vite-plugin-kiru 0.32.3 → 1.1.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 CHANGED
@@ -3448,10 +3448,10 @@ function isTopLevelFunction(node, bodyNodes) {
3448
3448
 
3449
3449
  // src/codegen/hmr.ts
3450
3450
  import fs from "node:fs";
3451
- var UNNAMED_WATCH_PREAMBLE = `
3451
+ var UNNAMED_EFFECT_PREAMBLE = `
3452
3452
 
3453
3453
  if (import.meta.hot && "window" in globalThis) {
3454
- window.__kiru.HMRContext?.signals.registerNextWatch();
3454
+ window.__kiru.HMRContext?.moduleEffects.registerNext();
3455
3455
  }
3456
3456
  `;
3457
3457
  function prepareHMR(ctx) {
@@ -3531,7 +3531,7 @@ function findHotVars(code, bodyNodes, _id) {
3531
3531
  "createStore",
3532
3532
  "signal",
3533
3533
  "computed",
3534
- "watch",
3534
+ "effect",
3535
3535
  "createContext",
3536
3536
  "lazy"
3537
3537
  ].map((name) => createAliasHandler(name));
@@ -3553,8 +3553,8 @@ function findHotVars(code, bodyNodes, _id) {
3553
3553
  if (!aliasHandler.isMatchingCallExpression(node2)) {
3554
3554
  return ctx.exitBranch();
3555
3555
  }
3556
- if (aliasHandler.name === "watch" && ctx.stack.length === 1 && ctx.stack[0].type === "ExpressionStatement") {
3557
- code.appendRight(node2.start, UNNAMED_WATCH_PREAMBLE);
3556
+ if (aliasHandler.name === "effect" && ctx.stack.length === 1 && ctx.stack[0].type === "ExpressionStatement") {
3557
+ code.appendRight(node2.start, UNNAMED_EFFECT_PREAMBLE);
3558
3558
  return ctx.exit();
3559
3559
  }
3560
3560
  const matchingParentStack = allowedHotVarParentStacks.find(
@@ -5273,7 +5273,6 @@ function createPluginState(opts = {}) {
5273
5273
  let fileLinkFormatter = (path8, line) => `vscode://file/${path8}:${line}`;
5274
5274
  let dtClientPathname = "/__devtools__";
5275
5275
  if (typeof opts.devtools === "object") {
5276
- dtClientPathname = opts.devtools.dtClientPathname ?? dtClientPathname;
5277
5276
  fileLinkFormatter = opts.devtools.formatFileLink ?? fileLinkFormatter;
5278
5277
  }
5279
5278
  if (!dtClientPathname.startsWith("/")) {
@@ -5409,838 +5408,999 @@ function updatePluginState(state, config, opts) {
5409
5408
  };
5410
5409
  }
5411
5410
 
5412
- // ../devtools-client/dist/index.js
5413
- var dist_default = `<!DOCTYPE html>
5414
- <html lang="en">
5415
- <head>
5416
- <meta charset="UTF-8" />
5417
- <link rel="icon" type="image/svg+xml" href="./favicon.svg" />
5418
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
5419
- <title>Kiru Devtools</title>
5420
- <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 iu="production",pe=iu==="development",Va=Symbol.for("kiru.signal"),su=Symbol.for("kiru.context"),Ni=Symbol.for("kiru.contextProvider"),zt=Symbol.for("kiru.fragment"),Ba=Symbol.for("kiru.error"),Wa=Symbol.for("kiru.memo"),no=Symbol.for("kiru.errorBoundary"),ou=Symbol.for("kiru.streamData"),ru=Symbol.for("kiru.devFileLink"),au=50,gn="kiru:deferred",se=2,le=4,Ri=8,ce=16,ja=32,gs=64,Fe=128,lu=/^on:?/,$a=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"]),cu=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"]),uu=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"]]),ze={current:null},Ua={current:0},Ht={current:"window"in globalThis?"dom":"string"},hu={current:"dynamic"};var Ya;class Je extends Error{constructor(t){const n=typeof t=="string"?t:t.message;super(n),this[Ya]=!0,typeof t!="string"&&(this.fatal=t?.fatal)}static isKiruError(t){return t instanceof Error&&t[Ba]===!0}}Ya=Ba;const mn=[],ke=[],Gt={bumpChildIndex(){ke[ke.length-1]++},getCurrentChild(){const e=ke[ke.length-1];return this.getCurrentParent().childNodes[e]},getCurrentParent(){return mn[mn.length-1]},clear(){mn.length=0,ke.length=0},pop(){mn.pop(),ke.pop()},push(e){mn.push(e),ke.push(0)}};let io=!1,ms=!1;const Xa=e=>{e.preventDefault(),e.stopPropagation(),ms=!0};let De=null;function fu(){io=!0,De=document.activeElement,De&&De!==document.body&&De.addEventListener("blur",Xa)}function du(){ms&&(De.removeEventListener("blur",Xa),De.isConnected&&De.focus(),ms=!1),io=!1}function pu(e){const t=e.type;return t=="#text"?gu(e):$a.has(t)?document.createElementNS("http://www.w3.org/2000/svg",t):document.createElement(t)}function gu(e){const{nodeValue:t}=e.props;return W.isSignal(t)?qa(e,t):document.createTextNode(t)}function qa(e,t){const n=t.peek()??"",i=document.createTextNode(n);return bs(e,i,t),i}function mu(e){return t=>{if(io){t.preventDefault(),t.stopPropagation();return}e(t)}}const Zo=new WeakMap;function Ga(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 d=r.nodeValue;!W.isSignal(d)&&t.nodeValue!==d&&(t.nodeValue=d);return}const l=[];for(const d in o)l.push(d);for(const d in r)d in o||l.push(d);let c;for(let d=0;d<l.length;d++){const m=l[d],x=o[m],y=r[m];if(Ps.isEvent(m)){if(c??(c=Zo.get(e)),c||Zo.set(e,c={}),x!==y||a){const v=m.replace(lu,""),w=c[v];if(!y){w&&(t.removeEventListener(v,w),delete c[v]);continue}let k=y.bind(void 0);if((v==="focus"||v==="blur")&&(k=mu(k)),w){w.handleEvent=k;continue}t.addEventListener(v,c[v]={handleEvent:k})}continue}if(!(Ps.isInternalProp(m)&&m!=="innerHTML")&&x!==y){if(W.isSignal(x)&&s){const v=s[m];v&&(v(),delete s[m])}if(W.isSignal(y)){vu(e,t,m,y,x);continue}ys(t,m,y,x)}}const u=o.ref,f=r.ref;u!==f&&(u&&Ds(u,null),f&&Ds(f,t))}function bu(e){return e.multiple?Array.from(e.selectedOptions).map(t=>t.value):e.value}function Ka(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 yu={value:"input",checked:"change",open:"toggle",volume:"volumechange",playbackRate:"ratechange",currentTime:"timeupdate"},xu=new Set(["progress","meter","number","range"]);function vu(e,t,n,i,s){const[o,r]=n.split(":"),a=e.cleanups??(e.cleanups={});if(o!=="bind")a[n]=i.subscribe((u,f)=>{u!==f&&ys(t,n,u,f)});else{const u=yu[r];if(!u)return;a[n]=wu(e,t,r,u,i)}const l=i.peek(),c=Fi(s);l!==c&&ys(t,r??o,l,c)}function _u(e,t){return e instanceof HTMLInputElement?Su(e,t):e instanceof HTMLSelectElement?()=>bu(e):()=>e.value}function wu(e,t,n,i,s){const o=u=>{s.sneak(u),s.notify(f=>f!==a)},r=t instanceof HTMLSelectElement&&n==="value"?u=>Ka(t,u):u=>t[n]=u,a=u=>{r(u)};let l;if(n==="value"){const u=_u(t,s);l=()=>o(u())}else l=()=>{const u=t[n];n==="currentTime"&&s.peek()===u||o(u)};t.addEventListener(i,l);const c=s.subscribe(a);return()=>{t.removeEventListener(i,l),c()}}function Su(e,t){const n=e.type,i=t.peek();return n==="date"&&i instanceof Date?()=>e.valueAsDate:xu.has(n)&&typeof i=="number"?()=>e.valueAsNumber:()=>e.value}function bs(e,t,n){(e.cleanups??(e.cleanups={})).nodeValue=n.subscribe((i,s)=>{i!==s&&(t.nodeValue=i)})}function ku(e){const t=e.props.nodeValue;if(!W.isSignal(t))return Gt.getCurrentChild();const n=t.peek();if(zi(n))return Gt.getCurrentChild();const i=qa(e,t),s=Gt.getCurrentChild();return s?(s.before(i),i):Gt.getCurrentParent().appendChild(i)}function Tu(e){const t=e.type==="#text"?ku(e):Gt.getCurrentChild();if(Gt.bumpChildIndex(),!t)throw new Je({message:"Hydration mismatch - no node found",vNode:e});let n=t.nodeName;if($a.has(n)||(n=n.toLowerCase()),e.type!==n)throw new Je({message:\`Hydration mismatch - expected node of type \${e.type.toString()} but received \${n}\`,vNode:e});if(e.dom=t,e.type!=="#text"&&!(e.flags&ce)){Ga(e);return}W.isSignal(e.props.nodeValue)&&bs(e,t,e.props.nodeValue);let i=e,s=e.sibling;for(;s&&s.type==="#text";){const o=s;Gt.bumpChildIndex();const r=String(Fi(i.props.nodeValue)??""),a=i.dom.splitText(r.length);o.dom=a,W.isSignal(o.props.nodeValue)&&bs(o,a,o.props.nodeValue),i=s,s=s.sibling}}function Za(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 Mu(e,t,n){const i=cu.has(t);Za(e,t,n,i)||e.setAttribute(t,i&&typeof n=="boolean"?"":String(n))}const Eu=["INPUT","TEXTAREA"],Cu=e=>Eu.indexOf(e.nodeName)>-1;function ys(e,t,n,i){switch(t){case"style":return Du(e,n,i);case"className":return Pu(e,n);case"innerHTML":return Ou(e,n);case"muted":e.muted=!!n;return;case"value":if(e.nodeName==="SELECT")return Ka(e,n);const s=n==null?"":String(n);if(Cu(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 Mu(e,Ju(t),n)}}function Ou(e,t){if(t==null||typeof t=="boolean"){e.innerHTML="";return}e.innerHTML=String(t)}function Pu(e,t){const n=Fi(t);if(!n)return e.removeAttribute("class");e.setAttribute("class",n)}function Du(e,t,n){if(Za(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 Au(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 Je({message:"No DOM parent found while attempting to place node.",vNode:e})}return t}function Iu(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&(le|ce))){const s=Lu(i);if(s?.isConnected)return s}i=i.sibling}if(n=n.parent,!n||n.flags&ce||n===t)return}}function Lu(e){let t=e;for(;t;){if(t.dom)return t.dom;if(t.flags&ce)return;t=t.child}}function Nu(e){if(Ht.current==="hydrate")return Hi(e,wi);const t={node:e.dom?e:Au(e)};xs(e,t,(e.flags&le)>0),e.dom&&!(e.flags&ce)&&Ja(e,t,!1),wi(e)}function xs(e,t,n){let i=e.child;for(;i;){if(i.flags&gs){i.flags&le&&Fu(i,t),wi(i),i=i.sibling;continue}i.dom?(xs(i,{node:i},!1),i.flags&ce||Ja(i,t,n)):xs(i,t,(i.flags&le)>0||n),wi(i),i=i.sibling}}function Ja(e,t,n){(n||!e.dom.isConnected||e.flags&le)&&Iu(e,t),(!e.prev||e.flags&se)&&Ga(e),t.lastChild=e.dom}function Ru(e){e===e.parent?.child&&(e.parent.child=e.sibling),Hi(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&ce)&&o.remove(),r&&Ds(r,null),delete t.dom)}),e.parent=null}function Fu(e,t){if(!e.child)return;const n=[];if(tl(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 tl(e,t){let n=e;for(;n;)n.dom?t.push(n.dom):n.child&&tl(n.child,t),n=n.sibling}function g(e,t=null,...n){e===Tt&&(e=zt);const i=t===null?{}:t,s=gl(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:gl(t),props:{children:e}}}function el(e){return typeof e[Wa]=="function"}function nl(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 so(e,t){return Array.isArray(t)?Hu(e,t):zu(e,t)}function zu(e,t){const n=e.child;if(n===null)return ol(e,t);const i=n.sibling,s=il(e,n,t);if(s!==null)return n&&n!==s&&!s.prev?vs(e,n):i&&vs(e,i),s;{const o=ll(n),r=rl(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 Hu(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=il(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=ol(e,t[a]);c!==null&&(r=mi(c,r,a),i===null?n=c:i.sibling=c,i=c)}return n}const l=ll(s);for(;a<t.length;a++){const c=rl(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 il(e,t,n){const i=t===null?null:t.key;return zi(n)?i!==null||t?.type==="#text"&&W.isSignal(t.props.nodeValue)?null:Qo(e,t,""+n):W.isSignal(n)?t&&t.props.nodeValue!==n?null:Qo(e,t,n):ro(n)?n.key!==i?null:Vu(e,t,n):Array.isArray(n)?i!==null?null:sl(e,t,n):null}function Qo(e,t,n){return t===null||t.type!=="#text"?Rt(e,"#text",{nodeValue:n}):(t.props.nodeValue!==n&&(t.props.nodeValue=n,t.flags|=se),t.sibling=null,t)}function Vu(e,t,n){let{type:i,props:s,key:o}=n;return i===zt?sl(e,t,s.children||[],s):t?.type===i?(t.index=0,t.sibling=null,typeof i=="string"?al(t.props,s)&&(t.flags|=se):t.flags|=se,t.props=s,t):Rt(e,i,s,o)}function sl(e,t,n,i={}){return t===null||t.type!==zt?Rt(e,zt,{children:n,...i}):(t.props={...t.props,...i,children:n},t.flags|=se,t.sibling=null,t)}function ol(e,t){return zi(t)?Rt(e,"#text",{nodeValue:""+t}):W.isSignal(t)?Rt(e,"#text",{nodeValue:t}):ro(t)?Rt(e,t.type,t.props,t.key):Array.isArray(t)?Rt(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|=le,t):s}else return e.flags|=le,t}function rl(e,t,n,i){if(W.isSignal(i)||zi(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 Rt(t,"#text",{nodeValue:i},null,n)}if(ro(i)){const{type:o,props:r,key:a}=i,l=e.get(a===null?n:a);return l?.type===o?(typeof o=="string"?al(l.props,r)&&(l.flags|=se):l.flags|=se,l.props=r,l.sibling=null,l.index=n,l):Rt(t,o,r,a,n)}if(Array.isArray(i)){const o=e.get(n);return o?(o.flags|=se,o.props.children=i,o):Rt(t,zt,{children:i},null,n)}return null}function al(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 ll(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 vs(e,t){for(;t;)vi(e,t),t=t.sibling}function Rt(e,t,n,i=null,s=0){const o=nl(t,e,n,i,s);return o.flags|=le,typeof t=="function"&&el(t)&&(o.flags|=ja),o}let Xt=[],tn=!1,_s=[],ws=[],Ss=!1,ks=!1,Ts=!1,Ms=0,cl=[],Es=[],ul=-1;function Bu(e){if(tn){_s.push(e);return}e()}function hl(){tn&&(window.cancelAnimationFrame(ul),fl())}function Jo(e){e.flags|=Fe,Xt.push(e),tn=!0,hl()}function Hn(e){if(Ht.current==="hydrate")return Bu(()=>Cs(e));Cs(e)}function Wu(){tn||(tn=!0,ul=window.requestAnimationFrame(fl))}function ju(){for(tn=!1;_s.length;)_s.shift()()}function Cs(e){if(Ss&&(ks=!0),ze.current===e){Ts=!0;return}if(!(e.flags&(Fe|Ri))){if(e.flags|=Fe,!Xt.length)return Xt.push(e),Wu();Xt.push(e)}}function $u(e){Hi(e,t=>t.flags|=Ri),ws.push(e)}const Uu=(e,t)=>t.depth-e.depth;let ee=null;function fl(){let e=1;for(fu();Xt.length;){Xt.length>e&&Xt.sort(Uu),ee=Xt.shift(),e=Xt.length;const t=ee.flags;if(!(t&Ri)&&t&Fe){let n=ee;for(;n=Yu(n););for(;ws.length;)Ru(ws.pop());Nu(ee),ee.flags&=~Fe}}if(du(),Ss=!0,es(cl),Ss=!1,ks)return Zu(),es(Es),ks=!1,Ms++,hl();Ms=0,ju(),queueMicrotask(()=>es(Es))}function Yu(e){const t=Xu(e);if(e.deletions!==null&&(e.deletions.forEach($u),e.deletions=null),t)return t;let n=e;for(;n;){if(n.immediateEffects&&(cl.push(...n.immediateEffects),n.immediateEffects=void 0),n.effects&&(Es.push(...n.effects),n.effects=void 0),n===ee)return null;if(n.sibling)return n.sibling;n=n.parent,Ht.current==="hydrate"&&n?.dom&&Gt.pop()}return null}function Xu(e){const{type:t,props:n,prev:i,flags:s}=e;if((s&Fe)===0&&n===i?.props)return null;try{return typeof t=="string"?Ku(e):eh(t)?qu(e):Gu(e)}catch(o){const r=rh(e);if(r){const a=r.error=o instanceof Error?o:new Error(String(o));return r.props.onError?.(a),r.depth<ee.depth&&(ee=r),r}if(Je.isKiruError(o)){if(o.customNodeStack&&setTimeout(()=>{throw new Error(o.customNodeStack)}),o.fatal)throw o;return console.error(o),e.child}setTimeout(()=>{throw o})}return null}function qu(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===no){const s=e,{error:o}=s;o&&(i=typeof t.fallback=="function"?t.fallback(o):t.fallback,delete s.error)}return e.child=so(e,i)}function Gu(e){const{type:t,props:n,subs:i,prev:s,flags:o}=e;if(o&ja){if(s&&t[Wa](s.props,n))return e.flags|=gs,null;e.flags&=~gs}try{ze.current=e;let r,a=0;do e.flags&=~Fe,Ts=!1,Ua.current=0,i&&(i.forEach(oo),i.clear()),r=t(n);while(Ts);return e.child=so(e,r)}finally{ze.current=null}}function Ku(e){const{props:t,type:n}=e;return e.dom||(Ht.current==="hydrate"?Tu(e):e.dom=pu(e)),n!=="#text"&&(e.child=so(e,t.children),e.child&&Ht.current==="hydrate"&&Gt.push(e.dom)),e.child}function Zu(){if(Ms>au)throw new Je("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 es(e){for(let t=0;t<e.length;t++)e[t]();e.length=0}var tr;(function(e){e.Start="start",e.End="end"})(tr||(tr={}));const ge=()=>{const e=dl("useRequestUpdate");return()=>Hn(e)};function _t(e,t,n){const i=dl(e),s=(a,l)=>{if(l?.immediate){(i.immediateEffects??(i.immediateEffects=[])).push(a);return}(i.effects??(i.effects=[])).push(a)},o=Ua.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:()=>Hn(i),queueEffect:s,vNode:i,index:o})}catch(a){throw a}}function dl(e){const t=ze.current;if(!t)throw new Je(\`Hook "\${e}" must be used at the top level of a component or inside another composite hook.\`);return t}function Vn(e){e.cleanup&&(e.cleanup(),e.cleanup=void 0)}function We(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]}},Ge=new Map;var pl;class W{constructor(t,n){this[pl]=!0,this.$id=lh(),this.$value=t,n&&(this.displayName=n),this.$subs=new Set}get value(){return 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.$value}sneak(t){this.$prevValue=this.$value,this.$value=t}toString(){return 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&&Va 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=ze.current,i=Os.current();if(i){(!n||n&&xt())&&i.set(t.$id,t);return}if(!n||!xt())return;const s=t.subscribe(()=>Hn(n));(n.subs??(n.subs=new Set)).add(s)}static dispose(t){t.$isDisposed=!0,t.$subs.clear()}}pl=Va;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 Fi(e,t=!1){return W.isSignal(e)?t?e.value:e.peek():e}const Qu=()=>{Ge.forEach(oo),Ge.clear()};function _i(...e){return e.filter(Boolean).join(" ")}const er=new Set(["children","ref","key","innerHTML"]),Ps={isInternalProp:e=>er.has(e),isEvent:e=>e.startsWith("on"),isStringRenderableProperty:e=>!er.has(e)&&!Ps.isEvent(e)};function Ju(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():uu.get(e)||e}}function oo(e){e()}const nr=Object.freeze(()=>{});function Ds(e,t){if(typeof e=="function"){e(t);return}if(W.isSignal(e)){e.value=t;return}e.current=t}function xt(){return Ht.current==="dom"||Ht.current==="hydrate"}function th(e){return(e.flags&Ri)!==0}function ro(e){return typeof e=="object"&&e!==null&&"type"in e}function zi(e){return typeof e=="string"&&e!==""||typeof e=="number"||typeof e=="bigint"}function eh(e){return e===zt||e===Ni||e===no}function nh(e){return e.type===zt}function ih(e){return typeof e.type=="function"&&"displayName"in e.type&&e.type.displayName==="Kiru.lazy"}function sh(e){return typeof e.type=="function"&&el(e.type)}function wi(e){const{props:t,key:n,index:i}=e;e.prev={props:t,key:n,index:i},e.flags&=-15}function Hi(e,t){t(e);let n=e.child;for(;n;)t(n),n.child&&Hi(n,t),n=n.sibling}function oh(e,t){let n=e.parent;for(;n;){if(t(n))return n;n=n.parent}return null}function rh(e){return oh(e,t=>t.type===no)}function gl(e){return e===void 0?null:typeof e=="string"||typeof e=="number"?e:null}const ah="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz-";function lh(e=10,t=ah){let n="";for(let i=0;i<e;i++)n+=t[Math.random()*t.length|0];return n}function ch(){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 uh(e){const{id:t,subs:n,fn:i,deps:s=[],onDepChanged:o}=e;let r;Ge.delete(t);const a=!!ze.current&&!xt();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=()=>{Ge.size||queueMicrotask(Qu),Ge.set(t,o)};for(const[u,f]of r){if(n.has(u))continue;const d=f.subscribe(c);n.set(u,d)}Os.stack.pop()}return l}class Oe extends W{constructor(t,n){super(void 0,n),this.$getter=t,this.$unsubs=new Map,this.$isDirty=!0}get value(){return this.ensureNotDirty(),super.value}toString(){return this.ensureNotDirty(),super.toString()}peek(){return this.ensureNotDirty(),super.peek()}set value(t){}subscribe(t){return this.$isDirty&&Oe.run(this),super.subscribe(t)}static dispose(t){Oe.stop(t),W.dispose(t)}static updateGetter(t,n){const i=t;i.$getter=n,i.$isDirty=!0,Oe.run(i),!Object.is(i.$value,i.$prevValue)&&i.notify()}static stop(t){const{$id:n,$unsubs:i}=t;Ge.delete(n),i.forEach(oo),i.clear(),t.$isDirty=!0}static run(t){const n=t,{$id:i,$getter:s,$unsubs:o}=n,r=uh({id:i,subs:o,fn:()=>s(n.$value),onDepChanged:()=>{n.$isDirty=!0,t.$subs.size&&(Oe.run(n),!Object.is(n.$value,n.$prevValue)&&n.notify())}});n.sneak(r),n.$isDirty=!1}ensureNotDirty(){this.$isDirty&&Oe.run(this)}}function Bn(e,t){return new Oe(e,t)}let hh=0;function fh(e,t,n){const i=dh(t),s=hh++,o={id:s,name:\`App-\${s}\`,rootNode:i,render:r,unmount:a};function r(l){i.props.children=l,Jo(i)}function a(){i.props.children=null,Jo(i),window.__kiru.emit("unmount",o)}return r(e),window.__kiru.emit("mount",o,Hn),o}function dh(e){const t=nl(e.nodeName.toLowerCase());return t.flags|=ce,t.dom=e,t}function me(e){return xt()?_t("useState",{state:void 0,dispatch:nr},({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,nr]}function ph(e){const t={[su]:!0,Provider:({value:n,children:i})=>{const[s]=me(()=>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 Ke(e,t){return xt()?_t("useCallback",{callback:e,deps:t},({hook:n,isHMR:i})=>(We(t,n.deps)&&(n.deps=t,n.callback=e),n.callback)):e}function gh(e,t=!0){return _t("useContext",{context:e,warnIfNotFound:t},mh)}const mh=({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(xt())return _t("useEffect",{deps:t},({hook:n,isInit:i,isHMR:s,queueEffect:o})=>{(i||We(t,n.deps))&&(n.deps=t,Vn(n),o(()=>{const r=e();typeof r=="function"&&(n.cleanup=r)}))})}function ml(){return _t("useId",bh,yh)}const bh=()=>({id:"",idx:0}),yh=({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 ao(e,t){if(xt())return _t("useLayoutEffect",{deps:t},({hook:n,isInit:i,isHMR:s,queueEffect:o})=>{(i||We(t,n.deps))&&(n.deps=t,Vn(n),o(()=>{const r=e();typeof r=="function"&&(n.cleanup=r)},{immediate:!0}))})}function Si(e,t){return xt()?_t("useMemo",{deps:t,value:void 0},({hook:n,isInit:i,isHMR:s})=>((i||We(t,n.deps))&&(n.deps=t,n.value=e()),n.value)):e()}const ir=new WeakMap;function xh(e,t){const n=ml(),i=J(!0);return _t("usePromise",{},({hook:s,isInit:o,vNode:r,update:a})=>{if(o||We(t,s.deps)){i.value=!0,s.deps=t,Vn(s);const l=s.abortController=new AbortController;s.cleanup=()=>l.abort();const c=ir.get(r)??0;ir.set(r,c+1);const u=\`\${n}:data:\${c}\`;let f;Ht.current==="string"?f=Promise.resolve():Ht.current==="hydrate"&&hu.current==="dynamic"?f=vh(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(x=>{m.state="fulfilled",m.value=x,i.value=!1}).catch(x=>{m.state="rejected",m.error=x instanceof Error?x:new Error(x)})}return s.promise})}function vh(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 He(e){return xt()?_t("useRef",{ref:{current:e}},({hook:t,isInit:n,isHMR:i})=>t.ref):{current:e}}function sr(e){return e instanceof Promise&&"id"in e&&"state"in e}function As(e){const{from:t,children:n,fallback:i,mode:s}=e,o=He(null),r=new Set;let a;if(sr(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];sr(u)&&r.add(u),l[c]=u.value}a=l}if(r.size===0)return n(a);if(!xt())throw{[ou]:{fallback:i,data:Array.from(r)}};for(const l of r){if(l.state==="rejected")throw l.error;if(l.state==="pending"){const c=ze.current;return Promise.allSettled(r).then(()=>Hn(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 or;"window"in globalThis&&!globalThis.__KIRU_DEVTOOLS__&&((or=globalThis.window).__kiru??(or.__kiru=ch()));function _h(e,t){if(!e)throw new Error(t)}function wh(...e){return e.filter(Boolean).join(" ")}function lo(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 co(e){return e.type.displayName??(e.type.name||"Anonymous Function")}const Sh=e=>e[ru]??null;function In(e){return e.name==="kiru.devtools"}function bl(e){return Array.from(e.entries())}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("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 ue(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 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("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 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","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 Eh(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 Ch(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 Oh(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 yl(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 Ph(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 Dh(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 uo(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 xl({title:e,children:t,className:n,disabled:i,...s}){const[o,r]=me(!0);rt(()=>{!o&&i&&r(!0)},[i]);const a=Ke(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(ue,{className:\`transition \${o?"":"rotate-90"}\`}),e)),o?null:g("div",{className:\`p-2 \${n||""}\`,...s},t))}const ho={arrayChunkSize:10,objectKeysChunkSize:100};function vl(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"&&!vl(e[i],t[i]))return!1;return!0}function _l(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"?_l(e[i],t[i],n):n(e,i,e[i])}let wl={...ho};const rr=localStorage.getItem("kiru.devtools.userSettings");if(rr)try{const e=JSON.parse(rr);vl(ho,e)&&(wl=e)}catch(e){console.error("kiru.devtools.userSettings error",e)}const Sl=ph({userSettings:null,saveUserSettings:()=>{}}),Vi=()=>gh(Sl);function Ah({children:e}){const[t,n]=me(wl),i=s=>{localStorage.setItem("kiru.devtools.userSettings",JSON.stringify(s)),n(s)};return g(Sl.Provider,{value:{userSettings:t,saveUserSettings:i}},e)}function Ih(){const{userSettings:e,saveUserSettings:t}=Vi();return g("div",{className:"rounded bg-neutral-400 bg-opacity-5 border border-white border-opacity-10 overflow-hidden"},g(be,{border:!1,data:e,onChange:(n,i)=>{const s={...e};lo(s,n,i),_l(s,ho,(o,r,a)=>{o[r]=a<1?1:a}),t(s)},mutable:!0,objectRefAcc:[]}))}const Lh=Object.freeze(()=>{});function be({data:e,onChange:t,mutable:n,objectRefAcc:i,keys:s=[],className:o,border:r=!0}){const{userSettings:{objectKeysChunkSize:a}}=Vi(),[l,c]=me(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:wh("flex flex-col items-start w-full",r&&"border border-neutral-700",Fi(o))},u.map(m=>{const x=s.concat(m),y=x.join(".");return g("div",{key:y,"data-key":y,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(fo,{value:e[m],onChange:t,keys:x,path:y,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 fo({value:e,onChange:t,keys:n,path:i,mutable:s,objectRefAcc:o,label:r}){const{userSettings:{arrayChunkSize:a}}=Vi(),[l,c]=me(!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(Jt,null,"null"));if(e===void 0)return g(mt,null,u,g(Jt,null,"undefined"));const f=window.opener?window.opener.Node:Node;if(e instanceof f)return g(mt,null,u,g(Jt,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(Jt,null,e.message," (",String(e.cause),")"):g(Jt,null,e.message));const m=x=>t(n,x);switch(typeof e){case"string":return g(mt,null,u,g(ns,{disabled:!s,id:i,type:"text",value:e,onchange:x=>m(x.target.value)}));case"number":return g(mt,null,u,g(ns,{disabled:!s,id:i,type:"number",value:e,placeholder:"NaN",onchange:x=>m(Number(x.target.value))}));case"bigint":return g(mt,null,u,g(ns,{disabled:!s,id:i,type:"number",value:e.toString(),onchange:x=>m(BigInt(x.target.value))}));case"boolean":return g(mt,null,u,g("input",{disabled:!s,id:i,type:"checkbox",checked:e,onchange:x=>m(x.target.checked),className:"accent-red-500"}));case"function":return g(mt,null,u,g(Jt,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,x=>o.splice(o.indexOf(x),1)),c(x=>!x)}},r,g(ue,{width:10,height:10,className:\`transition \${l?"":"rotate-90"}\`})),l?g(Jt,null,"Array(",e.length,")"):e.length>a?g(Nh,{array:e,objectRefAcc:o}):g("div",{className:"flex flex-col items-start gap-1 w-full"},e.map((x,y)=>g(fo,{value:x,onChange:t,keys:[...n,y.toString()],path:i.concat(".",y.toString()),label:y.toString(),mutable:s,objectRefAcc:o})))):o.includes(e)?g(mt,null,u,g(Jt,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,x=>o.splice(o.indexOf(x),1)),c(x=>!x)}},r,g(ue,{width:10,height:10,className:\`transition \${l?"":"rotate-90"}\`})),l?null:g(be,{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 ns(e){return g("input",{className:"flex-grow text-xs px-2 py-1 text-neutral-300 w-full",...e})}function Jt({children:e}){return g("small",{className:"text-neutral-300"},g("i",null,e))}function Nh({array:e,objectRefAcc:t}){const{userSettings:{arrayChunkSize:n}}=Vi(),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(Rh,{array:e,range:{start:r*n,end:(r+1)*n},objectRefAcc:t})))}function Rh({array:e,range:t,objectRefAcc:n}){const[i,s]=me(!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(ue,{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(fo,{value:r,onChange:Lh,label:(t.start+a).toString(),keys:[a.toString()],path:a.toString(),mutable:!1,objectRefAcc:n}))))}const Fh="kiru-devtools";"window"in globalThis&&(window.__devtoolsSelection??=null,window.__devtoolsNodeUpdatePtr??=null);class zh extends BroadcastChannel{send(t){super.postMessage(t)}removeEventListener(t){return super.removeEventListener("message",t)}addEventListener(t){return super.addEventListener("message",t)}}const Ve=new zh(Fh);function Bi({fn:e,onclick:t}){const n=Si(()=>Sh(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(),Ve.send({type:"open-editor",fileLink:n}),t?.(i)},title:"Open in editor"},"Open in editor",g(Mh,{width:"0.65rem",height:"0.65rem"})):null}function Hh({selectedApp:e,selectedNode:t,setSelectedNode:n,kiruGlobal:i}){const s=ge();rt(()=>{const l=c=>{c===e&&(th(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,Ve.send({type:"update-node"}),console.debug("[kiru]: sent refresh message",t)},r={...t.props};delete r.children;const a=Wh(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"},"<"+co(t)+">",g(Bi,{fn:t.type})),g("button",{onclick:o},g(yl,{className:"w-5 h-5"}))),g(xl,{title:"props",disabled:Object.keys(r).length===0},g(be,{data:r,onChange:()=>{},mutable:!1,objectRefAcc:[]})),g(kl,{node:a,selectedApp:e}))}function Vh(e){return e.name==="devtools:useHookDebugGroup"}function Bh(e){return Is in e}const Is=Symbol.for("devtools.hookGroup");function Wh(e){const t={parent:null,name:"hooks",children:[],[Is]:!0};if(e.hooks?.length){let n=t;for(let i=0;i<e.hooks.length;i++){const s=e.hooks[i];if(Vh(s)){switch(s.action){case"start":const o={parent:n,name:s.displayName,children:[],[Is]:!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 kl({node:e,selectedApp:t,depth:n=0}){if(Bh(e))return g(xl,{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(kl,{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(be,{data:l,onChange:(u,f)=>{if(!t||!a?.set||!a?.get)return;const d=a.get();lo(d,u,f),a.set(d)},mutable:!!a?.set,objectRefAcc:[]})))}const Le=(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])},jh=()=>{const e=J({x:0,y:0}),t=J({x:0,y:0}),n=J({x:0,y:0});return Le("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}},Jn="window"in globalThis&&"ResizeObserver"in globalThis.window,$h=(e,t,n=void 0)=>xt()?Jn?_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(()=>{We([e.current],s.deps)&&(s.deps=[e.current],s.resizeObserver?.disconnect?.(),e.current&&s.resizeObserver?.observe(e.current,n))}),{isSupported:Jn,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:()=>{Vn(s)}})):{isSupported:Jn,start:()=>{},stop:()=>{}}:{isSupported:Jn,start:()=>{},stop:()=>{}},ti="window"in globalThis&&"MutationObserver"in globalThis.window,Uh=(e,t,n=void 0)=>xt()?ti?_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}):We([e.current],s.deps)&&(s.deps=[e.current],s.mutationObserver?.disconnect?.(),e.current&&s.mutationObserver?.observe(e.current,n)),{isSupported:ti,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:()=>{Vn(s)}})):{isSupported:ti,start:()=>{},stop:()=>{}}:{isSupported:ti,start:()=>{},stop:()=>{}},Yh=(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 x=e.current;if(!x){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 y=x.getBoundingClientRect();o.value=y.width,r.value=y.height,a.value=y.top,l.value=y.right,c.value=y.bottom,u.value=y.left,f.value=y.x,d.value=y.y};return $h(e,m),Uh(e,m,{attributeFilter:["style","class"]}),Le("scroll",()=>{n&&m()},{capture:!0,passive:!0}),Le("resize",()=>{i&&m()},{passive:!0}),ao(()=>{s&&m()},[]),{width:o,height:r,top:a,right:l,bottom:c,left:u,x:f,y:d,update:m}};function Xh(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}const ar=(e,t,n={})=>{const{ref:i,eventName:s="keydown",passive:o=!1}=n,r=Xh(e);return Le(s,l=>{l.repeat&&!n.repeat||r(l)&&t(l)},{ref:i,passive:o})};function po({value:e,className:t,...n}){const i=ml();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 Ze=G(!1);Ve.addEventListener(e=>{e.data.type==="set-inspect-enabled"&&(Ze.value=e.data.value)});const Tl=(U?.apps??[]).filter(e=>!In(e)),oe=G(Tl);G(null);const Lt=G(Tl[0]??null),re=G(null);U?.on("mount",e=>{In(e)||(oe.value=[...oe.peek(),e],Lt.peek()===null&&(Lt.value=e))});U?.on("unmount",e=>{oe.value=oe.peek().filter(t=>t!==e),Lt.peek()===e&&(Lt.value=oe.peek()[0]??null)});const Ls=G(new Map),Nt=G(null),go=G("");function qh(e){return e.type.displayName??(e.type.name||"Anonymous Function")}function Gh(e,t){const n=t.toLowerCase();return e.every(i=>n.includes(i))}function Ns(e){return typeof e.type=="function"&&!nh(e)&&!ih(e)&&!sh(e)}function Kh(e){let t=[e];for(;t.length;){const n=t.pop();if(Ns(n))return!0;n.child&&t.push(n.child),n.sibling&&t.push(n.sibling)}return!1}const Zh=(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 Rs(e,t){if(!e)return null;const n=t(e),i=Rs(e.sibling,t),s=Rs(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]=me(!0),o=re.value===e,r=Si(()=>crypto.randomUUID(),[]),a=Si(()=>Nt.value==null?null:Zh(e,Nt.value),[Nt.value,e]);rt(()=>{a&&i(!1)},[a]),rt(()=>{if(!(!e||!Ns(e)))return Ls.peek().set(r,{vNode:e,setCollapsed:i}),()=>{Ls.peek().delete(r)}});const l=go.value;if(!e)return null;if(!Ns(e)||l.length>0&&!Gh(l.toLowerCase().split(" "),e.type.name))return g(Tt,null,e.child&&g(Ti,{node:e.child}),t&&g(lr,{node:e}));const c=e.child&&Kh(e.child);return g(Tt,null,g("div",{className:"pl-4 mb-1"},g("h2",{onclick:()=>{Nt.value=null,re.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(ue,{className:\`cursor-pointer transition \${n?"":"rotate-90"}\`,onclick:u=>{u.preventDefault(),u.stopImmediatePropagation(),Nt.value=null,i(f=>!f)}}),g("div",{className:c?"":"ml-6"},g("span",{className:o?"":"text-neutral-400"},"<"),g("span",{className:o?"":"text-primary"},qh(e)),g("span",{className:o?"":"text-neutral-400"},">"))),!n&&e.child||a!=null&&a&&e.child?g(Ti,{node:e.child}):null),t&&g(lr,{node:e}))}function lr({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 Qh=()=>{const e=He(null),t=r=>{if(!r)return null;const a=r.getAttribute("data-id");if(a!=null)return Ls.peek().get(a)},n=r=>{if(!r)return;const a=t(r);a!=null&&(r.scrollIntoView({behavior:"smooth"}),re.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 ar(["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],r=>{if(Nt.value&&(Nt.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()}}),ar("l",r=>{r.ctrlKey&&(r.preventDefault(),e.current?.focus({preventScroll:!1}))}),{searchRef:e}},Jh=e=>{go.value=e.target.value,Nt.value&&(Nt.value=null)};function tf(){const{searchRef:e}=Qh(),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:go,oninput:Jh})),t?.rootNode&&g(Ti,{node:t.rootNode}))}const Ml=e=>{const{mouse:t}=jh(),n=J(null),i=J(0),s=J(0),o=He(null),r=Yh(o),a=He(null),[l,c]=Array.isArray(e.children)?e.children:[];return ao(()=>{a.current&&(s.value=a.current.clientWidth/2)},[a.current]),Le("mouseup",Ke(()=>n.value=null,[])),Le("mousemove",Ke(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)},[])),Le("resize",Ke(()=>{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))},ef=()=>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"})),nf=()=>{Ze.value=!Ze.value,Ve.send({type:"set-inspect-enabled",value:Ze.value})};function sf(){const e=Lt.value,t=re.value,n=ge();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;_h(window.__devtoolsSelection,"no selection ptr");const{app:o,node:r}=window.__devtoolsSelection;window.__devtoolsSelection=null,Lt.value=o,re.value=r,Nt.value=r,Ze.value=!1};return Ve.addEventListener(i),()=>Ve.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=oe.peek().find(s=>s.name===i.currentTarget.value)??null},g("option",{value:"",disabled:!0},"Select App"),oe.value.map(i=>g("option",{key:i.id,value:i.name},i.name))),g("button",{title:"Toggle Component Inspection",onclick:nf,className:\`p-1 rounded \${Ze.value?"bg-neutral-900":""}\`},g(ef,null)))),g(Ml,null,e&&g(tf,null),t&&e&&g(Hh,{selectedApp:e,selectedNode:t,setSelectedNode:i=>re.value=i,kiruGlobal:U})))}const Fs=G({}),Pe=G([]);U?.stores?.subscribe(e=>{Fs.value=e,Pe.value=Pe.value.filter(t=>Object.values(Fs.value).includes(t))});const El=G(""),of=Bn(()=>El.value.toLowerCase().split(" ").filter(e=>e.length>0));function rf(e){return of.value.every(t=>e.toLowerCase().includes(t))}function af(){const e=Object.entries(Fs.value);return e.length===0?g("div",{className:"flex flex-col items-center justify-center h-full text-neutral-400"},g(uo,null),g("h2",{className:"text-lg italic"},"No stores detected")):g("div",{className:"flex flex-col gap-2 items-start"},g(po,{value:El,className:"sticky top-0"}),g("div",{className:"flex flex-col gap-2 w-full"},e.filter(([t])=>rf(t)).map(([t,n])=>g(lf,{key:t,name:t,store:n}))))}function lf({name:e,store:t}){const n=Pe.value.includes(t),i=ge(),{value:s}=Cl(t);ao(()=>{const r=t.subscribe(()=>i());return()=>r()},[]);const o=Ke(()=>{n?Pe.value=Pe.value.filter(r=>r!==t):Pe.value=[...Pe.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(Bi,{fn:t,onclick:r=>r.stopPropagation()}),g(ue,{className:"transition-all"+(n?" rotate-90":"")}))),n&&g("div",{className:"flex flex-col gap-2 p-2 border border-white border-opacity-10"},g(be,{data:{value:s},mutable:!0,objectRefAcc:[],onChange:(r,a)=>{const l=structuredClone({value:s});lo(l,r,a),t.setState(l.value)}}),g(cf,{store:t})))}function cf({store:e}){const t=oe.value;return t.length===0?null:g(Tt,null,t.map(n=>g(uf,{store:e,app:n})))}const cr=Symbol.for("kiru.hmrAccept"),Cl=e=>{if(cr in e)return e[cr].provide().current;throw new Error("Unable to get store subscribers")};function uf({store:e,app:t}){const n=ge(),{subscribers:i,nodeStateMap:s}=Cl(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=Rs(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(zs,{node:r,nodeStateMap:s})))}function zs({node:e,nodeStateMap:t}){const[n,i]=me(!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,"<"+co(e.ref)+" />"),g("div",{className:"flex gap-2 items-center"},g(Bi,{fn:e.ref.type,onclick:r=>r.stopPropagation()}),g(ue,{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(be,{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(zs,{node:e.child,nodeStateMap:t}))),e.sibling&&g(zs,{node:e.sibling,nodeStateMap:t}))}/*!
5421
- * @kurkle/color v0.3.4
5422
- * https://github.com/kurkle/color#readme
5423
- * (c) 2024 Jukka Kurkela
5424
- * Released under the MIT License
5425
- */function Wn(e){return e+.5|0}const ne=(e,t,n)=>Math.max(Math.min(e,n),t);function Sn(e){return ne(Wn(e*2.55),0,255)}function ae(e){return ne(Wn(e*255),0,255)}function Yt(e){return ne(Wn(e/2.55)/100,0,1)}function ur(e){return ne(Wn(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},Hs=[..."0123456789ABCDEF"],hf=e=>Hs[e&15],ff=e=>Hs[(e&240)>>4]+Hs[e&15],ei=e=>(e&240)>>4===(e&15),df=e=>ei(e.r)&&ei(e.g)&&ei(e.b)&&ei(e.a);function pf(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 gf=(e,t)=>e<255?t(e):"";function mf(e){var t=df(e)?hf:ff;return e?"#"+t(e.r)+t(e.g)+t(e.b)+gf(e.a,t):void 0}const bf=/^(hsla?|hwb|hsv)\\(\\s*([-+.e\\d]+)(?:deg)?[\\s,]+([-+.e\\d]+)%[\\s,]+([-+.e\\d]+)%(?:[\\s,]+([-+.e\\d]+)(%)?)?\\s*\\)$/;function Ol(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 yf(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 xf(e,t,n){const i=Ol(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 vf(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 mo(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=vf(n,i,s,u,o),l=l*60+.5),[l|0,c||0,a]}function bo(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(ae)}function yo(e,t,n){return bo(Ol,e,t,n)}function _f(e,t,n){return bo(xf,e,t,n)}function wf(e,t,n){return bo(yf,e,t,n)}function Pl(e){return(e%360+360)%360}function Sf(e){const t=bf.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?Sn(+t[5]):ae(+t[5]));const s=Pl(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?i=_f(s,o,r):t[1]==="hsv"?i=wf(s,o,r):i=yo(s,o,r),{r:i[0],g:i[1],b:i[2],a:n}}function kf(e,t){var n=mo(e);n[0]=Pl(n[0]+t),n=yo(n),e.r=n[0],e.g=n[1],e.b=n[2]}function Tf(e){if(!e)return;const t=mo(e),n=t[0],i=ur(t[1]),s=ur(t[2]);return e.a<255?\`hsla(\${n}, \${i}%, \${s}%, \${Yt(e.a)})\`:\`hsl(\${n}, \${i}%, \${s}%)\`}const hr={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"},fr={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 Mf(){const e={},t=Object.keys(fr),n=Object.keys(hr);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,hr[o]);o=parseInt(fr[r],16),e[a]=[o>>16&255,o>>8&255,o&255]}return e}let ni;function Ef(e){ni||(ni=Mf(),ni.transparent=[0,0,0,0]);const t=ni[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Cf=/^rgba?\\(\\s*([-+.\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?(?:[\\s,/]+([-+.e\\d]+)(%)?)?\\s*\\)$/;function Of(e){const t=Cf.exec(e);let n=255,i,s,o;if(t){if(t[7]!==i){const r=+t[7];n=t[8]?Sn(r):ne(r*255,0,255)}return i=+t[1],s=+t[3],o=+t[5],i=255&(t[2]?Sn(i):ne(i,0,255)),s=255&(t[4]?Sn(s):ne(s,0,255)),o=255&(t[6]?Sn(o):ne(o,0,255)),{r:i,g:s,b:o,a:n}}}function Pf(e){return e&&(e.a<255?\`rgba(\${e.r}, \${e.g}, \${e.b}, \${Yt(e.a)})\`:\`rgb(\${e.r}, \${e.g}, \${e.b})\`)}const is=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,qe=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function Df(e,t,n){const i=qe(Yt(e.r)),s=qe(Yt(e.g)),o=qe(Yt(e.b));return{r:ae(is(i+n*(qe(Yt(t.r))-i))),g:ae(is(s+n*(qe(Yt(t.g))-s))),b:ae(is(o+n*(qe(Yt(t.b))-o))),a:e.a+n*(t.a-e.a)}}function ii(e,t,n){if(e){let i=mo(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=yo(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function Dl(e,t){return e&&Object.assign(t||{},e)}function dr(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=ae(e[3]))):(t=Dl(e,{r:0,g:0,b:0,a:1}),t.a=ae(t.a)),t}function Af(e){return e.charAt(0)==="r"?Of(e):Sf(e)}class Ln{constructor(t){if(t instanceof Ln)return t;const n=typeof t;let i;n==="object"?i=dr(t):n==="string"&&(i=pf(t)||Ef(t)||Af(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Dl(this._rgb);return t&&(t.a=Yt(t.a)),t}set rgb(t){this._rgb=dr(t)}rgbString(){return this._valid?Pf(this._rgb):void 0}hexString(){return this._valid?mf(this._rgb):void 0}hslString(){return this._valid?Tf(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=Df(this._rgb,t._rgb,n)),this}clone(){return new Ln(this.rgb)}alpha(t){return this._rgb.a=ae(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Wn(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 ii(this._rgb,2,t),this}darken(t){return ii(this._rgb,2,-t),this}saturate(t){return ii(this._rgb,1,t),this}desaturate(t){return ii(this._rgb,1,-t),this}rotate(t){return kf(this._rgb,t),this}}/*!
5426
- * Chart.js v4.5.0
5427
- * https://www.chartjs.org
5428
- * (c) 2025 Chart.js Contributors
5429
- * Released under the MIT License
5430
- */function jt(){}const If=(()=>{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 N(e,t){return typeof e>"u"?t:e}const Lf=(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 Al(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function Nf(e,t,n,i){if(!Al(e))return;const s=t[e],o=n[e];V(s)&&V(o)?Nn(s,o,i):t[e]=Ei(o)}function Nn(e,t,n){const i=tt(t)?t:[t],s=i.length;if(!V(e))return e;n=n||{};const o=n.merger||Nf;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 Nn(e,t,{merger:Rf})}function Rf(e,t,n){if(!Al(e))return;const i=t[e],s=n[e];V(i)&&V(s)?En(i,s):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Ei(s))}const pr={"":e=>e,x:e=>e.x,y:e=>e.y};function Ff(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 zf(e){const t=Ff(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function Ci(e,t){return(pr[t]||(pr[t]=zf(t)))(e)}function xo(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Oi=e=>typeof e<"u",he=e=>typeof e=="function",gr=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function Hf(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const et=Math.PI,Ft=2*et,Vf=Ft+et,Pi=Number.POSITIVE_INFINITY,Bf=et/180,kt=et/2,Te=et/4,mr=et*2/3,Il=Math.log10,fe=Math.sign;function Ne(e,t,n){return Math.abs(e-t)<n}function br(e){const t=Math.round(e);e=Ne(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(Il(e))),i=e/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function Wf(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 jf(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Rn(e){return!jf(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function $f(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function Uf(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 Ae(e){return e*(et/180)}function Yf(e){return e*(180/et)}function yr(e){if(!vt(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function Xf(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 Vs(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function qf(e,t){return(e-t+Vf)%Ft-et}function te(e){return(e%Ft+Ft)%Ft}function Ll(e,t,n,i){const s=te(e),o=te(t),r=te(n),a=te(o-s),l=te(r-s),c=te(s-o),u=te(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 Gf(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 vo(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 Ie=(e,t,n,i)=>vo(e,n,i?s=>{const o=e[s][t];return o<n||o===n&&e[s+1][t]===n}:s=>e[s][t]<n),Kf=(e,t,n)=>vo(e,n,i=>e[i][t]>=n);function Zf(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 Nl=["push","pop","shift","splice","unshift"];function Qf(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Nl.forEach(n=>{const i="_onData"+xo(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 xr(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)&&(Nl.forEach(o=>{delete e[o]}),delete e._chartjs)}function Jf(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const Rl=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function Fl(e,t){let n=[],i=!1;return function(...s){n=s,i||(i=!0,Rl.call(window,()=>{i=!1,e.apply(t,n)}))}}function td(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const zl=e=>e==="start"?"left":e==="end"?"right":"center",ft=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,ed=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function nd(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:x}=r.getUserBounds();if(m){if(s=Math.min(Ie(l,u,f).lo,n?i:Ie(t,u,r.getPixelForValue(f)).lo),c){const y=l.slice(0,s+1).reverse().findIndex(v=>!B(v[a.axis]));s-=Math.max(0,y)}s=yt(s,0,i-1)}if(x){let y=Math.max(Ie(l,r.axis,d,!0).hi+1,n?0:Ie(t,u,r.getPixelForValue(d),!0).hi+1);if(c){const v=l.slice(y-1).findIndex(w=>!B(w[a.axis]));y+=Math.max(0,v)}o=yt(y,s,i)-s}else o=i-s}return{start:s,count:o}}function id(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 si=e=>e===0||e===1,vr=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Ft/n)),_r=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Ft/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*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=>si(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=>si(e)?e:vr(e,.075,.3),easeOutElastic:e=>si(e)?e:_r(e,.075,.3),easeInOutElastic(e){return si(e)?e:e<.5?.5*vr(e*2,.1125,.45):.5+.5*_r(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 _o(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function wr(e){return _o(e)?e:new Ln(e)}function ss(e){return _o(e)?e:new Ln(e).saturate(.5).darken(.1).hexString()}const sd=["x","y","borderWidth","radius","tension"],od=["color","borderColor","backgroundColor"];function rd(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:od},numbers:{type:"number",properties:sd}}),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 ad(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Sr=new Map;function ld(e,t){t=t||{};const n=e+JSON.stringify(t);let i=Sr.get(n);return i||(i=new Intl.NumberFormat(e,t),Sr.set(n,i)),i}function Hl(e,t,n){return ld(t,n).format(e)}const cd={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=ud(e,n)}const r=Il(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),Hl(e,i,l)}};function ud(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 Vl={formatters:cd};function hd(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:Vl.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 Be=Object.create(null),Bs=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 os(e,t,n){return typeof t=="string"?Nn(On(e,t),n):Nn(On(e,""),t)}class fd{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)=>ss(s.backgroundColor),this.hoverBorderColor=(i,s)=>ss(s.borderColor),this.hoverColor=(i,s)=>ss(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 os(this,t,n)}get(t){return On(this,t)}describe(t,n){return os(Bs,t,n)}override(t,n){return os(Be,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):N(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var Y=new fd({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[rd,ad,hd]);function dd(e){return!e||B(e.size)||B(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function kr(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 Me(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 Tr(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Ws(e,t,n,i){Bl(e,t,n,i,null)}function Bl(e,t,n,i,s){let o,r,a,l,c,u,f,d;const m=t.pointStyle,x=t.rotation,y=t.radius;let v=(x||0)*Bf;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(y)||y<=0)){switch(e.beginPath(),m){default:s?e.ellipse(n,i,s/2,y,0,0,Ft):e.arc(n,i,y,0,Ft),e.closePath();break;case"triangle":u=s?s/2:y,e.moveTo(n+Math.sin(v)*u,i-Math.cos(v)*y),v+=mr,e.lineTo(n+Math.sin(v)*u,i-Math.cos(v)*y),v+=mr,e.lineTo(n+Math.sin(v)*u,i-Math.cos(v)*y),e.closePath();break;case"rectRounded":c=y*.516,l=y-c,r=Math.cos(v+Te)*l,f=Math.cos(v+Te)*(s?s/2-c:l),a=Math.sin(v+Te)*l,d=Math.sin(v+Te)*(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(!x){l=Math.SQRT1_2*y,u=s?s/2:l,e.rect(n-u,i-l,2*u,2*l);break}v+=Te;case"rectRot":f=Math.cos(v)*(s?s/2:y),r=Math.cos(v)*y,a=Math.sin(v)*y,d=Math.sin(v)*(s?s/2:y),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+=Te;case"cross":f=Math.cos(v)*(s?s/2:y),r=Math.cos(v)*y,a=Math.sin(v)*y,d=Math.sin(v)*(s?s/2:y),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:y),r=Math.cos(v)*y,a=Math.sin(v)*y,d=Math.sin(v)*(s?s/2:y),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+=Te,f=Math.cos(v)*(s?s/2:y),r=Math.cos(v)*y,a=Math.sin(v)*y,d=Math.sin(v)*(s?s/2:y),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)*y,a=Math.sin(v)*y,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:y),i+Math.sin(v)*y);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 wo(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function So(e){e.restore()}function pd(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 gd(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 md(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 bd(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 yd(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,md(e,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&yd(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),bd(e,n,i,c,o),i+=Number(s.lineHeight);e.restore()}function js(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 xd=/^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/,vd=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function _d(e,t){const n=(""+e).match(xd);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 wd=e=>+e||0;function Wl(e,t){const n={},i=V(t),s=i?Object.keys(t):t,o=V(e)?i?r=>N(e[r],e[t[r]]):r=>e[r]:()=>e;for(const r of s)n[r]=wd(o(r));return n}function Sd(e){return Wl(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Pn(e){return Wl(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Mt(e){const t=Sd(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=N(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=N(e.style,t.style);i&&!(""+i).match(vd)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:N(e.family,t.family),lineHeight:_d(N(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:N(e.weight,t.weight),string:""};return s.string=dd(s),s}function oi(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 kd(e,t,n){const{min:i,max:s}=e,o=Lf(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 je(e,t){return Object.assign(Object.create(e),t)}function ko(e,t=[""],n,i,s=()=>e[0]){const o=n||e;typeof i>"u"&&(i=Yl("_fallback",e));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:i,_getTarget:s,override:a=>ko([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 $l(a,l,()=>Ad(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return Er(a).includes(l)},ownKeys(a){return Er(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:jl(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 $l(o,r,()=>Md(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 jl(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:he(n)?n:()=>n,isIndexable:he(i)?i:()=>i}}const Td=(e,t)=>e?e+xo(t):t,To=(e,t)=>V(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function $l(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const i=n();return e[t]=i,i}function Md(e,t,n){const{_proxy:i,_context:s,_subProxy:o,_descriptors:r}=e;let a=i[t];return he(a)&&r.isScriptable(t)&&(a=Ed(t,a,e,n)),tt(a)&&a.length&&(a=Cd(t,a,e,r.isIndexable)),To(t,a)&&(a=nn(a,s,o&&o[t],r)),a}function Ed(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),To(e,l)&&(l=Mo(s._scopes,s,e,l)),l}function Cd(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=Mo(c,s,e,u);t.push(nn(f,o,r&&r[e],a))}}return t}function Ul(e,t,n){return he(e)?e(t,n):e}const Od=(e,t)=>e===!0?t:typeof e=="string"?Ci(t,e):void 0;function Pd(e,t,n,i,s){for(const o of t){const r=Od(n,o);if(r){e.add(r);const a=Ul(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 Mo(e,t,n,i){const s=t._rootScopes,o=Ul(t._fallback,n,i),r=[...e,...s],a=new Set;a.add(i);let l=Mr(a,r,n,o||n,i);return l===null||typeof o<"u"&&o!==n&&(l=Mr(a,r,o,l,i),l===null)?!1:ko(Array.from(a),[""],s,o,()=>Dd(t,n,i))}function Mr(e,t,n,i,s){for(;n;)n=Pd(e,t,n,i,s);return n}function Dd(e,t,n){const i=e._getTarget();t in i||(i[t]={});const s=i[t];return tt(s)&&V(n)?n:s||{}}function Ad(e,t,n,i){let s;for(const o of t)if(s=Yl(Td(o,e),n),typeof s<"u")return To(e,s)?Mo(n,i,e,s):s}function Yl(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function Er(e){let t=e._keys;return t||(t=e._keys=Id(e._scopes)),t}function Id(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 Ld=Number.EPSILON||1e-14,sn=(e,t)=>t<e.length&&!e[t].skip&&e[t],Xl=e=>e==="x"?"y":"x";function Nd(e,t,n,i){const s=e.skip?t:e,o=t,r=n.skip?t:n,a=Vs(o,s),l=Vs(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 Rd(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(Ne(t[u],0,Ld)){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 Fd(e,t,n="x"){const i=Xl(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 zd(e,t="x"){const n=Xl(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?fe(s[r-1])!==fe(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}Rd(e,s,o),Fd(e,o,t)}function ri(e,t,n){return Math.max(Math.min(e,n),t)}function Hd(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=ri(s.cp1x,t.left,t.right),s.cp1y=ri(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=ri(s.cp2x,t.left,t.right),s.cp2y=ri(s.cp2y,t.top,t.bottom)))}function Vd(e,t,n,i,s){let o,r,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")zd(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=Nd(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&&Hd(e,n)}function Eo(){return typeof window<"u"&&typeof document<"u"}function Co(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 Wi=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function Bd(e,t){return Wi(e).getPropertyValue(t)}const Wd=["top","right","bottom","left"];function Re(e,t,n){const i={};n=n?"-"+n:"";for(let s=0;s<4;s++){const o=Wd[s];i[o]=parseFloat(e[t+"-"+o+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const jd=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function $d(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:s,offsetY:o}=i;let r=!1,a,l;if(jd(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=Wi(n),o=s.boxSizing==="border-box",r=Re(s,"padding"),a=Re(s,"border","width"),{x:l,y:c,box:u}=$d(e,n),f=r.left+(u&&a.left),d=r.top+(u&&a.top);let{width:m,height:x}=t;return o&&(m-=r.width+a.width,x-=r.height+a.height),{x:Math.round((l-f)/m*n.width/i),y:Math.round((c-d)/x*n.height/i)}}function Ud(e,t,n){let i,s;if(t===void 0||n===void 0){const o=e&&Co(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const r=o.getBoundingClientRect(),a=Wi(o),l=Re(a,"border","width"),c=Re(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 ai=e=>Math.round(e*10)/10;function Yd(e,t,n,i){const s=Wi(e),o=Re(s,"margin"),r=Ai(s.maxWidth,e,"clientWidth")||Pi,a=Ai(s.maxHeight,e,"clientHeight")||Pi,l=Ud(e,t,n);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const d=Re(s,"border","width"),m=Re(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=ai(Math.min(c,r,l.maxWidth)),u=ai(Math.min(u,a,l.maxHeight)),c&&!u&&(u=ai(c/2)),(t!==void 0||n!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=ai(Math.floor(u*i))),{width:c,height:u}}function Cr(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 Xd=(function(){let e=!1;try{const t={get passive(){return e=!0,!1}};Eo()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();function Or(e,t){const n=Bd(e,t),i=n&&n.match(/^(\\d+)(\\.\\d+)?px$/);return i?+i[1]:void 0}function Ce(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function qd(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 Gd(e,t,n,i){const s={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},r=Ce(e,s,n),a=Ce(s,o,n),l=Ce(o,t,n),c=Ce(r,a,n),u=Ce(a,l,n);return Ce(c,u,n)}const Kd=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}}},Zd=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Qe(e,t,n){return e?Kd(t,n):Zd()}function ql(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 Gl(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function Kl(e){return e==="angle"?{between:Ll,compare:qf,normalize:te}:{between:kn,compare:(t,n)=>t-n,normalize:t=>t}}function Pr({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 Qd(e,t,n){const{property:i,start:s,end:o}=n,{between:r,normalize:a}=Kl(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 Jd(e,t,n){if(!n)return[e];const{property:i,start:s,end:o}=n,r=t.length,{compare:a,between:l,normalize:c}=Kl(i),{start:u,end:f,loop:d,style:m}=Qd(e,t,n),x=[];let y=!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=()=>y||O(),P=()=>!y||T();for(let E=u,A=u;E<=f;++E)k=t[E%r],!k.skip&&(w=c(k[i]),w!==C&&(y=l(w,s,o),v===null&&D()&&(v=a(w,s)===0?E:A),v!==null&&P()&&(x.push(Pr({start:v,end:E,loop:d,count:r,style:m})),v=null),A=E,C=w));return v!==null&&x.push(Pr({start:v,end:f,loop:d,count:r,style:m})),x}function tp(e,t){const n=[],i=e.segments;for(let s=0;s<i.length;s++){const o=Jd(i[s],e.points,t);o.length&&n.push(...o)}return n}function ep(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 np(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 ip(e,t){const n=e.points,i=e.options.spanGaps,s=n.length;if(!s)return[];const o=!!e._loop,{start:r,end:a}=ep(n,s,o,i);if(i===!0)return Dr(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 Dr(e,np(n,r,l,c),n,t)}function Dr(e,t,n,i){return!i||!i.setContext||!n?t:sp(e,t,n,i)}function sp(e,t,n,i){const s=e._chart.getContext(),o=Ar(e.options),{_datasetIndex:r,options:{spanGaps:a}}=e,l=n.length,c=[];let u=o,f=t[0].start,d=f;function m(x,y,v,w){const k=a?-1:1;if(x!==y){for(x+=l;n[x%l].skip;)x-=k;for(;n[y%l].skip;)y+=k;x%l!==y%l&&(c.push({start:x%l,end:y%l,loop:v,style:w}),u=w,f=y%l)}}for(const x of t){f=a?f:x.start;let y=n[f%l],v;for(d=f+1;d<=x.end;d++){const w=n[d%l];v=Ar(i.setContext(je(s,{type:"segment",p0:y,p1:w,p0DataIndex:(d-1)%l,p1DataIndex:d%l,datasetIndex:r}))),op(v,u)&&m(f,d-1,x.loop,u),y=w,u=v}f<d-1&&m(f,d-1,x.loop,u)}return c}function Ar(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function op(e,t){if(!t)return!1;const n=[],i=function(s,o){return _o(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(e,i)!==JSON.stringify(t,i)}function li(e,t,n){return e.options.clip?e[n]:t[n]}function rp(e,t){const{xScale:n,yScale:i}=e;return n&&i?{left:li(n,t,"left"),right:li(n,t,"right"),top:li(i,t,"top"),bottom:li(i,t,"bottom")}:t}function ap(e,t){const n=t._clip;if(n.disabled)return!1;const i=rp(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)}}/*!
5431
- * Chart.js v4.5.0
5432
- * https://www.chartjs.org
5433
- * (c) 2025 Chart.js Contributors
5434
- * Released under the MIT License
5435
- */class lp{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=Rl.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 lp;const Ir="transparent",cp={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=wr(e||Ir),s=i.valid&&wr(t||Ir);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class up{constructor(t,n,i,s){const o=n[i];s=oi([t.to,s,o,t.from]);const r=oi([t.from,o,s]);this._active=!0,this._fn=t.fn||cp[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=oi([t.to,n,s,t.from]),this._from=oi([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 Zl{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=fp(t,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&hp(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 up(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 hp(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 fp(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 Lr(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 dp(e,t,n){if(n===!1)return!1;const i=Lr(e,n),s=Lr(t,n);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function pp(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 Ql(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 Nr(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||fe(t)===fe(c))&&(t+=c)}return!u&&!i.all?0:t}function gp(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 rs(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function mp(e,t,n){return\`\${e.id}.\${t.id}.\${n.stack||n.type}\`}function bp(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 yp(e,t,n){const i=e[t]||(e[t]={});return i[n]||(i[n]={})}function Rr(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 Fr(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=mp(o,r,i),f=t.length;let d;for(let m=0;m<f;++m){const x=t[m],{[l]:y,[c]:v}=x,w=x._stacks||(x._stacks={});d=w[c]=yp(s,u,y),d[a]=v,d._top=Rr(d,r,!0,i.type),d._bottom=Rr(d,r,!1,i.type);const k=d._visualValues||(d._visualValues={});k[a]=v}}function as(e,t){const n=e.scales;return Object.keys(n).filter(i=>n[i].axis===t).shift()}function xp(e,t){return je(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function vp(e,t,n){return je(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 ls=e=>e==="reset"||e==="none",zr=(e,t)=>t?e:Object.assign({},e),_p=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Ql(n,!0),values:null};class Jl{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=rs(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,d,m,x)=>f==="x"?d:f==="r"?x:m,o=n.xAxisID=N(i.xAxisID,as(t,"x")),r=n.yAxisID=N(i.yAxisID,as(t,"y")),a=n.rAxisID=N(i.rAxisID,as(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&&xr(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=gp(n,s)}else if(i!==n){if(i){xr(i,this);const s=this._cachedMeta;bn(s),s._parsed=[]}n&&Object.isExtensible(n)&&Qf(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=rs(n.vScale,n),n.stack!==i.stack&&(s=!0,bn(n),n.stack=i.stack),this._resyncElements(t),(s||o!==n._stacked)&&(Fr(this,n._parsed),n._stacked=rs(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&&Fr(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,x;for(d=0,m=s;d<m;++d)x=d+i,f[d]={[a]:u||o.parse(c[x],x),[l]:r.parse(n[x],x)};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:Ql(s,!0),values:n._stacks[t.axis]._visualValues};return Nr(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=Nr(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=_p(n,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=bp(a);let d,m;function x(){m=s[d];const y=m[a.axis];return!vt(m[t.axis])||u>y||f<y}for(d=0;d<r&&!(!x()&&(this.updateRangeFromParsed(c,t,m,l),o));++d);if(o){for(d=r-1;d>=0;--d)if(!x()){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=pp(N(this.options.clip,dp(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=vp(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=xp(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 zr(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]),x=()=>this.getContext(i,s,n),y=c.resolveNamedOptions(d,m,x,f);return y.$shared&&(y.$shared=l,o[r]=Object.freeze(zr(y,l))),y}_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 Zl(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||ls(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){ls(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!ls(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 wp extends Jl{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}=nd(n,s,r);this._drawStart=a,this._drawCount=l,id(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:x,segment:y}=this.options,v=Rn(x)?x: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[d]=r.getPixelForValue(E[d],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[d]-O[d])>v,y&&(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 Ee(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Oo{static override(t){Object.assign(Oo.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Ee()}parse(){return Ee()}format(){return Ee()}add(){return Ee()}diff(){return Ee()}startOf(){return Ee()}endOf(){return Ee()}}var Sp={_date:Oo};function kp(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?Kf:Ie;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(y=>!B(y[f.axis]));u.lo-=Math.max(0,m);const x=d.slice(u.hi).findIndex(y=>!B(y[f.axis]));u.hi+=Math.max(0,x)}return u}}return{lo:0,hi:o.length-1}}function ji(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}=kp(o[a],t,r,s);for(let m=f;m<=d;++m){const x=u[m];x.skip||i(x,c,m)}}}function Tp(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 cs(e,t,n,i,s){const o=[];return!s&&!e.isPointInArea(t)||ji(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 Mp(e,t,n,i){let s=[];function o(r,a,l){const{startAngle:c,endAngle:u}=r.getProps(["startAngle","endAngle"],i),{angle:f}=Xf(r,{x:t.x,y:t.y});Ll(f,c,u)&&s.push({element:r,datasetIndex:a,index:l})}return ji(e,n,t,o),s}function Ep(e,t,n,i,s,o){let r=[];const a=Tp(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 x=u.getCenterPoint(s);if(!(!!o||e.isPointInArea(x))&&!m)return;const v=a(t,x);v<l?(r=[{element:u,datasetIndex:f,index:d}],l=v):v===l&&r.push({element:u,datasetIndex:f,index:d})}return ji(e,n,t,c),r}function us(e,t,n,i,s,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!i?Mp(e,t,n,s):Ep(e,t,n,i,s,o)}function Hr(e,t,n,i,s){const o=[],r=n==="x"?"inXRange":"inYRange";let a=!1;return ji(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 Cp={modes:{index(e,t,n,i){const s=It(t,e),o=n.axis||"x",r=n.includeInvisible||!1,a=n.intersect?cs(e,s,o,i,r):us(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?cs(e,s,o,i,r):us(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 cs(e,s,o,i,r)},nearest(e,t,n,i){const s=It(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;return us(e,s,o,n.intersect,i,r)},x(e,t,n,i){const s=It(t,e);return Hr(e,s,"x",n.intersect,i)},y(e,t,n,i){const s=It(t,e);return Hr(e,s,"y",n.intersect,i)}}};const tc=["left","top","right","bottom"];function yn(e,t){return e.filter(n=>n.pos===t)}function Vr(e,t){return e.filter(n=>tc.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 Op(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 Pp(e){const t={};for(const n of e){const{stack:i,pos:s,stackWeight:o}=n;if(!i||!tc.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 Dp(e,t){const n=Pp(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 Ap(e){const t=Op(e),n=xn(t.filter(c=>c.box.fullSize),!0),i=xn(yn(t,"left"),!0),s=xn(yn(t,"right")),o=xn(yn(t,"top"),!0),r=xn(yn(t,"bottom")),a=Vr(t,"x"),l=Vr(t,"y");return{fullSize:n,leftAndTop:i.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:yn(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function Br(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function ec(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 Ip(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&&ec(r,o.getPadding());const a=Math.max(0,t.outerWidth-Br(r,e,"left","right")),l=Math.max(0,t.outerHeight-Br(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 Lp(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 Np(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,Np(a.horizontal,t));const{same:f,other:d}=Ip(t,n,a,i);c|=f&&s.length,u=u||d,l.fullSize||s.push(a)}return c&&Tn(s,t,n,i)||u}function ci(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 Wr(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?ci(l,s.left,r,n.outerWidth-s.right-s.left,d):ci(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?ci(l,o,s.top,d,n.outerHeight-s.bottom-s.top):ci(l,o,t.top+c.placed,d,f),c.start=o,c.placed+=f,o=l.right}}t.x=o,t.y=r}var ie={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=Ap(e.boxes),l=a.vertical,c=a.horizontal;F(e.boxes,y=>{typeof y.beforeLayout=="function"&&y.beforeLayout()});const u=l.reduce((y,v)=>v.box.options&&v.box.options.display===!1?y:y+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);ec(d,Mt(i));const m=Object.assign({maxPadding:d,w:o,h:r,x:s.left,y:s.top},s),x=Dp(l.concat(c),f);Tn(a.fullSize,m,f,x),Tn(l,m,f,x),Tn(c,m,f,x)&&Tn(l,m,f,x),Lp(m),Wr(a.leftAndTop,m,f,x),m.x+=m.w,m.y+=m.h,Wr(a.rightAndBottom,m,f,x),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,y=>{const v=y.box;Object.assign(v,e.chartArea),v.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class nc{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 Rp extends nc{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const bi="$chartjs",Fp={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},jr=e=>e===null||e==="";function zp(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",jr(s)){const o=Or(e,"width");o!==void 0&&(e.width=o)}if(jr(i))if(e.style.height==="")e.height=e.width/(t||2);else{const o=Or(e,"height");o!==void 0&&(e.height=o)}return e}const ic=Xd?{passive:!0}:!1;function Hp(e,t,n){e&&e.addEventListener(t,n,ic)}function Vp(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,ic)}function Bp(e,t){const n=Fp[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 Wp(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 jp(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 Fn=new Map;let $r=0;function sc(){const e=window.devicePixelRatio;e!==$r&&($r=e,Fn.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function $p(e,t){Fn.size||window.addEventListener("resize",sc),Fn.set(e,t)}function Up(e){Fn.delete(e),Fn.size||window.removeEventListener("resize",sc)}function Yp(e,t,n){const i=e.canvas,s=i&&Co(i);if(!s)return;const o=Fl((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),$p(e,o),r}function hs(e,t,n){n&&n.disconnect(),t==="resize"&&Up(e)}function Xp(e,t,n){const i=e.canvas,s=Fl(o=>{e.ctx!==null&&n(Bp(o,e))},e);return Hp(i,t,s),s}class qp extends nc{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(zp(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:Wp,detach:jp,resize:Yp}[n]||Xp;s[n]=r(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:hs,detach:hs,resize:hs}[n]||Vp)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return Yd(t,n,i,s)}isAttached(t){const n=t&&Co(t);return!!(n&&n.isConnected)}}function Gp(e){return!Eo()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Rp:qp}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 Kp(e,t){const n=e.options.ticks,i=Zp(e),s=Math.min(n.maxTicksLimit||i,i),o=n.major.enabled?Jp(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return tg(t,c,o,r/s),c;const u=Qp(o,t,s);if(r>0){let f,d;const m=r>1?Math.round((l-a)/(r-1)):null;for(ui(t,c,u,B(m)?0:a-m,a),f=0,d=r-1;f<d;f++)ui(t,c,u,o[f],o[f+1]);return ui(t,c,u,l,B(m)?t.length:l+m),c}return ui(t,c,u),c}function Zp(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 Qp(e,t,n){const i=eg(e),s=t.length/n;if(!i)return Math.max(s,1);const o=Wf(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 Jp(e){const t=[];let n,i;for(n=0,i=e.length;n<i;n++)e[n].major&&t.push(n);return t}function tg(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 ui(e,t,n,i,s){const o=N(i,0),r=Math.min(N(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 eg(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 ng=e=>e==="left"?"right":e==="right"?"left":e,Ur=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Yr=(e,t)=>Math.min(t||e,e);function Xr(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 ig(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 sg(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 qr(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 og(e,t){return je(e,{scale:t,type:"scale"})}function rg(e,t,n){return je(e,{tick:n,index:t,type:"tick"})}function ag(e,t,n){let i=zl(e);return(n&&t!=="right"||!n&&t==="right")&&(i=ng(i)),i}function lg(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,x;const y=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];x=u[w].getPixelForValue(k)+y-t}else n==="center"?x=(c.bottom+c.top)/2+y-t:x=Ur(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=Ur(e,n,t);x=ft(i,r,s),f=n==="left"?-kt:kt}return{titleX:m,titleY:x,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=kd(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Xr(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=Kp(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=Yr(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=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-qr(t.title,this.chart.options.font),c=Math.sqrt(f*f+d*d),r=Yf(Math.min(Math.asin(yt((u.highest.height+6)/a,-1,1)),Math.asin(yt(l/c,-1,1))-Math.asin(yt(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=qr(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:d}=this._getLabelSizes(),m=i.padding*2,x=Ae(this.labelRotation),y=Math.cos(x),v=Math.sin(x);if(a){const w=i.mirror?0:v*f.width+y*d.height;t.height=Math.min(this.maxHeight,t.height+w+m)}else{const w=i.mirror?0:y*f.width+v*d.height;t.width=Math.min(this.maxWidth,t.width+w+m)}this._calculatePadding(c,u,v,y)}}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=Xr(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/Yr(n,i));let c=0,u=0,f,d,m,x,y,v,w,k,C,O,T;for(f=0;f<n;f+=l){if(x=t[f].label,y=this._resolveTickFontOptions(f),s.font=v=y.string,w=o[v]=o[v]||{data:{},gc:[]},k=y.lineHeight,C=O=0,!B(x)&&!tt(x))C=kr(s,w.data,w.gc,C,x),O=k;else if(tt(x))for(d=0,m=x.length;d<m;++d)T=x[d],!B(T)&&!tt(T)&&(C=kr(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)}sg(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 Gf(this._alignToPixels?Me(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=rg(this.getContext(),t,i))}return this.$context||(this.$context=og(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Ae(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=vn(o),m=[],x=a.setContext(this.getContext()),y=x.display?x.width:0,v=y/2,w=function(q){return Me(i,q,y)};let k,C,O,T,D,P,E,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,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+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,E=D-d,z=t.left,H=t.right}const nt=N(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),Ue=a.setContext(q),ye=it.lineWidth,Kt=it.color,Ye=Ue.dash||[],dt=Ue.dashOffset,xe=it.tickWidth,wt=it.tickColor,ve=it.tickBorderDash||[],Vt=it.tickBorderDashOffset;O=ig(this,C,l),O!==void 0&&(T=Me(i,O,ye),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:ye,color:Kt,borderDash:Ye,borderDashOffset:dt,tickWidth:xe,tickColor:wt,tickBorderDash:ve,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=vn(i.grid),m=d+u,x=f?-u:m,y=-Ae(this.labelRotation),v=[];let w,k,C,O,T,D,P,E,A,z,L,H,Z="middle";if(s==="top")D=this.bottom-x,P=this._getXAxisLabelAlignment();else if(s==="bottom")D=this.top+x,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){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,Ue=j.textStrokeColor,ye=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"||y!==0?H=-L*z+z/2:c==="center"?H=-nt.highest.height/2-q*z+z:H=-nt.highest.height+z/2:c==="near"||y!==0?H=z/2:c==="center"?H=nt.highest.height/2-q*z:H=nt.highest.height-L*z,f&&(H*=-1),y!==0&&!j.showLabelBackdrop&&(T+=z/2*Math.sin(y))):(D=E,H=(1-L)*z/2);let Ye;if(j.showLabelBackdrop){const dt=Mt(j.backdropPadding),xe=nt.heights[w],wt=nt.widths[w];let ve=H-dt.top,Vt=0-dt.left;switch(Z){case"middle":ve-=xe/2;break;case"bottom":ve-=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}Ye={left:Vt,top:ve,width:wt+dt.width,height:xe+dt.height,color:j.backdropColor}}v.push({label:O,font:A,textOffset:H,options:{rotation:y,color:it,strokeColor:Ue,strokeWidth:ye,textAlign:Kt,textBaseline:Z,translation:[T,D],backdrop:Ye}})}return v}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Ae(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=Me(t,this.left,r)-r/2,u=Me(t,this.right,a)+a/2,f=d=l):(f=Me(t,this.top,r)-r/2,d=Me(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&&wo(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&&So(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}=lg(this,l,n,a);Di(t,i.text,0,0,o,{color:i.color,maxWidth:f,rotation:d,textAlign:ag(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=N(t.grid&&t.grid.z,-1),s=N(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 hi{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;hg(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,cg(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 Be[i])}}function cg(e,t,n){const i=Nn(Object.create(null),[n?Y.get(n):{},Y.get(t),e.defaults]);Y.set(t,i),e.defaultRoutes&&ug(t,e.defaultRoutes),e.descriptors&&Y.describe(t,e.descriptors)}function ug(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 hg(e){return"id"in e&&"defaults"in e}class fg{constructor(){this.controllers=new hi(Jl,"datasets",!0),this.elements=new hi(on,"elements"),this.plugins=new hi(Object,"plugins"),this.scales=new hi(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=xo(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 fg;class dg{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=N(i.options&&i.options.plugins,{}),o=pg(i);return s===!1&&!n?[]:mg(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 pg(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 gg(e,t){return!t&&e===!1?null:e===!0?{}:e}function mg(e,{plugins:t,localIds:n},i,s){const o=[],r=e.getContext();for(const a of t){const l=a.id,c=gg(i[l],s);c!==null&&o.push({plugin:a,options:bg(e.config,{plugin:a,local:n[l]},c,r)})}return o}function bg(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 $s(e,t){const n=Y.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function yg(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function xg(e,t){return e===t?"_index_":"_value_"}function Gr(e){if(e==="x"||e==="y"||e==="r")return e}function vg(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Us(e,...t){if(Gr(e))return e;for(const n of t){const i=n.axis||vg(n.position)||e.length>1&&Gr(e[0].toLowerCase());if(i)return i}throw new Error(\`Cannot determine type of '\${e}' axis. Please provide 'axis' or 'position' option.\`)}function Kr(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function _g(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 Kr(e,"x",n[0])||Kr(e,"y",n[0])}return{}}function wg(e,t){const n=Be[e.type]||{scales:{}},i=t.scales||{},s=$s(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=Us(r,a,_g(r,e),Y.scales[a.type]),c=xg(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||$s(a,t),u=(Be[a]||{}).scales||{};Object.keys(u).forEach(f=>{const d=yg(f,l),m=r[d+"AxisID"]||d;o[m]=o[m]||Object.create(null),En(o[m],[{axis:d},i[m],u[f]])})}),Object.keys(o).forEach(r=>{const a=o[r];En(a,[Y.scales[a.type],Y.scale])}),o}function oc(e){const t=e.options||(e.options={});t.plugins=N(t.plugins,{}),t.scales=wg(e,t)}function rc(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Sg(e){return e=e||{},e.data=rc(e.data),oc(e),e}const Zr=new Map,ac=new Set;function fi(e,t){let n=Zr.get(e);return n||(n=t(),Zr.set(e,n),ac.add(n)),n}const _n=(e,t,n)=>{const i=Ci(t,n);i!==void 0&&e.add(i)};class kg{constructor(t){this._config=Sg(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=rc(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(),oc(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return fi(t,()=>[[\`datasets.\${t}\`,""]])}datasetAnimationScopeKeys(t,n){return fi(\`\${t}.transition.\${n}\`,()=>[[\`datasets.\${t}.transitions.\${n}\`,\`transitions.\${n}\`],[\`datasets.\${t}\`,""]])}datasetElementScopeKeys(t,n){return fi(\`\${t}-\${n}\`,()=>[[\`datasets.\${t}.elements.\${n}\`,\`datasets.\${t}\`,\`elements.\${n}\`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return fi(\`\${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,Be[o]||{},f)),u.forEach(f=>_n(l,Y,f)),u.forEach(f=>_n(l,Bs,f))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),ac.has(n)&&r.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Be[n]||{},Y.datasets[n]||{},{type:n},Y,Bs]}resolveNamedOptions(t,n,i,s=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=Qr(this._resolverCache,t,s);let l=r;if(Mg(r,n)){o.$shared=!1,i=he(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:ko(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,o)),o}const Tg=e=>V(e)&&Object.getOwnPropertyNames(e).some(t=>he(e[t]));function Mg(e,t){const{isScriptable:n,isIndexable:i}=jl(e);for(const s of t){const o=n(s),r=i(s),a=(r||o)&&e[s];if(o&&(he(a)||Tg(a))||r&&tt(a))return!0}return!1}var Eg="4.5.0";const Cg=["top","bottom","left","right","chartArea"];function Jr(e,t){return e==="top"||e==="bottom"||Cg.indexOf(e)===-1&&t==="x"}function ta(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function ea(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),I(n&&n.onComplete,[e],t)}function Og(e){const t=e.chart,n=t.options.animation;I(n&&n.onProgress,[e],t)}function lc(e){return Eo()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const yi={},na=e=>{const t=lc(e);return Object.values(yi).filter(n=>n.canvas===t).pop()};function Pg(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 Dg(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}class Ys{static defaults=Y;static instances=yi;static overrides=Be;static registry=At;static version=Eg;static getChart=na;static register(...t){At.add(...t),ia()}static unregister(...t){At.remove(...t),ia()}constructor(t,n){const i=this.config=new kg(n),s=lc(t),o=na(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||Gp(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=If(),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 dg,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=td(f=>this.update(f),r.resizeDelay||0),this._dataChanges=[],yi[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}$t.listen(this,"complete",ea),$t.listen(this,"progress",Og),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():Cr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Tr(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,Cr(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=Us(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=Us(l,a),u=N(a.type,r.dtype);(a.position===void 0||Jr(a.position,c)!==Jr(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=>{ie.configure(this,r,r.options),ie.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(ta("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||$s(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(ta("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=>{ie.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!gr(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;Pg(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(!gr(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;ie.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,he(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(),ea({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=ap(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&wo(n,s),t.controller.draw(),s&&So(n),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return en(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){const o=Cp.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=je(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(),Tr(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete yi[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=Hf(t),c=Dg(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 ia(){return F(Ys.instances,e=>e._plugins.invalidate())}function cc(e,t,n=t){e.lineCap=N(n.borderCapStyle,t.borderCapStyle),e.setLineDash(N(n.borderDash,t.borderDash)),e.lineDashOffset=N(n.borderDashOffset,t.borderDashOffset),e.lineJoin=N(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=N(n.borderWidth,t.borderWidth),e.strokeStyle=N(n.borderColor,t.borderColor)}function Ag(e,t,n){e.lineTo(n.x,n.y)}function Ig(e){return e.stepped?pd:e.tension||e.cubicInterpolationMode==="monotone"?gd:Ag}function uc(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 Lg(e,t,n,i){const{points:s,options:o}=t,{count:r,start:a,loop:l,ilen:c}=uc(s,n,i),u=Ig(o);let{move:f=!0,reverse:d}=i||{},m,x,y;for(m=0;m<=c;++m)x=s[(a+(d?c-m:m))%r],!x.skip&&(f?(e.moveTo(x.x,x.y),f=!1):u(e,y,x,d,o.stepped),y=x);return l&&(x=s[(a+(d?c:0))%r],u(e,y,x,d,o.stepped)),!!l}function Ng(e,t,n,i){const s=t.points,{count:o,start:r,ilen:a}=uc(s,n,i),{move:l=!0,reverse:c}=i||{};let u=0,f=0,d,m,x,y,v,w;const k=O=>(r+(c?a-O:O))%o,C=()=>{y!==v&&(e.lineTo(u,v),e.lineTo(u,y),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 O=m.x,T=m.y,D=O|0;D===x?(T<y?y=T:T>v&&(v=T),u=(f*u+O)/++f):(C(),e.lineTo(O,T),x=D,f=0,y=v=T),w=T}C()}function Xs(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?Ng:Lg}function Rg(e){return e.stepped?qd:e.tension||e.cubicInterpolationMode==="monotone"?Gd:Ce}function Fg(e,t,n,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,i)&&s.closePath()),cc(e,t.options),e.stroke(s)}function zg(e,t,n,i){const{segments:s,options:o}=t,r=Xs(t);for(const a of s)cc(e,o,a.style),e.beginPath(),r(e,t,a,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const Hg=typeof Path2D=="function";function Vg(e,t,n,i){Hg&&!t.options.segment?Fg(e,t,n,i):zg(e,t,n,i)}class Bg 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;Vd(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=ip(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=tp(this,{property:n,start:s,end:s});if(!r.length)return;const a=[],l=Rg(i);let c,u;for(c=0,u=r.length;c<u;++c){const{start:f,end:d}=r[c],m=o[f],x=o[d];if(m===x){a.push(m);continue}const y=Math.abs((s-m[n])/(x[n]-m[n])),v=l(m,x,y,i.stepped);v[n]=t[n],a.push(v)}return a.length===1?a[0]:a}pathSegment(t,n,i){return Xs(this)(t,this,n,i)}path(t,n,i){const s=this.segments,o=Xs(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(),Vg(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function sa(e,t,n,i){const s=e.options,{[n]:o}=e.getProps([n],i);return Math.abs(t-o)<s.radius+s.hitRadius}class Wg 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 sa(this,t,"x",n)}inYRange(t,n){return sa(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,Ws(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}const oa=(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)}},jg=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class ra 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}=oa(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((x,y)=>{const v=i+n/2+o.measureText(x.text).width;(y===0||c[c.length-1]+v+2*a>r)&&(f+=u,c[c.length-(y>0?0:1)]=0,m+=u,d++),l[y]={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,x=0,y=0;return this.legendItems.forEach((v,w)=>{const{itemWidth:k,itemHeight:C}=$g(i,n,o,v,s);w>0&&m+C+2*a>u&&(f+=d+a,c.push({width:d,height:m}),x+=d+a,y++,d=m=0),l[w]={left:x,top:m,col:y,width:k,height:C},d=Math.max(d,k),m+=C+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=Qe(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;wo(t,this),this._draw(),So(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:s}=this,{align:o,labels:r}=t,a=Y.color,l=Qe(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:x,boxHeight:y,itemHeight:v}=oa(r,f),w=function(D,P,E){if(isNaN(x)||x<=0||isNaN(y)||y<0)return;s.save();const A=N(E.lineWidth,1);if(s.fillStyle=N(E.fillStyle,a),s.lineCap=N(E.lineCap,"butt"),s.lineDashOffset=N(E.lineDashOffset,0),s.lineJoin=N(E.lineJoin,"miter"),s.lineWidth=A,s.strokeStyle=N(E.strokeStyle,a),s.setLineDash(N(E.lineDash,[])),r.usePointStyle){const z={radius:y*Math.SQRT2/2,pointStyle:E.pointStyle,rotation:E.rotation,borderWidth:A},L=l.xPlus(D,x/2),H=P+d;Bl(s,z,L,H,r.pointStyleWidth&&x)}else{const z=P+Math.max((f-y)/2,0),L=l.leftForLtr(D,x),H=Pn(E.borderRadius);s.beginPath(),Object.values(H).some(Z=>Z!==0)?js(s,{x:L,y:z,w:x,h:y,radius:H}):s.rect(L,z,x,y),s.fill(),A!==0&&s.stroke()}s.restore()},k=function(D,P,E){Di(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},ql(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=x+d+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=ed(A,L+x+d,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+=hc(D,nt)+u}else m.y+=T}),Gl(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=Qe(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 x=this.columnSizes.reduce((y,v)=>Math.max(y,v.height),0);u=c+ft(t.align,this.top,this.bottom-x-t.labels.padding-this._computeTitleHeight())}const m=ft(a,f,f+d);r.textAlign=o.textAlign(zl(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(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(!Xg(t.type,n))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=jg(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 $g(e,t,n,i,s){const o=Ug(i,e,t,n),r=Yg(s,i,t.lineHeight);return{itemWidth:o,itemHeight:r}}function Ug(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 Yg(e,t,n){let i=e;return typeof t.text!="string"&&(i=hc(t,n)),i}function hc(e,t){const n=e.text?e.text.length:0;return t*n}function Xg(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var qg={id:"legend",_element:ra,start(e,t,n){const i=e.legend=new ra({ctx:e.ctx,options:n,chart:e});ie.configure(e,i,n),ie.addBox(e,i)},stop(e){ie.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;ie.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 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=Vs(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(\`
5436
- \`)>-1?e.split(\`
5437
- \`):e}function Gg(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 aa(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,x=Mt(t.padding);let y=x.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&&(y+=f*c.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),w){const O=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;y+=m*O+(w-m)*l.lineHeight+(w-1)*t.bodySpacing}d&&(y+=t.footerMarginTop+d*u.lineHeight+(d-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+=x.width,{width:v,height:y}}function Kg(e,t){const{y:n,height:i}=t;return n<i/2?"top":n>e.height-i/2?"bottom":"center"}function Zg(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 Qg(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"),Zg(c,e,t,n)&&(c="center"),c}function la(e,t,n){const i=n.yAlign||t.yAlign||Kg(e,n);return{xAlign:n.xAlign||t.xAlign||Qg(e,t,n,i),yAlign:i}}function Jg(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function tm(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function ca(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}=Pn(r);let x=Jg(t,a);const y=tm(t,l,c);return l==="center"?a==="left"?x+=c:a==="right"&&(x-=c):a==="left"?x-=Math.max(u,d)+s:a==="right"&&(x+=Math.max(f,m)+s),{x:yt(x,0,i.width-t.width),y:yt(y,0,i.height-t.height)}}function di(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 ua(e){return Dt([],Ut(e))}function em(e,t,n){return je(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function ha(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const fc={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"?fc[t].call(n,i):s}class fa extends on{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 Zl(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=em(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 ua(lt(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,s=[];return F(t,o=>{const r={before:[],lines:[],after:[]},a=ha(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 ua(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(Gg(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=ha(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=aa(this,i),c=Object.assign({},a,l),u=la(this.chart,i,c),f=ca(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:d,y:m}=t,{width:x,height:y}=n;let v,w,k,C,O,T;return o==="center"?(O=m+y/2,s==="left"?(v=d,w=v-r,C=O+r,T=O-r):(v=d+x,w=v+r,C=O-r,T=O+r),k=v):(s==="left"?w=d+Math.max(l,u)+r:s==="right"?w=d+x-Math.max(c,f)-r:w=this.caretX,o==="top"?(C=m,O=C-r,v=w-r,k=w+r):(C=m+y,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=Qe(i.rtl,this.x,this.width);for(t.x=di(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=di(this,"left",o),d=s.x(f),m=l<u.lineHeight?(u.lineHeight-l)/2:0,x=n.y+m;if(o.usePointStyle){const y={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},v=s.leftForLtr(d,c)+c/2,w=x+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Ws(t,y,v,w),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,Ws(t,y,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 y=s.leftForLtr(d,c),v=s.leftForLtr(s.xPlus(d,1),c-2),w=Pn(r.borderRadius);Object.values(w).some(k=>k!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,js(t,{x:y,y:x,w:c,h:l,radius:w}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),js(t,{x:v,y:x+1,w:c-2,h:l-2,radius:w}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(y,x,c,l),t.strokeRect(y,x,c,l),t.fillStyle=r.backgroundColor,t.fillRect(v,x+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 x=Qe(i.rtl,this.x,this.width),y=function(E){n.fillText(E,x.x(t.x+m),t.y+d/2),t.y+=d+o},v=x.textAlign(r);let w,k,C,O,T,D,P;for(n.textAlign=r,n.textBaseline="middle",n.font=f.string,t.x=di(this,v,i),n.fillStyle=i.bodyColor,F(this.beforeBody,y),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,y),C=w.lines,a&&C.length&&(this._drawColorBox(n,t,O,x,i),d=Math.max(f.lineHeight,l)),T=0,P=C.length;T<P;++T)y(C[T]),d=f.lineHeight;F(w.after,y)}m=0,d=f.lineHeight,F(this.afterBody,y),t.y-=o}drawFooter(t,n,i){const s=this.footer,o=s.length;let r,a;if(o){const l=Qe(i.rtl,this.x,this.width);for(t.x=di(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:x}=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-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-x),n.quadraticCurveTo(a+c,l+u,a+c-x,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=aa(this,t),l=Object.assign({},r,this._size),c=la(n,t,l),u=ca(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),ql(t,n.textDirection),o.y+=r.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),Gl(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=Mn[o.position].call(this,t,n);return r!==!1&&(i!==r.x||s!==r.y)}}var nm={id:"tooltip",_element:fa,positioners:Mn,afterInit(e,t,n){n&&(e.tooltip=new fa({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:fc},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 im=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function sm(e,t,n,i){const s=e.indexOf(t);if(s===-1)return im(e,t,n,i);const o=e.lastIndexOf(t);return s!==o?n:s}const om=(e,t)=>e===null?null:yt(Math.round(e),0,t);function da(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class rm extends rn{static id="category";static defaults={ticks:{callback:da}};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:sm(i,t,N(n,t),this._addedLabels),om(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 da.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 am(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,x=u-1,{min:y,max:v}=t,w=!B(r),k=!B(a),C=!B(c),O=(v-y)/(f+1);let T=br((v-y)/x/m)*m,D,P,E,A;if(T<1e-14&&!w&&!k)return[{value:y},{value:v}];A=Math.ceil(v/T)-Math.floor(y/T),A>x&&(T=br(A*T/x/m)*m),B(l)||(D=Math.pow(10,l),T=Math.ceil(T*D)/D),s==="ticks"?(P=Math.floor(y/T)*T,E=Math.ceil(v/T)*T):(P=y,E=v),w&&k&&o&&$f((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,Ne(A,Math.round(A),T/1e3)?A=Math.round(A):A=Math.ceil(A));const z=Math.max(yr(T),yr(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&&(d&&P!==r?(n.push({value:r}),P<r&&L++,Ne(Math.round((P+L*T)*D)/D,r,pa(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&&d&&E!==a?n.length&&Ne(n[n.length-1].value,a,pa(a,O,e))?n[n.length-1].value=a:n.push({value:a}):(!k||E===a)&&n.push({value:E}),n}function pa(e,t,{horizontal:n,minRotation:i}){const s=Ae(i),o=(n?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+e).length;return Math.min(t/o,r)}class lm 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=fe(s),c=fe(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=am(s,o);return t.bounds==="ticks"&&Uf(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 Hl(t,this.chart.options.locale,this.options.ticks.format)}}class cm extends lm{static id="linear";static defaults={ticks:{callback:Vl.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=Ae(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 $i={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($i);function ga(e,t){return e-t}function ma(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 ba(e,t,n,i){const s=ut.length;for(let o=ut.indexOf(e);o<s-1;++o){const r=$i[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 um(e,t,n,i,s){for(let o=ut.length-1;o>=ut.indexOf(n);o--){const r=ut[o];if($i[r].common&&e._adapter.diff(s,i,r)>=t-1)return r}return ut[n?ut.indexOf(n):0]}function hm(e){for(let t=ut.indexOf(e)+1,n=ut.length;t<n;++t)if($i[ut[t]].common)return ut[t]}function ya(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:i,hi:s}=vo(n,t),o=n[i]>=t?n[i]:n[s];e[o]=!0}}function fm(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 xa(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:fm(e,i,s,n)}class va 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 Sp._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:ma(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=Zf(s,o,r);return this._unit=n.unit||(i.autoSkip?ba(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):um(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:hm(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),xa(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||ba(o.minUnit,n,i,this._getLabelCapacity(n)),a=N(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 x=s.ticks.source==="data"&&this.getDataTimestamps();for(d=f,m=0;d<i;d=+t.add(d,a,r),m++)ya(u,d,x);return(d===i||s.bounds==="ticks"||m===1)&&ya(u,d,x),Object.keys(u).sort(ga).map(y=>+y)}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=Ae(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,xa(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(ma(this,s[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Jf(t.sort(ga))}}function pi(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}=Ie(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}=Ie(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 _b extends va{static id="timeseries";static defaults=va.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=pi(n,this.min),this._tableRange=pi(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(pi(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return pi(this._table,i*this._tableRange+this._minPos,!0)}}function dm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fs={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
5438
- * http://hammerjs.github.io/
5439
- *
5440
- * Copyright (c) 2016 Jorik Tangelder;
5441
- * Licensed under the MIT license */var _a;function pm(){return _a||(_a=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(C(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 x(h,p,b){var _="DEPRECATED METHOD: "+p+\`
5442
- \`+b+\` AT
5443
- \`;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",R=t.console&&(t.console.warn||t.console.log);return R&&R.call(t.console,_,M),h.apply(this,arguments)}}var y;typeof Object.assign!="function"?y=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}:y=Object.assign;var v=x(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=x(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&&y(S,b)}function C(h,p){return function(){return h.apply(p,arguments)}}function O(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 E(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 R=h[M][p];L(S,R)<0&&_.push(h[M]),S[M]=R,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 Ue=/mobile|tablet|ip(ad|hone|od)|android/i,ye="ontouchstart"in t,Kt=nt(t,"PointerEvent")!==s,Ye=ye&&Ue.test(navigator.userAgent),dt="touch",xe="pen",wt="mouse",ve="kinect",Vt=25,st=1,_e=2,X=4,at=8,jn=1,ln=2,cn=4,un=8,hn=16,Et=ln|cn,we=un|hn,Ao=Et|we,Io=["x","y"],$n=["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(_){O(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 Pc(h){var p,b=h.options.inputClass;return b?p=b:Kt?p=Yi:Ye?p=Xn:ye?p=Xi:p=Yn,new p(h,Dc)}function Dc(h,p,b){var _=b.pointers.length,S=b.changedPointers.length,M=p&st&&_-S===0,R=p&(X|at)&&_-S===0;b.isFirst=!!M,b.isFinal=!!R,M&&(h.session={}),b.eventType=p,Ac(h,b),h.emit("hammer.input",b),h.recognize(b),h.session.prevInput=b}function Ac(h,p){var b=h.session,_=p.pointers,S=_.length;b.firstInput||(b.firstInput=Lo(p)),S>1&&!b.firstMultiple?b.firstMultiple=Lo(p):S===1&&(b.firstMultiple=!1);var M=b.firstInput,R=b.firstMultiple,K=R?R.center:M.center,Q=p.center=No(_);p.timeStamp=u(),p.deltaTime=p.timeStamp-M.timeStamp,p.angle=Ui(K,Q),p.distance=Un(K,Q),Ic(b,p),p.offsetDirection=Fo(p.deltaX,p.deltaY);var ot=Ro(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=R?Rc(R.pointers,_):1,p.rotation=R?Nc(R.pointers,_):0,p.maxPointers=b.prevInput?p.pointers.length>b.prevInput.maxPointers?p.pointers.length:b.prevInput.maxPointers:p.pointers.length,Lc(b,p);var Ot=h.element;E(p.srcEvent.target,Ot)&&(Ot=p.srcEvent.target),p.target=Ot}function Ic(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 Lc(h,p){var b=h.lastInterval||p,_=p.timeStamp-b.timeStamp,S,M,R,K;if(p.eventType!=at&&(_>Vt||b.velocity===s)){var Q=p.deltaX-b.deltaX,ot=p.deltaY-b.deltaY,Ot=Ro(_,Q,ot);M=Ot.x,R=Ot.y,S=c(Ot.x)>c(Ot.y)?Ot.x:Ot.y,K=Fo(Q,ot),h.lastInterval=p}else S=b.velocity,M=b.velocityX,R=b.velocityY,K=b.direction;p.velocity=S,p.velocityX=M,p.velocityY=R,p.direction=K}function Lo(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:No(p),deltaX:h.deltaX,deltaY:h.deltaY}}function No(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 Ro(h,p,b){return{x:p/h||0,y:b/h||0}}function Fo(h,p){return h===p?jn:c(h)>=c(p)?h<0?ln:cn:p<0?un:hn}function Un(h,p,b){b||(b=Io);var _=p[b[0]]-h[b[0]],S=p[b[1]]-h[b[1]];return Math.sqrt(_*_+S*S)}function Ui(h,p,b){b||(b=Io);var _=p[b[0]]-h[b[0]],S=p[b[1]]-h[b[1]];return Math.atan2(S,_)*180/Math.PI}function Nc(h,p){return Ui(p[1],p[0],$n)+Ui(h[1],h[0],$n)}function Rc(h,p){return Un(p[0],p[1],$n)/Un(h[0],h[1],$n)}var Fc={mousedown:st,mousemove:_e,mouseup:X},zc="mousedown",Hc="mousemove mouseup";function Yn(){this.evEl=zc,this.evWin=Hc,this.pressed=!1,pt.apply(this,arguments)}k(Yn,pt,{handler:function(p){var b=Fc[p.type];b&st&&p.button===0&&(this.pressed=!0),b&_e&&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 Vc={pointerdown:st,pointermove:_e,pointerup:X,pointercancel:at,pointerout:at},Bc={2:dt,3:xe,4:wt,5:ve},zo="pointerdown",Ho="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(zo="MSPointerDown",Ho="MSPointerMove MSPointerUp MSPointerCancel");function Yi(){this.evEl=zo,this.evWin=Ho,pt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}k(Yi,pt,{handler:function(p){var b=this.store,_=!1,S=p.type.toLowerCase().replace("ms",""),M=Vc[S],R=Bc[p.pointerType]||p.pointerType,K=R==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:R,srcEvent:p}),_&&b.splice(Q,1))}});var Wc={touchstart:st,touchmove:_e,touchend:X,touchcancel:at},jc="touchstart",$c="touchstart touchmove touchend touchcancel";function Vo(){this.evTarget=jc,this.evWin=$c,this.started=!1,pt.apply(this,arguments)}k(Vo,pt,{handler:function(p){var b=Wc[p.type];if(b===st&&(this.started=!0),!!this.started){var _=Uc.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 Uc(h,p){var b=H(h.touches),_=H(h.changedTouches);return p&(X|at)&&(b=Z(b.concat(_),"identifier")),[b,_]}var Yc={touchstart:st,touchmove:_e,touchend:X,touchcancel:at},Xc="touchstart touchmove touchend touchcancel";function Xn(){this.evTarget=Xc,this.targetIds={},pt.apply(this,arguments)}k(Xn,pt,{handler:function(p){var b=Yc[p.type],_=qc.call(this,p,b);_&&this.callback(this.manager,b,{pointers:_[0],changedPointers:_[1],pointerType:dt,srcEvent:p})}});function qc(h,p){var b=H(h.touches),_=this.targetIds;if(p&(st|_e)&&b.length===1)return _[b[0].identifier]=!0,[b,b];var S,M,R=H(h.changedTouches),K=[],Q=this.target;if(M=b.filter(function(ot){return E(ot.target,Q)}),p===st)for(S=0;S<M.length;)_[M[S].identifier]=!0,S++;for(S=0;S<R.length;)_[R[S].identifier]&&K.push(R[S]),p&(X|at)&&delete _[R[S].identifier],S++;if(K.length)return[Z(M.concat(K),"identifier"),K]}var Gc=2500,Bo=25;function Xi(){pt.apply(this,arguments);var h=C(this.handler,this);this.touch=new Xn(this.manager,h),this.mouse=new Yn(this.manager,h),this.primaryTouch=null,this.lastTouches=[]}k(Xi,pt,{handler:function(p,b,_){var S=_.pointerType==dt,M=_.pointerType==wt;if(!(M&&_.sourceCapabilities&&_.sourceCapabilities.firesTouchEvents)){if(S)Kc.call(this,b,_);else if(M&&Zc.call(this,_))return;this.callback(p,b,_)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Kc(h,p){h&st?(this.primaryTouch=p.changedPointers[0].identifier,Wo.call(this,p)):h&(X|at)&&Wo.call(this,p)}function Wo(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,Gc)}}function Zc(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),R=Math.abs(b-S.y);if(M<=Bo&&R<=Bo)return!0}return!1}var jo=nt(r.style,"touchAction"),$o=jo!==s,Uo="compute",Yo="auto",qi="manipulation",Se="none",fn="pan-x",dn="pan-y",qn=Jc();function Gi(h,p){this.manager=h,this.set(p)}Gi.prototype={set:function(h){h==Uo&&(h=this.compute()),$o&&this.manager.element.style&&qn[h]&&(this.manager.element.style[jo]=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){O(p.options.enable,[p])&&(h=h.concat(p.getTouchAction()))}),Qc(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(_,Se)&&!qn[Se],M=A(_,dn)&&!qn[dn],R=A(_,fn)&&!qn[fn];if(S){var K=h.pointers.length===1,Q=h.distance<2,ot=h.deltaTime<250;if(K&&Q&&ot)return}if(!(R&&M)&&(S||M&&b&Et||R&&b&we))return this.preventSrc(p)},preventSrc:function(h){this.manager.session.prevented=!0,h.preventDefault()}};function Qc(h){if(A(h,Se))return Se;var p=A(h,fn),b=A(h,dn);return p&&b?Se:p||b?p?fn:dn:A(h,qi)?qi:Yo}function Jc(){if(!$o)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 Gn=1,gt=2,Xe=4,Zt=8,Bt=Zt,pn=16,Ct=32;function Wt(h){this.options=y({},this.defaults,h||{}),this.id=q(),this.manager=null,this.options.enable=T(this.options.enable,!0),this.state=Gn,this.simultaneous={},this.requireFail=[]}Wt.prototype={defaults:{},set:function(h){return y(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=Kn(h,this),p[h.id]||(p[h.id]=h,h.recognizeWith(this)),this},dropRecognizeWith:function(h){return d(h,"dropRecognizeWith",this)?this:(h=Kn(h,this),delete this.simultaneous[h.id],this)},requireFailure:function(h){if(d(h,"requireFailure",this))return this;var p=this.requireFail;return h=Kn(h,this),L(p,h)===-1&&(p.push(h),h.requireFailure(this)),this},dropRequireFailure:function(h){if(d(h,"dropRequireFailure",this))return this;h=Kn(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<Zt&&_(p.options.event+Xo(b)),_(p.options.event),h.additionalEvent&&_(h.additionalEvent),b>=Zt&&_(p.options.event+Xo(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|Gn)))return!1;h++}return!0},recognize:function(h){var p=y({},h);if(!O(this.options.enable,[this,p])){this.reset(),this.state=Ct;return}this.state&(Bt|pn|Ct)&&(this.state=Gn),this.state=this.process(p),this.state&(gt|Xe|Zt|pn)&&this.tryEmit(p)},process:function(h){},getTouchAction:function(){},reset:function(){}};function Xo(h){return h&pn?"cancel":h&Zt?"end":h&Xe?"move":h&gt?"start":""}function qo(h){return h==hn?"down":h==un?"up":h==ln?"left":h==cn?"right":""}function Kn(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|Xe),S=this.attrTest(h);return _&&(b&at||!S)?p|pn:_||S?b&X?p|Zt:p&gt?p|Xe:gt:Ct}});function Zn(){St.apply(this,arguments),this.pX=null,this.pY=null}k(Zn,St,{defaults:{event:"pan",threshold:10,pointers:1,direction:Ao},getTouchAction:function(){var h=this.options.direction,p=[];return h&Et&&p.push(dn),h&we&&p.push(fn),p},directionTest:function(h){var p=this.options,b=!0,_=h.distance,S=h.direction,M=h.deltaX,R=h.deltaY;return S&p.direction||(p.direction&Et?(S=M===0?jn:M<0?ln:cn,b=M!=this.pX,_=Math.abs(h.deltaX)):(S=R===0?jn:R<0?un:hn,b=R!=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&gt||!(this.state&gt)&&this.directionTest(h))},emit:function(h){this.pX=h.deltaX,this.pY=h.deltaY;var p=qo(h.direction);p&&(h.additionalEvent=this.options.event+p),this._super.emit.call(this,h)}});function Ki(){St.apply(this,arguments)}k(Ki,St,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Se]},attrTest:function(h){return this._super.attrTest.call(this,h)&&(Math.abs(h.scale-1)>this.options.threshold||this.state&gt)},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 Zi(){Wt.apply(this,arguments),this._timer=null,this._input=null}k(Zi,Wt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Yo]},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 Qi(){St.apply(this,arguments)}k(Qi,St,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Se]},attrTest:function(h){return this._super.attrTest.call(this,h)&&(Math.abs(h.rotation)>this.options.threshold||this.state&gt)}});function Ji(){St.apply(this,arguments)}k(Ji,St,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Et|we,pointers:1},getTouchAction:function(){return Zn.prototype.getTouchAction.call(this)},attrTest:function(h){var p=this.options.direction,b;return p&(Et|we)?b=h.overallVelocity:p&Et?b=h.overallVelocityX:p&we&&(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=qo(h.offsetDirection);p&&this.manager.emit(this.options.event+p,h),this.manager.emit(this.options.event,h)}});function Qn(){Wt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}k(Qn,Wt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[qi]},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,R=!this.pCenter||Un(this.pCenter,h.center)<p.posThreshold;this.pTime=h.timeStamp,this.pCenter=h.center,!R||!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 Qt(h,p){return p=p||{},p.recognizers=T(p.recognizers,Qt.defaults.preset),new ts(h,p)}Qt.VERSION="2.0.7",Qt.defaults={domEvents:!1,touchAction:Uo,enable:!0,inputTarget:null,inputClass:null,preset:[[Qi,{enable:!1}],[Ki,{enable:!1},["rotate"]],[Ji,{direction:Et}],[Zn,{direction:Et},["swipe"]],[Qn],[Qn,{event:"doubletap",taps:2},["tap"]],[Zi]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var tu=1,Go=2;function ts(h,p){this.options=y({},Qt.defaults,p||{}),this.options.inputTarget=this.options.inputTarget||h,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=h,this.input=Pc(this),this.touchAction=new Gi(this,this.options.touchAction),Ko(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)}ts.prototype={set:function(h){return y(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?Go:tu},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!==Go&&(!S||b==S||b.canRecognizeWith(S))?b.recognize(h):b.reset(),!S&&b.state&(gt|Xe|Zt)&&(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&&eu(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&&Ko(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Ko(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 eu(h,p){var b=n.createEvent("Event");b.initEvent(h,!0,!0),b.gesture=p,p.target.dispatchEvent(b)}y(Qt,{INPUT_START:st,INPUT_MOVE:_e,INPUT_END:X,INPUT_CANCEL:at,STATE_POSSIBLE:Gn,STATE_BEGAN:gt,STATE_CHANGED:Xe,STATE_ENDED:Zt,STATE_RECOGNIZED:Bt,STATE_CANCELLED:pn,STATE_FAILED:Ct,DIRECTION_NONE:jn,DIRECTION_LEFT:ln,DIRECTION_RIGHT:cn,DIRECTION_UP:un,DIRECTION_DOWN:hn,DIRECTION_HORIZONTAL:Et,DIRECTION_VERTICAL:we,DIRECTION_ALL:Ao,Manager:ts,Input:pt,TouchAction:Gi,TouchInput:Xn,MouseInput:Yn,PointerEventInput:Yi,TouchMouseInput:Xi,SingleTouchInput:Vo,Recognizer:Wt,AttrRecognizer:St,Tap:Qn,Pan:Zn,Swipe:Ji,Pinch:Ki,Rotate:Qi,Press:Zi,on:D,off:P,each:m,merge:w,extend:v,assign:y,inherit:k,bindFn:C,prefixed:nt});var nu=typeof t<"u"?t:typeof self<"u"?self:{};nu.Hammer=Qt,e.exports?e.exports=Qt:t[i]=Qt})(window,document,"Hammer")})(fs)),fs.exports}var gm=pm();const Dn=dm(gm);/*!
5444
- * chartjs-plugin-zoom v2.2.0
5445
- * https://www.chartjs.org/chartjs-plugin-zoom/2.2.0/
5446
- * (c) 2016-2024 chartjs-plugin-zoom Contributors
5447
- * Released under the MIT License
5448
- */const zn=e=>e&&e.enabled&&e.modifierKey,dc=(e,t)=>e&&t[e+"Key"],Po=(e,t)=>e&&!t[e+"Key"];function de(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 ds(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 mm(e,t){let n;return function(){return clearTimeout(n),n=setTimeout(e,t),t}}function bm({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 pc(e,t,n){const{mode:i="xy",scaleMode:s,overScaleMode:o}=e||{},r=bm(t,n),a=ds(i,n),l=ds(s,n);if(o){const u=ds(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 qs=new WeakMap;function $(e){let t=qs.get(e);return t||(t={originalScaleLimits:{},updatedScaleLimits:{},handlers:{},panDelta:{},dragging:!1,panning:!1},qs.set(e,t)),t}function ym(e){qs.delete(e)}function gc(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 mc(e,t){const n=e.isHorizontal()?t.x:t.y;return e.getValueForPixel(n)}function bc(e,t,n){const i=e.max-e.min,s=i*(t-1),o=mc(e,n);return gc(o,e.min,i,s)}function xm(e,t,n){const i=mc(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=gc(r,s,a,l);return{min:Math.pow(10,s+c.min),max:Math.pow(10,o-c.max)}}function vm(e,t){return t&&(t[e.id]||t[e.axis])||{}}function wa(e,t,n,i,s){let o=n[i];if(o==="original"){const r=e.originalScaleLimits[t.id][i];o=N(r.options,r.scale)}return N(o,s)}function _m(e,t,n){const i=e.getValueForPixel(t),s=e.getValueForPixel(n);return{min:Math.min(i,s),max:Math.max(i,s)}}function wm(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 Ne(t,a,c)&&(t=a),Ne(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 $e(e,{min:t,max:n},i,s=!1){const o=$(e.chart),{options:r}=e,a=vm(e,i),{minRange:l=0}=a,c=wa(o,e,a,"min",-1/0),u=wa(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=wm(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 Sm(e,t,n,i){const s=bc(e,t,n),o={min:e.min+s.min,max:e.max-s.max};return $e(e,o,i,!0)}function km(e,t,n,i){const s=xm(e,t,n);return $e(e,s,i,!0)}function Tm(e,t,n,i){$e(e,_m(e,t,n),i,!0)}const Sa=e=>e===0||isNaN(e)?0:e<0?Math.min(Math.round(e),-1):Math.max(Math.round(e),1);function Mm(e){const n=e.getLabels().length-1;e.min>0&&(e.min-=1),e.max<n&&(e.max+=1)}function Em(e,t,n,i){const s=bc(e,t,n);e.min===e.max&&t<1&&Mm(e);const o={min:e.min+Sa(s.min),max:e.max-Sa(s.max)};return $e(e,o,i,!0)}function Cm(e){return e.isHorizontal()?e.width:e.height}function Om(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(Cm(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),$e(e,{min:o,max:r},n)||u}const Pm={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 yc(e,t,n,i=!1){const{min:s,max:o,options:r}=e,a=r.time&&r.time.round,l=Pm[a]||0,c=e.getValueForPixel(e.getPixelForValue(s+l)-t),u=e.getValueForPixel(e.getPixelForValue(o+l)-t);return isNaN(c)||isNaN(u)?!0:$e(e,{min:c,max:u},n,i?"pan":!1)}function ka(e,t,n){return yc(e,t,n,!0)}const Gs={category:Em,default:Sm,logarithmic:km},Ks={default:Tm},Zs={category:Om,default:yc,logarithmic:ka,timeseries:ka};function Dm(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 Ta(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){Dm(o,i,s)&&(i[o.id]={min:{scale:o.min,options:o.options.min},max:{scale:o.max,options:o.options.max}})}),Ta(i,n),Ta(s,n),i}function Ma(e,t,n,i){const s=Gs[e.type]||Gs.default;I(s,[e,t,n,i])}function Ea(e,t,n,i){const s=Ks[e.type]||Ks.default;I(s,[e,t,n,i])}function Am(e){const t=e.chartArea;return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function Do(e,t,n="none",i="api"){const{x:s=1,y:o=1,focalPoint:r=Am(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=pc(c,r,e);F(d||e.scales,function(m){m.isHorizontal()&&u?Ma(m,s,r,l):!m.isHorizontal()&&f&&Ma(m,o,r,l)}),e.update(n),I(c.onZoom,[{chart:e,trigger:i}])}function xc(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=de(l,"x",e),u=de(l,"y",e);F(e.scales,function(f){f.isHorizontal()&&c?Ea(f,t.x,n.x,r):!f.isHorizontal()&&u&&Ea(f,t.y,n.y,r)}),e.update(i),I(a.onZoom,[{chart:e,trigger:s}])}function Im(e,t,n,i="none",s="api"){const o=$(e);an(e,o);const r=e.scales[t];$e(r,n,void 0,!0),e.update(i),I(o.options.zoom?.onZoom,[{chart:e,trigger:s}])}function Lm(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 Nm(e,t){const n=e.originalScaleLimits[t];if(!n)return;const{min:i,max:s}=n;return N(s.options,s.scale)-N(i.options,i.scale)}function Rm(e){const t=$(e);let n=1,i=1;return F(e.scales,function(s){const o=Nm(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 Ca(e,t,n,i){const{panDelta:s}=i,o=s[e.id]||0;fe(o)===fe(t)&&(t+=o);const r=Zs[e.type]||Zs.default;I(r,[e,t,n])?s[e.id]=0:s[e.id]=t}function vc(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?Ca(d,s,l,r):!d.isHorizontal()&&f&&Ca(d,o,l,r)}),e.update(i),I(c,[{chart:e}])}function _c(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 Fm(e){const t=$(e),n={};for(const i of Object.keys(e.scales))n[i]=t.updatedScaleLimits[i];return n}function zm(e){const t=_c(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 Oa(e){const t=$(e);return t.panning||t.dragging}const Pa=(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 An(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 Hm(e,t){const n=$(e);n.dragStart&&(n.dragging=!0,n.dragEnd=t,e.update("none"))}function Vm(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 Qs(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 wc(e,t,n){const{onZoomStart:i,onZoomRejected:s}=n;if(i){const o=Qs(t,e);if(I(i,[{chart:e,event:t,point:o}])===!1)return I(s,[{chart:e,event:t}]),!1}}function Bm(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||dc(zn(i),t)||Po(zn(s.drag),t))return I(s.onZoomRejected,[{chart:e,event:t}]);wc(e,t,s)!==!1&&(n.dragStart=t,An(e,e.canvas.ownerDocument,"mousemove",Hm),An(e,window.document,"keydown",Vm))}function Wm({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 Da(e,t,n,{min:i,max:s,prop:o}){e[i]=Pa(Math.min(n.begin[o],n.end[o]),t[i],t[s]),e[s]=Pa(Math.max(n.begin[o],n.end[o]),t[i],t[s])}function jm(e,t,n){const i={begin:Qs(t.dragStart,e),end:Qs(t.dragEnd,e)};if(n){const s=e.chartArea.width/e.chartArea.height;Wm(i,s)}return i}function Sc(e,t,n,i){const s=de(t,"x",e),o=de(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=jm(e,n,i&&s&&o);s&&Da(d,e.chartArea,m,{min:"left",max:"right",prop:"x"}),o&&Da(d,e.chartArea,m,{min:"top",max:"bottom",prop:"y"});const x=d.right-d.left,y=d.bottom-d.top;return{...d,width:x,height:y,zoomX:s&&x?1+(u-x)/u:1,zoomY:o&&y?1+(f-y)/f:1}}function $m(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=Sc(e,i,{dragStart:n.dragStart,dragEnd:t},r),l=de(i,"x",e)?a.width:0,c=de(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}xc(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 Um(e,t,n){if(Po(zn(n.wheel),t)){I(n.onZoomRejected,[{chart:e,event:t}]);return}if(wc(e,t,n)!==!1&&(t.cancelable&&t.preventDefault(),t.deltaY!==void 0))return!0}function Ym(e,t){const{handlers:{onZoomComplete:n},options:{zoom:i}}=$(e);if(!Um(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}};Do(e,a,"zoom","wheel"),I(n,[{chart:e}])}function Xm(e,t,n,i){n&&($(e).handlers[t]=mm(()=>I(n,[{chart:e}]),i))}function qm(e,t){const n=e.canvas,{wheel:i,drag:s,onZoomComplete:o}=t.zoom;i.enabled?(An(e,n,"wheel",Ym),Xm(e,"onZoomComplete",o,250)):ct(e,"wheel"),s.enabled?(An(e,n,"mousedown",Bm),An(e,n.ownerDocument,"mouseup",$m)):(ct(e,"mousedown"),ct(e,"mousemove"),ct(e,"mouseup"),ct(e,"keydown"))}function Gm(e){ct(e,"mousedown"),ct(e,"mousemove"),ct(e,"mouseup"),ct(e,"wheel"),ct(e,"click"),ct(e,"keydown")}function Km(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"&&(Po(zn(s),r)||dc(zn(o.drag),r))?(I(s.onPanRejected,[{chart:e,event:i}]),!1):!0}}function Zm(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 kc(e,t,n){if(t.scale){const{center:i,pointers:s}=n,o=1/t.scale*n.scale,r=n.target.getBoundingClientRect(),a=Zm(s[0],s[1]),l=t.options.zoom.mode,c={x:a.x&&de(l,"x",e)?o:1,y:a.y&&de(l,"y",e)?o:1,focalPoint:{x:i.x-r.left,y:i.y-r.top}};Do(e,c,"zoom","pinch"),t.scale=n.scale}}function Qm(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 Jm(e,t,n){t.scale&&(kc(e,t,n),t.scale=null,I(t.options.zoom.onZoomComplete,[{chart:e}]))}function Tc(e,t,n){const i=t.delta;i&&(t.panning=!0,vc(e,{x:n.deltaX-i.x,y:n.deltaY-i.y},t.panScales),t.delta={x:n.deltaX,y:n.deltaY})}function tb(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=pc(t.options.pan,a,e),t.delta={x:0,y:0},Tc(e,t,n)}function eb(e,t){t.delta=null,t.panning&&(t.panning=!1,t.filterNextClick=!0,I(t.options.pan.onPanComplete,[{chart:e}]))}const Js=new WeakMap;function Aa(e,t){const n=$(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=>Qm(e,n,a)),r.on("pinch",a=>kc(e,n,a)),r.on("pinchend",a=>Jm(e,n,a))),s&&s.enabled&&(r.add(new Dn.Pan({threshold:s.threshold,enable:Km(e,n)})),r.on("panstart",a=>tb(e,n,a)),r.on("panmove",a=>Tc(e,n,a)),r.on("panend",()=>eb(e,n))),Js.set(e,r)}function Ia(e){const t=Js.get(e);t&&(t.remove("pinchstart"),t.remove("pinch"),t.remove("pinchend"),t.remove("panstart"),t.remove("pan"),t.remove("panend"),t.destroy(),Js.delete(e))}function nb(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 ib="2.2.0";function gi(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}=Sc(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 sb={id:"zoom",version:ib,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)."),Dn&&Aa(e,n),e.pan=(s,o,r)=>vc(e,s,o,r),e.zoom=(s,o)=>Do(e,s,o),e.zoomRect=(s,o,r)=>xc(e,s,o,r),e.zoomScale=(s,o,r)=>Im(e,s,o,r),e.resetZoom=s=>Lm(e,s),e.getZoomLevel=()=>Rm(e),e.getInitialScaleBounds=()=>_c(e),e.getZoomedScaleBounds=()=>Fm(e),e.isZoomedOrPanned=()=>zm(e),e.isZoomingOrPanning=()=>Oa(e)},beforeEvent(e,{event:t}){if(Oa(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,nb(s,n)&&(Ia(e),Aa(e,n)),qm(e,n)},beforeDatasetsDraw(e,t,n){gi(e,"beforeDatasetsDraw",n)},afterDatasetsDraw(e,t,n){gi(e,"afterDatasetsDraw",n)},beforeDraw(e,t,n){gi(e,"beforeDraw",n)},afterDraw(e,t,n){gi(e,"afterDraw",n)},stop:function(e){Gm(e),Dn&&Ia(e),ym(e)},panFunctions:Zs,zoomFunctions:Gs,zoomRectFunctions:Ks};function ob({data:e,...t}){const n=He(null),i=He(null);return rt(()=>{Ys.register(sb,cm,wp,rm,Wg,Bg,qg,nm);const s=i.current,o=n.current=new Ys(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 rb(){const e=ge();rt(()=>{const n=i=>{In(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"},bl(t.appStats).filter(([n])=>!In(n)).map(([n])=>g(ab,{key:n.id,app:n})))}const La=100,Na=e=>Object.entries(e).map(([t,{values:n,color:i}])=>({label:t,data:n,fill:!1,borderColor:i,tension:.1}));function ab({app:e}){const t=ge(),n=He({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:Na(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>La&&c.values.shift()}),l.push((performance.now()/1e3).toFixed(2)),l.length>La&&l.shift(),i.value={labels:l,datasets:Na(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(ob,{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=G([]),Mc=G(""),lb=Bn(()=>Mc.value.toLowerCase().split(" ").filter(e=>e.length>0));function cb(e){return lb.value.every(t=>e.toLowerCase().includes(t))}function ub(){const e=ge();rt(()=>{const n=i=>{In(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(uo,null),g("h2",{className:"text-lg italic"},"No SWR detected")):g("div",{className:"flex flex-col gap-2 items-start"},g(po,{value:Mc,className:"sticky top-0"}),g("div",{className:"flex flex-col gap-2 w-full"},bl(t).filter(([n])=>cb(n)).map(([n,i])=>g(hb,{key:n,entry:i}))))}function hb({key:e,entry:t}){const n=wn.value.includes(e),i=ge();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=Ke(()=>{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(ue,{className:"transition-all"+(n?" rotate-90":"")})),n&&g("div",{className:"flex flex-col gap-2 p-2 border border-white border-opacity-10"},g(be,{data:{resource:t.resource.peek(),isMutating:t.isMutating.peek(),isValidating:t.isValidating.peek()},mutable:!1,objectRefAcc:[],keys:[],onChange:()=>{}})))}const qt=U.fileRouterInstance?.current?.devtools,xi=G({}),ps=G(null),Ra=G({});function fb(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),x=n.get(m);x?x.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 db=Bn(()=>fb(xi.value)),to=G(null),Ec=G(""),Fa=Bn(()=>Ec.value.toLowerCase().split(" ").filter(e=>e.length>0));function pb(e,t){if(Fa.value.length===0)return!0;const n=(e+" "+t.filePath).toLowerCase();return Fa.value.every(i=>n.includes(i))}function Cc(e){return e.map(t=>{const n=Cc(t.children);return pb(t.route,t.entry)||n.length>0?{...t,children:n}:null}).filter(t=>t!==null)}const gb=Bn(()=>Cc(db.value));function mb(){return rt(()=>{if(!qt){xi.value={},ps.value=null,Ra.value={};return}xi.value=qt.getPages(),console.log(xi.value);const e=qt.subscribe((t,n)=>{ps.value=t,Ra.value=n});return()=>e()},[qt]),qt?g(Tt,null,g(Ml,null,g("div",{className:"flex-grow sticky pr-2 top-0 flex flex-col gap-2"},g(po,{value:Ec,className:"sticky top-0"}),g("div",{className:"flex-grow flex flex-col gap-1 items-start"},g(As,{from:{filteredRouteTree:gb,selectedRoute:to,currentPage:ps}},({filteredRouteTree:e,selectedRoute:t,currentPage:n})=>g(Oc,{nodes:e,selected:t,currentPage:n,depth:0})))),g("div",{className:"flex-grow p-2 sticky top-0"},g(As,{from:to},e=>e&&g(bb,{page:e}))))):g("div",{className:"flex flex-col items-center justify-center h-full text-neutral-400"},g(uo,null),g("h2",{className:"text-lg italic"},"No file router detected"))}function Oc({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:()=>to.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(yl,{className:"w-4 h-4"})),a.params.length>0&&g(za,{entry:a,route:a.route})):g("div",{className:"flex invisible items-center gap-2 relative group-hover:visible"},g(za,{entry:a,route:a.route}))),u&&g("div",{className:"mt-1 flex flex-col gap-1"},g(Oc,{nodes:s.children,selected:t,currentPage:n,depth:i+1})))}))}function za({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(Dh,{className:"w-4 h-4"}))}function bb({page:e}){const n=qt.getPages()[e],i=xh(async()=>(await new Promise(s=>setTimeout(s,150)),await n.load()),[e]);return g(As,{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"},\`<\${co({type:r})}>\`,g(Bi,{fn:r}))),a?g("div",{className:"flex items-center gap-2"},g("span",{className:"text-sm text-neutral-400"},"Config:"),g(be,{data:a,mutable:!1,objectRefAcc:[],keys:[],onChange:()=>{}})):g("i",{className:"text-sm text-neutral-400"},"No config"))})}const yb=e=>e.active?g("main",{className:"flex flex-col flex-1 max-h-[calc(100vh-1rem)] overflow-y-auto"},e.children):null,eo={Apps:{Icon:kh,View:sf},FileRouter:{Icon:Eh,View:mb},Stores:{Icon:Ph,View:af},SWR:{Icon:Oh,View:ub},Profiling:{Icon:Ch,View:rb},Settings:{Icon:Th,View:Ih}},Li=G("Apps");let Ha=re.peek();re.subscribe(e=>{e!==Ha&&e!==null&&(Li.value="Apps"),Ha=e});function xb(){return g(Ah,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(eo).map(e=>g(vb,{key:e,title:e})))),Object.entries(eo).map(([e,{View:t}])=>g(yb,{key:e,active:Li.value===e},g(t,null))))}function vb({title:e}){const{Icon:t}=eo[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))}fh(g(xb,null),document.getElementById("app"));Ve.send({type:"ready"});setInterval(()=>{window.opener||window.close()},250);</script>
5449
- <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>
5450
- </head>
5451
- <body class="w-full min-h-screen">
5452
- <div id="app"></div>
5453
- <div id="portal-root"></div>
5454
- </body>
5455
- </html>
5456
- `;
5457
-
5458
5411
  // ../devtools-host/dist/index.js
5459
- var dist_default2 = `var Xe="production";if(Xe!=="development"&&Xe!=="production")throw new Error("NODE_ENV must either be set to development or production.");var l=Xe==="development";var Ye=Symbol.for("kiru.signal"),Pt=Symbol.for("kiru.context"),oe=Symbol.for("kiru.contextProvider"),A=Symbol.for("kiru.fragment"),Ze=Symbol.for("kiru.error"),ie=Symbol.for("kiru.hmrAccept"),Re=Symbol.for("kiru.memo"),se=Symbol.for("kiru.errorBoundary"),Je=Symbol.for("kiru.streamData"),Lt=Symbol.for("kiru.devFileLink"),Qe=50;var D=2,O=4,me=8,V=16,De=32,ve=64,J=128,Vt=/^on:?/;var et=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"]),tt=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"]),$t=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 _={current:null},X={current:0},M={current:"window"in globalThis?"dom":"string"};var Nt,S=class extends Error{constructor(t){let r=typeof t=="string"?t:t.message;super(r),this[Nt]=!0,typeof t!="string"&&(l&&t?.vNode&&(this.customNodeStack=Br(t.vNode)),this.fatal=t?.fatal)}static isKiruError(t){return t instanceof Error&&t[Ze]===!0}};Nt=Ze;function Br(e){let t=e,r=[];for(;t&&t.parent;)typeof t.type=="function"?r.push(qr(t.type)):typeof t.type=="string"&&r.push(t.type),t=t.parent;let n=typeof e.type=="function"?e:rt(e,o=>typeof o.type=="function");return\`The above error occurred in the <\${It(n?.type||K)}> component:
5412
+ var dist_default = `var Cg=Object.create;var io=Object.defineProperty;var Pg=Object.getOwnPropertyDescriptor;var Dg=Object.getOwnPropertyNames;var Ag=Object.getPrototypeOf,Og=Object.prototype.hasOwnProperty;var Rg=(e,t,n)=>t in e?io(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var M=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ig=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Br=(e,t)=>{for(var n in t)io(e,n,{get:t[n],enumerable:!0})},Ng=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Dg(t))!Og.call(e,s)&&s!==n&&io(e,s,{get:()=>t[s],enumerable:!(i=Pg(t,s))||i.enumerable});return e};var Lg=(e,t,n)=>(n=e!=null?Cg(Ag(e)):{},Ng(t||!e||!e.__esModule?io(n,"default",{value:e,enumerable:!0}):n,e));var F=(e,t,n)=>Rg(e,typeof t!="symbol"?t+"":t,n);var Wr,R,rt,ct=M(()=>{"use strict";Wr="production";if(Wr!=="development"&&Wr!=="production")throw new Error("NODE_ENV must either be set to development or production.");R=Wr==="development",rt="window"in globalThis&&typeof window<"u"});var jr,Rn,Gt,$r,te,je,si,Oc,Ur,oi,ee,ne,In,Yt,$e,Wi,Rc,Gr,so,Ic,at=M(()=>{"use strict";jr=Symbol.for("kiru.signal"),Rn=Symbol.for("kiru.context"),Gt=Symbol.for("kiru.fragment"),$r=Symbol.for("kiru.error"),te=Symbol.for("kiru.hmrAccept"),je=Symbol.for("kiru.errorBoundary"),si=Symbol.for("kiru.streamData"),Oc=Symbol.for("kiru.devFileLink"),Ur=50,oi="kiru:deferred",ee=2,ne=4,In=8,Yt=16,$e=128,Wi=/^on:?/,Rc=new Set(["kiru-head-outlet","kiru-body-outlet","area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]),Gr=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"]),so=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"]),Ic=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 Nc=M(()=>{"use strict"});function Lc(e){return typeof e=="string"||typeof e=="number"||typeof e=="bigint"||typeof e=="boolean"||e===void 0||e===null}var zc=M(()=>{"use strict"});var K,pt,Vc,ri,oo,xt=M(()=>{"use strict";ct();K={current:null},pt={current:rt?"dom":"string"},Vc={current:"dynamic"},ri=new WeakMap,oo=[]});function Yr(){let e=document.activeElement;e===document.body||!(e instanceof HTMLElement)||(e.addEventListener("blur",Fc),Nn=e)}function Kr(){Nn&&(Nn.removeEventListener("blur",Fc),Nn.isConnected&&Nn.focus(),Nn=null)}function Xr(e){return t=>{if(Nn){t.preventDefault(),t.stopPropagation();return}e(t)}}function Fc(e){e.preventDefault(),e.stopPropagation()}var Nn,qr=M(()=>{"use strict";Nn=null});function Hc(e){let{dom:t,prev:n,props:i,cleanups:s}=e,o=n?.props??{},r=i??{};if(Xg(t)){let p=r.nodeValue;!L.isSignal(p)&&t.nodeValue!==p&&(t.nodeValue=p);return}if(!n){Bg(e,t,r,s);let p=r.ref;p&&Ln(p,t);return}let a=new Set,l,c;for(let p in o){let b=o[p],x=r[p];if(b!==x){if(p.length>=2&&p.charCodeAt(0)===111&&p.charCodeAt(1)===110&&!x){c??(c=cn.get(e)??{}),cn.set(e,c);let y=p.replace(Wi,""),w=c[y];w&&(t.removeEventListener(y,w),delete c[y]);continue}L.isSignal(b)&&s?.[p]&&(s[p](),delete s[p]),a.add(p)}}for(let p in r)(!(p in o)||o[p]!==r[p])&&a.add(p);let u=Array.from(a);if(ro(t)&&u.length>1){let p=a,b=!1,x=!1,y=[],w=!1,_=!1;for(let T in r){let E=T.length>=2&&T.charCodeAt(0)===111&&T.charCodeAt(1)===110;E?w=!0:_=!0;let D=!E&&T.startsWith("bind:")?T.slice(5):T,O=jc(D,E);O===1?(b=!0,p.has(T)&&(x=!0)):O===5&&y.push(T)}if(b&&x)for(let T of y)!p.has(T)&&T in r&&(u.push(T),p.add(T));(b&&x||w&&_)&&u.length>1&&Wc(u)}for(let p=0;p<u.length;p++){let b=u[p],x=o[b],y=r[b];if(!Jr.has(b)){if(b.length>=2&&b.charCodeAt(0)===111&&b.charCodeAt(1)===110){c??(c=cn.get(e)??{}),cn.set(e,c);let w=b.replace(Wi,""),_=c[w];if(!y){_&&(t.removeEventListener(w,_),delete c[w]);continue}let S=y.bind(void 0);if((w==="focus"||w==="blur")&&(S=Xr(S)),_){_.handleEvent=S;continue}t.addEventListener(w,c[w]={handleEvent:S});continue}if(L.isSignal(y)){Uc(e,t,b,y,x);continue}if(b==="style"&&typeof y=="object"&&y!==null){if(s?.style&&(s.style(),delete s.style),l||(l=new Map),ao(t,y,x,!0),l.size>0){let w=[];for(let[_,S]of l.entries())w.push(S.subscribe(_.startsWith("--")?T=>$i(t,_,T):T=>Ui(t,_,T)));l.clear(),ie(e,"style",()=>w.forEach(_=>_()))}continue}Gi(t,b,y,x)}}let d=o.ref,f=r.ref;d!==f&&(d&&Ln(d,null),f&&Ln(f,t))}function Bc(e,t,n,i){let s;for(let r in n){let a=n[r];if(!Jr.has(r)){if(r.length>=2&&r.charCodeAt(0)===111&&r.charCodeAt(1)===110){s??(s=cn.get(e)??{}),cn.set(e,s);let l=r.replace(Wi,""),c=s[l];c&&(t.removeEventListener(l,c),delete s[l]);continue}if(L.isSignal(a)&&i?.[r]){i[r](),delete i[r];continue}if(r==="style"){i?.style&&(i.style(),delete i.style),ro(t)&&ao(t,void 0,a);continue}ro(t)&&Gi(t,r,void 0,a)}}let o=n.ref;o&&Ln(o,null)}function Bg(e,t,n,i){let s=Object.keys(n);ro(t)&&s.length>1&&Wc(s);let o;for(let r=0;r<s.length;r++){let a=s[r],l=n[a];if(!Jr.has(a)){if(a.length>=2&&a.charCodeAt(0)===111&&a.charCodeAt(1)===110){if(!l)continue;o??(o=cn.get(e)??{}),cn.set(e,o);let c=a.replace(Wi,""),u=o[c],d=l.bind(void 0);(c==="focus"||c==="blur")&&(d=Xr(d)),u?u.handleEvent=d:t.addEventListener(c,o[c]={handleEvent:d});continue}if(L.isSignal(l)){Uc(e,t,a,l,void 0);continue}if(a==="style"&&typeof l=="object"&&l!==null){if(ao(t,l,void 0,!0),ji.size>0){i??(i={});for(let[c,u]of ji.entries()){let d=\`style-\${c}\`;i[d]?.(),i[d]=u.subscribe(c.startsWith("--")?f=>$i(t,c,f):f=>Ui(t,c,f))}ji.clear()}continue}Gi(t,a,l,void 0)}}}function Wc(e){if(e.length<=1)return;for(let n=0;n<7;n++)Zr[n].length=0;for(let n=0;n<e.length;n++){let i=e[n],s=i.length>=2&&i.charCodeAt(0)===111&&i.charCodeAt(1)===110,o=i;!s&&i.length>5&&i.charCodeAt(4)===58&&(o=i.slice(5));let r=jc(o,s),a;r<=0?a=0:r===1?a=1:r===2?a=2:r===3?a=3:r===5?a=4:r>=9?a=6:a=5,Zr[a].push(i)}let t=0;for(let n=0;n<7;n++){let i=Zr[n];for(let s=0;s<i.length;s++)e[t++]=i[s]}}function jc(e,t){if(t)return 9;switch(e){case"innerHTML":case"type":case"muted":case"autoplay":case"loop":return 0;case"min":case"max":case"step":case"pattern":case"accept":case"multiple":case"preload":case"minLength":case"maxLength":case"crossOrigin":case"decoding":case"loading":case"referrerPolicy":return 1;case"style":case"className":return 3;case"value":case"checked":case"selected":case"open":case"src":return 5;default:return 4}}function $c(e,t){if(!e.multiple||t===void 0||t===null||t===""){e.value=t;return}let n=e.options,i=n.length;for(let s=0;s<i;s++){let o=n[s];o.selected=t.indexOf(o.value)>-1}}function Uc(e,t,n,i,s){let o=n.indexOf(":"),r=o===-1?n:n.slice(0,o),a=o===-1?void 0:n.slice(o+1);if(r==="bind"){let u=Vg[a];if(!u){R&&console.error(\`[kiru]: \${a} is not a valid element binding attribute.\`);return}let d=i.peek(),f=Wg(e,t,a,u,i,d);ie(e,n,f)}else{let u=i.subscribe((d,f)=>{d!==f&&(Gi(t,n,d,f),R&&Yc(e))});ie(e,n,u)}let l=i.peek(),c=Z(s);r!=="bind"&&l!==c&&Gi(t,a??r,l,c)}function Wg(e,t,n,i,s,o){let r=b=>{s.sneak(b),s.notify(x=>x!==l)},a=t.nodeName==="SELECT"&&n==="value"?b=>$c(t,b):b=>t[n]=b,l=b=>{a(b),R&&Yc(e)},c,u;n==="value"?(c=Gg(t),u=()=>r(c())):u=()=>{let b=t[n];n==="currentTime"&&s.peek()===b||r(b)},o!==void 0&&l(o);let d;n==="value"&&c?d=c():d=t[n];let f=s.peek();d!==f&&r(d),t.addEventListener(i,u);let p=s.subscribe(l);return()=>{t.removeEventListener(i,u),p()}}function Gi(e,t,n,i){switch(t){case"style":return ao(e,n,i);case"className":return Ug(e,n);case"innerHTML":return $g(e,n);case"muted":e.muted=!!n;return;case"value":if(e.nodeName==="SELECT")return $c(e,n);let s=n==null?"":String(n);if(Hg.has(e.nodeName)){e.value=s;return}e.setAttribute("value",s);return;case"checked":if(e.nodeName==="INPUT"){e.checked=!!n;return}e.setAttribute("checked",String(n));return;default:return jg(e,Qr(t),n)}}function jg(e,t,n){let i=so.has(t);Gc(e,t,n,i)||e.setAttribute(t,i&&typeof n=="boolean"?"":String(n))}function $g(e,t){if(t==null||typeof t=="boolean"){e.innerHTML="";return}e.innerHTML=String(t)}function Ug(e,t){let n=Z(t);if(!n)return e.removeAttribute("class");e.setAttribute("class",n)}function $i(e,t,n){if(n==null){e.style.removeProperty(t);return}e.style.setProperty(t,String(n))}function Ui(e,t,n){e.style[t]=n!=null?String(n):""}function ao(e,t,n,i=!1){if(Gc(e,"style",t))return;let s=Z(t);if(s==null){e.removeAttribute("style");return}if(typeof s=="string"){e.setAttribute("style",s);return}let o={},r=Z(n);typeof r=="string"?e.setAttribute("style",""):typeof r=="object"&&r!==null&&(o=r);let a=s,l=Object.keys(o),c=Object.keys(a);if(l.length===0){for(let d=0;d<c.length;d++){let f=c[d],p=a[f],b=Z(p);i&&L.isSignal(p)&&ji.set(f,p),f.startsWith("--")?$i(e,f,b):Ui(e,f,b)}return}let u=new Set(c);for(let d=0;d<l.length;d++){let f=l[d];u.has(f)||(f.startsWith("--")?$i(e,f,void 0):Ui(e,f,void 0))}for(let d=0;d<c.length;d++){let f=c[d],p=a[f],b=Z(o[f]),x=Z(p);i&&L.isSignal(p)&&ji.set(f,p),b!==x&&(f.startsWith("--")?$i(e,f,x):Ui(e,f,x))}}function Gc(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 Gg(e){return e.nodeName==="INPUT"?Yg(e):e.nodeName==="SELECT"?()=>Kg(e):()=>e.value}function Yg(e){let t=e.type;return Fg.has(t)?()=>e.valueAsNumber:()=>e.value}function Kg(e){return e.multiple?Array.from(e.selectedOptions).map(t=>t.value):e.value}function Yc(e){rt&&window.__kiru?.profilingContext?.emit("signalAttrUpdate",Nt(e))}function ro(e){return e.nodeType===1}function Xg(e){return e.nodeType===3}var cn,Jr,Zr,Vg,Fg,Hg,ji,Kc=M(()=>{"use strict";q();de();un();at();ct();qr();cn=new WeakMap,Jr=new Set(["children","ref","key"]),Zr=[[],[],[],[],[],[],[]],Vg={value:"input",checked:"change",open:"toggle",volume:"volumechange",playbackRate:"ratechange",currentTime:"timeupdate"},Fg=new Set(["progress","meter","number","range"]),Hg=new Set(["INPUT","TEXTAREA"]);ji=new Map});var Yi,zn,fe,ta=M(()=>{"use strict";Yi=[],zn=[],fe={bumpChildIndex(){zn[zn.length-1]++},getCurrentChild(){let e=zn[zn.length-1];return this.getCurrentParent().childNodes[e]},getCurrentParent(){return Yi[Yi.length-1]},clear(){Yi.length=0,zn.length=0},pop(){Yi.pop(),zn.pop()},push(e){Yi.push(e),zn.push(0)}}});function qg(e){let t=e,n=[];for(;t&&t.parent;)typeof t.type=="function"?n.push(Zg(t.type)):typeof t.type=="string"&&n.push(t.type),t=t.parent;let i=typeof e.type=="function"?e:ea(e,s=>typeof s.type=="function");return\`The above error occurred in the <\${qc(i?.type||Zc)}> component:
5460
5413
 
5461
- \${r.map(o=>\` at \${o}\`).join(\`
5414
+ \${n.map(s=>\` at \${s}\`).join(\`
5462
5415
  \`)}
5463
- \`}function qr(e){let t=It(e);if(l){let r=Xr(e);r&&(t=\`\${t} (\${r})\`)}return t}function It(e){return e.displayName??(e.name||"Anonymous Function")}function Xr(e){return e.toString().match(/\\/\\/ \\[kiru_devtools\\]:(.*)/)?.[1]??null}var xe=[],ae=[],$={bumpChildIndex(){ae[ae.length-1]++},getCurrentChild(){let e=ae[ae.length-1];return this.getCurrentParent().childNodes[e]},getCurrentParent(){return xe[xe.length-1]},clear(){xe.length=0,ae.length=0},pop(){xe.pop(),ae.pop()},push(e){xe.push(e),ae.push(0)}};var at=!1,nt=!1,Ft=e=>{e.preventDefault(),e.stopPropagation(),nt=!0},le=null;function zt(){at=!0,le=document.activeElement,le&&le!==document.body&&le.addEventListener("blur",Ft)}function jt(){nt&&(le.removeEventListener("blur",Ft),le.isConnected&&le.focus(),nt=!1),at=!1}function Kt(e){let t=e.type;return t=="#text"?Yr(e):et.has(t)?document.createElementNS("http://www.w3.org/2000/svg",t):document.createElement(t)}function Yr(e){let{nodeValue:t}=e.props;return b.isSignal(t)?Ut(e,t):document.createTextNode(t)}function Ut(e,t){let r=t.peek()??"",n=document.createTextNode(r);return ot(e,n,t),n}function Zr(e){return t=>{if(at){t.preventDefault(),t.stopPropagation();return}e(t)}}var Ht=new WeakMap;function Gt(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 v=s.nodeValue;!b.isSignal(v)&&t.nodeValue!==v&&(t.nodeValue=v);return}let u=[];for(let v in i)u.push(v);for(let v in s)v in i||u.push(v);let c;for(let v=0;v<u.length;v++){let p=u[v],x=i[p],E=s[p];if(Oe.isEvent(p)){if(c??(c=Ht.get(e)),c||Ht.set(e,c={}),x!==E||a){let T=p.replace(Vt,""),Z=c[T];if(!E){Z&&(t.removeEventListener(T,Z),delete c[T]);continue}let de=E.bind(void 0);if((T==="focus"||T==="blur")&&(de=Zr(de)),Z){Z.handleEvent=de;continue}t.addEventListener(T,c[T]={handleEvent:de})}continue}if(!(Oe.isInternalProp(p)&&p!=="innerHTML")&&x!==E){if(b.isSignal(x)&&o){let T=o[p];T&&(T(),delete o[p])}if(b.isSignal(E)){tn(e,t,p,E,x);continue}it(t,p,E,x)}}let f=i.ref,w=s.ref;f!==w&&(f&&Pe(f,null),w&&Pe(w,t))}function Jr(e){return e.multiple?Array.from(e.selectedOptions).map(t=>t.value):e.value}function Wt(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 Qr={value:"input",checked:"change",open:"toggle",volume:"volumechange",playbackRate:"ratechange",currentTime:"timeupdate"},en=new Set(["progress","meter","number","range"]);function tn(e,t,r,n,o){let[i,s]=r.split(":"),a=e.cleanups??(e.cleanups={});if(i!=="bind")a[r]=n.subscribe((f,w)=>{f!==w&&(it(t,r,f,w),l&&Bt(e))});else{let f=Qr[s];if(!f){l&&console.error(\`[kiru]: \${s} is not a valid element binding attribute.\`);return}a[r]=nn(e,t,s,f,n)}let u=n.peek(),c=Q(o);u!==c&&it(t,s??i,u,c)}function rn(e,t){return e instanceof HTMLInputElement?on(e,t):e instanceof HTMLSelectElement?()=>Jr(e):()=>e.value}function nn(e,t,r,n,o){let i=f=>{o.sneak(f),o.notify(w=>w!==a)},s=t instanceof HTMLSelectElement&&r==="value"?f=>Wt(t,f):f=>t[r]=f,a=f=>{s(f),l&&Bt(e)},u;if(r==="value"){let f=rn(t,o);u=()=>i(f())}else u=()=>{let f=t[r];r==="currentTime"&&o.peek()===f||i(f)};t.addEventListener(n,u);let c=o.subscribe(a);return()=>{t.removeEventListener(n,u),c()}}function on(e,t){let r=e.type,n=t.peek();return r==="date"&&n instanceof Date?()=>e.valueAsDate:en.has(r)&&typeof n=="number"?()=>e.valueAsNumber:()=>e.value}function Bt(e){window.__kiru.profilingContext?.emit("signalAttrUpdate",U(e))}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",U(e)))})}function sn(e){let t=e.props.nodeValue;if(!b.isSignal(t))return $.getCurrentChild();let r=t.peek();if(ue(r))return $.getCurrentChild();let n=Ut(e,t),o=$.getCurrentChild();return o?(o.before(n),n):$.getCurrentParent().appendChild(n)}function qt(e){let t=e.type==="#text"?sn(e):$.getCurrentChild();if($.bumpChildIndex(),!t)throw new S({message:"Hydration mismatch - no node found",vNode:e});let r=t.nodeName;if(et.has(r)||(r=r.toLowerCase()),e.type!==r)throw new S({message:\`Hydration mismatch - expected node of type \${e.type.toString()} but received \${r}\`,vNode:e});if(e.dom=t,e.type!=="#text"&&!(e.flags&V)){Gt(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;$.bumpChildIndex();let s=String(Q(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 Xt(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 an(e,t,r){let n=tt.has(t);Xt(e,t,r,n)||e.setAttribute(t,n&&typeof r=="boolean"?"":String(r))}var ln=["INPUT","TEXTAREA"],un=e=>ln.indexOf(e.nodeName)>-1;function it(e,t,r,n){switch(t){case"style":return pn(e,r,n);case"className":return fn(e,r);case"innerHTML":return cn(e,r);case"muted":e.muted=!!r;return;case"value":if(e.nodeName==="SELECT")return Wt(e,r);let o=r==null?"":String(r);if(un(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 an(e,tr(t),r)}}function cn(e,t){if(t==null||typeof t=="boolean"){e.innerHTML="";return}e.innerHTML=String(t)}function fn(e,t){let r=Q(t);if(!r)return e.removeAttribute("class");e.setAttribute("class",r)}function pn(e,t,r){if(Xt(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 dn(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 S({message:"No DOM parent found while attempting to place node.",vNode:e})}return t}function mn(e,t){let{node:r,lastChild:n}=t,o=e.dom;if(n){n.after(o);return}let i=Yt(e,r);if(i){r.dom.insertBefore(o,i);return}r.dom.appendChild(o)}function Yt(e,t){let r=e;for(;r;){let n=r.sibling;for(;n;){if(!(n.flags&(O|V))){let o=gn(n);if(o?.isConnected)return o}n=n.sibling}if(r=r.parent,!r||r.flags&V||r===t)return}}function gn(e){let t=e;for(;t;){if(t.dom)return t.dom;if(t.flags&V)return;t=t.child}}function Zt(e){if(M.current==="hydrate")return ce(e,Ee);let t={node:e.dom?e:dn(e)};st(e,t,(e.flags&O)>0),e.dom&&!(e.flags&V)&&Jt(e,t,!1),Ee(e)}function st(e,t,r){let n=e.child;for(;n;){if(n.flags&ve){n.flags&O&&hn(n,t),Ee(n),n=n.sibling;continue}n.dom?(st(n,{node:n},!1),n.flags&V||Jt(n,t,r)):st(n,t,(n.flags&O)>0||r),Ee(n),n=n.sibling}}function Jt(e,t,r){(r||!e.dom.isConnected||e.flags&O)&&mn(e,t),(!e.prev||e.flags&D)&&Gt(e),t.lastChild=e.dom}function Qt(e){e===e.parent?.child&&(e.parent.child=e.sibling);let t;l&&(t=U(e)),ce(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&V)&&s.remove(),a&&Pe(a,null),delete r.dom)}),e.parent=null}function hn(e,t){if(!e.child)return;let r=[];if(er(e.child,r),r.length===0)return;let{node:n,lastChild:o}=t;if(o)o.after(...r);else{let i=Yt(e,n),s=n.dom;i?i.before(...r):s.append(...r)}t.lastChild=r[r.length-1]}function er(e,t){let r=e;for(;r;)r.dom?t.push(r.dom):r.child&&er(r.child,t),r=r.sibling}function d(e,t=null,...r){e===fe&&(e=A);let n=t===null?{}:t,o=lt(n.key),i=r.length;return i===1?n.children=r[0]:i>1&&(n.children=r),{type:e,key:o,props:n}}function fe({children:e,key:t}){return{type:A,key:lt(t),props:{children:e}}}function ut(e){return typeof e[Re]=="function"}function Le(e,t=null,r={},n=null,o=0){e===fe&&(e=A);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 pt;function Ne(e,t){return l&&(pt=U(e)),Array.isArray(t)?(l&&(lr in t&&xn(e,t),vn(e,t)),bn(e,t)):wn(e,t)}function wn(e,t){let r=e.child;if(r===null)return ir(e,t);let n=r.sibling,o=nr(e,r,t);if(o!==null)return r&&r!==o&&!o.prev?ft(e,r):n&&ft(e,n),o;{let i=ur(r),s=sr(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)}Ve(s,0,0)}return i.forEach(a=>$e(e,a)),s}}function bn(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=nr(e,o,t[a]);if(c===null){o===null&&(o=i);break}o&&!c.prev&&$e(e,o),s=Ve(c,s,a),n===null?r=c:n.sibling=c,n=c,o=i}if(a===t.length)return ft(e,o),r;if(o===null){for(;a<t.length;a++){let c=ir(e,t[a]);c!==null&&(s=Ve(c,s,a),n===null?r=c:n.sibling=c,n=c)}return r}let u=ur(o);for(;a<t.length;a++){let c=sr(u,e,a,t[a]);if(c!==null){let f=c.prev;if(f!==null){let w=f.key;u.delete(w===null?f.index:w)}s=Ve(c,s,a),n===null?r=c:n.sibling=c,n=c}}return u.forEach(c=>$e(e,c)),r}function nr(e,t,r){let n=t===null?null:t.key;return ue(r)?n!==null||t?.type==="#text"&&b.isSignal(t.props.nodeValue)?null:rr(e,t,""+r):b.isSignal(r)?t&&t.props.nodeValue!==r?null:rr(e,t,r):ge(r)?r.key!==n?null:yn(e,t,r):Array.isArray(r)?n!==null?null:(l&&dt(r),or(e,t,r)):null}function rr(e,t,r){return t===null||t.type!=="#text"?G(e,"#text",{nodeValue:r}):(l&&Se(),t.props.nodeValue!==r&&(t.props.nodeValue=r,t.flags|=D),t.sibling=null,t)}function yn(e,t,r){let{type:n,props:o,key:i}=r;return l&&typeof n=="function"&&(n=k(n)),n===A?or(e,t,o.children||[],o):t?.type===n?(l&&Se(),t.index=0,t.sibling=null,typeof n=="string"?ar(t.props,o)&&(t.flags|=D):t.flags|=D,t.props=o,t):G(e,n,o,i)}function or(e,t,r,n={}){return t===null||t.type!==A?G(e,A,{children:r,...n}):(l&&Se(),t.props={...t.props,...n,children:r},t.flags|=D,t.sibling=null,t)}function ir(e,t){return ue(t)?G(e,"#text",{nodeValue:""+t}):b.isSignal(t)?G(e,"#text",{nodeValue:t}):ge(t)?G(e,t.type,t.props,t.key):Array.isArray(t)?(l&&dt(t),G(e,A,{children:t})):null}function Ve(e,t,r){e.index=r;let n=e.prev;if(n!==null){let o=n.index;return o<t?(e.flags|=O,t):o}else return e.flags|=O,t}function sr(e,t,r,n){if(b.isSignal(n)||ue(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 G(t,"#text",{nodeValue:n},null,r)}if(ge(n)){let{type:i,props:s,key:a}=n,u=e.get(a===null?r:a);return u?.type===i?(l&&Se(),typeof i=="string"?ar(u.props,s)&&(u.flags|=D):u.flags|=D,u.props=s,u.sibling=null,u.index=r,u):G(t,i,s,a,r)}if(Array.isArray(n)){let i=e.get(r);return l&&dt(n),i?(l&&Se(),i.flags|=D,i.props.children=n,i):G(t,A,{children:n},null,r)}return null}function ar(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 Se(){"window"in globalThis&&window.__kiru.profilingContext?.emit("updateNode",pt)}var lr=Symbol("kiru:marked-list-child");function dt(e){Object.assign(e,{[lr]:!0})}function ur(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 $e(e,t){e.deletions===null?e.deletions=[t]:e.deletions.push(t)}function ft(e,t){for(;t;)$e(e,t),t=t.sibling}function vn(e,t){let r=new Set,n=!1;for(let o of t){if(!ge(o))continue;let i=o.key;if(typeof i=="string"){if(!n&&r.has(i)){let s=fr(e);cr(\`\${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 xn(e,t){let r=!1,n=!1;for(let o of t)ge(o)&&(typeof o.key=="string"?r=!0:n=!0);if(n&&r){let o=fr(e);cr(\`\${o} component produced a child in a list without a valid key prop\`)}}function cr(e){let t=\`[kiru]: \${e}. See https://kirujs.dev/keys-warning for more information.\`;console.error(t)}var ct=new WeakMap;function fr(e){if(ct.has(e))return ct.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 ct.set(e,n),n}function G(e,t,r,n=null,o=0){let i=Le(t,e,r,n,o);return i.flags|=O,typeof t=="function"&&ut(t)&&(i.flags|=De),l&&"window"in globalThis&&window.__kiru.profilingContext?.emit("createNode",pt),i}var W,B=[],he=!1,gt=[],Ie=[],ht=!1,wt=!1,bt=!1,yt=0,pr=[],vt=[],dr=-1;function Et(e){if(he){gt.push(e);return}e()}function ke(){he&&(window.cancelAnimationFrame(dr),mr())}function St(e){e.flags|=J,B.push(e),he=!0,ke()}function N(e){if(M.current==="hydrate")return Et(()=>xt(e));xt(e)}function En(){he||(he=!0,dr=window.requestAnimationFrame(mr))}function Sn(){for(he=!1;gt.length;)gt.shift()()}function xt(e){if(ht&&(wt=!0),_.current===e){l&&window.__kiru.profilingContext?.emit("updateDirtied",W),bt=!0;return}if(!(e.flags&(J|me))){if(e.flags|=J,!B.length)return B.push(e),En();B.push(e)}}function kn(e){ce(e,t=>t.flags|=me),Ie.push(e)}var _n=(e,t)=>t.depth-e.depth,ee=null;function mr(){if(l){let t=Ie[0]??B[0];t?(W=U(t),window.__kiru.profilingContext?.beginTick(W)):W=null}let e=1;for(zt();B.length;){B.length>e&&B.sort(_n),ee=B.shift(),e=B.length;let t=ee.flags;if(!(t&me)&&t&J){let r=ee;for(;r=Cn(r););for(;Ie.length;)Qt(Ie.pop());Zt(ee),ee.flags&=~J}}if(jt(),ht=!0,mt(pr),ht=!1,wt)return Dn(),mt(vt),wt=!1,yt++,l&&(window.__kiru.profilingContext?.endTick(W),window.__kiru.profilingContext?.emit("updateDirtied",W)),ke();yt=0,Sn(),queueMicrotask(()=>mt(vt)),l&&(window.__kiru.emit("update",W),window.__kiru.profilingContext?.emit("update",W),window.__kiru.profilingContext?.endTick(W))}function Cn(e){let t=Tn(e);if(e.deletions!==null&&(e.deletions.forEach(kn),e.deletions=null),t)return t;let r=e;for(;r;){if(r.immediateEffects&&(pr.push(...r.immediateEffects),r.immediateEffects=void 0),r.effects&&(vt.push(...r.effects),r.effects=void 0),r===ee)return null;if(r.sibling)return r.sibling;r=r.parent,M.current==="hydrate"&&r?.dom&&$.pop()}return null}function Tn(e){let{type:t,props:r,prev:n,flags:o}=e;if(!(l&&we())){if(!(o&J)&&r===n?.props)return null}try{return typeof t=="string"?Rn(e):kt(t)?An(e):Mn(e)}catch(i){l&&window.__kiru.emit("error",W,i instanceof Error?i:new Error(String(i)));let s=gr(e);if(s){let a=s.error=i instanceof Error?i:new Error(String(i));return s.props.onError?.(a),s.depth<ee.depth&&(ee=s),s}if(S.isKiruError(i)){if(i.customNodeStack&&setTimeout(()=>{throw new Error(i.customNodeStack)}),i.fatal)throw i;return console.error(i),e.child}setTimeout(()=>{throw i})}return null}function An(e){let{props:t,type:r}=e,n=t.children;if(r===oe){let{props:{dependents:o,value:i},prev:s}=e;o.size&&s&&s.props.value!==i&&o.forEach(xt)}else if(r===se){let o=e,{error:i}=o;i&&(n=typeof t.fallback=="function"?t.fallback(i):t.fallback,delete o.error)}return e.child=Ne(e,n)}function Mn(e){let{type:t,props:r,subs:n,prev:o,flags:i}=e;if(i&De){if(o&&t[Re](o.props,r)&&!(l&&we()))return e.flags|=ve,null;e.flags&=~ve}try{_.current=e;let s,a=0;do{if(e.flags&=~J,bt=!1,X.current=0,n&&(n.forEach(te),n.clear()),l){if(s=k(t)(r),we()&&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(++a>Qe)throw new S({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(bt);return e.child=Ne(e,s)}finally{_.current=null}}function Rn(e){let{props:t,type:r}=e;return l&&_t(e),e.dom||(M.current==="hydrate"?qt(e):e.dom=Kt(e),l&&e.dom instanceof Element&&(e.dom.__kiruNode=e)),r!=="#text"&&(e.child=Ne(e,t.children),e.child&&M.current==="hydrate"&&$.push(e.dom)),e.child}function Dn(){if(yt>Qe)throw new S("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 mt(e){for(let t=0;t<e.length;t++)e[t]();e.length=0}var hr;(function(e){e.Start="start",e.End="end"})(hr||(hr={}));var be=null,wr=new Set;function g(e,t,r){let n=On(e);if(l&&be!==null&&!wr.has(e+be))throw wr.add(e+be),new S({message:\`Nested primitive "useHook" calls are not supported. "\${e}" was called inside "\${be}". 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=X.current++,s=n.hooks?.at(i);if(l){be=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:we(),update:()=>N(n),queueEffect:o,vNode:n,index:i})}catch(u){throw u}finally{be=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:()=>N(n),queueEffect:o,vNode:n,index:i})}catch(a){throw a}}function On(e){let t=_.current;if(!t)throw new S(\`Hook "\${e}" must be used at the top level of a component or inside another composite hook.\`);return t}function I(e){e.cleanup&&(e.cleanup(),e.cleanup=void 0)}function C(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 _e={stack:new Array,current:function(){return this.stack[this.stack.length-1]}},H=new Map,F=new Map;var br,b=class e{constructor(t,r){this[br]=!0,this.$id=Fe(),this.$value=t,r&&(this.displayName=r),l?(F.set(this.$id,new Set),this.$initialValue=Ct(t),this[ie]={provide:()=>this,inject:n=>{F.get(this.$id)?.clear?.(),F.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(l){let t=k(this);return e.entangle(t),t.$value}return e.entangle(this),this.$value}set value(t){if(l){let r=k(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 l?k(this).$value:this.$value}sneak(t){if(l){let r=k(this);r.$prevValue=r.$value,r.$value=t;return}this.$prevValue=this.$value,this.$value=t}toString(){if(l){let t=k(this);return e.entangle(t),\`\${t.$value}\`}return e.entangle(this),\`\${this.$value}\`}subscribe(t){return l?(F.get(this.$id).add(t),()=>F.get(this.$id)?.delete(t)):(this.$subs.add(t),()=>this.$subs.delete(t))}notify(t){if(l)return F.get(this.$id)?.forEach(r=>{if(t&&!t(r))return;let{$value:n,$prevValue:o}=k(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&&Ye in t}static subscribers(t){return l?F.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=_.current,n=_e.current();if(n){(!r||r&&m())&&n.set(t.$id,t);return}if(!r||!m())return;let o=t.subscribe(()=>N(r));(r.subs??(r.subs=new Set)).add(o)}static dispose(t){if(t.$isDisposed=!0,l){F.delete(t.$id);return}t.$subs.clear()}};br=Ye;var He=(e,t)=>new b(e,t),y=(e,t)=>g("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 Q(e,t=!1){return b.isSignal(e)?t?e.value:e.peek():e}var Tt=()=>{H.forEach(te),H.clear()};var yr=new Set(["children","ref","key","innerHTML"]),Oe={isInternalProp:e=>yr.has(e),isEvent:e=>e.startsWith("on"),isStringRenderableProperty:e=>!yr.has(e)&&!Oe.isEvent(e)};function tr(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():$t.get(e)||e}}function Ct(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 te(e){e()}var K=Object.freeze(()=>{});function k(e){let t=e;if(l)for(;"__next"in t;)t=t.__next;return t}function Pe(e,t){if(typeof e=="function"){e(t);return}if(b.isSignal(e)){e.value=t;return}e.current=t}function m(){return M.current==="dom"||M.current==="hydrate"}function ge(e){return typeof e=="object"&&e!==null&&"type"in e}function ue(e){return typeof e=="string"&&e!==""||typeof e=="number"||typeof e=="bigint"}function kt(e){return e===A||e===oe||e===se}function vr(e){return e.type===A}function U(e){let t=e;for(;t;){if(t.app)return e.app=t.app;t=t.parent}return null}function Ee(e){let{props:t,key:r,index:n}=e;e.prev={props:t,key:r,index:n},e.flags&=~(D|O|me)}function xr(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 ce(e,t){t(e);let r=e.child;for(;r;)t(r),r.child&&ce(r,t),r=r.sibling}function rt(e,t){let r=e.parent;for(;r;){if(t(r))return r;r=r.parent}return null}function gr(e){return rt(e,t=>t.type===se)}function _t(e){if("children"in e.props&&e.props.innerHTML)throw new S({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 S({message:\`Cannot use both bind:\${t} and \${t} on an element\`,vNode:e})}function lt(e){return e===void 0?null:typeof e=="string"||typeof e=="number"?e:null}var Pn="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz-";function Fe(e=10,t=Pn){let r="";for(let n=0;n<e;n++)r+=t[Math.random()*t.length|0];return r}var Ln=!1;function we(){return Ln}function ze(e){let{id:t,subs:r,fn:n,deps:o=[],onDepChanged:i}=e,s;H.delete(t);let a=!!_.current&&!m();a||(s=new Map,_e.stack.push(s));let u=n(...o.map(c=>c.value));if(!a){for(let[f,w]of r)s.has(f)||(w(),r.delete(f));let c=()=>{H.size||queueMicrotask(Tt),H.set(t,i)};for(let[f,w]of s){if(r.has(f))continue;let v=w.subscribe(c);r.set(f,v)}_e.stack.pop()}return u}var ye=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[ie].inject;this[ie]={provide:()=>this,inject:o=>{n(o),e.stop(o),this.$isDirty=o.$isDirty},destroy:()=>{}}}}get value(){return this.ensureNotDirty(),super.value}toString(){return this.ensureNotDirty(),super.toString()}peek(){return this.ensureNotDirty(),super.peek()}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=k(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}=k(t);H.delete(r),n.forEach(te),n.clear(),t.$isDirty=!0}static run(t){let r=k(t),{$id:n,$getter:o,$unsubs:i}=r,s=ze({id:n,subs:i,fn:()=>o(r.$value),onDepChanged:()=>{if(r.$isDirty=!0,l){if(!F?.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}ensureNotDirty(){this.$isDirty&&(l&&this.$isDisposed||e.run(this))}};function Er(e,t){return new ye(e,t)}function At(e,t,r){return g("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=()=>ye.dispose(n.signal),n.signal=Er(e,r)):n.deps&&typeof t!="string"&&C(n.deps,t)&&(n.deps=t,ye.updateGetter(n.signal,e)),n.signal))}var Ce=class e{constructor(t,r){if(this.id=Fe(),this.getter=t,this.deps=r,this.unsubs=new Map,this.isRunning=!1,this.cleanup=null,l&&"window"in globalThis){let{isWaitingForNextWatchCall:n,pushWatch:o}=window.__kiru.HMRContext.signals;n()&&o(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(){H.delete(this.id),this.unsubs.forEach(te),this.unsubs.clear(),this.cleanup?.(),this.cleanup=null,this.isRunning=!1}static run(t){let r=k(t),{id:n,getter:o,unsubs:i,deps:s}=r;r.cleanup=ze({id:n,subs:i,fn:o,deps:s,onDepChanged:()=>{r.cleanup?.(),e.run(r)}})??null}};function Sr(e,t){if(typeof e=="function")return new Ce(e);let r=e,n=t;return new Ce(n,r)}function Te(e,t){if(m())return g("useWatch",{watcher:null},({hook:r,isInit:n,isHMR:o})=>{if(l&&o&&(r.cleanup?.(),n=!0),n){let i=r.watcher=Sr(e,t);r.cleanup=()=>i.stop()}return r.watcher})}var Vn=0;function kr(e,t,r){if(l&&t.__kiruNode)throw new Error("[kiru]: container in use - call unmount on the previous app first.");let n=$n(t),o=Vn++,i={id:o,name:r?.name??\`App-\${o}\`,rootNode:n,render:s,unmount:a};function s(u){n.props.children=u,St(n)}function a(){n.props.children=null,St(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,N),l&&queueMicrotask(()=>{window.dispatchEvent(new Event("kiru:ready"))}),i}function $n(e){let t=Le(e.nodeName.toLowerCase());return t.flags|=V,t.dom=e,l&&(e.__kiruNode=t),t}function pe(e){return m()?g("useState",{state:void 0,dispatch:K},({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,K]}function _r(e){let t={[Pt]:!0,Provider:({value:r,children:n})=>{let[o]=pe(()=>new Set);return d(oe,{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"}};return t}function Y(e,t){return m()?g("useCallback",{callback:e,deps:t},({hook:r,isHMR:n})=>(l&&(r.dev={devtools:{get:()=>({callback:r.callback,dependencies:r.deps})}},n&&(r.deps=[])),C(t,r.deps)&&(r.deps=t,r.callback=e),r.callback)):e}function z(e,t){if(m())return g("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||C(t,r.deps))&&(r.deps=t,I(r),i(()=>{let s=e();typeof s=="function"&&(r.cleanup=s)}))})}function re(e,t){if(m())return g("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||C(t,r.deps))&&(r.deps=t,I(r),i(()=>{let s=e();typeof s=="function"&&(r.cleanup=s)},{immediate:!0}))})}function Ae(e,t){return m()?g("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||C(t,r.deps))&&(r.deps=t,r.value=e()),r.value)):e()}function P(e){return m()?g("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 hl="window"in globalThis?window.__KIRU_LAZY_CACHE??(window.__KIRU_LAZY_CACHE=new Map):new Map;function Ar(e){let[t,r]=pe(e.initialState||"exited"),n=P(null);re(()=>{e.in&&t!=="entered"&&t!=="entering"?(o("entering"),i("entered")):!e.in&&t!=="exited"&&t!=="exiting"&&(o("exiting"),i("exited"))},[e.in,t]),z(()=>()=>Tr(n.current),[]);let o=Y(s=>{Tr(n.current),r(s),(s==="entered"||s==="exited")&&e.onTransitionEnd&&e.onTransitionEnd(s)},[]),i=Y(s=>{n.current=window.setTimeout(()=>o(s),Hn(s,e.duration))},[e.duration]);return e.element(t)}var Cr=150;function Hn(e,t){if(typeof t=="number")return t;switch(e){case"entered":return t?.in??Cr;case"exited":return t?.out??Cr}}function Tr(e){e!=null&&window.clearTimeout(e)}"window"in globalThis;var Mr=()=>d("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"},d("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 je="kiru.devtools.anchorPosition",Rr={x:-16,y:-16};var Mt=(e,t,r)=>{if(!t.current)return{...Rr};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}},Dr=e=>{if(e==null)return null;let t=null,r=e?.__kiruNode?.parent;for(;r;){if(typeof r.type=="function"&&!vr(r)){t=r;break}r=r.parent}return t},Or=(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 Ke(e,t){if(!e)throw new Error(t)}var Lr={arrayChunkSize:10,objectKeysChunkSize:100};function Vr(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"&&!Vr(e[n],t[n]))return!1;return!0}var jn={...Lr},Pr=localStorage.getItem("kiru.devtools.userSettings");if(Pr)try{let e=JSON.parse(Pr);Vr(Lr,e)&&(jn=e)}catch(e){console.error("kiru.devtools.userSettings error",e)}var cc=_r({userSettings:null,saveUserSettings:()=>{}});var bc=Object.freeze(()=>{});var Gn="kiru-devtools";"window"in globalThis&&(window.__devtoolsSelection??(window.__devtoolsSelection=null),window.__devtoolsNodeUpdatePtr??(window.__devtoolsNodeUpdatePtr=null));var Rt=class extends BroadcastChannel{send(t){super.postMessage(t)}removeEventListener(t){return super.removeEventListener("message",t)}addEventListener(t){return super.addEventListener("message",t)}},R=new Rt(Gn);var jc=Symbol.for("devtools.hookGroup");var L=(e,t,r={})=>{z(()=>{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 Ue=()=>{let e=y({x:0,y:0}),t=y({x:0,y:0}),r=y({x:0,y:0});return L("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 Ge="window"in globalThis&&"ResizeObserver"in globalThis.window,$r=(e,t,r=void 0)=>m()?Ge?g("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(()=>{C([e.current],o.deps)&&(o.deps=[e.current],o.resizeObserver?.disconnect?.(),e.current&&o.resizeObserver?.observe(e.current,r))}),{isSupported:Ge,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:()=>{I(o)}})):{isSupported:Ge,start:()=>{},stop:()=>{}}:{isSupported:Ge,start:()=>{},stop:()=>{}};var We="window"in globalThis&&"MutationObserver"in globalThis.window,Nr=(e,t,r=void 0)=>m()?We?g("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}):C([e.current],o.deps)&&(o.deps=[e.current],o.mutationObserver?.disconnect?.(),e.current&&o.mutationObserver?.observe(e.current,r)),{isSupported:We,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:()=>{I(o)}})):{isSupported:We,start:()=>{},stop:()=>{}}:{isSupported:We,start:()=>{},stop:()=>{}};var Be=(e,t={windowScroll:!0,windowResize:!0})=>{let r=t?.windowScroll??!0,n=t?.windowResize??!0,o=t.immediate??!0,i=y(0),s=y(0),a=y(0),u=y(0),c=y(0),f=y(0),w=y(0),v=y(0),p=()=>{let x=e.current;if(!x){i.value=0,s.value=0,a.value=0,u.value=0,c.value=0,f.value=0,w.value=0,v.value=0;return}let E=x.getBoundingClientRect();i.value=E.width,s.value=E.height,a.value=E.top,u.value=E.right,c.value=E.bottom,f.value=E.left,w.value=E.x,v.value=E.y};return $r(e,p),Nr(e,p,{attributeFilter:["style","class"]}),L("scroll",()=>{r&&p()},{capture:!0,passive:!0}),L("resize",()=>{n&&p()},{passive:!0}),re(()=>{o&&p()},[]),{width:i,height:s,top:a,right:u,bottom:c,left:f,x:w,y:v,update:p}};var Ir=(e,t)=>{if(!m())return{isActive:t?.immediate??!1,start:()=>null,stop:()=>null};let r=t?.fpsLimit?1e3/t.fpsLimit:null;return g("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:()=>{I(o),i()}}))};var Hr=e=>{let{x:t,y:r,multiple:n,immediate:o=!0}=e,i=y(null),a=Ir(()=>{i.value=n?document.elementsFromPoint(t,r)??[]:document.elementFromPoint(t,r)??null},{immediate:o});return{element:i,...a}};var Fr=()=>{let{mouse:e}=Ue(),t=y(null),r=P(null),n=P(null),o=Be(r),i=y({x:-16,y:-16}),s=y({x:-16,y:-16}),a=y({width:window.innerWidth,height:window.innerHeight}),u=y("bottom"),c=P(null);re(()=>{let p=localStorage.getItem(je);if(p==null)return;let x=JSON.parse(p);a.value.width=window.innerWidth,a.value.height=window.innerHeight,u.value=x.snapSide,s.value=Mt(x,n,o)},[]);let f=At(()=>{let{x:p,y:x}=e.value;if(t.value===null)return null;let{x:E,y:T}=t.value;return{x:p-E,y:x-T}});L("dragstart",p=>{p.preventDefault(),t.value={x:p.x,y:p.y},i.value=s.value},{ref:()=>r.current}),L("mouseup",()=>{c.current&&(clearTimeout(c.current),c.current=null),t.peek()&&(t.value=null,localStorage.setItem(je,JSON.stringify({...s.value,...a.value,snapSide:u.value})))});let w=Y(()=>{if(n.current==null)return;let p=n.current.offsetWidth;if(u.value==="right"){let x=Math.min(-16,s.value.y);s.value={x:-16,y:Math.max(x,(window.innerHeight-o.height.value)*-1+16)}}else if(u.value==="left"){let x=Math.min(0,s.value.y);s.value={x:(p-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,s.value.x);s.value={x:Math.max(x,(p-o.width.value)*-1+16),y:(window.innerHeight-o.height.value)*-1+16};return}else{let x=Math.min(-16,s.value.x);s.value={x:Math.max(x,(p-o.width.value)*-1+16),y:-16}}},[]);Te([f,e],(p,x)=>{if(p===null||!n.current)return;let{x:E,y:T}=x,Z=n.current.offsetWidth,de=T>=window.innerHeight-100,Ot=T<=100;if(!Ot&&!de){let ne=E>window.innerWidth/2;u.value=ne?"right":"left"}else u.value=Ot?"top":"bottom";if(u.value==="right"){let ne=Math.min(-16,i.value.y+p.y);s.value={x:-16,y:Math.max(ne,(window.innerHeight-o.height.value)*-1+16)};return}else if(u.value==="left"){let ne=Math.min(0,i.value.y+p.y);s.value={x:(Z-o.width.value)*-1+16,y:Math.max(ne,(window.innerHeight-o.height.value)*-1+16)};return}else if(u.value==="top"){let ne=Math.min(-16,i.value.x+p.x);s.value={x:Math.max(ne,(Z-o.width.value)*-1+16),y:(window.innerHeight-o.height.value)*-1+16};return}let Wr=Math.min(-16,i.value.x+p.x);s.value={y:-16,x:Math.max(Wr,(Z-o.width.value)*-1+16)}});let v=Y(()=>{n.current!==null&&(s.value=Mt({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(je,JSON.stringify({...s.value,...a.value,snapSide:u.value})))},[Math.round(o.width.value),Math.round(o.height.value)]);return L("resize",v),{anchorRef:r,anchorCoords:s,viewPortRef:n,startMouse:t,elementBound:o,snapSide:u,updateAnchorPos:w}};var j=He(!1);"window"in globalThis&&R.addEventListener(e=>{e.data.type==="set-inspect-enabled"&&(j.value=e.data.value)});var q=He(null);var zr="kiru-devtools-popup-size",qe=()=>{let e=q.value;return Y(()=>new Promise((r,n)=>{if(e)if(e.closed)q.value=null;else return e.focus(),r(e);let o=sessionStorage.getItem(zr),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),q.value=a,a.onbeforeunload=()=>{console.debug("[kiru]: devtools window closed"),q.value=null})};R.addEventListener(u),a.onresize=()=>{sessionStorage.setItem(zr,JSON.stringify({width:a.innerWidth,height:a.innerHeight}))}}),[e])};var jr=()=>{let e=qe(),{mouse:t}=Ue(),r=Hr({x:t.value.x,y:t.value.y,immediate:!1}),n=r.element.value,o=j.value?n:null,i=Ae(()=>{if(o&&window.__kiru){let c=window.__kiru.apps.find(f=>f.rootNode==null||o.__kiruNode==null?!1:xr(f.rootNode,o.__kiruNode));return c?.rootNode==null?null:c}return null},[o]),s=Ae(()=>o?Dr(o):null,[o]),a=P(null),u=Be(a);return z(()=>j.subscribe(f=>{r[f?"start":"stop"]()}),[]),z(()=>{s&&o?a.current=Or(s,o)??null:a.current=null},[s,o]),L("click",c=>{if(j.value===!0&&s&&i){c.preventDefault();let f=w=>{w.__devtoolsSelection={node:s,app:i},R.send({type:"select-node"}),R.send({type:"set-inspect-enabled",value:!1}),j.value=!1,a.current=null,w.focus()};q.value?f(q.value):e().then(w=>f(w))}}),s&&d("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)\`}},d("p",null,s.type.name))};function Kr(e){return d("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,viewBox:"0 -960 960 960",fill:"currentColor",...e},d("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 Ur(e){return d("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},d("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"}),d("path",{d:"M21 11V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h6"}))}var Wn=()=>{j.value=!j.value,R.send({type:"set-inspect-enabled",value:j.value})};function Bn(e,t){let{damping:r}=t,n=y(e),o=P(e);return z(()=>{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 Dt(){let e=y(!1),t=qe(),{anchorCoords:r,anchorRef:n,viewPortRef:o,startMouse:i,snapSide:s}=Fr(),a=s.value==="left"||s.value==="right",u=P(!1),c=Bn(r.value,{damping:.4});return Te([r],c.set),re(()=>{u.current===!1&&c.set(r.value,{hard:!0}),u.current=!0},[]),d(fe,null,d("div",{ref:o,className:"w-full h-0 fixed top-0 left-0 z-[-9999] overflow-scroll pointer-events-none"}),d("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)\`}},d(Ar,{in:e.value,duration:{in:40,out:150},element:f=>{if(f==="exited")return null;let w=f==="entered"?"1":"0.5",v=f==="entered"?"1":"0";return d(fe,null,d("button",{title:"Open Devtools",onclick:t,style:{transform:\`scale(\${w})\`,opacity:v},className:"transition text-white rounded-full p-1 hover:bg-[#0003]"},d(Kr,{width:16,height:16})),d("button",{title:"Toggle Component Inspection",onclick:Wn,style:{transform:\`scale(\${w})\`,opacity:v},className:\`transition text-white rounded-full p-1 hover:bg-[#0003] \${j.value?"bg-[#0003]":""}\`},d(Ur,{width:16,height:16})))}}),d("button",{className:"bg-crimson rounded-full p-1"+(i.value?" pointer-events-none":""),onclick:()=>e.value=!e.value,tabIndex:-1},d(Mr,null))),d(jr,null))}var Gr=\`*, ::before, ::after {
5464
- --tw-border-spacing-x: 0;
5465
- --tw-border-spacing-y: 0;
5466
- --tw-translate-x: 0;
5467
- --tw-translate-y: 0;
5468
- --tw-rotate: 0;
5469
- --tw-skew-x: 0;
5470
- --tw-skew-y: 0;
5471
- --tw-scale-x: 1;
5472
- --tw-scale-y: 1;
5473
- --tw-pan-x: ;
5474
- --tw-pan-y: ;
5475
- --tw-pinch-zoom: ;
5476
- --tw-scroll-snap-strictness: proximity;
5477
- --tw-gradient-from-position: ;
5478
- --tw-gradient-via-position: ;
5479
- --tw-gradient-to-position: ;
5480
- --tw-ordinal: ;
5481
- --tw-slashed-zero: ;
5482
- --tw-numeric-figure: ;
5483
- --tw-numeric-spacing: ;
5484
- --tw-numeric-fraction: ;
5485
- --tw-ring-inset: ;
5486
- --tw-ring-offset-width: 0px;
5487
- --tw-ring-offset-color: #fff;
5488
- --tw-ring-color: rgb(59 130 246 / 0.5);
5489
- --tw-ring-offset-shadow: 0 0 #0000;
5490
- --tw-ring-shadow: 0 0 #0000;
5491
- --tw-shadow: 0 0 #0000;
5492
- --tw-shadow-colored: 0 0 #0000;
5493
- --tw-blur: ;
5494
- --tw-brightness: ;
5495
- --tw-contrast: ;
5496
- --tw-grayscale: ;
5497
- --tw-hue-rotate: ;
5498
- --tw-invert: ;
5499
- --tw-saturate: ;
5500
- --tw-sepia: ;
5501
- --tw-drop-shadow: ;
5502
- --tw-backdrop-blur: ;
5503
- --tw-backdrop-brightness: ;
5504
- --tw-backdrop-contrast: ;
5505
- --tw-backdrop-grayscale: ;
5506
- --tw-backdrop-hue-rotate: ;
5507
- --tw-backdrop-invert: ;
5508
- --tw-backdrop-opacity: ;
5509
- --tw-backdrop-saturate: ;
5510
- --tw-backdrop-sepia: ;
5511
- --tw-contain-size: ;
5512
- --tw-contain-layout: ;
5513
- --tw-contain-paint: ;
5514
- --tw-contain-style: ;
5515
- }
5516
-
5517
- ::backdrop {
5518
- --tw-border-spacing-x: 0;
5519
- --tw-border-spacing-y: 0;
5520
- --tw-translate-x: 0;
5521
- --tw-translate-y: 0;
5522
- --tw-rotate: 0;
5523
- --tw-skew-x: 0;
5524
- --tw-skew-y: 0;
5525
- --tw-scale-x: 1;
5526
- --tw-scale-y: 1;
5527
- --tw-pan-x: ;
5528
- --tw-pan-y: ;
5529
- --tw-pinch-zoom: ;
5530
- --tw-scroll-snap-strictness: proximity;
5531
- --tw-gradient-from-position: ;
5532
- --tw-gradient-via-position: ;
5533
- --tw-gradient-to-position: ;
5534
- --tw-ordinal: ;
5535
- --tw-slashed-zero: ;
5536
- --tw-numeric-figure: ;
5537
- --tw-numeric-spacing: ;
5538
- --tw-numeric-fraction: ;
5539
- --tw-ring-inset: ;
5540
- --tw-ring-offset-width: 0px;
5541
- --tw-ring-offset-color: #fff;
5542
- --tw-ring-color: rgb(59 130 246 / 0.5);
5543
- --tw-ring-offset-shadow: 0 0 #0000;
5544
- --tw-ring-shadow: 0 0 #0000;
5545
- --tw-shadow: 0 0 #0000;
5546
- --tw-shadow-colored: 0 0 #0000;
5547
- --tw-blur: ;
5548
- --tw-brightness: ;
5549
- --tw-contrast: ;
5550
- --tw-grayscale: ;
5551
- --tw-hue-rotate: ;
5552
- --tw-invert: ;
5553
- --tw-saturate: ;
5554
- --tw-sepia: ;
5555
- --tw-drop-shadow: ;
5556
- --tw-backdrop-blur: ;
5557
- --tw-backdrop-brightness: ;
5558
- --tw-backdrop-contrast: ;
5559
- --tw-backdrop-grayscale: ;
5560
- --tw-backdrop-hue-rotate: ;
5561
- --tw-backdrop-invert: ;
5562
- --tw-backdrop-opacity: ;
5563
- --tw-backdrop-saturate: ;
5564
- --tw-backdrop-sepia: ;
5565
- --tw-contain-size: ;
5566
- --tw-contain-layout: ;
5567
- --tw-contain-paint: ;
5568
- --tw-contain-style: ;
5569
- }/*
5570
- ! tailwindcss v3.4.18 | MIT License | https://tailwindcss.com
5571
- *//*
5572
- 1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
5573
- 2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
5574
- */
5575
-
5576
- *,
5577
- ::before,
5578
- ::after {
5579
- box-sizing: border-box; /* 1 */
5580
- border-width: 0; /* 2 */
5581
- border-style: solid; /* 2 */
5582
- border-color: #e5e7eb; /* 2 */
5583
- }
5584
-
5585
- ::before,
5586
- ::after {
5587
- --tw-content: '';
5588
- }
5589
-
5590
- /*
5591
- 1. Use a consistent sensible line-height in all browsers.
5592
- 2. Prevent adjustments of font size after orientation changes in iOS.
5593
- 3. Use a more readable tab size.
5594
- 4. Use the user's configured \\\`sans\\\` font-family by default.
5595
- 5. Use the user's configured \\\`sans\\\` font-feature-settings by default.
5596
- 6. Use the user's configured \\\`sans\\\` font-variation-settings by default.
5597
- 7. Disable tap highlights on iOS
5598
- */
5599
-
5600
- html,
5601
- :host {
5602
- line-height: 1.5; /* 1 */
5603
- -webkit-text-size-adjust: 100%; /* 2 */
5604
- -moz-tab-size: 4; /* 3 */
5605
- -o-tab-size: 4;
5606
- tab-size: 4; /* 3 */
5607
- font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 4 */
5608
- font-feature-settings: normal; /* 5 */
5609
- font-variation-settings: normal; /* 6 */
5610
- -webkit-tap-highlight-color: transparent; /* 7 */
5611
- }
5612
-
5613
- /*
5614
- 1. Remove the margin in all browsers.
5615
- 2. Inherit line-height from \\\`html\\\` so users can set them as a class directly on the \\\`html\\\` element.
5616
- */
5617
-
5618
- body {
5619
- margin: 0; /* 1 */
5620
- line-height: inherit; /* 2 */
5621
- }
5622
-
5623
- /*
5624
- 1. Add the correct height in Firefox.
5625
- 2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
5626
- 3. Ensure horizontal rules are visible by default.
5627
- */
5628
-
5629
- hr {
5630
- height: 0; /* 1 */
5631
- color: inherit; /* 2 */
5632
- border-top-width: 1px; /* 3 */
5633
- }
5634
-
5635
- /*
5636
- Add the correct text decoration in Chrome, Edge, and Safari.
5637
- */
5638
-
5639
- abbr:where([title]) {
5640
- -webkit-text-decoration: underline dotted;
5641
- text-decoration: underline dotted;
5642
- }
5643
-
5644
- /*
5645
- Remove the default font size and weight for headings.
5646
- */
5647
-
5648
- h1,
5649
- h2,
5650
- h3,
5651
- h4,
5652
- h5,
5653
- h6 {
5654
- font-size: inherit;
5655
- font-weight: inherit;
5656
- }
5657
-
5658
- /*
5659
- Reset links to optimize for opt-in styling instead of opt-out.
5660
- */
5661
-
5662
- a {
5663
- color: inherit;
5664
- text-decoration: inherit;
5665
- }
5666
-
5667
- /*
5668
- Add the correct font weight in Edge and Safari.
5669
- */
5670
-
5671
- b,
5672
- strong {
5673
- font-weight: bolder;
5674
- }
5675
-
5676
- /*
5677
- 1. Use the user's configured \\\`mono\\\` font-family by default.
5678
- 2. Use the user's configured \\\`mono\\\` font-feature-settings by default.
5679
- 3. Use the user's configured \\\`mono\\\` font-variation-settings by default.
5680
- 4. Correct the odd \\\`em\\\` font sizing in all browsers.
5681
- */
5682
-
5683
- code,
5684
- kbd,
5685
- samp,
5686
- pre {
5687
- font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* 1 */
5688
- font-feature-settings: normal; /* 2 */
5689
- font-variation-settings: normal; /* 3 */
5690
- font-size: 1em; /* 4 */
5691
- }
5692
-
5693
- /*
5694
- Add the correct font size in all browsers.
5695
- */
5696
-
5697
- small {
5698
- font-size: 80%;
5699
- }
5700
-
5701
- /*
5702
- Prevent \\\`sub\\\` and \\\`sup\\\` elements from affecting the line height in all browsers.
5703
- */
5704
-
5705
- sub,
5706
- sup {
5707
- font-size: 75%;
5708
- line-height: 0;
5709
- position: relative;
5710
- vertical-align: baseline;
5711
- }
5712
-
5713
- sub {
5714
- bottom: -0.25em;
5715
- }
5716
-
5717
- sup {
5718
- top: -0.5em;
5719
- }
5720
-
5721
- /*
5722
- 1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
5723
- 2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
5724
- 3. Remove gaps between table borders by default.
5725
- */
5726
-
5727
- table {
5728
- text-indent: 0; /* 1 */
5729
- border-color: inherit; /* 2 */
5730
- border-collapse: collapse; /* 3 */
5731
- }
5732
-
5733
- /*
5734
- 1. Change the font styles in all browsers.
5735
- 2. Remove the margin in Firefox and Safari.
5736
- 3. Remove default padding in all browsers.
5737
- */
5738
-
5739
- button,
5740
- input,
5741
- optgroup,
5742
- select,
5743
- textarea {
5744
- font-family: inherit; /* 1 */
5745
- font-feature-settings: inherit; /* 1 */
5746
- font-variation-settings: inherit; /* 1 */
5747
- font-size: 100%; /* 1 */
5748
- font-weight: inherit; /* 1 */
5749
- line-height: inherit; /* 1 */
5750
- letter-spacing: inherit; /* 1 */
5751
- color: inherit; /* 1 */
5752
- margin: 0; /* 2 */
5753
- padding: 0; /* 3 */
5754
- }
5755
-
5756
- /*
5757
- Remove the inheritance of text transform in Edge and Firefox.
5758
- */
5759
-
5760
- button,
5761
- select {
5762
- text-transform: none;
5763
- }
5764
-
5765
- /*
5766
- 1. Correct the inability to style clickable types in iOS and Safari.
5767
- 2. Remove default button styles.
5768
- */
5769
-
5770
- button,
5771
- input:where([type='button']),
5772
- input:where([type='reset']),
5773
- input:where([type='submit']) {
5774
- -webkit-appearance: button; /* 1 */
5775
- background-color: transparent; /* 2 */
5776
- background-image: none; /* 2 */
5777
- }
5778
-
5779
- /*
5780
- Use the modern Firefox focus style for all focusable elements.
5781
- */
5782
-
5783
- :-moz-focusring {
5784
- outline: auto;
5785
- }
5786
-
5787
- /*
5788
- Remove the additional \\\`:invalid\\\` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
5789
- */
5790
-
5791
- :-moz-ui-invalid {
5792
- box-shadow: none;
5793
- }
5794
-
5795
- /*
5796
- Add the correct vertical alignment in Chrome and Firefox.
5797
- */
5798
-
5799
- progress {
5800
- vertical-align: baseline;
5801
- }
5802
-
5803
- /*
5804
- Correct the cursor style of increment and decrement buttons in Safari.
5805
- */
5806
-
5807
- ::-webkit-inner-spin-button,
5808
- ::-webkit-outer-spin-button {
5809
- height: auto;
5810
- }
5811
-
5812
- /*
5813
- 1. Correct the odd appearance in Chrome and Safari.
5814
- 2. Correct the outline style in Safari.
5815
- */
5816
-
5817
- [type='search'] {
5818
- -webkit-appearance: textfield; /* 1 */
5819
- outline-offset: -2px; /* 2 */
5820
- }
5821
-
5822
- /*
5823
- Remove the inner padding in Chrome and Safari on macOS.
5824
- */
5825
-
5826
- ::-webkit-search-decoration {
5827
- -webkit-appearance: none;
5828
- }
5829
-
5830
- /*
5831
- 1. Correct the inability to style clickable types in iOS and Safari.
5832
- 2. Change font properties to \\\`inherit\\\` in Safari.
5833
- */
5834
-
5835
- ::-webkit-file-upload-button {
5836
- -webkit-appearance: button; /* 1 */
5837
- font: inherit; /* 2 */
5838
- }
5839
-
5840
- /*
5841
- Add the correct display in Chrome and Safari.
5842
- */
5843
-
5844
- summary {
5845
- display: list-item;
5846
- }
5847
-
5848
- /*
5849
- Removes the default spacing and border for appropriate elements.
5850
- */
5851
-
5852
- blockquote,
5853
- dl,
5854
- dd,
5855
- h1,
5856
- h2,
5857
- h3,
5858
- h4,
5859
- h5,
5860
- h6,
5861
- hr,
5862
- figure,
5863
- p,
5864
- pre {
5865
- margin: 0;
5866
- }
5867
-
5868
- fieldset {
5869
- margin: 0;
5870
- padding: 0;
5871
- }
5872
-
5873
- legend {
5874
- padding: 0;
5875
- }
5876
-
5877
- ol,
5878
- ul,
5879
- menu {
5880
- list-style: none;
5881
- margin: 0;
5882
- padding: 0;
5883
- }
5884
-
5885
- /*
5886
- Reset default styling for dialogs.
5887
- */
5888
- dialog {
5889
- padding: 0;
5890
- }
5891
-
5892
- /*
5893
- Prevent resizing textareas horizontally by default.
5894
- */
5895
-
5896
- textarea {
5897
- resize: vertical;
5898
- }
5899
-
5900
- /*
5901
- 1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
5902
- 2. Set the default placeholder color to the user's configured gray 400 color.
5903
- */
5904
-
5905
- input::-moz-placeholder, textarea::-moz-placeholder {
5906
- opacity: 1; /* 1 */
5907
- color: #9ca3af; /* 2 */
5908
- }
5909
-
5910
- input::placeholder,
5911
- textarea::placeholder {
5912
- opacity: 1; /* 1 */
5913
- color: #9ca3af; /* 2 */
5416
+ \`}function Zg(e){let t=qc(e);if(R){let n=Jg(e);n&&(t=\`\${t} (\${n})\`)}return t}function qc(e){return e.displayName??(e.name||"Anonymous Function")}function Jg(e){return e.toString().match(/\\/\\/ \\[kiru_devtools\\]:(.*)/)?.[1]??null}var Xc,Et,ai=M(()=>{"use strict";at();ct();q();Et=class extends Error{constructor(t){let n=typeof t=="string"?t:t.message;super(n),this[Xc]=!0,typeof t!="string"&&(R&&t?.vNode&&(this.customNodeStack=qg(t.vNode)),this.fatal=t?.fatal)}static isKiruError(t){return t instanceof Error&&t[$r]===!0}};Xc=$r});function ia(e){let t=e.type;return t=="#text"?nm(e):Gr.has(t)?document.createElementNS("http://www.w3.org/2000/svg",t):document.createElement(t)}function sa(e){let t=e.type==="#text"?em(e):fe.getCurrentChild();if(fe.bumpChildIndex(),!t)throw new Et({message:"Hydration mismatch - no node found",vNode:e});let n=t.nodeName;if(Gr.has(n)||(n=n.toLowerCase()),e.type!==n)throw new Et({message:\`Hydration mismatch - expected node of type \${e.type.toString()} but received \${n}\`,vNode:e});if(e.dom=t,e.type!=="#text"&&!(e.flags&Yt))return;L.isSignal(e.props.nodeValue)&&na(e,t,e.props.nodeValue);let i=e,s=e.sibling;for(;s&&s.type==="#text";){let o=s;fe.bumpChildIndex();let r=String(Z(i.props.nodeValue)??""),a=i.dom.splitText(r.length);o.dom=a,L.isSignal(o.props.nodeValue)&&na(o,a,o.props.nodeValue),i=s,s=s.sibling}}function Jc(e){let t=e.parent,n=t?.dom;for(;t&&!n;)t=t.parent,n=t?.dom;if(!n||!t){if(!e.parent&&e.dom)return e;throw new Et({message:"No DOM parent found while attempting to place node.",vNode:e})}return t}function Qc(e,t){let{node:n,lastChild:i}=t,s=e.dom;if(i){i.after(s);return}let o=Qg(e,n);if(o){n.dom.insertBefore(s,o);return}n.dom.appendChild(s)}function Qg(e,t){let n=e;for(;n;){let i=n.sibling;for(;i;){if(!(i.flags&(ne|Yt))){let s=tm(i);if(s?.isConnected)return s}i=i.sibling}if(n=n.parent,!n||n.flags&Yt||n===t)return}}function tm(e){let t=e;for(;t;){if(t.dom)return t.dom;if(t.flags&Yt)return;t=t.child}}function em(e){let t=e.props.nodeValue;if(!L.isSignal(t))return fe.getCurrentChild();let n=t.peek();if(dn(n))return fe.getCurrentChild();let i=tu(e,t),s=fe.getCurrentChild();return s?(s.before(i),i):fe.getCurrentParent().appendChild(i)}function na(e,t,n){let i=n.subscribe((s,o)=>{s!==o&&(t.nodeValue=s,R&&rt&&window.__kiru?.profilingContext?.emit("signalTextUpdate",Nt(e)))});ie(e,"nodeValue",i)}function nm(e){let{nodeValue:t}=e.props;return L.isSignal(t)?tu(e,t):document.createTextNode(t)}function tu(e,t){let n=t.peek()??"",i=document.createTextNode(n);return na(e,i,t),i}var oa=M(()=>{"use strict";at();de();un();ta();q();ai();ct()});function aa(e){if(pt.current==="hydrate")return fn(e,lo);let t={node:e.dom?e:Jc(e)};ra(e,t,(e.flags&ne)>0),e.dom&&!(e.flags&Yt)&&eu(e,t,!1),lo(e)}function ra(e,t,n){let i=e.child;for(;i;)i.dom?(ra(i,{node:i},!1),i.flags&Yt||eu(i,t,n)):ra(i,t,(i.flags&ne)>0||n),lo(i),i=i.sibling}function eu(e,t,n){if((n||!e.dom.isConnected||e.flags&ne)&&Qc(e,t),R&&e.prev&&Ki()){let{dom:i,prev:s,cleanups:o}=e;Bc(e,i,s.props,o),e.prev=null}(!e.prev||e.flags&ee)&&Hc(e),t.lastChild=e.dom}function la(e){e===e.parent?.child&&(e.parent.child=e.sibling);let t;R&&(t=Nt(e)),fn(e,n=>{let{subs:i,cleanups:s,dom:o,props:{ref:r},hooks:a}=n;if(i?.forEach(l=>l()),s&&Object.values(s).forEach(l=>l()),a){let{preCleanups:l,postCleanups:c}=a;oo.push(...c),l.forEach(Lt),l.length=c.length=0}R&&(window.__kiru.profilingContext?.emit("removeNode",t),o instanceof Element&&delete o.__kiruNode),o&&(o.isConnected&&!(n.flags&Yt)&&o.remove(),r&&Ln(r,null),delete n.dom)}),e.parent=null}var nu=M(()=>{"use strict";q();at();ct();xt();Xi();Kc();oa()});var iu=M(()=>{"use strict";nu();qr();oa()});function m(e,t=null,...n){e===vt&&(e=Gt);let i=t===null?{}:t,s=ca(i.key),o=n.length;return o===1?i.children=n[0]:o>1&&(i.children=n),{type:e,key:s,props:i}}function vt({children:e,key:t}){return{type:Gt,key:ca(t),props:{children:e}}}var li=M(()=>{"use strict";at();q()});function co(e,t=null,n={},i=null,s=0){e===vt&&(e=Gt);let o=t?t.depth+1:0;return{type:e,key:i,props:n,parent:t,index:s,depth:o,flags:0,child:null,sibling:null,prev:null,deletions:null}}var ua=M(()=>{"use strict";at();li()});function ho(e,t){return R&&(ha=Nt(e)),Array.isArray(t)?(R&&(cu in t&&am(e,t),rm(e,t)),sm(e,t)):im(e,t)}function im(e,t){let n=e.child;if(n===null)return au(e,t);let i=n.sibling,s=ou(e,n,t);if(s!==null)return n&&n!==s&&!s.prev?fa(e,n):i&&fa(e,i),s;{let o=uu(n),r=lu(o,e,0,t);if(r!==null){let a=r.prev;if(a!==null){let l=a.key;o.delete(l===null?a.index:l)}uo(r,0,0)}return o.forEach(a=>fo(e,a)),r}}function sm(e,t){let n=null,i=null,s=e.child,o=null,r=0,a=0;for(;s!==null&&a<t.length;a++){s.index>a?(o=s,s=null):o=s.sibling;let c=ou(e,s,t[a]);if(c===null){s===null&&(s=o);break}s&&!c.prev&&fo(e,s),r=uo(c,r,a),i===null?n=c:i.sibling=c,i=c,s=o}if(a===t.length)return fa(e,s),n;if(s===null){for(;a<t.length;a++){let c=au(e,t[a]);c!==null&&(r=uo(c,r,a),i===null?n=c:i.sibling=c,i=c)}return n}let l=uu(s);for(;a<t.length;a++){let c=lu(l,e,a,t[a]);if(c!==null){let u=c.prev;if(u!==null){let d=u.key;l.delete(d===null?u.index:d)}r=uo(c,r,a),i===null?n=c:i.sibling=c,i=c}}return l.forEach(c=>fo(e,c)),n}function ou(e,t,n){let i=t===null?null:t.key;return dn(n)?i!==null||t?.type==="#text"&&L.isSignal(t.props.nodeValue)?null:su(e,t,""+n):L.isSignal(n)?t&&t.props.nodeValue!==n?null:su(e,t,n):ci(n)?n.key!==i?null:om(e,t,n):Array.isArray(n)?i!==null?null:(R&&pa(n),ru(e,t,n)):null}function su(e,t,n){return t===null||t.type!=="#text"?Se(e,"#text",{nodeValue:n}):(R&&qi(),t.props.nodeValue!==n&&(t.props.nodeValue=n,t.flags|=ee),t.sibling=null,t)}function om(e,t,n){let{type:i,props:s,key:o}=n;return R&&typeof i=="function"&&(i=wt(i)),i===Gt?ru(e,t,s.children||[],s):t?.type===i?(R&&qi(),t.index=0,t.sibling=null,typeof i=="string"?hu(t.props,s)&&(t.flags|=ee):t.flags|=ee,t.props=s,t):Se(e,i,s,o)}function ru(e,t,n,i={}){return t===null||t.type!==Gt?Se(e,Gt,{children:n,...i}):(R&&qi(),t.props={...t.props,...i,children:n},t.flags|=ee,t.sibling=null,t)}function au(e,t){return dn(t)?Se(e,"#text",{nodeValue:""+t}):L.isSignal(t)?Se(e,"#text",{nodeValue:t}):ci(t)?Se(e,t.type,t.props,t.key):Array.isArray(t)?(R&&pa(t),Se(e,Gt,{children:t})):null}function uo(e,t,n){e.index=n;let i=e.prev;if(i!==null){let s=i.index;return s<t?(e.flags|=ne,t):s}else return e.flags|=ne,t}function lu(e,t,n,i){if(L.isSignal(i)||dn(i)){let o=e.get(n);if(o){if(o.props.nodeValue===i)return o;o.type==="#text"&&L.isSignal(o.props.nodeValue)&&o.cleanups?.nodeValue?.()}return Se(t,"#text",{nodeValue:i},null,n)}if(ci(i)){let{type:o,props:r,key:a}=i,l=e.get(a===null?n:a);return l?.type===o?(R&&qi(),typeof o=="string"?hu(l.props,r)&&(l.flags|=ee):l.flags|=ee,l.props=r,l.sibling=null,l.index=n,l):Se(t,o,r,a,n)}if(Array.isArray(i)){let o={children:i},r=e.get(n);return R&&pa(i),r?(R&&qi(),r.flags|=ee,r.props=o,r):Se(t,Gt,o,null,n)}return null}function qi(){rt&&window.__kiru.profilingContext?.emit("updateNode",ha)}function pa(e){Object.assign(e,{[cu]:!0})}function uu(e){let t=new Map;for(;e;){let n=e.key;t.set(n===null?e.index:n,e),e=e.sibling}return t}function fo(e,t){e.deletions===null?e.deletions=[t]:e.deletions.push(t)}function fa(e,t){for(;t;)fo(e,t),t=t.sibling}function rm(e,t){let n=new Set,i=!1;for(let s of t){if(!ci(s))continue;let o=s.key;if(typeof o=="string"){if(!i&&n.has(o)){let r=fu(e);du(\`\${r} component produced a child in a list with a duplicate key prop: "\${o}". Keys should be unique so that components maintain their identity across updates\`),i=!0}n.add(o)}}}function am(e,t){let n=!1,i=!1;for(let s of t)ci(s)&&(typeof s.key=="string"?n=!0:i=!0);if(i&&n){let s=fu(e);du(\`\${s} component produced a child in a list without a valid key prop\`)}}function du(e){let t=\`[kiru]: \${e}. See https://kirujs.dev/keys-warning for more information.\`;console.error(t)}function fu(e){if(da.has(e))return da.get(e);let t=e.parent,n;for(;!n&&t;)typeof t.type=="function"&&(n=t.type),t=t.parent;let i=\`<\${n?.displayName||n?.name||"Anonymous Function"} />\`;return da.set(e,i),i}function Se(e,t,n,i=null,s=0){let o=co(t,e,n,i,s);return o.flags|=ne,R&&rt&&window.__kiru.profilingContext?.emit("createNode",ha),o}function hu(e,t){return po(e,t,lm)}var ha,cu,da,lm,pu=M(()=>{"use strict";at();q();de();ct();ua();cu=Symbol("kiru:marked-list-child");da=new WeakMap;lm=["children","key"]});function Zi(e){if(ui){ga.push(e);return}e()}function pn(){ui&&(window.cancelAnimationFrame(bu),yu())}function wa(e){e.flags|=$e,Me.push(e),ui=!0,pn()}function zt(e){if(pt.current==="hydrate")return Zi(()=>gu(e));gu(e)}function xu(){let e=K.current;if(!e)throw new Error("useRequestUpdate must be called inside a Kiru component");return()=>zt(e)}function gu(e){if(ma&&(ba=!0),K.current===e){R&&window.__kiru.profilingContext?.emit("updateDirtied",Ee),xa=!0;return}if(!(e.flags&($e|In))){if(e.flags|=$e,!Me.length){Me.push(e),ui||(ui=!0,bu=window.requestAnimationFrame(yu));return}Me.push(e)}}function cm(e){fn(e,t=>t.flags|=In),mo.push(e)}function yu(){if(R){let t=mo[0]??Me[0];t?(Ee=Nt(t),window.__kiru.profilingContext?.beginTick(Ee)):Ee=null}let e=1;for(Yr();Me.length;){Me.length>e&&Me.sort(um),hn=Me.shift(),e=Me.length;let t=hn.flags;if(!(t&In)&&t&$e){let n=hn;for(;n=dm(n););for(;mo.length;)la(mo.pop());aa(hn),hn.flags&=~$e}}if(Kr(),ma=!0,go(mu),ma=!1,ba)return bm(),go(va),ba=!1,ya++,R&&(window.__kiru.profilingContext?.endTick(Ee),window.__kiru.profilingContext?.emit("updateDirtied",Ee)),pn();for(ya=0,ui=!1;ga.length;)ga.shift()();queueMicrotask(()=>{go(oo),go(va)}),R&&(window.__kiru.emit("update",Ee),window.__kiru.profilingContext?.emit("update",Ee),window.__kiru.profilingContext?.endTick(Ee))}function dm(e){let t=fm(e);if(e.deletions!==null&&(e.deletions.forEach(cm),e.deletions=null),t)return t;let n=e;for(;n;){let{hooks:i}=n;if(i&&(mu.push(...i.pre),va.push(...i.post),i.pre.length=0,i.post.length=0),n===hn)return null;if(n.sibling)return n.sibling;n=n.parent,pt.current==="hydrate"&&n?.dom&&fe.pop()}return null}function fm(e){let{type:t,props:n,prev:i,flags:s}=e;if(!(R&&Ki())){if(i&&(s&$e)===0&&(i.props===n||!po(i.props,n)))return null}try{return typeof t=="string"?mm(e):bo(t)?hm(e):pm(e)}catch(o){R&&window.__kiru.emit("error",Ee,o instanceof Error?o:new Error(String(o)));let r=vu(e);if(r){let a=r.error=o instanceof Error?o:new Error(String(o));return r.props.onError?.(a),r.depth<hn.depth&&(hn=r),r}if(Et.isKiruError(o)){if(o.customNodeStack&&setTimeout(()=>{throw new Error(o.customNodeStack)}),o.fatal)throw o;return console.error(o),e.child}setTimeout(()=>{throw o})}return null}function hm(e){let{props:t,type:n}=e,i=t.children;if(n===je){let s=e,{error:o}=s;o&&(i=typeof t.fallback=="function"?t.fallback(o):t.fallback,delete s.error)}return e.child=ho(e,i)}function pm(e){let{type:t,props:n,subs:i}=e,s=(e.flags&$e)===0;try{K.current=e;let o,r=0;do{if(e.flags&=~$e,xa=!1,i&&(i.forEach(Lt),i.clear()),R&&Ki()){let{hooks:a,cleanups:l}=e;if(l&&(Object.values(l).forEach(Lt),delete e.cleanups),a){let{preCleanups:c,postCleanups:u}=a;c.forEach(Lt),u.forEach(Lt),c.length=u.length=0}delete e.propSyncs,delete e.render}if(o=gm(e,t,n,s),++r>Ur){if(R)throw new Et({message:"Too many re-renders. Kiru limits the number of renders to prevent an infinite loop.",fatal:!0,vNode:e});break}}while(xa);return e.child=ho(e,o)}finally{K.current=null}}function gm(e,t,n,i){let{render:s,propSyncs:o}=e;if(s){if(i){let a={...n};o?.forEach(l=>l(a))}return s(n)}let r=wt(t)(n);if(typeof r=="function"){if(e.subs?.forEach(Lt),e.render=r,i){let a={...n};o?.forEach(l=>l(a))}r=r(n)}else if(R&&ri.has(e))throw new Error("setup() must not be called inside a render function");return r}function mm(e){let{props:t,type:n}=e;return R&&xo(e),e.dom||(pt.current==="hydrate"?sa(e):e.dom=ia(e),R&&e.dom instanceof Element&&(e.dom.__kiruNode=e)),n!=="#text"&&(e.child=ho(e,t.children),e.child&&pt.current==="hydrate"&&fe.push(e.dom)),e.child}function bm(){if(ya>Ur)throw new Et("Maximum update depth exceeded. This can happen when a component repeatedly calls setState during render or in useLayoutEffect. Kiru limits the number of nested updates to prevent infinite loops.")}function go(e){for(let t=0;t<e.length;t++)e[t]();e.length=0}var Ee,Me,ui,ga,mo,ma,ba,xa,ya,mu,va,bu,um,hn,Ue=M(()=>{"use strict";at();iu();q();ct();ai();xt();ta();pu();Xi();Me=[],ui=!1,ga=[],mo=[],ma=!1,ba=!1,xa=!1,ya=0,mu=[],va=[],bu=-1;um=(e,t)=>t.depth-e.depth,hn=null});var he,pe,di=M(()=>{"use strict";he=new Map,pe=new Map});function yo(e){let{id:t,subs:n,fn:i,deps:s=[],onDepChanged:o}=e,r;he.delete(t);let a=!!K.current&&!_t();a||(r=new Map,fi.stack.push(r));let l=i(...s.map(c=>c.value));if(!a){for(let[u,d]of n)r.has(u)||(d(),n.delete(u));let c=()=>{he.size||queueMicrotask(vo),he.set(t,o)};for(let[u,d]of r){if(n.has(u))continue;let f=d.subscribe(c);n.set(u,f)}fi.stack.pop()}return l}var fi,Ji=M(()=>{"use strict";xt();q();di();un();fi={enabled:!0,stack:new Array,current:function(){return this.stack[this.stack.length-1]}}});var wu,L,P,de=M(()=>{"use strict";q();at();ct();xt();Ue();di();Ji();L=class e{constructor(t,n){this[wu]=!0,this.$id=hi(),this.$value=t,n&&(this.displayName=n),R?(pe.set(this.$id,new Set),this.$initialValue=_u(t),this[te]={provide:()=>this,inject:s=>{rt&&window.__kiru.devtools?.untrack(s),pe.get(this.$id)?.clear?.(),pe.delete(this.$id),this.$id=s.$id,s.__next=this,this.$initialValue===s.$initialValue?this.$value=s.$value:this.notify()},destroy:()=>{}}):this.$subs=new Set;let i=K.current;i&&ie(i,this.$id,e.dispose.bind(null,this))}get value(){if(R){let t=wt(this);return e.entangle(t),t.$value}return e.entangle(this),this.$value}set value(t){if(R){let n=wt(this);if(Object.is(n.$value,t))return;n.$prevValue=n.$value,n.$value=t,n.notify();return}Object.is(this.$value,t)||(this.$prevValue=this.$value,this.$value=t,this.notify())}peek(){return R?wt(this).$value:this.$value}sneak(t){if(R){let n=wt(this);n.$prevValue=n.$value,n.$value=t;return}this.$prevValue=this.$value,this.$value=t}toString(){if(R){let t=wt(this);return e.entangle(t),\`\${t.$value}\`}return e.entangle(this),\`\${this.$value}\`}subscribe(t){return R?(pe.get(this.$id).add(t),()=>pe.get(this.$id)?.delete(t)):(this.$subs.add(t),()=>this.$subs.delete(t))}notify(t){if(R)return pe.get(this.$id)?.forEach(n=>{if(t&&!t(n))return;let{$value:i,$prevValue:s}=wt(this);return n(i,s)});this.$subs.forEach(n=>{if(!(t&&!t(n)))return n(this.$value,this.$prevValue)})}static isSignal(t){return typeof t=="object"&&!!t&&jr in t}static subscribers(t){return R?pe.get(t.$id):t.$subs}static makeReadonly(t){let n=Object.getOwnPropertyDescriptor(t,"value");return n&&!n.writable?t:Object.defineProperty(t,"value",{get:function(){return e.entangle(this),this.$value},configurable:!0})}static makeWritable(t){let n=Object.getOwnPropertyDescriptor(t,"value");return n&&n.writable?t:Object.defineProperty(t,"value",{get:function(){return e.entangle(this),this.$value},set:function(i){this.$value=i,this.notify()},configurable:!0})}static entangle(t){if(fi.enabled===!1)return;let n=K.current,i=fi.current();if(i){(!n||n&&_t())&&i.set(t.$id,t);return}if(!n||!_t())return;let s=t.subscribe(()=>zt(n));(n.subs??(n.subs=new Set)).add(s)}static dispose(t){if(t.$isDisposed=!0,R){pe.delete(t.$id),rt&&window.__kiru.devtools?.untrack(t);return}t.$subs.clear()}};wu=jr;P=(e,t)=>new L(e,t)});function Z(e,t=!1){return L.isSignal(e)?t?e.value:e.peek():e}function vo(){he.forEach(Lt),he.clear()}var un=M(()=>{"use strict";q();de();di();Ji()});function ut(...e){return e.filter(Boolean).join(" ")}function wo(e){return e.replace(xm,"&amp;").replace(ym,"&lt;").replace(vm,"&gt;").replace(_m,"&quot;").replace(wm,"&#039;").replace(km,"&#47;")}function Qr(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():Ic.get(e)||e}}function Em(e){let t="";for(let n in e){let i=Z(e[n]);if(i==null)continue;let s=n.replace(Sm,"-$&").toLowerCase();t+=\`\${s}:\${i};\`}return t}function Mm(e){return typeof e=="string"?e:typeof e=="object"&&e?Em(e):""}function Eu(e){let t=[],{className:n,style:i,...s}=e;if(n){let r=Z(n);r&&t.push(\`class="\${r}"\`)}if(i){let r=Z(i);r&&t.push(\`style="\${Mm(r)}"\`)}let o=Object.keys(s).filter(Su.isStringRenderableProperty);for(let r=0;r<o.length;r++){let a=o[r],l=Z(e[a]);if(l==null)continue;a=a.split("bind:")[1]??a;let c=Qr(a);switch(typeof l){case"function":case"symbol":continue;case"boolean":if(so.has(c)){l&&t.push(c);continue}}t.push(\`\${c}="\${l}"\`)}return t.join(" ")}function _u(e,t={functions:!0}){let n=new WeakSet;return JSON.stringify(e,(i,s)=>{if(typeof s=="object"&&s!==null){if(n.has(s))return"[CIRCULAR]";n.add(s)}return typeof s=="function"?t.functions?s.toString():\`[FUNCTION (\${s.name||"anonymous"})]\`:s})}var xm,ym,vm,wm,_m,km,Sm,ku,Su,Mu=M(()=>{"use strict";un();at();xm=/&/g,ym=/</g,vm=/>/g,wm=/'/g,_m=/"/g,km=/\\//g,Sm=/[A-Z]/g;ku=new Set(["children","ref","key","innerHTML"]),Su={isInternalProp:e=>ku.has(e),isEvent:e=>e.startsWith("on"),isStringRenderableProperty:e=>!ku.has(e)&&!Su.isEvent(e)}});function Lt(e){e()}function wt(e){let t=e;if(R)for(;"__next"in t;)t=t.__next;return t}function Ln(e,t){if(typeof e=="function"){e(t);return}if(L.isSignal(e)){e.value=t;return}e.current=t}function _t(){return pt.current==="dom"||pt.current==="hydrate"}var Zc,_a=M(()=>{"use strict";de();ct();xt();Zc=Object.freeze(()=>{})});function _o(e){return(e.flags&In)!==0}function Tu(e){return typeof e=="object"&&e!==null&&"type"in e}function ci(e){return typeof e=="object"&&e!==null&&"type"in e}function dn(e){return typeof e=="string"&&e!==""||typeof e=="number"||typeof e=="bigint"}function bo(e){return e===Gt||e===Rn||e===je}function Nt(e){let t=e;for(;t;){if(t.app)return e.app=t.app;t=t.parent}return null}function lo(e){let{props:t,key:n,index:i}=e;e.prev={props:t,key:n,index:i},e.flags&=~(ee|ne|In)}function fn(e,t){t(e);let n=e.child;for(;n;)t(n),n.child&&fn(n,t),n=n.sibling}function ea(e,t){let n=e.parent;for(;n;){if(t(n))return n;n=n.parent}return null}function vu(e){return ea(e,t=>t.type===je)}function xo(e){if("children"in e.props&&e.props.innerHTML)throw new Et({message:"Cannot use both children and innerHTML on an element",vNode:e});for(let t in e.props)if("bind:"+t in e.props)throw new Et({message:\`Cannot use both bind:\${t} and \${t} on an element\`,vNode:e})}function ca(e){return e===void 0?null:typeof e=="string"||typeof e=="number"?e:null}function Qi(e){let t=[],n=e;for(;n;)t.push(n.index),t.push(n.depth),n=n.parent;return\`k:\${BigInt(t.join("")).toString(36)}\`}function ie(e,t,n){(e.cleanups??(e.cleanups={}))[t]=n}function po(e,t,n){let i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!0;for(let o of i)if(!n?.includes(o)&&e[o]!==t[o])return!0;return!1}var ko=M(()=>{"use strict";at();V();ai();xt()});function hi(e=10,t=Tm){let n="";for(let i=0;i<e;i++)n+=t[Math.random()*t.length|0];return n}var Tm,Cu=M(()=>{"use strict";Tm="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz-"});var q=M(()=>{"use strict";Nc();zc();Mu();_a();ko();Cu()});function Ki(){return ka}function Pu(e){return!!e&&(typeof e=="object"||typeof e=="function")&&te in e&&typeof e[te]=="object"&&!!e[te]}function Du(){let e=new Map,t=null,n=null,i=!1,s=()=>i,o=!1,r=[];return{register:d=>{if(n===null)throw new Error("[kiru]: HMR could not register: No active module");let f=new Set;for(let[p,b]of Object.entries(d)){let x=n.hotVars.get(p);if(b.value[Oc]=b.link,x?.value&&(x.value.__next=b.value),n.hotVars.set(p,b),!!x){if(Pu(x.value)&&Pu(b.value)){b.value[te].inject(x.value[te].provide()),x.value[te].destroy();continue}x.type==="component"&&b.type==="component"&&window.__kiru.apps.forEach(y=>{fn(y.rootNode,w=>{w.type===x.value&&(w.type=b.value,f.add(w))})})}}f.size&&(ka=!0,f.forEach(p=>zt(p)),pn(),ka=!1),i=!1,n=null,t=null},prepare:d=>{let f=e.get(d);if(i=!!f,!f)f={hotVars:new Map,unnamedEffects:[],hmrCallbacks:[]},e.set(d,f);else{for(;f.hmrCallbacks.length;)f.hmrCallbacks.shift()();for(;r.length;)r.shift()();for(let p of f.unnamedEffects)p.stop();f.unnamedEffects.length=0}n=f,t=d},isReplacement:s,moduleEffects:{registerNext(){o=!0},push(d){o&&(n.unnamedEffects.push(d),o=!1)}},onHmr:d=>{if(n){n.hmrCallbacks.push(d);return}r.push(d)},getCurrentFilePath(){return t}}}function Au(e){"window"in globalThis&&window.__kiru.HMRContext&&window.__kiru.HMRContext.onHmr(e)}var ka,Xi=M(()=>{"use strict";at();q();Ue();ka=!1});function Ou(){let e=new Map,t=new Map;return{appStats:t,emit:(n,i)=>{e.get(n)?.forEach(s=>s(i))},addEventListener:(n,i)=>{e.has(n)||e.set(n,new Set),e.get(n).add(i)},removeEventListener:(n,i)=>{e.has(n)&&e.get(n).delete(i)},mountDuration:n=>{let i=t.get(n);return i?i.mountDuration:0},totalTicks:n=>{let i=t.get(n);return i?i.totalTicks:0},lastTickDuration:n=>{let i=t.get(n);if(!i)return 1/0;let s=i.timestamps[i.timestamps.length-1];return!s||(s.end===1/0&&(s=i.timestamps[i.timestamps.length-2]),!s)?1/0:s.end-s.start},averageTickDuration:n=>{let i=t.get(n);if(!i)return 0;let s=i.timestamps.filter(o=>o.end!==1/0);return s.reduce((o,r)=>o+(r.end-r.start),0)/s.length},beginTick:n=>{t.has(n)||t.set(n,{mountDuration:1/0,timestamps:[],totalTicks:0});let i=t.get(n);i.totalTicks++,i.timestamps.push({start:performance.now(),end:1/0})},endTick:n=>{let i=t.get(n),s=i.timestamps[i.timestamps.length-1];s.end=performance.now(),i.mountDuration===1/0&&(i.mountDuration=s.end-s.start),i.timestamps.length>100&&i.timestamps.shift()}}}var Ru=M(()=>{"use strict"});var Iu,Nu=M(()=>{"use strict";Iu={current:null}});function Lu(){let e=new Set,t=new Map;function n(r,a,l){t.get(r)?.forEach(c=>c(a,l))}function i(r,a){t.has(r)||t.set(r,new Set),t.get(r).add(a)}function s(r,a){t.get(r)?.delete(a)}let o={get apps(){return Array.from(e)},emit:n,on:i,off:s};if(i("mount",r=>e.add(r)),i("unmount",r=>e.delete(r)),R){o.HMRContext=Du(),o.profilingContext=Ou(),o.fileRouterInstance=Iu;let r=new Set,a=new Set;o.devtools={track:(l,c)=>{r.add({label:c??l.displayName??"Unnamed Signal",signal:l}),a.forEach(u=>u(r))},untrack:l=>{r.forEach(c=>{c.signal===l&&r.delete(c)}),a.forEach(c=>c(r))},subscribe:l=>(a.add(l),l(r),()=>a.delete(l))}}return o}var zu=M(()=>{"use strict";ct();Xi();Ru();Nu()});function Kt(e,t){return new ts(e,t)}var ts,Vu=M(()=>{"use strict";ct();at();q();di();Ji();de();ts=class e extends L{constructor(t,n){if(super(void 0,n),this.$getter=t,this.$unsubs=new Map,this.$isDirty=!0,R){let i=this[te].inject;this[te]={provide:()=>this,inject:s=>{i(s),e.stop(s),this.$isDirty=s.$isDirty},destroy:()=>{}}}}get value(){return this.ensureNotDirty(),super.value}toString(){return this.ensureNotDirty(),super.toString()}peek(){return this.ensureNotDirty(),super.peek()}set value(t){}subscribe(t){return this.$isDirty&&e.run(this),super.subscribe(t)}static dispose(t){e.stop(t),L.dispose(t)}static updateGetter(t,n){let i=wt(t);i.$getter=n,i.$isDirty=!0,e.run(i),!Object.is(i.$value,i.$prevValue)&&i.notify()}static stop(t){let{$id:n,$unsubs:i}=wt(t);he.delete(n),i.forEach(Lt),i.clear(),t.$isDirty=!0}static run(t){let n=wt(t),{$id:i,$getter:s,$unsubs:o}=n,r=yo({id:i,subs:o,fn:()=>s(n.$value),onDepChanged:()=>{if(n.$isDirty=!0,R){if(!pe?.get(i)?.size)return}else if(!t.$subs.size)return;e.run(n),!Object.is(n.$value,n.$prevValue)&&n.notify()}});n.sneak(r),n.$isDirty=!1}ensureNotDirty(){this.$isDirty&&(R&&this.$isDisposed||e.run(this))}}});function Vt(e,t){if(typeof e=="function")return new pi(e);let n=e,i=t;return new pi(i,n)}var pi,Sa=M(()=>{"use strict";ct();di();Ji();q();xt();pi=class e{constructor(t,n){this.id=hi(),this.callback=t,this.deps=n,this.unsubs=new Map,this.isRunning=!1,this.cleanup=null,R&&rt&&window.__kiru.HMRContext.moduleEffects.push(this);let i=K.current;if(i){if(!_t())return;ie(i,this.id,this.stop.bind(this))}this.start()}start(){if(!this.isRunning){if(this.isRunning=!0,R&&rt&&window.__kiru.HMRContext?.isReplacement())return queueMicrotask(()=>{this.isRunning&&e.run(this)});e.run(this)}}stop(){he.delete(this.id),this.unsubs.forEach(Lt),this.unsubs.clear(),this.cleanup?.(),this.cleanup=null,this.isRunning=!1}static run(t){let n=wt(t),{id:i,callback:s,unsubs:o,deps:r}=n;n.cleanup=yo({id:i,subs:o,fn:s,deps:r,onDepChanged:()=>{n.cleanup?.(),e.run(n)}})??null}}});function Ge({each:e,fallback:t,children:n}){let i=Z(e,!0);return i.length===0?t:i.map(n)}function Cm({children:e,when:t,fallback:n}){return Z(t,!0)?e:n}var Fu=M(()=>{"use strict";un()});var Hu=M(()=>{"use strict"});var So=M(()=>{"use strict";de();Vu();Sa();un();Fu();Hu()});function Pm(e){return async(...t)=>{let{execute:n,onError:i}=e(...t);try{return{error:null,data:await n()}}catch(s){let o=new Eo(s);return i?.(o),{error:o,data:null}}}}var Eo,Bu=M(()=>{"use strict";Eo=class extends Error{constructor(t){super("Error occurred during action execution",{cause:t})}}});function Am(e,t,n){if(R&&t.__kiruNode)throw new Error("[kiru]: container in use - call unmount on the previous app first.");let i=Om(t),s=Dm++,o={id:s,name:n?.name??\`App-\${s}\`,rootNode:i,render:r,unmount:a};function r(l){i.props={children:l},wa(i)}function a(){i.props={children:null},wa(i),R&&(delete t.__kiruNode,delete i.app),window.__kiru.emit("unmount",o)}return R&&(i.app=o),r(e),window.__kiru.emit("mount",o),R&&!globalThis.__KIRU_READY__&&(globalThis.__KIRU_READY__=!0,queueMicrotask(()=>{window.dispatchEvent(new Event("kiru:ready"))})),o}function Om(e){let t=co(e.nodeName.toLowerCase());return t.flags|=Yt,t.dom=e,R&&(e.__kiruNode=t),t}var Dm,Wu=M(()=>{"use strict";at();ct();Ue();ua();Dm=0});function ju({children:e,fallback:t,onError:n}){return m(je,{children:e,fallback:t,onError:n})}var $u=M(()=>{"use strict";at();V()});function Ft(e){if(!_t())return;let t=K.current;if(!t)throw new Error("Cannot queue onCleanup effect outside of a component");ie(t,hi(10),e)}var Mo=M(()=>{"use strict";xt();q()});function To(e){return typeof e=="object"&&!!e&&si in e}function Co(e){return e instanceof Promise&&"id"in e&&"state"in e}function Rm(e){let t=K.current;if(!t)throw new Error("statefulPromise must be called inside a Kiru component");let n=Qi(t),i=P(!0);i.value=!0;let s=new AbortController;Ft(()=>s.abort());let o=Uu.get(t)??0;Uu.set(t,o+1);let r=\`\${n}:data:\${o}\`,a;pt.current==="string"?a=Promise.resolve():pt.current==="hydrate"&&Vc.current==="dynamic"?a=Im(r,s.signal):a=e(s.signal);let c=Object.assign(a,{id:r,state:"pending"});return c.then(u=>{c.state="fulfilled",c.value=u,i.value=!1}).catch(u=>{c.state="rejected",c.error=u instanceof Error?u:new Error(u)}),Object.assign(c,{isPending:i})}function Im(e,t){return new Promise((n,i)=>{let s=window[oi]??(window[oi]=new Map),o=s.get(e);if(o){let{data:a,error:l}=o;return s.delete(e),l?i(l):n(a)}let r=a=>{let{detail:l}=a;if(l.id===e){s.delete(e),window.removeEventListener(oi,r);let{data:c,error:u}=l;if(u)return i(u);n(c)}};window.addEventListener(oi,r),t.addEventListener("abort",()=>{window.removeEventListener(oi,r),i()})})}var Uu,Po=M(()=>{"use strict";at();xt();de();ko();Mo();Uu=new WeakMap});function gn(e){return{current:e}}var Ea=M(()=>{"use strict"});var ge,Gu=M(()=>{"use strict";xt();at();Ue();So();q();Po();Ea();ge=()=>e=>{let{from:t,children:n,fallback:i,mode:s}=e,o=gn(null),r=new Set,a;if(Co(t))r.add(t),a=t.value;else if(L.isSignal(t))a=t.value;else{let l={};for(let c in t){let u=t[c];Co(u)&&r.add(u),l[c]=u.value}a=l}if(r.size===0)return n(a);if(!_t())throw{[si]:{fallback:i,data:Array.from(r)}};for(let l of r){if(l.state==="rejected")throw l.error;if(l.state==="pending"){let c=K.current;Promise.allSettled(r).then(()=>zt(c));let u=o.current;return s!=="fallback"&&u?n(u,!0):i}}return o.current=a,n(a,!1)}});function Nm(e){function t(n){let{fallback:i=null,...s}=n,o=K.current;if(!_t())return i;let r=Lm(e.toString()),a=Yu.get(r);if(!a){let l=e(),c={promise:l,result:null};return Yu.set(r,c),l.then(u=>{c.result=typeof u=="function"?u:u.default,zt(o)}),i}return a.result===null?(a.promise.then(()=>zt(o)),i):m(a.result,s)}return R&&(t.displayName="Kiru.lazy"),t}var Yu,Lm,Ku=M(()=>{"use strict";li();ct();_a();xt();Ue();Yu=rt?window.__KIRU_LAZY_CACHE??(window.__KIRU_LAZY_CACHE=new Map):new Map;Lm=e=>e.replace(/import\\((["'])([^?"']+)\\?[^)"']*\\1\\)/g,(t,n,i)=>\`import(\${n}\${i}\${n})\`)});function zm({children:e,container:t}){let n=K.current;if(!n.dom)switch(n.flags|=Yt,pt.current){case"dom":if(n.dom=typeof t=="function"?t():t,!(n.dom instanceof HTMLElement)){if(R)throw new Et({message:\`Invalid portal container, expected HTMLElement, got \${n.dom}\`,vNode:n});return null}return e;case"hydrate":Zi(()=>zt(n));case"stream":case"string":return null}return e}var Xu=M(()=>{"use strict";at();ct();ai();xt();Ue()});function Vm(e,t){if(typeof t=="number")return t;switch(e){case"entered":return t?.in??qu;case"exited":return t?.out??qu}}var gi,qu,Zu=M(()=>{"use strict";Mo();de();Sa();un();gi=e=>{let t=P(e.initialState||"exited"),n,i=o=>{clearTimeout(n),t.value=o,(o==="entered"||o==="exited")&&e.onTransitionEnd&&e.onTransitionEnd(o)},s=o=>{n=window.setTimeout(()=>i(o),Vm(o,e.duration))};return Vt(()=>{let o=Z(e.in,!0),r=t.peek();o&&r!=="entered"&&r!=="entering"?(i("entering"),s("entered")):!o&&r!=="exited"&&r!=="exiting"&&(i("exiting"),s("exited"))}),Ft(()=>clearTimeout(n)),o=>o.element(t.value)},qu=150});var Ju=M(()=>{"use strict";$u();Gu();Ku();Xu();Zu()});function Fm(e){let t=Object.assign(({value:n,children:i})=>m(Rn,{value:n,ctx:t},i),{[Rn]:()=>e});return t.displayName="Anonymous Context",t}function Hm(e,t){let n=e.parent;for(;n;){if(n.type===Rn){let i=n,{ctx:s,value:o}=i.props;if(s===t)return o}n=n.parent}return t[Rn]()}function Bm(e){let t=K.current;if(!t)throw new Error("useContext must be called inside a Kiru component");return Hm(t,e)}var Qu=M(()=>{"use strict";at();li();xt()});var Ma,td=M(()=>{"use strict";Ma=class{constructor(){}static on(t,n){return window.addEventListener(t,n),()=>window.removeEventListener(t,n)}static dispatch(t,n,i){(i||document).dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0}))}}});var Ta,ed=M(()=>{"use strict";(function(e){e.track=(t,n)=>{"window"in globalThis&&window.__kiru.devtools?.track(t,n)},e.untrack=t=>{"window"in globalThis&&window.__kiru.devtools?.untrack(t)},e.subscribe=t=>!("window"in globalThis)||!window.__kiru.devtools?()=>{}:window.__kiru.devtools.subscribe(t)})(Ta||(Ta={}))});function es(){let e=K.current;return e?e.hooks??(e.hooks={pre:[],preCleanups:[],post:[],postCleanups:[]}):null}function ns(e,t){return()=>{let n=e();typeof n=="function"&&t.push(n)}}var Do=M(()=>{"use strict";xt()});function Mt(e){if(!_t())return;let t=es();if(!t)throw new Error("Cannot queue onMount effect outside of a component");t.post.push(ns(e,t.postCleanups))}var nd=M(()=>{"use strict";q();Do()});function Ca(e){if(!_t())return;let t=es();if(!t)throw new Error("Cannot queue beforeMount effect outside of a component");t.pre.push(ns(e,t.preCleanups))}var id=M(()=>{"use strict";q();Do()});function Wm(){let e=K.current;if(R){if(!e)throw new Error("setup() must be called inside a Kiru component");if(e.render)throw new Error("setup() cannot be used inside a render function")}if(ri.has(e))return ri.get(e);let t=jm(e);return ri.set(e,t),t}function jm(e){let t,n=e.propSyncs=[],i=-1;return{derive(s){let o={...e.props},r=P(s(o));return n.push(a=>r.value=s(a)),r},get id(){return t||(t=P(Qi(e)),i=e.index,n.push(()=>{i!==e.index&&(t.value=Qi(e),i=e.index)})),t}}}var sd=M(()=>{"use strict";xt();So();ko();ct()});var od=M(()=>{"use strict";Mo();nd();id();sd();Do()});function Te(e,t,n,i){if(t===null||t===void 0||typeof t=="boolean")return;if(typeof t=="string")return e.write(wo(t));if(typeof t=="number"||typeof t=="bigint")return e.write(t.toString());if(t instanceof Array)return t.forEach((l,c)=>Te(e,l,n,c));if(L.isSignal(t)){let l=t.peek();if(!Lc(l)){R&&console.error(\`[kiru]: expected primitive child but received \${l}\`);return}dn(l)&&e.write(wo(String(l)));return}if(!Tu(t))return;t.parent=n,t.depth=(n?.depth??-1)+1,t.index=i;let{type:s,props:o={}}=t;if(s==="#text")return e.write(wo(o.nodeValue??""));let r=o.children;if(bo(s)){if(s===je){let l="",c=new Set,u={write(d){l+=d},onStreamData(d){d.forEach(f=>c.add(f))}};try{Te(u,r,t,i),e.write(l),e.onStreamData?.([...c])}catch(d){if(To(d))throw d;let f=d instanceof Error?d:new Error(String(d)),{fallback:p,onError:b}=o;b?.(f);let x=typeof p=="function"?p(f):p;Te(e,x,t,0)}return}Te(e,r,t,i);return}if(typeof s=="function")try{K.current=t;let l=s(o);typeof l=="function"&&(l=l(o)),Te(e,l,t,i);return}catch(l){if(To(l)){let{fallback:c,data:u}=l[si];return e.onStreamData?.(u),Te(e,c,t,0)}throw l}finally{K.current=null}R&&xo(t);let a=Eu(o);e.write(\`<\${s}\${a.length?\` \${a}\`:""}>\`),!Rc.has(s)&&("innerHTML"in o?e.write(String(L.isSignal(o.innerHTML)?o.innerHTML.peek():o.innerHTML)):Array.isArray(r)?r.forEach((l,c)=>Te(e,l,t,c)):Te(e,r,t,0),e.write(\`</\${s}>\`))}var rd=M(()=>{"use strict";xt();q();Po();de();at();ct()});function $m(e){let t=pt.current;pt.current="string";let n="";return Te({write(s){n+=s}},vt({children:e}),null,0),pt.current=t,n}var ad=M(()=>{"use strict";xt();li();rd()});var Pa,ld=M(()=>{"use strict";Ue();ct();(function(e){let t=[],n=!1,i=!1,s=null,o=rt&&typeof document.startViewTransition=="function";function r(u,d){let f=d?.signal;return new Promise(p=>{let b=async()=>{let x=await u();p(x)};t.push(b),f?.addEventListener("abort",()=>{let x=t.indexOf(b);x!==-1?t.splice(x,1):s?.skipTransition()},{once:!0}),l()})}e.run=r;function a(){s?.skipTransition(),s=null,t.length=0,n=!1,i=!1}e.stop=a;function l(){i||(i=!0,queueMicrotask(()=>{i=!1,c()}))}async function c(){if(n||t.length===0)return;n=!0;let u=[...t];t.length=0;let d=async()=>{await Promise.all(u.map(f=>f())),pn()};o?(s=document.startViewTransition(d),await s.finished):await d(),s=null,n=!1,t.length>0&&l()}})(Pa||(Pa={}))});var B={};Br(B,{ActionError:()=>Eo,ComputedSignal:()=>ts,CustomEvents:()=>Ma,Derive:()=>ge,DevTools:()=>Ta,Effect:()=>pi,ErrorBoundary:()=>ju,For:()=>Ge,Fragment:()=>vt,KiruError:()=>Et,Portal:()=>zm,Show:()=>Cm,Signal:()=>L,Transition:()=>gi,ViewTransitions:()=>Pa,computed:()=>Kt,createContext:()=>Fm,createElement:()=>m,defineAction:()=>Pm,effect:()=>Vt,flushSync:()=>pn,getVNodeLifecycleHooks:()=>es,isStatefulPromise:()=>Co,isStreamDataThrowValue:()=>To,lazy:()=>Nm,mount:()=>Am,nextIdle:()=>Zi,onBeforeMount:()=>Ca,onCleanup:()=>Ft,onHmr:()=>Au,onMount:()=>Mt,ref:()=>gn,renderToString:()=>$m,requestUpdate:()=>zt,setup:()=>Wm,signal:()=>P,statefulPromise:()=>Rm,tick:()=>vo,unwrap:()=>Z,useContext:()=>Bm,useRequestUpdate:()=>xu,wrapLifecycleHookCallback:()=>ns});var V=M(()=>{"use strict";zu();ct();So();Bu();Wu();Ju();Qu();td();ed();li();ai();Xi();od();ad();Ea();Ue();Po();ld();rt&&(window.__kiru??(window.__kiru=Lu()))});function Ye(e,t){if(!e)throw new Error(t)}function Vn(e){return e.type.displayName??(e.type.name||"Anonymous Function")}function is(e){try{return e[Um]??null}catch{return null}}function se(e){return e.name==="kiru.devtools"}function Gm(e){return Array.from(e.entries())}function Ke(e,t,n){return Math.min(Math.max(e,t),n)}function Ym(e,t,n){if(e.key==="Tab"){let i=t.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),s=i[0],o=i[i.length-1];if(n&&!t.contains(n)&&s&&s instanceof HTMLElement)return s.focus();e.shiftKey?n===s&&o instanceof HTMLElement&&(o.focus(),e.preventDefault()):n===o&&s instanceof HTMLElement&&(s.focus(),e.preventDefault())}}function Km(){return J.rootRef.value?.matches(":focus-within, :focus")}function Da(e){let t=J.rootRef.value;return t?.matches(":focus-within, :focus")?e(t):null}function mi(e){let t=[],n=e;for(;n;){if(typeof n.type=="function"){let i=n.type,s=i.displayName??(i.name||"AnonymousFunction"),o=n.key!=null&&n.key!==void 0?\`k:\${String(n.key)}\`:\`i:\${n.index}\`;t.push(\`\${s}[\${o}]\`)}n=n.parent}return\`ch:\${t.join("/")}\`}function Aa(e,t){if(!e)return null;let n=[e];for(;n.length;){let i=n.pop();if(typeof i.type=="function"&&mi(i)===t)return i;i.child&&n.push(i.child),i.sibling&&n.push(i.sibling)}return null}var Um,Fn=M(()=>{"use strict";Ce();Um=Symbol.for("kiru.devFileLink")});function Xm(e,t){let n=new BroadcastChannel(e),i=(l,c)=>{if(l.type==="SET"){let{key:u,version:d}=l;return cd[u]=c,n.postMessage({type:"SET",key:u,version:d})}n.postMessage(l)},s={},o={},r={};for(let l in t){let c=o[l]=P(t[l]);s[l]=0,r[l]=u=>{if(u.type==="GET"){let d=c.value,f=s[l];return i({type:"SET",key:l,version:f},d)}u.version>s[l]&&(c.value=cd[l],s[l]=u.version)},c.subscribe(u=>{let d=++s[l];i({type:"SET",key:l,version:d},u)})}n.addEventListener("message",({data:l})=>{r[l.key](l)});for(let l in o)i({type:"GET",key:l});return[o,()=>{n.close(),Object.values(o).forEach(l=>L.dispose(l))}]}var ud,cd,dt,J,Ce=M(()=>{"use strict";V();Fn();q();cd=(ud=window.opener??window).__kiru_devtools_state_register??(ud.__kiru_devtools_state_register={}),dt=()=>window.opener?.__kiru??window.__kiru;[J]=Xm("kiru-devtools:syncedState",{apps:[],rootRef:null,appSearchTerm:"",appSearchInput:null,componentSelection:{enabled:!1,componentNode:null},devtoolsViewMode:"embedded",devtoolsTab:"Apps",popupWindow:null,selectedApp:null,selectedNode:null,viewerSettings:{objectKeysChunkSize:10,arrayChunkSize:10}});if("window"in globalThis){let{apps:e,componentSelection:t,selectedNode:n,selectedApp:i,viewerSettings:s}=J;window.addEventListener("kiru:ready",()=>{e.value=[...dt().apps],dt().on("mount",a=>{se(a)||(e.value=[...e.value,a])}),dt().on("unmount",a=>{se(a)||(e.value=e.value.filter(l=>l!==a))})});let o="kiru-devtools:viewerSettings";s.subscribe(a=>{localStorage.setItem("kiru-devtools:viewerSettings",JSON.stringify(a))});let r=localStorage.getItem(o);if(r)try{let a=JSON.parse(r);Ye(typeof a.objectKeysChunkSize=="number"&&a.objectKeysChunkSize>0,"invalid objectKeysChunkSize"),Ye(typeof a.arrayChunkSize=="number"&&a.arrayChunkSize>0,"invalid arrayChunkSize"),s.sneak({objectKeysChunkSize:a.objectKeysChunkSize,arrayChunkSize:a.arrayChunkSize})}catch{s.sneak({objectKeysChunkSize:10,arrayChunkSize:10})}t.subscribe(({componentNode:a})=>{n.value=a,i.value=a?Nt(a):null})}});function Oa(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e},m("rect",{width:"20",height:"16",x:"2",y:"4",rx:"2"}),m("path",{d:"M12 9v11"}),m("path",{d:"M2 9h13a2 2 0 0 1 2 2v9"}))}var dd=M(()=>{"use strict";V()});function Xe(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},m("path",{d:"m9 18 6-6-6-6"}))}var Ao=M(()=>{"use strict";V()});function Ra(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},m("path",{d:"M18 6 6 18"}),m("path",{d:"m6 6 12 12"}))}var fd=M(()=>{"use strict";V()});function Ia(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},m("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),m("circle",{cx:"12",cy:"12",r:"3"}))}var hd=M(()=>{"use strict";V()});function qm(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},m("path",{d:"M15.536 11.293a1 1 0 0 0 0 1.414l2.376 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z"}),m("path",{d:"M2.297 11.293a1 1 0 0 0 0 1.414l2.377 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414L6.088 8.916a1 1 0 0 0-1.414 0z"}),m("path",{d:"M8.916 17.912a1 1 0 0 0 0 1.415l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.415l-2.377-2.376a1 1 0 0 0-1.414 0z"}),m("path",{d:"M8.916 4.674a1 1 0 0 0 0 1.414l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z"}))}var pd=M(()=>{"use strict";V()});function ss(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},m("path",{d:"M15 3h6v6"}),m("path",{d:"M10 14 21 3"}),m("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}))}var gd=M(()=>{"use strict";V()});function Na(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},m("path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z"}),m("path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z"}),m("path",{d:"M3 5a2 2 0 0 0 2 2h3"}),m("path",{d:"M3 3v13a2 2 0 0 0 2 2h3"}))}var md=M(()=>{"use strict";V()});function Zm(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},m("path",{d:"m15 15 6 6"}),m("path",{d:"m15 9 6-6"}),m("path",{d:"M21 16v5h-5"}),m("path",{d:"M21 8V3h-5"}),m("path",{d:"M3 16v5h5"}),m("path",{d:"m3 21 6-6"}),m("path",{d:"M3 8V3h5"}),m("path",{d:"M9 9 3 3"}))}var bd=M(()=>{"use strict";V()});function La(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e},m("path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z"}))}var xd=M(()=>{"use strict";V()});function os(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},m("path",{d:"m12 14 4-4"}),m("path",{d:"M3.34 19a10 10 0 1 1 17.32 0"}))}var yd=M(()=>{"use strict";V()});function Jm(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},m("circle",{cx:"12",cy:"5",r:"1"}),m("circle",{cx:"19",cy:"5",r:"1"}),m("circle",{cx:"5",cy:"5",r:"1"}),m("circle",{cx:"12",cy:"12",r:"1"}),m("circle",{cx:"19",cy:"12",r:"1"}),m("circle",{cx:"5",cy:"12",r:"1"}),m("circle",{cx:"12",cy:"19",r:"1"}),m("circle",{cx:"19",cy:"19",r:"1"}),m("circle",{cx:"5",cy:"19",r:"1"}))}var vd=M(()=>{"use strict";V()});function rs(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},m("path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z"}))}var wd=M(()=>{"use strict";V()});function Qm(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},m("path",{d:"M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6"}),m("path",{d:"m21 3-9 9"}),m("path",{d:"M15 3h6v6"}))}var _d=M(()=>{"use strict";V()});function za(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},m("path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478"}),m("path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134"}),m("path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134"}),m("path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478"}),m("circle",{cx:"12",cy:"12",r:"2"}))}var kd=M(()=>{"use strict";V()});function Hn(e){return m("svg",{width:"10",height:"10",viewBox:"0 0 10 10","aria-hidden":"true",...e},m("line",{x1:"9",y1:"1",x2:"1",y2:"9",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"}),m("line",{x1:"9",y1:"5",x2:"5",y2:"9",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"}))}var Sd=M(()=>{"use strict";V()});function tb(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},m("path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"}))}var Ed=M(()=>{"use strict";V()});var Md=M(()=>{"use strict";dd();Ao();fd();hd();pd();gd();md();bd();xd();yd();vd();wd();_d();kd();Sd();Ed()});function qe(e){let t=[],n=()=>t.forEach(f=>f()),i=P(null),s=P(null),o=P(eb(e)),r=Kt(()=>o.value.type==="snapped"?o.value.side:null),a=P([0,0]),l=P(!1);t.push(a.subscribe(([f,p])=>{let b=i.value;b.style.transform=\`translate(\${f}px, \${p}px)\`}));let c=f=>{if(f.button!==0)return;let p=i.value,[b,x]=[f.clientX,f.clientY],y=p.getBoundingClientRect(),[w,_]=[b-y.left,x-y.top];l.value=!1;let S=E=>{if(!l.peek()&&(Math.abs(E.clientX-b)>5||Math.abs(E.clientY-x)>5)&&(l.value=!0),!l.peek())return;let[D,O]=[E.clientX-w,E.clientY-_],[A,N]=e.getDraggableBounds(),{width:j,height:H}=p.getBoundingClientRect(),G=D,ot=A-(D+j),Ct=O,Q=N-(O+H),tt=Math.min(G,ot,Ct,Q),mt=D+j/2,ce=O+H/2;e.allowFloat&&tt>(e.snapDistance??0)?o.value={type:"floating",x:mt/A,y:ce/N}:tt===G?o.value={type:"snapped",side:"left",percent:ce/N}:tt===ot?o.value={type:"snapped",side:"right",percent:ce/N}:tt===Ct?o.value={type:"snapped",side:"top",percent:mt/A}:o.value={type:"snapped",side:"bottom",percent:mt/A},u()},T=()=>{if(window.removeEventListener("mousemove",S),window.removeEventListener("mouseup",T),!l.peek())return e.onclick?.();l.value=!1,e.storage.setItem(e.key,JSON.stringify(o.value))};window.addEventListener("mousemove",S),window.addEventListener("mouseup",T)},u=()=>{let f=i.value,{width:p,height:b}=f.getBoundingClientRect(),[x,y]=e.getDraggableBounds(),w=o.value;if(w.type==="floating"){let[D,O]=e.getPadding(null);a.value=[Ke(w.x*x-p/2,D,x-D-p),Ke(w.y*y-b/2,O,y-O-b)];return}let[_,S]=e.getPadding(w.side),T=0,E=0;switch(w.side){case"top":T=w.percent*x-p/2,E=0;break;case"bottom":T=w.percent*x-p/2,E=1/0;break;case"left":T=0,E=w.percent*y-b/2;break;case"right":T=1/0,E=w.percent*y-b/2;break}a.value=[Ke(T,_,x-_-p),Ke(E,S,y-S-b)]};return{init:()=>{let f=s.value;if(!f)return console.error("handle not found",new Error().stack);let p=i.value;if(!p)return console.error("container not found",new Error().stack);p.style.position="fixed",p.style.top="0",p.style.left="0",u();let b=new ResizeObserver(u);b.observe(p),window.addEventListener("resize",u),f.addEventListener("mousedown",c),t.push(()=>{b.disconnect(),window.removeEventListener("resize",u),f.removeEventListener("mousedown",c)})},isDragging:l,handleRef:s,containerRef:i,snapSide:r,containerPos:a,dispose:n}}function eb({storage:e,key:t,defaultPosition:n}){let i=e.getItem(t);if(i)try{let o=JSON.parse(i);if(o.type==="snapped")return Ye(["top","right","bottom","left"].includes(o.side),"invalid side"),Ye(typeof o.percent=="number"&&o.percent>=0&&o.percent<=1,"invalid percent"),o;if(o.type==="floating")return Ye(typeof o.x=="number"&&o.x>=0&&o.x<=1,"invalid x"),Ye(typeof o.y=="number"&&o.y>=0&&o.y<=1,"invalid y"),o}catch{}let s=n??{type:"floating",x:.5,y:.5};return e.setItem(t,JSON.stringify(s)),s}var Td=M(()=>{"use strict";V();Fn()});function Va(e,t={windowScroll:!0,windowResize:!0}){let n=[],i=()=>{n.forEach(_=>_()),n.length=0},s=t.windowScroll??!0,o=t.windowResize??!0,r=P(0),a=P(0),l=P(0),c=P(0),u=P(0),d=P(0),f=P(0),p=P(0),b=P(0),x=P(0),y=()=>{let _=e.current;if(!_){r.value=a.value=l.value=c.value=u.value=d.value=f.value=p.value=b.value=x.value=0;return}r.value=_.clientWidth,a.value=_.clientHeight;let S=_.getBoundingClientRect();l.value=S.top,c.value=S.left,u.value=S.right,d.value=S.bottom,f.value=S.x,p.value=S.y,b.value=window.scrollX,x.value=window.scrollY};return{state:{width:r,height:a,top:l,left:c,right:u,bottom:d,x:f,y:p,scrollX:b,scrollY:x},init:()=>{let _=e.current;if(!_)return console.error("element not found",new Error().stack);let S=new MutationObserver(y);S.observe(_,{attributeFilter:["style","class"],attributes:!0,childList:!0,subtree:!0}),n.push(()=>S.disconnect());let T=new ResizeObserver(y);T.observe(_),n.push(()=>T.disconnect()),s&&(window.addEventListener("scroll",y,{capture:!0,passive:!0}),n.push(()=>window.removeEventListener("scroll",y))),o&&(window.addEventListener("resize",y,{passive:!0}),n.push(()=>window.removeEventListener("resize",y))),y()},dispose:i}}var Cd=M(()=>{"use strict";V()});function Bn(e){let t=[],n=()=>t.forEach(d=>d()),i=P(null),s=P(null),o=P(!1),[r,a]=e.minSize??[0,0],l=e.aspectRatio??null,c=d=>{if(d.button!==0)return;d.stopPropagation(),d.preventDefault(),o.value=!0,document.body.style.cursor="se-resize",document.body.style.userSelect="none";let f=i.value,p=d.clientX,b=d.clientY,x=f.offsetWidth,y=f.offsetHeight,w=S=>{let T=S.clientX-p,E=S.clientY-b;if(l!==null){let D=(T*l+E)/(l*l+1),O=Math.max(r,x+D*l),A=O/l;A<a&&(A=a,O=A*l),f.style.width=\`\${O}px\`,f.style.height=\`\${A}px\`}else f.style.width=\`\${Math.max(r,x+T)}px\`,f.style.height=\`\${Math.max(a,y+E)}px\`},_=()=>{window.removeEventListener("mousemove",w),window.removeEventListener("mouseup",_),o.value=!1,document.body.style.cursor="",document.body.style.userSelect="",e.storage.setItem(e.key,JSON.stringify({w:f.offsetWidth,h:f.offsetHeight}))};window.addEventListener("mousemove",w),window.addEventListener("mouseup",_)};return{containerRef:i,handleRef:s,isResizing:o,init:()=>{let d=s.value;if(!d)return console.error("resize handle not found",new Error().stack);let f=i.value;if(!f)return console.error("resize container not found",new Error().stack);let p=nb(e.storage,e.key);if(p){let b=p[0],x=l!==null?b/l:p[1];f.style.width=\`\${b}px\`,f.style.height=\`\${x}px\`}d.addEventListener("mousedown",c),t.push(()=>d.removeEventListener("mousedown",c))},dispose:n}}function nb(e,t){let n=e.getItem(t);if(!n)return null;try{let i=JSON.parse(n);if(typeof i.w=="number"&&typeof i.h=="number")return[i.w,i.h]}catch{}return null}var Pd=M(()=>{"use strict";V()});function as(){let e=P({x:0,y:0}),t=n=>{e.value={x:n.clientX,y:n.clientY}};return window.addEventListener("mousemove",t),[e,()=>window.removeEventListener("mousemove",t)]}var Dd=M(()=>{"use strict";V()});function us(e){return e+.5|0}function ls(e){return mn(us(e*2.55),0,255)}function bn(e){return mn(us(e*255),0,255)}function Ze(e){return mn(us(e/2.55)/100,0,1)}function Ad(e){return mn(us(e*100),0,100)}function rb(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&oe[e[1]]*17,g:255&oe[e[2]]*17,b:255&oe[e[3]]*17,a:t===5?oe[e[4]]*17:255}:(t===7||t===9)&&(n={r:oe[e[1]]<<4|oe[e[2]],g:oe[e[3]]<<4|oe[e[4]],b:oe[e[5]]<<4|oe[e[6]],a:t===9?oe[e[7]]<<4|oe[e[8]]:255})),n}function lb(e){var t=ob(e)?ib:sb;return e?"#"+t(e.r)+t(e.g)+t(e.b)+ab(e.a,t):void 0}function Nd(e,t,n){let i=t*Math.min(n,1-n),s=(o,r=(o+e/30)%12)=>n-i*Math.max(Math.min(r-3,9-r,1),-1);return[s(0),s(8),s(4)]}function ub(e,t,n){let i=(s,o=(s+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function db(e,t,n){let i=Nd(e,1,.5),s;for(t+n>1&&(s=1/(t+n),t*=s,n*=s),s=0;s<3;s++)i[s]*=1-t-n,i[s]+=t;return i}function fb(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 Ba(e){let n=e.r/255,i=e.g/255,s=e.b/255,o=Math.max(n,i,s),r=Math.min(n,i,s),a=(o+r)/2,l,c,u;return o!==r&&(u=o-r,c=a>.5?u/(2-o-r):u/(o+r),l=fb(n,i,s,u,o),l=l*60+.5),[l|0,c||0,a]}function Wa(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(bn)}function ja(e,t,n){return Wa(Nd,e,t,n)}function hb(e,t,n){return Wa(db,e,t,n)}function pb(e,t,n){return Wa(ub,e,t,n)}function Ld(e){return(e%360+360)%360}function gb(e){let t=cb.exec(e),n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?ls(+t[5]):bn(+t[5]));let s=Ld(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?i=hb(s,o,r):t[1]==="hsv"?i=pb(s,o,r):i=ja(s,o,r),{r:i[0],g:i[1],b:i[2],a:n}}function mb(e,t){var n=Ba(e);n[0]=Ld(n[0]+t),n=ja(n),e.r=n[0],e.g=n[1],e.b=n[2]}function bb(e){if(!e)return;let t=Ba(e),n=t[0],i=Ad(t[1]),s=Ad(t[2]);return e.a<255?\`hsla(\${n}, \${i}%, \${s}%, \${Ze(e.a)})\`:\`hsl(\${n}, \${i}%, \${s}%)\`}function xb(){let e={},t=Object.keys(Rd),n=Object.keys(Od),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,Od[o]);o=parseInt(Rd[r],16),e[a]=[o>>16&255,o>>8&255,o&255]}return e}function yb(e){Ro||(Ro=xb(),Ro.transparent=[0,0,0,0]);let t=Ro[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}function wb(e){let t=vb.exec(e),n=255,i,s,o;if(t){if(t[7]!==i){let r=+t[7];n=t[8]?ls(r):mn(r*255,0,255)}return i=+t[1],s=+t[3],o=+t[5],i=255&(t[2]?ls(i):mn(i,0,255)),s=255&(t[4]?ls(s):mn(s,0,255)),o=255&(t[6]?ls(o):mn(o,0,255)),{r:i,g:s,b:o,a:n}}}function _b(e){return e&&(e.a<255?\`rgba(\${e.r}, \${e.g}, \${e.b}, \${Ze(e.a)})\`:\`rgb(\${e.r}, \${e.g}, \${e.b})\`)}function kb(e,t,n){let i=bi(Ze(e.r)),s=bi(Ze(e.g)),o=bi(Ze(e.b));return{r:bn(Fa(i+n*(bi(Ze(t.r))-i))),g:bn(Fa(s+n*(bi(Ze(t.g))-s))),b:bn(Fa(o+n*(bi(Ze(t.b))-o))),a:e.a+n*(t.a-e.a)}}function Io(e,t,n){if(e){let i=Ba(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=ja(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function zd(e,t){return e&&Object.assign(t||{},e)}function Id(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=bn(e[3]))):(t=zd(e,{r:0,g:0,b:0,a:1}),t.a=bn(t.a)),t}function Sb(e){return e.charAt(0)==="r"?wb(e):gb(e)}var mn,oe,Ha,ib,sb,Oo,ob,ab,cb,Od,Rd,Ro,vb,Fa,bi,cs,Vd=M(()=>{mn=(e,t,n)=>Math.max(Math.min(e,n),t);oe={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},Ha=[..."0123456789ABCDEF"],ib=e=>Ha[e&15],sb=e=>Ha[(e&240)>>4]+Ha[e&15],Oo=e=>(e&240)>>4===(e&15),ob=e=>Oo(e.r)&&Oo(e.g)&&Oo(e.b)&&Oo(e.a);ab=(e,t)=>e<255?t(e):"";cb=/^(hsla?|hwb|hsv)\\(\\s*([-+.e\\d]+)(?:deg)?[\\s,]+([-+.e\\d]+)%[\\s,]+([-+.e\\d]+)%(?:[\\s,]+([-+.e\\d]+)(%)?)?\\s*\\)$/;Od={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"},Rd={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"};vb=/^rgba?\\(\\s*([-+.\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?(?:[\\s,/]+([-+.e\\d]+)(%)?)?\\s*\\)$/;Fa=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,bi=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);cs=class e{constructor(t){if(t instanceof e)return t;let n=typeof t,i;n==="object"?i=Id(t):n==="string"&&(i=rb(t)||yb(t)||Sb(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=zd(this._rgb);return t&&(t.a=Ze(t.a)),t}set rgb(t){this._rgb=Id(t)}rgbString(){return this._valid?_b(this._rgb):void 0}hexString(){return this._valid?lb(this._rgb):void 0}hslString(){return this._valid?bb(this._rgb):void 0}mix(t,n){if(t){let i=this.rgb,s=t.rgb,o,r=n===o?.5:n,a=2*r-1,l=i.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,i.r=255&c*i.r+o*s.r+.5,i.g=255&c*i.g+o*s.g+.5,i.b=255&c*i.b+o*s.b+.5,i.a=r*i.a+(1-r)*s.a,this.rgb=i}return this}interpolate(t,n){return t&&(this._rgb=kb(this._rgb,t._rgb,n)),this}clone(){return new e(this.rgb)}alpha(t){return this._rgb.a=bn(t),this}clearer(t){let n=this._rgb;return n.a*=1-t,this}greyscale(){let t=this._rgb,n=us(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){let n=this._rgb;return n.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Io(this._rgb,2,t),this}darken(t){return Io(this._rgb,2,-t),this}saturate(t){return Io(this._rgb,1,t),this}desaturate(t){return Io(this._rgb,1,-t),this}rotate(t){return mb(this._rgb,t),this}}});function be(){}function X(e){return e==null}function et(e){if(Array.isArray&&Array.isArray(e))return!0;let t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Y(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function ht(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function At(e,t){return ht(e)?e:t}function W(e,t){return typeof e>"u"?t:e}function z(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function $(e,t,n,i){let s,o,r;if(et(e))if(o=e.length,i)for(s=o-1;s>=0;s--)t.call(n,e[s],s);else for(s=0;s<o;s++)t.call(n,e[s],s);else if(Y(e))for(r=Object.keys(e),o=r.length,s=0;s<o;s++)t.call(n,e[r[s]],r[s])}function vi(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 fs(e){if(et(e))return e.map(fs);if(Y(e)){let t=Object.create(null),n=Object.keys(e),i=n.length,s=0;for(;s<i;++s)t[n[s]]=fs(e[n[s]]);return t}return e}function Kd(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function Xd(e,t,n,i){if(!Kd(e))return;let s=t[e],o=n[e];Y(s)&&Y(o)?$n(s,o,i):t[e]=fs(o)}function $n(e,t,n){let i=et(t)?t:[t],s=i.length;if(!Y(e))return e;n=n||{};let o=n.merger||Xd,r;for(let a=0;a<s;++a){if(r=i[a],!Y(r))continue;let l=Object.keys(r);for(let c=0,u=l.length;c<u;++c)o(l[c],e,r,n)}return e}function Un(e,t){return $n(e,t,{merger:qd})}function qd(e,t,n){if(!Kd(e))return;let i=t[e],s=n[e];Y(i)&&Y(s)?Un(i,s):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=fs(s))}function Zd(e){let t=e.split("."),n=[],i="";for(let s of t)i+=s,i.endsWith("\\\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function Eb(e){let t=Zd(e);return n=>{for(let i of t){if(i==="")break;n=n&&n[i]}return n}}function wi(e,t){return(Fd[t]||(Fd[t]=Eb(t)))(e)}function gs(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Xa(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}function Ae(e,t,n){return Math.abs(e-t)<n}function Bo(e){let t=Math.round(e);e=Ae(e,t,e/1e3)?t:e;let n=Math.pow(10,Math.floor(De(e))),i=e/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function qa(e){let t=[],n=Math.sqrt(e),i;for(i=1;i<n;i++)e%i===0&&(t.push(i),t.push(e/i));return n===(n|0)&&t.push(n),t.sort((s,o)=>s-o).pop(),t}function Mb(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Gn(e){return!Mb(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function Za(e,t){let n=Math.round(e);return n-t<=e&&n+t>=e}function Wo(e,t,n){let i,s,o;for(i=0,s=e.length;i<s;i++)o=e[i][n],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function Oe(e){return e*(ft/180)}function ms(e){return e*(180/ft)}function jo(e){if(!ht(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function Ja(e,t){let n=t.x-e.x,i=t.y-e.y,s=Math.sqrt(n*n+i*i),o=Math.atan2(i,n);return o<-.5*ft&&(o+=Ht),{angle:o,distance:s}}function ps(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function tf(e,t){return(e-t+Jd)%Ht-ft}function Xt(e){return(e%Ht+Ht)%Ht}function $o(e,t,n,i){let s=Xt(e),o=Xt(t),r=Xt(n),a=Xt(o-s),l=Xt(r-s),c=Xt(s-o),u=Xt(s-r);return s===o||s===r||i&&o===r||a>l&&c<u}function Bt(e,t,n){return Math.max(t,Math.min(n,e))}function Qa(e){return Bt(e,-32768,32767)}function Yn(e,t,n,i=1e-6){return e>=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function bs(e,t,n){n=n||(r=>e[r]<t);let i=e.length-1,s=0,o;for(;i-s>1;)o=s+i>>1,n(o)?s=o:i=o;return{lo:s,hi:i}}function el(e,t,n){let i=0,s=e.length;for(;i<s&&e[i]<t;)i++;for(;s>i&&e[s-1]>n;)s--;return i>0||s<e.length?e.slice(i,s):e}function nl(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),ef.forEach(n=>{let i="_onData"+gs(n),s=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){let r=s.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...o)}),r}})})}function Uo(e,t){let n=e._chartjs;if(!n)return;let i=n.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(ef.forEach(o=>{delete e[o]}),delete e._chartjs)}function il(e){let t=new Set(e);return t.size===e.length?e:Array.from(t)}function Yo(e,t){let n=[],i=!1;return function(...s){n=s,i||(i=!0,Go.call(window,()=>{i=!1,e.apply(t,n)}))}}function sl(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}function rl(e,t,n){let i=t.length,s=0,o=i;if(e._sorted){let{iScale:r,vScale:a,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=r.axis,{min:d,max:f,minDefined:p,maxDefined:b}=r.getUserBounds();if(p){if(s=Math.min(Qe(l,u,d).lo,n?i:Qe(t,u,r.getPixelForValue(d)).lo),c){let x=l.slice(0,s+1).reverse().findIndex(y=>!X(y[a.axis]));s-=Math.max(0,x)}s=Bt(s,0,i-1)}if(b){let x=Math.max(Qe(l,r.axis,f,!0).hi+1,n?0:Qe(t,u,r.getPixelForValue(f),!0).hi+1);if(c){let y=l.slice(x-1).findIndex(w=>!X(w[a.axis]));x+=Math.max(0,y)}o=Bt(x,s,i)-s}else o=i-s}return{start:s,count:o}}function al(e){let{xScale:t,yScale:n,_scaleRanges:i}=e,s={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=s,!0;let o=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,s),o}function Xo(e){if(e&&typeof e=="object"){let t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function qo(e){return Xo(e)?e:new cs(e)}function Vo(e){return Xo(e)?e:new cs(e).saturate(.5).darken(.1).hexString()}function Pb(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:Cb},numbers:{type:"number",properties:Tb}}),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 Db(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}function Ab(e,t){t=t||{};let n=e+JSON.stringify(t),i=Wd.get(n);return i||(i=new Intl.NumberFormat(e,t),Wd.set(n,i)),i}function xs(e,t,n){return Ab(t,n).format(e)}function Ob(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}function Rb(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:ys.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}function ds(e,t){if(!t)return e;let n=t.split(".");for(let i=0,s=n.length;i<s;++i){let o=n[i];e=e[o]||(e[o]=Object.create(null))}return e}function $a(e,t,n){return typeof t=="string"?$n(ds(e,t),n):$n(ds(e,""),t)}function sf(e){return!e||X(e.size)||X(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function xi(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 ll(e,t,n,i){i=i||{};let s=i.data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},o=i.garbageCollect=[],i.font=t),e.save(),e.font=t;let r=0,a=n.length,l,c,u,d,f;for(l=0;l<a;l++)if(d=n[l],d!=null&&!et(d))r=xi(e,s,o,r,d);else if(et(d))for(c=0,u=d.length;c<u;c++)f=d[c],f!=null&&!et(f)&&(r=xi(e,s,o,r,f));e.restore();let p=o.length/2;if(p>n.length){for(l=0;l<p;l++)delete s[o[l]];o.splice(0,p)}return r}function tn(e,t,n){let i=e.currentDevicePixelRatio,s=n!==0?Math.max(n/2,.5):0;return Math.round((t-s)*i)/i+s}function Jo(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){Qo(e,t,n,i,null)}function Qo(e,t,n,i,s){let o,r,a,l,c,u,d,f,p=t.pointStyle,b=t.rotation,x=t.radius,y=(b||0)*Qd;if(p&&typeof p=="object"&&(o=p.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(n,i),e.rotate(y),e.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),e.restore();return}if(!(isNaN(x)||x<=0)){switch(e.beginPath(),p){default:s?e.ellipse(n,i,s/2,x,0,0,Ht):e.arc(n,i,x,0,Ht),e.closePath();break;case"triangle":u=s?s/2:x,e.moveTo(n+Math.sin(y)*u,i-Math.cos(y)*x),y+=Ua,e.lineTo(n+Math.sin(y)*u,i-Math.cos(y)*x),y+=Ua,e.lineTo(n+Math.sin(y)*u,i-Math.cos(y)*x),e.closePath();break;case"rectRounded":c=x*.516,l=x-c,r=Math.cos(y+xn)*l,d=Math.cos(y+xn)*(s?s/2-c:l),a=Math.sin(y+xn)*l,f=Math.sin(y+xn)*(s?s/2-c:l),e.arc(n-d,i-a,c,y-ft,y-Dt),e.arc(n+f,i-r,c,y-Dt,y),e.arc(n+d,i+a,c,y,y+Dt),e.arc(n-f,i+r,c,y+Dt,y+ft),e.closePath();break;case"rect":if(!b){l=Math.SQRT1_2*x,u=s?s/2:l,e.rect(n-u,i-l,2*u,2*l);break}y+=xn;case"rectRot":d=Math.cos(y)*(s?s/2:x),r=Math.cos(y)*x,a=Math.sin(y)*x,f=Math.sin(y)*(s?s/2:x),e.moveTo(n-d,i-a),e.lineTo(n+f,i-r),e.lineTo(n+d,i+a),e.lineTo(n-f,i+r),e.closePath();break;case"crossRot":y+=xn;case"cross":d=Math.cos(y)*(s?s/2:x),r=Math.cos(y)*x,a=Math.sin(y)*x,f=Math.sin(y)*(s?s/2:x),e.moveTo(n-d,i-a),e.lineTo(n+d,i+a),e.moveTo(n+f,i-r),e.lineTo(n-f,i+r);break;case"star":d=Math.cos(y)*(s?s/2:x),r=Math.cos(y)*x,a=Math.sin(y)*x,f=Math.sin(y)*(s?s/2:x),e.moveTo(n-d,i-a),e.lineTo(n+d,i+a),e.moveTo(n+f,i-r),e.lineTo(n-f,i+r),y+=xn,d=Math.cos(y)*(s?s/2:x),r=Math.cos(y)*x,a=Math.sin(y)*x,f=Math.sin(y)*(s?s/2:x),e.moveTo(n-d,i-a),e.lineTo(n+d,i+a),e.moveTo(n+f,i-r),e.lineTo(n-f,i+r);break;case"line":r=s?s/2:Math.cos(y)*x,a=Math.sin(y)*x,e.moveTo(n-r,i-a),e.lineTo(n+r,i+a);break;case"dash":e.moveTo(n,i),e.lineTo(n+Math.cos(y)*(s?s/2:x),i+Math.sin(y)*x);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function qt(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 ws(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function _s(e){e.restore()}function cl(e,t,n,i,s){if(!t)return e.lineTo(n.x,n.y);if(s==="middle"){let o=(t.x+n.x)/2;e.lineTo(o,t.y),e.lineTo(o,n.y)}else s==="after"!=!!i?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function ul(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 Ib(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),X(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function Nb(e,t,n,i,s){if(s.strikethrough||s.underline){let o=e.measureText(i),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=n-o.actualBoundingBoxAscent,c=n+o.actualBoundingBoxDescent,u=s.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=s.decorationWidth||2,e.moveTo(r,u),e.lineTo(a,u),e.stroke()}}function Lb(e,t){let n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function _n(e,t,n,i,s,o={}){let r=et(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="",l,c;for(e.save(),e.font=s.string,Ib(e,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&Lb(e,o.backdrop),a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),X(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,n,i,o.maxWidth)),e.fillText(c,n,i,o.maxWidth),Nb(e,n,i,c,o),i+=Number(s.lineHeight);e.restore()}function ki(e,t){let{x:n,y:i,w:s,h:o,radius:r}=t;e.arc(n+r.topLeft,i+r.topLeft,r.topLeft,1.5*ft,ft,!0),e.lineTo(n,i+o-r.bottomLeft),e.arc(n+r.bottomLeft,i+o-r.bottomLeft,r.bottomLeft,ft,Dt,!0),e.lineTo(n+s-r.bottomRight,i+o),e.arc(n+s-r.bottomRight,i+o-r.bottomRight,r.bottomRight,Dt,0,!0),e.lineTo(n+s,i+r.topRight),e.arc(n+s-r.topRight,i+r.topRight,r.topRight,0,-Dt,!0),e.lineTo(n+r.topLeft,i)}function of(e,t){let n=(""+e).match(zb);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}function tr(e,t){let n={},i=Y(t),s=i?Object.keys(t):t,o=Y(e)?i?r=>W(e[r],e[t[r]]):r=>e[r]:()=>e;for(let r of s)n[r]=Fb(o(r));return n}function dl(e){return tr(e,{top:"y",right:"x",bottom:"y",left:"x"})}function kn(e){return tr(e,["topLeft","topRight","bottomLeft","bottomRight"])}function kt(e){let t=dl(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function gt(e,t){e=e||{},t=t||it.font;let n=W(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=W(e.style,t.style);i&&!(""+i).match(Vb)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);let s={family:W(e.family,t.family),lineHeight:of(W(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:W(e.weight,t.weight),string:""};return s.string=sf(s),s}function Si(e,t,n,i){let s=!0,o,r,a;for(o=0,r=e.length;o<r;++o)if(a=e[o],a!==void 0&&(t!==void 0&&typeof a=="function"&&(a=a(t),s=!1),n!==void 0&&et(a)&&(a=a[n%a.length],s=!1),a!==void 0))return i&&!s&&(i.cacheable=!1),a}function fl(e,t,n){let{min:i,max:s}=e,o=Ka(t,(s-i)/2),r=(a,l)=>n&&a===0?0:a+l;return{min:r(i,-Math.abs(o)),max:r(s,o)}}function Re(e,t){return Object.assign(Object.create(e),t)}function ks(e,t=[""],n,i,s=()=>e[0]){let o=n||e;typeof i>"u"&&(i=lf("_fallback",e));let r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:i,_getTarget:s,override:a=>ks([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 rf(a,l,()=>Yb(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return $d(a).includes(l)},ownKeys(a){return $d(a)},set(a,l,c){let u=a._storage||(a._storage=s());return a[l]=u[l]=c,delete a._keys,!0}})}function vn(e,t,n,i){let s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:er(e,i),setContext:o=>vn(e,o,n,i),override:o=>vn(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 rf(o,r,()=>Bb(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 er(e,t={scriptable:!0,indexable:!0}){let{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:n,indexable:i,isScriptable:Pe(n)?n:()=>n,isIndexable:Pe(i)?i:()=>i}}function rf(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];let i=n();return e[t]=i,i}function Bb(e,t,n){let{_proxy:i,_context:s,_subProxy:o,_descriptors:r}=e,a=i[t];return Pe(a)&&r.isScriptable(t)&&(a=Wb(t,a,e,n)),et(a)&&a.length&&(a=jb(t,a,e,r.isIndexable)),hl(t,a)&&(a=vn(a,s,o&&o[t],r)),a}function Wb(e,t,n,i){let{_proxy:s,_context:o,_subProxy:r,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(o,r||i);return a.delete(e),hl(e,l)&&(l=pl(s._scopes,s,e,l)),l}function jb(e,t,n,i){let{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=n;if(typeof o.index<"u"&&i(e))return t[o.index%t.length];if(Y(t[0])){let l=t,c=s._scopes.filter(u=>u!==l);t=[];for(let u of l){let d=pl(c,s,e,u);t.push(vn(d,o,r&&r[e],a))}}return t}function af(e,t,n){return Pe(e)?e(t,n):e}function Ub(e,t,n,i,s){for(let o of t){let r=$b(n,o);if(r){e.add(r);let a=af(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 pl(e,t,n,i){let s=t._rootScopes,o=af(t._fallback,n,i),r=[...e,...s],a=new Set;a.add(i);let l=jd(a,r,n,o||n,i);return l===null||typeof o<"u"&&o!==n&&(l=jd(a,r,o,l,i),l===null)?!1:ks(Array.from(a),[""],s,o,()=>Gb(t,n,i))}function jd(e,t,n,i,s){for(;n;)n=Ub(e,t,n,i,s);return n}function Gb(e,t,n){let i=e._getTarget();t in i||(i[t]={});let s=i[t];return et(s)&&Y(n)?n:s||{}}function Yb(e,t,n,i){let s;for(let o of t)if(s=lf(Hb(o,e),n),typeof s<"u")return hl(e,s)?pl(n,i,e,s):s}function lf(e,t){for(let n of t){if(!n)continue;let i=n[e];if(typeof i<"u")return i}}function $d(e){let t=e._keys;return t||(t=e._keys=Kb(e._scopes)),t}function Kb(e){let t=new Set;for(let n of e)for(let i of Object.keys(n).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function uf(e,t,n,i){let s=e.skip?t:e,o=t,r=n.skip?t:n,a=ps(o,s),l=ps(r,o),c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;let d=i*c,f=i*u;return{previous:{x:o.x-d*(r.x-s.x),y:o.y-d*(r.y-s.y)},next:{x:o.x+f*(r.x-s.x),y:o.y+f*(r.y-s.y)}}}function qb(e,t,n){let i=e.length,s,o,r,a,l,c=yi(e,0);for(let u=0;u<i-1;++u)if(l=c,c=yi(e,u+1),!(!l||!c)){if(Ae(t[u],0,Xb)){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 Zb(e,t,n="x"){let i=cf(n),s=e.length,o,r,a,l=yi(e,0);for(let c=0;c<s;++c){if(r=a,a=l,l=yi(e,c+1),!a)continue;let u=a[n],d=a[i];r&&(o=(u-r[n])/3,a[\`cp1\${n}\`]=u-o,a[\`cp1\${i}\`]=d-o*t[c]),l&&(o=(l[n]-u)/3,a[\`cp2\${n}\`]=u+o,a[\`cp2\${i}\`]=d+o*t[c])}}function df(e,t="x"){let n=cf(t),i=e.length,s=Array(i).fill(0),o=Array(i),r,a,l,c=yi(e,0);for(r=0;r<i;++r)if(a=l,l=c,c=yi(e,r+1),!!l){if(c){let u=c[t]-l[t];s[r]=u!==0?(c[n]-l[n])/u:0}o[r]=a?c?me(s[r-1])!==me(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}qb(e,s,o),Zb(e,o,t)}function Lo(e,t,n){return Math.max(Math.min(e,n),t)}function Jb(e,t){let n,i,s,o,r,a=qt(e[0],t);for(n=0,i=e.length;n<i;++n)r=o,o=a,a=n<i-1&&qt(e[n+1],t),o&&(s=e[n],r&&(s.cp1x=Lo(s.cp1x,t.left,t.right),s.cp1y=Lo(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=Lo(s.cp2x,t.left,t.right),s.cp2y=Lo(s.cp2y,t.top,t.bottom)))}function gl(e,t,n,i,s){let o,r,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")df(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=uf(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&&Jb(e,n)}function Ss(){return typeof window<"u"&&typeof document<"u"}function Es(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Fo(e,t,n){let i;return typeof e=="string"?(i=parseInt(e,10),e.indexOf("%")!==-1&&(i=i/100*t.parentNode[n])):i=e,i}function ff(e,t){return nr(e).getPropertyValue(t)}function jn(e,t,n){let i={};n=n?"-"+n:"";for(let s=0;s<4;s++){let o=Qb[s];i[o]=parseFloat(e[t+"-"+o+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}function ex(e,t){let n=e.touches,i=n&&n.length?n[0]:e,{offsetX:s,offsetY:o}=i,r=!1,a,l;if(tx(s,o,e.target))a=s,l=o;else{let c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function Zt(e,t){if("native"in e)return e;let{canvas:n,currentDevicePixelRatio:i}=t,s=nr(n),o=s.boxSizing==="border-box",r=jn(s,"padding"),a=jn(s,"border","width"),{x:l,y:c,box:u}=ex(e,n),d=r.left+(u&&a.left),f=r.top+(u&&a.top),{width:p,height:b}=t;return o&&(p-=r.width+a.width,b-=r.height+a.height),{x:Math.round((l-d)/p*n.width/i),y:Math.round((c-f)/b*n.height/i)}}function nx(e,t,n){let i,s;if(t===void 0||n===void 0){let o=e&&Es(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{let r=o.getBoundingClientRect(),a=nr(o),l=jn(a,"border","width"),c=jn(a,"padding");t=r.width-c.width-l.width,n=r.height-c.height-l.height,i=Fo(a.maxWidth,o,"clientWidth"),s=Fo(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:i||hs,maxHeight:s||hs}}function ml(e,t,n,i){let s=nr(e),o=jn(s,"margin"),r=Fo(s.maxWidth,e,"clientWidth")||hs,a=Fo(s.maxHeight,e,"clientHeight")||hs,l=nx(e,t,n),{width:c,height:u}=l;if(s.boxSizing==="content-box"){let f=jn(s,"border","width"),p=jn(s,"padding");c-=p.width+f.width,u-=p.height+f.height}return c=Math.max(0,c-o.width),u=Math.max(0,i?c/i:u-o.height),c=yn(Math.min(c,r,l.maxWidth)),u=yn(Math.min(u,a,l.maxHeight)),c&&!u&&(u=yn(c/2)),(t!==void 0||n!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=yn(Math.floor(u*i))),{width:c,height:u}}function ir(e,t,n){let i=t||1,s=yn(e.height*i),o=yn(e.width*i);e.height=yn(e.height),e.width=yn(e.width);let r=e.canvas;return r.style&&(n||!r.style.height&&!r.style.width)&&(r.style.height=\`\${e.height}px\`,r.style.width=\`\${e.width}px\`),e.currentDevicePixelRatio!==i||r.height!==s||r.width!==o?(e.currentDevicePixelRatio=i,r.height=s,r.width=o,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}function sr(e,t){let n=ff(e,t),i=n&&n.match(/^(\\d+)(\\.\\d+)?px$/);return i?+i[1]:void 0}function Je(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function xl(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 yl(e,t,n,i){let s={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},r=Je(e,s,n),a=Je(s,o,n),l=Je(o,t,n),c=Je(r,a,n),u=Je(a,l,n);return Je(c,u,n)}function Sn(e,t,n){return e?ix(t,n):sx()}function or(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 rr(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function hf(e){return e==="angle"?{between:$o,compare:tf,normalize:Xt}:{between:Yn,compare:(t,n)=>t-n,normalize:t=>t}}function Ud({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 ox(e,t,n){let{property:i,start:s,end:o}=n,{between:r,normalize:a}=hf(i),l=t.length,{start:c,end:u,loop:d}=e,f,p;if(d){for(c+=l,u+=l,f=0,p=l;f<p&&r(a(t[c%l][i]),s,o);++f)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:e.style}}function vl(e,t,n){if(!n)return[e];let{property:i,start:s,end:o}=n,r=t.length,{compare:a,between:l,normalize:c}=hf(i),{start:u,end:d,loop:f,style:p}=ox(e,t,n),b=[],x=!1,y=null,w,_,S,T=()=>l(s,S,w)&&a(s,S)!==0,E=()=>a(o,w)===0||l(o,S,w),D=()=>x||T(),O=()=>!x||E();for(let A=u,N=u;A<=d;++A)_=t[A%r],!_.skip&&(w=c(_[i]),w!==S&&(x=l(w,s,o),y===null&&D()&&(y=a(w,s)===0?A:N),y!==null&&O()&&(b.push(Ud({start:y,end:A,loop:f,count:r,style:p})),y=null),N=A,S=w));return y!==null&&b.push(Ud({start:y,end:d,loop:f,count:r,style:p})),b}function wl(e,t){let n=[],i=e.segments;for(let s=0;s<i.length;s++){let o=vl(i[s],e.points,t);o.length&&n.push(...o)}return n}function rx(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 ax(e,t,n,i){let s=e.length,o=[],r=t,a=e[t],l;for(l=t+1;l<=n;++l){let c=e[l%s];c.skip||c.stop?a.skip||(i=!1,o.push({start:t%s,end:(l-1)%s,loop:i}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%s,end:r%s,loop:i}),o}function _l(e,t){let n=e.points,i=e.options.spanGaps,s=n.length;if(!s)return[];let o=!!e._loop,{start:r,end:a}=rx(n,s,o,i);if(i===!0)return Gd(e,[{start:r,end:a,loop:o}],n,t);let l=a<r?a+s:a,c=!!e._fullLoop&&r===0&&a===s-1;return Gd(e,ax(n,r,l,c),n,t)}function Gd(e,t,n,i){return!i||!i.setContext||!n?t:lx(e,t,n,i)}function lx(e,t,n,i){let s=e._chart.getContext(),o=Yd(e.options),{_datasetIndex:r,options:{spanGaps:a}}=e,l=n.length,c=[],u=o,d=t[0].start,f=d;function p(b,x,y,w){let _=a?-1:1;if(b!==x){for(b+=l;n[b%l].skip;)b-=_;for(;n[x%l].skip;)x+=_;b%l!==x%l&&(c.push({start:b%l,end:x%l,loop:y,style:w}),u=w,d=x%l)}}for(let b of t){d=a?d:b.start;let x=n[d%l],y;for(f=d+1;f<=b.end;f++){let w=n[f%l];y=Yd(i.setContext(Re(s,{type:"segment",p0:x,p1:w,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:r}))),cx(y,u)&&p(d,f-1,b.loop,u),x=w,u=y}d<f-1&&p(d,f-1,b.loop,u)}return c}function Yd(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function cx(e,t){if(!t)return!1;let 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 zo(e,t,n){return e.options.clip?e[n]:t[n]}function ux(e,t){let{xScale:n,yScale:i}=e;return n&&i?{left:zo(n,t,"left"),right:zo(n,t,"right"),top:zo(i,t,"top"),bottom:zo(i,t,"bottom")}:t}function kl(e,t){let n=t._clip;if(n.disabled)return!1;let i=ux(t,e.chartArea);return{left:n.left===!1?0:i.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:i.right+(n.right===!0?0:n.right),top:n.top===!1?0:i.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:i.bottom+(n.bottom===!0?0:n.bottom)}}var Ya,Ka,Fd,_i,Pe,Ho,ft,Ht,Jd,hs,Qd,Dt,xn,Ua,De,me,Qe,tl,ef,Go,Ko,Ot,ol,No,Hd,Bd,Wn,Tb,Cb,Wd,nf,ys,wn,Zo,Ga,it,zb,Vb,Fb,Hb,hl,$b,Xb,yi,cf,nr,Qb,tx,yn,bl,ix,sx,Sl=M(()=>{Vd();Ya=(()=>{let e=0;return()=>e++})();Ka=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;Fd={"":e=>e,x:e=>e.x,y:e=>e.y};_i=e=>typeof e<"u",Pe=e=>typeof e=="function",Ho=(e,t)=>{if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0};ft=Math.PI,Ht=2*ft,Jd=Ht+ft,hs=Number.POSITIVE_INFINITY,Qd=ft/180,Dt=ft/2,xn=ft/4,Ua=ft*2/3,De=Math.log10,me=Math.sign;Qe=(e,t,n,i)=>bs(e,n,i?s=>{let o=e[s][t];return o<n||o===n&&e[s+1][t]===n}:s=>e[s][t]<n),tl=(e,t,n)=>bs(e,n,i=>e[i][t]>=n);ef=["push","pop","shift","splice","unshift"];Go=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();Ko=e=>e==="start"?"left":e==="end"?"right":"center",Ot=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,ol=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;No=e=>e===0||e===1,Hd=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Ht/n)),Bd=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Ht/n)+1,Wn={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*Dt)+1,easeOutSine:e=>Math.sin(e*Dt),easeInOutSine:e=>-.5*(Math.cos(ft*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>No(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=>No(e)?e:Hd(e,.075,.3),easeOutElastic:e=>No(e)?e:Bd(e,.075,.3),easeInOutElastic(e){return No(e)?e:e<.5?.5*Hd(e*2,.1125,.45):.5+.5*Bd(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Wn.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Wn.easeInBounce(e*2)*.5:Wn.easeOutBounce(e*2-1)*.5+.5};Tb=["x","y","borderWidth","radius","tension"],Cb=["color","borderColor","backgroundColor"];Wd=new Map;nf={values(e){return et(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";let i=this.chart.options.locale,s,o=e;if(n.length>1){let c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=Ob(e,n)}let r=De(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),xs(e,i,l)},logarithmic(e,t,n){if(e===0)return"0";let i=n[t].significand||e/Math.pow(10,Math.floor(De(e)));return[1,2,3,5,10,15].includes(i)||t>.8*n.length?nf.numeric.call(this,e,t,n):""}};ys={formatters:nf};wn=Object.create(null),Zo=Object.create(null);Ga=class{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,s)=>Vo(s.backgroundColor),this.hoverBorderColor=(i,s)=>Vo(s.borderColor),this.hoverColor=(i,s)=>Vo(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 $a(this,t,n)}get(t){return ds(this,t)}describe(t,n){return $a(Zo,t,n)}override(t,n){return $a(wn,t,n)}route(t,n,i,s){let o=ds(this,t),r=ds(this,i),a="_"+n;Object.defineProperties(o,{[a]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){let l=this[a],c=r[s];return Y(l)?Object.assign({},c,l):W(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}},it=new Ga({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Pb,Db,Rb]);zb=/^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/,Vb=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;Fb=e=>+e||0;Hb=(e,t)=>e?e+gs(t):t,hl=(e,t)=>Y(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);$b=(e,t)=>e===!0?t:typeof e=="string"?wi(t,e):void 0;Xb=Number.EPSILON||1e-14,yi=(e,t)=>t<e.length&&!e[t].skip&&e[t],cf=e=>e==="x"?"y":"x";nr=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);Qb=["top","right","bottom","left"];tx=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);yn=e=>Math.round(e*10)/10;bl=(function(){let e=!1;try{let t={get passive(){return e=!0,!1}};Ss()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();ix=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}}},sx=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}}});function px(e,t){let n=[],i=Object.keys(t);for(let s=0;s<i.length;s++){let o=e[i[s]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function gx(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 gf(e,t){let n=e&&e.options||{},i=n.reverse,s=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:i?o:s,end:i?s:o}}function mx(e,t,n){if(n===!1)return!1;let i=gf(e,n),s=gf(t,n);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function bx(e){let t,n,i,s;return Y(e)?(t=e.top,n=e.right,i=e.bottom,s=e.left):t=n=i=s=e,{top:t,right:n,bottom:i,left:s,disabled:e===!1}}function nh(e,t){let n=[],i=e._getSortedDatasetMetas(t),s,o;for(s=0,o=i.length;s<o;++s)n.push(i[s].index);return n}function mf(e,t,n,i={}){let s=e.keys,o=i.mode==="single",r,a,l,c;if(t===null)return;let u=!1;for(r=0,a=s.length;r<a;++r){if(l=+s[r],l===n){if(u=!0,i.all)continue;break}c=e.values[l],ht(c)&&(o||t===0||me(t)===me(c))&&(t+=c)}return!u&&!i.all?0:t}function xx(e,t){let{iScale:n,vScale:i}=t,s=n.axis==="x"?"x":"y",o=i.axis==="x"?"x":"y",r=Object.keys(e),a=new Array(r.length),l,c,u;for(l=0,c=r.length;l<c;++l)u=r[l],a[l]={[s]:u,[o]:e[u]};return a}function El(e,t){let n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function yx(e,t,n){return\`\${e.id}.\${t.id}.\${n.stack||n.type}\`}function vx(e){let{min:t,max:n,minDefined:i,maxDefined:s}=e.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?n:Number.POSITIVE_INFINITY}}function wx(e,t,n){let i=e[t]||(e[t]={});return i[n]||(i[n]={})}function bf(e,t,n,i){for(let s of t.getMatchingVisibleMetas(i).reverse()){let o=e[s.index];if(n&&o>0||!n&&o<0)return s.index}return null}function xf(e,t){let{chart:n,_cachedMeta:i}=e,s=n._stacks||(n._stacks={}),{iScale:o,vScale:r,index:a}=i,l=o.axis,c=r.axis,u=yx(o,r,i),d=t.length,f;for(let p=0;p<d;++p){let b=t[p],{[l]:x,[c]:y}=b,w=b._stacks||(b._stacks={});f=w[c]=wx(s,u,x),f[a]=y,f._top=bf(f,r,!0,i.type),f._bottom=bf(f,r,!1,i.type);let _=f._visualValues||(f._visualValues={});_[a]=y}}function Ml(e,t){let n=e.scales;return Object.keys(n).filter(i=>n[i].axis===t).shift()}function _x(e,t){return Re(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function kx(e,t,n){return Re(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Ms(e,t){let n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(let s of t){let o=s._stacks;if(!o||o[i]===void 0||o[i][n]===void 0)return;delete o[i][n],o[i]._visualValues!==void 0&&o[i]._visualValues[n]!==void 0&&delete o[i]._visualValues[n]}}}function Kn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}function Mx(e,t,n,i){let{controller:s,data:o,_sorted:r}=e,a=s._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&r&&o.length){let c=a._reversePixels?tl:Qe;if(i){if(s._sharedOptions){let u=o[0],d=typeof u.getRange=="function"&&u.getRange(t);if(d){let f=c(o,t,n-d),p=c(o,t,n+d);return{lo:f.lo,hi:p.hi}}}}else{let u=c(o,t,n);if(l){let{vScale:d}=s._cachedMeta,{_parsed:f}=e,p=f.slice(0,u.lo+1).reverse().findIndex(x=>!X(x[d.axis]));u.lo-=Math.max(0,p);let b=f.slice(u.hi).findIndex(x=>!X(x[d.axis]));u.hi+=Math.max(0,b)}return u}}return{lo:0,hi:o.length-1}}function Ls(e,t,n,i,s){let o=e.getSortedVisibleDatasetMetas(),r=n[t];for(let a=0,l=o.length;a<l;++a){let{index:c,data:u}=o[a],{lo:d,hi:f}=Mx(o[a],t,r,s);for(let p=d;p<=f;++p){let b=u[p];b.skip||i(b,c,p)}}}function Tx(e){let t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(i,s){let o=t?Math.abs(i.x-s.x):0,r=n?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function Cl(e,t,n,i,s){let o=[];return!s&&!e.isPointInArea(t)||Ls(e,n,t,function(a,l,c){!s&&!qt(a,e.chartArea,0)||a.inRange(t.x,t.y,i)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function Cx(e,t,n,i){let s=[];function o(r,a,l){let{startAngle:c,endAngle:u}=r.getProps(["startAngle","endAngle"],i),{angle:d}=Ja(r,{x:t.x,y:t.y});$o(d,c,u)&&s.push({element:r,datasetIndex:a,index:l})}return Ls(e,n,t,o),s}function Px(e,t,n,i,s,o){let r=[],a=Tx(n),l=Number.POSITIVE_INFINITY;function c(u,d,f){let p=u.inRange(t.x,t.y,s);if(i&&!p)return;let b=u.getCenterPoint(s);if(!(!!o||e.isPointInArea(b))&&!p)return;let y=a(t,b);y<l?(r=[{element:u,datasetIndex:d,index:f}],l=y):y===l&&r.push({element:u,datasetIndex:d,index:f})}return Ls(e,n,t,c),r}function Pl(e,t,n,i,s,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!i?Cx(e,t,n,s):Px(e,t,n,i,s,o)}function vf(e,t,n,i,s){let o=[],r=n==="x"?"inXRange":"inYRange",a=!1;return Ls(e,n,t,(l,c,u)=>{l[r]&&l[r](t[n],s)&&(o.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:o}function Ts(e,t){return e.filter(n=>n.pos===t)}function wf(e,t){return e.filter(n=>ih.indexOf(n.pos)===-1&&n.box.axis===t)}function Cs(e,t){return e.sort((n,i)=>{let s=t?i:n,o=t?n:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function Ax(e){let t=[],n,i,s,o,r,a;for(n=0,i=(e||[]).length;n<i;++n)s=e[n],{position:o,options:{stack:r,stackWeight:a=1}}=s,t.push({index:n,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:r&&o+r,stackWeight:a});return t}function Ox(e){let t={};for(let n of e){let{stack:i,pos:s,stackWeight:o}=n;if(!i||!ih.includes(s))continue;let r=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function Rx(e,t){let n=Ox(e),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t,o,r,a;for(o=0,r=e.length;o<r;++o){a=e[o];let{fullSize:l}=a.box,c=n[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*i:l&&t.availableWidth,a.height=s):(a.width=i,a.height=u?u*s:l&&t.availableHeight)}return n}function Ix(e){let t=Ax(e),n=Cs(t.filter(c=>c.box.fullSize),!0),i=Cs(Ts(t,"left"),!0),s=Cs(Ts(t,"right")),o=Cs(Ts(t,"top"),!0),r=Cs(Ts(t,"bottom")),a=wf(t,"x"),l=wf(t,"y");return{fullSize:n,leftAndTop:i.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:Ts(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function _f(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function sh(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 Nx(e,t,n,i){let{pos:s,box:o}=n,r=e.maxPadding;if(!Y(s)){n.size&&(e[s]-=n.size);let d=i[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?o.height:o.width),n.size=d.size/d.count,e[s]+=n.size}o.getPadding&&sh(r,o.getPadding());let a=Math.max(0,t.outerWidth-_f(r,e,"left","right")),l=Math.max(0,t.outerHeight-_f(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 Lx(e){let t=e.maxPadding;function n(i){let s=Math.max(t[i]-e[i],0);return e[i]+=s,s}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function zx(e,t){let n=t.maxPadding;function i(s){let o={left:0,top:0,right:0,bottom:0};return s.forEach(r=>{o[r]=Math.max(t[r],n[r])}),o}return i(e?["left","right"]:["top","bottom"])}function As(e,t,n,i){let s=[],o,r,a,l,c,u;for(o=0,r=e.length,c=0;o<r;++o){a=e[o],l=a.box,l.update(a.width||t.w,a.height||t.h,zx(a.horizontal,t));let{same:d,other:f}=Nx(t,n,a,i);c|=d&&s.length,u=u||f,l.fullSize||s.push(a)}return c&&As(s,t,n,i)||u}function ar(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 kf(e,t,n,i){let s=n.padding,{x:o,y:r}=t;for(let a of e){let l=a.box,c=i[a.stack]||{count:1,placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){let d=t.w*u,f=c.size||l.height;_i(c.start)&&(r=c.start),l.fullSize?ar(l,s.left,r,n.outerWidth-s.right-s.left,f):ar(l,t.left+c.placed,r,d,f),c.start=r,c.placed+=d,r=l.bottom}else{let d=t.h*u,f=c.size||l.width;_i(c.start)&&(o=c.start),l.fullSize?ar(l,o,s.top,f,n.outerHeight-s.bottom-s.top):ar(l,o,t.top+c.placed,f,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=r}function Fx(e,t){let n=e.style,i=e.getAttribute("height"),s=e.getAttribute("width");if(e[pr]={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",Sf(s)){let o=sr(e,"width");o!==void 0&&(e.width=o)}if(Sf(i))if(e.style.height==="")e.height=e.width/(t||2);else{let o=sr(e,"height");o!==void 0&&(e.height=o)}return e}function Hx(e,t,n){e&&e.addEventListener(t,n,oh)}function Bx(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,oh)}function Wx(e,t){let n=Vx[e.type]||e.type,{x:i,y:s}=Zt(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:s!==void 0?s:null}}function xr(e,t){for(let n of e)if(n===t||n.contains(t))return!0}function jx(e,t,n){let i=e.canvas,s=new MutationObserver(o=>{let r=!1;for(let a of o)r=r||xr(a.addedNodes,i),r=r&&!xr(a.removedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function $x(e,t,n){let i=e.canvas,s=new MutationObserver(o=>{let r=!1;for(let a of o)r=r||xr(a.removedNodes,i),r=r&&!xr(a.addedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function rh(){let e=window.devicePixelRatio;e!==Ef&&(Ef=e,Is.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function Ux(e,t){Is.size||window.addEventListener("resize",rh),Is.set(e,t)}function Gx(e){Is.delete(e),Is.size||window.removeEventListener("resize",rh)}function Yx(e,t,n){let i=e.canvas,s=i&&Es(i);if(!s)return;let o=Yo((a,l)=>{let c=s.clientWidth;n(a,l),c<s.clientWidth&&n()},window),r=new ResizeObserver(a=>{let l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||o(c,u)});return r.observe(s),Ux(e,o),r}function Dl(e,t,n){n&&n.disconnect(),t==="resize"&&Gx(e)}function Kx(e,t,n){let i=e.canvas,s=Yo(o=>{e.ctx!==null&&n(Wx(o,e))},e);return Hx(i,t,s),s}function Xx(e){return!Ss()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Il:Nl}function qx(e,t){let n=e.options.ticks,i=Zx(e),s=Math.min(n.maxTicksLimit||i,i),o=n.major.enabled?Qx(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return t0(t,c,o,r/s),c;let u=Jx(o,t,s);if(r>0){let d,f,p=r>1?Math.round((l-a)/(r-1)):null;for(lr(t,c,u,X(p)?0:a-p,a),d=0,f=r-1;d<f;d++)lr(t,c,u,o[d],o[d+1]);return lr(t,c,u,l,X(p)?t.length:l+p),c}return lr(t,c,u),c}function Zx(e){let t=e.options.offset,n=e._tickSize(),i=e._length/n+(t?0:1),s=e._maxLength/n;return Math.floor(Math.min(i,s))}function Jx(e,t,n){let i=e0(e),s=t.length/n;if(!i)return Math.max(s,1);let o=qa(i);for(let r=0,a=o.length-1;r<a;r++){let l=o[r];if(l>s)return l}return Math.max(s,1)}function Qx(e){let t=[],n,i;for(n=0,i=e.length;n<i;n++)e[n].major&&t.push(n);return t}function t0(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 lr(e,t,n,i,s){let o=W(i,0),r=Math.min(W(s,e.length),e.length),a=0,l,c,u;for(n=Math.ceil(n),s&&(l=s-i,n=l/Math.floor(l/n)),u=o;u<0;)a++,u=Math.round(o+a*n);for(c=Math.max(o,0);c<r;c++)c===u&&(t.push(e[c]),a++,u=Math.round(o+a*n))}function e0(e){let t=e.length,n,i;if(t<2)return!1;for(i=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==i)return!1;return i}function Cf(e,t){let n=[],i=e.length/t,s=e.length,o=0;for(;o<s;o+=i)n.push(e[Math.floor(o)]);return n}function i0(e,t,n){let i=e.ticks.length,s=Math.min(t,i-1),o=e._startPixel,r=e._endPixel,a=1e-6,l=e.getPixelForTick(s),c;if(!(n&&(i===1?c=Math.max(l-o,r-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-a||l>r+a)))return l}function s0(e,t){$(e,n=>{let i=n.gc,s=i.length/2,o;if(s>t){for(o=0;o<s;++o)delete n.data[i[o]];i.splice(0,s)}})}function Ps(e){return e.drawTicks?e.tickLength:0}function Pf(e,t){if(!e.display)return 0;let n=gt(e.font,t),i=kt(e.padding);return(et(e.text)?e.text.length:1)*n.lineHeight+i.height}function o0(e,t){return Re(e,{scale:t,type:"scale"})}function r0(e,t,n){return Re(e,{tick:n,index:t,type:"tick"})}function a0(e,t,n){let i=Ko(e);return(n&&t!=="right"||!n&&t==="right")&&(i=n0(i)),i}function l0(e,t,n,i){let{top:s,left:o,bottom:r,right:a,chart:l}=e,{chartArea:c,scales:u}=l,d=0,f,p,b,x=r-s,y=a-o;if(e.isHorizontal()){if(p=Ot(i,o,a),Y(n)){let w=Object.keys(n)[0],_=n[w];b=u[w].getPixelForValue(_)+x-t}else n==="center"?b=(c.bottom+c.top)/2+x-t:b=Mf(e,n,t);f=a-o}else{if(Y(n)){let w=Object.keys(n)[0],_=n[w];p=u[w].getPixelForValue(_)-y+t}else n==="center"?p=(c.left+c.right)/2-y+t:p=Mf(e,n,t);b=Ot(i,r,s),d=n==="left"?-Dt:Dt}return{titleX:p,titleY:b,maxWidth:f,rotation:d}}function c0(e,t,n){let i=$n(Object.create(null),[n?it.get(n):{},it.get(t),e.defaults]);it.set(t,i),e.defaultRoutes&&u0(t,e.defaultRoutes),e.descriptors&&it.describe(t,e.descriptors)}function u0(e,t){Object.keys(t).forEach(n=>{let i=n.split("."),s=i.pop(),o=[e].concat(i).join("."),r=t[n].split("."),a=r.pop(),l=r.join(".");it.route(o,s,l,a)})}function d0(e){return"id"in e&&"defaults"in e}function f0(e){let t={},n=[],i=Object.keys(Ne.plugins.items);for(let o=0;o<i.length;o++)n.push(Ne.getPlugin(i[o]));let s=e.plugins||[];for(let o=0;o<s.length;o++){let r=s[o];n.indexOf(r)===-1&&(n.push(r),t[r.id]=!0)}return{plugins:n,localIds:t}}function h0(e,t){return!t&&e===!1?null:e===!0?{}:e}function p0(e,{plugins:t,localIds:n},i,s){let o=[],r=e.getContext();for(let a of t){let l=a.id,c=h0(i[l],s);c!==null&&o.push({plugin:a,options:g0(e.config,{plugin:a,local:n[l]},c,r)})}return o}function g0(e,{plugin:t,local:n},i,s){let o=e.pluginScopeKeys(t),r=e.getOptionScopes(i,o);return n&&t.defaults&&r.push(t.defaults),e.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Vl(e,t){let n=it.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function m0(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function b0(e,t){return e===t?"_index_":"_value_"}function Df(e){if(e==="x"||e==="y"||e==="r")return e}function x0(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Fl(e,...t){if(Df(e))return e;for(let n of t){let i=n.axis||x0(n.position)||e.length>1&&Df(e[0].toLowerCase());if(i)return i}throw new Error(\`Cannot determine type of '\${e}' axis. Please provide 'axis' or 'position' option.\`)}function Af(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function y0(e,t){if(t.data&&t.data.datasets){let n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return Af(e,"x",n[0])||Af(e,"y",n[0])}return{}}function v0(e,t){let n=wn[e.type]||{scales:{}},i=t.scales||{},s=Vl(e.type,t),o=Object.create(null);return Object.keys(i).forEach(r=>{let a=i[r];if(!Y(a))return console.error(\`Invalid scale configuration for scale: \${r}\`);if(a._proxy)return console.warn(\`Ignoring resolver passed as options for scale: \${r}\`);let l=Fl(r,a,y0(r,e),it.scales[a.type]),c=b0(l,s),u=n.scales||{};o[r]=Un(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(r=>{let a=r.type||e.type,l=r.indexAxis||Vl(a,t),u=(wn[a]||{}).scales||{};Object.keys(u).forEach(d=>{let f=m0(d,l),p=r[f+"AxisID"]||f;o[p]=o[p]||Object.create(null),Un(o[p],[{axis:f},i[p],u[d]])})}),Object.keys(o).forEach(r=>{let a=o[r];Un(a,[it.scales[a.type],it.scale])}),o}function ah(e){let t=e.options||(e.options={});t.plugins=W(t.plugins,{}),t.scales=v0(e,t)}function lh(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function w0(e){return e=e||{},e.data=lh(e.data),ah(e),e}function cr(e,t){let n=Of.get(e);return n||(n=t(),Of.set(e,n),ch.add(n)),n}function Rf(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));let s=n.join(),o=i.get(s);return o||(o={resolver:ks(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,o)),o}function k0(e,t){let{isScriptable:n,isIndexable:i}=er(e);for(let s of t){let o=n(s),r=i(s),a=(r||o)&&e[s];if(o&&(Pe(a)||_0(a))||r&&et(a))return!0}return!1}function If(e,t){return e==="top"||e==="bottom"||E0.indexOf(e)===-1&&t==="x"}function Nf(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function Lf(e){let t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),z(n&&n.onComplete,[e],t)}function M0(e){let t=e.chart,n=t.options.animation;z(n&&n.onProgress,[e],t)}function uh(e){return Ss()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}function T0(e,t,n){let i=Object.keys(e);for(let s of i){let o=+s;if(o>=t){let r=e[s];delete e[s],(n>0||o>t)&&(e[o+n]=r)}}}function C0(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}function Vf(){return $(re.instances,e=>e._plugins.invalidate())}function dh(e,t,n=t){e.lineCap=W(n.borderCapStyle,t.borderCapStyle),e.setLineDash(W(n.borderDash,t.borderDash)),e.lineDashOffset=W(n.borderDashOffset,t.borderDashOffset),e.lineJoin=W(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=W(n.borderWidth,t.borderWidth),e.strokeStyle=W(n.borderColor,t.borderColor)}function P0(e,t,n){e.lineTo(n.x,n.y)}function D0(e){return e.stepped?cl:e.tension||e.cubicInterpolationMode==="monotone"?ul:P0}function fh(e,t,n={}){let i=e.length,{start:s=0,end:o=i-1}=n,{start:r,end:a}=t,l=Math.max(s,r),c=Math.min(o,a),u=s<r&&o<r||s>a&&o>a;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function A0(e,t,n,i){let{points:s,options:o}=t,{count:r,start:a,loop:l,ilen:c}=fh(s,n,i),u=D0(o),{move:d=!0,reverse:f}=i||{},p,b,x;for(p=0;p<=c;++p)b=s[(a+(f?c-p:p))%r],!b.skip&&(d?(e.moveTo(b.x,b.y),d=!1):u(e,x,b,f,o.stepped),x=b);return l&&(b=s[(a+(f?c:0))%r],u(e,x,b,f,o.stepped)),!!l}function O0(e,t,n,i){let s=t.points,{count:o,start:r,ilen:a}=fh(s,n,i),{move:l=!0,reverse:c}=i||{},u=0,d=0,f,p,b,x,y,w,_=T=>(r+(c?a-T:T))%o,S=()=>{x!==y&&(e.lineTo(u,y),e.lineTo(u,x),e.lineTo(u,w))};for(l&&(p=s[_(0)],e.moveTo(p.x,p.y)),f=0;f<=a;++f){if(p=s[_(f)],p.skip)continue;let T=p.x,E=p.y,D=T|0;D===b?(E<x?x=E:E>y&&(y=E),u=(d*u+T)/++d):(S(),e.lineTo(T,E),b=D,d=0,x=y=E),w=E}S()}function Bl(e){let t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?O0:A0}function R0(e){return e.stepped?xl:e.tension||e.cubicInterpolationMode==="monotone"?yl:Je}function I0(e,t,n,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,i)&&s.closePath()),dh(e,t.options),e.stroke(s)}function N0(e,t,n,i){let{segments:s,options:o}=t,r=Bl(t);for(let a of s)dh(e,o,a.style),e.beginPath(),r(e,t,a,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}function z0(e,t,n,i){L0&&!t.options.segment?I0(e,t,n,i):N0(e,t,n,i)}function Ff(e,t,n,i){let s=e.options,{[n]:o}=e.getProps([n],i);return Math.abs(t-o)<s.radius+s.hitRadius}function F0(e,t,n,i,s){let o=H0(i,e,t,n),r=B0(s,i,t.lineHeight);return{itemWidth:o,itemHeight:r}}function H0(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 B0(e,t,n){let i=e;return typeof t.text!="string"&&(i=hh(t,n)),i}function hh(e,t){let n=e.text?e.text.length:0;return t*n}function W0(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}function Ie(e,t){return t&&(et(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function nn(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(\`
5417
+ \`)>-1?e.split(\`
5418
+ \`):e}function j0(e,t){let{element:n,datasetIndex:i,index:s}=t,o=e.getDatasetMeta(i).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:e,label:r,parsed:o.getParsed(s),raw:e.data.datasets[i].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:i,element:n}}function Bf(e,t){let n=e.chart.ctx,{body:i,footer:s,title:o}=e,{boxWidth:r,boxHeight:a}=t,l=gt(t.bodyFont),c=gt(t.titleFont),u=gt(t.footerFont),d=o.length,f=s.length,p=i.length,b=kt(t.padding),x=b.height,y=0,w=i.reduce((T,E)=>T+E.before.length+E.lines.length+E.after.length,0);if(w+=e.beforeBody.length+e.afterBody.length,d&&(x+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),w){let T=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;x+=p*T+(w-p)*l.lineHeight+(w-1)*t.bodySpacing}f&&(x+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let _=0,S=function(T){y=Math.max(y,n.measureText(T).width+_)};return n.save(),n.font=c.string,$(e.title,S),n.font=l.string,$(e.beforeBody.concat(e.afterBody),S),_=t.displayColors?r+2+t.boxPadding:0,$(i,T=>{$(T.before,S),$(T.lines,S),$(T.after,S)}),_=0,n.font=u.string,$(e.footer,S),n.restore(),y+=b.width,{width:y,height:x}}function $0(e,t){let{y:n,height:i}=t;return n<i/2?"top":n>e.height-i/2?"bottom":"center"}function U0(e,t,n,i){let{x:s,width:o}=i,r=n.caretSize+n.caretPadding;if(e==="left"&&s+o+r>t.width||e==="right"&&s-o-r<0)return!0}function G0(e,t,n,i){let{x:s,width:o}=n,{width:r,chartArea:{left:a,right:l}}=e,c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),U0(c,e,t,n)&&(c="center"),c}function Wf(e,t,n){let i=n.yAlign||t.yAlign||$0(e,n);return{xAlign:n.xAlign||t.xAlign||G0(e,t,n,i),yAlign:i}}function Y0(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function K0(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function jf(e,t,n,i){let{caretSize:s,caretPadding:o,cornerRadius:r}=e,{xAlign:a,yAlign:l}=n,c=s+o,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=kn(r),b=Y0(t,a),x=K0(t,l,c);return l==="center"?a==="left"?b+=c:a==="right"&&(b-=c):a==="left"?b-=Math.max(u,f)+s:a==="right"&&(b+=Math.max(d,p)+s),{x:Bt(b,0,i.width-t.width),y:Bt(x,0,i.height-t.height)}}function ur(e,t,n){let i=kt(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function $f(e){return Ie([],nn(e))}function X0(e,t,n){return Re(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function Uf(e,t){let n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}function Wt(e,t,n,i){let s=e[t].call(n,i);return typeof s>"u"?gh[t].call(n,i):s}function Z0(e,t,n,i){let s=e.indexOf(t);if(s===-1)return q0(e,t,n,i);let o=e.lastIndexOf(t);return s!==o?n:s}function Gf(e){let t=this.getLabels();return e>=0&&e<t.length?t[e]:e}function Q0(e,t){let n=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=e,p=o||1,b=u-1,{min:x,max:y}=t,w=!X(r),_=!X(a),S=!X(c),T=(y-x)/(d+1),E=Bo((y-x)/b/p)*p,D,O,A,N;if(E<1e-14&&!w&&!_)return[{value:x},{value:y}];N=Math.ceil(y/E)-Math.floor(x/E),N>b&&(E=Bo(N*E/b/p)*p),X(l)||(D=Math.pow(10,l),E=Math.ceil(E*D)/D),s==="ticks"?(O=Math.floor(x/E)*E,A=Math.ceil(y/E)*E):(O=x,A=y),w&&_&&o&&Za((a-r)/o,E/1e3)?(N=Math.round(Math.min((a-r)/E,u)),E=(a-r)/N,O=r,A=a):S?(O=w?r:O,A=_?a:A,N=c-1,E=(A-O)/N):(N=(A-O)/E,Ae(N,Math.round(N),E/1e3)?N=Math.round(N):N=Math.ceil(N));let j=Math.max(jo(E),jo(O));D=Math.pow(10,X(l)?j:l),O=Math.round(O*D)/D,A=Math.round(A*D)/D;let H=0;for(w&&(f&&O!==r?(n.push({value:r}),O<r&&H++,Ae(Math.round((O+H*E)*D)/D,r,Yf(r,T,e))&&H++):O<r&&H++);H<N;++H){let G=Math.round((O+H*E)*D)/D;if(_&&G>a)break;n.push({value:G})}return _&&f&&A!==a?n.length&&Ae(n[n.length-1].value,a,Yf(a,T,e))?n[n.length-1].value=a:n.push({value:a}):(!_||A===a)&&n.push({value:A}),n}function Yf(e,t,{horizontal:n,minRotation:i}){let s=Oe(i),o=(n?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+e).length;return Math.min(t/o,r)}function Kf(e){return e/Math.pow(10,Ns(e))===1}function Xf(e,t,n){let i=Math.pow(10,n),s=Math.floor(e/i);return Math.ceil(t/i)-s}function ty(e,t){let n=t-e,i=Ns(n);for(;Xf(e,t,i)>10;)i++;for(;Xf(e,t,i)<10;)i--;return Math.min(i,Ns(e))}function ey(e,{min:t,max:n}){t=At(e.min,t);let i=[],s=Ns(t),o=ty(t,n),r=o<0?Math.pow(10,Math.abs(o)):1,a=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((t-l)*r)/r,u=Math.floor((t-l)/a/10)*a*10,d=Math.floor((c-u)/Math.pow(10,o)),f=At(e.min,Math.round((l+u+d*Math.pow(10,o))*r)/r);for(;f<n;)i.push({value:f,major:Kf(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,r=o>=0?1:r),f=Math.round((l+u+d*Math.pow(10,o))*r)/r;let p=At(e.max,f);return i.push({value:p,major:Kf(p),significand:d}),i}function Wl(e){let t=e.ticks;if(t.display&&e.display){let n=kt(t.backdropPadding);return W(t.font&&t.font.size,it.font.size)+n.height}return 0}function ny(e,t,n){return n=et(n)?n:[n],{w:ll(e,t.string,n),h:n.length*t.lineHeight}}function qf(e,t,n,i,s){return e===i||e===s?{start:t-n/2,end:t+n/2}:e<i||e>s?{start:t-n,end:t}:{start:t,end:t+n}}function iy(e){let t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),i=[],s=[],o=e._pointLabels.length,r=e.options.pointLabels,a=r.centerPointLabels?ft/o:0;for(let l=0;l<o;l++){let c=r.setContext(e.getPointLabelContext(l));s[l]=c.padding;let u=e.getPointPosition(l,e.drawingArea+s[l],a),d=gt(c.font),f=ny(e.ctx,d,e._pointLabels[l]);i[l]=f;let p=Xt(e.getIndexAngle(l)+a),b=Math.round(ms(p)),x=qf(b,u.x,f.w,0,180),y=qf(b,u.y,f.h,90,270);sy(n,t,p,x,y)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=ay(e,i,s)}function sy(e,t,n,i,s){let o=Math.abs(Math.sin(n)),r=Math.abs(Math.cos(n)),a=0,l=0;i.start<t.l?(a=(t.l-i.start)/o,e.l=Math.min(e.l,t.l-a)):i.end>t.r&&(a=(i.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/r,e.t=Math.min(e.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/r,e.b=Math.max(e.b,t.b+l))}function oy(e,t,n){let i=e.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=n,l=e.getPointPosition(t,i+s+r,o),c=Math.round(ms(Xt(l.angle+Dt))),u=uy(l.y,a.h,c),d=ly(c),f=cy(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:f,top:u,right:f+a.w,bottom:u+a.h}}function ry(e,t){if(!t)return!0;let{left:n,top:i,right:s,bottom:o}=e;return!(qt({x:n,y:i},t)||qt({x:n,y:o},t)||qt({x:s,y:i},t)||qt({x:s,y:o},t))}function ay(e,t,n){let i=[],s=e._pointLabels.length,o=e.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:Wl(o)/2,additionalAngle:r?ft/s:0},c;for(let u=0;u<s;u++){l.padding=n[u],l.size=t[u];let d=oy(e,u,l);i.push(d),a==="auto"&&(d.visible=ry(d,c),d.visible&&(c=d))}return i}function ly(e){return e===0||e===180?"center":e<180?"left":"right"}function cy(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function uy(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function dy(e,t,n){let{left:i,top:s,right:o,bottom:r}=n,{backdropColor:a}=t;if(!X(a)){let l=kn(t.borderRadius),c=kt(t.backdropPadding);e.fillStyle=a;let u=i-c.left,d=s-c.top,f=o-i+c.width,p=r-s+c.height;Object.values(l).some(b=>b!==0)?(e.beginPath(),ki(e,{x:u,y:d,w:f,h:p,radius:l}),e.fill()):e.fillRect(u,d,f,p)}}function fy(e,t){let{ctx:n,options:{pointLabels:i}}=e;for(let s=t-1;s>=0;s--){let o=e._pointLabelItems[s];if(!o.visible)continue;let r=i.setContext(e.getPointLabelContext(s));dy(n,r,o);let a=gt(r.font),{x:l,y:c,textAlign:u}=o;_n(n,e._pointLabels[s],l,c+a.lineHeight/2,a,{color:r.color,textAlign:u,textBaseline:"middle"})}}function bh(e,t,n,i){let{ctx:s}=e;if(n)s.arc(e.xCenter,e.yCenter,t,0,Ht);else{let o=e.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let r=1;r<i;r++)o=e.getPointPosition(r,t),s.lineTo(o.x,o.y)}}function hy(e,t,n,i,s){let o=e.ctx,r=t.circular,{color:a,lineWidth:l}=t;!r&&!i||!a||!l||n<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),bh(e,n,r,i),o.closePath(),o.stroke(),o.restore())}function py(e,t,n){return Re(e,{label:n,index:t,type:"pointLabel"})}function Zf(e,t){return e-t}function Jf(e,t){if(X(t))return null;let n=e._adapter,{parser:i,round:s,isoWeekday:o}=e._parseOpts,r=t;return typeof i=="function"&&(r=i(r)),ht(r)||(r=typeof i=="string"?n.parse(r,i):n.parse(r)),r===null?null:(s&&(r=s==="week"&&(Gn(o)||o===!0)?n.startOf(r,"isoWeek",o):n.startOf(r,s)),+r)}function Qf(e,t,n,i){let s=jt.length;for(let o=jt.indexOf(e);o<s-1;++o){let r=vr[jt[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((n-t)/(a*r.size))<=i)return jt[o]}return jt[s-1]}function gy(e,t,n,i,s){for(let o=jt.length-1;o>=jt.indexOf(n);o--){let r=jt[o];if(vr[r].common&&e._adapter.diff(s,i,r)>=t-1)return r}return jt[n?jt.indexOf(n):0]}function my(e){for(let t=jt.indexOf(e)+1,n=jt.length;t<n;++t)if(vr[jt[t]].common)return jt[t]}function th(e,t,n){if(!n)e[t]=!0;else if(n.length){let{lo:i,hi:s}=bs(n,t),o=n[i]>=t?n[i]:n[s];e[o]=!0}}function by(e,t,n,i){let s=e._adapter,o=+s.startOf(t[0].value,i),r=t[t.length-1].value,a,l;for(a=o;a<=r;a=+s.add(a,1,i))l=n[a],l>=0&&(t[l].major=!0);return t}function eh(e,t,n){let i=[],s={},o=t.length,r,a;for(r=0;r<o;++r)a=t[r],s[a]=r,i.push({value:a,major:!1});return o===0||!n?i:by(e,i,s,n)}function fr(e,t,n){let i=0,s=e.length-1,o,r,a,l;n?(t>=e[i].pos&&t<=e[s].pos&&({lo:i,hi:s}=Qe(e,"pos",t)),{pos:o,time:a}=e[i],{pos:r,time:l}=e[s]):(t>=e[i].time&&t<=e[s].time&&({lo:i,hi:s}=Qe(e,"time",t)),{time:o,pos:a}=e[i],{time:r,pos:l}=e[s]);let c=r-o;return c?a+(l-a)*(t-o)/c:a}var Al,en,pf,hx,Ol,mr,Tl,yf,Sx,qn,Zn,Rl,Ex,Dx,ih,Mn,br,Il,pr,Vx,Sf,oh,Is,Ef,Nl,Le,n0,Mf,Tf,Qn,Mi,Ll,Ne,zl,Of,ch,Ds,Hl,_0,S0,E0,gr,zf,re,L0,En,Jn,Hf,V0,yr,ph,Os,gh,Rs,mh,q0,J0,Ti,Di,Ci,Ns,Xn,dr,Ei,vr,jt,Pi,hr,xh=M(()=>{Sl();Al=class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,i,s){let o=n.listeners[s],r=n.duration;o.forEach(a=>a({chart:t,initial:n.initial,numSteps:r,currentStep:Math.min(i-n.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=Go.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;let o=i.items,r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),o.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){let n=this._charts,i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){let n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;let n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){let n=this._charts.get(t);if(!n||!n.items.length)return;let i=n.items,s=i.length-1;for(;s>=0;--s)i[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}},en=new Al,pf="transparent",hx={boolean(e,t,n){return n>.5?t:e},color(e,t,n){let i=qo(e||pf),s=i.valid&&qo(t||pf);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}},Ol=class{constructor(t,n,i,s){let o=n[i];s=Si([t.to,s,o,t.from]);let r=Si([t.from,o,s]);this._active=!0,this._fn=t.fn||hx[t.type||typeof r],this._easing=Wn[t.easing]||Wn.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=i,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);let s=this._target[this._prop],o=i-this._start,r=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=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){let n=t-this._start,i=this._duration,s=this._prop,o=this._from,r=this._loop,a=this._to,l;if(this._active=o!==a&&(r||n<i),!this._active){this._target[s]=a,this._notify(!0);return}if(n<0){this._target[s]=o;return}l=n/i%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,a,l)}wait(){let t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){let n=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][n]()}},mr=class{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Y(t))return;let n=Object.keys(it.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{let o=t[s];if(!Y(o))return;let r={};for(let a of n)r[a]=o[a];(et(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,r)})})}_animateOptions(t,n){let i=n.options,s=gx(t,i);if(!s)return[];let o=this._createAnimations(s,i);return i.$shared&&px(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,n){let i=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(n),a=Date.now(),l;for(l=r.length-1;l>=0;--l){let c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,n));continue}let u=n[c],d=o[c],f=i.get(c);if(d)if(f&&d.active()){d.update(f,u,a);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}o[c]=d=new Ol(f,t,c,u),s.push(d)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}let i=this._createAnimations(t,n);if(i.length)return en.add(this._chart,i),!0}};Tl=e=>e==="reset"||e==="none",yf=(e,t)=>t?e:Object.assign({},e),Sx=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:nh(n,!0),values:null},qn=class{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=El(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&&Ms(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(d,f,p,b)=>d==="x"?f:d==="r"?b:p,o=n.xAxisID=W(i.xAxisID,Ml(t,"x")),r=n.yAxisID=W(i.yAxisID,Ml(t,"y")),a=n.rAxisID=W(i.rAxisID,Ml(t,"r")),l=n.indexAxis,c=n.iAxisID=s(l,o,r,a),u=n.vAxisID=s(l,r,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(r),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&Uo(this._data,this),t._stacked&&Ms(t)}_dataCheck(){let t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(Y(n)){let s=this._cachedMeta;this._data=xx(n,s)}else if(i!==n){if(i){Uo(i,this);let s=this._cachedMeta;Ms(s),s._parsed=[]}n&&Object.isExtensible(n)&&nl(n,this),this._syncList=[],this._data=n}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let n=this._cachedMeta,i=this.getDataset(),s=!1;this._dataCheck();let o=n._stacked;n._stacked=El(n.vScale,n),n.stack!==i.stack&&(s=!0,Ms(n),n.stack=i.stack),this._resyncElements(t),(s||o!==n._stacked)&&(xf(this,n._parsed),n._stacked=El(n.vScale,n))}configure(){let t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){let{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:r}=i,a=o.axis,l=t===0&&n===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,d,f;if(this._parsing===!1)i._parsed=s,i._sorted=!0,f=s;else{et(s[t])?f=this.parseArrayData(i,s,t,n):Y(s[t])?f=this.parseObjectData(i,s,t,n):f=this.parsePrimitiveData(i,s,t,n);let p=()=>d[a]===null||c&&d[a]<c[a];for(u=0;u<n;++u)i._parsed[u+t]=d=f[u],l&&(p()&&(l=!1),c=d);i._sorted=l}r&&xf(this,f)}parsePrimitiveData(t,n,i,s){let{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),u=o===r,d=new Array(s),f,p,b;for(f=0,p=s;f<p;++f)b=f+i,d[f]={[a]:u||o.parse(c[b],b),[l]:r.parse(n[b],b)};return d}parseArrayData(t,n,i,s){let{xScale:o,yScale:r}=t,a=new Array(s),l,c,u,d;for(l=0,c=s;l<c;++l)u=l+i,d=n[u],a[l]={x:o.parse(d[0],u),y:r.parse(d[1],u)};return a}parseObjectData(t,n,i,s){let{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s),u,d,f,p;for(u=0,d=s;u<d;++u)f=u+i,p=n[f],c[u]={x:o.parse(wi(p,a),f),y:r.parse(wi(p,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,i){let s=this.chart,o=this._cachedMeta,r=n[t.axis],a={keys:nh(s,!0),values:n._stacks[t.axis]._visualValues};return mf(a,r,o.index,{mode:i})}updateRangeFromParsed(t,n,i,s){let o=i[n.axis],r=o===null?NaN:o,a=s&&i._stacks[n.axis];s&&a&&(s.values=a,r=mf(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,n){let i=this._cachedMeta,s=i._parsed,o=i._sorted&&t===i.iScale,r=s.length,a=this._getOtherScale(t),l=Sx(n,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=vx(a),f,p;function b(){p=s[f];let x=p[a.axis];return!ht(p[t.axis])||u>x||d<x}for(f=0;f<r&&!(!b()&&(this.updateRangeFromParsed(c,t,p,l),o));++f);if(o){for(f=r-1;f>=0;--f)if(!b()){this.updateRangeFromParsed(c,t,p,l);break}}return c}getAllParsedValues(t){let n=this._cachedMeta._parsed,i=[],s,o,r;for(s=0,o=n.length;s<o;++s)r=n[s][t.axis],ht(r)&&i.push(r);return i}getMaxOverflow(){return!1}getLabelAndValue(t){let n=this._cachedMeta,i=n.iScale,s=n.vScale,o=this.getParsed(t);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){let n=this._cachedMeta;this.update(t||"default"),n._clip=bx(W(this.options.clip,mx(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){let t=this._ctx,n=this.chart,i=this._cachedMeta,s=i.data||[],o=n.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop,u;for(i.dataset&&i.dataset.draw(t,o,a,l),u=a;u<a+l;++u){let d=s[u];d.hidden||(d.active&&c?r.push(d):d.draw(t,o))}for(u=0;u<r.length;++u)r[u].draw(t,o)}getStyle(t,n){let i=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,n,i){let s=this.getDataset(),o;if(t>=0&&t<this._cachedMeta.data.length){let r=this._cachedMeta.data[t];o=r.$context||(r.$context=kx(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=_x(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=i,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",i){let s=n==="active",o=this._cachedDataOpts,r=t+"-"+n,a=o[r],l=this.enableOptionSharing&&_i(i);if(a)return yf(a,l);let c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=s?[\`\${t}Hover\`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),p=Object.keys(it.elements[t]),b=()=>this.getContext(i,s,n),x=c.resolveNamedOptions(f,p,b,d);return x.$shared&&(x.$shared=l,o[r]=Object.freeze(yf(x,l))),x}_resolveAnimations(t,n,i){let s=this.chart,o=this._cachedDataOpts,r=\`animation-\${n}\`,a=o[r];if(a)return a;let l;if(s.options.animation!==!1){let u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,i,n))}let c=new mr(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||Tl(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){let i=this.resolveDataElementOptions(t,n),s=this._sharedOptions,o=this.getSharedOptions(i),r=this.includeOptions(n,o)||o!==s;return this.updateSharedOptions(o,n,i),{sharedOptions:o,includeOptions:r}}updateElement(t,n,i,s){Tl(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!Tl(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,s){t.active=s;let o=this.getStyle(n,s);this._resolveAnimations(n,i,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let n=this._data,i=this._cachedMeta.data;for(let[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];let s=i.length,o=n.length,r=Math.min(o,s);r&&this.parse(0,r),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,n,i=!0){let s=this._cachedMeta,o=s.data,r=t+n,a,l=c=>{for(c.length+=n,a=c.length-1;a>=r;a--)c[a]=c[a-n]};for(l(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,n),i&&this.updateElements(o,t,n,"reset")}updateElements(t,n,i,s){}_removeElements(t,n){let i=this._cachedMeta;if(this._parsing){let s=i._parsed.splice(t,n);i._stacked&&Ms(i,s)}i.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{let[n,i,s]=t;this[n](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){let t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);let i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}};F(qn,"defaults",{}),F(qn,"datasetElementType",null),F(qn,"dataElementType",null);Zn=class extends qn{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let n=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=n,r=this.chart._animationsDisabled,{start:a,count:l}=rl(n,s,r);this._drawStart=a,this._drawCount=l,al(n)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;let c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,n,i,s){let o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,s),f=r.axis,p=a.axis,{spanGaps:b,segment:x}=this.options,y=Gn(b)?b:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||o||s==="none",_=n+i,S=t.length,T=n>0&&this.getParsed(n-1);for(let E=0;E<S;++E){let D=t[E],O=w?D:{};if(E<n||E>=_){O.skip=!0;continue}let A=this.getParsed(E),N=X(A[p]),j=O[f]=r.getPixelForValue(A[f],E),H=O[p]=o||N?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,A,l):A[p],E);O.skip=isNaN(j)||isNaN(H)||N,O.stop=E>0&&Math.abs(A[f]-T[f])>y,x&&(O.parsed=A,O.raw=c.data[E]),d&&(O.options=u||this.resolveDataElementOptions(E,D.active?"active":s)),w||this.updateElement(D,E,O,s),T=A}}getMaxOverflow(){let t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,s=t.data||[];if(!s.length)return i;let o=s[0].size(this.resolveDataElementOptions(0)),r=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,o,r)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}};F(Zn,"id","line"),F(Zn,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),F(Zn,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});Rl=class e{constructor(t){F(this,"options");this.options=t||{}}static override(t){Object.assign(e.prototype,t)}init(){}formats(){return Kn()}parse(){return Kn()}format(){return Kn()}add(){return Kn()}diff(){return Kn()}startOf(){return Kn()}endOf(){return Kn()}},Ex={_date:Rl};Dx={evaluateInteractionItems:Ls,modes:{index(e,t,n,i){let s=Zt(t,e),o=n.axis||"x",r=n.includeInvisible||!1,a=n.intersect?Cl(e,s,o,i,r):Pl(e,s,o,!1,i,r),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{let u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,i){let s=Zt(t,e),o=n.axis||"xy",r=n.includeInvisible||!1,a=n.intersect?Cl(e,s,o,i,r):Pl(e,s,o,!1,i,r);if(a.length>0){let l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(e,t,n,i){let s=Zt(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;return Cl(e,s,o,i,r)},nearest(e,t,n,i){let s=Zt(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;return Pl(e,s,o,n.intersect,i,r)},x(e,t,n,i){let s=Zt(t,e);return vf(e,s,"x",n.intersect,i)},y(e,t,n,i){let s=Zt(t,e);return vf(e,s,"y",n.intersect,i)}}},ih=["left","top","right","bottom"];Mn={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){let n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,i){if(!e)return;let s=kt(e.options.layout.padding),o=Math.max(t-s.width,0),r=Math.max(n-s.height,0),a=Ix(e.boxes),l=a.vertical,c=a.horizontal;$(e.boxes,x=>{typeof x.beforeLayout=="function"&&x.beforeLayout()});let u=l.reduce((x,y)=>y.box.options&&y.box.options.display===!1?x:x+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/u,hBoxMaxHeight:r/2}),f=Object.assign({},s);sh(f,kt(i));let p=Object.assign({maxPadding:f,w:o,h:r,x:s.left,y:s.top},s),b=Rx(l.concat(c),d);As(a.fullSize,p,d,b),As(l,p,d,b),As(c,p,d,b)&&As(l,p,d,b),Lx(p),kf(a.leftAndTop,p,d,b),p.x+=p.w,p.y+=p.h,kf(a.rightAndBottom,p,d,b),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},$(a.chartArea,x=>{let y=x.box;Object.assign(y,e.chartArea),y.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}},br=class{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,s){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,s?Math.floor(n/s):i)}}isAttached(t){return!0}updateConfig(t){}},Il=class extends br{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}},pr="$chartjs",Vx={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Sf=e=>e===null||e==="";oh=bl?{passive:!0}:!1;Is=new Map,Ef=0;Nl=class extends br{acquireContext(t,n){let i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Fx(t,n),i):null}releaseContext(t){let n=t.canvas;if(!n[pr])return!1;let i=n[pr].initial;["height","width"].forEach(o=>{let r=i[o];X(r)?n.removeAttribute(o):n.setAttribute(o,r)});let s=i.style||{};return Object.keys(s).forEach(o=>{n.style[o]=s[o]}),n.width=n.width,delete n[pr],!0}addEventListener(t,n,i){this.removeEventListener(t,n);let s=t.$proxies||(t.$proxies={}),r={attach:jx,detach:$x,resize:Yx}[n]||Kx;s[n]=r(t,n,i)}removeEventListener(t,n){let i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:Dl,detach:Dl,resize:Dl}[n]||Bx)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return ml(t,n,i,s)}isAttached(t){let n=t&&Es(t);return!!(n&&n.isConnected)}};Le=class{constructor(){F(this,"x");F(this,"y");F(this,"active",!1);F(this,"options");F(this,"$animations")}tooltipPosition(t){let{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return Gn(this.x)&&Gn(this.y)}getProps(t,n){let i=this.$animations;if(!n||!i)return this;let s={};return t.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}};F(Le,"defaults",{}),F(Le,"defaultRoutes");n0=e=>e==="left"?"right":e==="right"?"left":e,Mf=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Tf=(e,t)=>Math.min(t||e,e);Qn=class e extends Le{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:i,_suggestedMax:s}=this;return t=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:ht(t),maxDefined:ht(n)}}getMinMax(t){let{min:n,max:i,minDefined:s,maxDefined:o}=this.getUserBounds(),r;if(s&&o)return{min:n,max:i};let a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,t),s||(n=Math.min(n,r.min)),o||(i=Math.max(i,r.max));return n=o&&n>i?i:n,i=s&&n>i?n:i,{min: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(){let t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){z(this.options.beforeUpdate,[this])}update(t,n,i){let{beginAtZero:s,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=fl(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=a<this.ticks.length;this._convertTicksToLabels(l?Cf(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=qx(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,i;this.isHorizontal()?(n=this.left,i=this.right):(n=this.top,i=this.bottom,t=!t),this._startPixel=n,this._endPixel=i,this._reversePixels=t,this._length=i-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){z(this.options.afterUpdate,[this])}beforeSetDimensions(){z(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){z(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),z(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){z(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){let n=this.options.ticks,i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i],o.label=z(n.callback,[o.value,i,t],this)}afterTickToLabelConversion(){z(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){z(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let t=this.options,n=t.ticks,i=Tf(this.ticks.length,t.ticks.maxTicksLimit),s=n.minRotation||0,o=n.maxRotation,r=s,a,l,c;if(!this._isVisible()||!n.display||s>=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}let u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,p=Bt(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:p/(i-1),d+6>a&&(a=p/(i-(t.offset?.5:1)),l=this.maxHeight-Ps(t.grid)-n.padding-Pf(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),r=ms(Math.min(Math.asin(Bt((u.highest.height+6)/a,-1,1)),Math.asin(Bt(l/c,-1,1))-Math.asin(Bt(f/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){z(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){z(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){let l=Pf(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=Ps(o)+l):(t.height=this.maxHeight,t.width=Ps(o)+l),i.display&&this.ticks.length){let{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),p=i.padding*2,b=Oe(this.labelRotation),x=Math.cos(b),y=Math.sin(b);if(a){let w=i.mirror?0:y*d.width+x*f.height;t.height=Math.min(this.maxHeight,t.height+w+p)}else{let w=i.mirror?0:x*d.width+y*f.height;t.width=Math.min(this.maxWidth,t.width+w+p)}this._calculatePadding(c,u,y,x)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,i,s){let{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){let u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1),f=0,p=0;l?c?(f=s*t.width,p=i*n.height):(f=i*t.height,p=s*n.width):o==="start"?p=n.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,p=n.width/2),this.paddingLeft=Math.max((f-u+r)*this.width/(this.width-u),0),this.paddingRight=Math.max((p-d+r)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;o==="start"?(u=0,d=t.height):o==="end"&&(u=n.height,d=0),this.paddingTop=u+r,this.paddingBottom=d+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){z(this.options.afterFit,[this])}isHorizontal(){let{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,i;for(n=0,i=t.length;n<i;n++)X(t[n].label)&&(t.splice(n,1),i--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){let n=this.options.ticks.sampleSize,i=this.ticks;n<i.length&&(i=Cf(i,n)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,i){let{ctx:s,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(n/Tf(n,i)),c=0,u=0,d,f,p,b,x,y,w,_,S,T,E;for(d=0;d<n;d+=l){if(b=t[d].label,x=this._resolveTickFontOptions(d),s.font=y=x.string,w=o[y]=o[y]||{data:{},gc:[]},_=x.lineHeight,S=T=0,!X(b)&&!et(b))S=xi(s,w.data,w.gc,S,b),T=_;else if(et(b))for(f=0,p=b.length;f<p;++f)E=b[f],!X(E)&&!et(E)&&(S=xi(s,w.data,w.gc,S,E),T+=_);r.push(S),a.push(T),c=Math.max(S,c),u=Math.max(T,u)}s0(o,n);let D=r.indexOf(c),O=a.indexOf(u),A=N=>({width:r[N]||0,height:a[N]||0});return{first:A(0),last:A(n-1),widest:A(D),highest:A(O),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){let n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let n=this._startPixel+t*this._length;return Qa(this._alignToPixels?tn(this.chart,n,0):n)}getDecimalForPixel(t){let n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){let n=this.ticks||[];if(t>=0&&t<n.length){let i=n[t];return i.$context||(i.$context=r0(this.getContext(),t,i))}return this.$context||(this.$context=o0(this.chart.getContext(),this))}_tickSize(){let t=this.options.ticks,n=Oe(this.labelRotation),i=Math.abs(Math.cos(n)),s=Math.abs(Math.sin(n)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*i>a*s?a/i:l/s:l*s<a*i?l/i:a/s}_isVisible(){let t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){let n=this.axis,i=this.chart,s=this.options,{grid:o,position:r,border:a}=s,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=Ps(o),p=[],b=a.setContext(this.getContext()),x=b.display?b.width:0,y=x/2,w=function(tt){return tn(i,tt,x)},_,S,T,E,D,O,A,N,j,H,G,ot;if(r==="top")_=w(this.bottom),O=this.bottom-f,N=_-y,H=w(t.top)+y,ot=t.bottom;else if(r==="bottom")_=w(this.top),H=t.top,ot=w(t.bottom)-y,O=_+y,N=this.top+f;else if(r==="left")_=w(this.right),D=this.right-f,A=_-y,j=w(t.left)+y,G=t.right;else if(r==="right")_=w(this.left),j=t.left,G=w(t.right)-y,D=_+y,A=this.left+f;else if(n==="x"){if(r==="center")_=w((t.top+t.bottom)/2+.5);else if(Y(r)){let tt=Object.keys(r)[0],mt=r[tt];_=w(this.chart.scales[tt].getPixelForValue(mt))}H=t.top,ot=t.bottom,O=_+y,N=O+f}else if(n==="y"){if(r==="center")_=w((t.left+t.right)/2);else if(Y(r)){let tt=Object.keys(r)[0],mt=r[tt];_=w(this.chart.scales[tt].getPixelForValue(mt))}D=_-y,A=D-f,j=t.left,G=t.right}let Ct=W(s.ticks.maxTicksLimit,d),Q=Math.max(1,Math.ceil(d/Ct));for(S=0;S<d;S+=Q){let tt=this.getContext(S),mt=o.setContext(tt),ce=a.setContext(tt),ni=mt.lineWidth,rn=mt.color,ve=ce.dash||[],an=ce.dashOffset,Ve=mt.tickWidth,Fe=mt.tickColor,Pn=mt.tickBorderDash||[],nt=mt.tickBorderDashOffset;T=i0(this,S,l),T!==void 0&&(E=tn(i,T,ni),c?D=A=j=G=E:O=N=H=ot=E,p.push({tx1:D,ty1:O,tx2:A,ty2:N,x1:j,y1:H,x2:G,y2:ot,width:ni,color:rn,borderDash:ve,borderDashOffset:an,tickWidth:Ve,tickColor:Fe,tickBorderDash:Pn,tickBorderDashOffset:nt}))}return this._ticksLength=d,this._borderValue=_,p}_computeLabelItems(t){let n=this.axis,i=this.options,{position:s,ticks:o}=i,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=o,f=Ps(i.grid),p=f+u,b=d?-u:p,x=-Oe(this.labelRotation),y=[],w,_,S,T,E,D,O,A,N,j,H,G,ot="middle";if(s==="top")D=this.bottom-b,O=this._getXAxisLabelAlignment();else if(s==="bottom")D=this.top+b,O=this._getXAxisLabelAlignment();else if(s==="left"){let Q=this._getYAxisLabelAlignment(f);O=Q.textAlign,E=Q.x}else if(s==="right"){let Q=this._getYAxisLabelAlignment(f);O=Q.textAlign,E=Q.x}else if(n==="x"){if(s==="center")D=(t.top+t.bottom)/2+p;else if(Y(s)){let Q=Object.keys(s)[0],tt=s[Q];D=this.chart.scales[Q].getPixelForValue(tt)+p}O=this._getXAxisLabelAlignment()}else if(n==="y"){if(s==="center")E=(t.left+t.right)/2-p;else if(Y(s)){let Q=Object.keys(s)[0],tt=s[Q];E=this.chart.scales[Q].getPixelForValue(tt)}O=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?ot="top":l==="end"&&(ot="bottom"));let Ct=this._getLabelSizes();for(w=0,_=a.length;w<_;++w){S=a[w],T=S.label;let Q=o.setContext(this.getContext(w));A=this.getPixelForTick(w)+o.labelOffset,N=this._resolveTickFontOptions(w),j=N.lineHeight,H=et(T)?T.length:1;let tt=H/2,mt=Q.color,ce=Q.textStrokeColor,ni=Q.textStrokeWidth,rn=O;r?(E=A,O==="inner"&&(w===_-1?rn=this.options.reverse?"left":"right":w===0?rn=this.options.reverse?"right":"left":rn="center"),s==="top"?c==="near"||x!==0?G=-H*j+j/2:c==="center"?G=-Ct.highest.height/2-tt*j+j:G=-Ct.highest.height+j/2:c==="near"||x!==0?G=j/2:c==="center"?G=Ct.highest.height/2-tt*j:G=Ct.highest.height-H*j,d&&(G*=-1),x!==0&&!Q.showLabelBackdrop&&(E+=j/2*Math.sin(x))):(D=A,G=(1-H)*j/2);let ve;if(Q.showLabelBackdrop){let an=kt(Q.backdropPadding),Ve=Ct.heights[w],Fe=Ct.widths[w],Pn=G-an.top,nt=0-an.left;switch(ot){case"middle":Pn-=Ve/2;break;case"bottom":Pn-=Ve;break}switch(O){case"center":nt-=Fe/2;break;case"right":nt-=Fe;break;case"inner":w===_-1?nt-=Fe:w>0&&(nt-=Fe/2);break}ve={left:nt,top:Pn,width:Fe+an.width,height:Ve+an.height,color:Q.backdropColor}}y.push({label:T,font:N,textOffset:G,options:{rotation:x,color:mt,strokeColor:ce,strokeWidth:ni,textAlign:rn,textBaseline:ot,translation:[E,D],backdrop:ve}})}return y}_getXAxisLabelAlignment(){let{position:t,ticks:n}=this.options;if(-Oe(this.labelRotation))return t==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){let{position:n,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width,c,u;return n==="left"?s?(u=this.right+o,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?s?(u=this.left+o,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;let t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){let{ctx:t,options:{backgroundColor:n},left:i,top:s,width:o,height:r}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(i,s,o,r),t.restore())}getLineWidthForValue(t){let n=this.options.grid;if(!this._isVisible()||!n.display)return 0;let s=this.ticks.findIndex(o=>o.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){let n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),o,r,a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(n.display)for(o=0,r=s.length;o<r;++o){let l=s[o];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){let{chart:t,ctx:n,options:{border:i,grid:s}}=this,o=i.setContext(this.getContext()),r=i.display?o.width:0;if(!r)return;let a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue,c,u,d,f;this.isHorizontal()?(c=tn(t,this.left,r)-r/2,u=tn(t,this.right,a)+a/2,d=f=l):(d=tn(t,this.top,r)-r/2,f=tn(t,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(c,d),n.lineTo(u,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;let i=this.ctx,s=this._computeLabelArea();s&&ws(i,s);let o=this.getLabelItems(t);for(let r of o){let a=r.options,l=r.font,c=r.label,u=r.textOffset;_n(i,c,0,u,l,a)}s&&_s(i)}drawTitle(){let{ctx:t,options:{position:n,title:i,reverse:s}}=this;if(!i.display)return;let o=gt(i.font),r=kt(i.padding),a=i.align,l=o.lineHeight/2;n==="bottom"||n==="center"||Y(n)?(l+=r.bottom,et(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=r.top;let{titleX:c,titleY:u,maxWidth:d,rotation:f}=l0(this,l,n,a);_n(t,i.text,0,0,o,{color:i.color,maxWidth:d,rotation:f,textAlign:a0(a,n,s),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){let t=this.options,n=t.ticks&&t.ticks.z||0,i=W(t.grid&&t.grid.z,-1),s=W(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==e.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){let n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[],o,r;for(o=0,r=n.length;o<r;++o){let a=n[o];a[i]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){let n=this.options.ticks.setContext(this.getContext(t));return gt(n.font)}_maxDigits(){let t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}},Mi=class{constructor(t,n,i){this.type=t,this.scope=n,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){let n=Object.getPrototypeOf(t),i;d0(n)&&(i=this.register(n));let s=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,c0(t,r,i),this.override&&it.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){let n=this.items,i=t.id,s=this.scope;i in n&&delete n[i],s&&i in it[s]&&(delete it[s][i],this.override&&delete wn[i])}};Ll=class{constructor(){this.controllers=new Mi(qn,"datasets",!0),this.elements=new Mi(Le,"elements"),this.plugins=new Mi(Object,"plugins"),this.scales=new Mi(Qn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,i){[...n].forEach(s=>{let o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):$(s,r=>{let a=i||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,n,i){let s=gs(t);z(i["before"+s],[],i),n[t](i),z(i["after"+s],[],i)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){let i=this._typedRegistries[n];if(i.isForType(t))return i}return this.plugins}_get(t,n,i){let s=n.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}},Ne=new Ll,zl=class{constructor(){this._init=void 0}notify(t,n,i,s){if(n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;let o=s?this._descriptors(t).filter(s):this._descriptors(t),r=this._notify(o,t,n,i);return n==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),r}_notify(t,n,i,s){s=s||{};for(let o of t){let r=o.plugin,a=r[i],l=[n,s,o.options];if(z(a,l,r)===!1&&s.cancelable)return!1}return!0}invalidate(){X(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;let n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){let i=t&&t.config,s=W(i.options&&i.options.plugins,{}),o=f0(i);return s===!1&&!n?[]:p0(t,o,s,n)}_notifyStateChanges(t){let n=this._oldCache||[],i=this._cache,s=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(s(n,i),t,"stop"),this._notify(s(i,n),t,"start")}};Of=new Map,ch=new Set;Ds=(e,t,n)=>{let i=wi(t,n);i!==void 0&&e.add(i)},Hl=class{constructor(t){this._config=w0(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=lh(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),ah(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return cr(t,()=>[[\`datasets.\${t}\`,""]])}datasetAnimationScopeKeys(t,n){return cr(\`\${t}.transition.\${n}\`,()=>[[\`datasets.\${t}.transitions.\${n}\`,\`transitions.\${n}\`],[\`datasets.\${t}\`,""]])}datasetElementScopeKeys(t,n){return cr(\`\${t}-\${n}\`,()=>[[\`datasets.\${t}.elements.\${n}\`,\`datasets.\${t}\`,\`elements.\${n}\`,""]])}pluginScopeKeys(t){let n=t.id,i=this.type;return cr(\`\${i}-plugin-\${n}\`,()=>[[\`plugins.\${n}\`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){let i=this._scopeCache,s=i.get(t);return(!s||n)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,n,i){let{options:s,type:o}=this,r=this._cachedScopes(t,i),a=r.get(n);if(a)return a;let l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>Ds(l,t,d))),u.forEach(d=>Ds(l,s,d)),u.forEach(d=>Ds(l,wn[o]||{},d)),u.forEach(d=>Ds(l,it,d)),u.forEach(d=>Ds(l,Zo,d))});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),ch.has(n)&&r.set(n,c),c}chartOptionScopes(){let{options:t,type:n}=this;return[t,wn[n]||{},it.datasets[n]||{},{type:n},it,Zo]}resolveNamedOptions(t,n,i,s=[""]){let o={$shared:!0},{resolver:r,subPrefixes:a}=Rf(this._resolverCache,t,s),l=r;if(k0(r,n)){o.$shared=!1,i=Pe(i)?i():i;let c=this.createResolver(t,i,a);l=vn(r,i,c)}for(let c of n)o[c]=l[c];return o}createResolver(t,n,i=[""],s){let{resolver:o}=Rf(this._resolverCache,t,i);return Y(n)?vn(o,n,void 0,s):o}};_0=e=>Y(e)&&Object.getOwnPropertyNames(e).some(t=>Pe(e[t]));S0="4.5.1",E0=["top","bottom","left","right","chartArea"];gr={},zf=e=>{let t=uh(e);return Object.values(gr).filter(n=>n.canvas===t).pop()};re=class{static register(...t){Ne.add(...t),Vf()}static unregister(...t){Ne.remove(...t),Vf()}constructor(t,n){let i=this.config=new Hl(n),s=uh(t),o=zf(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");let r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Xx(s)),this.platform.updateConfig(i);let a=this.platform.acquireContext(s,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=Ya(),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 zl,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=sl(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],gr[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}en.listen(this,"complete",Lf),en.listen(this,"progress",M0),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:s,_aspectRatio:o}=this;return X(t)?n&&o?o:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Ne}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ir(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Jo(this.canvas,this.ctx),this}stop(){return en.stop(this),this}resize(t,n){en.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){let i=this.options,s=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,t,n,o),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,ir(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),z(i.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){let n=this.options.scales||{};$(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){let t=this.options,n=t.scales,i=this.scales,s=Object.keys(i).reduce((r,a)=>(r[a]=!1,r),{}),o=[];n&&(o=o.concat(Object.keys(n).map(r=>{let a=n[r],l=Fl(r,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),$(o,r=>{let a=r.options,l=a.id,c=Fl(l,a),u=W(a.type,r.dtype);(a.position===void 0||If(a.position,c)!==If(r.dposition))&&(a.position=r.dposition),s[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{let f=Ne.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),$(s,(r,a)=>{r||delete i[a]}),$(i,r=>{Mn.configure(this,r,r.options),Mn.addBox(this,r)})}_updateMetasets(){let t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((s,o)=>s.index-o.index),i>n){for(let s=n;s<i;++s)this._destroyDatasetMeta(s);t.splice(n,i-n)}this._sortedMetasets=t.slice(0).sort(Nf("order","index"))}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((i,s)=>{n.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){let t=[],n=this.data.datasets,i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i<s;i++){let o=n[i],r=this.getDatasetMeta(i),a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(i),r=this.getDatasetMeta(i)),r.type=a,r.indexAxis=o.indexAxis||Vl(a,this.options),r.order=o.order||0,r.index=i,r.label=""+o.label,r.visible=this.isDatasetVisible(i),r.controller)r.controller.updateIndex(i),r.controller.linkScales();else{let l=Ne.getController(a),{datasetElementType:c,dataElementType:u}=it.datasets[a];Object.assign(l,{dataElementType:Ne.getElement(u),datasetElementType:c&&Ne.getElement(c)}),r.controller=new l(this,i),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){$(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let n=this.config;n.update();let i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;let o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,u=this.data.datasets.length;c<u;c++){let{controller:d}=this.getDatasetMeta(c),f=!s&&o.indexOf(d)===-1;d.buildOrUpdateElements(f),r=Math.max(+d.getMaxOverflow(),r)}r=this._minPadding=i.layout.autoPadding?r:0,this._updateLayout(r),s||$(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Nf("z","_idx"));let{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){$(this.scales,t=>{Mn.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Ho(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(let{method:i,start:s,count:o}of n){let r=i==="_removeElements"?-o:o;T0(t,s,r)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let n=this.data.datasets.length,i=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),s=i(0);for(let o=1;o<n;o++)if(!Ho(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;Mn.update(this,this.width,this.height,t);let n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],$(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n<i;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,i=this.data.datasets.length;n<i;++n)this._updateDataset(n,Pe(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){let i=this.getDatasetMeta(t),s={meta:i,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(n),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(en.has(this)?this.attached&&!en.running(this)&&en.start(this):(this.draw(),Lf({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){let{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;let n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){let n=this._sortedMetasets,i=[],s,o;for(s=0,o=n.length;s<o;++s){let r=n[s];(!t||r.visible)&&i.push(r)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;let t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let n=this.ctx,i={meta:t,index:t.index,cancelable:!0},s=kl(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&ws(n,s),t.controller.draw(),s&&_s(n),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return qt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){let o=Dx.modes[n];return typeof o=="function"?o(this,t,i,s):[]}getDatasetMeta(t){let n=this.data.datasets[t],i=this._metasets,s=i.filter(o=>o&&o._dataset===n).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Re(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let n=this.data.datasets[t];if(!n)return!1;let i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){let i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){let s=i?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);_i(n)?(o.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(o,{visible:i}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){let n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),en.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Jo(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete gr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let t=this._listeners,n=this.platform,i=(o,r)=>{n.addEventListener(this,o,r),t[o]=r},s=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};$(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,n=this.platform,i=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)},r,a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",o),i("detach",r)};r=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),i("attach",a)},n.isAttached(this.canvas)?a():r()}unbindEvents(){$(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},$(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){let s=i?"set":"remove",o,r,a,l;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){r=t[a];let c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){let n=this._active||[],i=t.map(({datasetIndex:o,index:r})=>{let a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!vi(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,i){let s=this.options.hover,o=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),r=o(n,t),a=i?t:o(t,n);r.length&&this.updateHoverStyle(r,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,n){let i={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},s=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;let o=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(o||i.changed)&&this.render(),this}_handleEvent(t,n,i){let{_active:s=[],options:o}=this,r=n,a=this._getActiveElements(t,s,i,r),l=Xa(t),c=C0(t,this._lastEvent,i,l);i&&(this._lastEvent=null,z(o.onHover,[t,a,this],this),l&&z(o.onClick,[t,a,this],this));let u=!vi(a,s);return(u||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=c,u}_getActiveElements(t,n,i,s){if(t.type==="mouseout")return[];if(!i)return n;let o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}};F(re,"defaults",it),F(re,"instances",gr),F(re,"overrides",wn),F(re,"registry",Ne),F(re,"version",S0),F(re,"getChart",zf);L0=typeof Path2D=="function";En=class extends Le{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){let i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){let s=i.spanGaps?this._loop:this._fullLoop;gl(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=_l(this,this.options.segment))}first(){let t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){let t=this.segments,n=this.points,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){let i=this.options,s=t[n],o=this.points,r=wl(this,{property:n,start:s,end:s});if(!r.length)return;let a=[],l=R0(i),c,u;for(c=0,u=r.length;c<u;++c){let{start:d,end:f}=r[c],p=o[d],b=o[f];if(p===b){a.push(p);continue}let x=Math.abs((s-p[n])/(b[n]-p[n])),y=l(p,b,x,i.stepped);y[n]=t[n],a.push(y)}return a.length===1?a[0]:a}pathSegment(t,n,i){return Bl(this)(t,this,n,i)}path(t,n,i){let s=this.segments,o=Bl(this),r=this._loop;n=n||0,i=i||this.points.length-n;for(let a of s)r&=o(t,this,a,{start:n,end:n+i-1});return!!r}draw(t,n,i,s){let o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),z0(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}};F(En,"id","line"),F(En,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),F(En,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),F(En,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});Jn=class extends Le{constructor(n){super();F(this,"parsed");F(this,"skip");F(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,i,s){let o=this.options,{x:r,y:a}=this.getProps(["x","y"],s);return Math.pow(n-r,2)+Math.pow(i-a,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(n,i){return Ff(this,n,"x",i)}inYRange(n,i){return Ff(this,n,"y",i)}getCenterPoint(n){let{x:i,y:s}=this.getProps(["x","y"],n);return{x:i,y:s}}size(n){n=n||this.options||{};let i=n.radius||0;i=Math.max(i,i&&n.hoverRadius||0);let s=i&&n.borderWidth||0;return(i+s)*2}draw(n,i){let s=this.options;this.skip||s.radius<.1||!qt(this,i,this.size(s)/2)||(n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.fillStyle=s.backgroundColor,vs(n,s,this.x,this.y))}getRange(){let n=this.options||{};return n.radius+n.hitRadius}};F(Jn,"id","point"),F(Jn,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),F(Jn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});Hf=(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)}},V0=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index,yr=class extends Le{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,i){this.maxWidth=t,this.maxHeight=n,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let t=this.options.labels||{},n=z(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){let{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}let i=t.labels,s=gt(i.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Hf(i,o),c,u;n.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(r,o,a,l)+10):(u=this.maxHeight,c=this._fitCols(r,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,s){let{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a,d=t;o.textAlign="left",o.textBaseline="middle";let f=-1,p=-u;return this.legendItems.forEach((b,x)=>{let y=i+n/2+o.measureText(b.text).width;(x===0||c[c.length-1]+y+2*a>r)&&(d+=u,c[c.length-(x>0?0:1)]=0,p+=u,f++),l[x]={left:0,top:p,row:f,width:y,height:s},c[c.length-1]+=y+a}),d}_fitCols(t,n,i,s){let{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=r-t,d=a,f=0,p=0,b=0,x=0;return this.legendItems.forEach((y,w)=>{let{itemWidth:_,itemHeight:S}=F0(i,n,o,y,s);w>0&&p+S+2*a>u&&(d+=f+a,c.push({width:f,height:p}),b+=f+a,x++,f=p=0),l[w]={left:b,top:p,col:x,width:_,height:S},f=Math.max(f,_),p+=S+a}),d+=f,c.push({width:f,height:p}),d}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:o}}=this,r=Sn(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=Ot(i,this.left+s,this.right-this.lineWidths[a]);for(let c of n)a!==c.row&&(a=c.row,l=Ot(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=Ot(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(let c of n)c.col!==a&&(a=c.col,l=Ot(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){let t=this.ctx;ws(t,this),this._draw(),_s(t)}}_draw(){let{options:t,columnSizes:n,lineWidths:i,ctx:s}=this,{align:o,labels:r}=t,a=it.color,l=Sn(t.rtl,this.left,this.width),c=gt(r.font),{padding:u}=r,d=c.size,f=d/2,p;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;let{boxWidth:b,boxHeight:x,itemHeight:y}=Hf(r,d),w=function(D,O,A){if(isNaN(b)||b<=0||isNaN(x)||x<0)return;s.save();let N=W(A.lineWidth,1);if(s.fillStyle=W(A.fillStyle,a),s.lineCap=W(A.lineCap,"butt"),s.lineDashOffset=W(A.lineDashOffset,0),s.lineJoin=W(A.lineJoin,"miter"),s.lineWidth=N,s.strokeStyle=W(A.strokeStyle,a),s.setLineDash(W(A.lineDash,[])),r.usePointStyle){let j={radius:x*Math.SQRT2/2,pointStyle:A.pointStyle,rotation:A.rotation,borderWidth:N},H=l.xPlus(D,b/2),G=O+f;Qo(s,j,H,G,r.pointStyleWidth&&b)}else{let j=O+Math.max((d-x)/2,0),H=l.leftForLtr(D,b),G=kn(A.borderRadius);s.beginPath(),Object.values(G).some(ot=>ot!==0)?ki(s,{x:H,y:j,w:b,h:x,radius:G}):s.rect(H,j,b,x),s.fill(),N!==0&&s.stroke()}s.restore()},_=function(D,O,A){_n(s,A.text,D,O+y/2,c,{strikethrough:A.hidden,textAlign:l.textAlign(A.textAlign)})},S=this.isHorizontal(),T=this._computeTitleHeight();S?p={x:Ot(o,this.left+u,this.right-i[0]),y:this.top+u+T,line:0}:p={x:this.left+u,y:Ot(o,this.top+T+u,this.bottom-n[0].height),line:0},or(this.ctx,t.textDirection);let E=y+u;this.legendItems.forEach((D,O)=>{s.strokeStyle=D.fontColor,s.fillStyle=D.fontColor;let A=s.measureText(D.text).width,N=l.textAlign(D.textAlign||(D.textAlign=r.textAlign)),j=b+f+A,H=p.x,G=p.y;l.setWidth(this.width),S?O>0&&H+j+u>this.right&&(G=p.y+=E,p.line++,H=p.x=Ot(o,this.left+u,this.right-i[p.line])):O>0&&G+E>this.bottom&&(H=p.x=H+n[p.line].width+u,p.line++,G=p.y=Ot(o,this.top+T+u,this.bottom-n[p.line].height));let ot=l.x(H);if(w(ot,G,D),H=ol(N,H+b+f,S?H+j:this.right,t.rtl),_(l.x(H),G,D),S)p.x+=j+u;else if(typeof D.text!="string"){let Ct=c.lineHeight;p.y+=hh(D,Ct)+u}else p.y+=E}),rr(this.ctx,t.textDirection)}drawTitle(){let t=this.options,n=t.title,i=gt(n.font),s=kt(n.padding);if(!n.display)return;let o=Sn(t.rtl,this.left,this.width),r=this.ctx,a=n.position,l=i.size/2,c=s.top+l,u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=Ot(t.align,d,this.right-f);else{let b=this.columnSizes.reduce((x,y)=>Math.max(x,y.height),0);u=c+Ot(t.align,this.top,this.bottom-b-t.labels.padding-this._computeTitleHeight())}let p=Ot(a,d,d+f);r.textAlign=o.textAlign(Ko(a)),r.textBaseline="middle",r.strokeStyle=n.color,r.fillStyle=n.color,r.font=i.string,_n(r,n.text,p,u,i)}_computeTitleHeight(){let t=this.options.title,n=gt(t.font),i=kt(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,s,o;if(Yn(t,this.left,this.right)&&Yn(n,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],Yn(t,s.left,s.left+s.width)&&Yn(n,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){let n=this.options;if(!W0(t.type,n))return;let i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){let s=this._hoveredItem,o=V0(s,i);s&&!o&&z(n.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!o&&z(n.onHover,[t,i,this],this)}else i&&z(n.onClick,[t,i,this],this)}};ph={id:"legend",_element:yr,start(e,t,n){let i=e.legend=new yr({ctx:e.ctx,options:n,chart:e});Mn.configure(e,i,n),Mn.addBox(e,i)},stop(e){Mn.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){let i=e.legend;Mn.configure(e,i,n),i.options=n},afterUpdate(e){let t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){let i=t.datasetIndex,s=n.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){let t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{let c=l.controller.getStyle(n?0:void 0),u=kt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}},Os={average(e){if(!e.length)return!1;let t,n,i=new Set,s=0,o=0;for(t=0,n=e.length;t<n;++t){let a=e[t].element;if(a&&a.hasValue()){let l=a.tooltipPosition();i.add(l.x),s+=l.y,++o}}return o===0||i.size===0?!1:{x:[...i].reduce((a,l)=>a+l)/i.size,y:s/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,i=t.y,s=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=e.length;o<r;++o){let l=e[o].element;if(l&&l.hasValue()){let c=l.getCenterPoint(),u=ps(t,c);u<s&&(s=u,a=l)}}if(a){let l=a.tooltipPosition();n=l.x,i=l.y}return{x:n,y:i}}};gh={beforeTitle:be,title(e){if(e.length>0){let t=e[0],n=t.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return n[t.dataIndex]}return""},afterTitle:be,beforeBody:be,beforeLabel:be,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");let n=e.formattedValue;return X(n)||(t+=n),t},labelColor(e){let n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){let n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:be,afterBody:be,beforeFooter:be,footer:be,afterFooter:be};Rs=class extends Le{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let t=this._cachedAnimations;if(t)return t;let n=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&n.options.animation&&i.animations,o=new mr(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=X0(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){let{callbacks:i}=n,s=Wt(i,"beforeTitle",this,t),o=Wt(i,"title",this,t),r=Wt(i,"afterTitle",this,t),a=[];return a=Ie(a,nn(s)),a=Ie(a,nn(o)),a=Ie(a,nn(r)),a}getBeforeBody(t,n){return $f(Wt(n.callbacks,"beforeBody",this,t))}getBody(t,n){let{callbacks:i}=n,s=[];return $(t,o=>{let r={before:[],lines:[],after:[]},a=Uf(i,o);Ie(r.before,nn(Wt(a,"beforeLabel",this,o))),Ie(r.lines,Wt(a,"label",this,o)),Ie(r.after,nn(Wt(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,n){return $f(Wt(n.callbacks,"afterBody",this,t))}getFooter(t,n){let{callbacks:i}=n,s=Wt(i,"beforeFooter",this,t),o=Wt(i,"footer",this,t),r=Wt(i,"afterFooter",this,t),a=[];return a=Ie(a,nn(s)),a=Ie(a,nn(o)),a=Ie(a,nn(r)),a}_createItems(t){let n=this._active,i=this.chart.data,s=[],o=[],r=[],a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(j0(this.chart,n[l]));return t.filter&&(a=a.filter((u,d,f)=>t.filter(u,d,f,i))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,i))),$(a,u=>{let d=Uf(t.callbacks,u);s.push(Wt(d,"labelColor",this,u)),o.push(Wt(d,"labelPointStyle",this,u)),r.push(Wt(d,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,n){let i=this.options.setContext(this.getContext()),s=this._active,o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{let a=Os[i.position].call(this,s,this._eventPosition);r=this._createItems(i),this.title=this.getTitle(r,i),this.beforeBody=this.getBeforeBody(r,i),this.body=this.getBody(r,i),this.afterBody=this.getAfterBody(r,i),this.footer=this.getFooter(r,i);let l=this._size=Bf(this,i),c=Object.assign({},a,l),u=Wf(this.chart,i,c),d=jf(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,s){let o=this.getCaretPosition(t,i,s);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,i){let{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=kn(a),{x:f,y:p}=t,{width:b,height:x}=n,y,w,_,S,T,E;return o==="center"?(T=p+x/2,s==="left"?(y=f,w=y-r,S=T+r,E=T-r):(y=f+b,w=y+r,S=T-r,E=T+r),_=y):(s==="left"?w=f+Math.max(l,u)+r:s==="right"?w=f+b-Math.max(c,d)-r:w=this.caretX,o==="top"?(S=p,T=S-r,y=w-r,_=w+r):(S=p+x,T=S+r,y=w+r,_=w-r),E=S),{x1:y,x2:w,x3:_,y1:S,y2:T,y3:E}}drawTitle(t,n,i){let s=this.title,o=s.length,r,a,l;if(o){let c=Sn(i.rtl,this.x,this.width);for(t.x=ur(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",r=gt(i.titleFont),a=i.titleSpacing,n.fillStyle=i.titleColor,n.font=r.string,l=0;l<o;++l)n.fillText(s[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,n,i,s,o){let r=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=o,u=gt(o.bodyFont),d=ur(this,"left",o),f=s.x(d),p=l<u.lineHeight?(u.lineHeight-l)/2:0,b=n.y+p;if(o.usePointStyle){let x={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},y=s.leftForLtr(f,c)+c/2,w=b+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,vs(t,x,y,w),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,vs(t,x,y,w)}else{t.lineWidth=Y(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;let x=s.leftForLtr(f,c),y=s.leftForLtr(s.xPlus(f,1),c-2),w=kn(r.borderRadius);Object.values(w).some(_=>_!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ki(t,{x,y:b,w:c,h:l,radius:w}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),ki(t,{x:y,y:b+1,w:c-2,h:l-2,radius:w}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(x,b,c,l),t.strokeRect(x,b,c,l),t.fillStyle=r.backgroundColor,t.fillRect(y,b+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){let{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=gt(i.bodyFont),f=d.lineHeight,p=0,b=Sn(i.rtl,this.x,this.width),x=function(A){n.fillText(A,b.x(t.x+p),t.y+f/2),t.y+=f+o},y=b.textAlign(r),w,_,S,T,E,D,O;for(n.textAlign=r,n.textBaseline="middle",n.font=d.string,t.x=ur(this,y,i),n.fillStyle=i.bodyColor,$(this.beforeBody,x),p=a&&y!=="right"?r==="center"?c/2+u:c+2+u:0,T=0,D=s.length;T<D;++T){for(w=s[T],_=this.labelTextColors[T],n.fillStyle=_,$(w.before,x),S=w.lines,a&&S.length&&(this._drawColorBox(n,t,T,b,i),f=Math.max(d.lineHeight,l)),E=0,O=S.length;E<O;++E)x(S[E]),f=d.lineHeight;$(w.after,x)}p=0,f=d.lineHeight,$(this.afterBody,x),t.y-=o}drawFooter(t,n,i){let s=this.footer,o=s.length,r,a;if(o){let l=Sn(i.rtl,this.x,this.width);for(t.x=ur(this,i.footerAlign,i),t.y+=i.footerMarginTop,n.textAlign=l.textAlign(i.footerAlign),n.textBaseline="middle",r=gt(i.footerFont),n.fillStyle=i.footerColor,n.font=r.string,a=0;a<o;++a)n.fillText(s[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+i.footerSpacing}}drawBackground(t,n,i,s){let{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:u}=i,{topLeft:d,topRight:f,bottomLeft:p,bottomRight:b}=kn(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(a+d,l),r==="top"&&this.drawCaret(t,n,i,s),n.lineTo(a+c-f,l),n.quadraticCurveTo(a+c,l,a+c,l+f),r==="center"&&o==="right"&&this.drawCaret(t,n,i,s),n.lineTo(a+c,l+u-b),n.quadraticCurveTo(a+c,l+u,a+c-b,l+u),r==="bottom"&&this.drawCaret(t,n,i,s),n.lineTo(a+p,l+u),n.quadraticCurveTo(a,l+u,a,l+u-p),r==="center"&&o==="left"&&this.drawCaret(t,n,i,s),n.lineTo(a,l+d),n.quadraticCurveTo(a,l,a+d,l),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){let n=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){let r=Os[t.position].call(this,this._active,this._eventPosition);if(!r)return;let a=this._size=Bf(this,t),l=Object.assign({},r,this._size),c=Wf(n,t,l),u=jf(t,l,c,n);(s._to!==u.x||o._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){let n=this.options.setContext(this.getContext()),i=this.opacity;if(!i)return;this._updateAnimationTarget(n);let s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;let r=kt(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,s,n),or(t,n.textDirection),o.y+=r.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),rr(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){let i=this._active,s=t.map(({datasetIndex:a,index:l})=>{let c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!vi(i,s),r=this._positionChanged(s,n);(o||r)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let s=this.options,o=this._active||[],r=this._getActiveElements(t,o,n,i),a=this._positionChanged(r,t),l=n||!vi(r,o)||a;return l&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,i,s){let o=this.options;if(t.type==="mouseout")return[];if(!s)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);let r=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&r.reverse(),r}_positionChanged(t,n){let{caretX:i,caretY:s,options:o}=this,r=Os[o.position].call(this,t,n);return r!==!1&&(i!==r.x||s!==r.y)}};F(Rs,"positioners",Os);mh={id:"tooltip",_element:Rs,positioners:Os,afterInit(e,t,n){n&&(e.tooltip=new Rs({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){let t=e.tooltip;if(t&&t._willRender()){let n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){let n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:gh},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"]},q0=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);J0=(e,t)=>e===null?null:Bt(Math.round(e),0,t);Ti=class extends Qn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){let n=this._addedLabels;if(n.length){let i=this.getLabels();for(let{index:s,label:o}of n)i[s]===o&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(X(t))return null;let i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:Z0(i,t,W(n,t),this._addedLabels),J0(n,i.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:n}=this.getUserBounds(),{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),n||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){let t=this.min,n=this.max,i=this.options.offset,s=[],o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let r=t;r<=n;r++)s.push({value:r});return s}getLabelForValue(t){return Gf.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){let n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}};F(Ti,"id","category"),F(Ti,"defaults",{ticks:{callback:Gf}});Di=class extends Qn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return X(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds(),{min:s,max:o}=this,r=l=>s=n?s:l,a=l=>o=i?o:l;if(t){let l=me(s),c=me(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(s-l)}this.min=s,this.max=o}getTickLimit(){let t=this.options.ticks,{maxTicksLimit:n,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(\`scales.\${this.id}.ticks.stepSize: \${i} would result generating up to \${s} ticks. Limiting to 1000.\`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let t=this.options,n=t.ticks,i=this.getTickLimit();i=Math.max(2,i);let s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,r=Q0(s,o);return t.bounds==="ticks"&&Wo(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){let t=this.ticks,n=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){let s=(i-n)/Math.max(t.length-1,1)/2;n-=s,i+=s}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return xs(t,this.chart.options.locale,this.options.ticks.format)}},Ci=class extends Di{determineDataLimits(){let{min:t,max:n}=this.getMinMax(!0);this.min=ht(t)?t:0,this.max=ht(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),n=t?this.width:this.height,i=Oe(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}};F(Ci,"id","linear"),F(Ci,"defaults",{ticks:{callback:ys.formatters.numeric}});Ns=e=>Math.floor(De(e)),Xn=(e,t)=>Math.pow(10,Ns(e)+t);dr=class extends Qn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){let i=Di.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return ht(i)&&i>0?i:null}determineDataLimits(){let{min:t,max:n}=this.getMinMax(!0);this.min=ht(t)?Math.max(0,t):null,this.max=ht(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ht(this._userMin)&&(this.min=t===Xn(this.min,0)?Xn(this.min,-1):Xn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:n}=this.getUserBounds(),i=this.min,s=this.max,o=a=>i=t?i:a,r=a=>s=n?s:a;i===s&&(i<=0?(o(1),r(10)):(o(Xn(i,-1)),r(Xn(s,1)))),i<=0&&o(Xn(s,-1)),s<=0&&r(Xn(i,1)),this.min=i,this.max=s}buildTicks(){let t=this.options,n={min:this._userMin,max:this._userMax},i=ey(n,this);return t.bounds==="ticks"&&Wo(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":xs(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=De(t),this._valueRange=De(this.max)-De(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(De(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}};F(dr,"id","logarithmic"),F(dr,"defaults",{ticks:{callback:ys.formatters.logarithmic,major:{enabled:!0}}});Ei=class extends Di{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let t=this._padding=kt(Wl(this.options)/2),n=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(n,i)/2)}determineDataLimits(){let{min:t,max:n}=this.getMinMax(!1);this.min=ht(t)&&!isNaN(t)?t:0,this.max=ht(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Wl(this.options))}generateTickLabels(t){Di.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,i)=>{let s=z(this.options.pointLabels.callback,[n,i],this);return s||s===0?s:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){let t=this.options;t.display&&t.pointLabels.display?iy(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,s){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,s))}getIndexAngle(t){let n=Ht/(this._pointLabels.length||1),i=this.options.startAngle||0;return Xt(t*n+Oe(i))}getDistanceFromCenterForValue(t){if(X(t))return NaN;let n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(X(t))return NaN;let n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){let n=this._pointLabels||[];if(t>=0&&t<n.length){let i=n[t];return py(this.getContext(),t,i)}}getPointPosition(t,n,i=0){let s=this.getIndexAngle(t)-Dt+i;return{x:Math.cos(s)*n+this.xCenter,y:Math.sin(s)*n+this.yCenter,angle:s}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){let{left:n,top:i,right:s,bottom:o}=this._pointLabelItems[t];return{left:n,top:i,right:s,bottom:o}}drawBackground(){let{backgroundColor:t,grid:{circular:n}}=this.options;if(t){let i=this.ctx;i.save(),i.beginPath(),bh(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){let t=this.ctx,n=this.options,{angleLines:i,grid:s,border:o}=n,r=this._pointLabels.length,a,l,c;if(n.pointLabels.display&&fy(this,r),s.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);let f=this.getContext(d),p=s.setContext(f),b=o.setContext(f);hy(this,p,l,r,b)}}),i.display){for(t.save(),a=r-1;a>=0;a--){let u=i.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){let t=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;let s=this.getIndexAngle(0),o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;let c=i.setContext(this.getContext(l)),u=gt(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,r=t.measureText(a.label).width,t.fillStyle=c.backdropColor;let d=kt(c.backdropPadding);t.fillRect(-r/2-d.left,-o-u.size/2-d.top,r+d.width,u.size+d.height)}_n(t,a.label,0,-o,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}};F(Ei,"id","radialLinear"),F(Ei,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ys.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),F(Ei,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),F(Ei,"descriptors",{angleLines:{_fallback:"grid"}});vr={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}},jt=Object.keys(vr);Pi=class extends Qn{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){let i=t.time||(t.time={}),s=this._adapter=new Ex._date(t.adapters.date);s.init(n),Un(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:Jf(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,n=this._adapter,i=t.time.unit||"day",{min:s,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(c){!r&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!r||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=ht(s)&&!isNaN(s)?s:+n.startOf(Date.now(),i),o=ht(o)&&!isNaN(o)?o:+n.endOf(Date.now(),i)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){let t=this.getLabelTimestamps(),n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],i=t[t.length-1]),{min:n,max:i}}buildTicks(){let t=this.options,n=t.time,i=t.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);let o=this.min,r=this.max,a=el(s,o,r);return this._unit=n.unit||(i.autoSkip?Qf(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):gy(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:my(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),eh(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,i=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?i=o:i=(o-this.getDecimalForValue(t[t.length-2]))/2);let r=t.length<3?.5:.25;n=Bt(n,0,r),i=Bt(i,0,r),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){let t=this._adapter,n=this.min,i=this.max,s=this.options,o=s.time,r=o.unit||Qf(o.minUnit,n,i,this._getLabelCapacity(n)),a=W(s.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=Gn(l)||l===!0,u={},d=n,f,p;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":r),t.diff(i,n,r)>1e5*a)throw new Error(n+" and "+i+" are too far apart with stepSize of "+a+" "+r);let b=s.ticks.source==="data"&&this.getDataTimestamps();for(f=d,p=0;f<i;f=+t.add(f,a,r),p++)th(u,f,b);return(f===i||s.bounds==="ticks"||p===1)&&th(u,f,b),Object.keys(u).sort(Zf).map(x=>+x)}getLabelForValue(t){let n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){let s=this.options.time.displayFormats,o=this._unit,r=n||s[o];return this._adapter.format(t,r)}_tickFormatFunction(t,n,i,s){let o=this.options,r=o.ticks.callback;if(r)return z(r,[t,n,i],this);let a=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],f=i[n],p=c&&d&&f&&f.major;return this._adapter.format(t,s||(p?d:u))}generateTickLabels(t){let n,i,s;for(n=0,i=t.length;n<i;++n)s=t[n],s.label=this._tickFormatFunction(s.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){let n=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+i)*n.factor)}getValueForPixel(t){let n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){let n=this.options.ticks,i=this.ctx.measureText(t).width,s=Oe(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(s),r=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*o+a*r,h:i*r+a*o}}_getLabelCapacity(t){let n=this.options.time,i=n.displayFormats,s=i[n.unit]||i.millisecond,o=this._tickFormatFunction(t,0,eh(this,[t],this._majorUnit),s),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,i;if(t.length)return t;let s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,i=s.length;n<i;++n)t=t.concat(s[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){let t=this._cache.labels||[],n,i;if(t.length)return t;let s=this.getLabels();for(n=0,i=s.length;n<i;++n)t.push(Jf(this,s[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return il(t.sort(Zf))}};F(Pi,"id","time"),F(Pi,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});hr=class extends Pi{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=fr(n,this.min),this._tableRange=fr(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){let{min:n,max:i}=this,s=[],o=[],r,a,l,c,u;for(r=0,a=t.length;r<a;++r)c=t[r],c>=n&&c<=i&&s.push(c);if(s.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(r=0,a=s.length;r<a;++r)u=s[r+1],l=s[r-1],c=s[r],Math.round((u+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_generate(){let t=this.min,n=this.max,i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(n)||i.length===1)&&i.push(n),i.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;let n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?t=this.normalize(n.concat(i)):t=n.length?n:i,t=this._cache.all=t,t}getDecimalForValue(t){return(fr(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){let n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return fr(this._table,i*this._tableRange+this._minPos,!0)}};F(hr,"id","timeseries"),F(hr,"defaults",Pi.defaults)});var yh=Ig((pE,wr)=>{(function(e,t,n,i){"use strict";var s=["","webkit","Moz","MS","ms","o"],o=t.createElement("div"),r="function",a=Math.round,l=Math.abs,c=Date.now;function u(h,g,v){return setTimeout(_(h,v),g)}function d(h,g,v){return Array.isArray(h)?(f(h,v[g],v),!0):!1}function f(h,g,v){var k;if(h)if(h.forEach)h.forEach(g,v);else if(h.length!==i)for(k=0;k<h.length;)g.call(v,h[k],k,h),k++;else for(k in h)h.hasOwnProperty(k)&&g.call(v,h[k],k,h)}function p(h,g,v){var k="DEPRECATED METHOD: "+g+\`
5419
+ \`+v+\` AT
5420
+ \`;return function(){var C=new Error("get-stack-trace"),I=C&&C.stack?C.stack.replace(/^[^\\(]+?[\\n$]/gm,"").replace(/^\\s+at\\s+/gm,"").replace(/^Object.<anonymous>\\s*\\(/gm,"{anonymous}()@"):"Unknown Stack Trace",U=e.console&&(e.console.warn||e.console.log);return U&&U.call(e.console,k,I),h.apply(this,arguments)}}var b;typeof Object.assign!="function"?b=function(g){if(g===i||g===null)throw new TypeError("Cannot convert undefined or null to object");for(var v=Object(g),k=1;k<arguments.length;k++){var C=arguments[k];if(C!==i&&C!==null)for(var I in C)C.hasOwnProperty(I)&&(v[I]=C[I])}return v}:b=Object.assign;var x=p(function(g,v,k){for(var C=Object.keys(v),I=0;I<C.length;)(!k||k&&g[C[I]]===i)&&(g[C[I]]=v[C[I]]),I++;return g},"extend","Use \`assign\`."),y=p(function(g,v){return x(g,v,!0)},"merge","Use \`assign\`.");function w(h,g,v){var k=g.prototype,C;C=h.prototype=Object.create(k),C.constructor=h,C._super=k,v&&b(C,v)}function _(h,g){return function(){return h.apply(g,arguments)}}function S(h,g){return typeof h==r?h.apply(g&&g[0]||i,g):h}function T(h,g){return h===i?g:h}function E(h,g,v){f(N(g),function(k){h.addEventListener(k,v,!1)})}function D(h,g,v){f(N(g),function(k){h.removeEventListener(k,v,!1)})}function O(h,g){for(;h;){if(h==g)return!0;h=h.parentNode}return!1}function A(h,g){return h.indexOf(g)>-1}function N(h){return h.trim().split(/\\s+/g)}function j(h,g,v){if(h.indexOf&&!v)return h.indexOf(g);for(var k=0;k<h.length;){if(v&&h[k][v]==g||!v&&h[k]===g)return k;k++}return-1}function H(h){return Array.prototype.slice.call(h,0)}function G(h,g,v){for(var k=[],C=[],I=0;I<h.length;){var U=g?h[I][g]:h[I];j(C,U)<0&&k.push(h[I]),C[I]=U,I++}return v&&(g?k=k.sort(function(yt,Pt){return yt[g]>Pt[g]}):k=k.sort()),k}function ot(h,g){for(var v,k,C=g[0].toUpperCase()+g.slice(1),I=0;I<s.length;){if(v=s[I],k=v?v+C:g,k in h)return k;I++}return i}var Ct=1;function Q(){return Ct++}function tt(h){var g=h.ownerDocument||h;return g.defaultView||g.parentWindow||e}var mt=/mobile|tablet|ip(ad|hone|od)|android/i,ce="ontouchstart"in e,ni=ot(e,"PointerEvent")!==i,rn=ce&&mt.test(navigator.userAgent),ve="touch",an="pen",Ve="mouse",Fe="kinect",Pn=25,nt=1,Dn=2,lt=4,It=8,Ys=1,Ni=2,Li=4,zi=8,Vi=16,we=Ni|Li,An=zi|Vi,fc=we|An,hc=["x","y"],Ks=["clientX","clientY"];function Jt(h,g){var v=this;this.manager=h,this.callback=g,this.element=h.element,this.target=h.options.inputTarget,this.domHandler=function(k){S(h.options.enable,[h])&&v.handler(k)},this.init()}Jt.prototype={handler:function(){},init:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(tt(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&D(this.element,this.evEl,this.domHandler),this.evTarget&&D(this.target,this.evTarget,this.domHandler),this.evWin&&D(tt(this.element),this.evWin,this.domHandler)}};function eg(h){var g,v=h.options.inputClass;return v?g=v:ni?g=Or:rn?g=Zs:ce?g=Rr:g=qs,new g(h,ng)}function ng(h,g,v){var k=v.pointers.length,C=v.changedPointers.length,I=g&nt&&k-C===0,U=g&(lt|It)&&k-C===0;v.isFirst=!!I,v.isFinal=!!U,I&&(h.session={}),v.eventType=g,ig(h,v),h.emit("hammer.input",v),h.recognize(v),h.session.prevInput=v}function ig(h,g){var v=h.session,k=g.pointers,C=k.length;v.firstInput||(v.firstInput=pc(g)),C>1&&!v.firstMultiple?v.firstMultiple=pc(g):C===1&&(v.firstMultiple=!1);var I=v.firstInput,U=v.firstMultiple,bt=U?U.center:I.center,yt=g.center=gc(k);g.timeStamp=c(),g.deltaTime=g.timeStamp-I.timeStamp,g.angle=Ar(bt,yt),g.distance=Xs(bt,yt),sg(v,g),g.offsetDirection=bc(g.deltaX,g.deltaY);var Pt=mc(g.deltaTime,g.deltaX,g.deltaY);g.overallVelocityX=Pt.x,g.overallVelocityY=Pt.y,g.overallVelocity=l(Pt.x)>l(Pt.y)?Pt.x:Pt.y,g.scale=U?ag(U.pointers,k):1,g.rotation=U?rg(U.pointers,k):0,g.maxPointers=v.prevInput?g.pointers.length>v.prevInput.maxPointers?g.pointers.length:v.prevInput.maxPointers:g.pointers.length,og(v,g);var ke=h.element;O(g.srcEvent.target,ke)&&(ke=g.srcEvent.target),g.target=ke}function sg(h,g){var v=g.center,k=h.offsetDelta||{},C=h.prevDelta||{},I=h.prevInput||{};(g.eventType===nt||I.eventType===lt)&&(C=h.prevDelta={x:I.deltaX||0,y:I.deltaY||0},k=h.offsetDelta={x:v.x,y:v.y}),g.deltaX=C.x+(v.x-k.x),g.deltaY=C.y+(v.y-k.y)}function og(h,g){var v=h.lastInterval||g,k=g.timeStamp-v.timeStamp,C,I,U,bt;if(g.eventType!=It&&(k>Pn||v.velocity===i)){var yt=g.deltaX-v.deltaX,Pt=g.deltaY-v.deltaY,ke=mc(k,yt,Pt);I=ke.x,U=ke.y,C=l(ke.x)>l(ke.y)?ke.x:ke.y,bt=bc(yt,Pt),h.lastInterval=g}else C=v.velocity,I=v.velocityX,U=v.velocityY,bt=v.direction;g.velocity=C,g.velocityX=I,g.velocityY=U,g.direction=bt}function pc(h){for(var g=[],v=0;v<h.pointers.length;)g[v]={clientX:a(h.pointers[v].clientX),clientY:a(h.pointers[v].clientY)},v++;return{timeStamp:c(),pointers:g,center:gc(g),deltaX:h.deltaX,deltaY:h.deltaY}}function gc(h){var g=h.length;if(g===1)return{x:a(h[0].clientX),y:a(h[0].clientY)};for(var v=0,k=0,C=0;C<g;)v+=h[C].clientX,k+=h[C].clientY,C++;return{x:a(v/g),y:a(k/g)}}function mc(h,g,v){return{x:g/h||0,y:v/h||0}}function bc(h,g){return h===g?Ys:l(h)>=l(g)?h<0?Ni:Li:g<0?zi:Vi}function Xs(h,g,v){v||(v=hc);var k=g[v[0]]-h[v[0]],C=g[v[1]]-h[v[1]];return Math.sqrt(k*k+C*C)}function Ar(h,g,v){v||(v=hc);var k=g[v[0]]-h[v[0]],C=g[v[1]]-h[v[1]];return Math.atan2(C,k)*180/Math.PI}function rg(h,g){return Ar(g[1],g[0],Ks)+Ar(h[1],h[0],Ks)}function ag(h,g){return Xs(g[0],g[1],Ks)/Xs(h[0],h[1],Ks)}var lg={mousedown:nt,mousemove:Dn,mouseup:lt},cg="mousedown",ug="mousemove mouseup";function qs(){this.evEl=cg,this.evWin=ug,this.pressed=!1,Jt.apply(this,arguments)}w(qs,Jt,{handler:function(g){var v=lg[g.type];v&nt&&g.button===0&&(this.pressed=!0),v&Dn&&g.which!==1&&(v=lt),this.pressed&&(v&lt&&(this.pressed=!1),this.callback(this.manager,v,{pointers:[g],changedPointers:[g],pointerType:Ve,srcEvent:g}))}});var dg={pointerdown:nt,pointermove:Dn,pointerup:lt,pointercancel:It,pointerout:It},fg={2:ve,3:an,4:Ve,5:Fe},xc="pointerdown",yc="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&(xc="MSPointerDown",yc="MSPointerMove MSPointerUp MSPointerCancel");function Or(){this.evEl=xc,this.evWin=yc,Jt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}w(Or,Jt,{handler:function(g){var v=this.store,k=!1,C=g.type.toLowerCase().replace("ms",""),I=dg[C],U=fg[g.pointerType]||g.pointerType,bt=U==ve,yt=j(v,g.pointerId,"pointerId");I&nt&&(g.button===0||bt)?yt<0&&(v.push(g),yt=v.length-1):I&(lt|It)&&(k=!0),!(yt<0)&&(v[yt]=g,this.callback(this.manager,I,{pointers:v,changedPointers:[g],pointerType:U,srcEvent:g}),k&&v.splice(yt,1))}});var hg={touchstart:nt,touchmove:Dn,touchend:lt,touchcancel:It},pg="touchstart",gg="touchstart touchmove touchend touchcancel";function vc(){this.evTarget=pg,this.evWin=gg,this.started=!1,Jt.apply(this,arguments)}w(vc,Jt,{handler:function(g){var v=hg[g.type];if(v===nt&&(this.started=!0),!!this.started){var k=mg.call(this,g,v);v&(lt|It)&&k[0].length-k[1].length===0&&(this.started=!1),this.callback(this.manager,v,{pointers:k[0],changedPointers:k[1],pointerType:ve,srcEvent:g})}}});function mg(h,g){var v=H(h.touches),k=H(h.changedTouches);return g&(lt|It)&&(v=G(v.concat(k),"identifier",!0)),[v,k]}var bg={touchstart:nt,touchmove:Dn,touchend:lt,touchcancel:It},xg="touchstart touchmove touchend touchcancel";function Zs(){this.evTarget=xg,this.targetIds={},Jt.apply(this,arguments)}w(Zs,Jt,{handler:function(g){var v=bg[g.type],k=yg.call(this,g,v);k&&this.callback(this.manager,v,{pointers:k[0],changedPointers:k[1],pointerType:ve,srcEvent:g})}});function yg(h,g){var v=H(h.touches),k=this.targetIds;if(g&(nt|Dn)&&v.length===1)return k[v[0].identifier]=!0,[v,v];var C,I,U=H(h.changedTouches),bt=[],yt=this.target;if(I=v.filter(function(Pt){return O(Pt.target,yt)}),g===nt)for(C=0;C<I.length;)k[I[C].identifier]=!0,C++;for(C=0;C<U.length;)k[U[C].identifier]&&bt.push(U[C]),g&(lt|It)&&delete k[U[C].identifier],C++;if(bt.length)return[G(I.concat(bt),"identifier",!0),bt]}var vg=2500,wc=25;function Rr(){Jt.apply(this,arguments);var h=_(this.handler,this);this.touch=new Zs(this.manager,h),this.mouse=new qs(this.manager,h),this.primaryTouch=null,this.lastTouches=[]}w(Rr,Jt,{handler:function(g,v,k){var C=k.pointerType==ve,I=k.pointerType==Ve;if(!(I&&k.sourceCapabilities&&k.sourceCapabilities.firesTouchEvents)){if(C)wg.call(this,v,k);else if(I&&_g.call(this,k))return;this.callback(g,v,k)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function wg(h,g){h&nt?(this.primaryTouch=g.changedPointers[0].identifier,_c.call(this,g)):h&(lt|It)&&_c.call(this,g)}function _c(h){var g=h.changedPointers[0];if(g.identifier===this.primaryTouch){var v={x:g.clientX,y:g.clientY};this.lastTouches.push(v);var k=this.lastTouches,C=function(){var I=k.indexOf(v);I>-1&&k.splice(I,1)};setTimeout(C,vg)}}function _g(h){for(var g=h.srcEvent.clientX,v=h.srcEvent.clientY,k=0;k<this.lastTouches.length;k++){var C=this.lastTouches[k],I=Math.abs(g-C.x),U=Math.abs(v-C.y);if(I<=wc&&U<=wc)return!0}return!1}var kc=ot(o.style,"touchAction"),Sc=kc!==i,Ec="compute",Mc="auto",Ir="manipulation",On="none",Fi="pan-x",Hi="pan-y",Js=Sg();function Nr(h,g){this.manager=h,this.set(g)}Nr.prototype={set:function(h){h==Ec&&(h=this.compute()),Sc&&this.manager.element.style&&Js[h]&&(this.manager.element.style[kc]=h),this.actions=h.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var h=[];return f(this.manager.recognizers,function(g){S(g.options.enable,[g])&&(h=h.concat(g.getTouchAction()))}),kg(h.join(" "))},preventDefaults:function(h){var g=h.srcEvent,v=h.offsetDirection;if(this.manager.session.prevented){g.preventDefault();return}var k=this.actions,C=A(k,On)&&!Js[On],I=A(k,Hi)&&!Js[Hi],U=A(k,Fi)&&!Js[Fi];if(C){var bt=h.pointers.length===1,yt=h.distance<2,Pt=h.deltaTime<250;if(bt&&yt&&Pt)return}if(!(U&&I)&&(C||I&&v&we||U&&v&An))return this.preventSrc(g)},preventSrc:function(h){this.manager.session.prevented=!0,h.preventDefault()}};function kg(h){if(A(h,On))return On;var g=A(h,Fi),v=A(h,Hi);return g&&v?On:g||v?g?Fi:Hi:A(h,Ir)?Ir:Mc}function Sg(){if(!Sc)return!1;var h={},g=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(v){h[v]=g?e.CSS.supports("touch-action",v):!0}),h}var Qs=1,Qt=2,ii=4,ln=8,He=ln,Bi=16,_e=32;function Be(h){this.options=b({},this.defaults,h||{}),this.id=Q(),this.manager=null,this.options.enable=T(this.options.enable,!0),this.state=Qs,this.simultaneous={},this.requireFail=[]}Be.prototype={defaults:{},set:function(h){return b(this.options,h),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(h){if(d(h,"recognizeWith",this))return this;var g=this.simultaneous;return h=to(h,this),g[h.id]||(g[h.id]=h,h.recognizeWith(this)),this},dropRecognizeWith:function(h){return d(h,"dropRecognizeWith",this)?this:(h=to(h,this),delete this.simultaneous[h.id],this)},requireFailure:function(h){if(d(h,"requireFailure",this))return this;var g=this.requireFail;return h=to(h,this),j(g,h)===-1&&(g.push(h),h.requireFailure(this)),this},dropRequireFailure:function(h){if(d(h,"dropRequireFailure",this))return this;h=to(h,this);var g=j(this.requireFail,h);return g>-1&&this.requireFail.splice(g,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(h){return!!this.simultaneous[h.id]},emit:function(h){var g=this,v=this.state;function k(C){g.manager.emit(C,h)}v<ln&&k(g.options.event+Tc(v)),k(g.options.event),h.additionalEvent&&k(h.additionalEvent),v>=ln&&k(g.options.event+Tc(v))},tryEmit:function(h){if(this.canEmit())return this.emit(h);this.state=_e},canEmit:function(){for(var h=0;h<this.requireFail.length;){if(!(this.requireFail[h].state&(_e|Qs)))return!1;h++}return!0},recognize:function(h){var g=b({},h);if(!S(this.options.enable,[this,g])){this.reset(),this.state=_e;return}this.state&(He|Bi|_e)&&(this.state=Qs),this.state=this.process(g),this.state&(Qt|ii|ln|Bi)&&this.tryEmit(g)},process:function(h){},getTouchAction:function(){},reset:function(){}};function Tc(h){return h&Bi?"cancel":h&ln?"end":h&ii?"move":h&Qt?"start":""}function Cc(h){return h==Vi?"down":h==zi?"up":h==Ni?"left":h==Li?"right":""}function to(h,g){var v=g.manager;return v?v.get(h):h}function ue(){Be.apply(this,arguments)}w(ue,Be,{defaults:{pointers:1},attrTest:function(h){var g=this.options.pointers;return g===0||h.pointers.length===g},process:function(h){var g=this.state,v=h.eventType,k=g&(Qt|ii),C=this.attrTest(h);return k&&(v&It||!C)?g|Bi:k||C?v&lt?g|ln:g&Qt?g|ii:Qt:_e}});function eo(){ue.apply(this,arguments),this.pX=null,this.pY=null}w(eo,ue,{defaults:{event:"pan",threshold:10,pointers:1,direction:fc},getTouchAction:function(){var h=this.options.direction,g=[];return h&we&&g.push(Hi),h&An&&g.push(Fi),g},directionTest:function(h){var g=this.options,v=!0,k=h.distance,C=h.direction,I=h.deltaX,U=h.deltaY;return C&g.direction||(g.direction&we?(C=I===0?Ys:I<0?Ni:Li,v=I!=this.pX,k=Math.abs(h.deltaX)):(C=U===0?Ys:U<0?zi:Vi,v=U!=this.pY,k=Math.abs(h.deltaY))),h.direction=C,v&&k>g.threshold&&C&g.direction},attrTest:function(h){return ue.prototype.attrTest.call(this,h)&&(this.state&Qt||!(this.state&Qt)&&this.directionTest(h))},emit:function(h){this.pX=h.deltaX,this.pY=h.deltaY;var g=Cc(h.direction);g&&(h.additionalEvent=this.options.event+g),this._super.emit.call(this,h)}});function Lr(){ue.apply(this,arguments)}w(Lr,ue,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[On]},attrTest:function(h){return this._super.attrTest.call(this,h)&&(Math.abs(h.scale-1)>this.options.threshold||this.state&Qt)},emit:function(h){if(h.scale!==1){var g=h.scale<1?"in":"out";h.additionalEvent=this.options.event+g}this._super.emit.call(this,h)}});function zr(){Be.apply(this,arguments),this._timer=null,this._input=null}w(zr,Be,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Mc]},process:function(h){var g=this.options,v=h.pointers.length===g.pointers,k=h.distance<g.threshold,C=h.deltaTime>g.time;if(this._input=h,!k||!v||h.eventType&(lt|It)&&!C)this.reset();else if(h.eventType&nt)this.reset(),this._timer=u(function(){this.state=He,this.tryEmit()},g.time,this);else if(h.eventType&lt)return He;return _e},reset:function(){clearTimeout(this._timer)},emit:function(h){this.state===He&&(h&&h.eventType&lt?this.manager.emit(this.options.event+"up",h):(this._input.timeStamp=c(),this.manager.emit(this.options.event,this._input)))}});function Vr(){ue.apply(this,arguments)}w(Vr,ue,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[On]},attrTest:function(h){return this._super.attrTest.call(this,h)&&(Math.abs(h.rotation)>this.options.threshold||this.state&Qt)}});function Fr(){ue.apply(this,arguments)}w(Fr,ue,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:we|An,pointers:1},getTouchAction:function(){return eo.prototype.getTouchAction.call(this)},attrTest:function(h){var g=this.options.direction,v;return g&(we|An)?v=h.overallVelocity:g&we?v=h.overallVelocityX:g&An&&(v=h.overallVelocityY),this._super.attrTest.call(this,h)&&g&h.offsetDirection&&h.distance>this.options.threshold&&h.maxPointers==this.options.pointers&&l(v)>this.options.velocity&&h.eventType&lt},emit:function(h){var g=Cc(h.offsetDirection);g&&this.manager.emit(this.options.event+g,h),this.manager.emit(this.options.event,h)}});function no(){Be.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}w(no,Be,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Ir]},process:function(h){var g=this.options,v=h.pointers.length===g.pointers,k=h.distance<g.threshold,C=h.deltaTime<g.time;if(this.reset(),h.eventType&nt&&this.count===0)return this.failTimeout();if(k&&C&&v){if(h.eventType!=lt)return this.failTimeout();var I=this.pTime?h.timeStamp-this.pTime<g.interval:!0,U=!this.pCenter||Xs(this.pCenter,h.center)<g.posThreshold;this.pTime=h.timeStamp,this.pCenter=h.center,!U||!I?this.count=1:this.count+=1,this._input=h;var bt=this.count%g.taps;if(bt===0)return this.hasRequireFailures()?(this._timer=u(function(){this.state=He,this.tryEmit()},g.interval,this),Qt):He}return _e},failTimeout:function(){return this._timer=u(function(){this.state=_e},this.options.interval,this),_e},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==He&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function We(h,g){return g=g||{},g.recognizers=T(g.recognizers,We.defaults.preset),new Hr(h,g)}We.VERSION="2.0.7",We.defaults={domEvents:!1,touchAction:Ec,enable:!0,inputTarget:null,inputClass:null,preset:[[Vr,{enable:!1}],[Lr,{enable:!1},["rotate"]],[Fr,{direction:we}],[eo,{direction:we},["swipe"]],[no],[no,{event:"doubletap",taps:2},["tap"]],[zr]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Eg=1,Pc=2;function Hr(h,g){this.options=b({},We.defaults,g||{}),this.options.inputTarget=this.options.inputTarget||h,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=h,this.input=eg(this),this.touchAction=new Nr(this,this.options.touchAction),Dc(this,!0),f(this.options.recognizers,function(v){var k=this.add(new v[0](v[1]));v[2]&&k.recognizeWith(v[2]),v[3]&&k.requireFailure(v[3])},this)}Hr.prototype={set:function(h){return b(this.options,h),h.touchAction&&this.touchAction.update(),h.inputTarget&&(this.input.destroy(),this.input.target=h.inputTarget,this.input.init()),this},stop:function(h){this.session.stopped=h?Pc:Eg},recognize:function(h){var g=this.session;if(!g.stopped){this.touchAction.preventDefaults(h);var v,k=this.recognizers,C=g.curRecognizer;(!C||C&&C.state&He)&&(C=g.curRecognizer=null);for(var I=0;I<k.length;)v=k[I],g.stopped!==Pc&&(!C||v==C||v.canRecognizeWith(C))?v.recognize(h):v.reset(),!C&&v.state&(Qt|ii|ln)&&(C=g.curRecognizer=v),I++}},get:function(h){if(h instanceof Be)return h;for(var g=this.recognizers,v=0;v<g.length;v++)if(g[v].options.event==h)return g[v];return null},add:function(h){if(d(h,"add",this))return this;var g=this.get(h.options.event);return g&&this.remove(g),this.recognizers.push(h),h.manager=this,this.touchAction.update(),h},remove:function(h){if(d(h,"remove",this))return this;if(h=this.get(h),h){var g=this.recognizers,v=j(g,h);v!==-1&&(g.splice(v,1),this.touchAction.update())}return this},on:function(h,g){if(h!==i&&g!==i){var v=this.handlers;return f(N(h),function(k){v[k]=v[k]||[],v[k].push(g)}),this}},off:function(h,g){if(h!==i){var v=this.handlers;return f(N(h),function(k){g?v[k]&&v[k].splice(j(v[k],g),1):delete v[k]}),this}},emit:function(h,g){this.options.domEvents&&Mg(h,g);var v=this.handlers[h]&&this.handlers[h].slice();if(!(!v||!v.length)){g.type=h,g.preventDefault=function(){g.srcEvent.preventDefault()};for(var k=0;k<v.length;)v[k](g),k++}},destroy:function(){this.element&&Dc(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Dc(h,g){var v=h.element;if(v.style){var k;f(h.options.cssProps,function(C,I){k=ot(v.style,I),g?(h.oldCssProps[k]=v.style[k],v.style[k]=C):v.style[k]=h.oldCssProps[k]||""}),g||(h.oldCssProps={})}}function Mg(h,g){var v=t.createEvent("Event");v.initEvent(h,!0,!0),v.gesture=g,g.target.dispatchEvent(v)}b(We,{INPUT_START:nt,INPUT_MOVE:Dn,INPUT_END:lt,INPUT_CANCEL:It,STATE_POSSIBLE:Qs,STATE_BEGAN:Qt,STATE_CHANGED:ii,STATE_ENDED:ln,STATE_RECOGNIZED:He,STATE_CANCELLED:Bi,STATE_FAILED:_e,DIRECTION_NONE:Ys,DIRECTION_LEFT:Ni,DIRECTION_RIGHT:Li,DIRECTION_UP:zi,DIRECTION_DOWN:Vi,DIRECTION_HORIZONTAL:we,DIRECTION_VERTICAL:An,DIRECTION_ALL:fc,Manager:Hr,Input:Jt,TouchAction:Nr,TouchInput:Zs,MouseInput:qs,PointerEventInput:Or,TouchMouseInput:Rr,SingleTouchInput:vc,Recognizer:Be,AttrRecognizer:ue,Tap:no,Pan:eo,Swipe:Fr,Pinch:Lr,Rotate:Vr,Press:zr,on:E,off:D,each:f,merge:y,extend:x,assign:b,inherit:w,bindFn:_,prefixed:ot});var Tg=typeof e<"u"?e:typeof self<"u"?self:{};Tg.Hammer=We,typeof define=="function"&&define.amd?define(function(){return We}):typeof wr<"u"&&wr.exports?wr.exports=We:e[n]=We})(window,document,"Hammer")});var vh=M(()=>{Sl();});var wh=M(()=>{vh()});function Tn(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 jl(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 xy(e,t){let n;return function(){return clearTimeout(n),n=setTimeout(e,t),t}}function yy({x:e,y:t},n){let i=n.scales,s=Object.keys(i);for(let o=0;o<s.length;o++){let r=i[s[o]];if(t>=r.top&&t<=r.bottom&&e>=r.left&&e<=r.right)return r}return null}function Nh(e,t,n){let{mode:i="xy",scaleMode:s,overScaleMode:o}=e||{},r=yy(t,n),a=jl(i,n),l=jl(s,n);if(o){let u=jl(o,n);for(let d of["x","y"])u[d]&&(l[d]=a[d],a[d]=!1)}if(r&&l[r.axis])return[r];let c=[];return $(n.scales,function(u){a[u.axis]&&c.push(u)}),c}function st(e){let t=$l.get(e);return t||(t={originalScaleLimits:{},updatedScaleLimits:{},handlers:{},panDelta:{},dragging:!1,panning:!1},$l.set(e,t)),t}function vy(e){$l.delete(e)}function Lh(e,t,n,i){let s=Math.max(0,Math.min(1,(e-t)/n||0)),o=1-s;return{min:i*s,max:i*o}}function zh(e,t){let n=e.isHorizontal()?t.x:t.y;return e.getValueForPixel(n)}function Vh(e,t,n){let i=e.max-e.min,s=i*(t-1),o=zh(e,n);return Lh(o,e.min,i,s)}function wy(e,t,n){let i=zh(e,n);if(i===void 0)return{min:e.min,max:e.max};let s=Math.log10(e.min),o=Math.log10(e.max),r=Math.log10(i),a=o-s,l=a*(t-1),c=Lh(r,s,a,l);return{min:Math.pow(10,s+c.min),max:Math.pow(10,o-c.max)}}function _y(e,t){return t&&(t[e.id]||t[e.axis])||{}}function _h(e,t,n,i,s){let o=n[i];if(o==="original"){let r=e.originalScaleLimits[t.id][i];o=W(r.options,r.scale)}return W(o,s)}function ky(e,t,n){let i=e.getValueForPixel(t),s=e.getValueForPixel(n);return{min:Math.min(i,s),max:Math.max(i,s)}}function Sy(e,{min:t,max:n,minLimit:i,maxLimit:s},o){let r=(e-n+t)/2;t-=r,n+=r;let a=o.min.options??o.min.scale,l=o.max.options??o.max.scale,c=e/1e6;return Ae(t,a,c)&&(t=a),Ae(n,l,c)&&(n=l),t<i?(t=i,n=Math.min(i+e,s)):n>s&&(n=s,t=Math.max(s-e,i)),{min:t,max:n}}function ti(e,{min:t,max:n},i,s=!1){let o=st(e.chart),{options:r}=e,a=_y(e,i),{minRange:l=0}=a,c=_h(o,e,a,"min",-1/0),u=_h(o,e,a,"max",1/0);if(s==="pan"&&(t<c||n>u))return!0;let d=e.max-e.min,f=s?Math.max(n-t,l):d;if(s&&f===l&&d<=l)return!0;let p=Sy(f,{min:t,max:n,minLimit:c,maxLimit:u},o.originalScaleLimits[e.id]);return r.min=p.min,r.max=p.max,o.updatedScaleLimits[e.id]=p,e.parse(p.min)!==e.min||e.parse(p.max)!==e.max}function Ey(e,t,n,i){let s=Vh(e,t,n),o={min:e.min+s.min,max:e.max-s.max};return ti(e,o,i,!0)}function My(e,t,n,i){let s=wy(e,t,n);return ti(e,s,i,!0)}function Ty(e,t,n,i){ti(e,ky(e,t,n),i,!0)}function Cy(e){let n=e.getLabels().length-1;e.min>0&&(e.min-=1),e.max<n&&(e.max+=1)}function Py(e,t,n,i){let s=Vh(e,t,n);e.min===e.max&&t<1&&Cy(e);let o={min:e.min+kh(s.min),max:e.max-kh(s.max)};return ti(e,o,i,!0)}function Dy(e){return e.isHorizontal()?e.width:e.height}function Ay(e,t,n){let s=e.getLabels().length-1,{min:o,max:r}=e,a=Math.max(r-o,1),l=Math.round(Dy(e)/Math.max(a,10)),c=Math.round(Math.abs(t/l)),u;return t<-l?(r=Math.min(r+c,s),o=a===1?r:r-a,u=r===s):t>l&&(o=Math.max(0,o-c),r=a===1?o:o+a,u=o===0),ti(e,{min:o,max:r},n)||u}function Fh(e,t,n,i=!1){let{min:s,max:o,options:r}=e,a=r.time&&r.time.round,l=Oy[a]||0,c=e.getValueForPixel(e.getPixelForValue(s+l)-t),u=e.getValueForPixel(e.getPixelForValue(o+l)-t);return isNaN(c)||isNaN(u)?!0:ti(e,{min:c,max:u},n,i?"pan":!1)}function Sh(e,t,n){return Fh(e,t,n,!0)}function Ry(e,t,n){let{id:i,options:{min:s,max:o}}=e;if(!t[i]||!n[i])return!0;let r=n[i];return r.min!==s||r.max!==o}function Eh(e,t){$(e,(n,i)=>{t[i]||delete e[i]})}function Oi(e,t){let{scales:n}=e,{originalScaleLimits:i,updatedScaleLimits:s}=t;return $(n,function(o){Ry(o,i,s)&&(i[o.id]={min:{scale:o.min,options:o.options.min},max:{scale:o.max,options:o.options.max}})}),Eh(i,n),Eh(s,n),i}function Mh(e,t,n,i){let s=Ul[e.type]||Ul.default;z(s,[e,t,n,i])}function Th(e,t,n,i){let s=Gl[e.type]||Gl.default;z(s,[e,t,n,i])}function Iy(e){let t=e.chartArea;return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function Zl(e,t,n="none",i="api"){let{x:s=1,y:o=1,focalPoint:r=Iy(e)}=typeof t=="number"?{x:t,y:t}:t,a=st(e),{options:{limits:l,zoom:c}}=a;Oi(e,a);let u=s!==1,d=o!==1,f=Nh(c,r,e);$(f||e.scales,function(p){p.isHorizontal()&&u?Mh(p,s,r,l):!p.isHorizontal()&&d&&Mh(p,o,r,l)}),e.update(n),z(c.onZoom,[{chart:e,trigger:i}])}function Hh(e,t,n,i="none",s="api"){let o=st(e),{options:{limits:r,zoom:a}}=o,{mode:l="xy"}=a;Oi(e,o);let c=Tn(l,"x",e),u=Tn(l,"y",e);$(e.scales,function(d){d.isHorizontal()&&c?Th(d,t.x,n.x,r):!d.isHorizontal()&&u&&Th(d,t.y,n.y,r)}),e.update(i),z(a.onZoom,[{chart:e,trigger:s}])}function Ny(e,t,n,i="none",s="api"){let o=st(e);Oi(e,o);let r=e.scales[t];ti(r,n,void 0,!0),e.update(i),z(o.options.zoom?.onZoom,[{chart:e,trigger:s}])}function Ly(e,t="default"){let n=st(e),i=Oi(e,n);$(e.scales,function(s){let o=s.options;i[s.id]?(o.min=i[s.id].min.options,o.max=i[s.id].max.options):(delete o.min,delete o.max),delete n.updatedScaleLimits[s.id]}),e.update(t),z(n.options.zoom.onZoomComplete,[{chart:e}])}function zy(e,t){let n=e.originalScaleLimits[t];if(!n)return;let{min:i,max:s}=n;return W(s.options,s.scale)-W(i.options,i.scale)}function Vy(e){let t=st(e),n=1,i=1;return $(e.scales,function(s){let o=zy(t,s.id);if(o){let r=Math.round(o/(s.max-s.min)*100)/100;n=Math.min(n,r),i=Math.max(i,r)}}),n<1?n:i}function Ch(e,t,n,i){let{panDelta:s}=i,o=s[e.id]||0;me(o)===me(t)&&(t+=o);let r=Yl[e.type]||Yl.default;z(r,[e,t,n])?s[e.id]=0:s[e.id]=t}function Bh(e,t,n,i="none"){let{x:s=0,y:o=0}=typeof t=="number"?{x:t,y:t}:t,r=st(e),{options:{pan:a,limits:l}}=r,{onPan:c}=a||{};Oi(e,r);let u=s!==0,d=o!==0;$(n||e.scales,function(f){f.isHorizontal()&&u?Ch(f,s,l,r):!f.isHorizontal()&&d&&Ch(f,o,l,r)}),e.update(i),z(c,[{chart:e}])}function Wh(e){let t=st(e);Oi(e,t);let n={};for(let i of Object.keys(e.scales)){let{min:s,max:o}=t.originalScaleLimits[i]||{min:{},max:{}};n[i]={min:s.scale,max:o.scale}}return n}function Fy(e){let t=st(e),n={};for(let i of Object.keys(e.scales))n[i]=t.updatedScaleLimits[i];return n}function Hy(e){let t=Wh(e);for(let n of Object.keys(e.scales)){let{min:i,max:s}=t[n];if(i!==void 0&&e.scales[n].min!==i||s!==void 0&&e.scales[n].max!==s)return!0}return!1}function Ph(e){let t=st(e);return t.panning||t.dragging}function $t(e,t){let{handlers:n}=st(e),i=n[t];i&&i.target&&(i.target.removeEventListener(t,i),delete n[t])}function zs(e,t,n,i){let{handlers:s,options:o}=st(e),r=s[n];if(r&&r.target===t)return;$t(e,n),s[n]=l=>i(e,l,o),s[n].target=t;let a=n==="wheel"?!1:void 0;t.addEventListener(n,s[n],{passive:a})}function By(e,t){let n=st(e);n.dragStart&&(n.dragging=!0,n.dragEnd=t,e.update("none"))}function Wy(e,t){let n=st(e);!n.dragStart||t.key!=="Escape"||($t(e,"keydown"),n.dragging=!1,n.dragStart=n.dragEnd=null,e.update("none"))}function Kl(e,t){if(e.target!==t.canvas){let n=t.canvas.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}return Zt(e,t)}function jh(e,t,n){let{onZoomStart:i,onZoomRejected:s}=n;if(i){let o=Kl(t,e);if(z(i,[{chart:e,event:t,point:o}])===!1)return z(s,[{chart:e,event:t}]),!1}}function jy(e,t){if(e.legend){let o=Zt(t,e);if(qt(o,e.legend))return}let n=st(e),{pan:i,zoom:s={}}=n.options;if(t.button!==0||Ih(Vs(i),t)||ql(Vs(s.drag),t))return z(s.onZoomRejected,[{chart:e,event:t}]);jh(e,t,s)!==!1&&(n.dragStart=t,zs(e,e.canvas.ownerDocument,"mousemove",By),zs(e,window.document,"keydown",Wy))}function $y({begin:e,end:t},n){let i=t.x-e.x,s=t.y-e.y,o=Math.abs(i/s);o>n?i=Math.sign(i)*Math.abs(s*n):o<n&&(s=Math.sign(s)*Math.abs(i/n)),t.x=e.x+i,t.y=e.y+s}function Ah(e,t,n,{min:i,max:s,prop:o}){e[i]=Dh(Math.min(n.begin[o],n.end[o]),t[i],t[s]),e[s]=Dh(Math.max(n.begin[o],n.end[o]),t[i],t[s])}function Uy(e,t,n){let i={begin:Kl(t.dragStart,e),end:Kl(t.dragEnd,e)};if(n){let s=e.chartArea.width/e.chartArea.height;$y(i,s)}return i}function $h(e,t,n,i){let s=Tn(t,"x",e),o=Tn(t,"y",e),{top:r,left:a,right:l,bottom:c,width:u,height:d}=e.chartArea,f={top:r,left:a,right:l,bottom:c},p=Uy(e,n,i&&s&&o);s&&Ah(f,e.chartArea,p,{min:"left",max:"right",prop:"x"}),o&&Ah(f,e.chartArea,p,{min:"top",max:"bottom",prop:"y"});let b=f.right-f.left,x=f.bottom-f.top;return{...f,width:b,height:x,zoomX:s&&b?1+(u-b)/u:1,zoomY:o&&x?1+(d-x)/d:1}}function Gy(e,t){let n=st(e);if(!n.dragStart)return;$t(e,"mousemove");let{mode:i,onZoomComplete:s,drag:{threshold:o=0,maintainAspectRatio:r}}=n.options.zoom,a=$h(e,i,{dragStart:n.dragStart,dragEnd:t},r),l=Tn(i,"x",e)?a.width:0,c=Tn(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}Hh(e,{x:a.left,y:a.top},{x:a.right,y:a.bottom},"zoom","drag"),n.dragging=!1,n.filterNextClick=!0,z(s,[{chart:e}])}function Yy(e,t,n){if(ql(Vs(n.wheel),t)){z(n.onZoomRejected,[{chart:e,event:t}]);return}if(jh(e,t,n)!==!1&&(t.cancelable&&t.preventDefault(),t.deltaY!==void 0))return!0}function Ky(e,t){let{handlers:{onZoomComplete:n},options:{zoom:i}}=st(e);if(!Yy(e,t,i))return;let s=t.target.getBoundingClientRect(),o=i.wheel.speed,r=t.deltaY>=0?2-1/(1-o):1+o,a={x:r,y:r,focalPoint:{x:t.clientX-s.left,y:t.clientY-s.top}};Zl(e,a,"zoom","wheel"),z(n,[{chart:e}])}function Xy(e,t,n,i){n&&(st(e).handlers[t]=xy(()=>z(n,[{chart:e}]),i))}function qy(e,t){let n=e.canvas,{wheel:i,drag:s,onZoomComplete:o}=t.zoom;i.enabled?(zs(e,n,"wheel",Ky),Xy(e,"onZoomComplete",o,250)):$t(e,"wheel"),s.enabled?(zs(e,n,"mousedown",jy),zs(e,n.ownerDocument,"mouseup",Gy)):($t(e,"mousedown"),$t(e,"mousemove"),$t(e,"mouseup"),$t(e,"keydown"))}function Zy(e){$t(e,"mousedown"),$t(e,"mousemove"),$t(e,"mouseup"),$t(e,"wheel"),$t(e,"click"),$t(e,"keydown")}function Jy(e,t){return function(n,i){let{pan:s,zoom:o={}}=t.options;if(!s||!s.enabled)return!1;let r=i&&i.srcEvent;return r&&!t.panning&&i.pointerType==="mouse"&&(ql(Vs(s),r)||Ih(Vs(o.drag),r))?(z(s.onPanRejected,[{chart:e,event:i}]),!1):!0}}function Qy(e,t){let n=Math.abs(e.clientX-t.clientX),i=Math.abs(e.clientY-t.clientY),s=n/i,o,r;return s>.3&&s<1.7?o=r=!0:n>i?o=!0:r=!0,{x:o,y:r}}function Uh(e,t,n){if(t.scale){let{center:i,pointers:s}=n,o=1/t.scale*n.scale,r=n.target.getBoundingClientRect(),a=Qy(s[0],s[1]),l=t.options.zoom.mode,c={x:a.x&&Tn(l,"x",e)?o:1,y:a.y&&Tn(l,"y",e)?o:1,focalPoint:{x:i.x-r.left,y:i.y-r.top}};Zl(e,c,"zoom","pinch"),t.scale=n.scale}}function tv(e,t,n){if(t.options.zoom.pinch.enabled){let i=Zt(n,e);z(t.options.zoom.onZoomStart,[{chart:e,event:n,point:i}])===!1?(t.scale=null,z(t.options.zoom.onZoomRejected,[{chart:e,event:n}])):t.scale=1}}function ev(e,t,n){t.scale&&(Uh(e,t,n),t.scale=null,z(t.options.zoom.onZoomComplete,[{chart:e}]))}function Gh(e,t,n){let i=t.delta;i&&(t.panning=!0,Bh(e,{x:n.deltaX-i.x,y:n.deltaY-i.y},t.panScales),t.delta={x:n.deltaX,y:n.deltaY})}function nv(e,t,n){let{enabled:i,onPanStart:s,onPanRejected:o}=t.options.pan;if(!i)return;let r=n.target.getBoundingClientRect(),a={x:n.center.x-r.left,y:n.center.y-r.top};if(z(s,[{chart:e,event:n,point:a}])===!1)return z(o,[{chart:e,event:n}]);t.panScales=Nh(t.options.pan,a,e),t.delta={x:0,y:0},Gh(e,t,n)}function iv(e,t){t.delta=null,t.panning&&(t.panning=!1,t.filterNextClick=!0,z(t.options.pan.onPanComplete,[{chart:e}]))}function Oh(e,t){let n=st(e),i=e.canvas,{pan:s,zoom:o}=t,r=new Ai.default.Manager(i);o&&o.pinch.enabled&&(r.add(new Ai.default.Pinch),r.on("pinchstart",a=>tv(e,n,a)),r.on("pinch",a=>Uh(e,n,a)),r.on("pinchend",a=>ev(e,n,a))),s&&s.enabled&&(r.add(new Ai.default.Pan({threshold:s.threshold,enable:Jy(e,n)})),r.on("panstart",a=>nv(e,n,a)),r.on("panmove",a=>Gh(e,n,a)),r.on("panend",()=>iv(e,n))),Xl.set(e,r)}function Rh(e){let t=Xl.get(e);t&&(t.remove("pinchstart"),t.remove("pinch"),t.remove("pinchend"),t.remove("panstart"),t.remove("pan"),t.remove("panend"),t.destroy(),Xl.delete(e))}function sv(e,t){let{pan:n,zoom:i}=e,{pan:s,zoom:o}=t;return i?.zoom?.pinch?.enabled!==o?.zoom?.pinch?.enabled||n?.enabled!==s?.enabled||n?.threshold!==s?.threshold}function _r(e,t,n){let i=n.zoom.drag,{dragStart:s,dragEnd:o}=st(e);if(i.drawTime!==t||!o)return;let{left:r,top:a,width:l,height:c}=$h(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 Ai,Vs,Ih,ql,$l,kh,Oy,Ul,Gl,Yl,Dh,Xl,ov,Yh,Kh=M(()=>{Ai=Lg(yh());wh();Vs=e=>e&&e.enabled&&e.modifierKey,Ih=(e,t)=>e&&t[e+"Key"],ql=(e,t)=>e&&!t[e+"Key"];$l=new WeakMap;kh=e=>e===0||isNaN(e)?0:e<0?Math.min(Math.round(e),-1):Math.max(Math.round(e),1);Oy={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};Ul={category:Py,default:Ey,logarithmic:My},Gl={default:Ty},Yl={category:Ay,default:Fh,logarithmic:Sh,timeseries:Sh};Dh=(e,t,n)=>Math.min(n,Math.max(t,e));Xl=new WeakMap;ov="2.2.0";Yh={id:"zoom",version:ov,defaults:{pan:{enabled:!1,mode:"xy",threshold:10,modifierKey:null},zoom:{wheel:{enabled:!1,speed:.1,modifierKey:null},drag:{enabled:!1,drawTime:"beforeDatasetsDraw",modifierKey:null},pinch:{enabled:!1},mode:"xy"}},start:function(e,t,n){let i=st(e);i.options=n,Object.prototype.hasOwnProperty.call(n.zoom,"enabled")&&console.warn("The option \`zoom.enabled\` is no longer supported. Please use \`zoom.wheel.enabled\`, \`zoom.drag.enabled\`, or \`zoom.pinch.enabled\`."),(Object.prototype.hasOwnProperty.call(n.zoom,"overScaleMode")||Object.prototype.hasOwnProperty.call(n.pan,"overScaleMode"))&&console.warn("The option \`overScaleMode\` is deprecated. Please use \`scaleMode\` instead (and update \`mode\` as desired)."),Ai.default&&Oh(e,n),e.pan=(s,o,r)=>Bh(e,s,o,r),e.zoom=(s,o)=>Zl(e,s,o),e.zoomRect=(s,o,r)=>Hh(e,s,o,r),e.zoomScale=(s,o,r)=>Ny(e,s,o,r),e.resetZoom=s=>Ly(e,s),e.getZoomLevel=()=>Vy(e),e.getInitialScaleBounds=()=>Wh(e),e.getZoomedScaleBounds=()=>Fy(e),e.isZoomedOrPanned=()=>Hy(e),e.isZoomingOrPanning=()=>Ph(e)},beforeEvent(e,{event:t}){if(Ph(e))return!1;if(t.type==="click"||t.type==="mouseup"){let n=st(e);if(n.filterNextClick)return n.filterNextClick=!1,!1}},beforeUpdate:function(e,t,n){let i=st(e),s=i.options;i.options=n,sv(s,n)&&(Rh(e),Oh(e,n)),qy(e,n)},beforeDatasetsDraw(e,t,n){_r(e,"beforeDatasetsDraw",n)},afterDatasetsDraw(e,t,n){_r(e,"afterDatasetsDraw",n)},beforeDraw(e,t,n){_r(e,"beforeDraw",n)},afterDraw(e,t,n){_r(e,"afterDraw",n)},stop:function(e){Zy(e),Ai.default&&Rh(e),vy(e)},panFunctions:Yl,zoomFunctions:Ul,zoomRectFunctions:Gl}});function Jl(e){let t=[],n=()=>t.forEach(l=>l()),i=P(null),s=null;return{canvasRef:i,init:()=>{let l=i.value;if(!l)return console.error("createLineChart: canvas ref not set",new Error().stack),n;re.register(Yh,Ci,Zn,Ti,Jn,En,ph,mh),s=new re(l,{type:"line",data:e.data.peek(),options:{scales:{y:{min:0}},animation:!1,responsive:!0,plugins:{zoom:{pan:{enabled:!0,mode:"x"},zoom:{wheel:{enabled:!0},mode:"x"}},legend:{align:"start",position:"bottom"},title:{display:!1}}}});let c=e.data.subscribe(d=>{s&&(s.data=d,s.update())}),u=new ResizeObserver(()=>s?.resize());return u.observe(l.parentElement),t.push(()=>{u.disconnect(),s?.destroy(),s=null,c()}),()=>n()},resetZoom:()=>s?.resetZoom(),getZoomLevel:()=>s?.getZoomLevel()??0}}var Xh=M(()=>{"use strict";V();xh();Kh()});var kr=M(()=>{"use strict";Td();Cd();Pd();Dd();Xh()});var Ql,qh=M(()=>{"use strict";V();q();kr();Ql=e=>{let t=e.minContainerWidth??250,n=[],i=()=>{n.forEach(y=>y()),n.length=0},s=P(null),o=P(0),r=P(0),a=gn(null),l=gn(null),[c,u]=as(),d=Va(a);n.push(u);let f=y=>{y.preventDefault(),s.value={...c.value},o.value=r.value,console.log("onMouseDown",{startMouse:s.value,prevFirstContainerWidth:o.value,firstContainerWidth:r.value})},p=()=>s.value=null,b=y=>{if(s.value==null||l.current==null)return;let w=Math.max(o.value+y.x-s.value.x,t);r.value=Math.min(w,l.current.clientWidth-t),console.log("onMouseMove",w,r.value)},x=()=>{l.current!=null&&l.current.clientWidth-t<r.value&&(r.value=Math.max(l.current.clientWidth-t,t))};return window.addEventListener("mouseup",p),window.addEventListener("mousemove",b),window.addEventListener("resize",x),n.push(()=>{window.removeEventListener("mouseup",p),window.removeEventListener("mousemove",b),window.removeEventListener("resize",x)}),Ca(()=>{if(l.current)return r.value=l.current.clientWidth/2,d.init(),()=>{d.dispose()}}),d.state.width.subscribe(y=>{console.log("width",y)}),Ft(()=>i()),({children:y,className:w,..._})=>{let[S,T]=Array.isArray(y)?y:[];return m("div",{className:ut("flex-grow grid gap-2 items-start w-full relative",Z(w)),ref:l,style:{gridTemplateColumns:\`\${r}px 1fr\`},..._},m("div",{ref:a,className:"firstContainer w-full h-full"},S),d.state.width.value!=0&&m("div",{className:"w-8 flex justify-center h-full absolute top-0 -translate-x-1/2 cursor-col-resize z-[9999]",style:{left:\`\${d.state.width.value}px\`},onmousedown:f},m("div",{className:"dividerLine w-[5px] bg-neutral-800 h-full"})),m("div",{className:"secondContainer h-full"},T))}}});function Cn({root:e,className:t}){let{objectKeysChunkSize:n}=J.viewerSettings.value,i=e.page.value,s=e.children.slice(0,(i+1)*n),o=s.length<e.children.length;return m(vt,null,m("div",{className:ut("flex flex-col items-start w-full",Z(t))},s.map(r=>m("div",{key:r.path,className:"flex flex-col items-start w-full gap-2 pl-2 py-1 pr-1 border-b border-neutral-700 last:border-b-0"},m(Sr,{node:r})))),o&&m("button",{onclick:()=>e.page.value++,title:"Show more",className:"p-1 border font-bold border-neutral-700 hover:bg-neutral-700"},m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},m("circle",{cx:"12",cy:"12",r:"1"}),m("circle",{cx:"19",cy:"12",r:"1"}),m("circle",{cx:"5",cy:"12",r:"1"}))))}function Sr({node:e}){switch(e.kind){case"null":case"undefined":case"string":case"number":case"bigint":case"boolean":case"symbol":case"function":case"dom-node":case"error":return m(rv,{node:e});case"object":return m(lv,{node:e});case"array":return m(cv,{node:e});case"array-chunk":return m(uv,{node:e});case"signal":return m(dv,{node:e})}}function rv({node:e}){let{label:t,path:n,raw:i,kind:s}=e;return m(Er,null,m("label",{className:"text-xs truncate",title:n},t),m(av,{kind:s,raw:i}))}function av({kind:e,raw:t}){switch(e){case"null":return m("small",{className:"text-neutral-300"},"null");case"undefined":return m("small",{className:"text-neutral-300"},"undefined");case"dom-node":return m("small",{className:"text-neutral-300"},"<",m("span",{style:"color: #f0a05e"},t.nodeName),"/>");case"error":{let n=t;return m("small",{className:"text-neutral-300"},n.message,"cause"in n&&!!n.cause&&\` (\${String(n.cause)})\`)}case"string":return m("small",{className:"text-neutral-300"},\`"\${t}"\`);case"number":case"bigint":return m("small",{className:"text-neutral-300"},t);case"boolean":return m("small",{className:"text-neutral-300"},t?"true":"false");case"symbol":return m("small",{className:"text-neutral-300"},t.toString());case"function":return m("small",{className:"text-neutral-300 italic"},\`\\u0192 \${t.name??"anonymous"}()\`)}}function lv({node:e}){let t=e.collapsed.value;t||e.buildChildren();let n=t?null:e.children.peek();return m(Er,null,m("button",{className:"text-xs flex items-center gap-1 cursor-pointer w-full",title:e.path,onclick:()=>e.collapsed.value=!e.collapsed.value},e.label,m(Xe,{width:10,height:10,className:\`transition \${t?"":"rotate-90"}\`})),n!==null&&m(Cn,{root:{children:n,page:e.page}}))}function cv({node:e}){let t=e.collapsed.value;t||e.buildChildren();let n=t?null:e.children.peek();return m(Er,null,m("button",{className:"text-xs flex items-center gap-1 cursor-pointer w-full",title:e.path,onclick:()=>e.collapsed.value=!e.collapsed.value},e.label,m(Xe,{width:10,height:10,className:\`transition \${t?"":"rotate-90"}\`})),t?m("small",{className:"text-neutral-300"},\`Array(\${e.length})\`):n&&m("div",{className:"flex flex-col items-start gap-1 w-full"},n.map(i=>m(Sr,{node:i}))))}function uv({node:e}){let t=e.collapsed.value;t||e.buildChildren();let n=t?null:e.children.peek();return m("div",{className:"flex flex-col items-start gap-1 w-full"},m("button",{className:"text-xs flex items-center gap-1 cursor-pointer w-full",onclick:()=>e.collapsed.value=!e.collapsed.value},e.label,m(Xe,{width:10,height:10,className:\`transition \${t?"":"rotate-90"}\`})),n&&m("div",{className:"flex flex-col items-start gap-1 w-full"},n.map(i=>m(Sr,{node:i}))))}function dv({node:e}){let t=e.viewerNode.value;return m(Er,null,m("div",{className:"flex items-center gap-2"},m("label",{className:"text-xs truncate",title:e.path},e.label),m("span",{className:"text-[10px] italic text-primary border border-primary/40 px-1 rounded leading-none py-px"},"signal")),m("div",{className:"pl-2 w-full"},m(Sr,{node:t})))}function Er({children:e}){return m("div",{className:"flex flex-col items-start gap-1 w-full"},e)}var tc=M(()=>{"use strict";V();V();q();Ao();Ce()});function Tt(){return{collapsed:new Map,page:new Map,children:new Map,signalNodes:new Map}}function xe(e,t,n){n.page.set(t,e.page),Hs(e.children,n)}function Hs(e,t){for(let n of e)if(n.kind==="object"){t.collapsed.set(n.path,n.collapsed),t.page.set(n.path,n.page),t.children.set(n.path,n.children);let i=n.children.peek();i!==null&&Hs(i,t)}else if(n.kind==="array"||n.kind==="array-chunk"){t.collapsed.set(n.path,n.collapsed),t.children.set(n.path,n.children);let i=n.children.peek();i!==null&&Hs(i,t)}else n.kind==="signal"&&(t.signalNodes.set(n.path,n),Hs([n.viewerNode.peek()],t))}function ae(e){for(let t of e.collapsed.values())L.dispose(t);for(let t of e.page.values())L.dispose(t);for(let t of e.children.values())L.dispose(t);for(let t of e.signalNodes.values())t.unsubscribe(),L.dispose(t.viewerNode)}function fv(e){if(e===null)return"null";if(e===void 0)return"undefined";let t=window.opener?window.opener.Node:window.Node;if(e instanceof t)return"dom-node";let n=window.opener?window.opener.Error:window.Error;if(e instanceof n)return"error";let i=typeof e;return i==="string"?"string":i==="number"?"number":i==="bigint"?"bigint":i==="boolean"?"boolean":i==="symbol"?"symbol":i==="function"?"function":null}function Fs(e,t,n,i,s){let o=fv(e);if(o!==null)return{kind:o,label:t,path:n,raw:e};if(L.isSignal(e)){let d=e,f=\`\${n}.$value\`,p=Fs(d.peek(),"value",f,i,s),b=P(p),x=d.subscribe(y=>{let w=Tt();Hs([b.peek()],w),b.value=Fs(y,"value",f,w,s),ae(w)});return{kind:"signal",label:t,path:n,signal:d,viewerNode:b,unsubscribe:x}}if(Array.isArray(e)){let d=i.collapsed.get(n)??P(!0);i.collapsed.delete(n);let f=P(null);return{kind:"array",label:t,path:n,collapsed:d,length:e.length,children:f,buildChildren:()=>{if(f.peek()===null)if(e.length>s.arrayChunkSize){let b=Math.ceil(e.length/s.arrayChunkSize);f.value=Array.from({length:b},(x,y)=>{let w=y*s.arrayChunkSize,_=Math.min((y+1)*s.arrayChunkSize,e.length),S=\`\${n}[\${w}..\${_-1}]\`,T=P(!0),E=P(null),D=e.slice(w,_);return{kind:"array-chunk",label:\`[\${w}..\${_-1}]\`,path:S,collapsed:T,range:{start:w,end:_},children:E,buildChildren:()=>{E.peek()===null&&(E.value=D.map((A,N)=>Fs(A,(w+N).toString(),\`\${n}[\${w+N}]\`,Tt(),s)))}}})}else f.value=e.map((b,x)=>Fs(b,x.toString(),\`\${n}[\${x}]\`,Tt(),s))}}}let r=i.collapsed.get(n)??P(!0);i.collapsed.delete(n);let a=i.page.get(n)??P(0);i.page.delete(n);let l=P(null),c=e;return{kind:"object",label:t,path:n,collapsed:r,page:a,children:l,buildChildren:()=>{l.peek()===null&&(l.value=Zh(c,n,Tt(),s))}}}function Zh(e,t,n,i){return Object.keys(e).map(s=>Fs(e[s],s,\`\${t}.\${s}\`,n,i))}function sn(e,t,n,i){let s=n.page.get(t)??P(0);n.page.delete(t);let o=Zh(e,t,n,i);return{page:s,children:o}}var ec=M(()=>{"use strict";V()});var Bs=M(()=>{"use strict";Md();qh();tc();ec()});function Mr(e){e&&("nodes"in e?e.nodes.forEach(Mr):(Mr(e.child),Mr(e.sibling)))}function Jh(e,t,n){let i=new Map;Tr(n,i);let s=e.rootNode,o=ic();if(s){let r=t.trim().toLowerCase(),a=r?r.split(/\\s+/):[];o.nodes.push(...ep(s,a,i))}for(let{collapsed:r}of i.values())L.dispose(r);return o}function Tr(e,t){if(e)if("nodes"in e)for(let n of e.nodes)Tr(n,t);else{let{id:n,collapsed:i}=e;t.set(e.kiruNode,{id:n,collapsed:i}),Tr(e.child,t),Tr(e.sibling,t)}}function ep(e,t,n=new Map){let i=[],s=e;for(;s;){let o=ep(s.child,t,n);if(typeof s.type!="function")i.push(...o);else{let r=Vn(s);if(gv(t,r)){let a=mv(s,r,n);a.child=o[0]??null;for(let l=0;l<o.length;l++)o[l].parent=a,o[l].sibling=o[l+1]??null;i.push(a)}else i.push(...o)}s=s.sibling}return i}function gv(e,t){let n=t.toLowerCase();return e.every(i=>n.includes(i))}function ic(...e){return{value:"ROOT",nodes:e}}function mv(e,t,n=new Map){let{id:i,collapsed:s}=n.get(e)??{id:crypto.randomUUID(),collapsed:P(!0)};return n.delete(e),{id:i,name:t,kiruNode:e,collapsed:s,parent:null,child:null,sibling:null}}function nc(e){let t=Ri.peek();if(!t)return;let n=sc(e,t);if(!n)return;let i=n.parent;for(;i;)i.collapsed.value=!1,i=i.parent}function np(e){e&&nc(Ut.peek())}function bv(e){let t=Ri.peek();if(!t)return;let n=sc(Ut.peek(),t);n?.child&&(n.collapsed.value=e)}function xv(e,t){let n=Array.from(e.querySelectorAll("[data-graph-node-id]"));if(n.length===0)return;let i=Ri.peek(),s=-1;if(i){let c=sc(Ut.peek(),i);c&&(s=n.findIndex(u=>u.dataset.graphNodeId===c.id))}let r=s===-1?t==="down"?0:n.length-1:(s+(t==="up"?-1:1)+n.length)%n.length,a=n[r];if(!a)return;let l=yv(Ut.peek(),a);l&&(Ri.sneak(l.kiruNode),Ri.notify(c=>c!==np))}function yv(e,t){let n=t.dataset.graphNodeId;if(!n)return null;let i=s=>s?s.id===n?s:i(s.child)??i(s.sibling):null;for(let s of e.nodes){let o=i(s);if(o)return o}return null}function sc(e,t){let n=i=>i?i.kiruNode===t?i:n(i.child)??n(i.sibling):null;for(let i of e.nodes){let s=n(i);if(s)return s}return null}var hv,Ri,pv,Ut,tp,Qh,ip=M(()=>{"use strict";V();Ce();Fn();({selectedApp:hv,selectedNode:Ri,appSearchTerm:pv}=J),Ut=P(ic()),tp=()=>(window.addEventListener("keydown",Qh),()=>window.removeEventListener("keydown",Qh));Vt(()=>{let e=hv.value,t=pv.value;if(!e){Mr(Ut.peek()),Ut.value=ic();return}Ut.value=Jh(e,t,Ut.peek()),nc(Ut.peek());let n=i=>{i===e&&(Ut.value=Jh(i,t,Ut.peek()),nc(Ut.peek()))};return dt().on("update",n),()=>dt().off("update",n)});Ri.subscribe(np);Qh=e=>{Da(t=>{if(e.key==="l"&&e.ctrlKey){e.preventDefault(),J.appSearchInput.value?.focus(),J.appSearchInput.value?.select();return}if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(e.key))return;if(J.appSearchInput.value?.matches(":focus")){if(!e.altKey)return;e.preventDefault()}let n=e.key==="ArrowUp"?"up":e.key==="ArrowDown"?"down":e.key==="ArrowLeft"?"left":"right";if(n==="left"||n==="right"){bv(n==="left");return}xv(t,n)})}});function op(){return Mt(()=>tp()),()=>m("div",{className:"flex-grow p-2 sticky top-0"},m("div",{className:"flex gap-4 pb-2 border-b-2 border-neutral-800 mb-2 items-center"},m("input",{autofocus:!0,ref:wv,className:"bg-[#171616] px-1 py-2 w-full focus:outline focus:outline-primary",placeholder:"Search for component",type:"text","bind:value":vv})),m("div",{className:"flex flex-col"},m(ge,{from:Ut},e=>m(_v,{root:e}))))}function _v({root:e}){return e.nodes.map(t=>m(oc,{node:t,traverseSiblings:!0}))}function oc({node:e,traverseSiblings:t=!0}){let n=e.collapsed.value,i=sp.value===e.kiruNode,s=o=>{o.preventDefault(),o.stopPropagation(),e.collapsed.value=!e.collapsed.value};return m(vt,null,m("div",{"data-graph-node-id":e.id,className:"pl-4 mb-1 w-full"},m("button",{className:ut("flex gap-2 items-center px-2 py-0.5 w-full",i?"bg-crimson text-white":""),onclick:()=>sp.value=e.kiruNode},e.child&&m(Xe,{className:ut("transition-transform duration-200 w-4 h-4",n?"":"rotate-90"),onclick:s}),m("div",{className:e.child?"":"ml-6"},m("span",{className:i?"":"text-neutral-400"},"<"),m("span",{className:ut("font-medium",i?"":"text-crimson")},e.name),m("span",{className:i?"":"text-neutral-400"},">"))),!n&&e.child&&m(oc,{node:e.child})),t&&m(kv,{node:e}))}function kv({node:e}){if(!e)return null;let t=[],n=e.sibling;for(;n;)t.push(n),n=n.sibling;return m(vt,null,t.map(i=>m(oc,{node:i,traverseSiblings:!1})))}var sp,vv,wv,rp=M(()=>{"use strict";V();Ce();ip();Bs();q();({selectedNode:sp,appSearchTerm:vv,appSearchInput:wv}=J)});function cp(e,t){let n=Ws.peek();if(!e){n&&up(n.props),Ws.value=null;return}let i=n?.node===e,s=Tt();i&&n?xe(n.props.root,"props",s):n&&up(n.props);let o={...e.props};delete o.children;let r=i?n?.props.collapsed??P(!0):P(!0),a=sn(o,"props",s,t);ae(s),Ws.value={node:e,name:Vn(e),props:{root:a,collapsed:r}}}function up(e){L.dispose(e.collapsed),L.dispose(e.root.page);let t=Tt();xe(e.root,"props",t),ae(t)}var ap,Sv,lp,Ws,dp=M(()=>{"use strict";V();q();Ce();Fn();ec();({selectedNode:ap,selectedApp:Sv,viewerSettings:lp}=J),Ws=P(null);Vt(()=>{let e=ap.value,t=Sv.value,n=lp.value;if(cp(e,n),!e||!t)return;let i=s=>{if(s===t){if(_o(e)){ap.value=null;return}cp(e,lp.peek())}};return dt().on("update",i),()=>dt().off("update",i)})});function fp(){let e=Ws.value;if(!e)return null;let{name:t,props:n}=e,i=n.collapsed.value;return m("div",{className:"flex-grow p-2 sticky top-0"},m("h2",{className:"flex justify-between items-center font-bold mb-2 pb-2 border-b-2 border-neutral-800"},m("div",{className:"flex gap-2 items-center"},"<"+t+">")),m("div",{className:"flex flex-col"},m("button",{onclick:()=>n.collapsed.value=!n.collapsed.value,className:n.root.children.length===0?"opacity-50 cursor-default":"cursor-pointer"},m("span",{className:"flex items-center gap-2 font-medium"},m(Xe,{className:\`transition \${i?"":"rotate-90"}\`}),"props")),i?null:m("div",{className:"p-2",...n},m(Cn,{root:n.root}))))}var hp=M(()=>{"use strict";V();tc();Ao();dp()});function rc(){let e=gp.value;return m(vt,null,m("div",{className:"flex items-center justify-between gap-4 p-2 bg-neutral-400 bg-opacity-5 border border-white border-opacity-10 rounded"},m("div",{className:"flex items-center gap-4"},m("select",{className:"px-2 py-1 bg-neutral-800 text-neutral-100 rounded border border-white border-opacity-10",value:e?.name??"",onchange:t=>gp.value=pp.peek().find(n=>n.name===t.currentTarget.value)??null},m("option",{value:"",disabled:!0},"Select App"),m(Ge,{each:pp},t=>m("option",{key:t.id,value:t.name},t.name))),m("button",{title:"Toggle Component Inspection",onclick:Ev,className:\`p-1 rounded \${Mv.value?"bg-neutral-900":""}\`},m(rs,null)))),m(Ql,{minContainerWidth:100,className:"min-w-[480px]"},m(op,null),m(fp,null)))}var pp,gp,Cr,Ev,Mv,mp=M(()=>{"use strict";V();Ce();Bs();rp();hp();({apps:pp,selectedApp:gp,componentSelection:Cr}=J),Ev=()=>{Cr.value={enabled:!Cr.value.enabled,componentNode:Cr.value.componentNode}},Mv=Kt(()=>Cr.value.enabled)});function _p(e){if(xp)return;xp=!0;let t=e.profilingContext,n=s=>{if(se(s)||ze.value.find(a=>a.app.name===s.name))return;let r=vp(e,t,s);ze.value=[...ze.value,r]},i=s=>{se(s)||(console.log("onAppUnmounted",s),ze.value.find(o=>o.app.name===s.name)?.dispose())};t.appStats.forEach((s,o)=>{if(se(o))return;let r=vp(e,t,o);ze.value=[...ze.value,r]}),e.on("mount",n),e.on("unmount",i)}function yp(e,t){return{mountDuration:e.mountDuration(t).toFixed(2),totalTicks:e.totalTicks(t).toLocaleString(),avgTickDuration:e.averageTickDuration(t).toFixed(2),lastTickDuration:e.lastTickDuration(t).toFixed(2)}}function vp(e,t,n){let i=[],s=()=>{i.forEach(u=>u()),ze.value=ze.value.filter(u=>u.app.name!==n.name)},o=Tv(),r=P({labels:[(performance.now()/1e3).toFixed(2)],datasets:wp(o)});i.push(()=>L.dispose(r)),Object.entries(o).forEach(([u,{values:d}])=>{let f=b=>{b.name===n.name&&d[d.length-1]++},p=u;t.addEventListener(p,f),i.push(()=>t.removeEventListener(p,f))});let a=setInterval(()=>{Object.values(o).forEach(d=>{d.values.push(0),d.values.length>bp&&d.values.shift()});let u=[...r.value.labels,(performance.now()/1e3).toFixed(2)];u.length>bp&&u.shift(),r.value={labels:u,datasets:wp(o)}},100);i.push(()=>clearInterval(a));let l=P(yp(t,n)),c=u=>{u.name===n.name&&(l.value=yp(t,u))};return e.on("update",c),i.push(()=>e.off("update",c)),{app:n,stats:l,chartData:r,dispose:s}}function wp(e){return Object.entries(e).map(([t,{values:n,color:i}])=>({label:t,data:[...n],fill:!1,borderColor:i,tension:.1}))}function Tv(){return{update:{values:[0],color:"#ad981f"},updateDirtied:{values:[0],color:"#b21f3a"},createNode:{values:[0],color:"#198019"},removeNode:{values:[0],color:"#5F3691"},updateNode:{values:[0],color:"#2f2f9d"},signalAttrUpdate:{values:[0],color:"#28888f"},signalTextUpdate:{values:[0],color:"#9b3b98"}}}var bp,ze,xp,kp=M(()=>{"use strict";V();Fn();bp=100,ze=P([]),xp=!1});function Sp(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},m("circle",{cx:"12",cy:"12",r:"10"}),m("path",{d:"M12 16v-4"}),m("path",{d:"M12 8h.01"}))}var Ep=M(()=>{"use strict";V()});function js({pauseWhen:e}){let t=dt();return Mt(()=>_p(t)),m("div",{className:"flex flex-col gap-2"},m(Ge,{each:ze},n=>m(Cv,{item:n,pauseWhen:e})))}function Cv({item:e,pauseWhen:t}){let n=P(!1),i=P(e.chartData.peek()),s=Jl({data:i}),o=e.chartData.subscribe(c=>{n.peek()||t?.peek()||(i.value=c)});Ft(()=>o()),Mt(()=>s.init());let r=P(!1),a=()=>{n.value=!0},l=()=>{t?.peek()||(n.value=!1,i.value=e.chartData.peek(),s.resetZoom())};return()=>m("div",{title:e.app.name,className:"flex overflow-hidden"},m("canvas",{ref:s.canvasRef,className:"w-full max-w-full h-80 overflow-hidden",onmouseover:a,onmouseout:l,onmousedown:c=>{s.getZoomLevel()<=1||(c.preventDefault(),c.stopPropagation(),c.stopImmediatePropagation())}}),m("div",{className:"absolute top-1 right-1 flex flex-col gap-1 items-end"},m("button",{className:"p-1",onclick:()=>r.value=!r.value},m(Sp,{className:"w-4 h-4"})),m(ge,{from:{stats:e.stats,showStatsTooltip:r}},({stats:c,showStatsTooltip:u})=>u&&m("div",{className:"text-xs grid grid-cols-2 gap-x-4 bg-neutral-800 bg-opacity-60 hover:bg-opacity-80 rounded-md p-2",style:"grid-template-columns: auto auto;"},m("span",{className:"text-right"},"Mount duration:"),c.mountDuration," ms",m("span",{className:"text-right"},"Total updates:"),m("span",null,c.totalTicks),m("span",{className:"text-right"},"Avg. update duration:"),c.avgTickDuration," ms",m("span",{className:"text-right"},"Latest update:"),m("span",null,c.lastTickDuration," ms")))))}var Mp=M(()=>{"use strict";V();kr();Ce();kp();Ep()});var ac=M(()=>{"use strict";mp();Mp()});var Pr,Tp=M(()=>{"use strict";V();Bs();ac();Pr={Apps:{Icon:Oa,View:rc},FileRouter:{Icon:Na,View:()=>m("div",null,"FileRouter")},Profiling:{Icon:os,View:js},Settings:{Icon:Ia,View:()=>m("div",null,"Settings")}}});function Dv(){return m("button",{ref:J.rootRef,className:"flex gap-2 cursor-default"},m("nav",{className:"flex flex-col gap-2 justify-between"},m("div",{className:"flex flex-col gap-2"},Object.keys(Pr).map(e=>m(Av,{key:e,id:e})))),m("main",{className:"flex flex-col flex-1 max-h-[calc(100vh-1rem)] overflow-y-auto p-2 bg-neutral-400/5 rounded"},m(ge,{from:Pv},e=>m(e.View,null))))}function Av({id:e}){let{Icon:t}=Pr[e];return m("button",{key:e,onclick:()=>J.devtoolsTab.value=e,className:"flex items-center px-2 py-1 gap-2 rounded border text-xs border-white border-opacity-10"+(J.devtoolsTab.value===e?" bg-white bg-opacity-5 text-neutral-100":" hover:bg-white hover:bg-opacity-10 text-neutral-400"),title:e},m(t,{className:"text-primary"}),m("span",{className:"hidden sm:inline"},e))}var Pv,Cp=M(()=>{"use strict";V();Ce();Tp();Pv=Kt(()=>Pr[J.devtoolsTab.value])});var Pp={};Br(Pp,{AppsIcon:()=>Oa,AppsTabView:()=>rc,ChevronRightIcon:()=>Xe,CloseIcon:()=>Ra,CogIcon:()=>Ia,ComponentIcon:()=>qm,DevtoolsApp:()=>Dv,ExpandIcon:()=>Zm,ExternalLinkIcon:()=>ss,FlameIcon:()=>La,FolderTreeIcon:()=>Na,GaugeIcon:()=>os,GripIcon:()=>Jm,MouseIcon:()=>rs,OpenIcon:()=>Qm,ProfilingTabView:()=>js,RadioIcon:()=>za,ResizableSplit:()=>Ql,ResizeGripIcon:()=>Hn,ValueViewer:()=>Cn,ZapIcon:()=>tb,assert:()=>Ye,buildViewerRoot:()=>sn,clamp:()=>Ke,collectFromRoot:()=>xe,computeComponentHash:()=>mi,createDraggableController:()=>qe,createElementBoundingTracker:()=>Va,createLineChart:()=>Jl,createMousePositionTracker:()=>as,createResizableController:()=>Bn,devtoolsAppRootHasFocus:()=>Km,devtoolsState:()=>J,disposeCache:()=>ae,emptyCache:()=>Tt,findComponentByHash:()=>Aa,getFileLink:()=>is,getNodeName:()=>Vn,ifDevtoolsAppRootHasFocus:()=>Da,isDevtoolsApp:()=>se,kiruGlobal:()=>dt,trapFocus:()=>Ym,typedMapEntries:()=>Gm});var ei=M(()=>{"use strict";Cp();Bs();kr();Ce();ac();Fn()});var BM,$s,Us,ye,St,Dp,on,le,Ii=M(()=>{"use strict";V();BM=P(!1),$s=P(!1),Us=P(!1),ye=P(!1),St=P([]),Dp=Kt(()=>St.value.length>0),on=50,le=P(null)});var Gs=M(()=>{"use strict"});var Ov,Rv,Rp,Iv,Nv,Lv,Ip=M(()=>{"use strict";V();q();ei();Gs();Ii();Ov="kiru.devtools.debuggerPosition",Rv="kiru.devtools.debuggerSize",Rp=()=>{let e=qe({key:Ov,storage:sessionStorage,allowFloat:!0,snapDistance:50,defaultPosition:{type:"floating",x:.5,y:.5},getDraggableBounds:()=>[window.innerWidth,window.innerHeight],getPadding:()=>[10,10]}),t=Bn({key:Rv,storage:sessionStorage,minSize:[320,180]});Mt(()=>(e.init(),t.init(),()=>{e.dispose(),t.dispose()}));let n=s=>{e.containerRef.value=s,e.handleRef.value=s,t.containerRef.value=s},i=s=>{t.handleRef.value=s};return({state:s})=>m("div",{ref:n,className:ut("fixed rounded-lg p-0.5 flex flex-col gap-2 select-none overflow-hidden","bg-neutral-900 opacity-75 hover:opacity-100 shadow-lg"),style:{zIndex:le.value==="debugger"?on+1:on,minWidth:\`\${320}px\`,minHeight:\`\${180}px\`,cursor:t.isResizing.value?"se-resize":e.isDragging.value?"grabbing":"grab"},onclick:()=>le.value="debugger"},m("div",{style:{transition:"80ms ease-in-out",opacity:s==="entered"?1:0,flex:1,overflow:"auto",scrollbarWidth:"thin",minHeight:0}},m(Iv,null)),m("div",{ref:i,style:{position:"absolute",bottom:"4px",right:"4px",width:"16px",height:"16px",cursor:"se-resize",display:"flex",alignItems:"center",justifyContent:"center"}},m(Hn,{className:"text-neutral-500"})))},Iv=()=>{let e=P([]);return Mt(()=>{let t=dt().devtools.subscribe(n=>{e.value=Array.from(n).map(i=>({...i,link:is(i.signal)}))});return()=>t()}),m("div",{className:"flex flex-col gap-2 p-2"},m(Ge,{each:e,fallback:m("div",{className:"flex flex-col items-center justify-center gap-2 py-8 px-4 text-center text-neutral-400 text-sm"},m("p",{className:"font-medium"},"No signals tracked"),m("p",{className:"text-xs text-neutral-500 max-w-[240px]"},"Use"," ",m("code",{className:"px-1 py-0.5 rounded bg-neutral-800 text-neutral-300 font-mono text-[11px]"},"DevTools.track(signal, label)")," ","in your app to inspect signal values here."))},t=>m(Nv,{key:\`\${t.signal.$id}:\${t.label}\${t.link}\`,entry:t})))},Nv=({entry:e})=>{let t=J.viewerSettings.peek(),n=s=>s!==null&&typeof s=="object"&&!Array.isArray(s)?s:{value:s},i=P(sn(n(e.signal.peek()),e.label,Tt(),t));return Mt(()=>{let s=e.signal.subscribe(o=>{let r=Tt();xe(i.peek(),e.label,r),i.value=sn(n(o),e.label,r,t),ae(r)});return()=>{s();let o=Tt();xe(i.peek(),e.label,o),ae(o)}}),()=>m("div",{className:"rounded border border-neutral-700 text-xs"},m("div",{className:"flex items-center justify-between px-2 py-1 border-b border-neutral-700 font-medium text-neutral-300"},e.label,m(Lv,{link:e.link})),m(ge,{from:i},s=>m(Cn,{root:s})))},Lv=({link:e})=>e?m("a",{className:"flex items-center gap-1 text-[10px] opacity-50 hover:opacity-100 transition-opacity",href:e,onclick:t=>{t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),window.open(e)},title:"Open in editor"},"Open in editor",m(ss,{width:"0.65rem",height:"0.65rem"})):null});var zv,Vv,zp,Vp=M(()=>{"use strict";V();q();ei();Gs();Ii();zv="kiru.devtools.profilerPosition",Vv="kiru.devtools.profilerSize",zp=()=>{let e=qe({key:zv,storage:sessionStorage,allowFloat:!0,snapDistance:50,defaultPosition:{type:"floating",x:.5,y:.5},getDraggableBounds:()=>[window.innerWidth,window.innerHeight],getPadding:()=>[10,10]}),t=Bn({key:Vv,storage:sessionStorage,minSize:[320,180],aspectRatio:2/1});Mt(()=>(e.init(),t.init(),()=>{e.dispose(),t.dispose()}));let n=s=>{e.containerRef.value=s,e.handleRef.value=s,t.containerRef.value=s},i=s=>{t.handleRef.value=s};return({state:s})=>m("div",{ref:n,className:ut("fixed rounded-lg p-0.5 flex flex-col gap-2 select-none overflow-hidden","bg-neutral-900 opacity-75 hover:opacity-100 shadow-lg"),style:{zIndex:le.value==="profiler"?on+1:on,minWidth:\`\${320}px\`,minHeight:\`\${180}px\`,cursor:t.isResizing.value?"se-resize":e.isDragging.value?"grabbing":"grab"},onclick:()=>le.value="profiler"},m("div",{style:{transition:"80ms ease-in-out",opacity:s==="entered"?1:0,flex:1,overflow:"hidden",minHeight:0}},m(js,{pauseWhen:e.isDragging})),m("div",{ref:i,style:{position:"absolute",bottom:"4px",right:"4px",width:"16px",height:"16px",cursor:"se-resize",display:"flex",alignItems:"center",justifyContent:"center"}},m(Hn,{className:"text-neutral-500"})))}});function Dr({style:e,top:t,left:n,width:i,height:s,...o}){return m("div",{style:{...e,position:"absolute",zIndex:50,top:t+window.scrollY+"px",left:n+window.scrollX+"px",width:i+"px",height:s+"px",background:"linear-gradient(135deg, rgb(164 11 32 / 66%) 0%, rgb(82 14 47 / 80%) 80%)"},...o})}var lc=M(()=>{"use strict";V()});function Fv(e){let t=null,n=e;for(;n;){if(typeof n.type=="function"){let i=n,s=is(i.type);if(s){t={component:i,link:s};break}}n=n.parent}return t?{...t,elements:Hp(t.component.child)}:null}function Hp(e,t=new Set){let n=e;for(;n;)n.dom&&n.dom instanceof Element?t.add(n.dom):n.child&&Hp(n.child,t),n=n.sibling;return t}var Fp,Bp=M(()=>{"use strict";V();ei();Ii();lc();q();Fp=()=>{let[e,t]=as();Ft(()=>t());let n=P(null),i=null,s=()=>{let u=ye.value,{x:d,y:f}=e.value;if(!u){n.value=null;return}let p=document.elementsFromPoint(d,f),b=null;for(let E of p){let D=E.__kiruNode;if(D&&(b=Fv(D),b))break}if(!b){n.value=null;return}let x=1/0,y=1/0,w=-1/0,_=-1/0;for(let E of b.elements){let{top:D,left:O,width:A,height:N}=E.getBoundingClientRect();x=Math.min(x,O),y=Math.min(y,D),w=Math.max(w,O+A),_=Math.max(_,D+N)}let S=w-x,T=_-y;n.value={name:Vn(b.component),top:y,left:x,width:S,height:T,link:b.link,component:b.component}},o=()=>{i==null&&(i=requestAnimationFrame(()=>{i=null,s()}))};Vt([ye,e],o);let r=u=>{if(u.preventDefault(),u.stopPropagation(),u.stopImmediatePropagation(),!ye.value||!n.value)return;let{name:d,link:f,component:p}=n.value;if(!f)return;let b=mi(p);ye.value=!1;let x=St.value,y=x.findIndex(w=>w.hash===b&&w.link===f);if(y!==-1){let w=x[y],_={...w,pulseGeneration:(w.pulseGeneration??0)+1},S=x.filter(T=>T.id!==w.id);St.value=[...S,_],le.value="componentInfo";return}St.value=[...x,{id:crypto.randomUUID(),name:d,link:f,component:p,unmounted:!1,hash:b,pulseGeneration:0}],le.value="componentInfo"},a=u=>{se(u)||o()};dt().on("update",a),window.addEventListener("resize",o),window.addEventListener("scroll",o);let l=new MutationObserver(o);l.observe(document.body,{childList:!0,subtree:!0});let c=new ResizeObserver(o);return c.observe(document.body),Ft(()=>{dt().off("update",a),window.removeEventListener("resize",o),window.removeEventListener("scroll",o),l.disconnect(),c.disconnect()}),({state:u})=>{let d=ye.value,f=n.value;return!d||!f||u==="exited"?null:m(Dr,{top:f.top+window.scrollY,left:f.left+window.scrollX,width:f.width,height:f.height,className:ut("text-white flex items-center justify-center",u==="entered"?"opacity-100":"opacity-90",u==="entered"?"scale-100":"scale-90"),title:"Click to open in editor",onclick:r},m("span",{className:"font-medium text-sm truncate max-w-full"},\`<\${f.name}>\`))}}});function $p(e){let t={...e.props};return delete t.children,t}function cc(e){let t=Tt();xe(e,"props",t),ae(t)}function Up(e,t=new Set){let n=e;for(;n;)n.dom&&n.dom instanceof Element?t.add(n.dom):n.child&&Up(n.child,t),n=n.sibling;return t}function jv(e){if(!e.child)return null;let t=Up(e.child);if(t.size===0)return null;let n=1/0,i=1/0,s=-1/0,o=-1/0;for(let l of t){let{top:c,left:u,width:d,height:f}=l.getBoundingClientRect();n=Math.min(n,u),i=Math.min(i,c),s=Math.max(s,u+d),o=Math.max(o,c+f)}let r=s-n,a=o-i;return{top:i,left:n,width:r,height:a}}var Hv,Bv,Wv,$v,Gp,Yp=M(()=>{"use strict";V();q();ei();Gs();Ii();lc();Hv="kiru.devtools.componentInfoPosition",Bv="kiru.devtools.componentInfoSize",Wv=300;$v=()=>{let e=P(null),t=P(null),n=P(null),i=P(!1),s=P(!1),o=-1;Vt(()=>{let u=n.value;if(!u){let _=e.peek();_&&(cc(_),e.value=null);return}let d=St.value,f=d.find(_=>_.id===u);if(!f){let _=e.peek();_&&(cc(_),e.value=null);return}if(f.pulseGeneration!==o&&(o=f.pulseGeneration,f.pulseGeneration>0&&(s.value=!0,setTimeout(()=>{o===f.pulseGeneration&&(s.value=!1)},Wv))),!f.unmounted){let _=mi(f.component);t.value=_,f.hash!==_&&(St.value=d.map(S=>S.id===u?{...S,hash:_}:S))}if(f.unmounted)return;let p=e.peek(),b=Tt();p&&xe(p,"props",b);let x=J.viewerSettings.peek(),y=$p(f.component),w=sn(y,"props",b,x);e.value=w,ae(b)}),Ft(()=>{let u=e.peek();u&&(cc(u),e.value=null)});let r=qe({key:Hv,storage:sessionStorage,allowFloat:!0,snapDistance:50,defaultPosition:{type:"floating",x:.5,y:.5},getDraggableBounds:()=>[window.innerWidth,window.innerHeight],getPadding:()=>[10,10]}),a=Bn({key:Bv,storage:sessionStorage,minSize:[320,200]});Mt(()=>{r.init(),a.init();let u=d=>{let f=n.value;if(!f)return;let p=St.value,b=p.find(S=>S.id===f);if(!b||se(d))return;let x=Nt(b.component);if(x&&x!==d)return;if(b.unmounted){let S=t.value;if(!S)return;let T=Aa(d.rootNode,S);if(!T)return;St.value=p.map(E=>E.id===f?{...E,component:T,unmounted:!1}:E);return}if(_o(b.component)){St.value=p.map(S=>S.id===f?{...S,unmounted:!0}:S);return}let y=e.peek();if(!y)return;let w=J.viewerSettings.peek(),_=Tt();xe(y,"props",_),e.value=sn($p(b.component),"props",_,w),ae(_)};return dt().on("update",u),()=>{r.dispose(),a.dispose(),dt().off("update",u)}});let l=u=>{r.containerRef.value=u,r.handleRef.value=u,a.containerRef.value=u},c=u=>{a.handleRef.value=u};return({panel:u,state:d})=>{n.value||(n.value=u.id);let p=St.value.find(_=>_.id===u.id);if(!p)return null;let b=()=>{let _=St.value,S=_.find(T=>T.id===u.id);S&&(St.value=[..._.filter(T=>T.id!==u.id),S],le.value="componentInfo")},x=i.value,y=s.value,w=x&&!p.unmounted?jv(p.component):null;return m(vt,null,w&&m(Dr,{top:w.top+window.scrollY,left:w.left+window.scrollX,width:w.width,height:w.height,className:ut("pointer-events-none",d==="entered"?"opacity-100":"opacity-90")}),m("div",{ref:l,className:"fixed p-0.5 flex flex-col gap-2 select-none z-index-1001",style:{zIndex:le.value==="componentInfo"?on+1:on,minWidth:\`\${320}px\`,minHeight:\`\${200}px\`,opacity:d==="entered"?1:0,cursor:a.isResizing.value?"se-resize":r.isDragging.value?"grabbing":"grab"},onclick:b,onmousedown:b,onmouseenter:()=>i.value=!0,onmouseleave:()=>i.value=!1},m("div",{style:{transition:"80ms ease-in-out",opacity:y?1:.75,flex:1,scrollbarWidth:"thin",minHeight:0,overflow:"hidden",boxShadow:y?"0 0 8px crimson":void 0},className:"rounded-lg bg-neutral-900 opacity-75 hover:opacity-100! shadow-lg"},m("div",{className:"flex flex-col text-sm overflow-auto"},m("div",{className:"flex items-center justify-between gap-2 p-2"},m("a",{href:p.link,className:ut("flex items-center justify-center gap-2","text-neutral-400 hover:text-neutral-200"),onclick:_=>{_.preventDefault(),_.stopPropagation(),window.open(p.link)},onmousedown:_=>_.stopPropagation(),title:"Open in editor"},\`<\${p.name}>\`,m(ss,{className:"w-4 h-4 shrink-0 pointer-events-none"})),m("div",{className:"flex items-center gap-2"},p.unmounted&&m("span",{className:"rounded bg-amber-500/20 px-1.5 py-0.5 text-[10px] font-medium text-amber-400"},"Unmounted"),m("button",{type:"button",className:"p-1 text-neutral-400 hover:text-neutral-200",onclick:()=>{St.value=St.value.filter(_=>_.id!==u.id)},title:"Close"},m(Ra,{className:"w-4 h-4 shrink-0 pointer-events-none"})))),m("div",{className:"pt-2 px-4"},m("div",{className:"mb-1.5 font-medium text-neutral-300 text-xs"},"Props"),m(ge,{from:e},_=>_?_.children.length===0?m("div",{className:"text-neutral-500 text-xs italic py-1"},"No props"):m(Cn,{root:_,className:"text-xs"}):null)))),m("div",{ref:c,style:{position:"absolute",bottom:"4px",right:"4px",width:"16px",height:"16px",cursor:"se-resize",display:"flex",alignItems:"center",justifyContent:"center"}},m(Hn,{className:"text-neutral-500"}))))}},Gp=({state:e})=>m(Ge,{each:St},(t,n)=>m($v,{key:t.id,panel:t,index:n,state:e}))});var Kp=M(()=>{"use strict";Ip();Vp();Bp();Yp()});var Qp={};Br(Qp,{default:()=>Jp});function Jp(){let e=qe({storage:localStorage,key:Uv,defaultPosition:{type:"snapped",side:"bottom",percent:.5},getPadding:()=>[10,10],getDraggableBounds:()=>[window.innerWidth,window.innerHeight],onclick:()=>uc.value=!uc.value}),t=Kt(()=>{let i=e.snapSide.value;return i==="left"||i==="right"?"column":"row"}),n=Kt(()=>{let i=e.snapSide.value;return i==="left"||i==="right"?"row":"column"});return Mt(()=>{e.init();let i=e.containerRef.value,s=Zp.current;Vt([uc,e.snapSide,e.containerPos],(o,r,[a,l])=>{let[c,u]=[s.offsetWidth,s.offsetHeight],d=e.handleRef.value,f=d?.offsetWidth??0,p=d?.offsetHeight??0,b=0,x=0;if(r==="top"||r==="bottom"){let D=a+i.offsetWidth/2-c/2;b=Ke(D,10,window.innerWidth-10-c)-D}else{let D=l+i.offsetHeight/2-u/2;x=Ke(D,10,window.innerHeight-10-u)-D}let y=f/2+8+c/2,w=p/2+8+u/2,_=0,S=0;r==="left"?_=o?y:-y:r==="right"?_=o?-y:y:r==="top"?S=o?w:-w:S=o?-w:w;let T=-c/2+b+_,E=-u/2+x+S;s.style.transform=\`scale(\${o?1:0}) translate(\${T}px, \${E}px)\`,setTimeout(()=>{qp.value=!0},50)})}),()=>m(vt,null,m("div",{ref:e.containerRef,style:{transition:"80ms",opacity:qp.value?1:0,flexDirection:n},className:"z-999999 top-0 left-0 flex items-center justify-center"},m("button",{ref:e.handleRef,className:"rounded-full p-2 z-10",style:{background:"linear-gradient(135deg, rgb(143 1 1 / 90%) 0%, rgba(119, 14, 103, 0.89) 75%)"}},m(La,{className:"w-5 h-5"})),m("div",{ref:Zp,style:{transition:"80ms ease-in-out",transformOrigin:"0 0",flexDirection:t},className:ut("absolute left-1/2 top-1/2 z-0 flex p-1 gap-1","bg-neutral-900 rounded-xl shadow-sm")},m(dc,{active:$s,title:"Toggle Profiler",onclick:()=>$s.value=!$s.value},m(os,{className:"w-4 h-4 pointer-events-none"}),m("small",null,"Profiler")),m(dc,{active:Us,title:"Toggle Debugger",onclick:()=>Us.value=!Us.value},m(za,{className:"w-4 h-4 pointer-events-none"}),m("small",null,"Tracking")),m(dc,{active:ye,title:"Select Component",onclick:()=>{ye.value=!ye.value}},m(rs,{className:"w-4 h-4 pointer-events-none"}),m("small",null,"Inspect")))),m(gi,{in:$s,duration:{in:0,out:150},element:i=>i==="exited"?null:m(zp,{state:i})}),m(gi,{in:Us,duration:{in:0,out:150},element:i=>i==="exited"?null:m(Rp,{state:i})}),m(gi,{in:ye,duration:{in:0,out:150},element:i=>i==="exited"?null:m(Fp,{state:i})}),m(gi,{in:Dp,duration:{in:0,out:150},element:i=>i==="exited"?null:m(Gp,{state:i})}))}function dc({className:e,active:t,...n}){let i=!!t?.value;return m("button",{className:ut("flex items-center px-1.5 py-0.5 gap-2","text-sm rounded-lg border border-white/10",i&&"bg-white/5 text-neutral-100",!i&&"bg-white/2.5 hover:bg-white/5 text-neutral-400",Z(e)),...n})}var Uv,qp,uc,Zp,tg=M(()=>{"use strict";V();q();ei();Ii();Gs();Kp();Uv="kiru.devtools.anchorPosition",qp=P(!1),uc=P(!1),Zp=gn(null)});var Ac=\`/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */
5421
+ @layer properties;
5422
+ @layer theme, base, components, utilities;
5423
+ @layer theme {
5424
+ :root, :host {
5425
+ --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
5426
+ "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
5427
+ --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
5428
+ "Courier New", monospace;
5429
+ --color-amber-400: oklch(82.8% 0.189 84.429);
5430
+ --color-amber-500: oklch(76.9% 0.188 70.08);
5431
+ --color-neutral-100: oklch(97% 0 0);
5432
+ --color-neutral-200: oklch(92.2% 0 0);
5433
+ --color-neutral-300: oklch(87% 0 0);
5434
+ --color-neutral-400: oklch(70.8% 0 0);
5435
+ --color-neutral-500: oklch(55.6% 0 0);
5436
+ --color-neutral-700: oklch(37.1% 0 0);
5437
+ --color-neutral-800: oklch(26.9% 0 0);
5438
+ --color-neutral-900: oklch(20.5% 0 0);
5439
+ --color-black: #000;
5440
+ --color-white: #fff;
5441
+ --spacing: 0.25rem;
5442
+ --text-xs: 0.75rem;
5443
+ --text-xs--line-height: calc(1 / 0.75);
5444
+ --text-sm: 0.875rem;
5445
+ --text-sm--line-height: calc(1.25 / 0.875);
5446
+ --font-weight-medium: 500;
5447
+ --font-weight-bold: 700;
5448
+ --radius-sm: 0.25rem;
5449
+ --radius-md: 0.375rem;
5450
+ --radius-lg: 0.5rem;
5451
+ --radius-xl: 0.75rem;
5452
+ --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
5453
+ --default-transition-duration: 150ms;
5454
+ --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
5455
+ --default-font-family: var(--font-sans);
5456
+ --default-mono-font-family: var(--font-mono);
5457
+ }
5458
+ }
5459
+ @layer base {
5460
+ *, ::after, ::before, ::backdrop, ::file-selector-button {
5461
+ box-sizing: border-box;
5462
+ margin: 0;
5463
+ padding: 0;
5464
+ border: 0 solid;
5465
+ }
5466
+ html, :host {
5467
+ line-height: 1.5;
5468
+ -webkit-text-size-adjust: 100%;
5469
+ tab-size: 4;
5470
+ font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");
5471
+ font-feature-settings: var(--default-font-feature-settings, normal);
5472
+ font-variation-settings: var(--default-font-variation-settings, normal);
5473
+ -webkit-tap-highlight-color: transparent;
5474
+ }
5475
+ hr {
5476
+ height: 0;
5477
+ color: inherit;
5478
+ border-top-width: 1px;
5479
+ }
5480
+ abbr:where([title]) {
5481
+ -webkit-text-decoration: underline dotted;
5482
+ text-decoration: underline dotted;
5483
+ }
5484
+ h1, h2, h3, h4, h5, h6 {
5485
+ font-size: inherit;
5486
+ font-weight: inherit;
5487
+ }
5488
+ a {
5489
+ color: inherit;
5490
+ -webkit-text-decoration: inherit;
5491
+ text-decoration: inherit;
5492
+ }
5493
+ b, strong {
5494
+ font-weight: bolder;
5495
+ }
5496
+ code, kbd, samp, pre {
5497
+ font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);
5498
+ font-feature-settings: var(--default-mono-font-feature-settings, normal);
5499
+ font-variation-settings: var(--default-mono-font-variation-settings, normal);
5500
+ font-size: 1em;
5501
+ }
5502
+ small {
5503
+ font-size: 80%;
5504
+ }
5505
+ sub, sup {
5506
+ font-size: 75%;
5507
+ line-height: 0;
5508
+ position: relative;
5509
+ vertical-align: baseline;
5510
+ }
5511
+ sub {
5512
+ bottom: -0.25em;
5513
+ }
5514
+ sup {
5515
+ top: -0.5em;
5516
+ }
5517
+ table {
5518
+ text-indent: 0;
5519
+ border-color: inherit;
5520
+ border-collapse: collapse;
5521
+ }
5522
+ :-moz-focusring {
5523
+ outline: auto;
5524
+ }
5525
+ progress {
5526
+ vertical-align: baseline;
5527
+ }
5528
+ summary {
5529
+ display: list-item;
5530
+ }
5531
+ ol, ul, menu {
5532
+ list-style: none;
5533
+ }
5534
+ img, svg, video, canvas, audio, iframe, embed, object {
5535
+ display: block;
5536
+ vertical-align: middle;
5537
+ }
5538
+ img, video {
5539
+ max-width: 100%;
5540
+ height: auto;
5541
+ }
5542
+ button, input, select, optgroup, textarea, ::file-selector-button {
5543
+ font: inherit;
5544
+ font-feature-settings: inherit;
5545
+ font-variation-settings: inherit;
5546
+ letter-spacing: inherit;
5547
+ color: inherit;
5548
+ border-radius: 0;
5549
+ background-color: transparent;
5550
+ opacity: 1;
5551
+ }
5552
+ :where(select:is([multiple], [size])) optgroup {
5553
+ font-weight: bolder;
5554
+ }
5555
+ :where(select:is([multiple], [size])) optgroup option {
5556
+ padding-inline-start: 20px;
5557
+ }
5558
+ ::file-selector-button {
5559
+ margin-inline-end: 4px;
5560
+ }
5561
+ ::placeholder {
5562
+ opacity: 1;
5563
+ }
5564
+ @supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {
5565
+ ::placeholder {
5566
+ color: currentcolor;
5567
+ @supports (color: color-mix(in lab, red, red)) {
5568
+ color: color-mix(in oklab, currentcolor 50%, transparent);
5569
+ }
5570
+ }
5571
+ }
5572
+ textarea {
5573
+ resize: vertical;
5574
+ }
5575
+ ::-webkit-search-decoration {
5576
+ -webkit-appearance: none;
5577
+ }
5578
+ ::-webkit-date-and-time-value {
5579
+ min-height: 1lh;
5580
+ text-align: inherit;
5581
+ }
5582
+ ::-webkit-datetime-edit {
5583
+ display: inline-flex;
5584
+ }
5585
+ ::-webkit-datetime-edit-fields-wrapper {
5586
+ padding: 0;
5587
+ }
5588
+ ::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {
5589
+ padding-block: 0;
5590
+ }
5591
+ ::-webkit-calendar-picker-indicator {
5592
+ line-height: 1;
5593
+ }
5594
+ :-moz-ui-invalid {
5595
+ box-shadow: none;
5596
+ }
5597
+ button, input:where([type="button"], [type="reset"], [type="submit"]), ::file-selector-button {
5598
+ appearance: button;
5599
+ }
5600
+ ::-webkit-inner-spin-button, ::-webkit-outer-spin-button {
5601
+ height: auto;
5602
+ }
5603
+ [hidden]:where(:not([hidden="until-found"])) {
5604
+ display: none !important;
5605
+ }
5914
5606
  }
5915
-
5916
- /*
5917
- Set the default cursor for buttons.
5918
- */
5919
-
5920
- button,
5921
- [role="button"] {
5922
- cursor: pointer;
5607
+ @layer utilities {
5608
+ .pointer-events-none {
5609
+ pointer-events: none;
5610
+ }
5611
+ .visible {
5612
+ visibility: visible;
5613
+ }
5614
+ .absolute {
5615
+ position: absolute;
5616
+ }
5617
+ .fixed {
5618
+ position: fixed;
5619
+ }
5620
+ .relative {
5621
+ position: relative;
5622
+ }
5623
+ .sticky {
5624
+ position: sticky;
5625
+ }
5626
+ .inset-0 {
5627
+ inset: calc(var(--spacing) * 0);
5628
+ }
5629
+ .start {
5630
+ inset-inline-start: var(--spacing);
5631
+ }
5632
+ .end {
5633
+ inset-inline-end: var(--spacing);
5634
+ }
5635
+ .top-0 {
5636
+ top: calc(var(--spacing) * 0);
5637
+ }
5638
+ .top-1 {
5639
+ top: calc(var(--spacing) * 1);
5640
+ }
5641
+ .top-1\\\\/2 {
5642
+ top: calc(1 / 2 * 100%);
5643
+ }
5644
+ .right-1 {
5645
+ right: calc(var(--spacing) * 1);
5646
+ }
5647
+ .left-0 {
5648
+ left: calc(var(--spacing) * 0);
5649
+ }
5650
+ .left-1\\\\/2 {
5651
+ left: calc(1 / 2 * 100%);
5652
+ }
5653
+ .z-0 {
5654
+ z-index: 0;
5655
+ }
5656
+ .z-10 {
5657
+ z-index: 10;
5658
+ }
5659
+ .z-40 {
5660
+ z-index: 40;
5661
+ }
5662
+ .z-50 {
5663
+ z-index: 50;
5664
+ }
5665
+ .z-999999 {
5666
+ z-index: 999999;
5667
+ }
5668
+ .z-\\\\[9999\\\\] {
5669
+ z-index: 9999;
5670
+ }
5671
+ .container {
5672
+ width: 100%;
5673
+ @media (width >= 40rem) {
5674
+ max-width: 40rem;
5675
+ }
5676
+ @media (width >= 48rem) {
5677
+ max-width: 48rem;
5678
+ }
5679
+ @media (width >= 64rem) {
5680
+ max-width: 64rem;
5681
+ }
5682
+ @media (width >= 80rem) {
5683
+ max-width: 80rem;
5684
+ }
5685
+ @media (width >= 96rem) {
5686
+ max-width: 96rem;
5687
+ }
5688
+ }
5689
+ .mb-1 {
5690
+ margin-bottom: calc(var(--spacing) * 1);
5691
+ }
5692
+ .mb-1\\\\.5 {
5693
+ margin-bottom: calc(var(--spacing) * 1.5);
5694
+ }
5695
+ .mb-2 {
5696
+ margin-bottom: calc(var(--spacing) * 2);
5697
+ }
5698
+ .ml-6 {
5699
+ margin-left: calc(var(--spacing) * 6);
5700
+ }
5701
+ .contents {
5702
+ display: contents;
5703
+ }
5704
+ .flex {
5705
+ display: flex;
5706
+ }
5707
+ .grid {
5708
+ display: grid;
5709
+ }
5710
+ .hidden {
5711
+ display: none;
5712
+ }
5713
+ .h-4 {
5714
+ height: calc(var(--spacing) * 4);
5715
+ }
5716
+ .h-5 {
5717
+ height: calc(var(--spacing) * 5);
5718
+ }
5719
+ .h-80 {
5720
+ height: calc(var(--spacing) * 80);
5721
+ }
5722
+ .h-full {
5723
+ height: 100%;
5724
+ }
5725
+ .max-h-\\\\[calc\\\\(100vh-1rem\\\\)\\\\] {
5726
+ max-height: calc(100vh - 1rem);
5727
+ }
5728
+ .w-4 {
5729
+ width: calc(var(--spacing) * 4);
5730
+ }
5731
+ .w-5 {
5732
+ width: calc(var(--spacing) * 5);
5733
+ }
5734
+ .w-8 {
5735
+ width: calc(var(--spacing) * 8);
5736
+ }
5737
+ .w-\\\\[5px\\\\] {
5738
+ width: 5px;
5739
+ }
5740
+ .w-full {
5741
+ width: 100%;
5742
+ }
5743
+ .max-w-\\\\[240px\\\\] {
5744
+ max-width: 240px;
5745
+ }
5746
+ .max-w-full {
5747
+ max-width: 100%;
5748
+ }
5749
+ .min-w-\\\\[480px\\\\] {
5750
+ min-width: 480px;
5751
+ }
5752
+ .flex-1 {
5753
+ flex: 1;
5754
+ }
5755
+ .shrink-0 {
5756
+ flex-shrink: 0;
5757
+ }
5758
+ .flex-grow {
5759
+ flex-grow: 1;
5760
+ }
5761
+ .-translate-x-1\\\\/2 {
5762
+ --tw-translate-x: calc(calc(1 / 2 * 100%) * -1);
5763
+ translate: var(--tw-translate-x) var(--tw-translate-y);
5764
+ }
5765
+ .scale-90 {
5766
+ --tw-scale-x: 90%;
5767
+ --tw-scale-y: 90%;
5768
+ --tw-scale-z: 90%;
5769
+ scale: var(--tw-scale-x) var(--tw-scale-y);
5770
+ }
5771
+ .scale-100 {
5772
+ --tw-scale-x: 100%;
5773
+ --tw-scale-y: 100%;
5774
+ --tw-scale-z: 100%;
5775
+ scale: var(--tw-scale-x) var(--tw-scale-y);
5776
+ }
5777
+ .rotate-90 {
5778
+ rotate: 90deg;
5779
+ }
5780
+ .transform {
5781
+ transform: var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);
5782
+ }
5783
+ .cursor-col-resize {
5784
+ cursor: col-resize;
5785
+ }
5786
+ .cursor-default {
5787
+ cursor: default;
5788
+ }
5789
+ .cursor-grab {
5790
+ cursor: grab;
5791
+ }
5792
+ .cursor-pointer {
5793
+ cursor: pointer;
5794
+ }
5795
+ .resize {
5796
+ resize: both;
5797
+ }
5798
+ .grid-cols-2 {
5799
+ grid-template-columns: repeat(2, minmax(0, 1fr));
5800
+ }
5801
+ .flex-col {
5802
+ flex-direction: column;
5803
+ }
5804
+ .items-center {
5805
+ align-items: center;
5806
+ }
5807
+ .items-end {
5808
+ align-items: flex-end;
5809
+ }
5810
+ .items-start {
5811
+ align-items: flex-start;
5812
+ }
5813
+ .justify-between {
5814
+ justify-content: space-between;
5815
+ }
5816
+ .justify-center {
5817
+ justify-content: center;
5818
+ }
5819
+ .gap-1 {
5820
+ gap: calc(var(--spacing) * 1);
5821
+ }
5822
+ .gap-2 {
5823
+ gap: calc(var(--spacing) * 2);
5824
+ }
5825
+ .gap-4 {
5826
+ gap: calc(var(--spacing) * 4);
5827
+ }
5828
+ .gap-x-4 {
5829
+ column-gap: calc(var(--spacing) * 4);
5830
+ }
5831
+ .truncate {
5832
+ overflow: hidden;
5833
+ text-overflow: ellipsis;
5834
+ white-space: nowrap;
5835
+ }
5836
+ .overflow-auto {
5837
+ overflow: auto;
5838
+ }
5839
+ .overflow-hidden {
5840
+ overflow: hidden;
5841
+ }
5842
+ .overflow-y-auto {
5843
+ overflow-y: auto;
5844
+ }
5845
+ .rounded {
5846
+ border-radius: 0.25rem;
5847
+ }
5848
+ .rounded-full {
5849
+ border-radius: calc(infinity * 1px);
5850
+ }
5851
+ .rounded-lg {
5852
+ border-radius: var(--radius-lg);
5853
+ }
5854
+ .rounded-md {
5855
+ border-radius: var(--radius-md);
5856
+ }
5857
+ .rounded-sm {
5858
+ border-radius: var(--radius-sm);
5859
+ }
5860
+ .rounded-xl {
5861
+ border-radius: var(--radius-xl);
5862
+ }
5863
+ .border {
5864
+ border-style: var(--tw-border-style);
5865
+ border-width: 1px;
5866
+ }
5867
+ .border-b {
5868
+ border-bottom-style: var(--tw-border-style);
5869
+ border-bottom-width: 1px;
5870
+ }
5871
+ .border-b-2 {
5872
+ border-bottom-style: var(--tw-border-style);
5873
+ border-bottom-width: 2px;
5874
+ }
5875
+ .border-neutral-700 {
5876
+ border-color: var(--color-neutral-700);
5877
+ }
5878
+ .border-neutral-800 {
5879
+ border-color: var(--color-neutral-800);
5880
+ }
5881
+ .border-white {
5882
+ border-color: var(--color-white);
5883
+ }
5884
+ .border-white\\\\/10 {
5885
+ border-color: color-mix(in srgb, #fff 10%, transparent);
5886
+ @supports (color: color-mix(in lab, red, red)) {
5887
+ border-color: color-mix(in oklab, var(--color-white) 10%, transparent);
5888
+ }
5889
+ }
5890
+ .bg-\\\\[\\\\#171616\\\\] {
5891
+ background-color: #171616;
5892
+ }
5893
+ .bg-amber-500\\\\/20 {
5894
+ background-color: color-mix(in srgb, oklch(76.9% 0.188 70.08) 20%, transparent);
5895
+ @supports (color: color-mix(in lab, red, red)) {
5896
+ background-color: color-mix(in oklab, var(--color-amber-500) 20%, transparent);
5897
+ }
5898
+ }
5899
+ .bg-black\\\\/30 {
5900
+ background-color: color-mix(in srgb, #000 30%, transparent);
5901
+ @supports (color: color-mix(in lab, red, red)) {
5902
+ background-color: color-mix(in oklab, var(--color-black) 30%, transparent);
5903
+ }
5904
+ }
5905
+ .bg-neutral-400 {
5906
+ background-color: var(--color-neutral-400);
5907
+ }
5908
+ .bg-neutral-400\\\\/5 {
5909
+ background-color: color-mix(in srgb, oklch(70.8% 0 0) 5%, transparent);
5910
+ @supports (color: color-mix(in lab, red, red)) {
5911
+ background-color: color-mix(in oklab, var(--color-neutral-400) 5%, transparent);
5912
+ }
5913
+ }
5914
+ .bg-neutral-800 {
5915
+ background-color: var(--color-neutral-800);
5916
+ }
5917
+ .bg-neutral-900 {
5918
+ background-color: var(--color-neutral-900);
5919
+ }
5920
+ .bg-neutral-900\\\\/30 {
5921
+ background-color: color-mix(in srgb, oklch(20.5% 0 0) 30%, transparent);
5922
+ @supports (color: color-mix(in lab, red, red)) {
5923
+ background-color: color-mix(in oklab, var(--color-neutral-900) 30%, transparent);
5924
+ }
5925
+ }
5926
+ .bg-white {
5927
+ background-color: var(--color-white);
5928
+ }
5929
+ .bg-white\\\\/2\\\\.5 {
5930
+ background-color: color-mix(in srgb, #fff 2.5%, transparent);
5931
+ @supports (color: color-mix(in lab, red, red)) {
5932
+ background-color: color-mix(in oklab, var(--color-white) 2.5%, transparent);
5933
+ }
5934
+ }
5935
+ .bg-white\\\\/5 {
5936
+ background-color: color-mix(in srgb, #fff 5%, transparent);
5937
+ @supports (color: color-mix(in lab, red, red)) {
5938
+ background-color: color-mix(in oklab, var(--color-white) 5%, transparent);
5939
+ }
5940
+ }
5941
+ .p-0\\\\.5 {
5942
+ padding: calc(var(--spacing) * 0.5);
5943
+ }
5944
+ .p-1 {
5945
+ padding: calc(var(--spacing) * 1);
5946
+ }
5947
+ .p-2 {
5948
+ padding: calc(var(--spacing) * 2);
5949
+ }
5950
+ .px-1 {
5951
+ padding-inline: calc(var(--spacing) * 1);
5952
+ }
5953
+ .px-1\\\\.5 {
5954
+ padding-inline: calc(var(--spacing) * 1.5);
5955
+ }
5956
+ .px-2 {
5957
+ padding-inline: calc(var(--spacing) * 2);
5958
+ }
5959
+ .px-4 {
5960
+ padding-inline: calc(var(--spacing) * 4);
5961
+ }
5962
+ .py-0\\\\.5 {
5963
+ padding-block: calc(var(--spacing) * 0.5);
5964
+ }
5965
+ .py-1 {
5966
+ padding-block: calc(var(--spacing) * 1);
5967
+ }
5968
+ .py-2 {
5969
+ padding-block: calc(var(--spacing) * 2);
5970
+ }
5971
+ .py-8 {
5972
+ padding-block: calc(var(--spacing) * 8);
5973
+ }
5974
+ .py-px {
5975
+ padding-block: 1px;
5976
+ }
5977
+ .pt-2 {
5978
+ padding-top: calc(var(--spacing) * 2);
5979
+ }
5980
+ .pr-1 {
5981
+ padding-right: calc(var(--spacing) * 1);
5982
+ }
5983
+ .pb-2 {
5984
+ padding-bottom: calc(var(--spacing) * 2);
5985
+ }
5986
+ .pl-2 {
5987
+ padding-left: calc(var(--spacing) * 2);
5988
+ }
5989
+ .pl-4 {
5990
+ padding-left: calc(var(--spacing) * 4);
5991
+ }
5992
+ .text-center {
5993
+ text-align: center;
5994
+ }
5995
+ .text-left {
5996
+ text-align: left;
5997
+ }
5998
+ .text-right {
5999
+ text-align: right;
6000
+ }
6001
+ .font-mono {
6002
+ font-family: var(--font-mono);
6003
+ }
6004
+ .text-sm {
6005
+ font-size: var(--text-sm);
6006
+ line-height: var(--tw-leading, var(--text-sm--line-height));
6007
+ }
6008
+ .text-xs {
6009
+ font-size: var(--text-xs);
6010
+ line-height: var(--tw-leading, var(--text-xs--line-height));
6011
+ }
6012
+ .text-\\\\[10px\\\\] {
6013
+ font-size: 10px;
6014
+ }
6015
+ .text-\\\\[11px\\\\] {
6016
+ font-size: 11px;
6017
+ }
6018
+ .leading-none {
6019
+ --tw-leading: 1;
6020
+ line-height: 1;
6021
+ }
6022
+ .font-bold {
6023
+ --tw-font-weight: var(--font-weight-bold);
6024
+ font-weight: var(--font-weight-bold);
6025
+ }
6026
+ .font-medium {
6027
+ --tw-font-weight: var(--font-weight-medium);
6028
+ font-weight: var(--font-weight-medium);
6029
+ }
6030
+ .text-amber-400 {
6031
+ color: var(--color-amber-400);
6032
+ }
6033
+ .text-neutral-100 {
6034
+ color: var(--color-neutral-100);
6035
+ }
6036
+ .text-neutral-300 {
6037
+ color: var(--color-neutral-300);
6038
+ }
6039
+ .text-neutral-400 {
6040
+ color: var(--color-neutral-400);
6041
+ }
6042
+ .text-neutral-500 {
6043
+ color: var(--color-neutral-500);
6044
+ }
6045
+ .text-white {
6046
+ color: var(--color-white);
6047
+ }
6048
+ .italic {
6049
+ font-style: italic;
6050
+ }
6051
+ .opacity-50 {
6052
+ opacity: 50%;
6053
+ }
6054
+ .opacity-75 {
6055
+ opacity: 75%;
6056
+ }
6057
+ .opacity-90 {
6058
+ opacity: 90%;
6059
+ }
6060
+ .opacity-100 {
6061
+ opacity: 100%;
6062
+ }
6063
+ .shadow {
6064
+ --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
6065
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
6066
+ }
6067
+ .shadow-lg {
6068
+ --tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
6069
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
6070
+ }
6071
+ .shadow-sm {
6072
+ --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
6073
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
6074
+ }
6075
+ .transition {
6076
+ transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, content-visibility, overlay, pointer-events;
6077
+ transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
6078
+ transition-duration: var(--tw-duration, var(--default-transition-duration));
6079
+ }
6080
+ .transition-opacity {
6081
+ transition-property: opacity;
6082
+ transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
6083
+ transition-duration: var(--tw-duration, var(--default-transition-duration));
6084
+ }
6085
+ .transition-transform {
6086
+ transition-property: transform, translate, scale, rotate;
6087
+ transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
6088
+ transition-duration: var(--tw-duration, var(--default-transition-duration));
6089
+ }
6090
+ .duration-200 {
6091
+ --tw-duration: 200ms;
6092
+ transition-duration: 200ms;
6093
+ }
6094
+ .ease-in-out {
6095
+ --tw-ease: var(--ease-in-out);
6096
+ transition-timing-function: var(--ease-in-out);
6097
+ }
6098
+ .select-none {
6099
+ -webkit-user-select: none;
6100
+ user-select: none;
6101
+ }
6102
+ .last\\\\:border-b-0 {
6103
+ &:last-child {
6104
+ border-bottom-style: var(--tw-border-style);
6105
+ border-bottom-width: 0px;
6106
+ }
6107
+ }
6108
+ .hover\\\\:bg-neutral-700 {
6109
+ &:hover {
6110
+ @media (hover: hover) {
6111
+ background-color: var(--color-neutral-700);
6112
+ }
6113
+ }
6114
+ }
6115
+ .hover\\\\:bg-neutral-900 {
6116
+ &:hover {
6117
+ @media (hover: hover) {
6118
+ background-color: var(--color-neutral-900);
6119
+ }
6120
+ }
6121
+ }
6122
+ .hover\\\\:bg-white {
6123
+ &:hover {
6124
+ @media (hover: hover) {
6125
+ background-color: var(--color-white);
6126
+ }
6127
+ }
6128
+ }
6129
+ .hover\\\\:bg-white\\\\/5 {
6130
+ &:hover {
6131
+ @media (hover: hover) {
6132
+ background-color: color-mix(in srgb, #fff 5%, transparent);
6133
+ @supports (color: color-mix(in lab, red, red)) {
6134
+ background-color: color-mix(in oklab, var(--color-white) 5%, transparent);
6135
+ }
6136
+ }
6137
+ }
6138
+ }
6139
+ .hover\\\\:text-neutral-200 {
6140
+ &:hover {
6141
+ @media (hover: hover) {
6142
+ color: var(--color-neutral-200);
6143
+ }
6144
+ }
6145
+ }
6146
+ .hover\\\\:opacity-100 {
6147
+ &:hover {
6148
+ @media (hover: hover) {
6149
+ opacity: 100%;
6150
+ }
6151
+ }
6152
+ }
6153
+ .hover\\\\:opacity-100\\\\! {
6154
+ &:hover {
6155
+ @media (hover: hover) {
6156
+ opacity: 100% !important;
6157
+ }
6158
+ }
6159
+ }
6160
+ .focus\\\\:outline {
6161
+ &:focus {
6162
+ outline-style: var(--tw-outline-style);
6163
+ outline-width: 1px;
6164
+ }
6165
+ }
6166
+ .active\\\\:cursor-grabbing {
6167
+ &:active {
6168
+ cursor: grabbing;
6169
+ }
6170
+ }
6171
+ .sm\\\\:inline {
6172
+ @media (width >= 40rem) {
6173
+ display: inline;
6174
+ }
6175
+ }
5923
6176
  }
6177
+ @layer base {
6178
+ button:not(:disabled),
6179
+ [role="button"]:not(:disabled) {
6180
+ cursor: pointer;
6181
+ }
6182
+ }
6183
+ @property --tw-translate-x {
6184
+ syntax: "*";
6185
+ inherits: false;
6186
+ initial-value: 0;
6187
+ }
6188
+ @property --tw-translate-y {
6189
+ syntax: "*";
6190
+ inherits: false;
6191
+ initial-value: 0;
6192
+ }
6193
+ @property --tw-translate-z {
6194
+ syntax: "*";
6195
+ inherits: false;
6196
+ initial-value: 0;
6197
+ }
6198
+ @property --tw-scale-x {
6199
+ syntax: "*";
6200
+ inherits: false;
6201
+ initial-value: 1;
6202
+ }
6203
+ @property --tw-scale-y {
6204
+ syntax: "*";
6205
+ inherits: false;
6206
+ initial-value: 1;
6207
+ }
6208
+ @property --tw-scale-z {
6209
+ syntax: "*";
6210
+ inherits: false;
6211
+ initial-value: 1;
6212
+ }
6213
+ @property --tw-rotate-x {
6214
+ syntax: "*";
6215
+ inherits: false;
6216
+ }
6217
+ @property --tw-rotate-y {
6218
+ syntax: "*";
6219
+ inherits: false;
6220
+ }
6221
+ @property --tw-rotate-z {
6222
+ syntax: "*";
6223
+ inherits: false;
6224
+ }
6225
+ @property --tw-skew-x {
6226
+ syntax: "*";
6227
+ inherits: false;
6228
+ }
6229
+ @property --tw-skew-y {
6230
+ syntax: "*";
6231
+ inherits: false;
6232
+ }
6233
+ @property --tw-border-style {
6234
+ syntax: "*";
6235
+ inherits: false;
6236
+ initial-value: solid;
6237
+ }
6238
+ @property --tw-leading {
6239
+ syntax: "*";
6240
+ inherits: false;
6241
+ }
6242
+ @property --tw-font-weight {
6243
+ syntax: "*";
6244
+ inherits: false;
6245
+ }
6246
+ @property --tw-shadow {
6247
+ syntax: "*";
6248
+ inherits: false;
6249
+ initial-value: 0 0 #0000;
6250
+ }
6251
+ @property --tw-shadow-color {
6252
+ syntax: "*";
6253
+ inherits: false;
6254
+ }
6255
+ @property --tw-shadow-alpha {
6256
+ syntax: "<percentage>";
6257
+ inherits: false;
6258
+ initial-value: 100%;
6259
+ }
6260
+ @property --tw-inset-shadow {
6261
+ syntax: "*";
6262
+ inherits: false;
6263
+ initial-value: 0 0 #0000;
6264
+ }
6265
+ @property --tw-inset-shadow-color {
6266
+ syntax: "*";
6267
+ inherits: false;
6268
+ }
6269
+ @property --tw-inset-shadow-alpha {
6270
+ syntax: "<percentage>";
6271
+ inherits: false;
6272
+ initial-value: 100%;
6273
+ }
6274
+ @property --tw-ring-color {
6275
+ syntax: "*";
6276
+ inherits: false;
6277
+ }
6278
+ @property --tw-ring-shadow {
6279
+ syntax: "*";
6280
+ inherits: false;
6281
+ initial-value: 0 0 #0000;
6282
+ }
6283
+ @property --tw-inset-ring-color {
6284
+ syntax: "*";
6285
+ inherits: false;
6286
+ }
6287
+ @property --tw-inset-ring-shadow {
6288
+ syntax: "*";
6289
+ inherits: false;
6290
+ initial-value: 0 0 #0000;
6291
+ }
6292
+ @property --tw-ring-inset {
6293
+ syntax: "*";
6294
+ inherits: false;
6295
+ }
6296
+ @property --tw-ring-offset-width {
6297
+ syntax: "<length>";
6298
+ inherits: false;
6299
+ initial-value: 0px;
6300
+ }
6301
+ @property --tw-ring-offset-color {
6302
+ syntax: "*";
6303
+ inherits: false;
6304
+ initial-value: #fff;
6305
+ }
6306
+ @property --tw-ring-offset-shadow {
6307
+ syntax: "*";
6308
+ inherits: false;
6309
+ initial-value: 0 0 #0000;
6310
+ }
6311
+ @property --tw-duration {
6312
+ syntax: "*";
6313
+ inherits: false;
6314
+ }
6315
+ @property --tw-ease {
6316
+ syntax: "*";
6317
+ inherits: false;
6318
+ }
6319
+ @property --tw-outline-style {
6320
+ syntax: "*";
6321
+ inherits: false;
6322
+ initial-value: solid;
6323
+ }
6324
+ @layer properties {
6325
+ @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
6326
+ *, ::before, ::after, ::backdrop {
6327
+ --tw-translate-x: 0;
6328
+ --tw-translate-y: 0;
6329
+ --tw-translate-z: 0;
6330
+ --tw-scale-x: 1;
6331
+ --tw-scale-y: 1;
6332
+ --tw-scale-z: 1;
6333
+ --tw-rotate-x: initial;
6334
+ --tw-rotate-y: initial;
6335
+ --tw-rotate-z: initial;
6336
+ --tw-skew-x: initial;
6337
+ --tw-skew-y: initial;
6338
+ --tw-border-style: solid;
6339
+ --tw-leading: initial;
6340
+ --tw-font-weight: initial;
6341
+ --tw-shadow: 0 0 #0000;
6342
+ --tw-shadow-color: initial;
6343
+ --tw-shadow-alpha: 100%;
6344
+ --tw-inset-shadow: 0 0 #0000;
6345
+ --tw-inset-shadow-color: initial;
6346
+ --tw-inset-shadow-alpha: 100%;
6347
+ --tw-ring-color: initial;
6348
+ --tw-ring-shadow: 0 0 #0000;
6349
+ --tw-inset-ring-color: initial;
6350
+ --tw-inset-ring-shadow: 0 0 #0000;
6351
+ --tw-ring-inset: initial;
6352
+ --tw-ring-offset-width: 0px;
6353
+ --tw-ring-offset-color: #fff;
6354
+ --tw-ring-offset-shadow: 0 0 #0000;
6355
+ --tw-duration: initial;
6356
+ --tw-ease: initial;
6357
+ --tw-outline-style: solid;
6358
+ }
6359
+ }
6360
+ }\`;if("window"in globalThis){async function e(){let t=await Promise.resolve().then(()=>(V(),B)),{default:n}=await Promise.resolve().then(()=>(tg(),Qp)),{devtoolsState:i}=await Promise.resolve().then(()=>(ei(),Pp)),s=document.createElement("kiru-devtools");s.setAttribute("style","display: contents"),s.tabIndex=-1,document.body.appendChild(s);let o=s.attachShadow({mode:"open",delegatesFocus:!0}),r=new CSSStyleSheet;r.replaceSync(Ac),o.adoptedStyleSheets=[r],t.mount(t.createElement(n),o,{name:"kiru.devtools"});let a=()=>i.popupWindow.value?.close();window.addEventListener("close",a),window.addEventListener("beforeunload",a)}window.addEventListener("kiru:ready",e,{once:!0})}
6361
+ /*! Bundled license information:
5924
6362
 
5925
- /*
5926
- Make sure disabled buttons don't get the pointer cursor.
5927
- */
5928
- :disabled {
5929
- cursor: default;
5930
- }
6363
+ @kurkle/color/dist/color.esm.js:
6364
+ (*!
6365
+ * @kurkle/color v0.3.4
6366
+ * https://github.com/kurkle/color#readme
6367
+ * (c) 2024 Jukka Kurkela
6368
+ * Released under the MIT License
6369
+ *)
5931
6370
 
5932
- /*
5933
- 1. Make replaced elements \\\`display: block\\\` by default. (https://github.com/mozdevs/cssremedy/issues/14)
5934
- 2. Add \\\`vertical-align: middle\\\` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
5935
- This can trigger a poorly considered lint error in some tools but is included by design.
5936
- */
6371
+ chart.js/dist/chunks/helpers.dataset.js:
6372
+ chart.js/dist/chart.js:
6373
+ chart.js/dist/helpers.js:
6374
+ (*!
6375
+ * Chart.js v4.5.1
6376
+ * https://www.chartjs.org
6377
+ * (c) 2025 Chart.js Contributors
6378
+ * Released under the MIT License
6379
+ *)
5937
6380
 
5938
- img,
5939
- svg,
5940
- video,
5941
- canvas,
5942
- audio,
5943
- iframe,
5944
- embed,
5945
- object {
5946
- display: block; /* 1 */
5947
- vertical-align: middle; /* 2 */
5948
- }
6381
+ hammerjs/hammer.js:
6382
+ (*! Hammer.JS - v2.0.7 - 2016-04-22
6383
+ * http://hammerjs.github.io/
6384
+ *
6385
+ * Copyright (c) 2016 Jorik Tangelder;
6386
+ * Licensed under the MIT license *)
5949
6387
 
5950
- /*
5951
- Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
6388
+ chartjs-plugin-zoom/dist/chartjs-plugin-zoom.esm.js:
6389
+ (*!
6390
+ * chartjs-plugin-zoom v2.2.0
6391
+ * https://www.chartjs.org/chartjs-plugin-zoom/2.2.0/
6392
+ * (c) 2016-2024 chartjs-plugin-zoom Contributors
6393
+ * Released under the MIT License
6394
+ *)
5952
6395
  */
5953
6396
 
5954
- img,
5955
- video {
5956
- max-width: 100%;
5957
- height: auto;
5958
- }
5959
-
5960
- /* Make elements with the HTML hidden attribute stay hidden by default */
5961
- [hidden]:where(:not([hidden="until-found"])) {
5962
- display: none;
5963
- }
5964
- .pointer-events-none {
5965
- pointer-events: none;
5966
- }
5967
- .fixed {
5968
- position: fixed;
5969
- }
5970
- .sticky {
5971
- position: sticky;
5972
- }
5973
- .bottom-0 {
5974
- bottom: 0px;
5975
- }
5976
- .left-0 {
5977
- left: 0px;
5978
- }
5979
- .right-0 {
5980
- right: 0px;
5981
- }
5982
- .top-0 {
5983
- top: 0px;
5984
- }
5985
- .z-10 {
5986
- z-index: 10;
5987
- }
5988
- .z-\\\\[-9999\\\\] {
5989
- z-index: -9999;
5990
- }
5991
- .z-\\\\[9999999\\\\] {
5992
- z-index: 9999999;
5993
- }
5994
- .mb-2 {
5995
- margin-bottom: 0.5rem;
5996
- }
5997
- .inline {
5998
- display: inline;
5999
- }
6000
- .flex {
6001
- display: flex;
6002
- }
6003
- .grid {
6004
- display: grid;
6005
- }
6006
- .contents {
6007
- display: contents;
6008
- }
6009
- .h-0 {
6010
- height: 0px;
6011
- }
6012
- .h-5 {
6013
- height: 1.25rem;
6014
- }
6015
- .w-5 {
6016
- width: 1.25rem;
6017
- }
6018
- .w-full {
6019
- width: 100%;
6020
- }
6021
- .flex-grow {
6022
- flex-grow: 1;
6023
- }
6024
- .rotate-90 {
6025
- --tw-rotate: 90deg;
6026
- transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
6027
- }
6028
- .transform {
6029
- transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
6030
- }
6031
- .cursor-default {
6032
- cursor: default;
6033
- }
6034
- .cursor-pointer {
6035
- cursor: pointer;
6036
- }
6037
- .resize {
6038
- resize: both;
6039
- }
6040
- .flex-col {
6041
- flex-direction: column;
6042
- }
6043
- .place-content-center {
6044
- place-content: center;
6045
- }
6046
- .items-start {
6047
- align-items: flex-start;
6048
- }
6049
- .items-center {
6050
- align-items: center;
6051
- }
6052
- .justify-between {
6053
- justify-content: space-between;
6054
- }
6055
- .gap-1 {
6056
- gap: 0.25rem;
6057
- }
6058
- .gap-2 {
6059
- gap: 0.5rem;
6060
- }
6061
- .overflow-hidden {
6062
- overflow: hidden;
6063
- }
6064
- .overflow-scroll {
6065
- overflow: scroll;
6066
- }
6067
- .truncate {
6068
- overflow: hidden;
6069
- text-overflow: ellipsis;
6070
- white-space: nowrap;
6071
- }
6072
- .rounded {
6073
- border-radius: 0.25rem;
6074
- }
6075
- .rounded-3xl {
6076
- border-radius: 1.5rem;
6077
- }
6078
- .rounded-full {
6079
- border-radius: 9999px;
6080
- }
6081
- .border {
6082
- border-width: 1px;
6083
- }
6084
- .border-b {
6085
- border-bottom-width: 1px;
6086
- }
6087
- .border-b-2 {
6088
- border-bottom-width: 2px;
6089
- }
6090
- .border-\\\\[\\\\#fff1\\\\] {
6091
- border-color: #fff1;
6092
- }
6093
- .border-neutral-700 {
6094
- --tw-border-opacity: 1;
6095
- border-color: rgb(64 64 64 / var(--tw-border-opacity, 1));
6096
- }
6097
- .border-neutral-800 {
6098
- --tw-border-opacity: 1;
6099
- border-color: rgb(38 38 38 / var(--tw-border-opacity, 1));
6100
- }
6101
- .border-white {
6102
- --tw-border-opacity: 1;
6103
- border-color: rgb(255 255 255 / var(--tw-border-opacity, 1));
6104
- }
6105
- .border-opacity-10 {
6106
- --tw-border-opacity: 0.1;
6107
- }
6108
- .bg-\\\\[\\\\#0003\\\\] {
6109
- background-color: #0003;
6110
- }
6111
- .bg-\\\\[\\\\#1d1d1d\\\\] {
6112
- --tw-bg-opacity: 1;
6113
- background-color: rgb(29 29 29 / var(--tw-bg-opacity, 1));
6114
- }
6115
- .bg-\\\\[\\\\#212121\\\\] {
6116
- --tw-bg-opacity: 1;
6117
- background-color: rgb(33 33 33 / var(--tw-bg-opacity, 1));
6118
- }
6119
- .bg-\\\\[\\\\#ffffff04\\\\] {
6120
- background-color: #ffffff04;
6121
- }
6122
- .bg-\\\\[crimson\\\\]\\\\/80 {
6123
- background-color: rgb(220 20 60 / 0.8);
6124
- }
6125
- .bg-crimson {
6126
- --tw-bg-opacity: 1;
6127
- background-color: rgb(220 20 60 / var(--tw-bg-opacity, 1));
6128
- }
6129
- .bg-neutral-400 {
6130
- --tw-bg-opacity: 1;
6131
- background-color: rgb(163 163 163 / var(--tw-bg-opacity, 1));
6132
- }
6133
- .bg-opacity-5 {
6134
- --tw-bg-opacity: 0.05;
6135
- }
6136
- .p-1 {
6137
- padding: 0.25rem;
6138
- }
6139
- .p-2 {
6140
- padding: 0.5rem;
6141
- }
6142
- .px-2 {
6143
- padding-left: 0.5rem;
6144
- padding-right: 0.5rem;
6145
- }
6146
- .py-1 {
6147
- padding-top: 0.25rem;
6148
- padding-bottom: 0.25rem;
6149
- }
6150
- .pb-2 {
6151
- padding-bottom: 0.5rem;
6152
- }
6153
- .pl-2 {
6154
- padding-left: 0.5rem;
6155
- }
6156
- .pl-6 {
6157
- padding-left: 1.5rem;
6158
- }
6159
- .pr-1 {
6160
- padding-right: 0.25rem;
6161
- }
6162
- .text-\\\\[10px\\\\] {
6163
- font-size: 10px;
6164
- }
6165
- .text-sm {
6166
- font-size: 0.875rem;
6167
- line-height: 1.25rem;
6168
- }
6169
- .text-xs {
6170
- font-size: 0.75rem;
6171
- line-height: 1rem;
6172
- }
6173
- .font-bold {
6174
- font-weight: 700;
6175
- }
6176
- .font-medium {
6177
- font-weight: 500;
6178
- }
6179
- .text-neutral-300 {
6180
- --tw-text-opacity: 1;
6181
- color: rgb(212 212 212 / var(--tw-text-opacity, 1));
6182
- }
6183
- .text-white {
6184
- --tw-text-opacity: 1;
6185
- color: rgb(255 255 255 / var(--tw-text-opacity, 1));
6186
- }
6187
- .accent-red-500 {
6188
- accent-color: #ef4444;
6189
- }
6190
- .opacity-50 {
6191
- opacity: 0.5;
6192
- }
6193
- .shadow {
6194
- --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
6195
- --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
6196
- box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
6197
- }
6198
- .filter {
6199
- 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);
6200
- }
6201
- .transition {
6202
- transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
6203
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
6204
- transition-duration: 150ms;
6205
- }
6206
- .transition-opacity {
6207
- transition-property: opacity;
6208
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
6209
- transition-duration: 150ms;
6210
- }
6211
- .will-change-transform {
6212
- will-change: transform;
6213
- }
6214
- .last\\\\:border-b-0:last-child {
6215
- border-bottom-width: 0px;
6216
- }
6217
- .hover\\\\:bg-\\\\[\\\\#0003\\\\]:hover {
6218
- background-color: #0003;
6219
- }
6220
- .hover\\\\:bg-neutral-700:hover {
6221
- --tw-bg-opacity: 1;
6222
- background-color: rgb(64 64 64 / var(--tw-bg-opacity, 1));
6223
- }
6224
- .hover\\\\:opacity-100:hover {
6225
- opacity: 1;
6226
- }
6227
- .focus\\\\:outline:focus {
6228
- outline-style: solid;
6229
- }
6230
- \`;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(Gr),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),kr(d(Dt,{}),o,{name:"kiru.devtools"});let i=()=>q.value?.close();window.addEventListener("close",i),window.addEventListener("beforeunload",i),R.addEventListener(s=>{switch(s.data.type){case"update-node":{let a=window.__devtoolsNodeUpdatePtr;Ke(a,"failed to get node ptr");let u=U(a);Ke(u,"failed to get app context");let c=window.__kiru.getSchedulerInterface(u);Ke(c,"failed to get scheduler interface"),c.requestUpdate(a),window.__devtoolsNodeUpdatePtr=null;break}case"open-editor":{window.open(s.data.fileLink);break}}})};Xn=e,window.addEventListener("kiru:ready",e,{once:!0})}var Xn;
6231
-
6232
6397
  `;
6233
6398
 
6234
6399
  // src/devtools.ts
6235
- function setupDevtools(server, options, dtHostScriptPath, log2) {
6236
- const { dtClientPathname } = options;
6400
+ function setupDevtools(server, _options, dtHostScriptPath, log2) {
6237
6401
  log2(`Serving devtools host at ${ANSI.magenta(dtHostScriptPath)}`);
6238
6402
  server.middlewares.use(dtHostScriptPath, (_, res) => {
6239
6403
  res.setHeader("Content-Type", "application/javascript");
6240
- res.end(dist_default2, "utf-8");
6241
- });
6242
- log2(`Serving devtools client at ${ANSI.magenta(dtClientPathname)}`);
6243
- server.middlewares.use(dtClientPathname, (_, res) => {
6244
6404
  res.end(dist_default, "utf-8");
6245
6405
  });
6246
6406
  }