vite-plugin-kiru 0.30.0 → 0.31.0
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.
- package/dist/index.js +20 -20
- package/dist/server.d.ts +20 -0
- package/dist/server.js +6847 -0
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -3726,7 +3726,7 @@ minimatch.Minimatch = Minimatch;
|
|
|
3726
3726
|
minimatch.escape = escape;
|
|
3727
3727
|
minimatch.unescape = unescape2;
|
|
3728
3728
|
|
|
3729
|
-
// ../../node_modules/.pnpm/glob@
|
|
3729
|
+
// ../../node_modules/.pnpm/glob@12.0.0/node_modules/glob/dist/esm/glob.js
|
|
3730
3730
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
3731
3731
|
|
|
3732
3732
|
// ../../node_modules/.pnpm/lru-cache@11.2.2/node_modules/lru-cache/dist/esm/index.js
|
|
@@ -7741,7 +7741,7 @@ var PathScurryDarwin = class extends PathScurryPosix {
|
|
|
7741
7741
|
var Path = process.platform === "win32" ? PathWin32 : PathPosix;
|
|
7742
7742
|
var PathScurry = process.platform === "win32" ? PathScurryWin32 : process.platform === "darwin" ? PathScurryDarwin : PathScurryPosix;
|
|
7743
7743
|
|
|
7744
|
-
// ../../node_modules/.pnpm/glob@
|
|
7744
|
+
// ../../node_modules/.pnpm/glob@12.0.0/node_modules/glob/dist/esm/pattern.js
|
|
7745
7745
|
var isPatternList = (pl) => pl.length >= 1;
|
|
7746
7746
|
var isGlobList = (gl) => gl.length >= 1;
|
|
7747
7747
|
var Pattern = class _Pattern {
|
|
@@ -7906,7 +7906,7 @@ var Pattern = class _Pattern {
|
|
|
7906
7906
|
}
|
|
7907
7907
|
};
|
|
7908
7908
|
|
|
7909
|
-
// ../../node_modules/.pnpm/glob@
|
|
7909
|
+
// ../../node_modules/.pnpm/glob@12.0.0/node_modules/glob/dist/esm/ignore.js
|
|
7910
7910
|
var defaultPlatform2 = typeof process === "object" && process && typeof process.platform === "string" ? process.platform : "linux";
|
|
7911
7911
|
var Ignore = class {
|
|
7912
7912
|
relative;
|
|
@@ -7993,7 +7993,7 @@ var Ignore = class {
|
|
|
7993
7993
|
}
|
|
7994
7994
|
};
|
|
7995
7995
|
|
|
7996
|
-
// ../../node_modules/.pnpm/glob@
|
|
7996
|
+
// ../../node_modules/.pnpm/glob@12.0.0/node_modules/glob/dist/esm/processor.js
|
|
7997
7997
|
var HasWalkedCache = class _HasWalkedCache {
|
|
7998
7998
|
store;
|
|
7999
7999
|
constructor(store = /* @__PURE__ */ new Map()) {
|
|
@@ -8214,7 +8214,7 @@ var Processor = class _Processor {
|
|
|
8214
8214
|
}
|
|
8215
8215
|
};
|
|
8216
8216
|
|
|
8217
|
-
// ../../node_modules/.pnpm/glob@
|
|
8217
|
+
// ../../node_modules/.pnpm/glob@12.0.0/node_modules/glob/dist/esm/walker.js
|
|
8218
8218
|
var makeIgnore = (ignore, opts) => typeof ignore === "string" ? new Ignore([ignore], opts) : Array.isArray(ignore) ? new Ignore(ignore, opts) : ignore;
|
|
8219
8219
|
var GlobUtil = class {
|
|
8220
8220
|
path;
|
|
@@ -8541,7 +8541,7 @@ var GlobStream = class extends GlobUtil {
|
|
|
8541
8541
|
}
|
|
8542
8542
|
};
|
|
8543
8543
|
|
|
8544
|
-
// ../../node_modules/.pnpm/glob@
|
|
8544
|
+
// ../../node_modules/.pnpm/glob@12.0.0/node_modules/glob/dist/esm/glob.js
|
|
8545
8545
|
var defaultPlatform3 = typeof process === "object" && process && typeof process.platform === "string" ? process.platform : "linux";
|
|
8546
8546
|
var Glob = class {
|
|
8547
8547
|
absolute;
|
|
@@ -8741,7 +8741,7 @@ var Glob = class {
|
|
|
8741
8741
|
}
|
|
8742
8742
|
};
|
|
8743
8743
|
|
|
8744
|
-
// ../../node_modules/.pnpm/glob@
|
|
8744
|
+
// ../../node_modules/.pnpm/glob@12.0.0/node_modules/glob/dist/esm/has-magic.js
|
|
8745
8745
|
var hasMagic = (pattern, options = {}) => {
|
|
8746
8746
|
if (!Array.isArray(pattern)) {
|
|
8747
8747
|
pattern = [pattern];
|
|
@@ -8753,7 +8753,7 @@ var hasMagic = (pattern, options = {}) => {
|
|
|
8753
8753
|
return false;
|
|
8754
8754
|
};
|
|
8755
8755
|
|
|
8756
|
-
// ../../node_modules/.pnpm/glob@
|
|
8756
|
+
// ../../node_modules/.pnpm/glob@12.0.0/node_modules/glob/dist/esm/index.js
|
|
8757
8757
|
function globStreamSync(pattern, options = {}) {
|
|
8758
8758
|
return new Glob(pattern, options).streamSync();
|
|
8759
8759
|
}
|
|
@@ -9058,36 +9058,36 @@ var dist_default = `<!DOCTYPE html>
|
|
|
9058
9058
|
<link rel="icon" type="image/svg+xml" href="./favicon.svg" />
|
|
9059
9059
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
9060
9060
|
<title>Kiru Devtools</title>
|
|
9061
|
-
<script type="module" crossorigin>(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();const Gc="production",fe=Gc==="development",Na=Symbol.for("kiru.signal"),Zc=Symbol.for("kiru.context"),Ni=Symbol.for("kiru.contextProvider"),Xe=Symbol.for("kiru.fragment"),Fa=Symbol.for("kiru.error"),za=Symbol.for("kiru.memo"),Js=Symbol.for("kiru.errorBoundary"),Qc=Symbol.for("kiru.suspenseThrow"),Jc=Symbol.for("kiru.devFileLink"),tu=50,mn="kiru:prefetched",ie=2,Mt=4,Fi=8,ae=16,Ha=32,ps=64,qe=128,eu=/^on:?/,Va=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"]),nu=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"]),iu=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"]]);function su(e){return typeof e=="string"||typeof e=="number"||typeof e=="bigint"||typeof e=="boolean"||e===void 0||e===null}const Ie={current:null},Ba={current:0},vt={current:"window"in globalThis?"dom":"string"},ou={current:"dynamic"};var Wa;class Ke extends Error{constructor(t){const n=typeof t=="string"?t:t.message;super(n),this[Wa]=!0,typeof t!="string"&&(this.fatal=t?.fatal)}static isKiruError(t){return t instanceof Error&&t[Fa]===!0}}Wa=Fa;const Ge={parentStack:[],childIdxStack:[],eventDeferrals:new Map,parent:function(){return this.parentStack[this.parentStack.length-1]},clear:function(){this.parentStack.length=0,this.childIdxStack.length=0},pop:function(){this.parentStack.pop(),this.childIdxStack.pop()},push:function(e){this.parentStack.push(e),this.childIdxStack.push(0)},currentChild:function(){return this.parentStack[this.parentStack.length-1].childNodes[this.childIdxStack[this.childIdxStack.length-1]]},nextChild:function(){return this.parentStack[this.parentStack.length-1].childNodes[this.childIdxStack[this.childIdxStack.length-1]++]},bumpChildIndex:function(){this.childIdxStack[this.childIdxStack.length-1]++},captureEvents:function(e){qo(e,!0),this.eventDeferrals.set(e,[])},resetEvents:function(e){this.eventDeferrals.delete(e)},releaseEvents:function(e){qo(e,!1);const t=this.eventDeferrals.get(e);for(;t?.length;)t.shift()()}},ru=e=>{const t=e.target;!e.isTrusted||!t||Ge.eventDeferrals.get(t)?.push(()=>t.dispatchEvent(e))},qo=(e,t)=>{for(const n in e)if(n.startsWith("on")){const i=n.substring(2);e[t?"addEventListener":"removeEventListener"](i,ru,{passive:!0})}};let to=!1,gs=!1;const ja=e=>{e.preventDefault(),e.stopPropagation(),gs=!0};let Ee=null;function au(){to=!0,Ee=document.activeElement,Ee&&Ee!==document.body&&Ee.addEventListener("blur",ja)}function lu(){gs&&(Ee.removeEventListener("blur",ja),Ee.isConnected&&Ee.focus(),gs=!1),to=!1}function ms(e,t){if(typeof e=="function"){e(t);return}if(W.isSignal(e)){e.sneak(t),e.notify({filter:n=>typeof n=="function"});return}e.current=t}function cu(e){const t=e.type;return t=="#text"?Ua(e):Va.has(t)?document.createElementNS("http://www.w3.org/2000/svg",t):document.createElement(t)}function Ua(e){const{nodeValue:t}=e.props;if(!W.isSignal(t))return document.createTextNode(t);const n=t.peek()??"",i=document.createTextNode(n);return xs(e,i,t),i}function uu(e,t,n){const i=bs.get(e)??{},s=i[t]=o=>{if(to){o.preventDefault(),o.stopPropagation();return}n(o)};return bs.set(e,i),s}const bs=new WeakMap;function $a(e){const t=e.dom,n=e.prev?.props??{},i=e.props??{},s=new Set([...Object.keys(n),...Object.keys(i)]),o=vt.current==="hydrate";s.forEach(r=>{const a=n[r],l=i[r];if(wi.internalProps.includes(r)&&r!=="innerHTML"){r==="ref"&&a!==l&&(a&&ms(a,null),l&&ms(l,t));return}if(wi.isEvent(r)){if(a!==l||vt.current==="hydrate"){const c=r.replace(eu,""),u=c==="focus"||c==="blur";r in n&&t.removeEventListener(c,u?bs.get(e)?.[c]:a),r in i&&t.addEventListener(c,u?uu(e,c,l):l)}return}if(!(t instanceof Text)){if(a===l||o&&t.getAttribute(r)===l)return;if(W.isSignal(a)&&e.cleanups){const c=e.cleanups[r];c&&(c(),delete e.cleanups[r])}if(W.isSignal(l))return pu(e,t,r,l,a);gi(t,r,l,a);return}W.isSignal(l)||t.nodeValue!==l&&(t.nodeValue=l)})}function hu(e){return e.multiple?Array.from(e.selectedOptions).map(t=>t.value):e.value}function Ya(e,t){if(!e.multiple||t===void 0||t===null||t===""){e.value=t;return}Array.from(e.options).forEach(n=>{n.selected=t.indexOf(n.value)>-1})}const fu={value:"input",checked:"change",open:"toggle",volume:"volumechange",playbackRate:"ratechange",currentTime:"timeupdate"},du=["progress","meter","number","range"];function pu(e,t,n,i,s){const o=e.cleanups??(e.cleanups={}),[r,a]=n.split(":");if(r!=="bind")return o[n]=i.subscribe((x,v)=>{gi(t,n,x,v)}),gi(t,n,i.peek(),Qe(s));const l=fu[a];if(!l)return;const c=t instanceof HTMLSelectElement,u=c?x=>Ya(t,x):x=>t[a]=x,f=x=>{u(x)},p=x=>{i.sneak(x),i.notify({filter:v=>v!==f})};let m;if(a==="value"){const x=du.indexOf(t.type)!==-1;m=()=>{let v=t.value;c?v=hu(t):typeof i.peek()=="number"&&x&&(v=t.valueAsNumber),p(v)}}else m=x=>{const v=x.target[a];a==="currentTime"&&i.peek()===v||p(v)};t.addEventListener(l,m);const y=i.subscribe(f);return o[n]=()=>{t.removeEventListener(l,m),y()},gi(t,a,i.peek(),Qe(s))}function xs(e,t,n){(e.cleanups??(e.cleanups={})).nodeValue=n.subscribe((i,s)=>{i!==s&&(t.nodeValue=i)})}function gu(e){if(e.type!=="#text"||!W.isSignal(e.props.nodeValue))return;const t=Qe(e.props.nodeValue);if(!su(t))return;const n=Ua(e),i=Ge.parent();return i&&i.appendChild(n),n}function mu(e){const t=Ge.nextChild()??gu(e);if(!t)throw new Ke({message:"Hydration mismatch - no node found",vNode:e});let n=t.nodeName;if(Va.has(n)||(n=n.toLowerCase()),e.type!==n)throw new Ke({message:\`Hydration mismatch - expected node of type \${e.type.toString()} but received \${n}\`,vNode:e});if(e.dom=t,e.type!=="#text"&&!(e.flags&ae)){$a(e);return}W.isSignal(e.props.nodeValue)&&xs(e,t,e.props.nodeValue);let i=e,s=e.sibling;for(;s&&s.type==="#text";){const o=s;Ge.bumpChildIndex();const r=String(Qe(i.props.nodeValue)??""),a=i.dom.splitText(r.length);o.dom=a,W.isSignal(o.props.nodeValue)&&xs(o,a,o.props.nodeValue),i=s,s=s.sibling}}function Xa(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 bu(e,t,n){const i=nu.has(t);Xa(e,t,n,i)||e.setAttribute(t,i&&typeof n=="boolean"?"":String(n))}const xu=["INPUT","TEXTAREA"],yu=e=>xu.indexOf(e.nodeName)>-1;function gi(e,t,n,i){if(n!==i)switch(t){case"style":return wu(e,n,i);case"className":return _u(e,n);case"innerHTML":return vu(e,n);case"muted":e.muted=!!n;return;case"value":if(e.nodeName==="SELECT")return Ya(e,n);const s=n==null?"":String(n);if(yu(e)){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 bu(e,Uu(t),n)}}function vu(e,t){if(t==null||typeof t=="boolean"){e.innerHTML="";return}e.innerHTML=String(t)}function _u(e,t){const n=Qe(t);if(!n)return e.removeAttribute("class");e.setAttribute("class",n)}function wu(e,t,n){if(Xa(e,"style",t))return;if(typeof t=="string"){e.setAttribute("style",t);return}let i={};typeof n=="string"?e.setAttribute("style",""):typeof n=="object"&&n&&(i=n);const s=t;new Set([...Object.keys(i),...Object.keys(s)]).forEach(r=>{const a=i[r],l=s[r];if(a!==l){if(l===void 0){e.style[r]="";return}e.style[r]=l}})}function Su(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 Ke({message:"No DOM parent found while attempting to place node.",vNode:e})}return t}function ku(e,t){const{node:n,lastChild:i}=t,s=e.dom;if(i){i.after(s);return}const o=qa(e,n);if(o){n.dom.insertBefore(s,o);return}n.dom.appendChild(s)}function qa(e,t){let n=e;for(;n;){let i=n.sibling;for(;i;){if(!(i.flags&(Mt|ae))){const s=Tu(i);if(s?.isConnected)return s}i=i.sibling}if(n=n.parent,!n||n.flags&ae||n===t)return}}function Tu(e){let t=e;for(;t;){if(t.dom)return t.dom;if(t.flags&ae)return;t=t.child}}function Mu(e){if(vt.current==="hydrate")return zi(e,Si);const t={node:e.dom?e:Su(e)};ys(e,t,(e.flags&Mt)>0),e.dom&&!(e.flags&ae)&&Ka(e,t,!1),Si(e)}function ys(e,t,n){let i=e.child;for(;i;){if(i.flags&ps){i.flags&Mt&&Cu(i,t),Si(i),i=i.sibling;continue}i.dom?(ys(i,{node:i},!1),i.flags&ae||Ka(i,t,n)):ys(i,t,(i.flags&Mt)>0||n),Si(i),i=i.sibling}}function Ka(e,t,n){(n||!e.dom.isConnected||e.flags&Mt)&&ku(e,t),(!e.prev||e.flags&ie)&&$a(e),t.lastChild=e.dom}function Eu(e){e===e.parent?.child&&(e.parent.child=e.sibling),zi(e,t=>{const{hooks:n,subs:i,cleanups:s,dom:o,props:{ref:r}}=t;for(i?.forEach(a=>a()),s&&Object.values(s).forEach(a=>a());n?.length;)n.pop().cleanup?.();o&&(r&&ms(r,null),o.isConnected&&!(t.flags&ae)&&o.remove(),delete t.dom)}),e.parent=null}function Cu(e,t){if(!e.child)return;const n=[];if(Ga(e.child,n),n.length===0)return;const{node:i,lastChild:s}=t;if(s)s.after(...n);else{const o=qa(e,i),r=i.dom;o?o.before(...n):r.append(...n)}t.lastChild=n[n.length-1]}function Ga(e,t){let n=e;for(;n;)n.dom?t.push(n.dom):n.child&&Ga(n.child,t),n=n.sibling}function Ou(e){return typeof e=="function"&&typeof e[za]?.arePropsEqual=="function"}function g(e,t=null,...n){if(e===dt)return dt({children:n,...t});const i={type:e,flags:0,index:0,depth:0,props:{},parent:null,sibling:null,child:null,prev:null,deletions:null};if(Ou(e)&&(i.flags|=Ha,i.arePropsEqual=e[za].arePropsEqual),t!==null){const{key:o,ref:r,...a}=t;Qu(o)&&(i.props.key=o.toString()),Ju(r)&&(i.props.ref=r),Object.assign(i.props,a)}const s=n.length===1?n[0]:n.length>1?n:null;return s!==null&&(i.props.children=s),i}function dt({children:e,key:t}){return g(Xe,t?{key:t}:null,e)}function eo(e,t){return Array.isArray(t)?Du(e,t):Pu(e,t)}function Pu(e,t){const n=e.child;if(n===null)return Ja(e,t);const i=n.sibling,s=Za(e,n,t);if(s!==null)return n&&n!==s&&!s.prev?vs(e,n):i&&vs(e,i),s;{const o=nl(n),r=tl(o,e,0,t);if(r!==null){const a=r.prev;if(a!==null){const l=a.props.key;o.delete(l===void 0?a.index:l)}mi(r,0,0)}return o.forEach(a=>vi(e,a)),r}}function Du(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;const c=Za(e,s,t[a]);if(c===null){s===null&&(s=o);break}s&&!c.prev&&vi(e,s),r=mi(c,r,a),i===null?n=c:i.sibling=c,i=c,s=o}if(a===t.length)return vs(e,s),n;if(s===null){for(;a<t.length;a++){const c=Ja(e,t[a]);c!==null&&(r=mi(c,r,a),i===null?n=c:i.sibling=c,i=c)}return n}const l=nl(s);for(;a<t.length;a++){const c=tl(l,e,a,t[a]);if(c!==null){const u=c.prev;if(u!==null){const f=u.props.key;l.delete(f===void 0?u.index:f)}r=mi(c,r,a),i===null?n=c:i.sibling=c,i=c}}return l.forEach(c=>vi(e,c)),n}function Za(e,t,n){const i=t?.props.key;return io(n)?i!==void 0||t?.type==="#text"&&W.isSignal(t.props.nodeValue)?null:Ko(e,t,""+n):W.isSignal(n)?t&&t.props.nodeValue!==n?null:Ko(e,t,n):no(n)?n.props.key!==i?null:Au(e,t,n):Array.isArray(n)?i!==void 0?null:Qa(e,t,n):null}function Ko(e,t,n){if(t===null||t.type!=="#text"){const s=g("#text",{nodeValue:n});return zt(s,e),s}return t.props.nodeValue!==n&&(t.props.nodeValue=n,t.flags|=ie),t.sibling=null,t}function Au(e,t,n){let{type:i,props:s}=n;if(i===Xe)return Qa(e,t,s.children||[],s);if(t?.type===i)return t.index=0,t.sibling=null,typeof i=="string"?el(t.props,s)&&(t.flags|=ie):t.flags|=ie,t.props=s,t.memoizedProps=n.memoizedProps,t;const o=g(i,s);return zt(o,e),o}function Qa(e,t,n,i={}){if(t===null||t.type!==Xe){const s=g(Xe,{children:n,...i});return zt(s,e),s}return t.props={...t.props,...i,children:n},t.flags|=ie,t.sibling=null,t}function Ja(e,t){if(io(t)){const n=g("#text",{nodeValue:""+t});return zt(n,e),n}if(W.isSignal(t)){const n=g("#text",{nodeValue:t});return zt(n,e),n}if(no(t)){const n=g(t.type,t.props);return zt(n,e),n.flags|=Mt,n}if(Array.isArray(t)){const n=dt({children:t});return zt(n,e),n}return null}function mi(e,t,n){e.index=n;const i=e.prev;if(i!==null){const s=i.index;return s<t?(e.flags|=Mt,t):s}else return e.flags|=Mt,t}function tl(e,t,n,i){if(W.isSignal(i)||io(i)){const o=e.get(n);if(o){if(o.props.nodeValue===i)return o;o.type==="#text"&&W.isSignal(o.props.nodeValue)&&o.cleanups?.nodeValue?.()}const r=g("#text",{nodeValue:i});return zt(r,t),r.flags|=Mt,r.index=n,r}if(no(i)){const{type:o,props:r}=i,a=r.key,l=e.get(a===void 0?n:a);if(l?.type===o)return typeof o=="string"?el(l.props,r)&&(l.flags|=ie):l.flags|=ie,l.props=r,l.sibling=null,l.index=n,l;const c=g(i.type,i.props);return zt(c,t),c.flags|=Mt,c.index=n,c}if(Array.isArray(i)){const o=e.get(n);if(o)return o.flags|=ie,o.props.children=i,o;const r=dt({children:i});return zt(r,t),r.flags|=Mt,r.index=n,r}return null}function el(e,t){const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!0;for(let s of n)if(!(s==="children"||s==="key")&&e[s]!==t[s])return!0;return!1}function zt(e,t){e.parent=t,e.depth=t.depth+1}function nl(e){const t=new Map;for(;e;){const n=e.props.key;t.set(n===void 0?e.index:n,e),e=e.sibling}return t}function vi(e,t){e.deletions===null?e.deletions=[t]:e.deletions.push(t)}function vs(e,t){for(;t;)vi(e,t),t=t.sibling}let Xt=[],Ze=!1,_s=[],ws=[],Ss=!1,ks=!1,Ts=!1,Ms=0,il=[],Es=[],sl=-1;function Iu(e){if(Ze){_s.push(e);return}e()}function ol(){Ze&&(window.cancelAnimationFrame(sl),rl())}function Go(e){e.flags|=qe,Xt.push(e),Ze=!0,ol()}function on(e){if(vt.current==="hydrate")return Iu(()=>Cs(e));Cs(e)}function Lu(){Ze||(Ze=!0,sl=window.requestAnimationFrame(rl))}function Ru(){for(Ze=!1;_s.length;)_s.shift()()}function Cs(e){if(Ss&&(ks=!0),Ie.current===e){Ts=!0;return}if(!(e.flags&(qe|Fi))){if(e.flags|=qe,!Xt.length)return Xt.push(e),Lu();Xt.push(e)}}function Nu(e){zi(e,t=>t.flags|=Fi),ws.push(e)}const Fu=(e,t)=>t.depth-e.depth;let te=null;function rl(){let e=1;for(au();Xt.length;){Xt.length>e&&Xt.sort(Fu),te=Xt.shift(),e=Xt.length;const t=te.flags;if(!(t&Fi)&&t&qe){let n=te;for(;n=zu(n););for(;ws.length;)Eu(ws.pop());Mu(te),te.flags&=~qe}}if(lu(),Ss=!0,ts(il),Ss=!1,ks)return Wu(),ts(Es),ks=!1,Ms++,ol();Ms=0,Ru(),ts(Es)}function zu(e){let t=!0;try{typeof e.type=="string"?Bu(e):Yu(e.type)?Hu(e):t=Vu(e)}catch(i){const s=Zu(e);if(s){const o=s.error=i instanceof Error?i:new Error(String(i));return s.props.onError?.(o),s.depth<te.depth&&(te=s),s}if(Ke.isKiruError(i)){if(i.customNodeStack&&setTimeout(()=>{throw new Error(i.customNodeStack)}),i.fatal)throw i;console.error(i);return}setTimeout(()=>{throw i})}if(e.deletions!==null&&(e.deletions.forEach(Nu),e.deletions=null),t&&e.child)return e.child;let n=e;for(;n;){if(n.immediateEffects&&(il.push(...n.immediateEffects),n.immediateEffects=void 0),n.effects&&(Es.push(...n.effects),n.effects=void 0),n===te)return;if(n.sibling)return n.sibling;n=n.parent,vt.current==="hydrate"&&n?.dom&&Ge.pop()}}function Hu(e){const{props:t,type:n}=e;let i=t.children;if(n===Ni){const{props:{dependents:s,value:o},prev:r}=e;s.size&&r&&r.props.value!==o&&s.forEach(Cs)}else if(n===Js){const s=e,{error:o}=s;o&&(i=typeof t.fallback=="function"?t.fallback(o):t.fallback,delete s.error)}e.child=eo(e,i)}function Vu(e){const{type:t,props:n,subs:i,prev:s,flags:o}=e;if(o&Ha){if(e.memoizedProps=n,s?.memoizedProps&&e.arePropsEqual(s.memoizedProps,n)&&!e.hmrUpdated)return e.flags|=ps,!1;e.flags&=~ps}try{Ie.current=e;let r,a=0;do e.flags&=~qe,Ts=!1,Ba.current=0,i&&(i.forEach(l=>l()),i.clear()),r=t(n);while(Ts);return e.child=eo(e,r),!0}finally{Ie.current=null}}function Bu(e){const{props:t,type:n}=e;e.dom||(vt.current==="hydrate"?mu(e):e.dom=cu(e)),n!=="#text"&&(e.child=eo(e,t.children),e.child&&vt.current==="hydrate"&&Ge.push(e.dom))}function Wu(){if(Ms>tu)throw new Ke("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 ts(e){for(let t=0;t<e.length;t++)e[t]();e.length=0}var Zo;(function(e){e.Start="start",e.End="end"})(Zo||(Zo={}));const de=()=>{const e=al("useRequestUpdate");return()=>on(e)};function wt(e,t,n){const i=al(e),s=(a,l)=>{if(l?.immediate){(i.immediateEffects??(i.immediateEffects=[])).push(a);return}(i.effects??(i.effects=[])).push(a)},o=Ba.current++;let r=i.hooks?.at(o);try{const a=r??(typeof t=="function"?t():{...t});return i.hooks??(i.hooks=[]),i.hooks[o]=a,n({hook:a,isInit:!r,update:()=>on(i),queueEffect:s,vNode:i,index:o})}catch(a){throw a}}function al(e){const t=Ie.current;if(!t)throw new Ke(\`Hook "\${e}" must be used at the top level of a component or inside another composite hook.\`);return t}function Hn(e){e.cleanup&&(e.cleanup(),e.cleanup=void 0)}function Re(e,t){return e===void 0||t===void 0||e.length!==t.length||e.length>0&&t.some((n,i)=>!Object.is(n,e[i]))}const Os={stack:new Array,current:function(){return this.stack[this.stack.length-1]}},je=new Map;var ll;class W{constructor(t,n){this[ll]=!0,this.$id=eh(),this.$value=t,n&&(this.displayName=n),this.$subs=new Set}get value(){return this.onBeforeRead?.(),W.entangle(this),this.$value}set value(t){Object.is(this.$value,t)||(this.$prevValue=this.$value,this.$value=t,this.notify())}peek(){return this.onBeforeRead?.(),this.$value}sneak(t){this.$prevValue=this.$value,this.$value=t}toString(){return this.onBeforeRead?.(),W.entangle(this),\`\${this.$value}\`}subscribe(t){return this.$subs.add(t),()=>this.$subs.delete(t)}notify(t){this.$subs.forEach(n=>{if(!(t?.filter&&!t.filter(n)))return n(this.$value,this.$prevValue)})}static isSignal(t){return typeof t=="object"&&!!t&&Na in t}static subscribers(t){return t.$subs}static makeReadonly(t){const n=Object.getOwnPropertyDescriptor(t,"value");return n&&!n.writable?t:Object.defineProperty(t,"value",{get:function(){return W.entangle(this),this.$value},configurable:!0})}static makeWritable(t){const n=Object.getOwnPropertyDescriptor(t,"value");return n&&n.writable?t:Object.defineProperty(t,"value",{get:function(){return W.entangle(this),this.$value},set:function(i){this.$value=i,this.notify()},configurable:!0})}static entangle(t){const n=Ie.current,i=Os.current();if(i){(!n||n&&Et())&&i.set(t.$id,t);return}if(!n||!Et())return;const s=t.subscribe(()=>on(n));(n.subs??(n.subs=new Set)).add(s)}static configure(t,n){t.onBeforeRead=n}static dispose(t){t.$isDisposed=!0,t.$subs.clear()}}ll=Na;const K=(e,t)=>new W(e,t),J=(e,t)=>wt("useSignal",{signal:null},({hook:n,isInit:i,isHMR:s})=>(i&&(n.cleanup=()=>W.dispose(n.signal),n.signal=new W(e,t)),n.signal));function Qe(e,t=!1){return W.isSignal(e)?t?e.value:e.peek():e}const ju=()=>{je.forEach(e=>e()),je.clear()};function _i(...e){return e.filter(Boolean).join(" ")}const wi={internalProps:["children","ref","key","innerHTML"],isEvent:e=>e.startsWith("on"),isProperty:e=>!wi.internalProps.includes(e)&&!wi.isEvent(e)};function Uu(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():iu.get(e)||e}}function Et(){return vt.current==="dom"||vt.current==="hydrate"}function $u(e){return(e.flags&Fi)!==0}function no(e){return typeof e=="object"&&e!==null&&"type"in e}function io(e){return typeof e=="string"&&e!==""||typeof e=="number"||typeof e=="bigint"}function Yu(e){return e===Xe||e===Ni||e===Js}function Xu(e){return e.type===Xe}function qu(e){return typeof e.type=="function"&&"displayName"in e.type&&e.type.displayName==="Kiru.lazy"}function Ku(e){return typeof e.type=="function"&&"displayName"in e.type&&e.type.displayName==="Kiru.memo"}function Si(e){const{props:{children:t,...n},memoizedProps:i,index:s}=e;e.prev={props:n,memoizedProps:i,index:s},e.flags&=-15}function zi(e,t){t(e);let n=e.child;for(;n;)t(n),n.child&&zi(n,t),n=n.sibling}function Gu(e,t){let n=e.parent;for(;n;){if(t(n))return n;n=n.parent}return null}function Zu(e){return Gu(e,t=>t.type===Js)}function Qu(e){return typeof e=="string"||typeof e=="number"}function Ju(e){return typeof e=="function"||typeof e=="object"&&!!e&&"current"in e||W.isSignal(e)}const th="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz-";function eh(e=10,t=th){let n="";for(let i=0;i<e;i++)n+=t[Math.random()*t.length|0];return n}const Qo=Object.freeze(()=>{});function nh(){const 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)}const o={get apps(){return Array.from(e)},emit:n,on:i,off:s};return i("mount",r=>e.add(r)),i("unmount",r=>e.delete(r)),o}function ih(e){const{id:t,subs:n,fn:i,deps:s=[],onDepChanged:o}=e;let r;je.delete(t);const a=!!Ie.current&&!Et();a||(r=new Map,Os.stack.push(r));const l=i(...s.map(c=>c.value));if(!a){for(const[u,f]of n)r.has(u)||(f(),n.delete(u));const c=()=>{je.size||queueMicrotask(ju),je.set(t,o)};for(const[u,f]of r){if(n.has(u))continue;const p=f.subscribe(c);n.set(u,p)}Os.stack.pop()}return l}class We extends W{constructor(t,n){super(void 0,n),this.$getter=t,this.$unsubs=new Map,this.$isDirty=!0,W.configure(this,()=>{this.$isDirty&&We.run(this)})}get value(){return super.value}set value(t){}subscribe(t){return this.$isDirty&&We.run(this),super.subscribe(t)}static dispose(t){We.stop(t),W.dispose(t)}static stop(t){const{$id:n,$unsubs:i}=t;je.delete(n),i.forEach(s=>s()),i.clear(),t.$isDirty=!0}static run(t){const n=t,{$id:i,$getter:s,$unsubs:o}=n,r=ih({id:i,subs:o,fn:()=>s(n.$value),onDepChanged:()=>{n.$isDirty=!0,t.$subs.size&&(We.run(n),!Object.is(n.$value,n.$prevValue)&&n.notify())}});n.sneak(r),n.$isDirty=!1}}const Vn=(e,t)=>new We(e,t);function Jo({from:e,children:t}){const n=(Array.isArray(e)?e:[e]).map(i=>i.value);return t(...n)}let sh=0;function oh(e,t,n){const i=g(t.nodeName.toLowerCase(),{});i.dom=t,i.flags|=ae;const s=sh++,o=\`App-\${s}\`,r={id:s,name:o,rootNode:i,render:a,unmount:l};function a(c){i.props.children=c,Go(i)}function l(){i.props.children=null,Go(i),window.__kiru.emit("unmount",r)}return a(e),window.__kiru.emit("mount",r),r}function pe(e){return Et()?wt("useState",{state:void 0,dispatch:Qo},({hook:t,isInit:n,update:i,isHMR:s})=>(n&&(t.state=typeof e=="function"?e():e,t.dispatch=o=>{const r=typeof o=="function"?o(t.state):o;Object.is(t.state,r)||(t.state=r,i())}),[t.state,t.dispatch])):[typeof e=="function"?e():e,Qo]}function rh(e){const t={[Zc]:!0,Provider:({value:n,children:i})=>{const[s]=pe(()=>new Set);return g(Ni,{value:n,ctx:t,dependents:s},typeof i=="function"?i(n):i)},default:()=>e,set displayName(n){this.Provider.displayName=n},get displayName(){return this.Provider.displayName||"Anonymous Context"}};return t}function Ue(e,t){return Et()?wt("useCallback",{callback:e,deps:t},({hook:n,isHMR:i})=>(Re(t,n.deps)&&(n.deps=t,n.callback=e),n.callback)):e}function ah(e,t=!0){return wt("useContext",{context:e,warnIfNotFound:t},lh)}const lh=({hook:e,isInit:t,vNode:n})=>{if(t){let i=n.parent;for(;i;){if(i.type===Ni){const s=i,{ctx:o,value:r,dependents:a}=s.props;if(o===e.context)return a.add(n),e.cleanup=()=>a.delete(n),e.provider=s,r}i=i.parent}}return e.provider?e.provider.props.value:e.context.default()};function rt(e,t){if(Et())return wt("useEffect",{deps:t},({hook:n,isInit:i,isHMR:s,queueEffect:o})=>{(i||Re(t,n.deps))&&(n.deps=t,Hn(n),o(()=>{const r=e();typeof r=="function"&&(n.cleanup=r)}))})}function cl(){return wt("useId",ch,uh)}const ch=()=>({id:"",idx:0}),uh=({hook:e,isInit:t,vNode:n})=>{if(t||n.index!==e.idx){e.idx=n.index;const i=[];let s=n;for(;s;)i.push(s.index),i.push(s.depth),s=s.parent;e.id=\`k:\${BigInt(i.join("")).toString(36)}\`}return e.id};function so(e,t){if(Et())return wt("useLayoutEffect",{deps:t},({hook:n,isInit:i,isHMR:s,queueEffect:o})=>{(i||Re(t,n.deps))&&(n.deps=t,Hn(n),o(()=>{const r=e();typeof r=="function"&&(n.cleanup=r)},{immediate:!0}))})}function ki(e,t){return Et()?wt("useMemo",{deps:t,value:void 0},({hook:n,isInit:i,isHMR:s})=>((i||Re(t,n.deps))&&(n.deps=t,n.value=e()),n.value)):e()}const tr=new WeakMap;function hh(e,t){const n=cl(),i=J(!0);return wt("usePromise",{},({hook:s,isInit:o,vNode:r})=>{if(o||Re(t,s.deps)){i.value=!0,s.deps=t,Hn(s);const a=s.abortController=new AbortController;s.cleanup=()=>a.abort();const l=tr.get(r)??0;tr.set(r,l+1);const c=\`\${n}:data:\${l}\`;let u;vt.current==="string"?u=Promise.resolve():vt.current==="hydrate"&&ou.current==="dynamic"?u=fh(c,a.signal):u=e({signal:a.signal});const f={id:c,state:"pending"},p=s.promise=Object.assign(u,f);p.then(m=>{p.state="fulfilled",p.value=m}).catch(m=>{p.state="rejected",p.error=m instanceof Error?m:new Error(m)}).finally(()=>{i.value=!1})}return{data:s.promise,refresh:()=>{s.deps=void 0,on(r)},pending:i}})}function fh(e,t){return new Promise((n,i)=>{const s=window[mn]??(window[mn]=new Map),o=s.get(e);if(o){const{data:a,error:l}=o;return s.delete(e),l?i(l):n(a)}const r=a=>{const{detail:l}=a;if(l.id===e){s.delete(e),window.removeEventListener(mn,r);const{data:c,error:u}=l;if(u)return i(u);n(c)}};window.addEventListener(mn,r),t.addEventListener("abort",()=>{window.removeEventListener(mn,r),i()})})}function Je(e){return Et()?wt("useRef",{ref:{current:e}},({hook:t,isInit:n,isHMR:i})=>t.ref):{current:e}}"window"in globalThis&&(window.__KIRU_LAZY_CACHE??(window.__KIRU_LAZY_CACHE=new Map));function dh({data:e,children:t,fallback:n}){const i=Array.isArray(e)?e:[e];switch(vt.current){case"stream":case"string":throw{[Qc]:{fallback:n,pending:i}};case"dom":case"hydrate":for(const o of i){if(o.state==="rejected")throw o.error;if(o.state==="pending"){const r=Ie.current;return Promise.allSettled(i).then(()=>on(r)),n}}const s=i.map(o=>o.value);return t(...s)}}var er;"window"in globalThis&&!globalThis.__KIRU_DEVTOOLS__&&((er=globalThis.window).__kiru??(er.__kiru=nh()));function ph(...e){return e.filter(Boolean).join(" ")}function oo(e,t,n){let i=e;for(let s=0;s<t.length;s++){const o=t[s];s===t.length-1?i[o]=n:i=i[o]}}function ro(e){return e.type.displayName??(e.type.name||"Anonymous Function")}const gh=e=>e[Jc]??null;function In(e){return e.name==="kiru.devtools"}function ul(e){return Array.from(e.entries())}function mh(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"}))}function le(e){return 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",...e},g("path",{d:"m9 18 6-6-6-6"}))}function bh(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"}))}function xh(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"}))}function yh(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"}))}function vh(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"}))}function _h(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 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"}),g("path",{d:"M2 12h20"}))}function hl(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:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),g("path",{d:"M21 3v5h-5"}),g("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),g("path",{d:"M8 16H3v5"}))}function wh(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:"M22 8.35V20a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8.35A2 2 0 0 1 3.26 6.5l8-3.2a2 2 0 0 1 1.48 0l8 3.2A2 2 0 0 1 22 8.35Z"}),g("path",{d:"M6 18h12"}),g("path",{d:"M6 14h12"}),g("rect",{width:"12",height:"12",x:"6",y:"10"}))}function Sh(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("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),g("path",{d:"M8 12h8"}),g("path",{d:"m12 16 4-4-4-4"}))}function ao(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.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}),g("path",{d:"M12 9v4"}),g("path",{d:"M12 17h.01"}))}function fl({title:e,children:t,className:n,disabled:i,...s}){const[o,r]=pe(!0);rt(()=>{!o&&i&&r(!0)},[i]);const a=Ue(l=>{l.preventDefault(),l.stopImmediatePropagation(),r(c=>!c)},[]);return g("div",{className:"flex flex-col"},g("button",{onclick:a,disabled:i,className:\`\${i?"opacity-50 cursor-default":"cursor-pointer"}\`},g("span",{className:"flex items-center gap-2 font-medium"},g(le,{className:\`transition \${o?"":"rotate-90"}\`}),e)),o?null:g("div",{className:\`p-2 \${n||""}\`,...s},t))}const lo={arrayChunkSize:10,objectKeysChunkSize:100};function dl(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;const n=new Set([...Object.keys(e),...Object.keys(t)]);for(const i in n)if(typeof t[i]!=typeof e[i]||typeof e[i]=="object"&&!dl(e[i],t[i]))return!1;return!0}function pl(e,t,n){for(const i in t)typeof e[i]>"u"&&(e[i]=structuredClone(t[i]));for(const i in e)typeof e[i]=="object"?pl(e[i],t[i],n):n(e,i,e[i])}let gl={...lo};const nr=localStorage.getItem("kiru.devtools.userSettings");if(nr)try{const e=JSON.parse(nr);dl(lo,e)&&(gl=e)}catch(e){console.error("kiru.devtools.userSettings error",e)}const ml=rh({userSettings:null,saveUserSettings:()=>{}}),Hi=()=>ah(ml);function kh({children:e}){const[t,n]=pe(gl),i=s=>{localStorage.setItem("kiru.devtools.userSettings",JSON.stringify(s)),n(s)};return g(ml.Provider,{value:{userSettings:t,saveUserSettings:i}},e)}function Th(){const{userSettings:e,saveUserSettings:t}=Hi();return g("div",{className:"rounded bg-neutral-400 bg-opacity-5 border border-white border-opacity-10 overflow-hidden"},g(ge,{border:!1,data:e,onChange:(n,i)=>{const s={...e};oo(s,n,i),pl(s,lo,(o,r,a)=>{o[r]=a<1?1:a}),t(s)},mutable:!0,objectRefAcc:[]}))}const Mh=Object.freeze(()=>{});function ge({data:e,onChange:t,mutable:n,objectRefAcc:i,keys:s=[],className:o,border:r=!0}){const{userSettings:{objectKeysChunkSize:a}}=Hi(),[l,c]=pe(0),u=ki(()=>Object.keys(e).slice(0,(l+1)*a),[l,a,e]),f=()=>{u.forEach(m=>{typeof e[m]=="object"&&i.splice(i.indexOf(e[m]),1)}),c(l+1)},p=u.length<Object.keys(e).length;return g(dt,null,g("div",{className:ph("flex flex-col items-start w-full",r&&"border border-neutral-700",Qe(o))},u.map(m=>{const y=s.concat(m),x=y.join(".");return g("div",{key:x,"data-key":x,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(co,{value:e[m],onChange:t,keys:y,path:x,label:m,mutable:n,objectRefAcc:i}))})),p&&g("button",{onclick:f,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 Ti(e,t){Array.isArray(e)?(t(e),e.forEach(n=>Ti(n,t))):typeof e=="object"&&e!==null&&(t(e),Object.values(e).forEach(n=>Ti(n,t)))}function co({value:e,onChange:t,keys:n,path:i,mutable:s,objectRefAcc:o,label:r}){const{userSettings:{arrayChunkSize:a}}=Hi(),[l,c]=pe(!0),u=r!==void 0&&g("label",{htmlFor:i,className:"text-xs truncate",title:i,children:r});if(e===null)return g(bt,null,u,g(Qt,null,"null"));if(e===void 0)return g(bt,null,u,g(Qt,null,"undefined"));const f=window.opener?window.opener.Node:Node;if(e instanceof f)return g(bt,null,u,g(Qt,null,"<",g("span",{style:{color:"#f0a05e"}},e.nodeName),"/>"));const p=window.opener?window.opener.Error:Error;if(e instanceof p)return g(bt,null,u,"cause"in e&&e.cause?g(Qt,null,e.message," (",String(e.cause),")"):g(Qt,null,e.message));const m=y=>t(n,y);switch(typeof e){case"string":return g(bt,null,u,g(es,{disabled:!s,id:i,type:"text",value:e,onchange:y=>m(y.target.value)}));case"number":return g(bt,null,u,g(es,{disabled:!s,id:i,type:"number",value:e,placeholder:"NaN",onchange:y=>m(Number(y.target.value))}));case"bigint":return g(bt,null,u,g(es,{disabled:!s,id:i,type:"number",value:e.toString(),onchange:y=>m(BigInt(y.target.value))}));case"boolean":return g(bt,null,u,g("input",{disabled:!s,id:i,type:"checkbox",checked:e,onchange:y=>m(y.target.checked),className:"accent-red-500"}));case"function":return g(bt,null,u,g(Qt,null,\`\u0192 \${e.name||"anonymous"}()\`));default:return Array.isArray(e)?g(bt,null,g("button",{className:"text-xs flex items-center gap-1 cursor-pointer w-full",title:i,onclick:()=>{Ti(e,y=>o.splice(o.indexOf(y),1)),c(y=>!y)}},r,g(le,{width:10,height:10,className:\`transition \${l?"":"rotate-90"}\`})),l?g(Qt,null,"Array(",e.length,")"):e.length>a?g(Eh,{array:e,objectRefAcc:o}):g("div",{className:"flex flex-col items-start gap-1 w-full"},e.map((y,x)=>g(co,{value:y,onChange:t,keys:[...n,x.toString()],path:i.concat(".",x.toString()),label:x.toString(),mutable:s,objectRefAcc:o})))):o.includes(e)?g(bt,null,u,g(Qt,null,"Object(circular reference)")):(o.push(e),g(bt,null,g("button",{className:"text-xs flex items-center gap-1 cursor-pointer w-full",title:i,onclick:()=>{Ti(e,y=>o.splice(o.indexOf(y),1)),c(y=>!y)}},r,g(le,{width:10,height:10,className:\`transition \${l?"":"rotate-90"}\`})),l?null:g(ge,{data:e,onChange:t,keys:n,mutable:s,objectRefAcc:o})))}}function bt({children:e}){return g("div",{className:"flex flex-col items-start gap-1 w-full"},e)}function es(e){return g("input",{className:"flex-grow text-xs px-2 py-1 text-neutral-300 w-full",...e})}function Qt({children:e}){return g("small",{className:"text-neutral-300"},g("i",null,e))}function Eh({array:e,objectRefAcc:t}){const{userSettings:{arrayChunkSize:n}}=Hi(),i=e.length,s=Math.ceil(i/n);return g("div",{className:"flex flex-col items-start gap-1 w-full"},Array.from({length:s}).map((o,r)=>g(Ch,{array:e,range:{start:r*n,end:(r+1)*n},objectRefAcc:t})))}function Ch({array:e,range:t,objectRefAcc:n}){const[i,s]=pe(!0);let o;return i?o=void 0:o=e.slice(t.start,t.end),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:()=>{n.splice(n.indexOf(e),1),s(r=>!r)}},"[",t.start,"..",(t.end<e.length?t.end:e.length)-1,"]",g(le,{width:10,height:10,className:\`transition \${i?"":"rotate-90"}\`})),o&&g("div",{className:"flex flex-col items-start gap-1 w-full"},o.map((r,a)=>g(co,{value:r,onChange:Mh,label:(t.start+a).toString(),keys:[a.toString()],path:a.toString(),mutable:!1,objectRefAcc:n}))))}const Oh="kiru-devtools";"window"in globalThis&&(window.__devtoolsSelection??=null);class Ph extends BroadcastChannel{send(t){super.postMessage(t)}removeEventListener(t){return super.removeEventListener("message",t)}addEventListener(t){return super.addEventListener("message",t)}}const tn=new Ph(Oh);function Vi({fn:e,onclick:t}){const n=ki(()=>gh(e),[e]);return n?g("a",{className:"flex items-center gap-1 text-[10px] opacity-50 hover:opacity-100 transition-opacity",href:n,onclick:i=>{i.preventDefault(),tn.send({type:"open-editor",fileLink:n}),t?.(i)},title:"Open in editor"},"Open in editor",g(xh,{width:"0.65rem",height:"0.65rem"})):null}function Dh({selectedApp:e,selectedNode:t,setSelectedNode:n,kiruGlobal:i}){const s=de();rt(()=>{const l=c=>{c===e&&($u(t)?n(null):s())};return i?.on("update",l),()=>i?.off("update",l)},[]);const o=()=>{t&&on(t)},r={...t.props};delete r.children;const a=Lh(t);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"},"<"+ro(t)+">",g(Vi,{fn:t.type})),g("button",{onclick:o},g(hl,{className:"w-5 h-5"}))),g(fl,{title:"props",disabled:Object.keys(r).length===0},g(ge,{data:r,onChange:()=>{},mutable:!1,objectRefAcc:[]})),g(bl,{node:a,selectedApp:e}))}function Ah(e){return e.name==="devtools:useHookDebugGroup"}function Ih(e){return Ps in e}const Ps=Symbol.for("devtools.hookGroup");function Lh(e){const t={parent:null,name:"hooks",children:[],[Ps]:!0};if(e.hooks?.length){let n=t;for(let i=0;i<e.hooks.length;i++){const s=e.hooks[i];if(Ah(s)){switch(s.action){case"start":const o={parent:n,name:s.displayName,children:[],[Ps]:!0};n.children.push(o),n=o;break;case"end":if(n.name!==s.displayName||n.parent===null)throw new Error("useHookDebugGroup:end called with no start");n=n.parent;break}continue}n.children.push(s)}}return t}function bl({node:e,selectedApp:t,depth:n=0}){if(Ih(e))return g(fl,{title:e.name,className:"bg-[#ffffff04] border border-[#fff1] flex flex-col gap-2 pl-6",disabled:e.children.length===0},e.children.map(u=>g(bl,{node:u,selectedApp:t,depth:n+1})));const{name:i,dev:s,cleanup:o,...r}=e,a=s?.devtools,l=typeof a?.get=="function"?a.get():r;return g("div",null,g("i",{className:"text-neutral-300 text-sm"},i||"anonymous hook"),g("div",{className:"p-2"},g(ge,{data:l,onChange:(u,f)=>{if(!t||!a?.set||!a?.get)return;const p=a.get();oo(p,u,f),a.set(p)},mutable:!!a?.set,objectRefAcc:[]})))}const Pe=(e,t,n={})=>{rt(()=>{let i=window;const s=n?.ref?.();return s?i=s:n.ref&&console.warn("useEventListener ref failed, using window"),i.addEventListener(e,t,n),()=>{i.removeEventListener(e,t,n)}},[t])},Rh=()=>{const e=J({x:0,y:0}),t=J({x:0,y:0}),n=J({x:0,y:0});return Pe("mousemove",i=>{e.value={x:i.x,y:i.y},t.value={x:i.movementX,y:i.movementY},n.value={x:i.clientX,y:i.clientY}}),{mouse:e,delta:t,client:n}},Qn="window"in globalThis&&"ResizeObserver"in globalThis.window,Nh=(e,t,n=void 0)=>Et()?Qn?wt("useResizeObserver",{resizeObserver:null,deps:[e.current]},({isInit:i,hook:s,queueEffect:o})=>(i&&(s.resizeObserver=new ResizeObserver(t),s.cleanup=()=>{s.resizeObserver?.disconnect?.(),s.resizeObserver=null}),o(()=>{Re([e.current],s.deps)&&(s.deps=[e.current],s.resizeObserver?.disconnect?.(),e.current&&s.resizeObserver?.observe(e.current,n))}),{isSupported:Qn,start:()=>{s.resizeObserver==null&&(s.resizeObserver=new ResizeObserver(t),e.current&&s.resizeObserver.observe(e.current,n),s.cleanup=()=>{s.resizeObserver?.disconnect?.(),s.resizeObserver=null})},stop:()=>{Hn(s)}})):{isSupported:Qn,start:()=>{},stop:()=>{}}:{isSupported:Qn,start:()=>{},stop:()=>{}},Jn="window"in globalThis&&"MutationObserver"in globalThis.window,Fh=(e,t,n=void 0)=>Et()?Jn?wt("useMutationObserver",{mutationObserver:null,deps:[e.current]},({isInit:i,hook:s,queueEffect:o})=>(i?(o(()=>{s.deps=[e.current],s.mutationObserver=new MutationObserver(t),e.current&&s.mutationObserver.observe(e.current,n)}),s.cleanup=()=>{s.mutationObserver?.disconnect?.(),s.mutationObserver=null}):Re([e.current],s.deps)&&(s.deps=[e.current],s.mutationObserver?.disconnect?.(),e.current&&s.mutationObserver?.observe(e.current,n)),{isSupported:Jn,start:()=>{s.mutationObserver==null&&(s.mutationObserver=new MutationObserver(t),e.current&&s.mutationObserver.observe(e.current,n),s.cleanup=()=>{s.mutationObserver?.disconnect?.(),s.mutationObserver=null})},stop:()=>{Hn(s)}})):{isSupported:Jn,start:()=>{},stop:()=>{}}:{isSupported:Jn,start:()=>{},stop:()=>{}},zh=(e,t={windowScroll:!0,windowResize:!0})=>{const n=t?.windowScroll??!0,i=t?.windowResize??!0,s=t.immediate??!0,o=J(0),r=J(0),a=J(0),l=J(0),c=J(0),u=J(0),f=J(0),p=J(0),m=()=>{const y=e.current;if(!y){o.value=0,r.value=0,a.value=0,l.value=0,c.value=0,u.value=0,f.value=0,p.value=0;return}const x=y.getBoundingClientRect();o.value=x.width,r.value=x.height,a.value=x.top,l.value=x.right,c.value=x.bottom,u.value=x.left,f.value=x.x,p.value=x.y};return Nh(e,m),Fh(e,m,{attributeFilter:["style","class"]}),Pe("scroll",()=>{n&&m()},{capture:!0,passive:!0}),Pe("resize",()=>{i&&m()},{passive:!0}),so(()=>{s&&m()},[]),{width:o,height:r,top:a,right:l,bottom:c,left:u,x:f,y:p,update:m}};function Hh(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}const ir=(e,t,n={})=>{const{ref:i,eventName:s="keydown",passive:o=!1}=n,r=Hh(e);return Pe(s,l=>{l.repeat&&!n.repeat||r(l)&&t(l)},{ref:i,passive:o})};function uo({value:e,className:t,...n}){const i=cl();return g("div",{className:_i("w-full p-2 z-10","bg-[#1d1d1d] border border-white border-opacity-10 rounded",t?.toString()),...n},g("input",{className:_i("px-2 py-1 w-full rounded focus:outline focus:outline-primary","bg-[#212121] border border-white border-opacity-10 rounded"),placeholder:"Filter...",type:"text",autocomplete:i+Math.random().toString(36).substring(2,15),name:"filter-search",id:"filter-search","bind:value":e}))}let $;"window"in globalThis&&window.opener&&($=window.opener.__kiru);const $e=K(!1);tn.addEventListener(e=>{e.data.type==="set-inspect-enabled"&&($e.value=e.data.value)});const xl=($?.apps??[]).filter(e=>!In(e)),se=K(xl);K(null);const Nt=K(xl[0]??null),oe=K(null);$?.on("mount",e=>{In(e)||(se.value=[...se.peek(),e],Nt.peek()===null&&(Nt.value=e))});$?.on("unmount",e=>{se.value=se.peek().filter(t=>t!==e),Nt.peek()===e&&(Nt.value=se.peek()[0]??null)});const Ds=K(new Map),Ft=K(null),ho=K("");function Vh(e){return e.type.displayName??(e.type.name||"Anonymous Function")}function Bh(e,t){const n=t.toLowerCase();return e.every(i=>n.includes(i))}function As(e){return typeof e.type=="function"&&!Xu(e)&&!qu(e)&&!Ku(e)}function Wh(e){let t=[e];for(;t.length;){const n=t.pop();if(As(n))return!0;n.child&&t.push(n.child),n.sibling&&t.push(n.sibling)}return!1}const jh=(e,t)=>{const n=[t.parent];for(;n.length;){const i=n.pop();if(e===i)return!0;i?.parent&&n.push(i.parent)}return!1};function Is(e,t){if(!e)return null;const n=t(e),i=Is(e.sibling,t),s=Is(e.child,t);return n?{ref:e,sibling:i??null,child:s??null}:i||s||null}function Mi({node:e,traverseSiblings:t=!0}){const[n,i]=pe(!0),o=oe.value===e,r=ki(()=>crypto.randomUUID(),[]),a=ki(()=>Ft.value==null?null:jh(e,Ft.value),[Ft.value,e]);rt(()=>{a&&i(!1)},[a]),rt(()=>{if(!(!e||!As(e)))return Ds.peek().set(r,{vNode:e,setCollapsed:i}),()=>{Ds.peek().delete(r)}});const l=ho.value;if(!e)return null;if(!As(e)||l.length>0&&!Bh(l.toLowerCase().split(" "),e.type.name))return g(dt,null,e.child&&g(Mi,{node:e.child}),t&&g(sr,{node:e}));const c=e.child&&Wh(e.child);return g(dt,null,g("div",{className:"pl-4 mb-1"},g("h2",{onclick:()=>{Ft.value=null,oe.value=o?null:e},className:\`flex gap-2 items-center cursor-pointer mb-1 scroll-m-12 \${o?"font-medium bg-primary selected-vnode":""}\`,"data-id":r},c&&g(le,{className:\`cursor-pointer transition \${n?"":"rotate-90"}\`,onclick:u=>{u.preventDefault(),u.stopImmediatePropagation(),Ft.value=null,i(f=>!f)}}),g("div",{className:c?"":"ml-6"},g("span",{className:o?"":"text-neutral-400"},"<"),g("span",{className:o?"":"text-primary"},Vh(e)),g("span",{className:o?"":"text-neutral-400"},">"))),!n&&e.child||a!=null&&a&&e.child?g(Mi,{node:e.child}):null),t&&g(sr,{node:e}))}function sr({node:e}){if(!e)return null;let t=[],n=e.sibling;for(;n;)t.push(n),n=n.sibling;return g(dt,null,t.map(i=>g(Mi,{node:i,traverseSiblings:!1})))}const Uh=()=>{const e=Je(null),t=r=>{if(!r)return null;const a=r.getAttribute("data-id");if(a!=null)return Ds.peek().get(a)},n=r=>{if(!r)return;const a=t(r);a!=null&&(r.scrollIntoView({behavior:"smooth"}),oe.value=a.vNode)},i=r=>{if(!r||r===document.body)return null;const a=r.parentElement,l=a?.nextElementSibling?.querySelector("h2[data-id]");return l||i(a)},s=()=>{const r=document.querySelector("h2[data-id]");n(r)},o=()=>{const r=document.querySelectorAll("h2[data-id]"),a=r.item(r.length-1);a&&n(a)};return ir(["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],r=>{if(Ft.value&&(Ft.value=null),document.activeElement&&document.activeElement instanceof HTMLInputElement&&document.activeElement!=e.current)return;r.preventDefault();const a=document.querySelector(".selected-vnode");if(a===null){r.key==="ArrowDown"?s():r.key==="ArrowUp"&&o();return}if(r.key==="ArrowRight"){const l=t(a);l&&l.setCollapsed(!1);return}else if(r.key==="ArrowLeft"){const l=t(a);l&&l.setCollapsed(!0);return}if(r.key==="ArrowDown"){const l=a?.nextElementSibling?.querySelector("h2[data-id]");if(l)return n(l);const c=a.parentElement?.nextElementSibling?.querySelector("h2[data-id]");if(c)return n(c);const u=i(a);return u?n(u):s()}else if(r.key==="ArrowUp"){const l=a.parentElement?.previousElementSibling;if(l?.matches("h2[data-id]"))return n(l);const c=l?.querySelectorAll("h2[data-id]");return c?.length!=null&&c?.length>=1?n(c?.item?.(c.length-1)):o()}}),ir("l",r=>{r.ctrlKey&&(r.preventDefault(),e.current?.focus({preventScroll:!1}))}),{searchRef:e}},$h=e=>{ho.value=e.target.value,Ft.value&&(Ft.value=null)};function Yh(){const{searchRef:e}=Uh(),t=Nt.value;return 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",{ref:e,className:"bg-[#171616] px-1 py-2 w-full focus:outline focus:outline-primary",placeholder:"Search for component",type:"text",value:ho,oninput:$h})),t?.rootNode&&g(Mi,{node:t.rootNode}))}const yl=e=>{const{mouse:t}=Rh(),n=J(null),i=J(0),s=J(0),o=Je(null),r=zh(o),a=Je(null),[l,c]=Array.isArray(e.children)?e.children:[];return so(()=>{a.current&&(s.value=a.current.clientWidth/2)},[a.current]),Pe("mouseup",Ue(()=>n.value=null,[])),Pe("mousemove",Ue(u=>{if(n.value==null||a.current==null)return;const f=Math.max(i.value+u.x-n.value.x,250);s.value=Math.min(f,a.current.clientWidth-250)},[])),Pe("resize",Ue(()=>{a.current!=null&&a.current.clientWidth-250<s.value&&(s.value=Math.max(a.current.clientWidth-250,250))},[])),g("div",{onmousemove:u=>{u.x},ref:a,className:"flex-grow grid gap-2 items-start w-full relative",style:{gridTemplateColumns:\`\${s}px 1fr\`}},g("div",{ref:o,className:"firstContainer w-full h-full"},l),r.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:\`\${r.width}px\`},onmousedown:u=>{u.preventDefault(),n.value={...t.value},i.value=s.value}},g("div",{className:"dividerLine w-[5px] bg-neutral-800 h-full"})),g("div",{className:"secondContainer h-full"},c))},Xh=()=>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",className:"lucide lucide-square-mouse-pointer"},g("path",{d:"M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z"}),g("path",{d:"M21 11V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h6"})),qh=()=>{$e.value=!$e.value,tn.send({type:"set-inspect-enabled",value:$e.value})};function Kh(){const e=Nt.value,t=oe.value,n=de();return rt(()=>{const i=s=>{s===e&&n()};return $?.on("update",i),()=>$?.off("update",i)},[Nt]),rt(()=>{const i=s=>{if(s.data.type!=="select-node")return;if(!window.__devtoolsSelection){console.error("no selection ptr");return}const{app:o,node:r}=window.__devtoolsSelection;window.__devtoolsSelection=null,Nt.value=o,oe.value=r,Ft.value=r,$e.value=!1};return tn.addEventListener(i),()=>tn.removeEventListener(i)},[Nt]),g(dt,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:i=>Nt.value=se.peek().find(s=>s.name===i.currentTarget.value)??null},g("option",{value:"",disabled:!0},"Select App"),se.value.map(i=>g("option",{key:i.id,value:i.name},i.name))),g("button",{title:"Toggle Component Inspection",onclick:qh,className:\`p-1 rounded \${$e.value?"bg-neutral-900":""}\`},g(Xh,null)))),g(yl,null,e&&g(Yh,null),t&&e&&g(Dh,{selectedApp:e,selectedNode:t,setSelectedNode:i=>oe.value=i,kiruGlobal:$})))}const Ls=K({}),Me=K([]);$?.stores?.subscribe(e=>{Ls.value=e,Me.value=Me.value.filter(t=>Object.values(Ls.value).includes(t))});const vl=K(""),Gh=Vn(()=>vl.value.toLowerCase().split(" ").filter(e=>e.length>0));function Zh(e){return Gh.value.every(t=>e.toLowerCase().includes(t))}function Qh(){const e=Object.entries(Ls.value);return e.length===0?g("div",{className:"flex flex-col items-center justify-center h-full text-neutral-400"},g(ao,null),g("h2",{className:"text-lg italic"},"No stores detected")):g("div",{className:"flex flex-col gap-2 items-start"},g(uo,{value:vl,className:"sticky top-0"}),g("div",{className:"flex flex-col gap-2 w-full"},e.filter(([t])=>Zh(t)).map(([t,n])=>g(Jh,{key:t,name:t,store:n}))))}function Jh({name:e,store:t}){const n=Me.value.includes(t),i=de(),{value:s}=_l(t);so(()=>{const r=t.subscribe(()=>i());return()=>r()},[]);const o=Ue(()=>{n?Me.value=Me.value.filter(r=>r!==t):Me.value=[...Me.value,t]},[n]);return g("div",{className:"flex flex-col"},g("button",{onclick:o,className:"flex items-center gap-2 justify-between p-2 border border-white border-opacity-10 cursor-pointer"+(n?" bg-white bg-opacity-5 text-neutral-100 rounded-t":" hover:bg-white hover:bg-opacity-10 text-neutral-400 rounded")},e,g("div",{className:"flex gap-2"},g(Vi,{fn:t,onclick:r=>r.stopPropagation()}),g(le,{className:"transition-all"+(n?" rotate-90":"")}))),n&&g("div",{className:"flex flex-col gap-2 p-2 border border-white border-opacity-10"},g(ge,{data:{value:s},mutable:!0,objectRefAcc:[],onChange:(r,a)=>{const l=structuredClone({value:s});oo(l,r,a),t.setState(l.value)}}),g(tf,{store:t})))}function tf({store:e}){const t=se.value;return t.length===0?null:g(dt,null,t.map(n=>g(ef,{store:e,app:n})))}const or=Symbol.for("kiru.hmrAccept"),_l=e=>{if(or in e)return e[or].provide().current;throw new Error("Unable to get store subscribers")};function ef({store:e,app:t}){const n=de(),{subscribers:i,nodeStateMap:s}=_l(e),o=t.rootNode.child;if(rt(()=>{const a=l=>{l===t&&n()};return $?.on("update",a),()=>$?.off("update",a)},[]),!o)return null;const r=Is(o,a=>i.has(a));return g("div",{className:"flex flex-col gap-2 p-2 rounded-b border border-white border-opacity-10"},g("b",null,t.name),r&&g("ul",{className:"pl-8"},g(Rs,{node:r,nodeStateMap:s})))}function Rs({node:e,nodeStateMap:t}){const[n,i]=pe(!1),o=t.get(e.ref)?.slices??[];return g(dt,null,g("li",{className:"flex flex-col gap-2"},g("div",{className:"flex flex-col border border-white border-opacity-10 rounded"+(n?" bg-white bg-opacity-5 text-neutral-100":" hover:bg-white hover:bg-opacity-10 text-neutral-400")},g("button",{onclick:()=>i(!n),className:"flex gap-2 p-2 justify-between cursor-pointer"},g("span",null,"<"+ro(e.ref)+" />"),g("div",{className:"flex gap-2 items-center"},g(Vi,{fn:e.ref.type,onclick:r=>r.stopPropagation()}),g(le,{className:"transition-all"+(n?" rotate-90":"")}))),n&&g("div",{className:"flex flex-col gap-2 p-2 bg-[#1a1a1a]"},o.length===0&&g("div",{className:"p-2 bg-black bg-opacity-30 text-sm"},g("h5",{className:"border-b border-white border-opacity-10"},"No slices")),o.map(r=>g("div",{className:"flex flex-col gap-2"},g("div",{className:"p-2 bg-black bg-opacity-30 text-sm"},g("h5",{className:"border-b border-white border-opacity-10"},"Slice:"),g("pre",{className:"text-neutral-400"},g(ge,{data:{value:r.value},mutable:!1,objectRefAcc:[],onChange:()=>{}}))),g("div",{className:"p-2 bg-black bg-opacity-30 text-sm"},g("h5",{className:"border-b border-white border-opacity-10"},"SliceFn:"),g("pre",{className:"text-neutral-400"},r.sliceFn?r.sliceFn.toString():"null")),r.eq&&g("div",{className:"p-2 bg-black bg-opacity-30 text-sm"},g("h5",{className:"border-b border-white border-opacity-10"},"eq:"),g("pre",{className:"text-neutral-400"},r.eq.toString())))))),e.child&&g("ul",{className:"pl-8 flex flex-col gap-2"},g(Rs,{node:e.child,nodeStateMap:t}))),e.sibling&&g(Rs,{node:e.sibling,nodeStateMap:t}))}/*!
|
|
9061
|
+
<script type="module" crossorigin>(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();const eu="production",de=eu==="development",za=Symbol.for("kiru.signal"),nu=Symbol.for("kiru.context"),Ri=Symbol.for("kiru.contextProvider"),zt=Symbol.for("kiru.fragment"),Ha=Symbol.for("kiru.error"),Va=Symbol.for("kiru.memo"),to=Symbol.for("kiru.errorBoundary"),iu=Symbol.for("kiru.streamData"),su=Symbol.for("kiru.devFileLink"),ou=50,gn="kiru:deferred",ie=2,ae=4,Ni=8,le=16,Ba=32,ds=64,Ke=128,ru=/^on:?/,Wa=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"]),au=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"]),lu=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"]]),Re={current:null},ja={current:0},Ht={current:"window"in globalThis?"dom":"string"},cu={current:"dynamic"};var $a;class Ze extends Error{constructor(t){const n=typeof t=="string"?t:t.message;super(n),this[$a]=!0,typeof t!="string"&&(this.fatal=t?.fatal)}static isKiruError(t){return t instanceof Error&&t[Ha]===!0}}$a=Ha;const Qe={parentStack:[],childIdxStack:[],eventDeferrals:new Map,parent:function(){return this.parentStack[this.parentStack.length-1]},clear:function(){this.parentStack.length=0,this.childIdxStack.length=0},pop:function(){this.parentStack.pop(),this.childIdxStack.pop()},push:function(e){this.parentStack.push(e),this.childIdxStack.push(0)},currentChild:function(){return this.parentStack[this.parentStack.length-1].childNodes[this.childIdxStack[this.childIdxStack.length-1]]},nextChild:function(){return this.parentStack[this.parentStack.length-1].childNodes[this.childIdxStack[this.childIdxStack.length-1]++]},bumpChildIndex:function(){this.childIdxStack[this.childIdxStack.length-1]++},captureEvents:function(e){Go(e,!0),this.eventDeferrals.set(e,[])},resetEvents:function(e){this.eventDeferrals.delete(e)},releaseEvents:function(e){Go(e,!1);const t=this.eventDeferrals.get(e);for(;t?.length;)t.shift()()}},uu=e=>{const t=e.target;!e.isTrusted||!t||Qe.eventDeferrals.get(t)?.push(()=>t.dispatchEvent(e))},Go=(e,t)=>{for(const n in e)if(n.startsWith("on")){const i=n.substring(2);e[t?"addEventListener":"removeEventListener"](i,uu,{passive:!0})}};let eo=!1,ps=!1;const Ua=e=>{e.preventDefault(),e.stopPropagation(),ps=!0};let Oe=null;function hu(){eo=!0,Oe=document.activeElement,Oe&&Oe!==document.body&&Oe.addEventListener("blur",Ua)}function fu(){ps&&(Oe.removeEventListener("blur",Ua),Oe.isConnected&&Oe.focus(),ps=!1),eo=!1}function du(e){const t=e.type;return t=="#text"?Ya(e):Wa.has(t)?document.createElementNS("http://www.w3.org/2000/svg",t):document.createElement(t)}function Ya(e){const{nodeValue:t}=e.props;if(!W.isSignal(t))return document.createTextNode(t);const n=t.peek()??"",i=document.createTextNode(n);return ms(e,i,t),i}function pu(e,t,n){const i=gs.get(e)??{},s=i[t]=o=>{if(eo){o.preventDefault(),o.stopPropagation();return}n(o)};return gs.set(e,i),s}const gs=new WeakMap;function Xa(e){const{dom:t,prev:n,props:i,cleanups:s}=e,o=n?.props??{},r=i??{},a=Ht.current==="hydrate";if(t instanceof Text){const f=r.nodeValue;!W.isSignal(f)&&t.nodeValue!==f&&(t.nodeValue=f);return}const l=[];for(const f in o)l.push(f);for(const f in r)f in o||l.push(f);for(let f=0;f<l.length;f++){const d=l[f],m=o[d],y=r[d];if(Cs.isEvent(d)){if(m!==y||a){const x=d.replace(ru,""),v=x==="focus"||x==="blur",w=gs.get(e);d in o&&t.removeEventListener(x,v?w?.[x]:m),d in r&&t.addEventListener(x,v?pu(e,x,y):y)}continue}if(!(Cs.isInternalProp(d)&&d!=="innerHTML")&&m!==y){if(W.isSignal(m)&&s){const x=s[d];x&&(x(),delete s[d])}if(W.isSignal(y)){xu(e,t,d,y,m);continue}gi(t,d,y,m)}}const c=o.ref,u=r.ref;c!==u&&(c&&Os(c,null),u&&Os(u,t))}function gu(e){return e.multiple?Array.from(e.selectedOptions).map(t=>t.value):e.value}function qa(e,t){if(!e.multiple||t===void 0||t===null||t===""){e.value=t;return}Array.from(e.options).forEach(n=>{n.selected=t.indexOf(n.value)>-1})}const mu={value:"input",checked:"change",open:"toggle",volume:"volumechange",playbackRate:"ratechange",currentTime:"timeupdate"},bu=["progress","meter","number","range"];function xu(e,t,n,i,s){const o=e.cleanups??(e.cleanups={}),[r,a]=n.split(":");if(r!=="bind"){o[n]=i.subscribe((E,C)=>{E!==C&&gi(t,n,E,C)});const w=i.peek(),k=tn(s);if(w===k)return;gi(t,n,w,k);return}const l=mu[a];if(!l)return;const c=t instanceof HTMLSelectElement,u=c?w=>qa(t,w):w=>t[a]=w,f=w=>{u(w)},d=w=>{i.sneak(w),i.notify(k=>k!==f)};let m;if(a==="value"){const w=bu.indexOf(t.type)!==-1;m=()=>{let k=t.value;c?k=gu(t):typeof i.peek()=="number"&&w&&(k=t.valueAsNumber),d(k)}}else m=w=>{const k=w.target[a];a==="currentTime"&&i.peek()===k||d(k)};t.addEventListener(l,m);const y=i.subscribe(f);o[n]=()=>{t.removeEventListener(l,m),y()};const x=i.peek(),v=tn(s);x!==v&&gi(t,a,x,v)}function ms(e,t,n){(e.cleanups??(e.cleanups={})).nodeValue=n.subscribe((i,s)=>{i!==s&&(t.nodeValue=i)})}function yu(e){if(e.type!=="#text"||!W.isSignal(e.props.nodeValue))return;const t=tn(e.props.nodeValue);if(t!=null)return;const n=Ya(e);return Qe.parent().appendChild(n),n}function vu(e){const t=Qe.nextChild()??yu(e);if(!t)throw new Ze({message:"Hydration mismatch - no node found",vNode:e});let n=t.nodeName;if(Wa.has(n)||(n=n.toLowerCase()),e.type!==n)throw new Ze({message:\`Hydration mismatch - expected node of type \${e.type.toString()} but received \${n}\`,vNode:e});if(e.dom=t,e.type!=="#text"&&!(e.flags&le)){Xa(e);return}W.isSignal(e.props.nodeValue)&&ms(e,t,e.props.nodeValue);let i=e,s=e.sibling;for(;s&&s.type==="#text";){const o=s;Qe.bumpChildIndex();const r=String(tn(i.props.nodeValue)??""),a=i.dom.splitText(r.length);o.dom=a,W.isSignal(o.props.nodeValue)&&ms(o,a,o.props.nodeValue),i=s,s=s.sibling}}function Ga(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 _u(e,t,n){const i=au.has(t);Ga(e,t,n,i)||e.setAttribute(t,i&&typeof n=="boolean"?"":String(n))}const wu=["INPUT","TEXTAREA"],Su=e=>wu.indexOf(e.nodeName)>-1;function gi(e,t,n,i){switch(t){case"style":return Mu(e,n,i);case"className":return Tu(e,n);case"innerHTML":return ku(e,n);case"muted":e.muted=!!n;return;case"value":if(e.nodeName==="SELECT")return qa(e,n);const s=n==null?"":String(n);if(Su(e)){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 _u(e,Xu(t),n)}}function ku(e,t){if(t==null||typeof t=="boolean"){e.innerHTML="";return}e.innerHTML=String(t)}function Tu(e,t){const n=tn(t);if(!n)return e.removeAttribute("class");e.setAttribute("class",n)}function Mu(e,t,n){if(Ga(e,"style",t))return;if(typeof t=="string"){e.setAttribute("style",t);return}let i={};typeof n=="string"?e.setAttribute("style",""):typeof n=="object"&&n&&(i=n);const s=t;new Set([...Object.keys(i),...Object.keys(s)]).forEach(r=>{const a=i[r],l=s[r];if(a!==l){if(l===void 0){e.style[r]="";return}e.style[r]=l}})}function Eu(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 Ze({message:"No DOM parent found while attempting to place node.",vNode:e})}return t}function Cu(e,t){const{node:n,lastChild:i}=t,s=e.dom;if(i){i.after(s);return}const o=Ka(e,n);if(o){n.dom.insertBefore(s,o);return}n.dom.appendChild(s)}function Ka(e,t){let n=e;for(;n;){let i=n.sibling;for(;i;){if(!(i.flags&(ae|le))){const s=Ou(i);if(s?.isConnected)return s}i=i.sibling}if(n=n.parent,!n||n.flags&le||n===t)return}}function Ou(e){let t=e;for(;t;){if(t.dom)return t.dom;if(t.flags&le)return;t=t.child}}function Pu(e){if(Ht.current==="hydrate")return Fi(e,wi);const t={node:e.dom?e:Eu(e)};bs(e,t,(e.flags&ae)>0),e.dom&&!(e.flags&le)&&Za(e,t,!1),wi(e)}function bs(e,t,n){let i=e.child;for(;i;){if(i.flags&ds){i.flags&ae&&Au(i,t),wi(i),i=i.sibling;continue}i.dom?(bs(i,{node:i},!1),i.flags&le||Za(i,t,n)):bs(i,t,(i.flags&ae)>0||n),wi(i),i=i.sibling}}function Za(e,t,n){(n||!e.dom.isConnected||e.flags&ae)&&Cu(e,t),(!e.prev||e.flags&ie)&&Xa(e),t.lastChild=e.dom}function Du(e){e===e.parent?.child&&(e.parent.child=e.sibling),Fi(e,t=>{const{hooks:n,subs:i,cleanups:s,dom:o,props:{ref:r}}=t;for(i?.forEach(a=>a()),s&&Object.values(s).forEach(a=>a());n?.length;)n.pop().cleanup?.();o&&(o.isConnected&&!(t.flags&le)&&o.remove(),r&&Os(r,null),delete t.dom)}),e.parent=null}function Au(e,t){if(!e.child)return;const n=[];if(Qa(e.child,n),n.length===0)return;const{node:i,lastChild:s}=t;if(s)s.after(...n);else{const o=Ka(e,i),r=i.dom;o?o.before(...n):r.append(...n)}t.lastChild=n[n.length-1]}function Qa(e,t){let n=e;for(;n;)n.dom?t.push(n.dom):n.child&&Qa(n.child,t),n=n.sibling}function g(e,t=null,...n){e===Tt&&(e=zt);const i=t===null?{}:t,s=dl(i.key),o=n.length;return o===1?i.children=n[0]:o>1&&(i.children=n),{type:e,key:s,props:i}}function Tt({children:e,key:t}){return{type:zt,key:dl(t),props:{children:e}}}function Ja(e){return typeof e=="function"&&typeof e[Va]?.arePropsEqual=="function"}function tl(e,t=null,n={},i=null,s=0){e===Tt&&(e=zt);const 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}}function no(e,t){return Array.isArray(t)?Lu(e,t):Iu(e,t)}function Iu(e,t){const n=e.child;if(n===null)return il(e,t);const i=n.sibling,s=el(e,n,t);if(s!==null)return n&&n!==s&&!s.prev?xs(e,n):i&&xs(e,i),s;{const o=rl(n),r=sl(o,e,0,t);if(r!==null){const a=r.prev;if(a!==null){const l=a.key;o.delete(l===null?a.index:l)}mi(r,0,0)}return o.forEach(a=>vi(e,a)),r}}function Lu(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;const c=el(e,s,t[a]);if(c===null){s===null&&(s=o);break}s&&!c.prev&&vi(e,s),r=mi(c,r,a),i===null?n=c:i.sibling=c,i=c,s=o}if(a===t.length)return xs(e,s),n;if(s===null){for(;a<t.length;a++){const c=il(e,t[a]);c!==null&&(r=mi(c,r,a),i===null?n=c:i.sibling=c,i=c)}return n}const l=rl(s);for(;a<t.length;a++){const c=sl(l,e,a,t[a]);if(c!==null){const u=c.prev;if(u!==null){const f=u.key;l.delete(f===null?u.index:f)}r=mi(c,r,a),i===null?n=c:i.sibling=c,i=c}}return l.forEach(c=>vi(e,c)),n}function el(e,t,n){const i=t===null?null:t.key;return so(n)?i!==null||t?.type==="#text"&&W.isSignal(t.props.nodeValue)?null:Ko(e,t,""+n):W.isSignal(n)?t&&t.props.nodeValue!==n?null:Ko(e,t,n):io(n)?n.key!==i?null:Ru(e,t,n):Array.isArray(n)?i!==null?null:nl(e,t,n):null}function Ko(e,t,n){return t===null||t.type!=="#text"?Nt(e,"#text",{nodeValue:n}):(t.props.nodeValue!==n&&(t.props.nodeValue=n,t.flags|=ie),t.sibling=null,t)}function Ru(e,t,n){let{type:i,props:s,key:o}=n;return i===zt?nl(e,t,s.children||[],s):t?.type===i?(t.index=0,t.sibling=null,typeof i=="string"?ol(t.props,s)&&(t.flags|=ie):t.flags|=ie,t.props=s,t):Nt(e,i,s,o)}function nl(e,t,n,i={}){return t===null||t.type!==zt?Nt(e,zt,{children:n,...i}):(t.props={...t.props,...i,children:n},t.flags|=ie,t.sibling=null,t)}function il(e,t){return so(t)?Nt(e,"#text",{nodeValue:""+t}):W.isSignal(t)?Nt(e,"#text",{nodeValue:t}):io(t)?Nt(e,t.type,t.props,t.key):Array.isArray(t)?Nt(e,zt,{children:t}):null}function mi(e,t,n){e.index=n;const i=e.prev;if(i!==null){const s=i.index;return s<t?(e.flags|=ae,t):s}else return e.flags|=ae,t}function sl(e,t,n,i){if(W.isSignal(i)||so(i)){const o=e.get(n);if(o){if(o.props.nodeValue===i)return o;o.type==="#text"&&W.isSignal(o.props.nodeValue)&&o.cleanups?.nodeValue?.()}return Nt(t,"#text",{nodeValue:i},null,n)}if(io(i)){const{type:o,props:r,key:a}=i,l=e.get(a===null?n:a);return l?.type===o?(typeof o=="string"?ol(l.props,r)&&(l.flags|=ie):l.flags|=ie,l.props=r,l.sibling=null,l.index=n,l):Nt(t,o,r,a,n)}if(Array.isArray(i)){const o=e.get(n);return o?(o.flags|=ie,o.props.children=i,o):Nt(t,zt,{children:i},null,n)}return null}function ol(e,t){const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!0;for(let s of n)if(!(s==="children"||s==="key")&&e[s]!==t[s])return!0;return!1}function rl(e){const t=new Map;for(;e;){const n=e.key;t.set(n===null?e.index:n,e),e=e.sibling}return t}function vi(e,t){e.deletions===null?e.deletions=[t]:e.deletions.push(t)}function xs(e,t){for(;t;)vi(e,t),t=t.sibling}function Nt(e,t,n,i=null,s=0){const o=tl(t,e,n,i,s);return o.flags|=ae,typeof t=="function"&&Ja(t)&&(o.flags|=Ba,o.arePropsEqual=t[Va].arePropsEqual),o}let Xt=[],Je=!1,ys=[],vs=[],_s=!1,ws=!1,Ss=!1,ks=0,al=[],Ts=[],ll=-1;function Nu(e){if(Je){ys.push(e);return}e()}function cl(){Je&&(window.cancelAnimationFrame(ll),ul())}function Zo(e){e.flags|=Ke,Xt.push(e),Je=!0,cl()}function zn(e){if(Ht.current==="hydrate")return Nu(()=>Ms(e));Ms(e)}function Fu(){Je||(Je=!0,ll=window.requestAnimationFrame(ul))}function zu(){for(Je=!1;ys.length;)ys.shift()()}function Ms(e){if(_s&&(ws=!0),Re.current===e){Ss=!0;return}if(!(e.flags&(Ke|Ni))){if(e.flags|=Ke,!Xt.length)return Xt.push(e),Fu();Xt.push(e)}}function Hu(e){Fi(e,t=>t.flags|=Ni),vs.push(e)}const Vu=(e,t)=>t.depth-e.depth;let te=null;function ul(){let e=1;for(hu();Xt.length;){Xt.length>e&&Xt.sort(Vu),te=Xt.shift(),e=Xt.length;const t=te.flags;if(!(t&Ni)&&t&Ke){let n=te;for(;n=Bu(n););for(;vs.length;)Du(vs.pop());Pu(te),te.flags&=~Ke}}if(fu(),_s=!0,Ji(al),_s=!1,ws)return Uu(),Ji(Ts),ws=!1,ks++,cl();ks=0,zu(),Ji(Ts)}function Bu(e){let t=!0;try{typeof e.type=="string"?$u(e):Gu(e.type)?Wu(e):t=ju(e)}catch(i){const s=th(e);if(s){const o=s.error=i instanceof Error?i:new Error(String(i));return s.props.onError?.(o),s.depth<te.depth&&(te=s),s}if(Ze.isKiruError(i)){if(i.customNodeStack&&setTimeout(()=>{throw new Error(i.customNodeStack)}),i.fatal)throw i;console.error(i);return}setTimeout(()=>{throw i})}if(e.deletions!==null&&(e.deletions.forEach(Hu),e.deletions=null),t&&e.child)return e.child;let n=e;for(;n;){if(n.immediateEffects&&(al.push(...n.immediateEffects),n.immediateEffects=void 0),n.effects&&(Ts.push(...n.effects),n.effects=void 0),n===te)return;if(n.sibling)return n.sibling;n=n.parent,Ht.current==="hydrate"&&n?.dom&&Qe.pop()}}function Wu(e){const{props:t,type:n}=e;let i=t.children;if(n===Ri){const{props:{dependents:s,value:o},prev:r}=e;s.size&&r&&r.props.value!==o&&s.forEach(Ms)}else if(n===to){const s=e,{error:o}=s;o&&(i=typeof t.fallback=="function"?t.fallback(o):t.fallback,delete s.error)}e.child=no(e,i)}function ju(e){const{type:t,props:n,subs:i,prev:s,flags:o}=e;if(o&Ba){if(e.memoizedProps=n,s?.memoizedProps&&e.arePropsEqual(s.memoizedProps,n)&&!e.hmrUpdated)return e.flags|=ds,!1;e.flags&=~ds}try{Re.current=e;let r,a=0;do e.flags&=~Ke,Ss=!1,ja.current=0,i&&(i.forEach(l=>l()),i.clear()),r=t(n);while(Ss);return e.child=no(e,r),!0}finally{Re.current=null}}function $u(e){const{props:t,type:n}=e;e.dom||(Ht.current==="hydrate"?vu(e):e.dom=du(e)),n!=="#text"&&(e.child=no(e,t.children),e.child&&Ht.current==="hydrate"&&Qe.push(e.dom))}function Uu(){if(ks>ou)throw new Ze("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 Ji(e){for(let t=0;t<e.length;t++)e[t]();e.length=0}var Qo;(function(e){e.Start="start",e.End="end"})(Qo||(Qo={}));const pe=()=>{const e=hl("useRequestUpdate");return()=>zn(e)};function _t(e,t,n){const i=hl(e),s=(a,l)=>{if(l?.immediate){(i.immediateEffects??(i.immediateEffects=[])).push(a);return}(i.effects??(i.effects=[])).push(a)},o=ja.current++;let r=i.hooks?.at(o);try{const a=r??(typeof t=="function"?t():{...t});return i.hooks??(i.hooks=[]),i.hooks[o]=a,n({hook:a,isInit:!r,update:()=>zn(i),queueEffect:s,vNode:i,index:o})}catch(a){throw a}}function hl(e){const t=Re.current;if(!t)throw new Ze(\`Hook "\${e}" must be used at the top level of a component or inside another composite hook.\`);return t}function Hn(e){e.cleanup&&(e.cleanup(),e.cleanup=void 0)}function He(e,t){return e===void 0||t===void 0||e.length!==t.length||e.length>0&&t.some((n,i)=>!Object.is(n,e[i]))}const Es={stack:new Array,current:function(){return this.stack[this.stack.length-1]}},Ye=new Map;var fl;class W{constructor(t,n){this[fl]=!0,this.$id=nh(),this.$value=t,n&&(this.displayName=n),this.$subs=new Set}get value(){return this.onBeforeRead?.(),W.entangle(this),this.$value}set value(t){Object.is(this.$value,t)||(this.$prevValue=this.$value,this.$value=t,this.notify())}peek(){return this.onBeforeRead?.(),this.$value}sneak(t){this.$prevValue=this.$value,this.$value=t}toString(){return this.onBeforeRead?.(),W.entangle(this),\`\${this.$value}\`}subscribe(t){return this.$subs.add(t),()=>this.$subs.delete(t)}notify(t){this.$subs.forEach(n=>{if(!(t&&!t(n)))return n(this.$value,this.$prevValue)})}static isSignal(t){return typeof t=="object"&&!!t&&za in t}static subscribers(t){return t.$subs}static makeReadonly(t){const n=Object.getOwnPropertyDescriptor(t,"value");return n&&!n.writable?t:Object.defineProperty(t,"value",{get:function(){return W.entangle(this),this.$value},configurable:!0})}static makeWritable(t){const n=Object.getOwnPropertyDescriptor(t,"value");return n&&n.writable?t:Object.defineProperty(t,"value",{get:function(){return W.entangle(this),this.$value},set:function(i){this.$value=i,this.notify()},configurable:!0})}static entangle(t){const n=Re.current,i=Es.current();if(i){(!n||n&&yt())&&i.set(t.$id,t);return}if(!n||!yt())return;const s=t.subscribe(()=>zn(n));(n.subs??(n.subs=new Set)).add(s)}static configure(t,n){t.onBeforeRead=n}static dispose(t){t.$isDisposed=!0,t.$subs.clear()}}fl=za;const G=(e,t)=>new W(e,t),J=(e,t)=>_t("useSignal",{signal:null},({hook:n,isInit:i,isHMR:s})=>(i&&(n.cleanup=()=>W.dispose(n.signal),n.signal=new W(e,t)),n.signal));function tn(e,t=!1){return W.isSignal(e)?t?e.value:e.peek():e}const Yu=()=>{Ye.forEach(e=>e()),Ye.clear()};function _i(...e){return e.filter(Boolean).join(" ")}const Jo=new Set(["children","ref","key","innerHTML"]),Cs={isInternalProp:e=>Jo.has(e),isEvent:e=>e.startsWith("on"),isStringRenderableProperty:e=>!Jo.has(e)&&!Cs.isEvent(e)};function Xu(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():lu.get(e)||e}}const tr=Object.freeze(()=>{});function Os(e,t){if(typeof e=="function"){e(t);return}if(W.isSignal(e)){e.value=t;return}e.current=t}function yt(){return Ht.current==="dom"||Ht.current==="hydrate"}function qu(e){return(e.flags&Ni)!==0}function io(e){return typeof e=="object"&&e!==null&&"type"in e}function so(e){return typeof e=="string"&&e!==""||typeof e=="number"||typeof e=="bigint"}function Gu(e){return e===zt||e===Ri||e===to}function Ku(e){return e.type===zt}function Zu(e){return typeof e.type=="function"&&"displayName"in e.type&&e.type.displayName==="Kiru.lazy"}function Qu(e){return typeof e.type=="function"&&Ja(e.type)}function wi(e){const{props:{children:t,...n},key:i,memoizedProps:s,index:o}=e;e.prev={props:n,key:i,memoizedProps:s,index:o},e.flags&=-15}function Fi(e,t){t(e);let n=e.child;for(;n;)t(n),n.child&&Fi(n,t),n=n.sibling}function Ju(e,t){let n=e.parent;for(;n;){if(t(n))return n;n=n.parent}return null}function th(e){return Ju(e,t=>t.type===to)}function dl(e){return e===void 0?null:typeof e=="string"||typeof e=="number"?e:null}const eh="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz-";function nh(e=10,t=eh){let n="";for(let i=0;i<e;i++)n+=t[Math.random()*t.length|0];return n}function ih(){const e=new Set,t=new WeakMap,n=new Map;function i(a,l,c){n.get(a)?.forEach(u=>u(l,c))}function s(a,l){n.has(a)||n.set(a,new Set),n.get(a).add(l)}function o(a,l){n.get(a)?.delete(l)}const r={get apps(){return Array.from(e)},emit:i,on:s,off:o};return s("mount",(a,l)=>{e.add(a),l&&typeof l=="function"&&t.set(a,{requestUpdate:l})}),s("unmount",a=>{e.delete(a),t.delete(a)}),r}function sh(e){const{id:t,subs:n,fn:i,deps:s=[],onDepChanged:o}=e;let r;Ye.delete(t);const a=!!Re.current&&!yt();a||(r=new Map,Es.stack.push(r));const l=i(...s.map(c=>c.value));if(!a){for(const[u,f]of n)r.has(u)||(f(),n.delete(u));const c=()=>{Ye.size||queueMicrotask(Yu),Ye.set(t,o)};for(const[u,f]of r){if(n.has(u))continue;const d=f.subscribe(c);n.set(u,d)}Es.stack.pop()}return l}class Ee extends W{constructor(t,n){super(void 0,n),this.$getter=t,this.$unsubs=new Map,this.$isDirty=!0,W.configure(this,()=>{this.$isDirty&&Ee.run(this)})}get value(){return super.value}set value(t){}subscribe(t){return this.$isDirty&&Ee.run(this),super.subscribe(t)}static dispose(t){Ee.stop(t),W.dispose(t)}static updateGetter(t,n){const i=t;i.$getter=n,i.$isDirty=!0,Ee.run(i),!Object.is(i.$value,i.$prevValue)&&i.notify()}static stop(t){const{$id:n,$unsubs:i}=t;Ye.delete(n),i.forEach(s=>s()),i.clear(),t.$isDirty=!0}static run(t){const n=t,{$id:i,$getter:s,$unsubs:o}=n,r=sh({id:i,subs:o,fn:()=>s(n.$value),onDepChanged:()=>{n.$isDirty=!0,t.$subs.size&&(Ee.run(n),!Object.is(n.$value,n.$prevValue)&&n.notify())}});n.sneak(r),n.$isDirty=!1}}function Vn(e,t){return new Ee(e,t)}let oh=0;function rh(e,t,n){const i=ah(t),s=oh++,o={id:s,name:\`App-\${s}\`,rootNode:i,render:r,unmount:a};function r(l){i.props.children=l,Zo(i)}function a(){i.props.children=null,Zo(i),window.__kiru.emit("unmount",o)}return r(e),window.__kiru.emit("mount",o,zn),o}function ah(e){const t=tl(e.nodeName.toLowerCase());return t.flags|=le,t.dom=e,t}function ge(e){return yt()?_t("useState",{state:void 0,dispatch:tr},({hook:t,isInit:n,update:i,isHMR:s})=>(n&&(t.state=typeof e=="function"?e():e,t.dispatch=o=>{const r=typeof o=="function"?o(t.state):o;Object.is(t.state,r)||(t.state=r,i())}),[t.state,t.dispatch])):[typeof e=="function"?e():e,tr]}function lh(e){const t={[nu]:!0,Provider:({value:n,children:i})=>{const[s]=ge(()=>new Set);return g(Ri,{value:n,ctx:t,dependents:s},typeof i=="function"?i(n):i)},default:()=>e,set displayName(n){this.Provider.displayName=n},get displayName(){return this.Provider.displayName||"Anonymous Context"}};return t}function Xe(e,t){return yt()?_t("useCallback",{callback:e,deps:t},({hook:n,isHMR:i})=>(He(t,n.deps)&&(n.deps=t,n.callback=e),n.callback)):e}function ch(e,t=!0){return _t("useContext",{context:e,warnIfNotFound:t},uh)}const uh=({hook:e,isInit:t,vNode:n})=>{if(t){let i=n.parent;for(;i;){if(i.type===Ri){const s=i,{ctx:o,value:r,dependents:a}=s.props;if(o===e.context)return a.add(n),e.cleanup=()=>a.delete(n),e.provider=s,r}i=i.parent}}return e.provider?e.provider.props.value:e.context.default()};function rt(e,t){if(yt())return _t("useEffect",{deps:t},({hook:n,isInit:i,isHMR:s,queueEffect:o})=>{(i||He(t,n.deps))&&(n.deps=t,Hn(n),o(()=>{const r=e();typeof r=="function"&&(n.cleanup=r)}))})}function pl(){return _t("useId",hh,fh)}const hh=()=>({id:"",idx:0}),fh=({hook:e,isInit:t,vNode:n})=>{if(t||n.index!==e.idx){e.idx=n.index;const i=[];let s=n;for(;s;)i.push(s.index),i.push(s.depth),s=s.parent;e.id=\`k:\${BigInt(i.join("")).toString(36)}\`}return e.id};function oo(e,t){if(yt())return _t("useLayoutEffect",{deps:t},({hook:n,isInit:i,isHMR:s,queueEffect:o})=>{(i||He(t,n.deps))&&(n.deps=t,Hn(n),o(()=>{const r=e();typeof r=="function"&&(n.cleanup=r)},{immediate:!0}))})}function Si(e,t){return yt()?_t("useMemo",{deps:t,value:void 0},({hook:n,isInit:i,isHMR:s})=>((i||He(t,n.deps))&&(n.deps=t,n.value=e()),n.value)):e()}const er=new WeakMap;function dh(e,t){const n=pl(),i=J(!0);return _t("usePromise",{},({hook:s,isInit:o,vNode:r,update:a})=>{if(o||He(t,s.deps)){i.value=!0,s.deps=t,Hn(s);const l=s.abortController=new AbortController;s.cleanup=()=>l.abort();const c=er.get(r)??0;er.set(r,c+1);const u=\`\${n}:data:\${c}\`;let f;Ht.current==="string"?f=Promise.resolve():Ht.current==="hydrate"&&cu.current==="dynamic"?f=ph(u,l.signal):f=e(l.signal);const d={id:u,state:"pending"},m=s.promise=Object.assign(f,d,{isPending:i,refresh:()=>{s.deps=void 0,a()}});m.then(y=>{m.state="fulfilled",m.value=y,i.value=!1}).catch(y=>{m.state="rejected",m.error=y instanceof Error?y:new Error(y)})}return s.promise})}function ph(e,t){return new Promise((n,i)=>{const s=window[gn]??(window[gn]=new Map),o=s.get(e);if(o){const{data:a,error:l}=o;return s.delete(e),l?i(l):n(a)}const r=a=>{const{detail:l}=a;if(l.id===e){s.delete(e),window.removeEventListener(gn,r);const{data:c,error:u}=l;if(u)return i(u);n(c)}};window.addEventListener(gn,r),t.addEventListener("abort",()=>{window.removeEventListener(gn,r),i()})})}function Ne(e){return yt()?_t("useRef",{ref:{current:e}},({hook:t,isInit:n,isHMR:i})=>t.ref):{current:e}}function nr(e){return e instanceof Promise&&"id"in e&&"state"in e}function Ps(e){const{from:t,children:n,fallback:i,mode:s}=e,o=Ne(null),r=new Set;let a;if(nr(t))r.add(t),a=t.value;else if(W.isSignal(t))a=t.value;else{const l={};for(const c in t){const u=t[c];nr(u)&&r.add(u),l[c]=u.value}a=l}if(r.size===0)return n(a);if(!yt())throw{[iu]:{fallback:i,data:Array.from(r)}};for(const l of r){if(l.state==="rejected")throw l.error;if(l.state==="pending"){const c=Re.current;return Promise.allSettled(r).then(()=>zn(c)),s!=="fallback"&&o.current?n(o.current,!0):i}}return o.current=a,n(a,!1)}"window"in globalThis&&(window.__KIRU_LAZY_CACHE??(window.__KIRU_LAZY_CACHE=new Map));var ir;"window"in globalThis&&!globalThis.__KIRU_DEVTOOLS__&&((ir=globalThis.window).__kiru??(ir.__kiru=ih()));function gh(e,t){if(!e)throw new Error(t)}function mh(...e){return e.filter(Boolean).join(" ")}function ro(e,t,n){let i=e;for(let s=0;s<t.length;s++){const o=t[s];s===t.length-1?i[o]=n:i=i[o]}}function ao(e){return e.type.displayName??(e.type.name||"Anonymous Function")}const bh=e=>e[su]??null;function An(e){return e.name==="kiru.devtools"}function gl(e){return Array.from(e.entries())}function xh(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"}))}function ce(e){return 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",...e},g("path",{d:"m9 18 6-6-6-6"}))}function yh(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"}))}function vh(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"}))}function _h(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"}))}function wh(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"}))}function Sh(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 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"}),g("path",{d:"M2 12h20"}))}function ml(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:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),g("path",{d:"M21 3v5h-5"}),g("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),g("path",{d:"M8 16H3v5"}))}function kh(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:"M22 8.35V20a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8.35A2 2 0 0 1 3.26 6.5l8-3.2a2 2 0 0 1 1.48 0l8 3.2A2 2 0 0 1 22 8.35Z"}),g("path",{d:"M6 18h12"}),g("path",{d:"M6 14h12"}),g("rect",{width:"12",height:"12",x:"6",y:"10"}))}function Th(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("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),g("path",{d:"M8 12h8"}),g("path",{d:"m12 16 4-4-4-4"}))}function lo(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.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}),g("path",{d:"M12 9v4"}),g("path",{d:"M12 17h.01"}))}function bl({title:e,children:t,className:n,disabled:i,...s}){const[o,r]=ge(!0);rt(()=>{!o&&i&&r(!0)},[i]);const a=Xe(l=>{l.preventDefault(),l.stopImmediatePropagation(),r(c=>!c)},[]);return g("div",{className:"flex flex-col"},g("button",{onclick:a,disabled:i,className:\`\${i?"opacity-50 cursor-default":"cursor-pointer"}\`},g("span",{className:"flex items-center gap-2 font-medium"},g(ce,{className:\`transition \${o?"":"rotate-90"}\`}),e)),o?null:g("div",{className:\`p-2 \${n||""}\`,...s},t))}const co={arrayChunkSize:10,objectKeysChunkSize:100};function xl(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;const n=new Set([...Object.keys(e),...Object.keys(t)]);for(const i in n)if(typeof t[i]!=typeof e[i]||typeof e[i]=="object"&&!xl(e[i],t[i]))return!1;return!0}function yl(e,t,n){for(const i in t)typeof e[i]>"u"&&(e[i]=structuredClone(t[i]));for(const i in e)typeof e[i]=="object"?yl(e[i],t[i],n):n(e,i,e[i])}let vl={...co};const sr=localStorage.getItem("kiru.devtools.userSettings");if(sr)try{const e=JSON.parse(sr);xl(co,e)&&(vl=e)}catch(e){console.error("kiru.devtools.userSettings error",e)}const _l=lh({userSettings:null,saveUserSettings:()=>{}}),zi=()=>ch(_l);function Mh({children:e}){const[t,n]=ge(vl),i=s=>{localStorage.setItem("kiru.devtools.userSettings",JSON.stringify(s)),n(s)};return g(_l.Provider,{value:{userSettings:t,saveUserSettings:i}},e)}function Eh(){const{userSettings:e,saveUserSettings:t}=zi();return g("div",{className:"rounded bg-neutral-400 bg-opacity-5 border border-white border-opacity-10 overflow-hidden"},g(me,{border:!1,data:e,onChange:(n,i)=>{const s={...e};ro(s,n,i),yl(s,co,(o,r,a)=>{o[r]=a<1?1:a}),t(s)},mutable:!0,objectRefAcc:[]}))}const Ch=Object.freeze(()=>{});function me({data:e,onChange:t,mutable:n,objectRefAcc:i,keys:s=[],className:o,border:r=!0}){const{userSettings:{objectKeysChunkSize:a}}=zi(),[l,c]=ge(0),u=Si(()=>Object.keys(e).slice(0,(l+1)*a),[l,a,e]),f=()=>{u.forEach(m=>{typeof e[m]=="object"&&i.splice(i.indexOf(e[m]),1)}),c(l+1)},d=u.length<Object.keys(e).length;return g(Tt,null,g("div",{className:mh("flex flex-col items-start w-full",r&&"border border-neutral-700",tn(o))},u.map(m=>{const y=s.concat(m),x=y.join(".");return g("div",{key:x,"data-key":x,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(uo,{value:e[m],onChange:t,keys:y,path:x,label:m,mutable:n,objectRefAcc:i}))})),d&&g("button",{onclick:f,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 ki(e,t){Array.isArray(e)?(t(e),e.forEach(n=>ki(n,t))):typeof e=="object"&&e!==null&&(t(e),Object.values(e).forEach(n=>ki(n,t)))}function uo({value:e,onChange:t,keys:n,path:i,mutable:s,objectRefAcc:o,label:r}){const{userSettings:{arrayChunkSize:a}}=zi(),[l,c]=ge(!0),u=r!==void 0&&g("label",{htmlFor:i,className:"text-xs truncate",title:i,children:r});if(e===null)return g(mt,null,u,g(Qt,null,"null"));if(e===void 0)return g(mt,null,u,g(Qt,null,"undefined"));const f=window.opener?window.opener.Node:Node;if(e instanceof f)return g(mt,null,u,g(Qt,null,"<",g("span",{style:{color:"#f0a05e"}},e.nodeName),"/>"));const d=window.opener?window.opener.Error:Error;if(e instanceof d)return g(mt,null,u,"cause"in e&&e.cause?g(Qt,null,e.message," (",String(e.cause),")"):g(Qt,null,e.message));const m=y=>t(n,y);switch(typeof e){case"string":return g(mt,null,u,g(ts,{disabled:!s,id:i,type:"text",value:e,onchange:y=>m(y.target.value)}));case"number":return g(mt,null,u,g(ts,{disabled:!s,id:i,type:"number",value:e,placeholder:"NaN",onchange:y=>m(Number(y.target.value))}));case"bigint":return g(mt,null,u,g(ts,{disabled:!s,id:i,type:"number",value:e.toString(),onchange:y=>m(BigInt(y.target.value))}));case"boolean":return g(mt,null,u,g("input",{disabled:!s,id:i,type:"checkbox",checked:e,onchange:y=>m(y.target.checked),className:"accent-red-500"}));case"function":return g(mt,null,u,g(Qt,null,\`\u0192 \${e.name||"anonymous"}()\`));default:return Array.isArray(e)?g(mt,null,g("button",{className:"text-xs flex items-center gap-1 cursor-pointer w-full",title:i,onclick:()=>{ki(e,y=>o.splice(o.indexOf(y),1)),c(y=>!y)}},r,g(ce,{width:10,height:10,className:\`transition \${l?"":"rotate-90"}\`})),l?g(Qt,null,"Array(",e.length,")"):e.length>a?g(Oh,{array:e,objectRefAcc:o}):g("div",{className:"flex flex-col items-start gap-1 w-full"},e.map((y,x)=>g(uo,{value:y,onChange:t,keys:[...n,x.toString()],path:i.concat(".",x.toString()),label:x.toString(),mutable:s,objectRefAcc:o})))):o.includes(e)?g(mt,null,u,g(Qt,null,"Object(circular reference)")):(o.push(e),g(mt,null,g("button",{className:"text-xs flex items-center gap-1 cursor-pointer w-full",title:i,onclick:()=>{ki(e,y=>o.splice(o.indexOf(y),1)),c(y=>!y)}},r,g(ce,{width:10,height:10,className:\`transition \${l?"":"rotate-90"}\`})),l?null:g(me,{data:e,onChange:t,keys:n,mutable:s,objectRefAcc:o})))}}function mt({children:e}){return g("div",{className:"flex flex-col items-start gap-1 w-full"},e)}function ts(e){return g("input",{className:"flex-grow text-xs px-2 py-1 text-neutral-300 w-full",...e})}function Qt({children:e}){return g("small",{className:"text-neutral-300"},g("i",null,e))}function Oh({array:e,objectRefAcc:t}){const{userSettings:{arrayChunkSize:n}}=zi(),i=e.length,s=Math.ceil(i/n);return g("div",{className:"flex flex-col items-start gap-1 w-full"},Array.from({length:s}).map((o,r)=>g(Ph,{array:e,range:{start:r*n,end:(r+1)*n},objectRefAcc:t})))}function Ph({array:e,range:t,objectRefAcc:n}){const[i,s]=ge(!0);let o;return i?o=void 0:o=e.slice(t.start,t.end),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:()=>{n.splice(n.indexOf(e),1),s(r=>!r)}},"[",t.start,"..",(t.end<e.length?t.end:e.length)-1,"]",g(ce,{width:10,height:10,className:\`transition \${i?"":"rotate-90"}\`})),o&&g("div",{className:"flex flex-col items-start gap-1 w-full"},o.map((r,a)=>g(uo,{value:r,onChange:Ch,label:(t.start+a).toString(),keys:[a.toString()],path:a.toString(),mutable:!1,objectRefAcc:n}))))}const Dh="kiru-devtools";"window"in globalThis&&(window.__devtoolsSelection??=null,window.__devtoolsNodeUpdatePtr??=null);class Ah extends BroadcastChannel{send(t){super.postMessage(t)}removeEventListener(t){return super.removeEventListener("message",t)}addEventListener(t){return super.addEventListener("message",t)}}const Fe=new Ah(Dh);function Hi({fn:e,onclick:t}){const n=Si(()=>bh(e),[e]);return n?g("a",{className:"flex items-center gap-1 text-[10px] opacity-50 hover:opacity-100 transition-opacity",href:n,onclick:i=>{i.preventDefault(),Fe.send({type:"open-editor",fileLink:n}),t?.(i)},title:"Open in editor"},"Open in editor",g(vh,{width:"0.65rem",height:"0.65rem"})):null}function Ih({selectedApp:e,selectedNode:t,setSelectedNode:n,kiruGlobal:i}){const s=pe();rt(()=>{const l=c=>{c===e&&(qu(t)?n(null):s())};return i?.on("update",l),()=>i?.off("update",l)},[]);const o=()=>{const l=window.opener;if(!t||!l){console.error("invalid refresh state",{w:l,selectedNode:t});return}l.__devtoolsNodeUpdatePtr=t,Fe.send({type:"update-node"}),console.debug("[kiru]: sent refresh message",t)},r={...t.props};delete r.children;const a=Nh(t);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"},"<"+ao(t)+">",g(Hi,{fn:t.type})),g("button",{onclick:o},g(ml,{className:"w-5 h-5"}))),g(bl,{title:"props",disabled:Object.keys(r).length===0},g(me,{data:r,onChange:()=>{},mutable:!1,objectRefAcc:[]})),g(wl,{node:a,selectedApp:e}))}function Lh(e){return e.name==="devtools:useHookDebugGroup"}function Rh(e){return Ds in e}const Ds=Symbol.for("devtools.hookGroup");function Nh(e){const t={parent:null,name:"hooks",children:[],[Ds]:!0};if(e.hooks?.length){let n=t;for(let i=0;i<e.hooks.length;i++){const s=e.hooks[i];if(Lh(s)){switch(s.action){case"start":const o={parent:n,name:s.displayName,children:[],[Ds]:!0};n.children.push(o),n=o;break;case"end":if(n.name!==s.displayName||n.parent===null)throw new Error("useHookDebugGroup:end called with no start");n=n.parent;break}continue}n.children.push(s)}}return t}function wl({node:e,selectedApp:t,depth:n=0}){if(Rh(e))return g(bl,{title:e.name,className:"bg-[#ffffff04] border border-[#fff1] flex flex-col gap-2 pl-6",disabled:e.children.length===0},e.children.map(u=>g(wl,{node:u,selectedApp:t,depth:n+1})));const{name:i,dev:s,cleanup:o,...r}=e,a=s?.devtools,l=typeof a?.get=="function"?a.get():r;return g("div",null,g("i",{className:"text-neutral-300 text-sm"},i||"anonymous hook"),g("div",{className:"p-2"},g(me,{data:l,onChange:(u,f)=>{if(!t||!a?.set||!a?.get)return;const d=a.get();ro(d,u,f),a.set(d)},mutable:!!a?.set,objectRefAcc:[]})))}const Ae=(e,t,n={})=>{rt(()=>{let i=window;const s=n?.ref?.();return s?i=s:n.ref&&console.warn("useEventListener ref failed, using window"),i.addEventListener(e,t,n),()=>{i.removeEventListener(e,t,n)}},[t])},Fh=()=>{const e=J({x:0,y:0}),t=J({x:0,y:0}),n=J({x:0,y:0});return Ae("mousemove",i=>{e.value={x:i.x,y:i.y},t.value={x:i.movementX,y:i.movementY},n.value={x:i.clientX,y:i.clientY}}),{mouse:e,delta:t,client:n}},Qn="window"in globalThis&&"ResizeObserver"in globalThis.window,zh=(e,t,n=void 0)=>yt()?Qn?_t("useResizeObserver",{resizeObserver:null,deps:[e.current]},({isInit:i,hook:s,queueEffect:o})=>(i&&(s.resizeObserver=new ResizeObserver(t),s.cleanup=()=>{s.resizeObserver?.disconnect?.(),s.resizeObserver=null}),o(()=>{He([e.current],s.deps)&&(s.deps=[e.current],s.resizeObserver?.disconnect?.(),e.current&&s.resizeObserver?.observe(e.current,n))}),{isSupported:Qn,start:()=>{s.resizeObserver==null&&(s.resizeObserver=new ResizeObserver(t),e.current&&s.resizeObserver.observe(e.current,n),s.cleanup=()=>{s.resizeObserver?.disconnect?.(),s.resizeObserver=null})},stop:()=>{Hn(s)}})):{isSupported:Qn,start:()=>{},stop:()=>{}}:{isSupported:Qn,start:()=>{},stop:()=>{}},Jn="window"in globalThis&&"MutationObserver"in globalThis.window,Hh=(e,t,n=void 0)=>yt()?Jn?_t("useMutationObserver",{mutationObserver:null,deps:[e.current]},({isInit:i,hook:s,queueEffect:o})=>(i?(o(()=>{s.deps=[e.current],s.mutationObserver=new MutationObserver(t),e.current&&s.mutationObserver.observe(e.current,n)}),s.cleanup=()=>{s.mutationObserver?.disconnect?.(),s.mutationObserver=null}):He([e.current],s.deps)&&(s.deps=[e.current],s.mutationObserver?.disconnect?.(),e.current&&s.mutationObserver?.observe(e.current,n)),{isSupported:Jn,start:()=>{s.mutationObserver==null&&(s.mutationObserver=new MutationObserver(t),e.current&&s.mutationObserver.observe(e.current,n),s.cleanup=()=>{s.mutationObserver?.disconnect?.(),s.mutationObserver=null})},stop:()=>{Hn(s)}})):{isSupported:Jn,start:()=>{},stop:()=>{}}:{isSupported:Jn,start:()=>{},stop:()=>{}},Vh=(e,t={windowScroll:!0,windowResize:!0})=>{const n=t?.windowScroll??!0,i=t?.windowResize??!0,s=t.immediate??!0,o=J(0),r=J(0),a=J(0),l=J(0),c=J(0),u=J(0),f=J(0),d=J(0),m=()=>{const y=e.current;if(!y){o.value=0,r.value=0,a.value=0,l.value=0,c.value=0,u.value=0,f.value=0,d.value=0;return}const x=y.getBoundingClientRect();o.value=x.width,r.value=x.height,a.value=x.top,l.value=x.right,c.value=x.bottom,u.value=x.left,f.value=x.x,d.value=x.y};return zh(e,m),Hh(e,m,{attributeFilter:["style","class"]}),Ae("scroll",()=>{n&&m()},{capture:!0,passive:!0}),Ae("resize",()=>{i&&m()},{passive:!0}),oo(()=>{s&&m()},[]),{width:o,height:r,top:a,right:l,bottom:c,left:u,x:f,y:d,update:m}};function Bh(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}const or=(e,t,n={})=>{const{ref:i,eventName:s="keydown",passive:o=!1}=n,r=Bh(e);return Ae(s,l=>{l.repeat&&!n.repeat||r(l)&&t(l)},{ref:i,passive:o})};function ho({value:e,className:t,...n}){const i=pl();return g("div",{className:_i("w-full p-2 z-10","bg-[#1d1d1d] border border-white border-opacity-10 rounded",t?.toString()),...n},g("input",{className:_i("px-2 py-1 w-full rounded focus:outline focus:outline-primary","bg-[#212121] border border-white border-opacity-10 rounded"),placeholder:"Filter...",type:"text",autocomplete:i+Math.random().toString(36).substring(2,15),name:"filter-search",id:"filter-search","bind:value":e}))}let U;"window"in globalThis&&window.opener&&(U=window.opener.__kiru);const qe=G(!1);Fe.addEventListener(e=>{e.data.type==="set-inspect-enabled"&&(qe.value=e.data.value)});const Sl=(U?.apps??[]).filter(e=>!An(e)),se=G(Sl);G(null);const Lt=G(Sl[0]??null),oe=G(null);U?.on("mount",e=>{An(e)||(se.value=[...se.peek(),e],Lt.peek()===null&&(Lt.value=e))});U?.on("unmount",e=>{se.value=se.peek().filter(t=>t!==e),Lt.peek()===e&&(Lt.value=se.peek()[0]??null)});const As=G(new Map),Rt=G(null),fo=G("");function Wh(e){return e.type.displayName??(e.type.name||"Anonymous Function")}function jh(e,t){const n=t.toLowerCase();return e.every(i=>n.includes(i))}function Is(e){return typeof e.type=="function"&&!Ku(e)&&!Zu(e)&&!Qu(e)}function $h(e){let t=[e];for(;t.length;){const n=t.pop();if(Is(n))return!0;n.child&&t.push(n.child),n.sibling&&t.push(n.sibling)}return!1}const Uh=(e,t)=>{const n=[t.parent];for(;n.length;){const i=n.pop();if(e===i)return!0;i?.parent&&n.push(i.parent)}return!1};function Ls(e,t){if(!e)return null;const n=t(e),i=Ls(e.sibling,t),s=Ls(e.child,t);return n?{ref:e,sibling:i??null,child:s??null}:i||s||null}function Ti({node:e,traverseSiblings:t=!0}){const[n,i]=ge(!0),o=oe.value===e,r=Si(()=>crypto.randomUUID(),[]),a=Si(()=>Rt.value==null?null:Uh(e,Rt.value),[Rt.value,e]);rt(()=>{a&&i(!1)},[a]),rt(()=>{if(!(!e||!Is(e)))return As.peek().set(r,{vNode:e,setCollapsed:i}),()=>{As.peek().delete(r)}});const l=fo.value;if(!e)return null;if(!Is(e)||l.length>0&&!jh(l.toLowerCase().split(" "),e.type.name))return g(Tt,null,e.child&&g(Ti,{node:e.child}),t&&g(rr,{node:e}));const c=e.child&&$h(e.child);return g(Tt,null,g("div",{className:"pl-4 mb-1"},g("h2",{onclick:()=>{Rt.value=null,oe.value=o?null:e},className:\`flex gap-2 items-center cursor-pointer mb-1 scroll-m-12 \${o?"font-medium bg-primary selected-vnode":""}\`,"data-id":r},c&&g(ce,{className:\`cursor-pointer transition \${n?"":"rotate-90"}\`,onclick:u=>{u.preventDefault(),u.stopImmediatePropagation(),Rt.value=null,i(f=>!f)}}),g("div",{className:c?"":"ml-6"},g("span",{className:o?"":"text-neutral-400"},"<"),g("span",{className:o?"":"text-primary"},Wh(e)),g("span",{className:o?"":"text-neutral-400"},">"))),!n&&e.child||a!=null&&a&&e.child?g(Ti,{node:e.child}):null),t&&g(rr,{node:e}))}function rr({node:e}){if(!e)return null;let t=[],n=e.sibling;for(;n;)t.push(n),n=n.sibling;return g(Tt,null,t.map(i=>g(Ti,{node:i,traverseSiblings:!1})))}const Yh=()=>{const e=Ne(null),t=r=>{if(!r)return null;const a=r.getAttribute("data-id");if(a!=null)return As.peek().get(a)},n=r=>{if(!r)return;const a=t(r);a!=null&&(r.scrollIntoView({behavior:"smooth"}),oe.value=a.vNode)},i=r=>{if(!r||r===document.body)return null;const a=r.parentElement,l=a?.nextElementSibling?.querySelector("h2[data-id]");return l||i(a)},s=()=>{const r=document.querySelector("h2[data-id]");n(r)},o=()=>{const r=document.querySelectorAll("h2[data-id]"),a=r.item(r.length-1);a&&n(a)};return or(["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],r=>{if(Rt.value&&(Rt.value=null),document.activeElement&&document.activeElement instanceof HTMLInputElement&&document.activeElement!=e.current)return;r.preventDefault();const a=document.querySelector(".selected-vnode");if(a===null){r.key==="ArrowDown"?s():r.key==="ArrowUp"&&o();return}if(r.key==="ArrowRight"){const l=t(a);l&&l.setCollapsed(!1);return}else if(r.key==="ArrowLeft"){const l=t(a);l&&l.setCollapsed(!0);return}if(r.key==="ArrowDown"){const l=a?.nextElementSibling?.querySelector("h2[data-id]");if(l)return n(l);const c=a.parentElement?.nextElementSibling?.querySelector("h2[data-id]");if(c)return n(c);const u=i(a);return u?n(u):s()}else if(r.key==="ArrowUp"){const l=a.parentElement?.previousElementSibling;if(l?.matches("h2[data-id]"))return n(l);const c=l?.querySelectorAll("h2[data-id]");return c?.length!=null&&c?.length>=1?n(c?.item?.(c.length-1)):o()}}),or("l",r=>{r.ctrlKey&&(r.preventDefault(),e.current?.focus({preventScroll:!1}))}),{searchRef:e}},Xh=e=>{fo.value=e.target.value,Rt.value&&(Rt.value=null)};function qh(){const{searchRef:e}=Yh(),t=Lt.value;return 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",{ref:e,className:"bg-[#171616] px-1 py-2 w-full focus:outline focus:outline-primary",placeholder:"Search for component",type:"text",value:fo,oninput:Xh})),t?.rootNode&&g(Ti,{node:t.rootNode}))}const kl=e=>{const{mouse:t}=Fh(),n=J(null),i=J(0),s=J(0),o=Ne(null),r=Vh(o),a=Ne(null),[l,c]=Array.isArray(e.children)?e.children:[];return oo(()=>{a.current&&(s.value=a.current.clientWidth/2)},[a.current]),Ae("mouseup",Xe(()=>n.value=null,[])),Ae("mousemove",Xe(u=>{if(n.value==null||a.current==null)return;const f=Math.max(i.value+u.x-n.value.x,250);s.value=Math.min(f,a.current.clientWidth-250)},[])),Ae("resize",Xe(()=>{a.current!=null&&a.current.clientWidth-250<s.value&&(s.value=Math.max(a.current.clientWidth-250,250))},[])),g("div",{onmousemove:u=>{u.x},ref:a,className:"flex-grow grid gap-2 items-start w-full relative",style:{gridTemplateColumns:\`\${s}px 1fr\`}},g("div",{ref:o,className:"firstContainer w-full h-full"},l),r.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:\`\${r.width}px\`},onmousedown:u=>{u.preventDefault(),n.value={...t.value},i.value=s.value}},g("div",{className:"dividerLine w-[5px] bg-neutral-800 h-full"})),g("div",{className:"secondContainer h-full"},c))},Gh=()=>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",className:"lucide lucide-square-mouse-pointer"},g("path",{d:"M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z"}),g("path",{d:"M21 11V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h6"})),Kh=()=>{qe.value=!qe.value,Fe.send({type:"set-inspect-enabled",value:qe.value})};function Zh(){const e=Lt.value,t=oe.value,n=pe();return rt(()=>{const i=s=>{s===e&&n()};return U?.on("update",i),()=>U?.off("update",i)},[Lt]),rt(()=>{const i=s=>{if(s.data.type!=="select-node")return;gh(window.__devtoolsSelection,"no selection ptr");const{app:o,node:r}=window.__devtoolsSelection;window.__devtoolsSelection=null,Lt.value=o,oe.value=r,Rt.value=r,qe.value=!1};return Fe.addEventListener(i),()=>Fe.removeEventListener(i)},[Lt]),g(Tt,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:i=>Lt.value=se.peek().find(s=>s.name===i.currentTarget.value)??null},g("option",{value:"",disabled:!0},"Select App"),se.value.map(i=>g("option",{key:i.id,value:i.name},i.name))),g("button",{title:"Toggle Component Inspection",onclick:Kh,className:\`p-1 rounded \${qe.value?"bg-neutral-900":""}\`},g(Gh,null)))),g(kl,null,e&&g(qh,null),t&&e&&g(Ih,{selectedApp:e,selectedNode:t,setSelectedNode:i=>oe.value=i,kiruGlobal:U})))}const Rs=G({}),Ce=G([]);U?.stores?.subscribe(e=>{Rs.value=e,Ce.value=Ce.value.filter(t=>Object.values(Rs.value).includes(t))});const Tl=G(""),Qh=Vn(()=>Tl.value.toLowerCase().split(" ").filter(e=>e.length>0));function Jh(e){return Qh.value.every(t=>e.toLowerCase().includes(t))}function tf(){const e=Object.entries(Rs.value);return e.length===0?g("div",{className:"flex flex-col items-center justify-center h-full text-neutral-400"},g(lo,null),g("h2",{className:"text-lg italic"},"No stores detected")):g("div",{className:"flex flex-col gap-2 items-start"},g(ho,{value:Tl,className:"sticky top-0"}),g("div",{className:"flex flex-col gap-2 w-full"},e.filter(([t])=>Jh(t)).map(([t,n])=>g(ef,{key:t,name:t,store:n}))))}function ef({name:e,store:t}){const n=Ce.value.includes(t),i=pe(),{value:s}=Ml(t);oo(()=>{const r=t.subscribe(()=>i());return()=>r()},[]);const o=Xe(()=>{n?Ce.value=Ce.value.filter(r=>r!==t):Ce.value=[...Ce.value,t]},[n]);return g("div",{className:"flex flex-col"},g("button",{onclick:o,className:"flex items-center gap-2 justify-between p-2 border border-white border-opacity-10 cursor-pointer"+(n?" bg-white bg-opacity-5 text-neutral-100 rounded-t":" hover:bg-white hover:bg-opacity-10 text-neutral-400 rounded")},e,g("div",{className:"flex gap-2"},g(Hi,{fn:t,onclick:r=>r.stopPropagation()}),g(ce,{className:"transition-all"+(n?" rotate-90":"")}))),n&&g("div",{className:"flex flex-col gap-2 p-2 border border-white border-opacity-10"},g(me,{data:{value:s},mutable:!0,objectRefAcc:[],onChange:(r,a)=>{const l=structuredClone({value:s});ro(l,r,a),t.setState(l.value)}}),g(nf,{store:t})))}function nf({store:e}){const t=se.value;return t.length===0?null:g(Tt,null,t.map(n=>g(sf,{store:e,app:n})))}const ar=Symbol.for("kiru.hmrAccept"),Ml=e=>{if(ar in e)return e[ar].provide().current;throw new Error("Unable to get store subscribers")};function sf({store:e,app:t}){const n=pe(),{subscribers:i,nodeStateMap:s}=Ml(e),o=t.rootNode.child;if(rt(()=>{const a=l=>{l===t&&n()};return U?.on("update",a),()=>U?.off("update",a)},[]),!o)return null;const r=Ls(o,a=>i.has(a));return g("div",{className:"flex flex-col gap-2 p-2 rounded-b border border-white border-opacity-10"},g("b",null,t.name),r&&g("ul",{className:"pl-8"},g(Ns,{node:r,nodeStateMap:s})))}function Ns({node:e,nodeStateMap:t}){const[n,i]=ge(!1),o=t.get(e.ref)?.slices??[];return g(Tt,null,g("li",{className:"flex flex-col gap-2"},g("div",{className:"flex flex-col border border-white border-opacity-10 rounded"+(n?" bg-white bg-opacity-5 text-neutral-100":" hover:bg-white hover:bg-opacity-10 text-neutral-400")},g("button",{onclick:()=>i(!n),className:"flex gap-2 p-2 justify-between cursor-pointer"},g("span",null,"<"+ao(e.ref)+" />"),g("div",{className:"flex gap-2 items-center"},g(Hi,{fn:e.ref.type,onclick:r=>r.stopPropagation()}),g(ce,{className:"transition-all"+(n?" rotate-90":"")}))),n&&g("div",{className:"flex flex-col gap-2 p-2 bg-[#1a1a1a]"},o.length===0&&g("div",{className:"p-2 bg-black bg-opacity-30 text-sm"},g("h5",{className:"border-b border-white border-opacity-10"},"No slices")),o.map(r=>g("div",{className:"flex flex-col gap-2"},g("div",{className:"p-2 bg-black bg-opacity-30 text-sm"},g("h5",{className:"border-b border-white border-opacity-10"},"Slice:"),g("pre",{className:"text-neutral-400"},g(me,{data:{value:r.value},mutable:!1,objectRefAcc:[],onChange:()=>{}}))),g("div",{className:"p-2 bg-black bg-opacity-30 text-sm"},g("h5",{className:"border-b border-white border-opacity-10"},"SliceFn:"),g("pre",{className:"text-neutral-400"},r.sliceFn?r.sliceFn.toString():"null")),r.eq&&g("div",{className:"p-2 bg-black bg-opacity-30 text-sm"},g("h5",{className:"border-b border-white border-opacity-10"},"eq:"),g("pre",{className:"text-neutral-400"},r.eq.toString())))))),e.child&&g("ul",{className:"pl-8 flex flex-col gap-2"},g(Ns,{node:e.child,nodeStateMap:t}))),e.sibling&&g(Ns,{node:e.sibling,nodeStateMap:t}))}/*!
|
|
9062
9062
|
* @kurkle/color v0.3.4
|
|
9063
9063
|
* https://github.com/kurkle/color#readme
|
|
9064
9064
|
* (c) 2024 Jukka Kurkela
|
|
9065
9065
|
* Released under the MIT License
|
|
9066
|
-
*/function Bn(e){return e+.5|0}const ee=(e,t,n)=>Math.max(Math.min(e,n),t);function
|
|
9066
|
+
*/function Bn(e){return e+.5|0}const ee=(e,t,n)=>Math.max(Math.min(e,n),t);function wn(e){return ee(Bn(e*2.55),0,255)}function re(e){return ee(Bn(e*255),0,255)}function Yt(e){return ee(Bn(e/2.55)/100,0,1)}function lr(e){return ee(Bn(e*100),0,100)}const bt={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},Fs=[..."0123456789ABCDEF"],of=e=>Fs[e&15],rf=e=>Fs[(e&240)>>4]+Fs[e&15],ti=e=>(e&240)>>4===(e&15),af=e=>ti(e.r)&&ti(e.g)&&ti(e.b)&&ti(e.a);function lf(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&bt[e[1]]*17,g:255&bt[e[2]]*17,b:255&bt[e[3]]*17,a:t===5?bt[e[4]]*17:255}:(t===7||t===9)&&(n={r:bt[e[1]]<<4|bt[e[2]],g:bt[e[3]]<<4|bt[e[4]],b:bt[e[5]]<<4|bt[e[6]],a:t===9?bt[e[7]]<<4|bt[e[8]]:255})),n}const cf=(e,t)=>e<255?t(e):"";function uf(e){var t=af(e)?of:rf;return e?"#"+t(e.r)+t(e.g)+t(e.b)+cf(e.a,t):void 0}const hf=/^(hsla?|hwb|hsv)\\(\\s*([-+.e\\d]+)(?:deg)?[\\s,]+([-+.e\\d]+)%[\\s,]+([-+.e\\d]+)%(?:[\\s,]+([-+.e\\d]+)(%)?)?\\s*\\)$/;function El(e,t,n){const 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 ff(e,t,n){const 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 df(e,t,n){const i=El(e,1,.5);let 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 pf(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 po(e){const 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;let l,c,u;return o!==r&&(u=o-r,c=a>.5?u/(2-o-r):u/(o+r),l=pf(n,i,s,u,o),l=l*60+.5),[l|0,c||0,a]}function go(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(re)}function mo(e,t,n){return go(El,e,t,n)}function gf(e,t,n){return go(df,e,t,n)}function mf(e,t,n){return go(ff,e,t,n)}function Cl(e){return(e%360+360)%360}function bf(e){const t=hf.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?wn(+t[5]):re(+t[5]));const s=Cl(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?i=gf(s,o,r):t[1]==="hsv"?i=mf(s,o,r):i=mo(s,o,r),{r:i[0],g:i[1],b:i[2],a:n}}function xf(e,t){var n=po(e);n[0]=Cl(n[0]+t),n=mo(n),e.r=n[0],e.g=n[1],e.b=n[2]}function yf(e){if(!e)return;const t=po(e),n=t[0],i=lr(t[1]),s=lr(t[2]);return e.a<255?\`hsla(\${n}, \${i}%, \${s}%, \${Yt(e.a)})\`:\`hsl(\${n}, \${i}%, \${s}%)\`}const cr={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"},ur={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"};function vf(){const e={},t=Object.keys(ur),n=Object.keys(cr);let 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,cr[o]);o=parseInt(ur[r],16),e[a]=[o>>16&255,o>>8&255,o&255]}return e}let ei;function _f(e){ei||(ei=vf(),ei.transparent=[0,0,0,0]);const t=ei[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const wf=/^rgba?\\(\\s*([-+.\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?(?:[\\s,/]+([-+.e\\d]+)(%)?)?\\s*\\)$/;function Sf(e){const t=wf.exec(e);let n=255,i,s,o;if(t){if(t[7]!==i){const r=+t[7];n=t[8]?wn(r):ee(r*255,0,255)}return i=+t[1],s=+t[3],o=+t[5],i=255&(t[2]?wn(i):ee(i,0,255)),s=255&(t[4]?wn(s):ee(s,0,255)),o=255&(t[6]?wn(o):ee(o,0,255)),{r:i,g:s,b:o,a:n}}}function kf(e){return e&&(e.a<255?\`rgba(\${e.r}, \${e.g}, \${e.b}, \${Yt(e.a)})\`:\`rgb(\${e.r}, \${e.g}, \${e.b})\`)}const es=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Ue=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function Tf(e,t,n){const i=Ue(Yt(e.r)),s=Ue(Yt(e.g)),o=Ue(Yt(e.b));return{r:re(es(i+n*(Ue(Yt(t.r))-i))),g:re(es(s+n*(Ue(Yt(t.g))-s))),b:re(es(o+n*(Ue(Yt(t.b))-o))),a:e.a+n*(t.a-e.a)}}function ni(e,t,n){if(e){let i=po(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=mo(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function Ol(e,t){return e&&Object.assign(t||{},e)}function hr(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=re(e[3]))):(t=Ol(e,{r:0,g:0,b:0,a:1}),t.a=re(t.a)),t}function Mf(e){return e.charAt(0)==="r"?Sf(e):bf(e)}class In{constructor(t){if(t instanceof In)return t;const n=typeof t;let i;n==="object"?i=hr(t):n==="string"&&(i=lf(t)||_f(t)||Mf(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Ol(this._rgb);return t&&(t.a=Yt(t.a)),t}set rgb(t){this._rgb=hr(t)}rgbString(){return this._valid?kf(this._rgb):void 0}hexString(){return this._valid?uf(this._rgb):void 0}hslString(){return this._valid?yf(this._rgb):void 0}mix(t,n){if(t){const i=this.rgb,s=t.rgb;let o;const 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=Tf(this._rgb,t._rgb,n)),this}clone(){return new In(this.rgb)}alpha(t){return this._rgb.a=re(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Bn(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return ni(this._rgb,2,t),this}darken(t){return ni(this._rgb,2,-t),this}saturate(t){return ni(this._rgb,1,t),this}desaturate(t){return ni(this._rgb,1,-t),this}rotate(t){return xf(this._rgb,t),this}}/*!
|
|
9067
9067
|
* Chart.js v4.5.0
|
|
9068
9068
|
* https://www.chartjs.org
|
|
9069
9069
|
* (c) 2025 Chart.js Contributors
|
|
9070
9070
|
* Released under the MIT License
|
|
9071
|
-
*/function jt(){}const Tf=(()=>{let e=0;return()=>e++})();function B(e){return e==null}function tt(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function V(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function _t(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function At(e,t){return _t(e)?e:t}function R(e,t){return typeof e>"u"?t:e}const Mf=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function I(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function F(e,t,n,i){let s,o,r;if(tt(e))for(o=e.length,s=0;s<o;s++)t.call(n,e[s],s);else if(V(e))for(r=Object.keys(e),o=r.length,s=0;s<o;s++)t.call(n,e[r[s]],r[s])}function Ei(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 Ci(e){if(tt(e))return e.map(Ci);if(V(e)){const t=Object.create(null),n=Object.keys(e),i=n.length;let s=0;for(;s<i;++s)t[n[s]]=Ci(e[n[s]]);return t}return e}function Tl(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function Ef(e,t,n,i){if(!Tl(e))return;const s=t[e],o=n[e];V(s)&&V(o)?Rn(s,o,i):t[e]=Ci(o)}function Rn(e,t,n){const i=tt(t)?t:[t],s=i.length;if(!V(e))return e;n=n||{};const o=n.merger||Ef;let r;for(let a=0;a<s;++a){if(r=i[a],!V(r))continue;const l=Object.keys(r);for(let c=0,u=l.length;c<u;++c)o(l[c],e,r,n)}return e}function En(e,t){return Rn(e,t,{merger:Cf})}function Cf(e,t,n){if(!Tl(e))return;const i=t[e],s=n[e];V(i)&&V(s)?En(i,s):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Ci(s))}const ur={"":e=>e,x:e=>e.x,y:e=>e.y};function Of(e){const t=e.split("."),n=[];let i="";for(const s of t)i+=s,i.endsWith("\\\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function Pf(e){const t=Of(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function Oi(e,t){return(ur[t]||(ur[t]=Pf(t)))(e)}function mo(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Pi=e=>typeof e<"u",ce=e=>typeof e=="function",hr=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function Df(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const et=Math.PI,Ht=2*et,Af=Ht+et,Di=Number.POSITIVE_INFINITY,If=et/180,Tt=et/2,we=et/4,fr=et*2/3,Ml=Math.log10,ue=Math.sign;function De(e,t,n){return Math.abs(e-t)<n}function dr(e){const t=Math.round(e);e=De(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(Ml(e))),i=e/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function Lf(e){const t=[],n=Math.sqrt(e);let 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 Rf(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Nn(e){return!Rf(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function Nf(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function Ff(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 Ce(e){return e*(et/180)}function zf(e){return e*(180/et)}function pr(e){if(!_t(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function Hf(e,t){const n=t.x-e.x,i=t.y-e.y,s=Math.sqrt(n*n+i*i);let o=Math.atan2(i,n);return o<-.5*et&&(o+=Ht),{angle:o,distance:s}}function Fs(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Vf(e,t){return(e-t+Af)%Ht-et}function Jt(e){return(e%Ht+Ht)%Ht}function El(e,t,n,i){const s=Jt(e),o=Jt(t),r=Jt(n),a=Jt(o-s),l=Jt(r-s),c=Jt(s-o),u=Jt(s-r);return s===o||s===r||i&&o===r||a>l&&c<u}function yt(e,t,n){return Math.max(t,Math.min(n,e))}function Bf(e){return yt(e,-32768,32767)}function kn(e,t,n,i=1e-6){return e>=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function bo(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}}const Oe=(e,t,n,i)=>bo(e,n,i?s=>{const o=e[s][t];return o<n||o===n&&e[s+1][t]===n}:s=>e[s][t]<n),Wf=(e,t,n)=>bo(e,n,i=>e[i][t]>=n);function jf(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}const Cl=["push","pop","shift","splice","unshift"];function Uf(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Cl.forEach(n=>{const i="_onData"+mo(n),s=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){const r=s.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...o)}),r}})})}function gr(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(Cl.forEach(o=>{delete e[o]}),delete e._chartjs)}function $f(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const Ol=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function Pl(e,t){let n=[],i=!1;return function(...s){n=s,i||(i=!0,Ol.call(window,()=>{i=!1,e.apply(t,n)}))}}function Yf(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const Dl=e=>e==="start"?"left":e==="end"?"right":"center",ft=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,Xf=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function qf(e,t,n){const i=t.length;let s=0,o=i;if(e._sorted){const{iScale:r,vScale:a,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=r.axis,{min:f,max:p,minDefined:m,maxDefined:y}=r.getUserBounds();if(m){if(s=Math.min(Oe(l,u,f).lo,n?i:Oe(t,u,r.getPixelForValue(f)).lo),c){const x=l.slice(0,s+1).reverse().findIndex(v=>!B(v[a.axis]));s-=Math.max(0,x)}s=yt(s,0,i-1)}if(y){let x=Math.max(Oe(l,r.axis,p,!0).hi+1,n?0:Oe(t,u,r.getPixelForValue(p),!0).hi+1);if(c){const v=l.slice(x-1).findIndex(w=>!B(w[a.axis]));x+=Math.max(0,v)}o=yt(x,s,i)-s}else o=i-s}return{start:s,count:o}}function Kf(e){const{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;const o=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,s),o}const ii=e=>e===0||e===1,mr=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Ht/n)),br=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Ht/n)+1,Cn={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*Tt)+1,easeOutSine:e=>Math.sin(e*Tt),easeInOutSine:e=>-.5*(Math.cos(et*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=>ii(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=>ii(e)?e:mr(e,.075,.3),easeOutElastic:e=>ii(e)?e:br(e,.075,.3),easeInOutElastic(e){return ii(e)?e:e<.5?.5*mr(e*2,.1125,.45):.5+.5*br(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-Cn.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?Cn.easeInBounce(e*2)*.5:Cn.easeOutBounce(e*2-1)*.5+.5};function xo(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function xr(e){return xo(e)?e:new Ln(e)}function is(e){return xo(e)?e:new Ln(e).saturate(.5).darken(.1).hexString()}const Gf=["x","y","borderWidth","radius","tension"],Zf=["color","borderColor","backgroundColor"];function Qf(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:Zf},numbers:{type:"number",properties:Gf}}),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 Jf(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const yr=new Map;function td(e,t){t=t||{};const n=e+JSON.stringify(t);let i=yr.get(n);return i||(i=new Intl.NumberFormat(e,t),yr.set(n,i)),i}function Al(e,t,n){return td(t,n).format(e)}const ed={values(e){return tt(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const i=this.chart.options.locale;let s,o=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=nd(e,n)}const r=Ml(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),Al(e,i,l)}};function nd(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}var Il={formatters:ed};function id(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:Il.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"})}const Le=Object.create(null),zs=Object.create(null);function On(e,t){if(!t)return e;const n=t.split(".");for(let i=0,s=n.length;i<s;++i){const o=n[i];e=e[o]||(e[o]=Object.create(null))}return e}function ss(e,t,n){return typeof t=="string"?Rn(On(e,t),n):Rn(On(e,""),t)}class sd{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)=>is(s.backgroundColor),this.hoverBorderColor=(i,s)=>is(s.borderColor),this.hoverColor=(i,s)=>is(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 ss(this,t,n)}get(t){return On(this,t)}describe(t,n){return ss(zs,t,n)}override(t,n){return ss(Le,t,n)}route(t,n,i,s){const o=On(this,t),r=On(this,i),a="_"+n;Object.defineProperties(o,{[a]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=r[s];return V(l)?Object.assign({},c,l):R(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var Y=new sd({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Qf,Jf,id]);function od(e){return!e||B(e.size)||B(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function vr(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 Se(e,t,n){const i=e.currentDevicePixelRatio,s=n!==0?Math.max(n/2,.5):0;return Math.round((t-s)*i)/i+s}function _r(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Hs(e,t,n,i){Ll(e,t,n,i,null)}function Ll(e,t,n,i,s){let o,r,a,l,c,u,f,p;const m=t.pointStyle,y=t.rotation,x=t.radius;let v=(y||0)*If;if(m&&typeof m=="object"&&(o=m.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(n,i),e.rotate(v),e.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),e.restore();return}if(!(isNaN(x)||x<=0)){switch(e.beginPath(),m){default:s?e.ellipse(n,i,s/2,x,0,0,Ht):e.arc(n,i,x,0,Ht),e.closePath();break;case"triangle":u=s?s/2:x,e.moveTo(n+Math.sin(v)*u,i-Math.cos(v)*x),v+=fr,e.lineTo(n+Math.sin(v)*u,i-Math.cos(v)*x),v+=fr,e.lineTo(n+Math.sin(v)*u,i-Math.cos(v)*x),e.closePath();break;case"rectRounded":c=x*.516,l=x-c,r=Math.cos(v+we)*l,f=Math.cos(v+we)*(s?s/2-c:l),a=Math.sin(v+we)*l,p=Math.sin(v+we)*(s?s/2-c:l),e.arc(n-f,i-a,c,v-et,v-Tt),e.arc(n+p,i-r,c,v-Tt,v),e.arc(n+f,i+a,c,v,v+Tt),e.arc(n-p,i+r,c,v+Tt,v+et),e.closePath();break;case"rect":if(!y){l=Math.SQRT1_2*x,u=s?s/2:l,e.rect(n-u,i-l,2*u,2*l);break}v+=we;case"rectRot":f=Math.cos(v)*(s?s/2:x),r=Math.cos(v)*x,a=Math.sin(v)*x,p=Math.sin(v)*(s?s/2:x),e.moveTo(n-f,i-a),e.lineTo(n+p,i-r),e.lineTo(n+f,i+a),e.lineTo(n-p,i+r),e.closePath();break;case"crossRot":v+=we;case"cross":f=Math.cos(v)*(s?s/2:x),r=Math.cos(v)*x,a=Math.sin(v)*x,p=Math.sin(v)*(s?s/2:x),e.moveTo(n-f,i-a),e.lineTo(n+f,i+a),e.moveTo(n+p,i-r),e.lineTo(n-p,i+r);break;case"star":f=Math.cos(v)*(s?s/2:x),r=Math.cos(v)*x,a=Math.sin(v)*x,p=Math.sin(v)*(s?s/2:x),e.moveTo(n-f,i-a),e.lineTo(n+f,i+a),e.moveTo(n+p,i-r),e.lineTo(n-p,i+r),v+=we,f=Math.cos(v)*(s?s/2:x),r=Math.cos(v)*x,a=Math.sin(v)*x,p=Math.sin(v)*(s?s/2:x),e.moveTo(n-f,i-a),e.lineTo(n+f,i+a),e.moveTo(n+p,i-r),e.lineTo(n-p,i+r);break;case"line":r=s?s/2:Math.cos(v)*x,a=Math.sin(v)*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(v)*(s?s/2:x),i+Math.sin(v)*x);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function en(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 yo(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function vo(e){e.restore()}function rd(e,t,n,i,s){if(!t)return e.lineTo(n.x,n.y);if(s==="middle"){const 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 ad(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 ld(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),B(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 cd(e,t,n,i,s){if(s.strikethrough||s.underline){const 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 ud(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Ai(e,t,n,i,s,o={}){const r=tt(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(e.save(),e.font=s.string,ld(e,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&ud(e,o.backdrop),a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),B(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,n,i,o.maxWidth)),e.fillText(c,n,i,o.maxWidth),cd(e,n,i,c,o),i+=Number(s.lineHeight);e.restore()}function Vs(e,t){const{x:n,y:i,w:s,h:o,radius:r}=t;e.arc(n+r.topLeft,i+r.topLeft,r.topLeft,1.5*et,et,!0),e.lineTo(n,i+o-r.bottomLeft),e.arc(n+r.bottomLeft,i+o-r.bottomLeft,r.bottomLeft,et,Tt,!0),e.lineTo(n+s-r.bottomRight,i+o),e.arc(n+s-r.bottomRight,i+o-r.bottomRight,r.bottomRight,Tt,0,!0),e.lineTo(n+s,i+r.topRight),e.arc(n+s-r.topRight,i+r.topRight,r.topRight,0,-Tt,!0),e.lineTo(n+r.topLeft,i)}const hd=/^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/,fd=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function dd(e,t){const n=(""+e).match(hd);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}const pd=e=>+e||0;function Rl(e,t){const n={},i=V(t),s=i?Object.keys(t):t,o=V(e)?i?r=>R(e[r],e[t[r]]):r=>e[r]:()=>e;for(const r of s)n[r]=pd(o(r));return n}function gd(e){return Rl(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Pn(e){return Rl(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Ct(e){const t=gd(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function ht(e,t){e=e||{},t=t||Y.font;let n=R(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=R(e.style,t.style);i&&!(""+i).match(fd)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:R(e.family,t.family),lineHeight:dd(R(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:R(e.weight,t.weight),string:""};return s.string=od(s),s}function si(e,t,n,i){let s,o,r;for(s=0,o=e.length;s<o;++s)if(r=e[s],r!==void 0&&r!==void 0)return r}function md(e,t,n){const{min:i,max:s}=e,o=Mf(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 Ne(e,t){return Object.assign(Object.create(e),t)}function _o(e,t=[""],n,i,s=()=>e[0]){const o=n||e;typeof i>"u"&&(i=Hl("_fallback",e));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:i,_getTarget:s,override:a=>_o([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 Fl(a,l,()=>kd(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return Sr(a).includes(l)},ownKeys(a){return Sr(a)},set(a,l,c){const u=a._storage||(a._storage=s());return a[l]=u[l]=c,delete a._keys,!0}})}function nn(e,t,n,i){const s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:Nl(e,i),setContext:o=>nn(e,o,n,i),override:o=>nn(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 Fl(o,r,()=>xd(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 Nl(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:n,indexable:i,isScriptable:ce(n)?n:()=>n,isIndexable:ce(i)?i:()=>i}}const bd=(e,t)=>e?e+mo(t):t,wo=(e,t)=>V(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Fl(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const i=n();return e[t]=i,i}function xd(e,t,n){const{_proxy:i,_context:s,_subProxy:o,_descriptors:r}=e;let a=i[t];return ce(a)&&r.isScriptable(t)&&(a=yd(t,a,e,n)),tt(a)&&a.length&&(a=vd(t,a,e,r.isIndexable)),wo(t,a)&&(a=nn(a,s,o&&o[t],r)),a}function yd(e,t,n,i){const{_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),wo(e,l)&&(l=So(s._scopes,s,e,l)),l}function vd(e,t,n,i){const{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=n;if(typeof o.index<"u"&&i(e))return t[o.index%t.length];if(V(t[0])){const l=t,c=s._scopes.filter(u=>u!==l);t=[];for(const u of l){const f=So(c,s,e,u);t.push(nn(f,o,r&&r[e],a))}}return t}function zl(e,t,n){return ce(e)?e(t,n):e}const _d=(e,t)=>e===!0?t:typeof e=="string"?Oi(t,e):void 0;function wd(e,t,n,i,s){for(const o of t){const r=_d(n,o);if(r){e.add(r);const a=zl(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 So(e,t,n,i){const s=t._rootScopes,o=zl(t._fallback,n,i),r=[...e,...s],a=new Set;a.add(i);let l=wr(a,r,n,o||n,i);return l===null||typeof o<"u"&&o!==n&&(l=wr(a,r,o,l,i),l===null)?!1:_o(Array.from(a),[""],s,o,()=>Sd(t,n,i))}function wr(e,t,n,i,s){for(;n;)n=wd(e,t,n,i,s);return n}function Sd(e,t,n){const i=e._getTarget();t in i||(i[t]={});const s=i[t];return tt(s)&&V(n)?n:s||{}}function kd(e,t,n,i){let s;for(const o of t)if(s=Hl(bd(o,e),n),typeof s<"u")return wo(e,s)?So(n,i,e,s):s}function Hl(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function Sr(e){let t=e._keys;return t||(t=e._keys=Td(e._scopes)),t}function Td(e){const t=new Set;for(const n of e)for(const i of Object.keys(n).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}const Md=Number.EPSILON||1e-14,sn=(e,t)=>t<e.length&&!e[t].skip&&e[t],Vl=e=>e==="x"?"y":"x";function Ed(e,t,n,i){const s=e.skip?t:e,o=t,r=n.skip?t:n,a=Fs(o,s),l=Fs(r,o);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const f=i*c,p=i*u;return{previous:{x:o.x-f*(r.x-s.x),y:o.y-f*(r.y-s.y)},next:{x:o.x+p*(r.x-s.x),y:o.y+p*(r.y-s.y)}}}function Cd(e,t,n){const i=e.length;let s,o,r,a,l,c=sn(e,0);for(let u=0;u<i-1;++u)if(l=c,c=sn(e,u+1),!(!l||!c)){if(De(t[u],0,Md)){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 Od(e,t,n="x"){const i=Vl(n),s=e.length;let o,r,a,l=sn(e,0);for(let c=0;c<s;++c){if(r=a,a=l,l=sn(e,c+1),!a)continue;const u=a[n],f=a[i];r&&(o=(u-r[n])/3,a[\`cp1\${n}\`]=u-o,a[\`cp1\${i}\`]=f-o*t[c]),l&&(o=(l[n]-u)/3,a[\`cp2\${n}\`]=u+o,a[\`cp2\${i}\`]=f+o*t[c])}}function Pd(e,t="x"){const n=Vl(t),i=e.length,s=Array(i).fill(0),o=Array(i);let r,a,l,c=sn(e,0);for(r=0;r<i;++r)if(a=l,l=c,c=sn(e,r+1),!!l){if(c){const u=c[t]-l[t];s[r]=u!==0?(c[n]-l[n])/u:0}o[r]=a?c?ue(s[r-1])!==ue(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}Cd(e,s,o),Od(e,o,t)}function oi(e,t,n){return Math.max(Math.min(e,n),t)}function Dd(e,t){let n,i,s,o,r,a=en(e[0],t);for(n=0,i=e.length;n<i;++n)r=o,o=a,a=n<i-1&&en(e[n+1],t),o&&(s=e[n],r&&(s.cp1x=oi(s.cp1x,t.left,t.right),s.cp1y=oi(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=oi(s.cp2x,t.left,t.right),s.cp2y=oi(s.cp2y,t.top,t.bottom)))}function Ad(e,t,n,i,s){let o,r,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Pd(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=Ed(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&&Dd(e,n)}function ko(){return typeof window<"u"&&typeof document<"u"}function To(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Ii(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}const Bi=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function Id(e,t){return Bi(e).getPropertyValue(t)}const Ld=["top","right","bottom","left"];function Ae(e,t,n){const i={};n=n?"-"+n:"";for(let s=0;s<4;s++){const o=Ld[s];i[o]=parseFloat(e[t+"-"+o+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Rd=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function Nd(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:s,offsetY:o}=i;let r=!1,a,l;if(Rd(s,o,e.target))a=s,l=o;else{const c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function Rt(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,s=Bi(n),o=s.boxSizing==="border-box",r=Ae(s,"padding"),a=Ae(s,"border","width"),{x:l,y:c,box:u}=Nd(e,n),f=r.left+(u&&a.left),p=r.top+(u&&a.top);let{width:m,height:y}=t;return o&&(m-=r.width+a.width,y-=r.height+a.height),{x:Math.round((l-f)/m*n.width/i),y:Math.round((c-p)/y*n.height/i)}}function Fd(e,t,n){let i,s;if(t===void 0||n===void 0){const o=e&&To(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const r=o.getBoundingClientRect(),a=Bi(o),l=Ae(a,"border","width"),c=Ae(a,"padding");t=r.width-c.width-l.width,n=r.height-c.height-l.height,i=Ii(a.maxWidth,o,"clientWidth"),s=Ii(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:i||Di,maxHeight:s||Di}}const ri=e=>Math.round(e*10)/10;function zd(e,t,n,i){const s=Bi(e),o=Ae(s,"margin"),r=Ii(s.maxWidth,e,"clientWidth")||Di,a=Ii(s.maxHeight,e,"clientHeight")||Di,l=Fd(e,t,n);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const p=Ae(s,"border","width"),m=Ae(s,"padding");c-=m.width+p.width,u-=m.height+p.height}return c=Math.max(0,c-o.width),u=Math.max(0,i?c/i:u-o.height),c=ri(Math.min(c,r,l.maxWidth)),u=ri(Math.min(u,a,l.maxHeight)),c&&!u&&(u=ri(c/2)),(t!==void 0||n!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=ri(Math.floor(u*i))),{width:c,height:u}}function kr(e,t,n){const i=t||1,s=Math.floor(e.height*i),o=Math.floor(e.width*i);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const 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}const Hd=(function(){let e=!1;try{const t={get passive(){return e=!0,!1}};ko()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();function Tr(e,t){const n=Id(e,t),i=n&&n.match(/^(\\d+)(\\.\\d+)?px$/);return i?+i[1]:void 0}function Te(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function Vd(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 Bd(e,t,n,i){const s={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},r=Te(e,s,n),a=Te(s,o,n),l=Te(o,t,n),c=Te(r,a,n),u=Te(a,l,n);return Te(c,u,n)}const Wd=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}}},jd=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Ye(e,t,n){return e?Wd(t,n):jd()}function Bl(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 Wl(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function jl(e){return e==="angle"?{between:El,compare:Vf,normalize:Jt}:{between:kn,compare:(t,n)=>t-n,normalize:t=>t}}function Mr({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 Ud(e,t,n){const{property:i,start:s,end:o}=n,{between:r,normalize:a}=jl(i),l=t.length;let{start:c,end:u,loop:f}=e,p,m;if(f){for(c+=l,u+=l,p=0,m=l;p<m&&r(a(t[c%l][i]),s,o);++p)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:f,style:e.style}}function $d(e,t,n){if(!n)return[e];const{property:i,start:s,end:o}=n,r=t.length,{compare:a,between:l,normalize:c}=jl(i),{start:u,end:f,loop:p,style:m}=Ud(e,t,n),y=[];let x=!1,v=null,w,k,C;const O=()=>l(s,C,w)&&a(s,C)!==0,T=()=>a(o,w)===0||l(o,C,w),D=()=>x||O(),P=()=>!x||T();for(let E=u,A=u;E<=f;++E)k=t[E%r],!k.skip&&(w=c(k[i]),w!==C&&(x=l(w,s,o),v===null&&D()&&(v=a(w,s)===0?E:A),v!==null&&P()&&(y.push(Mr({start:v,end:E,loop:p,count:r,style:m})),v=null),A=E,C=w));return v!==null&&y.push(Mr({start:v,end:f,loop:p,count:r,style:m})),y}function Yd(e,t){const n=[],i=e.segments;for(let s=0;s<i.length;s++){const o=$d(i[s],e.points,t);o.length&&n.push(...o)}return n}function Xd(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 qd(e,t,n,i){const s=e.length,o=[];let r=t,a=e[t],l;for(l=t+1;l<=n;++l){const 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 Kd(e,t){const n=e.points,i=e.options.spanGaps,s=n.length;if(!s)return[];const o=!!e._loop,{start:r,end:a}=Xd(n,s,o,i);if(i===!0)return Er(e,[{start:r,end:a,loop:o}],n,t);const l=a<r?a+s:a,c=!!e._fullLoop&&r===0&&a===s-1;return Er(e,qd(n,r,l,c),n,t)}function Er(e,t,n,i){return!i||!i.setContext||!n?t:Gd(e,t,n,i)}function Gd(e,t,n,i){const s=e._chart.getContext(),o=Cr(e.options),{_datasetIndex:r,options:{spanGaps:a}}=e,l=n.length,c=[];let u=o,f=t[0].start,p=f;function m(y,x,v,w){const k=a?-1:1;if(y!==x){for(y+=l;n[y%l].skip;)y-=k;for(;n[x%l].skip;)x+=k;y%l!==x%l&&(c.push({start:y%l,end:x%l,loop:v,style:w}),u=w,f=x%l)}}for(const y of t){f=a?f:y.start;let x=n[f%l],v;for(p=f+1;p<=y.end;p++){const w=n[p%l];v=Cr(i.setContext(Ne(s,{type:"segment",p0:x,p1:w,p0DataIndex:(p-1)%l,p1DataIndex:p%l,datasetIndex:r}))),Zd(v,u)&&m(f,p-1,y.loop,u),x=w,u=v}f<p-1&&m(f,p-1,y.loop,u)}return c}function Cr(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function Zd(e,t){if(!t)return!1;const n=[],i=function(s,o){return xo(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(e,i)!==JSON.stringify(t,i)}function ai(e,t,n){return e.options.clip?e[n]:t[n]}function Qd(e,t){const{xScale:n,yScale:i}=e;return n&&i?{left:ai(n,t,"left"),right:ai(n,t,"right"),top:ai(i,t,"top"),bottom:ai(i,t,"bottom")}:t}function Jd(e,t){const n=t._clip;if(n.disabled)return!1;const i=Qd(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)}}/*!
|
|
9071
|
+
*/function jt(){}const Ef=(()=>{let e=0;return()=>e++})();function B(e){return e==null}function tt(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function V(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function vt(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Pt(e,t){return vt(e)?e:t}function R(e,t){return typeof e>"u"?t:e}const Cf=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function I(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function F(e,t,n,i){let s,o,r;if(tt(e))for(o=e.length,s=0;s<o;s++)t.call(n,e[s],s);else if(V(e))for(r=Object.keys(e),o=r.length,s=0;s<o;s++)t.call(n,e[r[s]],r[s])}function Mi(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 Ei(e){if(tt(e))return e.map(Ei);if(V(e)){const t=Object.create(null),n=Object.keys(e),i=n.length;let s=0;for(;s<i;++s)t[n[s]]=Ei(e[n[s]]);return t}return e}function Pl(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function Of(e,t,n,i){if(!Pl(e))return;const s=t[e],o=n[e];V(s)&&V(o)?Ln(s,o,i):t[e]=Ei(o)}function Ln(e,t,n){const i=tt(t)?t:[t],s=i.length;if(!V(e))return e;n=n||{};const o=n.merger||Of;let r;for(let a=0;a<s;++a){if(r=i[a],!V(r))continue;const l=Object.keys(r);for(let c=0,u=l.length;c<u;++c)o(l[c],e,r,n)}return e}function Mn(e,t){return Ln(e,t,{merger:Pf})}function Pf(e,t,n){if(!Pl(e))return;const i=t[e],s=n[e];V(i)&&V(s)?Mn(i,s):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Ei(s))}const fr={"":e=>e,x:e=>e.x,y:e=>e.y};function Df(e){const t=e.split("."),n=[];let i="";for(const s of t)i+=s,i.endsWith("\\\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function Af(e){const t=Df(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function Ci(e,t){return(fr[t]||(fr[t]=Af(t)))(e)}function bo(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Oi=e=>typeof e<"u",ue=e=>typeof e=="function",dr=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function If(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const et=Math.PI,Ft=2*et,Lf=Ft+et,Pi=Number.POSITIVE_INFINITY,Rf=et/180,kt=et/2,Se=et/4,pr=et*2/3,Dl=Math.log10,he=Math.sign;function Ie(e,t,n){return Math.abs(e-t)<n}function gr(e){const t=Math.round(e);e=Ie(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(Dl(e))),i=e/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function Nf(e){const t=[],n=Math.sqrt(e);let 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 Ff(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Rn(e){return!Ff(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function zf(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function Hf(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 Pe(e){return e*(et/180)}function Vf(e){return e*(180/et)}function mr(e){if(!vt(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function Bf(e,t){const n=t.x-e.x,i=t.y-e.y,s=Math.sqrt(n*n+i*i);let o=Math.atan2(i,n);return o<-.5*et&&(o+=Ft),{angle:o,distance:s}}function zs(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Wf(e,t){return(e-t+Lf)%Ft-et}function Jt(e){return(e%Ft+Ft)%Ft}function Al(e,t,n,i){const s=Jt(e),o=Jt(t),r=Jt(n),a=Jt(o-s),l=Jt(r-s),c=Jt(s-o),u=Jt(s-r);return s===o||s===r||i&&o===r||a>l&&c<u}function xt(e,t,n){return Math.max(t,Math.min(n,e))}function jf(e){return xt(e,-32768,32767)}function Sn(e,t,n,i=1e-6){return e>=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function xo(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}}const De=(e,t,n,i)=>xo(e,n,i?s=>{const o=e[s][t];return o<n||o===n&&e[s+1][t]===n}:s=>e[s][t]<n),$f=(e,t,n)=>xo(e,n,i=>e[i][t]>=n);function Uf(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}const Il=["push","pop","shift","splice","unshift"];function Yf(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Il.forEach(n=>{const i="_onData"+bo(n),s=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){const r=s.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...o)}),r}})})}function br(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(Il.forEach(o=>{delete e[o]}),delete e._chartjs)}function Xf(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const Ll=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function Rl(e,t){let n=[],i=!1;return function(...s){n=s,i||(i=!0,Ll.call(window,()=>{i=!1,e.apply(t,n)}))}}function qf(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const Nl=e=>e==="start"?"left":e==="end"?"right":"center",ft=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,Gf=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function Kf(e,t,n){const i=t.length;let s=0,o=i;if(e._sorted){const{iScale:r,vScale:a,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=r.axis,{min:f,max:d,minDefined:m,maxDefined:y}=r.getUserBounds();if(m){if(s=Math.min(De(l,u,f).lo,n?i:De(t,u,r.getPixelForValue(f)).lo),c){const x=l.slice(0,s+1).reverse().findIndex(v=>!B(v[a.axis]));s-=Math.max(0,x)}s=xt(s,0,i-1)}if(y){let x=Math.max(De(l,r.axis,d,!0).hi+1,n?0:De(t,u,r.getPixelForValue(d),!0).hi+1);if(c){const v=l.slice(x-1).findIndex(w=>!B(w[a.axis]));x+=Math.max(0,v)}o=xt(x,s,i)-s}else o=i-s}return{start:s,count:o}}function Zf(e){const{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;const o=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,s),o}const ii=e=>e===0||e===1,xr=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Ft/n)),yr=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Ft/n)+1,En={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*kt)+1,easeOutSine:e=>Math.sin(e*kt),easeInOutSine:e=>-.5*(Math.cos(et*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=>ii(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=>ii(e)?e:xr(e,.075,.3),easeOutElastic:e=>ii(e)?e:yr(e,.075,.3),easeInOutElastic(e){return ii(e)?e:e<.5?.5*xr(e*2,.1125,.45):.5+.5*yr(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-En.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?En.easeInBounce(e*2)*.5:En.easeOutBounce(e*2-1)*.5+.5};function yo(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function vr(e){return yo(e)?e:new In(e)}function ns(e){return yo(e)?e:new In(e).saturate(.5).darken(.1).hexString()}const Qf=["x","y","borderWidth","radius","tension"],Jf=["color","borderColor","backgroundColor"];function td(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:Jf},numbers:{type:"number",properties:Qf}}),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 ed(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const _r=new Map;function nd(e,t){t=t||{};const n=e+JSON.stringify(t);let i=_r.get(n);return i||(i=new Intl.NumberFormat(e,t),_r.set(n,i)),i}function Fl(e,t,n){return nd(t,n).format(e)}const id={values(e){return tt(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const i=this.chart.options.locale;let s,o=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=sd(e,n)}const r=Dl(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),Fl(e,i,l)}};function sd(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}var zl={formatters:id};function od(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:zl.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"})}const ze=Object.create(null),Hs=Object.create(null);function Cn(e,t){if(!t)return e;const n=t.split(".");for(let i=0,s=n.length;i<s;++i){const o=n[i];e=e[o]||(e[o]=Object.create(null))}return e}function is(e,t,n){return typeof t=="string"?Ln(Cn(e,t),n):Ln(Cn(e,""),t)}class rd{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)=>ns(s.backgroundColor),this.hoverBorderColor=(i,s)=>ns(s.borderColor),this.hoverColor=(i,s)=>ns(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 is(this,t,n)}get(t){return Cn(this,t)}describe(t,n){return is(Hs,t,n)}override(t,n){return is(ze,t,n)}route(t,n,i,s){const o=Cn(this,t),r=Cn(this,i),a="_"+n;Object.defineProperties(o,{[a]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=r[s];return V(l)?Object.assign({},c,l):R(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var Y=new rd({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[td,ed,od]);function ad(e){return!e||B(e.size)||B(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function wr(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 ke(e,t,n){const i=e.currentDevicePixelRatio,s=n!==0?Math.max(n/2,.5):0;return Math.round((t-s)*i)/i+s}function Sr(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Vs(e,t,n,i){Hl(e,t,n,i,null)}function Hl(e,t,n,i,s){let o,r,a,l,c,u,f,d;const m=t.pointStyle,y=t.rotation,x=t.radius;let v=(y||0)*Rf;if(m&&typeof m=="object"&&(o=m.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(n,i),e.rotate(v),e.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),e.restore();return}if(!(isNaN(x)||x<=0)){switch(e.beginPath(),m){default:s?e.ellipse(n,i,s/2,x,0,0,Ft):e.arc(n,i,x,0,Ft),e.closePath();break;case"triangle":u=s?s/2:x,e.moveTo(n+Math.sin(v)*u,i-Math.cos(v)*x),v+=pr,e.lineTo(n+Math.sin(v)*u,i-Math.cos(v)*x),v+=pr,e.lineTo(n+Math.sin(v)*u,i-Math.cos(v)*x),e.closePath();break;case"rectRounded":c=x*.516,l=x-c,r=Math.cos(v+Se)*l,f=Math.cos(v+Se)*(s?s/2-c:l),a=Math.sin(v+Se)*l,d=Math.sin(v+Se)*(s?s/2-c:l),e.arc(n-f,i-a,c,v-et,v-kt),e.arc(n+d,i-r,c,v-kt,v),e.arc(n+f,i+a,c,v,v+kt),e.arc(n-d,i+r,c,v+kt,v+et),e.closePath();break;case"rect":if(!y){l=Math.SQRT1_2*x,u=s?s/2:l,e.rect(n-u,i-l,2*u,2*l);break}v+=Se;case"rectRot":f=Math.cos(v)*(s?s/2:x),r=Math.cos(v)*x,a=Math.sin(v)*x,d=Math.sin(v)*(s?s/2:x),e.moveTo(n-f,i-a),e.lineTo(n+d,i-r),e.lineTo(n+f,i+a),e.lineTo(n-d,i+r),e.closePath();break;case"crossRot":v+=Se;case"cross":f=Math.cos(v)*(s?s/2:x),r=Math.cos(v)*x,a=Math.sin(v)*x,d=Math.sin(v)*(s?s/2:x),e.moveTo(n-f,i-a),e.lineTo(n+f,i+a),e.moveTo(n+d,i-r),e.lineTo(n-d,i+r);break;case"star":f=Math.cos(v)*(s?s/2:x),r=Math.cos(v)*x,a=Math.sin(v)*x,d=Math.sin(v)*(s?s/2:x),e.moveTo(n-f,i-a),e.lineTo(n+f,i+a),e.moveTo(n+d,i-r),e.lineTo(n-d,i+r),v+=Se,f=Math.cos(v)*(s?s/2:x),r=Math.cos(v)*x,a=Math.sin(v)*x,d=Math.sin(v)*(s?s/2:x),e.moveTo(n-f,i-a),e.lineTo(n+f,i+a),e.moveTo(n+d,i-r),e.lineTo(n-d,i+r);break;case"line":r=s?s/2:Math.cos(v)*x,a=Math.sin(v)*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(v)*(s?s/2:x),i+Math.sin(v)*x);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function en(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 vo(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function _o(e){e.restore()}function ld(e,t,n,i,s){if(!t)return e.lineTo(n.x,n.y);if(s==="middle"){const 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 cd(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 ud(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),B(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 hd(e,t,n,i,s){if(s.strikethrough||s.underline){const 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 fd(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Di(e,t,n,i,s,o={}){const r=tt(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(e.save(),e.font=s.string,ud(e,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&fd(e,o.backdrop),a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),B(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,n,i,o.maxWidth)),e.fillText(c,n,i,o.maxWidth),hd(e,n,i,c,o),i+=Number(s.lineHeight);e.restore()}function Bs(e,t){const{x:n,y:i,w:s,h:o,radius:r}=t;e.arc(n+r.topLeft,i+r.topLeft,r.topLeft,1.5*et,et,!0),e.lineTo(n,i+o-r.bottomLeft),e.arc(n+r.bottomLeft,i+o-r.bottomLeft,r.bottomLeft,et,kt,!0),e.lineTo(n+s-r.bottomRight,i+o),e.arc(n+s-r.bottomRight,i+o-r.bottomRight,r.bottomRight,kt,0,!0),e.lineTo(n+s,i+r.topRight),e.arc(n+s-r.topRight,i+r.topRight,r.topRight,0,-kt,!0),e.lineTo(n+r.topLeft,i)}const dd=/^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/,pd=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function gd(e,t){const n=(""+e).match(dd);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}const md=e=>+e||0;function Vl(e,t){const n={},i=V(t),s=i?Object.keys(t):t,o=V(e)?i?r=>R(e[r],e[t[r]]):r=>e[r]:()=>e;for(const r of s)n[r]=md(o(r));return n}function bd(e){return Vl(e,{top:"y",right:"x",bottom:"y",left:"x"})}function On(e){return Vl(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Mt(e){const t=bd(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function ht(e,t){e=e||{},t=t||Y.font;let n=R(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=R(e.style,t.style);i&&!(""+i).match(pd)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:R(e.family,t.family),lineHeight:gd(R(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:R(e.weight,t.weight),string:""};return s.string=ad(s),s}function si(e,t,n,i){let s,o,r;for(s=0,o=e.length;s<o;++s)if(r=e[s],r!==void 0&&r!==void 0)return r}function xd(e,t,n){const{min:i,max:s}=e,o=Cf(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 Ve(e,t){return Object.assign(Object.create(e),t)}function wo(e,t=[""],n,i,s=()=>e[0]){const o=n||e;typeof i>"u"&&(i=$l("_fallback",e));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:i,_getTarget:s,override:a=>wo([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 Wl(a,l,()=>Md(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return Tr(a).includes(l)},ownKeys(a){return Tr(a)},set(a,l,c){const u=a._storage||(a._storage=s());return a[l]=u[l]=c,delete a._keys,!0}})}function nn(e,t,n,i){const s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:Bl(e,i),setContext:o=>nn(e,o,n,i),override:o=>nn(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 Wl(o,r,()=>vd(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 Bl(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:n,indexable:i,isScriptable:ue(n)?n:()=>n,isIndexable:ue(i)?i:()=>i}}const yd=(e,t)=>e?e+bo(t):t,So=(e,t)=>V(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Wl(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const i=n();return e[t]=i,i}function vd(e,t,n){const{_proxy:i,_context:s,_subProxy:o,_descriptors:r}=e;let a=i[t];return ue(a)&&r.isScriptable(t)&&(a=_d(t,a,e,n)),tt(a)&&a.length&&(a=wd(t,a,e,r.isIndexable)),So(t,a)&&(a=nn(a,s,o&&o[t],r)),a}function _d(e,t,n,i){const{_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),So(e,l)&&(l=ko(s._scopes,s,e,l)),l}function wd(e,t,n,i){const{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=n;if(typeof o.index<"u"&&i(e))return t[o.index%t.length];if(V(t[0])){const l=t,c=s._scopes.filter(u=>u!==l);t=[];for(const u of l){const f=ko(c,s,e,u);t.push(nn(f,o,r&&r[e],a))}}return t}function jl(e,t,n){return ue(e)?e(t,n):e}const Sd=(e,t)=>e===!0?t:typeof e=="string"?Ci(t,e):void 0;function kd(e,t,n,i,s){for(const o of t){const r=Sd(n,o);if(r){e.add(r);const a=jl(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 ko(e,t,n,i){const s=t._rootScopes,o=jl(t._fallback,n,i),r=[...e,...s],a=new Set;a.add(i);let l=kr(a,r,n,o||n,i);return l===null||typeof o<"u"&&o!==n&&(l=kr(a,r,o,l,i),l===null)?!1:wo(Array.from(a),[""],s,o,()=>Td(t,n,i))}function kr(e,t,n,i,s){for(;n;)n=kd(e,t,n,i,s);return n}function Td(e,t,n){const i=e._getTarget();t in i||(i[t]={});const s=i[t];return tt(s)&&V(n)?n:s||{}}function Md(e,t,n,i){let s;for(const o of t)if(s=$l(yd(o,e),n),typeof s<"u")return So(e,s)?ko(n,i,e,s):s}function $l(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function Tr(e){let t=e._keys;return t||(t=e._keys=Ed(e._scopes)),t}function Ed(e){const t=new Set;for(const n of e)for(const i of Object.keys(n).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}const Cd=Number.EPSILON||1e-14,sn=(e,t)=>t<e.length&&!e[t].skip&&e[t],Ul=e=>e==="x"?"y":"x";function Od(e,t,n,i){const s=e.skip?t:e,o=t,r=n.skip?t:n,a=zs(o,s),l=zs(r,o);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const f=i*c,d=i*u;return{previous:{x:o.x-f*(r.x-s.x),y:o.y-f*(r.y-s.y)},next:{x:o.x+d*(r.x-s.x),y:o.y+d*(r.y-s.y)}}}function Pd(e,t,n){const i=e.length;let s,o,r,a,l,c=sn(e,0);for(let u=0;u<i-1;++u)if(l=c,c=sn(e,u+1),!(!l||!c)){if(Ie(t[u],0,Cd)){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 Dd(e,t,n="x"){const i=Ul(n),s=e.length;let o,r,a,l=sn(e,0);for(let c=0;c<s;++c){if(r=a,a=l,l=sn(e,c+1),!a)continue;const u=a[n],f=a[i];r&&(o=(u-r[n])/3,a[\`cp1\${n}\`]=u-o,a[\`cp1\${i}\`]=f-o*t[c]),l&&(o=(l[n]-u)/3,a[\`cp2\${n}\`]=u+o,a[\`cp2\${i}\`]=f+o*t[c])}}function Ad(e,t="x"){const n=Ul(t),i=e.length,s=Array(i).fill(0),o=Array(i);let r,a,l,c=sn(e,0);for(r=0;r<i;++r)if(a=l,l=c,c=sn(e,r+1),!!l){if(c){const u=c[t]-l[t];s[r]=u!==0?(c[n]-l[n])/u:0}o[r]=a?c?he(s[r-1])!==he(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}Pd(e,s,o),Dd(e,o,t)}function oi(e,t,n){return Math.max(Math.min(e,n),t)}function Id(e,t){let n,i,s,o,r,a=en(e[0],t);for(n=0,i=e.length;n<i;++n)r=o,o=a,a=n<i-1&&en(e[n+1],t),o&&(s=e[n],r&&(s.cp1x=oi(s.cp1x,t.left,t.right),s.cp1y=oi(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=oi(s.cp2x,t.left,t.right),s.cp2y=oi(s.cp2y,t.top,t.bottom)))}function Ld(e,t,n,i,s){let o,r,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Ad(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=Od(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&&Id(e,n)}function To(){return typeof window<"u"&&typeof document<"u"}function Mo(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Ai(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}const Vi=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function Rd(e,t){return Vi(e).getPropertyValue(t)}const Nd=["top","right","bottom","left"];function Le(e,t,n){const i={};n=n?"-"+n:"";for(let s=0;s<4;s++){const o=Nd[s];i[o]=parseFloat(e[t+"-"+o+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Fd=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function zd(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:s,offsetY:o}=i;let r=!1,a,l;if(Fd(s,o,e.target))a=s,l=o;else{const c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function It(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,s=Vi(n),o=s.boxSizing==="border-box",r=Le(s,"padding"),a=Le(s,"border","width"),{x:l,y:c,box:u}=zd(e,n),f=r.left+(u&&a.left),d=r.top+(u&&a.top);let{width:m,height:y}=t;return o&&(m-=r.width+a.width,y-=r.height+a.height),{x:Math.round((l-f)/m*n.width/i),y:Math.round((c-d)/y*n.height/i)}}function Hd(e,t,n){let i,s;if(t===void 0||n===void 0){const o=e&&Mo(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const r=o.getBoundingClientRect(),a=Vi(o),l=Le(a,"border","width"),c=Le(a,"padding");t=r.width-c.width-l.width,n=r.height-c.height-l.height,i=Ai(a.maxWidth,o,"clientWidth"),s=Ai(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:i||Pi,maxHeight:s||Pi}}const ri=e=>Math.round(e*10)/10;function Vd(e,t,n,i){const s=Vi(e),o=Le(s,"margin"),r=Ai(s.maxWidth,e,"clientWidth")||Pi,a=Ai(s.maxHeight,e,"clientHeight")||Pi,l=Hd(e,t,n);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const d=Le(s,"border","width"),m=Le(s,"padding");c-=m.width+d.width,u-=m.height+d.height}return c=Math.max(0,c-o.width),u=Math.max(0,i?c/i:u-o.height),c=ri(Math.min(c,r,l.maxWidth)),u=ri(Math.min(u,a,l.maxHeight)),c&&!u&&(u=ri(c/2)),(t!==void 0||n!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=ri(Math.floor(u*i))),{width:c,height:u}}function Mr(e,t,n){const i=t||1,s=Math.floor(e.height*i),o=Math.floor(e.width*i);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const 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}const Bd=(function(){let e=!1;try{const t={get passive(){return e=!0,!1}};To()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();function Er(e,t){const n=Rd(e,t),i=n&&n.match(/^(\\d+)(\\.\\d+)?px$/);return i?+i[1]:void 0}function Me(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function Wd(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 jd(e,t,n,i){const s={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},r=Me(e,s,n),a=Me(s,o,n),l=Me(o,t,n),c=Me(r,a,n),u=Me(a,l,n);return Me(c,u,n)}const $d=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}}},Ud=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Ge(e,t,n){return e?$d(t,n):Ud()}function Yl(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 Xl(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function ql(e){return e==="angle"?{between:Al,compare:Wf,normalize:Jt}:{between:Sn,compare:(t,n)=>t-n,normalize:t=>t}}function Cr({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 Yd(e,t,n){const{property:i,start:s,end:o}=n,{between:r,normalize:a}=ql(i),l=t.length;let{start:c,end:u,loop:f}=e,d,m;if(f){for(c+=l,u+=l,d=0,m=l;d<m&&r(a(t[c%l][i]),s,o);++d)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:f,style:e.style}}function Xd(e,t,n){if(!n)return[e];const{property:i,start:s,end:o}=n,r=t.length,{compare:a,between:l,normalize:c}=ql(i),{start:u,end:f,loop:d,style:m}=Yd(e,t,n),y=[];let x=!1,v=null,w,k,E;const C=()=>l(s,E,w)&&a(s,E)!==0,T=()=>a(o,w)===0||l(o,E,w),D=()=>x||C(),P=()=>!x||T();for(let O=u,A=u;O<=f;++O)k=t[O%r],!k.skip&&(w=c(k[i]),w!==E&&(x=l(w,s,o),v===null&&D()&&(v=a(w,s)===0?O:A),v!==null&&P()&&(y.push(Cr({start:v,end:O,loop:d,count:r,style:m})),v=null),A=O,E=w));return v!==null&&y.push(Cr({start:v,end:f,loop:d,count:r,style:m})),y}function qd(e,t){const n=[],i=e.segments;for(let s=0;s<i.length;s++){const o=Xd(i[s],e.points,t);o.length&&n.push(...o)}return n}function Gd(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 Kd(e,t,n,i){const s=e.length,o=[];let r=t,a=e[t],l;for(l=t+1;l<=n;++l){const 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 Zd(e,t){const n=e.points,i=e.options.spanGaps,s=n.length;if(!s)return[];const o=!!e._loop,{start:r,end:a}=Gd(n,s,o,i);if(i===!0)return Or(e,[{start:r,end:a,loop:o}],n,t);const l=a<r?a+s:a,c=!!e._fullLoop&&r===0&&a===s-1;return Or(e,Kd(n,r,l,c),n,t)}function Or(e,t,n,i){return!i||!i.setContext||!n?t:Qd(e,t,n,i)}function Qd(e,t,n,i){const s=e._chart.getContext(),o=Pr(e.options),{_datasetIndex:r,options:{spanGaps:a}}=e,l=n.length,c=[];let u=o,f=t[0].start,d=f;function m(y,x,v,w){const k=a?-1:1;if(y!==x){for(y+=l;n[y%l].skip;)y-=k;for(;n[x%l].skip;)x+=k;y%l!==x%l&&(c.push({start:y%l,end:x%l,loop:v,style:w}),u=w,f=x%l)}}for(const y of t){f=a?f:y.start;let x=n[f%l],v;for(d=f+1;d<=y.end;d++){const w=n[d%l];v=Pr(i.setContext(Ve(s,{type:"segment",p0:x,p1:w,p0DataIndex:(d-1)%l,p1DataIndex:d%l,datasetIndex:r}))),Jd(v,u)&&m(f,d-1,y.loop,u),x=w,u=v}f<d-1&&m(f,d-1,y.loop,u)}return c}function Pr(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function Jd(e,t){if(!t)return!1;const n=[],i=function(s,o){return yo(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(e,i)!==JSON.stringify(t,i)}function ai(e,t,n){return e.options.clip?e[n]:t[n]}function tp(e,t){const{xScale:n,yScale:i}=e;return n&&i?{left:ai(n,t,"left"),right:ai(n,t,"right"),top:ai(i,t,"top"),bottom:ai(i,t,"bottom")}:t}function ep(e,t){const n=t._clip;if(n.disabled)return!1;const i=tp(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)}}/*!
|
|
9072
9072
|
* Chart.js v4.5.0
|
|
9073
9073
|
* https://www.chartjs.org
|
|
9074
9074
|
* (c) 2025 Chart.js Contributors
|
|
9075
9075
|
* Released under the MIT License
|
|
9076
|
-
*/class tp{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,i,s){const 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=Ol.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;const o=i.items;let 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){const n=this._charts;let 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){const 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;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const i=n.items;let 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)}}var Ut=new tp;const Or="transparent",ep={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=xr(e||Or),s=i.valid&&xr(t||Or);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class np{constructor(t,n,i,s){const o=n[i];s=si([t.to,s,o,t.from]);const r=si([t.from,o,s]);this._active=!0,this._fn=t.fn||ep[t.type||typeof r],this._easing=Cn[t.easing]||Cn.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);const 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=si([t.to,n,s,t.from]),this._from=si([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,s=this._prop,o=this._from,r=this._loop,a=this._to;let 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(){const t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][n]()}}class Ul{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!V(t))return;const n=Object.keys(Y.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!V(o))return;const r={};for(const a of n)r[a]=o[a];(tt(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,r)})})}_animateOptions(t,n){const i=n.options,s=sp(t,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&ip(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,n){const i=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(n),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,n));continue}const u=n[c];let f=o[c];const p=i.get(c);if(f)if(p&&f.active()){f.update(p,u,a);continue}else f.cancel();if(!p||!p.duration){t[c]=u;continue}o[c]=f=new np(p,t,c,u),s.push(f)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return Ut.add(this._chart,i),!0}}function ip(e,t){const n=[],i=Object.keys(t);for(let s=0;s<i.length;s++){const o=e[i[s]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function sp(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 Pr(e,t){const 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 op(e,t,n){if(n===!1)return!1;const i=Pr(e,n),s=Pr(t,n);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function rp(e){let t,n,i,s;return V(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 $l(e,t){const n=[],i=e._getSortedDatasetMetas(t);let s,o;for(s=0,o=i.length;s<o;++s)n.push(i[s].index);return n}function Dr(e,t,n,i={}){const s=e.keys,o=i.mode==="single";let 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],_t(c)&&(o||t===0||ue(t)===ue(c))&&(t+=c)}return!u&&!i.all?0:t}function ap(e,t){const{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);let 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 os(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function lp(e,t,n){return\`\${e.id}.\${t.id}.\${n.stack||n.type}\`}function cp(e){const{min:t,max:n,minDefined:i,maxDefined:s}=e.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?n:Number.POSITIVE_INFINITY}}function up(e,t,n){const i=e[t]||(e[t]={});return i[n]||(i[n]={})}function Ar(e,t,n,i){for(const s of t.getMatchingVisibleMetas(i).reverse()){const o=e[s.index];if(n&&o>0||!n&&o<0)return s.index}return null}function Ir(e,t){const{chart:n,_cachedMeta:i}=e,s=n._stacks||(n._stacks={}),{iScale:o,vScale:r,index:a}=i,l=o.axis,c=r.axis,u=lp(o,r,i),f=t.length;let p;for(let m=0;m<f;++m){const y=t[m],{[l]:x,[c]:v}=y,w=y._stacks||(y._stacks={});p=w[c]=up(s,u,x),p[a]=v,p._top=Ar(p,r,!0,i.type),p._bottom=Ar(p,r,!1,i.type);const k=p._visualValues||(p._visualValues={});k[a]=v}}function rs(e,t){const n=e.scales;return Object.keys(n).filter(i=>n[i].axis===t).shift()}function hp(e,t){return Ne(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function fp(e,t,n){return Ne(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function bn(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const s of t){const 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]}}}const as=e=>e==="reset"||e==="none",Lr=(e,t)=>t?e:Object.assign({},e),dp=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:$l(n,!0),values:null};class Yl{static defaults={};static datasetElementType=null;static dataElementType=null;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(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=os(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&&bn(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(f,p,m,y)=>f==="x"?p:f==="r"?y:m,o=n.xAxisID=R(i.xAxisID,rs(t,"x")),r=n.yAxisID=R(i.yAxisID,rs(t,"y")),a=n.rAxisID=R(i.rAxisID,rs(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){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&gr(this._data,this),t._stacked&&bn(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(V(n)){const s=this._cachedMeta;this._data=ap(n,s)}else if(i!==n){if(i){gr(i,this);const s=this._cachedMeta;bn(s),s._parsed=[]}n&&Object.isExtensible(n)&&Uf(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const o=n._stacked;n._stacked=os(n.vScale,n),n.stack!==i.stack&&(s=!0,bn(n),n.stack=i.stack),this._resyncElements(t),(s||o!==n._stacked)&&(Ir(this,n._parsed),n._stacked=os(n.vScale,n))}configure(){const 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){const{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:r}=i,a=o.axis;let l=t===0&&n===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,f,p;if(this._parsing===!1)i._parsed=s,i._sorted=!0,p=s;else{tt(s[t])?p=this.parseArrayData(i,s,t,n):V(s[t])?p=this.parseObjectData(i,s,t,n):p=this.parsePrimitiveData(i,s,t,n);const m=()=>f[a]===null||c&&f[a]<c[a];for(u=0;u<n;++u)i._parsed[u+t]=f=p[u],l&&(m()&&(l=!1),c=f);i._sorted=l}r&&Ir(this,p)}parsePrimitiveData(t,n,i,s){const{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),u=o===r,f=new Array(s);let p,m,y;for(p=0,m=s;p<m;++p)y=p+i,f[p]={[a]:u||o.parse(c[y],y),[l]:r.parse(n[y],y)};return f}parseArrayData(t,n,i,s){const{xScale:o,yScale:r}=t,a=new Array(s);let l,c,u,f;for(l=0,c=s;l<c;++l)u=l+i,f=n[u],a[l]={x:o.parse(f[0],u),y:r.parse(f[1],u)};return a}parseObjectData(t,n,i,s){const{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let u,f,p,m;for(u=0,f=s;u<f;++u)p=u+i,m=n[p],c[u]={x:o.parse(Oi(m,a),p),y:r.parse(Oi(m,l),p)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,i){const s=this.chart,o=this._cachedMeta,r=n[t.axis],a={keys:$l(s,!0),values:n._stacks[t.axis]._visualValues};return Dr(a,r,o.index,{mode:i})}updateRangeFromParsed(t,n,i,s){const o=i[n.axis];let r=o===null?NaN:o;const a=s&&i._stacks[n.axis];s&&a&&(s.values=a,r=Dr(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,n){const i=this._cachedMeta,s=i._parsed,o=i._sorted&&t===i.iScale,r=s.length,a=this._getOtherScale(t),l=dp(n,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=cp(a);let p,m;function y(){m=s[p];const x=m[a.axis];return!_t(m[t.axis])||u>x||f<x}for(p=0;p<r&&!(!y()&&(this.updateRangeFromParsed(c,t,m,l),o));++p);if(o){for(p=r-1;p>=0;--p)if(!y()){this.updateRangeFromParsed(c,t,m,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let s,o,r;for(s=0,o=n.length;s<o;++s)r=n[s][t.axis],_t(r)&&i.push(r);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const 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){const n=this._cachedMeta;this.update(t||"default"),n._clip=rp(R(this.options.clip,op(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const 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;let u;for(i.dataset&&i.dataset.draw(t,o,a,l),u=a;u<a+l;++u){const f=s[u];f.hidden||(f.active&&c?r.push(f):f.draw(t,o))}for(u=0;u<r.length;++u)r[u].draw(t,o)}getStyle(t,n){const i=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,n,i){const s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const r=this._cachedMeta.data[t];o=r.$context||(r.$context=fp(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=hp(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){const s=n==="active",o=this._cachedDataOpts,r=t+"-"+n,a=o[r],l=this.enableOptionSharing&&Pi(i);if(a)return Lr(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),f=s?[\`\${t}Hover\`,"hover",t,""]:[t,""],p=c.getOptionScopes(this.getDataset(),u),m=Object.keys(Y.elements[t]),y=()=>this.getContext(i,s,n),x=c.resolveNamedOptions(p,m,y,f);return x.$shared&&(x.$shared=l,o[r]=Object.freeze(Lr(x,l))),x}_resolveAnimations(t,n,i){const s=this.chart,o=this._cachedDataOpts,r=\`animation-\${n}\`,a=o[r];if(a)return a;let l;if(s.options.animation!==!1){const u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,n),p=u.getOptionScopes(this.getDataset(),f);l=u.createResolver(p,this.getContext(t,i,n))}const c=new Ul(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||as(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const 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){as(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!as(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,s){t.active=s;const 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(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const 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){const s=this._cachedMeta,o=s.data,r=t+n;let a;const 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){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,n);i._stacked&&bn(i,s)}i.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,i,s]=t;this[n](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const 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]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}class pp extends Yl{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=n,r=this.chart._animationsDisabled;let{start:a,count:l}=qf(n,s,r);this._drawStart=a,this._drawCount=l,Kf(n)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;const 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){const o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(n,s),p=r.axis,m=a.axis,{spanGaps:y,segment:x}=this.options,v=Nn(y)?y:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||o||s==="none",k=n+i,C=t.length;let O=n>0&&this.getParsed(n-1);for(let T=0;T<C;++T){const D=t[T],P=w?D:{};if(T<n||T>=k){P.skip=!0;continue}const E=this.getParsed(T),A=B(E[m]),z=P[p]=r.getPixelForValue(E[p],T),L=P[m]=o||A?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,E,l):E[m],T);P.skip=isNaN(z)||isNaN(L)||A,P.stop=T>0&&Math.abs(E[p]-O[p])>v,x&&(P.parsed=E,P.raw=c.data[T]),f&&(P.options=u||this.resolveDataElementOptions(T,D.active?"active":s)),w||this.updateElement(D,T,P,s),O=E}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const 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(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}function ke(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Mo{static override(t){Object.assign(Mo.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return ke()}parse(){return ke()}format(){return ke()}add(){return ke()}diff(){return ke()}startOf(){return ke()}endOf(){return ke()}}var gp={_date:Mo};function mp(e,t,n,i){const{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){const c=a._reversePixels?Wf:Oe;if(i){if(s._sharedOptions){const u=o[0],f=typeof u.getRange=="function"&&u.getRange(t);if(f){const p=c(o,t,n-f),m=c(o,t,n+f);return{lo:p.lo,hi:m.hi}}}}else{const u=c(o,t,n);if(l){const{vScale:f}=s._cachedMeta,{_parsed:p}=e,m=p.slice(0,u.lo+1).reverse().findIndex(x=>!B(x[f.axis]));u.lo-=Math.max(0,m);const y=p.slice(u.hi).findIndex(x=>!B(x[f.axis]));u.hi+=Math.max(0,y)}return u}}return{lo:0,hi:o.length-1}}function Wi(e,t,n,i,s){const o=e.getSortedVisibleDatasetMetas(),r=n[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:u}=o[a],{lo:f,hi:p}=mp(o[a],t,r,s);for(let m=f;m<=p;++m){const y=u[m];y.skip||i(y,c,m)}}}function bp(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(i,s){const 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 ls(e,t,n,i,s){const o=[];return!s&&!e.isPointInArea(t)||Wi(e,n,t,function(a,l,c){!s&&!en(a,e.chartArea,0)||a.inRange(t.x,t.y,i)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function xp(e,t,n,i){let s=[];function o(r,a,l){const{startAngle:c,endAngle:u}=r.getProps(["startAngle","endAngle"],i),{angle:f}=Hf(r,{x:t.x,y:t.y});El(f,c,u)&&s.push({element:r,datasetIndex:a,index:l})}return Wi(e,n,t,o),s}function yp(e,t,n,i,s,o){let r=[];const a=bp(n);let l=Number.POSITIVE_INFINITY;function c(u,f,p){const m=u.inRange(t.x,t.y,s);if(i&&!m)return;const y=u.getCenterPoint(s);if(!(!!o||e.isPointInArea(y))&&!m)return;const v=a(t,y);v<l?(r=[{element:u,datasetIndex:f,index:p}],l=v):v===l&&r.push({element:u,datasetIndex:f,index:p})}return Wi(e,n,t,c),r}function cs(e,t,n,i,s,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!i?xp(e,t,n,s):yp(e,t,n,i,s,o)}function Rr(e,t,n,i,s){const o=[],r=n==="x"?"inXRange":"inYRange";let a=!1;return Wi(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}var vp={modes:{index(e,t,n,i){const s=Rt(t,e),o=n.axis||"x",r=n.includeInvisible||!1,a=n.intersect?ls(e,s,o,i,r):cs(e,s,o,!1,i,r),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,f=c.data[u];f&&!f.skip&&l.push({element:f,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,i){const s=Rt(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;let a=n.intersect?ls(e,s,o,i,r):cs(e,s,o,!1,i,r);if(a.length>0){const 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){const s=Rt(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;return ls(e,s,o,i,r)},nearest(e,t,n,i){const s=Rt(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;return cs(e,s,o,n.intersect,i,r)},x(e,t,n,i){const s=Rt(t,e);return Rr(e,s,"x",n.intersect,i)},y(e,t,n,i){const s=Rt(t,e);return Rr(e,s,"y",n.intersect,i)}}};const Xl=["left","top","right","bottom"];function xn(e,t){return e.filter(n=>n.pos===t)}function Nr(e,t){return e.filter(n=>Xl.indexOf(n.pos)===-1&&n.box.axis===t)}function yn(e,t){return e.sort((n,i)=>{const s=t?i:n,o=t?n:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function _p(e){const t=[];let 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 wp(e){const t={};for(const n of e){const{stack:i,pos:s,stackWeight:o}=n;if(!i||!Xl.includes(s))continue;const r=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function Sp(e,t){const n=wp(e),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let o,r,a;for(o=0,r=e.length;o<r;++o){a=e[o];const{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 kp(e){const t=_p(e),n=yn(t.filter(c=>c.box.fullSize),!0),i=yn(xn(t,"left"),!0),s=yn(xn(t,"right")),o=yn(xn(t,"top"),!0),r=yn(xn(t,"bottom")),a=Nr(t,"x"),l=Nr(t,"y");return{fullSize:n,leftAndTop:i.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:xn(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function Fr(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function ql(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 Tp(e,t,n,i){const{pos:s,box:o}=n,r=e.maxPadding;if(!V(s)){n.size&&(e[s]-=n.size);const f=i[n.stack]||{size:0,count:1};f.size=Math.max(f.size,n.horizontal?o.height:o.width),n.size=f.size/f.count,e[s]+=n.size}o.getPadding&&ql(r,o.getPadding());const a=Math.max(0,t.outerWidth-Fr(r,e,"left","right")),l=Math.max(0,t.outerHeight-Fr(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 Mp(e){const t=e.maxPadding;function n(i){const 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 Ep(e,t){const n=t.maxPadding;function i(s){const 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 Tn(e,t,n,i){const s=[];let 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,Ep(a.horizontal,t));const{same:f,other:p}=Tp(t,n,a,i);c|=f&&s.length,u=u||p,l.fullSize||s.push(a)}return c&&Tn(s,t,n,i)||u}function li(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 zr(e,t,n,i){const s=n.padding;let{x:o,y:r}=t;for(const a of e){const l=a.box,c=i[a.stack]||{placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const f=t.w*u,p=c.size||l.height;Pi(c.start)&&(r=c.start),l.fullSize?li(l,s.left,r,n.outerWidth-s.right-s.left,p):li(l,t.left+c.placed,r,f,p),c.start=r,c.placed+=f,r=l.bottom}else{const f=t.h*u,p=c.size||l.width;Pi(c.start)&&(o=c.start),l.fullSize?li(l,o,s.top,p,n.outerHeight-s.bottom-s.top):li(l,o,t.top+c.placed,p,f),c.start=o,c.placed+=f,o=l.right}}t.x=o,t.y=r}var ne={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){const 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;const s=Ct(e.options.layout.padding),o=Math.max(t-s.width,0),r=Math.max(n-s.height,0),a=kp(e.boxes),l=a.vertical,c=a.horizontal;F(e.boxes,x=>{typeof x.beforeLayout=="function"&&x.beforeLayout()});const u=l.reduce((x,v)=>v.box.options&&v.box.options.display===!1?x:x+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/u,hBoxMaxHeight:r/2}),p=Object.assign({},s);ql(p,Ct(i));const m=Object.assign({maxPadding:p,w:o,h:r,x:s.left,y:s.top},s),y=Sp(l.concat(c),f);Tn(a.fullSize,m,f,y),Tn(l,m,f,y),Tn(c,m,f,y)&&Tn(l,m,f,y),Mp(m),zr(a.leftAndTop,m,f,y),m.x+=m.w,m.y+=m.h,zr(a.rightAndBottom,m,f,y),e.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},F(a.chartArea,x=>{const v=x.box;Object.assign(v,e.chartArea),v.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Kl{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){}}class Cp extends Kl{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const bi="$chartjs",Op={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Hr=e=>e===null||e==="";function Pp(e,t){const n=e.style,i=e.getAttribute("height"),s=e.getAttribute("width");if(e[bi]={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",Hr(s)){const o=Tr(e,"width");o!==void 0&&(e.width=o)}if(Hr(i))if(e.style.height==="")e.height=e.width/(t||2);else{const o=Tr(e,"height");o!==void 0&&(e.height=o)}return e}const Gl=Hd?{passive:!0}:!1;function Dp(e,t,n){e&&e.addEventListener(t,n,Gl)}function Ap(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,Gl)}function Ip(e,t){const n=Op[e.type]||e.type,{x:i,y:s}=Rt(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Li(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function Lp(e,t,n){const i=e.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Li(a.addedNodes,i),r=r&&!Li(a.removedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function Rp(e,t,n){const i=e.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Li(a.removedNodes,i),r=r&&!Li(a.addedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const Fn=new Map;let Vr=0;function Zl(){const e=window.devicePixelRatio;e!==Vr&&(Vr=e,Fn.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function Np(e,t){Fn.size||window.addEventListener("resize",Zl),Fn.set(e,t)}function Fp(e){Fn.delete(e),Fn.size||window.removeEventListener("resize",Zl)}function zp(e,t,n){const i=e.canvas,s=i&&To(i);if(!s)return;const o=Pl((a,l)=>{const c=s.clientWidth;n(a,l),c<s.clientWidth&&n()},window),r=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||o(c,u)});return r.observe(s),Np(e,o),r}function us(e,t,n){n&&n.disconnect(),t==="resize"&&Fp(e)}function Hp(e,t,n){const i=e.canvas,s=Pl(o=>{e.ctx!==null&&n(Ip(o,e))},e);return Dp(i,t,s),s}class Vp extends Kl{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Pp(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[bi])return!1;const i=n[bi].initial;["height","width"].forEach(o=>{const r=i[o];B(r)?n.removeAttribute(o):n.setAttribute(o,r)});const s=i.style||{};return Object.keys(s).forEach(o=>{n.style[o]=s[o]}),n.width=n.width,delete n[bi],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),r={attach:Lp,detach:Rp,resize:zp}[n]||Hp;s[n]=r(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:us,detach:us,resize:us}[n]||Ap)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return zd(t,n,i,s)}isAttached(t){const n=t&&To(t);return!!(n&&n.isConnected)}}function Bp(e){return!ko()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Cp:Vp}class rn{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return Nn(this.x)&&Nn(this.y)}getProps(t,n){const i=this.$animations;if(!n||!i)return this;const s={};return t.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}}function Wp(e,t){const n=e.options.ticks,i=jp(e),s=Math.min(n.maxTicksLimit||i,i),o=n.major.enabled?$p(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return Yp(t,c,o,r/s),c;const u=Up(o,t,s);if(r>0){let f,p;const m=r>1?Math.round((l-a)/(r-1)):null;for(ci(t,c,u,B(m)?0:a-m,a),f=0,p=r-1;f<p;f++)ci(t,c,u,o[f],o[f+1]);return ci(t,c,u,l,B(m)?t.length:l+m),c}return ci(t,c,u),c}function jp(e){const 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 Up(e,t,n){const i=Xp(e),s=t.length/n;if(!i)return Math.max(s,1);const o=Lf(i);for(let r=0,a=o.length-1;r<a;r++){const l=o[r];if(l>s)return l}return Math.max(s,1)}function $p(e){const t=[];let n,i;for(n=0,i=e.length;n<i;n++)e[n].major&&t.push(n);return t}function Yp(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 ci(e,t,n,i,s){const o=R(i,0),r=Math.min(R(s,e.length),e.length);let 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 Xp(e){const t=e.length;let 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}const qp=e=>e==="left"?"right":e==="right"?"left":e,Br=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Wr=(e,t)=>Math.min(t||e,e);function jr(e,t){const n=[],i=e.length/t,s=e.length;let o=0;for(;o<s;o+=i)n.push(e[Math.floor(o)]);return n}function Kp(e,t,n){const i=e.ticks.length,s=Math.min(t,i-1),o=e._startPixel,r=e._endPixel,a=1e-6;let 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 Gp(e,t){F(e,n=>{const i=n.gc,s=i.length/2;let o;if(s>t){for(o=0;o<s;++o)delete n.data[i[o]];i.splice(0,s)}})}function vn(e){return e.drawTicks?e.tickLength:0}function Ur(e,t){if(!e.display)return 0;const n=ht(e.font,t),i=Ct(e.padding);return(tt(e.text)?e.text.length:1)*n.lineHeight+i.height}function Zp(e,t){return Ne(e,{scale:t,type:"scale"})}function Qp(e,t,n){return Ne(e,{tick:n,index:t,type:"tick"})}function Jp(e,t,n){let i=Dl(e);return(n&&t!=="right"||!n&&t==="right")&&(i=qp(i)),i}function tg(e,t,n,i){const{top:s,left:o,bottom:r,right:a,chart:l}=e,{chartArea:c,scales:u}=l;let f=0,p,m,y;const x=r-s,v=a-o;if(e.isHorizontal()){if(m=ft(i,o,a),V(n)){const w=Object.keys(n)[0],k=n[w];y=u[w].getPixelForValue(k)+x-t}else n==="center"?y=(c.bottom+c.top)/2+x-t:y=Br(e,n,t);p=a-o}else{if(V(n)){const w=Object.keys(n)[0],k=n[w];m=u[w].getPixelForValue(k)-v+t}else n==="center"?m=(c.left+c.right)/2-v+t:m=Br(e,n,t);y=ft(i,r,s),f=n==="left"?-Tt:Tt}return{titleX:m,titleY:y,maxWidth:p,rotation:f}}class an extends rn{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=At(t,Number.POSITIVE_INFINITY),n=At(n,Number.NEGATIVE_INFINITY),i=At(i,Number.POSITIVE_INFINITY),s=At(s,Number.NEGATIVE_INFINITY),{min:At(t,i),max:At(n,s),minDefined:_t(t),maxDefined:_t(n)}}getMinMax(t){let{min:n,max:i,minDefined:s,maxDefined:o}=this.getUserBounds(),r;if(s&&o)return{min:n,max:i};const 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:At(n,At(i,n)),max:At(i,At(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(){const 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(){I(this.options.beforeUpdate,[this])}update(t,n,i){const{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=md(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?jr(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=Wp(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(){I(this.options.afterUpdate,[this])}beforeSetDimensions(){I(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(){I(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),I(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){I(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i],o.label=I(n.callback,[o.value,i,t],this)}afterTickToLabelConversion(){I(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){I(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,i=Wr(this.ticks.length,t.ticks.maxTicksLimit),s=n.minRotation||0,o=n.maxRotation;let r=s,a,l,c;if(!this._isVisible()||!n.display||s>=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),f=u.widest.width,p=u.highest.height,m=yt(this.chart.width-f,0,this.maxWidth);a=t.offset?this.maxWidth/i:m/(i-1),f+6>a&&(a=m/(i-(t.offset?.5:1)),l=this.maxHeight-vn(t.grid)-n.padding-Ur(t.title,this.chart.options.font),c=Math.sqrt(f*f+p*p),r=zf(Math.min(Math.asin(yt((u.highest.height+6)/a,-1,1)),Math.asin(yt(l/c,-1,1))-Math.asin(yt(p/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){I(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){I(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=Ur(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=vn(o)+l):(t.height=this.maxHeight,t.width=vn(o)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:f,highest:p}=this._getLabelSizes(),m=i.padding*2,y=Ce(this.labelRotation),x=Math.cos(y),v=Math.sin(y);if(a){const w=i.mirror?0:v*f.width+x*p.height;t.height=Math.min(this.maxHeight,t.height+w+m)}else{const w=i.mirror?0:x*f.width+v*p.height;t.width=Math.min(this.maxWidth,t.width+w+m)}this._calculatePadding(c,u,v,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){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let p=0,m=0;l?c?(p=s*t.width,m=i*n.height):(p=i*t.height,m=s*n.width):o==="start"?m=n.width:o==="end"?p=t.width:o!=="inner"&&(p=t.width/2,m=n.width/2),this.paddingLeft=Math.max((p-u+r)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-f+r)*this.width/(this.width-f),0)}else{let u=n.height/2,f=t.height/2;o==="start"?(u=0,f=t.height):o==="end"&&(u=n.height,f=0),this.paddingTop=u+r,this.paddingBottom=f+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(){I(this.options.afterFit,[this])}isHorizontal(){const{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++)B(t[n].label)&&(t.splice(n,1),i--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let i=this.ticks;n<i.length&&(i=jr(i,n)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,i){const{ctx:s,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(n/Wr(n,i));let c=0,u=0,f,p,m,y,x,v,w,k,C,O,T;for(f=0;f<n;f+=l){if(y=t[f].label,x=this._resolveTickFontOptions(f),s.font=v=x.string,w=o[v]=o[v]||{data:{},gc:[]},k=x.lineHeight,C=O=0,!B(y)&&!tt(y))C=vr(s,w.data,w.gc,C,y),O=k;else if(tt(y))for(p=0,m=y.length;p<m;++p)T=y[p],!B(T)&&!tt(T)&&(C=vr(s,w.data,w.gc,C,T),O+=k);r.push(C),a.push(O),c=Math.max(C,c),u=Math.max(O,u)}Gp(o,n);const D=r.indexOf(c),P=a.indexOf(u),E=A=>({width:r[A]||0,height:a[A]||0});return{first:E(0),last:E(n-1),widest:E(D),highest:E(P),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return Bf(this._alignToPixels?Se(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const i=n[t];return i.$context||(i.$context=Qp(this.getContext(),t,i))}return this.$context||(this.$context=Zp(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Ce(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(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,i=this.chart,s=this.options,{grid:o,position:r,border:a}=s,l=o.offset,c=this.isHorizontal(),f=this.ticks.length+(l?1:0),p=vn(o),m=[],y=a.setContext(this.getContext()),x=y.display?y.width:0,v=x/2,w=function(q){return Se(i,q,x)};let k,C,O,T,D,P,E,A,z,L,H,Z;if(r==="top")k=w(this.bottom),P=this.bottom-p,A=k-v,L=w(t.top)+v,Z=t.bottom;else if(r==="bottom")k=w(this.top),L=t.top,Z=w(t.bottom)-v,P=k+v,A=this.top+p;else if(r==="left")k=w(this.right),D=this.right-p,E=k-v,z=w(t.left)+v,H=t.right;else if(r==="right")k=w(this.left),z=t.left,H=w(t.right)-v,D=k+v,E=this.left+p;else if(n==="x"){if(r==="center")k=w((t.top+t.bottom)/2+.5);else if(V(r)){const q=Object.keys(r)[0],it=r[q];k=w(this.chart.scales[q].getPixelForValue(it))}L=t.top,Z=t.bottom,P=k+v,A=P+p}else if(n==="y"){if(r==="center")k=w((t.left+t.right)/2);else if(V(r)){const q=Object.keys(r)[0],it=r[q];k=w(this.chart.scales[q].getPixelForValue(it))}D=k-v,E=D-p,z=t.left,H=t.right}const nt=R(s.ticks.maxTicksLimit,f),j=Math.max(1,Math.ceil(f/nt));for(C=0;C<f;C+=j){const q=this.getContext(C),it=o.setContext(q),ze=a.setContext(q),me=it.lineWidth,Kt=it.color,He=ze.dash||[],pt=ze.dashOffset,be=it.tickWidth,St=it.tickColor,xe=it.tickBorderDash||[],Vt=it.tickBorderDashOffset;O=Kp(this,C,l),O!==void 0&&(T=Se(i,O,me),c?D=E=z=H=T:P=A=L=Z=T,m.push({tx1:D,ty1:P,tx2:E,ty2:A,x1:z,y1:L,x2:H,y2:Z,width:me,color:Kt,borderDash:He,borderDashOffset:pt,tickWidth:be,tickColor:St,tickBorderDash:xe,tickBorderDashOffset:Vt}))}return this._ticksLength=f,this._borderValue=k,m}_computeLabelItems(t){const n=this.axis,i=this.options,{position:s,ticks:o}=i,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:f}=o,p=vn(i.grid),m=p+u,y=f?-u:m,x=-Ce(this.labelRotation),v=[];let w,k,C,O,T,D,P,E,A,z,L,H,Z="middle";if(s==="top")D=this.bottom-y,P=this._getXAxisLabelAlignment();else if(s==="bottom")D=this.top+y,P=this._getXAxisLabelAlignment();else if(s==="left"){const j=this._getYAxisLabelAlignment(p);P=j.textAlign,T=j.x}else if(s==="right"){const j=this._getYAxisLabelAlignment(p);P=j.textAlign,T=j.x}else if(n==="x"){if(s==="center")D=(t.top+t.bottom)/2+m;else if(V(s)){const j=Object.keys(s)[0],q=s[j];D=this.chart.scales[j].getPixelForValue(q)+m}P=this._getXAxisLabelAlignment()}else if(n==="y"){if(s==="center")T=(t.left+t.right)/2-m;else if(V(s)){const j=Object.keys(s)[0],q=s[j];T=this.chart.scales[j].getPixelForValue(q)}P=this._getYAxisLabelAlignment(p).textAlign}n==="y"&&(l==="start"?Z="top":l==="end"&&(Z="bottom"));const nt=this._getLabelSizes();for(w=0,k=a.length;w<k;++w){C=a[w],O=C.label;const j=o.setContext(this.getContext(w));E=this.getPixelForTick(w)+o.labelOffset,A=this._resolveTickFontOptions(w),z=A.lineHeight,L=tt(O)?O.length:1;const q=L/2,it=j.color,ze=j.textStrokeColor,me=j.textStrokeWidth;let Kt=P;r?(T=E,P==="inner"&&(w===k-1?Kt=this.options.reverse?"left":"right":w===0?Kt=this.options.reverse?"right":"left":Kt="center"),s==="top"?c==="near"||x!==0?H=-L*z+z/2:c==="center"?H=-nt.highest.height/2-q*z+z:H=-nt.highest.height+z/2:c==="near"||x!==0?H=z/2:c==="center"?H=nt.highest.height/2-q*z:H=nt.highest.height-L*z,f&&(H*=-1),x!==0&&!j.showLabelBackdrop&&(T+=z/2*Math.sin(x))):(D=E,H=(1-L)*z/2);let He;if(j.showLabelBackdrop){const pt=Ct(j.backdropPadding),be=nt.heights[w],St=nt.widths[w];let xe=H-pt.top,Vt=0-pt.left;switch(Z){case"middle":xe-=be/2;break;case"bottom":xe-=be;break}switch(P){case"center":Vt-=St/2;break;case"right":Vt-=St;break;case"inner":w===k-1?Vt-=St:w>0&&(Vt-=St/2);break}He={left:Vt,top:xe,width:St+pt.width,height:be+pt.height,color:j.backdropColor}}v.push({label:O,font:A,textOffset:H,options:{rotation:x,color:it,strokeColor:ze,strokeWidth:me,textAlign:Kt,textBaseline:Z,translation:[T,D],backdrop:He}})}return v}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Ce(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){const{position:n,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let 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;const 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(){const{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){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const 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){const 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(){const{chart:t,ctx:n,options:{border:i,grid:s}}=this,o=i.setContext(this.getContext()),r=i.display?o.width:0;if(!r)return;const a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,f,p;this.isHorizontal()?(c=Se(t,this.left,r)-r/2,u=Se(t,this.right,a)+a/2,f=p=l):(f=Se(t,this.top,r)-r/2,p=Se(t,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(c,f),n.lineTo(u,p),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&yo(i,s);const o=this.getLabelItems(t);for(const r of o){const a=r.options,l=r.font,c=r.label,u=r.textOffset;Ai(i,c,0,u,l,a)}s&&vo(i)}drawTitle(){const{ctx:t,options:{position:n,title:i,reverse:s}}=this;if(!i.display)return;const o=ht(i.font),r=Ct(i.padding),a=i.align;let l=o.lineHeight/2;n==="bottom"||n==="center"||V(n)?(l+=r.bottom,tt(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=r.top;const{titleX:c,titleY:u,maxWidth:f,rotation:p}=tg(this,l,n,a);Ai(t,i.text,0,0,o,{color:i.color,maxWidth:f,rotation:p,textAlign:Jp(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(){const t=this.options,n=t.ticks&&t.ticks.z||0,i=R(t.grid&&t.grid.z,-1),s=R(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==an.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){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let o,r;for(o=0,r=n.length;o<r;++o){const a=n[o];a[i]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return ht(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class ui{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){const n=Object.getPrototypeOf(t);let i;ig(n)&&(i=this.register(n));const 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,eg(t,r,i),this.override&&Y.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const n=this.items,i=t.id,s=this.scope;i in n&&delete n[i],s&&i in Y[s]&&(delete Y[s][i],this.override&&delete Le[i])}}function eg(e,t,n){const i=Rn(Object.create(null),[n?Y.get(n):{},Y.get(t),e.defaults]);Y.set(t,i),e.defaultRoutes&&ng(t,e.defaultRoutes),e.descriptors&&Y.describe(t,e.descriptors)}function ng(e,t){Object.keys(t).forEach(n=>{const i=n.split("."),s=i.pop(),o=[e].concat(i).join("."),r=t[n].split("."),a=r.pop(),l=r.join(".");Y.route(o,s,l,a)})}function ig(e){return"id"in e&&"defaults"in e}class sg{constructor(){this.controllers=new ui(Yl,"datasets",!0),this.elements=new ui(rn,"elements"),this.plugins=new ui(Object,"plugins"),this.scales=new ui(an,"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=>{const o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):F(s,r=>{const a=i||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,n,i){const s=mo(t);I(i["before"+s],[],i),n[t](i),I(i["after"+s],[],i)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const i=this._typedRegistries[n];if(i.isForType(t))return i}return this.plugins}_get(t,n,i){const s=n.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var Lt=new sg;class og{constructor(){this._init=[]}notify(t,n,i,s){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const 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")),r}_notify(t,n,i,s){s=s||{};for(const o of t){const r=o.plugin,a=r[i],l=[n,s,o.options];if(I(a,l,r)===!1&&s.cancelable)return!1}return!0}invalidate(){B(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const i=t&&t.config,s=R(i.options&&i.options.plugins,{}),o=rg(i);return s===!1&&!n?[]:lg(t,o,s,n)}_notifyStateChanges(t){const 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")}}function rg(e){const t={},n=[],i=Object.keys(Lt.plugins.items);for(let o=0;o<i.length;o++)n.push(Lt.getPlugin(i[o]));const s=e.plugins||[];for(let o=0;o<s.length;o++){const r=s[o];n.indexOf(r)===-1&&(n.push(r),t[r.id]=!0)}return{plugins:n,localIds:t}}function ag(e,t){return!t&&e===!1?null:e===!0?{}:e}function lg(e,{plugins:t,localIds:n},i,s){const o=[],r=e.getContext();for(const a of t){const l=a.id,c=ag(i[l],s);c!==null&&o.push({plugin:a,options:cg(e.config,{plugin:a,local:n[l]},c,r)})}return o}function cg(e,{plugin:t,local:n},i,s){const 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 Bs(e,t){const n=Y.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function ug(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function hg(e,t){return e===t?"_index_":"_value_"}function $r(e){if(e==="x"||e==="y"||e==="r")return e}function fg(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Ws(e,...t){if($r(e))return e;for(const n of t){const i=n.axis||fg(n.position)||e.length>1&&$r(e[0].toLowerCase());if(i)return i}throw new Error(\`Cannot determine type of '\${e}' axis. Please provide 'axis' or 'position' option.\`)}function Yr(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function dg(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return Yr(e,"x",n[0])||Yr(e,"y",n[0])}return{}}function pg(e,t){const n=Le[e.type]||{scales:{}},i=t.scales||{},s=Bs(e.type,t),o=Object.create(null);return Object.keys(i).forEach(r=>{const a=i[r];if(!V(a))return console.error(\`Invalid scale configuration for scale: \${r}\`);if(a._proxy)return console.warn(\`Ignoring resolver passed as options for scale: \${r}\`);const l=Ws(r,a,dg(r,e),Y.scales[a.type]),c=hg(l,s),u=n.scales||{};o[r]=En(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(r=>{const a=r.type||e.type,l=r.indexAxis||Bs(a,t),u=(Le[a]||{}).scales||{};Object.keys(u).forEach(f=>{const p=ug(f,l),m=r[p+"AxisID"]||p;o[m]=o[m]||Object.create(null),En(o[m],[{axis:p},i[m],u[f]])})}),Object.keys(o).forEach(r=>{const a=o[r];En(a,[Y.scales[a.type],Y.scale])}),o}function Ql(e){const t=e.options||(e.options={});t.plugins=R(t.plugins,{}),t.scales=pg(e,t)}function Jl(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function gg(e){return e=e||{},e.data=Jl(e.data),Ql(e),e}const Xr=new Map,tc=new Set;function hi(e,t){let n=Xr.get(e);return n||(n=t(),Xr.set(e,n),tc.add(n)),n}const _n=(e,t,n)=>{const i=Oi(t,n);i!==void 0&&e.add(i)};class mg{constructor(t){this._config=gg(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=Jl(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Ql(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return hi(t,()=>[[\`datasets.\${t}\`,""]])}datasetAnimationScopeKeys(t,n){return hi(\`\${t}.transition.\${n}\`,()=>[[\`datasets.\${t}.transitions.\${n}\`,\`transitions.\${n}\`],[\`datasets.\${t}\`,""]])}datasetElementScopeKeys(t,n){return hi(\`\${t}-\${n}\`,()=>[[\`datasets.\${t}.elements.\${n}\`,\`datasets.\${t}\`,\`elements.\${n}\`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return hi(\`\${i}-plugin-\${n}\`,()=>[[\`plugins.\${n}\`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let s=i.get(t);return(!s||n)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,n,i){const{options:s,type:o}=this,r=this._cachedScopes(t,i),a=r.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(f=>_n(l,t,f))),u.forEach(f=>_n(l,s,f)),u.forEach(f=>_n(l,Le[o]||{},f)),u.forEach(f=>_n(l,Y,f)),u.forEach(f=>_n(l,zs,f))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),tc.has(n)&&r.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Le[n]||{},Y.datasets[n]||{},{type:n},Y,zs]}resolveNamedOptions(t,n,i,s=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=qr(this._resolverCache,t,s);let l=r;if(xg(r,n)){o.$shared=!1,i=ce(i)?i():i;const c=this.createResolver(t,i,a);l=nn(r,i,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,i=[""],s){const{resolver:o}=qr(this._resolverCache,t,i);return V(n)?nn(o,n,void 0,s):o}}function qr(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const s=n.join();let o=i.get(s);return o||(o={resolver:_o(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,o)),o}const bg=e=>V(e)&&Object.getOwnPropertyNames(e).some(t=>ce(e[t]));function xg(e,t){const{isScriptable:n,isIndexable:i}=Nl(e);for(const s of t){const o=n(s),r=i(s),a=(r||o)&&e[s];if(o&&(ce(a)||bg(a))||r&&tt(a))return!0}return!1}var yg="4.5.0";const vg=["top","bottom","left","right","chartArea"];function Kr(e,t){return e==="top"||e==="bottom"||vg.indexOf(e)===-1&&t==="x"}function Gr(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function Zr(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),I(n&&n.onComplete,[e],t)}function _g(e){const t=e.chart,n=t.options.animation;I(n&&n.onProgress,[e],t)}function ec(e){return ko()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const xi={},Qr=e=>{const t=ec(e);return Object.values(xi).filter(n=>n.canvas===t).pop()};function wg(e,t,n){const i=Object.keys(e);for(const s of i){const o=+s;if(o>=t){const r=e[s];delete e[s],(n>0||o>t)&&(e[o+n]=r)}}}function Sg(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}class js{static defaults=Y;static instances=xi;static overrides=Le;static registry=Lt;static version=yg;static getChart=Qr;static register(...t){Lt.add(...t),Jr()}static unregister(...t){Lt.remove(...t),Jr()}constructor(t,n){const i=this.config=new mg(n),s=ec(t),o=Qr(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.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Bp(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=Tf(),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 og,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Yf(f=>this.update(f),r.resizeDelay||0),this._dataChanges=[],xi[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Ut.listen(this,"complete",Zr),Ut.listen(this,"progress",_g),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:s,_aspectRatio:o}=this;return B(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 Lt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():kr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return _r(this.canvas,this.ctx),this}stop(){return Ut.stop(this),this}resize(t,n){Ut.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const 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,kr(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),I(i.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};F(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,s=Object.keys(i).reduce((r,a)=>(r[a]=!1,r),{});let o=[];n&&(o=o.concat(Object.keys(n).map(r=>{const a=n[r],l=Ws(r,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),F(o,r=>{const a=r.options,l=a.id,c=Ws(l,a),u=R(a.type,r.dtype);(a.position===void 0||Kr(a.position,c)!==Kr(r.dposition))&&(a.position=r.dposition),s[l]=!0;let f=null;if(l in i&&i[l].type===u)f=i[l];else{const p=Lt.getScale(u);f=new p({id:l,type:u,ctx:this.ctx,chart:this}),i[f.id]=f}f.init(a,t)}),F(s,(r,a)=>{r||delete i[a]}),F(i,r=>{ne.configure(this,r,r.options),ne.addBox(this,r)})}_updateMetasets(){const 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(Gr("order","index"))}_removeUnreferencedMetasets(){const{_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(){const t=[],n=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i<s;i++){const o=n[i];let r=this.getDatasetMeta(i);const 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||Bs(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{const l=Lt.getController(a),{datasetElementType:c,dataElementType:u}=Y.datasets[a];Object.assign(l,{dataElementType:Lt.getElement(u),datasetElementType:c&&Lt.getElement(c)}),r.controller=new l(this,i),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){F(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const 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;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:f}=this.getDatasetMeta(c),p=!s&&o.indexOf(f)===-1;f.buildOrUpdateElements(p),r=Math.max(+f.getMaxOverflow(),r)}r=this._minPadding=i.layout.autoPadding?r:0,this._updateLayout(r),s||F(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Gr("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){F(this.scales,t=>{ne.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!hr(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:o}of n){const r=i==="_removeElements"?-o:o;wg(t,s,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const 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(!hr(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;ne.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],F(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,ce(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const 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&&(Ut.has(this)?this.attached&&!Ut.running(this)&&Ut.start(this):(this.draw(),Zr({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{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;const 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){const n=this._sortedMetasets,i=[];let s,o;for(s=0,o=n.length;s<o;++s){const 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;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i={meta:t,index:t.index,cancelable:!0},s=Jd(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&yo(n,s),t.controller.draw(),s&&vo(n),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return en(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){const o=vp.modes[n];return typeof o=="function"?o(this,t,i,s):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let 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=Ne(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const 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){const s=i?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);Pi(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){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),Ut.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),_r(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete xi[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const 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)};F(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const 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)};let r;const 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(){F(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},F(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const s=i?"set":"remove";let 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];const c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],i=t.map(({datasetIndex:o,index:r})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!Ei(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){const s=this.options.hover,o=(l,c)=>l.filter(u=>!c.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.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){const 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;const 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){const{_active:s=[],options:o}=this,r=n,a=this._getActiveElements(t,s,i,r),l=Df(t),c=Sg(t,this._lastEvent,i,l);i&&(this._lastEvent=null,I(o.onHover,[t,a,this],this),l&&I(o.onClick,[t,a,this],this));const u=!Ei(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;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}}function Jr(){return F(js.instances,e=>e._plugins.invalidate())}function nc(e,t,n=t){e.lineCap=R(n.borderCapStyle,t.borderCapStyle),e.setLineDash(R(n.borderDash,t.borderDash)),e.lineDashOffset=R(n.borderDashOffset,t.borderDashOffset),e.lineJoin=R(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=R(n.borderWidth,t.borderWidth),e.strokeStyle=R(n.borderColor,t.borderColor)}function kg(e,t,n){e.lineTo(n.x,n.y)}function Tg(e){return e.stepped?rd:e.tension||e.cubicInterpolationMode==="monotone"?ad:kg}function ic(e,t,n={}){const 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 Mg(e,t,n,i){const{points:s,options:o}=t,{count:r,start:a,loop:l,ilen:c}=ic(s,n,i),u=Tg(o);let{move:f=!0,reverse:p}=i||{},m,y,x;for(m=0;m<=c;++m)y=s[(a+(p?c-m:m))%r],!y.skip&&(f?(e.moveTo(y.x,y.y),f=!1):u(e,x,y,p,o.stepped),x=y);return l&&(y=s[(a+(p?c:0))%r],u(e,x,y,p,o.stepped)),!!l}function Eg(e,t,n,i){const s=t.points,{count:o,start:r,ilen:a}=ic(s,n,i),{move:l=!0,reverse:c}=i||{};let u=0,f=0,p,m,y,x,v,w;const k=O=>(r+(c?a-O:O))%o,C=()=>{x!==v&&(e.lineTo(u,v),e.lineTo(u,x),e.lineTo(u,w))};for(l&&(m=s[k(0)],e.moveTo(m.x,m.y)),p=0;p<=a;++p){if(m=s[k(p)],m.skip)continue;const O=m.x,T=m.y,D=O|0;D===y?(T<x?x=T:T>v&&(v=T),u=(f*u+O)/++f):(C(),e.lineTo(O,T),y=D,f=0,x=v=T),w=T}C()}function Us(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?Eg:Mg}function Cg(e){return e.stepped?Vd:e.tension||e.cubicInterpolationMode==="monotone"?Bd:Te}function Og(e,t,n,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,i)&&s.closePath()),nc(e,t.options),e.stroke(s)}function Pg(e,t,n,i){const{segments:s,options:o}=t,r=Us(t);for(const a of s)nc(e,o,a.style),e.beginPath(),r(e,t,a,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const Dg=typeof Path2D=="function";function Ag(e,t,n,i){Dg&&!t.options.segment?Og(e,t,n,i):Pg(e,t,n,i)}class Ig extends rn{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};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){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;Ad(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=Kd(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){const i=this.options,s=t[n],o=this.points,r=Yd(this,{property:n,start:s,end:s});if(!r.length)return;const a=[],l=Cg(i);let c,u;for(c=0,u=r.length;c<u;++c){const{start:f,end:p}=r[c],m=o[f],y=o[p];if(m===y){a.push(m);continue}const x=Math.abs((s-m[n])/(y[n]-m[n])),v=l(m,y,x,i.stepped);v[n]=t[n],a.push(v)}return a.length===1?a[0]:a}pathSegment(t,n,i){return Us(this)(t,this,n,i)}path(t,n,i){const s=this.segments,o=Us(this);let r=this._loop;n=n||0,i=i||this.points.length-n;for(const a of s)r&=o(t,this,a,{start:n,end:n+i-1});return!!r}draw(t,n,i,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Ag(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function ta(e,t,n,i){const s=e.options,{[n]:o}=e.getProps([n],i);return Math.abs(t-o)<s.radius+s.hitRadius}class Lg extends rn{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,n,i){const s=this.options,{x:o,y:r}=this.getProps(["x","y"],i);return Math.pow(t-o,2)+Math.pow(n-r,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,n){return ta(this,t,"x",n)}inYRange(t,n){return ta(this,t,"y",n)}getCenterPoint(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}size(t){t=t||this.options||{};let n=t.radius||0;n=Math.max(n,n&&t.hoverRadius||0);const i=n&&t.borderWidth||0;return(n+i)*2}draw(t,n){const i=this.options;this.skip||i.radius<.1||!en(this,n,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Hs(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}const ea=(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)}},Rg=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class na extends rn{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(){const t=this.options.labels||{};let n=I(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(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,s=ht(i.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=ea(i,o);let 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){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a;let f=t;o.textAlign="left",o.textBaseline="middle";let p=-1,m=-u;return this.legendItems.forEach((y,x)=>{const v=i+n/2+o.measureText(y.text).width;(x===0||c[c.length-1]+v+2*a>r)&&(f+=u,c[c.length-(x>0?0:1)]=0,m+=u,p++),l[x]={left:0,top:m,row:p,width:v,height:s},c[c.length-1]+=v+a}),f}_fitCols(t,n,i,s){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=r-t;let f=a,p=0,m=0,y=0,x=0;return this.legendItems.forEach((v,w)=>{const{itemWidth:k,itemHeight:C}=Ng(i,n,o,v,s);w>0&&m+C+2*a>u&&(f+=p+a,c.push({width:p,height:m}),y+=p+a,x++,p=m=0),l[w]={left:y,top:m,col:x,width:k,height:C},p=Math.max(p,k),m+=C+a}),f+=p,c.push({width:p,height:m}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:o}}=this,r=Ye(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=ft(i,this.left+s,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=ft(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=ft(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=ft(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){const t=this.ctx;yo(t,this),this._draw(),vo(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:s}=this,{align:o,labels:r}=t,a=Y.color,l=Ye(t.rtl,this.left,this.width),c=ht(r.font),{padding:u}=r,f=c.size,p=f/2;let m;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:y,boxHeight:x,itemHeight:v}=ea(r,f),w=function(D,P,E){if(isNaN(y)||y<=0||isNaN(x)||x<0)return;s.save();const A=R(E.lineWidth,1);if(s.fillStyle=R(E.fillStyle,a),s.lineCap=R(E.lineCap,"butt"),s.lineDashOffset=R(E.lineDashOffset,0),s.lineJoin=R(E.lineJoin,"miter"),s.lineWidth=A,s.strokeStyle=R(E.strokeStyle,a),s.setLineDash(R(E.lineDash,[])),r.usePointStyle){const z={radius:x*Math.SQRT2/2,pointStyle:E.pointStyle,rotation:E.rotation,borderWidth:A},L=l.xPlus(D,y/2),H=P+p;Ll(s,z,L,H,r.pointStyleWidth&&y)}else{const z=P+Math.max((f-x)/2,0),L=l.leftForLtr(D,y),H=Pn(E.borderRadius);s.beginPath(),Object.values(H).some(Z=>Z!==0)?Vs(s,{x:L,y:z,w:y,h:x,radius:H}):s.rect(L,z,y,x),s.fill(),A!==0&&s.stroke()}s.restore()},k=function(D,P,E){Ai(s,E.text,D,P+v/2,c,{strikethrough:E.hidden,textAlign:l.textAlign(E.textAlign)})},C=this.isHorizontal(),O=this._computeTitleHeight();C?m={x:ft(o,this.left+u,this.right-i[0]),y:this.top+u+O,line:0}:m={x:this.left+u,y:ft(o,this.top+O+u,this.bottom-n[0].height),line:0},Bl(this.ctx,t.textDirection);const T=v+u;this.legendItems.forEach((D,P)=>{s.strokeStyle=D.fontColor,s.fillStyle=D.fontColor;const E=s.measureText(D.text).width,A=l.textAlign(D.textAlign||(D.textAlign=r.textAlign)),z=y+p+E;let L=m.x,H=m.y;l.setWidth(this.width),C?P>0&&L+z+u>this.right&&(H=m.y+=T,m.line++,L=m.x=ft(o,this.left+u,this.right-i[m.line])):P>0&&H+T>this.bottom&&(L=m.x=L+n[m.line].width+u,m.line++,H=m.y=ft(o,this.top+O+u,this.bottom-n[m.line].height));const Z=l.x(L);if(w(Z,H,D),L=Xf(A,L+y+p,C?L+z:this.right,t.rtl),k(l.x(L),H,D),C)m.x+=z+u;else if(typeof D.text!="string"){const nt=c.lineHeight;m.y+=sc(D,nt)+u}else m.y+=T}),Wl(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=ht(n.font),s=Ct(n.padding);if(!n.display)return;const o=Ye(t.rtl,this.left,this.width),r=this.ctx,a=n.position,l=i.size/2,c=s.top+l;let u,f=this.left,p=this.width;if(this.isHorizontal())p=Math.max(...this.lineWidths),u=this.top+c,f=ft(t.align,f,this.right-p);else{const y=this.columnSizes.reduce((x,v)=>Math.max(x,v.height),0);u=c+ft(t.align,this.top,this.bottom-y-t.labels.padding-this._computeTitleHeight())}const m=ft(a,f,f+p);r.textAlign=o.textAlign(Dl(a)),r.textBaseline="middle",r.strokeStyle=n.color,r.fillStyle=n.color,r.font=i.string,Ai(r,n.text,m,u,i)}_computeTitleHeight(){const t=this.options.title,n=ht(t.font),i=Ct(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,s,o;if(kn(t,this.left,this.right)&&kn(n,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],kn(t,s.left,s.left+s.width)&&kn(n,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const n=this.options;if(!Hg(t.type,n))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=Rg(s,i);s&&!o&&I(n.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!o&&I(n.onHover,[t,i,this],this)}else i&&I(n.onClick,[t,i,this],this)}}function Ng(e,t,n,i,s){const o=Fg(i,e,t,n),r=zg(s,i,t.lineHeight);return{itemWidth:o,itemHeight:r}}function Fg(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 zg(e,t,n){let i=e;return typeof t.text!="string"&&(i=sc(t,n)),i}function sc(e,t){const n=e.text?e.text.length:0;return t*n}function Hg(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var Vg={id:"legend",_element:na,start(e,t,n){const i=e.legend=new na({ctx:e.ctx,options:n,chart:e});ne.configure(e,i,n),ne.addBox(e,i)},stop(e){ne.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;ne.configure(e,i,n),i.options=n},afterUpdate(e){const 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){const 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){const 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=>{const c=l.controller.getStyle(n?0:void 0),u=Ct(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)}}};const Mn={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){const a=e[t].element;if(a&&a.hasValue()){const 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){const l=e[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=Fs(t,c);u<s&&(s=u,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,i=l.y}return{x:n,y:i}}};function It(e,t){return t&&(tt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function $t(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(\`
|
|
9076
|
+
*/class np{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,i,s){const 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=Ll.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;const o=i.items;let 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){const n=this._charts;let 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){const 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;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const i=n.items;let 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)}}var $t=new np;const Dr="transparent",ip={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=vr(e||Dr),s=i.valid&&vr(t||Dr);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class sp{constructor(t,n,i,s){const o=n[i];s=si([t.to,s,o,t.from]);const r=si([t.from,o,s]);this._active=!0,this._fn=t.fn||ip[t.type||typeof r],this._easing=En[t.easing]||En.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);const 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=si([t.to,n,s,t.from]),this._from=si([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,s=this._prop,o=this._from,r=this._loop,a=this._to;let 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(){const t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][n]()}}class Gl{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!V(t))return;const n=Object.keys(Y.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!V(o))return;const r={};for(const a of n)r[a]=o[a];(tt(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,r)})})}_animateOptions(t,n){const i=n.options,s=rp(t,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&op(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,n){const i=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(n),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,n));continue}const u=n[c];let f=o[c];const d=i.get(c);if(f)if(d&&f.active()){f.update(d,u,a);continue}else f.cancel();if(!d||!d.duration){t[c]=u;continue}o[c]=f=new sp(d,t,c,u),s.push(f)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return $t.add(this._chart,i),!0}}function op(e,t){const n=[],i=Object.keys(t);for(let s=0;s<i.length;s++){const o=e[i[s]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function rp(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 Ar(e,t){const 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 ap(e,t,n){if(n===!1)return!1;const i=Ar(e,n),s=Ar(t,n);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function lp(e){let t,n,i,s;return V(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 Kl(e,t){const n=[],i=e._getSortedDatasetMetas(t);let s,o;for(s=0,o=i.length;s<o;++s)n.push(i[s].index);return n}function Ir(e,t,n,i={}){const s=e.keys,o=i.mode==="single";let 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],vt(c)&&(o||t===0||he(t)===he(c))&&(t+=c)}return!u&&!i.all?0:t}function cp(e,t){const{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);let 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 ss(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function up(e,t,n){return\`\${e.id}.\${t.id}.\${n.stack||n.type}\`}function hp(e){const{min:t,max:n,minDefined:i,maxDefined:s}=e.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?n:Number.POSITIVE_INFINITY}}function fp(e,t,n){const i=e[t]||(e[t]={});return i[n]||(i[n]={})}function Lr(e,t,n,i){for(const s of t.getMatchingVisibleMetas(i).reverse()){const o=e[s.index];if(n&&o>0||!n&&o<0)return s.index}return null}function Rr(e,t){const{chart:n,_cachedMeta:i}=e,s=n._stacks||(n._stacks={}),{iScale:o,vScale:r,index:a}=i,l=o.axis,c=r.axis,u=up(o,r,i),f=t.length;let d;for(let m=0;m<f;++m){const y=t[m],{[l]:x,[c]:v}=y,w=y._stacks||(y._stacks={});d=w[c]=fp(s,u,x),d[a]=v,d._top=Lr(d,r,!0,i.type),d._bottom=Lr(d,r,!1,i.type);const k=d._visualValues||(d._visualValues={});k[a]=v}}function os(e,t){const n=e.scales;return Object.keys(n).filter(i=>n[i].axis===t).shift()}function dp(e,t){return Ve(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function pp(e,t,n){return Ve(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function mn(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const s of t){const 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]}}}const rs=e=>e==="reset"||e==="none",Nr=(e,t)=>t?e:Object.assign({},e),gp=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Kl(n,!0),values:null};class Zl{static defaults={};static datasetElementType=null;static dataElementType=null;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(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=ss(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&&mn(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(f,d,m,y)=>f==="x"?d:f==="r"?y:m,o=n.xAxisID=R(i.xAxisID,os(t,"x")),r=n.yAxisID=R(i.yAxisID,os(t,"y")),a=n.rAxisID=R(i.rAxisID,os(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){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&br(this._data,this),t._stacked&&mn(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(V(n)){const s=this._cachedMeta;this._data=cp(n,s)}else if(i!==n){if(i){br(i,this);const s=this._cachedMeta;mn(s),s._parsed=[]}n&&Object.isExtensible(n)&&Yf(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const o=n._stacked;n._stacked=ss(n.vScale,n),n.stack!==i.stack&&(s=!0,mn(n),n.stack=i.stack),this._resyncElements(t),(s||o!==n._stacked)&&(Rr(this,n._parsed),n._stacked=ss(n.vScale,n))}configure(){const 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){const{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:r}=i,a=o.axis;let l=t===0&&n===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,f,d;if(this._parsing===!1)i._parsed=s,i._sorted=!0,d=s;else{tt(s[t])?d=this.parseArrayData(i,s,t,n):V(s[t])?d=this.parseObjectData(i,s,t,n):d=this.parsePrimitiveData(i,s,t,n);const m=()=>f[a]===null||c&&f[a]<c[a];for(u=0;u<n;++u)i._parsed[u+t]=f=d[u],l&&(m()&&(l=!1),c=f);i._sorted=l}r&&Rr(this,d)}parsePrimitiveData(t,n,i,s){const{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),u=o===r,f=new Array(s);let d,m,y;for(d=0,m=s;d<m;++d)y=d+i,f[d]={[a]:u||o.parse(c[y],y),[l]:r.parse(n[y],y)};return f}parseArrayData(t,n,i,s){const{xScale:o,yScale:r}=t,a=new Array(s);let l,c,u,f;for(l=0,c=s;l<c;++l)u=l+i,f=n[u],a[l]={x:o.parse(f[0],u),y:r.parse(f[1],u)};return a}parseObjectData(t,n,i,s){const{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let u,f,d,m;for(u=0,f=s;u<f;++u)d=u+i,m=n[d],c[u]={x:o.parse(Ci(m,a),d),y:r.parse(Ci(m,l),d)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,i){const s=this.chart,o=this._cachedMeta,r=n[t.axis],a={keys:Kl(s,!0),values:n._stacks[t.axis]._visualValues};return Ir(a,r,o.index,{mode:i})}updateRangeFromParsed(t,n,i,s){const o=i[n.axis];let r=o===null?NaN:o;const a=s&&i._stacks[n.axis];s&&a&&(s.values=a,r=Ir(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,n){const i=this._cachedMeta,s=i._parsed,o=i._sorted&&t===i.iScale,r=s.length,a=this._getOtherScale(t),l=gp(n,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=hp(a);let d,m;function y(){m=s[d];const x=m[a.axis];return!vt(m[t.axis])||u>x||f<x}for(d=0;d<r&&!(!y()&&(this.updateRangeFromParsed(c,t,m,l),o));++d);if(o){for(d=r-1;d>=0;--d)if(!y()){this.updateRangeFromParsed(c,t,m,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let s,o,r;for(s=0,o=n.length;s<o;++s)r=n[s][t.axis],vt(r)&&i.push(r);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const 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){const n=this._cachedMeta;this.update(t||"default"),n._clip=lp(R(this.options.clip,ap(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const 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;let u;for(i.dataset&&i.dataset.draw(t,o,a,l),u=a;u<a+l;++u){const f=s[u];f.hidden||(f.active&&c?r.push(f):f.draw(t,o))}for(u=0;u<r.length;++u)r[u].draw(t,o)}getStyle(t,n){const i=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,n,i){const s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const r=this._cachedMeta.data[t];o=r.$context||(r.$context=pp(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=dp(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){const s=n==="active",o=this._cachedDataOpts,r=t+"-"+n,a=o[r],l=this.enableOptionSharing&&Oi(i);if(a)return Nr(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),f=s?[\`\${t}Hover\`,"hover",t,""]:[t,""],d=c.getOptionScopes(this.getDataset(),u),m=Object.keys(Y.elements[t]),y=()=>this.getContext(i,s,n),x=c.resolveNamedOptions(d,m,y,f);return x.$shared&&(x.$shared=l,o[r]=Object.freeze(Nr(x,l))),x}_resolveAnimations(t,n,i){const s=this.chart,o=this._cachedDataOpts,r=\`animation-\${n}\`,a=o[r];if(a)return a;let l;if(s.options.animation!==!1){const u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,n),d=u.getOptionScopes(this.getDataset(),f);l=u.createResolver(d,this.getContext(t,i,n))}const c=new Gl(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||rs(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const 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){rs(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!rs(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,s){t.active=s;const 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(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const 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){const s=this._cachedMeta,o=s.data,r=t+n;let a;const 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){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,n);i._stacked&&mn(i,s)}i.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,i,s]=t;this[n](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const 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]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}class mp extends Zl{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=n,r=this.chart._animationsDisabled;let{start:a,count:l}=Kf(n,s,r);this._drawStart=a,this._drawCount=l,Zf(n)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;const 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){const o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(n,s),d=r.axis,m=a.axis,{spanGaps:y,segment:x}=this.options,v=Rn(y)?y:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||o||s==="none",k=n+i,E=t.length;let C=n>0&&this.getParsed(n-1);for(let T=0;T<E;++T){const D=t[T],P=w?D:{};if(T<n||T>=k){P.skip=!0;continue}const O=this.getParsed(T),A=B(O[m]),z=P[d]=r.getPixelForValue(O[d],T),L=P[m]=o||A?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,O,l):O[m],T);P.skip=isNaN(z)||isNaN(L)||A,P.stop=T>0&&Math.abs(O[d]-C[d])>v,x&&(P.parsed=O,P.raw=c.data[T]),f&&(P.options=u||this.resolveDataElementOptions(T,D.active?"active":s)),w||this.updateElement(D,T,P,s),C=O}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const 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(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}function Te(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Eo{static override(t){Object.assign(Eo.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Te()}parse(){return Te()}format(){return Te()}add(){return Te()}diff(){return Te()}startOf(){return Te()}endOf(){return Te()}}var bp={_date:Eo};function xp(e,t,n,i){const{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){const c=a._reversePixels?$f:De;if(i){if(s._sharedOptions){const u=o[0],f=typeof u.getRange=="function"&&u.getRange(t);if(f){const d=c(o,t,n-f),m=c(o,t,n+f);return{lo:d.lo,hi:m.hi}}}}else{const u=c(o,t,n);if(l){const{vScale:f}=s._cachedMeta,{_parsed:d}=e,m=d.slice(0,u.lo+1).reverse().findIndex(x=>!B(x[f.axis]));u.lo-=Math.max(0,m);const y=d.slice(u.hi).findIndex(x=>!B(x[f.axis]));u.hi+=Math.max(0,y)}return u}}return{lo:0,hi:o.length-1}}function Bi(e,t,n,i,s){const o=e.getSortedVisibleDatasetMetas(),r=n[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:u}=o[a],{lo:f,hi:d}=xp(o[a],t,r,s);for(let m=f;m<=d;++m){const y=u[m];y.skip||i(y,c,m)}}}function yp(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(i,s){const 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 as(e,t,n,i,s){const o=[];return!s&&!e.isPointInArea(t)||Bi(e,n,t,function(a,l,c){!s&&!en(a,e.chartArea,0)||a.inRange(t.x,t.y,i)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function vp(e,t,n,i){let s=[];function o(r,a,l){const{startAngle:c,endAngle:u}=r.getProps(["startAngle","endAngle"],i),{angle:f}=Bf(r,{x:t.x,y:t.y});Al(f,c,u)&&s.push({element:r,datasetIndex:a,index:l})}return Bi(e,n,t,o),s}function _p(e,t,n,i,s,o){let r=[];const a=yp(n);let l=Number.POSITIVE_INFINITY;function c(u,f,d){const m=u.inRange(t.x,t.y,s);if(i&&!m)return;const y=u.getCenterPoint(s);if(!(!!o||e.isPointInArea(y))&&!m)return;const v=a(t,y);v<l?(r=[{element:u,datasetIndex:f,index:d}],l=v):v===l&&r.push({element:u,datasetIndex:f,index:d})}return Bi(e,n,t,c),r}function ls(e,t,n,i,s,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!i?vp(e,t,n,s):_p(e,t,n,i,s,o)}function Fr(e,t,n,i,s){const o=[],r=n==="x"?"inXRange":"inYRange";let a=!1;return Bi(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}var wp={modes:{index(e,t,n,i){const s=It(t,e),o=n.axis||"x",r=n.includeInvisible||!1,a=n.intersect?as(e,s,o,i,r):ls(e,s,o,!1,i,r),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,f=c.data[u];f&&!f.skip&&l.push({element:f,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,i){const s=It(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;let a=n.intersect?as(e,s,o,i,r):ls(e,s,o,!1,i,r);if(a.length>0){const 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){const s=It(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;return as(e,s,o,i,r)},nearest(e,t,n,i){const s=It(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;return ls(e,s,o,n.intersect,i,r)},x(e,t,n,i){const s=It(t,e);return Fr(e,s,"x",n.intersect,i)},y(e,t,n,i){const s=It(t,e);return Fr(e,s,"y",n.intersect,i)}}};const Ql=["left","top","right","bottom"];function bn(e,t){return e.filter(n=>n.pos===t)}function zr(e,t){return e.filter(n=>Ql.indexOf(n.pos)===-1&&n.box.axis===t)}function xn(e,t){return e.sort((n,i)=>{const s=t?i:n,o=t?n:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function Sp(e){const t=[];let 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 kp(e){const t={};for(const n of e){const{stack:i,pos:s,stackWeight:o}=n;if(!i||!Ql.includes(s))continue;const r=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function Tp(e,t){const n=kp(e),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let o,r,a;for(o=0,r=e.length;o<r;++o){a=e[o];const{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 Mp(e){const t=Sp(e),n=xn(t.filter(c=>c.box.fullSize),!0),i=xn(bn(t,"left"),!0),s=xn(bn(t,"right")),o=xn(bn(t,"top"),!0),r=xn(bn(t,"bottom")),a=zr(t,"x"),l=zr(t,"y");return{fullSize:n,leftAndTop:i.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:bn(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function Hr(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function Jl(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 Ep(e,t,n,i){const{pos:s,box:o}=n,r=e.maxPadding;if(!V(s)){n.size&&(e[s]-=n.size);const f=i[n.stack]||{size:0,count:1};f.size=Math.max(f.size,n.horizontal?o.height:o.width),n.size=f.size/f.count,e[s]+=n.size}o.getPadding&&Jl(r,o.getPadding());const a=Math.max(0,t.outerWidth-Hr(r,e,"left","right")),l=Math.max(0,t.outerHeight-Hr(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 Cp(e){const t=e.maxPadding;function n(i){const 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 Op(e,t){const n=t.maxPadding;function i(s){const 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 kn(e,t,n,i){const s=[];let 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,Op(a.horizontal,t));const{same:f,other:d}=Ep(t,n,a,i);c|=f&&s.length,u=u||d,l.fullSize||s.push(a)}return c&&kn(s,t,n,i)||u}function li(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 Vr(e,t,n,i){const s=n.padding;let{x:o,y:r}=t;for(const a of e){const l=a.box,c=i[a.stack]||{placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const f=t.w*u,d=c.size||l.height;Oi(c.start)&&(r=c.start),l.fullSize?li(l,s.left,r,n.outerWidth-s.right-s.left,d):li(l,t.left+c.placed,r,f,d),c.start=r,c.placed+=f,r=l.bottom}else{const f=t.h*u,d=c.size||l.width;Oi(c.start)&&(o=c.start),l.fullSize?li(l,o,s.top,d,n.outerHeight-s.bottom-s.top):li(l,o,t.top+c.placed,d,f),c.start=o,c.placed+=f,o=l.right}}t.x=o,t.y=r}var ne={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){const 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;const s=Mt(e.options.layout.padding),o=Math.max(t-s.width,0),r=Math.max(n-s.height,0),a=Mp(e.boxes),l=a.vertical,c=a.horizontal;F(e.boxes,x=>{typeof x.beforeLayout=="function"&&x.beforeLayout()});const u=l.reduce((x,v)=>v.box.options&&v.box.options.display===!1?x:x+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/u,hBoxMaxHeight:r/2}),d=Object.assign({},s);Jl(d,Mt(i));const m=Object.assign({maxPadding:d,w:o,h:r,x:s.left,y:s.top},s),y=Tp(l.concat(c),f);kn(a.fullSize,m,f,y),kn(l,m,f,y),kn(c,m,f,y)&&kn(l,m,f,y),Cp(m),Vr(a.leftAndTop,m,f,y),m.x+=m.w,m.y+=m.h,Vr(a.rightAndBottom,m,f,y),e.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},F(a.chartArea,x=>{const v=x.box;Object.assign(v,e.chartArea),v.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class tc{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){}}class Pp extends tc{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const bi="$chartjs",Dp={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Br=e=>e===null||e==="";function Ap(e,t){const n=e.style,i=e.getAttribute("height"),s=e.getAttribute("width");if(e[bi]={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",Br(s)){const o=Er(e,"width");o!==void 0&&(e.width=o)}if(Br(i))if(e.style.height==="")e.height=e.width/(t||2);else{const o=Er(e,"height");o!==void 0&&(e.height=o)}return e}const ec=Bd?{passive:!0}:!1;function Ip(e,t,n){e&&e.addEventListener(t,n,ec)}function Lp(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,ec)}function Rp(e,t){const n=Dp[e.type]||e.type,{x:i,y:s}=It(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Ii(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function Np(e,t,n){const i=e.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Ii(a.addedNodes,i),r=r&&!Ii(a.removedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function Fp(e,t,n){const i=e.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Ii(a.removedNodes,i),r=r&&!Ii(a.addedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const Nn=new Map;let Wr=0;function nc(){const e=window.devicePixelRatio;e!==Wr&&(Wr=e,Nn.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function zp(e,t){Nn.size||window.addEventListener("resize",nc),Nn.set(e,t)}function Hp(e){Nn.delete(e),Nn.size||window.removeEventListener("resize",nc)}function Vp(e,t,n){const i=e.canvas,s=i&&Mo(i);if(!s)return;const o=Rl((a,l)=>{const c=s.clientWidth;n(a,l),c<s.clientWidth&&n()},window),r=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||o(c,u)});return r.observe(s),zp(e,o),r}function cs(e,t,n){n&&n.disconnect(),t==="resize"&&Hp(e)}function Bp(e,t,n){const i=e.canvas,s=Rl(o=>{e.ctx!==null&&n(Rp(o,e))},e);return Ip(i,t,s),s}class Wp extends tc{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Ap(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[bi])return!1;const i=n[bi].initial;["height","width"].forEach(o=>{const r=i[o];B(r)?n.removeAttribute(o):n.setAttribute(o,r)});const s=i.style||{};return Object.keys(s).forEach(o=>{n.style[o]=s[o]}),n.width=n.width,delete n[bi],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),r={attach:Np,detach:Fp,resize:Vp}[n]||Bp;s[n]=r(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:cs,detach:cs,resize:cs}[n]||Lp)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return Vd(t,n,i,s)}isAttached(t){const n=t&&Mo(t);return!!(n&&n.isConnected)}}function jp(e){return!To()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Pp:Wp}class on{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return Rn(this.x)&&Rn(this.y)}getProps(t,n){const i=this.$animations;if(!n||!i)return this;const s={};return t.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}}function $p(e,t){const n=e.options.ticks,i=Up(e),s=Math.min(n.maxTicksLimit||i,i),o=n.major.enabled?Xp(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return qp(t,c,o,r/s),c;const u=Yp(o,t,s);if(r>0){let f,d;const m=r>1?Math.round((l-a)/(r-1)):null;for(ci(t,c,u,B(m)?0:a-m,a),f=0,d=r-1;f<d;f++)ci(t,c,u,o[f],o[f+1]);return ci(t,c,u,l,B(m)?t.length:l+m),c}return ci(t,c,u),c}function Up(e){const 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 Yp(e,t,n){const i=Gp(e),s=t.length/n;if(!i)return Math.max(s,1);const o=Nf(i);for(let r=0,a=o.length-1;r<a;r++){const l=o[r];if(l>s)return l}return Math.max(s,1)}function Xp(e){const t=[];let n,i;for(n=0,i=e.length;n<i;n++)e[n].major&&t.push(n);return t}function qp(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 ci(e,t,n,i,s){const o=R(i,0),r=Math.min(R(s,e.length),e.length);let 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 Gp(e){const t=e.length;let 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}const Kp=e=>e==="left"?"right":e==="right"?"left":e,jr=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,$r=(e,t)=>Math.min(t||e,e);function Ur(e,t){const n=[],i=e.length/t,s=e.length;let o=0;for(;o<s;o+=i)n.push(e[Math.floor(o)]);return n}function Zp(e,t,n){const i=e.ticks.length,s=Math.min(t,i-1),o=e._startPixel,r=e._endPixel,a=1e-6;let 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 Qp(e,t){F(e,n=>{const i=n.gc,s=i.length/2;let o;if(s>t){for(o=0;o<s;++o)delete n.data[i[o]];i.splice(0,s)}})}function yn(e){return e.drawTicks?e.tickLength:0}function Yr(e,t){if(!e.display)return 0;const n=ht(e.font,t),i=Mt(e.padding);return(tt(e.text)?e.text.length:1)*n.lineHeight+i.height}function Jp(e,t){return Ve(e,{scale:t,type:"scale"})}function tg(e,t,n){return Ve(e,{tick:n,index:t,type:"tick"})}function eg(e,t,n){let i=Nl(e);return(n&&t!=="right"||!n&&t==="right")&&(i=Kp(i)),i}function ng(e,t,n,i){const{top:s,left:o,bottom:r,right:a,chart:l}=e,{chartArea:c,scales:u}=l;let f=0,d,m,y;const x=r-s,v=a-o;if(e.isHorizontal()){if(m=ft(i,o,a),V(n)){const w=Object.keys(n)[0],k=n[w];y=u[w].getPixelForValue(k)+x-t}else n==="center"?y=(c.bottom+c.top)/2+x-t:y=jr(e,n,t);d=a-o}else{if(V(n)){const w=Object.keys(n)[0],k=n[w];m=u[w].getPixelForValue(k)-v+t}else n==="center"?m=(c.left+c.right)/2-v+t:m=jr(e,n,t);y=ft(i,r,s),f=n==="left"?-kt:kt}return{titleX:m,titleY:y,maxWidth:d,rotation:f}}class rn extends on{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=Pt(t,Number.POSITIVE_INFINITY),n=Pt(n,Number.NEGATIVE_INFINITY),i=Pt(i,Number.POSITIVE_INFINITY),s=Pt(s,Number.NEGATIVE_INFINITY),{min:Pt(t,i),max:Pt(n,s),minDefined:vt(t),maxDefined:vt(n)}}getMinMax(t){let{min:n,max:i,minDefined:s,maxDefined:o}=this.getUserBounds(),r;if(s&&o)return{min:n,max:i};const 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:Pt(n,Pt(i,n)),max:Pt(i,Pt(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(){const 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(){I(this.options.beforeUpdate,[this])}update(t,n,i){const{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=xd(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Ur(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=$p(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(){I(this.options.afterUpdate,[this])}beforeSetDimensions(){I(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(){I(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),I(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){I(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i],o.label=I(n.callback,[o.value,i,t],this)}afterTickToLabelConversion(){I(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){I(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,i=$r(this.ticks.length,t.ticks.maxTicksLimit),s=n.minRotation||0,o=n.maxRotation;let r=s,a,l,c;if(!this._isVisible()||!n.display||s>=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),f=u.widest.width,d=u.highest.height,m=xt(this.chart.width-f,0,this.maxWidth);a=t.offset?this.maxWidth/i:m/(i-1),f+6>a&&(a=m/(i-(t.offset?.5:1)),l=this.maxHeight-yn(t.grid)-n.padding-Yr(t.title,this.chart.options.font),c=Math.sqrt(f*f+d*d),r=Vf(Math.min(Math.asin(xt((u.highest.height+6)/a,-1,1)),Math.asin(xt(l/c,-1,1))-Math.asin(xt(d/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){I(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){I(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=Yr(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=yn(o)+l):(t.height=this.maxHeight,t.width=yn(o)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:f,highest:d}=this._getLabelSizes(),m=i.padding*2,y=Pe(this.labelRotation),x=Math.cos(y),v=Math.sin(y);if(a){const w=i.mirror?0:v*f.width+x*d.height;t.height=Math.min(this.maxHeight,t.height+w+m)}else{const w=i.mirror?0:x*f.width+v*d.height;t.width=Math.min(this.maxWidth,t.width+w+m)}this._calculatePadding(c,u,v,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){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,m=0;l?c?(d=s*t.width,m=i*n.height):(d=i*t.height,m=s*n.width):o==="start"?m=n.width:o==="end"?d=t.width:o!=="inner"&&(d=t.width/2,m=n.width/2),this.paddingLeft=Math.max((d-u+r)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-f+r)*this.width/(this.width-f),0)}else{let u=n.height/2,f=t.height/2;o==="start"?(u=0,f=t.height):o==="end"&&(u=n.height,f=0),this.paddingTop=u+r,this.paddingBottom=f+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(){I(this.options.afterFit,[this])}isHorizontal(){const{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++)B(t[n].label)&&(t.splice(n,1),i--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let i=this.ticks;n<i.length&&(i=Ur(i,n)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,i){const{ctx:s,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(n/$r(n,i));let c=0,u=0,f,d,m,y,x,v,w,k,E,C,T;for(f=0;f<n;f+=l){if(y=t[f].label,x=this._resolveTickFontOptions(f),s.font=v=x.string,w=o[v]=o[v]||{data:{},gc:[]},k=x.lineHeight,E=C=0,!B(y)&&!tt(y))E=wr(s,w.data,w.gc,E,y),C=k;else if(tt(y))for(d=0,m=y.length;d<m;++d)T=y[d],!B(T)&&!tt(T)&&(E=wr(s,w.data,w.gc,E,T),C+=k);r.push(E),a.push(C),c=Math.max(E,c),u=Math.max(C,u)}Qp(o,n);const D=r.indexOf(c),P=a.indexOf(u),O=A=>({width:r[A]||0,height:a[A]||0});return{first:O(0),last:O(n-1),widest:O(D),highest:O(P),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return jf(this._alignToPixels?ke(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const i=n[t];return i.$context||(i.$context=tg(this.getContext(),t,i))}return this.$context||(this.$context=Jp(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Pe(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(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,i=this.chart,s=this.options,{grid:o,position:r,border:a}=s,l=o.offset,c=this.isHorizontal(),f=this.ticks.length+(l?1:0),d=yn(o),m=[],y=a.setContext(this.getContext()),x=y.display?y.width:0,v=x/2,w=function(q){return ke(i,q,x)};let k,E,C,T,D,P,O,A,z,L,H,Z;if(r==="top")k=w(this.bottom),P=this.bottom-d,A=k-v,L=w(t.top)+v,Z=t.bottom;else if(r==="bottom")k=w(this.top),L=t.top,Z=w(t.bottom)-v,P=k+v,A=this.top+d;else if(r==="left")k=w(this.right),D=this.right-d,O=k-v,z=w(t.left)+v,H=t.right;else if(r==="right")k=w(this.left),z=t.left,H=w(t.right)-v,D=k+v,O=this.left+d;else if(n==="x"){if(r==="center")k=w((t.top+t.bottom)/2+.5);else if(V(r)){const q=Object.keys(r)[0],it=r[q];k=w(this.chart.scales[q].getPixelForValue(it))}L=t.top,Z=t.bottom,P=k+v,A=P+d}else if(n==="y"){if(r==="center")k=w((t.left+t.right)/2);else if(V(r)){const q=Object.keys(r)[0],it=r[q];k=w(this.chart.scales[q].getPixelForValue(it))}D=k-v,O=D-d,z=t.left,H=t.right}const nt=R(s.ticks.maxTicksLimit,f),j=Math.max(1,Math.ceil(f/nt));for(E=0;E<f;E+=j){const q=this.getContext(E),it=o.setContext(q),We=a.setContext(q),be=it.lineWidth,Gt=it.color,je=We.dash||[],dt=We.dashOffset,xe=it.tickWidth,wt=it.tickColor,ye=it.tickBorderDash||[],Vt=it.tickBorderDashOffset;C=Zp(this,E,l),C!==void 0&&(T=ke(i,C,be),c?D=O=z=H=T:P=A=L=Z=T,m.push({tx1:D,ty1:P,tx2:O,ty2:A,x1:z,y1:L,x2:H,y2:Z,width:be,color:Gt,borderDash:je,borderDashOffset:dt,tickWidth:xe,tickColor:wt,tickBorderDash:ye,tickBorderDashOffset:Vt}))}return this._ticksLength=f,this._borderValue=k,m}_computeLabelItems(t){const n=this.axis,i=this.options,{position:s,ticks:o}=i,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:f}=o,d=yn(i.grid),m=d+u,y=f?-u:m,x=-Pe(this.labelRotation),v=[];let w,k,E,C,T,D,P,O,A,z,L,H,Z="middle";if(s==="top")D=this.bottom-y,P=this._getXAxisLabelAlignment();else if(s==="bottom")D=this.top+y,P=this._getXAxisLabelAlignment();else if(s==="left"){const j=this._getYAxisLabelAlignment(d);P=j.textAlign,T=j.x}else if(s==="right"){const j=this._getYAxisLabelAlignment(d);P=j.textAlign,T=j.x}else if(n==="x"){if(s==="center")D=(t.top+t.bottom)/2+m;else if(V(s)){const j=Object.keys(s)[0],q=s[j];D=this.chart.scales[j].getPixelForValue(q)+m}P=this._getXAxisLabelAlignment()}else if(n==="y"){if(s==="center")T=(t.left+t.right)/2-m;else if(V(s)){const j=Object.keys(s)[0],q=s[j];T=this.chart.scales[j].getPixelForValue(q)}P=this._getYAxisLabelAlignment(d).textAlign}n==="y"&&(l==="start"?Z="top":l==="end"&&(Z="bottom"));const nt=this._getLabelSizes();for(w=0,k=a.length;w<k;++w){E=a[w],C=E.label;const j=o.setContext(this.getContext(w));O=this.getPixelForTick(w)+o.labelOffset,A=this._resolveTickFontOptions(w),z=A.lineHeight,L=tt(C)?C.length:1;const q=L/2,it=j.color,We=j.textStrokeColor,be=j.textStrokeWidth;let Gt=P;r?(T=O,P==="inner"&&(w===k-1?Gt=this.options.reverse?"left":"right":w===0?Gt=this.options.reverse?"right":"left":Gt="center"),s==="top"?c==="near"||x!==0?H=-L*z+z/2:c==="center"?H=-nt.highest.height/2-q*z+z:H=-nt.highest.height+z/2:c==="near"||x!==0?H=z/2:c==="center"?H=nt.highest.height/2-q*z:H=nt.highest.height-L*z,f&&(H*=-1),x!==0&&!j.showLabelBackdrop&&(T+=z/2*Math.sin(x))):(D=O,H=(1-L)*z/2);let je;if(j.showLabelBackdrop){const dt=Mt(j.backdropPadding),xe=nt.heights[w],wt=nt.widths[w];let ye=H-dt.top,Vt=0-dt.left;switch(Z){case"middle":ye-=xe/2;break;case"bottom":ye-=xe;break}switch(P){case"center":Vt-=wt/2;break;case"right":Vt-=wt;break;case"inner":w===k-1?Vt-=wt:w>0&&(Vt-=wt/2);break}je={left:Vt,top:ye,width:wt+dt.width,height:xe+dt.height,color:j.backdropColor}}v.push({label:C,font:A,textOffset:H,options:{rotation:x,color:it,strokeColor:We,strokeWidth:be,textAlign:Gt,textBaseline:Z,translation:[T,D],backdrop:je}})}return v}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Pe(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){const{position:n,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let 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;const 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(){const{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){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const 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){const 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(){const{chart:t,ctx:n,options:{border:i,grid:s}}=this,o=i.setContext(this.getContext()),r=i.display?o.width:0;if(!r)return;const a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,f,d;this.isHorizontal()?(c=ke(t,this.left,r)-r/2,u=ke(t,this.right,a)+a/2,f=d=l):(f=ke(t,this.top,r)-r/2,d=ke(t,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(c,f),n.lineTo(u,d),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&vo(i,s);const o=this.getLabelItems(t);for(const r of o){const a=r.options,l=r.font,c=r.label,u=r.textOffset;Di(i,c,0,u,l,a)}s&&_o(i)}drawTitle(){const{ctx:t,options:{position:n,title:i,reverse:s}}=this;if(!i.display)return;const o=ht(i.font),r=Mt(i.padding),a=i.align;let l=o.lineHeight/2;n==="bottom"||n==="center"||V(n)?(l+=r.bottom,tt(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=r.top;const{titleX:c,titleY:u,maxWidth:f,rotation:d}=ng(this,l,n,a);Di(t,i.text,0,0,o,{color:i.color,maxWidth:f,rotation:d,textAlign:eg(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(){const t=this.options,n=t.ticks&&t.ticks.z||0,i=R(t.grid&&t.grid.z,-1),s=R(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==rn.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){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let o,r;for(o=0,r=n.length;o<r;++o){const a=n[o];a[i]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return ht(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class ui{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){const n=Object.getPrototypeOf(t);let i;og(n)&&(i=this.register(n));const 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,ig(t,r,i),this.override&&Y.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const n=this.items,i=t.id,s=this.scope;i in n&&delete n[i],s&&i in Y[s]&&(delete Y[s][i],this.override&&delete ze[i])}}function ig(e,t,n){const i=Ln(Object.create(null),[n?Y.get(n):{},Y.get(t),e.defaults]);Y.set(t,i),e.defaultRoutes&&sg(t,e.defaultRoutes),e.descriptors&&Y.describe(t,e.descriptors)}function sg(e,t){Object.keys(t).forEach(n=>{const i=n.split("."),s=i.pop(),o=[e].concat(i).join("."),r=t[n].split("."),a=r.pop(),l=r.join(".");Y.route(o,s,l,a)})}function og(e){return"id"in e&&"defaults"in e}class rg{constructor(){this.controllers=new ui(Zl,"datasets",!0),this.elements=new ui(on,"elements"),this.plugins=new ui(Object,"plugins"),this.scales=new ui(rn,"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=>{const o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):F(s,r=>{const a=i||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,n,i){const s=bo(t);I(i["before"+s],[],i),n[t](i),I(i["after"+s],[],i)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const i=this._typedRegistries[n];if(i.isForType(t))return i}return this.plugins}_get(t,n,i){const s=n.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var At=new rg;class ag{constructor(){this._init=[]}notify(t,n,i,s){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const 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")),r}_notify(t,n,i,s){s=s||{};for(const o of t){const r=o.plugin,a=r[i],l=[n,s,o.options];if(I(a,l,r)===!1&&s.cancelable)return!1}return!0}invalidate(){B(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const i=t&&t.config,s=R(i.options&&i.options.plugins,{}),o=lg(i);return s===!1&&!n?[]:ug(t,o,s,n)}_notifyStateChanges(t){const 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")}}function lg(e){const t={},n=[],i=Object.keys(At.plugins.items);for(let o=0;o<i.length;o++)n.push(At.getPlugin(i[o]));const s=e.plugins||[];for(let o=0;o<s.length;o++){const r=s[o];n.indexOf(r)===-1&&(n.push(r),t[r.id]=!0)}return{plugins:n,localIds:t}}function cg(e,t){return!t&&e===!1?null:e===!0?{}:e}function ug(e,{plugins:t,localIds:n},i,s){const o=[],r=e.getContext();for(const a of t){const l=a.id,c=cg(i[l],s);c!==null&&o.push({plugin:a,options:hg(e.config,{plugin:a,local:n[l]},c,r)})}return o}function hg(e,{plugin:t,local:n},i,s){const 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 Ws(e,t){const n=Y.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function fg(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function dg(e,t){return e===t?"_index_":"_value_"}function Xr(e){if(e==="x"||e==="y"||e==="r")return e}function pg(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function js(e,...t){if(Xr(e))return e;for(const n of t){const i=n.axis||pg(n.position)||e.length>1&&Xr(e[0].toLowerCase());if(i)return i}throw new Error(\`Cannot determine type of '\${e}' axis. Please provide 'axis' or 'position' option.\`)}function qr(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function gg(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return qr(e,"x",n[0])||qr(e,"y",n[0])}return{}}function mg(e,t){const n=ze[e.type]||{scales:{}},i=t.scales||{},s=Ws(e.type,t),o=Object.create(null);return Object.keys(i).forEach(r=>{const a=i[r];if(!V(a))return console.error(\`Invalid scale configuration for scale: \${r}\`);if(a._proxy)return console.warn(\`Ignoring resolver passed as options for scale: \${r}\`);const l=js(r,a,gg(r,e),Y.scales[a.type]),c=dg(l,s),u=n.scales||{};o[r]=Mn(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(r=>{const a=r.type||e.type,l=r.indexAxis||Ws(a,t),u=(ze[a]||{}).scales||{};Object.keys(u).forEach(f=>{const d=fg(f,l),m=r[d+"AxisID"]||d;o[m]=o[m]||Object.create(null),Mn(o[m],[{axis:d},i[m],u[f]])})}),Object.keys(o).forEach(r=>{const a=o[r];Mn(a,[Y.scales[a.type],Y.scale])}),o}function ic(e){const t=e.options||(e.options={});t.plugins=R(t.plugins,{}),t.scales=mg(e,t)}function sc(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function bg(e){return e=e||{},e.data=sc(e.data),ic(e),e}const Gr=new Map,oc=new Set;function hi(e,t){let n=Gr.get(e);return n||(n=t(),Gr.set(e,n),oc.add(n)),n}const vn=(e,t,n)=>{const i=Ci(t,n);i!==void 0&&e.add(i)};class xg{constructor(t){this._config=bg(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=sc(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),ic(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return hi(t,()=>[[\`datasets.\${t}\`,""]])}datasetAnimationScopeKeys(t,n){return hi(\`\${t}.transition.\${n}\`,()=>[[\`datasets.\${t}.transitions.\${n}\`,\`transitions.\${n}\`],[\`datasets.\${t}\`,""]])}datasetElementScopeKeys(t,n){return hi(\`\${t}-\${n}\`,()=>[[\`datasets.\${t}.elements.\${n}\`,\`datasets.\${t}\`,\`elements.\${n}\`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return hi(\`\${i}-plugin-\${n}\`,()=>[[\`plugins.\${n}\`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let s=i.get(t);return(!s||n)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,n,i){const{options:s,type:o}=this,r=this._cachedScopes(t,i),a=r.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(f=>vn(l,t,f))),u.forEach(f=>vn(l,s,f)),u.forEach(f=>vn(l,ze[o]||{},f)),u.forEach(f=>vn(l,Y,f)),u.forEach(f=>vn(l,Hs,f))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),oc.has(n)&&r.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,ze[n]||{},Y.datasets[n]||{},{type:n},Y,Hs]}resolveNamedOptions(t,n,i,s=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=Kr(this._resolverCache,t,s);let l=r;if(vg(r,n)){o.$shared=!1,i=ue(i)?i():i;const c=this.createResolver(t,i,a);l=nn(r,i,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,i=[""],s){const{resolver:o}=Kr(this._resolverCache,t,i);return V(n)?nn(o,n,void 0,s):o}}function Kr(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const s=n.join();let o=i.get(s);return o||(o={resolver:wo(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,o)),o}const yg=e=>V(e)&&Object.getOwnPropertyNames(e).some(t=>ue(e[t]));function vg(e,t){const{isScriptable:n,isIndexable:i}=Bl(e);for(const s of t){const o=n(s),r=i(s),a=(r||o)&&e[s];if(o&&(ue(a)||yg(a))||r&&tt(a))return!0}return!1}var _g="4.5.0";const wg=["top","bottom","left","right","chartArea"];function Zr(e,t){return e==="top"||e==="bottom"||wg.indexOf(e)===-1&&t==="x"}function Qr(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function Jr(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),I(n&&n.onComplete,[e],t)}function Sg(e){const t=e.chart,n=t.options.animation;I(n&&n.onProgress,[e],t)}function rc(e){return To()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const xi={},ta=e=>{const t=rc(e);return Object.values(xi).filter(n=>n.canvas===t).pop()};function kg(e,t,n){const i=Object.keys(e);for(const s of i){const o=+s;if(o>=t){const r=e[s];delete e[s],(n>0||o>t)&&(e[o+n]=r)}}}function Tg(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}class $s{static defaults=Y;static instances=xi;static overrides=ze;static registry=At;static version=_g;static getChart=ta;static register(...t){At.add(...t),ea()}static unregister(...t){At.remove(...t),ea()}constructor(t,n){const i=this.config=new xg(n),s=rc(t),o=ta(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.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||jp(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=Ef(),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 ag,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=qf(f=>this.update(f),r.resizeDelay||0),this._dataChanges=[],xi[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}$t.listen(this,"complete",Jr),$t.listen(this,"progress",Sg),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:s,_aspectRatio:o}=this;return B(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 At}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Mr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Sr(this.canvas,this.ctx),this}stop(){return $t.stop(this),this}resize(t,n){$t.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const 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,Mr(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),I(i.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};F(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,s=Object.keys(i).reduce((r,a)=>(r[a]=!1,r),{});let o=[];n&&(o=o.concat(Object.keys(n).map(r=>{const a=n[r],l=js(r,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),F(o,r=>{const a=r.options,l=a.id,c=js(l,a),u=R(a.type,r.dtype);(a.position===void 0||Zr(a.position,c)!==Zr(r.dposition))&&(a.position=r.dposition),s[l]=!0;let f=null;if(l in i&&i[l].type===u)f=i[l];else{const d=At.getScale(u);f=new d({id:l,type:u,ctx:this.ctx,chart:this}),i[f.id]=f}f.init(a,t)}),F(s,(r,a)=>{r||delete i[a]}),F(i,r=>{ne.configure(this,r,r.options),ne.addBox(this,r)})}_updateMetasets(){const 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(Qr("order","index"))}_removeUnreferencedMetasets(){const{_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(){const t=[],n=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i<s;i++){const o=n[i];let r=this.getDatasetMeta(i);const 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||Ws(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{const l=At.getController(a),{datasetElementType:c,dataElementType:u}=Y.datasets[a];Object.assign(l,{dataElementType:At.getElement(u),datasetElementType:c&&At.getElement(c)}),r.controller=new l(this,i),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){F(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const 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;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:f}=this.getDatasetMeta(c),d=!s&&o.indexOf(f)===-1;f.buildOrUpdateElements(d),r=Math.max(+f.getMaxOverflow(),r)}r=this._minPadding=i.layout.autoPadding?r:0,this._updateLayout(r),s||F(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Qr("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){F(this.scales,t=>{ne.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!dr(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:o}of n){const r=i==="_removeElements"?-o:o;kg(t,s,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const 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(!dr(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;ne.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],F(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,ue(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const 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&&($t.has(this)?this.attached&&!$t.running(this)&&$t.start(this):(this.draw(),Jr({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{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;const 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){const n=this._sortedMetasets,i=[];let s,o;for(s=0,o=n.length;s<o;++s){const 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;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i={meta:t,index:t.index,cancelable:!0},s=ep(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&vo(n,s),t.controller.draw(),s&&_o(n),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return en(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){const o=wp.modes[n];return typeof o=="function"?o(this,t,i,s):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let 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=Ve(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const 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){const s=i?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);Oi(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){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),$t.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Sr(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete xi[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const 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)};F(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const 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)};let r;const 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(){F(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},F(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const s=i?"set":"remove";let 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];const c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],i=t.map(({datasetIndex:o,index:r})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!Mi(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){const s=this.options.hover,o=(l,c)=>l.filter(u=>!c.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.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){const 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;const 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){const{_active:s=[],options:o}=this,r=n,a=this._getActiveElements(t,s,i,r),l=If(t),c=Tg(t,this._lastEvent,i,l);i&&(this._lastEvent=null,I(o.onHover,[t,a,this],this),l&&I(o.onClick,[t,a,this],this));const u=!Mi(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;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}}function ea(){return F($s.instances,e=>e._plugins.invalidate())}function ac(e,t,n=t){e.lineCap=R(n.borderCapStyle,t.borderCapStyle),e.setLineDash(R(n.borderDash,t.borderDash)),e.lineDashOffset=R(n.borderDashOffset,t.borderDashOffset),e.lineJoin=R(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=R(n.borderWidth,t.borderWidth),e.strokeStyle=R(n.borderColor,t.borderColor)}function Mg(e,t,n){e.lineTo(n.x,n.y)}function Eg(e){return e.stepped?ld:e.tension||e.cubicInterpolationMode==="monotone"?cd:Mg}function lc(e,t,n={}){const 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 Cg(e,t,n,i){const{points:s,options:o}=t,{count:r,start:a,loop:l,ilen:c}=lc(s,n,i),u=Eg(o);let{move:f=!0,reverse:d}=i||{},m,y,x;for(m=0;m<=c;++m)y=s[(a+(d?c-m:m))%r],!y.skip&&(f?(e.moveTo(y.x,y.y),f=!1):u(e,x,y,d,o.stepped),x=y);return l&&(y=s[(a+(d?c:0))%r],u(e,x,y,d,o.stepped)),!!l}function Og(e,t,n,i){const s=t.points,{count:o,start:r,ilen:a}=lc(s,n,i),{move:l=!0,reverse:c}=i||{};let u=0,f=0,d,m,y,x,v,w;const k=C=>(r+(c?a-C:C))%o,E=()=>{x!==v&&(e.lineTo(u,v),e.lineTo(u,x),e.lineTo(u,w))};for(l&&(m=s[k(0)],e.moveTo(m.x,m.y)),d=0;d<=a;++d){if(m=s[k(d)],m.skip)continue;const C=m.x,T=m.y,D=C|0;D===y?(T<x?x=T:T>v&&(v=T),u=(f*u+C)/++f):(E(),e.lineTo(C,T),y=D,f=0,x=v=T),w=T}E()}function Us(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?Og:Cg}function Pg(e){return e.stepped?Wd:e.tension||e.cubicInterpolationMode==="monotone"?jd:Me}function Dg(e,t,n,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,i)&&s.closePath()),ac(e,t.options),e.stroke(s)}function Ag(e,t,n,i){const{segments:s,options:o}=t,r=Us(t);for(const a of s)ac(e,o,a.style),e.beginPath(),r(e,t,a,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const Ig=typeof Path2D=="function";function Lg(e,t,n,i){Ig&&!t.options.segment?Dg(e,t,n,i):Ag(e,t,n,i)}class Rg extends on{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};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){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;Ld(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=Zd(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){const i=this.options,s=t[n],o=this.points,r=qd(this,{property:n,start:s,end:s});if(!r.length)return;const a=[],l=Pg(i);let c,u;for(c=0,u=r.length;c<u;++c){const{start:f,end:d}=r[c],m=o[f],y=o[d];if(m===y){a.push(m);continue}const x=Math.abs((s-m[n])/(y[n]-m[n])),v=l(m,y,x,i.stepped);v[n]=t[n],a.push(v)}return a.length===1?a[0]:a}pathSegment(t,n,i){return Us(this)(t,this,n,i)}path(t,n,i){const s=this.segments,o=Us(this);let r=this._loop;n=n||0,i=i||this.points.length-n;for(const a of s)r&=o(t,this,a,{start:n,end:n+i-1});return!!r}draw(t,n,i,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Lg(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function na(e,t,n,i){const s=e.options,{[n]:o}=e.getProps([n],i);return Math.abs(t-o)<s.radius+s.hitRadius}class Ng extends on{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,n,i){const s=this.options,{x:o,y:r}=this.getProps(["x","y"],i);return Math.pow(t-o,2)+Math.pow(n-r,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,n){return na(this,t,"x",n)}inYRange(t,n){return na(this,t,"y",n)}getCenterPoint(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}size(t){t=t||this.options||{};let n=t.radius||0;n=Math.max(n,n&&t.hoverRadius||0);const i=n&&t.borderWidth||0;return(n+i)*2}draw(t,n){const i=this.options;this.skip||i.radius<.1||!en(this,n,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Vs(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}const ia=(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)}},Fg=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class sa extends on{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(){const t=this.options.labels||{};let n=I(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(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,s=ht(i.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=ia(i,o);let 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){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a;let f=t;o.textAlign="left",o.textBaseline="middle";let d=-1,m=-u;return this.legendItems.forEach((y,x)=>{const v=i+n/2+o.measureText(y.text).width;(x===0||c[c.length-1]+v+2*a>r)&&(f+=u,c[c.length-(x>0?0:1)]=0,m+=u,d++),l[x]={left:0,top:m,row:d,width:v,height:s},c[c.length-1]+=v+a}),f}_fitCols(t,n,i,s){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=r-t;let f=a,d=0,m=0,y=0,x=0;return this.legendItems.forEach((v,w)=>{const{itemWidth:k,itemHeight:E}=zg(i,n,o,v,s);w>0&&m+E+2*a>u&&(f+=d+a,c.push({width:d,height:m}),y+=d+a,x++,d=m=0),l[w]={left:y,top:m,col:x,width:k,height:E},d=Math.max(d,k),m+=E+a}),f+=d,c.push({width:d,height:m}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:o}}=this,r=Ge(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=ft(i,this.left+s,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=ft(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=ft(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=ft(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){const t=this.ctx;vo(t,this),this._draw(),_o(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:s}=this,{align:o,labels:r}=t,a=Y.color,l=Ge(t.rtl,this.left,this.width),c=ht(r.font),{padding:u}=r,f=c.size,d=f/2;let m;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:y,boxHeight:x,itemHeight:v}=ia(r,f),w=function(D,P,O){if(isNaN(y)||y<=0||isNaN(x)||x<0)return;s.save();const A=R(O.lineWidth,1);if(s.fillStyle=R(O.fillStyle,a),s.lineCap=R(O.lineCap,"butt"),s.lineDashOffset=R(O.lineDashOffset,0),s.lineJoin=R(O.lineJoin,"miter"),s.lineWidth=A,s.strokeStyle=R(O.strokeStyle,a),s.setLineDash(R(O.lineDash,[])),r.usePointStyle){const z={radius:x*Math.SQRT2/2,pointStyle:O.pointStyle,rotation:O.rotation,borderWidth:A},L=l.xPlus(D,y/2),H=P+d;Hl(s,z,L,H,r.pointStyleWidth&&y)}else{const z=P+Math.max((f-x)/2,0),L=l.leftForLtr(D,y),H=On(O.borderRadius);s.beginPath(),Object.values(H).some(Z=>Z!==0)?Bs(s,{x:L,y:z,w:y,h:x,radius:H}):s.rect(L,z,y,x),s.fill(),A!==0&&s.stroke()}s.restore()},k=function(D,P,O){Di(s,O.text,D,P+v/2,c,{strikethrough:O.hidden,textAlign:l.textAlign(O.textAlign)})},E=this.isHorizontal(),C=this._computeTitleHeight();E?m={x:ft(o,this.left+u,this.right-i[0]),y:this.top+u+C,line:0}:m={x:this.left+u,y:ft(o,this.top+C+u,this.bottom-n[0].height),line:0},Yl(this.ctx,t.textDirection);const T=v+u;this.legendItems.forEach((D,P)=>{s.strokeStyle=D.fontColor,s.fillStyle=D.fontColor;const O=s.measureText(D.text).width,A=l.textAlign(D.textAlign||(D.textAlign=r.textAlign)),z=y+d+O;let L=m.x,H=m.y;l.setWidth(this.width),E?P>0&&L+z+u>this.right&&(H=m.y+=T,m.line++,L=m.x=ft(o,this.left+u,this.right-i[m.line])):P>0&&H+T>this.bottom&&(L=m.x=L+n[m.line].width+u,m.line++,H=m.y=ft(o,this.top+C+u,this.bottom-n[m.line].height));const Z=l.x(L);if(w(Z,H,D),L=Gf(A,L+y+d,E?L+z:this.right,t.rtl),k(l.x(L),H,D),E)m.x+=z+u;else if(typeof D.text!="string"){const nt=c.lineHeight;m.y+=cc(D,nt)+u}else m.y+=T}),Xl(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=ht(n.font),s=Mt(n.padding);if(!n.display)return;const o=Ge(t.rtl,this.left,this.width),r=this.ctx,a=n.position,l=i.size/2,c=s.top+l;let u,f=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),u=this.top+c,f=ft(t.align,f,this.right-d);else{const y=this.columnSizes.reduce((x,v)=>Math.max(x,v.height),0);u=c+ft(t.align,this.top,this.bottom-y-t.labels.padding-this._computeTitleHeight())}const m=ft(a,f,f+d);r.textAlign=o.textAlign(Nl(a)),r.textBaseline="middle",r.strokeStyle=n.color,r.fillStyle=n.color,r.font=i.string,Di(r,n.text,m,u,i)}_computeTitleHeight(){const t=this.options.title,n=ht(t.font),i=Mt(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,s,o;if(Sn(t,this.left,this.right)&&Sn(n,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],Sn(t,s.left,s.left+s.width)&&Sn(n,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const n=this.options;if(!Bg(t.type,n))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=Fg(s,i);s&&!o&&I(n.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!o&&I(n.onHover,[t,i,this],this)}else i&&I(n.onClick,[t,i,this],this)}}function zg(e,t,n,i,s){const o=Hg(i,e,t,n),r=Vg(s,i,t.lineHeight);return{itemWidth:o,itemHeight:r}}function Hg(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 Vg(e,t,n){let i=e;return typeof t.text!="string"&&(i=cc(t,n)),i}function cc(e,t){const n=e.text?e.text.length:0;return t*n}function Bg(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var Wg={id:"legend",_element:sa,start(e,t,n){const i=e.legend=new sa({ctx:e.ctx,options:n,chart:e});ne.configure(e,i,n),ne.addBox(e,i)},stop(e){ne.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;ne.configure(e,i,n),i.options=n},afterUpdate(e){const 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){const 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){const 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=>{const c=l.controller.getStyle(n?0:void 0),u=Mt(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)}}};const Tn={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){const a=e[t].element;if(a&&a.hasValue()){const 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){const l=e[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=zs(t,c);u<s&&(s=u,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,i=l.y}return{x:n,y:i}}};function Dt(e,t){return t&&(tt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Ut(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(\`
|
|
9077
9077
|
\`)>-1?e.split(\`
|
|
9078
|
-
\`):e}function Bg(e,t){const{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 ia(e,t){const n=e.chart.ctx,{body:i,footer:s,title:o}=e,{boxWidth:r,boxHeight:a}=t,l=ht(t.bodyFont),c=ht(t.titleFont),u=ht(t.footerFont),f=o.length,p=s.length,m=i.length,y=Ct(t.padding);let x=y.height,v=0,w=i.reduce((O,T)=>O+T.before.length+T.lines.length+T.after.length,0);if(w+=e.beforeBody.length+e.afterBody.length,f&&(x+=f*c.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),w){const O=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;x+=m*O+(w-m)*l.lineHeight+(w-1)*t.bodySpacing}p&&(x+=t.footerMarginTop+p*u.lineHeight+(p-1)*t.footerSpacing);let k=0;const C=function(O){v=Math.max(v,n.measureText(O).width+k)};return n.save(),n.font=c.string,F(e.title,C),n.font=l.string,F(e.beforeBody.concat(e.afterBody),C),k=t.displayColors?r+2+t.boxPadding:0,F(i,O=>{F(O.before,C),F(O.lines,C),F(O.after,C)}),k=0,n.font=u.string,F(e.footer,C),n.restore(),v+=y.width,{width:v,height:x}}function Wg(e,t){const{y:n,height:i}=t;return n<i/2?"top":n>e.height-i/2?"bottom":"center"}function jg(e,t,n,i){const{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 Ug(e,t,n,i){const{x:s,width:o}=n,{width:r,chartArea:{left:a,right:l}}=e;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),jg(c,e,t,n)&&(c="center"),c}function sa(e,t,n){const i=n.yAlign||t.yAlign||Wg(e,n);return{xAlign:n.xAlign||t.xAlign||Ug(e,t,n,i),yAlign:i}}function $g(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function Yg(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function oa(e,t,n,i){const{caretSize:s,caretPadding:o,cornerRadius:r}=e,{xAlign:a,yAlign:l}=n,c=s+o,{topLeft:u,topRight:f,bottomLeft:p,bottomRight:m}=Pn(r);let y=$g(t,a);const x=Yg(t,l,c);return l==="center"?a==="left"?y+=c:a==="right"&&(y-=c):a==="left"?y-=Math.max(u,p)+s:a==="right"&&(y+=Math.max(f,m)+s),{x:yt(y,0,i.width-t.width),y:yt(x,0,i.height-t.height)}}function fi(e,t,n){const i=Ct(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function ra(e){return It([],$t(e))}function Xg(e,t,n){return Ne(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function aa(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const oc={beforeTitle:jt,title(e){if(e.length>0){const 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:jt,beforeBody:jt,beforeLabel:jt,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return B(n)||(t+=n),t},labelColor(e){const 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){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:jt,afterBody:jt,beforeFooter:jt,footer:jt,afterFooter:jt};function lt(e,t,n,i){const s=e[t].call(n,i);return typeof s>"u"?oc[t].call(n,i):s}class la extends rn{static positioners=Mn;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(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&n.options.animation&&i.animations,o=new Ul(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Xg(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,s=lt(i,"beforeTitle",this,t),o=lt(i,"title",this,t),r=lt(i,"afterTitle",this,t);let a=[];return a=It(a,$t(s)),a=It(a,$t(o)),a=It(a,$t(r)),a}getBeforeBody(t,n){return ra(lt(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,s=[];return F(t,o=>{const r={before:[],lines:[],after:[]},a=aa(i,o);It(r.before,$t(lt(a,"beforeLabel",this,o))),It(r.lines,lt(a,"label",this,o)),It(r.after,$t(lt(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,n){return ra(lt(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,s=lt(i,"beforeFooter",this,t),o=lt(i,"footer",this,t),r=lt(i,"afterFooter",this,t);let a=[];return a=It(a,$t(s)),a=It(a,$t(o)),a=It(a,$t(r)),a}_createItems(t){const n=this._active,i=this.chart.data,s=[],o=[],r=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(Bg(this.chart,n[l]));return t.filter&&(a=a.filter((u,f,p)=>t.filter(u,f,p,i))),t.itemSort&&(a=a.sort((u,f)=>t.itemSort(u,f,i))),F(a,u=>{const f=aa(t.callbacks,u);s.push(lt(f,"labelColor",this,u)),o.push(lt(f,"labelPointStyle",this,u)),r.push(lt(f,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,n){const i=this.options.setContext(this.getContext()),s=this._active;let o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const a=Mn[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);const l=this._size=ia(this,i),c=Object.assign({},a,l),u=sa(this.chart,i,c),f=oa(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:f.x,y:f.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){const 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){const{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:f}=Pn(a),{x:p,y:m}=t,{width:y,height:x}=n;let v,w,k,C,O,T;return o==="center"?(O=m+x/2,s==="left"?(v=p,w=v-r,C=O+r,T=O-r):(v=p+y,w=v+r,C=O-r,T=O+r),k=v):(s==="left"?w=p+Math.max(l,u)+r:s==="right"?w=p+y-Math.max(c,f)-r:w=this.caretX,o==="top"?(C=m,O=C-r,v=w-r,k=w+r):(C=m+x,O=C+r,v=w+r,k=w-r),T=C),{x1:v,x2:w,x3:k,y1:C,y2:O,y3:T}}drawTitle(t,n,i){const s=this.title,o=s.length;let r,a,l;if(o){const c=Ye(i.rtl,this.x,this.width);for(t.x=fi(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",r=ht(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){const r=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=o,u=ht(o.bodyFont),f=fi(this,"left",o),p=s.x(f),m=l<u.lineHeight?(u.lineHeight-l)/2:0,y=n.y+m;if(o.usePointStyle){const x={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},v=s.leftForLtr(p,c)+c/2,w=y+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Hs(t,x,v,w),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,Hs(t,x,v,w)}else{t.lineWidth=V(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const x=s.leftForLtr(p,c),v=s.leftForLtr(s.xPlus(p,1),c-2),w=Pn(r.borderRadius);Object.values(w).some(k=>k!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Vs(t,{x,y,w:c,h:l,radius:w}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),Vs(t,{x:v,y:y+1,w:c-2,h:l-2,radius:w}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(x,y,c,l),t.strokeRect(x,y,c,l),t.fillStyle=r.backgroundColor,t.fillRect(v,y+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,f=ht(i.bodyFont);let p=f.lineHeight,m=0;const y=Ye(i.rtl,this.x,this.width),x=function(E){n.fillText(E,y.x(t.x+m),t.y+p/2),t.y+=p+o},v=y.textAlign(r);let w,k,C,O,T,D,P;for(n.textAlign=r,n.textBaseline="middle",n.font=f.string,t.x=fi(this,v,i),n.fillStyle=i.bodyColor,F(this.beforeBody,x),m=a&&v!=="right"?r==="center"?c/2+u:c+2+u:0,O=0,D=s.length;O<D;++O){for(w=s[O],k=this.labelTextColors[O],n.fillStyle=k,F(w.before,x),C=w.lines,a&&C.length&&(this._drawColorBox(n,t,O,y,i),p=Math.max(f.lineHeight,l)),T=0,P=C.length;T<P;++T)x(C[T]),p=f.lineHeight;F(w.after,x)}m=0,p=f.lineHeight,F(this.afterBody,x),t.y-=o}drawFooter(t,n,i){const s=this.footer,o=s.length;let r,a;if(o){const l=Ye(i.rtl,this.x,this.width);for(t.x=fi(this,i.footerAlign,i),t.y+=i.footerMarginTop,n.textAlign=l.textAlign(i.footerAlign),n.textBaseline="middle",r=ht(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){const{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:u}=i,{topLeft:f,topRight:p,bottomLeft:m,bottomRight:y}=Pn(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(a+f,l),r==="top"&&this.drawCaret(t,n,i,s),n.lineTo(a+c-p,l),n.quadraticCurveTo(a+c,l,a+c,l+p),r==="center"&&o==="right"&&this.drawCaret(t,n,i,s),n.lineTo(a+c,l+u-y),n.quadraticCurveTo(a+c,l+u,a+c-y,l+u),r==="bottom"&&this.drawCaret(t,n,i,s),n.lineTo(a+m,l+u),n.quadraticCurveTo(a,l+u,a,l+u-m),r==="center"&&o==="left"&&this.drawCaret(t,n,i,s),n.lineTo(a,l+f),n.quadraticCurveTo(a,l,a+f,l),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){const r=Mn[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=ia(this,t),l=Object.assign({},r,this._size),c=sa(n,t,l),u=oa(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){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=Ct(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),Bl(t,n.textDirection),o.y+=r.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),Wl(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const 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=!Ei(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;const s=this.options,o=this._active||[],r=this._getActiveElements(t,o,n,i),a=this._positionChanged(r,t),l=n||!Ei(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){const 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);const r=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&r.reverse(),r}_positionChanged(t,n){const{caretX:i,caretY:s,options:o}=this,r=Mn[o.position].call(this,t,n);return r!==!1&&(i!==r.x||s!==r.y)}}var qg={id:"tooltip",_element:la,positioners:Mn,afterInit(e,t,n){n&&(e.tooltip=new la({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){const t=e.tooltip;if(t&&t._willRender()){const 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){const 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:oc},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"]};const Kg=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function Gg(e,t,n,i){const s=e.indexOf(t);if(s===-1)return Kg(e,t,n,i);const o=e.lastIndexOf(t);return s!==o?n:s}const Zg=(e,t)=>e===null?null:yt(Math.round(e),0,t);function ca(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Qg extends an{static id="category";static defaults={ticks:{callback:ca}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const i=this.getLabels();for(const{index:s,label:o}of n)i[s]===o&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(B(t))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:Gg(i,t,R(n,t),this._addedLabels),Zg(n,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{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(){const t=this.min,n=this.max,i=this.options.offset,s=[];let 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 ca.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){const 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}}function Jg(e,t){const n=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:u,maxDigits:f,includeBounds:p}=e,m=o||1,y=u-1,{min:x,max:v}=t,w=!B(r),k=!B(a),C=!B(c),O=(v-x)/(f+1);let T=dr((v-x)/y/m)*m,D,P,E,A;if(T<1e-14&&!w&&!k)return[{value:x},{value:v}];A=Math.ceil(v/T)-Math.floor(x/T),A>y&&(T=dr(A*T/y/m)*m),B(l)||(D=Math.pow(10,l),T=Math.ceil(T*D)/D),s==="ticks"?(P=Math.floor(x/T)*T,E=Math.ceil(v/T)*T):(P=x,E=v),w&&k&&o&&Nf((a-r)/o,T/1e3)?(A=Math.round(Math.min((a-r)/T,u)),T=(a-r)/A,P=r,E=a):C?(P=w?r:P,E=k?a:E,A=c-1,T=(E-P)/A):(A=(E-P)/T,De(A,Math.round(A),T/1e3)?A=Math.round(A):A=Math.ceil(A));const z=Math.max(pr(T),pr(P));D=Math.pow(10,B(l)?z:l),P=Math.round(P*D)/D,E=Math.round(E*D)/D;let L=0;for(w&&(p&&P!==r?(n.push({value:r}),P<r&&L++,De(Math.round((P+L*T)*D)/D,r,ua(r,O,e))&&L++):P<r&&L++);L<A;++L){const H=Math.round((P+L*T)*D)/D;if(k&&H>a)break;n.push({value:H})}return k&&p&&E!==a?n.length&&De(n[n.length-1].value,a,ua(a,O,e))?n[n.length-1].value=a:n.push({value:a}):(!k||E===a)&&n.push({value:E}),n}function ua(e,t,{horizontal:n,minRotation:i}){const s=Ce(i),o=(n?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+e).length;return Math.min(t/o,r)}class tm extends an{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 B(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:s,max:o}=this;const r=l=>s=n?s:l,a=l=>o=i?o:l;if(t){const l=ue(s),c=ue(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(){const t=this.options.ticks;let{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(){const t=this.options,n=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const 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=Jg(s,o);return t.bounds==="ticks"&&Ff(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(){const t=this.ticks;let n=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const 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 Al(t,this.chart.options.locale,this.options.ticks.format)}}class em extends tm{static id="linear";static defaults={ticks:{callback:Il.formatters.numeric}};determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=_t(t)?t:0,this.max=_t(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=Ce(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}}const ji={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}},ut=Object.keys(ji);function ha(e,t){return e-t}function fa(e,t){if(B(t))return null;const n=e._adapter,{parser:i,round:s,isoWeekday:o}=e._parseOpts;let r=t;return typeof i=="function"&&(r=i(r)),_t(r)||(r=typeof i=="string"?n.parse(r,i):n.parse(r)),r===null?null:(s&&(r=s==="week"&&(Nn(o)||o===!0)?n.startOf(r,"isoWeek",o):n.startOf(r,s)),+r)}function da(e,t,n,i){const s=ut.length;for(let o=ut.indexOf(e);o<s-1;++o){const r=ji[ut[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((n-t)/(a*r.size))<=i)return ut[o]}return ut[s-1]}function nm(e,t,n,i,s){for(let o=ut.length-1;o>=ut.indexOf(n);o--){const r=ut[o];if(ji[r].common&&e._adapter.diff(s,i,r)>=t-1)return r}return ut[n?ut.indexOf(n):0]}function im(e){for(let t=ut.indexOf(e)+1,n=ut.length;t<n;++t)if(ji[ut[t]].common)return ut[t]}function pa(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:i,hi:s}=bo(n,t),o=n[i]>=t?n[i]:n[s];e[o]=!0}}function sm(e,t,n,i){const s=e._adapter,o=+s.startOf(t[0].value,i),r=t[t.length-1].value;let 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 ga(e,t,n){const i=[],s={},o=t.length;let 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:sm(e,i,s,n)}class ma extends an{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};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={}){const i=t.time||(t.time={}),s=this._adapter=new gp._date(t.adapters.date);s.init(n),En(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:fa(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,i=t.time.unit||"day";let{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=_t(s)&&!isNaN(s)?s:+n.startOf(Date.now(),i),o=_t(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(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],i=t[t.length-1]),{min:n,max:i}}buildTicks(){const 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]);const o=this.min,r=this.max,a=jf(s,o,r);return this._unit=n.unit||(i.autoSkip?da(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):nm(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:im(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),ga(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);const r=t.length<3?.5:.25;n=yt(n,0,r),i=yt(i,0,r),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,s=this.options,o=s.time,r=o.unit||da(o.minUnit,n,i,this._getLabelCapacity(n)),a=R(s.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=Nn(l)||l===!0,u={};let f=n,p,m;if(c&&(f=+t.startOf(f,"isoWeek",l)),f=+t.startOf(f,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);const y=s.ticks.source==="data"&&this.getDataTimestamps();for(p=f,m=0;p<i;p=+t.add(p,a,r),m++)pa(u,p,y);return(p===i||s.bounds==="ticks"||m===1)&&pa(u,p,y),Object.keys(u).sort(ha).map(x=>+x)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){const s=this.options.time.displayFormats,o=this._unit,r=n||s[o];return this._adapter.format(t,r)}_tickFormatFunction(t,n,i,s){const o=this.options,r=o.ticks.callback;if(r)return I(r,[t,n,i],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],f=c&&a[c],p=i[n],m=c&&f&&p&&p.major;return this._adapter.format(t,s||(m?f: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){const n=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+i)*n.factor)}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,i=this.ctx.measureText(t).width,s=Ce(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){const n=this.options.time,i=n.displayFormats,s=i[n.unit]||i.millisecond,o=this._tickFormatFunction(t,0,ga(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;const 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(){const t=this._cache.labels||[];let n,i;if(t.length)return t;const s=this.getLabels();for(n=0,i=s.length;n<i;++n)t.push(fa(this,s[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return $f(t.sort(ha))}}function di(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}=Oe(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}=Oe(e,"time",t)),{time:o,pos:a}=e[i],{time:r,pos:l}=e[s]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class db extends ma{static id="timeseries";static defaults=ma.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=di(n,this.min),this._tableRange=di(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,s=[],o=[];let 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(){const t=this.min,n=this.max;let 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;const 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(di(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return di(this._table,i*this._tableRange+this._minPos,!0)}}function om(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hs={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
9078
|
+
\`):e}function jg(e,t){const{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 oa(e,t){const n=e.chart.ctx,{body:i,footer:s,title:o}=e,{boxWidth:r,boxHeight:a}=t,l=ht(t.bodyFont),c=ht(t.titleFont),u=ht(t.footerFont),f=o.length,d=s.length,m=i.length,y=Mt(t.padding);let x=y.height,v=0,w=i.reduce((C,T)=>C+T.before.length+T.lines.length+T.after.length,0);if(w+=e.beforeBody.length+e.afterBody.length,f&&(x+=f*c.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),w){const C=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;x+=m*C+(w-m)*l.lineHeight+(w-1)*t.bodySpacing}d&&(x+=t.footerMarginTop+d*u.lineHeight+(d-1)*t.footerSpacing);let k=0;const E=function(C){v=Math.max(v,n.measureText(C).width+k)};return n.save(),n.font=c.string,F(e.title,E),n.font=l.string,F(e.beforeBody.concat(e.afterBody),E),k=t.displayColors?r+2+t.boxPadding:0,F(i,C=>{F(C.before,E),F(C.lines,E),F(C.after,E)}),k=0,n.font=u.string,F(e.footer,E),n.restore(),v+=y.width,{width:v,height:x}}function $g(e,t){const{y:n,height:i}=t;return n<i/2?"top":n>e.height-i/2?"bottom":"center"}function Ug(e,t,n,i){const{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 Yg(e,t,n,i){const{x:s,width:o}=n,{width:r,chartArea:{left:a,right:l}}=e;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),Ug(c,e,t,n)&&(c="center"),c}function ra(e,t,n){const i=n.yAlign||t.yAlign||$g(e,n);return{xAlign:n.xAlign||t.xAlign||Yg(e,t,n,i),yAlign:i}}function Xg(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function qg(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function aa(e,t,n,i){const{caretSize:s,caretPadding:o,cornerRadius:r}=e,{xAlign:a,yAlign:l}=n,c=s+o,{topLeft:u,topRight:f,bottomLeft:d,bottomRight:m}=On(r);let y=Xg(t,a);const x=qg(t,l,c);return l==="center"?a==="left"?y+=c:a==="right"&&(y-=c):a==="left"?y-=Math.max(u,d)+s:a==="right"&&(y+=Math.max(f,m)+s),{x:xt(y,0,i.width-t.width),y:xt(x,0,i.height-t.height)}}function fi(e,t,n){const i=Mt(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function la(e){return Dt([],Ut(e))}function Gg(e,t,n){return Ve(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function ca(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const uc={beforeTitle:jt,title(e){if(e.length>0){const 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:jt,beforeBody:jt,beforeLabel:jt,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return B(n)||(t+=n),t},labelColor(e){const 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){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:jt,afterBody:jt,beforeFooter:jt,footer:jt,afterFooter:jt};function lt(e,t,n,i){const s=e[t].call(n,i);return typeof s>"u"?uc[t].call(n,i):s}class ua extends on{static positioners=Tn;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(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&n.options.animation&&i.animations,o=new Gl(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Gg(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,s=lt(i,"beforeTitle",this,t),o=lt(i,"title",this,t),r=lt(i,"afterTitle",this,t);let a=[];return a=Dt(a,Ut(s)),a=Dt(a,Ut(o)),a=Dt(a,Ut(r)),a}getBeforeBody(t,n){return la(lt(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,s=[];return F(t,o=>{const r={before:[],lines:[],after:[]},a=ca(i,o);Dt(r.before,Ut(lt(a,"beforeLabel",this,o))),Dt(r.lines,lt(a,"label",this,o)),Dt(r.after,Ut(lt(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,n){return la(lt(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,s=lt(i,"beforeFooter",this,t),o=lt(i,"footer",this,t),r=lt(i,"afterFooter",this,t);let a=[];return a=Dt(a,Ut(s)),a=Dt(a,Ut(o)),a=Dt(a,Ut(r)),a}_createItems(t){const n=this._active,i=this.chart.data,s=[],o=[],r=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(jg(this.chart,n[l]));return t.filter&&(a=a.filter((u,f,d)=>t.filter(u,f,d,i))),t.itemSort&&(a=a.sort((u,f)=>t.itemSort(u,f,i))),F(a,u=>{const f=ca(t.callbacks,u);s.push(lt(f,"labelColor",this,u)),o.push(lt(f,"labelPointStyle",this,u)),r.push(lt(f,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,n){const i=this.options.setContext(this.getContext()),s=this._active;let o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const a=Tn[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);const l=this._size=oa(this,i),c=Object.assign({},a,l),u=ra(this.chart,i,c),f=aa(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:f.x,y:f.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){const 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){const{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:f}=On(a),{x:d,y:m}=t,{width:y,height:x}=n;let v,w,k,E,C,T;return o==="center"?(C=m+x/2,s==="left"?(v=d,w=v-r,E=C+r,T=C-r):(v=d+y,w=v+r,E=C-r,T=C+r),k=v):(s==="left"?w=d+Math.max(l,u)+r:s==="right"?w=d+y-Math.max(c,f)-r:w=this.caretX,o==="top"?(E=m,C=E-r,v=w-r,k=w+r):(E=m+x,C=E+r,v=w+r,k=w-r),T=E),{x1:v,x2:w,x3:k,y1:E,y2:C,y3:T}}drawTitle(t,n,i){const s=this.title,o=s.length;let r,a,l;if(o){const c=Ge(i.rtl,this.x,this.width);for(t.x=fi(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",r=ht(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){const r=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=o,u=ht(o.bodyFont),f=fi(this,"left",o),d=s.x(f),m=l<u.lineHeight?(u.lineHeight-l)/2:0,y=n.y+m;if(o.usePointStyle){const x={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},v=s.leftForLtr(d,c)+c/2,w=y+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Vs(t,x,v,w),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,Vs(t,x,v,w)}else{t.lineWidth=V(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const x=s.leftForLtr(d,c),v=s.leftForLtr(s.xPlus(d,1),c-2),w=On(r.borderRadius);Object.values(w).some(k=>k!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Bs(t,{x,y,w:c,h:l,radius:w}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),Bs(t,{x:v,y:y+1,w:c-2,h:l-2,radius:w}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(x,y,c,l),t.strokeRect(x,y,c,l),t.fillStyle=r.backgroundColor,t.fillRect(v,y+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,f=ht(i.bodyFont);let d=f.lineHeight,m=0;const y=Ge(i.rtl,this.x,this.width),x=function(O){n.fillText(O,y.x(t.x+m),t.y+d/2),t.y+=d+o},v=y.textAlign(r);let w,k,E,C,T,D,P;for(n.textAlign=r,n.textBaseline="middle",n.font=f.string,t.x=fi(this,v,i),n.fillStyle=i.bodyColor,F(this.beforeBody,x),m=a&&v!=="right"?r==="center"?c/2+u:c+2+u:0,C=0,D=s.length;C<D;++C){for(w=s[C],k=this.labelTextColors[C],n.fillStyle=k,F(w.before,x),E=w.lines,a&&E.length&&(this._drawColorBox(n,t,C,y,i),d=Math.max(f.lineHeight,l)),T=0,P=E.length;T<P;++T)x(E[T]),d=f.lineHeight;F(w.after,x)}m=0,d=f.lineHeight,F(this.afterBody,x),t.y-=o}drawFooter(t,n,i){const s=this.footer,o=s.length;let r,a;if(o){const l=Ge(i.rtl,this.x,this.width);for(t.x=fi(this,i.footerAlign,i),t.y+=i.footerMarginTop,n.textAlign=l.textAlign(i.footerAlign),n.textBaseline="middle",r=ht(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){const{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:u}=i,{topLeft:f,topRight:d,bottomLeft:m,bottomRight:y}=On(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(a+f,l),r==="top"&&this.drawCaret(t,n,i,s),n.lineTo(a+c-d,l),n.quadraticCurveTo(a+c,l,a+c,l+d),r==="center"&&o==="right"&&this.drawCaret(t,n,i,s),n.lineTo(a+c,l+u-y),n.quadraticCurveTo(a+c,l+u,a+c-y,l+u),r==="bottom"&&this.drawCaret(t,n,i,s),n.lineTo(a+m,l+u),n.quadraticCurveTo(a,l+u,a,l+u-m),r==="center"&&o==="left"&&this.drawCaret(t,n,i,s),n.lineTo(a,l+f),n.quadraticCurveTo(a,l,a+f,l),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){const r=Tn[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=oa(this,t),l=Object.assign({},r,this._size),c=ra(n,t,l),u=aa(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){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=Mt(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),Yl(t,n.textDirection),o.y+=r.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),Xl(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const 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=!Mi(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;const s=this.options,o=this._active||[],r=this._getActiveElements(t,o,n,i),a=this._positionChanged(r,t),l=n||!Mi(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){const 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);const r=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&r.reverse(),r}_positionChanged(t,n){const{caretX:i,caretY:s,options:o}=this,r=Tn[o.position].call(this,t,n);return r!==!1&&(i!==r.x||s!==r.y)}}var Kg={id:"tooltip",_element:ua,positioners:Tn,afterInit(e,t,n){n&&(e.tooltip=new ua({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){const t=e.tooltip;if(t&&t._willRender()){const 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){const 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:uc},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"]};const Zg=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function Qg(e,t,n,i){const s=e.indexOf(t);if(s===-1)return Zg(e,t,n,i);const o=e.lastIndexOf(t);return s!==o?n:s}const Jg=(e,t)=>e===null?null:xt(Math.round(e),0,t);function ha(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class tm extends rn{static id="category";static defaults={ticks:{callback:ha}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const i=this.getLabels();for(const{index:s,label:o}of n)i[s]===o&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(B(t))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:Qg(i,t,R(n,t),this._addedLabels),Jg(n,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{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(){const t=this.min,n=this.max,i=this.options.offset,s=[];let 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 ha.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){const 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}}function em(e,t){const n=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:u,maxDigits:f,includeBounds:d}=e,m=o||1,y=u-1,{min:x,max:v}=t,w=!B(r),k=!B(a),E=!B(c),C=(v-x)/(f+1);let T=gr((v-x)/y/m)*m,D,P,O,A;if(T<1e-14&&!w&&!k)return[{value:x},{value:v}];A=Math.ceil(v/T)-Math.floor(x/T),A>y&&(T=gr(A*T/y/m)*m),B(l)||(D=Math.pow(10,l),T=Math.ceil(T*D)/D),s==="ticks"?(P=Math.floor(x/T)*T,O=Math.ceil(v/T)*T):(P=x,O=v),w&&k&&o&&zf((a-r)/o,T/1e3)?(A=Math.round(Math.min((a-r)/T,u)),T=(a-r)/A,P=r,O=a):E?(P=w?r:P,O=k?a:O,A=c-1,T=(O-P)/A):(A=(O-P)/T,Ie(A,Math.round(A),T/1e3)?A=Math.round(A):A=Math.ceil(A));const z=Math.max(mr(T),mr(P));D=Math.pow(10,B(l)?z:l),P=Math.round(P*D)/D,O=Math.round(O*D)/D;let L=0;for(w&&(d&&P!==r?(n.push({value:r}),P<r&&L++,Ie(Math.round((P+L*T)*D)/D,r,fa(r,C,e))&&L++):P<r&&L++);L<A;++L){const H=Math.round((P+L*T)*D)/D;if(k&&H>a)break;n.push({value:H})}return k&&d&&O!==a?n.length&&Ie(n[n.length-1].value,a,fa(a,C,e))?n[n.length-1].value=a:n.push({value:a}):(!k||O===a)&&n.push({value:O}),n}function fa(e,t,{horizontal:n,minRotation:i}){const s=Pe(i),o=(n?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+e).length;return Math.min(t/o,r)}class nm extends rn{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 B(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:s,max:o}=this;const r=l=>s=n?s:l,a=l=>o=i?o:l;if(t){const l=he(s),c=he(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(){const t=this.options.ticks;let{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(){const t=this.options,n=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const 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=em(s,o);return t.bounds==="ticks"&&Hf(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(){const t=this.ticks;let n=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const 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 Fl(t,this.chart.options.locale,this.options.ticks.format)}}class im extends nm{static id="linear";static defaults={ticks:{callback:zl.formatters.numeric}};determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=vt(t)?t:0,this.max=vt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=Pe(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}}const Wi={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}},ut=Object.keys(Wi);function da(e,t){return e-t}function pa(e,t){if(B(t))return null;const n=e._adapter,{parser:i,round:s,isoWeekday:o}=e._parseOpts;let r=t;return typeof i=="function"&&(r=i(r)),vt(r)||(r=typeof i=="string"?n.parse(r,i):n.parse(r)),r===null?null:(s&&(r=s==="week"&&(Rn(o)||o===!0)?n.startOf(r,"isoWeek",o):n.startOf(r,s)),+r)}function ga(e,t,n,i){const s=ut.length;for(let o=ut.indexOf(e);o<s-1;++o){const r=Wi[ut[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((n-t)/(a*r.size))<=i)return ut[o]}return ut[s-1]}function sm(e,t,n,i,s){for(let o=ut.length-1;o>=ut.indexOf(n);o--){const r=ut[o];if(Wi[r].common&&e._adapter.diff(s,i,r)>=t-1)return r}return ut[n?ut.indexOf(n):0]}function om(e){for(let t=ut.indexOf(e)+1,n=ut.length;t<n;++t)if(Wi[ut[t]].common)return ut[t]}function ma(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:i,hi:s}=xo(n,t),o=n[i]>=t?n[i]:n[s];e[o]=!0}}function rm(e,t,n,i){const s=e._adapter,o=+s.startOf(t[0].value,i),r=t[t.length-1].value;let 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 ba(e,t,n){const i=[],s={},o=t.length;let 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:rm(e,i,s,n)}class xa extends rn{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};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={}){const i=t.time||(t.time={}),s=this._adapter=new bp._date(t.adapters.date);s.init(n),Mn(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:pa(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,i=t.time.unit||"day";let{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=vt(s)&&!isNaN(s)?s:+n.startOf(Date.now(),i),o=vt(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(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],i=t[t.length-1]),{min:n,max:i}}buildTicks(){const 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]);const o=this.min,r=this.max,a=Uf(s,o,r);return this._unit=n.unit||(i.autoSkip?ga(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):sm(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:om(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),ba(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);const r=t.length<3?.5:.25;n=xt(n,0,r),i=xt(i,0,r),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,s=this.options,o=s.time,r=o.unit||ga(o.minUnit,n,i,this._getLabelCapacity(n)),a=R(s.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=Rn(l)||l===!0,u={};let f=n,d,m;if(c&&(f=+t.startOf(f,"isoWeek",l)),f=+t.startOf(f,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);const y=s.ticks.source==="data"&&this.getDataTimestamps();for(d=f,m=0;d<i;d=+t.add(d,a,r),m++)ma(u,d,y);return(d===i||s.bounds==="ticks"||m===1)&&ma(u,d,y),Object.keys(u).sort(da).map(x=>+x)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){const s=this.options.time.displayFormats,o=this._unit,r=n||s[o];return this._adapter.format(t,r)}_tickFormatFunction(t,n,i,s){const o=this.options,r=o.ticks.callback;if(r)return I(r,[t,n,i],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],f=c&&a[c],d=i[n],m=c&&f&&d&&d.major;return this._adapter.format(t,s||(m?f: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){const n=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+i)*n.factor)}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,i=this.ctx.measureText(t).width,s=Pe(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){const n=this.options.time,i=n.displayFormats,s=i[n.unit]||i.millisecond,o=this._tickFormatFunction(t,0,ba(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;const 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(){const t=this._cache.labels||[];let n,i;if(t.length)return t;const s=this.getLabels();for(n=0,i=s.length;n<i;++n)t.push(pa(this,s[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Xf(t.sort(da))}}function di(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}=De(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}=De(e,"time",t)),{time:o,pos:a}=e[i],{time:r,pos:l}=e[s]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class gb extends xa{static id="timeseries";static defaults=xa.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=di(n,this.min),this._tableRange=di(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,s=[],o=[];let 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(){const t=this.min,n=this.max;let 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;const 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(di(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return di(this._table,i*this._tableRange+this._minPos,!0)}}function am(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var us={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
9079
9079
|
* http://hammerjs.github.io/
|
|
9080
9080
|
*
|
|
9081
9081
|
* Copyright (c) 2016 Jorik Tangelder;
|
|
9082
|
-
* Licensed under the MIT license */var
|
|
9082
|
+
* Licensed under the MIT license */var ya;function lm(){return ya||(ya=1,(function(e){(function(t,n,i,s){var o=["","webkit","Moz","MS","ms","o"],r=n.createElement("div"),a="function",l=Math.round,c=Math.abs,u=Date.now;function f(h,p,b){return setTimeout(E(h,b),p)}function d(h,p,b){return Array.isArray(h)?(m(h,b[p],b),!0):!1}function m(h,p,b){var _;if(h)if(h.forEach)h.forEach(p,b);else if(h.length!==s)for(_=0;_<h.length;)p.call(b,h[_],_,h),_++;else for(_ in h)h.hasOwnProperty(_)&&p.call(b,h[_],_,h)}function y(h,p,b){var _="DEPRECATED METHOD: "+p+\`
|
|
9083
9083
|
\`+b+\` AT
|
|
9084
|
-
\`;return function(){var S=new Error("get-stack-trace"),M=S&&S.stack?S.stack.replace(/^[^\\(]+?[\\n$]/gm,"").replace(/^\\s+at\\s+/gm,"").replace(/^Object.<anonymous>\\s*\\(/gm,"{anonymous}()@"):"Unknown Stack Trace",N=t.console&&(t.console.warn||t.console.log);return N&&N.call(t.console,_,M),h.apply(this,arguments)}}var x;typeof Object.assign!="function"?x=function(d){if(d===s||d===null)throw new TypeError("Cannot convert undefined or null to object");for(var b=Object(d),_=1;_<arguments.length;_++){var S=arguments[_];if(S!==s&&S!==null)for(var M in S)S.hasOwnProperty(M)&&(b[M]=S[M])}return b}:x=Object.assign;var v=y(function(d,b,_){for(var S=Object.keys(b),M=0;M<S.length;)(!_||_&&d[S[M]]===s)&&(d[S[M]]=b[S[M]]),M++;return d},"extend","Use \`assign\`."),w=y(function(d,b){return v(d,b,!0)},"merge","Use \`assign\`.");function k(h,d,b){var _=d.prototype,S;S=h.prototype=Object.create(_),S.constructor=h,S._super=_,b&&x(S,b)}function C(h,d){return function(){return h.apply(d,arguments)}}function O(h,d){return typeof h==a?h.apply(d&&d[0]||s,d):h}function T(h,d){return h===s?d:h}function D(h,d,b){m(z(d),function(_){h.addEventListener(_,b,!1)})}function P(h,d,b){m(z(d),function(_){h.removeEventListener(_,b,!1)})}function E(h,d){for(;h;){if(h==d)return!0;h=h.parentNode}return!1}function A(h,d){return h.indexOf(d)>-1}function z(h){return h.trim().split(/\\s+/g)}function L(h,d,b){if(h.indexOf&&!b)return h.indexOf(d);for(var _=0;_<h.length;){if(b&&h[_][b]==d||!b&&h[_]===d)return _;_++}return-1}function H(h){return Array.prototype.slice.call(h,0)}function Z(h,d,b){for(var _=[],S=[],M=0;M<h.length;){var N=h[M][d];L(S,N)<0&&_.push(h[M]),S[M]=N,M++}return _=_.sort(function(Q,ot){return Q[d]>ot[d]}),_}function nt(h,d){for(var b,_,S=d[0].toUpperCase()+d.slice(1),M=0;M<o.length;){if(b=o[M],_=b?b+S:d,_ in h)return _;M++}return s}var j=1;function q(){return j++}function it(h){var d=h.ownerDocument||h;return d.defaultView||d.parentWindow||t}var ze=/mobile|tablet|ip(ad|hone|od)|android/i,me="ontouchstart"in t,Kt=nt(t,"PointerEvent")!==s,He=me&&ze.test(navigator.userAgent),pt="touch",be="pen",St="mouse",xe="kinect",Vt=25,st=1,ye=2,X=4,at=8,Wn=1,cn=2,un=4,hn=8,fn=16,Ot=cn|un,ve=hn|fn,Oo=Ot|ve,Po=["x","y"],jn=["clientX","clientY"];function gt(h,d){var b=this;this.manager=h,this.callback=d,this.element=h.element,this.target=h.options.inputTarget,this.domHandler=function(_){O(h.options.enable,[h])&&b.handler(_)},this.init()}gt.prototype={handler:function(){},init:function(){this.evEl&&D(this.element,this.evEl,this.domHandler),this.evTarget&&D(this.target,this.evTarget,this.domHandler),this.evWin&&D(it(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(it(this.element),this.evWin,this.domHandler)}};function Sc(h){var d,b=h.options.inputClass;return b?d=b:Kt?d=$i:He?d=Yn:me?d=Yi:d=$n,new d(h,kc)}function kc(h,d,b){var _=b.pointers.length,S=b.changedPointers.length,M=d&st&&_-S===0,N=d&(X|at)&&_-S===0;b.isFirst=!!M,b.isFinal=!!N,M&&(h.session={}),b.eventType=d,Tc(h,b),h.emit("hammer.input",b),h.recognize(b),h.session.prevInput=b}function Tc(h,d){var b=h.session,_=d.pointers,S=_.length;b.firstInput||(b.firstInput=Do(d)),S>1&&!b.firstMultiple?b.firstMultiple=Do(d):S===1&&(b.firstMultiple=!1);var M=b.firstInput,N=b.firstMultiple,G=N?N.center:M.center,Q=d.center=Ao(_);d.timeStamp=u(),d.deltaTime=d.timeStamp-M.timeStamp,d.angle=Ui(G,Q),d.distance=Un(G,Q),Mc(b,d),d.offsetDirection=Lo(d.deltaX,d.deltaY);var ot=Io(d.deltaTime,d.deltaX,d.deltaY);d.overallVelocityX=ot.x,d.overallVelocityY=ot.y,d.overallVelocity=c(ot.x)>c(ot.y)?ot.x:ot.y,d.scale=N?Oc(N.pointers,_):1,d.rotation=N?Cc(N.pointers,_):0,d.maxPointers=b.prevInput?d.pointers.length>b.prevInput.maxPointers?d.pointers.length:b.prevInput.maxPointers:d.pointers.length,Ec(b,d);var Dt=h.element;E(d.srcEvent.target,Dt)&&(Dt=d.srcEvent.target),d.target=Dt}function Mc(h,d){var b=d.center,_=h.offsetDelta||{},S=h.prevDelta||{},M=h.prevInput||{};(d.eventType===st||M.eventType===X)&&(S=h.prevDelta={x:M.deltaX||0,y:M.deltaY||0},_=h.offsetDelta={x:b.x,y:b.y}),d.deltaX=S.x+(b.x-_.x),d.deltaY=S.y+(b.y-_.y)}function Ec(h,d){var b=h.lastInterval||d,_=d.timeStamp-b.timeStamp,S,M,N,G;if(d.eventType!=at&&(_>Vt||b.velocity===s)){var Q=d.deltaX-b.deltaX,ot=d.deltaY-b.deltaY,Dt=Io(_,Q,ot);M=Dt.x,N=Dt.y,S=c(Dt.x)>c(Dt.y)?Dt.x:Dt.y,G=Lo(Q,ot),h.lastInterval=d}else S=b.velocity,M=b.velocityX,N=b.velocityY,G=b.direction;d.velocity=S,d.velocityX=M,d.velocityY=N,d.direction=G}function Do(h){for(var d=[],b=0;b<h.pointers.length;)d[b]={clientX:l(h.pointers[b].clientX),clientY:l(h.pointers[b].clientY)},b++;return{timeStamp:u(),pointers:d,center:Ao(d),deltaX:h.deltaX,deltaY:h.deltaY}}function Ao(h){var d=h.length;if(d===1)return{x:l(h[0].clientX),y:l(h[0].clientY)};for(var b=0,_=0,S=0;S<d;)b+=h[S].clientX,_+=h[S].clientY,S++;return{x:l(b/d),y:l(_/d)}}function Io(h,d,b){return{x:d/h||0,y:b/h||0}}function Lo(h,d){return h===d?Wn:c(h)>=c(d)?h<0?cn:un:d<0?hn:fn}function Un(h,d,b){b||(b=Po);var _=d[b[0]]-h[b[0]],S=d[b[1]]-h[b[1]];return Math.sqrt(_*_+S*S)}function Ui(h,d,b){b||(b=Po);var _=d[b[0]]-h[b[0]],S=d[b[1]]-h[b[1]];return Math.atan2(S,_)*180/Math.PI}function Cc(h,d){return Ui(d[1],d[0],jn)+Ui(h[1],h[0],jn)}function Oc(h,d){return Un(d[0],d[1],jn)/Un(h[0],h[1],jn)}var Pc={mousedown:st,mousemove:ye,mouseup:X},Dc="mousedown",Ac="mousemove mouseup";function $n(){this.evEl=Dc,this.evWin=Ac,this.pressed=!1,gt.apply(this,arguments)}k($n,gt,{handler:function(d){var b=Pc[d.type];b&st&&d.button===0&&(this.pressed=!0),b&ye&&d.which!==1&&(b=X),this.pressed&&(b&X&&(this.pressed=!1),this.callback(this.manager,b,{pointers:[d],changedPointers:[d],pointerType:St,srcEvent:d}))}});var Ic={pointerdown:st,pointermove:ye,pointerup:X,pointercancel:at,pointerout:at},Lc={2:pt,3:be,4:St,5:xe},Ro="pointerdown",No="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(Ro="MSPointerDown",No="MSPointerMove MSPointerUp MSPointerCancel");function $i(){this.evEl=Ro,this.evWin=No,gt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}k($i,gt,{handler:function(d){var b=this.store,_=!1,S=d.type.toLowerCase().replace("ms",""),M=Ic[S],N=Lc[d.pointerType]||d.pointerType,G=N==pt,Q=L(b,d.pointerId,"pointerId");M&st&&(d.button===0||G)?Q<0&&(b.push(d),Q=b.length-1):M&(X|at)&&(_=!0),!(Q<0)&&(b[Q]=d,this.callback(this.manager,M,{pointers:b,changedPointers:[d],pointerType:N,srcEvent:d}),_&&b.splice(Q,1))}});var Rc={touchstart:st,touchmove:ye,touchend:X,touchcancel:at},Nc="touchstart",Fc="touchstart touchmove touchend touchcancel";function Fo(){this.evTarget=Nc,this.evWin=Fc,this.started=!1,gt.apply(this,arguments)}k(Fo,gt,{handler:function(d){var b=Rc[d.type];if(b===st&&(this.started=!0),!!this.started){var _=zc.call(this,d,b);b&(X|at)&&_[0].length-_[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:_[0],changedPointers:_[1],pointerType:pt,srcEvent:d})}}});function zc(h,d){var b=H(h.touches),_=H(h.changedTouches);return d&(X|at)&&(b=Z(b.concat(_),"identifier")),[b,_]}var Hc={touchstart:st,touchmove:ye,touchend:X,touchcancel:at},Vc="touchstart touchmove touchend touchcancel";function Yn(){this.evTarget=Vc,this.targetIds={},gt.apply(this,arguments)}k(Yn,gt,{handler:function(d){var b=Hc[d.type],_=Bc.call(this,d,b);_&&this.callback(this.manager,b,{pointers:_[0],changedPointers:_[1],pointerType:pt,srcEvent:d})}});function Bc(h,d){var b=H(h.touches),_=this.targetIds;if(d&(st|ye)&&b.length===1)return _[b[0].identifier]=!0,[b,b];var S,M,N=H(h.changedTouches),G=[],Q=this.target;if(M=b.filter(function(ot){return E(ot.target,Q)}),d===st)for(S=0;S<M.length;)_[M[S].identifier]=!0,S++;for(S=0;S<N.length;)_[N[S].identifier]&&G.push(N[S]),d&(X|at)&&delete _[N[S].identifier],S++;if(G.length)return[Z(M.concat(G),"identifier"),G]}var Wc=2500,zo=25;function Yi(){gt.apply(this,arguments);var h=C(this.handler,this);this.touch=new Yn(this.manager,h),this.mouse=new $n(this.manager,h),this.primaryTouch=null,this.lastTouches=[]}k(Yi,gt,{handler:function(d,b,_){var S=_.pointerType==pt,M=_.pointerType==St;if(!(M&&_.sourceCapabilities&&_.sourceCapabilities.firesTouchEvents)){if(S)jc.call(this,b,_);else if(M&&Uc.call(this,_))return;this.callback(d,b,_)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function jc(h,d){h&st?(this.primaryTouch=d.changedPointers[0].identifier,Ho.call(this,d)):h&(X|at)&&Ho.call(this,d)}function Ho(h){var d=h.changedPointers[0];if(d.identifier===this.primaryTouch){var b={x:d.clientX,y:d.clientY};this.lastTouches.push(b);var _=this.lastTouches,S=function(){var M=_.indexOf(b);M>-1&&_.splice(M,1)};setTimeout(S,Wc)}}function Uc(h){for(var d=h.srcEvent.clientX,b=h.srcEvent.clientY,_=0;_<this.lastTouches.length;_++){var S=this.lastTouches[_],M=Math.abs(d-S.x),N=Math.abs(b-S.y);if(M<=zo&&N<=zo)return!0}return!1}var Vo=nt(r.style,"touchAction"),Bo=Vo!==s,Wo="compute",jo="auto",Xi="manipulation",_e="none",dn="pan-x",pn="pan-y",Xn=Yc();function qi(h,d){this.manager=h,this.set(d)}qi.prototype={set:function(h){h==Wo&&(h=this.compute()),Bo&&this.manager.element.style&&Xn[h]&&(this.manager.element.style[Vo]=h),this.actions=h.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var h=[];return m(this.manager.recognizers,function(d){O(d.options.enable,[d])&&(h=h.concat(d.getTouchAction()))}),$c(h.join(" "))},preventDefaults:function(h){var d=h.srcEvent,b=h.offsetDirection;if(this.manager.session.prevented){d.preventDefault();return}var _=this.actions,S=A(_,_e)&&!Xn[_e],M=A(_,pn)&&!Xn[pn],N=A(_,dn)&&!Xn[dn];if(S){var G=h.pointers.length===1,Q=h.distance<2,ot=h.deltaTime<250;if(G&&Q&&ot)return}if(!(N&&M)&&(S||M&&b&Ot||N&&b&ve))return this.preventSrc(d)},preventSrc:function(h){this.manager.session.prevented=!0,h.preventDefault()}};function $c(h){if(A(h,_e))return _e;var d=A(h,dn),b=A(h,pn);return d&&b?_e:d||b?d?dn:pn:A(h,Xi)?Xi:jo}function Yc(){if(!Bo)return!1;var h={},d=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(b){h[b]=d?t.CSS.supports("touch-action",b):!0}),h}var qn=1,mt=2,Ve=4,Gt=8,Bt=Gt,gn=16,Pt=32;function Wt(h){this.options=x({},this.defaults,h||{}),this.id=q(),this.manager=null,this.options.enable=T(this.options.enable,!0),this.state=qn,this.simultaneous={},this.requireFail=[]}Wt.prototype={defaults:{},set:function(h){return x(this.options,h),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(h){if(p(h,"recognizeWith",this))return this;var d=this.simultaneous;return h=Kn(h,this),d[h.id]||(d[h.id]=h,h.recognizeWith(this)),this},dropRecognizeWith:function(h){return p(h,"dropRecognizeWith",this)?this:(h=Kn(h,this),delete this.simultaneous[h.id],this)},requireFailure:function(h){if(p(h,"requireFailure",this))return this;var d=this.requireFail;return h=Kn(h,this),L(d,h)===-1&&(d.push(h),h.requireFailure(this)),this},dropRequireFailure:function(h){if(p(h,"dropRequireFailure",this))return this;h=Kn(h,this);var d=L(this.requireFail,h);return d>-1&&this.requireFail.splice(d,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(h){return!!this.simultaneous[h.id]},emit:function(h){var d=this,b=this.state;function _(S){d.manager.emit(S,h)}b<Gt&&_(d.options.event+Uo(b)),_(d.options.event),h.additionalEvent&&_(h.additionalEvent),b>=Gt&&_(d.options.event+Uo(b))},tryEmit:function(h){if(this.canEmit())return this.emit(h);this.state=Pt},canEmit:function(){for(var h=0;h<this.requireFail.length;){if(!(this.requireFail[h].state&(Pt|qn)))return!1;h++}return!0},recognize:function(h){var d=x({},h);if(!O(this.options.enable,[this,d])){this.reset(),this.state=Pt;return}this.state&(Bt|gn|Pt)&&(this.state=qn),this.state=this.process(d),this.state&(mt|Ve|Gt|gn)&&this.tryEmit(d)},process:function(h){},getTouchAction:function(){},reset:function(){}};function Uo(h){return h&gn?"cancel":h&Gt?"end":h&Ve?"move":h&mt?"start":""}function $o(h){return h==fn?"down":h==hn?"up":h==cn?"left":h==un?"right":""}function Kn(h,d){var b=d.manager;return b?b.get(h):h}function kt(){Wt.apply(this,arguments)}k(kt,Wt,{defaults:{pointers:1},attrTest:function(h){var d=this.options.pointers;return d===0||h.pointers.length===d},process:function(h){var d=this.state,b=h.eventType,_=d&(mt|Ve),S=this.attrTest(h);return _&&(b&at||!S)?d|gn:_||S?b&X?d|Gt:d&mt?d|Ve:mt:Pt}});function Gn(){kt.apply(this,arguments),this.pX=null,this.pY=null}k(Gn,kt,{defaults:{event:"pan",threshold:10,pointers:1,direction:Oo},getTouchAction:function(){var h=this.options.direction,d=[];return h&Ot&&d.push(pn),h&ve&&d.push(dn),d},directionTest:function(h){var d=this.options,b=!0,_=h.distance,S=h.direction,M=h.deltaX,N=h.deltaY;return S&d.direction||(d.direction&Ot?(S=M===0?Wn:M<0?cn:un,b=M!=this.pX,_=Math.abs(h.deltaX)):(S=N===0?Wn:N<0?hn:fn,b=N!=this.pY,_=Math.abs(h.deltaY))),h.direction=S,b&&_>d.threshold&&S&d.direction},attrTest:function(h){return kt.prototype.attrTest.call(this,h)&&(this.state&mt||!(this.state&mt)&&this.directionTest(h))},emit:function(h){this.pX=h.deltaX,this.pY=h.deltaY;var d=$o(h.direction);d&&(h.additionalEvent=this.options.event+d),this._super.emit.call(this,h)}});function Ki(){kt.apply(this,arguments)}k(Ki,kt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[_e]},attrTest:function(h){return this._super.attrTest.call(this,h)&&(Math.abs(h.scale-1)>this.options.threshold||this.state&mt)},emit:function(h){if(h.scale!==1){var d=h.scale<1?"in":"out";h.additionalEvent=this.options.event+d}this._super.emit.call(this,h)}});function Gi(){Wt.apply(this,arguments),this._timer=null,this._input=null}k(Gi,Wt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[jo]},process:function(h){var d=this.options,b=h.pointers.length===d.pointers,_=h.distance<d.threshold,S=h.deltaTime>d.time;if(this._input=h,!_||!b||h.eventType&(X|at)&&!S)this.reset();else if(h.eventType&st)this.reset(),this._timer=f(function(){this.state=Bt,this.tryEmit()},d.time,this);else if(h.eventType&X)return Bt;return Pt},reset:function(){clearTimeout(this._timer)},emit:function(h){this.state===Bt&&(h&&h.eventType&X?this.manager.emit(this.options.event+"up",h):(this._input.timeStamp=u(),this.manager.emit(this.options.event,this._input)))}});function Zi(){kt.apply(this,arguments)}k(Zi,kt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[_e]},attrTest:function(h){return this._super.attrTest.call(this,h)&&(Math.abs(h.rotation)>this.options.threshold||this.state&mt)}});function Qi(){kt.apply(this,arguments)}k(Qi,kt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Ot|ve,pointers:1},getTouchAction:function(){return Gn.prototype.getTouchAction.call(this)},attrTest:function(h){var d=this.options.direction,b;return d&(Ot|ve)?b=h.overallVelocity:d&Ot?b=h.overallVelocityX:d&ve&&(b=h.overallVelocityY),this._super.attrTest.call(this,h)&&d&h.offsetDirection&&h.distance>this.options.threshold&&h.maxPointers==this.options.pointers&&c(b)>this.options.velocity&&h.eventType&X},emit:function(h){var d=$o(h.offsetDirection);d&&this.manager.emit(this.options.event+d,h),this.manager.emit(this.options.event,h)}});function Zn(){Wt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}k(Zn,Wt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Xi]},process:function(h){var d=this.options,b=h.pointers.length===d.pointers,_=h.distance<d.threshold,S=h.deltaTime<d.time;if(this.reset(),h.eventType&st&&this.count===0)return this.failTimeout();if(_&&S&&b){if(h.eventType!=X)return this.failTimeout();var M=this.pTime?h.timeStamp-this.pTime<d.interval:!0,N=!this.pCenter||Un(this.pCenter,h.center)<d.posThreshold;this.pTime=h.timeStamp,this.pCenter=h.center,!N||!M?this.count=1:this.count+=1,this._input=h;var G=this.count%d.taps;if(G===0)return this.hasRequireFailures()?(this._timer=f(function(){this.state=Bt,this.tryEmit()},d.interval,this),mt):Bt}return Pt},failTimeout:function(){return this._timer=f(function(){this.state=Pt},this.options.interval,this),Pt},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Bt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Zt(h,d){return d=d||{},d.recognizers=T(d.recognizers,Zt.defaults.preset),new Ji(h,d)}Zt.VERSION="2.0.7",Zt.defaults={domEvents:!1,touchAction:Wo,enable:!0,inputTarget:null,inputClass:null,preset:[[Zi,{enable:!1}],[Ki,{enable:!1},["rotate"]],[Qi,{direction:Ot}],[Gn,{direction:Ot},["swipe"]],[Zn],[Zn,{event:"doubletap",taps:2},["tap"]],[Gi]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Xc=1,Yo=2;function Ji(h,d){this.options=x({},Zt.defaults,d||{}),this.options.inputTarget=this.options.inputTarget||h,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=h,this.input=Sc(this),this.touchAction=new qi(this,this.options.touchAction),Xo(this,!0),m(this.options.recognizers,function(b){var _=this.add(new b[0](b[1]));b[2]&&_.recognizeWith(b[2]),b[3]&&_.requireFailure(b[3])},this)}Ji.prototype={set:function(h){return x(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?Yo:Xc},recognize:function(h){var d=this.session;if(!d.stopped){this.touchAction.preventDefaults(h);var b,_=this.recognizers,S=d.curRecognizer;(!S||S&&S.state&Bt)&&(S=d.curRecognizer=null);for(var M=0;M<_.length;)b=_[M],d.stopped!==Yo&&(!S||b==S||b.canRecognizeWith(S))?b.recognize(h):b.reset(),!S&&b.state&(mt|Ve|Gt)&&(S=d.curRecognizer=b),M++}},get:function(h){if(h instanceof Wt)return h;for(var d=this.recognizers,b=0;b<d.length;b++)if(d[b].options.event==h)return d[b];return null},add:function(h){if(p(h,"add",this))return this;var d=this.get(h.options.event);return d&&this.remove(d),this.recognizers.push(h),h.manager=this,this.touchAction.update(),h},remove:function(h){if(p(h,"remove",this))return this;if(h=this.get(h),h){var d=this.recognizers,b=L(d,h);b!==-1&&(d.splice(b,1),this.touchAction.update())}return this},on:function(h,d){if(h!==s&&d!==s){var b=this.handlers;return m(z(h),function(_){b[_]=b[_]||[],b[_].push(d)}),this}},off:function(h,d){if(h!==s){var b=this.handlers;return m(z(h),function(_){d?b[_]&&b[_].splice(L(b[_],d),1):delete b[_]}),this}},emit:function(h,d){this.options.domEvents&&qc(h,d);var b=this.handlers[h]&&this.handlers[h].slice();if(!(!b||!b.length)){d.type=h,d.preventDefault=function(){d.srcEvent.preventDefault()};for(var _=0;_<b.length;)b[_](d),_++}},destroy:function(){this.element&&Xo(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Xo(h,d){var b=h.element;if(b.style){var _;m(h.options.cssProps,function(S,M){_=nt(b.style,M),d?(h.oldCssProps[_]=b.style[_],b.style[_]=S):b.style[_]=h.oldCssProps[_]||""}),d||(h.oldCssProps={})}}function qc(h,d){var b=n.createEvent("Event");b.initEvent(h,!0,!0),b.gesture=d,d.target.dispatchEvent(b)}x(Zt,{INPUT_START:st,INPUT_MOVE:ye,INPUT_END:X,INPUT_CANCEL:at,STATE_POSSIBLE:qn,STATE_BEGAN:mt,STATE_CHANGED:Ve,STATE_ENDED:Gt,STATE_RECOGNIZED:Bt,STATE_CANCELLED:gn,STATE_FAILED:Pt,DIRECTION_NONE:Wn,DIRECTION_LEFT:cn,DIRECTION_RIGHT:un,DIRECTION_UP:hn,DIRECTION_DOWN:fn,DIRECTION_HORIZONTAL:Ot,DIRECTION_VERTICAL:ve,DIRECTION_ALL:Oo,Manager:Ji,Input:gt,TouchAction:qi,TouchInput:Yn,MouseInput:$n,PointerEventInput:$i,TouchMouseInput:Yi,SingleTouchInput:Fo,Recognizer:Wt,AttrRecognizer:kt,Tap:Zn,Pan:Gn,Swipe:Qi,Pinch:Ki,Rotate:Zi,Press:Gi,on:D,off:P,each:m,merge:w,extend:v,assign:x,inherit:k,bindFn:C,prefixed:nt});var Kc=typeof t<"u"?t:typeof self<"u"?self:{};Kc.Hammer=Zt,e.exports?e.exports=Zt:t[i]=Zt})(window,document,"Hammer")})(hs)),hs.exports}var am=rm();const Dn=om(am);/*!
|
|
9084
|
+
\`;return function(){var S=new Error("get-stack-trace"),M=S&&S.stack?S.stack.replace(/^[^\\(]+?[\\n$]/gm,"").replace(/^\\s+at\\s+/gm,"").replace(/^Object.<anonymous>\\s*\\(/gm,"{anonymous}()@"):"Unknown Stack Trace",N=t.console&&(t.console.warn||t.console.log);return N&&N.call(t.console,_,M),h.apply(this,arguments)}}var x;typeof Object.assign!="function"?x=function(p){if(p===s||p===null)throw new TypeError("Cannot convert undefined or null to object");for(var b=Object(p),_=1;_<arguments.length;_++){var S=arguments[_];if(S!==s&&S!==null)for(var M in S)S.hasOwnProperty(M)&&(b[M]=S[M])}return b}:x=Object.assign;var v=y(function(p,b,_){for(var S=Object.keys(b),M=0;M<S.length;)(!_||_&&p[S[M]]===s)&&(p[S[M]]=b[S[M]]),M++;return p},"extend","Use \`assign\`."),w=y(function(p,b){return v(p,b,!0)},"merge","Use \`assign\`.");function k(h,p,b){var _=p.prototype,S;S=h.prototype=Object.create(_),S.constructor=h,S._super=_,b&&x(S,b)}function E(h,p){return function(){return h.apply(p,arguments)}}function C(h,p){return typeof h==a?h.apply(p&&p[0]||s,p):h}function T(h,p){return h===s?p:h}function D(h,p,b){m(z(p),function(_){h.addEventListener(_,b,!1)})}function P(h,p,b){m(z(p),function(_){h.removeEventListener(_,b,!1)})}function O(h,p){for(;h;){if(h==p)return!0;h=h.parentNode}return!1}function A(h,p){return h.indexOf(p)>-1}function z(h){return h.trim().split(/\\s+/g)}function L(h,p,b){if(h.indexOf&&!b)return h.indexOf(p);for(var _=0;_<h.length;){if(b&&h[_][b]==p||!b&&h[_]===p)return _;_++}return-1}function H(h){return Array.prototype.slice.call(h,0)}function Z(h,p,b){for(var _=[],S=[],M=0;M<h.length;){var N=h[M][p];L(S,N)<0&&_.push(h[M]),S[M]=N,M++}return _=_.sort(function(Q,ot){return Q[p]>ot[p]}),_}function nt(h,p){for(var b,_,S=p[0].toUpperCase()+p.slice(1),M=0;M<o.length;){if(b=o[M],_=b?b+S:p,_ in h)return _;M++}return s}var j=1;function q(){return j++}function it(h){var p=h.ownerDocument||h;return p.defaultView||p.parentWindow||t}var We=/mobile|tablet|ip(ad|hone|od)|android/i,be="ontouchstart"in t,Gt=nt(t,"PointerEvent")!==s,je=be&&We.test(navigator.userAgent),dt="touch",xe="pen",wt="mouse",ye="kinect",Vt=25,st=1,ve=2,X=4,at=8,Wn=1,ln=2,cn=4,un=8,hn=16,Et=ln|cn,_e=un|hn,Po=Et|_e,Do=["x","y"],jn=["clientX","clientY"];function pt(h,p){var b=this;this.manager=h,this.callback=p,this.element=h.element,this.target=h.options.inputTarget,this.domHandler=function(_){C(h.options.enable,[h])&&b.handler(_)},this.init()}pt.prototype={handler:function(){},init:function(){this.evEl&&D(this.element,this.evEl,this.domHandler),this.evTarget&&D(this.target,this.evTarget,this.domHandler),this.evWin&&D(it(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(it(this.element),this.evWin,this.domHandler)}};function Cc(h){var p,b=h.options.inputClass;return b?p=b:Gt?p=$i:je?p=Yn:be?p=Ui:p=Un,new p(h,Oc)}function Oc(h,p,b){var _=b.pointers.length,S=b.changedPointers.length,M=p&st&&_-S===0,N=p&(X|at)&&_-S===0;b.isFirst=!!M,b.isFinal=!!N,M&&(h.session={}),b.eventType=p,Pc(h,b),h.emit("hammer.input",b),h.recognize(b),h.session.prevInput=b}function Pc(h,p){var b=h.session,_=p.pointers,S=_.length;b.firstInput||(b.firstInput=Ao(p)),S>1&&!b.firstMultiple?b.firstMultiple=Ao(p):S===1&&(b.firstMultiple=!1);var M=b.firstInput,N=b.firstMultiple,K=N?N.center:M.center,Q=p.center=Io(_);p.timeStamp=u(),p.deltaTime=p.timeStamp-M.timeStamp,p.angle=ji(K,Q),p.distance=$n(K,Q),Dc(b,p),p.offsetDirection=Ro(p.deltaX,p.deltaY);var ot=Lo(p.deltaTime,p.deltaX,p.deltaY);p.overallVelocityX=ot.x,p.overallVelocityY=ot.y,p.overallVelocity=c(ot.x)>c(ot.y)?ot.x:ot.y,p.scale=N?Lc(N.pointers,_):1,p.rotation=N?Ic(N.pointers,_):0,p.maxPointers=b.prevInput?p.pointers.length>b.prevInput.maxPointers?p.pointers.length:b.prevInput.maxPointers:p.pointers.length,Ac(b,p);var Ot=h.element;O(p.srcEvent.target,Ot)&&(Ot=p.srcEvent.target),p.target=Ot}function Dc(h,p){var b=p.center,_=h.offsetDelta||{},S=h.prevDelta||{},M=h.prevInput||{};(p.eventType===st||M.eventType===X)&&(S=h.prevDelta={x:M.deltaX||0,y:M.deltaY||0},_=h.offsetDelta={x:b.x,y:b.y}),p.deltaX=S.x+(b.x-_.x),p.deltaY=S.y+(b.y-_.y)}function Ac(h,p){var b=h.lastInterval||p,_=p.timeStamp-b.timeStamp,S,M,N,K;if(p.eventType!=at&&(_>Vt||b.velocity===s)){var Q=p.deltaX-b.deltaX,ot=p.deltaY-b.deltaY,Ot=Lo(_,Q,ot);M=Ot.x,N=Ot.y,S=c(Ot.x)>c(Ot.y)?Ot.x:Ot.y,K=Ro(Q,ot),h.lastInterval=p}else S=b.velocity,M=b.velocityX,N=b.velocityY,K=b.direction;p.velocity=S,p.velocityX=M,p.velocityY=N,p.direction=K}function Ao(h){for(var p=[],b=0;b<h.pointers.length;)p[b]={clientX:l(h.pointers[b].clientX),clientY:l(h.pointers[b].clientY)},b++;return{timeStamp:u(),pointers:p,center:Io(p),deltaX:h.deltaX,deltaY:h.deltaY}}function Io(h){var p=h.length;if(p===1)return{x:l(h[0].clientX),y:l(h[0].clientY)};for(var b=0,_=0,S=0;S<p;)b+=h[S].clientX,_+=h[S].clientY,S++;return{x:l(b/p),y:l(_/p)}}function Lo(h,p,b){return{x:p/h||0,y:b/h||0}}function Ro(h,p){return h===p?Wn:c(h)>=c(p)?h<0?ln:cn:p<0?un:hn}function $n(h,p,b){b||(b=Do);var _=p[b[0]]-h[b[0]],S=p[b[1]]-h[b[1]];return Math.sqrt(_*_+S*S)}function ji(h,p,b){b||(b=Do);var _=p[b[0]]-h[b[0]],S=p[b[1]]-h[b[1]];return Math.atan2(S,_)*180/Math.PI}function Ic(h,p){return ji(p[1],p[0],jn)+ji(h[1],h[0],jn)}function Lc(h,p){return $n(p[0],p[1],jn)/$n(h[0],h[1],jn)}var Rc={mousedown:st,mousemove:ve,mouseup:X},Nc="mousedown",Fc="mousemove mouseup";function Un(){this.evEl=Nc,this.evWin=Fc,this.pressed=!1,pt.apply(this,arguments)}k(Un,pt,{handler:function(p){var b=Rc[p.type];b&st&&p.button===0&&(this.pressed=!0),b&ve&&p.which!==1&&(b=X),this.pressed&&(b&X&&(this.pressed=!1),this.callback(this.manager,b,{pointers:[p],changedPointers:[p],pointerType:wt,srcEvent:p}))}});var zc={pointerdown:st,pointermove:ve,pointerup:X,pointercancel:at,pointerout:at},Hc={2:dt,3:xe,4:wt,5:ye},No="pointerdown",Fo="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(No="MSPointerDown",Fo="MSPointerMove MSPointerUp MSPointerCancel");function $i(){this.evEl=No,this.evWin=Fo,pt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}k($i,pt,{handler:function(p){var b=this.store,_=!1,S=p.type.toLowerCase().replace("ms",""),M=zc[S],N=Hc[p.pointerType]||p.pointerType,K=N==dt,Q=L(b,p.pointerId,"pointerId");M&st&&(p.button===0||K)?Q<0&&(b.push(p),Q=b.length-1):M&(X|at)&&(_=!0),!(Q<0)&&(b[Q]=p,this.callback(this.manager,M,{pointers:b,changedPointers:[p],pointerType:N,srcEvent:p}),_&&b.splice(Q,1))}});var Vc={touchstart:st,touchmove:ve,touchend:X,touchcancel:at},Bc="touchstart",Wc="touchstart touchmove touchend touchcancel";function zo(){this.evTarget=Bc,this.evWin=Wc,this.started=!1,pt.apply(this,arguments)}k(zo,pt,{handler:function(p){var b=Vc[p.type];if(b===st&&(this.started=!0),!!this.started){var _=jc.call(this,p,b);b&(X|at)&&_[0].length-_[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:_[0],changedPointers:_[1],pointerType:dt,srcEvent:p})}}});function jc(h,p){var b=H(h.touches),_=H(h.changedTouches);return p&(X|at)&&(b=Z(b.concat(_),"identifier")),[b,_]}var $c={touchstart:st,touchmove:ve,touchend:X,touchcancel:at},Uc="touchstart touchmove touchend touchcancel";function Yn(){this.evTarget=Uc,this.targetIds={},pt.apply(this,arguments)}k(Yn,pt,{handler:function(p){var b=$c[p.type],_=Yc.call(this,p,b);_&&this.callback(this.manager,b,{pointers:_[0],changedPointers:_[1],pointerType:dt,srcEvent:p})}});function Yc(h,p){var b=H(h.touches),_=this.targetIds;if(p&(st|ve)&&b.length===1)return _[b[0].identifier]=!0,[b,b];var S,M,N=H(h.changedTouches),K=[],Q=this.target;if(M=b.filter(function(ot){return O(ot.target,Q)}),p===st)for(S=0;S<M.length;)_[M[S].identifier]=!0,S++;for(S=0;S<N.length;)_[N[S].identifier]&&K.push(N[S]),p&(X|at)&&delete _[N[S].identifier],S++;if(K.length)return[Z(M.concat(K),"identifier"),K]}var Xc=2500,Ho=25;function Ui(){pt.apply(this,arguments);var h=E(this.handler,this);this.touch=new Yn(this.manager,h),this.mouse=new Un(this.manager,h),this.primaryTouch=null,this.lastTouches=[]}k(Ui,pt,{handler:function(p,b,_){var S=_.pointerType==dt,M=_.pointerType==wt;if(!(M&&_.sourceCapabilities&&_.sourceCapabilities.firesTouchEvents)){if(S)qc.call(this,b,_);else if(M&&Gc.call(this,_))return;this.callback(p,b,_)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function qc(h,p){h&st?(this.primaryTouch=p.changedPointers[0].identifier,Vo.call(this,p)):h&(X|at)&&Vo.call(this,p)}function Vo(h){var p=h.changedPointers[0];if(p.identifier===this.primaryTouch){var b={x:p.clientX,y:p.clientY};this.lastTouches.push(b);var _=this.lastTouches,S=function(){var M=_.indexOf(b);M>-1&&_.splice(M,1)};setTimeout(S,Xc)}}function Gc(h){for(var p=h.srcEvent.clientX,b=h.srcEvent.clientY,_=0;_<this.lastTouches.length;_++){var S=this.lastTouches[_],M=Math.abs(p-S.x),N=Math.abs(b-S.y);if(M<=Ho&&N<=Ho)return!0}return!1}var Bo=nt(r.style,"touchAction"),Wo=Bo!==s,jo="compute",$o="auto",Yi="manipulation",we="none",fn="pan-x",dn="pan-y",Xn=Zc();function Xi(h,p){this.manager=h,this.set(p)}Xi.prototype={set:function(h){h==jo&&(h=this.compute()),Wo&&this.manager.element.style&&Xn[h]&&(this.manager.element.style[Bo]=h),this.actions=h.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var h=[];return m(this.manager.recognizers,function(p){C(p.options.enable,[p])&&(h=h.concat(p.getTouchAction()))}),Kc(h.join(" "))},preventDefaults:function(h){var p=h.srcEvent,b=h.offsetDirection;if(this.manager.session.prevented){p.preventDefault();return}var _=this.actions,S=A(_,we)&&!Xn[we],M=A(_,dn)&&!Xn[dn],N=A(_,fn)&&!Xn[fn];if(S){var K=h.pointers.length===1,Q=h.distance<2,ot=h.deltaTime<250;if(K&&Q&&ot)return}if(!(N&&M)&&(S||M&&b&Et||N&&b&_e))return this.preventSrc(p)},preventSrc:function(h){this.manager.session.prevented=!0,h.preventDefault()}};function Kc(h){if(A(h,we))return we;var p=A(h,fn),b=A(h,dn);return p&&b?we:p||b?p?fn:dn:A(h,Yi)?Yi:$o}function Zc(){if(!Wo)return!1;var h={},p=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(b){h[b]=p?t.CSS.supports("touch-action",b):!0}),h}var qn=1,gt=2,$e=4,Kt=8,Bt=Kt,pn=16,Ct=32;function Wt(h){this.options=x({},this.defaults,h||{}),this.id=q(),this.manager=null,this.options.enable=T(this.options.enable,!0),this.state=qn,this.simultaneous={},this.requireFail=[]}Wt.prototype={defaults:{},set:function(h){return x(this.options,h),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(h){if(d(h,"recognizeWith",this))return this;var p=this.simultaneous;return h=Gn(h,this),p[h.id]||(p[h.id]=h,h.recognizeWith(this)),this},dropRecognizeWith:function(h){return d(h,"dropRecognizeWith",this)?this:(h=Gn(h,this),delete this.simultaneous[h.id],this)},requireFailure:function(h){if(d(h,"requireFailure",this))return this;var p=this.requireFail;return h=Gn(h,this),L(p,h)===-1&&(p.push(h),h.requireFailure(this)),this},dropRequireFailure:function(h){if(d(h,"dropRequireFailure",this))return this;h=Gn(h,this);var p=L(this.requireFail,h);return p>-1&&this.requireFail.splice(p,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(h){return!!this.simultaneous[h.id]},emit:function(h){var p=this,b=this.state;function _(S){p.manager.emit(S,h)}b<Kt&&_(p.options.event+Uo(b)),_(p.options.event),h.additionalEvent&&_(h.additionalEvent),b>=Kt&&_(p.options.event+Uo(b))},tryEmit:function(h){if(this.canEmit())return this.emit(h);this.state=Ct},canEmit:function(){for(var h=0;h<this.requireFail.length;){if(!(this.requireFail[h].state&(Ct|qn)))return!1;h++}return!0},recognize:function(h){var p=x({},h);if(!C(this.options.enable,[this,p])){this.reset(),this.state=Ct;return}this.state&(Bt|pn|Ct)&&(this.state=qn),this.state=this.process(p),this.state&(gt|$e|Kt|pn)&&this.tryEmit(p)},process:function(h){},getTouchAction:function(){},reset:function(){}};function Uo(h){return h&pn?"cancel":h&Kt?"end":h&$e?"move":h>?"start":""}function Yo(h){return h==hn?"down":h==un?"up":h==ln?"left":h==cn?"right":""}function Gn(h,p){var b=p.manager;return b?b.get(h):h}function St(){Wt.apply(this,arguments)}k(St,Wt,{defaults:{pointers:1},attrTest:function(h){var p=this.options.pointers;return p===0||h.pointers.length===p},process:function(h){var p=this.state,b=h.eventType,_=p&(gt|$e),S=this.attrTest(h);return _&&(b&at||!S)?p|pn:_||S?b&X?p|Kt:p>?p|$e:gt:Ct}});function Kn(){St.apply(this,arguments),this.pX=null,this.pY=null}k(Kn,St,{defaults:{event:"pan",threshold:10,pointers:1,direction:Po},getTouchAction:function(){var h=this.options.direction,p=[];return h&Et&&p.push(dn),h&_e&&p.push(fn),p},directionTest:function(h){var p=this.options,b=!0,_=h.distance,S=h.direction,M=h.deltaX,N=h.deltaY;return S&p.direction||(p.direction&Et?(S=M===0?Wn:M<0?ln:cn,b=M!=this.pX,_=Math.abs(h.deltaX)):(S=N===0?Wn:N<0?un:hn,b=N!=this.pY,_=Math.abs(h.deltaY))),h.direction=S,b&&_>p.threshold&&S&p.direction},attrTest:function(h){return St.prototype.attrTest.call(this,h)&&(this.state>||!(this.state>)&&this.directionTest(h))},emit:function(h){this.pX=h.deltaX,this.pY=h.deltaY;var p=Yo(h.direction);p&&(h.additionalEvent=this.options.event+p),this._super.emit.call(this,h)}});function qi(){St.apply(this,arguments)}k(qi,St,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[we]},attrTest:function(h){return this._super.attrTest.call(this,h)&&(Math.abs(h.scale-1)>this.options.threshold||this.state>)},emit:function(h){if(h.scale!==1){var p=h.scale<1?"in":"out";h.additionalEvent=this.options.event+p}this._super.emit.call(this,h)}});function Gi(){Wt.apply(this,arguments),this._timer=null,this._input=null}k(Gi,Wt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[$o]},process:function(h){var p=this.options,b=h.pointers.length===p.pointers,_=h.distance<p.threshold,S=h.deltaTime>p.time;if(this._input=h,!_||!b||h.eventType&(X|at)&&!S)this.reset();else if(h.eventType&st)this.reset(),this._timer=f(function(){this.state=Bt,this.tryEmit()},p.time,this);else if(h.eventType&X)return Bt;return Ct},reset:function(){clearTimeout(this._timer)},emit:function(h){this.state===Bt&&(h&&h.eventType&X?this.manager.emit(this.options.event+"up",h):(this._input.timeStamp=u(),this.manager.emit(this.options.event,this._input)))}});function Ki(){St.apply(this,arguments)}k(Ki,St,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[we]},attrTest:function(h){return this._super.attrTest.call(this,h)&&(Math.abs(h.rotation)>this.options.threshold||this.state>)}});function Zi(){St.apply(this,arguments)}k(Zi,St,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Et|_e,pointers:1},getTouchAction:function(){return Kn.prototype.getTouchAction.call(this)},attrTest:function(h){var p=this.options.direction,b;return p&(Et|_e)?b=h.overallVelocity:p&Et?b=h.overallVelocityX:p&_e&&(b=h.overallVelocityY),this._super.attrTest.call(this,h)&&p&h.offsetDirection&&h.distance>this.options.threshold&&h.maxPointers==this.options.pointers&&c(b)>this.options.velocity&&h.eventType&X},emit:function(h){var p=Yo(h.offsetDirection);p&&this.manager.emit(this.options.event+p,h),this.manager.emit(this.options.event,h)}});function Zn(){Wt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}k(Zn,Wt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Yi]},process:function(h){var p=this.options,b=h.pointers.length===p.pointers,_=h.distance<p.threshold,S=h.deltaTime<p.time;if(this.reset(),h.eventType&st&&this.count===0)return this.failTimeout();if(_&&S&&b){if(h.eventType!=X)return this.failTimeout();var M=this.pTime?h.timeStamp-this.pTime<p.interval:!0,N=!this.pCenter||$n(this.pCenter,h.center)<p.posThreshold;this.pTime=h.timeStamp,this.pCenter=h.center,!N||!M?this.count=1:this.count+=1,this._input=h;var K=this.count%p.taps;if(K===0)return this.hasRequireFailures()?(this._timer=f(function(){this.state=Bt,this.tryEmit()},p.interval,this),gt):Bt}return Ct},failTimeout:function(){return this._timer=f(function(){this.state=Ct},this.options.interval,this),Ct},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Bt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Zt(h,p){return p=p||{},p.recognizers=T(p.recognizers,Zt.defaults.preset),new Qi(h,p)}Zt.VERSION="2.0.7",Zt.defaults={domEvents:!1,touchAction:jo,enable:!0,inputTarget:null,inputClass:null,preset:[[Ki,{enable:!1}],[qi,{enable:!1},["rotate"]],[Zi,{direction:Et}],[Kn,{direction:Et},["swipe"]],[Zn],[Zn,{event:"doubletap",taps:2},["tap"]],[Gi]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Qc=1,Xo=2;function Qi(h,p){this.options=x({},Zt.defaults,p||{}),this.options.inputTarget=this.options.inputTarget||h,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=h,this.input=Cc(this),this.touchAction=new Xi(this,this.options.touchAction),qo(this,!0),m(this.options.recognizers,function(b){var _=this.add(new b[0](b[1]));b[2]&&_.recognizeWith(b[2]),b[3]&&_.requireFailure(b[3])},this)}Qi.prototype={set:function(h){return x(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?Xo:Qc},recognize:function(h){var p=this.session;if(!p.stopped){this.touchAction.preventDefaults(h);var b,_=this.recognizers,S=p.curRecognizer;(!S||S&&S.state&Bt)&&(S=p.curRecognizer=null);for(var M=0;M<_.length;)b=_[M],p.stopped!==Xo&&(!S||b==S||b.canRecognizeWith(S))?b.recognize(h):b.reset(),!S&&b.state&(gt|$e|Kt)&&(S=p.curRecognizer=b),M++}},get:function(h){if(h instanceof Wt)return h;for(var p=this.recognizers,b=0;b<p.length;b++)if(p[b].options.event==h)return p[b];return null},add:function(h){if(d(h,"add",this))return this;var p=this.get(h.options.event);return p&&this.remove(p),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 p=this.recognizers,b=L(p,h);b!==-1&&(p.splice(b,1),this.touchAction.update())}return this},on:function(h,p){if(h!==s&&p!==s){var b=this.handlers;return m(z(h),function(_){b[_]=b[_]||[],b[_].push(p)}),this}},off:function(h,p){if(h!==s){var b=this.handlers;return m(z(h),function(_){p?b[_]&&b[_].splice(L(b[_],p),1):delete b[_]}),this}},emit:function(h,p){this.options.domEvents&&Jc(h,p);var b=this.handlers[h]&&this.handlers[h].slice();if(!(!b||!b.length)){p.type=h,p.preventDefault=function(){p.srcEvent.preventDefault()};for(var _=0;_<b.length;)b[_](p),_++}},destroy:function(){this.element&&qo(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function qo(h,p){var b=h.element;if(b.style){var _;m(h.options.cssProps,function(S,M){_=nt(b.style,M),p?(h.oldCssProps[_]=b.style[_],b.style[_]=S):b.style[_]=h.oldCssProps[_]||""}),p||(h.oldCssProps={})}}function Jc(h,p){var b=n.createEvent("Event");b.initEvent(h,!0,!0),b.gesture=p,p.target.dispatchEvent(b)}x(Zt,{INPUT_START:st,INPUT_MOVE:ve,INPUT_END:X,INPUT_CANCEL:at,STATE_POSSIBLE:qn,STATE_BEGAN:gt,STATE_CHANGED:$e,STATE_ENDED:Kt,STATE_RECOGNIZED:Bt,STATE_CANCELLED:pn,STATE_FAILED:Ct,DIRECTION_NONE:Wn,DIRECTION_LEFT:ln,DIRECTION_RIGHT:cn,DIRECTION_UP:un,DIRECTION_DOWN:hn,DIRECTION_HORIZONTAL:Et,DIRECTION_VERTICAL:_e,DIRECTION_ALL:Po,Manager:Qi,Input:pt,TouchAction:Xi,TouchInput:Yn,MouseInput:Un,PointerEventInput:$i,TouchMouseInput:Ui,SingleTouchInput:zo,Recognizer:Wt,AttrRecognizer:St,Tap:Zn,Pan:Kn,Swipe:Zi,Pinch:qi,Rotate:Ki,Press:Gi,on:D,off:P,each:m,merge:w,extend:v,assign:x,inherit:k,bindFn:E,prefixed:nt});var tu=typeof t<"u"?t:typeof self<"u"?self:{};tu.Hammer=Zt,e.exports?e.exports=Zt:t[i]=Zt})(window,document,"Hammer")})(us)),us.exports}var cm=lm();const Pn=am(cm);/*!
|
|
9085
9085
|
* chartjs-plugin-zoom v2.2.0
|
|
9086
9086
|
* https://www.chartjs.org/chartjs-plugin-zoom/2.2.0/
|
|
9087
9087
|
* (c) 2016-2024 chartjs-plugin-zoom Contributors
|
|
9088
9088
|
* Released under the MIT License
|
|
9089
|
-
*/const zn=e=>e&&e.enabled&&e.modifierKey,rc=(e,t)=>e&&t[e+"Key"],Eo=(e,t)=>e&&!t[e+"Key"];function he(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 fs(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 lm(e,t){let n;return function(){return clearTimeout(n),n=setTimeout(e,t),t}}function cm({x:e,y:t},n){const i=n.scales,s=Object.keys(i);for(let o=0;o<s.length;o++){const r=i[s[o]];if(t>=r.top&&t<=r.bottom&&e>=r.left&&e<=r.right)return r}return null}function ac(e,t,n){const{mode:i="xy",scaleMode:s,overScaleMode:o}=e||{},r=cm(t,n),a=fs(i,n),l=fs(s,n);if(o){const u=fs(o,n);for(const f of["x","y"])u[f]&&(l[f]=a[f],a[f]=!1)}if(r&&l[r.axis])return[r];const c=[];return F(n.scales,function(u){a[u.axis]&&c.push(u)}),c}const $s=new WeakMap;function U(e){let t=$s.get(e);return t||(t={originalScaleLimits:{},updatedScaleLimits:{},handlers:{},panDelta:{},dragging:!1,panning:!1},$s.set(e,t)),t}function um(e){$s.delete(e)}function lc(e,t,n,i){const s=Math.max(0,Math.min(1,(e-t)/n||0)),o=1-s;return{min:i*s,max:i*o}}function cc(e,t){const n=e.isHorizontal()?t.x:t.y;return e.getValueForPixel(n)}function uc(e,t,n){const i=e.max-e.min,s=i*(t-1),o=cc(e,n);return lc(o,e.min,i,s)}function hm(e,t,n){const i=cc(e,n);if(i===void 0)return{min:e.min,max:e.max};const s=Math.log10(e.min),o=Math.log10(e.max),r=Math.log10(i),a=o-s,l=a*(t-1),c=lc(r,s,a,l);return{min:Math.pow(10,s+c.min),max:Math.pow(10,o-c.max)}}function fm(e,t){return t&&(t[e.id]||t[e.axis])||{}}function xa(e,t,n,i,s){let o=n[i];if(o==="original"){const r=e.originalScaleLimits[t.id][i];o=R(r.options,r.scale)}return R(o,s)}function dm(e,t,n){const i=e.getValueForPixel(t),s=e.getValueForPixel(n);return{min:Math.min(i,s),max:Math.max(i,s)}}function pm(e,{min:t,max:n,minLimit:i,maxLimit:s},o){const r=(e-n+t)/2;t-=r,n+=r;const a=o.min.options??o.min.scale,l=o.max.options??o.max.scale,c=e/1e6;return De(t,a,c)&&(t=a),De(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 Fe(e,{min:t,max:n},i,s=!1){const o=U(e.chart),{options:r}=e,a=fm(e,i),{minRange:l=0}=a,c=xa(o,e,a,"min",-1/0),u=xa(o,e,a,"max",1/0);if(s==="pan"&&(t<c||n>u))return!0;const f=e.max-e.min,p=s?Math.max(n-t,l):f;if(s&&p===l&&f<=l)return!0;const m=pm(p,{min:t,max:n,minLimit:c,maxLimit:u},o.originalScaleLimits[e.id]);return r.min=m.min,r.max=m.max,o.updatedScaleLimits[e.id]=m,e.parse(m.min)!==e.min||e.parse(m.max)!==e.max}function gm(e,t,n,i){const s=uc(e,t,n),o={min:e.min+s.min,max:e.max-s.max};return Fe(e,o,i,!0)}function mm(e,t,n,i){const s=hm(e,t,n);return Fe(e,s,i,!0)}function bm(e,t,n,i){Fe(e,dm(e,t,n),i,!0)}const ya=e=>e===0||isNaN(e)?0:e<0?Math.min(Math.round(e),-1):Math.max(Math.round(e),1);function xm(e){const n=e.getLabels().length-1;e.min>0&&(e.min-=1),e.max<n&&(e.max+=1)}function ym(e,t,n,i){const s=uc(e,t,n);e.min===e.max&&t<1&&xm(e);const o={min:e.min+ya(s.min),max:e.max-ya(s.max)};return Fe(e,o,i,!0)}function vm(e){return e.isHorizontal()?e.width:e.height}function _m(e,t,n){const s=e.getLabels().length-1;let{min:o,max:r}=e;const a=Math.max(r-o,1),l=Math.round(vm(e)/Math.max(a,10)),c=Math.round(Math.abs(t/l));let 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),Fe(e,{min:o,max:r},n)||u}const wm={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};function hc(e,t,n,i=!1){const{min:s,max:o,options:r}=e,a=r.time&&r.time.round,l=wm[a]||0,c=e.getValueForPixel(e.getPixelForValue(s+l)-t),u=e.getValueForPixel(e.getPixelForValue(o+l)-t);return isNaN(c)||isNaN(u)?!0:Fe(e,{min:c,max:u},n,i?"pan":!1)}function va(e,t,n){return hc(e,t,n,!0)}const Ys={category:ym,default:gm,logarithmic:mm},Xs={default:bm},qs={category:_m,default:hc,logarithmic:va,timeseries:va};function Sm(e,t,n){const{id:i,options:{min:s,max:o}}=e;if(!t[i]||!n[i])return!0;const r=n[i];return r.min!==s||r.max!==o}function _a(e,t){F(e,(n,i)=>{t[i]||delete e[i]})}function ln(e,t){const{scales:n}=e,{originalScaleLimits:i,updatedScaleLimits:s}=t;return F(n,function(o){Sm(o,i,s)&&(i[o.id]={min:{scale:o.min,options:o.options.min},max:{scale:o.max,options:o.options.max}})}),_a(i,n),_a(s,n),i}function wa(e,t,n,i){const s=Ys[e.type]||Ys.default;I(s,[e,t,n,i])}function Sa(e,t,n,i){const s=Xs[e.type]||Xs.default;I(s,[e,t,n,i])}function km(e){const t=e.chartArea;return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function Co(e,t,n="none",i="api"){const{x:s=1,y:o=1,focalPoint:r=km(e)}=typeof t=="number"?{x:t,y:t}:t,a=U(e),{options:{limits:l,zoom:c}}=a;ln(e,a);const u=s!==1,f=o!==1,p=ac(c,r,e);F(p||e.scales,function(m){m.isHorizontal()&&u?wa(m,s,r,l):!m.isHorizontal()&&f&&wa(m,o,r,l)}),e.update(n),I(c.onZoom,[{chart:e,trigger:i}])}function fc(e,t,n,i="none",s="api"){const o=U(e),{options:{limits:r,zoom:a}}=o,{mode:l="xy"}=a;ln(e,o);const c=he(l,"x",e),u=he(l,"y",e);F(e.scales,function(f){f.isHorizontal()&&c?Sa(f,t.x,n.x,r):!f.isHorizontal()&&u&&Sa(f,t.y,n.y,r)}),e.update(i),I(a.onZoom,[{chart:e,trigger:s}])}function Tm(e,t,n,i="none",s="api"){const o=U(e);ln(e,o);const r=e.scales[t];Fe(r,n,void 0,!0),e.update(i),I(o.options.zoom?.onZoom,[{chart:e,trigger:s}])}function Mm(e,t="default"){const n=U(e),i=ln(e,n);F(e.scales,function(s){const 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),I(n.options.zoom.onZoomComplete,[{chart:e}])}function Em(e,t){const n=e.originalScaleLimits[t];if(!n)return;const{min:i,max:s}=n;return R(s.options,s.scale)-R(i.options,i.scale)}function Cm(e){const t=U(e);let n=1,i=1;return F(e.scales,function(s){const o=Em(t,s.id);if(o){const 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 ka(e,t,n,i){const{panDelta:s}=i,o=s[e.id]||0;ue(o)===ue(t)&&(t+=o);const r=qs[e.type]||qs.default;I(r,[e,t,n])?s[e.id]=0:s[e.id]=t}function dc(e,t,n,i="none"){const{x:s=0,y:o=0}=typeof t=="number"?{x:t,y:t}:t,r=U(e),{options:{pan:a,limits:l}}=r,{onPan:c}=a||{};ln(e,r);const u=s!==0,f=o!==0;F(n||e.scales,function(p){p.isHorizontal()&&u?ka(p,s,l,r):!p.isHorizontal()&&f&&ka(p,o,l,r)}),e.update(i),I(c,[{chart:e}])}function pc(e){const t=U(e);ln(e,t);const n={};for(const i of Object.keys(e.scales)){const{min:s,max:o}=t.originalScaleLimits[i]||{min:{},max:{}};n[i]={min:s.scale,max:o.scale}}return n}function Om(e){const t=U(e),n={};for(const i of Object.keys(e.scales))n[i]=t.updatedScaleLimits[i];return n}function Pm(e){const t=pc(e);for(const n of Object.keys(e.scales)){const{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 Ta(e){const t=U(e);return t.panning||t.dragging}const Ma=(e,t,n)=>Math.min(n,Math.max(t,e));function ct(e,t){const{handlers:n}=U(e),i=n[t];i&&i.target&&(i.target.removeEventListener(t,i),delete n[t])}function An(e,t,n,i){const{handlers:s,options:o}=U(e),r=s[n];if(r&&r.target===t)return;ct(e,n),s[n]=l=>i(e,l,o),s[n].target=t;const a=n==="wheel"?!1:void 0;t.addEventListener(n,s[n],{passive:a})}function Dm(e,t){const n=U(e);n.dragStart&&(n.dragging=!0,n.dragEnd=t,e.update("none"))}function Am(e,t){const n=U(e);!n.dragStart||t.key!=="Escape"||(ct(e,"keydown"),n.dragging=!1,n.dragStart=n.dragEnd=null,e.update("none"))}function Ks(e,t){if(e.target!==t.canvas){const n=t.canvas.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}return Rt(e,t)}function gc(e,t,n){const{onZoomStart:i,onZoomRejected:s}=n;if(i){const o=Ks(t,e);if(I(i,[{chart:e,event:t,point:o}])===!1)return I(s,[{chart:e,event:t}]),!1}}function Im(e,t){if(e.legend){const o=Rt(t,e);if(en(o,e.legend))return}const n=U(e),{pan:i,zoom:s={}}=n.options;if(t.button!==0||rc(zn(i),t)||Eo(zn(s.drag),t))return I(s.onZoomRejected,[{chart:e,event:t}]);gc(e,t,s)!==!1&&(n.dragStart=t,An(e,e.canvas.ownerDocument,"mousemove",Dm),An(e,window.document,"keydown",Am))}function Lm({begin:e,end:t},n){let i=t.x-e.x,s=t.y-e.y;const 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 Ea(e,t,n,{min:i,max:s,prop:o}){e[i]=Ma(Math.min(n.begin[o],n.end[o]),t[i],t[s]),e[s]=Ma(Math.max(n.begin[o],n.end[o]),t[i],t[s])}function Rm(e,t,n){const i={begin:Ks(t.dragStart,e),end:Ks(t.dragEnd,e)};if(n){const s=e.chartArea.width/e.chartArea.height;Lm(i,s)}return i}function mc(e,t,n,i){const s=he(t,"x",e),o=he(t,"y",e),{top:r,left:a,right:l,bottom:c,width:u,height:f}=e.chartArea,p={top:r,left:a,right:l,bottom:c},m=Rm(e,n,i&&s&&o);s&&Ea(p,e.chartArea,m,{min:"left",max:"right",prop:"x"}),o&&Ea(p,e.chartArea,m,{min:"top",max:"bottom",prop:"y"});const y=p.right-p.left,x=p.bottom-p.top;return{...p,width:y,height:x,zoomX:s&&y?1+(u-y)/u:1,zoomY:o&&x?1+(f-x)/f:1}}function Nm(e,t){const n=U(e);if(!n.dragStart)return;ct(e,"mousemove");const{mode:i,onZoomComplete:s,drag:{threshold:o=0,maintainAspectRatio:r}}=n.options.zoom,a=mc(e,i,{dragStart:n.dragStart,dragEnd:t},r),l=he(i,"x",e)?a.width:0,c=he(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}fc(e,{x:a.left,y:a.top},{x:a.right,y:a.bottom},"zoom","drag"),n.dragging=!1,n.filterNextClick=!0,I(s,[{chart:e}])}function Fm(e,t,n){if(Eo(zn(n.wheel),t)){I(n.onZoomRejected,[{chart:e,event:t}]);return}if(gc(e,t,n)!==!1&&(t.cancelable&&t.preventDefault(),t.deltaY!==void 0))return!0}function zm(e,t){const{handlers:{onZoomComplete:n},options:{zoom:i}}=U(e);if(!Fm(e,t,i))return;const 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}};Co(e,a,"zoom","wheel"),I(n,[{chart:e}])}function Hm(e,t,n,i){n&&(U(e).handlers[t]=lm(()=>I(n,[{chart:e}]),i))}function Vm(e,t){const n=e.canvas,{wheel:i,drag:s,onZoomComplete:o}=t.zoom;i.enabled?(An(e,n,"wheel",zm),Hm(e,"onZoomComplete",o,250)):ct(e,"wheel"),s.enabled?(An(e,n,"mousedown",Im),An(e,n.ownerDocument,"mouseup",Nm)):(ct(e,"mousedown"),ct(e,"mousemove"),ct(e,"mouseup"),ct(e,"keydown"))}function Bm(e){ct(e,"mousedown"),ct(e,"mousemove"),ct(e,"mouseup"),ct(e,"wheel"),ct(e,"click"),ct(e,"keydown")}function Wm(e,t){return function(n,i){const{pan:s,zoom:o={}}=t.options;if(!s||!s.enabled)return!1;const r=i&&i.srcEvent;return r&&!t.panning&&i.pointerType==="mouse"&&(Eo(zn(s),r)||rc(zn(o.drag),r))?(I(s.onPanRejected,[{chart:e,event:i}]),!1):!0}}function jm(e,t){const n=Math.abs(e.clientX-t.clientX),i=Math.abs(e.clientY-t.clientY),s=n/i;let o,r;return s>.3&&s<1.7?o=r=!0:n>i?o=!0:r=!0,{x:o,y:r}}function bc(e,t,n){if(t.scale){const{center:i,pointers:s}=n,o=1/t.scale*n.scale,r=n.target.getBoundingClientRect(),a=jm(s[0],s[1]),l=t.options.zoom.mode,c={x:a.x&&he(l,"x",e)?o:1,y:a.y&&he(l,"y",e)?o:1,focalPoint:{x:i.x-r.left,y:i.y-r.top}};Co(e,c,"zoom","pinch"),t.scale=n.scale}}function Um(e,t,n){if(t.options.zoom.pinch.enabled){const i=Rt(n,e);I(t.options.zoom.onZoomStart,[{chart:e,event:n,point:i}])===!1?(t.scale=null,I(t.options.zoom.onZoomRejected,[{chart:e,event:n}])):t.scale=1}}function $m(e,t,n){t.scale&&(bc(e,t,n),t.scale=null,I(t.options.zoom.onZoomComplete,[{chart:e}]))}function xc(e,t,n){const i=t.delta;i&&(t.panning=!0,dc(e,{x:n.deltaX-i.x,y:n.deltaY-i.y},t.panScales),t.delta={x:n.deltaX,y:n.deltaY})}function Ym(e,t,n){const{enabled:i,onPanStart:s,onPanRejected:o}=t.options.pan;if(!i)return;const r=n.target.getBoundingClientRect(),a={x:n.center.x-r.left,y:n.center.y-r.top};if(I(s,[{chart:e,event:n,point:a}])===!1)return I(o,[{chart:e,event:n}]);t.panScales=ac(t.options.pan,a,e),t.delta={x:0,y:0},xc(e,t,n)}function Xm(e,t){t.delta=null,t.panning&&(t.panning=!1,t.filterNextClick=!0,I(t.options.pan.onPanComplete,[{chart:e}]))}const Gs=new WeakMap;function Ca(e,t){const n=U(e),i=e.canvas,{pan:s,zoom:o}=t,r=new Dn.Manager(i);o&&o.pinch.enabled&&(r.add(new Dn.Pinch),r.on("pinchstart",a=>Um(e,n,a)),r.on("pinch",a=>bc(e,n,a)),r.on("pinchend",a=>$m(e,n,a))),s&&s.enabled&&(r.add(new Dn.Pan({threshold:s.threshold,enable:Wm(e,n)})),r.on("panstart",a=>Ym(e,n,a)),r.on("panmove",a=>xc(e,n,a)),r.on("panend",()=>Xm(e,n))),Gs.set(e,r)}function Oa(e){const t=Gs.get(e);t&&(t.remove("pinchstart"),t.remove("pinch"),t.remove("pinchend"),t.remove("panstart"),t.remove("pan"),t.remove("panend"),t.destroy(),Gs.delete(e))}function qm(e,t){const{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}var Km="2.2.0";function pi(e,t,n){const i=n.zoom.drag,{dragStart:s,dragEnd:o}=U(e);if(i.drawTime!==t||!o)return;const{left:r,top:a,width:l,height:c}=mc(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 Gm={id:"zoom",version:Km,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){const i=U(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)."),Dn&&Ca(e,n),e.pan=(s,o,r)=>dc(e,s,o,r),e.zoom=(s,o)=>Co(e,s,o),e.zoomRect=(s,o,r)=>fc(e,s,o,r),e.zoomScale=(s,o,r)=>Tm(e,s,o,r),e.resetZoom=s=>Mm(e,s),e.getZoomLevel=()=>Cm(e),e.getInitialScaleBounds=()=>pc(e),e.getZoomedScaleBounds=()=>Om(e),e.isZoomedOrPanned=()=>Pm(e),e.isZoomingOrPanning=()=>Ta(e)},beforeEvent(e,{event:t}){if(Ta(e))return!1;if(t.type==="click"||t.type==="mouseup"){const n=U(e);if(n.filterNextClick)return n.filterNextClick=!1,!1}},beforeUpdate:function(e,t,n){const i=U(e),s=i.options;i.options=n,qm(s,n)&&(Oa(e),Ca(e,n)),Vm(e,n)},beforeDatasetsDraw(e,t,n){pi(e,"beforeDatasetsDraw",n)},afterDatasetsDraw(e,t,n){pi(e,"afterDatasetsDraw",n)},beforeDraw(e,t,n){pi(e,"beforeDraw",n)},afterDraw(e,t,n){pi(e,"afterDraw",n)},stop:function(e){Bm(e),Dn&&Oa(e),um(e)},panFunctions:qs,zoomFunctions:Ys,zoomRectFunctions:Xs};function Zm({data:e,...t}){const n=Je(null),i=Je(null);return rt(()=>{js.register(Gm,em,pp,Qg,Lg,Ig,Vg,qg);const s=i.current,o=n.current=new js(s,{type:"line",data:e.peek(),options:{scales:{y:{min:0}},animation:!1,responsive:!0,plugins:{zoom:{pan:{enabled:!0,mode:"x"},zoom:{wheel:{enabled:!0},mode:"x"}},legend:{position:"top"},title:{display:!1}}}}),r=e.subscribe(a=>{o.data=a,o.update()});return()=>{o.destroy(),r()}},[]),g("canvas",{ref:i,...t})}function Qm(){const e=de();rt(()=>{const n=i=>{In(i)||e()};return $?.on("mount",n),$?.on("unmount",n),()=>{$?.off("mount",n),$?.off("unmount",n)}},[]);const t=$?.profilingContext;return g("div",{className:"flex flex-col gap-2"},ul(t.appStats).filter(([n])=>!In(n)).map(([n])=>g(Jm,{key:n.id,app:n})))}const Pa=100,Da=e=>Object.entries(e).map(([t,{values:n,color:i}])=>({label:t,data:n,fill:!1,borderColor:i,tension:.1}));function Jm({app:e}){const t=de(),n=Je({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"}}),i=J({labels:[(performance.now()/1e3).toFixed(2)],datasets:Da(n.current)}),s=J(!1),o=$?.profilingContext;return rt(()=>{const r=a=>{a.id===e.id&&t()};return $?.on("update",r),()=>$?.off("update",r)},[]),rt(()=>{const r=[];Object.entries(n.current).forEach(([l,{values:c}])=>{const u=p=>{p.id===e.id&&s.peek()!==!0&&c[c.length-1]++},f=l;o.addEventListener(f,u),r.push(()=>o.removeEventListener(f,u))});const a=setInterval(()=>{if(s.peek()===!0)return;const l=[...i.value.labels];Object.values(n.current).forEach(c=>{c.values.push(0),c.values.length>Pa&&c.values.shift()}),l.push((performance.now()/1e3).toFixed(2)),l.length>Pa&&l.shift(),i.value={labels:l,datasets:Da(n.current)}},100);return()=>{r.forEach(l=>l()),clearInterval(a)}},[]),g("div",{className:"flex flex-col gap-2 border border-white border-opacity-10 rounded bg-neutral-400 bg-opacity-5 text-neutral-400 p-2"},g("div",{className:"grid items-start gap-2",style:"grid-template-columns: 1fr max-content;"},g("div",{className:"flex flex-col gap-2"},g("span",null,e.name),g(Zm,{data:i,className:"w-full max-w-full min-h-20 bg-black bg-opacity-30",onmouseenter:()=>s.value=!0,onmouseleave:()=>s.value=!1})),g("div",{className:"text-xs grid grid-cols-2 gap-x-4",style:"grid-template-columns: auto auto;"},g("span",{className:"text-right"},"Mount duration:"),o.mountDuration(e).toFixed(2)," ms",g("span",{className:"text-right"},"Total updates:"),g("span",null,o.totalTicks(e).toLocaleString()),g("span",{className:"text-right"},"Avg. update duration:"),o.averageTickDuration(e).toFixed(2)," ms",g("span",{className:"text-right"},"Latest update:"),g("span",null,o.lastTickDuration(e).toFixed(2)," ms"))))}const wn=K([]),yc=K(""),tb=Vn(()=>yc.value.toLowerCase().split(" ").filter(e=>e.length>0));function eb(e){return tb.value.every(t=>e.toLowerCase().includes(t))}function nb(){const e=de();rt(()=>{const n=i=>{In(i)||e()};return $?.on("update",n),()=>$?.off("update",n)},[]);const t=$?.SWRGlobalCache??new Map;return t.size===0?g("div",{className:"flex flex-col items-center justify-center h-full text-neutral-400"},g(ao,null),g("h2",{className:"text-lg italic"},"No SWR detected")):g("div",{className:"flex flex-col gap-2 items-start"},g(uo,{value:yc,className:"sticky top-0"}),g("div",{className:"flex flex-col gap-2 w-full"},ul(t).filter(([n])=>eb(n)).map(([n,i])=>g(ib,{key:n,entry:i}))))}function ib({key:e,entry:t}){const n=wn.value.includes(e),i=de();rt(()=>{const{resource:o,isValidating:r,isMutating:a}=t,l=[o.subscribe(i),r.subscribe(i),a.subscribe(i)];return()=>l.forEach(c=>c())},[]);const s=Ue(()=>{n?wn.value=wn.value.filter(o=>o!==e):wn.value=[...wn.value,e]},[n]);return g("div",{className:"flex flex-col"},g("button",{onclick:s,className:"flex items-center gap-2 justify-between p-2 border border-white border-opacity-10 cursor-pointer"+(n?" bg-white bg-opacity-5 text-neutral-100 rounded-t":" hover:bg-white hover:bg-opacity-10 text-neutral-400 rounded")},e,g(le,{className:"transition-all"+(n?" rotate-90":"")})),n&&g("div",{className:"flex flex-col gap-2 p-2 border border-white border-opacity-10"},g(ge,{data:{resource:t.resource.peek(),isMutating:t.isMutating.peek(),isValidating:t.isValidating.peek()},mutable:!1,objectRefAcc:[],keys:[],onChange:()=>{}})))}const qt=$.fileRouterInstance?.current?.devtools,yi=K({}),ds=K(null),Aa=K({});function sb(e){const t=new Map,n=new Map,i=[];function s(a){return a.filter(l=>!(l.startsWith("(")&&l.endsWith(")")))}function o(a){return"/"+s(a).join("/")}for(const[a,l]of Object.entries(e)){const c=l.route,u=s(l.segments),f=o(u),p={routeKey:a,route:c,entry:l,children:[]};t.set(c,p),n.set(f,p)}for(const[,a]of Object.entries(e)){const l=a.route,c=a.segments,u=t.get(l),f=s(c);if(f.length>1){const p=f.slice(0,-1),m=o(p),y=n.get(m);y?y.children.push(u):i.push(u)}else i.push(u)}function r(a){return a.sort((l,c)=>l.route.localeCompare(c.route)).map(l=>({...l,children:r(l.children)}))}return r(i)}const ob=Vn(()=>sb(yi.value)),Zs=K(null),vc=K(""),Ia=Vn(()=>vc.value.toLowerCase().split(" ").filter(e=>e.length>0));function rb(e,t){if(Ia.value.length===0)return!0;const n=(e+" "+t.filePath).toLowerCase();return Ia.value.every(i=>n.includes(i))}function _c(e){return e.map(t=>{const n=_c(t.children);return rb(t.route,t.entry)||n.length>0?{...t,children:n}:null}).filter(t=>t!==null)}const ab=Vn(()=>_c(ob.value));function lb(){return rt(()=>{if(!qt){yi.value={},ds.value=null,Aa.value={};return}yi.value=qt.getPages(),console.log(yi.value);const e=qt.subscribe((t,n)=>{ds.value=t,Aa.value=n});return()=>e()},[qt]),qt?g(dt,null,g(yl,null,g("div",{className:"flex-grow sticky pr-2 top-0 flex flex-col gap-2"},g(uo,{value:vc,className:"sticky top-0"}),g("div",{className:"flex-grow flex flex-col gap-1 items-start"},g(Jo,{from:[ab,Zs,ds]},(e,t,n)=>g(wc,{nodes:e,selected:t,currentPage:n,depth:0})))),g("div",{className:"flex-grow p-2 sticky top-0"},g(Jo,{from:Zs},e=>e&&g(cb,{page:e}))))):g("div",{className:"flex flex-col items-center justify-center h-full text-neutral-400"},g(ao,null),g("h2",{className:"text-lg italic"},"No file router detected"))}function wc({nodes:e,selected:t,currentPage:n,depth:i}){return g(dt,null,e.map(s=>{const o=s.routeKey,r=s.route,a=s.entry,l=o===t,c=n?.route===r,u=s.children.length>0;let f=a.route;if(i>0){const p=a.route.split("/").filter(Boolean);p.length>0&&(f="/"+p[p.length-1])}return g("div",{key:o,className:_i("flex-grow",i>0?"ml-4":"w-full")},g("button",{onclick:()=>Zs.value=o,className:_i("flex items-center gap-2 justify-between px-2 py-1 w-full cursor-pointer rounded","border border-white border-opacity-10 group",l?" bg-white bg-opacity-5 text-neutral-100":" hover:[&:not(:group-hover)]:bg-white/10 hover:[&:not(:group-hover)]:text-neutral-100 text-neutral-400")},g("span",{className:"text-sm"},f),c?g("div",{className:"flex items-center gap-2 relative"},g("span",{className:"text-xs text-neutral-300 bg-white/15 rounded px-1 py-0.5 font-medium"},"Current"),g("button",{className:"flex items-center gap-2 text-neutral-400 hover:text-neutral-100 hover:bg-white/10 rounded p-1",onclick:p=>{p.stopPropagation(),qt.reload()}},g(hl,{className:"w-4 h-4"})),a.params.length>0&&g(La,{entry:a,route:a.route})):g("div",{className:"flex invisible items-center gap-2 relative group-hover:visible"},g(La,{entry:a,route:a.route}))),u&&g("div",{className:"mt-1 flex flex-col gap-1"},g(wc,{nodes:s.children,selected:t,currentPage:n,depth:i+1})))}))}function La({route:e,entry:t}){return g("button",{className:"flex items-center gap-2 text-neutral-400 hover:text-neutral-100 hover:bg-white/10 rounded p-1",onclick:n=>{if(n.stopPropagation(),!t.params.length)return qt.navigate(e);let i={};for(let o=0;o<t.params.length;o++){const r=t.params[o],a=prompt(\`Enter value for "\${r}"\`);if(!a){alert("Navigation cancelled");return}i[r]=a}const s=t.route.split("/").filter(o=>!o.startsWith("(")&&!o.endsWith(")")).map(o=>o.startsWith("[...")&&o.endsWith("]")?i[o.slice(4,-1)]:o.startsWith("[")&&o.endsWith("]")?i[o.slice(1,-1)]:o).filter(Boolean).join("/");qt.navigate(\`/\${s}\`)}},g(Sh,{className:"w-4 h-4"}))}function cb({page:e}){const n=qt.getPages()[e],i=hh(()=>n.load(),[e]);return g(dh,{data:i.data,fallback:g("div",null,"Loading...")},({default:s,config:o})=>g("div",null,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"},\`<\${ro({type:s})}>\`,g(Vi,{fn:s}))),o?g("div",{className:"flex items-center gap-2"},g("span",{className:"text-sm text-neutral-400"},"Config:"),g(ge,{data:o,mutable:!1,objectRefAcc:[],keys:[],onChange:()=>{}})):g("i",{className:"text-sm text-neutral-400"},"No config")))}const ub=e=>e.active?g("main",{className:"flex flex-col flex-1 max-h-[calc(100vh-1rem)] overflow-y-auto"},e.children):null,Qs={Apps:{Icon:mh,View:Kh},FileRouter:{Icon:yh,View:lb},Stores:{Icon:wh,View:Qh},SWR:{Icon:_h,View:nb},Profiling:{Icon:vh,View:Qm},Settings:{Icon:bh,View:Th}},Ri=K("Apps");let Ra=oe.peek();oe.subscribe(e=>{e!==Ra&&e!==null&&(Ri.value="Apps"),Ra=e});function hb(){return g(kh,null,g("nav",{className:"flex flex-col gap-2 justify-between p-2 bg-neutral-400 bg-opacity-5 border border-white border-opacity-10 rounded"},g("div",{className:"flex flex-col gap-2"},Object.keys(Qs).map(e=>g(fb,{key:e,title:e})))),Object.entries(Qs).map(([e,{View:t}])=>g(ub,{key:e,active:Ri.value===e},g(t,null))))}function fb({title:e}){const{Icon:t}=Qs[e];return g("button",{key:e,onclick:()=>{Ri.value=e},className:"flex items-center px-2 py-1 gap-2 rounded border text-xs border-white border-opacity-10"+(Ri.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))}oh(g(hb,null),document.getElementById("app"));tn.send({type:"ready"});setInterval(()=>{window.opener||window.close()},250);</script>
|
|
9090
|
-
<style rel="stylesheet" crossorigin>*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.invisible{visibility:hidden}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.top-0{top:0}.z-10{z-index:10}.z-\\[9999\\]{z-index:9999}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.ml-4{margin-left:1rem}.ml-6{margin-left:1.5rem}.mt-1{margin-top:.25rem}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-4{height:1rem}.h-5{height:1.25rem}.h-full{height:100%}.max-h-\\[calc\\(100vh-1rem\\)\\]{max-height:calc(100vh - 1rem)}.min-h-20{min-height:5rem}.min-h-screen{min-height:100vh}.w-4{width:1rem}.w-5{width:1.25rem}.w-8{width:2rem}.w-\\[5px\\]{width:5px}.w-full{width:100%}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-grow{flex-grow:1}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-col-resize{cursor:col-resize}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.resize{resize:both}.scroll-m-12{scroll-margin:3rem}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-4{gap:1rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded{border-radius:.25rem}.rounded-b{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-\\[\\#fff1\\]{border-color:#fff1}.border-neutral-700{--tw-border-opacity: 1;border-color:rgb(64 64 64 / var(--tw-border-opacity, 1))}.border-neutral-800{--tw-border-opacity: 1;border-color:rgb(38 38 38 / var(--tw-border-opacity, 1))}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.border-opacity-10{--tw-border-opacity: .1}.bg-\\[\\#171616\\]{--tw-bg-opacity: 1;background-color:rgb(23 22 22 / var(--tw-bg-opacity, 1))}.bg-\\[\\#1a1a1a\\]{--tw-bg-opacity: 1;background-color:rgb(26 26 26 / var(--tw-bg-opacity, 1))}.bg-\\[\\#1d1d1d\\]{--tw-bg-opacity: 1;background-color:rgb(29 29 29 / var(--tw-bg-opacity, 1))}.bg-\\[\\#212121\\]{--tw-bg-opacity: 1;background-color:rgb(33 33 33 / var(--tw-bg-opacity, 1))}.bg-\\[\\#ffffff04\\]{background-color:#ffffff04}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-neutral-400{--tw-bg-opacity: 1;background-color:rgb(163 163 163 / var(--tw-bg-opacity, 1))}.bg-neutral-800{--tw-bg-opacity: 1;background-color:rgb(38 38 38 / var(--tw-bg-opacity, 1))}.bg-neutral-900{--tw-bg-opacity: 1;background-color:rgb(23 23 23 / var(--tw-bg-opacity, 1))}.bg-primary{--tw-bg-opacity: 1;background-color:rgb(220 20 60 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\\/15{background-color:#ffffff26}.bg-opacity-30{--tw-bg-opacity: .3}.bg-opacity-5{--tw-bg-opacity: .05}.p-1{padding:.25rem}.p-2{padding:.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.pb-2{padding-bottom:.5rem}.pl-2{padding-left:.5rem}.pl-4{padding-left:1rem}.pl-6{padding-left:1.5rem}.pl-8{padding-left:2rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.text-right{text-align:right}.text-\\[10px\\]{font-size:10px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.italic{font-style:italic}.text-neutral-100{--tw-text-opacity: 1;color:rgb(245 245 245 / var(--tw-text-opacity, 1))}.text-neutral-300{--tw-text-opacity: 1;color:rgb(212 212 212 / var(--tw-text-opacity, 1))}.text-neutral-400{--tw-text-opacity: 1;color:rgb(163 163 163 / var(--tw-text-opacity, 1))}.text-primary{--tw-text-opacity: 1;color:rgb(220 20 60 / var(--tw-text-opacity, 1))}.accent-red-500{accent-color:#ef4444}.opacity-50{opacity:.5}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:root{color-scheme:dark}#app{min-width:-moz-fit-content;min-width:fit-content;background-image:linear-gradient(#171616,#0e0e0e);color:#fff;min-height:100vh;width:100%;display:flex;flex-direction:row;padding:.5rem;gap:.5rem}select{background:url("data:image/svg+xml,<svg height='10px' width='10px' viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'><path d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/></svg>") no-repeat;background-position:calc(100% - .75rem) center!important;-moz-appearance:none!important;-webkit-appearance:none!important;appearance:none!important;padding-right:2rem!important}select:not([disabled]){cursor:pointer}.last\\:border-b-0:last-child{border-bottom-width:0px}.hover\\:bg-neutral-700:hover{--tw-bg-opacity: 1;background-color:rgb(64 64 64 / var(--tw-bg-opacity, 1))}.hover\\:bg-white:hover{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.hover\\:bg-white\\/10:hover{background-color:#ffffff1a}.hover\\:bg-opacity-10:hover{--tw-bg-opacity: .1}.hover\\:text-neutral-100:hover{--tw-text-opacity: 1;color:rgb(245 245 245 / var(--tw-text-opacity, 1))}.hover\\:opacity-100:hover{opacity:1}.focus\\:outline:focus{outline-style:solid}.focus\\:outline-primary:focus{outline-color:#dc143c}.group:hover .group-hover\\:visible{visibility:visible}@media (min-width: 640px){.sm\\:inline{display:inline}}.hover\\:\\[\\&\\:not\\(\\:group-hover\\)\\]\\:bg-white\\/10:not(:group-hover):hover{background-color:#ffffff1a}.hover\\:\\[\\&\\:not\\(\\:group-hover\\)\\]\\:text-neutral-100:not(:group-hover):hover{--tw-text-opacity: 1;color:rgb(245 245 245 / var(--tw-text-opacity, 1))}</style>
|
|
9089
|
+
*/const Fn=e=>e&&e.enabled&&e.modifierKey,hc=(e,t)=>e&&t[e+"Key"],Co=(e,t)=>e&&!t[e+"Key"];function fe(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 hs(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 um(e,t){let n;return function(){return clearTimeout(n),n=setTimeout(e,t),t}}function hm({x:e,y:t},n){const i=n.scales,s=Object.keys(i);for(let o=0;o<s.length;o++){const r=i[s[o]];if(t>=r.top&&t<=r.bottom&&e>=r.left&&e<=r.right)return r}return null}function fc(e,t,n){const{mode:i="xy",scaleMode:s,overScaleMode:o}=e||{},r=hm(t,n),a=hs(i,n),l=hs(s,n);if(o){const u=hs(o,n);for(const f of["x","y"])u[f]&&(l[f]=a[f],a[f]=!1)}if(r&&l[r.axis])return[r];const c=[];return F(n.scales,function(u){a[u.axis]&&c.push(u)}),c}const Ys=new WeakMap;function $(e){let t=Ys.get(e);return t||(t={originalScaleLimits:{},updatedScaleLimits:{},handlers:{},panDelta:{},dragging:!1,panning:!1},Ys.set(e,t)),t}function fm(e){Ys.delete(e)}function dc(e,t,n,i){const s=Math.max(0,Math.min(1,(e-t)/n||0)),o=1-s;return{min:i*s,max:i*o}}function pc(e,t){const n=e.isHorizontal()?t.x:t.y;return e.getValueForPixel(n)}function gc(e,t,n){const i=e.max-e.min,s=i*(t-1),o=pc(e,n);return dc(o,e.min,i,s)}function dm(e,t,n){const i=pc(e,n);if(i===void 0)return{min:e.min,max:e.max};const s=Math.log10(e.min),o=Math.log10(e.max),r=Math.log10(i),a=o-s,l=a*(t-1),c=dc(r,s,a,l);return{min:Math.pow(10,s+c.min),max:Math.pow(10,o-c.max)}}function pm(e,t){return t&&(t[e.id]||t[e.axis])||{}}function va(e,t,n,i,s){let o=n[i];if(o==="original"){const r=e.originalScaleLimits[t.id][i];o=R(r.options,r.scale)}return R(o,s)}function gm(e,t,n){const i=e.getValueForPixel(t),s=e.getValueForPixel(n);return{min:Math.min(i,s),max:Math.max(i,s)}}function mm(e,{min:t,max:n,minLimit:i,maxLimit:s},o){const r=(e-n+t)/2;t-=r,n+=r;const a=o.min.options??o.min.scale,l=o.max.options??o.max.scale,c=e/1e6;return Ie(t,a,c)&&(t=a),Ie(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 Be(e,{min:t,max:n},i,s=!1){const o=$(e.chart),{options:r}=e,a=pm(e,i),{minRange:l=0}=a,c=va(o,e,a,"min",-1/0),u=va(o,e,a,"max",1/0);if(s==="pan"&&(t<c||n>u))return!0;const f=e.max-e.min,d=s?Math.max(n-t,l):f;if(s&&d===l&&f<=l)return!0;const m=mm(d,{min:t,max:n,minLimit:c,maxLimit:u},o.originalScaleLimits[e.id]);return r.min=m.min,r.max=m.max,o.updatedScaleLimits[e.id]=m,e.parse(m.min)!==e.min||e.parse(m.max)!==e.max}function bm(e,t,n,i){const s=gc(e,t,n),o={min:e.min+s.min,max:e.max-s.max};return Be(e,o,i,!0)}function xm(e,t,n,i){const s=dm(e,t,n);return Be(e,s,i,!0)}function ym(e,t,n,i){Be(e,gm(e,t,n),i,!0)}const _a=e=>e===0||isNaN(e)?0:e<0?Math.min(Math.round(e),-1):Math.max(Math.round(e),1);function vm(e){const n=e.getLabels().length-1;e.min>0&&(e.min-=1),e.max<n&&(e.max+=1)}function _m(e,t,n,i){const s=gc(e,t,n);e.min===e.max&&t<1&&vm(e);const o={min:e.min+_a(s.min),max:e.max-_a(s.max)};return Be(e,o,i,!0)}function wm(e){return e.isHorizontal()?e.width:e.height}function Sm(e,t,n){const s=e.getLabels().length-1;let{min:o,max:r}=e;const a=Math.max(r-o,1),l=Math.round(wm(e)/Math.max(a,10)),c=Math.round(Math.abs(t/l));let 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),Be(e,{min:o,max:r},n)||u}const km={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};function mc(e,t,n,i=!1){const{min:s,max:o,options:r}=e,a=r.time&&r.time.round,l=km[a]||0,c=e.getValueForPixel(e.getPixelForValue(s+l)-t),u=e.getValueForPixel(e.getPixelForValue(o+l)-t);return isNaN(c)||isNaN(u)?!0:Be(e,{min:c,max:u},n,i?"pan":!1)}function wa(e,t,n){return mc(e,t,n,!0)}const Xs={category:_m,default:bm,logarithmic:xm},qs={default:ym},Gs={category:Sm,default:mc,logarithmic:wa,timeseries:wa};function Tm(e,t,n){const{id:i,options:{min:s,max:o}}=e;if(!t[i]||!n[i])return!0;const r=n[i];return r.min!==s||r.max!==o}function Sa(e,t){F(e,(n,i)=>{t[i]||delete e[i]})}function an(e,t){const{scales:n}=e,{originalScaleLimits:i,updatedScaleLimits:s}=t;return F(n,function(o){Tm(o,i,s)&&(i[o.id]={min:{scale:o.min,options:o.options.min},max:{scale:o.max,options:o.options.max}})}),Sa(i,n),Sa(s,n),i}function ka(e,t,n,i){const s=Xs[e.type]||Xs.default;I(s,[e,t,n,i])}function Ta(e,t,n,i){const s=qs[e.type]||qs.default;I(s,[e,t,n,i])}function Mm(e){const t=e.chartArea;return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function Oo(e,t,n="none",i="api"){const{x:s=1,y:o=1,focalPoint:r=Mm(e)}=typeof t=="number"?{x:t,y:t}:t,a=$(e),{options:{limits:l,zoom:c}}=a;an(e,a);const u=s!==1,f=o!==1,d=fc(c,r,e);F(d||e.scales,function(m){m.isHorizontal()&&u?ka(m,s,r,l):!m.isHorizontal()&&f&&ka(m,o,r,l)}),e.update(n),I(c.onZoom,[{chart:e,trigger:i}])}function bc(e,t,n,i="none",s="api"){const o=$(e),{options:{limits:r,zoom:a}}=o,{mode:l="xy"}=a;an(e,o);const c=fe(l,"x",e),u=fe(l,"y",e);F(e.scales,function(f){f.isHorizontal()&&c?Ta(f,t.x,n.x,r):!f.isHorizontal()&&u&&Ta(f,t.y,n.y,r)}),e.update(i),I(a.onZoom,[{chart:e,trigger:s}])}function Em(e,t,n,i="none",s="api"){const o=$(e);an(e,o);const r=e.scales[t];Be(r,n,void 0,!0),e.update(i),I(o.options.zoom?.onZoom,[{chart:e,trigger:s}])}function Cm(e,t="default"){const n=$(e),i=an(e,n);F(e.scales,function(s){const 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),I(n.options.zoom.onZoomComplete,[{chart:e}])}function Om(e,t){const n=e.originalScaleLimits[t];if(!n)return;const{min:i,max:s}=n;return R(s.options,s.scale)-R(i.options,i.scale)}function Pm(e){const t=$(e);let n=1,i=1;return F(e.scales,function(s){const o=Om(t,s.id);if(o){const 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 Ma(e,t,n,i){const{panDelta:s}=i,o=s[e.id]||0;he(o)===he(t)&&(t+=o);const r=Gs[e.type]||Gs.default;I(r,[e,t,n])?s[e.id]=0:s[e.id]=t}function xc(e,t,n,i="none"){const{x:s=0,y:o=0}=typeof t=="number"?{x:t,y:t}:t,r=$(e),{options:{pan:a,limits:l}}=r,{onPan:c}=a||{};an(e,r);const u=s!==0,f=o!==0;F(n||e.scales,function(d){d.isHorizontal()&&u?Ma(d,s,l,r):!d.isHorizontal()&&f&&Ma(d,o,l,r)}),e.update(i),I(c,[{chart:e}])}function yc(e){const t=$(e);an(e,t);const n={};for(const i of Object.keys(e.scales)){const{min:s,max:o}=t.originalScaleLimits[i]||{min:{},max:{}};n[i]={min:s.scale,max:o.scale}}return n}function Dm(e){const t=$(e),n={};for(const i of Object.keys(e.scales))n[i]=t.updatedScaleLimits[i];return n}function Am(e){const t=yc(e);for(const n of Object.keys(e.scales)){const{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 Ea(e){const t=$(e);return t.panning||t.dragging}const Ca=(e,t,n)=>Math.min(n,Math.max(t,e));function ct(e,t){const{handlers:n}=$(e),i=n[t];i&&i.target&&(i.target.removeEventListener(t,i),delete n[t])}function Dn(e,t,n,i){const{handlers:s,options:o}=$(e),r=s[n];if(r&&r.target===t)return;ct(e,n),s[n]=l=>i(e,l,o),s[n].target=t;const a=n==="wheel"?!1:void 0;t.addEventListener(n,s[n],{passive:a})}function Im(e,t){const n=$(e);n.dragStart&&(n.dragging=!0,n.dragEnd=t,e.update("none"))}function Lm(e,t){const n=$(e);!n.dragStart||t.key!=="Escape"||(ct(e,"keydown"),n.dragging=!1,n.dragStart=n.dragEnd=null,e.update("none"))}function Ks(e,t){if(e.target!==t.canvas){const n=t.canvas.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}return It(e,t)}function vc(e,t,n){const{onZoomStart:i,onZoomRejected:s}=n;if(i){const o=Ks(t,e);if(I(i,[{chart:e,event:t,point:o}])===!1)return I(s,[{chart:e,event:t}]),!1}}function Rm(e,t){if(e.legend){const o=It(t,e);if(en(o,e.legend))return}const n=$(e),{pan:i,zoom:s={}}=n.options;if(t.button!==0||hc(Fn(i),t)||Co(Fn(s.drag),t))return I(s.onZoomRejected,[{chart:e,event:t}]);vc(e,t,s)!==!1&&(n.dragStart=t,Dn(e,e.canvas.ownerDocument,"mousemove",Im),Dn(e,window.document,"keydown",Lm))}function Nm({begin:e,end:t},n){let i=t.x-e.x,s=t.y-e.y;const 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 Oa(e,t,n,{min:i,max:s,prop:o}){e[i]=Ca(Math.min(n.begin[o],n.end[o]),t[i],t[s]),e[s]=Ca(Math.max(n.begin[o],n.end[o]),t[i],t[s])}function Fm(e,t,n){const i={begin:Ks(t.dragStart,e),end:Ks(t.dragEnd,e)};if(n){const s=e.chartArea.width/e.chartArea.height;Nm(i,s)}return i}function _c(e,t,n,i){const s=fe(t,"x",e),o=fe(t,"y",e),{top:r,left:a,right:l,bottom:c,width:u,height:f}=e.chartArea,d={top:r,left:a,right:l,bottom:c},m=Fm(e,n,i&&s&&o);s&&Oa(d,e.chartArea,m,{min:"left",max:"right",prop:"x"}),o&&Oa(d,e.chartArea,m,{min:"top",max:"bottom",prop:"y"});const y=d.right-d.left,x=d.bottom-d.top;return{...d,width:y,height:x,zoomX:s&&y?1+(u-y)/u:1,zoomY:o&&x?1+(f-x)/f:1}}function zm(e,t){const n=$(e);if(!n.dragStart)return;ct(e,"mousemove");const{mode:i,onZoomComplete:s,drag:{threshold:o=0,maintainAspectRatio:r}}=n.options.zoom,a=_c(e,i,{dragStart:n.dragStart,dragEnd:t},r),l=fe(i,"x",e)?a.width:0,c=fe(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}bc(e,{x:a.left,y:a.top},{x:a.right,y:a.bottom},"zoom","drag"),n.dragging=!1,n.filterNextClick=!0,I(s,[{chart:e}])}function Hm(e,t,n){if(Co(Fn(n.wheel),t)){I(n.onZoomRejected,[{chart:e,event:t}]);return}if(vc(e,t,n)!==!1&&(t.cancelable&&t.preventDefault(),t.deltaY!==void 0))return!0}function Vm(e,t){const{handlers:{onZoomComplete:n},options:{zoom:i}}=$(e);if(!Hm(e,t,i))return;const 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}};Oo(e,a,"zoom","wheel"),I(n,[{chart:e}])}function Bm(e,t,n,i){n&&($(e).handlers[t]=um(()=>I(n,[{chart:e}]),i))}function Wm(e,t){const n=e.canvas,{wheel:i,drag:s,onZoomComplete:o}=t.zoom;i.enabled?(Dn(e,n,"wheel",Vm),Bm(e,"onZoomComplete",o,250)):ct(e,"wheel"),s.enabled?(Dn(e,n,"mousedown",Rm),Dn(e,n.ownerDocument,"mouseup",zm)):(ct(e,"mousedown"),ct(e,"mousemove"),ct(e,"mouseup"),ct(e,"keydown"))}function jm(e){ct(e,"mousedown"),ct(e,"mousemove"),ct(e,"mouseup"),ct(e,"wheel"),ct(e,"click"),ct(e,"keydown")}function $m(e,t){return function(n,i){const{pan:s,zoom:o={}}=t.options;if(!s||!s.enabled)return!1;const r=i&&i.srcEvent;return r&&!t.panning&&i.pointerType==="mouse"&&(Co(Fn(s),r)||hc(Fn(o.drag),r))?(I(s.onPanRejected,[{chart:e,event:i}]),!1):!0}}function Um(e,t){const n=Math.abs(e.clientX-t.clientX),i=Math.abs(e.clientY-t.clientY),s=n/i;let o,r;return s>.3&&s<1.7?o=r=!0:n>i?o=!0:r=!0,{x:o,y:r}}function wc(e,t,n){if(t.scale){const{center:i,pointers:s}=n,o=1/t.scale*n.scale,r=n.target.getBoundingClientRect(),a=Um(s[0],s[1]),l=t.options.zoom.mode,c={x:a.x&&fe(l,"x",e)?o:1,y:a.y&&fe(l,"y",e)?o:1,focalPoint:{x:i.x-r.left,y:i.y-r.top}};Oo(e,c,"zoom","pinch"),t.scale=n.scale}}function Ym(e,t,n){if(t.options.zoom.pinch.enabled){const i=It(n,e);I(t.options.zoom.onZoomStart,[{chart:e,event:n,point:i}])===!1?(t.scale=null,I(t.options.zoom.onZoomRejected,[{chart:e,event:n}])):t.scale=1}}function Xm(e,t,n){t.scale&&(wc(e,t,n),t.scale=null,I(t.options.zoom.onZoomComplete,[{chart:e}]))}function Sc(e,t,n){const i=t.delta;i&&(t.panning=!0,xc(e,{x:n.deltaX-i.x,y:n.deltaY-i.y},t.panScales),t.delta={x:n.deltaX,y:n.deltaY})}function qm(e,t,n){const{enabled:i,onPanStart:s,onPanRejected:o}=t.options.pan;if(!i)return;const r=n.target.getBoundingClientRect(),a={x:n.center.x-r.left,y:n.center.y-r.top};if(I(s,[{chart:e,event:n,point:a}])===!1)return I(o,[{chart:e,event:n}]);t.panScales=fc(t.options.pan,a,e),t.delta={x:0,y:0},Sc(e,t,n)}function Gm(e,t){t.delta=null,t.panning&&(t.panning=!1,t.filterNextClick=!0,I(t.options.pan.onPanComplete,[{chart:e}]))}const Zs=new WeakMap;function Pa(e,t){const n=$(e),i=e.canvas,{pan:s,zoom:o}=t,r=new Pn.Manager(i);o&&o.pinch.enabled&&(r.add(new Pn.Pinch),r.on("pinchstart",a=>Ym(e,n,a)),r.on("pinch",a=>wc(e,n,a)),r.on("pinchend",a=>Xm(e,n,a))),s&&s.enabled&&(r.add(new Pn.Pan({threshold:s.threshold,enable:$m(e,n)})),r.on("panstart",a=>qm(e,n,a)),r.on("panmove",a=>Sc(e,n,a)),r.on("panend",()=>Gm(e,n))),Zs.set(e,r)}function Da(e){const t=Zs.get(e);t&&(t.remove("pinchstart"),t.remove("pinch"),t.remove("pinchend"),t.remove("panstart"),t.remove("pan"),t.remove("panend"),t.destroy(),Zs.delete(e))}function Km(e,t){const{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}var Zm="2.2.0";function pi(e,t,n){const i=n.zoom.drag,{dragStart:s,dragEnd:o}=$(e);if(i.drawTime!==t||!o)return;const{left:r,top:a,width:l,height:c}=_c(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 Qm={id:"zoom",version:Zm,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){const i=$(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)."),Pn&&Pa(e,n),e.pan=(s,o,r)=>xc(e,s,o,r),e.zoom=(s,o)=>Oo(e,s,o),e.zoomRect=(s,o,r)=>bc(e,s,o,r),e.zoomScale=(s,o,r)=>Em(e,s,o,r),e.resetZoom=s=>Cm(e,s),e.getZoomLevel=()=>Pm(e),e.getInitialScaleBounds=()=>yc(e),e.getZoomedScaleBounds=()=>Dm(e),e.isZoomedOrPanned=()=>Am(e),e.isZoomingOrPanning=()=>Ea(e)},beforeEvent(e,{event:t}){if(Ea(e))return!1;if(t.type==="click"||t.type==="mouseup"){const n=$(e);if(n.filterNextClick)return n.filterNextClick=!1,!1}},beforeUpdate:function(e,t,n){const i=$(e),s=i.options;i.options=n,Km(s,n)&&(Da(e),Pa(e,n)),Wm(e,n)},beforeDatasetsDraw(e,t,n){pi(e,"beforeDatasetsDraw",n)},afterDatasetsDraw(e,t,n){pi(e,"afterDatasetsDraw",n)},beforeDraw(e,t,n){pi(e,"beforeDraw",n)},afterDraw(e,t,n){pi(e,"afterDraw",n)},stop:function(e){jm(e),Pn&&Da(e),fm(e)},panFunctions:Gs,zoomFunctions:Xs,zoomRectFunctions:qs};function Jm({data:e,...t}){const n=Ne(null),i=Ne(null);return rt(()=>{$s.register(Qm,im,mp,tm,Ng,Rg,Wg,Kg);const s=i.current,o=n.current=new $s(s,{type:"line",data:e.peek(),options:{scales:{y:{min:0}},animation:!1,responsive:!0,plugins:{zoom:{pan:{enabled:!0,mode:"x"},zoom:{wheel:{enabled:!0},mode:"x"}},legend:{position:"top"},title:{display:!1}}}}),r=e.subscribe(a=>{o.data=a,o.update()});return()=>{o.destroy(),r()}},[]),g("canvas",{ref:i,...t})}function tb(){const e=pe();rt(()=>{const n=i=>{An(i)||e()};return U?.on("mount",n),U?.on("unmount",n),()=>{U?.off("mount",n),U?.off("unmount",n)}},[]);const t=U?.profilingContext;return g("div",{className:"flex flex-col gap-2"},gl(t.appStats).filter(([n])=>!An(n)).map(([n])=>g(eb,{key:n.id,app:n})))}const Aa=100,Ia=e=>Object.entries(e).map(([t,{values:n,color:i}])=>({label:t,data:n,fill:!1,borderColor:i,tension:.1}));function eb({app:e}){const t=pe(),n=Ne({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"}}),i=J({labels:[(performance.now()/1e3).toFixed(2)],datasets:Ia(n.current)}),s=J(!1),o=U?.profilingContext;return rt(()=>{const r=a=>{a.id===e.id&&t()};return U?.on("update",r),()=>U?.off("update",r)},[]),rt(()=>{const r=[];Object.entries(n.current).forEach(([l,{values:c}])=>{const u=d=>{d.id===e.id&&s.peek()!==!0&&c[c.length-1]++},f=l;o.addEventListener(f,u),r.push(()=>o.removeEventListener(f,u))});const a=setInterval(()=>{if(s.peek()===!0)return;const l=[...i.value.labels];Object.values(n.current).forEach(c=>{c.values.push(0),c.values.length>Aa&&c.values.shift()}),l.push((performance.now()/1e3).toFixed(2)),l.length>Aa&&l.shift(),i.value={labels:l,datasets:Ia(n.current)}},100);return()=>{r.forEach(l=>l()),clearInterval(a)}},[]),g("div",{className:"flex flex-col gap-2 border border-white border-opacity-10 rounded bg-neutral-400 bg-opacity-5 text-neutral-400 p-2"},g("div",{className:"grid items-start gap-2",style:"grid-template-columns: 1fr max-content;"},g("div",{className:"flex flex-col gap-2"},g("span",null,e.name),g(Jm,{data:i,className:"w-full max-w-full min-h-20 bg-black bg-opacity-30",onmouseenter:()=>s.value=!0,onmouseleave:()=>s.value=!1})),g("div",{className:"text-xs grid grid-cols-2 gap-x-4",style:"grid-template-columns: auto auto;"},g("span",{className:"text-right"},"Mount duration:"),o.mountDuration(e).toFixed(2)," ms",g("span",{className:"text-right"},"Total updates:"),g("span",null,o.totalTicks(e).toLocaleString()),g("span",{className:"text-right"},"Avg. update duration:"),o.averageTickDuration(e).toFixed(2)," ms",g("span",{className:"text-right"},"Latest update:"),g("span",null,o.lastTickDuration(e).toFixed(2)," ms"))))}const _n=G([]),kc=G(""),nb=Vn(()=>kc.value.toLowerCase().split(" ").filter(e=>e.length>0));function ib(e){return nb.value.every(t=>e.toLowerCase().includes(t))}function sb(){const e=pe();rt(()=>{const n=i=>{An(i)||e()};return U?.on("update",n),()=>U?.off("update",n)},[]);const t=U?.SWRGlobalCache??new Map;return t.size===0?g("div",{className:"flex flex-col items-center justify-center h-full text-neutral-400"},g(lo,null),g("h2",{className:"text-lg italic"},"No SWR detected")):g("div",{className:"flex flex-col gap-2 items-start"},g(ho,{value:kc,className:"sticky top-0"}),g("div",{className:"flex flex-col gap-2 w-full"},gl(t).filter(([n])=>ib(n)).map(([n,i])=>g(ob,{key:n,entry:i}))))}function ob({key:e,entry:t}){const n=_n.value.includes(e),i=pe();rt(()=>{const{resource:o,isValidating:r,isMutating:a}=t,l=[o.subscribe(i),r.subscribe(i),a.subscribe(i)];return()=>l.forEach(c=>c())},[]);const s=Xe(()=>{n?_n.value=_n.value.filter(o=>o!==e):_n.value=[..._n.value,e]},[n]);return g("div",{className:"flex flex-col"},g("button",{onclick:s,className:"flex items-center gap-2 justify-between p-2 border border-white border-opacity-10 cursor-pointer"+(n?" bg-white bg-opacity-5 text-neutral-100 rounded-t":" hover:bg-white hover:bg-opacity-10 text-neutral-400 rounded")},e,g(ce,{className:"transition-all"+(n?" rotate-90":"")})),n&&g("div",{className:"flex flex-col gap-2 p-2 border border-white border-opacity-10"},g(me,{data:{resource:t.resource.peek(),isMutating:t.isMutating.peek(),isValidating:t.isValidating.peek()},mutable:!1,objectRefAcc:[],keys:[],onChange:()=>{}})))}const qt=U.fileRouterInstance?.current?.devtools,yi=G({}),fs=G(null),La=G({});function rb(e){const t=new Map,n=new Map,i=[];function s(a){return a.filter(l=>!(l.startsWith("(")&&l.endsWith(")")))}function o(a){return"/"+s(a).join("/")}for(const[a,l]of Object.entries(e)){const c=l.route,u=s(l.segments),f=o(u),d={routeKey:a,route:c,entry:l,children:[]};t.set(c,d),n.set(f,d)}for(const[,a]of Object.entries(e)){const l=a.route,c=a.segments,u=t.get(l),f=s(c);if(f.length>1){const d=f.slice(0,-1),m=o(d),y=n.get(m);y?y.children.push(u):i.push(u)}else i.push(u)}function r(a){return a.sort((l,c)=>l.route.localeCompare(c.route)).map(l=>({...l,children:r(l.children)}))}return r(i)}const ab=Vn(()=>rb(yi.value)),Qs=G(null),Tc=G(""),Ra=Vn(()=>Tc.value.toLowerCase().split(" ").filter(e=>e.length>0));function lb(e,t){if(Ra.value.length===0)return!0;const n=(e+" "+t.filePath).toLowerCase();return Ra.value.every(i=>n.includes(i))}function Mc(e){return e.map(t=>{const n=Mc(t.children);return lb(t.route,t.entry)||n.length>0?{...t,children:n}:null}).filter(t=>t!==null)}const cb=Vn(()=>Mc(ab.value));function ub(){return rt(()=>{if(!qt){yi.value={},fs.value=null,La.value={};return}yi.value=qt.getPages(),console.log(yi.value);const e=qt.subscribe((t,n)=>{fs.value=t,La.value=n});return()=>e()},[qt]),qt?g(Tt,null,g(kl,null,g("div",{className:"flex-grow sticky pr-2 top-0 flex flex-col gap-2"},g(ho,{value:Tc,className:"sticky top-0"}),g("div",{className:"flex-grow flex flex-col gap-1 items-start"},g(Ps,{from:{filteredRouteTree:cb,selectedRoute:Qs,currentPage:fs}},({filteredRouteTree:e,selectedRoute:t,currentPage:n})=>g(Ec,{nodes:e,selected:t,currentPage:n,depth:0})))),g("div",{className:"flex-grow p-2 sticky top-0"},g(Ps,{from:Qs},e=>e&&g(hb,{page:e}))))):g("div",{className:"flex flex-col items-center justify-center h-full text-neutral-400"},g(lo,null),g("h2",{className:"text-lg italic"},"No file router detected"))}function Ec({nodes:e,selected:t,currentPage:n,depth:i}){return g(Tt,null,e.map(s=>{const o=s.routeKey,r=s.route,a=s.entry,l=o===t,c=n?.route===r,u=s.children.length>0;let f=a.route;if(i>0){const d=a.route.split("/").filter(Boolean);d.length>0&&(f="/"+d[d.length-1])}return g("div",{key:o,className:_i("flex-grow",i>0?"ml-4":"w-full")},g("button",{onclick:()=>Qs.value=o,className:_i("flex items-center gap-2 justify-between px-2 py-1 w-full cursor-pointer rounded","border border-white border-opacity-10 group",l?" bg-white bg-opacity-5 text-neutral-100":" hover:[&:not(:group-hover)]:bg-white/10 hover:[&:not(:group-hover)]:text-neutral-100 text-neutral-400")},g("span",{className:"text-sm"},f),c?g("div",{className:"flex items-center gap-2 relative"},g("span",{className:"text-xs text-neutral-300 bg-white/15 rounded px-1 py-0.5 font-medium"},"Current"),g("button",{className:"flex items-center gap-2 text-neutral-400 hover:text-neutral-100 hover:bg-white/10 rounded p-1",onclick:d=>{d.stopPropagation(),qt.reload()}},g(ml,{className:"w-4 h-4"})),a.params.length>0&&g(Na,{entry:a,route:a.route})):g("div",{className:"flex invisible items-center gap-2 relative group-hover:visible"},g(Na,{entry:a,route:a.route}))),u&&g("div",{className:"mt-1 flex flex-col gap-1"},g(Ec,{nodes:s.children,selected:t,currentPage:n,depth:i+1})))}))}function Na({route:e,entry:t}){return g("button",{className:"flex items-center gap-2 text-neutral-400 hover:text-neutral-100 hover:bg-white/10 rounded p-1",onclick:n=>{if(n.stopPropagation(),!t.params.length)return qt.navigate(e);let i={};for(let o=0;o<t.params.length;o++){const r=t.params[o],a=prompt(\`Enter value for "\${r}"\`);if(!a){alert("Navigation cancelled");return}i[r]=a}const s=t.route.split("/").filter(o=>!o.startsWith("(")&&!o.endsWith(")")).map(o=>o.startsWith("[...")&&o.endsWith("]")?i[o.slice(4,-1)]:o.startsWith("[")&&o.endsWith("]")?i[o.slice(1,-1)]:o).filter(Boolean).join("/");qt.navigate(\`/\${s}\`)}},g(Th,{className:"w-4 h-4"}))}function hb({page:e}){const n=qt.getPages()[e],i=dh(async()=>(await new Promise(s=>setTimeout(s,150)),await n.load()),[e]);return g(Ps,{from:i,fallback:g("div",null,"Loading...")},(s,o)=>{const{default:r,config:a}=s;return g("div",{className:\`transition-opacity \${o?"opacity-75":""}\`},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"},\`<\${ao({type:r})}>\`,g(Hi,{fn:r}))),a?g("div",{className:"flex items-center gap-2"},g("span",{className:"text-sm text-neutral-400"},"Config:"),g(me,{data:a,mutable:!1,objectRefAcc:[],keys:[],onChange:()=>{}})):g("i",{className:"text-sm text-neutral-400"},"No config"))})}const fb=e=>e.active?g("main",{className:"flex flex-col flex-1 max-h-[calc(100vh-1rem)] overflow-y-auto"},e.children):null,Js={Apps:{Icon:xh,View:Zh},FileRouter:{Icon:_h,View:ub},Stores:{Icon:kh,View:tf},SWR:{Icon:Sh,View:sb},Profiling:{Icon:wh,View:tb},Settings:{Icon:yh,View:Eh}},Li=G("Apps");let Fa=oe.peek();oe.subscribe(e=>{e!==Fa&&e!==null&&(Li.value="Apps"),Fa=e});function db(){return g(Mh,null,g("nav",{className:"flex flex-col gap-2 justify-between p-2 bg-neutral-400 bg-opacity-5 border border-white border-opacity-10 rounded"},g("div",{className:"flex flex-col gap-2"},Object.keys(Js).map(e=>g(pb,{key:e,title:e})))),Object.entries(Js).map(([e,{View:t}])=>g(fb,{key:e,active:Li.value===e},g(t,null))))}function pb({title:e}){const{Icon:t}=Js[e];return g("button",{key:e,onclick:()=>{Li.value=e},className:"flex items-center px-2 py-1 gap-2 rounded border text-xs border-white border-opacity-10"+(Li.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))}rh(g(db,null),document.getElementById("app"));Fe.send({type:"ready"});setInterval(()=>{window.opener||window.close()},250);</script>
|
|
9090
|
+
<style rel="stylesheet" crossorigin>*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.invisible{visibility:hidden}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.top-0{top:0}.z-10{z-index:10}.z-\\[9999\\]{z-index:9999}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.ml-4{margin-left:1rem}.ml-6{margin-left:1.5rem}.mt-1{margin-top:.25rem}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-4{height:1rem}.h-5{height:1.25rem}.h-full{height:100%}.max-h-\\[calc\\(100vh-1rem\\)\\]{max-height:calc(100vh - 1rem)}.min-h-20{min-height:5rem}.min-h-screen{min-height:100vh}.w-4{width:1rem}.w-5{width:1.25rem}.w-8{width:2rem}.w-\\[5px\\]{width:5px}.w-full{width:100%}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-grow{flex-grow:1}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-col-resize{cursor:col-resize}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.resize{resize:both}.scroll-m-12{scroll-margin:3rem}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-4{gap:1rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded{border-radius:.25rem}.rounded-b{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-\\[\\#fff1\\]{border-color:#fff1}.border-neutral-700{--tw-border-opacity: 1;border-color:rgb(64 64 64 / var(--tw-border-opacity, 1))}.border-neutral-800{--tw-border-opacity: 1;border-color:rgb(38 38 38 / var(--tw-border-opacity, 1))}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.border-opacity-10{--tw-border-opacity: .1}.bg-\\[\\#171616\\]{--tw-bg-opacity: 1;background-color:rgb(23 22 22 / var(--tw-bg-opacity, 1))}.bg-\\[\\#1a1a1a\\]{--tw-bg-opacity: 1;background-color:rgb(26 26 26 / var(--tw-bg-opacity, 1))}.bg-\\[\\#1d1d1d\\]{--tw-bg-opacity: 1;background-color:rgb(29 29 29 / var(--tw-bg-opacity, 1))}.bg-\\[\\#212121\\]{--tw-bg-opacity: 1;background-color:rgb(33 33 33 / var(--tw-bg-opacity, 1))}.bg-\\[\\#ffffff04\\]{background-color:#ffffff04}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-neutral-400{--tw-bg-opacity: 1;background-color:rgb(163 163 163 / var(--tw-bg-opacity, 1))}.bg-neutral-800{--tw-bg-opacity: 1;background-color:rgb(38 38 38 / var(--tw-bg-opacity, 1))}.bg-neutral-900{--tw-bg-opacity: 1;background-color:rgb(23 23 23 / var(--tw-bg-opacity, 1))}.bg-primary{--tw-bg-opacity: 1;background-color:rgb(220 20 60 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\\/15{background-color:#ffffff26}.bg-opacity-30{--tw-bg-opacity: .3}.bg-opacity-5{--tw-bg-opacity: .05}.p-1{padding:.25rem}.p-2{padding:.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.pb-2{padding-bottom:.5rem}.pl-2{padding-left:.5rem}.pl-4{padding-left:1rem}.pl-6{padding-left:1.5rem}.pl-8{padding-left:2rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.text-right{text-align:right}.text-\\[10px\\]{font-size:10px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.italic{font-style:italic}.text-neutral-100{--tw-text-opacity: 1;color:rgb(245 245 245 / var(--tw-text-opacity, 1))}.text-neutral-300{--tw-text-opacity: 1;color:rgb(212 212 212 / var(--tw-text-opacity, 1))}.text-neutral-400{--tw-text-opacity: 1;color:rgb(163 163 163 / var(--tw-text-opacity, 1))}.text-primary{--tw-text-opacity: 1;color:rgb(220 20 60 / var(--tw-text-opacity, 1))}.accent-red-500{accent-color:#ef4444}.opacity-50{opacity:.5}.opacity-75{opacity:.75}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:root{color-scheme:dark}#app{min-width:-moz-fit-content;min-width:fit-content;background-image:linear-gradient(#171616,#0e0e0e);color:#fff;min-height:100vh;width:100%;display:flex;flex-direction:row;padding:.5rem;gap:.5rem}select{background:url("data:image/svg+xml,<svg height='10px' width='10px' viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'><path d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/></svg>") no-repeat;background-position:calc(100% - .75rem) center!important;-moz-appearance:none!important;-webkit-appearance:none!important;appearance:none!important;padding-right:2rem!important}select:not([disabled]){cursor:pointer}.last\\:border-b-0:last-child{border-bottom-width:0px}.hover\\:bg-neutral-700:hover{--tw-bg-opacity: 1;background-color:rgb(64 64 64 / var(--tw-bg-opacity, 1))}.hover\\:bg-white:hover{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.hover\\:bg-white\\/10:hover{background-color:#ffffff1a}.hover\\:bg-opacity-10:hover{--tw-bg-opacity: .1}.hover\\:text-neutral-100:hover{--tw-text-opacity: 1;color:rgb(245 245 245 / var(--tw-text-opacity, 1))}.hover\\:opacity-100:hover{opacity:1}.focus\\:outline:focus{outline-style:solid}.focus\\:outline-primary:focus{outline-color:#dc143c}.group:hover .group-hover\\:visible{visibility:visible}@media (min-width: 640px){.sm\\:inline{display:inline}}.hover\\:\\[\\&\\:not\\(\\:group-hover\\)\\]\\:bg-white\\/10:not(:group-hover):hover{background-color:#ffffff1a}.hover\\:\\[\\&\\:not\\(\\:group-hover\\)\\]\\:text-neutral-100:not(:group-hover):hover{--tw-text-opacity: 1;color:rgb(245 245 245 / var(--tw-text-opacity, 1))}</style>
|
|
9091
9091
|
</head>
|
|
9092
9092
|
<body class="w-full min-h-screen">
|
|
9093
9093
|
<div id="app"></div>
|
|
@@ -9097,11 +9097,11 @@ var dist_default = `<!DOCTYPE html>
|
|
|
9097
9097
|
`;
|
|
9098
9098
|
|
|
9099
9099
|
// ../devtools-host/dist/index.js
|
|
9100
|
-
var dist_default2 = `var
|
|
9100
|
+
var dist_default2 = `var qe="production";if(qe!=="development"&&qe!=="production")throw new Error("NODE_ENV must either be set to development or production.");var l=qe==="development";var Xe=Symbol.for("kiru.signal"),Dt=Symbol.for("kiru.context"),ie=Symbol.for("kiru.contextProvider"),T=Symbol.for("kiru.fragment"),Ye=Symbol.for("kiru.error"),Y=Symbol.for("kiru.hmrAccept"),_e=Symbol.for("kiru.memo"),se=Symbol.for("kiru.errorBoundary"),Ze=Symbol.for("kiru.streamData"),Ot=Symbol.for("kiru.devFileLink"),Je=50;var P=2,L=4,fe=8,I=16,Ce=32,we=64,ae=128,Pt=/^on:?/;var Qe=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"]),et=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"]),Lt=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 C={current:null},Z={current:0},M={current:"window"in globalThis?"dom":"string"};var Vt,k=class extends Error{constructor(t){let r=typeof t=="string"?t:t.message;super(r),this[Vt]=!0,typeof t!="string"&&(l&&t?.vNode&&(this.customNodeStack=Ur(t.vNode)),this.fatal=t?.fatal)}static isKiruError(t){return t instanceof Error&&t[Ye]===!0}};Vt=Ye;function Ur(e){let t=e,r=[];for(;t&&t.parent;)typeof t.type=="function"?r.push(Br(t.type)):typeof t.type=="string"&&r.push(t.type),t=t.parent;let n=typeof e.type=="function"?e:tt(e,o=>typeof o.type=="function");return\`The above error occurred in the <\${$t(n?.type||B)}> component:
|
|
9101
9101
|
|
|
9102
9102
|
\${r.map(o=>\` at \${o}\`).join(\`
|
|
9103
9103
|
\`)}
|
|
9104
|
-
\`}function Ur(e){let t=Pt(e);if(l){let r=Wr(e);r&&(t=\`\${t} (\${r})\`)}return t}function Pt(e){return e.displayName??(e.name||"Anonymous Function")}function Wr(e){return e.toString().match(/\\/\\/ \\[kiru_devtools\\]:(.*)/)?.[1]??null}var te={parentStack:[],childIdxStack:[],eventDeferrals:new Map,parent:function(){return this.parentStack[this.parentStack.length-1]},clear:function(){this.parentStack.length=0,this.childIdxStack.length=0},pop:function(){this.parentStack.pop(),this.childIdxStack.pop()},push:function(e){this.parentStack.push(e),this.childIdxStack.push(0)},currentChild:function(){return this.parentStack[this.parentStack.length-1].childNodes[this.childIdxStack[this.childIdxStack.length-1]]},nextChild:function(){return this.parentStack[this.parentStack.length-1].childNodes[this.childIdxStack[this.childIdxStack.length-1]++]},bumpChildIndex:function(){this.childIdxStack[this.childIdxStack.length-1]++},captureEvents:function(e){Dt(e,!0),this.eventDeferrals.set(e,[])},resetEvents:function(e){this.eventDeferrals.delete(e)},releaseEvents:function(e){Dt(e,!1);let t=this.eventDeferrals.get(e);for(;t?.length;)t.shift()()}},Br=e=>{let t=e.target;!e.isTrusted||!t||te.eventDeferrals.get(t)?.push(()=>t.dispatchEvent(e))},Dt=(e,t)=>{for(let r in e)if(r.startsWith("on")){let n=r.substring(2);e[t?"addEventListener":"removeEventListener"](n,Br,{passive:!0})}};var rt=!1,Ze=!1,Lt=e=>{e.preventDefault(),e.stopPropagation(),Ze=!0},le=null;function Vt(){rt=!0,le=document.activeElement,le&&le!==document.body&&le.addEventListener("blur",Lt)}function $t(){Ze&&(le.removeEventListener("blur",Lt),le.isConnected&&le.focus(),Ze=!1),rt=!1}function Je(e,t){if(typeof e=="function"){e(t);return}if(w.isSignal(e)){e.sneak(t),e.notify({filter:r=>typeof r=="function"});return}e.current=t}function Ht(e){let t=e.type;return t=="#text"?It(e):qe.has(t)?document.createElementNS("http://www.w3.org/2000/svg",t):document.createElement(t)}function It(e){let{nodeValue:t}=e.props;if(!w.isSignal(t))return document.createTextNode(t);let r=t.peek()??"",n=document.createTextNode(r);return et(e,n,t),n}function qr(e,t,r){let n=Qe.get(e)??{},o=n[t]=s=>{if(rt){s.preventDefault(),s.stopPropagation();return}r(s)};return Qe.set(e,n),o}var Qe=new WeakMap;function Ft(e){let t=e.dom,r=e.prev?.props??{},n=e.props??{},o=new Set([...Object.keys(r),...Object.keys(n)]),s=k.current==="hydrate";o.forEach(i=>{let a=r[i],u=n[i];if(ge.internalProps.includes(i)&&i!=="innerHTML"){i==="ref"&&a!==u&&(a&&Je(a,null),u&&Je(u,t));return}if(ge.isEvent(i)){if(a!==u||k.current==="hydrate"){let c=i.replace(Mt,""),p=c==="focus"||c==="blur";i in r&&t.removeEventListener(c,p?Qe.get(e)?.[c]:a),i in n&&t.addEventListener(c,p?qr(e,c,u):u)}return}if(!(t instanceof Text)){if(a===u||s&&t.getAttribute(i)===u)return;if(w.isSignal(a)&&e.cleanups){let c=e.cleanups[i];c&&(c(),delete e.cleanups[i])}if(w.isSignal(u))return Zr(e,t,i,u,a);Ce(t,i,u,a);return}w.isSignal(u)||t.nodeValue!==u&&(t.nodeValue=u)})}function Gr(e){return e.multiple?Array.from(e.selectedOptions).map(t=>t.value):e.value}function Nt(e,t){if(!e.multiple||t===void 0||t===null||t===""){e.value=t;return}Array.from(e.options).forEach(r=>{r.selected=t.indexOf(r.value)>-1})}var Xr={value:"input",checked:"change",open:"toggle",volume:"volumechange",playbackRate:"ratechange",currentTime:"timeupdate"},Yr=["progress","meter","number","range"];function Zr(e,t,r,n,o){let s=e.cleanups??(e.cleanups={}),[i,a]=r.split(":");if(i!=="bind")return s[r]=n.subscribe((b,C)=>{Ce(t,r,b,C),l&&window.__kiru.profilingContext?.emit("signalAttrUpdate",Z(e))}),Ce(t,r,n.peek(),Y(o));let u=Xr[a];if(!u){l&&console.error(\`[kiru]: \${a} is not a valid element binding attribute.\`);return}let c=t instanceof HTMLSelectElement,p=c?b=>Nt(t,b):b=>t[a]=b,v=b=>{p(b),l&&window.__kiru.profilingContext?.emit("signalAttrUpdate",Z(e))},M=b=>{n.sneak(b),n.notify({filter:C=>C!==v})},h;if(a==="value"){let b=Yr.indexOf(t.type)!==-1;h=()=>{let C=t.value;c?C=Gr(t):typeof n.peek()=="number"&&b&&(C=t.valueAsNumber),M(C)}}else h=b=>{let C=b.target[a];a==="currentTime"&&n.peek()===C||M(C)};t.addEventListener(u,h);let x=n.subscribe(v);return s[r]=()=>{t.removeEventListener(u,h),x()},Ce(t,a,n.peek(),Y(o))}function et(e,t,r){(e.cleanups??(e.cleanups={})).nodeValue=r.subscribe((n,o)=>{n!==o&&(t.nodeValue=n,l&&window.__kiru.profilingContext?.emit("signalTextUpdate",Z(e)))})}function Jr(e){if(e.type!=="#text"||!w.isSignal(e.props.nodeValue))return;let t=Y(e.props.nodeValue);if(!Xe(t)){l&&console.error(\`[kiru]: Hydration mismatch - expected primitive child but received \${t}\`);return}let r=It(e),n=te.parent();return n&&n.appendChild(r),r}function zt(e){let t=te.nextChild()??Jr(e);if(!t)throw new E({message:"Hydration mismatch - no node found",vNode:e});let r=t.nodeName;if(qe.has(r)||(r=r.toLowerCase()),e.type!==r)throw new E({message:\`Hydration mismatch - expected node of type \${e.type.toString()} but received \${r}\`,vNode:e});if(e.dom=t,e.type!=="#text"&&!(e.flags&L)){Ft(e);return}w.isSignal(e.props.nodeValue)&&et(e,t,e.props.nodeValue);let n=e,o=e.sibling;for(;o&&o.type==="#text";){let s=o;te.bumpChildIndex();let i=String(Y(n.props.nodeValue)??""),a=n.dom.splitText(i.length);s.dom=a,w.isSignal(s.props.nodeValue)&&et(s,a,s.props.nodeValue),n=o,o=o.sibling}}function jt(e,t,r,n=!1){if(r===null)return e.removeAttribute(t),!0;switch(typeof r){case"undefined":case"function":case"symbol":return e.removeAttribute(t),!0;case"boolean":if(n&&!r)return e.removeAttribute(t),!0}return!1}function Qr(e,t,r){let n=Ge.has(t);jt(e,t,r,n)||e.setAttribute(t,n&&typeof r=="boolean"?"":String(r))}var en=["INPUT","TEXTAREA"],tn=e=>en.indexOf(e.nodeName)>-1;function Ce(e,t,r,n){if(r!==n)switch(t){case"style":return on(e,r,n);case"className":return nn(e,r);case"innerHTML":return rn(e,r);case"muted":e.muted=!!r;return;case"value":if(e.nodeName==="SELECT")return Nt(e,r);let o=r==null?"":String(r);if(tn(e)){e.value=o;return}e.setAttribute("value",o);return;case"checked":if(e.nodeName==="INPUT"){e.checked=!!r;return}e.setAttribute("checked",String(r));return;default:return Qr(e,Gt(t),r)}}function rn(e,t){if(t==null||typeof t=="boolean"){e.innerHTML="";return}e.innerHTML=String(t)}function nn(e,t){let r=Y(t);if(!r)return e.removeAttribute("class");e.setAttribute("class",r)}function on(e,t,r){if(jt(e,"style",t))return;if(typeof t=="string"){e.setAttribute("style",t);return}let n={};typeof r=="string"?e.setAttribute("style",""):typeof r=="object"&&r&&(n=r);let o=t;new Set([...Object.keys(n),...Object.keys(o)]).forEach(i=>{let a=n[i],u=o[i];if(a!==u){if(u===void 0){e.style[i]="";return}e.style[i]=u}})}function sn(e){let t=e.parent,r=t?.dom;for(;t&&!r;)t=t.parent,r=t?.dom;if(!r||!t){if(!e.parent&&e.dom)return e;throw new E({message:"No DOM parent found while attempting to place node.",vNode:e})}return t}function an(e,t){let{node:r,lastChild:n}=t,o=e.dom;if(n){n.after(o);return}let s=Kt(e,r);if(s){r.dom.insertBefore(o,s);return}r.dom.appendChild(o)}function Kt(e,t){let r=e;for(;r;){let n=r.sibling;for(;n;){if(!(n.flags&(T|L))){let o=ln(n);if(o?.isConnected)return o}n=n.sibling}if(r=r.parent,!r||r.flags&L||r===t)return}}function ln(e){let t=e;for(;t;){if(t.dom)return t.dom;if(t.flags&L)return;t=t.child}}function Ut(e){if(k.current==="hydrate")return J(e,he);let t={node:e.dom?e:sn(e)};tt(e,t,(e.flags&T)>0),e.dom&&!(e.flags&L)&&Wt(e,t,!1),he(e)}function tt(e,t,r){let n=e.child;for(;n;){if(n.flags&me){n.flags&T&&un(n,t),he(n),n=n.sibling;continue}n.dom?(tt(n,{node:n},!1),n.flags&L||Wt(n,t,r)):tt(n,t,(n.flags&T)>0||r),he(n),n=n.sibling}}function Wt(e,t,r){(r||!e.dom.isConnected||e.flags&T)&&an(e,t),(!e.prev||e.flags&P)&&Ft(e),t.lastChild=e.dom}function Bt(e){e===e.parent?.child&&(e.parent.child=e.sibling);let t;l&&(t=Z(e)),J(e,r=>{let{hooks:n,subs:o,cleanups:s,dom:i,props:{ref:a}}=r;for(o?.forEach(u=>u()),s&&Object.values(s).forEach(u=>u());n?.length;)n.pop().cleanup?.();l&&(window.__kiru.profilingContext?.emit("removeNode",t),i instanceof Element&&delete i.__kiruNode),i&&(a&&Je(a,null),i.isConnected&&!(r.flags&L)&&i.remove(),delete r.dom)}),e.parent=null}function un(e,t){if(!e.child)return;let r=[];if(qt(e.child,r),r.length===0)return;let{node:n,lastChild:o}=t;if(o)o.after(...r);else{let s=Kt(e,n),i=n.dom;s?s.before(...r):i.append(...r)}t.lastChild=r[r.length-1]}function qt(e,t){let r=e;for(;r;)r.dom?t.push(r.dom):r.child&&qt(r.child,t),r=r.sibling}function Xt(e){return typeof e=="function"&&typeof e[ke]?.arePropsEqual=="function"}function f(e,t=null,...r){if(e===Q)return Q({children:r,...t});let n={type:e,flags:0,index:0,depth:0,props:{},parent:null,sibling:null,child:null,prev:null,deletions:null};if(Xt(e)&&(n.flags|=_e,n.arePropsEqual=e[ke].arePropsEqual),t!==null){let{key:s,ref:i,...a}=t;Yt(s)&&(n.props.key=s.toString()),Zt(i)&&(n.props.ref=i),Object.assign(n.props,a)}let o=r.length===1?r[0]:r.length>1?r:null;return o!==null&&(n.props.children=o),n}function Q({children:e,key:t}){return f(q,t?{key:t}:null,e)}var it;function Me(e,t){return l&&(it=Z(e)),Array.isArray(t)?(l&&(or in t&&mn(e,t),dn(e,t)),fn(e,t)):cn(e,t)}function cn(e,t){let r=e.child;if(r===null)return tr(e,t);let n=r.sibling,o=Qt(e,r,t);if(o!==null)return r&&r!==o&&!o.prev?ot(e,r):n&&ot(e,n),o;{let s=ir(r),i=rr(s,e,0,t);if(i!==null){let a=i.prev;if(a!==null){let u=a.props.key;s.delete(u===void 0?a.index:u)}Te(i,0,0)}return s.forEach(a=>Ae(e,a)),i}}function fn(e,t){let r=null,n=null,o=e.child,s=null,i=0,a=0;for(;o!==null&&a<t.length;a++){o.index>a?(s=o,o=null):s=o.sibling;let c=Qt(e,o,t[a]);if(c===null){o===null&&(o=s);break}o&&!c.prev&&Ae(e,o),i=Te(c,i,a),n===null?r=c:n.sibling=c,n=c,o=s}if(a===t.length)return ot(e,o),r;if(o===null){for(;a<t.length;a++){let c=tr(e,t[a]);c!==null&&(i=Te(c,i,a),n===null?r=c:n.sibling=c,n=c)}return r}let u=ir(o);for(;a<t.length;a++){let c=rr(u,e,a,t[a]);if(c!==null){let p=c.prev;if(p!==null){let v=p.props.key;u.delete(v===void 0?p.index:v)}i=Te(c,i,a),n===null?r=c:n.sibling=c,n=c}}return u.forEach(c=>Ae(e,c)),r}function Qt(e,t,r){let n=t?.props.key;return Re(r)?n!==void 0||t?.type==="#text"&&w.isSignal(t.props.nodeValue)?null:Jt(e,t,""+r):w.isSignal(r)?t&&t.props.nodeValue!==r?null:Jt(e,t,r):ue(r)?r.props.key!==n?null:pn(e,t,r):Array.isArray(r)?n!==void 0?null:(l&&st(r),er(e,t,r)):null}function Jt(e,t,r){if(t===null||t.type!=="#text"){l&&K();let o=f("#text",{nodeValue:r});return j(o,e),o}return l&&we(),t.props.nodeValue!==r&&(t.props.nodeValue=r,t.flags|=P),t.sibling=null,t}function pn(e,t,r){let{type:n,props:o}=r;if(l&&typeof n=="function"&&(n=_(n)),n===q)return er(e,t,o.children||[],o);if(t?.type===n)return l&&we(),t.index=0,t.sibling=null,typeof n=="string"?nr(t.props,o)&&(t.flags|=P):t.flags|=P,t.props=o,t.memoizedProps=r.memoizedProps,t;l&&K();let s=f(n,o);return j(s,e),s}function er(e,t,r,n={}){if(t===null||t.type!==q){l&&K();let o=f(q,{children:r,...n});return j(o,e),o}return l&&we(),t.props={...t.props,...n,children:r},t.flags|=P,t.sibling=null,t}function tr(e,t){if(Re(t)){l&&K();let r=f("#text",{nodeValue:""+t});return j(r,e),r}if(w.isSignal(t)){l&&K();let r=f("#text",{nodeValue:t});return j(r,e),r}if(ue(t)){l&&K();let r=f(t.type,t.props);return j(r,e),r.flags|=T,r}if(Array.isArray(t)){l&&(K(),st(t));let r=Q({children:t});return j(r,e),r}return null}function Te(e,t,r){e.index=r;let n=e.prev;if(n!==null){let o=n.index;return o<t?(e.flags|=T,t):o}else return e.flags|=T,t}function rr(e,t,r,n){if(w.isSignal(n)||Re(n)){let s=e.get(r);if(s){if(s.props.nodeValue===n)return s;s.type==="#text"&&w.isSignal(s.props.nodeValue)&&s.cleanups?.nodeValue?.()}l&&K();let i=f("#text",{nodeValue:n});return j(i,t),i.flags|=T,i.index=r,i}if(ue(n)){let{type:s,props:i}=n,a=i.key,u=e.get(a===void 0?r:a);if(u?.type===s)return l&&we(),typeof s=="string"?nr(u.props,i)&&(u.flags|=P):u.flags|=P,u.props=i,u.sibling=null,u.index=r,u;l&&K();let c=f(n.type,n.props);return j(c,t),c.flags|=T,c.index=r,c}if(Array.isArray(n)){let s=e.get(r);if(l&&st(n),s)return l&&we(),s.flags|=P,s.props.children=n,s;l&&K();let i=Q({children:n});return j(i,t),i.flags|=T,i.index=r,i}return null}function nr(e,t){let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!0;for(let o of r)if(!(o==="children"||o==="key")&&e[o]!==t[o])return!0;return!1}function j(e,t){e.parent=t,e.depth=t.depth+1}function we(){"window"in globalThis&&window.__kiru.profilingContext?.emit("updateNode",it)}function K(){"window"in globalThis&&window.__kiru.profilingContext?.emit("createNode",it)}var or=Symbol("kiru:marked-list-child");function st(e){Object.assign(e,{[or]:!0})}function ir(e){let t=new Map;for(;e;){let r=e.props.key;t.set(r===void 0?e.index:r,e),e=e.sibling}return t}function Ae(e,t){e.deletions===null?e.deletions=[t]:e.deletions.push(t)}function ot(e,t){for(;t;)Ae(e,t),t=t.sibling}function dn(e,t){let r=new Set,n=!1;for(let o of t){if(!ue(o))continue;let s=o.props.key;if(typeof s=="string"){if(!n&&r.has(s)){let i=ar(e);sr(\`\${i} component produced a child in a list with a duplicate key prop: "\${s}". Keys should be unique so that components maintain their identity across updates\`),n=!0}r.add(s)}}}function mn(e,t){let r=!1,n=!1;for(let o of t){if(!ue(o))continue;typeof o.props.key=="string"?r=!0:n=!0}if(n&&r){let o=ar(e);sr(\`\${o} component produced a child in a list without a valid key prop\`)}}function sr(e){let t=\`[kiru]: \${e}. See https://kirujs.dev/keys-warning for more information.\`;console.error(t)}var nt=new WeakMap;function ar(e){if(nt.has(e))return nt.get(e);let t=e.parent,r;for(;!r&&t;)typeof t.type=="function"&&(r=t.type),t=t.parent;let n=\`<\${r?.displayName||r?.name||"Anonymous Function"} />\`;return nt.set(e,n),n}var U,W=[],pe=!1,lt=[],Oe=[],ut=!1,ct=!1,ft=!1,pt=0,lr=[],dt=[],ur=-1;function gt(e){if(pe){lt.push(e);return}e()}function Pe(){pe&&(window.cancelAnimationFrame(ur),cr())}function ht(e){e.flags|=ae,W.push(e),pe=!0,Pe()}function R(e){if(k.current==="hydrate")return gt(()=>mt(e));mt(e)}function gn(){pe||(pe=!0,ur=window.requestAnimationFrame(cr))}function hn(){for(pe=!1;lt.length;)lt.shift()()}function mt(e){if(ut&&(ct=!0),S.current===e){l&&window.__kiru.profilingContext?.emit("updateDirtied",U),ft=!0;return}if(!(e.flags&(ae|fe))){if(e.flags|=ae,!W.length)return W.push(e),gn();W.push(e)}}function wn(e){J(e,t=>t.flags|=fe),Oe.push(e)}var bn=(e,t)=>t.depth-e.depth,re=null;function cr(){if(l){let t=Oe[0]??W[0];t?(U=Z(t),window.__kiru.profilingContext?.beginTick(U)):U=null}let e=1;for(Vt();W.length;){W.length>e&&W.sort(bn),re=W.shift(),e=W.length;let t=re.flags;if(!(t&fe)&&t&ae){let r=re;for(;r=yn(r););for(;Oe.length;)Bt(Oe.pop());Ut(re),re.flags&=~ae}}if($t(),ut=!0,at(lr),ut=!1,ct)return Sn(),at(dt),ct=!1,pt++,l&&(window.__kiru.profilingContext?.endTick(U),window.__kiru.profilingContext?.emit("updateDirtied",U)),Pe();pt=0,hn(),at(dt),l&&(window.__kiru.emit("update",U),window.__kiru.profilingContext?.emit("update",U),window.__kiru.profilingContext?.endTick(U))}function yn(e){let t=!0;try{typeof e.type=="string"?En(e):wt(e.type)?vn(e):t=xn(e)}catch(n){l&&window.__kiru.emit("error",U,n instanceof Error?n:new Error(String(n)));let o=fr(e);if(o){let s=o.error=n instanceof Error?n:new Error(String(n));return o.props.onError?.(s),o.depth<re.depth&&(re=o),o}if(E.isKiruError(n)){if(n.customNodeStack&&setTimeout(()=>{throw new Error(n.customNodeStack)}),n.fatal)throw n;console.error(n);return}setTimeout(()=>{throw n})}if(e.deletions!==null&&(e.deletions.forEach(wn),e.deletions=null),t&&e.child)return e.child;let r=e;for(;r;){if(r.immediateEffects&&(lr.push(...r.immediateEffects),r.immediateEffects=void 0),r.effects&&(dt.push(...r.effects),r.effects=void 0),r===re)return;if(r.sibling)return r.sibling;r=r.parent,k.current==="hydrate"&&r?.dom&&te.pop()}}function vn(e){let{props:t,type:r}=e,n=t.children;if(r===ie){let{props:{dependents:o,value:s},prev:i}=e;o.size&&i&&i.props.value!==s&&o.forEach(mt)}else if(r===se){let o=e,{error:s}=o;s&&(n=typeof t.fallback=="function"?t.fallback(s):t.fallback,delete o.error)}e.child=Me(e,n)}function xn(e){let{type:t,props:r,subs:n,prev:o,flags:s}=e;if(s&_e){if(e.memoizedProps=r,o?.memoizedProps&&e.arePropsEqual(o.memoizedProps,r)&&!e.hmrUpdated)return e.flags|=me,!1;e.flags&=~me}try{S.current=e;let i,a=0;do{if(e.flags&=~ae,ft=!1,X.current=0,n&&(n.forEach(u=>u()),n.clear()),l){if(i=_(t)(r),e.hmrUpdated&&e.hooks&&e.hookSig){let u=e.hooks.length;if(X.current<u){for(let c=X.current;c<u;c++)e.hooks[c].cleanup?.();e.hooks.length=X.current,e.hookSig.length=X.current}}if(delete e.hmrUpdated,++a>Be)throw new E({message:"Too many re-renders. Kiru limits the number of renders to prevent an infinite loop.",fatal:!0,vNode:e});continue}i=t(r)}while(ft);return e.child=Me(e,i),!0}finally{S.current=null}}function En(e){let{props:t,type:r}=e;l&&bt(e),e.dom||(k.current==="hydrate"?zt(e):e.dom=Ht(e),l&&e.dom instanceof Element&&(e.dom.__kiruNode=e)),r!=="#text"&&(e.child=Me(e,t.children),e.child&&k.current==="hydrate"&&te.push(e.dom))}function Sn(){if(pt>Be)throw new E("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 at(e){for(let t=0;t<e.length;t++)e[t]();e.length=0}var pr;(function(e){e.Start="start",e.End="end"})(pr||(pr={}));var de=null,dr=new Set;function d(e,t,r){let n=kn(e);if(l&&de!==null&&!dr.has(e+de))throw dr.add(e+de),new E({message:\`Nested primitive "useHook" calls are not supported. "\${e}" was called inside "\${de}". Strange will most certainly happen.\`,vNode:n});let o=(a,u)=>{if(u?.immediate){(n.immediateEffects??(n.immediateEffects=[])).push(a);return}(n.effects??(n.effects=[])).push(a)},s=X.current++,i=n.hooks?.at(s);if(l){de=e,n.hooks??(n.hooks=[]),n.hookSig??(n.hookSig=[]),n.hookSig[s]?n.hookSig[s]!==e&&(console.warn(\`[kiru]: hooks must be called in the same order. Hook "\${e}" was called in place of "\${n.hookSig[s]}". Strange things may happen.\`),i?.cleanup?.(),n.hooks.length=s,n.hookSig.length=s,i=void 0):n.hookSig[s]=e;let a;i?a=i:(a=typeof t=="function"?t():{...t},a.name=e),n.hooks[s]=a;try{return r({hook:a,isInit:!i,isHMR:n.hmrUpdated,update:()=>R(n),queueEffect:o,vNode:n,index:s})}catch(u){throw u}finally{de=null}}try{let a=i??(typeof t=="function"?t():{...t});return n.hooks??(n.hooks=[]),n.hooks[s]=a,r({hook:a,isInit:!i,update:()=>R(n),queueEffect:o,vNode:n,index:s})}catch(a){throw a}}function kn(e){let t=S.current;if(!t)throw new E(\`Hook "\${e}" must be used at the top level of a component or inside another composite hook.\`);return t}function V(e){e.cleanup&&(e.cleanup(),e.cleanup=void 0)}function A(e,t){return e===void 0||t===void 0||e.length!==t.length||e.length>0&&t.some((r,n)=>!Object.is(r,e[n]))}var be={stack:new Array,current:function(){return this.stack[this.stack.length-1]}},$=new Map,H=new Map;var mr,w=class e{constructor(t,r){this[mr]=!0,this.$id=Le(),this.$value=t,r&&(this.displayName=r),l?(H.set(this.$id,new Set),this.$initialValue=yt(t),this[G]={provide:()=>this,inject:n=>{H.get(this.$id)?.clear?.(),H.delete(this.$id),this.$id=n.$id,n.__next=this,this.$initialValue===n.$initialValue?this.$value=n.$value:this.notify()},destroy:()=>{}}):this.$subs=new Set}get value(){if(this.onBeforeRead?.(),l){let t=_(this);return e.entangle(t),t.$value}return e.entangle(this),this.$value}set value(t){if(l){let r=_(this);if(Object.is(r.$value,t))return;r.$prevValue=r.$value,r.$value=t,r.notify();return}Object.is(this.$value,t)||(this.$prevValue=this.$value,this.$value=t,this.notify())}peek(){return this.onBeforeRead?.(),l?_(this).$value:this.$value}sneak(t){if(l){let r=_(this);r.$prevValue=r.$value,r.$value=t;return}this.$prevValue=this.$value,this.$value=t}toString(){if(this.onBeforeRead?.(),l){let t=_(this);return e.entangle(t),\`\${t.$value}\`}return e.entangle(this),\`\${this.$value}\`}subscribe(t){return l?(H.get(this.$id).add(t),()=>H.get(this.$id)?.delete(t)):(this.$subs.add(t),()=>this.$subs.delete(t))}notify(t){if(l)return H.get(this.$id)?.forEach(r=>{if(t?.filter&&!t.filter(r))return;let{$value:n,$prevValue:o}=_(this);return r(n,o)});this.$subs.forEach(r=>{if(!(t?.filter&&!t.filter(r)))return r(this.$value,this.$prevValue)})}static isSignal(t){return typeof t=="object"&&!!t&&Ue in t}static subscribers(t){return l?H.get(t.$id):t.$subs}static makeReadonly(t){let r=Object.getOwnPropertyDescriptor(t,"value");return r&&!r.writable?t:Object.defineProperty(t,"value",{get:function(){return e.entangle(this),this.$value},configurable:!0})}static makeWritable(t){let r=Object.getOwnPropertyDescriptor(t,"value");return r&&r.writable?t:Object.defineProperty(t,"value",{get:function(){return e.entangle(this),this.$value},set:function(n){this.$value=n,this.notify()},configurable:!0})}static entangle(t){let r=S.current,n=be.current();if(n){(!r||r&&m())&&n.set(t.$id,t);return}if(!r||!m())return;let o=t.subscribe(()=>R(r));(r.subs??(r.subs=new Set)).add(o)}static configure(t,r){t.onBeforeRead=r}static dispose(t){if(t.$isDisposed=!0,l){H.delete(t.$id);return}t.$subs.clear()}};mr=Ue;var De=(e,t)=>new w(e,t),y=(e,t)=>d("useSignal",{signal:null},({hook:r,isInit:n,isHMR:o})=>{if(l&&(n&&(r.dev={devtools:{get:()=>({displayName:r.signal.displayName,value:r.signal.peek()}),set:({value:s})=>{r.signal.value=s}},initialArgs:[e,t]}),o)){let[s,i]=r.dev.initialArgs;(s!==e||i!==t)&&(r.cleanup?.(),n=!0,r.dev.initialArgs=[e,t])}return n&&(r.cleanup=()=>w.dispose(r.signal),r.signal=new w(e,t)),r.signal});function Y(e,t=!1){return w.isSignal(e)?t?e.value:e.peek():e}var vt=()=>{$.forEach(e=>e()),$.clear()};var ge={internalProps:["children","ref","key","innerHTML"],isEvent:e=>e.startsWith("on"),isProperty:e=>!ge.internalProps.includes(e)&&!ge.isEvent(e)};function Gt(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():Rt.get(e)||e}}function yt(e,t={functions:!0}){let r=new WeakSet;return JSON.stringify(e,(n,o)=>{if(typeof o=="object"&&o!==null){if(r.has(o))return"[CIRCULAR]";r.add(o)}return typeof o=="function"?t.functions?o.toString():\`[FUNCTION (\${o.name||"anonymous"})]\`:o})}function _(e){let t=e;if(l)for(;"__next"in t;)t=t.__next;return t}function m(){return k.current==="dom"||k.current==="hydrate"}function ue(e){return typeof e=="object"&&e!==null&&"type"in e}function Re(e){return typeof e=="string"&&e!==""||typeof e=="number"||typeof e=="bigint"}function wt(e){return e===q||e===ie||e===se}function gr(e){return e.type===q}function Z(e){let t=e;for(;t;){if(t.app)return e.app=t.app;t=t.parent}return null}function he(e){let{props:{children:t,...r},memoizedProps:n,index:o}=e;e.prev={props:r,memoizedProps:n,index:o},e.flags&=~(P|T|fe)}function hr(e,t){if(t.depth<e.depth)return!1;if(e===t)return!0;let r=!1,n=[e];for(;n.length;){let o=n.pop();if(o===t)return!0;o.child&&n.push(o.child),r&&o.sibling&&n.push(o.sibling),r=!0}return!1}function J(e,t){t(e);let r=e.child;for(;r;)t(r),r.child&&J(r,t),r=r.sibling}function Ye(e,t){let r=e.parent;for(;r;){if(t(r))return r;r=r.parent}return null}function fr(e){return Ye(e,t=>t.type===se)}function bt(e){if("children"in e.props&&e.props.innerHTML)throw new E({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 E({message:\`Cannot use both bind:\${t} and \${t} on an element\`,vNode:e})}function Yt(e){return typeof e=="string"||typeof e=="number"}function Zt(e){return typeof e=="function"||typeof e=="object"&&!!e&&"current"in e||w.isSignal(e)}var _n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz-";function Le(e=10,t=_n){let r="";for(let n=0;n<e;n++)r+=t[Math.random()*t.length|0];return r}var z=Object.freeze(()=>{});function Ve(e){let{id:t,subs:r,fn:n,deps:o=[],onDepChanged:s}=e,i;$.delete(t);let a=!!S.current&&!m();a||(i=new Map,be.stack.push(i));let u=n(...o.map(c=>c.value));if(!a){for(let[p,v]of r)i.has(p)||(v(),r.delete(p));let c=()=>{$.size||queueMicrotask(vt),$.set(t,s)};for(let[p,v]of i){if(r.has(p))continue;let M=v.subscribe(c);r.set(p,M)}be.stack.pop()}return u}var ye=class e extends w{constructor(t,r){if(super(void 0,r),this.$getter=t,this.$unsubs=new Map,this.$isDirty=!0,l){let n=this[G].inject;this[G]={provide:()=>this,inject:o=>{n(o),e.stop(o),this.$isDirty=o.$isDirty},destroy:()=>{}}}w.configure(this,()=>{this.$isDirty&&(l&&this.$isDisposed||e.run(this))})}get value(){return super.value}set value(t){}subscribe(t){return this.$isDirty&&e.run(this),super.subscribe(t)}static dispose(t){e.stop(t),w.dispose(t)}static stop(t){let{$id:r,$unsubs:n}=_(t);$.delete(r),n.forEach(o=>o()),n.clear(),t.$isDirty=!0}static run(t){let r=_(t),{$id:n,$getter:o,$unsubs:s}=r,i=Ve({id:n,subs:s,fn:()=>o(r.$value),onDepChanged:()=>{if(r.$isDirty=!0,l){if(!H?.get(n)?.size)return}else if(!t.$subs.size)return;e.run(r),!Object.is(r.$value,r.$prevValue)&&r.notify()}});r.sneak(i),r.$isDirty=!1}},wr=(e,t)=>new ye(e,t),xt=(e,t)=>d("useComputedSignal",{signal:null},({hook:r,isInit:n,isHMR:o})=>(l&&(r.dev={devtools:{get:()=>({displayName:r.signal.displayName,value:r.signal.peek()})}},o&&(r.cleanup?.(),n=!0)),n&&(r.cleanup=()=>ye.dispose(r.signal),r.signal=wr(e,t)),r.signal));var ve=class e{constructor(t,r){if(this.id=Le(),this.getter=t,this.deps=r,this.unsubs=new Map,this.isRunning=!1,this.cleanup=null,l&&"window"in globalThis){let n=window.__kiru.HMRContext.signals;n.isWaitingForNextWatchCall()&&n.pushWatch(this)}this.start()}start(){if(!this.isRunning){if(this.isRunning=!0,l&&"window"in globalThis&&window.__kiru.HMRContext?.isReplacement())return queueMicrotask(()=>{this.isRunning&&e.run(this)});e.run(this)}}stop(){$.delete(this.id),this.unsubs.forEach(t=>t()),this.unsubs.clear(),this.cleanup?.(),this.cleanup=null,this.isRunning=!1}static run(t){let r=_(t),{id:n,getter:o,unsubs:s,deps:i}=r;r.cleanup=Ve({id:n,subs:s,fn:o,deps:i,onDepChanged:()=>{r.cleanup?.(),e.run(r)}})??null}};function br(e,t){if(typeof e=="function")return new ve(e);let r=e,n=t;return new ve(n,r)}function xe(e,t){if(m())return d("useWatch",{watcher:null},({hook:r,isInit:n,isHMR:o})=>{if(l&&o&&(r.cleanup?.(),n=!0),n){let s=r.watcher=br(e,t);r.cleanup=()=>s.stop()}return r.watcher})}var Cn=0;function yr(e,t,r){if(l&&t.__kiruNode)throw new Error("[kiru]: container in use - call unmount on the previous app first.");let n=f(t.nodeName.toLowerCase(),{});l&&(t.__kiruNode=n),n.dom=t,n.flags|=L;let o=Cn++,s=r?.name??\`App-\${o}\`,i={id:o,name:s,rootNode:n,render:a,unmount:u};function a(c){n.props.children=c,ht(n)}function u(){n.props.children=null,ht(n),l&&(delete t.__kiruNode,delete n.app),window.__kiru.emit("unmount",i)}return l&&(n.app=i),a(e),window.__kiru.emit("mount",i),l&&queueMicrotask(()=>{window.dispatchEvent(new Event("kiru:ready"))}),i}function ce(e){return m()?d("useState",{state:void 0,dispatch:z},({hook:t,isInit:r,update:n,isHMR:o})=>{if(l&&(r&&(t.dev={devtools:{get:()=>({value:t.state}),set:({value:s})=>t.state=s},initialArgs:[e]}),o)){let[s]=t.dev.initialArgs;s!==e&&(r=!0,t.dev.initialArgs=[e])}return r&&(t.state=typeof e=="function"?e():e,t.dispatch=s=>{let i=typeof s=="function"?s(t.state):s;Object.is(t.state,i)||(t.state=i,n())}),[t.state,t.dispatch]}):[typeof e=="function"?e():e,z]}function vr(e){let t={[Ct]:!0,Provider:({value:r,children:n})=>{let[o]=ce(()=>new Set);return f(ie,{value:r,ctx:t,dependents:o},typeof n=="function"?n(r):n)},default:()=>e,set displayName(r){this.Provider.displayName=r},get displayName(){return this.Provider.displayName||"Anonymous Context"}};if(l){let r=t;r[G]={inject:n=>{let o=t.Provider;window.__kiru.apps.forEach(s=>{J(s.rootNode,i=>{i.type===n.Provider&&(i.type=o,i.hmrUpdated=!0,R(i))})})},destroy:()=>{},provide:()=>t}}return t}function ee(e,t){return m()?d("useCallback",{callback:e,deps:t},({hook:r,isHMR:n})=>(l&&(r.dev={devtools:{get:()=>({callback:r.callback,dependencies:r.deps})}},n&&(r.deps=[])),A(t,r.deps)&&(r.deps=t,r.callback=e),r.callback)):e}function I(e,t){if(m())return d("useEffect",{deps:t},({hook:r,isInit:n,isHMR:o,queueEffect:s})=>{l&&(r.dev={devtools:{get:()=>({callback:e,dependencies:r.deps})}},o&&(n=!0)),(n||A(t,r.deps))&&(r.deps=t,V(r),s(()=>{let i=e();typeof i=="function"&&(r.cleanup=i)}))})}function ne(e,t){if(m())return d("useLayoutEffect",{deps:t},({hook:r,isInit:n,isHMR:o,queueEffect:s})=>{l&&(r.dev={devtools:{get:()=>({callback:e,dependencies:r.deps})}},o&&(n=!0)),(n||A(t,r.deps))&&(r.deps=t,V(r),s(()=>{let i=e();typeof i=="function"&&(r.cleanup=i)},{immediate:!0}))})}function Ee(e,t){return m()?d("useMemo",{deps:t,value:void 0},({hook:r,isInit:n,isHMR:o})=>(l&&(r.dev={devtools:{get:()=>({value:r.value,dependencies:r.deps})}},o&&(n=!0)),(n||A(t,r.deps))&&(r.deps=t,r.value=e()),r.value)):e()}function F(e){return m()?d("useRef",{ref:{current:e}},({hook:t,isInit:r,isHMR:n})=>{if(l&&(r&&(t.dev={devtools:{get:()=>({value:t.ref.current}),set:({value:o})=>t.ref.current=o},initialArgs:[t.ref.current]}),n)){let[o]=t.dev.initialArgs;o!==e&&(t.ref={current:e},t.dev.initialArgs=[e])}return t.ref}):{current:e}}var Wa="window"in globalThis?window.__KIRU_LAZY_CACHE??(window.__KIRU_LAZY_CACHE=new Map):new Map;function Sr(e){let[t,r]=ce(e.initialState||"exited"),n=F(null);ne(()=>{e.in&&t!=="entered"&&t!=="entering"?(o("entering"),s("entered")):!e.in&&t!=="exited"&&t!=="exiting"&&(o("exiting"),s("exited"))},[e.in,t]),I(()=>()=>Er(n.current),[]);let o=ee(i=>{Er(n.current),r(i),(i==="entered"||i==="exited")&&e.onTransitionEnd&&e.onTransitionEnd(i)},[]),s=ee(i=>{n.current=window.setTimeout(()=>o(i),Mn(i,e.duration))},[e.duration]);return e.element(t)}var xr=150;function Mn(e,t){if(typeof t=="number")return t;switch(e){case"entered":return t?.in??xr;case"exited":return t?.out??xr}}function Er(e){e!=null&&window.clearTimeout(e)}"window"in globalThis;var kr=()=>f("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},f("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 $e="kiru.devtools.anchorPosition",_r={x:-16,y:-16};var Et=(e,t,r)=>{if(!t.current)return{..._r};let n=window.innerWidth/e.width,o=window.innerHeight/e.height,s=null,i=null;return e.snapSide==="left"?s=(t.current.offsetWidth-r.width.value)*-1+16:e.snapSide==="right"?s=-16:e.snapSide==="bottom"?i=-16:e.snapSide==="top"&&(i=(window.innerHeight-r.height.value)*-1+16),{x:s??e.x*n,y:i??e.y*o}},Cr=e=>{if(e==null)return null;let t=null,r=e?.__kiruNode?.parent;for(;r;){if(typeof r.type=="function"&&!gr(r)){t=r;break}r=r.parent}return t},Tr=(e,t)=>{let r=[],n=[t.__kiruNode];for(;n.length;){let s=n.pop();if(s===e)break;s?.dom&&r.push(s),s?.parent&&n.push(s.parent)}if(r.length===0)return;let o=r[r.length-1].dom;return o instanceof Element?o:void 0};var Mr={arrayChunkSize:10,objectKeysChunkSize:100};function Rr(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;let r=new Set([...Object.keys(e),...Object.keys(t)]);for(let n in r)if(typeof t[n]!=typeof e[n]||typeof e[n]=="object"&&!Rr(e[n],t[n]))return!1;return!0}var Pn={...Mr},Ar=localStorage.getItem("kiru.devtools.userSettings");if(Ar)try{let e=JSON.parse(Ar);Rr(Mr,e)&&(Pn=e)}catch(e){console.error("kiru.devtools.userSettings error",e)}var zu=vr({userSettings:null,saveUserSettings:()=>{}});var Xu=Object.freeze(()=>{});var Vn="kiru-devtools";"window"in globalThis&&(window.__devtoolsSelection??(window.__devtoolsSelection=null));var St=class extends BroadcastChannel{send(t){super.postMessage(t)}removeEventListener(t){return super.removeEventListener("message",t)}addEventListener(t){return super.addEventListener("message",t)}},O=new St(Vn);var bc=Symbol.for("devtools.hookGroup");var D=(e,t,r={})=>{I(()=>{let n=window,o=r?.ref?.();return o?n=o:r.ref&&console.warn("useEventListener ref failed, using window"),n.addEventListener(e,t,r),()=>{n.removeEventListener(e,t,r)}},[t])};var He=()=>{let e=y({x:0,y:0}),t=y({x:0,y:0}),r=y({x:0,y:0});return D("mousemove",n=>{e.value={x:n.x,y:n.y},t.value={x:n.movementX,y:n.movementY},r.value={x:n.clientX,y:n.clientY}}),{mouse:e,delta:t,client:r}};var Ie="window"in globalThis&&"ResizeObserver"in globalThis.window,Or=(e,t,r=void 0)=>m()?Ie?d("useResizeObserver",{resizeObserver:null,deps:[e.current]},({isInit:n,hook:o,queueEffect:s})=>(n&&(o.resizeObserver=new ResizeObserver(t),o.cleanup=()=>{o.resizeObserver?.disconnect?.(),o.resizeObserver=null}),s(()=>{A([e.current],o.deps)&&(o.deps=[e.current],o.resizeObserver?.disconnect?.(),e.current&&o.resizeObserver?.observe(e.current,r))}),{isSupported:Ie,start:()=>{o.resizeObserver==null&&(o.resizeObserver=new ResizeObserver(t),e.current&&o.resizeObserver.observe(e.current,r),o.cleanup=()=>{o.resizeObserver?.disconnect?.(),o.resizeObserver=null})},stop:()=>{V(o)}})):{isSupported:Ie,start:()=>{},stop:()=>{}}:{isSupported:Ie,start:()=>{},stop:()=>{}};var Fe="window"in globalThis&&"MutationObserver"in globalThis.window,Pr=(e,t,r=void 0)=>m()?Fe?d("useMutationObserver",{mutationObserver:null,deps:[e.current]},({isInit:n,hook:o,queueEffect:s})=>(n?(s(()=>{o.deps=[e.current],o.mutationObserver=new MutationObserver(t),e.current&&o.mutationObserver.observe(e.current,r)}),o.cleanup=()=>{o.mutationObserver?.disconnect?.(),o.mutationObserver=null}):A([e.current],o.deps)&&(o.deps=[e.current],o.mutationObserver?.disconnect?.(),e.current&&o.mutationObserver?.observe(e.current,r)),{isSupported:Fe,start:()=>{o.mutationObserver==null&&(o.mutationObserver=new MutationObserver(t),e.current&&o.mutationObserver.observe(e.current,r),o.cleanup=()=>{o.mutationObserver?.disconnect?.(),o.mutationObserver=null})},stop:()=>{V(o)}})):{isSupported:Fe,start:()=>{},stop:()=>{}}:{isSupported:Fe,start:()=>{},stop:()=>{}};var Ne=(e,t={windowScroll:!0,windowResize:!0})=>{let r=t?.windowScroll??!0,n=t?.windowResize??!0,o=t.immediate??!0,s=y(0),i=y(0),a=y(0),u=y(0),c=y(0),p=y(0),v=y(0),M=y(0),h=()=>{let x=e.current;if(!x){s.value=0,i.value=0,a.value=0,u.value=0,c.value=0,p.value=0,v.value=0,M.value=0;return}let b=x.getBoundingClientRect();s.value=b.width,i.value=b.height,a.value=b.top,u.value=b.right,c.value=b.bottom,p.value=b.left,v.value=b.x,M.value=b.y};return Or(e,h),Pr(e,h,{attributeFilter:["style","class"]}),D("scroll",()=>{r&&h()},{capture:!0,passive:!0}),D("resize",()=>{n&&h()},{passive:!0}),ne(()=>{o&&h()},[]),{width:s,height:i,top:a,right:u,bottom:c,left:p,x:v,y:M,update:h}};var Dr=(e,t)=>{if(!m())return{isActive:t?.immediate??!1,start:()=>null,stop:()=>null};let r=t?.fpsLimit?1e3/t.fpsLimit:null;return d("useRafFn",()=>({callback:e,refId:null,previousFrameTimestamp:0,isActive:t?.immediate??!1,rafLoop:()=>{}}),({isInit:n,hook:o,update:s})=>(o.callback=e,n&&(o.rafLoop=i=>{if(o.isActive===!1)return;o.previousFrameTimestamp||(o.previousFrameTimestamp=i);let a=i-o.previousFrameTimestamp;if(r&&a<r){o.refId=window.requestAnimationFrame(o.rafLoop);return}o.previousFrameTimestamp=i,o.callback({delta:a,timestamp:i}),o.refId=window.requestAnimationFrame(o.rafLoop)}),n&&t?.immediate&&(o.isActive=!0,o.refId=window.requestAnimationFrame(o.rafLoop),o.cleanup=()=>{o.refId!=null&&window.cancelAnimationFrame(o.refId),o.isActive=!1},s()),{isActive:o.isActive,start:()=>{o.isActive!==!0&&(o.isActive=!0,o.refId=window.requestAnimationFrame(o.rafLoop),o.cleanup=()=>{o.refId!=null&&window.cancelAnimationFrame(o.refId),o.isActive=!1},s())},stop:()=>{V(o),s()}}))};var Lr=e=>{let{x:t,y:r,multiple:n,immediate:o=!0}=e,s=y(null),a=Dr(()=>{s.value=n?document.elementsFromPoint(t,r)??[]:document.elementFromPoint(t,r)??null},{immediate:o});return{element:s,...a}};var Vr=()=>{let{mouse:e}=He(),t=y(null),r=F(null),n=F(null),o=Ne(r),s=y({x:-16,y:-16}),i=y({x:-16,y:-16}),a=y({width:window.innerWidth,height:window.innerHeight}),u=y("bottom"),c=F(null);ne(()=>{let h=localStorage.getItem($e);if(h==null)return;let x=JSON.parse(h);a.value.width=window.innerWidth,a.value.height=window.innerHeight,u.value=x.snapSide,i.value=Et(x,n,o)},[]);let p=xt(()=>{let{x:h,y:x}=e.value;if(t.value===null)return null;let{x:b,y:C}=t.value;return{x:h-b,y:x-C}});D("dragstart",h=>{h.preventDefault(),t.value={x:h.x,y:h.y},s.value=i.value},{ref:()=>r.current}),D("mouseup",()=>{c.current&&(clearTimeout(c.current),c.current=null),t.peek()&&(t.value=null,localStorage.setItem($e,JSON.stringify({...i.value,...a.value,snapSide:u.value})))});let v=ee(()=>{if(n.current==null)return;let h=n.current.offsetWidth;if(u.value==="right"){let x=Math.min(-16,i.value.y);i.value={x:-16,y:Math.max(x,(window.innerHeight-o.height.value)*-1+16)}}else if(u.value==="left"){let x=Math.min(0,i.value.y);i.value={x:(h-o.width.value)*-1+16,y:Math.max(x,(window.innerHeight-o.height.value)*-1+16)}}else if(u.value==="top"){let x=Math.min(-16,i.value.x);i.value={x:Math.max(x,(h-o.width.value)*-1+16),y:(window.innerHeight-o.height.value)*-1+16};return}else{let x=Math.min(-16,i.value.x);i.value={x:Math.max(x,(h-o.width.value)*-1+16),y:-16}}},[]);xe([p,e],(h,x)=>{if(h===null||!n.current)return;let{x:b,y:C}=x,je=n.current.offsetWidth,zr=C>=window.innerHeight-100,_t=C<=100;if(!_t&&!zr){let oe=b>window.innerWidth/2;u.value=oe?"right":"left"}else u.value=_t?"top":"bottom";if(u.value==="right"){let oe=Math.min(-16,s.value.y+h.y);i.value={x:-16,y:Math.max(oe,(window.innerHeight-o.height.value)*-1+16)};return}else if(u.value==="left"){let oe=Math.min(0,s.value.y+h.y);i.value={x:(je-o.width.value)*-1+16,y:Math.max(oe,(window.innerHeight-o.height.value)*-1+16)};return}else if(u.value==="top"){let oe=Math.min(-16,s.value.x+h.x);i.value={x:Math.max(oe,(je-o.width.value)*-1+16),y:(window.innerHeight-o.height.value)*-1+16};return}let jr=Math.min(-16,s.value.x+h.x);i.value={y:-16,x:Math.max(jr,(je-o.width.value)*-1+16)}});let M=ee(()=>{n.current!==null&&(i.value=Et({width:a.value.width,height:a.value.height,x:i.value.x,y:i.value.y,snapSide:u.value},n,o),a.value.width=window.innerWidth,a.value.height=window.innerHeight,localStorage.setItem($e,JSON.stringify({...i.value,...a.value,snapSide:u.value})))},[Math.round(o.width.value),Math.round(o.height.value)]);return D("resize",M),{anchorRef:r,anchorCoords:i,viewPortRef:n,startMouse:t,elementBound:o,snapSide:u,updateAnchorPos:v}};var N=De(!1);"window"in globalThis&&O.addEventListener(e=>{e.data.type==="set-inspect-enabled"&&(N.value=e.data.value)});var B=De(null);var $r="kiru-devtools-popup-size",ze=()=>{let e=B.value;return ee(()=>new Promise((r,n)=>{if(e)if(e.closed)B.value=null;else return e.focus(),r(e);let o=sessionStorage.getItem($r),s=o?JSON.parse(o):{width:Math.floor(Math.min(1920,window.screen.width)/2),height:Math.floor(Math.min(1080,window.screen.height)/2)},i=\`popup,width=\${s.width},height=\${s.height};\`,a=window.open(window.__KIRU_DEVTOOLS_PATHNAME__,"_blank",i);if(!a)return console.error("[kiru]: Unable to open devtools window"),n();let u=c=>{c.data.type==="ready"&&(O.removeEventListener(u),console.debug("[kiru]: devtools window opened"),r(a),B.value=a,a.onbeforeunload=()=>{console.debug("[kiru]: devtools window closed"),B.value=null})};O.addEventListener(u),a.onresize=()=>{sessionStorage.setItem($r,JSON.stringify({width:a.innerWidth,height:a.innerHeight}))}}),[e])};var Hr=()=>{let e=ze(),{mouse:t}=He(),r=Lr({x:t.value.x,y:t.value.y,immediate:!1}),n=r.element.value,o=N.value?n:null,s=Ee(()=>{if(o&&window.__kiru){let c=window.__kiru.apps.find(p=>p.rootNode==null||o.__kiruNode==null?!1:hr(p.rootNode,o.__kiruNode));return c?.rootNode==null?null:c}return null},[o]),i=Ee(()=>o?Cr(o):null,[o]),a=F(null),u=Ne(a);return I(()=>N.subscribe(p=>{r[p?"start":"stop"]()}),[]),I(()=>{i&&o?a.current=Tr(i,o)??null:a.current=null},[i,o]),D("click",c=>{if(N.value===!0&&i&&s){c.preventDefault();let p=v=>{v.__devtoolsSelection={node:i,app:s},O.send({type:"select-node"}),O.send({type:"set-inspect-enabled",value:!1}),N.value=!1,a.current=null,v.focus()};B.value?p(B.value):e().then(v=>p(v))}}),i&&f("div",{className:"bg-[crimson]/80 fixed grid place-content-center pointer-events-none z-10 top-0 left-0",style:{width:\`\${u?.width}px\`,height:\`\${u?.height}px\`,transform:\`translate(\${u.x}px, \${u.y}px)\`}},f("p",null,i.type.name))};function Ir(e){return f("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,viewBox:"0 -960 960 960",fill:"currentColor",...e},f("path",{d:"M710-150q-63 0-106.5-43.5T560-300q0-63 43.5-106.5T710-450q63 0 106.5 43.5T860-300q0 63-43.5 106.5T710-150Zm0-80q29 0 49.5-20.5T780-300q0-29-20.5-49.5T710-370q-29 0-49.5 20.5T640-300q0 29 20.5 49.5T710-230Zm-270-30H200q-17 0-28.5-11.5T160-300q0-17 11.5-28.5T200-340h240q17 0 28.5 11.5T480-300q0 17-11.5 28.5T440-260ZM250-510q-63 0-106.5-43.5T100-660q0-63 43.5-106.5T250-810q63 0 106.5 43.5T400-660q0 63-43.5 106.5T250-510Zm0-80q29 0 49.5-20.5T320-660q0-29-20.5-49.5T250-730q-29 0-49.5 20.5T180-660q0 29 20.5 49.5T250-590Zm510-30H520q-17 0-28.5-11.5T480-660q0-17 11.5-28.5T520-700h240q17 0 28.5 11.5T800-660q0 17-11.5 28.5T760-620Zm-50 320ZM250-660Z"}))}function Fr(e){return f("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-square-mouse-pointer",...e},f("path",{d:"M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z"}),f("path",{d:"M21 11V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h6"}))}var $n=()=>{N.value=!N.value,O.send({type:"set-inspect-enabled",value:N.value})};function Hn(e,t){let{damping:r}=t,n=y(e),o=F(e);return I(()=>{let s=null,i=()=>{if(Math.sqrt(Math.pow(o.current.x-n.value.x,2)+Math.pow(o.current.y-n.value.y,2))<5)return;let u=n.value.x+(o.current.x-n.value.x)*r,c=n.value.y+(o.current.y-n.value.y)*r;n.value={x:u,y:c},s=window.requestAnimationFrame(i)};return s=window.requestAnimationFrame(i),()=>{s!=null&&window.cancelAnimationFrame(s)}},[e.x,e.y]),Object.assign(n,{set:(s,i)=>{o.current=s,i?.hard&&(n.value=s)}})}function kt(){let e=y(!1),t=ze(),{anchorCoords:r,anchorRef:n,viewPortRef:o,startMouse:s,snapSide:i}=Vr(),a=i.value==="left"||i.value==="right",u=F(!1),c=Hn(r.value,{damping:.4});return xe([r],c.set),ne(()=>{u.current===!1&&c.set(r.value,{hard:!0}),u.current=!0},[]),f(Q,null,f("div",{ref:o,className:"w-full h-0 fixed top-0 left-0 z-[-9999] overflow-scroll pointer-events-none"}),f("div",{ref:n,draggable:!0,className:\`flex \${a?"flex-col":""} \${e.value?"rounded-3xl":"rounded-full"} p-1 gap-1 items-center will-change-transform bg-crimson\`,style:{transform:\`translate3d(\${Math.round(c.value.x)}px, \${Math.round(c.value.y)}px, 0)\`}},f(Sr,{in:e.value,duration:{in:40,out:150},element:p=>{if(p==="exited")return null;let v=p==="entered"?"1":"0.5",M=p==="entered"?"1":"0";return f(Q,null,f("button",{title:"Open Devtools",onclick:t,style:{transform:\`scale(\${v})\`,opacity:M},className:"transition text-white rounded-full p-1 hover:bg-[#0003]"},f(Ir,{width:16,height:16})),f("button",{title:"Toggle Component Inspection",onclick:$n,style:{transform:\`scale(\${v})\`,opacity:M},className:\`transition text-white rounded-full p-1 hover:bg-[#0003] \${N.value?"bg-[#0003]":""}\`},f(Fr,{width:16,height:16})))}}),f("button",{className:"bg-crimson rounded-full p-1"+(s.value?" pointer-events-none":""),onclick:()=>e.value=!e.value,tabIndex:-1},f(kr,null))),f(Hr,null))}var Nr=\`*, ::before, ::after {
|
|
9104
|
+
\`}function Br(e){let t=$t(e);if(l){let r=Wr(e);r&&(t=\`\${t} (\${r})\`)}return t}function $t(e){return e.displayName??(e.name||"Anonymous Function")}function Wr(e){return e.toString().match(/\\/\\/ \\[kiru_devtools\\]:(.*)/)?.[1]??null}var te={parentStack:[],childIdxStack:[],eventDeferrals:new Map,parent:function(){return this.parentStack[this.parentStack.length-1]},clear:function(){this.parentStack.length=0,this.childIdxStack.length=0},pop:function(){this.parentStack.pop(),this.childIdxStack.pop()},push:function(e){this.parentStack.push(e),this.childIdxStack.push(0)},currentChild:function(){return this.parentStack[this.parentStack.length-1].childNodes[this.childIdxStack[this.childIdxStack.length-1]]},nextChild:function(){return this.parentStack[this.parentStack.length-1].childNodes[this.childIdxStack[this.childIdxStack.length-1]++]},bumpChildIndex:function(){this.childIdxStack[this.childIdxStack.length-1]++},captureEvents:function(e){It(e,!0),this.eventDeferrals.set(e,[])},resetEvents:function(e){this.eventDeferrals.delete(e)},releaseEvents:function(e){It(e,!1);let t=this.eventDeferrals.get(e);for(;t?.length;)t.shift()()}},Gr=e=>{let t=e.target;!e.isTrusted||!t||te.eventDeferrals.get(t)?.push(()=>t.dispatchEvent(e))},It=(e,t)=>{for(let r in e)if(r.startsWith("on")){let n=r.substring(2);e[t?"addEventListener":"removeEventListener"](n,Gr,{passive:!0})}};var st=!1,rt=!1,Nt=e=>{e.preventDefault(),e.stopPropagation(),rt=!0},le=null;function Ht(){st=!0,le=document.activeElement,le&&le!==document.body&&le.addEventListener("blur",Nt)}function Ft(){rt&&(le.removeEventListener("blur",Nt),le.isConnected&&le.focus(),rt=!1),st=!1}function zt(e){let t=e.type;return t=="#text"?jt(e):Qe.has(t)?document.createElementNS("http://www.w3.org/2000/svg",t):document.createElement(t)}function jt(e){let{nodeValue:t}=e.props;if(!b.isSignal(t))return document.createTextNode(t);let r=t.peek()??"",n=document.createTextNode(r);return ot(e,n,t),n}function qr(e,t,r){let n=nt.get(e)??{},o=n[t]=i=>{if(st){i.preventDefault(),i.stopPropagation();return}r(i)};return nt.set(e,n),o}var nt=new WeakMap;function Kt(e){let{dom:t,prev:r,props:n,cleanups:o}=e,i=r?.props??{},s=n??{},a=M.current==="hydrate";if(t instanceof Text){let p=s.nodeValue;!b.isSignal(p)&&t.nodeValue!==p&&(t.nodeValue=p);return}let u=[];for(let p in i)u.push(p);for(let p in s)p in i||u.push(p);for(let p=0;p<u.length;p++){let v=u[p],f=i[v],y=s[v];if(Te.isEvent(v)){if(f!==y||a){let E=v.replace(Pt,""),U=E==="focus"||E==="blur",S=nt.get(e);v in i&&t.removeEventListener(E,U?S?.[E]:f),v in s&&t.addEventListener(E,U?qr(e,E,y):y)}continue}if(!(Te.isInternalProp(v)&&v!=="innerHTML")&&f!==y){if(b.isSignal(f)&&o){let E=o[v];E&&(E(),delete o[v])}if(b.isSignal(y)){Jr(e,t,v,y,f);continue}Ae(t,v,y,f)}}let c=i.ref,d=s.ref;c!==d&&(c&&Me(c,null),d&&Me(d,t))}function Xr(e){return e.multiple?Array.from(e.selectedOptions).map(t=>t.value):e.value}function Ut(e,t){if(!e.multiple||t===void 0||t===null||t===""){e.value=t;return}Array.from(e.options).forEach(r=>{r.selected=t.indexOf(r.value)>-1})}var Yr={value:"input",checked:"change",open:"toggle",volume:"volumechange",playbackRate:"ratechange",currentTime:"timeupdate"},Zr=["progress","meter","number","range"];function Jr(e,t,r,n,o){let i=e.cleanups??(e.cleanups={}),[s,a]=r.split(":");if(s!=="bind"){i[r]=n.subscribe((he,Ge)=>{he!==Ge&&(Ae(t,r,he,Ge),l&&window.__kiru.profilingContext?.emit("signalAttrUpdate",N(e)))});let S=n.peek(),D=J(o);if(S===D)return;Ae(t,r,S,D);return}let u=Yr[a];if(!u){l&&console.error(\`[kiru]: \${a} is not a valid element binding attribute.\`);return}let c=t instanceof HTMLSelectElement,d=c?S=>Ut(t,S):S=>t[a]=S,p=S=>{d(S),l&&window.__kiru.profilingContext?.emit("signalAttrUpdate",N(e))},v=S=>{n.sneak(S),n.notify(D=>D!==p)},f;if(a==="value"){let S=Zr.indexOf(t.type)!==-1;f=()=>{let D=t.value;c?D=Xr(t):typeof n.peek()=="number"&&S&&(D=t.valueAsNumber),v(D)}}else f=S=>{let D=S.target[a];a==="currentTime"&&n.peek()===D||v(D)};t.addEventListener(u,f);let y=n.subscribe(p);i[r]=()=>{t.removeEventListener(u,f),y()};let E=n.peek(),U=J(o);E!==U&&Ae(t,a,E,U)}function ot(e,t,r){(e.cleanups??(e.cleanups={})).nodeValue=r.subscribe((n,o)=>{n!==o&&(t.nodeValue=n,l&&window.__kiru.profilingContext?.emit("signalTextUpdate",N(e)))})}function Qr(e){if(e.type!=="#text"||!b.isSignal(e.props.nodeValue))return;let t=J(e.props.nodeValue);if(t!=null)return;let r=jt(e);return te.parent().appendChild(r),r}function Bt(e){let t=te.nextChild()??Qr(e);if(!t)throw new k({message:"Hydration mismatch - no node found",vNode:e});let r=t.nodeName;if(Qe.has(r)||(r=r.toLowerCase()),e.type!==r)throw new k({message:\`Hydration mismatch - expected node of type \${e.type.toString()} but received \${r}\`,vNode:e});if(e.dom=t,e.type!=="#text"&&!(e.flags&I)){Kt(e);return}b.isSignal(e.props.nodeValue)&&ot(e,t,e.props.nodeValue);let n=e,o=e.sibling;for(;o&&o.type==="#text";){let i=o;te.bumpChildIndex();let s=String(J(n.props.nodeValue)??""),a=n.dom.splitText(s.length);i.dom=a,b.isSignal(i.props.nodeValue)&&ot(i,a,i.props.nodeValue),n=o,o=o.sibling}}function Wt(e,t,r,n=!1){if(r===null)return e.removeAttribute(t),!0;switch(typeof r){case"undefined":case"function":case"symbol":return e.removeAttribute(t),!0;case"boolean":if(n&&!r)return e.removeAttribute(t),!0}return!1}function en(e,t,r){let n=et.has(t);Wt(e,t,r,n)||e.setAttribute(t,n&&typeof r=="boolean"?"":String(r))}var tn=["INPUT","TEXTAREA"],rn=e=>tn.indexOf(e.nodeName)>-1;function Ae(e,t,r,n){switch(t){case"style":return sn(e,r,n);case"className":return on(e,r);case"innerHTML":return nn(e,r);case"muted":e.muted=!!r;return;case"value":if(e.nodeName==="SELECT")return Ut(e,r);let o=r==null?"":String(r);if(rn(e)){e.value=o;return}e.setAttribute("value",o);return;case"checked":if(e.nodeName==="INPUT"){e.checked=!!r;return}e.setAttribute("checked",String(r));return;default:return en(e,Jt(t),r)}}function nn(e,t){if(t==null||typeof t=="boolean"){e.innerHTML="";return}e.innerHTML=String(t)}function on(e,t){let r=J(t);if(!r)return e.removeAttribute("class");e.setAttribute("class",r)}function sn(e,t,r){if(Wt(e,"style",t))return;if(typeof t=="string"){e.setAttribute("style",t);return}let n={};typeof r=="string"?e.setAttribute("style",""):typeof r=="object"&&r&&(n=r);let o=t;new Set([...Object.keys(n),...Object.keys(o)]).forEach(s=>{let a=n[s],u=o[s];if(a!==u){if(u===void 0){e.style[s]="";return}e.style[s]=u}})}function an(e){let t=e.parent,r=t?.dom;for(;t&&!r;)t=t.parent,r=t?.dom;if(!r||!t){if(!e.parent&&e.dom)return e;throw new k({message:"No DOM parent found while attempting to place node.",vNode:e})}return t}function ln(e,t){let{node:r,lastChild:n}=t,o=e.dom;if(n){n.after(o);return}let i=Gt(e,r);if(i){r.dom.insertBefore(o,i);return}r.dom.appendChild(o)}function Gt(e,t){let r=e;for(;r;){let n=r.sibling;for(;n;){if(!(n.flags&(L|I))){let o=un(n);if(o?.isConnected)return o}n=n.sibling}if(r=r.parent,!r||r.flags&I||r===t)return}}function un(e){let t=e;for(;t;){if(t.dom)return t.dom;if(t.flags&I)return;t=t.child}}function qt(e){if(M.current==="hydrate")return Q(e,be);let t={node:e.dom?e:an(e)};it(e,t,(e.flags&L)>0),e.dom&&!(e.flags&I)&&Xt(e,t,!1),be(e)}function it(e,t,r){let n=e.child;for(;n;){if(n.flags&we){n.flags&L&&cn(n,t),be(n),n=n.sibling;continue}n.dom?(it(n,{node:n},!1),n.flags&I||Xt(n,t,r)):it(n,t,(n.flags&L)>0||r),be(n),n=n.sibling}}function Xt(e,t,r){(r||!e.dom.isConnected||e.flags&L)&&ln(e,t),(!e.prev||e.flags&P)&&Kt(e),t.lastChild=e.dom}function Yt(e){e===e.parent?.child&&(e.parent.child=e.sibling);let t;l&&(t=N(e)),Q(e,r=>{let{hooks:n,subs:o,cleanups:i,dom:s,props:{ref:a}}=r;for(o?.forEach(u=>u()),i&&Object.values(i).forEach(u=>u());n?.length;)n.pop().cleanup?.();l&&(window.__kiru.profilingContext?.emit("removeNode",t),s instanceof Element&&delete s.__kiruNode),s&&(s.isConnected&&!(r.flags&I)&&s.remove(),a&&Me(a,null),delete r.dom)}),e.parent=null}function cn(e,t){if(!e.child)return;let r=[];if(Zt(e.child,r),r.length===0)return;let{node:n,lastChild:o}=t;if(o)o.after(...r);else{let i=Gt(e,n),s=n.dom;i?i.before(...r):s.append(...r)}t.lastChild=r[r.length-1]}function Zt(e,t){let r=e;for(;r;)r.dom?t.push(r.dom):r.child&&Zt(r.child,t),r=r.sibling}function m(e,t=null,...r){e===ue&&(e=T);let n=t===null?{}:t,o=at(n.key),i=r.length;return i===1?n.children=r[0]:i>1&&(n.children=r),{type:e,key:o,props:n}}function ue({children:e,key:t}){return{type:T,key:at(t),props:{children:e}}}function lt(e){return typeof e=="function"&&typeof e[_e]?.arePropsEqual=="function"}function Re(e,t=null,r={},n=null,o=0){e===ue&&(e=T);let i=t?t.depth+1:0;return{type:e,key:n,props:r,parent:t,index:o,depth:i,flags:0,child:null,sibling:null,prev:null,deletions:null}}var ft;function Pe(e,t){return l&&(ft=N(e)),Array.isArray(t)?(l&&(ir in t&&gn(e,t),mn(e,t)),pn(e,t)):fn(e,t)}function fn(e,t){let r=e.child;if(r===null)return rr(e,t);let n=r.sibling,o=er(e,r,t);if(o!==null)return r&&r!==o&&!o.prev?ct(e,r):n&&ct(e,n),o;{let i=sr(r),s=nr(i,e,0,t);if(s!==null){let a=s.prev;if(a!==null){let u=a.key;i.delete(u===null?a.index:u)}De(s,0,0)}return i.forEach(a=>Oe(e,a)),s}}function pn(e,t){let r=null,n=null,o=e.child,i=null,s=0,a=0;for(;o!==null&&a<t.length;a++){o.index>a?(i=o,o=null):i=o.sibling;let c=er(e,o,t[a]);if(c===null){o===null&&(o=i);break}o&&!c.prev&&Oe(e,o),s=De(c,s,a),n===null?r=c:n.sibling=c,n=c,o=i}if(a===t.length)return ct(e,o),r;if(o===null){for(;a<t.length;a++){let c=rr(e,t[a]);c!==null&&(s=De(c,s,a),n===null?r=c:n.sibling=c,n=c)}return r}let u=sr(o);for(;a<t.length;a++){let c=nr(u,e,a,t[a]);if(c!==null){let d=c.prev;if(d!==null){let p=d.key;u.delete(p===null?d.index:p)}s=De(c,s,a),n===null?r=c:n.sibling=c,n=c}}return u.forEach(c=>Oe(e,c)),r}function er(e,t,r){let n=t===null?null:t.key;return Le(r)?n!==null||t?.type==="#text"&&b.isSignal(t.props.nodeValue)?null:Qt(e,t,""+r):b.isSignal(r)?t&&t.props.nodeValue!==r?null:Qt(e,t,r):pe(r)?r.key!==n?null:dn(e,t,r):Array.isArray(r)?n!==null?null:(l&&pt(r),tr(e,t,r)):null}function Qt(e,t,r){return t===null||t.type!=="#text"?W(e,"#text",{nodeValue:r}):(l&&ye(),t.props.nodeValue!==r&&(t.props.nodeValue=r,t.flags|=P),t.sibling=null,t)}function dn(e,t,r){let{type:n,props:o,key:i}=r;return l&&typeof n=="function"&&(n=_(n)),n===T?tr(e,t,o.children||[],o):t?.type===n?(l&&ye(),t.index=0,t.sibling=null,typeof n=="string"?or(t.props,o)&&(t.flags|=P):t.flags|=P,t.props=o,t):W(e,n,o,i)}function tr(e,t,r,n={}){return t===null||t.type!==T?W(e,T,{children:r,...n}):(l&&ye(),t.props={...t.props,...n,children:r},t.flags|=P,t.sibling=null,t)}function rr(e,t){return Le(t)?W(e,"#text",{nodeValue:""+t}):b.isSignal(t)?W(e,"#text",{nodeValue:t}):pe(t)?W(e,t.type,t.props,t.key):Array.isArray(t)?(l&&pt(t),W(e,T,{children:t})):null}function De(e,t,r){e.index=r;let n=e.prev;if(n!==null){let o=n.index;return o<t?(e.flags|=L,t):o}else return e.flags|=L,t}function nr(e,t,r,n){if(b.isSignal(n)||Le(n)){let i=e.get(r);if(i){if(i.props.nodeValue===n)return i;i.type==="#text"&&b.isSignal(i.props.nodeValue)&&i.cleanups?.nodeValue?.()}return W(t,"#text",{nodeValue:n},null,r)}if(pe(n)){let{type:i,props:s,key:a}=n,u=e.get(a===null?r:a);return u?.type===i?(l&&ye(),typeof i=="string"?or(u.props,s)&&(u.flags|=P):u.flags|=P,u.props=s,u.sibling=null,u.index=r,u):W(t,i,s,a,r)}if(Array.isArray(n)){let i=e.get(r);return l&&pt(n),i?(l&&ye(),i.flags|=P,i.props.children=n,i):W(t,T,{children:n},null,r)}return null}function or(e,t){let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!0;for(let o of r)if(!(o==="children"||o==="key")&&e[o]!==t[o])return!0;return!1}function ye(){"window"in globalThis&&window.__kiru.profilingContext?.emit("updateNode",ft)}var ir=Symbol("kiru:marked-list-child");function pt(e){Object.assign(e,{[ir]:!0})}function sr(e){let t=new Map;for(;e;){let r=e.key;t.set(r===null?e.index:r,e),e=e.sibling}return t}function Oe(e,t){e.deletions===null?e.deletions=[t]:e.deletions.push(t)}function ct(e,t){for(;t;)Oe(e,t),t=t.sibling}function mn(e,t){let r=new Set,n=!1;for(let o of t){if(!pe(o))continue;let i=o.key;if(typeof i=="string"){if(!n&&r.has(i)){let s=lr(e);ar(\`\${s} component produced a child in a list with a duplicate key prop: "\${i}". Keys should be unique so that components maintain their identity across updates\`),n=!0}r.add(i)}}}function gn(e,t){let r=!1,n=!1;for(let o of t)pe(o)&&(typeof o.key=="string"?r=!0:n=!0);if(n&&r){let o=lr(e);ar(\`\${o} component produced a child in a list without a valid key prop\`)}}function ar(e){let t=\`[kiru]: \${e}. See https://kirujs.dev/keys-warning for more information.\`;console.error(t)}var ut=new WeakMap;function lr(e){if(ut.has(e))return ut.get(e);let t=e.parent,r;for(;!r&&t;)typeof t.type=="function"&&(r=t.type),t=t.parent;let n=\`<\${r?.displayName||r?.name||"Anonymous Function"} />\`;return ut.set(e,n),n}function W(e,t,r,n=null,o=0){let i=Re(t,e,r,n,o);return i.flags|=L,typeof t=="function"&<(t)&&(i.flags|=Ce,i.arePropsEqual=t[_e].arePropsEqual),l&&"window"in globalThis&&window.__kiru.profilingContext?.emit("createNode",ft),i}var G,q=[],de=!1,mt=[],Ve=[],gt=!1,ht=!1,wt=!1,bt=0,ur=[],yt=[],cr=-1;function xt(e){if(de){mt.push(e);return}e()}function $e(){de&&(window.cancelAnimationFrame(cr),fr())}function Et(e){e.flags|=ae,q.push(e),de=!0,$e()}function O(e){if(M.current==="hydrate")return xt(()=>vt(e));vt(e)}function hn(){de||(de=!0,cr=window.requestAnimationFrame(fr))}function wn(){for(de=!1;mt.length;)mt.shift()()}function vt(e){if(gt&&(ht=!0),C.current===e){l&&window.__kiru.profilingContext?.emit("updateDirtied",G),wt=!0;return}if(!(e.flags&(ae|fe))){if(e.flags|=ae,!q.length)return q.push(e),hn();q.push(e)}}function bn(e){Q(e,t=>t.flags|=fe),Ve.push(e)}var yn=(e,t)=>t.depth-e.depth,re=null;function fr(){if(l){let t=Ve[0]??q[0];t?(G=N(t),window.__kiru.profilingContext?.beginTick(G)):G=null}let e=1;for(Ht();q.length;){q.length>e&&q.sort(yn),re=q.shift(),e=q.length;let t=re.flags;if(!(t&fe)&&t&ae){let r=re;for(;r=vn(r););for(;Ve.length;)Yt(Ve.pop());qt(re),re.flags&=~ae}}if(Ft(),gt=!0,dt(ur),gt=!1,ht)return kn(),dt(yt),ht=!1,bt++,l&&(window.__kiru.profilingContext?.endTick(G),window.__kiru.profilingContext?.emit("updateDirtied",G)),$e();bt=0,wn(),dt(yt),l&&(window.__kiru.emit("update",G),window.__kiru.profilingContext?.emit("update",G),window.__kiru.profilingContext?.endTick(G))}function vn(e){let t=!0;try{typeof e.type=="string"?Sn(e):St(e.type)?xn(e):t=En(e)}catch(n){l&&window.__kiru.emit("error",G,n instanceof Error?n:new Error(String(n)));let o=pr(e);if(o){let i=o.error=n instanceof Error?n:new Error(String(n));return o.props.onError?.(i),o.depth<re.depth&&(re=o),o}if(k.isKiruError(n)){if(n.customNodeStack&&setTimeout(()=>{throw new Error(n.customNodeStack)}),n.fatal)throw n;console.error(n);return}setTimeout(()=>{throw n})}if(e.deletions!==null&&(e.deletions.forEach(bn),e.deletions=null),t&&e.child)return e.child;let r=e;for(;r;){if(r.immediateEffects&&(ur.push(...r.immediateEffects),r.immediateEffects=void 0),r.effects&&(yt.push(...r.effects),r.effects=void 0),r===re)return;if(r.sibling)return r.sibling;r=r.parent,M.current==="hydrate"&&r?.dom&&te.pop()}}function xn(e){let{props:t,type:r}=e,n=t.children;if(r===ie){let{props:{dependents:o,value:i},prev:s}=e;o.size&&s&&s.props.value!==i&&o.forEach(vt)}else if(r===se){let o=e,{error:i}=o;i&&(n=typeof t.fallback=="function"?t.fallback(i):t.fallback,delete o.error)}e.child=Pe(e,n)}function En(e){let{type:t,props:r,subs:n,prev:o,flags:i}=e;if(i&Ce){if(e.memoizedProps=r,o?.memoizedProps&&e.arePropsEqual(o.memoizedProps,r)&&!e.hmrUpdated)return e.flags|=we,!1;e.flags&=~we}try{C.current=e;let s,a=0;do{if(e.flags&=~ae,wt=!1,Z.current=0,n&&(n.forEach(u=>u()),n.clear()),l){if(s=_(t)(r),e.hmrUpdated&&e.hooks&&e.hookSig){let u=e.hooks.length;if(Z.current<u){for(let c=Z.current;c<u;c++)e.hooks[c].cleanup?.();e.hooks.length=Z.current,e.hookSig.length=Z.current}}if(delete e.hmrUpdated,++a>Je)throw new k({message:"Too many re-renders. Kiru limits the number of renders to prevent an infinite loop.",fatal:!0,vNode:e});continue}s=t(r)}while(wt);return e.child=Pe(e,s),!0}finally{C.current=null}}function Sn(e){let{props:t,type:r}=e;l&&kt(e),e.dom||(M.current==="hydrate"?Bt(e):e.dom=zt(e),l&&e.dom instanceof Element&&(e.dom.__kiruNode=e)),r!=="#text"&&(e.child=Pe(e,t.children),e.child&&M.current==="hydrate"&&te.push(e.dom))}function kn(){if(bt>Je)throw new k("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 dt(e){for(let t=0;t<e.length;t++)e[t]();e.length=0}var dr;(function(e){e.Start="start",e.End="end"})(dr||(dr={}));var me=null,mr=new Set;function h(e,t,r){let n=_n(e);if(l&&me!==null&&!mr.has(e+me))throw mr.add(e+me),new k({message:\`Nested primitive "useHook" calls are not supported. "\${e}" was called inside "\${me}". Strange will most certainly happen.\`,vNode:n});let o=(a,u)=>{if(u?.immediate){(n.immediateEffects??(n.immediateEffects=[])).push(a);return}(n.effects??(n.effects=[])).push(a)},i=Z.current++,s=n.hooks?.at(i);if(l){me=e,n.hooks??(n.hooks=[]),n.hookSig??(n.hookSig=[]),n.hookSig[i]?n.hookSig[i]!==e&&(console.warn(\`[kiru]: hooks must be called in the same order. Hook "\${e}" was called in place of "\${n.hookSig[i]}". Strange things may happen.\`),s?.cleanup?.(),n.hooks.length=i,n.hookSig.length=i,s=void 0):n.hookSig[i]=e;let a;s?a=s:(a=typeof t=="function"?t():{...t},a.name=e),n.hooks[i]=a;try{return r({hook:a,isInit:!s,isHMR:n.hmrUpdated,update:()=>O(n),queueEffect:o,vNode:n,index:i})}catch(u){throw u}finally{me=null}}try{let a=s??(typeof t=="function"?t():{...t});return n.hooks??(n.hooks=[]),n.hooks[i]=a,r({hook:a,isInit:!s,update:()=>O(n),queueEffect:o,vNode:n,index:i})}catch(a){throw a}}function _n(e){let t=C.current;if(!t)throw new k(\`Hook "\${e}" must be used at the top level of a component or inside another composite hook.\`);return t}function H(e){e.cleanup&&(e.cleanup(),e.cleanup=void 0)}function A(e,t){return e===void 0||t===void 0||e.length!==t.length||e.length>0&&t.some((r,n)=>!Object.is(r,e[n]))}var ve={stack:new Array,current:function(){return this.stack[this.stack.length-1]}},F=new Map,z=new Map;var gr,b=class e{constructor(t,r){this[gr]=!0,this.$id=Ne(),this.$value=t,r&&(this.displayName=r),l?(z.set(this.$id,new Set),this.$initialValue=_t(t),this[Y]={provide:()=>this,inject:n=>{z.get(this.$id)?.clear?.(),z.delete(this.$id),this.$id=n.$id,n.__next=this,this.$initialValue===n.$initialValue?this.$value=n.$value:this.notify()},destroy:()=>{}}):this.$subs=new Set}get value(){if(this.onBeforeRead?.(),l){let t=_(this);return e.entangle(t),t.$value}return e.entangle(this),this.$value}set value(t){if(l){let r=_(this);if(Object.is(r.$value,t))return;r.$prevValue=r.$value,r.$value=t,r.notify();return}Object.is(this.$value,t)||(this.$prevValue=this.$value,this.$value=t,this.notify())}peek(){return this.onBeforeRead?.(),l?_(this).$value:this.$value}sneak(t){if(l){let r=_(this);r.$prevValue=r.$value,r.$value=t;return}this.$prevValue=this.$value,this.$value=t}toString(){if(this.onBeforeRead?.(),l){let t=_(this);return e.entangle(t),\`\${t.$value}\`}return e.entangle(this),\`\${this.$value}\`}subscribe(t){return l?(z.get(this.$id).add(t),()=>z.get(this.$id)?.delete(t)):(this.$subs.add(t),()=>this.$subs.delete(t))}notify(t){if(l)return z.get(this.$id)?.forEach(r=>{if(t&&!t(r))return;let{$value:n,$prevValue:o}=_(this);return r(n,o)});this.$subs.forEach(r=>{if(!(t&&!t(r)))return r(this.$value,this.$prevValue)})}static isSignal(t){return typeof t=="object"&&!!t&&Xe in t}static subscribers(t){return l?z.get(t.$id):t.$subs}static makeReadonly(t){let r=Object.getOwnPropertyDescriptor(t,"value");return r&&!r.writable?t:Object.defineProperty(t,"value",{get:function(){return e.entangle(this),this.$value},configurable:!0})}static makeWritable(t){let r=Object.getOwnPropertyDescriptor(t,"value");return r&&r.writable?t:Object.defineProperty(t,"value",{get:function(){return e.entangle(this),this.$value},set:function(n){this.$value=n,this.notify()},configurable:!0})}static entangle(t){let r=C.current,n=ve.current();if(n){(!r||r&&g())&&n.set(t.$id,t);return}if(!r||!g())return;let o=t.subscribe(()=>O(r));(r.subs??(r.subs=new Set)).add(o)}static configure(t,r){t.onBeforeRead=r}static dispose(t){if(t.$isDisposed=!0,l){z.delete(t.$id);return}t.$subs.clear()}};gr=Xe;var Ie=(e,t)=>new b(e,t),x=(e,t)=>h("useSignal",{signal:null},({hook:r,isInit:n,isHMR:o})=>{if(l&&(n&&(r.dev={devtools:{get:()=>({displayName:r.signal.displayName,value:r.signal.peek()}),set:({value:i})=>{r.signal.value=i}},initialArgs:[e,t]}),o)){let[i,s]=r.dev.initialArgs;(i!==e||s!==t)&&(r.cleanup?.(),n=!0,r.dev.initialArgs=[e,t])}return n&&(r.cleanup=()=>b.dispose(r.signal),r.signal=new b(e,t)),r.signal});function J(e,t=!1){return b.isSignal(e)?t?e.value:e.peek():e}var Ct=()=>{F.forEach(e=>e()),F.clear()};var hr=new Set(["children","ref","key","innerHTML"]),Te={isInternalProp:e=>hr.has(e),isEvent:e=>e.startsWith("on"),isStringRenderableProperty:e=>!hr.has(e)&&!Te.isEvent(e)};function Jt(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():Lt.get(e)||e}}function _t(e,t={functions:!0}){let r=new WeakSet;return JSON.stringify(e,(n,o)=>{if(typeof o=="object"&&o!==null){if(r.has(o))return"[CIRCULAR]";r.add(o)}return typeof o=="function"?t.functions?o.toString():\`[FUNCTION (\${o.name||"anonymous"})]\`:o})}var B=Object.freeze(()=>{});function _(e){let t=e;if(l)for(;"__next"in t;)t=t.__next;return t}function Me(e,t){if(typeof e=="function"){e(t);return}if(b.isSignal(e)){e.value=t;return}e.current=t}function g(){return M.current==="dom"||M.current==="hydrate"}function pe(e){return typeof e=="object"&&e!==null&&"type"in e}function Le(e){return typeof e=="string"&&e!==""||typeof e=="number"||typeof e=="bigint"}function St(e){return e===T||e===ie||e===se}function wr(e){return e.type===T}function N(e){let t=e;for(;t;){if(t.app)return e.app=t.app;t=t.parent}return null}function be(e){let{props:{children:t,...r},key:n,memoizedProps:o,index:i}=e;e.prev={props:r,key:n,memoizedProps:o,index:i},e.flags&=~(P|L|fe)}function br(e,t){if(t.depth<e.depth)return!1;if(e===t)return!0;let r=!1,n=[e];for(;n.length;){let o=n.pop();if(o===t)return!0;o.child&&n.push(o.child),r&&o.sibling&&n.push(o.sibling),r=!0}return!1}function Q(e,t){t(e);let r=e.child;for(;r;)t(r),r.child&&Q(r,t),r=r.sibling}function tt(e,t){let r=e.parent;for(;r;){if(t(r))return r;r=r.parent}return null}function pr(e){return tt(e,t=>t.type===se)}function kt(e){if("children"in e.props&&e.props.innerHTML)throw new k({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 k({message:\`Cannot use both bind:\${t} and \${t} on an element\`,vNode:e})}function at(e){return e===void 0?null:typeof e=="string"||typeof e=="number"?e:null}var Cn="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz-";function Ne(e=10,t=Cn){let r="";for(let n=0;n<e;n++)r+=t[Math.random()*t.length|0];return r}function He(e){let{id:t,subs:r,fn:n,deps:o=[],onDepChanged:i}=e,s;F.delete(t);let a=!!C.current&&!g();a||(s=new Map,ve.stack.push(s));let u=n(...o.map(c=>c.value));if(!a){for(let[d,p]of r)s.has(d)||(p(),r.delete(d));let c=()=>{F.size||queueMicrotask(Ct),F.set(t,i)};for(let[d,p]of s){if(r.has(d))continue;let v=p.subscribe(c);r.set(d,v)}ve.stack.pop()}return u}var ge=class e extends b{constructor(t,r){if(super(void 0,r),this.$getter=t,this.$unsubs=new Map,this.$isDirty=!0,l){let n=this[Y].inject;this[Y]={provide:()=>this,inject:o=>{n(o),e.stop(o),this.$isDirty=o.$isDirty},destroy:()=>{}}}b.configure(this,()=>{this.$isDirty&&(l&&this.$isDisposed||e.run(this))})}get value(){return super.value}set value(t){}subscribe(t){return this.$isDirty&&e.run(this),super.subscribe(t)}static dispose(t){e.stop(t),b.dispose(t)}static updateGetter(t,r){let n=_(t);n.$getter=r,n.$isDirty=!0,e.run(n),!Object.is(n.$value,n.$prevValue)&&n.notify()}static stop(t){let{$id:r,$unsubs:n}=_(t);F.delete(r),n.forEach(o=>o()),n.clear(),t.$isDirty=!0}static run(t){let r=_(t),{$id:n,$getter:o,$unsubs:i}=r,s=He({id:n,subs:i,fn:()=>o(r.$value),onDepChanged:()=>{if(r.$isDirty=!0,l){if(!z?.get(n)?.size)return}else if(!t.$subs.size)return;e.run(r),!Object.is(r.$value,r.$prevValue)&&r.notify()}});r.sneak(s),r.$isDirty=!1}};function yr(e,t){return new ge(e,t)}function At(e,t,r){return h("useComputedSignal",{signal:null,deps:void 0},({hook:n,isInit:o,isHMR:i})=>(l&&(n.dev={devtools:{get:()=>({displayName:n.signal.displayName,value:n.signal.peek()})}},i&&(n.cleanup?.(),o=!0)),o?(typeof t=="string"&&(r=t,t=void 0),n.deps=t,n.cleanup=()=>ge.dispose(n.signal),n.signal=yr(e,r)):n.deps&&typeof t!="string"&&A(n.deps,t)&&(n.deps=t,ge.updateGetter(n.signal,e)),n.signal))}var xe=class e{constructor(t,r){if(this.id=Ne(),this.getter=t,this.deps=r,this.unsubs=new Map,this.isRunning=!1,this.cleanup=null,l&&"window"in globalThis){let n=window.__kiru.HMRContext.signals;n.isWaitingForNextWatchCall()&&n.pushWatch(this)}this.start()}start(){if(!this.isRunning){if(this.isRunning=!0,l&&"window"in globalThis&&window.__kiru.HMRContext?.isReplacement())return queueMicrotask(()=>{this.isRunning&&e.run(this)});e.run(this)}}stop(){F.delete(this.id),this.unsubs.forEach(t=>t()),this.unsubs.clear(),this.cleanup?.(),this.cleanup=null,this.isRunning=!1}static run(t){let r=_(t),{id:n,getter:o,unsubs:i,deps:s}=r;r.cleanup=He({id:n,subs:i,fn:o,deps:s,onDepChanged:()=>{r.cleanup?.(),e.run(r)}})??null}};function vr(e,t){if(typeof e=="function")return new xe(e);let r=e,n=t;return new xe(n,r)}function Ee(e,t){if(g())return h("useWatch",{watcher:null},({hook:r,isInit:n,isHMR:o})=>{if(l&&o&&(r.cleanup?.(),n=!0),n){let i=r.watcher=vr(e,t);r.cleanup=()=>i.stop()}return r.watcher})}var An=0;function xr(e,t,r){if(l&&t.__kiruNode)throw new Error("[kiru]: container in use - call unmount on the previous app first.");let n=Tn(t),o=An++,i={id:o,name:r?.name??\`App-\${o}\`,rootNode:n,render:s,unmount:a};function s(u){n.props.children=u,Et(n)}function a(){n.props.children=null,Et(n),l&&(delete t.__kiruNode,delete n.app),window.__kiru.emit("unmount",i)}return l&&(n.app=i),s(e),window.__kiru.emit("mount",i,O),l&&queueMicrotask(()=>{window.dispatchEvent(new Event("kiru:ready"))}),i}function Tn(e){let t=Re(e.nodeName.toLowerCase());return t.flags|=I,t.dom=e,l&&(e.__kiruNode=t),t}function ce(e){return g()?h("useState",{state:void 0,dispatch:B},({hook:t,isInit:r,update:n,isHMR:o})=>{if(l&&(r&&(t.dev={devtools:{get:()=>({value:t.state}),set:({value:i})=>t.state=i},initialArgs:[e]}),o)){let[i]=t.dev.initialArgs;i!==e&&(r=!0,t.dev.initialArgs=[e])}return r&&(t.state=typeof e=="function"?e():e,t.dispatch=i=>{let s=typeof i=="function"?i(t.state):i;Object.is(t.state,s)||(t.state=s,n())}),[t.state,t.dispatch]}):[typeof e=="function"?e():e,B]}function Er(e){let t={[Dt]:!0,Provider:({value:r,children:n})=>{let[o]=ce(()=>new Set);return m(ie,{value:r,ctx:t,dependents:o},typeof n=="function"?n(r):n)},default:()=>e,set displayName(r){this.Provider.displayName=r},get displayName(){return this.Provider.displayName||"Anonymous Context"}};if(l){let r=t;r[Y]={inject:n=>{let o=t.Provider;window.__kiru.apps.forEach(i=>{Q(i.rootNode,s=>{s.type===n.Provider&&(s.type=o,s.hmrUpdated=!0,O(s))})})},destroy:()=>{},provide:()=>t}}return t}function ee(e,t){return g()?h("useCallback",{callback:e,deps:t},({hook:r,isHMR:n})=>(l&&(r.dev={devtools:{get:()=>({callback:r.callback,dependencies:r.deps})}},n&&(r.deps=[])),A(t,r.deps)&&(r.deps=t,r.callback=e),r.callback)):e}function j(e,t){if(g())return h("useEffect",{deps:t},({hook:r,isInit:n,isHMR:o,queueEffect:i})=>{l&&(r.dev={devtools:{get:()=>({callback:e,dependencies:r.deps})}},o&&(n=!0)),(n||A(t,r.deps))&&(r.deps=t,H(r),i(()=>{let s=e();typeof s=="function"&&(r.cleanup=s)}))})}function ne(e,t){if(g())return h("useLayoutEffect",{deps:t},({hook:r,isInit:n,isHMR:o,queueEffect:i})=>{l&&(r.dev={devtools:{get:()=>({callback:e,dependencies:r.deps})}},o&&(n=!0)),(n||A(t,r.deps))&&(r.deps=t,H(r),i(()=>{let s=e();typeof s=="function"&&(r.cleanup=s)},{immediate:!0}))})}function Se(e,t){return g()?h("useMemo",{deps:t,value:void 0},({hook:r,isInit:n,isHMR:o})=>(l&&(r.dev={devtools:{get:()=>({value:r.value,dependencies:r.deps})}},o&&(n=!0)),(n||A(t,r.deps))&&(r.deps=t,r.value=e()),r.value)):e()}function V(e){return g()?h("useRef",{ref:{current:e}},({hook:t,isInit:r,isHMR:n})=>{if(l&&(r&&(t.dev={devtools:{get:()=>({value:t.ref.current}),set:({value:o})=>t.ref.current=o},initialArgs:[t.ref.current]}),n)){let[o]=t.dev.initialArgs;o!==e&&(t.ref={current:e},t.dev.initialArgs=[e])}return t.ref}):{current:e}}var sl="window"in globalThis?window.__KIRU_LAZY_CACHE??(window.__KIRU_LAZY_CACHE=new Map):new Map;function _r(e){let[t,r]=ce(e.initialState||"exited"),n=V(null);ne(()=>{e.in&&t!=="entered"&&t!=="entering"?(o("entering"),i("entered")):!e.in&&t!=="exited"&&t!=="exiting"&&(o("exiting"),i("exited"))},[e.in,t]),j(()=>()=>kr(n.current),[]);let o=ee(s=>{kr(n.current),r(s),(s==="entered"||s==="exited")&&e.onTransitionEnd&&e.onTransitionEnd(s)},[]),i=ee(s=>{n.current=window.setTimeout(()=>o(s),Dn(s,e.duration))},[e.duration]);return e.element(t)}var Sr=150;function Dn(e,t){if(typeof t=="number")return t;switch(e){case"entered":return t?.in??Sr;case"exited":return t?.out??Sr}}function kr(e){e!=null&&window.clearTimeout(e)}"window"in globalThis;var Cr=()=>m("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},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 Fe="kiru.devtools.anchorPosition",Ar={x:-16,y:-16};var Tt=(e,t,r)=>{if(!t.current)return{...Ar};let n=window.innerWidth/e.width,o=window.innerHeight/e.height,i=null,s=null;return e.snapSide==="left"?i=(t.current.offsetWidth-r.width.value)*-1+16:e.snapSide==="right"?i=-16:e.snapSide==="bottom"?s=-16:e.snapSide==="top"&&(s=(window.innerHeight-r.height.value)*-1+16),{x:i??e.x*n,y:s??e.y*o}},Tr=e=>{if(e==null)return null;let t=null,r=e?.__kiruNode?.parent;for(;r;){if(typeof r.type=="function"&&!wr(r)){t=r;break}r=r.parent}return t},Mr=(e,t)=>{let r=[],n=[t.__kiruNode];for(;n.length;){let i=n.pop();if(i===e)break;i?.dom&&r.push(i),i?.parent&&n.push(i.parent)}if(r.length===0)return;let o=r[r.length-1].dom;return o instanceof Element?o:void 0};function ze(e,t){if(!e)throw new Error(t)}var Dr={arrayChunkSize:10,objectKeysChunkSize:100};function Or(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;let r=new Set([...Object.keys(e),...Object.keys(t)]);for(let n in r)if(typeof t[n]!=typeof e[n]||typeof e[n]=="object"&&!Or(e[n],t[n]))return!1;return!0}var Ln={...Dr},Rr=localStorage.getItem("kiru.devtools.userSettings");if(Rr)try{let e=JSON.parse(Rr);Or(Dr,e)&&(Ln=e)}catch(e){console.error("kiru.devtools.userSettings error",e)}var ec=Er({userSettings:null,saveUserSettings:()=>{}});var lc=Object.freeze(()=>{});var In="kiru-devtools";"window"in globalThis&&(window.__devtoolsSelection??(window.__devtoolsSelection=null),window.__devtoolsNodeUpdatePtr??(window.__devtoolsNodeUpdatePtr=null));var Mt=class extends BroadcastChannel{send(t){super.postMessage(t)}removeEventListener(t){return super.removeEventListener("message",t)}addEventListener(t){return super.addEventListener("message",t)}},R=new Mt(In);var Oc=Symbol.for("devtools.hookGroup");var $=(e,t,r={})=>{j(()=>{let n=window,o=r?.ref?.();return o?n=o:r.ref&&console.warn("useEventListener ref failed, using window"),n.addEventListener(e,t,r),()=>{n.removeEventListener(e,t,r)}},[t])};var je=()=>{let e=x({x:0,y:0}),t=x({x:0,y:0}),r=x({x:0,y:0});return $("mousemove",n=>{e.value={x:n.x,y:n.y},t.value={x:n.movementX,y:n.movementY},r.value={x:n.clientX,y:n.clientY}}),{mouse:e,delta:t,client:r}};var Ke="window"in globalThis&&"ResizeObserver"in globalThis.window,Pr=(e,t,r=void 0)=>g()?Ke?h("useResizeObserver",{resizeObserver:null,deps:[e.current]},({isInit:n,hook:o,queueEffect:i})=>(n&&(o.resizeObserver=new ResizeObserver(t),o.cleanup=()=>{o.resizeObserver?.disconnect?.(),o.resizeObserver=null}),i(()=>{A([e.current],o.deps)&&(o.deps=[e.current],o.resizeObserver?.disconnect?.(),e.current&&o.resizeObserver?.observe(e.current,r))}),{isSupported:Ke,start:()=>{o.resizeObserver==null&&(o.resizeObserver=new ResizeObserver(t),e.current&&o.resizeObserver.observe(e.current,r),o.cleanup=()=>{o.resizeObserver?.disconnect?.(),o.resizeObserver=null})},stop:()=>{H(o)}})):{isSupported:Ke,start:()=>{},stop:()=>{}}:{isSupported:Ke,start:()=>{},stop:()=>{}};var Ue="window"in globalThis&&"MutationObserver"in globalThis.window,Lr=(e,t,r=void 0)=>g()?Ue?h("useMutationObserver",{mutationObserver:null,deps:[e.current]},({isInit:n,hook:o,queueEffect:i})=>(n?(i(()=>{o.deps=[e.current],o.mutationObserver=new MutationObserver(t),e.current&&o.mutationObserver.observe(e.current,r)}),o.cleanup=()=>{o.mutationObserver?.disconnect?.(),o.mutationObserver=null}):A([e.current],o.deps)&&(o.deps=[e.current],o.mutationObserver?.disconnect?.(),e.current&&o.mutationObserver?.observe(e.current,r)),{isSupported:Ue,start:()=>{o.mutationObserver==null&&(o.mutationObserver=new MutationObserver(t),e.current&&o.mutationObserver.observe(e.current,r),o.cleanup=()=>{o.mutationObserver?.disconnect?.(),o.mutationObserver=null})},stop:()=>{H(o)}})):{isSupported:Ue,start:()=>{},stop:()=>{}}:{isSupported:Ue,start:()=>{},stop:()=>{}};var Be=(e,t={windowScroll:!0,windowResize:!0})=>{let r=t?.windowScroll??!0,n=t?.windowResize??!0,o=t.immediate??!0,i=x(0),s=x(0),a=x(0),u=x(0),c=x(0),d=x(0),p=x(0),v=x(0),f=()=>{let y=e.current;if(!y){i.value=0,s.value=0,a.value=0,u.value=0,c.value=0,d.value=0,p.value=0,v.value=0;return}let E=y.getBoundingClientRect();i.value=E.width,s.value=E.height,a.value=E.top,u.value=E.right,c.value=E.bottom,d.value=E.left,p.value=E.x,v.value=E.y};return Pr(e,f),Lr(e,f,{attributeFilter:["style","class"]}),$("scroll",()=>{r&&f()},{capture:!0,passive:!0}),$("resize",()=>{n&&f()},{passive:!0}),ne(()=>{o&&f()},[]),{width:i,height:s,top:a,right:u,bottom:c,left:d,x:p,y:v,update:f}};var Vr=(e,t)=>{if(!g())return{isActive:t?.immediate??!1,start:()=>null,stop:()=>null};let r=t?.fpsLimit?1e3/t.fpsLimit:null;return h("useRafFn",()=>({callback:e,refId:null,previousFrameTimestamp:0,isActive:t?.immediate??!1,rafLoop:()=>{}}),({isInit:n,hook:o,update:i})=>(o.callback=e,n&&(o.rafLoop=s=>{if(o.isActive===!1)return;o.previousFrameTimestamp||(o.previousFrameTimestamp=s);let a=s-o.previousFrameTimestamp;if(r&&a<r){o.refId=window.requestAnimationFrame(o.rafLoop);return}o.previousFrameTimestamp=s,o.callback({delta:a,timestamp:s}),o.refId=window.requestAnimationFrame(o.rafLoop)}),n&&t?.immediate&&(o.isActive=!0,o.refId=window.requestAnimationFrame(o.rafLoop),o.cleanup=()=>{o.refId!=null&&window.cancelAnimationFrame(o.refId),o.isActive=!1},i()),{isActive:o.isActive,start:()=>{o.isActive!==!0&&(o.isActive=!0,o.refId=window.requestAnimationFrame(o.rafLoop),o.cleanup=()=>{o.refId!=null&&window.cancelAnimationFrame(o.refId),o.isActive=!1},i())},stop:()=>{H(o),i()}}))};var $r=e=>{let{x:t,y:r,multiple:n,immediate:o=!0}=e,i=x(null),a=Vr(()=>{i.value=n?document.elementsFromPoint(t,r)??[]:document.elementFromPoint(t,r)??null},{immediate:o});return{element:i,...a}};var Ir=()=>{let{mouse:e}=je(),t=x(null),r=V(null),n=V(null),o=Be(r),i=x({x:-16,y:-16}),s=x({x:-16,y:-16}),a=x({width:window.innerWidth,height:window.innerHeight}),u=x("bottom"),c=V(null);ne(()=>{let f=localStorage.getItem(Fe);if(f==null)return;let y=JSON.parse(f);a.value.width=window.innerWidth,a.value.height=window.innerHeight,u.value=y.snapSide,s.value=Tt(y,n,o)},[]);let d=At(()=>{let{x:f,y}=e.value;if(t.value===null)return null;let{x:E,y:U}=t.value;return{x:f-E,y:y-U}});$("dragstart",f=>{f.preventDefault(),t.value={x:f.x,y:f.y},i.value=s.value},{ref:()=>r.current}),$("mouseup",()=>{c.current&&(clearTimeout(c.current),c.current=null),t.peek()&&(t.value=null,localStorage.setItem(Fe,JSON.stringify({...s.value,...a.value,snapSide:u.value})))});let p=ee(()=>{if(n.current==null)return;let f=n.current.offsetWidth;if(u.value==="right"){let y=Math.min(-16,s.value.y);s.value={x:-16,y:Math.max(y,(window.innerHeight-o.height.value)*-1+16)}}else if(u.value==="left"){let y=Math.min(0,s.value.y);s.value={x:(f-o.width.value)*-1+16,y:Math.max(y,(window.innerHeight-o.height.value)*-1+16)}}else if(u.value==="top"){let y=Math.min(-16,s.value.x);s.value={x:Math.max(y,(f-o.width.value)*-1+16),y:(window.innerHeight-o.height.value)*-1+16};return}else{let y=Math.min(-16,s.value.x);s.value={x:Math.max(y,(f-o.width.value)*-1+16),y:-16}}},[]);Ee([d,e],(f,y)=>{if(f===null||!n.current)return;let{x:E,y:U}=y,S=n.current.offsetWidth,D=U>=window.innerHeight-100,he=U<=100;if(!he&&!D){let oe=E>window.innerWidth/2;u.value=oe?"right":"left"}else u.value=he?"top":"bottom";if(u.value==="right"){let oe=Math.min(-16,i.value.y+f.y);s.value={x:-16,y:Math.max(oe,(window.innerHeight-o.height.value)*-1+16)};return}else if(u.value==="left"){let oe=Math.min(0,i.value.y+f.y);s.value={x:(S-o.width.value)*-1+16,y:Math.max(oe,(window.innerHeight-o.height.value)*-1+16)};return}else if(u.value==="top"){let oe=Math.min(-16,i.value.x+f.x);s.value={x:Math.max(oe,(S-o.width.value)*-1+16),y:(window.innerHeight-o.height.value)*-1+16};return}let Kr=Math.min(-16,i.value.x+f.x);s.value={y:-16,x:Math.max(Kr,(S-o.width.value)*-1+16)}});let v=ee(()=>{n.current!==null&&(s.value=Tt({width:a.value.width,height:a.value.height,x:s.value.x,y:s.value.y,snapSide:u.value},n,o),a.value.width=window.innerWidth,a.value.height=window.innerHeight,localStorage.setItem(Fe,JSON.stringify({...s.value,...a.value,snapSide:u.value})))},[Math.round(o.width.value),Math.round(o.height.value)]);return $("resize",v),{anchorRef:r,anchorCoords:s,viewPortRef:n,startMouse:t,elementBound:o,snapSide:u,updateAnchorPos:p}};var K=Ie(!1);"window"in globalThis&&R.addEventListener(e=>{e.data.type==="set-inspect-enabled"&&(K.value=e.data.value)});var X=Ie(null);var Nr="kiru-devtools-popup-size",We=()=>{let e=X.value;return ee(()=>new Promise((r,n)=>{if(e)if(e.closed)X.value=null;else return e.focus(),r(e);let o=sessionStorage.getItem(Nr),i=o?JSON.parse(o):{width:Math.floor(Math.min(1920,window.screen.width)/2),height:Math.floor(Math.min(1080,window.screen.height)/2)},s=\`popup,width=\${i.width},height=\${i.height};\`,a=window.open(window.__KIRU_DEVTOOLS_PATHNAME__,"_blank",s);if(!a)return console.error("[kiru]: Unable to open devtools window"),n();let u=c=>{c.data.type==="ready"&&(R.removeEventListener(u),console.debug("[kiru]: devtools window opened"),r(a),X.value=a,a.onbeforeunload=()=>{console.debug("[kiru]: devtools window closed"),X.value=null})};R.addEventListener(u),a.onresize=()=>{sessionStorage.setItem(Nr,JSON.stringify({width:a.innerWidth,height:a.innerHeight}))}}),[e])};var Hr=()=>{let e=We(),{mouse:t}=je(),r=$r({x:t.value.x,y:t.value.y,immediate:!1}),n=r.element.value,o=K.value?n:null,i=Se(()=>{if(o&&window.__kiru){let c=window.__kiru.apps.find(d=>d.rootNode==null||o.__kiruNode==null?!1:br(d.rootNode,o.__kiruNode));return c?.rootNode==null?null:c}return null},[o]),s=Se(()=>o?Tr(o):null,[o]),a=V(null),u=Be(a);return j(()=>K.subscribe(d=>{r[d?"start":"stop"]()}),[]),j(()=>{s&&o?a.current=Mr(s,o)??null:a.current=null},[s,o]),$("click",c=>{if(K.value===!0&&s&&i){c.preventDefault();let d=p=>{p.__devtoolsSelection={node:s,app:i},R.send({type:"select-node"}),R.send({type:"set-inspect-enabled",value:!1}),K.value=!1,a.current=null,p.focus()};X.value?d(X.value):e().then(p=>d(p))}}),s&&m("div",{className:"bg-[crimson]/80 fixed grid place-content-center pointer-events-none z-10 top-0 left-0",style:{width:\`\${u?.width}px\`,height:\`\${u?.height}px\`,transform:\`translate(\${u.x}px, \${u.y}px)\`}},m("p",null,s.type.name))};function Fr(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,viewBox:"0 -960 960 960",fill:"currentColor",...e},m("path",{d:"M710-150q-63 0-106.5-43.5T560-300q0-63 43.5-106.5T710-450q63 0 106.5 43.5T860-300q0 63-43.5 106.5T710-150Zm0-80q29 0 49.5-20.5T780-300q0-29-20.5-49.5T710-370q-29 0-49.5 20.5T640-300q0 29 20.5 49.5T710-230Zm-270-30H200q-17 0-28.5-11.5T160-300q0-17 11.5-28.5T200-340h240q17 0 28.5 11.5T480-300q0 17-11.5 28.5T440-260ZM250-510q-63 0-106.5-43.5T100-660q0-63 43.5-106.5T250-810q63 0 106.5 43.5T400-660q0 63-43.5 106.5T250-510Zm0-80q29 0 49.5-20.5T320-660q0-29-20.5-49.5T250-730q-29 0-49.5 20.5T180-660q0 29 20.5 49.5T250-590Zm510-30H520q-17 0-28.5-11.5T480-660q0-17 11.5-28.5T520-700h240q17 0 28.5 11.5T800-660q0 17-11.5 28.5T760-620Zm-50 320ZM250-660Z"}))}function zr(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-square-mouse-pointer",...e},m("path",{d:"M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z"}),m("path",{d:"M21 11V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h6"}))}var Nn=()=>{K.value=!K.value,R.send({type:"set-inspect-enabled",value:K.value})};function Hn(e,t){let{damping:r}=t,n=x(e),o=V(e);return j(()=>{let i=null,s=()=>{if(Math.sqrt(Math.pow(o.current.x-n.value.x,2)+Math.pow(o.current.y-n.value.y,2))<5)return;let u=n.value.x+(o.current.x-n.value.x)*r,c=n.value.y+(o.current.y-n.value.y)*r;n.value={x:u,y:c},i=window.requestAnimationFrame(s)};return i=window.requestAnimationFrame(s),()=>{i!=null&&window.cancelAnimationFrame(i)}},[e.x,e.y]),Object.assign(n,{set:(i,s)=>{o.current=i,s?.hard&&(n.value=i)}})}function Rt(){let e=x(!1),t=We(),{anchorCoords:r,anchorRef:n,viewPortRef:o,startMouse:i,snapSide:s}=Ir(),a=s.value==="left"||s.value==="right",u=V(!1),c=Hn(r.value,{damping:.4});return Ee([r],c.set),ne(()=>{u.current===!1&&c.set(r.value,{hard:!0}),u.current=!0},[]),m(ue,null,m("div",{ref:o,className:"w-full h-0 fixed top-0 left-0 z-[-9999] overflow-scroll pointer-events-none"}),m("div",{ref:n,draggable:!0,className:\`flex \${a?"flex-col":""} \${e.value?"rounded-3xl":"rounded-full"} p-1 gap-1 items-center will-change-transform bg-crimson\`,style:{transform:\`translate3d(\${Math.round(c.value.x)}px, \${Math.round(c.value.y)}px, 0)\`}},m(_r,{in:e.value,duration:{in:40,out:150},element:d=>{if(d==="exited")return null;let p=d==="entered"?"1":"0.5",v=d==="entered"?"1":"0";return m(ue,null,m("button",{title:"Open Devtools",onclick:t,style:{transform:\`scale(\${p})\`,opacity:v},className:"transition text-white rounded-full p-1 hover:bg-[#0003]"},m(Fr,{width:16,height:16})),m("button",{title:"Toggle Component Inspection",onclick:Nn,style:{transform:\`scale(\${p})\`,opacity:v},className:\`transition text-white rounded-full p-1 hover:bg-[#0003] \${K.value?"bg-[#0003]":""}\`},m(zr,{width:16,height:16})))}}),m("button",{className:"bg-crimson rounded-full p-1"+(i.value?" pointer-events-none":""),onclick:()=>e.value=!e.value,tabIndex:-1},m(Cr,null))),m(Hr,null))}var jr=\`*, ::before, ::after {
|
|
9105
9105
|
--tw-border-spacing-x: 0;
|
|
9106
9106
|
--tw-border-spacing-y: 0;
|
|
9107
9107
|
--tw-translate-x: 0;
|
|
@@ -9868,7 +9868,7 @@ video {
|
|
|
9868
9868
|
.focus\\\\:outline:focus {
|
|
9869
9869
|
outline-style: solid;
|
|
9870
9870
|
}
|
|
9871
|
-
\`;if("window"in globalThis){let e=function(){let t=document.createElement("kiru-devtools");t.setAttribute("style","display: contents"),document.body.appendChild(t);let r=t.attachShadow({mode:"open"}),n=new CSSStyleSheet;n.replaceSync(
|
|
9871
|
+
\`;if("window"in globalThis){let e=function(){let t=document.createElement("kiru-devtools");t.setAttribute("style","display: contents"),document.body.appendChild(t);let r=t.attachShadow({mode:"open"}),n=new CSSStyleSheet;n.replaceSync(jr),r.adoptedStyleSheets=[n];let o=Object.assign(document.createElement("div"),{id:"devtools-root",className:"fixed flex bottom-0 right-0 z-[9999999]"});r.appendChild(o),xr(m(Rt,{}),o,{name:"kiru.devtools"});let i=()=>X.value?.close();window.addEventListener("close",i),window.addEventListener("beforeunload",i),R.addEventListener(s=>{switch(s.data.type){case"update-node":{let a=window.__devtoolsNodeUpdatePtr;ze(a,"failed to get node ptr");let u=N(a);ze(u,"failed to get app context");let c=window.__kiru.getSchedulerInterface(u);ze(c,"failed to get scheduler interface"),c.requestUpdate(a),window.__devtoolsNodeUpdatePtr=null;break}case"open-editor":{window.open(s.data.fileLink);break}}})};zn=e,window.addEventListener("kiru:ready",e,{once:!0})}var zn;
|
|
9872
9872
|
|
|
9873
9873
|
`;
|
|
9874
9874
|
|