vite-plugin-kiru 0.26.0 → 0.27.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.
Files changed (2) hide show
  1. package/dist/index.js +790 -1175
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -24,11 +24,27 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
24
  mod
25
25
  ));
26
26
 
27
- // ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.4/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js
27
+ // ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js
28
28
  var require_sourcemap_codec_umd = __commonJS({
29
- "../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.4/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js"(exports, module) {
30
- (function(global, factory, m) {
31
- typeof exports === "object" && typeof module !== "undefined" ? factory(module) : typeof define === "function" && define.amd ? define(["module"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(m = { exports: {} }), global.sourcemapCodec = "default" in m.exports ? m.exports.default : m.exports);
29
+ "../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js"(exports, module) {
30
+ (function(global, factory) {
31
+ if (typeof exports === "object" && typeof module !== "undefined") {
32
+ factory(module);
33
+ module.exports = def(module);
34
+ } else if (typeof define === "function" && define.amd) {
35
+ define(["module"], function(mod) {
36
+ factory.apply(this, arguments);
37
+ mod.exports = def(mod);
38
+ });
39
+ } else {
40
+ const mod = { exports: {} };
41
+ factory(mod);
42
+ global = typeof globalThis !== "undefined" ? globalThis : global || self;
43
+ global.sourcemapCodec = def(mod);
44
+ }
45
+ function def(m) {
46
+ return "default" in m.exports ? m.exports.default : m.exports;
47
+ }
32
48
  })(exports, function(module2) {
33
49
  "use strict";
34
50
  var __defProp2 = Object.defineProperty;
@@ -469,9 +485,9 @@ var require_sourcemap_codec_umd = __commonJS({
469
485
  }
470
486
  });
471
487
 
472
- // ../../node_modules/.pnpm/magic-string@0.30.17/node_modules/magic-string/dist/magic-string.cjs.js
488
+ // ../../node_modules/.pnpm/magic-string@0.30.19/node_modules/magic-string/dist/magic-string.cjs.js
473
489
  var require_magic_string_cjs = __commonJS({
474
- "../../node_modules/.pnpm/magic-string@0.30.17/node_modules/magic-string/dist/magic-string.cjs.js"(exports, module) {
490
+ "../../node_modules/.pnpm/magic-string@0.30.19/node_modules/magic-string/dist/magic-string.cjs.js"(exports, module) {
475
491
  "use strict";
476
492
  var sourcemapCodec = require_sourcemap_codec_umd();
477
493
  var BitSet = class _BitSet {
@@ -910,6 +926,9 @@ var require_magic_string_cjs = __commonJS({
910
926
  }
911
927
  if (chunk.outro.length) mappings.advance(chunk.outro);
912
928
  });
929
+ if (this.outro) {
930
+ mappings.advance(this.outro);
931
+ }
913
932
  return {
914
933
  file: options.file ? options.file.split(/[/\\]/).pop() : void 0,
915
934
  sources: [
@@ -1267,10 +1286,13 @@ var require_magic_string_cjs = __commonJS({
1267
1286
  _split(index) {
1268
1287
  if (this.byStart[index] || this.byEnd[index]) return;
1269
1288
  let chunk = this.lastSearchedChunk;
1289
+ let previousChunk = chunk;
1270
1290
  const searchForward = index > chunk.end;
1271
1291
  while (chunk) {
1272
1292
  if (chunk.contains(index)) return this._splitChunk(chunk, index);
1273
1293
  chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];
1294
+ if (chunk === previousChunk) return;
1295
+ previousChunk = chunk;
1274
1296
  }
1275
1297
  }
1276
1298
  _splitChunk(chunk, index) {
@@ -1417,7 +1439,12 @@ var require_magic_string_cjs = __commonJS({
1417
1439
  const { original } = this;
1418
1440
  const index = original.indexOf(string);
1419
1441
  if (index !== -1) {
1420
- this.overwrite(index, index + string.length, replacement);
1442
+ if (typeof replacement === "function") {
1443
+ replacement = replacement(string, index, original);
1444
+ }
1445
+ if (string !== replacement) {
1446
+ this.overwrite(index, index + string.length, replacement);
1447
+ }
1421
1448
  }
1422
1449
  return this;
1423
1450
  }
@@ -1432,7 +1459,11 @@ var require_magic_string_cjs = __commonJS({
1432
1459
  const stringLength = string.length;
1433
1460
  for (let index = original.indexOf(string); index !== -1; index = original.indexOf(string, index + stringLength)) {
1434
1461
  const previous = original.slice(index, index + stringLength);
1435
- if (previous !== replacement) this.overwrite(index, index + stringLength, replacement);
1462
+ let _replacement = replacement;
1463
+ if (typeof replacement === "function") {
1464
+ _replacement = replacement(previous, index, original);
1465
+ }
1466
+ if (previous !== _replacement) this.overwrite(index, index + stringLength, _replacement);
1436
1467
  }
1437
1468
  return this;
1438
1469
  }
@@ -1692,36 +1723,36 @@ var dist_default = `<!DOCTYPE html>
1692
1723
  <link rel="icon" type="image/svg+xml" href="./favicon.svg" />
1693
1724
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
1694
1725
  <title>Kiru Devtools</title>
1695
- <script type="module" crossorigin>import*as m from"kiru";import{useState as xe,useEffect as ct,useCallback as Te,createContext as ol,useContext as rl,useMemo as jn,unwrap as al,useRequestUpdate as te,requestUpdate as ll,useSignal as Q,sideEffectsEnabled as mr,useHook as br,depsRequireChange as xr,cleanupHook as yr,useLayoutEffect as Ki,signal as ht,useRef as Ce,computed as vr,mount as cl}from"kiru";(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 hl=Symbol.for("kiru.fragment"),ul=8;new Array;var zs;(function(e){e.Start="start",e.End="end"})(zs||(zs={}));function dl(e){return(e.flags&ul)!==0}function fl(e){return e.type===hl}function gl(e){return typeof e.type=="function"&&"displayName"in e.type&&e.type.displayName==="Kiru.lazy"}function pl(e){return typeof e.type=="function"&&"displayName"in e.type&&e.type.displayName==="Kiru.memo"}function Mi(...e){return e.filter(Boolean).join(" ")}function Zi(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 _r(e){return e.type.displayName??(e.type.name||"Anonymous Function")}const ml=e=>e.__devtoolsFileLink??null;function an(e){return e.name==="kiru.devtools"}function wr(e){return Array.from(e.entries())}function bl(e){return m.createElement("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.createElement("rect",{width:"20",height:"16",x:"2",y:"4",rx:"2"}),m.createElement("path",{d:"M12 9v11"}),m.createElement("path",{d:"M2 9h13a2 2 0 0 1 2 2v9"}))}function Kt(e){return m.createElement("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},m.createElement("path",{d:"m9 18 6-6-6-6"}))}function xl(e){return m.createElement("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.createElement("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.createElement("circle",{cx:"12",cy:"12",r:"3"}))}function yl(e){return m.createElement("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.createElement("path",{d:"M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6"}),m.createElement("path",{d:"m21 3-9 9"}),m.createElement("path",{d:"M15 3h6v6"}))}function vl(e){return m.createElement("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.createElement("path",{d:"m12 14 4-4"}),m.createElement("path",{d:"M3.34 19a10 10 0 1 1 17.32 0"}))}function _l(e){return m.createElement("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.createElement("circle",{cx:"12",cy:"12",r:"10"}),m.createElement("path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"}),m.createElement("path",{d:"M2 12h20"}))}function wl(e){return m.createElement("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.createElement("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),m.createElement("path",{d:"M21 3v5h-5"}),m.createElement("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),m.createElement("path",{d:"M8 16H3v5"}))}function El(e){return m.createElement("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.createElement("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"}),m.createElement("path",{d:"M6 18h12"}),m.createElement("path",{d:"M6 14h12"}),m.createElement("rect",{width:"12",height:"12",x:"6",y:"10"}))}function Er(e){return m.createElement("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.createElement("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"}),m.createElement("path",{d:"M12 9v4"}),m.createElement("path",{d:"M12 17h.01"}))}function Sr({title:e,children:t,className:n,disabled:i,...s}){const[o,r]=xe(!0);ct(()=>{!o&&i&&r(!0)},[i]);const a=Te(l=>{l.preventDefault(),l.stopImmediatePropagation(),r(c=>!c)},[]);return m.createElement("div",{className:"flex flex-col"},m.createElement("button",{onclick:a,disabled:i,className:\`\${i?"opacity-50 cursor-default":"cursor-pointer"}\`},m.createElement("span",{className:"flex items-center gap-2 font-medium"},m.createElement(Kt,{className:\`transition \${o?"":"rotate-90"}\`}),e)),o?null:m.createElement("div",{className:\`p-2 \${n||""}\`,...s},t))}const Qi={arrayChunkSize:10,objectKeysChunkSize:100};function kr(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"&&!kr(e[i],t[i]))return!1;return!0}function Tr(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"?Tr(e[i],t[i],n):n(e,i,e[i])}let Mr={...Qi};const Fs=localStorage.getItem("kiru.devtools.userSettings");if(Fs)try{const e=JSON.parse(Fs);kr(Qi,e)&&(Mr=e)}catch(e){console.error("kiru.devtools.userSettings error",e)}const Or=ol({userSettings:null,saveUserSettings:()=>{}}),ei=()=>rl(Or);function Sl({children:e}){const[t,n]=xe(Mr),i=s=>{localStorage.setItem("kiru.devtools.userSettings",JSON.stringify(s)),n(s)};return m.createElement(Or.Provider,{value:{userSettings:t,saveUserSettings:i}},e)}function kl(){const{userSettings:e,saveUserSettings:t}=ei();return m.createElement("div",{className:"rounded bg-neutral-400 bg-opacity-5 border border-white border-opacity-10 overflow-hidden"},m.createElement(ye,{border:!1,data:e,onChange:(n,i)=>{const s={...e};Zi(s,n,i),Tr(s,Qi,(o,r,a)=>{o[r]=a<1?1:a}),t(s)},mutable:!0,objectRefAcc:[]}))}const Tl=Object.freeze(()=>{});function ye({data:e,onChange:t,mutable:n,objectRefAcc:i,keys:s=[],className:o,border:r=!0}){const{userSettings:{objectKeysChunkSize:a}}=ei(),[l,c]=xe(0),h=jn(()=>Object.keys(e).slice(0,(l+1)*a),[l,a,e]),d=()=>{h.forEach(p=>{typeof e[p]=="object"&&i.splice(i.indexOf(e[p]),1)}),c(l+1)},g=h.length<Object.keys(e).length;return m.createElement(m.Fragment,null,m.createElement("div",{className:Mi("flex flex-col items-start w-full",r&&"border border-neutral-700",al(o))},h.map(p=>{const y=s.concat(p),x=y.join(".");return m.createElement("div",{key:x,"data-key":x,className:"flex flex-col items-start w-full gap-2 pl-2 py-1 pr-1 border-b border-neutral-700 last:border-b-0"},m.createElement(Ji,{value:e[p],onChange:t,keys:y,path:x,label:p,mutable:n,objectRefAcc:i}))})),g&&m.createElement("button",{onclick:d,title:"Show more",className:"p-1 border font-bold border-neutral-700 hover:bg-neutral-700"},m.createElement("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.createElement("circle",{cx:"12",cy:"12",r:"1"}),m.createElement("circle",{cx:"19",cy:"12",r:"1"}),m.createElement("circle",{cx:"5",cy:"12",r:"1"}))))}function Un(e,t){Array.isArray(e)?(t(e),e.forEach(n=>Un(n,t))):typeof e=="object"&&e!==null&&(t(e),Object.values(e).forEach(n=>Un(n,t)))}function Ji({value:e,onChange:t,keys:n,path:i,mutable:s,objectRefAcc:o,label:r}){const{userSettings:{arrayChunkSize:a}}=ei(),[l,c]=xe(!0),h=r!==void 0&&m.createElement("label",{htmlFor:i,className:"text-xs truncate",title:i,children:r});if(e===null)return m.createElement(pt,null,h,m.createElement(jt,null,"null"));if(e===void 0)return m.createElement(pt,null,h,m.createElement(jt,null,"undefined"));const d=window.opener?window.opener.Node:Node;if(e instanceof d)return m.createElement(pt,null,h,m.createElement(jt,null,"<",m.createElement("span",{style:{color:"#f0a05e"}},e.nodeName),"/>"));const g=window.opener?window.opener.Error:Error;if(e instanceof g)return m.createElement(pt,null,h,"cause"in e&&e.cause?m.createElement(jt,null,e.message," (",String(e.cause),")"):m.createElement(jt,null,e.message));const p=y=>t(n,y);switch(typeof e){case"string":return m.createElement(pt,null,h,m.createElement(pi,{disabled:!s,id:i,type:"text",value:e,onchange:y=>p(y.target.value)}));case"number":return m.createElement(pt,null,h,m.createElement(pi,{disabled:!s,id:i,type:"number",value:e,placeholder:"NaN",onchange:y=>p(Number(y.target.value))}));case"bigint":return m.createElement(pt,null,h,m.createElement(pi,{disabled:!s,id:i,type:"number",value:e.toString(),onchange:y=>p(BigInt(y.target.value))}));case"boolean":return m.createElement(pt,null,h,m.createElement("input",{disabled:!s,id:i,type:"checkbox",checked:e,onchange:y=>p(y.target.checked),className:"accent-red-500"}));case"function":return m.createElement(pt,null,h,m.createElement(jt,null,\`\u0192 \${e.name||"anonymous"}()\`));default:return Array.isArray(e)?m.createElement(pt,null,m.createElement("button",{className:"text-xs flex items-center gap-1 cursor-pointer w-full",title:i,onclick:()=>{Un(e,y=>o.splice(o.indexOf(y),1)),c(y=>!y)}},r,m.createElement(Kt,{width:10,height:10,className:\`transition \${l?"":"rotate-90"}\`})),l?m.createElement(jt,null,"Array(",e.length,")"):e.length>a?m.createElement(Ml,{array:e,objectRefAcc:o}):m.createElement("div",{className:"flex flex-col items-start gap-1 w-full"},e.map((y,x)=>m.createElement(Ji,{value:y,onChange:t,keys:[...n,x.toString()],path:i.concat(".",x.toString()),label:x.toString(),mutable:s,objectRefAcc:o})))):o.includes(e)?m.createElement(pt,null,h,m.createElement(jt,null,"Object(circular reference)")):(o.push(e),m.createElement(pt,null,m.createElement("button",{className:"text-xs flex items-center gap-1 cursor-pointer w-full",title:i,onclick:()=>{Un(e,y=>o.splice(o.indexOf(y),1)),c(y=>!y)}},r,m.createElement(Kt,{width:10,height:10,className:\`transition \${l?"":"rotate-90"}\`})),l?null:m.createElement(ye,{data:e,onChange:t,keys:n,mutable:s,objectRefAcc:o})))}}function pt({children:e}){return m.createElement("div",{className:"flex flex-col items-start gap-1 w-full"},e)}function pi(e){return m.createElement("input",{className:"flex-grow text-xs px-2 py-1 text-neutral-300 w-full",...e})}function jt({children:e}){return m.createElement("small",{className:"text-neutral-300"},m.createElement("i",null,e))}function Ml({array:e,objectRefAcc:t}){const{userSettings:{arrayChunkSize:n}}=ei(),i=e.length,s=Math.ceil(i/n);return m.createElement("div",{className:"flex flex-col items-start gap-1 w-full"},Array.from({length:s}).map((o,r)=>m.createElement(Ol,{array:e,range:{start:r*n,end:(r+1)*n},objectRefAcc:t})))}function Ol({array:e,range:t,objectRefAcc:n}){const[i,s]=xe(!0);let o;return i?o=void 0:o=e.slice(t.start,t.end),m.createElement("div",{className:"flex flex-col items-start gap-1 w-full"},m.createElement("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,"]",m.createElement(Kt,{width:10,height:10,className:\`transition \${i?"":"rotate-90"}\`})),o&&m.createElement("div",{className:"flex flex-col items-start gap-1 w-full"},o.map((r,a)=>m.createElement(Ji,{value:r,onChange:Tl,label:(t.start+a).toString(),keys:[a.toString()],path:a.toString(),mutable:!1,objectRefAcc:n}))))}const Cl="kiru-devtools";"window"in globalThis&&(window.__devtoolsSelection??=null);class Pl extends BroadcastChannel{send(t){super.postMessage(t)}removeEventListener(t){return super.removeEventListener("message",t)}addEventListener(t){return super.addEventListener("message",t)}}const Pe=new Pl(Cl);function ts({fn:e,onclick:t}){const n=jn(()=>ml(e),[e]);return n?m.createElement("a",{className:"flex items-center gap-1 text-[10px] opacity-50 hover:opacity-100 transition-opacity",href:n,onclick:i=>{i.preventDefault(),Pe.send({type:"open-editor",fileLink:n}),t?.(i)},title:"Open in editor"},"Open in editor",m.createElement(yl,{width:"0.65rem",height:"0.65rem"})):null}function Dl({selectedApp:e,selectedNode:t,setSelectedNode:n,kiruGlobal:i}){const s=te();ct(()=>{const l=c=>{c===e&&(dl(t)?n(null):s())};return i?.on("update",l),()=>i?.off("update",l)},[]);const o=()=>{t&&ll(t)},r={...t.props};delete r.children;const a=Nl(t);return m.createElement("div",{className:"flex-grow p-2 sticky top-0"},m.createElement("h2",{className:"flex justify-between items-center font-bold mb-2 pb-2 border-b-2 border-neutral-800"},m.createElement("div",{className:"flex gap-2 items-center"},"<"+_r(t)+">",m.createElement(ts,{fn:t.type})),m.createElement("button",{onclick:o},m.createElement(wl,{className:"w-5 h-5"}))),m.createElement(Sr,{title:"props",disabled:Object.keys(r).length===0},m.createElement(ye,{data:r,onChange:()=>{},mutable:!1,objectRefAcc:[]})),m.createElement(Cr,{node:a,selectedApp:e}))}function Al(e){return e.name==="devtools:useHookDebugGroup"}function Il(e){return Oi in e}const Oi=Symbol.for("devtools.hookGroup");function Nl(e){const t={parent:null,name:"hooks",children:[],[Oi]:!0};if(e.hooks?.length){let n=t;for(let i=0;i<e.hooks.length;i++){const s=e.hooks[i];if(Al(s)){switch(s.action){case"start":const o={parent:n,name:s.displayName,children:[],[Oi]:!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 Cr({node:e,selectedApp:t,depth:n=0}){if(Il(e))return m.createElement(Sr,{title:e.name,className:"bg-[#ffffff04] border border-[#fff1] flex flex-col gap-2 pl-6",disabled:e.children.length===0},e.children.map(h=>m.createElement(Cr,{node:h,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,c=(h,d)=>{if(!t||!a?.set||!a?.get)return;const g=a.get();Zi(g,h,d),a.set(g)};return m.createElement("div",null,m.createElement("i",{className:"text-neutral-300 text-sm"},i||"anonymous hook"),m.createElement("div",{className:"p-2"},m.createElement(ye,{data:l,onChange:c,mutable:!!a?.set,objectRefAcc:[]})))}const ge=(e,t,n={})=>{ct(()=>{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])},Ll=()=>{const e=Q({x:0,y:0}),t=Q({x:0,y:0}),n=Q({x:0,y:0});return ge("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}},Sn="window"in globalThis&&"ResizeObserver"in globalThis.window,Rl=(e,t,n=void 0)=>mr()?Sn?br("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(()=>{xr([e.current],s.deps)&&(s.deps=[e.current],s.resizeObserver?.disconnect?.(),e.current&&s.resizeObserver?.observe(e.current,n))}),{isSupported:Sn,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:()=>{yr(s)}})):{isSupported:Sn,start:()=>{},stop:()=>{}}:{isSupported:Sn,start:()=>{},stop:()=>{}},kn="window"in globalThis&&"MutationObserver"in globalThis.window,zl=(e,t,n=void 0)=>mr()?kn?br("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}):xr([e.current],s.deps)&&(s.deps=[e.current],s.mutationObserver?.disconnect?.(),e.current&&s.mutationObserver?.observe(e.current,n)),{isSupported:kn,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:()=>{yr(s)}})):{isSupported:kn,start:()=>{},stop:()=>{}}:{isSupported:kn,start:()=>{},stop:()=>{}},Fl=(e,t={windowScroll:!0,windowResize:!0})=>{const n=t?.windowScroll??!0,i=t?.windowResize??!0,s=t.immediate??!0,o=Q(0),r=Q(0),a=Q(0),l=Q(0),c=Q(0),h=Q(0),d=Q(0),g=Q(0),p=()=>{const y=e.current;if(!y){o.value=0,r.value=0,a.value=0,l.value=0,c.value=0,h.value=0,d.value=0,g.value=0;return}const x=y.getBoundingClientRect();o.value=x.width,r.value=x.height,a.value=x.top,l.value=x.right,c.value=x.bottom,h.value=x.left,d.value=x.x,g.value=x.y};return Rl(e,p),zl(e,p,{attributeFilter:["style","class"]}),ge("scroll",()=>{n&&p()},{capture:!0,passive:!0}),ge("resize",()=>{i&&p()},{passive:!0}),Ki(()=>{s&&p()},[]),{width:o,height:r,top:a,right:l,bottom:c,left:h,x:d,y:g,update:p}};function Hl(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}const Hs=(e,t,n={})=>{const{ref:i,eventName:s="keydown",passive:o=!1}=n,r=Hl(e);return ge(s,l=>{l.repeat&&!n.repeat||r(l)&&t(l)},{ref:i,passive:o})};function Pr({value:e,className:t,...n}){return m.createElement("div",{className:Mi("w-full p-2 z-10","bg-[#1d1d1d] border border-white border-opacity-10 rounded",t?.toString()),...n},m.createElement("input",{className:Mi("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","bind:value":e}))}let U;"window"in globalThis&&window.opener&&(U=window.opener.__kiru);const Me=ht(!1);Pe.addEventListener(e=>{e.data.type==="set-inspect-enabled"&&(Me.value=e.data.value)});const Dr=(U?.apps??[]).filter(e=>!an(e)),Xt=ht(Dr);ht(null);const Pt=ht(Dr[0]??null),qt=ht(null);U?.on("mount",e=>{an(e)||(Xt.value=[...Xt.peek(),e],Pt.peek()===null&&(Pt.value=e))});U?.on("unmount",e=>{Xt.value=Xt.peek().filter(t=>t!==e),Pt.peek()===e&&(Pt.value=Xt.peek()[0]??null)});const Ci=ht(new Map),Dt=ht(null),es=ht("");function Bl(e){return e.type.displayName??(e.type.name||"Anonymous Function")}function Wl(e,t){const n=t.toLowerCase();return e.every(i=>n.includes(i))}function Pi(e){return typeof e.type=="function"&&!fl(e)&&!gl(e)&&!pl(e)}function Vl(e){let t=[e];for(;t.length;){const n=t.pop();if(Pi(n))return!0;n.child&&t.push(n.child),n.sibling&&t.push(n.sibling)}return!1}const jl=(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 Di(e,t){if(!e)return null;const n=t(e),i=Di(e.sibling,t),s=Di(e.child,t);return n?{ref:e,sibling:i??null,child:s??null}:i||s||null}function Yn({node:e,traverseSiblings:t=!0}){const[n,i]=xe(!0),o=qt.value===e,r=jn(()=>crypto.randomUUID(),[]),a=jn(()=>Dt.value==null?null:jl(e,Dt.value),[Dt.value,e]);ct(()=>{a&&i(!1)},[a]),ct(()=>{if(!(!e||!Pi(e)))return Ci.peek().set(r,{vNode:e,setCollapsed:i}),()=>{Ci.peek().delete(r)}});const l=es.value;if(!e)return null;if(!Pi(e)||l.length>0&&!Wl(l.toLowerCase().split(" "),e.type.name))return m.createElement(m.Fragment,null,e.child&&m.createElement(Yn,{node:e.child}),t&&m.createElement(Bs,{node:e}));const c=e.child&&Vl(e.child);return m.createElement(m.Fragment,null,m.createElement("div",{className:"pl-4 mb-1"},m.createElement("h2",{onclick:()=>{Dt.value=null,qt.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&&m.createElement(Kt,{className:\`cursor-pointer transition \${n?"":"rotate-90"}\`,onclick:h=>{h.preventDefault(),h.stopImmediatePropagation(),Dt.value=null,i(d=>!d)}}),m.createElement("div",{className:c?"":"ml-6"},m.createElement("span",{className:o?"":"text-neutral-400"},"<"),m.createElement("span",{className:o?"":"text-primary"},Bl(e)),m.createElement("span",{className:o?"":"text-neutral-400"},">"))),!n&&e.child||a!=null&&a&&e.child?m.createElement(Yn,{node:e.child}):null),t&&m.createElement(Bs,{node:e}))}function Bs({node:e}){if(!e)return null;let t=[],n=e.sibling;for(;n;)t.push(n),n=n.sibling;return m.createElement(m.Fragment,null,t.map(i=>m.createElement(Yn,{node:i,traverseSiblings:!1})))}const Ul=()=>{const e=Ce(null),t=r=>{if(!r)return null;const a=r.getAttribute("data-id");if(a!=null)return Ci.peek().get(a)},n=r=>{if(!r)return;const a=t(r);a!=null&&(r.scrollIntoView({behavior:"smooth"}),qt.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 Hs(["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],r=>{if(Dt.value&&(Dt.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 h=i(a);return h?n(h):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()}}),Hs("l",r=>{r.ctrlKey&&(r.preventDefault(),e.current?.focus({preventScroll:!1}))}),{searchRef:e}},Yl=e=>{es.value=e.target.value,Dt.value&&(Dt.value=null)};function $l(){const{searchRef:e}=Ul(),t=Pt.value;return m.createElement("div",{className:"flex-grow p-2 sticky top-0"},m.createElement("div",{className:"flex gap-4 pb-2 border-b-2 border-neutral-800 mb-2 items-center"},m.createElement("input",{ref:e,className:"bg-[#171616] px-1 py-2 w-full focus:outline focus:outline-primary",placeholder:"Search for component",type:"text",value:es,oninput:Yl})),t?.rootNode&&m.createElement(Yn,{node:t.rootNode}))}const Xl=e=>{const{mouse:t}=Ll(),n=Q(null),i=Q(0),s=Q(0),o=Ce(null),r=Fl(o),a=Ce(null),[l,c]=Array.isArray(e.children)?e.children:[];return Ki(()=>{a.current&&(s.value=a.current.clientWidth/2)},[a.current]),ge("mouseup",Te(()=>n.value=null,[])),ge("mousemove",Te(h=>{if(n.value==null||a.current==null)return;const d=Math.max(i.value+h.x-n.value.x,250);s.value=Math.min(d,a.current.clientWidth-250)},[])),ge("resize",Te(()=>{a.current!=null&&a.current.clientWidth-250<s.value&&(s.value=Math.max(a.current.clientWidth-250,250))},[])),m.createElement("div",{onmousemove:h=>{h.x},ref:a,className:"flex-grow grid gap-2 items-start w-full relative",style:{gridTemplateColumns:\`\${s}px 1fr\`}},m.createElement("div",{ref:o,className:"firstContainer w-full h-full"},l),r.width.value!=0&&m.createElement("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:h=>{h.preventDefault(),n.value={...t.value},i.value=s.value}},m.createElement("div",{className:"dividerLine w-[5px] bg-neutral-800 h-full"})),m.createElement("div",{className:"secondContainer h-full"},c))},ql=()=>m.createElement("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"},m.createElement("path",{d:"M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z"}),m.createElement("path",{d:"M21 11V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h6"})),Gl=()=>{Me.value=!Me.value,Pe.send({type:"set-inspect-enabled",value:Me.value})};function Kl(){const e=Pt.value,t=qt.value,n=te();return ct(()=>{const i=s=>{s===e&&n()};return U?.on("update",i),()=>U?.off("update",i)},[Pt]),ct(()=>{const i=s=>{if(s.data.type!=="select-node")return;if(!window.__devtoolsSelection){console.error("no selection ptr");return}const{app:o,node:r}=window.__devtoolsSelection;window.__devtoolsSelection=null,Pt.value=o,qt.value=r,Dt.value=r,Me.value=!1};return Pe.addEventListener(i),()=>Pe.removeEventListener(i)},[Pt]),m.createElement(m.Fragment,null,m.createElement("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.createElement("div",{className:"flex items-center gap-4"},m.createElement("select",{className:"px-2 py-1 bg-neutral-800 text-neutral-100 rounded border border-white border-opacity-10",value:e?.name??"",onchange:i=>Pt.value=Xt.peek().find(s=>s.name===i.currentTarget.value)??null},m.createElement("option",{value:"",disabled:!0},"Select App"),Xt.value.map(i=>m.createElement("option",{key:i.id,value:i.name},i.name))),m.createElement("button",{title:"Toggle Component Inspection",onclick:Gl,className:\`p-1 rounded \${Me.value?"bg-neutral-900":""}\`},m.createElement(ql,null)))),m.createElement(Xl,null,e&&m.createElement($l,null),t&&e&&m.createElement(Dl,{selectedApp:e,selectedNode:t,setSelectedNode:i=>qt.value=i,kiruGlobal:U})))}const Ai=ht({}),ue=ht([]);U?.stores?.subscribe(e=>{Ai.value=e,ue.value=ue.value.filter(t=>Object.values(Ai.value).includes(t))});const Ar=ht(""),Zl=vr(()=>Ar.value.toLowerCase().split(" ").filter(e=>e.length>0));function Ql(e){return Zl.value.every(t=>e.toLowerCase().includes(t))}function Jl(){const e=Object.entries(Ai.value);return e.length===0?m.createElement("div",{className:"flex flex-col items-center justify-center h-full text-neutral-400"},m.createElement(Er,null),m.createElement("h2",{className:"text-lg italic"},"No stores detected")):m.createElement("div",{className:"flex flex-col gap-2 items-start"},m.createElement(Pr,{value:Ar,className:"sticky top-0"}),m.createElement("div",{className:"flex flex-col gap-2 w-full"},e.filter(([t])=>Ql(t)).map(([t,n])=>m.createElement(tc,{key:t,name:t,store:n}))))}function tc({name:e,store:t}){const n=ue.value.includes(t),i=te(),{value:s}=Ir(t);Ki(()=>{const r=t.subscribe(()=>i());return()=>r()},[]);const o=Te(()=>{n?ue.value=ue.value.filter(r=>r!==t):ue.value=[...ue.value,t]},[n]);return m.createElement("div",{className:"flex flex-col"},m.createElement("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,m.createElement("div",{className:"flex gap-2"},m.createElement(ts,{fn:t,onclick:r=>r.stopPropagation()}),m.createElement(Kt,{className:"transition-all"+(n?" rotate-90":"")}))),n&&m.createElement("div",{className:"flex flex-col gap-2 p-2 border border-white border-opacity-10"},m.createElement(ye,{data:{value:s},mutable:!0,objectRefAcc:[],onChange:(r,a)=>{const l=structuredClone({value:s});Zi(l,r,a),t.setState(l.value)}}),m.createElement(ec,{store:t})))}function ec({store:e}){const t=Xt.value;return t.length===0?null:m.createElement(m.Fragment,null,t.map(n=>m.createElement(nc,{store:e,app:n})))}const Ws=Symbol.for("kiru.hmrAccept"),Ir=e=>{if(Ws in e)return e[Ws].provide().current;throw new Error("Unable to get store subscribers")};function nc({store:e,app:t}){const n=te(),{subscribers:i,nodeStateMap:s}=Ir(e),o=t.rootNode.child;if(ct(()=>{const a=l=>{l===t&&n()};return U?.on("update",a),()=>U?.off("update",a)},[]),!o)return null;const r=Di(o,a=>i.has(a));return m.createElement("div",{className:"flex flex-col gap-2 p-2 rounded-b border border-white border-opacity-10"},m.createElement("b",null,t.name),r&&m.createElement("ul",{className:"pl-8"},m.createElement(Ii,{node:r,nodeStateMap:s})))}function Ii({node:e,nodeStateMap:t}){const[n,i]=xe(!1),o=t.get(e.ref)?.slices??[];return m.createElement(m.Fragment,null,m.createElement("li",{className:"flex flex-col gap-2"},m.createElement("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")},m.createElement("button",{onclick:()=>i(!n),className:"flex gap-2 p-2 justify-between cursor-pointer"},m.createElement("span",null,"<"+_r(e.ref)+" />"),m.createElement("div",{className:"flex gap-2 items-center"},m.createElement(ts,{fn:e.ref.type,onclick:r=>r.stopPropagation()}),m.createElement(Kt,{className:"transition-all"+(n?" rotate-90":"")}))),n&&m.createElement("div",{className:"flex flex-col gap-2 p-2 bg-[#1a1a1a]"},o.length===0&&m.createElement("div",{className:"p-2 bg-black bg-opacity-30 text-sm"},m.createElement("h5",{className:"border-b border-white border-opacity-10"},"No slices")),o.map(r=>m.createElement("div",{className:"flex flex-col gap-2"},m.createElement("div",{className:"p-2 bg-black bg-opacity-30 text-sm"},m.createElement("h5",{className:"border-b border-white border-opacity-10"},"Slice:"),m.createElement("pre",{className:"text-neutral-400"},m.createElement(ye,{data:{value:r.value},mutable:!1,objectRefAcc:[],onChange:()=>{}}))),m.createElement("div",{className:"p-2 bg-black bg-opacity-30 text-sm"},m.createElement("h5",{className:"border-b border-white border-opacity-10"},"SliceFn:"),m.createElement("pre",{className:"text-neutral-400"},r.sliceFn?r.sliceFn.toString():"null")),r.eq&&m.createElement("div",{className:"p-2 bg-black bg-opacity-30 text-sm"},m.createElement("h5",{className:"border-b border-white border-opacity-10"},"eq:"),m.createElement("pre",{className:"text-neutral-400"},r.eq.toString())))))),e.child&&m.createElement("ul",{className:"pl-8 flex flex-col gap-2"},m.createElement(Ii,{node:e.child,nodeStateMap:t}))),e.sibling&&m.createElement(Ii,{node:e.sibling,nodeStateMap:t}))}/*!
1726
+ <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 Dc="production",ue=Dc==="development",xa=Symbol.for("kiru.signal"),Ac=Symbol.for("kiru.context"),Ci=Symbol.for("kiru.contextProvider"),$e=Symbol.for("kiru.fragment"),va=Symbol.for("kiru.error"),_a=Symbol.for("kiru.memo"),Ic=Symbol.for("kiru.hydrationBoundary"),Lc=50,ee=2,St=4,Pi=8,oe=16,wa=32,as=64,Ye=128,Rc=/^on:?/,Sa=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"]),Nc=new Set(["allowfullscreen","autofocus","autoplay","async","checked","compact","controls","contenteditable","declare","default","defer","disabled","download","hidden","inert","ismap","multiple","nohref","noresize","noshade","novalidate","nowrap","open","popover","readonly","required","sandbox","scoped","selected","sortable","spellcheck","translate","wrap"]),zc=new Map([["acceptCharset","accept-charset"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["httpEquiv","http-equiv"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Pe={current:null},ka={current:0},Xt={current:"window"in globalThis?"dom":"string"};var Ta;class Xe extends Error{constructor(t){const n=typeof t=="string"?t:t.message;super(n),this[Ta]=!0,typeof t!="string"&&(this.fatal=t?.fatal)}static isKiruError(t){return t instanceof Error&&t[va]===!0}}Ta=va;const ls={stack:new Array,current:function(){return this.stack[this.stack.length-1]}},Ve=new Map;function On(e,t=!1){return W.isSignal(e)?t?e.value:e.peek():e}const Fc=()=>{Ve.forEach(e=>e()),Ve.clear()},Cn={parentStack:[],childIdxStack:[],eventDeferrals:new Map,parent:function(){return this.parentStack[this.parentStack.length-1]},clear:function(){this.parentStack.length=0,this.childIdxStack.length=0},pop:function(){this.parentStack.pop(),this.childIdxStack.pop()},push:function(e){this.parentStack.push(e),this.childIdxStack.push(0)},currentChild:function(){return this.parentStack[this.parentStack.length-1].childNodes[this.childIdxStack[this.childIdxStack.length-1]]},nextChild:function(){return this.parentStack[this.parentStack.length-1].childNodes[this.childIdxStack[this.childIdxStack.length-1]++]},bumpChildIndex:function(){this.childIdxStack[this.childIdxStack.length-1]++},captureEvents:function(e){zo(e,!0),this.eventDeferrals.set(e,[])},resetEvents:function(e){this.eventDeferrals.delete(e)},releaseEvents:function(e){zo(e,!1);const t=this.eventDeferrals.get(e);for(;t?.length;)t.shift()()}},Hc=e=>{const t=e.target;!e.isTrusted||!t||Cn.eventDeferrals.get(t)?.push(()=>t.dispatchEvent(e))},zo=(e,t)=>{for(const n in e)if(n.startsWith("on")){const i=n.substring(2);e[t?"addEventListener":"removeEventListener"](i,Hc,{passive:!0})}};let Ys=!1,cs=!1;const Ma=e=>{e.preventDefault(),e.stopPropagation(),cs=!0};let ke=null;function Bc(){Ys=!0,ke=document.activeElement,ke&&ke!==document.body&&ke.addEventListener("blur",Ma)}function Vc(){cs&&(ke.removeEventListener("blur",Ma),ke.isConnected&&ke.focus(),cs=!1),Ys=!1}function us(e,t){if(typeof e=="function"){e(t);return}if(W.isSignal(e)){e.sneak(t),e.notify({filter:n=>typeof n=="function"});return}e.current=t}function Wc(e){const t=e.type;return t=="#text"?jc(e):Sa.has(t)?document.createElementNS("http://www.w3.org/2000/svg",t):document.createElement(t)}function jc(e){const{nodeValue:t}=e.props;if(!W.isSignal(t))return document.createTextNode(t);const n=t.peek()??"",i=document.createTextNode(n);return fs(e,i,t),i}function Uc(e,t,n){const i=hs.get(e)??{},s=i[t]=o=>{if(Ys){o.preventDefault(),o.stopPropagation();return}n(o)};return hs.set(e,i),s}const hs=new WeakMap;function Ea(e){const t=e.dom,n=e.prev?.props??{},i=e.props??{},s=new Set([...Object.keys(n),...Object.keys(i)]),o=Xt.current==="hydrate";s.forEach(r=>{const a=n[r],l=i[r];if(gi.internalProps.includes(r)&&r!=="innerHTML"){r==="ref"&&a!==l&&(a&&us(a,null),l&&us(l,t));return}if(gi.isEvent(r)){if(a!==l||Xt.current==="hydrate"){const c=r.replace(Rc,""),u=c==="focus"||c==="blur";r in n&&t.removeEventListener(c,u?hs.get(e)?.[c]:a),r in i&&t.addEventListener(c,u?Uc(e,c,l):l)}return}if(!(t instanceof Text)){if(a===l||o&&t.getAttribute(r)===l)return;if(W.isSignal(a)&&e.cleanups){const c=e.cleanups[r];c&&(c(),delete e.cleanups[r])}if(W.isSignal(l))return qc(e,t,r,l,a);ui(t,r,l,a);return}W.isSignal(l)||t.nodeValue!==l&&(t.nodeValue=l)})}function $c(e){return e.multiple?Array.from(e.selectedOptions).map(t=>t.value):e.value}function Oa(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 Yc={value:"input",checked:"change",open:"toggle",volume:"volumechange",playbackRate:"ratechange",currentTime:"timeupdate"},Xc=["progress","meter","number","range"];function qc(e,t,n,i,s){const o=e.cleanups??(e.cleanups={}),[r,a]=n.split(":");if(r!=="bind")return o[n]=i.subscribe((y,v)=>{ui(t,n,y,v)}),ui(t,n,i.peek(),On(s));const l=Yc[a];if(!l)return;const c=t instanceof HTMLSelectElement,u=c?y=>Oa(t,y):y=>t[a]=y,f=y=>{u(y)},p=y=>{i.sneak(y),i.notify({filter:v=>v!==f})};let g;if(a==="value"){const y=Xc.indexOf(t.type)!==-1;g=()=>{let v=t.value;c?v=$c(t):typeof i.peek()=="number"&&y&&(v=t.valueAsNumber),p(v)}}else g=y=>{const v=y.target[a];a==="currentTime"&&i.peek()===v||p(v)};t.addEventListener(l,g);const x=i.subscribe(f);return o[n]=()=>{t.removeEventListener(l,g),x()},ui(t,a,i.peek(),On(s))}function fs(e,t,n){(e.cleanups??(e.cleanups={})).nodeValue=n.subscribe((i,s)=>{i!==s&&(t.nodeValue=i)})}function Gc(e){const t=Cn.nextChild();if(!t)throw new Xe({message:"Hydration mismatch - no node found",vNode:e});let n=t.nodeName;if(Sa.has(n)||(n=n.toLowerCase()),e.type!==n)throw new Xe({message:\`Hydration mismatch - expected node of type \${e.type.toString()} but received \${n}\`,vNode:e});if(e.dom=t,e.type!=="#text"&&!(e.flags&oe)){Ea(e);return}W.isSignal(e.props.nodeValue)&&fs(e,t,e.props.nodeValue);let i=e,s=e.sibling;for(;s&&s.type==="#text";){const o=s;Cn.bumpChildIndex();const r=String(On(i.props.nodeValue)??""),a=i.dom.splitText(r.length);o.dom=a,W.isSignal(o.props.nodeValue)&&fs(o,a,o.props.nodeValue),i=s,s=s.sibling}}function Ca(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 Kc(e,t,n){const i=Nc.has(t);Ca(e,t,n,i)||e.setAttribute(t,i&&typeof n=="boolean"?"":String(n))}const Zc=["INPUT","TEXTAREA"],Qc=e=>Zc.indexOf(e.nodeName)>-1;function ui(e,t,n,i){if(n!==i)switch(t){case"style":return eu(e,n,i);case"className":return tu(e,n);case"innerHTML":return Jc(e,n);case"muted":e.muted=!!n;return;case"value":if(e.nodeName==="SELECT")return Oa(e,n);const s=n==null?"":String(n);if(Qc(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 Kc(e,wu(t),n)}}function Jc(e,t){if(t==null||typeof t=="boolean"){e.innerHTML="";return}e.innerHTML=String(t)}function tu(e,t){const n=On(t);if(!n)return e.removeAttribute("class");e.setAttribute("class",n)}function eu(e,t,n){if(Ca(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 nu(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 Xe({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=Pa(e,n);if(o){n.dom.insertBefore(s,o);return}n.dom.appendChild(s)}function Pa(e,t){let n=e;for(;n;){let i=n.sibling;for(;i;){if(!(i.flags&(St|oe))){const s=su(i);if(s?.isConnected)return s}i=i.sibling}if(n=n.parent,!n||n.flags&oe||n===t)return}}function su(e){let t=e;for(;t;){if(t.dom)return t.dom;if(t.flags&oe)return;t=t.child}}function ou(e){if(Xt.current==="hydrate")return Ii(e,mi);const t={node:e.dom?e:nu(e)};ds(e,t,(e.flags&St)>0),e.dom&&!(e.flags&oe)&&Da(e,t,!1),mi(e)}function ds(e,t,n){let i=e.child;for(;i;){if(i.flags&as){i.flags&St&&au(i,t),mi(i),i=i.sibling;continue}i.dom?(ds(i,{node:i},!1),i.flags&oe||Da(i,t,n)):ds(i,t,(i.flags&St)>0||n),mi(i),i=i.sibling}}function Da(e,t,n){(n||!e.dom.isConnected||e.flags&St)&&iu(e,t),(!e.prev||e.flags&ee)&&Ea(e),t.lastChild=e.dom}function ru(e){e===e.parent?.child&&(e.parent.child=e.sibling),Ii(e,t=>{const{hooks:n,subs:i,cleanups:s,dom:o,props:{ref:r}}=t;for(i?.forEach(a=>a()),s&&Object.values(s).forEach(a=>a());n?.length;)n.pop().cleanup?.();o&&(r&&us(r,null),o.isConnected&&!(t.flags&oe)&&o.remove(),delete t.dom)}),e.parent=null}function au(e,t){if(!e.child)return;const n=[];if(Aa(e.child,n),n.length===0)return;const{node:i,lastChild:s}=t;if(s)s.after(...n);else{const o=Pa(e,i),r=i.dom;if(o){const[a,...l]=n;r.insertBefore(a,o),a.after(...l)}else r.append(...n)}t.lastChild=n[n.length-1]}function Aa(e,t){let n=e;for(;n;)n.dom?t.push(n.dom):n.child&&Aa(n.child,t),n=n.sibling}function lu(e){return typeof e=="function"&&typeof e[_a]?.arePropsEqual=="function"}function m(e,t=null,...n){if(e===kt)return kt({children:n,...t});const i={type:e,flags:0,index:0,depth:0,props:{},parent:null,sibling:null,child:null,prev:null,deletions:null};if(lu(e)&&(i.flags|=wa,i.arePropsEqual=e[_a].arePropsEqual),t!==null){const{key:o,ref:r,...a}=t;Ou(o)&&(i.props.key=o.toString()),Cu(r)&&(i.props.ref=r),Object.assign(i.props,a)}const s=n.length===1?n[0]:n.length>1?n:null;return s!==null&&(i.props.children=s),i}function kt({children:e,key:t}){return m($e,t?{key:t}:null,e)}function Xs(e,t){return Array.isArray(t)?uu(e,t):cu(e,t)}function cu(e,t){const n=e.child;if(n===null)return Ra(e,t);const i=n.sibling,s=Ia(e,n,t);if(s!==null)return n&&n!==s&&!s.prev?ps(e,n):i&&ps(e,i),s;{const o=Ha(n),r=Na(o,e,0,t);if(r!==null){const a=r.prev;if(a!==null){const l=a.props.key;o.delete(l===void 0?a.index:l)}hi(r,0,0)}return o.forEach(a=>pi(e,a)),r}}function uu(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=Ia(e,s,t[a]);if(c===null){s===null&&(s=o);break}s&&!c.prev&&pi(e,s),r=hi(c,r,a),i===null?n=c:i.sibling=c,i=c,s=o}if(a===t.length)return ps(e,s),n;if(s===null){for(;a<t.length;a++){const c=Ra(e,t[a]);c!==null&&(r=hi(c,r,a),i===null?n=c:i.sibling=c,i=c)}return n}const l=Ha(s);for(;a<t.length;a++){const c=Na(l,e,a,t[a]);if(c!==null){const u=c.prev;if(u!==null){const f=u.props.key;l.delete(f===void 0?u.index:f)}r=hi(c,r,a),i===null?n=c:i.sibling=c,i=c}}return l.forEach(c=>pi(e,c)),n}function Ia(e,t,n){const i=t?.props.key;return za(n)?i!==void 0||t?.type==="#text"&&W.isSignal(t.props.nodeValue)?null:Fo(e,t,""+n):W.isSignal(n)?t&&t.props.nodeValue!==n?null:Fo(e,t,n):qs(n)?n.props.key!==i?null:hu(e,t,n):Array.isArray(n)?i!==void 0?null:La(e,t,n):null}function Fo(e,t,n){if(t===null||t.type!=="#text"){const s=m("#text",{nodeValue:n});return Nt(s,e),s}return t.props.nodeValue!==n&&(t.props.nodeValue=n,t.flags|=ee),t.sibling=null,t}function hu(e,t,n){let{type:i,props:s}=n;if(i===$e)return La(e,t,s.children||[],s);if(t?.type===i)return t.index=0,t.sibling=null,typeof i=="string"?Fa(t.props,s)&&(t.flags|=ee):t.flags|=ee,t.props=s,t.memoizedProps=n.memoizedProps,t;const o=m(i,s);return Nt(o,e),o}function La(e,t,n,i={}){if(t===null||t.type!==$e){const s=m($e,{children:n,...i});return Nt(s,e),s}return t.props={...t.props,...i,children:n},t.flags|=ee,t.sibling=null,t}function Ra(e,t){if(za(t)){const n=m("#text",{nodeValue:""+t});return Nt(n,e),n}if(W.isSignal(t)){const n=m("#text",{nodeValue:t});return Nt(n,e),n}if(qs(t)){const n=m(t.type,t.props);return Nt(n,e),n.flags|=St,n}if(Array.isArray(t)){const n=kt({children:t});return Nt(n,e),n}return null}function hi(e,t,n){e.index=n;const i=e.prev;if(i!==null){const s=i.index;return s<t?(e.flags|=St,t):s}else return e.flags|=St,t}function Na(e,t,n,i){if(W.isSignal(i)||typeof i=="string"&&i!==""||typeof i=="number"||typeof i=="bigint"){const o=e.get(n);if(o){if(o.props.nodeValue===i)return o;o.type==="#text"&&W.isSignal(o.props.nodeValue)&&o.cleanups?.nodeValue?.()}const r=m("#text",{nodeValue:i});return Nt(r,t),r.flags|=St,r.index=n,r}if(qs(i)){const{type:o,props:r}=i,a=r.key,l=e.get(a===void 0?n:a);if(l?.type===o)return typeof o=="string"?Fa(l.props,r)&&(l.flags|=ee):l.flags|=ee,l.props=r,l.sibling=null,l.index=n,l;const c=m(i.type,i.props);return Nt(c,t),c.flags|=St,c.index=n,c}if(Array.isArray(i)){const o=e.get(n);if(o)return o.flags|=ee,o.props.children=i,o;const r=kt({children:i});return Nt(r,t),r.flags|=St,r.index=n,r}return null}function za(e){return typeof e=="string"&&e!==""||typeof e=="number"||typeof e=="bigint"}function Fa(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 Nt(e,t){e.parent=t,e.depth=t.depth+1}function Ha(e){const t=new Map;for(;e;){const n=e.props.key;t.set(n===void 0?e.index:n,e),e=e.sibling}return t}function pi(e,t){e.deletions===null?e.deletions=[t]:e.deletions.push(t)}function ps(e,t){for(;t;)pi(e,t),t=t.sibling}let Yt=[],qe=!1,gs=[],ms=[],bs=!1,ys=!1,xs=!1,vs=0,Ba=[],_s=[],Va=-1;function fu(e){if(qe){gs.push(e);return}e()}function Wa(){qe&&(window.cancelAnimationFrame(Va),ja())}function Ho(e){e.flags|=Ye,Yt.push(e),qe=!0,Wa()}function Di(e){if(Xt.current==="hydrate")return fu(()=>ws(e));ws(e)}function du(){qe||(qe=!0,Va=window.requestAnimationFrame(ja))}function pu(){for(qe=!1;gs.length;)gs.shift()()}function ws(e){if(bs&&(ys=!0),Pe.current===e){xs=!0;return}if(!(e.flags&(Ye|Pi))){if(e.flags|=Ye,!Yt.length)return Yt.push(e),du();Yt.push(e)}}function gu(e){Ii(e,t=>t.flags|=Pi),ms.push(e)}const mu=(e,t)=>t.depth-e.depth;let He=null;function ja(){let e=1;for(Bc();Yt.length;){Yt.length>e&&Yt.sort(mu),He=Yt.shift(),e=Yt.length;const t=He.flags;if(!(t&Pi)&&t&Ye){let n=He;for(;n=bu(n););for(;ms.length;)ru(ms.pop());ou(He),He.flags&=~Ye}}if(Vc(),bs=!0,qi(Ba),bs=!1,ys)return vu(),qi(_s),ys=!1,vs++,Wa();vs=0,pu(),qi(_s)}function bu(e){let t=!0;try{const{props:i}=e;if(typeof e.type=="string")xu(e);else if(ku(e.type)){if(e?.type===Ci){const{props:{dependents:s,value:o},prev:r}=e;s.size&&r&&r.props.value!==o&&s.forEach(ws)}e.child=Xs(e,i.children)}else t=yu(e)}catch(i){if(Xe.isKiruError(i)){if(i.customNodeStack&&setTimeout(()=>{throw new Error(i.customNodeStack)}),i.fatal)throw i;console.error(i);return}setTimeout(()=>{throw i})}if(e.deletions!==null&&(e.deletions.forEach(gu),e.deletions=null),t&&e.child)return e.child;let n=e;for(;n;){if(n.immediateEffects&&(Ba.push(...n.immediateEffects),n.immediateEffects=void 0),n.effects&&(_s.push(...n.effects),n.effects=void 0),n===He)return;if(n.sibling)return n.sibling;n=n.parent,Xt.current==="hydrate"&&n?.dom&&Cn.pop()}}function yu(e){const{type:t,props:n,subs:i,prev:s,flags:o}=e;if(o&wa){if(e.memoizedProps=n,s?.memoizedProps&&e.arePropsEqual(s.memoizedProps,n)&&!e.hmrUpdated)return e.flags|=as,!1;e.flags&=~as}try{Pe.current=e;let r,a=0;do e.flags&=~Ye,xs=!1,ka.current=0,i&&(i.forEach(l=>l()),i.clear()),r=t(n);while(xs);return e.child=Xs(e,r),!0}finally{Pe.current=null}}function xu(e){const{props:t,type:n}=e;e.dom||(Xt.current==="hydrate"?Gc(e):e.dom=Wc(e)),n!=="#text"&&(e.child=Xs(e,t.children),e.child&&Xt.current==="hydrate"&&Cn.push(e.dom))}function vu(){if(vs>Lc)throw new Xe("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 qi(e){for(let t=0;t<e.length;t++)e[t]();e.length=0}var Bo;(function(e){e.Start="start",e.End="end"})(Bo||(Bo={}));const he=()=>{const e=Pe.current;return e||Ua("useRequestUpdate"),()=>Di(e)};function Ft(e,t,n){const i=Pe.current;i||Ua(e);const s=(a,l)=>{if(l?.immediate){(i.immediateEffects??(i.immediateEffects=[])).push(a);return}(i.effects??(i.effects=[])).push(a)},o=ka.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:()=>Di(i),queueEffect:s,vNode:i,index:o})}catch(a){throw a}}function Ua(e){throw new Xe(\`Hook "\${e}" must be used at the top level of a component or inside another composite hook.\`)}function Ai(e){e.cleanup&&(e.cleanup(),e.cleanup=void 0)}function tn(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]))}var $a;class W{constructor(t,n){this[$a]=!0,this.$id=Du(),this.$value=t,n&&(this.displayName=n),this.$subs=new Set}get value(){return this.onBeforeRead?.(),W.entangle(this),this.$value}set value(t){Object.is(this.$value,t)||(this.$prevValue=this.$value,this.$value=t,this.notify())}peek(){return this.onBeforeRead?.(),this.$value}sneak(t){this.$prevValue=this.$value,this.$value=t}toString(){return this.onBeforeRead?.(),W.entangle(this),\`\${this.$value}\`}subscribe(t){return this.$subs.add(t),()=>this.$subs.delete(t)}notify(t){this.$subs.forEach(n=>{if(!(t?.filter&&!t.filter(n)))return n(this.$value,this.$prevValue)})}static isSignal(t){return typeof t=="object"&&!!t&&xa 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=Pe.current,i=ls.current();if(i){(!n||n&&Tt())&&i.set(t.$id,t);return}if(!n||!Tt())return;const s=t.subscribe(()=>Di(n));(n.subs??(n.subs=new Set)).add(s)}static configure(t,n){t.onBeforeRead=n}static dispose(t){t.$isDisposed=!0,t.$subs.clear()}}$a=xa;const ht=(e,t)=>new W(e,t),J=(e,t)=>Ft("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 _u(e){const{id:t,subs:n,fn:i,deps:s=[],onDepChanged:o}=e;let r;Ve.delete(t);const a=!!Pe.current&&!Tt();a||(r=new Map,ls.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=()=>{Ve.size||queueMicrotask(Fc),Ve.set(t,o)};for(const[u,f]of r){if(n.has(u))continue;const p=f.subscribe(c);n.set(u,p)}ls.stack.pop()}return l}class Be extends W{constructor(t,n){super(void 0,n),this.$getter=t,this.$unsubs=new Map,this.$isDirty=!0,W.configure(this,()=>{this.$isDirty&&Be.run(this)})}get value(){return super.value}set value(t){}subscribe(t){return this.$isDirty&&Be.run(this),super.subscribe(t)}static dispose(t){Be.stop(t),W.dispose(t)}static stop(t){const{$id:n,$unsubs:i}=t;Ve.delete(n),i.forEach(s=>s()),i.clear(),t.$isDirty=!0}static run(t){const n=t,{$id:i,$getter:s,$unsubs:o}=n,r=_u({id:i,subs:o,fn:()=>s(n.$value),onDepChanged:()=>{n.$isDirty=!0,t.$subs.size&&(Be.run(n),!Object.is(n.$value,n.$prevValue)&&n.notify())}});n.sneak(r),n.$isDirty=!1}}const Ya=(e,t)=>new Be(e,t),gi={internalProps:["children","ref","key","innerHTML"],isEvent:e=>e.startsWith("on"),isProperty:e=>!gi.internalProps.includes(e)&&!gi.isEvent(e)};function wu(e){switch(e){case"className":return"class";case"htmlFor":return"for";case"tabIndex":case"formAction":case"formMethod":case"formEncType":case"contentEditable":case"spellCheck":case"allowFullScreen":case"autoPlay":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"noModule":case"noValidate":case"popoverTarget":case"popoverTargetAction":case"playsInline":case"readOnly":case"itemscope":case"rowSpan":case"crossOrigin":return e.toLowerCase();default:return e.indexOf("-")>-1?e:e.startsWith("aria")?"aria-"+e.substring(4).toLowerCase():zc.get(e)||e}}function Tt(){return Xt.current==="dom"||Xt.current==="hydrate"}function Su(e){return(e.flags&Pi)!==0}function qs(e){return typeof e=="object"&&e!==null&&"type"in e}function ku(e){return e===$e||e===Ci||e===Ic}function Tu(e){return e.type===$e}function Mu(e){return typeof e.type=="function"&&"displayName"in e.type&&e.type.displayName==="Kiru.lazy"}function Eu(e){return typeof e.type=="function"&&"displayName"in e.type&&e.type.displayName==="Kiru.memo"}function mi(e){const{props:{children:t,...n},memoizedProps:i,index:s}=e;e.prev={props:n,memoizedProps:i,index:s},e.flags&=-15}function Ii(e,t){t(e);let n=e.child;for(;n;)t(n),n.child&&Ii(n,t),n=n.sibling}function Ou(e){return typeof e=="string"||typeof e=="number"}function Cu(e){return typeof e=="function"||typeof e=="object"&&!!e&&"current"in e||W.isSignal(e)}const Pu="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz-";function Du(e=10,t=Pu){let n="";for(let i=0;i<e;i++)n+=t[Math.random()*t.length|0];return n}const Vo=Object.freeze(()=>{});let Au=0;function Iu(e,t,n){const i=m(t.nodeName.toLowerCase(),{});i.dom=t,i.flags|=oe;const s=Au++,o=\`App-\${s}\`,r={id:s,name:o,rootNode:i,render:a,unmount:l};function a(c){i.props.children=c,Ho(i)}function l(){i.props.children=null,Ho(i)}return a(e),r}function fe(e){return Tt()?Ft("useState",{state:void 0,dispatch:Vo},({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,Vo]}function Lu(e){const t={[Ac]:!0,Provider:({value:n,children:i})=>{const[s]=fe(()=>new Set);return m(Ci,{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 We(e,t){return Tt()?Ft("useCallback",{callback:e,deps:t},({hook:n,isHMR:i})=>(tn(t,n.deps)&&(n.deps=t,n.callback=e),n.callback)):e}function Ru(e,t=!0){return Ft("useContext",{context:e,warnIfNotFound:t},Nu)}const Nu=({hook:e,isInit:t,vNode:n})=>{if(t){let i=n.parent;for(;i;){if(i.type===Ci){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 ut(e,t){if(Tt())return Ft("useEffect",{deps:t},({hook:n,isInit:i,isHMR:s,queueEffect:o})=>{(i||tn(t,n.deps))&&(n.deps=t,Ai(n),o(()=>{const r=e();typeof r=="function"&&(n.cleanup=r)}))})}function Gs(e,t){if(Tt())return Ft("useLayoutEffect",{deps:t},({hook:n,isInit:i,isHMR:s,queueEffect:o})=>{(i||tn(t,n.deps))&&(n.deps=t,Ai(n),o(()=>{const r=e();typeof r=="function"&&(n.cleanup=r)},{immediate:!0}))})}function bi(e,t){return Tt()?Ft("useMemo",{deps:t,value:void 0},({hook:n,isInit:i,isHMR:s})=>((i||tn(t,n.deps))&&(n.deps=t,n.value=e()),n.value)):e()}function Ge(e){return Tt()?Ft("useRef",{ref:{current:e}},({hook:t,isInit:n,isHMR:i})=>t.ref):{current:e}}"window"in globalThis&&(window.__KIRU_LAZY_CACHE??(window.__KIRU_LAZY_CACHE=new Map));function Ss(...e){return e.filter(Boolean).join(" ")}function Ks(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 Xa(e){return e.type.displayName??(e.type.name||"Anonymous Function")}const zu=e=>e.__devtoolsFileLink??null;function Pn(e){return e.name==="kiru.devtools"}function qa(e){return Array.from(e.entries())}function Fu(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"}))}function re(e){return 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",...e},m("path",{d:"m9 18 6-6-6-6"}))}function Hu(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"}))}function Bu(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"}))}function Vu(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"}))}function Wu(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 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"}),m("path",{d:"M2 12h20"}))}function ju(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:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),m("path",{d:"M21 3v5h-5"}),m("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),m("path",{d:"M8 16H3v5"}))}function Uu(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:"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"}),m("path",{d:"M6 18h12"}),m("path",{d:"M6 14h12"}),m("rect",{width:"12",height:"12",x:"6",y:"10"}))}function Ga(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.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"}),m("path",{d:"M12 9v4"}),m("path",{d:"M12 17h.01"}))}function Ka({title:e,children:t,className:n,disabled:i,...s}){const[o,r]=fe(!0);ut(()=>{!o&&i&&r(!0)},[i]);const a=We(l=>{l.preventDefault(),l.stopImmediatePropagation(),r(c=>!c)},[]);return m("div",{className:"flex flex-col"},m("button",{onclick:a,disabled:i,className:\`\${i?"opacity-50 cursor-default":"cursor-pointer"}\`},m("span",{className:"flex items-center gap-2 font-medium"},m(re,{className:\`transition \${o?"":"rotate-90"}\`}),e)),o?null:m("div",{className:\`p-2 \${n||""}\`,...s},t))}const Zs={arrayChunkSize:10,objectKeysChunkSize:100};function Za(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"&&!Za(e[i],t[i]))return!1;return!0}function Qa(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"?Qa(e[i],t[i],n):n(e,i,e[i])}let Ja={...Zs};const Wo=localStorage.getItem("kiru.devtools.userSettings");if(Wo)try{const e=JSON.parse(Wo);Za(Zs,e)&&(Ja=e)}catch(e){console.error("kiru.devtools.userSettings error",e)}const tl=Lu({userSettings:null,saveUserSettings:()=>{}}),Li=()=>Ru(tl);function $u({children:e}){const[t,n]=fe(Ja),i=s=>{localStorage.setItem("kiru.devtools.userSettings",JSON.stringify(s)),n(s)};return m(tl.Provider,{value:{userSettings:t,saveUserSettings:i}},e)}function Yu(){const{userSettings:e,saveUserSettings:t}=Li();return m("div",{className:"rounded bg-neutral-400 bg-opacity-5 border border-white border-opacity-10 overflow-hidden"},m(Ae,{border:!1,data:e,onChange:(n,i)=>{const s={...e};Ks(s,n,i),Qa(s,Zs,(o,r,a)=>{o[r]=a<1?1:a}),t(s)},mutable:!0,objectRefAcc:[]}))}const Xu=Object.freeze(()=>{});function Ae({data:e,onChange:t,mutable:n,objectRefAcc:i,keys:s=[],className:o,border:r=!0}){const{userSettings:{objectKeysChunkSize:a}}=Li(),[l,c]=fe(0),u=bi(()=>Object.keys(e).slice(0,(l+1)*a),[l,a,e]),f=()=>{u.forEach(g=>{typeof e[g]=="object"&&i.splice(i.indexOf(e[g]),1)}),c(l+1)},p=u.length<Object.keys(e).length;return m(kt,null,m("div",{className:Ss("flex flex-col items-start w-full",r&&"border border-neutral-700",On(o))},u.map(g=>{const x=s.concat(g),y=x.join(".");return m("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"},m(Qs,{value:e[g],onChange:t,keys:x,path:y,label:g,mutable:n,objectRefAcc:i}))})),p&&m("button",{onclick:f,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 yi(e,t){Array.isArray(e)?(t(e),e.forEach(n=>yi(n,t))):typeof e=="object"&&e!==null&&(t(e),Object.values(e).forEach(n=>yi(n,t)))}function Qs({value:e,onChange:t,keys:n,path:i,mutable:s,objectRefAcc:o,label:r}){const{userSettings:{arrayChunkSize:a}}=Li(),[l,c]=fe(!0),u=r!==void 0&&m("label",{htmlFor:i,className:"text-xs truncate",title:i,children:r});if(e===null)return m(mt,null,u,m(Zt,null,"null"));if(e===void 0)return m(mt,null,u,m(Zt,null,"undefined"));const f=window.opener?window.opener.Node:Node;if(e instanceof f)return m(mt,null,u,m(Zt,null,"<",m("span",{style:{color:"#f0a05e"}},e.nodeName),"/>"));const p=window.opener?window.opener.Error:Error;if(e instanceof p)return m(mt,null,u,"cause"in e&&e.cause?m(Zt,null,e.message," (",String(e.cause),")"):m(Zt,null,e.message));const g=x=>t(n,x);switch(typeof e){case"string":return m(mt,null,u,m(Gi,{disabled:!s,id:i,type:"text",value:e,onchange:x=>g(x.target.value)}));case"number":return m(mt,null,u,m(Gi,{disabled:!s,id:i,type:"number",value:e,placeholder:"NaN",onchange:x=>g(Number(x.target.value))}));case"bigint":return m(mt,null,u,m(Gi,{disabled:!s,id:i,type:"number",value:e.toString(),onchange:x=>g(BigInt(x.target.value))}));case"boolean":return m(mt,null,u,m("input",{disabled:!s,id:i,type:"checkbox",checked:e,onchange:x=>g(x.target.checked),className:"accent-red-500"}));case"function":return m(mt,null,u,m(Zt,null,\`\u0192 \${e.name||"anonymous"}()\`));default:return Array.isArray(e)?m(mt,null,m("button",{className:"text-xs flex items-center gap-1 cursor-pointer w-full",title:i,onclick:()=>{yi(e,x=>o.splice(o.indexOf(x),1)),c(x=>!x)}},r,m(re,{width:10,height:10,className:\`transition \${l?"":"rotate-90"}\`})),l?m(Zt,null,"Array(",e.length,")"):e.length>a?m(qu,{array:e,objectRefAcc:o}):m("div",{className:"flex flex-col items-start gap-1 w-full"},e.map((x,y)=>m(Qs,{value:x,onChange:t,keys:[...n,y.toString()],path:i.concat(".",y.toString()),label:y.toString(),mutable:s,objectRefAcc:o})))):o.includes(e)?m(mt,null,u,m(Zt,null,"Object(circular reference)")):(o.push(e),m(mt,null,m("button",{className:"text-xs flex items-center gap-1 cursor-pointer w-full",title:i,onclick:()=>{yi(e,x=>o.splice(o.indexOf(x),1)),c(x=>!x)}},r,m(re,{width:10,height:10,className:\`transition \${l?"":"rotate-90"}\`})),l?null:m(Ae,{data:e,onChange:t,keys:n,mutable:s,objectRefAcc:o})))}}function mt({children:e}){return m("div",{className:"flex flex-col items-start gap-1 w-full"},e)}function Gi(e){return m("input",{className:"flex-grow text-xs px-2 py-1 text-neutral-300 w-full",...e})}function Zt({children:e}){return m("small",{className:"text-neutral-300"},m("i",null,e))}function qu({array:e,objectRefAcc:t}){const{userSettings:{arrayChunkSize:n}}=Li(),i=e.length,s=Math.ceil(i/n);return m("div",{className:"flex flex-col items-start gap-1 w-full"},Array.from({length:s}).map((o,r)=>m(Gu,{array:e,range:{start:r*n,end:(r+1)*n},objectRefAcc:t})))}function Gu({array:e,range:t,objectRefAcc:n}){const[i,s]=fe(!0);let o;return i?o=void 0:o=e.slice(t.start,t.end),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:()=>{n.splice(n.indexOf(e),1),s(r=>!r)}},"[",t.start,"..",(t.end<e.length?t.end:e.length)-1,"]",m(re,{width:10,height:10,className:\`transition \${i?"":"rotate-90"}\`})),o&&m("div",{className:"flex flex-col items-start gap-1 w-full"},o.map((r,a)=>m(Qs,{value:r,onChange:Xu,label:(t.start+a).toString(),keys:[a.toString()],path:a.toString(),mutable:!1,objectRefAcc:n}))))}const Ku="kiru-devtools";"window"in globalThis&&(window.__devtoolsSelection??=null);class Zu extends BroadcastChannel{send(t){super.postMessage(t)}removeEventListener(t){return super.removeEventListener("message",t)}addEventListener(t){return super.addEventListener("message",t)}}const Ke=new Zu(Ku);function Js({fn:e,onclick:t}){const n=bi(()=>zu(e),[e]);return n?m("a",{className:"flex items-center gap-1 text-[10px] opacity-50 hover:opacity-100 transition-opacity",href:n,onclick:i=>{i.preventDefault(),Ke.send({type:"open-editor",fileLink:n}),t?.(i)},title:"Open in editor"},"Open in editor",m(Bu,{width:"0.65rem",height:"0.65rem"})):null}function Qu({selectedApp:e,selectedNode:t,setSelectedNode:n,kiruGlobal:i}){const s=he();ut(()=>{const l=c=>{c===e&&(Su(t)?n(null):s())};return i?.on("update",l),()=>i?.off("update",l)},[]);const o=()=>{t&&Di(t)},r={...t.props};delete r.children;const a=eh(t);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"},"<"+Xa(t)+">",m(Js,{fn:t.type})),m("button",{onclick:o},m(ju,{className:"w-5 h-5"}))),m(Ka,{title:"props",disabled:Object.keys(r).length===0},m(Ae,{data:r,onChange:()=>{},mutable:!1,objectRefAcc:[]})),m(el,{node:a,selectedApp:e}))}function Ju(e){return e.name==="devtools:useHookDebugGroup"}function th(e){return ks in e}const ks=Symbol.for("devtools.hookGroup");function eh(e){const t={parent:null,name:"hooks",children:[],[ks]:!0};if(e.hooks?.length){let n=t;for(let i=0;i<e.hooks.length;i++){const s=e.hooks[i];if(Ju(s)){switch(s.action){case"start":const o={parent:n,name:s.displayName,children:[],[ks]:!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 el({node:e,selectedApp:t,depth:n=0}){if(th(e))return m(Ka,{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=>m(el,{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 m("div",null,m("i",{className:"text-neutral-300 text-sm"},i||"anonymous hook"),m("div",{className:"p-2"},m(Ae,{data:l,onChange:(u,f)=>{if(!t||!a?.set||!a?.get)return;const p=a.get();Ks(p,u,f),a.set(p)},mutable:!!a?.set,objectRefAcc:[]})))}const Ee=(e,t,n={})=>{ut(()=>{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])},nh=()=>{const e=J({x:0,y:0}),t=J({x:0,y:0}),n=J({x:0,y:0});return Ee("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}},Xn="window"in globalThis&&"ResizeObserver"in globalThis.window,ih=(e,t,n=void 0)=>Tt()?Xn?Ft("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(()=>{tn([e.current],s.deps)&&(s.deps=[e.current],s.resizeObserver?.disconnect?.(),e.current&&s.resizeObserver?.observe(e.current,n))}),{isSupported:Xn,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:()=>{Ai(s)}})):{isSupported:Xn,start:()=>{},stop:()=>{}}:{isSupported:Xn,start:()=>{},stop:()=>{}},qn="window"in globalThis&&"MutationObserver"in globalThis.window,sh=(e,t,n=void 0)=>Tt()?qn?Ft("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}):tn([e.current],s.deps)&&(s.deps=[e.current],s.mutationObserver?.disconnect?.(),e.current&&s.mutationObserver?.observe(e.current,n)),{isSupported:qn,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:()=>{Ai(s)}})):{isSupported:qn,start:()=>{},stop:()=>{}}:{isSupported:qn,start:()=>{},stop:()=>{}},oh=(e,t={windowScroll:!0,windowResize:!0})=>{const n=t?.windowScroll??!0,i=t?.windowResize??!0,s=t.immediate??!0,o=J(0),r=J(0),a=J(0),l=J(0),c=J(0),u=J(0),f=J(0),p=J(0),g=()=>{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,p.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,p.value=y.y};return ih(e,g),sh(e,g,{attributeFilter:["style","class"]}),Ee("scroll",()=>{n&&g()},{capture:!0,passive:!0}),Ee("resize",()=>{i&&g()},{passive:!0}),Gs(()=>{s&&g()},[]),{width:o,height:r,top:a,right:l,bottom:c,left:u,x:f,y:p,update:g}};function rh(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}const jo=(e,t,n={})=>{const{ref:i,eventName:s="keydown",passive:o=!1}=n,r=rh(e);return Ee(s,l=>{l.repeat&&!n.repeat||r(l)&&t(l)},{ref:i,passive:o})};function nl({value:e,className:t,...n}){return m("div",{className:Ss("w-full p-2 z-10","bg-[#1d1d1d] border border-white border-opacity-10 rounded",t?.toString()),...n},m("input",{className:Ss("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","bind:value":e}))}let $;"window"in globalThis&&window.opener&&($=window.opener.__kiru);const je=ht(!1);Ke.addEventListener(e=>{e.data.type==="set-inspect-enabled"&&(je.value=e.data.value)});const il=($?.apps??[]).filter(e=>!Pn(e)),ne=ht(il);ht(null);const Lt=ht(il[0]??null),ie=ht(null);$?.on("mount",e=>{Pn(e)||(ne.value=[...ne.peek(),e],Lt.peek()===null&&(Lt.value=e))});$?.on("unmount",e=>{ne.value=ne.peek().filter(t=>t!==e),Lt.peek()===e&&(Lt.value=ne.peek()[0]??null)});const Ts=ht(new Map),Rt=ht(null),to=ht("");function ah(e){return e.type.displayName??(e.type.name||"Anonymous Function")}function lh(e,t){const n=t.toLowerCase();return e.every(i=>n.includes(i))}function Ms(e){return typeof e.type=="function"&&!Tu(e)&&!Mu(e)&&!Eu(e)}function ch(e){let t=[e];for(;t.length;){const n=t.pop();if(Ms(n))return!0;n.child&&t.push(n.child),n.sibling&&t.push(n.sibling)}return!1}const uh=(e,t)=>{const n=[t.parent];for(;n.length;){const i=n.pop();if(e===i)return!0;i?.parent&&n.push(i.parent)}return!1};function Es(e,t){if(!e)return null;const n=t(e),i=Es(e.sibling,t),s=Es(e.child,t);return n?{ref:e,sibling:i??null,child:s??null}:i||s||null}function xi({node:e,traverseSiblings:t=!0}){const[n,i]=fe(!0),o=ie.value===e,r=bi(()=>crypto.randomUUID(),[]),a=bi(()=>Rt.value==null?null:uh(e,Rt.value),[Rt.value,e]);ut(()=>{a&&i(!1)},[a]),ut(()=>{if(!(!e||!Ms(e)))return Ts.peek().set(r,{vNode:e,setCollapsed:i}),()=>{Ts.peek().delete(r)}});const l=to.value;if(!e)return null;if(!Ms(e)||l.length>0&&!lh(l.toLowerCase().split(" "),e.type.name))return m(kt,null,e.child&&m(xi,{node:e.child}),t&&m(Uo,{node:e}));const c=e.child&&ch(e.child);return m(kt,null,m("div",{className:"pl-4 mb-1"},m("h2",{onclick:()=>{Rt.value=null,ie.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&&m(re,{className:\`cursor-pointer transition \${n?"":"rotate-90"}\`,onclick:u=>{u.preventDefault(),u.stopImmediatePropagation(),Rt.value=null,i(f=>!f)}}),m("div",{className:c?"":"ml-6"},m("span",{className:o?"":"text-neutral-400"},"<"),m("span",{className:o?"":"text-primary"},ah(e)),m("span",{className:o?"":"text-neutral-400"},">"))),!n&&e.child||a!=null&&a&&e.child?m(xi,{node:e.child}):null),t&&m(Uo,{node:e}))}function Uo({node:e}){if(!e)return null;let t=[],n=e.sibling;for(;n;)t.push(n),n=n.sibling;return m(kt,null,t.map(i=>m(xi,{node:i,traverseSiblings:!1})))}const hh=()=>{const e=Ge(null),t=r=>{if(!r)return null;const a=r.getAttribute("data-id");if(a!=null)return Ts.peek().get(a)},n=r=>{if(!r)return;const a=t(r);a!=null&&(r.scrollIntoView({behavior:"smooth"}),ie.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 jo(["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],r=>{if(Rt.value&&(Rt.value=null),document.activeElement&&document.activeElement instanceof HTMLInputElement&&document.activeElement!=e.current)return;r.preventDefault();const a=document.querySelector(".selected-vnode");if(a===null){r.key==="ArrowDown"?s():r.key==="ArrowUp"&&o();return}if(r.key==="ArrowRight"){const l=t(a);l&&l.setCollapsed(!1);return}else if(r.key==="ArrowLeft"){const l=t(a);l&&l.setCollapsed(!0);return}if(r.key==="ArrowDown"){const l=a?.nextElementSibling?.querySelector("h2[data-id]");if(l)return n(l);const c=a.parentElement?.nextElementSibling?.querySelector("h2[data-id]");if(c)return n(c);const u=i(a);return u?n(u):s()}else if(r.key==="ArrowUp"){const l=a.parentElement?.previousElementSibling;if(l?.matches("h2[data-id]"))return n(l);const c=l?.querySelectorAll("h2[data-id]");return c?.length!=null&&c?.length>=1?n(c?.item?.(c.length-1)):o()}}),jo("l",r=>{r.ctrlKey&&(r.preventDefault(),e.current?.focus({preventScroll:!1}))}),{searchRef:e}},fh=e=>{to.value=e.target.value,Rt.value&&(Rt.value=null)};function dh(){const{searchRef:e}=hh(),t=Lt.value;return 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",{ref:e,className:"bg-[#171616] px-1 py-2 w-full focus:outline focus:outline-primary",placeholder:"Search for component",type:"text",value:to,oninput:fh})),t?.rootNode&&m(xi,{node:t.rootNode}))}const ph=e=>{const{mouse:t}=nh(),n=J(null),i=J(0),s=J(0),o=Ge(null),r=oh(o),a=Ge(null),[l,c]=Array.isArray(e.children)?e.children:[];return Gs(()=>{a.current&&(s.value=a.current.clientWidth/2)},[a.current]),Ee("mouseup",We(()=>n.value=null,[])),Ee("mousemove",We(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)},[])),Ee("resize",We(()=>{a.current!=null&&a.current.clientWidth-250<s.value&&(s.value=Math.max(a.current.clientWidth-250,250))},[])),m("div",{onmousemove:u=>{u.x},ref:a,className:"flex-grow grid gap-2 items-start w-full relative",style:{gridTemplateColumns:\`\${s}px 1fr\`}},m("div",{ref:o,className:"firstContainer w-full h-full"},l),r.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:\`\${r.width}px\`},onmousedown:u=>{u.preventDefault(),n.value={...t.value},i.value=s.value}},m("div",{className:"dividerLine w-[5px] bg-neutral-800 h-full"})),m("div",{className:"secondContainer h-full"},c))},gh=()=>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",className:"lucide lucide-square-mouse-pointer"},m("path",{d:"M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z"}),m("path",{d:"M21 11V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h6"})),mh=()=>{je.value=!je.value,Ke.send({type:"set-inspect-enabled",value:je.value})};function bh(){const e=Lt.value,t=ie.value,n=he();return ut(()=>{const i=s=>{s===e&&n()};return $?.on("update",i),()=>$?.off("update",i)},[Lt]),ut(()=>{const i=s=>{if(s.data.type!=="select-node")return;if(!window.__devtoolsSelection){console.error("no selection ptr");return}const{app:o,node:r}=window.__devtoolsSelection;window.__devtoolsSelection=null,Lt.value=o,ie.value=r,Rt.value=r,je.value=!1};return Ke.addEventListener(i),()=>Ke.removeEventListener(i)},[Lt]),m(kt,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:i=>Lt.value=ne.peek().find(s=>s.name===i.currentTarget.value)??null},m("option",{value:"",disabled:!0},"Select App"),ne.value.map(i=>m("option",{key:i.id,value:i.name},i.name))),m("button",{title:"Toggle Component Inspection",onclick:mh,className:\`p-1 rounded \${je.value?"bg-neutral-900":""}\`},m(gh,null)))),m(ph,null,e&&m(dh,null),t&&e&&m(Qu,{selectedApp:e,selectedNode:t,setSelectedNode:i=>ie.value=i,kiruGlobal:$})))}const Os=ht({}),Se=ht([]);$?.stores?.subscribe(e=>{Os.value=e,Se.value=Se.value.filter(t=>Object.values(Os.value).includes(t))});const sl=ht(""),yh=Ya(()=>sl.value.toLowerCase().split(" ").filter(e=>e.length>0));function xh(e){return yh.value.every(t=>e.toLowerCase().includes(t))}function vh(){const e=Object.entries(Os.value);return e.length===0?m("div",{className:"flex flex-col items-center justify-center h-full text-neutral-400"},m(Ga,null),m("h2",{className:"text-lg italic"},"No stores detected")):m("div",{className:"flex flex-col gap-2 items-start"},m(nl,{value:sl,className:"sticky top-0"}),m("div",{className:"flex flex-col gap-2 w-full"},e.filter(([t])=>xh(t)).map(([t,n])=>m(_h,{key:t,name:t,store:n}))))}function _h({name:e,store:t}){const n=Se.value.includes(t),i=he(),{value:s}=ol(t);Gs(()=>{const r=t.subscribe(()=>i());return()=>r()},[]);const o=We(()=>{n?Se.value=Se.value.filter(r=>r!==t):Se.value=[...Se.value,t]},[n]);return m("div",{className:"flex flex-col"},m("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,m("div",{className:"flex gap-2"},m(Js,{fn:t,onclick:r=>r.stopPropagation()}),m(re,{className:"transition-all"+(n?" rotate-90":"")}))),n&&m("div",{className:"flex flex-col gap-2 p-2 border border-white border-opacity-10"},m(Ae,{data:{value:s},mutable:!0,objectRefAcc:[],onChange:(r,a)=>{const l=structuredClone({value:s});Ks(l,r,a),t.setState(l.value)}}),m(wh,{store:t})))}function wh({store:e}){const t=ne.value;return t.length===0?null:m(kt,null,t.map(n=>m(Sh,{store:e,app:n})))}const $o=Symbol.for("kiru.hmrAccept"),ol=e=>{if($o in e)return e[$o].provide().current;throw new Error("Unable to get store subscribers")};function Sh({store:e,app:t}){const n=he(),{subscribers:i,nodeStateMap:s}=ol(e),o=t.rootNode.child;if(ut(()=>{const a=l=>{l===t&&n()};return $?.on("update",a),()=>$?.off("update",a)},[]),!o)return null;const r=Es(o,a=>i.has(a));return m("div",{className:"flex flex-col gap-2 p-2 rounded-b border border-white border-opacity-10"},m("b",null,t.name),r&&m("ul",{className:"pl-8"},m(Cs,{node:r,nodeStateMap:s})))}function Cs({node:e,nodeStateMap:t}){const[n,i]=fe(!1),o=t.get(e.ref)?.slices??[];return m(kt,null,m("li",{className:"flex flex-col gap-2"},m("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")},m("button",{onclick:()=>i(!n),className:"flex gap-2 p-2 justify-between cursor-pointer"},m("span",null,"<"+Xa(e.ref)+" />"),m("div",{className:"flex gap-2 items-center"},m(Js,{fn:e.ref.type,onclick:r=>r.stopPropagation()}),m(re,{className:"transition-all"+(n?" rotate-90":"")}))),n&&m("div",{className:"flex flex-col gap-2 p-2 bg-[#1a1a1a]"},o.length===0&&m("div",{className:"p-2 bg-black bg-opacity-30 text-sm"},m("h5",{className:"border-b border-white border-opacity-10"},"No slices")),o.map(r=>m("div",{className:"flex flex-col gap-2"},m("div",{className:"p-2 bg-black bg-opacity-30 text-sm"},m("h5",{className:"border-b border-white border-opacity-10"},"Slice:"),m("pre",{className:"text-neutral-400"},m(Ae,{data:{value:r.value},mutable:!1,objectRefAcc:[],onChange:()=>{}}))),m("div",{className:"p-2 bg-black bg-opacity-30 text-sm"},m("h5",{className:"border-b border-white border-opacity-10"},"SliceFn:"),m("pre",{className:"text-neutral-400"},r.sliceFn?r.sliceFn.toString():"null")),r.eq&&m("div",{className:"p-2 bg-black bg-opacity-30 text-sm"},m("h5",{className:"border-b border-white border-opacity-10"},"eq:"),m("pre",{className:"text-neutral-400"},r.eq.toString())))))),e.child&&m("ul",{className:"pl-8 flex flex-col gap-2"},m(Cs,{node:e.child,nodeStateMap:t}))),e.sibling&&m(Cs,{node:e.sibling,nodeStateMap:t}))}/*!
1696
1727
  * @kurkle/color v0.3.4
1697
1728
  * https://github.com/kurkle/color#readme
1698
1729
  * (c) 2024 Jukka Kurkela
1699
1730
  * Released under the MIT License
1700
- */function fn(e){return e+.5|0}const Yt=(e,t,n)=>Math.max(Math.min(e,n),t);function Ke(e){return Yt(fn(e*2.55),0,255)}function Gt(e){return Yt(fn(e*255),0,255)}function Ht(e){return Yt(fn(e/2.55)/100,0,1)}function Vs(e){return Yt(fn(e*100),0,100)}const mt={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},Ni=[..."0123456789ABCDEF"],ic=e=>Ni[e&15],sc=e=>Ni[(e&240)>>4]+Ni[e&15],Tn=e=>(e&240)>>4===(e&15),oc=e=>Tn(e.r)&&Tn(e.g)&&Tn(e.b)&&Tn(e.a);function rc(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&mt[e[1]]*17,g:255&mt[e[2]]*17,b:255&mt[e[3]]*17,a:t===5?mt[e[4]]*17:255}:(t===7||t===9)&&(n={r:mt[e[1]]<<4|mt[e[2]],g:mt[e[3]]<<4|mt[e[4]],b:mt[e[5]]<<4|mt[e[6]],a:t===9?mt[e[7]]<<4|mt[e[8]]:255})),n}const ac=(e,t)=>e<255?t(e):"";function lc(e){var t=oc(e)?ic:sc;return e?"#"+t(e.r)+t(e.g)+t(e.b)+ac(e.a,t):void 0}const cc=/^(hsla?|hwb|hsv)\\(\\s*([-+.e\\d]+)(?:deg)?[\\s,]+([-+.e\\d]+)%[\\s,]+([-+.e\\d]+)%(?:[\\s,]+([-+.e\\d]+)(%)?)?\\s*\\)$/;function Nr(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 hc(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 uc(e,t,n){const i=Nr(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 dc(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 ns(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,h;return o!==r&&(h=o-r,c=a>.5?h/(2-o-r):h/(o+r),l=dc(n,i,s,h,o),l=l*60+.5),[l|0,c||0,a]}function is(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(Gt)}function ss(e,t,n){return is(Nr,e,t,n)}function fc(e,t,n){return is(uc,e,t,n)}function gc(e,t,n){return is(hc,e,t,n)}function Lr(e){return(e%360+360)%360}function pc(e){const t=cc.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?Ke(+t[5]):Gt(+t[5]));const s=Lr(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?i=fc(s,o,r):t[1]==="hsv"?i=gc(s,o,r):i=ss(s,o,r),{r:i[0],g:i[1],b:i[2],a:n}}function mc(e,t){var n=ns(e);n[0]=Lr(n[0]+t),n=ss(n),e.r=n[0],e.g=n[1],e.b=n[2]}function bc(e){if(!e)return;const t=ns(e),n=t[0],i=Vs(t[1]),s=Vs(t[2]);return e.a<255?\`hsla(\${n}, \${i}%, \${s}%, \${Ht(e.a)})\`:\`hsl(\${n}, \${i}%, \${s}%)\`}const js={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"},Us={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 xc(){const e={},t=Object.keys(Us),n=Object.keys(js);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,js[o]);o=parseInt(Us[r],16),e[a]=[o>>16&255,o>>8&255,o&255]}return e}let Mn;function yc(e){Mn||(Mn=xc(),Mn.transparent=[0,0,0,0]);const t=Mn[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const vc=/^rgba?\\(\\s*([-+.\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?(?:[\\s,/]+([-+.e\\d]+)(%)?)?\\s*\\)$/;function _c(e){const t=vc.exec(e);let n=255,i,s,o;if(t){if(t[7]!==i){const r=+t[7];n=t[8]?Ke(r):Yt(r*255,0,255)}return i=+t[1],s=+t[3],o=+t[5],i=255&(t[2]?Ke(i):Yt(i,0,255)),s=255&(t[4]?Ke(s):Yt(s,0,255)),o=255&(t[6]?Ke(o):Yt(o,0,255)),{r:i,g:s,b:o,a:n}}}function wc(e){return e&&(e.a<255?\`rgba(\${e.r}, \${e.g}, \${e.b}, \${Ht(e.a)})\`:\`rgb(\${e.r}, \${e.g}, \${e.b})\`)}const mi=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,ke=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function Ec(e,t,n){const i=ke(Ht(e.r)),s=ke(Ht(e.g)),o=ke(Ht(e.b));return{r:Gt(mi(i+n*(ke(Ht(t.r))-i))),g:Gt(mi(s+n*(ke(Ht(t.g))-s))),b:Gt(mi(o+n*(ke(Ht(t.b))-o))),a:e.a+n*(t.a-e.a)}}function On(e,t,n){if(e){let i=ns(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=ss(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function Rr(e,t){return e&&Object.assign(t||{},e)}function Ys(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=Gt(e[3]))):(t=Rr(e,{r:0,g:0,b:0,a:1}),t.a=Gt(t.a)),t}function Sc(e){return e.charAt(0)==="r"?_c(e):pc(e)}class ln{constructor(t){if(t instanceof ln)return t;const n=typeof t;let i;n==="object"?i=Ys(t):n==="string"&&(i=rc(t)||yc(t)||Sc(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Rr(this._rgb);return t&&(t.a=Ht(t.a)),t}set rgb(t){this._rgb=Ys(t)}rgbString(){return this._valid?wc(this._rgb):void 0}hexString(){return this._valid?lc(this._rgb):void 0}hslString(){return this._valid?bc(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=Ec(this._rgb,t._rgb,n)),this}clone(){return new ln(this.rgb)}alpha(t){return this._rgb.a=Gt(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=fn(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 On(this._rgb,2,t),this}darken(t){return On(this._rgb,2,-t),this}saturate(t){return On(this._rgb,1,t),this}desaturate(t){return On(this._rgb,1,-t),this}rotate(t){return mc(this._rgb,t),this}}/*!
1731
+ */function Nn(e){return e+.5|0}const Jt=(e,t,n)=>Math.max(Math.min(e,n),t);function yn(e){return Jt(Nn(e*2.55),0,255)}function se(e){return Jt(Nn(e*255),0,255)}function $t(e){return Jt(Nn(e/2.55)/100,0,1)}function Yo(e){return Jt(Nn(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},Ps=[..."0123456789ABCDEF"],kh=e=>Ps[e&15],Th=e=>Ps[(e&240)>>4]+Ps[e&15],Gn=e=>(e&240)>>4===(e&15),Mh=e=>Gn(e.r)&&Gn(e.g)&&Gn(e.b)&&Gn(e.a);function Eh(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 Oh=(e,t)=>e<255?t(e):"";function Ch(e){var t=Mh(e)?kh:Th;return e?"#"+t(e.r)+t(e.g)+t(e.b)+Oh(e.a,t):void 0}const Ph=/^(hsla?|hwb|hsv)\\(\\s*([-+.e\\d]+)(?:deg)?[\\s,]+([-+.e\\d]+)%[\\s,]+([-+.e\\d]+)%(?:[\\s,]+([-+.e\\d]+)(%)?)?\\s*\\)$/;function rl(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 Dh(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 Ah(e,t,n){const i=rl(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 Ih(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 eo(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=Ih(n,i,s,u,o),l=l*60+.5),[l|0,c||0,a]}function no(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(se)}function io(e,t,n){return no(rl,e,t,n)}function Lh(e,t,n){return no(Ah,e,t,n)}function Rh(e,t,n){return no(Dh,e,t,n)}function al(e){return(e%360+360)%360}function Nh(e){const t=Ph.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?yn(+t[5]):se(+t[5]));const s=al(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?i=Lh(s,o,r):t[1]==="hsv"?i=Rh(s,o,r):i=io(s,o,r),{r:i[0],g:i[1],b:i[2],a:n}}function zh(e,t){var n=eo(e);n[0]=al(n[0]+t),n=io(n),e.r=n[0],e.g=n[1],e.b=n[2]}function Fh(e){if(!e)return;const t=eo(e),n=t[0],i=Yo(t[1]),s=Yo(t[2]);return e.a<255?\`hsla(\${n}, \${i}%, \${s}%, \${$t(e.a)})\`:\`hsl(\${n}, \${i}%, \${s}%)\`}const Xo={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"},qo={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 Hh(){const e={},t=Object.keys(qo),n=Object.keys(Xo);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,Xo[o]);o=parseInt(qo[r],16),e[a]=[o>>16&255,o>>8&255,o&255]}return e}let Kn;function Bh(e){Kn||(Kn=Hh(),Kn.transparent=[0,0,0,0]);const t=Kn[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Vh=/^rgba?\\(\\s*([-+.\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?(?:[\\s,/]+([-+.e\\d]+)(%)?)?\\s*\\)$/;function Wh(e){const t=Vh.exec(e);let n=255,i,s,o;if(t){if(t[7]!==i){const r=+t[7];n=t[8]?yn(r):Jt(r*255,0,255)}return i=+t[1],s=+t[3],o=+t[5],i=255&(t[2]?yn(i):Jt(i,0,255)),s=255&(t[4]?yn(s):Jt(s,0,255)),o=255&(t[6]?yn(o):Jt(o,0,255)),{r:i,g:s,b:o,a:n}}}function jh(e){return e&&(e.a<255?\`rgba(\${e.r}, \${e.g}, \${e.b}, \${$t(e.a)})\`:\`rgb(\${e.r}, \${e.g}, \${e.b})\`)}const Ki=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Fe=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function Uh(e,t,n){const i=Fe($t(e.r)),s=Fe($t(e.g)),o=Fe($t(e.b));return{r:se(Ki(i+n*(Fe($t(t.r))-i))),g:se(Ki(s+n*(Fe($t(t.g))-s))),b:se(Ki(o+n*(Fe($t(t.b))-o))),a:e.a+n*(t.a-e.a)}}function Zn(e,t,n){if(e){let i=eo(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=io(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function ll(e,t){return e&&Object.assign(t||{},e)}function Go(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=se(e[3]))):(t=ll(e,{r:0,g:0,b:0,a:1}),t.a=se(t.a)),t}function $h(e){return e.charAt(0)==="r"?Wh(e):Nh(e)}class Dn{constructor(t){if(t instanceof Dn)return t;const n=typeof t;let i;n==="object"?i=Go(t):n==="string"&&(i=Eh(t)||Bh(t)||$h(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=ll(this._rgb);return t&&(t.a=$t(t.a)),t}set rgb(t){this._rgb=Go(t)}rgbString(){return this._valid?jh(this._rgb):void 0}hexString(){return this._valid?Ch(this._rgb):void 0}hslString(){return this._valid?Fh(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=Uh(this._rgb,t._rgb,n)),this}clone(){return new Dn(this.rgb)}alpha(t){return this._rgb.a=se(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Nn(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 Zn(this._rgb,2,t),this}darken(t){return Zn(this._rgb,2,-t),this}saturate(t){return Zn(this._rgb,1,t),this}desaturate(t){return Zn(this._rgb,1,-t),this}rotate(t){return zh(this._rgb,t),this}}/*!
1701
1732
  * Chart.js v4.5.0
1702
1733
  * https://www.chartjs.org
1703
1734
  * (c) 2025 Chart.js Contributors
1704
1735
  * Released under the MIT License
1705
- */function Rt(){}const kc=(()=>{let e=0;return()=>e++})();function W(e){return e==null}function Z(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 B(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function xt(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Tt(e,t){return xt(e)?e:t}function L(e,t){return typeof e>"u"?t:e}const Tc=(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 z(e,t,n,i){let s,o,r;if(Z(e))for(o=e.length,s=0;s<o;s++)t.call(n,e[s],s);else if(B(e))for(r=Object.keys(e),o=r.length,s=0;s<o;s++)t.call(n,e[r[s]],r[s])}function $n(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 Xn(e){if(Z(e))return e.map(Xn);if(B(e)){const t=Object.create(null),n=Object.keys(e),i=n.length;let s=0;for(;s<i;++s)t[n[s]]=Xn(e[n[s]]);return t}return e}function zr(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function Mc(e,t,n,i){if(!zr(e))return;const s=t[e],o=n[e];B(s)&&B(o)?cn(s,o,i):t[e]=Xn(o)}function cn(e,t,n){const i=Z(t)?t:[t],s=i.length;if(!B(e))return e;n=n||{};const o=n.merger||Mc;let r;for(let a=0;a<s;++a){if(r=i[a],!B(r))continue;const l=Object.keys(r);for(let c=0,h=l.length;c<h;++c)o(l[c],e,r,n)}return e}function tn(e,t){return cn(e,t,{merger:Oc})}function Oc(e,t,n){if(!zr(e))return;const i=t[e],s=n[e];B(i)&&B(s)?tn(i,s):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Xn(s))}const $s={"":e=>e,x:e=>e.x,y:e=>e.y};function Cc(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 Pc(e){const t=Cc(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function qn(e,t){return($s[t]||($s[t]=Pc(t)))(e)}function os(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Gn=e=>typeof e<"u",Zt=e=>typeof e=="function",Xs=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function Dc(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const J=Math.PI,At=2*J,Ac=At+J,Kn=Number.POSITIVE_INFINITY,Ic=J/180,_t=J/2,ae=J/4,qs=J*2/3,Fr=Math.log10,Qt=Math.sign;function pe(e,t,n){return Math.abs(e-t)<n}function Gs(e){const t=Math.round(e);e=pe(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(Fr(e))),i=e/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function Nc(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 Lc(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function hn(e){return!Lc(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function Rc(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function zc(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 de(e){return e*(J/180)}function Fc(e){return e*(180/J)}function Ks(e){if(!xt(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function Hc(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*J&&(o+=At),{angle:o,distance:s}}function Li(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Bc(e,t){return(e-t+Ac)%At-J}function Ut(e){return(e%At+At)%At}function Hr(e,t,n,i){const s=Ut(e),o=Ut(t),r=Ut(n),a=Ut(o-s),l=Ut(r-s),c=Ut(s-o),h=Ut(s-r);return s===o||s===r||i&&o===r||a>l&&c<h}function bt(e,t,n){return Math.max(t,Math.min(n,e))}function Wc(e){return bt(e,-32768,32767)}function Ze(e,t,n,i=1e-6){return e>=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function rs(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 fe=(e,t,n,i)=>rs(e,n,i?s=>{const o=e[s][t];return o<n||o===n&&e[s+1][t]===n}:s=>e[s][t]<n),Vc=(e,t,n)=>rs(e,n,i=>e[i][t]>=n);function jc(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 Br=["push","pop","shift","splice","unshift"];function Uc(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Br.forEach(n=>{const i="_onData"+os(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 Zs(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)&&(Br.forEach(o=>{delete e[o]}),delete e._chartjs)}function Yc(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const Wr=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function Vr(e,t){let n=[],i=!1;return function(...s){n=s,i||(i=!0,Wr.call(window,()=>{i=!1,e.apply(t,n)}))}}function $c(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const jr=e=>e==="start"?"left":e==="end"?"right":"center",ut=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,Xc=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function qc(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,h=r.axis,{min:d,max:g,minDefined:p,maxDefined:y}=r.getUserBounds();if(p){if(s=Math.min(fe(l,h,d).lo,n?i:fe(t,h,r.getPixelForValue(d)).lo),c){const x=l.slice(0,s+1).reverse().findIndex(v=>!W(v[a.axis]));s-=Math.max(0,x)}s=bt(s,0,i-1)}if(y){let x=Math.max(fe(l,r.axis,g,!0).hi+1,n?0:fe(t,h,r.getPixelForValue(g),!0).hi+1);if(c){const v=l.slice(x-1).findIndex(w=>!W(w[a.axis]));x+=Math.max(0,v)}o=bt(x,s,i)-s}else o=i-s}return{start:s,count:o}}function Gc(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 Cn=e=>e===0||e===1,Qs=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*At/n)),Js=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*At/n)+1,en={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*_t)+1,easeOutSine:e=>Math.sin(e*_t),easeInOutSine:e=>-.5*(Math.cos(J*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=>Cn(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=>Cn(e)?e:Qs(e,.075,.3),easeOutElastic:e=>Cn(e)?e:Js(e,.075,.3),easeInOutElastic(e){return Cn(e)?e:e<.5?.5*Qs(e*2,.1125,.45):.5+.5*Js(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-en.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?en.easeInBounce(e*2)*.5:en.easeOutBounce(e*2-1)*.5+.5};function as(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function to(e){return as(e)?e:new ln(e)}function bi(e){return as(e)?e:new ln(e).saturate(.5).darken(.1).hexString()}const Kc=["x","y","borderWidth","radius","tension"],Zc=["color","borderColor","backgroundColor"];function Qc(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:Zc},numbers:{type:"number",properties:Kc}}),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 Jc(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const eo=new Map;function th(e,t){t=t||{};const n=e+JSON.stringify(t);let i=eo.get(n);return i||(i=new Intl.NumberFormat(e,t),eo.set(n,i)),i}function Ur(e,t,n){return th(t,n).format(e)}const eh={values(e){return Z(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=nh(e,n)}const r=Fr(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),Ur(e,i,l)}};function nh(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 Yr={formatters:eh};function ih(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:Yr.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),Ri=Object.create(null);function nn(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 xi(e,t,n){return typeof t=="string"?cn(nn(e,t),n):cn(nn(e,""),t)}class sh{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)=>bi(s.backgroundColor),this.hoverBorderColor=(i,s)=>bi(s.borderColor),this.hoverColor=(i,s)=>bi(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 xi(this,t,n)}get(t){return nn(this,t)}describe(t,n){return xi(Ri,t,n)}override(t,n){return xi(be,t,n)}route(t,n,i,s){const o=nn(this,t),r=nn(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 B(l)?Object.assign({},c,l):L(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var Y=new sh({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Qc,Jc,ih]);function oh(e){return!e||W(e.size)||W(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function no(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 le(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 io(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function zi(e,t,n,i){$r(e,t,n,i,null)}function $r(e,t,n,i,s){let o,r,a,l,c,h,d,g;const p=t.pointStyle,y=t.rotation,x=t.radius;let v=(y||0)*Ic;if(p&&typeof p=="object"&&(o=p.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(n,i),e.rotate(v),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,At):e.arc(n,i,x,0,At),e.closePath();break;case"triangle":h=s?s/2:x,e.moveTo(n+Math.sin(v)*h,i-Math.cos(v)*x),v+=qs,e.lineTo(n+Math.sin(v)*h,i-Math.cos(v)*x),v+=qs,e.lineTo(n+Math.sin(v)*h,i-Math.cos(v)*x),e.closePath();break;case"rectRounded":c=x*.516,l=x-c,r=Math.cos(v+ae)*l,d=Math.cos(v+ae)*(s?s/2-c:l),a=Math.sin(v+ae)*l,g=Math.sin(v+ae)*(s?s/2-c:l),e.arc(n-d,i-a,c,v-J,v-_t),e.arc(n+g,i-r,c,v-_t,v),e.arc(n+d,i+a,c,v,v+_t),e.arc(n-g,i+r,c,v+_t,v+J),e.closePath();break;case"rect":if(!y){l=Math.SQRT1_2*x,h=s?s/2:l,e.rect(n-h,i-l,2*h,2*l);break}v+=ae;case"rectRot":d=Math.cos(v)*(s?s/2:x),r=Math.cos(v)*x,a=Math.sin(v)*x,g=Math.sin(v)*(s?s/2:x),e.moveTo(n-d,i-a),e.lineTo(n+g,i-r),e.lineTo(n+d,i+a),e.lineTo(n-g,i+r),e.closePath();break;case"crossRot":v+=ae;case"cross":d=Math.cos(v)*(s?s/2:x),r=Math.cos(v)*x,a=Math.sin(v)*x,g=Math.sin(v)*(s?s/2:x),e.moveTo(n-d,i-a),e.lineTo(n+d,i+a),e.moveTo(n+g,i-r),e.lineTo(n-g,i+r);break;case"star":d=Math.cos(v)*(s?s/2:x),r=Math.cos(v)*x,a=Math.sin(v)*x,g=Math.sin(v)*(s?s/2:x),e.moveTo(n-d,i-a),e.lineTo(n+d,i+a),e.moveTo(n+g,i-r),e.lineTo(n-g,i+r),v+=ae,d=Math.cos(v)*(s?s/2:x),r=Math.cos(v)*x,a=Math.sin(v)*x,g=Math.sin(v)*(s?s/2:x),e.moveTo(n-d,i-a),e.lineTo(n+d,i+a),e.moveTo(n+g,i-r),e.lineTo(n-g,i+r);break;case"line":r=s?s/2:Math.cos(v)*x,a=Math.sin(v)*x,e.moveTo(n-r,i-a),e.lineTo(n+r,i+a);break;case"dash":e.moveTo(n,i),e.lineTo(n+Math.cos(v)*(s?s/2:x),i+Math.sin(v)*x);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function De(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 ls(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function cs(e){e.restore()}function rh(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 ah(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 lh(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),W(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 ch(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,h=s.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=s.decorationWidth||2,e.moveTo(r,h),e.lineTo(a,h),e.stroke()}}function hh(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Zn(e,t,n,i,s,o={}){const r=Z(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(e.save(),e.font=s.string,lh(e,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&hh(e,o.backdrop),a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),W(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,n,i,o.maxWidth)),e.fillText(c,n,i,o.maxWidth),ch(e,n,i,c,o),i+=Number(s.lineHeight);e.restore()}function Fi(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*J,J,!0),e.lineTo(n,i+o-r.bottomLeft),e.arc(n+r.bottomLeft,i+o-r.bottomLeft,r.bottomLeft,J,_t,!0),e.lineTo(n+s-r.bottomRight,i+o),e.arc(n+s-r.bottomRight,i+o-r.bottomRight,r.bottomRight,_t,0,!0),e.lineTo(n+s,i+r.topRight),e.arc(n+s-r.topRight,i+r.topRight,r.topRight,0,-_t,!0),e.lineTo(n+r.topLeft,i)}const uh=/^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/,dh=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function fh(e,t){const n=(""+e).match(uh);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 gh=e=>+e||0;function Xr(e,t){const n={},i=B(t),s=i?Object.keys(t):t,o=B(e)?i?r=>L(e[r],e[t[r]]):r=>e[r]:()=>e;for(const r of s)n[r]=gh(o(r));return n}function ph(e){return Xr(e,{top:"y",right:"x",bottom:"y",left:"x"})}function sn(e){return Xr(e,["topLeft","topRight","bottomLeft","bottomRight"])}function wt(e){const t=ph(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function lt(e,t){e=e||{},t=t||Y.font;let n=L(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=L(e.style,t.style);i&&!(""+i).match(dh)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:L(e.family,t.family),lineHeight:fh(L(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:L(e.weight,t.weight),string:""};return s.string=oh(s),s}function Pn(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 mh(e,t,n){const{min:i,max:s}=e,o=Tc(t,(s-i)/2),r=(a,l)=>n&&a===0?0:a+l;return{min:r(i,-Math.abs(o)),max:r(s,o)}}function ve(e,t){return Object.assign(Object.create(e),t)}function hs(e,t=[""],n,i,s=()=>e[0]){const o=n||e;typeof i>"u"&&(i=Zr("_fallback",e));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:i,_getTarget:s,override:a=>hs([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 Gr(a,l,()=>Sh(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return oo(a).includes(l)},ownKeys(a){return oo(a)},set(a,l,c){const h=a._storage||(a._storage=s());return a[l]=h[l]=c,delete a._keys,!0}})}function Ae(e,t,n,i){const s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:qr(e,i),setContext:o=>Ae(e,o,n,i),override:o=>Ae(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 Gr(o,r,()=>xh(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 qr(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:Zt(n)?n:()=>n,isIndexable:Zt(i)?i:()=>i}}const bh=(e,t)=>e?e+os(t):t,us=(e,t)=>B(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Gr(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const i=n();return e[t]=i,i}function xh(e,t,n){const{_proxy:i,_context:s,_subProxy:o,_descriptors:r}=e;let a=i[t];return Zt(a)&&r.isScriptable(t)&&(a=yh(t,a,e,n)),Z(a)&&a.length&&(a=vh(t,a,e,r.isIndexable)),us(t,a)&&(a=Ae(a,s,o&&o[t],r)),a}function yh(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),us(e,l)&&(l=ds(s._scopes,s,e,l)),l}function vh(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(B(t[0])){const l=t,c=s._scopes.filter(h=>h!==l);t=[];for(const h of l){const d=ds(c,s,e,h);t.push(Ae(d,o,r&&r[e],a))}}return t}function Kr(e,t,n){return Zt(e)?e(t,n):e}const _h=(e,t)=>e===!0?t:typeof e=="string"?qn(t,e):void 0;function wh(e,t,n,i,s){for(const o of t){const r=_h(n,o);if(r){e.add(r);const a=Kr(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 ds(e,t,n,i){const s=t._rootScopes,o=Kr(t._fallback,n,i),r=[...e,...s],a=new Set;a.add(i);let l=so(a,r,n,o||n,i);return l===null||typeof o<"u"&&o!==n&&(l=so(a,r,o,l,i),l===null)?!1:hs(Array.from(a),[""],s,o,()=>Eh(t,n,i))}function so(e,t,n,i,s){for(;n;)n=wh(e,t,n,i,s);return n}function Eh(e,t,n){const i=e._getTarget();t in i||(i[t]={});const s=i[t];return Z(s)&&B(n)?n:s||{}}function Sh(e,t,n,i){let s;for(const o of t)if(s=Zr(bh(o,e),n),typeof s<"u")return us(e,s)?ds(n,i,e,s):s}function Zr(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function oo(e){let t=e._keys;return t||(t=e._keys=kh(e._scopes)),t}function kh(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 Th=Number.EPSILON||1e-14,Ie=(e,t)=>t<e.length&&!e[t].skip&&e[t],Qr=e=>e==="x"?"y":"x";function Mh(e,t,n,i){const s=e.skip?t:e,o=t,r=n.skip?t:n,a=Li(o,s),l=Li(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=i*c,g=i*h;return{previous:{x:o.x-d*(r.x-s.x),y:o.y-d*(r.y-s.y)},next:{x:o.x+g*(r.x-s.x),y:o.y+g*(r.y-s.y)}}}function Oh(e,t,n){const i=e.length;let s,o,r,a,l,c=Ie(e,0);for(let h=0;h<i-1;++h)if(l=c,c=Ie(e,h+1),!(!l||!c)){if(pe(t[h],0,Th)){n[h]=n[h+1]=0;continue}s=n[h]/t[h],o=n[h+1]/t[h],a=Math.pow(s,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),n[h]=s*r*t[h],n[h+1]=o*r*t[h])}}function Ch(e,t,n="x"){const i=Qr(n),s=e.length;let o,r,a,l=Ie(e,0);for(let c=0;c<s;++c){if(r=a,a=l,l=Ie(e,c+1),!a)continue;const h=a[n],d=a[i];r&&(o=(h-r[n])/3,a[\`cp1\${n}\`]=h-o,a[\`cp1\${i}\`]=d-o*t[c]),l&&(o=(l[n]-h)/3,a[\`cp2\${n}\`]=h+o,a[\`cp2\${i}\`]=d+o*t[c])}}function Ph(e,t="x"){const n=Qr(t),i=e.length,s=Array(i).fill(0),o=Array(i);let r,a,l,c=Ie(e,0);for(r=0;r<i;++r)if(a=l,l=c,c=Ie(e,r+1),!!l){if(c){const h=c[t]-l[t];s[r]=h!==0?(c[n]-l[n])/h:0}o[r]=a?c?Qt(s[r-1])!==Qt(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}Oh(e,s,o),Ch(e,o,t)}function Dn(e,t,n){return Math.max(Math.min(e,n),t)}function Dh(e,t){let n,i,s,o,r,a=De(e[0],t);for(n=0,i=e.length;n<i;++n)r=o,o=a,a=n<i-1&&De(e[n+1],t),o&&(s=e[n],r&&(s.cp1x=Dn(s.cp1x,t.left,t.right),s.cp1y=Dn(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=Dn(s.cp2x,t.left,t.right),s.cp2y=Dn(s.cp2y,t.top,t.bottom)))}function Ah(e,t,n,i,s){let o,r,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Ph(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=Mh(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&&Dh(e,n)}function fs(){return typeof window<"u"&&typeof document<"u"}function gs(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Qn(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 ni=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function Ih(e,t){return ni(e).getPropertyValue(t)}const Nh=["top","right","bottom","left"];function me(e,t,n){const i={};n=n?"-"+n:"";for(let s=0;s<4;s++){const o=Nh[s];i[o]=parseFloat(e[t+"-"+o+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Lh=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function Rh(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:s,offsetY:o}=i;let r=!1,a,l;if(Lh(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 Ct(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,s=ni(n),o=s.boxSizing==="border-box",r=me(s,"padding"),a=me(s,"border","width"),{x:l,y:c,box:h}=Rh(e,n),d=r.left+(h&&a.left),g=r.top+(h&&a.top);let{width:p,height:y}=t;return o&&(p-=r.width+a.width,y-=r.height+a.height),{x:Math.round((l-d)/p*n.width/i),y:Math.round((c-g)/y*n.height/i)}}function zh(e,t,n){let i,s;if(t===void 0||n===void 0){const o=e&&gs(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const r=o.getBoundingClientRect(),a=ni(o),l=me(a,"border","width"),c=me(a,"padding");t=r.width-c.width-l.width,n=r.height-c.height-l.height,i=Qn(a.maxWidth,o,"clientWidth"),s=Qn(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:i||Kn,maxHeight:s||Kn}}const An=e=>Math.round(e*10)/10;function Fh(e,t,n,i){const s=ni(e),o=me(s,"margin"),r=Qn(s.maxWidth,e,"clientWidth")||Kn,a=Qn(s.maxHeight,e,"clientHeight")||Kn,l=zh(e,t,n);let{width:c,height:h}=l;if(s.boxSizing==="content-box"){const g=me(s,"border","width"),p=me(s,"padding");c-=p.width+g.width,h-=p.height+g.height}return c=Math.max(0,c-o.width),h=Math.max(0,i?c/i:h-o.height),c=An(Math.min(c,r,l.maxWidth)),h=An(Math.min(h,a,l.maxHeight)),c&&!h&&(h=An(c/2)),(t!==void 0||n!==void 0)&&i&&l.height&&h>l.height&&(h=l.height,c=An(Math.floor(h*i))),{width:c,height:h}}function ro(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 Hh=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};fs()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function ao(e,t){const n=Ih(e,t),i=n&&n.match(/^(\\d+)(\\.\\d+)?px$/);return i?+i[1]:void 0}function he(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function Bh(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 Wh(e,t,n,i){const s={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},r=he(e,s,n),a=he(s,o,n),l=he(o,t,n),c=he(r,a,n),h=he(a,l,n);return he(c,h,n)}const Vh=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}}},jh=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Oe(e,t,n){return e?Vh(t,n):jh()}function Jr(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 ta(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function ea(e){return e==="angle"?{between:Hr,compare:Bc,normalize:Ut}:{between:Ze,compare:(t,n)=>t-n,normalize:t=>t}}function lo({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 Uh(e,t,n){const{property:i,start:s,end:o}=n,{between:r,normalize:a}=ea(i),l=t.length;let{start:c,end:h,loop:d}=e,g,p;if(d){for(c+=l,h+=l,g=0,p=l;g<p&&r(a(t[c%l][i]),s,o);++g)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:d,style:e.style}}function Yh(e,t,n){if(!n)return[e];const{property:i,start:s,end:o}=n,r=t.length,{compare:a,between:l,normalize:c}=ea(i),{start:h,end:d,loop:g,style:p}=Uh(e,t,n),y=[];let x=!1,v=null,w,S,O;const C=()=>l(s,O,w)&&a(s,O)!==0,k=()=>a(o,w)===0||l(o,O,w),D=()=>x||C(),P=()=>!x||k();for(let M=h,A=h;M<=d;++M)S=t[M%r],!S.skip&&(w=c(S[i]),w!==O&&(x=l(w,s,o),v===null&&D()&&(v=a(w,s)===0?M:A),v!==null&&P()&&(y.push(lo({start:v,end:M,loop:g,count:r,style:p})),v=null),A=M,O=w));return v!==null&&y.push(lo({start:v,end:d,loop:g,count:r,style:p})),y}function $h(e,t){const n=[],i=e.segments;for(let s=0;s<i.length;s++){const o=Yh(i[s],e.points,t);o.length&&n.push(...o)}return n}function Xh(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 qh(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 Gh(e,t){const n=e.points,i=e.options.spanGaps,s=n.length;if(!s)return[];const o=!!e._loop,{start:r,end:a}=Xh(n,s,o,i);if(i===!0)return co(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 co(e,qh(n,r,l,c),n,t)}function co(e,t,n,i){return!i||!i.setContext||!n?t:Kh(e,t,n,i)}function Kh(e,t,n,i){const s=e._chart.getContext(),o=ho(e.options),{_datasetIndex:r,options:{spanGaps:a}}=e,l=n.length,c=[];let h=o,d=t[0].start,g=d;function p(y,x,v,w){const S=a?-1:1;if(y!==x){for(y+=l;n[y%l].skip;)y-=S;for(;n[x%l].skip;)x+=S;y%l!==x%l&&(c.push({start:y%l,end:x%l,loop:v,style:w}),h=w,d=x%l)}}for(const y of t){d=a?d:y.start;let x=n[d%l],v;for(g=d+1;g<=y.end;g++){const w=n[g%l];v=ho(i.setContext(ve(s,{type:"segment",p0:x,p1:w,p0DataIndex:(g-1)%l,p1DataIndex:g%l,datasetIndex:r}))),Zh(v,h)&&p(d,g-1,y.loop,h),x=w,h=v}d<g-1&&p(d,g-1,y.loop,h)}return c}function ho(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function Zh(e,t){if(!t)return!1;const n=[],i=function(s,o){return as(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(e,i)!==JSON.stringify(t,i)}function In(e,t,n){return e.options.clip?e[n]:t[n]}function Qh(e,t){const{xScale:n,yScale:i}=e;return n&&i?{left:In(n,t,"left"),right:In(n,t,"right"),top:In(i,t,"top"),bottom:In(i,t,"bottom")}:t}function Jh(e,t){const n=t._clip;if(n.disabled)return!1;const i=Qh(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)}}/*!
1736
+ */function Wt(){}const Yh=(()=>{let e=0;return()=>e++})();function V(e){return e==null}function Q(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 B(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function xt(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Pt(e,t){return xt(e)?e:t}function R(e,t){return typeof e>"u"?t:e}const Xh=(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 z(e,t,n,i){let s,o,r;if(Q(e))for(o=e.length,s=0;s<o;s++)t.call(n,e[s],s);else if(B(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 _i(e){if(Q(e))return e.map(_i);if(B(e)){const t=Object.create(null),n=Object.keys(e),i=n.length;let s=0;for(;s<i;++s)t[n[s]]=_i(e[n[s]]);return t}return e}function cl(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function qh(e,t,n,i){if(!cl(e))return;const s=t[e],o=n[e];B(s)&&B(o)?An(s,o,i):t[e]=_i(o)}function An(e,t,n){const i=Q(t)?t:[t],s=i.length;if(!B(e))return e;n=n||{};const o=n.merger||qh;let r;for(let a=0;a<s;++a){if(r=i[a],!B(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 wn(e,t){return An(e,t,{merger:Gh})}function Gh(e,t,n){if(!cl(e))return;const i=t[e],s=n[e];B(i)&&B(s)?wn(i,s):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=_i(s))}const Ko={"":e=>e,x:e=>e.x,y:e=>e.y};function Kh(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 Zh(e){const t=Kh(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function wi(e,t){return(Ko[t]||(Ko[t]=Zh(t)))(e)}function so(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Si=e=>typeof e<"u",ae=e=>typeof e=="function",Zo=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function Qh(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const tt=Math.PI,zt=2*tt,Jh=zt+tt,ki=Number.POSITIVE_INFINITY,tf=tt/180,wt=tt/2,xe=tt/4,Qo=tt*2/3,ul=Math.log10,le=Math.sign;function Oe(e,t,n){return Math.abs(e-t)<n}function Jo(e){const t=Math.round(e);e=Oe(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(ul(e))),i=e/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function ef(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 nf(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function In(e){return!nf(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function sf(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function of(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 Te(e){return e*(tt/180)}function rf(e){return e*(180/tt)}function tr(e){if(!xt(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function af(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*tt&&(o+=zt),{angle:o,distance:s}}function Ds(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function lf(e,t){return(e-t+Jh)%zt-tt}function Qt(e){return(e%zt+zt)%zt}function hl(e,t,n,i){const s=Qt(e),o=Qt(t),r=Qt(n),a=Qt(o-s),l=Qt(r-s),c=Qt(s-o),u=Qt(s-r);return s===o||s===r||i&&o===r||a>l&&c<u}function yt(e,t,n){return Math.max(t,Math.min(n,e))}function cf(e){return yt(e,-32768,32767)}function xn(e,t,n,i=1e-6){return e>=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function oo(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 Me=(e,t,n,i)=>oo(e,n,i?s=>{const o=e[s][t];return o<n||o===n&&e[s+1][t]===n}:s=>e[s][t]<n),uf=(e,t,n)=>oo(e,n,i=>e[i][t]>=n);function hf(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 fl=["push","pop","shift","splice","unshift"];function ff(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),fl.forEach(n=>{const i="_onData"+so(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 er(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)&&(fl.forEach(o=>{delete e[o]}),delete e._chartjs)}function df(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const dl=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function pl(e,t){let n=[],i=!1;return function(...s){n=s,i||(i=!0,dl.call(window,()=>{i=!1,e.apply(t,n)}))}}function pf(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const gl=e=>e==="start"?"left":e==="end"?"right":"center",ft=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,gf=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function mf(e,t,n){const i=t.length;let s=0,o=i;if(e._sorted){const{iScale:r,vScale:a,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=r.axis,{min:f,max:p,minDefined:g,maxDefined:x}=r.getUserBounds();if(g){if(s=Math.min(Me(l,u,f).lo,n?i:Me(t,u,r.getPixelForValue(f)).lo),c){const y=l.slice(0,s+1).reverse().findIndex(v=>!V(v[a.axis]));s-=Math.max(0,y)}s=yt(s,0,i-1)}if(x){let y=Math.max(Me(l,r.axis,p,!0).hi+1,n?0:Me(t,u,r.getPixelForValue(p),!0).hi+1);if(c){const v=l.slice(y-1).findIndex(w=>!V(w[a.axis]));y+=Math.max(0,v)}o=yt(y,s,i)-s}else o=i-s}return{start:s,count:o}}function bf(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 Qn=e=>e===0||e===1,nr=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*zt/n)),ir=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*zt/n)+1,Sn={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*wt)+1,easeOutSine:e=>Math.sin(e*wt),easeInOutSine:e=>-.5*(Math.cos(tt*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=>Qn(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=>Qn(e)?e:nr(e,.075,.3),easeOutElastic:e=>Qn(e)?e:ir(e,.075,.3),easeInOutElastic(e){return Qn(e)?e:e<.5?.5*nr(e*2,.1125,.45):.5+.5*ir(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-Sn.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?Sn.easeInBounce(e*2)*.5:Sn.easeOutBounce(e*2-1)*.5+.5};function ro(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function sr(e){return ro(e)?e:new Dn(e)}function Zi(e){return ro(e)?e:new Dn(e).saturate(.5).darken(.1).hexString()}const yf=["x","y","borderWidth","radius","tension"],xf=["color","borderColor","backgroundColor"];function vf(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:xf},numbers:{type:"number",properties:yf}}),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 _f(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const or=new Map;function wf(e,t){t=t||{};const n=e+JSON.stringify(t);let i=or.get(n);return i||(i=new Intl.NumberFormat(e,t),or.set(n,i)),i}function ml(e,t,n){return wf(t,n).format(e)}const Sf={values(e){return Q(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=kf(e,n)}const r=ul(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),ml(e,i,l)}};function kf(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 bl={formatters:Sf};function Tf(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:bl.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 De=Object.create(null),As=Object.create(null);function kn(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 Qi(e,t,n){return typeof t=="string"?An(kn(e,t),n):An(kn(e,""),t)}class Mf{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)=>Zi(s.backgroundColor),this.hoverBorderColor=(i,s)=>Zi(s.borderColor),this.hoverColor=(i,s)=>Zi(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 Qi(this,t,n)}get(t){return kn(this,t)}describe(t,n){return Qi(As,t,n)}override(t,n){return Qi(De,t,n)}route(t,n,i,s){const o=kn(this,t),r=kn(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 B(l)?Object.assign({},c,l):R(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var Y=new Mf({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[vf,_f,Tf]);function Ef(e){return!e||V(e.size)||V(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function rr(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 ve(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 ar(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Is(e,t,n,i){yl(e,t,n,i,null)}function yl(e,t,n,i,s){let o,r,a,l,c,u,f,p;const g=t.pointStyle,x=t.rotation,y=t.radius;let v=(x||0)*tf;if(g&&typeof g=="object"&&(o=g.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(n,i),e.rotate(v),e.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),e.restore();return}if(!(isNaN(y)||y<=0)){switch(e.beginPath(),g){default:s?e.ellipse(n,i,s/2,y,0,0,zt):e.arc(n,i,y,0,zt),e.closePath();break;case"triangle":u=s?s/2:y,e.moveTo(n+Math.sin(v)*u,i-Math.cos(v)*y),v+=Qo,e.lineTo(n+Math.sin(v)*u,i-Math.cos(v)*y),v+=Qo,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+xe)*l,f=Math.cos(v+xe)*(s?s/2-c:l),a=Math.sin(v+xe)*l,p=Math.sin(v+xe)*(s?s/2-c:l),e.arc(n-f,i-a,c,v-tt,v-wt),e.arc(n+p,i-r,c,v-wt,v),e.arc(n+f,i+a,c,v,v+wt),e.arc(n-p,i+r,c,v+wt,v+tt),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+=xe;case"rectRot":f=Math.cos(v)*(s?s/2:y),r=Math.cos(v)*y,a=Math.sin(v)*y,p=Math.sin(v)*(s?s/2:y),e.moveTo(n-f,i-a),e.lineTo(n+p,i-r),e.lineTo(n+f,i+a),e.lineTo(n-p,i+r),e.closePath();break;case"crossRot":v+=xe;case"cross":f=Math.cos(v)*(s?s/2:y),r=Math.cos(v)*y,a=Math.sin(v)*y,p=Math.sin(v)*(s?s/2:y),e.moveTo(n-f,i-a),e.lineTo(n+f,i+a),e.moveTo(n+p,i-r),e.lineTo(n-p,i+r);break;case"star":f=Math.cos(v)*(s?s/2:y),r=Math.cos(v)*y,a=Math.sin(v)*y,p=Math.sin(v)*(s?s/2:y),e.moveTo(n-f,i-a),e.lineTo(n+f,i+a),e.moveTo(n+p,i-r),e.lineTo(n-p,i+r),v+=xe,f=Math.cos(v)*(s?s/2:y),r=Math.cos(v)*y,a=Math.sin(v)*y,p=Math.sin(v)*(s?s/2:y),e.moveTo(n-f,i-a),e.lineTo(n+f,i+a),e.moveTo(n+p,i-r),e.lineTo(n-p,i+r);break;case"line":r=s?s/2:Math.cos(v)*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 Ze(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 ao(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function lo(e){e.restore()}function Of(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 Cf(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 Pf(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),V(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 Df(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 Af(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Ti(e,t,n,i,s,o={}){const r=Q(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(e.save(),e.font=s.string,Pf(e,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&Af(e,o.backdrop),a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),V(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,n,i,o.maxWidth)),e.fillText(c,n,i,o.maxWidth),Df(e,n,i,c,o),i+=Number(s.lineHeight);e.restore()}function Ls(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*tt,tt,!0),e.lineTo(n,i+o-r.bottomLeft),e.arc(n+r.bottomLeft,i+o-r.bottomLeft,r.bottomLeft,tt,wt,!0),e.lineTo(n+s-r.bottomRight,i+o),e.arc(n+s-r.bottomRight,i+o-r.bottomRight,r.bottomRight,wt,0,!0),e.lineTo(n+s,i+r.topRight),e.arc(n+s-r.topRight,i+r.topRight,r.topRight,0,-wt,!0),e.lineTo(n+r.topLeft,i)}const If=/^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/,Lf=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Rf(e,t){const n=(""+e).match(If);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 Nf=e=>+e||0;function xl(e,t){const n={},i=B(t),s=i?Object.keys(t):t,o=B(e)?i?r=>R(e[r],e[t[r]]):r=>e[r]:()=>e;for(const r of s)n[r]=Nf(o(r));return n}function zf(e){return xl(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Tn(e){return xl(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Mt(e){const t=zf(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function ct(e,t){e=e||{},t=t||Y.font;let n=R(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=R(e.style,t.style);i&&!(""+i).match(Lf)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:R(e.family,t.family),lineHeight:Rf(R(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:R(e.weight,t.weight),string:""};return s.string=Ef(s),s}function Jn(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 Ff(e,t,n){const{min:i,max:s}=e,o=Xh(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 Ie(e,t){return Object.assign(Object.create(e),t)}function co(e,t=[""],n,i,s=()=>e[0]){const o=n||e;typeof i>"u"&&(i=Sl("_fallback",e));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:i,_getTarget:s,override:a=>co([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,()=>Yf(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return cr(a).includes(l)},ownKeys(a){return cr(a)},set(a,l,c){const u=a._storage||(a._storage=s());return a[l]=u[l]=c,delete a._keys,!0}})}function Qe(e,t,n,i){const s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:vl(e,i),setContext:o=>Qe(e,o,n,i),override:o=>Qe(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,()=>Bf(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 vl(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:ae(n)?n:()=>n,isIndexable:ae(i)?i:()=>i}}const Hf=(e,t)=>e?e+so(t):t,uo=(e,t)=>B(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 Bf(e,t,n){const{_proxy:i,_context:s,_subProxy:o,_descriptors:r}=e;let a=i[t];return ae(a)&&r.isScriptable(t)&&(a=Vf(t,a,e,n)),Q(a)&&a.length&&(a=Wf(t,a,e,r.isIndexable)),uo(t,a)&&(a=Qe(a,s,o&&o[t],r)),a}function Vf(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),uo(e,l)&&(l=ho(s._scopes,s,e,l)),l}function Wf(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(B(t[0])){const l=t,c=s._scopes.filter(u=>u!==l);t=[];for(const u of l){const f=ho(c,s,e,u);t.push(Qe(f,o,r&&r[e],a))}}return t}function wl(e,t,n){return ae(e)?e(t,n):e}const jf=(e,t)=>e===!0?t:typeof e=="string"?wi(t,e):void 0;function Uf(e,t,n,i,s){for(const o of t){const r=jf(n,o);if(r){e.add(r);const a=wl(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 ho(e,t,n,i){const s=t._rootScopes,o=wl(t._fallback,n,i),r=[...e,...s],a=new Set;a.add(i);let l=lr(a,r,n,o||n,i);return l===null||typeof o<"u"&&o!==n&&(l=lr(a,r,o,l,i),l===null)?!1:co(Array.from(a),[""],s,o,()=>$f(t,n,i))}function lr(e,t,n,i,s){for(;n;)n=Uf(e,t,n,i,s);return n}function $f(e,t,n){const i=e._getTarget();t in i||(i[t]={});const s=i[t];return Q(s)&&B(n)?n:s||{}}function Yf(e,t,n,i){let s;for(const o of t)if(s=Sl(Hf(o,e),n),typeof s<"u")return uo(e,s)?ho(n,i,e,s):s}function Sl(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function cr(e){let t=e._keys;return t||(t=e._keys=Xf(e._scopes)),t}function Xf(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 qf=Number.EPSILON||1e-14,Je=(e,t)=>t<e.length&&!e[t].skip&&e[t],kl=e=>e==="x"?"y":"x";function Gf(e,t,n,i){const s=e.skip?t:e,o=t,r=n.skip?t:n,a=Ds(o,s),l=Ds(r,o);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const f=i*c,p=i*u;return{previous:{x:o.x-f*(r.x-s.x),y:o.y-f*(r.y-s.y)},next:{x:o.x+p*(r.x-s.x),y:o.y+p*(r.y-s.y)}}}function Kf(e,t,n){const i=e.length;let s,o,r,a,l,c=Je(e,0);for(let u=0;u<i-1;++u)if(l=c,c=Je(e,u+1),!(!l||!c)){if(Oe(t[u],0,qf)){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 Zf(e,t,n="x"){const i=kl(n),s=e.length;let o,r,a,l=Je(e,0);for(let c=0;c<s;++c){if(r=a,a=l,l=Je(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 Qf(e,t="x"){const n=kl(t),i=e.length,s=Array(i).fill(0),o=Array(i);let r,a,l,c=Je(e,0);for(r=0;r<i;++r)if(a=l,l=c,c=Je(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?le(s[r-1])!==le(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}Kf(e,s,o),Zf(e,o,t)}function ti(e,t,n){return Math.max(Math.min(e,n),t)}function Jf(e,t){let n,i,s,o,r,a=Ze(e[0],t);for(n=0,i=e.length;n<i;++n)r=o,o=a,a=n<i-1&&Ze(e[n+1],t),o&&(s=e[n],r&&(s.cp1x=ti(s.cp1x,t.left,t.right),s.cp1y=ti(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=ti(s.cp2x,t.left,t.right),s.cp2y=ti(s.cp2y,t.top,t.bottom)))}function td(e,t,n,i,s){let o,r,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Qf(e,s);else{let c=i?e[e.length-1]:e[0];for(o=0,r=e.length;o<r;++o)a=e[o],l=Gf(c,a,e[Math.min(o+1,r-(i?0:1))%r],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&Jf(e,n)}function fo(){return typeof window<"u"&&typeof document<"u"}function po(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Mi(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 Ri=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function ed(e,t){return Ri(e).getPropertyValue(t)}const nd=["top","right","bottom","left"];function Ce(e,t,n){const i={};n=n?"-"+n:"";for(let s=0;s<4;s++){const o=nd[s];i[o]=parseFloat(e[t+"-"+o+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const id=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function sd(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:s,offsetY:o}=i;let r=!1,a,l;if(id(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=Ri(n),o=s.boxSizing==="border-box",r=Ce(s,"padding"),a=Ce(s,"border","width"),{x:l,y:c,box:u}=sd(e,n),f=r.left+(u&&a.left),p=r.top+(u&&a.top);let{width:g,height:x}=t;return o&&(g-=r.width+a.width,x-=r.height+a.height),{x:Math.round((l-f)/g*n.width/i),y:Math.round((c-p)/x*n.height/i)}}function od(e,t,n){let i,s;if(t===void 0||n===void 0){const o=e&&po(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const r=o.getBoundingClientRect(),a=Ri(o),l=Ce(a,"border","width"),c=Ce(a,"padding");t=r.width-c.width-l.width,n=r.height-c.height-l.height,i=Mi(a.maxWidth,o,"clientWidth"),s=Mi(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:i||ki,maxHeight:s||ki}}const ei=e=>Math.round(e*10)/10;function rd(e,t,n,i){const s=Ri(e),o=Ce(s,"margin"),r=Mi(s.maxWidth,e,"clientWidth")||ki,a=Mi(s.maxHeight,e,"clientHeight")||ki,l=od(e,t,n);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const p=Ce(s,"border","width"),g=Ce(s,"padding");c-=g.width+p.width,u-=g.height+p.height}return c=Math.max(0,c-o.width),u=Math.max(0,i?c/i:u-o.height),c=ei(Math.min(c,r,l.maxWidth)),u=ei(Math.min(u,a,l.maxHeight)),c&&!u&&(u=ei(c/2)),(t!==void 0||n!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=ei(Math.floor(u*i))),{width:c,height:u}}function ur(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 ad=(function(){let e=!1;try{const t={get passive(){return e=!0,!1}};fo()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();function hr(e,t){const n=ed(e,t),i=n&&n.match(/^(\\d+)(\\.\\d+)?px$/);return i?+i[1]:void 0}function we(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function ld(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 cd(e,t,n,i){const s={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},r=we(e,s,n),a=we(s,o,n),l=we(o,t,n),c=we(r,a,n),u=we(a,l,n);return we(c,u,n)}const ud=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}}},hd=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Ue(e,t,n){return e?ud(t,n):hd()}function Tl(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 Ml(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function El(e){return e==="angle"?{between:hl,compare:lf,normalize:Qt}:{between:xn,compare:(t,n)=>t-n,normalize:t=>t}}function fr({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 fd(e,t,n){const{property:i,start:s,end:o}=n,{between:r,normalize:a}=El(i),l=t.length;let{start:c,end:u,loop:f}=e,p,g;if(f){for(c+=l,u+=l,p=0,g=l;p<g&&r(a(t[c%l][i]),s,o);++p)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:f,style:e.style}}function dd(e,t,n){if(!n)return[e];const{property:i,start:s,end:o}=n,r=t.length,{compare:a,between:l,normalize:c}=El(i),{start:u,end:f,loop:p,style:g}=fd(e,t,n),x=[];let y=!1,v=null,w,k,O;const C=()=>l(s,O,w)&&a(s,O)!==0,T=()=>a(o,w)===0||l(o,O,w),D=()=>y||C(),P=()=>!y||T();for(let E=u,A=u;E<=f;++E)k=t[E%r],!k.skip&&(w=c(k[i]),w!==O&&(y=l(w,s,o),v===null&&D()&&(v=a(w,s)===0?E:A),v!==null&&P()&&(x.push(fr({start:v,end:E,loop:p,count:r,style:g})),v=null),A=E,O=w));return v!==null&&x.push(fr({start:v,end:f,loop:p,count:r,style:g})),x}function pd(e,t){const n=[],i=e.segments;for(let s=0;s<i.length;s++){const o=dd(i[s],e.points,t);o.length&&n.push(...o)}return n}function gd(e,t,n,i){let s=0,o=t-1;if(n&&!i)for(;s<t&&!e[s].skip;)s++;for(;s<t&&e[s].skip;)s++;for(s%=t,n&&(o+=s);o>s&&e[o%t].skip;)o--;return o%=t,{start:s,end:o}}function md(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 bd(e,t){const n=e.points,i=e.options.spanGaps,s=n.length;if(!s)return[];const o=!!e._loop,{start:r,end:a}=gd(n,s,o,i);if(i===!0)return 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,md(n,r,l,c),n,t)}function dr(e,t,n,i){return!i||!i.setContext||!n?t:yd(e,t,n,i)}function yd(e,t,n,i){const s=e._chart.getContext(),o=pr(e.options),{_datasetIndex:r,options:{spanGaps:a}}=e,l=n.length,c=[];let u=o,f=t[0].start,p=f;function g(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(p=f+1;p<=x.end;p++){const w=n[p%l];v=pr(i.setContext(Ie(s,{type:"segment",p0:y,p1:w,p0DataIndex:(p-1)%l,p1DataIndex:p%l,datasetIndex:r}))),xd(v,u)&&g(f,p-1,x.loop,u),y=w,u=v}f<p-1&&g(f,p-1,x.loop,u)}return c}function pr(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function xd(e,t){if(!t)return!1;const n=[],i=function(s,o){return ro(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(e,i)!==JSON.stringify(t,i)}function ni(e,t,n){return e.options.clip?e[n]:t[n]}function vd(e,t){const{xScale:n,yScale:i}=e;return n&&i?{left:ni(n,t,"left"),right:ni(n,t,"right"),top:ni(i,t,"top"),bottom:ni(i,t,"bottom")}:t}function _d(e,t){const n=t._clip;if(n.disabled)return!1;const i=vd(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)}}/*!
1706
1737
  * Chart.js v4.5.0
1707
1738
  * https://www.chartjs.org
1708
1739
  * (c) 2025 Chart.js Contributors
1709
1740
  * Released under the MIT License
1710
- */class tu{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=Wr.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 zt=new tu;const uo="transparent",eu={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=to(e||uo),s=i.valid&&to(t||uo);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class nu{constructor(t,n,i,s){const o=n[i];s=Pn([t.to,s,o,t.from]);const r=Pn([t.from,o,s]);this._active=!0,this._fn=t.fn||eu[t.type||typeof r],this._easing=en[t.easing]||en.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=i,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);const s=this._target[this._prop],o=i-this._start,r=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Pn([t.to,n,s,t.from]),this._from=Pn([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 na{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!B(t))return;const n=Object.keys(Y.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!B(o))return;const r={};for(const a of n)r[a]=o[a];(Z(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,r)})})}_animateOptions(t,n){const i=n.options,s=su(t,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&iu(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 h=n[c];let d=o[c];const g=i.get(c);if(d)if(g&&d.active()){d.update(g,h,a);continue}else d.cancel();if(!g||!g.duration){t[c]=h;continue}o[c]=d=new nu(g,t,c,h),s.push(d)}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 zt.add(this._chart,i),!0}}function iu(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 su(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 fo(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 ou(e,t,n){if(n===!1)return!1;const i=fo(e,n),s=fo(t,n);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function ru(e){let t,n,i,s;return B(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 ia(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 go(e,t,n,i={}){const s=e.keys,o=i.mode==="single";let r,a,l,c;if(t===null)return;let h=!1;for(r=0,a=s.length;r<a;++r){if(l=+s[r],l===n){if(h=!0,i.all)continue;break}c=e.values[l],xt(c)&&(o||t===0||Qt(t)===Qt(c))&&(t+=c)}return!h&&!i.all?0:t}function au(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,h;for(l=0,c=r.length;l<c;++l)h=r[l],a[l]={[s]:h,[o]:e[h]};return a}function yi(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function lu(e,t,n){return\`\${e.id}.\${t.id}.\${n.stack||n.type}\`}function cu(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 hu(e,t,n){const i=e[t]||(e[t]={});return i[n]||(i[n]={})}function po(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 mo(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,h=lu(o,r,i),d=t.length;let g;for(let p=0;p<d;++p){const y=t[p],{[l]:x,[c]:v}=y,w=y._stacks||(y._stacks={});g=w[c]=hu(s,h,x),g[a]=v,g._top=po(g,r,!0,i.type),g._bottom=po(g,r,!1,i.type);const S=g._visualValues||(g._visualValues={});S[a]=v}}function vi(e,t){const n=e.scales;return Object.keys(n).filter(i=>n[i].axis===t).shift()}function uu(e,t){return ve(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function du(e,t,n){return ve(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Ue(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 _i=e=>e==="reset"||e==="none",bo=(e,t)=>t?e:Object.assign({},e),fu=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:ia(n,!0),values:null};class sa{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=yi(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&&Ue(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(d,g,p,y)=>d==="x"?g:d==="r"?y:p,o=n.xAxisID=L(i.xAxisID,vi(t,"x")),r=n.yAxisID=L(i.yAxisID,vi(t,"y")),a=n.rAxisID=L(i.rAxisID,vi(t,"r")),l=n.indexAxis,c=n.iAxisID=s(l,o,r,a),h=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(h)}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&&Zs(this._data,this),t._stacked&&Ue(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(B(n)){const s=this._cachedMeta;this._data=au(n,s)}else if(i!==n){if(i){Zs(i,this);const s=this._cachedMeta;Ue(s),s._parsed=[]}n&&Object.isExtensible(n)&&Uc(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=yi(n.vScale,n),n.stack!==i.stack&&(s=!0,Ue(n),n.stack=i.stack),this._resyncElements(t),(s||o!==n._stacked)&&(mo(this,n._parsed),n._stacked=yi(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],h,d,g;if(this._parsing===!1)i._parsed=s,i._sorted=!0,g=s;else{Z(s[t])?g=this.parseArrayData(i,s,t,n):B(s[t])?g=this.parseObjectData(i,s,t,n):g=this.parsePrimitiveData(i,s,t,n);const p=()=>d[a]===null||c&&d[a]<c[a];for(h=0;h<n;++h)i._parsed[h+t]=d=g[h],l&&(p()&&(l=!1),c=d);i._sorted=l}r&&mo(this,g)}parsePrimitiveData(t,n,i,s){const{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),h=o===r,d=new Array(s);let g,p,y;for(g=0,p=s;g<p;++g)y=g+i,d[g]={[a]:h||o.parse(c[y],y),[l]:r.parse(n[y],y)};return d}parseArrayData(t,n,i,s){const{xScale:o,yScale:r}=t,a=new Array(s);let l,c,h,d;for(l=0,c=s;l<c;++l)h=l+i,d=n[h],a[l]={x:o.parse(d[0],h),y:r.parse(d[1],h)};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 h,d,g,p;for(h=0,d=s;h<d;++h)g=h+i,p=n[g],c[h]={x:o.parse(qn(p,a),g),y:r.parse(qn(p,l),g)};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:ia(s,!0),values:n._stacks[t.axis]._visualValues};return go(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=go(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=fu(n,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=cu(a);let g,p;function y(){p=s[g];const x=p[a.axis];return!xt(p[t.axis])||h>x||d<x}for(g=0;g<r&&!(!y()&&(this.updateRangeFromParsed(c,t,p,l),o));++g);if(o){for(g=r-1;g>=0;--g)if(!y()){this.updateRangeFromParsed(c,t,p,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],xt(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=ru(L(this.options.clip,ou(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 h;for(i.dataset&&i.dataset.draw(t,o,a,l),h=a;h<a+l;++h){const d=s[h];d.hidden||(d.active&&c?r.push(d):d.draw(t,o))}for(h=0;h<r.length;++h)r[h].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=du(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=uu(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&&Gn(i);if(a)return bo(a,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),d=s?[\`\${t}Hover\`,"hover",t,""]:[t,""],g=c.getOptionScopes(this.getDataset(),h),p=Object.keys(Y.elements[t]),y=()=>this.getContext(i,s,n),x=c.resolveNamedOptions(g,p,y,d);return x.$shared&&(x.$shared=l,o[r]=Object.freeze(bo(x,l))),x}_resolveAnimations(t,n,i){const s=this.chart,o=this._cachedDataOpts,r=\`animation-\${n}\`,a=o[r];if(a)return a;let l;if(s.options.animation!==!1){const h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,n),g=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(g,this.getContext(t,i,n))}const c=new na(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||_i(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){_i(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!_i(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&&Ue(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 gu extends sa{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}=qc(n,s,r);this._drawStart=a,this._drawCount=l,Gc(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:h,includeOptions:d}=this._getSharedOptions(n,s),g=r.axis,p=a.axis,{spanGaps:y,segment:x}=this.options,v=hn(y)?y:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||o||s==="none",S=n+i,O=t.length;let C=n>0&&this.getParsed(n-1);for(let k=0;k<O;++k){const D=t[k],P=w?D:{};if(k<n||k>=S){P.skip=!0;continue}const M=this.getParsed(k),A=W(M[p]),F=P[g]=r.getPixelForValue(M[g],k),N=P[p]=o||A?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,M,l):M[p],k);P.skip=isNaN(F)||isNaN(N)||A,P.stop=k>0&&Math.abs(M[g]-C[g])>v,x&&(P.parsed=M,P.raw=c.data[k]),d&&(P.options=h||this.resolveDataElementOptions(k,D.active?"active":s)),w||this.updateElement(D,k,P,s),C=M}}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 ce(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ps{static override(t){Object.assign(ps.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return ce()}parse(){return ce()}format(){return ce()}add(){return ce()}diff(){return ce()}startOf(){return ce()}endOf(){return ce()}}var pu={_date:ps};function mu(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?Vc:fe;if(i){if(s._sharedOptions){const h=o[0],d=typeof h.getRange=="function"&&h.getRange(t);if(d){const g=c(o,t,n-d),p=c(o,t,n+d);return{lo:g.lo,hi:p.hi}}}}else{const h=c(o,t,n);if(l){const{vScale:d}=s._cachedMeta,{_parsed:g}=e,p=g.slice(0,h.lo+1).reverse().findIndex(x=>!W(x[d.axis]));h.lo-=Math.max(0,p);const y=g.slice(h.hi).findIndex(x=>!W(x[d.axis]));h.hi+=Math.max(0,y)}return h}}return{lo:0,hi:o.length-1}}function ii(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:h}=o[a],{lo:d,hi:g}=mu(o[a],t,r,s);for(let p=d;p<=g;++p){const y=h[p];y.skip||i(y,c,p)}}}function bu(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 wi(e,t,n,i,s){const o=[];return!s&&!e.isPointInArea(t)||ii(e,n,t,function(a,l,c){!s&&!De(a,e.chartArea,0)||a.inRange(t.x,t.y,i)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function xu(e,t,n,i){let s=[];function o(r,a,l){const{startAngle:c,endAngle:h}=r.getProps(["startAngle","endAngle"],i),{angle:d}=Hc(r,{x:t.x,y:t.y});Hr(d,c,h)&&s.push({element:r,datasetIndex:a,index:l})}return ii(e,n,t,o),s}function yu(e,t,n,i,s,o){let r=[];const a=bu(n);let l=Number.POSITIVE_INFINITY;function c(h,d,g){const p=h.inRange(t.x,t.y,s);if(i&&!p)return;const y=h.getCenterPoint(s);if(!(!!o||e.isPointInArea(y))&&!p)return;const v=a(t,y);v<l?(r=[{element:h,datasetIndex:d,index:g}],l=v):v===l&&r.push({element:h,datasetIndex:d,index:g})}return ii(e,n,t,c),r}function Ei(e,t,n,i,s,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!i?xu(e,t,n,s):yu(e,t,n,i,s,o)}function xo(e,t,n,i,s){const o=[],r=n==="x"?"inXRange":"inYRange";let a=!1;return ii(e,n,t,(l,c,h)=>{l[r]&&l[r](t[n],s)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:o}var vu={modes:{index(e,t,n,i){const s=Ct(t,e),o=n.axis||"x",r=n.includeInvisible||!1,a=n.intersect?wi(e,s,o,i,r):Ei(e,s,o,!1,i,r),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(e,t,n,i){const s=Ct(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;let a=n.intersect?wi(e,s,o,i,r):Ei(e,s,o,!1,i,r);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let h=0;h<c.length;++h)a.push({element:c[h],datasetIndex:l,index:h})}return a},point(e,t,n,i){const s=Ct(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;return wi(e,s,o,i,r)},nearest(e,t,n,i){const s=Ct(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;return Ei(e,s,o,n.intersect,i,r)},x(e,t,n,i){const s=Ct(t,e);return xo(e,s,"x",n.intersect,i)},y(e,t,n,i){const s=Ct(t,e);return xo(e,s,"y",n.intersect,i)}}};const oa=["left","top","right","bottom"];function Ye(e,t){return e.filter(n=>n.pos===t)}function yo(e,t){return e.filter(n=>oa.indexOf(n.pos)===-1&&n.box.axis===t)}function $e(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 _u(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 wu(e){const t={};for(const n of e){const{stack:i,pos:s,stackWeight:o}=n;if(!i||!oa.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 Eu(e,t){const n=wu(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],h=c&&a.stackWeight/c.weight;a.horizontal?(a.width=h?h*i:l&&t.availableWidth,a.height=s):(a.width=i,a.height=h?h*s:l&&t.availableHeight)}return n}function Su(e){const t=_u(e),n=$e(t.filter(c=>c.box.fullSize),!0),i=$e(Ye(t,"left"),!0),s=$e(Ye(t,"right")),o=$e(Ye(t,"top"),!0),r=$e(Ye(t,"bottom")),a=yo(t,"x"),l=yo(t,"y");return{fullSize:n,leftAndTop:i.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:Ye(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function vo(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function ra(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 ku(e,t,n,i){const{pos:s,box:o}=n,r=e.maxPadding;if(!B(s)){n.size&&(e[s]-=n.size);const 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&&ra(r,o.getPadding());const a=Math.max(0,t.outerWidth-vo(r,e,"left","right")),l=Math.max(0,t.outerHeight-vo(r,e,"top","bottom")),c=a!==e.w,h=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:h}:{same:h,other:c}}function Tu(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 Mu(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 Qe(e,t,n,i){const s=[];let o,r,a,l,c,h;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,Mu(a.horizontal,t));const{same:d,other:g}=ku(t,n,a,i);c|=d&&s.length,h=h||g,l.fullSize||s.push(a)}return c&&Qe(s,t,n,i)||h}function Nn(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 _o(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},h=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*h,g=c.size||l.height;Gn(c.start)&&(r=c.start),l.fullSize?Nn(l,s.left,r,n.outerWidth-s.right-s.left,g):Nn(l,t.left+c.placed,r,d,g),c.start=r,c.placed+=d,r=l.bottom}else{const d=t.h*h,g=c.size||l.width;Gn(c.start)&&(o=c.start),l.fullSize?Nn(l,o,s.top,g,n.outerHeight-s.bottom-s.top):Nn(l,o,t.top+c.placed,g,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=r}var $t={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=wt(e.options.layout.padding),o=Math.max(t-s.width,0),r=Math.max(n-s.height,0),a=Su(e.boxes),l=a.vertical,c=a.horizontal;z(e.boxes,x=>{typeof x.beforeLayout=="function"&&x.beforeLayout()});const h=l.reduce((x,v)=>v.box.options&&v.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/h,hBoxMaxHeight:r/2}),g=Object.assign({},s);ra(g,wt(i));const p=Object.assign({maxPadding:g,w:o,h:r,x:s.left,y:s.top},s),y=Eu(l.concat(c),d);Qe(a.fullSize,p,d,y),Qe(l,p,d,y),Qe(c,p,d,y)&&Qe(l,p,d,y),Tu(p),_o(a.leftAndTop,p,d,y),p.x+=p.w,p.y+=p.h,_o(a.rightAndBottom,p,d,y),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},z(a.chartArea,x=>{const v=x.box;Object.assign(v,e.chartArea),v.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class aa{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 Ou extends aa{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Wn="$chartjs",Cu={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},wo=e=>e===null||e==="";function Pu(e,t){const n=e.style,i=e.getAttribute("height"),s=e.getAttribute("width");if(e[Wn]={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",wo(s)){const o=ao(e,"width");o!==void 0&&(e.width=o)}if(wo(i))if(e.style.height==="")e.height=e.width/(t||2);else{const o=ao(e,"height");o!==void 0&&(e.height=o)}return e}const la=Hh?{passive:!0}:!1;function Du(e,t,n){e&&e.addEventListener(t,n,la)}function Au(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,la)}function Iu(e,t){const n=Cu[e.type]||e.type,{x:i,y:s}=Ct(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Jn(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function Nu(e,t,n){const i=e.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Jn(a.addedNodes,i),r=r&&!Jn(a.removedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function Lu(e,t,n){const i=e.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Jn(a.removedNodes,i),r=r&&!Jn(a.addedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const un=new Map;let Eo=0;function ca(){const e=window.devicePixelRatio;e!==Eo&&(Eo=e,un.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function Ru(e,t){un.size||window.addEventListener("resize",ca),un.set(e,t)}function zu(e){un.delete(e),un.size||window.removeEventListener("resize",ca)}function Fu(e,t,n){const i=e.canvas,s=i&&gs(i);if(!s)return;const o=Vr((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,h=l.contentRect.height;c===0&&h===0||o(c,h)});return r.observe(s),Ru(e,o),r}function Si(e,t,n){n&&n.disconnect(),t==="resize"&&zu(e)}function Hu(e,t,n){const i=e.canvas,s=Vr(o=>{e.ctx!==null&&n(Iu(o,e))},e);return Du(i,t,s),s}class Bu extends aa{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Pu(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[Wn])return!1;const i=n[Wn].initial;["height","width"].forEach(o=>{const r=i[o];W(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[Wn],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),r={attach:Nu,detach:Lu,resize:Fu}[n]||Hu;s[n]=r(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:Si,detach:Si,resize:Si}[n]||Au)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return Fh(t,n,i,s)}isAttached(t){const n=t&&gs(t);return!!(n&&n.isConnected)}}function Wu(e){return!fs()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Ou:Bu}class Ne{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 hn(this.x)&&hn(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 Vu(e,t){const n=e.options.ticks,i=ju(e),s=Math.min(n.maxTicksLimit||i,i),o=n.major.enabled?Yu(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return $u(t,c,o,r/s),c;const h=Uu(o,t,s);if(r>0){let d,g;const p=r>1?Math.round((l-a)/(r-1)):null;for(Ln(t,c,h,W(p)?0:a-p,a),d=0,g=r-1;d<g;d++)Ln(t,c,h,o[d],o[d+1]);return Ln(t,c,h,l,W(p)?t.length:l+p),c}return Ln(t,c,h),c}function ju(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 Uu(e,t,n){const i=Xu(e),s=t.length/n;if(!i)return Math.max(s,1);const o=Nc(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 Yu(e){const t=[];let n,i;for(n=0,i=e.length;n<i;n++)e[n].major&&t.push(n);return t}function $u(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 Ln(e,t,n,i,s){const o=L(i,0),r=Math.min(L(s,e.length),e.length);let a=0,l,c,h;for(n=Math.ceil(n),s&&(l=s-i,n=l/Math.floor(l/n)),h=o;h<0;)a++,h=Math.round(o+a*n);for(c=Math.max(o,0);c<r;c++)c===h&&(t.push(e[c]),a++,h=Math.round(o+a*n))}function Xu(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 qu=e=>e==="left"?"right":e==="right"?"left":e,So=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,ko=(e,t)=>Math.min(t||e,e);function To(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 Gu(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 Ku(e,t){z(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 Xe(e){return e.drawTicks?e.tickLength:0}function Mo(e,t){if(!e.display)return 0;const n=lt(e.font,t),i=wt(e.padding);return(Z(e.text)?e.text.length:1)*n.lineHeight+i.height}function Zu(e,t){return ve(e,{scale:t,type:"scale"})}function Qu(e,t,n){return ve(e,{tick:n,index:t,type:"tick"})}function Ju(e,t,n){let i=jr(e);return(n&&t!=="right"||!n&&t==="right")&&(i=qu(i)),i}function td(e,t,n,i){const{top:s,left:o,bottom:r,right:a,chart:l}=e,{chartArea:c,scales:h}=l;let d=0,g,p,y;const x=r-s,v=a-o;if(e.isHorizontal()){if(p=ut(i,o,a),B(n)){const w=Object.keys(n)[0],S=n[w];y=h[w].getPixelForValue(S)+x-t}else n==="center"?y=(c.bottom+c.top)/2+x-t:y=So(e,n,t);g=a-o}else{if(B(n)){const w=Object.keys(n)[0],S=n[w];p=h[w].getPixelForValue(S)-v+t}else n==="center"?p=(c.left+c.right)/2-v+t:p=So(e,n,t);y=ut(i,r,s),d=n==="left"?-_t:_t}return{titleX:p,titleY:y,maxWidth:g,rotation:d}}class Le extends Ne{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=Tt(t,Number.POSITIVE_INFINITY),n=Tt(n,Number.NEGATIVE_INFINITY),i=Tt(i,Number.POSITIVE_INFINITY),s=Tt(s,Number.NEGATIVE_INFINITY),{min:Tt(t,i),max:Tt(n,s),minDefined:xt(t),maxDefined:xt(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:Tt(n,Tt(i,n)),max:Tt(i,Tt(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=mh(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?To(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=Vu(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=ko(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 h=this._getLabelSizes(),d=h.widest.width,g=h.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-Xe(t.grid)-n.padding-Mo(t.title,this.chart.options.font),c=Math.sqrt(d*d+g*g),r=Fc(Math.min(Math.asin(bt((h.highest.height+6)/a,-1,1)),Math.asin(bt(l/c,-1,1))-Math.asin(bt(g/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=Mo(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=Xe(o)+l):(t.height=this.maxHeight,t.width=Xe(o)+l),i.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:g}=this._getLabelSizes(),p=i.padding*2,y=de(this.labelRotation),x=Math.cos(y),v=Math.sin(y);if(a){const w=i.mirror?0:v*d.width+x*g.height;t.height=Math.min(this.maxHeight,t.height+w+p)}else{const w=i.mirror?0:x*d.width+v*g.height;t.width=Math.min(this.maxWidth,t.width+w+p)}this._calculatePadding(c,h,v,x)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,i,s){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let g=0,p=0;l?c?(g=s*t.width,p=i*n.height):(g=i*t.height,p=s*n.width):o==="start"?p=n.width:o==="end"?g=t.width:o!=="inner"&&(g=t.width/2,p=n.width/2),this.paddingLeft=Math.max((g-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((p-d+r)*this.width/(this.width-d),0)}else{let h=n.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=n.height,d=0),this.paddingTop=h+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(){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++)W(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=To(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/ko(n,i));let c=0,h=0,d,g,p,y,x,v,w,S,O,C,k;for(d=0;d<n;d+=l){if(y=t[d].label,x=this._resolveTickFontOptions(d),s.font=v=x.string,w=o[v]=o[v]||{data:{},gc:[]},S=x.lineHeight,O=C=0,!W(y)&&!Z(y))O=no(s,w.data,w.gc,O,y),C=S;else if(Z(y))for(g=0,p=y.length;g<p;++g)k=y[g],!W(k)&&!Z(k)&&(O=no(s,w.data,w.gc,O,k),C+=S);r.push(O),a.push(C),c=Math.max(O,c),h=Math.max(C,h)}Ku(o,n);const D=r.indexOf(c),P=a.indexOf(h),M=A=>({width:r[A]||0,height:a[A]||0});return{first:M(0),last:M(n-1),widest:M(D),highest:M(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 Wc(this._alignToPixels?le(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=Qu(this.getContext(),t,i))}return this.$context||(this.$context=Zu(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=de(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(),d=this.ticks.length+(l?1:0),g=Xe(o),p=[],y=a.setContext(this.getContext()),x=y.display?y.width:0,v=x/2,w=function(X){return le(i,X,x)};let S,O,C,k,D,P,M,A,F,N,H,G;if(r==="top")S=w(this.bottom),P=this.bottom-g,A=S-v,N=w(t.top)+v,G=t.bottom;else if(r==="bottom")S=w(this.top),N=t.top,G=w(t.bottom)-v,P=S+v,A=this.top+g;else if(r==="left")S=w(this.right),D=this.right-g,M=S-v,F=w(t.left)+v,H=t.right;else if(r==="right")S=w(this.left),F=t.left,H=w(t.right)-v,D=S+v,M=this.left+g;else if(n==="x"){if(r==="center")S=w((t.top+t.bottom)/2+.5);else if(B(r)){const X=Object.keys(r)[0],et=r[X];S=w(this.chart.scales[X].getPixelForValue(et))}N=t.top,G=t.bottom,P=S+v,A=P+g}else if(n==="y"){if(r==="center")S=w((t.left+t.right)/2);else if(B(r)){const X=Object.keys(r)[0],et=r[X];S=w(this.chart.scales[X].getPixelForValue(et))}D=S-v,M=D-g,F=t.left,H=t.right}const tt=L(s.ticks.maxTicksLimit,d),V=Math.max(1,Math.ceil(d/tt));for(O=0;O<d;O+=V){const X=this.getContext(O),et=o.setContext(X),we=a.setContext(X),ee=et.lineWidth,Bt=et.color,Ee=we.dash||[],dt=we.dashOffset,ne=et.tickWidth,yt=et.tickColor,ie=et.tickBorderDash||[],It=et.tickBorderDashOffset;C=Gu(this,O,l),C!==void 0&&(k=le(i,C,ee),c?D=M=F=H=k:P=A=N=G=k,p.push({tx1:D,ty1:P,tx2:M,ty2:A,x1:F,y1:N,x2:H,y2:G,width:ee,color:Bt,borderDash:Ee,borderDashOffset:dt,tickWidth:ne,tickColor:yt,tickBorderDash:ie,tickBorderDashOffset:It}))}return this._ticksLength=d,this._borderValue=S,p}_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:h,mirror:d}=o,g=Xe(i.grid),p=g+h,y=d?-h:p,x=-de(this.labelRotation),v=[];let w,S,O,C,k,D,P,M,A,F,N,H,G="middle";if(s==="top")D=this.bottom-y,P=this._getXAxisLabelAlignment();else if(s==="bottom")D=this.top+y,P=this._getXAxisLabelAlignment();else if(s==="left"){const V=this._getYAxisLabelAlignment(g);P=V.textAlign,k=V.x}else if(s==="right"){const V=this._getYAxisLabelAlignment(g);P=V.textAlign,k=V.x}else if(n==="x"){if(s==="center")D=(t.top+t.bottom)/2+p;else if(B(s)){const V=Object.keys(s)[0],X=s[V];D=this.chart.scales[V].getPixelForValue(X)+p}P=this._getXAxisLabelAlignment()}else if(n==="y"){if(s==="center")k=(t.left+t.right)/2-p;else if(B(s)){const V=Object.keys(s)[0],X=s[V];k=this.chart.scales[V].getPixelForValue(X)}P=this._getYAxisLabelAlignment(g).textAlign}n==="y"&&(l==="start"?G="top":l==="end"&&(G="bottom"));const tt=this._getLabelSizes();for(w=0,S=a.length;w<S;++w){O=a[w],C=O.label;const V=o.setContext(this.getContext(w));M=this.getPixelForTick(w)+o.labelOffset,A=this._resolveTickFontOptions(w),F=A.lineHeight,N=Z(C)?C.length:1;const X=N/2,et=V.color,we=V.textStrokeColor,ee=V.textStrokeWidth;let Bt=P;r?(k=M,P==="inner"&&(w===S-1?Bt=this.options.reverse?"left":"right":w===0?Bt=this.options.reverse?"right":"left":Bt="center"),s==="top"?c==="near"||x!==0?H=-N*F+F/2:c==="center"?H=-tt.highest.height/2-X*F+F:H=-tt.highest.height+F/2:c==="near"||x!==0?H=F/2:c==="center"?H=tt.highest.height/2-X*F:H=tt.highest.height-N*F,d&&(H*=-1),x!==0&&!V.showLabelBackdrop&&(k+=F/2*Math.sin(x))):(D=M,H=(1-N)*F/2);let Ee;if(V.showLabelBackdrop){const dt=wt(V.backdropPadding),ne=tt.heights[w],yt=tt.widths[w];let ie=H-dt.top,It=0-dt.left;switch(G){case"middle":ie-=ne/2;break;case"bottom":ie-=ne;break}switch(P){case"center":It-=yt/2;break;case"right":It-=yt;break;case"inner":w===S-1?It-=yt:w>0&&(It-=yt/2);break}Ee={left:It,top:ie,width:yt+dt.width,height:ne+dt.height,color:V.backdropColor}}v.push({label:C,font:A,textOffset:H,options:{rotation:x,color:et,strokeColor:we,strokeWidth:ee,textAlign:Bt,textBaseline:G,translation:[k,D],backdrop:Ee}})}return v}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-de(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,h;return n==="left"?s?(h=this.right+o,i==="near"?c="left":i==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,i==="near"?c="right":i==="center"?(c="center",h-=l/2):(c="left",h=this.left)):n==="right"?s?(h=this.left+o,i==="near"?c="right":i==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,i==="near"?c="left":i==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_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,h)=>{!h.width||!h.color||(i.save(),i.lineWidth=h.width,i.strokeStyle=h.color,i.setLineDash(h.borderDash||[]),i.lineDashOffset=h.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,h,d,g;this.isHorizontal()?(c=le(t,this.left,r)-r/2,h=le(t,this.right,a)+a/2,d=g=l):(d=le(t,this.top,r)-r/2,g=le(t,this.bottom,a)+a/2,c=h=l),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(c,d),n.lineTo(h,g),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&ls(i,s);const o=this.getLabelItems(t);for(const r of o){const a=r.options,l=r.font,c=r.label,h=r.textOffset;Zn(i,c,0,h,l,a)}s&&cs(i)}drawTitle(){const{ctx:t,options:{position:n,title:i,reverse:s}}=this;if(!i.display)return;const o=lt(i.font),r=wt(i.padding),a=i.align;let l=o.lineHeight/2;n==="bottom"||n==="center"||B(n)?(l+=r.bottom,Z(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=r.top;const{titleX:c,titleY:h,maxWidth:d,rotation:g}=td(this,l,n,a);Zn(t,i.text,0,0,o,{color:i.color,maxWidth:d,rotation:g,textAlign:Ju(a,n,s),textBaseline:"middle",translation:[c,h]})}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=L(t.grid&&t.grid.z,-1),s=L(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Le.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 lt(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Rn{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;id(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,ed(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 ed(e,t,n){const i=cn(Object.create(null),[n?Y.get(n):{},Y.get(t),e.defaults]);Y.set(t,i),e.defaultRoutes&&nd(t,e.defaultRoutes),e.descriptors&&Y.describe(t,e.descriptors)}function nd(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 id(e){return"id"in e&&"defaults"in e}class sd{constructor(){this.controllers=new Rn(sa,"datasets",!0),this.elements=new Rn(Ne,"elements"),this.plugins=new Rn(Object,"plugins"),this.scales=new Rn(Le,"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):z(s,r=>{const a=i||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,n,i){const s=os(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 Ot=new sd;class od{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(){W(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=L(i.options&&i.options.plugins,{}),o=rd(i);return s===!1&&!n?[]:ld(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 rd(e){const t={},n=[],i=Object.keys(Ot.plugins.items);for(let o=0;o<i.length;o++)n.push(Ot.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 ad(e,t){return!t&&e===!1?null:e===!0?{}:e}function ld(e,{plugins:t,localIds:n},i,s){const o=[],r=e.getContext();for(const a of t){const l=a.id,c=ad(i[l],s);c!==null&&o.push({plugin:a,options:cd(e.config,{plugin:a,local:n[l]},c,r)})}return o}function cd(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 Hi(e,t){const n=Y.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function hd(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function ud(e,t){return e===t?"_index_":"_value_"}function Oo(e){if(e==="x"||e==="y"||e==="r")return e}function dd(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Bi(e,...t){if(Oo(e))return e;for(const n of t){const i=n.axis||dd(n.position)||e.length>1&&Oo(e[0].toLowerCase());if(i)return i}throw new Error(\`Cannot determine type of '\${e}' axis. Please provide 'axis' or 'position' option.\`)}function Co(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function fd(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 Co(e,"x",n[0])||Co(e,"y",n[0])}return{}}function gd(e,t){const n=be[e.type]||{scales:{}},i=t.scales||{},s=Hi(e.type,t),o=Object.create(null);return Object.keys(i).forEach(r=>{const a=i[r];if(!B(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=Bi(r,a,fd(r,e),Y.scales[a.type]),c=ud(l,s),h=n.scales||{};o[r]=tn(Object.create(null),[{axis:l},a,h[l],h[c]])}),e.data.datasets.forEach(r=>{const a=r.type||e.type,l=r.indexAxis||Hi(a,t),h=(be[a]||{}).scales||{};Object.keys(h).forEach(d=>{const g=hd(d,l),p=r[g+"AxisID"]||g;o[p]=o[p]||Object.create(null),tn(o[p],[{axis:g},i[p],h[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];tn(a,[Y.scales[a.type],Y.scale])}),o}function ha(e){const t=e.options||(e.options={});t.plugins=L(t.plugins,{}),t.scales=gd(e,t)}function ua(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function pd(e){return e=e||{},e.data=ua(e.data),ha(e),e}const Po=new Map,da=new Set;function zn(e,t){let n=Po.get(e);return n||(n=t(),Po.set(e,n),da.add(n)),n}const qe=(e,t,n)=>{const i=qn(t,n);i!==void 0&&e.add(i)};class md{constructor(t){this._config=pd(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=ua(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(),ha(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return zn(t,()=>[[\`datasets.\${t}\`,""]])}datasetAnimationScopeKeys(t,n){return zn(\`\${t}.transition.\${n}\`,()=>[[\`datasets.\${t}.transitions.\${n}\`,\`transitions.\${n}\`],[\`datasets.\${t}\`,""]])}datasetElementScopeKeys(t,n){return zn(\`\${t}-\${n}\`,()=>[[\`datasets.\${t}.elements.\${n}\`,\`datasets.\${t}\`,\`elements.\${n}\`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return zn(\`\${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(h=>{t&&(l.add(t),h.forEach(d=>qe(l,t,d))),h.forEach(d=>qe(l,s,d)),h.forEach(d=>qe(l,be[o]||{},d)),h.forEach(d=>qe(l,Y,d)),h.forEach(d=>qe(l,Ri,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),da.has(n)&&r.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,be[n]||{},Y.datasets[n]||{},{type:n},Y,Ri]}resolveNamedOptions(t,n,i,s=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=Do(this._resolverCache,t,s);let l=r;if(xd(r,n)){o.$shared=!1,i=Zt(i)?i():i;const c=this.createResolver(t,i,a);l=Ae(r,i,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,i=[""],s){const{resolver:o}=Do(this._resolverCache,t,i);return B(n)?Ae(o,n,void 0,s):o}}function Do(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:hs(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,o)),o}const bd=e=>B(e)&&Object.getOwnPropertyNames(e).some(t=>Zt(e[t]));function xd(e,t){const{isScriptable:n,isIndexable:i}=qr(e);for(const s of t){const o=n(s),r=i(s),a=(r||o)&&e[s];if(o&&(Zt(a)||bd(a))||r&&Z(a))return!0}return!1}var yd="4.5.0";const vd=["top","bottom","left","right","chartArea"];function Ao(e,t){return e==="top"||e==="bottom"||vd.indexOf(e)===-1&&t==="x"}function Io(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function No(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),I(n&&n.onComplete,[e],t)}function _d(e){const t=e.chart,n=t.options.animation;I(n&&n.onProgress,[e],t)}function fa(e){return fs()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Vn={},Lo=e=>{const t=fa(e);return Object.values(Vn).filter(n=>n.canvas===t).pop()};function wd(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 Ed(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}class Wi{static defaults=Y;static instances=Vn;static overrides=be;static registry=Ot;static version=yd;static getChart=Lo;static register(...t){Ot.add(...t),Ro()}static unregister(...t){Ot.remove(...t),Ro()}constructor(t,n){const i=this.config=new md(n),s=fa(t),o=Lo(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||Wu(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=kc(),this.ctx=a,this.canvas=l,this.width=h,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 od,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=$c(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],Vn[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}zt.listen(this,"complete",No),zt.listen(this,"progress",_d),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:s,_aspectRatio:o}=this;return W(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 Ot}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ro(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return io(this.canvas,this.ctx),this}stop(){return zt.stop(this),this}resize(t,n){zt.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,ro(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||{};z(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=Bi(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),z(o,r=>{const a=r.options,l=a.id,c=Bi(l,a),h=L(a.type,r.dtype);(a.position===void 0||Ao(a.position,c)!==Ao(r.dposition))&&(a.position=r.dposition),s[l]=!0;let d=null;if(l in i&&i[l].type===h)d=i[l];else{const g=Ot.getScale(h);d=new g({id:l,type:h,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),z(s,(r,a)=>{r||delete i[a]}),z(i,r=>{$t.configure(this,r,r.options),$t.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(Io("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||Hi(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=Ot.getController(a),{datasetElementType:c,dataElementType:h}=Y.datasets[a];Object.assign(l,{dataElementType:Ot.getElement(h),datasetElementType:c&&Ot.getElement(c)}),r.controller=new l(this,i),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){z(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,h=this.data.datasets.length;c<h;c++){const{controller:d}=this.getDatasetMeta(c),g=!s&&o.indexOf(d)===-1;d.buildOrUpdateElements(g),r=Math.max(+d.getMaxOverflow(),r)}r=this._minPadding=i.layout.autoPadding?r:0,this._updateLayout(r),s||z(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Io("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){z(this.scales,t=>{$t.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Xs(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;wd(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(!Xs(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;$t.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],z(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,Zt(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&&(zt.has(this)?this.attached&&!zt.running(this)&&zt.start(this):(this.draw(),No({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=Jh(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&ls(n,s),t.controller.draw(),s&&cs(n),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return De(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){const o=vu.modes[n];return typeof o=="function"?o(this,t,i,s):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let s=i.filter(o=>o&&o._dataset===n).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=ve(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){const s=i?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);Gn(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(),zt.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(),io(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Vn[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)};z(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(){z(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},z(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}});!$n(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(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.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){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=Dc(t),c=Ed(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 h=!$n(a,s);return(h||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=c,h}_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 Ro(){return z(Wi.instances,e=>e._plugins.invalidate())}function ga(e,t,n=t){e.lineCap=L(n.borderCapStyle,t.borderCapStyle),e.setLineDash(L(n.borderDash,t.borderDash)),e.lineDashOffset=L(n.borderDashOffset,t.borderDashOffset),e.lineJoin=L(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=L(n.borderWidth,t.borderWidth),e.strokeStyle=L(n.borderColor,t.borderColor)}function Sd(e,t,n){e.lineTo(n.x,n.y)}function kd(e){return e.stepped?rh:e.tension||e.cubicInterpolationMode==="monotone"?ah:Sd}function pa(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),h=s<r&&o<r||s>a&&o>a;return{count:i,start:l,loop:t.loop,ilen:c<l&&!h?i+c-l:c-l}}function Td(e,t,n,i){const{points:s,options:o}=t,{count:r,start:a,loop:l,ilen:c}=pa(s,n,i),h=kd(o);let{move:d=!0,reverse:g}=i||{},p,y,x;for(p=0;p<=c;++p)y=s[(a+(g?c-p:p))%r],!y.skip&&(d?(e.moveTo(y.x,y.y),d=!1):h(e,x,y,g,o.stepped),x=y);return l&&(y=s[(a+(g?c:0))%r],h(e,x,y,g,o.stepped)),!!l}function Md(e,t,n,i){const s=t.points,{count:o,start:r,ilen:a}=pa(s,n,i),{move:l=!0,reverse:c}=i||{};let h=0,d=0,g,p,y,x,v,w;const S=C=>(r+(c?a-C:C))%o,O=()=>{x!==v&&(e.lineTo(h,v),e.lineTo(h,x),e.lineTo(h,w))};for(l&&(p=s[S(0)],e.moveTo(p.x,p.y)),g=0;g<=a;++g){if(p=s[S(g)],p.skip)continue;const C=p.x,k=p.y,D=C|0;D===y?(k<x?x=k:k>v&&(v=k),h=(d*h+C)/++d):(O(),e.lineTo(C,k),y=D,d=0,x=v=k),w=k}O()}function Vi(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?Md:Td}function Od(e){return e.stepped?Bh:e.tension||e.cubicInterpolationMode==="monotone"?Wh:he}function Cd(e,t,n,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,i)&&s.closePath()),ga(e,t.options),e.stroke(s)}function Pd(e,t,n,i){const{segments:s,options:o}=t,r=Vi(t);for(const a of s)ga(e,o,a.style),e.beginPath(),r(e,t,a,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const Dd=typeof Path2D=="function";function Ad(e,t,n,i){Dd&&!t.options.segment?Cd(e,t,n,i):Pd(e,t,n,i)}class Id extends Ne{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;Ah(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=Gh(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=$h(this,{property:n,start:s,end:s});if(!r.length)return;const a=[],l=Od(i);let c,h;for(c=0,h=r.length;c<h;++c){const{start:d,end:g}=r[c],p=o[d],y=o[g];if(p===y){a.push(p);continue}const x=Math.abs((s-p[n])/(y[n]-p[n])),v=l(p,y,x,i.stepped);v[n]=t[n],a.push(v)}return a.length===1?a[0]:a}pathSegment(t,n,i){return Vi(this)(t,this,n,i)}path(t,n,i){const s=this.segments,o=Vi(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(),Ad(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function zo(e,t,n,i){const s=e.options,{[n]:o}=e.getProps([n],i);return Math.abs(t-o)<s.radius+s.hitRadius}class Nd extends Ne{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 zo(this,t,"x",n)}inYRange(t,n){return zo(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||!De(this,n,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,zi(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}const Fo=(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)}},Ld=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Ho extends Ne{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=lt(i.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Fo(i,o);let c,h;n.font=s.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,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],h=s+a;let d=t;o.textAlign="left",o.textBaseline="middle";let g=-1,p=-h;return this.legendItems.forEach((y,x)=>{const v=i+n/2+o.measureText(y.text).width;(x===0||c[c.length-1]+v+2*a>r)&&(d+=h,c[c.length-(x>0?0:1)]=0,p+=h,g++),l[x]={left:0,top:p,row:g,width:v,height:s},c[c.length-1]+=v+a}),d}_fitCols(t,n,i,s){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t;let d=a,g=0,p=0,y=0,x=0;return this.legendItems.forEach((v,w)=>{const{itemWidth:S,itemHeight:O}=Rd(i,n,o,v,s);w>0&&p+O+2*a>h&&(d+=g+a,c.push({width:g,height:p}),y+=g+a,x++,g=p=0),l[w]={left:y,top:p,col:x,width:S,height:O},g=Math.max(g,S),p+=O+a}),d+=g,c.push({width:g,height:p}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:o}}=this,r=Oe(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=ut(i,this.left+s,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=ut(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=ut(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=ut(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;ls(t,this),this._draw(),cs(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:s}=this,{align:o,labels:r}=t,a=Y.color,l=Oe(t.rtl,this.left,this.width),c=lt(r.font),{padding:h}=r,d=c.size,g=d/2;let p;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:y,boxHeight:x,itemHeight:v}=Fo(r,d),w=function(D,P,M){if(isNaN(y)||y<=0||isNaN(x)||x<0)return;s.save();const A=L(M.lineWidth,1);if(s.fillStyle=L(M.fillStyle,a),s.lineCap=L(M.lineCap,"butt"),s.lineDashOffset=L(M.lineDashOffset,0),s.lineJoin=L(M.lineJoin,"miter"),s.lineWidth=A,s.strokeStyle=L(M.strokeStyle,a),s.setLineDash(L(M.lineDash,[])),r.usePointStyle){const F={radius:x*Math.SQRT2/2,pointStyle:M.pointStyle,rotation:M.rotation,borderWidth:A},N=l.xPlus(D,y/2),H=P+g;$r(s,F,N,H,r.pointStyleWidth&&y)}else{const F=P+Math.max((d-x)/2,0),N=l.leftForLtr(D,y),H=sn(M.borderRadius);s.beginPath(),Object.values(H).some(G=>G!==0)?Fi(s,{x:N,y:F,w:y,h:x,radius:H}):s.rect(N,F,y,x),s.fill(),A!==0&&s.stroke()}s.restore()},S=function(D,P,M){Zn(s,M.text,D,P+v/2,c,{strikethrough:M.hidden,textAlign:l.textAlign(M.textAlign)})},O=this.isHorizontal(),C=this._computeTitleHeight();O?p={x:ut(o,this.left+h,this.right-i[0]),y:this.top+h+C,line:0}:p={x:this.left+h,y:ut(o,this.top+C+h,this.bottom-n[0].height),line:0},Jr(this.ctx,t.textDirection);const k=v+h;this.legendItems.forEach((D,P)=>{s.strokeStyle=D.fontColor,s.fillStyle=D.fontColor;const M=s.measureText(D.text).width,A=l.textAlign(D.textAlign||(D.textAlign=r.textAlign)),F=y+g+M;let N=p.x,H=p.y;l.setWidth(this.width),O?P>0&&N+F+h>this.right&&(H=p.y+=k,p.line++,N=p.x=ut(o,this.left+h,this.right-i[p.line])):P>0&&H+k>this.bottom&&(N=p.x=N+n[p.line].width+h,p.line++,H=p.y=ut(o,this.top+C+h,this.bottom-n[p.line].height));const G=l.x(N);if(w(G,H,D),N=Xc(A,N+y+g,O?N+F:this.right,t.rtl),S(l.x(N),H,D),O)p.x+=F+h;else if(typeof D.text!="string"){const tt=c.lineHeight;p.y+=ma(D,tt)+h}else p.y+=k}),ta(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=lt(n.font),s=wt(n.padding);if(!n.display)return;const o=Oe(t.rtl,this.left,this.width),r=this.ctx,a=n.position,l=i.size/2,c=s.top+l;let h,d=this.left,g=this.width;if(this.isHorizontal())g=Math.max(...this.lineWidths),h=this.top+c,d=ut(t.align,d,this.right-g);else{const y=this.columnSizes.reduce((x,v)=>Math.max(x,v.height),0);h=c+ut(t.align,this.top,this.bottom-y-t.labels.padding-this._computeTitleHeight())}const p=ut(a,d,d+g);r.textAlign=o.textAlign(jr(a)),r.textBaseline="middle",r.strokeStyle=n.color,r.fillStyle=n.color,r.font=i.string,Zn(r,n.text,p,h,i)}_computeTitleHeight(){const t=this.options.title,n=lt(t.font),i=wt(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,s,o;if(Ze(t,this.left,this.right)&&Ze(n,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],Ze(t,s.left,s.left+s.width)&&Ze(n,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const n=this.options;if(!Hd(t.type,n))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=Ld(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 Rd(e,t,n,i,s){const o=zd(i,e,t,n),r=Fd(s,i,t.lineHeight);return{itemWidth:o,itemHeight:r}}function zd(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 Fd(e,t,n){let i=e;return typeof t.text!="string"&&(i=ma(t,n)),i}function ma(e,t){const n=e.text?e.text.length:0;return t*n}function Hd(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var Bd={id:"legend",_element:Ho,start(e,t,n){const i=e.legend=new Ho({ctx:e.ctx,options:n,chart:e});$t.configure(e,i,n),$t.addBox(e,i)},stop(e){$t.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;$t.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),h=wt(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:(h.width+h.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 Je={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(),h=Li(t,c);h<s&&(s=h,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,i=l.y}return{x:n,y:i}}};function Mt(e,t){return t&&(Z(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Ft(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(\`
1741
+ */class wd{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=dl.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 jt=new wd;const gr="transparent",Sd={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=sr(e||gr),s=i.valid&&sr(t||gr);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class kd{constructor(t,n,i,s){const o=n[i];s=Jn([t.to,s,o,t.from]);const r=Jn([t.from,o,s]);this._active=!0,this._fn=t.fn||Sd[t.type||typeof r],this._easing=Sn[t.easing]||Sn.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=Jn([t.to,n,s,t.from]),this._from=Jn([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 Ol{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!B(t))return;const n=Object.keys(Y.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!B(o))return;const r={};for(const a of n)r[a]=o[a];(Q(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,r)})})}_animateOptions(t,n){const i=n.options,s=Md(t,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&Td(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,n){const i=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(n),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,n));continue}const u=n[c];let f=o[c];const p=i.get(c);if(f)if(p&&f.active()){f.update(p,u,a);continue}else f.cancel();if(!p||!p.duration){t[c]=u;continue}o[c]=f=new kd(p,t,c,u),s.push(f)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return jt.add(this._chart,i),!0}}function Td(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 Md(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 mr(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 Ed(e,t,n){if(n===!1)return!1;const i=mr(e,n),s=mr(t,n);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function Od(e){let t,n,i,s;return B(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 Cl(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 br(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],xt(c)&&(o||t===0||le(t)===le(c))&&(t+=c)}return!u&&!i.all?0:t}function Cd(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 Ji(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function Pd(e,t,n){return\`\${e.id}.\${t.id}.\${n.stack||n.type}\`}function Dd(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 Ad(e,t,n){const i=e[t]||(e[t]={});return i[n]||(i[n]={})}function yr(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 xr(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=Pd(o,r,i),f=t.length;let p;for(let g=0;g<f;++g){const x=t[g],{[l]:y,[c]:v}=x,w=x._stacks||(x._stacks={});p=w[c]=Ad(s,u,y),p[a]=v,p._top=yr(p,r,!0,i.type),p._bottom=yr(p,r,!1,i.type);const k=p._visualValues||(p._visualValues={});k[a]=v}}function ts(e,t){const n=e.scales;return Object.keys(n).filter(i=>n[i].axis===t).shift()}function Id(e,t){return Ie(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Ld(e,t,n){return Ie(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function fn(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 es=e=>e==="reset"||e==="none",vr=(e,t)=>t?e:Object.assign({},e),Rd=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Cl(n,!0),values:null};class Pl{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=Ji(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&&fn(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(f,p,g,x)=>f==="x"?p:f==="r"?x:g,o=n.xAxisID=R(i.xAxisID,ts(t,"x")),r=n.yAxisID=R(i.yAxisID,ts(t,"y")),a=n.rAxisID=R(i.rAxisID,ts(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&&er(this._data,this),t._stacked&&fn(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(B(n)){const s=this._cachedMeta;this._data=Cd(n,s)}else if(i!==n){if(i){er(i,this);const s=this._cachedMeta;fn(s),s._parsed=[]}n&&Object.isExtensible(n)&&ff(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=Ji(n.vScale,n),n.stack!==i.stack&&(s=!0,fn(n),n.stack=i.stack),this._resyncElements(t),(s||o!==n._stacked)&&(xr(this,n._parsed),n._stacked=Ji(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:r}=i,a=o.axis;let l=t===0&&n===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,f,p;if(this._parsing===!1)i._parsed=s,i._sorted=!0,p=s;else{Q(s[t])?p=this.parseArrayData(i,s,t,n):B(s[t])?p=this.parseObjectData(i,s,t,n):p=this.parsePrimitiveData(i,s,t,n);const g=()=>f[a]===null||c&&f[a]<c[a];for(u=0;u<n;++u)i._parsed[u+t]=f=p[u],l&&(g()&&(l=!1),c=f);i._sorted=l}r&&xr(this,p)}parsePrimitiveData(t,n,i,s){const{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),u=o===r,f=new Array(s);let p,g,x;for(p=0,g=s;p<g;++p)x=p+i,f[p]={[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,p,g;for(u=0,f=s;u<f;++u)p=u+i,g=n[p],c[u]={x:o.parse(wi(g,a),p),y:r.parse(wi(g,l),p)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,i){const s=this.chart,o=this._cachedMeta,r=n[t.axis],a={keys:Cl(s,!0),values:n._stacks[t.axis]._visualValues};return br(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=br(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=Rd(n,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=Dd(a);let p,g;function x(){g=s[p];const y=g[a.axis];return!xt(g[t.axis])||u>y||f<y}for(p=0;p<r&&!(!x()&&(this.updateRangeFromParsed(c,t,g,l),o));++p);if(o){for(p=r-1;p>=0;--p)if(!x()){this.updateRangeFromParsed(c,t,g,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],xt(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=Od(R(this.options.clip,Ed(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=Ld(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=Id(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&&Si(i);if(a)return vr(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),f=s?[\`\${t}Hover\`,"hover",t,""]:[t,""],p=c.getOptionScopes(this.getDataset(),u),g=Object.keys(Y.elements[t]),x=()=>this.getContext(i,s,n),y=c.resolveNamedOptions(p,g,x,f);return y.$shared&&(y.$shared=l,o[r]=Object.freeze(vr(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),p=u.getOptionScopes(this.getDataset(),f);l=u.createResolver(p,this.getContext(t,i,n))}const c=new Ol(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||es(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){es(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!es(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&&fn(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 Nd extends Pl{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}=mf(n,s,r);this._drawStart=a,this._drawCount=l,bf(n)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,n,i,s){const o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(n,s),p=r.axis,g=a.axis,{spanGaps:x,segment:y}=this.options,v=In(x)?x:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||o||s==="none",k=n+i,O=t.length;let C=n>0&&this.getParsed(n-1);for(let T=0;T<O;++T){const D=t[T],P=w?D:{};if(T<n||T>=k){P.skip=!0;continue}const E=this.getParsed(T),A=V(E[g]),F=P[p]=r.getPixelForValue(E[p],T),L=P[g]=o||A?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,E,l):E[g],T);P.skip=isNaN(F)||isNaN(L)||A,P.stop=T>0&&Math.abs(E[p]-C[p])>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),C=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 _e(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class go{static override(t){Object.assign(go.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return _e()}parse(){return _e()}format(){return _e()}add(){return _e()}diff(){return _e()}startOf(){return _e()}endOf(){return _e()}}var zd={_date:go};function Fd(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?uf:Me;if(i){if(s._sharedOptions){const u=o[0],f=typeof u.getRange=="function"&&u.getRange(t);if(f){const p=c(o,t,n-f),g=c(o,t,n+f);return{lo:p.lo,hi:g.hi}}}}else{const u=c(o,t,n);if(l){const{vScale:f}=s._cachedMeta,{_parsed:p}=e,g=p.slice(0,u.lo+1).reverse().findIndex(y=>!V(y[f.axis]));u.lo-=Math.max(0,g);const x=p.slice(u.hi).findIndex(y=>!V(y[f.axis]));u.hi+=Math.max(0,x)}return u}}return{lo:0,hi:o.length-1}}function Ni(e,t,n,i,s){const o=e.getSortedVisibleDatasetMetas(),r=n[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:u}=o[a],{lo:f,hi:p}=Fd(o[a],t,r,s);for(let g=f;g<=p;++g){const x=u[g];x.skip||i(x,c,g)}}}function Hd(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 ns(e,t,n,i,s){const o=[];return!s&&!e.isPointInArea(t)||Ni(e,n,t,function(a,l,c){!s&&!Ze(a,e.chartArea,0)||a.inRange(t.x,t.y,i)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function Bd(e,t,n,i){let s=[];function o(r,a,l){const{startAngle:c,endAngle:u}=r.getProps(["startAngle","endAngle"],i),{angle:f}=af(r,{x:t.x,y:t.y});hl(f,c,u)&&s.push({element:r,datasetIndex:a,index:l})}return Ni(e,n,t,o),s}function Vd(e,t,n,i,s,o){let r=[];const a=Hd(n);let l=Number.POSITIVE_INFINITY;function c(u,f,p){const g=u.inRange(t.x,t.y,s);if(i&&!g)return;const x=u.getCenterPoint(s);if(!(!!o||e.isPointInArea(x))&&!g)return;const v=a(t,x);v<l?(r=[{element:u,datasetIndex:f,index:p}],l=v):v===l&&r.push({element:u,datasetIndex:f,index:p})}return Ni(e,n,t,c),r}function is(e,t,n,i,s,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!i?Bd(e,t,n,s):Vd(e,t,n,i,s,o)}function _r(e,t,n,i,s){const o=[],r=n==="x"?"inXRange":"inYRange";let a=!1;return Ni(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 Wd={modes:{index(e,t,n,i){const s=It(t,e),o=n.axis||"x",r=n.includeInvisible||!1,a=n.intersect?ns(e,s,o,i,r):is(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?ns(e,s,o,i,r):is(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 ns(e,s,o,i,r)},nearest(e,t,n,i){const s=It(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;return is(e,s,o,n.intersect,i,r)},x(e,t,n,i){const s=It(t,e);return _r(e,s,"x",n.intersect,i)},y(e,t,n,i){const s=It(t,e);return _r(e,s,"y",n.intersect,i)}}};const Dl=["left","top","right","bottom"];function dn(e,t){return e.filter(n=>n.pos===t)}function wr(e,t){return e.filter(n=>Dl.indexOf(n.pos)===-1&&n.box.axis===t)}function pn(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 jd(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 Ud(e){const t={};for(const n of e){const{stack:i,pos:s,stackWeight:o}=n;if(!i||!Dl.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 $d(e,t){const n=Ud(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 Yd(e){const t=jd(e),n=pn(t.filter(c=>c.box.fullSize),!0),i=pn(dn(t,"left"),!0),s=pn(dn(t,"right")),o=pn(dn(t,"top"),!0),r=pn(dn(t,"bottom")),a=wr(t,"x"),l=wr(t,"y");return{fullSize:n,leftAndTop:i.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:dn(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function Sr(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function Al(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 Xd(e,t,n,i){const{pos:s,box:o}=n,r=e.maxPadding;if(!B(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&&Al(r,o.getPadding());const a=Math.max(0,t.outerWidth-Sr(r,e,"left","right")),l=Math.max(0,t.outerHeight-Sr(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 qd(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 Gd(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 vn(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,Gd(a.horizontal,t));const{same:f,other:p}=Xd(t,n,a,i);c|=f&&s.length,u=u||p,l.fullSize||s.push(a)}return c&&vn(s,t,n,i)||u}function ii(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 kr(e,t,n,i){const s=n.padding;let{x:o,y:r}=t;for(const a of e){const l=a.box,c=i[a.stack]||{placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const f=t.w*u,p=c.size||l.height;Si(c.start)&&(r=c.start),l.fullSize?ii(l,s.left,r,n.outerWidth-s.right-s.left,p):ii(l,t.left+c.placed,r,f,p),c.start=r,c.placed+=f,r=l.bottom}else{const f=t.h*u,p=c.size||l.width;Si(c.start)&&(o=c.start),l.fullSize?ii(l,o,s.top,p,n.outerHeight-s.bottom-s.top):ii(l,o,t.top+c.placed,p,f),c.start=o,c.placed+=f,o=l.right}}t.x=o,t.y=r}var te={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=Yd(e.boxes),l=a.vertical,c=a.horizontal;z(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}),p=Object.assign({},s);Al(p,Mt(i));const g=Object.assign({maxPadding:p,w:o,h:r,x:s.left,y:s.top},s),x=$d(l.concat(c),f);vn(a.fullSize,g,f,x),vn(l,g,f,x),vn(c,g,f,x)&&vn(l,g,f,x),qd(g),kr(a.leftAndTop,g,f,x),g.x+=g.w,g.y+=g.h,kr(a.rightAndBottom,g,f,x),e.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},z(a.chartArea,y=>{const v=y.box;Object.assign(v,e.chartArea),v.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class Il{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 Kd extends Il{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const fi="$chartjs",Zd={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Tr=e=>e===null||e==="";function Qd(e,t){const n=e.style,i=e.getAttribute("height"),s=e.getAttribute("width");if(e[fi]={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",Tr(s)){const o=hr(e,"width");o!==void 0&&(e.width=o)}if(Tr(i))if(e.style.height==="")e.height=e.width/(t||2);else{const o=hr(e,"height");o!==void 0&&(e.height=o)}return e}const Ll=ad?{passive:!0}:!1;function Jd(e,t,n){e&&e.addEventListener(t,n,Ll)}function tp(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,Ll)}function ep(e,t){const n=Zd[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 Ei(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function np(e,t,n){const i=e.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Ei(a.addedNodes,i),r=r&&!Ei(a.removedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function ip(e,t,n){const i=e.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Ei(a.removedNodes,i),r=r&&!Ei(a.addedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const Ln=new Map;let Mr=0;function Rl(){const e=window.devicePixelRatio;e!==Mr&&(Mr=e,Ln.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function sp(e,t){Ln.size||window.addEventListener("resize",Rl),Ln.set(e,t)}function op(e){Ln.delete(e),Ln.size||window.removeEventListener("resize",Rl)}function rp(e,t,n){const i=e.canvas,s=i&&po(i);if(!s)return;const o=pl((a,l)=>{const c=s.clientWidth;n(a,l),c<s.clientWidth&&n()},window),r=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||o(c,u)});return r.observe(s),sp(e,o),r}function ss(e,t,n){n&&n.disconnect(),t==="resize"&&op(e)}function ap(e,t,n){const i=e.canvas,s=pl(o=>{e.ctx!==null&&n(ep(o,e))},e);return Jd(i,t,s),s}class lp extends Il{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Qd(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[fi])return!1;const i=n[fi].initial;["height","width"].forEach(o=>{const r=i[o];V(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[fi],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),r={attach:np,detach:ip,resize:rp}[n]||ap;s[n]=r(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:ss,detach:ss,resize:ss}[n]||tp)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return rd(t,n,i,s)}isAttached(t){const n=t&&po(t);return!!(n&&n.isConnected)}}function cp(e){return!fo()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Kd:lp}class en{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 In(this.x)&&In(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 up(e,t){const n=e.options.ticks,i=hp(e),s=Math.min(n.maxTicksLimit||i,i),o=n.major.enabled?dp(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return pp(t,c,o,r/s),c;const u=fp(o,t,s);if(r>0){let f,p;const g=r>1?Math.round((l-a)/(r-1)):null;for(si(t,c,u,V(g)?0:a-g,a),f=0,p=r-1;f<p;f++)si(t,c,u,o[f],o[f+1]);return si(t,c,u,l,V(g)?t.length:l+g),c}return si(t,c,u),c}function hp(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 fp(e,t,n){const i=gp(e),s=t.length/n;if(!i)return Math.max(s,1);const o=ef(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 dp(e){const t=[];let n,i;for(n=0,i=e.length;n<i;n++)e[n].major&&t.push(n);return t}function pp(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 si(e,t,n,i,s){const o=R(i,0),r=Math.min(R(s,e.length),e.length);let a=0,l,c,u;for(n=Math.ceil(n),s&&(l=s-i,n=l/Math.floor(l/n)),u=o;u<0;)a++,u=Math.round(o+a*n);for(c=Math.max(o,0);c<r;c++)c===u&&(t.push(e[c]),a++,u=Math.round(o+a*n))}function gp(e){const t=e.length;let n,i;if(t<2)return!1;for(i=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==i)return!1;return i}const mp=e=>e==="left"?"right":e==="right"?"left":e,Er=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Or=(e,t)=>Math.min(t||e,e);function Cr(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 bp(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 yp(e,t){z(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 gn(e){return e.drawTicks?e.tickLength:0}function Pr(e,t){if(!e.display)return 0;const n=ct(e.font,t),i=Mt(e.padding);return(Q(e.text)?e.text.length:1)*n.lineHeight+i.height}function xp(e,t){return Ie(e,{scale:t,type:"scale"})}function vp(e,t,n){return Ie(e,{tick:n,index:t,type:"tick"})}function _p(e,t,n){let i=gl(e);return(n&&t!=="right"||!n&&t==="right")&&(i=mp(i)),i}function wp(e,t,n,i){const{top:s,left:o,bottom:r,right:a,chart:l}=e,{chartArea:c,scales:u}=l;let f=0,p,g,x;const y=r-s,v=a-o;if(e.isHorizontal()){if(g=ft(i,o,a),B(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=Er(e,n,t);p=a-o}else{if(B(n)){const w=Object.keys(n)[0],k=n[w];g=u[w].getPixelForValue(k)-v+t}else n==="center"?g=(c.left+c.right)/2-v+t:g=Er(e,n,t);x=ft(i,r,s),f=n==="left"?-wt:wt}return{titleX:g,titleY:x,maxWidth:p,rotation:f}}class nn extends en{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:xt(t),maxDefined:xt(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=Ff(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Cr(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=up(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=Or(this.ticks.length,t.ticks.maxTicksLimit),s=n.minRotation||0,o=n.maxRotation;let r=s,a,l,c;if(!this._isVisible()||!n.display||s>=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),f=u.widest.width,p=u.highest.height,g=yt(this.chart.width-f,0,this.maxWidth);a=t.offset?this.maxWidth/i:g/(i-1),f+6>a&&(a=g/(i-(t.offset?.5:1)),l=this.maxHeight-gn(t.grid)-n.padding-Pr(t.title,this.chart.options.font),c=Math.sqrt(f*f+p*p),r=rf(Math.min(Math.asin(yt((u.highest.height+6)/a,-1,1)),Math.asin(yt(l/c,-1,1))-Math.asin(yt(p/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){I(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){I(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=Pr(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=gn(o)+l):(t.height=this.maxHeight,t.width=gn(o)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:f,highest:p}=this._getLabelSizes(),g=i.padding*2,x=Te(this.labelRotation),y=Math.cos(x),v=Math.sin(x);if(a){const w=i.mirror?0:v*f.width+y*p.height;t.height=Math.min(this.maxHeight,t.height+w+g)}else{const w=i.mirror?0:y*f.width+v*p.height;t.width=Math.min(this.maxWidth,t.width+w+g)}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 p=0,g=0;l?c?(p=s*t.width,g=i*n.height):(p=i*t.height,g=s*n.width):o==="start"?g=n.width:o==="end"?p=t.width:o!=="inner"&&(p=t.width/2,g=n.width/2),this.paddingLeft=Math.max((p-u+r)*this.width/(this.width-u),0),this.paddingRight=Math.max((g-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++)V(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=Cr(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/Or(n,i));let c=0,u=0,f,p,g,x,y,v,w,k,O,C,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,O=C=0,!V(x)&&!Q(x))O=rr(s,w.data,w.gc,O,x),C=k;else if(Q(x))for(p=0,g=x.length;p<g;++p)T=x[p],!V(T)&&!Q(T)&&(O=rr(s,w.data,w.gc,O,T),C+=k);r.push(O),a.push(C),c=Math.max(O,c),u=Math.max(C,u)}yp(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 cf(this._alignToPixels?ve(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=vp(this.getContext(),t,i))}return this.$context||(this.$context=xp(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Te(this.labelRotation),i=Math.abs(Math.cos(n)),s=Math.abs(Math.sin(n)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*i>a*s?a/i:l/s:l*s<a*i?l/i:a/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,i=this.chart,s=this.options,{grid:o,position:r,border:a}=s,l=o.offset,c=this.isHorizontal(),f=this.ticks.length+(l?1:0),p=gn(o),g=[],x=a.setContext(this.getContext()),y=x.display?x.width:0,v=y/2,w=function(q){return ve(i,q,y)};let k,O,C,T,D,P,E,A,F,L,H,K;if(r==="top")k=w(this.bottom),P=this.bottom-p,A=k-v,L=w(t.top)+v,K=t.bottom;else if(r==="bottom")k=w(this.top),L=t.top,K=w(t.bottom)-v,P=k+v,A=this.top+p;else if(r==="left")k=w(this.right),D=this.right-p,E=k-v,F=w(t.left)+v,H=t.right;else if(r==="right")k=w(this.left),F=t.left,H=w(t.right)-v,D=k+v,E=this.left+p;else if(n==="x"){if(r==="center")k=w((t.top+t.bottom)/2+.5);else if(B(r)){const q=Object.keys(r)[0],nt=r[q];k=w(this.chart.scales[q].getPixelForValue(nt))}L=t.top,K=t.bottom,P=k+v,A=P+p}else if(n==="y"){if(r==="center")k=w((t.left+t.right)/2);else if(B(r)){const q=Object.keys(r)[0],nt=r[q];k=w(this.chart.scales[q].getPixelForValue(nt))}D=k-v,E=D-p,F=t.left,H=t.right}const et=R(s.ticks.maxTicksLimit,f),j=Math.max(1,Math.ceil(f/et));for(O=0;O<f;O+=j){const q=this.getContext(O),nt=o.setContext(q),Re=a.setContext(q),de=nt.lineWidth,qt=nt.color,Ne=Re.dash||[],dt=Re.dashOffset,pe=nt.tickWidth,vt=nt.tickColor,ge=nt.tickBorderDash||[],Ht=nt.tickBorderDashOffset;C=bp(this,O,l),C!==void 0&&(T=ve(i,C,de),c?D=E=F=H=T:P=A=L=K=T,g.push({tx1:D,ty1:P,tx2:E,ty2:A,x1:F,y1:L,x2:H,y2:K,width:de,color:qt,borderDash:Ne,borderDashOffset:dt,tickWidth:pe,tickColor:vt,tickBorderDash:ge,tickBorderDashOffset:Ht}))}return this._ticksLength=f,this._borderValue=k,g}_computeLabelItems(t){const n=this.axis,i=this.options,{position:s,ticks:o}=i,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:f}=o,p=gn(i.grid),g=p+u,x=f?-u:g,y=-Te(this.labelRotation),v=[];let w,k,O,C,T,D,P,E,A,F,L,H,K="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(p);P=j.textAlign,T=j.x}else if(s==="right"){const j=this._getYAxisLabelAlignment(p);P=j.textAlign,T=j.x}else if(n==="x"){if(s==="center")D=(t.top+t.bottom)/2+g;else if(B(s)){const j=Object.keys(s)[0],q=s[j];D=this.chart.scales[j].getPixelForValue(q)+g}P=this._getXAxisLabelAlignment()}else if(n==="y"){if(s==="center")T=(t.left+t.right)/2-g;else if(B(s)){const j=Object.keys(s)[0],q=s[j];T=this.chart.scales[j].getPixelForValue(q)}P=this._getYAxisLabelAlignment(p).textAlign}n==="y"&&(l==="start"?K="top":l==="end"&&(K="bottom"));const et=this._getLabelSizes();for(w=0,k=a.length;w<k;++w){O=a[w],C=O.label;const j=o.setContext(this.getContext(w));E=this.getPixelForTick(w)+o.labelOffset,A=this._resolveTickFontOptions(w),F=A.lineHeight,L=Q(C)?C.length:1;const q=L/2,nt=j.color,Re=j.textStrokeColor,de=j.textStrokeWidth;let qt=P;r?(T=E,P==="inner"&&(w===k-1?qt=this.options.reverse?"left":"right":w===0?qt=this.options.reverse?"right":"left":qt="center"),s==="top"?c==="near"||y!==0?H=-L*F+F/2:c==="center"?H=-et.highest.height/2-q*F+F:H=-et.highest.height+F/2:c==="near"||y!==0?H=F/2:c==="center"?H=et.highest.height/2-q*F:H=et.highest.height-L*F,f&&(H*=-1),y!==0&&!j.showLabelBackdrop&&(T+=F/2*Math.sin(y))):(D=E,H=(1-L)*F/2);let Ne;if(j.showLabelBackdrop){const dt=Mt(j.backdropPadding),pe=et.heights[w],vt=et.widths[w];let ge=H-dt.top,Ht=0-dt.left;switch(K){case"middle":ge-=pe/2;break;case"bottom":ge-=pe;break}switch(P){case"center":Ht-=vt/2;break;case"right":Ht-=vt;break;case"inner":w===k-1?Ht-=vt:w>0&&(Ht-=vt/2);break}Ne={left:Ht,top:ge,width:vt+dt.width,height:pe+dt.height,color:j.backdropColor}}v.push({label:C,font:A,textOffset:H,options:{rotation:y,color:nt,strokeColor:Re,strokeWidth:de,textAlign:qt,textBaseline:K,translation:[T,D],backdrop:Ne}})}return v}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Te(this.labelRotation))return t==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let c,u;return n==="left"?s?(u=this.right+o,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?s?(u=this.left+o,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:i,top:s,width:o,height:r}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(i,s,o,r),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(n.display)for(o=0,r=s.length;o<r;++o){const l=s[o];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:i,grid:s}}=this,o=i.setContext(this.getContext()),r=i.display?o.width:0;if(!r)return;const a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,f,p;this.isHorizontal()?(c=ve(t,this.left,r)-r/2,u=ve(t,this.right,a)+a/2,f=p=l):(f=ve(t,this.top,r)-r/2,p=ve(t,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(c,f),n.lineTo(u,p),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&ao(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;Ti(i,c,0,u,l,a)}s&&lo(i)}drawTitle(){const{ctx:t,options:{position:n,title:i,reverse:s}}=this;if(!i.display)return;const o=ct(i.font),r=Mt(i.padding),a=i.align;let l=o.lineHeight/2;n==="bottom"||n==="center"||B(n)?(l+=r.bottom,Q(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=r.top;const{titleX:c,titleY:u,maxWidth:f,rotation:p}=wp(this,l,n,a);Ti(t,i.text,0,0,o,{color:i.color,maxWidth:f,rotation:p,textAlign:_p(a,n,s),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,i=R(t.grid&&t.grid.z,-1),s=R(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==nn.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 ct(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class oi{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;Tp(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,Sp(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 De[i])}}function Sp(e,t,n){const i=An(Object.create(null),[n?Y.get(n):{},Y.get(t),e.defaults]);Y.set(t,i),e.defaultRoutes&&kp(t,e.defaultRoutes),e.descriptors&&Y.describe(t,e.descriptors)}function kp(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 Tp(e){return"id"in e&&"defaults"in e}class Mp{constructor(){this.controllers=new oi(Pl,"datasets",!0),this.elements=new oi(en,"elements"),this.plugins=new oi(Object,"plugins"),this.scales=new oi(nn,"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):z(s,r=>{const a=i||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,n,i){const s=so(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 Mp;class Ep{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(){V(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const i=t&&t.config,s=R(i.options&&i.options.plugins,{}),o=Op(i);return s===!1&&!n?[]:Pp(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 Op(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 Cp(e,t){return!t&&e===!1?null:e===!0?{}:e}function Pp(e,{plugins:t,localIds:n},i,s){const o=[],r=e.getContext();for(const a of t){const l=a.id,c=Cp(i[l],s);c!==null&&o.push({plugin:a,options:Dp(e.config,{plugin:a,local:n[l]},c,r)})}return o}function Dp(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 Rs(e,t){const n=Y.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function Ap(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function Ip(e,t){return e===t?"_index_":"_value_"}function Dr(e){if(e==="x"||e==="y"||e==="r")return e}function Lp(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Ns(e,...t){if(Dr(e))return e;for(const n of t){const i=n.axis||Lp(n.position)||e.length>1&&Dr(e[0].toLowerCase());if(i)return i}throw new Error(\`Cannot determine type of '\${e}' axis. Please provide 'axis' or 'position' option.\`)}function Ar(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function Rp(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 Ar(e,"x",n[0])||Ar(e,"y",n[0])}return{}}function Np(e,t){const n=De[e.type]||{scales:{}},i=t.scales||{},s=Rs(e.type,t),o=Object.create(null);return Object.keys(i).forEach(r=>{const a=i[r];if(!B(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=Ns(r,a,Rp(r,e),Y.scales[a.type]),c=Ip(l,s),u=n.scales||{};o[r]=wn(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(r=>{const a=r.type||e.type,l=r.indexAxis||Rs(a,t),u=(De[a]||{}).scales||{};Object.keys(u).forEach(f=>{const p=Ap(f,l),g=r[p+"AxisID"]||p;o[g]=o[g]||Object.create(null),wn(o[g],[{axis:p},i[g],u[f]])})}),Object.keys(o).forEach(r=>{const a=o[r];wn(a,[Y.scales[a.type],Y.scale])}),o}function Nl(e){const t=e.options||(e.options={});t.plugins=R(t.plugins,{}),t.scales=Np(e,t)}function zl(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function zp(e){return e=e||{},e.data=zl(e.data),Nl(e),e}const Ir=new Map,Fl=new Set;function ri(e,t){let n=Ir.get(e);return n||(n=t(),Ir.set(e,n),Fl.add(n)),n}const mn=(e,t,n)=>{const i=wi(t,n);i!==void 0&&e.add(i)};class Fp{constructor(t){this._config=zp(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=zl(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(),Nl(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ri(t,()=>[[\`datasets.\${t}\`,""]])}datasetAnimationScopeKeys(t,n){return ri(\`\${t}.transition.\${n}\`,()=>[[\`datasets.\${t}.transitions.\${n}\`,\`transitions.\${n}\`],[\`datasets.\${t}\`,""]])}datasetElementScopeKeys(t,n){return ri(\`\${t}-\${n}\`,()=>[[\`datasets.\${t}.elements.\${n}\`,\`datasets.\${t}\`,\`elements.\${n}\`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return ri(\`\${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=>mn(l,t,f))),u.forEach(f=>mn(l,s,f)),u.forEach(f=>mn(l,De[o]||{},f)),u.forEach(f=>mn(l,Y,f)),u.forEach(f=>mn(l,As,f))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Fl.has(n)&&r.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,De[n]||{},Y.datasets[n]||{},{type:n},Y,As]}resolveNamedOptions(t,n,i,s=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=Lr(this._resolverCache,t,s);let l=r;if(Bp(r,n)){o.$shared=!1,i=ae(i)?i():i;const c=this.createResolver(t,i,a);l=Qe(r,i,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,i=[""],s){const{resolver:o}=Lr(this._resolverCache,t,i);return B(n)?Qe(o,n,void 0,s):o}}function Lr(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:co(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,o)),o}const Hp=e=>B(e)&&Object.getOwnPropertyNames(e).some(t=>ae(e[t]));function Bp(e,t){const{isScriptable:n,isIndexable:i}=vl(e);for(const s of t){const o=n(s),r=i(s),a=(r||o)&&e[s];if(o&&(ae(a)||Hp(a))||r&&Q(a))return!0}return!1}var Vp="4.5.0";const Wp=["top","bottom","left","right","chartArea"];function Rr(e,t){return e==="top"||e==="bottom"||Wp.indexOf(e)===-1&&t==="x"}function Nr(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function zr(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),I(n&&n.onComplete,[e],t)}function jp(e){const t=e.chart,n=t.options.animation;I(n&&n.onProgress,[e],t)}function Hl(e){return fo()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const di={},Fr=e=>{const t=Hl(e);return Object.values(di).filter(n=>n.canvas===t).pop()};function Up(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 $p(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}class zs{static defaults=Y;static instances=di;static overrides=De;static registry=At;static version=Vp;static getChart=Fr;static register(...t){At.add(...t),Hr()}static unregister(...t){At.remove(...t),Hr()}constructor(t,n){const i=this.config=new Fp(n),s=Hl(t),o=Fr(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||cp(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=Yh(),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 Ep,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=pf(f=>this.update(f),r.resizeDelay||0),this._dataChanges=[],di[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}jt.listen(this,"complete",zr),jt.listen(this,"progress",jp),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:s,_aspectRatio:o}=this;return V(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():ur(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ar(this.canvas,this.ctx),this}stop(){return jt.stop(this),this}resize(t,n){jt.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,ur(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||{};z(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=Ns(r,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),z(o,r=>{const a=r.options,l=a.id,c=Ns(l,a),u=R(a.type,r.dtype);(a.position===void 0||Rr(a.position,c)!==Rr(r.dposition))&&(a.position=r.dposition),s[l]=!0;let f=null;if(l in i&&i[l].type===u)f=i[l];else{const p=At.getScale(u);f=new p({id:l,type:u,ctx:this.ctx,chart:this}),i[f.id]=f}f.init(a,t)}),z(s,(r,a)=>{r||delete i[a]}),z(i,r=>{te.configure(this,r,r.options),te.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(Nr("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||Rs(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(){z(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:f}=this.getDatasetMeta(c),p=!s&&o.indexOf(f)===-1;f.buildOrUpdateElements(p),r=Math.max(+f.getMaxOverflow(),r)}r=this._minPadding=i.layout.autoPadding?r:0,this._updateLayout(r),s||z(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Nr("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){z(this.scales,t=>{te.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Zo(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;Up(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(!Zo(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;te.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],z(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,ae(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&&(jt.has(this)?this.attached&&!jt.running(this)&&jt.start(this):(this.draw(),zr({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,i=[];let s,o;for(s=0,o=n.length;s<o;++s){const r=n[s];(!t||r.visible)&&i.push(r)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i={meta:t,index:t.index,cancelable:!0},s=_d(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&ao(n,s),t.controller.draw(),s&&lo(n),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return Ze(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){const o=Wd.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=Ie(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);Si(n)?(o.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(o,{visible:i}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),jt.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(),ar(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete di[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)};z(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(){z(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},z(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}});!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){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=Qh(t),c=$p(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=!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;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}}function Hr(){return z(zs.instances,e=>e._plugins.invalidate())}function Bl(e,t,n=t){e.lineCap=R(n.borderCapStyle,t.borderCapStyle),e.setLineDash(R(n.borderDash,t.borderDash)),e.lineDashOffset=R(n.borderDashOffset,t.borderDashOffset),e.lineJoin=R(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=R(n.borderWidth,t.borderWidth),e.strokeStyle=R(n.borderColor,t.borderColor)}function Yp(e,t,n){e.lineTo(n.x,n.y)}function Xp(e){return e.stepped?Of:e.tension||e.cubicInterpolationMode==="monotone"?Cf:Yp}function Vl(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 qp(e,t,n,i){const{points:s,options:o}=t,{count:r,start:a,loop:l,ilen:c}=Vl(s,n,i),u=Xp(o);let{move:f=!0,reverse:p}=i||{},g,x,y;for(g=0;g<=c;++g)x=s[(a+(p?c-g:g))%r],!x.skip&&(f?(e.moveTo(x.x,x.y),f=!1):u(e,y,x,p,o.stepped),y=x);return l&&(x=s[(a+(p?c:0))%r],u(e,y,x,p,o.stepped)),!!l}function Gp(e,t,n,i){const s=t.points,{count:o,start:r,ilen:a}=Vl(s,n,i),{move:l=!0,reverse:c}=i||{};let u=0,f=0,p,g,x,y,v,w;const k=C=>(r+(c?a-C:C))%o,O=()=>{y!==v&&(e.lineTo(u,v),e.lineTo(u,y),e.lineTo(u,w))};for(l&&(g=s[k(0)],e.moveTo(g.x,g.y)),p=0;p<=a;++p){if(g=s[k(p)],g.skip)continue;const C=g.x,T=g.y,D=C|0;D===x?(T<y?y=T:T>v&&(v=T),u=(f*u+C)/++f):(O(),e.lineTo(C,T),x=D,f=0,y=v=T),w=T}O()}function Fs(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?Gp:qp}function Kp(e){return e.stepped?ld:e.tension||e.cubicInterpolationMode==="monotone"?cd:we}function Zp(e,t,n,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,i)&&s.closePath()),Bl(e,t.options),e.stroke(s)}function Qp(e,t,n,i){const{segments:s,options:o}=t,r=Fs(t);for(const a of s)Bl(e,o,a.style),e.beginPath(),r(e,t,a,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const Jp=typeof Path2D=="function";function tg(e,t,n,i){Jp&&!t.options.segment?Zp(e,t,n,i):Qp(e,t,n,i)}class eg extends en{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;td(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=bd(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=pd(this,{property:n,start:s,end:s});if(!r.length)return;const a=[],l=Kp(i);let c,u;for(c=0,u=r.length;c<u;++c){const{start:f,end:p}=r[c],g=o[f],x=o[p];if(g===x){a.push(g);continue}const y=Math.abs((s-g[n])/(x[n]-g[n])),v=l(g,x,y,i.stepped);v[n]=t[n],a.push(v)}return a.length===1?a[0]:a}pathSegment(t,n,i){return Fs(this)(t,this,n,i)}path(t,n,i){const s=this.segments,o=Fs(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(),tg(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Br(e,t,n,i){const s=e.options,{[n]:o}=e.getProps([n],i);return Math.abs(t-o)<s.radius+s.hitRadius}class ng extends en{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 Br(this,t,"x",n)}inYRange(t,n){return Br(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||!Ze(this,n,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Is(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}const Vr=(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)}},ig=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Wr extends en{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=ct(i.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Vr(i,o);let c,u;n.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(r,o,a,l)+10):(u=this.maxHeight,c=this._fitCols(r,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,s){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a;let f=t;o.textAlign="left",o.textBaseline="middle";let p=-1,g=-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,g+=u,p++),l[y]={left:0,top:g,row:p,width:v,height:s},c[c.length-1]+=v+a}),f}_fitCols(t,n,i,s){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=r-t;let f=a,p=0,g=0,x=0,y=0;return this.legendItems.forEach((v,w)=>{const{itemWidth:k,itemHeight:O}=sg(i,n,o,v,s);w>0&&g+O+2*a>u&&(f+=p+a,c.push({width:p,height:g}),x+=p+a,y++,p=g=0),l[w]={left:x,top:g,col:y,width:k,height:O},p=Math.max(p,k),g+=O+a}),f+=p,c.push({width:p,height:g}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:o}}=this,r=Ue(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;ao(t,this),this._draw(),lo(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:s}=this,{align:o,labels:r}=t,a=Y.color,l=Ue(t.rtl,this.left,this.width),c=ct(r.font),{padding:u}=r,f=c.size,p=f/2;let g;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:x,boxHeight:y,itemHeight:v}=Vr(r,f),w=function(D,P,E){if(isNaN(x)||x<=0||isNaN(y)||y<0)return;s.save();const A=R(E.lineWidth,1);if(s.fillStyle=R(E.fillStyle,a),s.lineCap=R(E.lineCap,"butt"),s.lineDashOffset=R(E.lineDashOffset,0),s.lineJoin=R(E.lineJoin,"miter"),s.lineWidth=A,s.strokeStyle=R(E.strokeStyle,a),s.setLineDash(R(E.lineDash,[])),r.usePointStyle){const F={radius:y*Math.SQRT2/2,pointStyle:E.pointStyle,rotation:E.rotation,borderWidth:A},L=l.xPlus(D,x/2),H=P+p;yl(s,F,L,H,r.pointStyleWidth&&x)}else{const F=P+Math.max((f-y)/2,0),L=l.leftForLtr(D,x),H=Tn(E.borderRadius);s.beginPath(),Object.values(H).some(K=>K!==0)?Ls(s,{x:L,y:F,w:x,h:y,radius:H}):s.rect(L,F,x,y),s.fill(),A!==0&&s.stroke()}s.restore()},k=function(D,P,E){Ti(s,E.text,D,P+v/2,c,{strikethrough:E.hidden,textAlign:l.textAlign(E.textAlign)})},O=this.isHorizontal(),C=this._computeTitleHeight();O?g={x:ft(o,this.left+u,this.right-i[0]),y:this.top+u+C,line:0}:g={x:this.left+u,y:ft(o,this.top+C+u,this.bottom-n[0].height),line:0},Tl(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)),F=x+p+E;let L=g.x,H=g.y;l.setWidth(this.width),O?P>0&&L+F+u>this.right&&(H=g.y+=T,g.line++,L=g.x=ft(o,this.left+u,this.right-i[g.line])):P>0&&H+T>this.bottom&&(L=g.x=L+n[g.line].width+u,g.line++,H=g.y=ft(o,this.top+C+u,this.bottom-n[g.line].height));const K=l.x(L);if(w(K,H,D),L=gf(A,L+x+p,O?L+F:this.right,t.rtl),k(l.x(L),H,D),O)g.x+=F+u;else if(typeof D.text!="string"){const et=c.lineHeight;g.y+=Wl(D,et)+u}else g.y+=T}),Ml(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=ct(n.font),s=Mt(n.padding);if(!n.display)return;const o=Ue(t.rtl,this.left,this.width),r=this.ctx,a=n.position,l=i.size/2,c=s.top+l;let u,f=this.left,p=this.width;if(this.isHorizontal())p=Math.max(...this.lineWidths),u=this.top+c,f=ft(t.align,f,this.right-p);else{const 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 g=ft(a,f,f+p);r.textAlign=o.textAlign(gl(a)),r.textBaseline="middle",r.strokeStyle=n.color,r.fillStyle=n.color,r.font=i.string,Ti(r,n.text,g,u,i)}_computeTitleHeight(){const t=this.options.title,n=ct(t.font),i=Mt(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,s,o;if(xn(t,this.left,this.right)&&xn(n,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],xn(t,s.left,s.left+s.width)&&xn(n,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const n=this.options;if(!ag(t.type,n))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=ig(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 sg(e,t,n,i,s){const o=og(i,e,t,n),r=rg(s,i,t.lineHeight);return{itemWidth:o,itemHeight:r}}function og(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 rg(e,t,n){let i=e;return typeof t.text!="string"&&(i=Wl(t,n)),i}function Wl(e,t){const n=e.text?e.text.length:0;return t*n}function ag(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var lg={id:"legend",_element:Wr,start(e,t,n){const i=e.legend=new Wr({ctx:e.ctx,options:n,chart:e});te.configure(e,i,n),te.addBox(e,i)},stop(e){te.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;te.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 _n={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=Ds(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&&(Q(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Ut(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(\`
1711
1742
  \`)>-1?e.split(\`
1712
- \`):e}function Wd(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 Bo(e,t){const n=e.chart.ctx,{body:i,footer:s,title:o}=e,{boxWidth:r,boxHeight:a}=t,l=lt(t.bodyFont),c=lt(t.titleFont),h=lt(t.footerFont),d=o.length,g=s.length,p=i.length,y=wt(t.padding);let x=y.height,v=0,w=i.reduce((C,k)=>C+k.before.length+k.lines.length+k.after.length,0);if(w+=e.beforeBody.length+e.afterBody.length,d&&(x+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),w){const C=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;x+=p*C+(w-p)*l.lineHeight+(w-1)*t.bodySpacing}g&&(x+=t.footerMarginTop+g*h.lineHeight+(g-1)*t.footerSpacing);let S=0;const O=function(C){v=Math.max(v,n.measureText(C).width+S)};return n.save(),n.font=c.string,z(e.title,O),n.font=l.string,z(e.beforeBody.concat(e.afterBody),O),S=t.displayColors?r+2+t.boxPadding:0,z(i,C=>{z(C.before,O),z(C.lines,O),z(C.after,O)}),S=0,n.font=h.string,z(e.footer,O),n.restore(),v+=y.width,{width:v,height:x}}function Vd(e,t){const{y:n,height:i}=t;return n<i/2?"top":n>e.height-i/2?"bottom":"center"}function jd(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 Ud(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"),jd(c,e,t,n)&&(c="center"),c}function Wo(e,t,n){const i=n.yAlign||t.yAlign||Vd(e,n);return{xAlign:n.xAlign||t.xAlign||Ud(e,t,n,i),yAlign:i}}function Yd(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function $d(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function Vo(e,t,n,i){const{caretSize:s,caretPadding:o,cornerRadius:r}=e,{xAlign:a,yAlign:l}=n,c=s+o,{topLeft:h,topRight:d,bottomLeft:g,bottomRight:p}=sn(r);let y=Yd(t,a);const x=$d(t,l,c);return l==="center"?a==="left"?y+=c:a==="right"&&(y-=c):a==="left"?y-=Math.max(h,g)+s:a==="right"&&(y+=Math.max(d,p)+s),{x:bt(y,0,i.width-t.width),y:bt(x,0,i.height-t.height)}}function Fn(e,t,n){const i=wt(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function jo(e){return Mt([],Ft(e))}function Xd(e,t,n){return ve(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function Uo(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const ba={beforeTitle:Rt,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:Rt,beforeBody:Rt,beforeLabel:Rt,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 W(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:Rt,afterBody:Rt,beforeFooter:Rt,footer:Rt,afterFooter:Rt};function ot(e,t,n,i){const s=e[t].call(n,i);return typeof s>"u"?ba[t].call(n,i):s}class Yo extends Ne{static positioners=Je;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 na(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Xd(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,s=ot(i,"beforeTitle",this,t),o=ot(i,"title",this,t),r=ot(i,"afterTitle",this,t);let a=[];return a=Mt(a,Ft(s)),a=Mt(a,Ft(o)),a=Mt(a,Ft(r)),a}getBeforeBody(t,n){return jo(ot(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,s=[];return z(t,o=>{const r={before:[],lines:[],after:[]},a=Uo(i,o);Mt(r.before,Ft(ot(a,"beforeLabel",this,o))),Mt(r.lines,ot(a,"label",this,o)),Mt(r.after,Ft(ot(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,n){return jo(ot(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,s=ot(i,"beforeFooter",this,t),o=ot(i,"footer",this,t),r=ot(i,"afterFooter",this,t);let a=[];return a=Mt(a,Ft(s)),a=Mt(a,Ft(o)),a=Mt(a,Ft(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(Wd(this.chart,n[l]));return t.filter&&(a=a.filter((h,d,g)=>t.filter(h,d,g,i))),t.itemSort&&(a=a.sort((h,d)=>t.itemSort(h,d,i))),z(a,h=>{const d=Uo(t.callbacks,h);s.push(ot(d,"labelColor",this,h)),o.push(ot(d,"labelPointStyle",this,h)),r.push(ot(d,"labelTextColor",this,h))}),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=Je[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=Bo(this,i),c=Object.assign({},a,l),h=Wo(this.chart,i,c),d=Vo(i,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.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){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:h,bottomRight:d}=sn(a),{x:g,y:p}=t,{width:y,height:x}=n;let v,w,S,O,C,k;return o==="center"?(C=p+x/2,s==="left"?(v=g,w=v-r,O=C+r,k=C-r):(v=g+y,w=v+r,O=C-r,k=C+r),S=v):(s==="left"?w=g+Math.max(l,h)+r:s==="right"?w=g+y-Math.max(c,d)-r:w=this.caretX,o==="top"?(O=p,C=O-r,v=w-r,S=w+r):(O=p+x,C=O+r,v=w+r,S=w-r),k=O),{x1:v,x2:w,x3:S,y1:O,y2:C,y3:k}}drawTitle(t,n,i){const s=this.title,o=s.length;let r,a,l;if(o){const c=Oe(i.rtl,this.x,this.width);for(t.x=Fn(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",r=lt(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,h=lt(o.bodyFont),d=Fn(this,"left",o),g=s.x(d),p=l<h.lineHeight?(h.lineHeight-l)/2:0,y=n.y+p;if(o.usePointStyle){const x={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},v=s.leftForLtr(g,c)+c/2,w=y+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,zi(t,x,v,w),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,zi(t,x,v,w)}else{t.lineWidth=B(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const x=s.leftForLtr(g,c),v=s.leftForLtr(s.xPlus(g,1),c-2),w=sn(r.borderRadius);Object.values(w).some(S=>S!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Fi(t,{x,y,w:c,h:l,radius:w}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),Fi(t,{x:v,y:y+1,w:c-2,h:l-2,radius:w}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(x,y,c,l),t.strokeRect(x,y,c,l),t.fillStyle=r.backgroundColor,t.fillRect(v,y+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=i,d=lt(i.bodyFont);let g=d.lineHeight,p=0;const y=Oe(i.rtl,this.x,this.width),x=function(M){n.fillText(M,y.x(t.x+p),t.y+g/2),t.y+=g+o},v=y.textAlign(r);let w,S,O,C,k,D,P;for(n.textAlign=r,n.textBaseline="middle",n.font=d.string,t.x=Fn(this,v,i),n.fillStyle=i.bodyColor,z(this.beforeBody,x),p=a&&v!=="right"?r==="center"?c/2+h:c+2+h:0,C=0,D=s.length;C<D;++C){for(w=s[C],S=this.labelTextColors[C],n.fillStyle=S,z(w.before,x),O=w.lines,a&&O.length&&(this._drawColorBox(n,t,C,y,i),g=Math.max(d.lineHeight,l)),k=0,P=O.length;k<P;++k)x(O[k]),g=d.lineHeight;z(w.after,x)}p=0,g=d.lineHeight,z(this.afterBody,x),t.y-=o}drawFooter(t,n,i){const s=this.footer,o=s.length;let r,a;if(o){const l=Oe(i.rtl,this.x,this.width);for(t.x=Fn(this,i.footerAlign,i),t.y+=i.footerMarginTop,n.textAlign=l.textAlign(i.footerAlign),n.textBaseline="middle",r=lt(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:h}=i,{topLeft:d,topRight:g,bottomLeft:p,bottomRight:y}=sn(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-g,l),n.quadraticCurveTo(a+c,l,a+c,l+g),r==="center"&&o==="right"&&this.drawCaret(t,n,i,s),n.lineTo(a+c,l+h-y),n.quadraticCurveTo(a+c,l+h,a+c-y,l+h),r==="bottom"&&this.drawCaret(t,n,i,s),n.lineTo(a+p,l+h),n.quadraticCurveTo(a,l+h,a,l+h-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){const n=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){const r=Je[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=Bo(this,t),l=Object.assign({},r,this._size),c=Wo(n,t,l),h=Vo(t,l,c,n);(s._to!==h.x||o._to!==h.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,h))}}_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=wt(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),Jr(t,n.textDirection),o.y+=r.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),ta(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=!$n(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||!$n(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=Je[o.position].call(this,t,n);return r!==!1&&(i!==r.x||s!==r.y)}}var qd={id:"tooltip",_element:Yo,positioners:Je,afterInit(e,t,n){n&&(e.tooltip=new Yo({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:ba},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 Gd=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function Kd(e,t,n,i){const s=e.indexOf(t);if(s===-1)return Gd(e,t,n,i);const o=e.lastIndexOf(t);return s!==o?n:s}const Zd=(e,t)=>e===null?null:bt(Math.round(e),0,t);function $o(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Qd extends Le{static id="category";static defaults={ticks:{callback:$o}};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(W(t))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:Kd(i,t,L(n,t),this._addedLabels),Zd(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 $o.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 Jd(e,t){const n=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:g}=e,p=o||1,y=h-1,{min:x,max:v}=t,w=!W(r),S=!W(a),O=!W(c),C=(v-x)/(d+1);let k=Gs((v-x)/y/p)*p,D,P,M,A;if(k<1e-14&&!w&&!S)return[{value:x},{value:v}];A=Math.ceil(v/k)-Math.floor(x/k),A>y&&(k=Gs(A*k/y/p)*p),W(l)||(D=Math.pow(10,l),k=Math.ceil(k*D)/D),s==="ticks"?(P=Math.floor(x/k)*k,M=Math.ceil(v/k)*k):(P=x,M=v),w&&S&&o&&Rc((a-r)/o,k/1e3)?(A=Math.round(Math.min((a-r)/k,h)),k=(a-r)/A,P=r,M=a):O?(P=w?r:P,M=S?a:M,A=c-1,k=(M-P)/A):(A=(M-P)/k,pe(A,Math.round(A),k/1e3)?A=Math.round(A):A=Math.ceil(A));const F=Math.max(Ks(k),Ks(P));D=Math.pow(10,W(l)?F:l),P=Math.round(P*D)/D,M=Math.round(M*D)/D;let N=0;for(w&&(g&&P!==r?(n.push({value:r}),P<r&&N++,pe(Math.round((P+N*k)*D)/D,r,Xo(r,C,e))&&N++):P<r&&N++);N<A;++N){const H=Math.round((P+N*k)*D)/D;if(S&&H>a)break;n.push({value:H})}return S&&g&&M!==a?n.length&&pe(n[n.length-1].value,a,Xo(a,C,e))?n[n.length-1].value=a:n.push({value:a}):(!S||M===a)&&n.push({value:M}),n}function Xo(e,t,{horizontal:n,minRotation:i}){const s=de(i),o=(n?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+e).length;return Math.min(t/o,r)}class tf extends Le{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 W(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=Qt(s),c=Qt(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=Jd(s,o);return t.bounds==="ticks"&&zc(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 Ur(t,this.chart.options.locale,this.options.ticks.format)}}class ef extends tf{static id="linear";static defaults={ticks:{callback:Yr.formatters.numeric}};determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=xt(t)?t:0,this.max=xt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=de(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 si={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}},at=Object.keys(si);function qo(e,t){return e-t}function Go(e,t){if(W(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)),xt(r)||(r=typeof i=="string"?n.parse(r,i):n.parse(r)),r===null?null:(s&&(r=s==="week"&&(hn(o)||o===!0)?n.startOf(r,"isoWeek",o):n.startOf(r,s)),+r)}function Ko(e,t,n,i){const s=at.length;for(let o=at.indexOf(e);o<s-1;++o){const r=si[at[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((n-t)/(a*r.size))<=i)return at[o]}return at[s-1]}function nf(e,t,n,i,s){for(let o=at.length-1;o>=at.indexOf(n);o--){const r=at[o];if(si[r].common&&e._adapter.diff(s,i,r)>=t-1)return r}return at[n?at.indexOf(n):0]}function sf(e){for(let t=at.indexOf(e)+1,n=at.length;t<n;++t)if(si[at[t]].common)return at[t]}function Zo(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:i,hi:s}=rs(n,t),o=n[i]>=t?n[i]:n[s];e[o]=!0}}function of(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 Qo(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:of(e,i,s,n)}class Jo extends Le{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 pu._date(t.adapters.date);s.init(n),tn(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:Go(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=xt(s)&&!isNaN(s)?s:+n.startOf(Date.now(),i),o=xt(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=jc(s,o,r);return this._unit=n.unit||(i.autoSkip?Ko(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):nf(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:sf(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),Qo(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=bt(n,0,r),i=bt(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||Ko(o.minUnit,n,i,this._getLabelCapacity(n)),a=L(s.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=hn(l)||l===!0,h={};let d=n,g,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);const y=s.ticks.source==="data"&&this.getDataTimestamps();for(g=d,p=0;g<i;g=+t.add(g,a,r),p++)Zo(h,g,y);return(g===i||s.bounds==="ticks"||p===1)&&Zo(h,g,y),Object.keys(h).sort(qo).map(x=>+x)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){const s=this.options.time.displayFormats,o=this._unit,r=n||s[o];return this._adapter.format(t,r)}_tickFormatFunction(t,n,i,s){const o=this.options,r=o.ticks.callback;if(r)return I(r,[t,n,i],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],d=c&&a[c],g=i[n],p=c&&d&&g&&g.major;return this._adapter.format(t,s||(p?d:h))}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=de(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,Qo(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(Go(this,s[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Yc(t.sort(qo))}}function Hn(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}=fe(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}=fe(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 cg extends Jo{static id="timeseries";static defaults=Jo.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=Hn(n,this.min),this._tableRange=Hn(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,s=[],o=[];let r,a,l,c,h;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)h=s[r+1],l=s[r-1],c=s[r],Math.round((h+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(Hn(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return Hn(this._table,i*this._tableRange+this._minPos,!0)}}function rf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ki={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
1743
+ \`):e}function cg(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 jr(e,t){const n=e.chart.ctx,{body:i,footer:s,title:o}=e,{boxWidth:r,boxHeight:a}=t,l=ct(t.bodyFont),c=ct(t.titleFont),u=ct(t.footerFont),f=o.length,p=s.length,g=i.length,x=Mt(t.padding);let y=x.height,v=0,w=i.reduce((C,T)=>C+T.before.length+T.lines.length+T.after.length,0);if(w+=e.beforeBody.length+e.afterBody.length,f&&(y+=f*c.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),w){const C=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;y+=g*C+(w-g)*l.lineHeight+(w-1)*t.bodySpacing}p&&(y+=t.footerMarginTop+p*u.lineHeight+(p-1)*t.footerSpacing);let k=0;const O=function(C){v=Math.max(v,n.measureText(C).width+k)};return n.save(),n.font=c.string,z(e.title,O),n.font=l.string,z(e.beforeBody.concat(e.afterBody),O),k=t.displayColors?r+2+t.boxPadding:0,z(i,C=>{z(C.before,O),z(C.lines,O),z(C.after,O)}),k=0,n.font=u.string,z(e.footer,O),n.restore(),v+=x.width,{width:v,height:y}}function ug(e,t){const{y:n,height:i}=t;return n<i/2?"top":n>e.height-i/2?"bottom":"center"}function hg(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 fg(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"),hg(c,e,t,n)&&(c="center"),c}function Ur(e,t,n){const i=n.yAlign||t.yAlign||ug(e,n);return{xAlign:n.xAlign||t.xAlign||fg(e,t,n,i),yAlign:i}}function dg(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function pg(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function $r(e,t,n,i){const{caretSize:s,caretPadding:o,cornerRadius:r}=e,{xAlign:a,yAlign:l}=n,c=s+o,{topLeft:u,topRight:f,bottomLeft:p,bottomRight:g}=Tn(r);let x=dg(t,a);const y=pg(t,l,c);return l==="center"?a==="left"?x+=c:a==="right"&&(x-=c):a==="left"?x-=Math.max(u,p)+s:a==="right"&&(x+=Math.max(f,g)+s),{x:yt(x,0,i.width-t.width),y:yt(y,0,i.height-t.height)}}function ai(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 Yr(e){return Dt([],Ut(e))}function gg(e,t,n){return Ie(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function Xr(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const jl={beforeTitle:Wt,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:Wt,beforeBody:Wt,beforeLabel:Wt,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 V(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:Wt,afterBody:Wt,beforeFooter:Wt,footer:Wt,afterFooter:Wt};function rt(e,t,n,i){const s=e[t].call(n,i);return typeof s>"u"?jl[t].call(n,i):s}class qr extends en{static positioners=_n;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 Ol(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=gg(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,s=rt(i,"beforeTitle",this,t),o=rt(i,"title",this,t),r=rt(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 Yr(rt(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,s=[];return z(t,o=>{const r={before:[],lines:[],after:[]},a=Xr(i,o);Dt(r.before,Ut(rt(a,"beforeLabel",this,o))),Dt(r.lines,rt(a,"label",this,o)),Dt(r.after,Ut(rt(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,n){return Yr(rt(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,s=rt(i,"beforeFooter",this,t),o=rt(i,"footer",this,t),r=rt(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(cg(this.chart,n[l]));return t.filter&&(a=a.filter((u,f,p)=>t.filter(u,f,p,i))),t.itemSort&&(a=a.sort((u,f)=>t.itemSort(u,f,i))),z(a,u=>{const f=Xr(t.callbacks,u);s.push(rt(f,"labelColor",this,u)),o.push(rt(f,"labelPointStyle",this,u)),r.push(rt(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=_n[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=jr(this,i),c=Object.assign({},a,l),u=Ur(this.chart,i,c),f=$r(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}=Tn(a),{x:p,y:g}=t,{width:x,height:y}=n;let v,w,k,O,C,T;return o==="center"?(C=g+y/2,s==="left"?(v=p,w=v-r,O=C+r,T=C-r):(v=p+x,w=v+r,O=C-r,T=C+r),k=v):(s==="left"?w=p+Math.max(l,u)+r:s==="right"?w=p+x-Math.max(c,f)-r:w=this.caretX,o==="top"?(O=g,C=O-r,v=w-r,k=w+r):(O=g+y,C=O+r,v=w+r,k=w-r),T=O),{x1:v,x2:w,x3:k,y1:O,y2:C,y3:T}}drawTitle(t,n,i){const s=this.title,o=s.length;let r,a,l;if(o){const c=Ue(i.rtl,this.x,this.width);for(t.x=ai(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",r=ct(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=ct(o.bodyFont),f=ai(this,"left",o),p=s.x(f),g=l<u.lineHeight?(u.lineHeight-l)/2:0,x=n.y+g;if(o.usePointStyle){const y={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},v=s.leftForLtr(p,c)+c/2,w=x+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Is(t,y,v,w),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,Is(t,y,v,w)}else{t.lineWidth=B(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(p,c),v=s.leftForLtr(s.xPlus(p,1),c-2),w=Tn(r.borderRadius);Object.values(w).some(k=>k!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Ls(t,{x:y,y:x,w:c,h:l,radius:w}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),Ls(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=ct(i.bodyFont);let p=f.lineHeight,g=0;const x=Ue(i.rtl,this.x,this.width),y=function(E){n.fillText(E,x.x(t.x+g),t.y+p/2),t.y+=p+o},v=x.textAlign(r);let w,k,O,C,T,D,P;for(n.textAlign=r,n.textBaseline="middle",n.font=f.string,t.x=ai(this,v,i),n.fillStyle=i.bodyColor,z(this.beforeBody,y),g=a&&v!=="right"?r==="center"?c/2+u:c+2+u:0,C=0,D=s.length;C<D;++C){for(w=s[C],k=this.labelTextColors[C],n.fillStyle=k,z(w.before,y),O=w.lines,a&&O.length&&(this._drawColorBox(n,t,C,x,i),p=Math.max(f.lineHeight,l)),T=0,P=O.length;T<P;++T)y(O[T]),p=f.lineHeight;z(w.after,y)}g=0,p=f.lineHeight,z(this.afterBody,y),t.y-=o}drawFooter(t,n,i){const s=this.footer,o=s.length;let r,a;if(o){const l=Ue(i.rtl,this.x,this.width);for(t.x=ai(this,i.footerAlign,i),t.y+=i.footerMarginTop,n.textAlign=l.textAlign(i.footerAlign),n.textBaseline="middle",r=ct(i.footerFont),n.fillStyle=i.footerColor,n.font=r.string,a=0;a<o;++a)n.fillText(s[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+i.footerSpacing}}drawBackground(t,n,i,s){const{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:u}=i,{topLeft:f,topRight:p,bottomLeft:g,bottomRight:x}=Tn(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(a+f,l),r==="top"&&this.drawCaret(t,n,i,s),n.lineTo(a+c-p,l),n.quadraticCurveTo(a+c,l,a+c,l+p),r==="center"&&o==="right"&&this.drawCaret(t,n,i,s),n.lineTo(a+c,l+u-x),n.quadraticCurveTo(a+c,l+u,a+c-x,l+u),r==="bottom"&&this.drawCaret(t,n,i,s),n.lineTo(a+g,l+u),n.quadraticCurveTo(a,l+u,a,l+u-g),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=_n[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=jr(this,t),l=Object.assign({},r,this._size),c=Ur(n,t,l),u=$r(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),Tl(t,n.textDirection),o.y+=r.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),Ml(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=!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;const 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){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=_n[o.position].call(this,t,n);return r!==!1&&(i!==r.x||s!==r.y)}}var mg={id:"tooltip",_element:qr,positioners:_n,afterInit(e,t,n){n&&(e.tooltip=new qr({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:jl},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 bg=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function yg(e,t,n,i){const s=e.indexOf(t);if(s===-1)return bg(e,t,n,i);const o=e.lastIndexOf(t);return s!==o?n:s}const xg=(e,t)=>e===null?null:yt(Math.round(e),0,t);function Gr(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class vg extends nn{static id="category";static defaults={ticks:{callback:Gr}};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(V(t))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:yg(i,t,R(n,t),this._addedLabels),xg(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 Gr.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 _g(e,t){const n=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:u,maxDigits:f,includeBounds:p}=e,g=o||1,x=u-1,{min:y,max:v}=t,w=!V(r),k=!V(a),O=!V(c),C=(v-y)/(f+1);let T=Jo((v-y)/x/g)*g,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=Jo(A*T/x/g)*g),V(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&&sf((a-r)/o,T/1e3)?(A=Math.round(Math.min((a-r)/T,u)),T=(a-r)/A,P=r,E=a):O?(P=w?r:P,E=k?a:E,A=c-1,T=(E-P)/A):(A=(E-P)/T,Oe(A,Math.round(A),T/1e3)?A=Math.round(A):A=Math.ceil(A));const F=Math.max(tr(T),tr(P));D=Math.pow(10,V(l)?F:l),P=Math.round(P*D)/D,E=Math.round(E*D)/D;let L=0;for(w&&(p&&P!==r?(n.push({value:r}),P<r&&L++,Oe(Math.round((P+L*T)*D)/D,r,Kr(r,C,e))&&L++):P<r&&L++);L<A;++L){const H=Math.round((P+L*T)*D)/D;if(k&&H>a)break;n.push({value:H})}return k&&p&&E!==a?n.length&&Oe(n[n.length-1].value,a,Kr(a,C,e))?n[n.length-1].value=a:n.push({value:a}):(!k||E===a)&&n.push({value:E}),n}function Kr(e,t,{horizontal:n,minRotation:i}){const s=Te(i),o=(n?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+e).length;return Math.min(t/o,r)}class wg extends nn{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 V(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=le(s),c=le(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=_g(s,o);return t.bounds==="ticks"&&of(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 ml(t,this.chart.options.locale,this.options.ticks.format)}}class Sg extends wg{static id="linear";static defaults={ticks:{callback:bl.formatters.numeric}};determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=xt(t)?t:0,this.max=xt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=Te(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 zi={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}},lt=Object.keys(zi);function Zr(e,t){return e-t}function Qr(e,t){if(V(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)),xt(r)||(r=typeof i=="string"?n.parse(r,i):n.parse(r)),r===null?null:(s&&(r=s==="week"&&(In(o)||o===!0)?n.startOf(r,"isoWeek",o):n.startOf(r,s)),+r)}function Jr(e,t,n,i){const s=lt.length;for(let o=lt.indexOf(e);o<s-1;++o){const r=zi[lt[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((n-t)/(a*r.size))<=i)return lt[o]}return lt[s-1]}function kg(e,t,n,i,s){for(let o=lt.length-1;o>=lt.indexOf(n);o--){const r=lt[o];if(zi[r].common&&e._adapter.diff(s,i,r)>=t-1)return r}return lt[n?lt.indexOf(n):0]}function Tg(e){for(let t=lt.indexOf(e)+1,n=lt.length;t<n;++t)if(zi[lt[t]].common)return lt[t]}function ta(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:i,hi:s}=oo(n,t),o=n[i]>=t?n[i]:n[s];e[o]=!0}}function Mg(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 ea(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:Mg(e,i,s,n)}class na extends nn{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 zd._date(t.adapters.date);s.init(n),wn(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:Qr(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=xt(s)&&!isNaN(s)?s:+n.startOf(Date.now(),i),o=xt(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=hf(s,o,r);return this._unit=n.unit||(i.autoSkip?Jr(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):kg(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:Tg(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),ea(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||Jr(o.minUnit,n,i,this._getLabelCapacity(n)),a=R(s.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=In(l)||l===!0,u={};let f=n,p,g;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(p=f,g=0;p<i;p=+t.add(p,a,r),g++)ta(u,p,x);return(p===i||s.bounds==="ticks"||g===1)&&ta(u,p,x),Object.keys(u).sort(Zr).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],p=i[n],g=c&&f&&p&&p.major;return this._adapter.format(t,s||(g?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=Te(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,ea(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(Qr(this,s[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return df(t.sort(Zr))}}function li(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}=Me(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}=Me(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 Cm extends na{static id="timeseries";static defaults=na.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=li(n,this.min),this._tableRange=li(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(li(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return li(this._table,i*this._tableRange+this._minPos,!0)}}function Eg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var os={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
1713
1744
  * http://hammerjs.github.io/
1714
1745
  *
1715
1746
  * Copyright (c) 2016 Jorik Tangelder;
1716
- * Licensed under the MIT license */var tr;function af(){return tr||(tr=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,h=Date.now;function d(u,f,b){return setTimeout(O(u,b),f)}function g(u,f,b){return Array.isArray(u)?(p(u,b[f],b),!0):!1}function p(u,f,b){var _;if(u)if(u.forEach)u.forEach(f,b);else if(u.length!==s)for(_=0;_<u.length;)f.call(b,u[_],_,u),_++;else for(_ in u)u.hasOwnProperty(_)&&f.call(b,u[_],_,u)}function y(u,f,b){var _="DEPRECATED METHOD: "+f+\`
1747
+ * Licensed under the MIT license */var ia;function Og(){return ia||(ia=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,d,b){return setTimeout(O(h,b),d)}function p(h,d,b){return Array.isArray(h)?(g(h,b[d],b),!0):!1}function g(h,d,b){var _;if(h)if(h.forEach)h.forEach(d,b);else if(h.length!==s)for(_=0;_<h.length;)d.call(b,h[_],_,h),_++;else for(_ in h)h.hasOwnProperty(_)&&d.call(b,h[_],_,h)}function x(h,d,b){var _="DEPRECATED METHOD: "+d+\`
1717
1748
  \`+b+\` AT
1718
- \`;return function(){var E=new Error("get-stack-trace"),T=E&&E.stack?E.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,_,T),u.apply(this,arguments)}}var x;typeof Object.assign!="function"?x=function(f){if(f===s||f===null)throw new TypeError("Cannot convert undefined or null to object");for(var b=Object(f),_=1;_<arguments.length;_++){var E=arguments[_];if(E!==s&&E!==null)for(var T in E)E.hasOwnProperty(T)&&(b[T]=E[T])}return b}:x=Object.assign;var v=y(function(f,b,_){for(var E=Object.keys(b),T=0;T<E.length;)(!_||_&&f[E[T]]===s)&&(f[E[T]]=b[E[T]]),T++;return f},"extend","Use \`assign\`."),w=y(function(f,b){return v(f,b,!0)},"merge","Use \`assign\`.");function S(u,f,b){var _=f.prototype,E;E=u.prototype=Object.create(_),E.constructor=u,E._super=_,b&&x(E,b)}function O(u,f){return function(){return u.apply(f,arguments)}}function C(u,f){return typeof u==a?u.apply(f&&f[0]||s,f):u}function k(u,f){return u===s?f:u}function D(u,f,b){p(F(f),function(_){u.addEventListener(_,b,!1)})}function P(u,f,b){p(F(f),function(_){u.removeEventListener(_,b,!1)})}function M(u,f){for(;u;){if(u==f)return!0;u=u.parentNode}return!1}function A(u,f){return u.indexOf(f)>-1}function F(u){return u.trim().split(/\\s+/g)}function N(u,f,b){if(u.indexOf&&!b)return u.indexOf(f);for(var _=0;_<u.length;){if(b&&u[_][b]==f||!b&&u[_]===f)return _;_++}return-1}function H(u){return Array.prototype.slice.call(u,0)}function G(u,f,b){for(var _=[],E=[],T=0;T<u.length;){var R=u[T][f];N(E,R)<0&&_.push(u[T]),E[T]=R,T++}return _=_.sort(function(K,it){return K[f]>it[f]}),_}function tt(u,f){for(var b,_,E=f[0].toUpperCase()+f.slice(1),T=0;T<o.length;){if(b=o[T],_=b?b+E:f,_ in u)return _;T++}return s}var V=1;function X(){return V++}function et(u){var f=u.ownerDocument||u;return f.defaultView||f.parentWindow||t}var we=/mobile|tablet|ip(ad|hone|od)|android/i,ee="ontouchstart"in t,Bt=tt(t,"PointerEvent")!==s,Ee=ee&&we.test(navigator.userAgent),dt="touch",ne="pen",yt="mouse",ie="kinect",It=25,nt=1,se=2,$=4,st=8,gn=1,ze=2,Fe=4,He=8,Be=16,Et=ze|Fe,oe=He|Be,xs=Et|oe,ys=["x","y"],pn=["clientX","clientY"];function ft(u,f){var b=this;this.manager=u,this.callback=f,this.element=u.element,this.target=u.options.inputTarget,this.domHandler=function(_){C(u.options.enable,[u])&&b.handler(_)},this.init()}ft.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(et(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(et(this.element),this.evWin,this.domHandler)}};function Aa(u){var f,b=u.options.inputClass;return b?f=b:Bt?f=ri:Ee?f=xn:ee?f=ai:f=bn,new f(u,Ia)}function Ia(u,f,b){var _=b.pointers.length,E=b.changedPointers.length,T=f&nt&&_-E===0,R=f&($|st)&&_-E===0;b.isFirst=!!T,b.isFinal=!!R,T&&(u.session={}),b.eventType=f,Na(u,b),u.emit("hammer.input",b),u.recognize(b),u.session.prevInput=b}function Na(u,f){var b=u.session,_=f.pointers,E=_.length;b.firstInput||(b.firstInput=vs(f)),E>1&&!b.firstMultiple?b.firstMultiple=vs(f):E===1&&(b.firstMultiple=!1);var T=b.firstInput,R=b.firstMultiple,q=R?R.center:T.center,K=f.center=_s(_);f.timeStamp=h(),f.deltaTime=f.timeStamp-T.timeStamp,f.angle=oi(q,K),f.distance=mn(q,K),La(b,f),f.offsetDirection=Es(f.deltaX,f.deltaY);var it=ws(f.deltaTime,f.deltaX,f.deltaY);f.overallVelocityX=it.x,f.overallVelocityY=it.y,f.overallVelocity=c(it.x)>c(it.y)?it.x:it.y,f.scale=R?Fa(R.pointers,_):1,f.rotation=R?za(R.pointers,_):0,f.maxPointers=b.prevInput?f.pointers.length>b.prevInput.maxPointers?f.pointers.length:b.prevInput.maxPointers:f.pointers.length,Ra(b,f);var kt=u.element;M(f.srcEvent.target,kt)&&(kt=f.srcEvent.target),f.target=kt}function La(u,f){var b=f.center,_=u.offsetDelta||{},E=u.prevDelta||{},T=u.prevInput||{};(f.eventType===nt||T.eventType===$)&&(E=u.prevDelta={x:T.deltaX||0,y:T.deltaY||0},_=u.offsetDelta={x:b.x,y:b.y}),f.deltaX=E.x+(b.x-_.x),f.deltaY=E.y+(b.y-_.y)}function Ra(u,f){var b=u.lastInterval||f,_=f.timeStamp-b.timeStamp,E,T,R,q;if(f.eventType!=st&&(_>It||b.velocity===s)){var K=f.deltaX-b.deltaX,it=f.deltaY-b.deltaY,kt=ws(_,K,it);T=kt.x,R=kt.y,E=c(kt.x)>c(kt.y)?kt.x:kt.y,q=Es(K,it),u.lastInterval=f}else E=b.velocity,T=b.velocityX,R=b.velocityY,q=b.direction;f.velocity=E,f.velocityX=T,f.velocityY=R,f.direction=q}function vs(u){for(var f=[],b=0;b<u.pointers.length;)f[b]={clientX:l(u.pointers[b].clientX),clientY:l(u.pointers[b].clientY)},b++;return{timeStamp:h(),pointers:f,center:_s(f),deltaX:u.deltaX,deltaY:u.deltaY}}function _s(u){var f=u.length;if(f===1)return{x:l(u[0].clientX),y:l(u[0].clientY)};for(var b=0,_=0,E=0;E<f;)b+=u[E].clientX,_+=u[E].clientY,E++;return{x:l(b/f),y:l(_/f)}}function ws(u,f,b){return{x:f/u||0,y:b/u||0}}function Es(u,f){return u===f?gn:c(u)>=c(f)?u<0?ze:Fe:f<0?He:Be}function mn(u,f,b){b||(b=ys);var _=f[b[0]]-u[b[0]],E=f[b[1]]-u[b[1]];return Math.sqrt(_*_+E*E)}function oi(u,f,b){b||(b=ys);var _=f[b[0]]-u[b[0]],E=f[b[1]]-u[b[1]];return Math.atan2(E,_)*180/Math.PI}function za(u,f){return oi(f[1],f[0],pn)+oi(u[1],u[0],pn)}function Fa(u,f){return mn(f[0],f[1],pn)/mn(u[0],u[1],pn)}var Ha={mousedown:nt,mousemove:se,mouseup:$},Ba="mousedown",Wa="mousemove mouseup";function bn(){this.evEl=Ba,this.evWin=Wa,this.pressed=!1,ft.apply(this,arguments)}S(bn,ft,{handler:function(f){var b=Ha[f.type];b&nt&&f.button===0&&(this.pressed=!0),b&se&&f.which!==1&&(b=$),this.pressed&&(b&$&&(this.pressed=!1),this.callback(this.manager,b,{pointers:[f],changedPointers:[f],pointerType:yt,srcEvent:f}))}});var Va={pointerdown:nt,pointermove:se,pointerup:$,pointercancel:st,pointerout:st},ja={2:dt,3:ne,4:yt,5:ie},Ss="pointerdown",ks="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(Ss="MSPointerDown",ks="MSPointerMove MSPointerUp MSPointerCancel");function ri(){this.evEl=Ss,this.evWin=ks,ft.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}S(ri,ft,{handler:function(f){var b=this.store,_=!1,E=f.type.toLowerCase().replace("ms",""),T=Va[E],R=ja[f.pointerType]||f.pointerType,q=R==dt,K=N(b,f.pointerId,"pointerId");T&nt&&(f.button===0||q)?K<0&&(b.push(f),K=b.length-1):T&($|st)&&(_=!0),!(K<0)&&(b[K]=f,this.callback(this.manager,T,{pointers:b,changedPointers:[f],pointerType:R,srcEvent:f}),_&&b.splice(K,1))}});var Ua={touchstart:nt,touchmove:se,touchend:$,touchcancel:st},Ya="touchstart",$a="touchstart touchmove touchend touchcancel";function Ts(){this.evTarget=Ya,this.evWin=$a,this.started=!1,ft.apply(this,arguments)}S(Ts,ft,{handler:function(f){var b=Ua[f.type];if(b===nt&&(this.started=!0),!!this.started){var _=Xa.call(this,f,b);b&($|st)&&_[0].length-_[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:_[0],changedPointers:_[1],pointerType:dt,srcEvent:f})}}});function Xa(u,f){var b=H(u.touches),_=H(u.changedTouches);return f&($|st)&&(b=G(b.concat(_),"identifier")),[b,_]}var qa={touchstart:nt,touchmove:se,touchend:$,touchcancel:st},Ga="touchstart touchmove touchend touchcancel";function xn(){this.evTarget=Ga,this.targetIds={},ft.apply(this,arguments)}S(xn,ft,{handler:function(f){var b=qa[f.type],_=Ka.call(this,f,b);_&&this.callback(this.manager,b,{pointers:_[0],changedPointers:_[1],pointerType:dt,srcEvent:f})}});function Ka(u,f){var b=H(u.touches),_=this.targetIds;if(f&(nt|se)&&b.length===1)return _[b[0].identifier]=!0,[b,b];var E,T,R=H(u.changedTouches),q=[],K=this.target;if(T=b.filter(function(it){return M(it.target,K)}),f===nt)for(E=0;E<T.length;)_[T[E].identifier]=!0,E++;for(E=0;E<R.length;)_[R[E].identifier]&&q.push(R[E]),f&($|st)&&delete _[R[E].identifier],E++;if(q.length)return[G(T.concat(q),"identifier"),q]}var Za=2500,Ms=25;function ai(){ft.apply(this,arguments);var u=O(this.handler,this);this.touch=new xn(this.manager,u),this.mouse=new bn(this.manager,u),this.primaryTouch=null,this.lastTouches=[]}S(ai,ft,{handler:function(f,b,_){var E=_.pointerType==dt,T=_.pointerType==yt;if(!(T&&_.sourceCapabilities&&_.sourceCapabilities.firesTouchEvents)){if(E)Qa.call(this,b,_);else if(T&&Ja.call(this,_))return;this.callback(f,b,_)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Qa(u,f){u&nt?(this.primaryTouch=f.changedPointers[0].identifier,Os.call(this,f)):u&($|st)&&Os.call(this,f)}function Os(u){var f=u.changedPointers[0];if(f.identifier===this.primaryTouch){var b={x:f.clientX,y:f.clientY};this.lastTouches.push(b);var _=this.lastTouches,E=function(){var T=_.indexOf(b);T>-1&&_.splice(T,1)};setTimeout(E,Za)}}function Ja(u){for(var f=u.srcEvent.clientX,b=u.srcEvent.clientY,_=0;_<this.lastTouches.length;_++){var E=this.lastTouches[_],T=Math.abs(f-E.x),R=Math.abs(b-E.y);if(T<=Ms&&R<=Ms)return!0}return!1}var Cs=tt(r.style,"touchAction"),Ps=Cs!==s,Ds="compute",As="auto",li="manipulation",re="none",We="pan-x",Ve="pan-y",yn=el();function ci(u,f){this.manager=u,this.set(f)}ci.prototype={set:function(u){u==Ds&&(u=this.compute()),Ps&&this.manager.element.style&&yn[u]&&(this.manager.element.style[Cs]=u),this.actions=u.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var u=[];return p(this.manager.recognizers,function(f){C(f.options.enable,[f])&&(u=u.concat(f.getTouchAction()))}),tl(u.join(" "))},preventDefaults:function(u){var f=u.srcEvent,b=u.offsetDirection;if(this.manager.session.prevented){f.preventDefault();return}var _=this.actions,E=A(_,re)&&!yn[re],T=A(_,Ve)&&!yn[Ve],R=A(_,We)&&!yn[We];if(E){var q=u.pointers.length===1,K=u.distance<2,it=u.deltaTime<250;if(q&&K&&it)return}if(!(R&&T)&&(E||T&&b&Et||R&&b&oe))return this.preventSrc(f)},preventSrc:function(u){this.manager.session.prevented=!0,u.preventDefault()}};function tl(u){if(A(u,re))return re;var f=A(u,We),b=A(u,Ve);return f&&b?re:f||b?f?We:Ve:A(u,li)?li:As}function el(){if(!Ps)return!1;var u={},f=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(b){u[b]=f?t.CSS.supports("touch-action",b):!0}),u}var vn=1,gt=2,Se=4,Wt=8,Nt=Wt,je=16,St=32;function Lt(u){this.options=x({},this.defaults,u||{}),this.id=X(),this.manager=null,this.options.enable=k(this.options.enable,!0),this.state=vn,this.simultaneous={},this.requireFail=[]}Lt.prototype={defaults:{},set:function(u){return x(this.options,u),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(u){if(g(u,"recognizeWith",this))return this;var f=this.simultaneous;return u=_n(u,this),f[u.id]||(f[u.id]=u,u.recognizeWith(this)),this},dropRecognizeWith:function(u){return g(u,"dropRecognizeWith",this)?this:(u=_n(u,this),delete this.simultaneous[u.id],this)},requireFailure:function(u){if(g(u,"requireFailure",this))return this;var f=this.requireFail;return u=_n(u,this),N(f,u)===-1&&(f.push(u),u.requireFailure(this)),this},dropRequireFailure:function(u){if(g(u,"dropRequireFailure",this))return this;u=_n(u,this);var f=N(this.requireFail,u);return f>-1&&this.requireFail.splice(f,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(u){return!!this.simultaneous[u.id]},emit:function(u){var f=this,b=this.state;function _(E){f.manager.emit(E,u)}b<Wt&&_(f.options.event+Is(b)),_(f.options.event),u.additionalEvent&&_(u.additionalEvent),b>=Wt&&_(f.options.event+Is(b))},tryEmit:function(u){if(this.canEmit())return this.emit(u);this.state=St},canEmit:function(){for(var u=0;u<this.requireFail.length;){if(!(this.requireFail[u].state&(St|vn)))return!1;u++}return!0},recognize:function(u){var f=x({},u);if(!C(this.options.enable,[this,f])){this.reset(),this.state=St;return}this.state&(Nt|je|St)&&(this.state=vn),this.state=this.process(f),this.state&(gt|Se|Wt|je)&&this.tryEmit(f)},process:function(u){},getTouchAction:function(){},reset:function(){}};function Is(u){return u&je?"cancel":u&Wt?"end":u&Se?"move":u&gt?"start":""}function Ns(u){return u==Be?"down":u==He?"up":u==ze?"left":u==Fe?"right":""}function _n(u,f){var b=f.manager;return b?b.get(u):u}function vt(){Lt.apply(this,arguments)}S(vt,Lt,{defaults:{pointers:1},attrTest:function(u){var f=this.options.pointers;return f===0||u.pointers.length===f},process:function(u){var f=this.state,b=u.eventType,_=f&(gt|Se),E=this.attrTest(u);return _&&(b&st||!E)?f|je:_||E?b&$?f|Wt:f&gt?f|Se:gt:St}});function wn(){vt.apply(this,arguments),this.pX=null,this.pY=null}S(wn,vt,{defaults:{event:"pan",threshold:10,pointers:1,direction:xs},getTouchAction:function(){var u=this.options.direction,f=[];return u&Et&&f.push(Ve),u&oe&&f.push(We),f},directionTest:function(u){var f=this.options,b=!0,_=u.distance,E=u.direction,T=u.deltaX,R=u.deltaY;return E&f.direction||(f.direction&Et?(E=T===0?gn:T<0?ze:Fe,b=T!=this.pX,_=Math.abs(u.deltaX)):(E=R===0?gn:R<0?He:Be,b=R!=this.pY,_=Math.abs(u.deltaY))),u.direction=E,b&&_>f.threshold&&E&f.direction},attrTest:function(u){return vt.prototype.attrTest.call(this,u)&&(this.state&gt||!(this.state&gt)&&this.directionTest(u))},emit:function(u){this.pX=u.deltaX,this.pY=u.deltaY;var f=Ns(u.direction);f&&(u.additionalEvent=this.options.event+f),this._super.emit.call(this,u)}});function hi(){vt.apply(this,arguments)}S(hi,vt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[re]},attrTest:function(u){return this._super.attrTest.call(this,u)&&(Math.abs(u.scale-1)>this.options.threshold||this.state&gt)},emit:function(u){if(u.scale!==1){var f=u.scale<1?"in":"out";u.additionalEvent=this.options.event+f}this._super.emit.call(this,u)}});function ui(){Lt.apply(this,arguments),this._timer=null,this._input=null}S(ui,Lt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[As]},process:function(u){var f=this.options,b=u.pointers.length===f.pointers,_=u.distance<f.threshold,E=u.deltaTime>f.time;if(this._input=u,!_||!b||u.eventType&($|st)&&!E)this.reset();else if(u.eventType&nt)this.reset(),this._timer=d(function(){this.state=Nt,this.tryEmit()},f.time,this);else if(u.eventType&$)return Nt;return St},reset:function(){clearTimeout(this._timer)},emit:function(u){this.state===Nt&&(u&&u.eventType&$?this.manager.emit(this.options.event+"up",u):(this._input.timeStamp=h(),this.manager.emit(this.options.event,this._input)))}});function di(){vt.apply(this,arguments)}S(di,vt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[re]},attrTest:function(u){return this._super.attrTest.call(this,u)&&(Math.abs(u.rotation)>this.options.threshold||this.state&gt)}});function fi(){vt.apply(this,arguments)}S(fi,vt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Et|oe,pointers:1},getTouchAction:function(){return wn.prototype.getTouchAction.call(this)},attrTest:function(u){var f=this.options.direction,b;return f&(Et|oe)?b=u.overallVelocity:f&Et?b=u.overallVelocityX:f&oe&&(b=u.overallVelocityY),this._super.attrTest.call(this,u)&&f&u.offsetDirection&&u.distance>this.options.threshold&&u.maxPointers==this.options.pointers&&c(b)>this.options.velocity&&u.eventType&$},emit:function(u){var f=Ns(u.offsetDirection);f&&this.manager.emit(this.options.event+f,u),this.manager.emit(this.options.event,u)}});function En(){Lt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}S(En,Lt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[li]},process:function(u){var f=this.options,b=u.pointers.length===f.pointers,_=u.distance<f.threshold,E=u.deltaTime<f.time;if(this.reset(),u.eventType&nt&&this.count===0)return this.failTimeout();if(_&&E&&b){if(u.eventType!=$)return this.failTimeout();var T=this.pTime?u.timeStamp-this.pTime<f.interval:!0,R=!this.pCenter||mn(this.pCenter,u.center)<f.posThreshold;this.pTime=u.timeStamp,this.pCenter=u.center,!R||!T?this.count=1:this.count+=1,this._input=u;var q=this.count%f.taps;if(q===0)return this.hasRequireFailures()?(this._timer=d(function(){this.state=Nt,this.tryEmit()},f.interval,this),gt):Nt}return St},failTimeout:function(){return this._timer=d(function(){this.state=St},this.options.interval,this),St},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Nt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Vt(u,f){return f=f||{},f.recognizers=k(f.recognizers,Vt.defaults.preset),new gi(u,f)}Vt.VERSION="2.0.7",Vt.defaults={domEvents:!1,touchAction:Ds,enable:!0,inputTarget:null,inputClass:null,preset:[[di,{enable:!1}],[hi,{enable:!1},["rotate"]],[fi,{direction:Et}],[wn,{direction:Et},["swipe"]],[En],[En,{event:"doubletap",taps:2},["tap"]],[ui]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var nl=1,Ls=2;function gi(u,f){this.options=x({},Vt.defaults,f||{}),this.options.inputTarget=this.options.inputTarget||u,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=u,this.input=Aa(this),this.touchAction=new ci(this,this.options.touchAction),Rs(this,!0),p(this.options.recognizers,function(b){var _=this.add(new b[0](b[1]));b[2]&&_.recognizeWith(b[2]),b[3]&&_.requireFailure(b[3])},this)}gi.prototype={set:function(u){return x(this.options,u),u.touchAction&&this.touchAction.update(),u.inputTarget&&(this.input.destroy(),this.input.target=u.inputTarget,this.input.init()),this},stop:function(u){this.session.stopped=u?Ls:nl},recognize:function(u){var f=this.session;if(!f.stopped){this.touchAction.preventDefaults(u);var b,_=this.recognizers,E=f.curRecognizer;(!E||E&&E.state&Nt)&&(E=f.curRecognizer=null);for(var T=0;T<_.length;)b=_[T],f.stopped!==Ls&&(!E||b==E||b.canRecognizeWith(E))?b.recognize(u):b.reset(),!E&&b.state&(gt|Se|Wt)&&(E=f.curRecognizer=b),T++}},get:function(u){if(u instanceof Lt)return u;for(var f=this.recognizers,b=0;b<f.length;b++)if(f[b].options.event==u)return f[b];return null},add:function(u){if(g(u,"add",this))return this;var f=this.get(u.options.event);return f&&this.remove(f),this.recognizers.push(u),u.manager=this,this.touchAction.update(),u},remove:function(u){if(g(u,"remove",this))return this;if(u=this.get(u),u){var f=this.recognizers,b=N(f,u);b!==-1&&(f.splice(b,1),this.touchAction.update())}return this},on:function(u,f){if(u!==s&&f!==s){var b=this.handlers;return p(F(u),function(_){b[_]=b[_]||[],b[_].push(f)}),this}},off:function(u,f){if(u!==s){var b=this.handlers;return p(F(u),function(_){f?b[_]&&b[_].splice(N(b[_],f),1):delete b[_]}),this}},emit:function(u,f){this.options.domEvents&&il(u,f);var b=this.handlers[u]&&this.handlers[u].slice();if(!(!b||!b.length)){f.type=u,f.preventDefault=function(){f.srcEvent.preventDefault()};for(var _=0;_<b.length;)b[_](f),_++}},destroy:function(){this.element&&Rs(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Rs(u,f){var b=u.element;if(b.style){var _;p(u.options.cssProps,function(E,T){_=tt(b.style,T),f?(u.oldCssProps[_]=b.style[_],b.style[_]=E):b.style[_]=u.oldCssProps[_]||""}),f||(u.oldCssProps={})}}function il(u,f){var b=n.createEvent("Event");b.initEvent(u,!0,!0),b.gesture=f,f.target.dispatchEvent(b)}x(Vt,{INPUT_START:nt,INPUT_MOVE:se,INPUT_END:$,INPUT_CANCEL:st,STATE_POSSIBLE:vn,STATE_BEGAN:gt,STATE_CHANGED:Se,STATE_ENDED:Wt,STATE_RECOGNIZED:Nt,STATE_CANCELLED:je,STATE_FAILED:St,DIRECTION_NONE:gn,DIRECTION_LEFT:ze,DIRECTION_RIGHT:Fe,DIRECTION_UP:He,DIRECTION_DOWN:Be,DIRECTION_HORIZONTAL:Et,DIRECTION_VERTICAL:oe,DIRECTION_ALL:xs,Manager:gi,Input:ft,TouchAction:ci,TouchInput:xn,MouseInput:bn,PointerEventInput:ri,TouchMouseInput:ai,SingleTouchInput:Ts,Recognizer:Lt,AttrRecognizer:vt,Tap:En,Pan:wn,Swipe:fi,Pinch:hi,Rotate:di,Press:ui,on:D,off:P,each:p,merge:w,extend:v,assign:x,inherit:S,bindFn:O,prefixed:tt});var sl=typeof t<"u"?t:typeof self<"u"?self:{};sl.Hammer=Vt,e.exports?e.exports=Vt:t[i]=Vt})(window,document,"Hammer")}(ki)),ki.exports}var lf=af();const on=rf(lf);/*!
1749
+ \`;return function(){var S=new Error("get-stack-trace"),M=S&&S.stack?S.stack.replace(/^[^\\(]+?[\\n$]/gm,"").replace(/^\\s+at\\s+/gm,"").replace(/^Object.<anonymous>\\s*\\(/gm,"{anonymous}()@"):"Unknown Stack Trace",N=t.console&&(t.console.warn||t.console.log);return N&&N.call(t.console,_,M),h.apply(this,arguments)}}var y;typeof Object.assign!="function"?y=function(d){if(d===s||d===null)throw new TypeError("Cannot convert undefined or null to object");for(var b=Object(d),_=1;_<arguments.length;_++){var S=arguments[_];if(S!==s&&S!==null)for(var M in S)S.hasOwnProperty(M)&&(b[M]=S[M])}return b}:y=Object.assign;var v=x(function(d,b,_){for(var S=Object.keys(b),M=0;M<S.length;)(!_||_&&d[S[M]]===s)&&(d[S[M]]=b[S[M]]),M++;return d},"extend","Use \`assign\`."),w=x(function(d,b){return v(d,b,!0)},"merge","Use \`assign\`.");function k(h,d,b){var _=d.prototype,S;S=h.prototype=Object.create(_),S.constructor=h,S._super=_,b&&y(S,b)}function O(h,d){return function(){return h.apply(d,arguments)}}function C(h,d){return typeof h==a?h.apply(d&&d[0]||s,d):h}function T(h,d){return h===s?d:h}function D(h,d,b){g(F(d),function(_){h.addEventListener(_,b,!1)})}function P(h,d,b){g(F(d),function(_){h.removeEventListener(_,b,!1)})}function E(h,d){for(;h;){if(h==d)return!0;h=h.parentNode}return!1}function A(h,d){return h.indexOf(d)>-1}function F(h){return h.trim().split(/\\s+/g)}function L(h,d,b){if(h.indexOf&&!b)return h.indexOf(d);for(var _=0;_<h.length;){if(b&&h[_][b]==d||!b&&h[_]===d)return _;_++}return-1}function H(h){return Array.prototype.slice.call(h,0)}function K(h,d,b){for(var _=[],S=[],M=0;M<h.length;){var N=h[M][d];L(S,N)<0&&_.push(h[M]),S[M]=N,M++}return _=_.sort(function(Z,st){return Z[d]>st[d]}),_}function et(h,d){for(var b,_,S=d[0].toUpperCase()+d.slice(1),M=0;M<o.length;){if(b=o[M],_=b?b+S:d,_ in h)return _;M++}return s}var j=1;function q(){return j++}function nt(h){var d=h.ownerDocument||h;return d.defaultView||d.parentWindow||t}var Re=/mobile|tablet|ip(ad|hone|od)|android/i,de="ontouchstart"in t,qt=et(t,"PointerEvent")!==s,Ne=de&&Re.test(navigator.userAgent),dt="touch",pe="pen",vt="mouse",ge="kinect",Ht=25,it=1,me=2,X=4,ot=8,zn=1,on=2,rn=4,an=8,ln=16,Et=on|rn,be=an|ln,yo=Et|be,xo=["x","y"],Fn=["clientX","clientY"];function pt(h,d){var b=this;this.manager=h,this.callback=d,this.element=h.element,this.target=h.options.inputTarget,this.domHandler=function(_){C(h.options.enable,[h])&&b.handler(_)},this.init()}pt.prototype={handler:function(){},init:function(){this.evEl&&D(this.element,this.evEl,this.domHandler),this.evTarget&&D(this.target,this.evTarget,this.domHandler),this.evWin&&D(nt(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(nt(this.element),this.evWin,this.domHandler)}};function sc(h){var d,b=h.options.inputClass;return b?d=b:qt?d=Hi:Ne?d=Vn:de?d=Bi:d=Bn,new d(h,oc)}function oc(h,d,b){var _=b.pointers.length,S=b.changedPointers.length,M=d&it&&_-S===0,N=d&(X|ot)&&_-S===0;b.isFirst=!!M,b.isFinal=!!N,M&&(h.session={}),b.eventType=d,rc(h,b),h.emit("hammer.input",b),h.recognize(b),h.session.prevInput=b}function rc(h,d){var b=h.session,_=d.pointers,S=_.length;b.firstInput||(b.firstInput=vo(d)),S>1&&!b.firstMultiple?b.firstMultiple=vo(d):S===1&&(b.firstMultiple=!1);var M=b.firstInput,N=b.firstMultiple,G=N?N.center:M.center,Z=d.center=_o(_);d.timeStamp=u(),d.deltaTime=d.timeStamp-M.timeStamp,d.angle=Fi(G,Z),d.distance=Hn(G,Z),ac(b,d),d.offsetDirection=So(d.deltaX,d.deltaY);var st=wo(d.deltaTime,d.deltaX,d.deltaY);d.overallVelocityX=st.x,d.overallVelocityY=st.y,d.overallVelocity=c(st.x)>c(st.y)?st.x:st.y,d.scale=N?uc(N.pointers,_):1,d.rotation=N?cc(N.pointers,_):0,d.maxPointers=b.prevInput?d.pointers.length>b.prevInput.maxPointers?d.pointers.length:b.prevInput.maxPointers:d.pointers.length,lc(b,d);var Ct=h.element;E(d.srcEvent.target,Ct)&&(Ct=d.srcEvent.target),d.target=Ct}function ac(h,d){var b=d.center,_=h.offsetDelta||{},S=h.prevDelta||{},M=h.prevInput||{};(d.eventType===it||M.eventType===X)&&(S=h.prevDelta={x:M.deltaX||0,y:M.deltaY||0},_=h.offsetDelta={x:b.x,y:b.y}),d.deltaX=S.x+(b.x-_.x),d.deltaY=S.y+(b.y-_.y)}function lc(h,d){var b=h.lastInterval||d,_=d.timeStamp-b.timeStamp,S,M,N,G;if(d.eventType!=ot&&(_>Ht||b.velocity===s)){var Z=d.deltaX-b.deltaX,st=d.deltaY-b.deltaY,Ct=wo(_,Z,st);M=Ct.x,N=Ct.y,S=c(Ct.x)>c(Ct.y)?Ct.x:Ct.y,G=So(Z,st),h.lastInterval=d}else S=b.velocity,M=b.velocityX,N=b.velocityY,G=b.direction;d.velocity=S,d.velocityX=M,d.velocityY=N,d.direction=G}function vo(h){for(var d=[],b=0;b<h.pointers.length;)d[b]={clientX:l(h.pointers[b].clientX),clientY:l(h.pointers[b].clientY)},b++;return{timeStamp:u(),pointers:d,center:_o(d),deltaX:h.deltaX,deltaY:h.deltaY}}function _o(h){var d=h.length;if(d===1)return{x:l(h[0].clientX),y:l(h[0].clientY)};for(var b=0,_=0,S=0;S<d;)b+=h[S].clientX,_+=h[S].clientY,S++;return{x:l(b/d),y:l(_/d)}}function wo(h,d,b){return{x:d/h||0,y:b/h||0}}function So(h,d){return h===d?zn:c(h)>=c(d)?h<0?on:rn:d<0?an:ln}function Hn(h,d,b){b||(b=xo);var _=d[b[0]]-h[b[0]],S=d[b[1]]-h[b[1]];return Math.sqrt(_*_+S*S)}function Fi(h,d,b){b||(b=xo);var _=d[b[0]]-h[b[0]],S=d[b[1]]-h[b[1]];return Math.atan2(S,_)*180/Math.PI}function cc(h,d){return Fi(d[1],d[0],Fn)+Fi(h[1],h[0],Fn)}function uc(h,d){return Hn(d[0],d[1],Fn)/Hn(h[0],h[1],Fn)}var hc={mousedown:it,mousemove:me,mouseup:X},fc="mousedown",dc="mousemove mouseup";function Bn(){this.evEl=fc,this.evWin=dc,this.pressed=!1,pt.apply(this,arguments)}k(Bn,pt,{handler:function(d){var b=hc[d.type];b&it&&d.button===0&&(this.pressed=!0),b&me&&d.which!==1&&(b=X),this.pressed&&(b&X&&(this.pressed=!1),this.callback(this.manager,b,{pointers:[d],changedPointers:[d],pointerType:vt,srcEvent:d}))}});var pc={pointerdown:it,pointermove:me,pointerup:X,pointercancel:ot,pointerout:ot},gc={2:dt,3:pe,4:vt,5:ge},ko="pointerdown",To="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(ko="MSPointerDown",To="MSPointerMove MSPointerUp MSPointerCancel");function Hi(){this.evEl=ko,this.evWin=To,pt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}k(Hi,pt,{handler:function(d){var b=this.store,_=!1,S=d.type.toLowerCase().replace("ms",""),M=pc[S],N=gc[d.pointerType]||d.pointerType,G=N==dt,Z=L(b,d.pointerId,"pointerId");M&it&&(d.button===0||G)?Z<0&&(b.push(d),Z=b.length-1):M&(X|ot)&&(_=!0),!(Z<0)&&(b[Z]=d,this.callback(this.manager,M,{pointers:b,changedPointers:[d],pointerType:N,srcEvent:d}),_&&b.splice(Z,1))}});var mc={touchstart:it,touchmove:me,touchend:X,touchcancel:ot},bc="touchstart",yc="touchstart touchmove touchend touchcancel";function Mo(){this.evTarget=bc,this.evWin=yc,this.started=!1,pt.apply(this,arguments)}k(Mo,pt,{handler:function(d){var b=mc[d.type];if(b===it&&(this.started=!0),!!this.started){var _=xc.call(this,d,b);b&(X|ot)&&_[0].length-_[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:_[0],changedPointers:_[1],pointerType:dt,srcEvent:d})}}});function xc(h,d){var b=H(h.touches),_=H(h.changedTouches);return d&(X|ot)&&(b=K(b.concat(_),"identifier")),[b,_]}var vc={touchstart:it,touchmove:me,touchend:X,touchcancel:ot},_c="touchstart touchmove touchend touchcancel";function Vn(){this.evTarget=_c,this.targetIds={},pt.apply(this,arguments)}k(Vn,pt,{handler:function(d){var b=vc[d.type],_=wc.call(this,d,b);_&&this.callback(this.manager,b,{pointers:_[0],changedPointers:_[1],pointerType:dt,srcEvent:d})}});function wc(h,d){var b=H(h.touches),_=this.targetIds;if(d&(it|me)&&b.length===1)return _[b[0].identifier]=!0,[b,b];var S,M,N=H(h.changedTouches),G=[],Z=this.target;if(M=b.filter(function(st){return E(st.target,Z)}),d===it)for(S=0;S<M.length;)_[M[S].identifier]=!0,S++;for(S=0;S<N.length;)_[N[S].identifier]&&G.push(N[S]),d&(X|ot)&&delete _[N[S].identifier],S++;if(G.length)return[K(M.concat(G),"identifier"),G]}var Sc=2500,Eo=25;function Bi(){pt.apply(this,arguments);var h=O(this.handler,this);this.touch=new Vn(this.manager,h),this.mouse=new Bn(this.manager,h),this.primaryTouch=null,this.lastTouches=[]}k(Bi,pt,{handler:function(d,b,_){var S=_.pointerType==dt,M=_.pointerType==vt;if(!(M&&_.sourceCapabilities&&_.sourceCapabilities.firesTouchEvents)){if(S)kc.call(this,b,_);else if(M&&Tc.call(this,_))return;this.callback(d,b,_)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function kc(h,d){h&it?(this.primaryTouch=d.changedPointers[0].identifier,Oo.call(this,d)):h&(X|ot)&&Oo.call(this,d)}function Oo(h){var d=h.changedPointers[0];if(d.identifier===this.primaryTouch){var b={x:d.clientX,y:d.clientY};this.lastTouches.push(b);var _=this.lastTouches,S=function(){var M=_.indexOf(b);M>-1&&_.splice(M,1)};setTimeout(S,Sc)}}function Tc(h){for(var d=h.srcEvent.clientX,b=h.srcEvent.clientY,_=0;_<this.lastTouches.length;_++){var S=this.lastTouches[_],M=Math.abs(d-S.x),N=Math.abs(b-S.y);if(M<=Eo&&N<=Eo)return!0}return!1}var Co=et(r.style,"touchAction"),Po=Co!==s,Do="compute",Ao="auto",Vi="manipulation",ye="none",cn="pan-x",un="pan-y",Wn=Ec();function Wi(h,d){this.manager=h,this.set(d)}Wi.prototype={set:function(h){h==Do&&(h=this.compute()),Po&&this.manager.element.style&&Wn[h]&&(this.manager.element.style[Co]=h),this.actions=h.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var h=[];return g(this.manager.recognizers,function(d){C(d.options.enable,[d])&&(h=h.concat(d.getTouchAction()))}),Mc(h.join(" "))},preventDefaults:function(h){var d=h.srcEvent,b=h.offsetDirection;if(this.manager.session.prevented){d.preventDefault();return}var _=this.actions,S=A(_,ye)&&!Wn[ye],M=A(_,un)&&!Wn[un],N=A(_,cn)&&!Wn[cn];if(S){var G=h.pointers.length===1,Z=h.distance<2,st=h.deltaTime<250;if(G&&Z&&st)return}if(!(N&&M)&&(S||M&&b&Et||N&&b&be))return this.preventSrc(d)},preventSrc:function(h){this.manager.session.prevented=!0,h.preventDefault()}};function Mc(h){if(A(h,ye))return ye;var d=A(h,cn),b=A(h,un);return d&&b?ye:d||b?d?cn:un:A(h,Vi)?Vi:Ao}function Ec(){if(!Po)return!1;var h={},d=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(b){h[b]=d?t.CSS.supports("touch-action",b):!0}),h}var jn=1,gt=2,ze=4,Gt=8,Bt=Gt,hn=16,Ot=32;function Vt(h){this.options=y({},this.defaults,h||{}),this.id=q(),this.manager=null,this.options.enable=T(this.options.enable,!0),this.state=jn,this.simultaneous={},this.requireFail=[]}Vt.prototype={defaults:{},set:function(h){return y(this.options,h),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(h){if(p(h,"recognizeWith",this))return this;var d=this.simultaneous;return h=Un(h,this),d[h.id]||(d[h.id]=h,h.recognizeWith(this)),this},dropRecognizeWith:function(h){return p(h,"dropRecognizeWith",this)?this:(h=Un(h,this),delete this.simultaneous[h.id],this)},requireFailure:function(h){if(p(h,"requireFailure",this))return this;var d=this.requireFail;return h=Un(h,this),L(d,h)===-1&&(d.push(h),h.requireFailure(this)),this},dropRequireFailure:function(h){if(p(h,"dropRequireFailure",this))return this;h=Un(h,this);var d=L(this.requireFail,h);return d>-1&&this.requireFail.splice(d,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(h){return!!this.simultaneous[h.id]},emit:function(h){var d=this,b=this.state;function _(S){d.manager.emit(S,h)}b<Gt&&_(d.options.event+Io(b)),_(d.options.event),h.additionalEvent&&_(h.additionalEvent),b>=Gt&&_(d.options.event+Io(b))},tryEmit:function(h){if(this.canEmit())return this.emit(h);this.state=Ot},canEmit:function(){for(var h=0;h<this.requireFail.length;){if(!(this.requireFail[h].state&(Ot|jn)))return!1;h++}return!0},recognize:function(h){var d=y({},h);if(!C(this.options.enable,[this,d])){this.reset(),this.state=Ot;return}this.state&(Bt|hn|Ot)&&(this.state=jn),this.state=this.process(d),this.state&(gt|ze|Gt|hn)&&this.tryEmit(d)},process:function(h){},getTouchAction:function(){},reset:function(){}};function Io(h){return h&hn?"cancel":h&Gt?"end":h&ze?"move":h&gt?"start":""}function Lo(h){return h==ln?"down":h==an?"up":h==on?"left":h==rn?"right":""}function Un(h,d){var b=d.manager;return b?b.get(h):h}function _t(){Vt.apply(this,arguments)}k(_t,Vt,{defaults:{pointers:1},attrTest:function(h){var d=this.options.pointers;return d===0||h.pointers.length===d},process:function(h){var d=this.state,b=h.eventType,_=d&(gt|ze),S=this.attrTest(h);return _&&(b&ot||!S)?d|hn:_||S?b&X?d|Gt:d&gt?d|ze:gt:Ot}});function $n(){_t.apply(this,arguments),this.pX=null,this.pY=null}k($n,_t,{defaults:{event:"pan",threshold:10,pointers:1,direction:yo},getTouchAction:function(){var h=this.options.direction,d=[];return h&Et&&d.push(un),h&be&&d.push(cn),d},directionTest:function(h){var d=this.options,b=!0,_=h.distance,S=h.direction,M=h.deltaX,N=h.deltaY;return S&d.direction||(d.direction&Et?(S=M===0?zn:M<0?on:rn,b=M!=this.pX,_=Math.abs(h.deltaX)):(S=N===0?zn:N<0?an:ln,b=N!=this.pY,_=Math.abs(h.deltaY))),h.direction=S,b&&_>d.threshold&&S&d.direction},attrTest:function(h){return _t.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 d=Lo(h.direction);d&&(h.additionalEvent=this.options.event+d),this._super.emit.call(this,h)}});function ji(){_t.apply(this,arguments)}k(ji,_t,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ye]},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 d=h.scale<1?"in":"out";h.additionalEvent=this.options.event+d}this._super.emit.call(this,h)}});function Ui(){Vt.apply(this,arguments),this._timer=null,this._input=null}k(Ui,Vt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ao]},process:function(h){var d=this.options,b=h.pointers.length===d.pointers,_=h.distance<d.threshold,S=h.deltaTime>d.time;if(this._input=h,!_||!b||h.eventType&(X|ot)&&!S)this.reset();else if(h.eventType&it)this.reset(),this._timer=f(function(){this.state=Bt,this.tryEmit()},d.time,this);else if(h.eventType&X)return Bt;return Ot},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 $i(){_t.apply(this,arguments)}k($i,_t,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ye]},attrTest:function(h){return this._super.attrTest.call(this,h)&&(Math.abs(h.rotation)>this.options.threshold||this.state&gt)}});function Yi(){_t.apply(this,arguments)}k(Yi,_t,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Et|be,pointers:1},getTouchAction:function(){return $n.prototype.getTouchAction.call(this)},attrTest:function(h){var d=this.options.direction,b;return d&(Et|be)?b=h.overallVelocity:d&Et?b=h.overallVelocityX:d&be&&(b=h.overallVelocityY),this._super.attrTest.call(this,h)&&d&h.offsetDirection&&h.distance>this.options.threshold&&h.maxPointers==this.options.pointers&&c(b)>this.options.velocity&&h.eventType&X},emit:function(h){var d=Lo(h.offsetDirection);d&&this.manager.emit(this.options.event+d,h),this.manager.emit(this.options.event,h)}});function Yn(){Vt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}k(Yn,Vt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Vi]},process:function(h){var d=this.options,b=h.pointers.length===d.pointers,_=h.distance<d.threshold,S=h.deltaTime<d.time;if(this.reset(),h.eventType&it&&this.count===0)return this.failTimeout();if(_&&S&&b){if(h.eventType!=X)return this.failTimeout();var M=this.pTime?h.timeStamp-this.pTime<d.interval:!0,N=!this.pCenter||Hn(this.pCenter,h.center)<d.posThreshold;this.pTime=h.timeStamp,this.pCenter=h.center,!N||!M?this.count=1:this.count+=1,this._input=h;var G=this.count%d.taps;if(G===0)return this.hasRequireFailures()?(this._timer=f(function(){this.state=Bt,this.tryEmit()},d.interval,this),gt):Bt}return Ot},failTimeout:function(){return this._timer=f(function(){this.state=Ot},this.options.interval,this),Ot},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Bt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Kt(h,d){return d=d||{},d.recognizers=T(d.recognizers,Kt.defaults.preset),new Xi(h,d)}Kt.VERSION="2.0.7",Kt.defaults={domEvents:!1,touchAction:Do,enable:!0,inputTarget:null,inputClass:null,preset:[[$i,{enable:!1}],[ji,{enable:!1},["rotate"]],[Yi,{direction:Et}],[$n,{direction:Et},["swipe"]],[Yn],[Yn,{event:"doubletap",taps:2},["tap"]],[Ui]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Oc=1,Ro=2;function Xi(h,d){this.options=y({},Kt.defaults,d||{}),this.options.inputTarget=this.options.inputTarget||h,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=h,this.input=sc(this),this.touchAction=new Wi(this,this.options.touchAction),No(this,!0),g(this.options.recognizers,function(b){var _=this.add(new b[0](b[1]));b[2]&&_.recognizeWith(b[2]),b[3]&&_.requireFailure(b[3])},this)}Xi.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?Ro:Oc},recognize:function(h){var d=this.session;if(!d.stopped){this.touchAction.preventDefaults(h);var b,_=this.recognizers,S=d.curRecognizer;(!S||S&&S.state&Bt)&&(S=d.curRecognizer=null);for(var M=0;M<_.length;)b=_[M],d.stopped!==Ro&&(!S||b==S||b.canRecognizeWith(S))?b.recognize(h):b.reset(),!S&&b.state&(gt|ze|Gt)&&(S=d.curRecognizer=b),M++}},get:function(h){if(h instanceof Vt)return h;for(var d=this.recognizers,b=0;b<d.length;b++)if(d[b].options.event==h)return d[b];return null},add:function(h){if(p(h,"add",this))return this;var d=this.get(h.options.event);return d&&this.remove(d),this.recognizers.push(h),h.manager=this,this.touchAction.update(),h},remove:function(h){if(p(h,"remove",this))return this;if(h=this.get(h),h){var d=this.recognizers,b=L(d,h);b!==-1&&(d.splice(b,1),this.touchAction.update())}return this},on:function(h,d){if(h!==s&&d!==s){var b=this.handlers;return g(F(h),function(_){b[_]=b[_]||[],b[_].push(d)}),this}},off:function(h,d){if(h!==s){var b=this.handlers;return g(F(h),function(_){d?b[_]&&b[_].splice(L(b[_],d),1):delete b[_]}),this}},emit:function(h,d){this.options.domEvents&&Cc(h,d);var b=this.handlers[h]&&this.handlers[h].slice();if(!(!b||!b.length)){d.type=h,d.preventDefault=function(){d.srcEvent.preventDefault()};for(var _=0;_<b.length;)b[_](d),_++}},destroy:function(){this.element&&No(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function No(h,d){var b=h.element;if(b.style){var _;g(h.options.cssProps,function(S,M){_=et(b.style,M),d?(h.oldCssProps[_]=b.style[_],b.style[_]=S):b.style[_]=h.oldCssProps[_]||""}),d||(h.oldCssProps={})}}function Cc(h,d){var b=n.createEvent("Event");b.initEvent(h,!0,!0),b.gesture=d,d.target.dispatchEvent(b)}y(Kt,{INPUT_START:it,INPUT_MOVE:me,INPUT_END:X,INPUT_CANCEL:ot,STATE_POSSIBLE:jn,STATE_BEGAN:gt,STATE_CHANGED:ze,STATE_ENDED:Gt,STATE_RECOGNIZED:Bt,STATE_CANCELLED:hn,STATE_FAILED:Ot,DIRECTION_NONE:zn,DIRECTION_LEFT:on,DIRECTION_RIGHT:rn,DIRECTION_UP:an,DIRECTION_DOWN:ln,DIRECTION_HORIZONTAL:Et,DIRECTION_VERTICAL:be,DIRECTION_ALL:yo,Manager:Xi,Input:pt,TouchAction:Wi,TouchInput:Vn,MouseInput:Bn,PointerEventInput:Hi,TouchMouseInput:Bi,SingleTouchInput:Mo,Recognizer:Vt,AttrRecognizer:_t,Tap:Yn,Pan:$n,Swipe:Yi,Pinch:ji,Rotate:$i,Press:Ui,on:D,off:P,each:g,merge:w,extend:v,assign:y,inherit:k,bindFn:O,prefixed:et});var Pc=typeof t<"u"?t:typeof self<"u"?self:{};Pc.Hammer=Kt,e.exports?e.exports=Kt:t[i]=Kt})(window,document,"Hammer")})(os)),os.exports}var Cg=Og();const Mn=Eg(Cg);/*!
1719
1750
  * chartjs-plugin-zoom v2.2.0
1720
1751
  * https://www.chartjs.org/chartjs-plugin-zoom/2.2.0/
1721
1752
  * (c) 2016-2024 chartjs-plugin-zoom Contributors
1722
1753
  * Released under the MIT License
1723
- */const dn=e=>e&&e.enabled&&e.modifierKey,xa=(e,t)=>e&&t[e+"Key"],ms=(e,t)=>e&&!t[e+"Key"];function Jt(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 Ti(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 cf(e,t){let n;return function(){return clearTimeout(n),n=setTimeout(e,t),t}}function hf({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 ya(e,t,n){const{mode:i="xy",scaleMode:s,overScaleMode:o}=e||{},r=hf(t,n),a=Ti(i,n),l=Ti(s,n);if(o){const h=Ti(o,n);for(const d of["x","y"])h[d]&&(l[d]=a[d],a[d]=!1)}if(r&&l[r.axis])return[r];const c=[];return z(n.scales,function(h){a[h.axis]&&c.push(h)}),c}const ji=new WeakMap;function j(e){let t=ji.get(e);return t||(t={originalScaleLimits:{},updatedScaleLimits:{},handlers:{},panDelta:{},dragging:!1,panning:!1},ji.set(e,t)),t}function uf(e){ji.delete(e)}function va(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 _a(e,t){const n=e.isHorizontal()?t.x:t.y;return e.getValueForPixel(n)}function wa(e,t,n){const i=e.max-e.min,s=i*(t-1),o=_a(e,n);return va(o,e.min,i,s)}function df(e,t,n){const i=_a(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=va(r,s,a,l);return{min:Math.pow(10,s+c.min),max:Math.pow(10,o-c.max)}}function ff(e,t){return t&&(t[e.id]||t[e.axis])||{}}function er(e,t,n,i,s){let o=n[i];if(o==="original"){const r=e.originalScaleLimits[t.id][i];o=L(r.options,r.scale)}return L(o,s)}function gf(e,t,n){const i=e.getValueForPixel(t),s=e.getValueForPixel(n);return{min:Math.min(i,s),max:Math.max(i,s)}}function pf(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 pe(t,a,c)&&(t=a),pe(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=j(e.chart),{options:r}=e,a=ff(e,i),{minRange:l=0}=a,c=er(o,e,a,"min",-1/0),h=er(o,e,a,"max",1/0);if(s==="pan"&&(t<c||n>h))return!0;const d=e.max-e.min,g=s?Math.max(n-t,l):d;if(s&&g===l&&d<=l)return!0;const p=pf(g,{min:t,max:n,minLimit:c,maxLimit:h},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 mf(e,t,n,i){const s=wa(e,t,n),o={min:e.min+s.min,max:e.max-s.max};return _e(e,o,i,!0)}function bf(e,t,n,i){const s=df(e,t,n);return _e(e,s,i,!0)}function xf(e,t,n,i){_e(e,gf(e,t,n),i,!0)}const nr=e=>e===0||isNaN(e)?0:e<0?Math.min(Math.round(e),-1):Math.max(Math.round(e),1);function yf(e){const n=e.getLabels().length-1;e.min>0&&(e.min-=1),e.max<n&&(e.max+=1)}function vf(e,t,n,i){const s=wa(e,t,n);e.min===e.max&&t<1&&yf(e);const o={min:e.min+nr(s.min),max:e.max-nr(s.max)};return _e(e,o,i,!0)}function _f(e){return e.isHorizontal()?e.width:e.height}function wf(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(_f(e)/Math.max(a,10)),c=Math.round(Math.abs(t/l));let h;return t<-l?(r=Math.min(r+c,s),o=a===1?r:r-a,h=r===s):t>l&&(o=Math.max(0,o-c),r=a===1?o:o+a,h=o===0),_e(e,{min:o,max:r},n)||h}const Ef={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 Ea(e,t,n,i=!1){const{min:s,max:o,options:r}=e,a=r.time&&r.time.round,l=Ef[a]||0,c=e.getValueForPixel(e.getPixelForValue(s+l)-t),h=e.getValueForPixel(e.getPixelForValue(o+l)-t);return isNaN(c)||isNaN(h)?!0:_e(e,{min:c,max:h},n,i?"pan":!1)}function ir(e,t,n){return Ea(e,t,n,!0)}const Ui={category:vf,default:mf,logarithmic:bf},Yi={default:xf},$i={category:wf,default:Ea,logarithmic:ir,timeseries:ir};function Sf(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 sr(e,t){z(e,(n,i)=>{t[i]||delete e[i]})}function Re(e,t){const{scales:n}=e,{originalScaleLimits:i,updatedScaleLimits:s}=t;return z(n,function(o){Sf(o,i,s)&&(i[o.id]={min:{scale:o.min,options:o.options.min},max:{scale:o.max,options:o.options.max}})}),sr(i,n),sr(s,n),i}function or(e,t,n,i){const s=Ui[e.type]||Ui.default;I(s,[e,t,n,i])}function rr(e,t,n,i){const s=Yi[e.type]||Yi.default;I(s,[e,t,n,i])}function kf(e){const t=e.chartArea;return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function bs(e,t,n="none",i="api"){const{x:s=1,y:o=1,focalPoint:r=kf(e)}=typeof t=="number"?{x:t,y:t}:t,a=j(e),{options:{limits:l,zoom:c}}=a;Re(e,a);const h=s!==1,d=o!==1,g=ya(c,r,e);z(g||e.scales,function(p){p.isHorizontal()&&h?or(p,s,r,l):!p.isHorizontal()&&d&&or(p,o,r,l)}),e.update(n),I(c.onZoom,[{chart:e,trigger:i}])}function Sa(e,t,n,i="none",s="api"){const o=j(e),{options:{limits:r,zoom:a}}=o,{mode:l="xy"}=a;Re(e,o);const c=Jt(l,"x",e),h=Jt(l,"y",e);z(e.scales,function(d){d.isHorizontal()&&c?rr(d,t.x,n.x,r):!d.isHorizontal()&&h&&rr(d,t.y,n.y,r)}),e.update(i),I(a.onZoom,[{chart:e,trigger:s}])}function Tf(e,t,n,i="none",s="api"){const o=j(e);Re(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 Mf(e,t="default"){const n=j(e),i=Re(e,n);z(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 Of(e,t){const n=e.originalScaleLimits[t];if(!n)return;const{min:i,max:s}=n;return L(s.options,s.scale)-L(i.options,i.scale)}function Cf(e){const t=j(e);let n=1,i=1;return z(e.scales,function(s){const o=Of(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 ar(e,t,n,i){const{panDelta:s}=i,o=s[e.id]||0;Qt(o)===Qt(t)&&(t+=o);const r=$i[e.type]||$i.default;I(r,[e,t,n])?s[e.id]=0:s[e.id]=t}function ka(e,t,n,i="none"){const{x:s=0,y:o=0}=typeof t=="number"?{x:t,y:t}:t,r=j(e),{options:{pan:a,limits:l}}=r,{onPan:c}=a||{};Re(e,r);const h=s!==0,d=o!==0;z(n||e.scales,function(g){g.isHorizontal()&&h?ar(g,s,l,r):!g.isHorizontal()&&d&&ar(g,o,l,r)}),e.update(i),I(c,[{chart:e}])}function Ta(e){const t=j(e);Re(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 Pf(e){const t=j(e),n={};for(const i of Object.keys(e.scales))n[i]=t.updatedScaleLimits[i];return n}function Df(e){const t=Ta(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 lr(e){const t=j(e);return t.panning||t.dragging}const cr=(e,t,n)=>Math.min(n,Math.max(t,e));function rt(e,t){const{handlers:n}=j(e),i=n[t];i&&i.target&&(i.target.removeEventListener(t,i),delete n[t])}function rn(e,t,n,i){const{handlers:s,options:o}=j(e),r=s[n];if(r&&r.target===t)return;rt(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 Af(e,t){const n=j(e);n.dragStart&&(n.dragging=!0,n.dragEnd=t,e.update("none"))}function If(e,t){const n=j(e);!n.dragStart||t.key!=="Escape"||(rt(e,"keydown"),n.dragging=!1,n.dragStart=n.dragEnd=null,e.update("none"))}function Xi(e,t){if(e.target!==t.canvas){const n=t.canvas.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}return Ct(e,t)}function Ma(e,t,n){const{onZoomStart:i,onZoomRejected:s}=n;if(i){const o=Xi(t,e);if(I(i,[{chart:e,event:t,point:o}])===!1)return I(s,[{chart:e,event:t}]),!1}}function Nf(e,t){if(e.legend){const o=Ct(t,e);if(De(o,e.legend))return}const n=j(e),{pan:i,zoom:s={}}=n.options;if(t.button!==0||xa(dn(i),t)||ms(dn(s.drag),t))return I(s.onZoomRejected,[{chart:e,event:t}]);Ma(e,t,s)!==!1&&(n.dragStart=t,rn(e,e.canvas.ownerDocument,"mousemove",Af),rn(e,window.document,"keydown",If))}function Lf({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 hr(e,t,n,{min:i,max:s,prop:o}){e[i]=cr(Math.min(n.begin[o],n.end[o]),t[i],t[s]),e[s]=cr(Math.max(n.begin[o],n.end[o]),t[i],t[s])}function Rf(e,t,n){const i={begin:Xi(t.dragStart,e),end:Xi(t.dragEnd,e)};if(n){const s=e.chartArea.width/e.chartArea.height;Lf(i,s)}return i}function Oa(e,t,n,i){const s=Jt(t,"x",e),o=Jt(t,"y",e),{top:r,left:a,right:l,bottom:c,width:h,height:d}=e.chartArea,g={top:r,left:a,right:l,bottom:c},p=Rf(e,n,i&&s&&o);s&&hr(g,e.chartArea,p,{min:"left",max:"right",prop:"x"}),o&&hr(g,e.chartArea,p,{min:"top",max:"bottom",prop:"y"});const y=g.right-g.left,x=g.bottom-g.top;return{...g,width:y,height:x,zoomX:s&&y?1+(h-y)/h:1,zoomY:o&&x?1+(d-x)/d:1}}function zf(e,t){const n=j(e);if(!n.dragStart)return;rt(e,"mousemove");const{mode:i,onZoomComplete:s,drag:{threshold:o=0,maintainAspectRatio:r}}=n.options.zoom,a=Oa(e,i,{dragStart:n.dragStart,dragEnd:t},r),l=Jt(i,"x",e)?a.width:0,c=Jt(i,"y",e)?a.height:0,h=Math.sqrt(l*l+c*c);if(n.dragStart=n.dragEnd=null,h<=o){n.dragging=!1,e.update("none");return}Sa(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 Ff(e,t,n){if(ms(dn(n.wheel),t)){I(n.onZoomRejected,[{chart:e,event:t}]);return}if(Ma(e,t,n)!==!1&&(t.cancelable&&t.preventDefault(),t.deltaY!==void 0))return!0}function Hf(e,t){const{handlers:{onZoomComplete:n},options:{zoom:i}}=j(e);if(!Ff(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}};bs(e,a,"zoom","wheel"),I(n,[{chart:e}])}function Bf(e,t,n,i){n&&(j(e).handlers[t]=cf(()=>I(n,[{chart:e}]),i))}function Wf(e,t){const n=e.canvas,{wheel:i,drag:s,onZoomComplete:o}=t.zoom;i.enabled?(rn(e,n,"wheel",Hf),Bf(e,"onZoomComplete",o,250)):rt(e,"wheel"),s.enabled?(rn(e,n,"mousedown",Nf),rn(e,n.ownerDocument,"mouseup",zf)):(rt(e,"mousedown"),rt(e,"mousemove"),rt(e,"mouseup"),rt(e,"keydown"))}function Vf(e){rt(e,"mousedown"),rt(e,"mousemove"),rt(e,"mouseup"),rt(e,"wheel"),rt(e,"click"),rt(e,"keydown")}function jf(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"&&(ms(dn(s),r)||xa(dn(o.drag),r))?(I(s.onPanRejected,[{chart:e,event:i}]),!1):!0}}function Uf(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 Ca(e,t,n){if(t.scale){const{center:i,pointers:s}=n,o=1/t.scale*n.scale,r=n.target.getBoundingClientRect(),a=Uf(s[0],s[1]),l=t.options.zoom.mode,c={x:a.x&&Jt(l,"x",e)?o:1,y:a.y&&Jt(l,"y",e)?o:1,focalPoint:{x:i.x-r.left,y:i.y-r.top}};bs(e,c,"zoom","pinch"),t.scale=n.scale}}function Yf(e,t,n){if(t.options.zoom.pinch.enabled){const i=Ct(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 $f(e,t,n){t.scale&&(Ca(e,t,n),t.scale=null,I(t.options.zoom.onZoomComplete,[{chart:e}]))}function Pa(e,t,n){const i=t.delta;i&&(t.panning=!0,ka(e,{x:n.deltaX-i.x,y:n.deltaY-i.y},t.panScales),t.delta={x:n.deltaX,y:n.deltaY})}function Xf(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=ya(t.options.pan,a,e),t.delta={x:0,y:0},Pa(e,t,n)}function qf(e,t){t.delta=null,t.panning&&(t.panning=!1,t.filterNextClick=!0,I(t.options.pan.onPanComplete,[{chart:e}]))}const qi=new WeakMap;function ur(e,t){const n=j(e),i=e.canvas,{pan:s,zoom:o}=t,r=new on.Manager(i);o&&o.pinch.enabled&&(r.add(new on.Pinch),r.on("pinchstart",a=>Yf(e,n,a)),r.on("pinch",a=>Ca(e,n,a)),r.on("pinchend",a=>$f(e,n,a))),s&&s.enabled&&(r.add(new on.Pan({threshold:s.threshold,enable:jf(e,n)})),r.on("panstart",a=>Xf(e,n,a)),r.on("panmove",a=>Pa(e,n,a)),r.on("panend",()=>qf(e,n))),qi.set(e,r)}function dr(e){const t=qi.get(e);t&&(t.remove("pinchstart"),t.remove("pinch"),t.remove("pinchend"),t.remove("panstart"),t.remove("pan"),t.remove("panend"),t.destroy(),qi.delete(e))}function Gf(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 Kf="2.2.0";function Bn(e,t,n){const i=n.zoom.drag,{dragStart:s,dragEnd:o}=j(e);if(i.drawTime!==t||!o)return;const{left:r,top:a,width:l,height:c}=Oa(e,n.zoom.mode,{dragStart:s,dragEnd:o},i.maintainAspectRatio),h=e.ctx;h.save(),h.beginPath(),h.fillStyle=i.backgroundColor||"rgba(225,225,225,0.3)",h.fillRect(r,a,l,c),i.borderWidth>0&&(h.lineWidth=i.borderWidth,h.strokeStyle=i.borderColor||"rgba(225,225,225)",h.strokeRect(r,a,l,c)),h.restore()}var Zf={id:"zoom",version:Kf,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=j(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)."),on&&ur(e,n),e.pan=(s,o,r)=>ka(e,s,o,r),e.zoom=(s,o)=>bs(e,s,o),e.zoomRect=(s,o,r)=>Sa(e,s,o,r),e.zoomScale=(s,o,r)=>Tf(e,s,o,r),e.resetZoom=s=>Mf(e,s),e.getZoomLevel=()=>Cf(e),e.getInitialScaleBounds=()=>Ta(e),e.getZoomedScaleBounds=()=>Pf(e),e.isZoomedOrPanned=()=>Df(e),e.isZoomingOrPanning=()=>lr(e)},beforeEvent(e,{event:t}){if(lr(e))return!1;if(t.type==="click"||t.type==="mouseup"){const n=j(e);if(n.filterNextClick)return n.filterNextClick=!1,!1}},beforeUpdate:function(e,t,n){const i=j(e),s=i.options;i.options=n,Gf(s,n)&&(dr(e),ur(e,n)),Wf(e,n)},beforeDatasetsDraw(e,t,n){Bn(e,"beforeDatasetsDraw",n)},afterDatasetsDraw(e,t,n){Bn(e,"afterDatasetsDraw",n)},beforeDraw(e,t,n){Bn(e,"beforeDraw",n)},afterDraw(e,t,n){Bn(e,"afterDraw",n)},stop:function(e){Vf(e),on&&dr(e),uf(e)},panFunctions:$i,zoomFunctions:Ui,zoomRectFunctions:Yi};function Qf({data:e,...t}){const n=Ce(null),i=Ce(null);return ct(()=>{Wi.register(Zf,ef,gu,Qd,Nd,Id,Bd,qd);const s=i.current,o=n.current=new Wi(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()}},[]),m.createElement("canvas",{ref:i,...t})}function Jf(){const e=te();ct(()=>{const n=i=>{an(i)||e()};return U?.on("mount",n),U?.on("unmount",n),()=>{U?.off("mount",n),U?.off("unmount",n)}},[]);const t=U?.profilingContext;return m.createElement("div",{className:"flex flex-col gap-2"},wr(t.appStats).filter(([n])=>!an(n)).map(([n])=>m.createElement(tg,{key:n.id,app:n})))}const fr=100,gr=e=>Object.entries(e).map(([t,{values:n,color:i}])=>({label:t,data:n,fill:!1,borderColor:i,tension:.1}));function tg({app:e}){const t=te(),n=Ce({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=Q({labels:[(performance.now()/1e3).toFixed(2)],datasets:gr(n.current)}),s=Q(!1),o=U?.profilingContext;return ct(()=>{const r=a=>{a.id===e.id&&t()};return U?.on("update",r),()=>U?.off("update",r)},[]),ct(()=>{const r=[];Object.entries(n.current).forEach(([l,{values:c}])=>{const h=g=>{g.id===e.id&&s.peek()!==!0&&c[c.length-1]++},d=l;o.addEventListener(d,h),r.push(()=>o.removeEventListener(d,h))});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>fr&&c.values.shift()}),l.push((performance.now()/1e3).toFixed(2)),l.length>fr&&l.shift(),i.value={labels:l,datasets:gr(n.current)}},100);return()=>{r.forEach(l=>l()),clearInterval(a)}},[]),m.createElement("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"},m.createElement("div",{className:"grid items-start gap-2",style:"grid-template-columns: 1fr max-content;"},m.createElement("div",{className:"flex flex-col gap-2"},m.createElement("span",null,e.name),m.createElement(Qf,{data:i,className:"w-full max-w-full min-h-20 bg-black bg-opacity-30",onmouseenter:()=>s.value=!0,onmouseleave:()=>s.value=!1})),m.createElement("div",{className:"text-xs grid grid-cols-2 gap-x-4",style:"grid-template-columns: auto auto;"},m.createElement("span",{className:"text-right"},"Mount duration:"),o.mountDuration(e).toFixed(2)," ms",m.createElement("span",{className:"text-right"},"Total updates:"),m.createElement("span",null,o.totalTicks(e).toLocaleString()),m.createElement("span",{className:"text-right"},"Avg. update duration:"),o.averageTickDuration(e).toFixed(2)," ms",m.createElement("span",{className:"text-right"},"Latest update:"),m.createElement("span",null,o.lastTickDuration(e).toFixed(2)," ms"))))}const Ge=ht([]),Da=ht(""),eg=vr(()=>Da.value.toLowerCase().split(" ").filter(e=>e.length>0));function ng(e){return eg.value.every(t=>e.toLowerCase().includes(t))}function ig(){const e=te();ct(()=>{const n=i=>{an(i)||e()};return U?.on("update",n),()=>U?.off("update",n)},[]);const t=U?.globalState[Symbol.for("SWR_GLOBAL")]??new Map;return t.size===0?m.createElement("div",{className:"flex flex-col items-center justify-center h-full text-neutral-400"},m.createElement(Er,null),m.createElement("h2",{className:"text-lg italic"},"No SWR detected")):m.createElement("div",{className:"flex flex-col gap-2 items-start"},m.createElement(Pr,{value:Da,className:"sticky top-0"}),m.createElement("div",{className:"flex flex-col gap-2 w-full"},wr(t).filter(([n])=>ng(n)).map(([n,i])=>m.createElement(sg,{key:n,entry:i}))))}function sg({key:e,entry:t}){const n=Ge.value.includes(e),i=te();ct(()=>{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=Te(()=>{n?Ge.value=Ge.value.filter(o=>o!==e):Ge.value=[...Ge.value,e]},[n]);return m.createElement("div",{className:"flex flex-col"},m.createElement("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,m.createElement(Kt,{className:"transition-all"+(n?" rotate-90":"")})),n&&m.createElement("div",{className:"flex flex-col gap-2 p-2 border border-white border-opacity-10"},m.createElement(ye,{data:{resource:t.resource.peek(),isMutating:t.isMutating.peek(),isValidating:t.isValidating.peek()},mutable:!1,objectRefAcc:[],keys:[],onChange:()=>{}})))}const og=e=>m.createElement("main",{className:"flex flex-col flex-1 max-h-[calc(100vh-1rem)] overflow-y-auto",style:e.active?{}:{display:"none"}},e.children),Gi={Apps:{Icon:bl,View:Kl},Stores:{Icon:El,View:Jl},SWR:{Icon:_l,View:ig},Profiling:{Icon:vl,View:Jf},Settings:{Icon:xl,View:kl}},ti=ht("Apps");let pr=qt.peek();qt.subscribe(e=>{e!==pr&&e!==null&&(ti.value="Apps"),pr=e});function rg(){return m.createElement(Sl,null,m.createElement("nav",{className:"flex flex-col gap-2 justify-between p-2 bg-neutral-400 bg-opacity-5 border border-white border-opacity-10 rounded"},m.createElement("div",{className:"flex flex-col gap-2"},Object.keys(Gi).map(e=>m.createElement(ag,{key:e,title:e})))),Object.entries(Gi).map(([e,{View:t}])=>m.createElement(og,{key:e,active:ti.value===e},m.createElement(t,null))))}function ag({title:e}){const{Icon:t}=Gi[e];return m.createElement("button",{key:e,onclick:()=>{ti.value=e},className:"flex items-center px-2 py-1 gap-2 rounded border text-xs border-white border-opacity-10"+(ti.value===e?" bg-white bg-opacity-5 text-neutral-100":" hover:bg-white hover:bg-opacity-10 text-neutral-400"),title:e},m.createElement(t,{className:"text-primary"}),m.createElement("span",{className:"hidden sm:inline"},e))}cl(m.createElement(rg,null),document.getElementById("app"));Pe.send({type:"ready"});setInterval(()=>{window.opener||window.close()},250);</script>
1724
- <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}.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-6{margin-left:1.5rem}.flex{display:flex}.grid{display:grid}.hidden{display:none}.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-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-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-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}.text-right{text-align:right}.text-\\[10px\\]{font-size:10px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.italic{font-style:italic}.text-neutral-100{--tw-text-opacity: 1;color:rgb(245 245 245 / var(--tw-text-opacity, 1))}.text-neutral-300{--tw-text-opacity: 1;color:rgb(212 212 212 / var(--tw-text-opacity, 1))}.text-neutral-400{--tw-text-opacity: 1;color:rgb(163 163 163 / var(--tw-text-opacity, 1))}.text-primary{--tw-text-opacity: 1;color:rgb(220 20 60 / var(--tw-text-opacity, 1))}.accent-red-500{accent-color:#ef4444}.opacity-50{opacity:.5}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-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-opacity-10:hover{--tw-bg-opacity: .1}.hover\\:opacity-100:hover{opacity:1}.focus\\:outline:focus{outline-style:solid}.focus\\:outline-primary:focus{outline-color:#dc143c}@media (min-width: 640px){.sm\\:inline{display:inline}}</style>
1754
+ */const Rn=e=>e&&e.enabled&&e.modifierKey,Ul=(e,t)=>e&&t[e+"Key"],mo=(e,t)=>e&&!t[e+"Key"];function ce(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 rs(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 Pg(e,t){let n;return function(){return clearTimeout(n),n=setTimeout(e,t),t}}function Dg({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 $l(e,t,n){const{mode:i="xy",scaleMode:s,overScaleMode:o}=e||{},r=Dg(t,n),a=rs(i,n),l=rs(s,n);if(o){const u=rs(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 z(n.scales,function(u){a[u.axis]&&c.push(u)}),c}const Hs=new WeakMap;function U(e){let t=Hs.get(e);return t||(t={originalScaleLimits:{},updatedScaleLimits:{},handlers:{},panDelta:{},dragging:!1,panning:!1},Hs.set(e,t)),t}function Ag(e){Hs.delete(e)}function Yl(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 Xl(e,t){const n=e.isHorizontal()?t.x:t.y;return e.getValueForPixel(n)}function ql(e,t,n){const i=e.max-e.min,s=i*(t-1),o=Xl(e,n);return Yl(o,e.min,i,s)}function Ig(e,t,n){const i=Xl(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=Yl(r,s,a,l);return{min:Math.pow(10,s+c.min),max:Math.pow(10,o-c.max)}}function Lg(e,t){return t&&(t[e.id]||t[e.axis])||{}}function sa(e,t,n,i,s){let o=n[i];if(o==="original"){const r=e.originalScaleLimits[t.id][i];o=R(r.options,r.scale)}return R(o,s)}function Rg(e,t,n){const i=e.getValueForPixel(t),s=e.getValueForPixel(n);return{min:Math.min(i,s),max:Math.max(i,s)}}function Ng(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 Oe(t,a,c)&&(t=a),Oe(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 Le(e,{min:t,max:n},i,s=!1){const o=U(e.chart),{options:r}=e,a=Lg(e,i),{minRange:l=0}=a,c=sa(o,e,a,"min",-1/0),u=sa(o,e,a,"max",1/0);if(s==="pan"&&(t<c||n>u))return!0;const f=e.max-e.min,p=s?Math.max(n-t,l):f;if(s&&p===l&&f<=l)return!0;const g=Ng(p,{min:t,max:n,minLimit:c,maxLimit:u},o.originalScaleLimits[e.id]);return r.min=g.min,r.max=g.max,o.updatedScaleLimits[e.id]=g,e.parse(g.min)!==e.min||e.parse(g.max)!==e.max}function zg(e,t,n,i){const s=ql(e,t,n),o={min:e.min+s.min,max:e.max-s.max};return Le(e,o,i,!0)}function Fg(e,t,n,i){const s=Ig(e,t,n);return Le(e,s,i,!0)}function Hg(e,t,n,i){Le(e,Rg(e,t,n),i,!0)}const oa=e=>e===0||isNaN(e)?0:e<0?Math.min(Math.round(e),-1):Math.max(Math.round(e),1);function Bg(e){const n=e.getLabels().length-1;e.min>0&&(e.min-=1),e.max<n&&(e.max+=1)}function Vg(e,t,n,i){const s=ql(e,t,n);e.min===e.max&&t<1&&Bg(e);const o={min:e.min+oa(s.min),max:e.max-oa(s.max)};return Le(e,o,i,!0)}function Wg(e){return e.isHorizontal()?e.width:e.height}function jg(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(Wg(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),Le(e,{min:o,max:r},n)||u}const Ug={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 Gl(e,t,n,i=!1){const{min:s,max:o,options:r}=e,a=r.time&&r.time.round,l=Ug[a]||0,c=e.getValueForPixel(e.getPixelForValue(s+l)-t),u=e.getValueForPixel(e.getPixelForValue(o+l)-t);return isNaN(c)||isNaN(u)?!0:Le(e,{min:c,max:u},n,i?"pan":!1)}function ra(e,t,n){return Gl(e,t,n,!0)}const Bs={category:Vg,default:zg,logarithmic:Fg},Vs={default:Hg},Ws={category:jg,default:Gl,logarithmic:ra,timeseries:ra};function $g(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 aa(e,t){z(e,(n,i)=>{t[i]||delete e[i]})}function sn(e,t){const{scales:n}=e,{originalScaleLimits:i,updatedScaleLimits:s}=t;return z(n,function(o){$g(o,i,s)&&(i[o.id]={min:{scale:o.min,options:o.options.min},max:{scale:o.max,options:o.options.max}})}),aa(i,n),aa(s,n),i}function la(e,t,n,i){const s=Bs[e.type]||Bs.default;I(s,[e,t,n,i])}function ca(e,t,n,i){const s=Vs[e.type]||Vs.default;I(s,[e,t,n,i])}function Yg(e){const t=e.chartArea;return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function bo(e,t,n="none",i="api"){const{x:s=1,y:o=1,focalPoint:r=Yg(e)}=typeof t=="number"?{x:t,y:t}:t,a=U(e),{options:{limits:l,zoom:c}}=a;sn(e,a);const u=s!==1,f=o!==1,p=$l(c,r,e);z(p||e.scales,function(g){g.isHorizontal()&&u?la(g,s,r,l):!g.isHorizontal()&&f&&la(g,o,r,l)}),e.update(n),I(c.onZoom,[{chart:e,trigger:i}])}function Kl(e,t,n,i="none",s="api"){const o=U(e),{options:{limits:r,zoom:a}}=o,{mode:l="xy"}=a;sn(e,o);const c=ce(l,"x",e),u=ce(l,"y",e);z(e.scales,function(f){f.isHorizontal()&&c?ca(f,t.x,n.x,r):!f.isHorizontal()&&u&&ca(f,t.y,n.y,r)}),e.update(i),I(a.onZoom,[{chart:e,trigger:s}])}function Xg(e,t,n,i="none",s="api"){const o=U(e);sn(e,o);const r=e.scales[t];Le(r,n,void 0,!0),e.update(i),I(o.options.zoom?.onZoom,[{chart:e,trigger:s}])}function qg(e,t="default"){const n=U(e),i=sn(e,n);z(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 Gg(e,t){const n=e.originalScaleLimits[t];if(!n)return;const{min:i,max:s}=n;return R(s.options,s.scale)-R(i.options,i.scale)}function Kg(e){const t=U(e);let n=1,i=1;return z(e.scales,function(s){const o=Gg(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 ua(e,t,n,i){const{panDelta:s}=i,o=s[e.id]||0;le(o)===le(t)&&(t+=o);const r=Ws[e.type]||Ws.default;I(r,[e,t,n])?s[e.id]=0:s[e.id]=t}function Zl(e,t,n,i="none"){const{x:s=0,y:o=0}=typeof t=="number"?{x:t,y:t}:t,r=U(e),{options:{pan:a,limits:l}}=r,{onPan:c}=a||{};sn(e,r);const u=s!==0,f=o!==0;z(n||e.scales,function(p){p.isHorizontal()&&u?ua(p,s,l,r):!p.isHorizontal()&&f&&ua(p,o,l,r)}),e.update(i),I(c,[{chart:e}])}function Ql(e){const t=U(e);sn(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 Zg(e){const t=U(e),n={};for(const i of Object.keys(e.scales))n[i]=t.updatedScaleLimits[i];return n}function Qg(e){const t=Ql(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 ha(e){const t=U(e);return t.panning||t.dragging}const fa=(e,t,n)=>Math.min(n,Math.max(t,e));function at(e,t){const{handlers:n}=U(e),i=n[t];i&&i.target&&(i.target.removeEventListener(t,i),delete n[t])}function En(e,t,n,i){const{handlers:s,options:o}=U(e),r=s[n];if(r&&r.target===t)return;at(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 Jg(e,t){const n=U(e);n.dragStart&&(n.dragging=!0,n.dragEnd=t,e.update("none"))}function tm(e,t){const n=U(e);!n.dragStart||t.key!=="Escape"||(at(e,"keydown"),n.dragging=!1,n.dragStart=n.dragEnd=null,e.update("none"))}function js(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 Jl(e,t,n){const{onZoomStart:i,onZoomRejected:s}=n;if(i){const o=js(t,e);if(I(i,[{chart:e,event:t,point:o}])===!1)return I(s,[{chart:e,event:t}]),!1}}function em(e,t){if(e.legend){const o=It(t,e);if(Ze(o,e.legend))return}const n=U(e),{pan:i,zoom:s={}}=n.options;if(t.button!==0||Ul(Rn(i),t)||mo(Rn(s.drag),t))return I(s.onZoomRejected,[{chart:e,event:t}]);Jl(e,t,s)!==!1&&(n.dragStart=t,En(e,e.canvas.ownerDocument,"mousemove",Jg),En(e,window.document,"keydown",tm))}function nm({begin:e,end:t},n){let i=t.x-e.x,s=t.y-e.y;const o=Math.abs(i/s);o>n?i=Math.sign(i)*Math.abs(s*n):o<n&&(s=Math.sign(s)*Math.abs(i/n)),t.x=e.x+i,t.y=e.y+s}function da(e,t,n,{min:i,max:s,prop:o}){e[i]=fa(Math.min(n.begin[o],n.end[o]),t[i],t[s]),e[s]=fa(Math.max(n.begin[o],n.end[o]),t[i],t[s])}function im(e,t,n){const i={begin:js(t.dragStart,e),end:js(t.dragEnd,e)};if(n){const s=e.chartArea.width/e.chartArea.height;nm(i,s)}return i}function tc(e,t,n,i){const s=ce(t,"x",e),o=ce(t,"y",e),{top:r,left:a,right:l,bottom:c,width:u,height:f}=e.chartArea,p={top:r,left:a,right:l,bottom:c},g=im(e,n,i&&s&&o);s&&da(p,e.chartArea,g,{min:"left",max:"right",prop:"x"}),o&&da(p,e.chartArea,g,{min:"top",max:"bottom",prop:"y"});const x=p.right-p.left,y=p.bottom-p.top;return{...p,width:x,height:y,zoomX:s&&x?1+(u-x)/u:1,zoomY:o&&y?1+(f-y)/f:1}}function sm(e,t){const n=U(e);if(!n.dragStart)return;at(e,"mousemove");const{mode:i,onZoomComplete:s,drag:{threshold:o=0,maintainAspectRatio:r}}=n.options.zoom,a=tc(e,i,{dragStart:n.dragStart,dragEnd:t},r),l=ce(i,"x",e)?a.width:0,c=ce(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}Kl(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 om(e,t,n){if(mo(Rn(n.wheel),t)){I(n.onZoomRejected,[{chart:e,event:t}]);return}if(Jl(e,t,n)!==!1&&(t.cancelable&&t.preventDefault(),t.deltaY!==void 0))return!0}function rm(e,t){const{handlers:{onZoomComplete:n},options:{zoom:i}}=U(e);if(!om(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}};bo(e,a,"zoom","wheel"),I(n,[{chart:e}])}function am(e,t,n,i){n&&(U(e).handlers[t]=Pg(()=>I(n,[{chart:e}]),i))}function lm(e,t){const n=e.canvas,{wheel:i,drag:s,onZoomComplete:o}=t.zoom;i.enabled?(En(e,n,"wheel",rm),am(e,"onZoomComplete",o,250)):at(e,"wheel"),s.enabled?(En(e,n,"mousedown",em),En(e,n.ownerDocument,"mouseup",sm)):(at(e,"mousedown"),at(e,"mousemove"),at(e,"mouseup"),at(e,"keydown"))}function cm(e){at(e,"mousedown"),at(e,"mousemove"),at(e,"mouseup"),at(e,"wheel"),at(e,"click"),at(e,"keydown")}function um(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"&&(mo(Rn(s),r)||Ul(Rn(o.drag),r))?(I(s.onPanRejected,[{chart:e,event:i}]),!1):!0}}function hm(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 ec(e,t,n){if(t.scale){const{center:i,pointers:s}=n,o=1/t.scale*n.scale,r=n.target.getBoundingClientRect(),a=hm(s[0],s[1]),l=t.options.zoom.mode,c={x:a.x&&ce(l,"x",e)?o:1,y:a.y&&ce(l,"y",e)?o:1,focalPoint:{x:i.x-r.left,y:i.y-r.top}};bo(e,c,"zoom","pinch"),t.scale=n.scale}}function fm(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 dm(e,t,n){t.scale&&(ec(e,t,n),t.scale=null,I(t.options.zoom.onZoomComplete,[{chart:e}]))}function nc(e,t,n){const i=t.delta;i&&(t.panning=!0,Zl(e,{x:n.deltaX-i.x,y:n.deltaY-i.y},t.panScales),t.delta={x:n.deltaX,y:n.deltaY})}function pm(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=$l(t.options.pan,a,e),t.delta={x:0,y:0},nc(e,t,n)}function gm(e,t){t.delta=null,t.panning&&(t.panning=!1,t.filterNextClick=!0,I(t.options.pan.onPanComplete,[{chart:e}]))}const Us=new WeakMap;function pa(e,t){const n=U(e),i=e.canvas,{pan:s,zoom:o}=t,r=new Mn.Manager(i);o&&o.pinch.enabled&&(r.add(new Mn.Pinch),r.on("pinchstart",a=>fm(e,n,a)),r.on("pinch",a=>ec(e,n,a)),r.on("pinchend",a=>dm(e,n,a))),s&&s.enabled&&(r.add(new Mn.Pan({threshold:s.threshold,enable:um(e,n)})),r.on("panstart",a=>pm(e,n,a)),r.on("panmove",a=>nc(e,n,a)),r.on("panend",()=>gm(e,n))),Us.set(e,r)}function ga(e){const t=Us.get(e);t&&(t.remove("pinchstart"),t.remove("pinch"),t.remove("pinchend"),t.remove("panstart"),t.remove("pan"),t.remove("panend"),t.destroy(),Us.delete(e))}function mm(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 bm="2.2.0";function ci(e,t,n){const i=n.zoom.drag,{dragStart:s,dragEnd:o}=U(e);if(i.drawTime!==t||!o)return;const{left:r,top:a,width:l,height:c}=tc(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 ym={id:"zoom",version:bm,defaults:{pan:{enabled:!1,mode:"xy",threshold:10,modifierKey:null},zoom:{wheel:{enabled:!1,speed:.1,modifierKey:null},drag:{enabled:!1,drawTime:"beforeDatasetsDraw",modifierKey:null},pinch:{enabled:!1},mode:"xy"}},start:function(e,t,n){const i=U(e);i.options=n,Object.prototype.hasOwnProperty.call(n.zoom,"enabled")&&console.warn("The option \`zoom.enabled\` is no longer supported. Please use \`zoom.wheel.enabled\`, \`zoom.drag.enabled\`, or \`zoom.pinch.enabled\`."),(Object.prototype.hasOwnProperty.call(n.zoom,"overScaleMode")||Object.prototype.hasOwnProperty.call(n.pan,"overScaleMode"))&&console.warn("The option \`overScaleMode\` is deprecated. Please use \`scaleMode\` instead (and update \`mode\` as desired)."),Mn&&pa(e,n),e.pan=(s,o,r)=>Zl(e,s,o,r),e.zoom=(s,o)=>bo(e,s,o),e.zoomRect=(s,o,r)=>Kl(e,s,o,r),e.zoomScale=(s,o,r)=>Xg(e,s,o,r),e.resetZoom=s=>qg(e,s),e.getZoomLevel=()=>Kg(e),e.getInitialScaleBounds=()=>Ql(e),e.getZoomedScaleBounds=()=>Zg(e),e.isZoomedOrPanned=()=>Qg(e),e.isZoomingOrPanning=()=>ha(e)},beforeEvent(e,{event:t}){if(ha(e))return!1;if(t.type==="click"||t.type==="mouseup"){const n=U(e);if(n.filterNextClick)return n.filterNextClick=!1,!1}},beforeUpdate:function(e,t,n){const i=U(e),s=i.options;i.options=n,mm(s,n)&&(ga(e),pa(e,n)),lm(e,n)},beforeDatasetsDraw(e,t,n){ci(e,"beforeDatasetsDraw",n)},afterDatasetsDraw(e,t,n){ci(e,"afterDatasetsDraw",n)},beforeDraw(e,t,n){ci(e,"beforeDraw",n)},afterDraw(e,t,n){ci(e,"afterDraw",n)},stop:function(e){cm(e),Mn&&ga(e),Ag(e)},panFunctions:Ws,zoomFunctions:Bs,zoomRectFunctions:Vs};function xm({data:e,...t}){const n=Ge(null),i=Ge(null);return ut(()=>{zs.register(ym,Sg,Nd,vg,ng,eg,lg,mg);const s=i.current,o=n.current=new zs(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()}},[]),m("canvas",{ref:i,...t})}function vm(){const e=he();ut(()=>{const n=i=>{Pn(i)||e()};return $?.on("mount",n),$?.on("unmount",n),()=>{$?.off("mount",n),$?.off("unmount",n)}},[]);const t=$?.profilingContext;return m("div",{className:"flex flex-col gap-2"},qa(t.appStats).filter(([n])=>!Pn(n)).map(([n])=>m(_m,{key:n.id,app:n})))}const ma=100,ba=e=>Object.entries(e).map(([t,{values:n,color:i}])=>({label:t,data:n,fill:!1,borderColor:i,tension:.1}));function _m({app:e}){const t=he(),n=Ge({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:ba(n.current)}),s=J(!1),o=$?.profilingContext;return ut(()=>{const r=a=>{a.id===e.id&&t()};return $?.on("update",r),()=>$?.off("update",r)},[]),ut(()=>{const r=[];Object.entries(n.current).forEach(([l,{values:c}])=>{const u=p=>{p.id===e.id&&s.peek()!==!0&&c[c.length-1]++},f=l;o.addEventListener(f,u),r.push(()=>o.removeEventListener(f,u))});const a=setInterval(()=>{if(s.peek()===!0)return;const l=[...i.value.labels];Object.values(n.current).forEach(c=>{c.values.push(0),c.values.length>ma&&c.values.shift()}),l.push((performance.now()/1e3).toFixed(2)),l.length>ma&&l.shift(),i.value={labels:l,datasets:ba(n.current)}},100);return()=>{r.forEach(l=>l()),clearInterval(a)}},[]),m("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"},m("div",{className:"grid items-start gap-2",style:"grid-template-columns: 1fr max-content;"},m("div",{className:"flex flex-col gap-2"},m("span",null,e.name),m(xm,{data:i,className:"w-full max-w-full min-h-20 bg-black bg-opacity-30",onmouseenter:()=>s.value=!0,onmouseleave:()=>s.value=!1})),m("div",{className:"text-xs grid grid-cols-2 gap-x-4",style:"grid-template-columns: auto auto;"},m("span",{className:"text-right"},"Mount duration:"),o.mountDuration(e).toFixed(2)," ms",m("span",{className:"text-right"},"Total updates:"),m("span",null,o.totalTicks(e).toLocaleString()),m("span",{className:"text-right"},"Avg. update duration:"),o.averageTickDuration(e).toFixed(2)," ms",m("span",{className:"text-right"},"Latest update:"),m("span",null,o.lastTickDuration(e).toFixed(2)," ms"))))}const bn=ht([]),ic=ht(""),wm=Ya(()=>ic.value.toLowerCase().split(" ").filter(e=>e.length>0));function Sm(e){return wm.value.every(t=>e.toLowerCase().includes(t))}function km(){const e=he();ut(()=>{const n=i=>{Pn(i)||e()};return $?.on("update",n),()=>$?.off("update",n)},[]);const t=$?.SWRGlobalCache??new Map;return t.size===0?m("div",{className:"flex flex-col items-center justify-center h-full text-neutral-400"},m(Ga,null),m("h2",{className:"text-lg italic"},"No SWR detected")):m("div",{className:"flex flex-col gap-2 items-start"},m(nl,{value:ic,className:"sticky top-0"}),m("div",{className:"flex flex-col gap-2 w-full"},qa(t).filter(([n])=>Sm(n)).map(([n,i])=>m(Tm,{key:n,entry:i}))))}function Tm({key:e,entry:t}){const n=bn.value.includes(e),i=he();ut(()=>{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=We(()=>{n?bn.value=bn.value.filter(o=>o!==e):bn.value=[...bn.value,e]},[n]);return m("div",{className:"flex flex-col"},m("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,m(re,{className:"transition-all"+(n?" rotate-90":"")})),n&&m("div",{className:"flex flex-col gap-2 p-2 border border-white border-opacity-10"},m(Ae,{data:{resource:t.resource.peek(),isMutating:t.isMutating.peek(),isValidating:t.isValidating.peek()},mutable:!1,objectRefAcc:[],keys:[],onChange:()=>{}})))}const Mm=e=>m("main",{className:"flex flex-col flex-1 max-h-[calc(100vh-1rem)] overflow-y-auto",style:e.active?{}:{display:"none"}},e.children),$s={Apps:{Icon:Fu,View:bh},Stores:{Icon:Uu,View:vh},SWR:{Icon:Wu,View:km},Profiling:{Icon:Vu,View:vm},Settings:{Icon:Hu,View:Yu}},Oi=ht("Apps");let ya=ie.peek();ie.subscribe(e=>{e!==ya&&e!==null&&(Oi.value="Apps"),ya=e});function Em(){return m($u,null,m("nav",{className:"flex flex-col gap-2 justify-between p-2 bg-neutral-400 bg-opacity-5 border border-white border-opacity-10 rounded"},m("div",{className:"flex flex-col gap-2"},Object.keys($s).map(e=>m(Om,{key:e,title:e})))),Object.entries($s).map(([e,{View:t}])=>m(Mm,{key:e,active:Oi.value===e},m(t,null))))}function Om({title:e}){const{Icon:t}=$s[e];return m("button",{key:e,onclick:()=>{Oi.value=e},className:"flex items-center px-2 py-1 gap-2 rounded border text-xs border-white border-opacity-10"+(Oi.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))}Iu(m(Em,null),document.getElementById("app"));Ke.send({type:"ready"});setInterval(()=>{window.opener||window.close()},250);</script>
1755
+ <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}.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-6{margin-left:1.5rem}.flex{display:flex}.grid{display:grid}.hidden{display:none}.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-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-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-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}.text-right{text-align:right}.text-\\[10px\\]{font-size:10px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.italic{font-style:italic}.text-neutral-100{--tw-text-opacity: 1;color:rgb(245 245 245 / var(--tw-text-opacity, 1))}.text-neutral-300{--tw-text-opacity: 1;color:rgb(212 212 212 / var(--tw-text-opacity, 1))}.text-neutral-400{--tw-text-opacity: 1;color:rgb(163 163 163 / var(--tw-text-opacity, 1))}.text-primary{--tw-text-opacity: 1;color:rgb(220 20 60 / var(--tw-text-opacity, 1))}.accent-red-500{accent-color:#ef4444}.opacity-50{opacity:.5}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:root{color-scheme:dark}#app{min-width:-moz-fit-content;min-width:fit-content;background-image:linear-gradient(#171616,#0e0e0e);color:#fff;min-height:100vh;width:100%;display:flex;flex-direction:row;padding:.5rem;gap:.5rem}select{background:url("data:image/svg+xml,<svg height='10px' width='10px' viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'><path d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/></svg>") no-repeat;background-position:calc(100% - .75rem) center!important;-moz-appearance:none!important;-webkit-appearance:none!important;appearance:none!important;padding-right:2rem!important}select:not([disabled]){cursor:pointer}.last\\:border-b-0:last-child{border-bottom-width:0px}.hover\\:bg-neutral-700:hover{--tw-bg-opacity: 1;background-color:rgb(64 64 64 / var(--tw-bg-opacity, 1))}.hover\\:bg-white:hover{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.hover\\:bg-opacity-10:hover{--tw-bg-opacity: .1}.hover\\:opacity-100:hover{opacity:1}.focus\\:outline:focus{outline-style:solid}.focus\\:outline-primary:focus{outline-color:#dc143c}@media (min-width: 640px){.sm\\:inline{display:inline}}</style>
1725
1756
  </head>
1726
1757
  <body class="w-full min-h-screen">
1727
1758
  <div id="app"></div>
@@ -1731,1176 +1762,779 @@ var dist_default = `<!DOCTYPE html>
1731
1762
  `;
1732
1763
 
1733
1764
  // ../devtools-host/dist/index.js
1734
- var dist_default2 = `var __defProp = Object.defineProperty;
1735
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
1765
+ var dist_default2 = `var Ue="production";if(Ue!=="development"&&Ue!=="production")throw new Error("NODE_ENV must either be set to development or production.");var l=Ue==="development";var Ge=Symbol.for("kiru.signal"),kt=Symbol.for("kiru.context"),oe=Symbol.for("kiru.contextProvider"),X=Symbol.for("kiru.fragment"),We=Symbol.for("kiru.error"),S=Symbol.for("kiru.hmrAccept"),ke=Symbol.for("kiru.memo"),_e=Symbol.for("kiru.hydrationBoundary"),Be=50,D=2,M=4,ue=8,V=16,Ce=32,de=64,ie=128;var _t=/^on:?/;var qe=new Set(["animateTransform","circle","clipPath","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","path","polygon","polyline","radialGradient","rect","stop","svg","switch","symbol","text","textPath","title","tspan","use"]),Ye=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"]),Ct=new Map([["acceptCharset","accept-charset"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["httpEquiv","http-equiv"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]);var C={current:null},Te={current:0},T={current:"window"in globalThis?"dom":"string"};var Tt,k=class extends Error{constructor(t){let r=typeof t=="string"?t:t.message;super(r),this[Tt]=!0,typeof t!="string"&&(l&&t?.vNode&&(this.customNodeStack=Kr(t.vNode)),this.fatal=t?.fatal)}static isKiruError(t){return t instanceof Error&&t[We]===!0}};Tt=We;function Kr(e){let t=e,r=[];for(;t&&t.parent;)typeof t.type=="function"?r.push(Ur(t.type)):typeof t.type=="string"&&r.push(t.type),t=t.parent;let n=typeof e.type=="function"?e:Mt(e,o=>typeof o.type=="function");return\`The above error occurred in the <\${At(n?.type||H)}> component:
1736
1766
 
1737
- // src/index.ts
1738
- import { createElement as createElement7, mount } from "kiru";
1767
+ \${r.map(o=>\` at \${o}\`).join(\`
1768
+ \`)}
1769
+ \`}function Ur(e){let t=At(e);if(l){let r=Gr(e);r&&(t=\`\${t} (\${r})\`)}return t}function At(e){return e.displayName??(e.name||"Anonymous Function")}function Gr(e){return e.toString().match(/\\/\\/ \\[kiru_devtools\\]:(.*)/)?.[1]??null}var me={stack:new Array,current:function(){return this.stack[this.stack.length-1]}},$=new Map,I=new Map;function Q(e,t=!1){return v.isSignal(e)?t?e.value:e.peek():e}var Xe=()=>{$.forEach(e=>e()),$.clear()};var ee={parentStack:[],childIdxStack:[],eventDeferrals:new Map,parent:function(){return this.parentStack[this.parentStack.length-1]},clear:function(){this.parentStack.length=0,this.childIdxStack.length=0},pop:function(){this.parentStack.pop(),this.childIdxStack.pop()},push:function(e){this.parentStack.push(e),this.childIdxStack.push(0)},currentChild:function(){return this.parentStack[this.parentStack.length-1].childNodes[this.childIdxStack[this.childIdxStack.length-1]]},nextChild:function(){return this.parentStack[this.parentStack.length-1].childNodes[this.childIdxStack[this.childIdxStack.length-1]++]},bumpChildIndex:function(){this.childIdxStack[this.childIdxStack.length-1]++},captureEvents:function(e){Ot(e,!0),this.eventDeferrals.set(e,[])},resetEvents:function(e){this.eventDeferrals.delete(e)},releaseEvents:function(e){Ot(e,!1);let t=this.eventDeferrals.get(e);for(;t?.length;)t.shift()()}},Wr=e=>{let t=e.target;!e.isTrusted||!t||ee.eventDeferrals.get(t)?.push(()=>t.dispatchEvent(e))},Ot=(e,t)=>{for(let r in e)if(r.startsWith("on")){let n=r.substring(2);e[t?"addEventListener":"removeEventListener"](n,Wr,{passive:!0})}};var rt=!1,Je=!1,Rt=e=>{e.preventDefault(),e.stopPropagation(),Je=!0},se=null;function Dt(){rt=!0,se=document.activeElement,se&&se!==document.body&&se.addEventListener("blur",Rt)}function Pt(){Je&&(se.removeEventListener("blur",Rt),se.isConnected&&se.focus(),Je=!1),rt=!1}function Ze(e,t){if(typeof e=="function"){e(t);return}if(v.isSignal(e)){e.sneak(t),e.notify({filter:r=>typeof r=="function"});return}e.current=t}function Lt(e){let t=e.type;return t=="#text"?Br(e):qe.has(t)?document.createElementNS("http://www.w3.org/2000/svg",t):document.createElement(t)}function Br(e){let{nodeValue:t}=e.props;if(!v.isSignal(t))return document.createTextNode(t);let r=t.peek()??"",n=document.createTextNode(r);return et(e,n,t),n}function qr(e,t,r){let n=Qe.get(e)??{},o=n[t]=s=>{if(rt){s.preventDefault(),s.stopPropagation();return}r(s)};return Qe.set(e,n),o}var Qe=new WeakMap;function Nt(e){let t=e.dom,r=e.prev?.props??{},n=e.props??{},o=new Set([...Object.keys(r),...Object.keys(n)]),s=T.current==="hydrate";o.forEach(i=>{let a=r[i],u=n[i];if(ge.internalProps.includes(i)&&i!=="innerHTML"){i==="ref"&&a!==u&&(a&&Ze(a,null),u&&Ze(u,t));return}if(ge.isEvent(i)){if(a!==u||T.current==="hydrate"){let c=i.replace(_t,""),d=c==="focus"||c==="blur";i in r&&t.removeEventListener(c,d?Qe.get(e)?.[c]:a),i in n&&t.addEventListener(c,d?qr(e,c,u):u)}return}if(!(t instanceof Text)){if(a===u||s&&t.getAttribute(i)===u)return;if(v.isSignal(a)&&e.cleanups){let c=e.cleanups[i];c&&(c(),delete e.cleanups[i])}if(v.isSignal(u))return Zr(e,t,i,u,a);Ae(t,i,u,a);return}v.isSignal(u)||t.nodeValue!==u&&(t.nodeValue=u)})}function Yr(e){return e.multiple?Array.from(e.selectedOptions).map(t=>t.value):e.value}function Vt(e,t){if(!e.multiple||t===void 0||t===null||t===""){e.value=t;return}Array.from(e.options).forEach(r=>{r.selected=t.indexOf(r.value)>-1})}var Xr={value:"input",checked:"change",open:"toggle",volume:"volumechange",playbackRate:"ratechange",currentTime:"timeupdate"},Jr=["progress","meter","number","range"];function Zr(e,t,r,n,o){let s=e.cleanups??(e.cleanups={}),[i,a]=r.split(":");if(i!=="bind")return s[r]=n.subscribe((m,_)=>{Ae(t,r,m,_),l&&window.__kiru?.profilingContext?.emit("signalAttrUpdate",J(e))}),Ae(t,r,n.peek(),Q(o));let u=Xr[a];if(!u){l&&console.error(\`[kiru]: \${a} is not a valid element binding attribute.\`);return}let c=t instanceof HTMLSelectElement,d=c?m=>Vt(t,m):m=>t[a]=m,h=m=>{d(m),l&&window.__kiru?.profilingContext?.emit("signalAttrUpdate",J(e))},E=m=>{n.sneak(m),n.notify({filter:_=>_!==h})},f;if(a==="value"){let m=Jr.indexOf(t.type)!==-1;f=()=>{let _=t.value;c?_=Yr(t):typeof n.peek()=="number"&&m&&(_=t.valueAsNumber),E(_)}}else f=m=>{let _=m.target[a];a==="currentTime"&&n.peek()===_||E(_)};t.addEventListener(u,f);let g=n.subscribe(h);return s[r]=()=>{t.removeEventListener(u,f),g()},Ae(t,a,n.peek(),Q(o))}function et(e,t,r){(e.cleanups??(e.cleanups={})).nodeValue=r.subscribe((n,o)=>{n!==o&&(t.nodeValue=n,l&&window.__kiru?.profilingContext?.emit("signalTextUpdate",J(e)))})}function Ht(e){let t=ee.nextChild();if(!t)throw new k({message:"Hydration mismatch - no node found",vNode:e});let r=t.nodeName;if(qe.has(r)||(r=r.toLowerCase()),e.type!==r)throw new k({message:\`Hydration mismatch - expected node of type \${e.type.toString()} but received \${r}\`,vNode:e});if(e.dom=t,e.type!=="#text"&&!(e.flags&V)){Nt(e);return}v.isSignal(e.props.nodeValue)&&et(e,t,e.props.nodeValue);let n=e,o=e.sibling;for(;o&&o.type==="#text";){let s=o;ee.bumpChildIndex();let i=String(Q(n.props.nodeValue)??""),a=n.dom.splitText(i.length);s.dom=a,v.isSignal(s.props.nodeValue)&&et(s,a,s.props.nodeValue),n=o,o=o.sibling}}function $t(e,t,r,n=!1){if(r===null)return e.removeAttribute(t),!0;switch(typeof r){case"undefined":case"function":case"symbol":return e.removeAttribute(t),!0;case"boolean":if(n&&!r)return e.removeAttribute(t),!0}return!1}function Qr(e,t,r){let n=Ye.has(t);$t(e,t,r,n)||e.setAttribute(t,n&&typeof r=="boolean"?"":String(r))}var en=["INPUT","TEXTAREA"],tn=e=>en.indexOf(e.nodeName)>-1;function Ae(e,t,r,n){if(r!==n)switch(t){case"style":return on(e,r,n);case"className":return nn(e,r);case"innerHTML":return rn(e,r);case"muted":e.muted=!!r;return;case"value":if(e.nodeName==="SELECT")return Vt(e,r);let o=r==null?"":String(r);if(tn(e)){e.value=o;return}e.setAttribute("value",o);return;case"checked":if(e.nodeName==="INPUT"){e.checked=!!r;return}e.setAttribute("checked",String(r));return;default:return Qr(e,Ut(t),r)}}function rn(e,t){if(t==null||typeof t=="boolean"){e.innerHTML="";return}e.innerHTML=String(t)}function nn(e,t){let r=Q(t);if(!r)return e.removeAttribute("class");e.setAttribute("class",r)}function on(e,t,r){if($t(e,"style",t))return;if(typeof t=="string"){e.setAttribute("style",t);return}let n={};typeof r=="string"?e.setAttribute("style",""):typeof r=="object"&&r&&(n=r);let o=t;new Set([...Object.keys(n),...Object.keys(o)]).forEach(i=>{let a=n[i],u=o[i];if(a!==u){if(u===void 0){e.style[i]="";return}e.style[i]=u}})}function sn(e){let t=e.parent,r=t?.dom;for(;t&&!r;)t=t.parent,r=t?.dom;if(!r||!t){if(!e.parent&&e.dom)return e;throw new k({message:"No DOM parent found while attempting to place node.",vNode:e})}return t}function an(e,t){let{node:r,lastChild:n}=t,o=e.dom;if(n){n.after(o);return}let s=It(e,r);if(s){r.dom.insertBefore(o,s);return}r.dom.appendChild(o)}function It(e,t){let r=e;for(;r;){let n=r.sibling;for(;n;){if(!(n.flags&(M|V))){let o=ln(n);if(o?.isConnected)return o}n=n.sibling}if(r=r.parent,!r||r.flags&V||r===t)return}}function ln(e){let t=e;for(;t;){if(t.dom)return t.dom;if(t.flags&V)return;t=t.child}}function Ft(e){if(T.current==="hydrate")return j(e,he);let t={node:e.dom?e:sn(e)};tt(e,t,(e.flags&M)>0),e.dom&&!(e.flags&V)&&zt(e,t,!1),he(e)}function tt(e,t,r){let n=e.child;for(;n;){if(n.flags&de){n.flags&M&&un(n,t),he(n),n=n.sibling;continue}n.dom?(tt(n,{node:n},!1),n.flags&V||zt(n,t,r)):tt(n,t,(n.flags&M)>0||r),he(n),n=n.sibling}}function zt(e,t,r){(r||!e.dom.isConnected||e.flags&M)&&an(e,t),(!e.prev||e.flags&D)&&Nt(e),t.lastChild=e.dom}function jt(e){e===e.parent?.child&&(e.parent.child=e.sibling);let t;l&&(t=J(e)),j(e,r=>{let{hooks:n,subs:o,cleanups:s,dom:i,props:{ref:a}}=r;for(o?.forEach(u=>u()),s&&Object.values(s).forEach(u=>u());n?.length;)n.pop().cleanup?.();l&&(window.__kiru?.profilingContext?.emit("removeNode",t),i instanceof Element&&delete i.__kiruNode),i&&(a&&Ze(a,null),i.isConnected&&!(r.flags&V)&&i.remove(),delete r.dom)}),e.parent=null}function un(e,t){if(!e.child)return;let r=[];if(Kt(e.child,r),r.length===0)return;let{node:n,lastChild:o}=t;if(o)o.after(...r);else{let s=It(e,n),i=n.dom;if(s){let[a,...u]=r;i.insertBefore(a,s),a.after(...u)}else i.append(...r)}t.lastChild=r[r.length-1]}function Kt(e,t){let r=e;for(;r;)r.dom?t.push(r.dom):r.child&&Kt(r.child,t),r=r.sibling}function Gt(e){return typeof e=="function"&&typeof e[ke]?.arePropsEqual=="function"}function p(e,t=null,...r){if(e===K)return K({children:r,...t});let n={type:e,flags:0,index:0,depth:0,props:{},parent:null,sibling:null,child:null,prev:null,deletions:null};if(Gt(e)&&(n.flags|=Ce,n.arePropsEqual=e[ke].arePropsEqual),t!==null){let{key:s,ref:i,...a}=t;Wt(s)&&(n.props.key=s.toString()),Bt(i)&&(n.props.ref=i),Object.assign(n.props,a)}let o=r.length===1?r[0]:r.length>1?r:null;return o!==null&&(n.props.children=o),n}function K({children:e,key:t}){return p(X,t?{key:t}:null,e)}var it;function Re(e,t){return l&&(it=J(e)),Array.isArray(t)?(l&&(tr in t&&mn(e,t),dn(e,t)),fn(e,t)):cn(e,t)}function cn(e,t){let r=e.child;if(r===null)return Jt(e,t);let n=r.sibling,o=Yt(e,r,t);if(o!==null)return r&&r!==o&&!o.prev?ot(e,r):n&&ot(e,n),o;{let s=rr(r),i=Zt(s,e,0,t);if(i!==null){let a=i.prev;if(a!==null){let u=a.props.key;s.delete(u===void 0?a.index:u)}Me(i,0,0)}return s.forEach(a=>Oe(e,a)),i}}function fn(e,t){let r=null,n=null,o=e.child,s=null,i=0,a=0;for(;o!==null&&a<t.length;a++){o.index>a?(s=o,o=null):s=o.sibling;let c=Yt(e,o,t[a]);if(c===null){o===null&&(o=s);break}o&&!c.prev&&Oe(e,o),i=Me(c,i,a),n===null?r=c:n.sibling=c,n=c,o=s}if(a===t.length)return ot(e,o),r;if(o===null){for(;a<t.length;a++){let c=Jt(e,t[a]);c!==null&&(i=Me(c,i,a),n===null?r=c:n.sibling=c,n=c)}return r}let u=rr(o);for(;a<t.length;a++){let c=Zt(u,e,a,t[a]);if(c!==null){let d=c.prev;if(d!==null){let h=d.props.key;u.delete(h===void 0?d.index:h)}i=Me(c,i,a),n===null?r=c:n.sibling=c,n=c}}return u.forEach(c=>Oe(e,c)),r}function Yt(e,t,r){let n=t?.props.key;return Qt(r)?n!==void 0||t?.type==="#text"&&v.isSignal(t.props.nodeValue)?null:qt(e,t,""+r):v.isSignal(r)?t&&t.props.nodeValue!==r?null:qt(e,t,r):ae(r)?r.props.key!==n?null:pn(e,t,r):Array.isArray(r)?n!==void 0?null:(l&&st(r),Xt(e,t,r)):null}function qt(e,t,r){if(t===null||t.type!=="#text"){l&&G();let o=p("#text",{nodeValue:r});return U(o,e),o}return l&&we(),t.props.nodeValue!==r&&(t.props.nodeValue=r,t.flags|=D),t.sibling=null,t}function pn(e,t,r){let{type:n,props:o}=r;if(l&&typeof n=="function"&&(n=A(n)),n===X)return Xt(e,t,o.children||[],o);if(t?.type===n)return l&&we(),t.index=0,t.sibling=null,typeof n=="string"?er(t.props,o)&&(t.flags|=D):t.flags|=D,t.props=o,t.memoizedProps=r.memoizedProps,t;l&&G();let s=p(n,o);return U(s,e),s}function Xt(e,t,r,n={}){if(t===null||t.type!==X){l&&G();let o=p(X,{children:r,...n});return U(o,e),o}return l&&we(),t.props={...t.props,...n,children:r},t.flags|=D,t.sibling=null,t}function Jt(e,t){if(Qt(t)){l&&G();let r=p("#text",{nodeValue:""+t});return U(r,e),r}if(v.isSignal(t)){l&&G();let r=p("#text",{nodeValue:t});return U(r,e),r}if(ae(t)){l&&G();let r=p(t.type,t.props);return U(r,e),r.flags|=M,r}if(Array.isArray(t)){l&&(G(),st(t));let r=K({children:t});return U(r,e),r}return null}function Me(e,t,r){e.index=r;let n=e.prev;if(n!==null){let o=n.index;return o<t?(e.flags|=M,t):o}else return e.flags|=M,t}function Zt(e,t,r,n){if(v.isSignal(n)||typeof n=="string"&&n!==""||typeof n=="number"||typeof n=="bigint"){let s=e.get(r);if(s){if(s.props.nodeValue===n)return s;s.type==="#text"&&v.isSignal(s.props.nodeValue)&&s.cleanups?.nodeValue?.()}l&&G();let i=p("#text",{nodeValue:n});return U(i,t),i.flags|=M,i.index=r,i}if(ae(n)){let{type:s,props:i}=n,a=i.key,u=e.get(a===void 0?r:a);if(u?.type===s)return l&&we(),typeof s=="string"?er(u.props,i)&&(u.flags|=D):u.flags|=D,u.props=i,u.sibling=null,u.index=r,u;l&&G();let c=p(n.type,n.props);return U(c,t),c.flags|=M,c.index=r,c}if(Array.isArray(n)){let s=e.get(r);if(l&&st(n),s)return l&&we(),s.flags|=D,s.props.children=n,s;l&&G();let i=K({children:n});return U(i,t),i.flags|=M,i.index=r,i}return null}function Qt(e){return typeof e=="string"&&e!==""||typeof e=="number"||typeof e=="bigint"}function er(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 U(e,t){e.parent=t,e.depth=t.depth+1}function we(){"window"in globalThis&&window.__kiru?.profilingContext?.emit("updateNode",it)}function G(){"window"in globalThis&&window.__kiru?.profilingContext?.emit("createNode",it)}var tr=Symbol("kiru:marked-list-child");function st(e){Object.assign(e,{[tr]:!0})}function rr(e){let t=new Map;for(;e;){let r=e.props.key;t.set(r===void 0?e.index:r,e),e=e.sibling}return t}function Oe(e,t){e.deletions===null?e.deletions=[t]:e.deletions.push(t)}function ot(e,t){for(;t;)Oe(e,t),t=t.sibling}function dn(e,t){let r=new Set,n=!1;for(let o of t){if(!ae(o))continue;let s=o.props.key;if(typeof s=="string"){if(!n&&r.has(s)){let i=or(e);nr(\`\${i} component produced a child in a list with a duplicate key prop: "\${s}". Keys should be unique so that components maintain their identity across updates\`),n=!0}r.add(s)}}}function mn(e,t){let r=!1,n=!1;for(let o of t){if(!ae(o))continue;typeof o.props.key=="string"?r=!0:n=!0}if(n&&r){let o=or(e);nr(\`\${o} component produced a child in a list without a valid key prop\`)}}function nr(e){let t=\`[kiru]: \${e}. See https://kirujs.dev/keys-warning for more information.\`;console.error(t)}var nt=new WeakMap;function or(e){if(nt.has(e))return nt.get(e);let t=e.parent,r;for(;!r&&t;)typeof t.type=="function"&&(r=t.type),t=t.parent;let n=\`<\${r?.displayName||r?.name||"Anonymous Function"} />\`;return nt.set(e,n),n}var W,B=[],fe=!1,lt=[],De=[],ut=!1,ct=!1,ft=!1,pt=0,ir=[],dt=[],sr=-1;function Pe(e){if(fe){lt.push(e);return}e()}function ye(){fe&&(window.cancelAnimationFrame(sr),ar())}function gt(e){e.flags|=ie,B.push(e),fe=!0,ye()}function P(e){if(T.current==="hydrate")return Pe(()=>mt(e));mt(e)}function gn(){fe||(fe=!0,sr=window.requestAnimationFrame(ar))}function hn(){for(fe=!1;lt.length;)lt.shift()()}function mt(e){if(ut&&(ct=!0),C.current===e){l&&window.__kiru?.profilingContext?.emit("updateDirtied",W),ft=!0;return}if(!(e.flags&(ie|ue))){if(e.flags|=ie,!B.length)return B.push(e),gn();B.push(e)}}function wn(e){j(e,t=>t.flags|=ue),De.push(e)}var yn=(e,t)=>t.depth-e.depth,ce=null;function ar(){if(l){let t=De[0]??B[0];t?(W=J(t),window.__kiru?.profilingContext?.beginTick(W)):W=null}let e=1;for(Dt();B.length;){B.length>e&&B.sort(yn),ce=B.shift(),e=B.length;let t=ce.flags;if(!(t&ue)&&t&ie){let r=ce;for(;r=bn(r););for(;De.length;)jt(De.pop());Ft(ce),ce.flags&=~ie}}if(Pt(),ut=!0,at(ir),ut=!1,ct)return En(),at(dt),ct=!1,pt++,l&&(window.__kiru?.profilingContext?.endTick(W),window.__kiru?.profilingContext?.emit("updateDirtied",W)),ye();pt=0,hn(),at(dt),l&&(window.__kiru.emit("update",W),window.__kiru?.profilingContext?.emit("update",W),window.__kiru?.profilingContext?.endTick(W))}function bn(e){let t=!0;try{let{props:n}=e;if(typeof e.type=="string")xn(e);else if(ht(e.type)){if(e?.type===oe){let{props:{dependents:o,value:s},prev:i}=e;o.size&&i&&i.props.value!==s&&o.forEach(mt)}e.child=Re(e,n.children)}else t=vn(e)}catch(n){if(l&&window.__kiru?.emit("error",W,n instanceof Error?n:new Error(String(n))),k.isKiruError(n)){if(n.customNodeStack&&setTimeout(()=>{throw new Error(n.customNodeStack)}),n.fatal)throw n;console.error(n);return}setTimeout(()=>{throw n})}if(e.deletions!==null&&(e.deletions.forEach(wn),e.deletions=null),t&&e.child)return e.child;let r=e;for(;r;){if(r.immediateEffects&&(ir.push(...r.immediateEffects),r.immediateEffects=void 0),r.effects&&(dt.push(...r.effects),r.effects=void 0),r===ce)return;if(r.sibling)return r.sibling;r=r.parent,T.current==="hydrate"&&r?.dom&&ee.pop()}}function vn(e){let{type:t,props:r,subs:n,prev:o,flags:s}=e;if(s&Ce){if(e.memoizedProps=r,o?.memoizedProps&&e.arePropsEqual(o.memoizedProps,r)&&!e.hmrUpdated)return e.flags|=de,!1;e.flags&=~de}try{C.current=e;let i,a=0;do{if(e.flags&=~ie,ft=!1,Te.current=0,n&&(n.forEach(u=>u()),n.clear()),l){if(i=A(t)(r),delete e.hmrUpdated,++a>Be)throw new k({message:"Too many re-renders. Kiru limits the number of renders to prevent an infinite loop.",fatal:!0,vNode:e});continue}i=t(r)}while(ft);return e.child=Re(e,i),!0}finally{C.current=null}}function xn(e){let{props:t,type:r}=e;l&&wt(e),e.dom||(T.current==="hydrate"?Ht(e):e.dom=Lt(e),l&&e.dom instanceof Element&&(e.dom.__kiruNode=e)),r!=="#text"&&(e.child=Re(e,t.children),e.child&&T.current==="hydrate"&&ee.push(e.dom))}function En(){if(pt>Be)throw new k("Maximum update depth exceeded. This can happen when a component repeatedly calls setState during render or in useLayoutEffect. Kiru limits the number of nested updates to prevent infinite loops.")}function at(e){for(let t=0;t<e.length;t++)e[t]();e.length=0}var lr;(function(e){e.Start="start",e.End="end"})(lr||(lr={}));var pe=null,ur=new Set;function w(e,t,r){let n=C.current;if(n||Sn(e),l&&pe!==null&&!ur.has(e+pe))throw ur.add(e+pe),new k({message:\`Nested primitive "useHook" calls are not supported. "\${e}" was called inside "\${pe}". Strange will most certainly happen.\`,vNode:n});let o=(a,u)=>{if(u?.immediate){(n.immediateEffects??(n.immediateEffects=[])).push(a);return}(n.effects??(n.effects=[])).push(a)},s=Te.current++,i=n.hooks?.at(s);if(l){pe=e,n.hooks??(n.hooks=[]),n.hookSig??(n.hookSig=[]),n.hookSig[s]?n.hookSig[s]!==e&&(console.warn(\`[kiru]: hooks must be called in the same order. Hook "\${e}" was called in place of "\${n.hookSig[s]}". Strange things may happen.\`),n.hooks.length=s,n.hookSig.length=s,i=void 0):n.hookSig[s]=e;let a;i?a=i:(a=typeof t=="function"?t():{...t},a.name=e),n.hooks[s]=a;try{return r({hook:a,isInit:!i,isHMR:n.hmrUpdated,update:()=>P(n),queueEffect:o,vNode:n,index:s})}catch(u){throw u}finally{pe=null}}try{let a=i??(typeof t=="function"?t():{...t});return n.hooks??(n.hooks=[]),n.hooks[s]=a,r({hook:a,isInit:!i,update:()=>P(n),queueEffect:o,vNode:n,index:s})}catch(a){throw a}}function Sn(e){throw new k(\`Hook "\${e}" must be used at the top level of a component or inside another composite hook.\`)}function q(e){e.cleanup&&(e.cleanup(),e.cleanup=void 0)}function O(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 cr,v=class e{constructor(t,r){this[cr]=!0,this.$id=Ne(),this.$value=t,r&&(this.displayName=r),l?(I.set(this.$id,new Set),this.$initialValue=yt(t),this[S]={provide:()=>this,inject:n=>{this.$initialValue===n.$initialValue&&(this.$value=n.$value),I.get(this.$id)?.clear?.(),I.delete(this.$id),this.$id=n.$id,n.__next=this},destroy:()=>{}}):this.$subs=new Set}get value(){if(this.onBeforeRead?.(),l){let t=A(this);return e.entangle(t),t.$value}return e.entangle(this),this.$value}set value(t){if(l){let r=A(this);if(Object.is(r.$value,t))return;r.$prevValue=r.$value,r.$value=t,r.notify();return}Object.is(this.$value,t)||(this.$prevValue=this.$value,this.$value=t,this.notify())}peek(){return this.onBeforeRead?.(),l?A(this).$value:this.$value}sneak(t){if(l){let r=A(this);r.$prevValue=r.$value,r.$value=t;return}this.$prevValue=this.$value,this.$value=t}toString(){if(this.onBeforeRead?.(),l){let t=A(this);return e.entangle(t),\`\${t.$value}\`}return e.entangle(this),\`\${this.$value}\`}subscribe(t){return l?(I.get(this.$id).add(t),()=>I.get(this.$id)?.delete(t)):(this.$subs.add(t),()=>this.$subs.delete(t))}notify(t){if(l)return I.get(this.$id)?.forEach(r=>{if(t?.filter&&!t.filter(r))return;let{$value:n,$prevValue:o}=A(this);return r(n,o)});this.$subs.forEach(r=>{if(!(t?.filter&&!t.filter(r)))return r(this.$value,this.$prevValue)})}static isSignal(t){return typeof t=="object"&&!!t&&Ge in t}static subscribers(t){return l?I.get(t.$id):t.$subs}static makeReadonly(t){let r=Object.getOwnPropertyDescriptor(t,"value");return r&&!r.writable?t:Object.defineProperty(t,"value",{get:function(){return e.entangle(this),this.$value},configurable:!0})}static makeWritable(t){let r=Object.getOwnPropertyDescriptor(t,"value");return r&&r.writable?t:Object.defineProperty(t,"value",{get:function(){return e.entangle(this),this.$value},set:function(n){this.$value=n,this.notify()},configurable:!0})}static entangle(t){let r=C.current,n=me.current();if(n){(!r||r&&y())&&n.set(t.$id,t);return}if(!r||!y())return;let o=t.subscribe(()=>P(r));(r.subs??(r.subs=new Set)).add(o)}static configure(t,r){t.onBeforeRead=r}static dispose(t){if(t.$isDisposed=!0,l){I.delete(t.$id);return}t.$subs.clear()}};cr=Ge;var Le=(e,t)=>new v(e,t),x=(e,t)=>w("useSignal",{signal:null},({hook:r,isInit:n,isHMR:o})=>{if(l&&(n&&(r.dev={devtools:{get:()=>({displayName:r.signal.displayName,value:r.signal.peek()}),set:({value:s})=>{r.signal.value=s}},initialArgs:[e,t]}),o)){let[s,i]=r.dev.initialArgs;(s!==e||i!==t)&&(r.cleanup?.(),n=!0,r.dev.initialArgs=[e,t])}return n&&(r.cleanup=()=>v.dispose(r.signal),r.signal=new v(e,t)),r.signal});function Ve(e){let{id:t,subs:r,fn:n,deps:o=[],onDepChanged:s}=e,i;$.delete(t);let a=!!C.current&&!y();a||(i=new Map,me.stack.push(i));let u=n(...o.map(c=>c.value));if(!a){for(let[d,h]of r)i.has(d)||(h(),r.delete(d));let c=()=>{$.size||queueMicrotask(Xe),$.set(t,s)};for(let[d,h]of i){if(r.has(d))continue;let E=h.subscribe(c);r.set(d,E)}me.stack.pop()}return u}var be=class e extends v{constructor(t,r){if(super(void 0,r),this.$getter=t,this.$unsubs=new Map,this.$isDirty=!0,l){let n=this[S].inject;this[S]={provide:()=>this,inject:o=>{n(o),e.stop(o),this.$isDirty=o.$isDirty},destroy:()=>{}}}v.configure(this,()=>{this.$isDirty&&(l&&this.$isDisposed||e.run(this))})}get value(){return super.value}set value(t){}subscribe(t){return this.$isDirty&&e.run(this),super.subscribe(t)}static dispose(t){e.stop(t),v.dispose(t)}static stop(t){let{$id:r,$unsubs:n}=A(t);$.delete(r),n.forEach(o=>o()),n.clear(),t.$isDirty=!0}static run(t){let r=A(t),{$id:n,$getter:o,$unsubs:s}=r,i=Ve({id:n,subs:s,fn:()=>o(r.$value),onDepChanged:()=>{if(r.$isDirty=!0,l){if(!I?.get(n)?.size)return}else if(!t.$subs.size)return;e.run(r),!Object.is(r.$value,r.$prevValue)&&r.notify()}});r.sneak(i),r.$isDirty=!1}},fr=(e,t)=>new be(e,t),bt=(e,t)=>w("useComputedSignal",{signal:null},({hook:r,isInit:n,isHMR:o})=>(l&&(r.dev={devtools:{get:()=>({displayName:r.signal.displayName,value:r.signal.peek()})}},o&&(r.cleanup?.(),n=!0)),n&&(r.cleanup=()=>be.dispose(r.signal),r.signal=fr(e,t)),r.signal));var ve=class e{constructor(t,r){if(this.id=Ne(),this.getter=t,this.deps=r,this.unsubs=new Map,this.isRunning=!1,this.cleanup=null,l&&(this[S]={provide:()=>this,inject:n=>{n.isRunning||this.stop()},destroy:()=>{this.stop()}},"window"in globalThis)){let n=window.__kiru.HMRContext.signals;n.isWaitingForNextWatchCall()&&n.pushWatch(this)}this.start()}start(){if(!this.isRunning){if(this.isRunning=!0,l&&"window"in globalThis&&window.__kiru?.HMRContext?.isReplacement())return queueMicrotask(()=>{this.isRunning&&e.run(this)});e.run(this)}}stop(){$.delete(this.id),this.unsubs.forEach(t=>t()),this.unsubs.clear(),this.cleanup?.(),this.cleanup=null,this.isRunning=!1}static run(t){let r=A(t),{id:n,getter:o,unsubs:s,deps:i}=r;r.cleanup=Ve({id:n,subs:s,fn:o,deps:i,onDepChanged:()=>{r.cleanup?.(),e.run(r)}})??null}};function pr(e,t){if(typeof e=="function")return new ve(e);let r=e,n=t;return new ve(n,r)}function xe(e,t){if(y())return w("useWatch",{watcher:null},({hook:r,isInit:n,isHMR:o})=>{if(l&&o&&(r.cleanup?.(),n=!0),n){let s=r.watcher=pr(e,t);r.cleanup=()=>s.stop()}return r.watcher})}var ge={internalProps:["children","ref","key","innerHTML"],isEvent:e=>e.startsWith("on"),isProperty:e=>!ge.internalProps.includes(e)&&!ge.isEvent(e)};function Ut(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():Ct.get(e)||e}}function yt(e,t={functions:!0}){let r=new WeakSet;return JSON.stringify(e,(n,o)=>{if(typeof o=="object"&&o!==null){if(r.has(o))return"[CIRCULAR]";r.add(o)}return typeof o=="function"?t.functions?o.toString():\`[FUNCTION (\${o.name||"anonymous"})]\`:o})}function A(e){let t=e;if(l)for(;"__next"in t;)t=t.__next;return t}function y(){return T.current==="dom"||T.current==="hydrate"}function ae(e){return typeof e=="object"&&e!==null&&"type"in e}function ht(e){return e===X||e===oe||e===_e}function dr(e){return e.type===X}function J(e){let t=e;for(;t;){if(t.app)return e.app=t.app;t=t.parent}return null}function he(e){let{props:{children:t,...r},memoizedProps:n,index:o}=e;e.prev={props:r,memoizedProps:n,index:o},e.flags&=~(D|M|ue)}function mr(e,t){if(t.depth<e.depth)return!1;if(e===t)return!0;let r=!1,n=[e];for(;n.length;){let o=n.pop();if(o===t)return!0;o.child&&n.push(o.child),r&&o.sibling&&n.push(o.sibling),r=!0}return!1}function j(e,t){t(e);let r=e.child;for(;r;)t(r),r.child&&j(r,t),r=r.sibling}function Mt(e,t){let r=e.parent;for(;r;){if(t(r))return r;r=r.parent}return null}function wt(e){if("children"in e.props&&e.props.innerHTML)throw new k({message:"Cannot use both children and innerHTML on an element",vNode:e});for(let t in e.props)if("bind:"+t in e.props)throw new k({message:\`Cannot use both bind:\${t} and \${t} on an element\`,vNode:e})}function Wt(e){return typeof e=="string"||typeof e=="number"}function Bt(e){return typeof e=="function"||typeof e=="object"&&!!e&&"current"in e||v.isSignal(e)}var kn="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz-";function Ne(e=10,t=kn){let r="";for(let n=0;n<e;n++)r+=t[Math.random()*t.length|0];return r}var H=Object.freeze(()=>{});function gr(e){return!!e&&(typeof e=="object"||typeof e=="function")&&S in e&&typeof e[S]=="object"&&!!e[S]}function hr(){let e=new Map,t=null,r=!1,n=()=>r,o=!1,s=[],i=[];return{register:h=>{if(t===null)throw new Error("[kiru]: HMR could not register: No active module");let E=new Set;for(let[f,g]of Object.entries(h)){let m=t.hotVars.get(f);if(g.value.__devtoolsFileLink=g.link,typeof g.value=="function"&&m?.value&&(m.value.__next=g.value),g.type==="createStore"&&window.__kiru.stores.add(f,g.value),t.hotVars.set(f,g),!!m){if(gr(m.value)&&gr(g.value)){g.value[S].inject(m.value[S].provide()),m.value[S].destroy();continue}m.type==="component"&&g.type==="component"&&window.__kiru.apps.forEach(_=>{j(_.rootNode,re=>{re.type===m.value&&(re.type=g.value,E.add(_),re.hmrUpdated=!0)})})}}if(E.forEach(f=>f.rootNode&&P(f.rootNode)),r=!1,s.length){let f=0;for(;f<s.length;f++){let g=s[f],m=t.unnamedWatchers[f];m&&(g[S].inject(m[S].provide()),m[S].destroy()),t.unnamedWatchers[f]=g}for(;f<t.unnamedWatchers.length;f++)t.unnamedWatchers[f][S].destroy();t.unnamedWatchers.length=s.length,s.length=0}},prepare:h=>{let E=e.get(h);if(r=!!E,!E)E={hotVars:new Map,unnamedWatchers:[]},e.set(h,E);else for(;i.length;)i.shift()();t=E},isReplacement:n,signals:{registerNextWatch(){o=!0},isWaitingForNextWatchCall(){return o},pushWatch(h){s.push(h),o=!1}},onHmr:h=>{i.push(h)}}}function wr(){let e=new Map,t=new Map;return{appStats:t,emit:(r,n)=>{e.get(r)?.forEach(o=>o(n))},addEventListener:(r,n)=>{e.has(r)||e.set(r,new Set),e.get(r).add(n)},removeEventListener:(r,n)=>{e.has(r)&&e.get(r).delete(n)},mountDuration:r=>{let n=t.get(r);return n?n.mountDuration:0},totalTicks:r=>{let n=t.get(r);return n?n.totalTicks:0},lastTickDuration:r=>{let n=t.get(r);if(!n)return 0;let o=n.timestamps[n.timestamps.length-1];return o.end-o.start},averageTickDuration:r=>{let n=t.get(r);if(!n)return 0;let o=n.timestamps.filter(s=>s.end!==1/0);return o.reduce((s,i)=>s+(i.end-i.start),0)/o.length},beginTick:r=>{t.has(r)||t.set(r,{mountDuration:1/0,timestamps:[],totalTicks:0});let n=t.get(r);n.totalTicks++,n.timestamps.push({start:performance.now(),end:1/0})},endTick:r=>{if(!t.has(r))return;let n=t.get(r),o=n.timestamps[n.timestamps.length-1];o.end=performance.now(),n.mountDuration===1/0&&(n.mountDuration=o.end-o.start),n.timestamps.length>100&&n.timestamps.shift()}}}function _n(){let e=new Map,t=new Set;function r(i,a){e.has(i)||(e.set(i,a),o())}function n(i){e.has(i)&&(e.delete(i),o())}function o(){let i=Object.fromEntries(e);t.forEach(a=>a(i))}function s(i){return t.add(i),i(Object.fromEntries(e)),()=>t.delete(i)}return{add:r,delete:n,subscribe:s,get size(){return e.size}}}function yr(){let e=new Set,t=new Map,r,n,o;function s(c,d,h){t.get(c)?.forEach(E=>E(d,h))}function i(c,d){t.has(c)||t.set(c,new Set),t.get(c).add(d)}function a(c,d){t.get(c)?.delete(d)}let u={get apps(){return Array.from(e)},get stores(){return r},get HMRContext(){return n},get profilingContext(){return o},emit:s,on:i,off:a};return i("mount",c=>e.add(c)),i("unmount",c=>e.delete(c)),l&&(n=hr(),o=wr(),r=_n()),u}var Cn=0;function br(e,t,r){let n=p(t.nodeName.toLowerCase(),{});if(l){if(t.__kiruNode)throw new Error("[kiru]: container in use - call unmount on the previous app first.");t.__kiruNode=n}n.dom=t,n.flags|=V;let o=Cn++,s=r?.name??\`App-\${o}\`,i={id:o,name:s,rootNode:n,render:a,unmount:u};l&&(n.app=i,window.__kiru?.emit("mount",i));function a(c){n.props.children=c,gt(n)}function u(){n.props.children=null,gt(n),l&&(delete t.__kiruNode,delete n.app,window.__kiru?.emit("unmount",i))}return a(e),i}function le(e){return y()?w("useState",{state:void 0,dispatch:H},({hook:t,isInit:r,update:n,isHMR:o})=>{if(l&&(r&&(t.dev={devtools:{get:()=>({value:t.state}),set:({value:s})=>t.state=s},initialArgs:[e]}),o)){let[s]=t.dev.initialArgs;s!==e&&(r=!0,t.dev.initialArgs=[e])}return r&&(t.state=typeof e=="function"?e():e,t.dispatch=s=>{let i=typeof s=="function"?s(t.state):s;Object.is(t.state,i)||(t.state=i,n())}),[t.state,t.dispatch]}):[typeof e=="function"?e():e,H]}function He(e){let t={[kt]:!0,Provider:({value:r,children:n})=>{let[o]=le(()=>new Set);return p(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"}};if(l){let r=t;r[S]={inject:n=>{let o=t.Provider;window.__kiru.apps.forEach(s=>{j(s.rootNode,i=>{i.type===n.Provider&&(i.type=o,i.hmrUpdated=!0,P(i))})})},destroy:()=>{},provide:()=>t}}return t}function Z(e,t){return y()?w("useCallback",{callback:e,deps:t},({hook:r,isHMR:n})=>(l&&(r.dev={devtools:{get:()=>({callback:r.callback,dependencies:r.deps})}},n&&(r.deps=[])),O(t,r.deps)&&(r.deps=t,r.callback=e),r.callback)):e}function F(e,t){if(y())return w("useEffect",{deps:t},({hook:r,isInit:n,isHMR:o,queueEffect:s})=>{l&&(r.dev={devtools:{get:()=>({callback:e,dependencies:r.deps})}},o&&(n=!0)),(n||O(t,r.deps))&&(r.deps=t,q(r),s(()=>{let i=e();typeof i=="function"&&(r.cleanup=i)}))})}function te(e,t){if(y())return w("useLayoutEffect",{deps:t},({hook:r,isInit:n,isHMR:o,queueEffect:s})=>{l&&(r.dev={devtools:{get:()=>({callback:e,dependencies:r.deps})}},o&&(n=!0)),(n||O(t,r.deps))&&(r.deps=t,q(r),s(()=>{let i=e();typeof i=="function"&&(r.cleanup=i)},{immediate:!0}))})}function Ee(e,t){return y()?w("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||O(t,r.deps))&&(r.deps=t,r.value=e()),r.value)):e()}function L(e){return y()?w("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 Tn=He(null);var ja="window"in globalThis?window.__KIRU_LAZY_CACHE??(window.__KIRU_LAZY_CACHE=new Map):new Map;function Er(e){let[t,r]=le(e.initialState||"exited"),n=L(null);te(()=>{e.in&&t!=="entered"&&t!=="entering"?(o("entering"),s("entered")):!e.in&&t!=="exited"&&t!=="exiting"&&(o("exiting"),s("exited"))},[e.in,t]),F(()=>()=>xr(n.current),[]);let o=Z(i=>{xr(n.current),r(i),(i==="entered"||i==="exited")&&e.onTransitionEnd&&e.onTransitionEnd(i)},[]),s=Z(i=>{n.current=window.setTimeout(()=>o(i),Rn(i,e.duration))},[e.duration]);return e.element(t)}var vr=150;function Rn(e,t){if(typeof t=="number")return t;switch(e){case"entered":return t?.in??vr;case"exited":return t?.out??vr}}function xr(e){e!=null&&window.clearTimeout(e)}var Sr;l&&"window"in globalThis&&((Sr=globalThis.window).__kiru??(Sr.__kiru=yr()));var kr=()=>p("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"},p("path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z"}));var $e="kiru.devtools.anchorPosition",_r={x:-16,y:-16};var vt=(e,t,r)=>{if(!t.current)return{..._r};let n=window.innerWidth/e.width,o=window.innerHeight/e.height,s=null,i=null;return e.snapSide==="left"?s=(t.current.offsetWidth-r.width.value)*-1+16:e.snapSide==="right"?s=-16:e.snapSide==="bottom"?i=-16:e.snapSide==="top"&&(i=(window.innerHeight-r.height.value)*-1+16),{x:s??e.x*n,y:i??e.y*o}},Cr=e=>{if(e==null)return null;let t=null,r=e?.__kiruNode?.parent;for(;r;){if(typeof r.type=="function"&&!dr(r)){t=r;break}r=r.parent}return t},Tr=(e,t)=>{let r=[],n=[t.__kiruNode];for(;n.length;){let s=n.pop();if(s===e)break;s?.dom&&r.push(s),s?.parent&&n.push(s.parent)}if(r.length===0)return;let o=r[r.length-1].dom;return o instanceof Element?o:void 0};var Mr={arrayChunkSize:10,objectKeysChunkSize:100};function Or(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;let r=new Set([...Object.keys(e),...Object.keys(t)]);for(let n in r)if(typeof t[n]!=typeof e[n]||typeof e[n]=="object"&&!Or(e[n],t[n]))return!1;return!0}var Ln={...Mr},Ar=localStorage.getItem("kiru.devtools.userSettings");if(Ar)try{let e=JSON.parse(Ar);Or(Mr,e)&&(Ln=e)}catch(e){console.error("kiru.devtools.userSettings error",e)}var wu=He({userSettings:null,saveUserSettings:()=>{}});var ku=Object.freeze(()=>{});var $n="kiru-devtools";"window"in globalThis&&(window.__devtoolsSelection??(window.__devtoolsSelection=null));var xt=class extends BroadcastChannel{send(t){super.postMessage(t)}removeEventListener(t){return super.removeEventListener("message",t)}addEventListener(t){return super.addEventListener("message",t)}},R=new xt($n);var Bu=Symbol.for("devtools.hookGroup");var N=(e,t,r={})=>{F(()=>{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 Ie=()=>{let e=x({x:0,y:0}),t=x({x:0,y:0}),r=x({x:0,y:0});return N("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 Fe="window"in globalThis&&"ResizeObserver"in globalThis.window,Rr=(e,t,r=void 0)=>y()?Fe?w("useResizeObserver",{resizeObserver:null,deps:[e.current]},({isInit:n,hook:o,queueEffect:s})=>(n&&(o.resizeObserver=new ResizeObserver(t),o.cleanup=()=>{o.resizeObserver?.disconnect?.(),o.resizeObserver=null}),s(()=>{O([e.current],o.deps)&&(o.deps=[e.current],o.resizeObserver?.disconnect?.(),e.current&&o.resizeObserver?.observe(e.current,r))}),{isSupported:Fe,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:()=>{q(o)}})):{isSupported:Fe,start:()=>{},stop:()=>{}}:{isSupported:Fe,start:()=>{},stop:()=>{}};var ze="window"in globalThis&&"MutationObserver"in globalThis.window,Dr=(e,t,r=void 0)=>y()?ze?w("useMutationObserver",{mutationObserver:null,deps:[e.current]},({isInit:n,hook:o,queueEffect:s})=>(n?(s(()=>{o.deps=[e.current],o.mutationObserver=new MutationObserver(t),e.current&&o.mutationObserver.observe(e.current,r)}),o.cleanup=()=>{o.mutationObserver?.disconnect?.(),o.mutationObserver=null}):O([e.current],o.deps)&&(o.deps=[e.current],o.mutationObserver?.disconnect?.(),e.current&&o.mutationObserver?.observe(e.current,r)),{isSupported:ze,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:()=>{q(o)}})):{isSupported:ze,start:()=>{},stop:()=>{}}:{isSupported:ze,start:()=>{},stop:()=>{}};var je=(e,t={windowScroll:!0,windowResize:!0})=>{let r=t?.windowScroll??!0,n=t?.windowResize??!0,o=t.immediate??!0,s=x(0),i=x(0),a=x(0),u=x(0),c=x(0),d=x(0),h=x(0),E=x(0),f=()=>{let g=e.current;if(!g){s.value=0,i.value=0,a.value=0,u.value=0,c.value=0,d.value=0,h.value=0,E.value=0;return}let m=g.getBoundingClientRect();s.value=m.width,i.value=m.height,a.value=m.top,u.value=m.right,c.value=m.bottom,d.value=m.left,h.value=m.x,E.value=m.y};return Rr(e,f),Dr(e,f,{attributeFilter:["style","class"]}),N("scroll",()=>{r&&f()},{capture:!0,passive:!0}),N("resize",()=>{n&&f()},{passive:!0}),te(()=>{o&&f()},[]),{width:s,height:i,top:a,right:u,bottom:c,left:d,x:h,y:E,update:f}};var Pr=(e,t)=>{if(!y())return{isActive:t?.immediate??!1,start:()=>null,stop:()=>null};let r=t?.fpsLimit?1e3/t.fpsLimit:null;return w("useRafFn",()=>({callback:e,refId:null,previousFrameTimestamp:0,isActive:t?.immediate??!1,rafLoop:()=>{}}),({isInit:n,hook:o,update:s})=>(o.callback=e,n&&(o.rafLoop=i=>{if(o.isActive===!1)return;o.previousFrameTimestamp||(o.previousFrameTimestamp=i);let a=i-o.previousFrameTimestamp;if(r&&a<r){o.refId=window.requestAnimationFrame(o.rafLoop);return}o.previousFrameTimestamp=i,o.callback({delta:a,timestamp:i}),o.refId=window.requestAnimationFrame(o.rafLoop)}),n&&t?.immediate&&(o.isActive=!0,o.refId=window.requestAnimationFrame(o.rafLoop),o.cleanup=()=>{o.refId!=null&&window.cancelAnimationFrame(o.refId),o.isActive=!1},s()),{isActive:o.isActive,start:()=>{o.isActive!==!0&&(o.isActive=!0,o.refId=window.requestAnimationFrame(o.rafLoop),o.cleanup=()=>{o.refId!=null&&window.cancelAnimationFrame(o.refId),o.isActive=!1},s())},stop:()=>{q(o),s()}}))};var Lr=e=>{let{x:t,y:r,multiple:n,immediate:o=!0}=e,s=x(null),a=Pr(()=>{s.value=n?document.elementsFromPoint(t,r)??[]:document.elementFromPoint(t,r)??null},{immediate:o});return{element:s,...a}};var Nr=()=>{let{mouse:e}=Ie(),t=x(null),r=L(null),n=L(null),o=je(r),s=x({x:-16,y:-16}),i=x({x:-16,y:-16}),a=x({width:window.innerWidth,height:window.innerHeight}),u=x("bottom"),c=L(null);te(()=>{let f=localStorage.getItem($e);if(f==null)return;let g=JSON.parse(f);a.value.width=window.innerWidth,a.value.height=window.innerHeight,u.value=g.snapSide,i.value=vt(g,n,o)},[Math.round(o.width.value),Math.round(o.height.value)]);let d=bt(()=>{let{x:f,y:g}=e.value;if(t.value===null)return null;let{x:m,y:_}=t.value;return{x:f-m,y:g-_}});N("dragstart",f=>{f.preventDefault(),t.value={x:f.x,y:f.y},s.value=i.value},{ref:()=>r.current}),N("mouseup",()=>{c.current&&(clearTimeout(c.current),c.current=null),t.peek()&&(t.value=null,localStorage.setItem($e,JSON.stringify({...i.value,...a.value,snapSide:u.value})))});let h=Z(()=>{if(n.current==null)return;let f=n.current.offsetWidth;if(u.value==="right"){let g=Math.min(-16,i.value.y);i.value={x:-16,y:Math.max(g,(window.innerHeight-o.height.value)*-1+16)}}else if(u.value==="left"){let g=Math.min(0,i.value.y);i.value={x:(f-o.width.value)*-1+16,y:Math.max(g,(window.innerHeight-o.height.value)*-1+16)}}else if(u.value==="top"){let g=Math.min(-16,i.value.x);i.value={x:Math.max(g,(f-o.width.value)*-1+16),y:(window.innerHeight-o.height.value)*-1+16};return}else{let g=Math.min(-16,i.value.x);i.value={x:Math.max(g,(f-o.width.value)*-1+16),y:-16}}},[]);xe([d,e],(f,g)=>{if(f===null||!n.current)return;let{x:m,y:_}=g,re=n.current.offsetWidth,zr=_>=window.innerHeight-100,St=_<=100;if(!St&&!zr){let ne=m>window.innerWidth/2;u.value=ne?"right":"left"}else u.value=St?"top":"bottom";if(u.value==="right"){let ne=Math.min(-16,s.value.y+f.y);i.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,s.value.y+f.y);i.value={x:(re-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,s.value.x+f.x);i.value={x:Math.max(ne,(re-o.width.value)*-1+16),y:(window.innerHeight-o.height.value)*-1+16};return}let jr=Math.min(-16,s.value.x+f.x);i.value={y:-16,x:Math.max(jr,(re-o.width.value)*-1+16)}});let E=Z(()=>{n.current!==null&&(i.value=vt({width:a.value.width,height:a.value.height,x:i.value.x,y:i.value.y,snapSide:u.value},n,o),a.value.width=window.innerWidth,a.value.height=window.innerHeight,localStorage.setItem($e,JSON.stringify({...i.value,...a.value,snapSide:u.value})))},[Math.round(o.width.value),Math.round(o.height.value)]);return N("resize",E),{anchorRef:r,anchorCoords:i,viewPortRef:n,startMouse:t,elementBound:o,snapSide:u,updateAnchorPos:h}};var z=Le(!1);"window"in globalThis&&R.addEventListener(e=>{e.data.type==="set-inspect-enabled"&&(z.value=e.data.value)});var Y=Le(null);var Vr="kiru-devtools-popup-size",Ke=()=>{let e=Y.value;return Z(()=>new Promise((r,n)=>{if(e)if(e.closed)Y.value=null;else return e.focus(),r(e);let o=sessionStorage.getItem(Vr),s=o?JSON.parse(o):{width:Math.floor(Math.min(1920,window.screen.width)/2),height:Math.floor(Math.min(1080,window.screen.height)/2)},i=\`popup,width=\${s.width},height=\${s.height};\`,a=window.open(window.__KIRU_DEVTOOLS_PATHNAME__,"_blank",i);if(!a)return console.error("[kiru]: Unable to open devtools window"),n();let u=c=>{c.data.type==="ready"&&(R.removeEventListener(u),console.debug("[kiru]: devtools window opened"),r(a),Y.value=a,a.onbeforeunload=()=>{console.debug("[kiru]: devtools window closed"),Y.value=null})};R.addEventListener(u),a.onresize=()=>{sessionStorage.setItem(Vr,JSON.stringify({width:a.innerWidth,height:a.innerHeight}))}}),[e])};var Hr=()=>{let e=Ke(),{mouse:t}=Ie(),r=Lr({x:t.value.x,y:t.value.y,immediate:!1}),n=r.element.value,o=z.value?n:null,s=Ee(()=>{if(o&&window.__kiru){let c=window.__kiru.apps.find(d=>d.rootNode==null||o.__kiruNode==null?!1:mr(d.rootNode,o.__kiruNode));return c?.rootNode==null?null:c}return null},[o]),i=Ee(()=>o?Cr(o):null,[o]),a=L(null),u=je(a);return F(()=>z.subscribe(d=>{r[d?"start":"stop"]()}),[]),F(()=>{i&&o?a.current=Tr(i,o)??null:a.current=null},[i,o]),N("click",c=>{if(z.value===!0&&i&&s){c.preventDefault();let d=h=>{h.__devtoolsSelection={node:i,app:s},R.send({type:"select-node"}),R.send({type:"set-inspect-enabled",value:!1}),z.value=!1,a.current=null,h.focus()};Y.value?d(Y.value):e().then(h=>d(h))}}),i&&p("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)\`}},p("p",null,i.type.name))};function $r(e){return p("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,viewBox:"0 -960 960 960",fill:"currentColor",...e},p("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 Ir(e){return p("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},p("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"}),p("path",{d:"M21 11V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h6"}))}var In=()=>{z.value=!z.value,R.send({type:"set-inspect-enabled",value:z.value})};function Fn(e,t){let{damping:r}=t,n=x(e),o=L(e);return F(()=>{let s=null,i=()=>{if(Math.sqrt(Math.pow(o.current.x-n.value.x,2)+Math.pow(o.current.y-n.value.y,2))<5)return;let u=n.value.x+(o.current.x-n.value.x)*r,c=n.value.y+(o.current.y-n.value.y)*r;n.value={x:u,y:c},s=window.requestAnimationFrame(i)};return s=window.requestAnimationFrame(i),()=>{s!=null&&window.cancelAnimationFrame(s)}},[e.x,e.y]),Object.assign(n,{set:(s,i)=>{o.current=s,i?.hard&&(n.value=s)}})}function Et(){let e=x(!1),t=Ke(),{anchorCoords:r,anchorRef:n,viewPortRef:o,startMouse:s,snapSide:i}=Nr(),a=i.value==="left"||i.value==="right",u=L(!1),c=Fn(r.value,{damping:.4});return xe([r],c.set),te(()=>{u.current===!1&&c.set(r.value,{hard:!0}),u.current=!0},[]),p(K,null,p("div",{ref:o,className:"w-full h-0 fixed top-0 left-0 z-[-9999] overflow-scroll pointer-events-none"}),p("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)\`}},p(Er,{in:e.value,duration:{in:40,out:150},element:d=>{if(d==="exited")return null;let h=d==="entered"?"1":"0.5",E=d==="entered"?"1":"0";return p(K,null,p("button",{title:"Open Devtools",onclick:t,style:{transform:\`scale(\${h})\`,opacity:E},className:"transition text-white rounded-full p-1 hover:bg-[#0003]"},p($r,{width:16,height:16})),p("button",{title:"Toggle Component Inspection",onclick:In,style:{transform:\`scale(\${h})\`,opacity:E},className:\`transition text-white rounded-full p-1 hover:bg-[#0003] \${z.value?"bg-[#0003]":""}\`},p(Ir,{width:16,height:16})))}}),p("button",{className:"bg-crimson rounded-full p-1"+(s.value?" pointer-events-none":""),onclick:()=>e.value=!e.value,tabIndex:-1},p(kr,null))),p(Hr,null))}var Fr=\`*, ::before, ::after {
1770
+ --tw-border-spacing-x: 0;
1771
+ --tw-border-spacing-y: 0;
1772
+ --tw-translate-x: 0;
1773
+ --tw-translate-y: 0;
1774
+ --tw-rotate: 0;
1775
+ --tw-skew-x: 0;
1776
+ --tw-skew-y: 0;
1777
+ --tw-scale-x: 1;
1778
+ --tw-scale-y: 1;
1779
+ --tw-pan-x: ;
1780
+ --tw-pan-y: ;
1781
+ --tw-pinch-zoom: ;
1782
+ --tw-scroll-snap-strictness: proximity;
1783
+ --tw-gradient-from-position: ;
1784
+ --tw-gradient-via-position: ;
1785
+ --tw-gradient-to-position: ;
1786
+ --tw-ordinal: ;
1787
+ --tw-slashed-zero: ;
1788
+ --tw-numeric-figure: ;
1789
+ --tw-numeric-spacing: ;
1790
+ --tw-numeric-fraction: ;
1791
+ --tw-ring-inset: ;
1792
+ --tw-ring-offset-width: 0px;
1793
+ --tw-ring-offset-color: #fff;
1794
+ --tw-ring-color: rgb(59 130 246 / 0.5);
1795
+ --tw-ring-offset-shadow: 0 0 #0000;
1796
+ --tw-ring-shadow: 0 0 #0000;
1797
+ --tw-shadow: 0 0 #0000;
1798
+ --tw-shadow-colored: 0 0 #0000;
1799
+ --tw-blur: ;
1800
+ --tw-brightness: ;
1801
+ --tw-contrast: ;
1802
+ --tw-grayscale: ;
1803
+ --tw-hue-rotate: ;
1804
+ --tw-invert: ;
1805
+ --tw-saturate: ;
1806
+ --tw-sepia: ;
1807
+ --tw-drop-shadow: ;
1808
+ --tw-backdrop-blur: ;
1809
+ --tw-backdrop-brightness: ;
1810
+ --tw-backdrop-contrast: ;
1811
+ --tw-backdrop-grayscale: ;
1812
+ --tw-backdrop-hue-rotate: ;
1813
+ --tw-backdrop-invert: ;
1814
+ --tw-backdrop-opacity: ;
1815
+ --tw-backdrop-saturate: ;
1816
+ --tw-backdrop-sepia: ;
1817
+ --tw-contain-size: ;
1818
+ --tw-contain-layout: ;
1819
+ --tw-contain-paint: ;
1820
+ --tw-contain-style: ;
1821
+ }
1739
1822
 
1740
- // src/App.tsx
1741
- import * as kiru6 from "kiru";
1823
+ ::backdrop {
1824
+ --tw-border-spacing-x: 0;
1825
+ --tw-border-spacing-y: 0;
1826
+ --tw-translate-x: 0;
1827
+ --tw-translate-y: 0;
1828
+ --tw-rotate: 0;
1829
+ --tw-skew-x: 0;
1830
+ --tw-skew-y: 0;
1831
+ --tw-scale-x: 1;
1832
+ --tw-scale-y: 1;
1833
+ --tw-pan-x: ;
1834
+ --tw-pan-y: ;
1835
+ --tw-pinch-zoom: ;
1836
+ --tw-scroll-snap-strictness: proximity;
1837
+ --tw-gradient-from-position: ;
1838
+ --tw-gradient-via-position: ;
1839
+ --tw-gradient-to-position: ;
1840
+ --tw-ordinal: ;
1841
+ --tw-slashed-zero: ;
1842
+ --tw-numeric-figure: ;
1843
+ --tw-numeric-spacing: ;
1844
+ --tw-numeric-fraction: ;
1845
+ --tw-ring-inset: ;
1846
+ --tw-ring-offset-width: 0px;
1847
+ --tw-ring-offset-color: #fff;
1848
+ --tw-ring-color: rgb(59 130 246 / 0.5);
1849
+ --tw-ring-offset-shadow: 0 0 #0000;
1850
+ --tw-ring-shadow: 0 0 #0000;
1851
+ --tw-shadow: 0 0 #0000;
1852
+ --tw-shadow-colored: 0 0 #0000;
1853
+ --tw-blur: ;
1854
+ --tw-brightness: ;
1855
+ --tw-contrast: ;
1856
+ --tw-grayscale: ;
1857
+ --tw-hue-rotate: ;
1858
+ --tw-invert: ;
1859
+ --tw-saturate: ;
1860
+ --tw-sepia: ;
1861
+ --tw-drop-shadow: ;
1862
+ --tw-backdrop-blur: ;
1863
+ --tw-backdrop-brightness: ;
1864
+ --tw-backdrop-contrast: ;
1865
+ --tw-backdrop-grayscale: ;
1866
+ --tw-backdrop-hue-rotate: ;
1867
+ --tw-backdrop-invert: ;
1868
+ --tw-backdrop-opacity: ;
1869
+ --tw-backdrop-saturate: ;
1870
+ --tw-backdrop-sepia: ;
1871
+ --tw-contain-size: ;
1872
+ --tw-contain-layout: ;
1873
+ --tw-contain-paint: ;
1874
+ --tw-contain-style: ;
1875
+ }/*
1876
+ ! tailwindcss v3.4.18 | MIT License | https://tailwindcss.com
1877
+ *//*
1878
+ 1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
1879
+ 2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
1880
+ */
1742
1881
 
1743
- // src/icon/Flame.tsx
1744
- import * as kiru2 from "kiru";
1745
- var Flame = /* @__PURE__ */ __name(() => {
1746
- return /* @__PURE__ */ kiru2.createElement(
1747
- "svg",
1748
- {
1749
- xmlns: "http://www.w3.org/2000/svg",
1750
- width: 20,
1751
- height: 20,
1752
- viewBox: "0 0 24 24",
1753
- fill: "none",
1754
- stroke: "white",
1755
- strokeWidth: "2",
1756
- strokeLinecap: "round",
1757
- strokeLinejoin: "round"
1758
- },
1759
- /* @__PURE__ */ kiru2.createElement("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" })
1760
- );
1761
- }, "Flame");
1762
-
1763
- // src/hooks/useAnchorPos.ts
1764
- import {
1765
- useCallback as useCallback2,
1766
- useComputed as useComputed2,
1767
- useLayoutEffect as useLayoutEffect2,
1768
- useRef,
1769
- useSignal as useSignal5,
1770
- useWatch as useWatch2
1771
- } from "kiru";
1772
-
1773
- // src/utils/constants.ts
1774
- var PADDING = 16;
1775
- var LOCAL_KEY = "kiru.devtools.anchorPosition";
1776
- var DEFAULT_ANCHOR_POS = { x: -PADDING, y: -PADDING };
1777
-
1778
- // ../lib/dist/globals.js
1779
- var renderMode = {
1780
- current: "window" in globalThis ? "dom" : "string"
1781
- };
1882
+ *,
1883
+ ::before,
1884
+ ::after {
1885
+ box-sizing: border-box; /* 1 */
1886
+ border-width: 0; /* 2 */
1887
+ border-style: solid; /* 2 */
1888
+ border-color: #e5e7eb; /* 2 */
1889
+ }
1782
1890
 
1783
- // ../lib/dist/constants.js
1784
- var $SIGNAL = Symbol.for("kiru.signal");
1785
- var $CONTEXT = Symbol.for("kiru.context");
1786
- var $CONTEXT_PROVIDER = Symbol.for("kiru.contextProvider");
1787
- var $FRAGMENT = Symbol.for("kiru.fragment");
1788
- var $KIRU_ERROR = Symbol.for("kiru.error");
1789
- var $HMR_ACCEPT = Symbol.for("kiru.hmrAccept");
1790
- var $MEMO = Symbol.for("kiru.memo");
1791
- var $HYDRATION_BOUNDARY = Symbol.for("kiru.hydrationBoundary");
1792
- var FLAG_UPDATE = 1 << 1;
1793
- var FLAG_PLACEMENT = 1 << 2;
1794
- var FLAG_DELETION = 1 << 3;
1795
- var FLAG_HAS_MEMO_ANCESTOR = 1 << 4;
1796
- var FLAG_STATIC_DOM = 1 << 5;
1797
-
1798
- // ../lib/dist/env.js
1799
- var NODE_ENV = "development";
1800
- if (NODE_ENV !== "development" && NODE_ENV !== "production") {
1801
- throw new Error("NODE_ENV must either be set to development or production.");
1802
- }
1803
-
1804
- // ../lib/dist/signals/globals.js
1805
- var tracking = {
1806
- stack: new Array(),
1807
- current: /* @__PURE__ */ __name(function() {
1808
- return this.stack[this.stack.length - 1];
1809
- }, "current")
1810
- };
1891
+ ::before,
1892
+ ::after {
1893
+ --tw-content: '';
1894
+ }
1811
1895
 
1812
- // ../lib/dist/error.js
1813
- var _a;
1814
- _a = $KIRU_ERROR;
1896
+ /*
1897
+ 1. Use a consistent sensible line-height in all browsers.
1898
+ 2. Prevent adjustments of font size after orientation changes in iOS.
1899
+ 3. Use a more readable tab size.
1900
+ 4. Use the user's configured \\\`sans\\\` font-family by default.
1901
+ 5. Use the user's configured \\\`sans\\\` font-feature-settings by default.
1902
+ 6. Use the user's configured \\\`sans\\\` font-variation-settings by default.
1903
+ 7. Disable tap highlights on iOS
1904
+ */
1815
1905
 
1816
- // ../lib/dist/reconciler.js
1817
- var $LIST_CHILD = Symbol("kiru:marked-list-child");
1906
+ html,
1907
+ :host {
1908
+ line-height: 1.5; /* 1 */
1909
+ -webkit-text-size-adjust: 100%; /* 2 */
1910
+ -moz-tab-size: 4; /* 3 */
1911
+ -o-tab-size: 4;
1912
+ tab-size: 4; /* 3 */
1913
+ font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 4 */
1914
+ font-feature-settings: normal; /* 5 */
1915
+ font-variation-settings: normal; /* 6 */
1916
+ -webkit-tap-highlight-color: transparent; /* 7 */
1917
+ }
1818
1918
 
1819
- // ../lib/dist/hooks/utils.js
1820
- var HookDebugGroupAction;
1821
- (function(HookDebugGroupAction2) {
1822
- HookDebugGroupAction2["Start"] = "start";
1823
- HookDebugGroupAction2["End"] = "end";
1824
- })(HookDebugGroupAction || (HookDebugGroupAction = {}));
1919
+ /*
1920
+ 1. Remove the margin in all browsers.
1921
+ 2. Inherit line-height from \\\`html\\\` so users can set them as a class directly on the \\\`html\\\` element.
1922
+ */
1825
1923
 
1826
- // ../lib/dist/signals/base.js
1827
- var _a2;
1828
- _a2 = $SIGNAL;
1924
+ body {
1925
+ margin: 0; /* 1 */
1926
+ line-height: inherit; /* 2 */
1927
+ }
1829
1928
 
1830
- // ../lib/dist/utils.js
1831
- var noop = Object.freeze(() => {
1832
- });
1833
- function isFragment(vNode) {
1834
- return vNode.type === $FRAGMENT;
1835
- }
1836
- __name(isFragment, "isFragment");
1837
- function vNodeContains(haystack, needle) {
1838
- if (needle.depth < haystack.depth)
1839
- return false;
1840
- if (haystack === needle)
1841
- return true;
1842
- let checkSiblings = false;
1843
- const stack = [haystack];
1844
- while (stack.length) {
1845
- const n = stack.pop();
1846
- if (n === needle)
1847
- return true;
1848
- n.child && stack.push(n.child);
1849
- checkSiblings && n.sibling && stack.push(n.sibling);
1850
- checkSiblings = true;
1851
- }
1852
- return false;
1929
+ /*
1930
+ 1. Add the correct height in Firefox.
1931
+ 2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
1932
+ 3. Ensure horizontal rules are visible by default.
1933
+ */
1934
+
1935
+ hr {
1936
+ height: 0; /* 1 */
1937
+ color: inherit; /* 2 */
1938
+ border-top-width: 1px; /* 3 */
1853
1939
  }
1854
- __name(vNodeContains, "vNodeContains");
1855
-
1856
- // src/utils/index.ts
1857
- var reinitializeAnchorPos = /* @__PURE__ */ __name((storage, viewPortRef, elementBound) => {
1858
- if (!viewPortRef.current) return { ...DEFAULT_ANCHOR_POS };
1859
- const rateInWidthChange = window.innerWidth / storage.width;
1860
- const rateInHeightChange = window.innerHeight / storage.height;
1861
- let forceX = null;
1862
- let forceY = null;
1863
- if (storage.snapSide === "left") {
1864
- forceX = (viewPortRef.current.offsetWidth - elementBound.width.value) * -1 + PADDING;
1865
- } else if (storage.snapSide === "right") {
1866
- forceX = -PADDING;
1867
- } else if (storage.snapSide === "bottom") {
1868
- forceY = -PADDING;
1869
- } else if (storage.snapSide === "top") {
1870
- forceY = (window.innerHeight - elementBound.height.value) * -1 + PADDING;
1871
- }
1872
- return {
1873
- x: forceX ?? storage.x * rateInWidthChange,
1874
- y: forceY ?? storage.y * rateInHeightChange
1875
- };
1876
- }, "reinitializeAnchorPos");
1877
- var getComponentVnodeFromElement = /* @__PURE__ */ __name((domNode) => {
1878
- if (domNode == null) return null;
1879
- let parentComponent = null;
1880
- let parent = domNode?.__kiruNode?.parent;
1881
- while (parent) {
1882
- if (typeof parent.type === "function" && !isFragment(parent)) {
1883
- parentComponent = parent;
1884
- break;
1885
- }
1886
- parent = parent.parent;
1887
- }
1888
- return parentComponent;
1889
- }, "getComponentVnodeFromElement");
1890
- var getNearestElm = /* @__PURE__ */ __name((vNode, element) => {
1891
- const elementvNodeTreeUptillComponetVnode = [];
1892
- const stack = [element.__kiruNode];
1893
- while (stack.length) {
1894
- const node2 = stack.pop();
1895
- if (node2 === vNode) {
1896
- break;
1897
- }
1898
- if (node2?.dom) {
1899
- elementvNodeTreeUptillComponetVnode.push(node2);
1900
- }
1901
- if (node2?.parent) stack.push(node2.parent);
1902
- }
1903
- if (elementvNodeTreeUptillComponetVnode.length === 0) return void 0;
1904
- const dom = elementvNodeTreeUptillComponetVnode[elementvNodeTreeUptillComponetVnode.length - 1].dom;
1905
- return dom instanceof Element ? dom : void 0;
1906
- }, "getNearestElm");
1907
1940
 
1908
- // ../devtools-shared/src/SelectedNodeView.tsx
1909
- import { useEffect as useEffect2, useRequestUpdate, requestUpdate as requestUpdate2 } from "kiru";
1941
+ /*
1942
+ Add the correct text decoration in Chrome, Edge, and Safari.
1943
+ */
1910
1944
 
1911
- // ../devtools-shared/src/NodeDataSection.tsx
1912
- import { useCallback, useEffect, useState } from "kiru";
1945
+ abbr:where([title]) {
1946
+ -webkit-text-decoration: underline dotted;
1947
+ text-decoration: underline dotted;
1948
+ }
1913
1949
 
1914
- // ../devtools-shared/src/ValueEditor.tsx
1915
- import { unwrap as unwrap2, useMemo, useState as useState3 } from "kiru";
1950
+ /*
1951
+ Remove the default font size and weight for headings.
1952
+ */
1916
1953
 
1917
- // ../devtools-shared/src/Settings.tsx
1918
- import { createContext, useContext, useState as useState2 } from "kiru";
1919
- var defaultSettings = {
1920
- arrayChunkSize: 10,
1921
- objectKeysChunkSize: 100
1922
- };
1923
- function recursiveObjectValidate(obj, subject) {
1924
- if (Object.keys(obj).length !== Object.keys(subject).length) {
1925
- return false;
1926
- }
1927
- const keys = /* @__PURE__ */ new Set([...Object.keys(obj), ...Object.keys(subject)]);
1928
- for (const key in keys) {
1929
- if (typeof subject[key] !== typeof obj[key]) {
1930
- return false;
1931
- }
1932
- if (typeof obj[key] === "object") {
1933
- if (!recursiveObjectValidate(obj[key], subject[key])) {
1934
- return false;
1935
- }
1936
- }
1937
- }
1938
- return true;
1954
+ h1,
1955
+ h2,
1956
+ h3,
1957
+ h4,
1958
+ h5,
1959
+ h6 {
1960
+ font-size: inherit;
1961
+ font-weight: inherit;
1939
1962
  }
1940
- __name(recursiveObjectValidate, "recursiveObjectValidate");
1941
- var userSettings = { ...defaultSettings };
1942
- var storageData = localStorage.getItem("kiru.devtools.userSettings");
1943
- if (storageData) {
1944
- try {
1945
- const parsed = JSON.parse(storageData);
1946
- if (recursiveObjectValidate(defaultSettings, parsed)) {
1947
- userSettings = parsed;
1948
- }
1949
- } catch (error) {
1950
- console.error("kiru.devtools.userSettings error", error);
1951
- }
1963
+
1964
+ /*
1965
+ Reset links to optimize for opt-in styling instead of opt-out.
1966
+ */
1967
+
1968
+ a {
1969
+ color: inherit;
1970
+ text-decoration: inherit;
1952
1971
  }
1953
- var SettingsContext = createContext({
1954
- userSettings: null,
1955
- saveUserSettings: /* @__PURE__ */ __name(() => {
1956
- }, "saveUserSettings")
1957
- });
1958
1972
 
1959
- // ../devtools-shared/src/ValueEditor.tsx
1960
- var noop2 = Object.freeze(() => {
1961
- });
1973
+ /*
1974
+ Add the correct font weight in Edge and Safari.
1975
+ */
1962
1976
 
1963
- // ../devtools-shared/src/FileLink.tsx
1964
- import { useMemo as useMemo2 } from "kiru";
1977
+ b,
1978
+ strong {
1979
+ font-weight: bolder;
1980
+ }
1981
+
1982
+ /*
1983
+ 1. Use the user's configured \\\`mono\\\` font-family by default.
1984
+ 2. Use the user's configured \\\`mono\\\` font-feature-settings by default.
1985
+ 3. Use the user's configured \\\`mono\\\` font-variation-settings by default.
1986
+ 4. Correct the odd \\\`em\\\` font sizing in all browsers.
1987
+ */
1965
1988
 
1966
- // ../devtools-shared/src/broadcastChannel.ts
1967
- var BROADCAST_CHANNEL_NAME = "kiru-devtools";
1968
- if ("window" in globalThis) {
1969
- window.__devtoolsSelection ?? (window.__devtoolsSelection = null);
1989
+ code,
1990
+ kbd,
1991
+ samp,
1992
+ pre {
1993
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* 1 */
1994
+ font-feature-settings: normal; /* 2 */
1995
+ font-variation-settings: normal; /* 3 */
1996
+ font-size: 1em; /* 4 */
1970
1997
  }
1971
- var _TypedBroadcastChannel = class _TypedBroadcastChannel extends BroadcastChannel {
1972
- send(data) {
1973
- super.postMessage(data);
1974
- }
1975
- // @ts-expect-error heck u ts
1976
- removeEventListener(listener) {
1977
- return super.removeEventListener("message", listener);
1978
- }
1979
- // @ts-expect-error heck u ts
1980
- addEventListener(listener) {
1981
- return super.addEventListener("message", listener);
1982
- }
1983
- };
1984
- __name(_TypedBroadcastChannel, "TypedBroadcastChannel");
1985
- var TypedBroadcastChannel = _TypedBroadcastChannel;
1986
- var broadcastChannel = new TypedBroadcastChannel(BROADCAST_CHANNEL_NAME);
1987
-
1988
- // ../devtools-shared/src/SelectedNodeView.tsx
1989
- var hookGroupSymbol = Symbol.for("devtools.hookGroup");
1990
-
1991
- // ../devtools-shared/src/hooks/useEventListener.ts
1992
- import { useEffect as useEffect3 } from "kiru";
1993
- var useEventListener = /* @__PURE__ */ __name((event, listener, options = {}) => {
1994
- useEffect3(() => {
1995
- let pointer = window;
1996
- const elm = options?.ref?.();
1997
- if (elm) {
1998
- pointer = elm;
1999
- } else if (options.ref) {
2000
- console.warn("useEventListener ref failed, using window");
2001
- }
2002
- pointer.addEventListener(event, listener, options);
2003
- return () => {
2004
- pointer.removeEventListener(event, listener, options);
2005
- };
2006
- }, [listener]);
2007
- }, "useEventListener");
2008
-
2009
- // ../devtools-shared/src/hooks/useMouse.ts
2010
- import { useSignal as useSignal2 } from "kiru";
2011
- var useMouse = /* @__PURE__ */ __name(() => {
2012
- const mouse = useSignal2({ x: 0, y: 0 });
2013
- const delta = useSignal2({ x: 0, y: 0 });
2014
- const client = useSignal2({ x: 0, y: 0 });
2015
- useEventListener("mousemove", (event) => {
2016
- mouse.value = {
2017
- x: event.x,
2018
- y: event.y
2019
- };
2020
- delta.value = {
2021
- x: event.movementX,
2022
- y: event.movementY
2023
- };
2024
- client.value = {
2025
- x: event.clientX,
2026
- y: event.clientY
2027
- };
2028
- });
2029
- return { mouse, delta, client };
2030
- }, "useMouse");
2031
-
2032
- // ../devtools-shared/src/hooks/useElementBounding.ts
2033
- import { useLayoutEffect, useSignal as useSignal3 } from "kiru";
2034
-
2035
- // ../devtools-shared/src/hooks/useResizeObserver.ts
2036
- import {
2037
- cleanupHook,
2038
- depsRequireChange,
2039
- sideEffectsEnabled as sideEffectsEnabled2,
2040
- useHook as useHook2
2041
- } from "kiru";
2042
- var isSupported = "window" in globalThis && "ResizeObserver" in globalThis.window;
2043
- var useResizeObserver = /* @__PURE__ */ __name((ref, callback, options = void 0) => {
2044
- if (!sideEffectsEnabled2())
2045
- return {
2046
- isSupported,
2047
- start: /* @__PURE__ */ __name(() => {
2048
- }, "start"),
2049
- stop: /* @__PURE__ */ __name(() => {
2050
- }, "stop")
2051
- };
2052
- if (!isSupported) {
2053
- return {
2054
- isSupported,
2055
- start: /* @__PURE__ */ __name(() => {
2056
- }, "start"),
2057
- stop: /* @__PURE__ */ __name(() => {
2058
- }, "stop")
2059
- };
2060
- }
2061
- return useHook2(
2062
- "useResizeObserver",
2063
- {
2064
- resizeObserver: null,
2065
- deps: [ref.current]
2066
- },
2067
- ({ isInit, hook, queueEffect }) => {
2068
- if (isInit) {
2069
- hook.resizeObserver = new ResizeObserver(callback);
2070
- hook.cleanup = () => {
2071
- hook.resizeObserver?.disconnect?.();
2072
- hook.resizeObserver = null;
2073
- };
2074
- }
2075
- queueEffect(() => {
2076
- if (depsRequireChange([ref.current], hook.deps)) {
2077
- hook.deps = [ref.current];
2078
- hook.resizeObserver?.disconnect?.();
2079
- if (ref.current) {
2080
- hook.resizeObserver?.observe(ref.current, options);
2081
- }
2082
- }
2083
- });
2084
- return {
2085
- isSupported,
2086
- start: /* @__PURE__ */ __name(() => {
2087
- if (hook.resizeObserver != null) {
2088
- return;
2089
- }
2090
- hook.resizeObserver = new ResizeObserver(callback);
2091
- if (ref.current) {
2092
- hook.resizeObserver.observe(ref.current, options);
2093
- }
2094
- hook.cleanup = () => {
2095
- hook.resizeObserver?.disconnect?.();
2096
- hook.resizeObserver = null;
2097
- };
2098
- }, "start"),
2099
- stop: /* @__PURE__ */ __name(() => {
2100
- cleanupHook(hook);
2101
- }, "stop")
2102
- };
2103
- }
2104
- );
2105
- }, "useResizeObserver");
2106
-
2107
- // ../devtools-shared/src/hooks/useMutationObserver.ts
2108
- import {
2109
- cleanupHook as cleanupHook2,
2110
- depsRequireChange as depsRequireChange2,
2111
- sideEffectsEnabled as sideEffectsEnabled3,
2112
- useHook as useHook3
2113
- } from "kiru";
2114
- var isSupported2 = "window" in globalThis && "MutationObserver" in globalThis.window;
2115
- var useMutationObserver = /* @__PURE__ */ __name((ref, callback, options = void 0) => {
2116
- if (!sideEffectsEnabled3())
2117
- return {
2118
- isSupported: isSupported2,
2119
- start: /* @__PURE__ */ __name(() => {
2120
- }, "start"),
2121
- stop: /* @__PURE__ */ __name(() => {
2122
- }, "stop")
2123
- };
2124
- if (!isSupported2) {
2125
- return {
2126
- isSupported: isSupported2,
2127
- start: /* @__PURE__ */ __name(() => {
2128
- }, "start"),
2129
- stop: /* @__PURE__ */ __name(() => {
2130
- }, "stop")
2131
- };
2132
- }
2133
- return useHook3(
2134
- "useMutationObserver",
2135
- {
2136
- mutationObserver: null,
2137
- deps: [ref.current]
2138
- },
2139
- ({ isInit, hook, queueEffect }) => {
2140
- if (isInit) {
2141
- queueEffect(() => {
2142
- hook.deps = [ref.current];
2143
- hook.mutationObserver = new MutationObserver(callback);
2144
- if (ref.current) {
2145
- hook.mutationObserver.observe(ref.current, options);
2146
- }
2147
- });
2148
- hook.cleanup = () => {
2149
- hook.mutationObserver?.disconnect?.();
2150
- hook.mutationObserver = null;
2151
- };
2152
- } else if (depsRequireChange2([ref.current], hook.deps)) {
2153
- hook.deps = [ref.current];
2154
- hook.mutationObserver?.disconnect?.();
2155
- if (ref.current) {
2156
- hook.mutationObserver?.observe(ref.current, options);
2157
- }
2158
- }
2159
- return {
2160
- isSupported: isSupported2,
2161
- start: /* @__PURE__ */ __name(() => {
2162
- if (hook.mutationObserver != null) {
2163
- return;
2164
- }
2165
- hook.mutationObserver = new MutationObserver(callback);
2166
- if (ref.current) {
2167
- hook.mutationObserver.observe(ref.current, options);
2168
- }
2169
- hook.cleanup = () => {
2170
- hook.mutationObserver?.disconnect?.();
2171
- hook.mutationObserver = null;
2172
- };
2173
- }, "start"),
2174
- stop: /* @__PURE__ */ __name(() => {
2175
- cleanupHook2(hook);
2176
- }, "stop")
2177
- };
2178
- }
2179
- );
2180
- }, "useMutationObserver");
2181
-
2182
- // ../devtools-shared/src/hooks/useElementBounding.ts
2183
- var useElementBounding = /* @__PURE__ */ __name((ref, options = {
2184
- windowScroll: true,
2185
- windowResize: true
2186
- }) => {
2187
- const windowScroll = options?.windowScroll ?? true;
2188
- const windowResize = options?.windowResize ?? true;
2189
- const immediate = options.immediate ?? true;
2190
- const width = useSignal3(0);
2191
- const height = useSignal3(0);
2192
- const top = useSignal3(0);
2193
- const right = useSignal3(0);
2194
- const bottom = useSignal3(0);
2195
- const left = useSignal3(0);
2196
- const x = useSignal3(0);
2197
- const y = useSignal3(0);
2198
- const update = /* @__PURE__ */ __name(() => {
2199
- const el = ref.current;
2200
- if (!el) {
2201
- width.value = 0;
2202
- height.value = 0;
2203
- top.value = 0;
2204
- right.value = 0;
2205
- bottom.value = 0;
2206
- left.value = 0;
2207
- x.value = 0;
2208
- y.value = 0;
2209
- return;
2210
- }
2211
- const bounding = el.getBoundingClientRect();
2212
- width.value = bounding.width;
2213
- height.value = bounding.height;
2214
- top.value = bounding.top;
2215
- right.value = bounding.right;
2216
- bottom.value = bounding.bottom;
2217
- left.value = bounding.left;
2218
- x.value = bounding.x;
2219
- y.value = bounding.y;
2220
- }, "update");
2221
- useResizeObserver(ref, update);
2222
- useMutationObserver(ref, update, {
2223
- attributeFilter: ["style", "class"]
2224
- });
2225
- useEventListener(
2226
- "scroll",
2227
- () => {
2228
- if (windowScroll) {
2229
- update();
2230
- }
2231
- },
2232
- { capture: true, passive: true }
2233
- );
2234
- useEventListener(
2235
- "resize",
2236
- () => {
2237
- if (windowResize) {
2238
- update();
2239
- }
2240
- },
2241
- { passive: true }
2242
- );
2243
- useLayoutEffect(() => {
2244
- if (immediate) {
2245
- update();
2246
- }
2247
- }, []);
2248
- return {
2249
- width,
2250
- height,
2251
- top,
2252
- right,
2253
- bottom,
2254
- left,
2255
- x,
2256
- y,
2257
- update
2258
- };
2259
- }, "useElementBounding");
2260
-
2261
- // ../devtools-shared/src/hooks/useElementByPoint.ts
2262
- import { useSignal as useSignal4 } from "kiru";
2263
-
2264
- // ../devtools-shared/src/hooks/useRafFn.ts
2265
- import { cleanupHook as cleanupHook3, sideEffectsEnabled as sideEffectsEnabled4, useHook as useHook4 } from "kiru";
2266
- var useRafFn = /* @__PURE__ */ __name((callback, options) => {
2267
- if (!sideEffectsEnabled4())
2268
- return {
2269
- isActive: options?.immediate ?? false,
2270
- start: /* @__PURE__ */ __name(() => null, "start"),
2271
- stop: /* @__PURE__ */ __name(() => null, "stop")
2272
- };
2273
- const intervalLimit = options?.fpsLimit ? 1e3 / options.fpsLimit : null;
2274
- return useHook4(
2275
- "useRafFn",
2276
- () => ({
2277
- callback,
2278
- refId: null,
2279
- previousFrameTimestamp: 0,
2280
- isActive: options?.immediate ?? false,
2281
- rafLoop: /* @__PURE__ */ __name(() => {
2282
- }, "rafLoop")
2283
- }),
2284
- ({ isInit, hook, update }) => {
2285
- hook.callback = callback;
2286
- if (isInit) {
2287
- hook.rafLoop = (timestamp) => {
2288
- if (hook.isActive === false) return;
2289
- if (!hook.previousFrameTimestamp)
2290
- hook.previousFrameTimestamp = timestamp;
2291
- const delta = timestamp - hook.previousFrameTimestamp;
2292
- if (intervalLimit && delta < intervalLimit) {
2293
- hook.refId = window.requestAnimationFrame(hook.rafLoop);
2294
- return;
2295
- }
2296
- hook.previousFrameTimestamp = timestamp;
2297
- hook.callback({ delta, timestamp });
2298
- hook.refId = window.requestAnimationFrame(hook.rafLoop);
2299
- };
2300
- }
2301
- if (isInit && options?.immediate) {
2302
- hook.isActive = true;
2303
- hook.refId = window.requestAnimationFrame(hook.rafLoop);
2304
- hook.cleanup = () => {
2305
- if (hook.refId != null) {
2306
- window.cancelAnimationFrame(hook.refId);
2307
- }
2308
- hook.isActive = false;
2309
- };
2310
- update();
2311
- }
2312
- return {
2313
- isActive: hook.isActive,
2314
- start: /* @__PURE__ */ __name(() => {
2315
- if (hook.isActive === true) return;
2316
- hook.isActive = true;
2317
- hook.refId = window.requestAnimationFrame(hook.rafLoop);
2318
- hook.cleanup = () => {
2319
- if (hook.refId != null) {
2320
- window.cancelAnimationFrame(hook.refId);
2321
- }
2322
- hook.isActive = false;
2323
- };
2324
- update();
2325
- }, "start"),
2326
- stop: /* @__PURE__ */ __name(() => {
2327
- cleanupHook3(hook);
2328
- update();
2329
- }, "stop")
2330
- };
2331
- }
2332
- );
2333
- }, "useRafFn");
2334
-
2335
- // ../devtools-shared/src/hooks/useElementByPoint.ts
2336
- var useElementByPoint = /* @__PURE__ */ __name((options) => {
2337
- const { x, y, multiple, immediate = true } = options;
2338
- const element = useSignal4(null);
2339
- const cb = /* @__PURE__ */ __name(() => {
2340
- element.value = multiple ? document.elementsFromPoint(x, y) ?? [] : document.elementFromPoint(x, y) ?? null;
2341
- }, "cb");
2342
- const controls = useRafFn(cb, { immediate });
2343
- return {
2344
- element,
2345
- ...controls
2346
- };
2347
- }, "useElementByPoint");
2348
-
2349
- // src/hooks/useAnchorPos.ts
2350
- var useAnchorPos = /* @__PURE__ */ __name(() => {
2351
- const { mouse } = useMouse();
2352
- const startMouse = useSignal5(null);
2353
- const anchorRef = useRef(null);
2354
- const viewPortRef = useRef(null);
2355
- const elementBound = useElementBounding(anchorRef);
2356
- const lastDroppedCoord = useSignal5({ x: -PADDING, y: -PADDING });
2357
- const anchorCoords = useSignal5({ x: -PADDING, y: -PADDING });
2358
- const viewportSize = useSignal5({
2359
- width: window.innerWidth,
2360
- height: window.innerHeight
2361
- });
2362
- const snapSide = useSignal5("bottom");
2363
- const timeoutRef = useRef(null);
2364
- useLayoutEffect2(() => {
2365
- const resultString = localStorage.getItem(LOCAL_KEY);
2366
- if (resultString == null) return;
2367
- const result = JSON.parse(resultString);
2368
- viewportSize.value.width = window.innerWidth;
2369
- viewportSize.value.height = window.innerHeight;
2370
- snapSide.value = result.snapSide;
2371
- anchorCoords.value = reinitializeAnchorPos(
2372
- result,
2373
- viewPortRef,
2374
- elementBound
2375
- );
2376
- }, [
2377
- Math.round(elementBound.width.value),
2378
- Math.round(elementBound.height.value)
2379
- ]);
2380
- const distanceCovered = useComputed2(() => {
2381
- const { x, y } = mouse.value;
2382
- if (startMouse.value === null) return null;
2383
- const { x: startX, y: startY } = startMouse.value;
2384
- return {
2385
- x: x - startX,
2386
- y: y - startY
2387
- };
2388
- });
2389
- useEventListener(
2390
- "dragstart",
2391
- (e) => {
2392
- e.preventDefault();
2393
- startMouse.value = { x: e.x, y: e.y };
2394
- lastDroppedCoord.value = anchorCoords.value;
2395
- },
2396
- {
2397
- ref: /* @__PURE__ */ __name(() => anchorRef.current, "ref")
2398
- }
2399
- );
2400
- useEventListener("mouseup", () => {
2401
- if (timeoutRef.current) {
2402
- clearTimeout(timeoutRef.current);
2403
- timeoutRef.current = null;
2404
- }
2405
- if (startMouse.peek()) {
2406
- startMouse.value = null;
2407
- localStorage.setItem(
2408
- LOCAL_KEY,
2409
- JSON.stringify({
2410
- ...anchorCoords.value,
2411
- ...viewportSize.value,
2412
- snapSide: snapSide.value
2413
- })
2414
- );
2415
- }
2416
- });
2417
- const updateAnchorPos = useCallback2(() => {
2418
- if (viewPortRef.current == null) return;
2419
- const viewportWidth = viewPortRef.current.offsetWidth;
2420
- if (snapSide.value === "right") {
2421
- const min = Math.min(-PADDING, anchorCoords.value.y);
2422
- anchorCoords.value = {
2423
- x: -PADDING,
2424
- y: Math.max(
2425
- min,
2426
- (window.innerHeight - elementBound.height.value) * -1 + PADDING
2427
- )
2428
- };
2429
- } else if (snapSide.value === "left") {
2430
- const min = Math.min(0, anchorCoords.value.y);
2431
- anchorCoords.value = {
2432
- x: (viewportWidth - elementBound.width.value) * -1 + PADDING,
2433
- y: Math.max(
2434
- min,
2435
- (window.innerHeight - elementBound.height.value) * -1 + PADDING
2436
- )
2437
- };
2438
- } else if (snapSide.value === "top") {
2439
- const min = Math.min(-PADDING, anchorCoords.value.x);
2440
- anchorCoords.value = {
2441
- x: Math.max(
2442
- min,
2443
- (viewportWidth - elementBound.width.value) * -1 + PADDING
2444
- ),
2445
- y: (window.innerHeight - elementBound.height.value) * -1 + PADDING
2446
- };
2447
- return;
2448
- } else {
2449
- const min = Math.min(-PADDING, anchorCoords.value.x);
2450
- anchorCoords.value = {
2451
- x: Math.max(
2452
- min,
2453
- (viewportWidth - elementBound.width.value) * -1 + PADDING
2454
- ),
2455
- y: -PADDING
2456
- };
2457
- }
2458
- }, []);
2459
- useWatch2([distanceCovered, mouse], (dist, mouse2) => {
2460
- if (dist === null || !viewPortRef.current) return;
2461
- const { x, y } = mouse2;
2462
- const viewportWidth = viewPortRef.current.offsetWidth;
2463
- const isInBottomSeg = y >= window.innerHeight - 100;
2464
- const isInTopSeg = y <= 100;
2465
- const isInMidSeg = !isInTopSeg && !isInBottomSeg;
2466
- if (isInMidSeg) {
2467
- const isRight = x > window.innerWidth / 2;
2468
- snapSide.value = isRight ? "right" : "left";
2469
- } else {
2470
- snapSide.value = isInTopSeg ? "top" : "bottom";
2471
- }
2472
- if (snapSide.value === "right") {
2473
- const min2 = Math.min(-PADDING, lastDroppedCoord.value.y + dist.y);
2474
- anchorCoords.value = {
2475
- x: -PADDING,
2476
- y: Math.max(
2477
- min2,
2478
- (window.innerHeight - elementBound.height.value) * -1 + PADDING
2479
- )
2480
- };
2481
- return;
2482
- } else if (snapSide.value === "left") {
2483
- const min2 = Math.min(0, lastDroppedCoord.value.y + dist.y);
2484
- anchorCoords.value = {
2485
- x: (viewportWidth - elementBound.width.value) * -1 + PADDING,
2486
- y: Math.max(
2487
- min2,
2488
- (window.innerHeight - elementBound.height.value) * -1 + PADDING
2489
- )
2490
- };
2491
- return;
2492
- } else if (snapSide.value === "top") {
2493
- const min2 = Math.min(-PADDING, lastDroppedCoord.value.x + dist.x);
2494
- anchorCoords.value = {
2495
- x: Math.max(
2496
- min2,
2497
- (viewportWidth - elementBound.width.value) * -1 + PADDING
2498
- ),
2499
- y: (window.innerHeight - elementBound.height.value) * -1 + PADDING
2500
- };
2501
- return;
2502
- }
2503
- const min = Math.min(-PADDING, lastDroppedCoord.value.x + dist.x);
2504
- anchorCoords.value = {
2505
- y: -PADDING,
2506
- x: Math.max(
2507
- min,
2508
- (viewportWidth - elementBound.width.value) * -1 + PADDING
2509
- )
2510
- };
2511
- });
2512
- const onResize = useCallback2(() => {
2513
- if (viewPortRef.current === null) return;
2514
- anchorCoords.value = reinitializeAnchorPos(
2515
- {
2516
- width: viewportSize.value.width,
2517
- height: viewportSize.value.height,
2518
- x: anchorCoords.value.x,
2519
- y: anchorCoords.value.y,
2520
- snapSide: snapSide.value
2521
- },
2522
- viewPortRef,
2523
- elementBound
2524
- );
2525
- viewportSize.value.width = window.innerWidth;
2526
- viewportSize.value.height = window.innerHeight;
2527
- localStorage.setItem(
2528
- LOCAL_KEY,
2529
- JSON.stringify({
2530
- ...anchorCoords.value,
2531
- ...viewportSize.value,
2532
- snapSide: snapSide.value
2533
- })
2534
- );
2535
- }, [
2536
- Math.round(elementBound.width.value),
2537
- Math.round(elementBound.height.value)
2538
- ]);
2539
- useEventListener("resize", onResize);
2540
- return {
2541
- anchorRef,
2542
- anchorCoords,
2543
- viewPortRef,
2544
- startMouse,
2545
- elementBound,
2546
- snapSide,
2547
- updateAnchorPos
2548
- };
2549
- }, "useAnchorPos");
2550
1998
 
2551
- // src/App.tsx
2552
- import { useSignal as useSignal6, Transition, useEffect as useEffect5, useLayoutEffect as useLayoutEffect3, useRef as useRef3 } from "kiru";
1999
+ /*
2000
+ Add the correct font size in all browsers.
2001
+ */
2553
2002
 
2554
- // src/hooks/useDevtools.ts
2555
- import { useCallback as useCallback3 } from "kiru";
2003
+ small {
2004
+ font-size: 80%;
2005
+ }
2556
2006
 
2557
- // src/store.ts
2558
- import { signal as signal2 } from "kiru";
2559
- var toggleElementToVnode = signal2(false);
2560
- if ("window" in globalThis) {
2561
- broadcastChannel.addEventListener((e) => {
2562
- if (e.data.type === "set-inspect-enabled") {
2563
- toggleElementToVnode.value = e.data.value;
2564
- }
2565
- });
2007
+ /*
2008
+ Prevent \\\`sub\\\` and \\\`sup\\\` elements from affecting the line height in all browsers.
2009
+ */
2010
+
2011
+ sub,
2012
+ sup {
2013
+ font-size: 75%;
2014
+ line-height: 0;
2015
+ position: relative;
2016
+ vertical-align: baseline;
2566
2017
  }
2567
- var popup = signal2(null);
2568
-
2569
- // src/hooks/useDevtools.ts
2570
- var SIZE_STORAGE_KEY = "kiru-devtools-popup-size";
2571
- var useDevTools = /* @__PURE__ */ __name(() => {
2572
- const _popup = popup.value;
2573
- const handleOpen = useCallback3(() => {
2574
- return new Promise((res, rej) => {
2575
- if (_popup) {
2576
- if (_popup.closed) {
2577
- popup.value = null;
2578
- } else {
2579
- _popup.focus();
2580
- return res(_popup);
2581
- }
2582
- }
2583
- const savedSize_raw = sessionStorage.getItem(SIZE_STORAGE_KEY);
2584
- const size = savedSize_raw ? JSON.parse(savedSize_raw) : {
2585
- width: Math.floor(Math.min(1920, window.screen.width) / 2),
2586
- height: Math.floor(Math.min(1080, window.screen.height) / 2)
2587
- };
2588
- const features = \`popup,width=\${size.width},height=\${size.height};\`;
2589
- const w = window.open(
2590
- // @ts-ignore
2591
- window.__KIRU_DEVTOOLS_PATHNAME__,
2592
- "_blank",
2593
- features
2594
- );
2595
- if (!w)
2596
- return console.error("[kiru]: Unable to open devtools window"), rej();
2597
- const handleReady = /* @__PURE__ */ __name((e) => {
2598
- if (e.data.type !== "ready") return;
2599
- broadcastChannel.removeEventListener(handleReady);
2600
- console.debug("[kiru]: devtools window opened");
2601
- res(w);
2602
- popup.value = w;
2603
- w.onbeforeunload = () => {
2604
- console.debug("[kiru]: devtools window closed");
2605
- popup.value = null;
2606
- };
2607
- }, "handleReady");
2608
- broadcastChannel.addEventListener(handleReady);
2609
- w.onresize = () => {
2610
- sessionStorage.setItem(
2611
- SIZE_STORAGE_KEY,
2612
- JSON.stringify({
2613
- width: w.innerWidth,
2614
- height: w.innerHeight
2615
- })
2616
- );
2617
- };
2618
- });
2619
- }, [_popup]);
2620
- return handleOpen;
2621
- }, "useDevTools");
2622
-
2623
- // src/components/InspectComponent.tsx
2624
- import * as kiru3 from "kiru";
2625
- import { useEffect as useEffect4, useMemo as useMemo4, useRef as useRef2 } from "kiru";
2626
- var InspectComponent = /* @__PURE__ */ __name(() => {
2627
- const openDevTools = useDevTools();
2628
- const { mouse } = useMouse();
2629
- const controls = useElementByPoint({
2630
- x: mouse.value.x,
2631
- y: mouse.value.y,
2632
- immediate: false
2633
- });
2634
- const _el = controls.element.value;
2635
- const element = toggleElementToVnode.value ? _el : null;
2636
- const elApp = useMemo4(() => {
2637
- if (element && window.__kiru) {
2638
- const app = window.__kiru.apps.find(($app) => {
2639
- if ($app.rootNode == null || element.__kiruNode == null) return false;
2640
- return vNodeContains($app.rootNode, element.__kiruNode);
2641
- });
2642
- if (app?.rootNode == null) return null;
2643
- return app;
2644
- }
2645
- return null;
2646
- }, [element]);
2647
- const vnode = useMemo4(() => {
2648
- if (element) {
2649
- return getComponentVnodeFromElement(element);
2650
- }
2651
- return null;
2652
- }, [element]);
2653
- const boundingRef = useRef2(null);
2654
- const bounding = useElementBounding(boundingRef);
2655
- useEffect4(() => {
2656
- const unsub = toggleElementToVnode.subscribe((toggled) => {
2657
- controls[toggled ? "start" : "stop"]();
2658
- });
2659
- return unsub;
2660
- }, []);
2661
- useEffect4(() => {
2662
- if (vnode && element) {
2663
- boundingRef.current = getNearestElm(vnode, element) ?? null;
2664
- } else {
2665
- boundingRef.current = null;
2666
- }
2667
- }, [vnode, element]);
2668
- useEventListener("click", (e) => {
2669
- if (toggleElementToVnode.value === true && vnode && elApp) {
2670
- e.preventDefault();
2671
- const emitSelectNode = /* @__PURE__ */ __name((w) => {
2672
- w.__devtoolsSelection = { node: vnode, app: elApp };
2673
- broadcastChannel.send({ type: "select-node" });
2674
- broadcastChannel.send({
2675
- type: "set-inspect-enabled",
2676
- value: false
2677
- });
2678
- toggleElementToVnode.value = false;
2679
- boundingRef.current = null;
2680
- w.focus();
2681
- }, "emitSelectNode");
2682
- if (!popup.value) {
2683
- openDevTools().then((w) => emitSelectNode(w));
2684
- } else {
2685
- emitSelectNode(popup.value);
2686
- }
2687
- }
2688
- });
2689
- return vnode && /* @__PURE__ */ kiru3.createElement(
2690
- "div",
2691
- {
2692
- className: "bg-[crimson]/80 fixed grid place-content-center pointer-events-none z-10 top-0 left-0",
2693
- style: {
2694
- width: \`\${bounding?.width}px\`,
2695
- height: \`\${bounding?.height}px\`,
2696
- transform: \`translate(\${bounding.x}px, \${bounding.y}px)\`
2697
- }
2698
- },
2699
- /* @__PURE__ */ kiru3.createElement("p", null, vnode.type.name)
2700
- );
2701
- }, "InspectComponent");
2702
2018
 
2703
- // src/icon/PageInfo.tsx
2704
- import * as kiru4 from "kiru";
2705
- function PageInfo(props) {
2706
- return /* @__PURE__ */ kiru4.createElement(
2707
- "svg",
2708
- {
2709
- xmlns: "http://www.w3.org/2000/svg",
2710
- width: 20,
2711
- height: 20,
2712
- viewBox: "0 -960 960 960",
2713
- fill: "currentColor",
2714
- ...props
2715
- },
2716
- /* @__PURE__ */ kiru4.createElement("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" })
2717
- );
2019
+ sub {
2020
+ bottom: -0.25em;
2718
2021
  }
2719
- __name(PageInfo, "PageInfo");
2720
2022
 
2721
- // src/icon/SquareMouse.tsx
2722
- import * as kiru5 from "kiru";
2723
- function SquareMouse(props) {
2724
- return /* @__PURE__ */ kiru5.createElement(
2725
- "svg",
2726
- {
2727
- xmlns: "http://www.w3.org/2000/svg",
2728
- width: 20,
2729
- height: 20,
2730
- viewBox: "0 0 24 24",
2731
- fill: "none",
2732
- stroke: "currentColor",
2733
- strokeWidth: "2",
2734
- strokeLinecap: "round",
2735
- strokeLinejoin: "round",
2736
- className: "lucide lucide-square-mouse-pointer",
2737
- ...props
2738
- },
2739
- /* @__PURE__ */ kiru5.createElement("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" }),
2740
- /* @__PURE__ */ kiru5.createElement("path", { d: "M21 11V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h6" })
2741
- );
2023
+ sup {
2024
+ top: -0.5em;
2742
2025
  }
2743
- __name(SquareMouse, "SquareMouse");
2744
2026
 
2745
- // src/App.tsx
2746
- var handleToggleInspect = /* @__PURE__ */ __name(() => {
2747
- toggleElementToVnode.value = !toggleElementToVnode.value;
2748
- broadcastChannel.send({
2749
- type: "set-inspect-enabled",
2750
- value: toggleElementToVnode.value
2751
- });
2752
- }, "handleToggleInspect");
2753
- function useLerpedVec2(value, options) {
2754
- const { damping } = options;
2755
- const current = useSignal6(value);
2756
- const target = useRef3(value);
2757
- useEffect5(() => {
2758
- let frameId = null;
2759
- const callback = /* @__PURE__ */ __name(() => {
2760
- const dist = Math.sqrt(
2761
- Math.pow(target.current.x - current.value.x, 2) + Math.pow(target.current.y - current.value.y, 2)
2762
- );
2763
- if (dist < 5) {
2764
- return;
2765
- }
2766
- const nextX = current.value.x + (target.current.x - current.value.x) * damping;
2767
- const nextY = current.value.y + (target.current.y - current.value.y) * damping;
2768
- current.value = {
2769
- x: nextX,
2770
- y: nextY
2771
- };
2772
- frameId = window.requestAnimationFrame(callback);
2773
- }, "callback");
2774
- frameId = window.requestAnimationFrame(callback);
2775
- return () => {
2776
- if (frameId != null) {
2777
- window.cancelAnimationFrame(frameId);
2778
- }
2779
- };
2780
- }, [value.x, value.y]);
2781
- return Object.assign(current, {
2782
- set: /* @__PURE__ */ __name((value2, options2) => {
2783
- target.current = value2;
2784
- if (options2?.hard) {
2785
- current.value = value2;
2786
- }
2787
- }, "set")
2788
- });
2027
+ /*
2028
+ 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)
2029
+ 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)
2030
+ 3. Remove gaps between table borders by default.
2031
+ */
2032
+
2033
+ table {
2034
+ text-indent: 0; /* 1 */
2035
+ border-color: inherit; /* 2 */
2036
+ border-collapse: collapse; /* 3 */
2789
2037
  }
2790
- __name(useLerpedVec2, "useLerpedVec2");
2791
- function App() {
2792
- const toggled = useSignal6(false);
2793
- const handleOpen = useDevTools();
2794
- const { anchorCoords, anchorRef, viewPortRef, startMouse, snapSide } = useAnchorPos();
2795
- const isHorizontalSnap = snapSide.value === "left" || snapSide.value === "right";
2796
- const isMounted = useRef3(false);
2797
- const smoothedCoords = useLerpedVec2(anchorCoords.value, {
2798
- damping: 0.4
2799
- });
2800
- kiru6.useWatch([anchorCoords], smoothedCoords.set);
2801
- useLayoutEffect3(() => {
2802
- if (isMounted.current === false) {
2803
- smoothedCoords.set(anchorCoords.value, {
2804
- hard: true
2805
- });
2806
- }
2807
- isMounted.current = true;
2808
- }, []);
2809
- return /* @__PURE__ */ kiru6.createElement(kiru6.Fragment, null, /* @__PURE__ */ kiru6.createElement(
2810
- "div",
2811
- {
2812
- ref: viewPortRef,
2813
- className: "w-full h-0 fixed top-0 left-0 z-[-9999] overflow-scroll pointer-events-none"
2814
- }
2815
- ), /* @__PURE__ */ kiru6.createElement(
2816
- "div",
2817
- {
2818
- ref: anchorRef,
2819
- draggable: true,
2820
- className: \`flex \${isHorizontalSnap ? "flex-col" : ""} \${toggled.value ? "rounded-3xl" : "rounded-full"} p-1 gap-1 items-center will-change-transform bg-crimson\`,
2821
- style: {
2822
- transform: \`translate3d(\${Math.round(
2823
- smoothedCoords.value.x
2824
- )}px, \${Math.round(smoothedCoords.value.y)}px, 0)\`
2825
- }
2826
- },
2827
- /* @__PURE__ */ kiru6.createElement(
2828
- Transition,
2829
- {
2830
- in: toggled.value,
2831
- duration: {
2832
- in: 40,
2833
- out: 150
2834
- },
2835
- element: (state) => {
2836
- if (state === "exited") return null;
2837
- const scale = state === "entered" ? "1" : "0.5";
2838
- const opacity = state === "entered" ? "1" : "0";
2839
- return /* @__PURE__ */ kiru6.createElement(kiru6.Fragment, null, /* @__PURE__ */ kiru6.createElement(
2840
- "button",
2841
- {
2842
- title: "Open Devtools",
2843
- onclick: handleOpen,
2844
- style: { transform: \`scale(\${scale})\`, opacity },
2845
- className: "transition text-white rounded-full p-1 hover:bg-[#0003]"
2846
- },
2847
- /* @__PURE__ */ kiru6.createElement(PageInfo, { width: 16, height: 16 })
2848
- ), /* @__PURE__ */ kiru6.createElement(
2849
- "button",
2850
- {
2851
- title: "Toggle Component Inspection",
2852
- onclick: handleToggleInspect,
2853
- style: { transform: \`scale(\${scale})\`, opacity },
2854
- className: \`transition text-white rounded-full p-1 hover:bg-[#0003] \${toggleElementToVnode.value ? "bg-[#0003]" : ""}\`
2855
- },
2856
- /* @__PURE__ */ kiru6.createElement(SquareMouse, { width: 16, height: 16 })
2857
- ));
2858
- }
2859
- }
2860
- ),
2861
- /* @__PURE__ */ kiru6.createElement(
2862
- "button",
2863
- {
2864
- className: "bg-crimson rounded-full p-1" + (startMouse.value ? " pointer-events-none" : ""),
2865
- onclick: () => toggled.value = !toggled.value,
2866
- tabIndex: -1
2867
- },
2868
- /* @__PURE__ */ kiru6.createElement(Flame, null)
2869
- )
2870
- ), /* @__PURE__ */ kiru6.createElement(InspectComponent, null));
2871
- }
2872
- __name(App, "App");
2873
-
2874
- // _ekfsstq70:C:\\repos\\kiru\\packages\\devtools-host\\src\\style.css
2875
- var style_default = "*, ::before, ::after {\\n --tw-border-spacing-x: 0;\\n --tw-border-spacing-y: 0;\\n --tw-translate-x: 0;\\n --tw-translate-y: 0;\\n --tw-rotate: 0;\\n --tw-skew-x: 0;\\n --tw-skew-y: 0;\\n --tw-scale-x: 1;\\n --tw-scale-y: 1;\\n --tw-pan-x: ;\\n --tw-pan-y: ;\\n --tw-pinch-zoom: ;\\n --tw-scroll-snap-strictness: proximity;\\n --tw-gradient-from-position: ;\\n --tw-gradient-via-position: ;\\n --tw-gradient-to-position: ;\\n --tw-ordinal: ;\\n --tw-slashed-zero: ;\\n --tw-numeric-figure: ;\\n --tw-numeric-spacing: ;\\n --tw-numeric-fraction: ;\\n --tw-ring-inset: ;\\n --tw-ring-offset-width: 0px;\\n --tw-ring-offset-color: #fff;\\n --tw-ring-color: rgb(59 130 246 / 0.5);\\n --tw-ring-offset-shadow: 0 0 #0000;\\n --tw-ring-shadow: 0 0 #0000;\\n --tw-shadow: 0 0 #0000;\\n --tw-shadow-colored: 0 0 #0000;\\n --tw-blur: ;\\n --tw-brightness: ;\\n --tw-contrast: ;\\n --tw-grayscale: ;\\n --tw-hue-rotate: ;\\n --tw-invert: ;\\n --tw-saturate: ;\\n --tw-sepia: ;\\n --tw-drop-shadow: ;\\n --tw-backdrop-blur: ;\\n --tw-backdrop-brightness: ;\\n --tw-backdrop-contrast: ;\\n --tw-backdrop-grayscale: ;\\n --tw-backdrop-hue-rotate: ;\\n --tw-backdrop-invert: ;\\n --tw-backdrop-opacity: ;\\n --tw-backdrop-saturate: ;\\n --tw-backdrop-sepia: ;\\n --tw-contain-size: ;\\n --tw-contain-layout: ;\\n --tw-contain-paint: ;\\n --tw-contain-style: ;\\n}\\n\\n::backdrop {\\n --tw-border-spacing-x: 0;\\n --tw-border-spacing-y: 0;\\n --tw-translate-x: 0;\\n --tw-translate-y: 0;\\n --tw-rotate: 0;\\n --tw-skew-x: 0;\\n --tw-skew-y: 0;\\n --tw-scale-x: 1;\\n --tw-scale-y: 1;\\n --tw-pan-x: ;\\n --tw-pan-y: ;\\n --tw-pinch-zoom: ;\\n --tw-scroll-snap-strictness: proximity;\\n --tw-gradient-from-position: ;\\n --tw-gradient-via-position: ;\\n --tw-gradient-to-position: ;\\n --tw-ordinal: ;\\n --tw-slashed-zero: ;\\n --tw-numeric-figure: ;\\n --tw-numeric-spacing: ;\\n --tw-numeric-fraction: ;\\n --tw-ring-inset: ;\\n --tw-ring-offset-width: 0px;\\n --tw-ring-offset-color: #fff;\\n --tw-ring-color: rgb(59 130 246 / 0.5);\\n --tw-ring-offset-shadow: 0 0 #0000;\\n --tw-ring-shadow: 0 0 #0000;\\n --tw-shadow: 0 0 #0000;\\n --tw-shadow-colored: 0 0 #0000;\\n --tw-blur: ;\\n --tw-brightness: ;\\n --tw-contrast: ;\\n --tw-grayscale: ;\\n --tw-hue-rotate: ;\\n --tw-invert: ;\\n --tw-saturate: ;\\n --tw-sepia: ;\\n --tw-drop-shadow: ;\\n --tw-backdrop-blur: ;\\n --tw-backdrop-brightness: ;\\n --tw-backdrop-contrast: ;\\n --tw-backdrop-grayscale: ;\\n --tw-backdrop-hue-rotate: ;\\n --tw-backdrop-invert: ;\\n --tw-backdrop-opacity: ;\\n --tw-backdrop-saturate: ;\\n --tw-backdrop-sepia: ;\\n --tw-contain-size: ;\\n --tw-contain-layout: ;\\n --tw-contain-paint: ;\\n --tw-contain-style: ;\\n}/*\\n! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com\\n*//*\\n1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)\\n2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)\\n*/\\n\\n*,\\n::before,\\n::after {\\n box-sizing: border-box; /* 1 */\\n border-width: 0; /* 2 */\\n border-style: solid; /* 2 */\\n border-color: #e5e7eb; /* 2 */\\n}\\n\\n::before,\\n::after {\\n --tw-content: '';\\n}\\n\\n/*\\n1. Use a consistent sensible line-height in all browsers.\\n2. Prevent adjustments of font size after orientation changes in iOS.\\n3. Use a more readable tab size.\\n4. Use the user's configured \`sans\` font-family by default.\\n5. Use the user's configured \`sans\` font-feature-settings by default.\\n6. Use the user's configured \`sans\` font-variation-settings by default.\\n7. Disable tap highlights on iOS\\n*/\\n\\nhtml,\\n:host {\\n line-height: 1.5; /* 1 */\\n -webkit-text-size-adjust: 100%; /* 2 */\\n -moz-tab-size: 4; /* 3 */\\n -o-tab-size: 4;\\n tab-size: 4; /* 3 */\\n font-family: ui-sans-serif, system-ui, sans-serif, \\"Apple Color Emoji\\", \\"Segoe UI Emoji\\", \\"Segoe UI Symbol\\", \\"Noto Color Emoji\\"; /* 4 */\\n font-feature-settings: normal; /* 5 */\\n font-variation-settings: normal; /* 6 */\\n -webkit-tap-highlight-color: transparent; /* 7 */\\n}\\n\\n/*\\n1. Remove the margin in all browsers.\\n2. Inherit line-height from \`html\` so users can set them as a class directly on the \`html\` element.\\n*/\\n\\nbody {\\n margin: 0; /* 1 */\\n line-height: inherit; /* 2 */\\n}\\n\\n/*\\n1. Add the correct height in Firefox.\\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\\n3. Ensure horizontal rules are visible by default.\\n*/\\n\\nhr {\\n height: 0; /* 1 */\\n color: inherit; /* 2 */\\n border-top-width: 1px; /* 3 */\\n}\\n\\n/*\\nAdd the correct text decoration in Chrome, Edge, and Safari.\\n*/\\n\\nabbr:where([title]) {\\n -webkit-text-decoration: underline dotted;\\n text-decoration: underline dotted;\\n}\\n\\n/*\\nRemove the default font size and weight for headings.\\n*/\\n\\nh1,\\nh2,\\nh3,\\nh4,\\nh5,\\nh6 {\\n font-size: inherit;\\n font-weight: inherit;\\n}\\n\\n/*\\nReset links to optimize for opt-in styling instead of opt-out.\\n*/\\n\\na {\\n color: inherit;\\n text-decoration: inherit;\\n}\\n\\n/*\\nAdd the correct font weight in Edge and Safari.\\n*/\\n\\nb,\\nstrong {\\n font-weight: bolder;\\n}\\n\\n/*\\n1. Use the user's configured \`mono\` font-family by default.\\n2. Use the user's configured \`mono\` font-feature-settings by default.\\n3. Use the user's configured \`mono\` font-variation-settings by default.\\n4. Correct the odd \`em\` font sizing in all browsers.\\n*/\\n\\ncode,\\nkbd,\\nsamp,\\npre {\\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \\"Liberation Mono\\", \\"Courier New\\", monospace; /* 1 */\\n font-feature-settings: normal; /* 2 */\\n font-variation-settings: normal; /* 3 */\\n font-size: 1em; /* 4 */\\n}\\n\\n/*\\nAdd the correct font size in all browsers.\\n*/\\n\\nsmall {\\n font-size: 80%;\\n}\\n\\n/*\\nPrevent \`sub\` and \`sup\` elements from affecting the line height in all browsers.\\n*/\\n\\nsub,\\nsup {\\n font-size: 75%;\\n line-height: 0;\\n position: relative;\\n vertical-align: baseline;\\n}\\n\\nsub {\\n bottom: -0.25em;\\n}\\n\\nsup {\\n top: -0.5em;\\n}\\n\\n/*\\n1. 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)\\n2. 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)\\n3. Remove gaps between table borders by default.\\n*/\\n\\ntable {\\n text-indent: 0; /* 1 */\\n border-color: inherit; /* 2 */\\n border-collapse: collapse; /* 3 */\\n}\\n\\n/*\\n1. Change the font styles in all browsers.\\n2. Remove the margin in Firefox and Safari.\\n3. Remove default padding in all browsers.\\n*/\\n\\nbutton,\\ninput,\\noptgroup,\\nselect,\\ntextarea {\\n font-family: inherit; /* 1 */\\n font-feature-settings: inherit; /* 1 */\\n font-variation-settings: inherit; /* 1 */\\n font-size: 100%; /* 1 */\\n font-weight: inherit; /* 1 */\\n line-height: inherit; /* 1 */\\n letter-spacing: inherit; /* 1 */\\n color: inherit; /* 1 */\\n margin: 0; /* 2 */\\n padding: 0; /* 3 */\\n}\\n\\n/*\\nRemove the inheritance of text transform in Edge and Firefox.\\n*/\\n\\nbutton,\\nselect {\\n text-transform: none;\\n}\\n\\n/*\\n1. Correct the inability to style clickable types in iOS and Safari.\\n2. Remove default button styles.\\n*/\\n\\nbutton,\\ninput:where([type='button']),\\ninput:where([type='reset']),\\ninput:where([type='submit']) {\\n -webkit-appearance: button; /* 1 */\\n background-color: transparent; /* 2 */\\n background-image: none; /* 2 */\\n}\\n\\n/*\\nUse the modern Firefox focus style for all focusable elements.\\n*/\\n\\n:-moz-focusring {\\n outline: auto;\\n}\\n\\n/*\\nRemove the additional \`:invalid\` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)\\n*/\\n\\n:-moz-ui-invalid {\\n box-shadow: none;\\n}\\n\\n/*\\nAdd the correct vertical alignment in Chrome and Firefox.\\n*/\\n\\nprogress {\\n vertical-align: baseline;\\n}\\n\\n/*\\nCorrect the cursor style of increment and decrement buttons in Safari.\\n*/\\n\\n::-webkit-inner-spin-button,\\n::-webkit-outer-spin-button {\\n height: auto;\\n}\\n\\n/*\\n1. Correct the odd appearance in Chrome and Safari.\\n2. Correct the outline style in Safari.\\n*/\\n\\n[type='search'] {\\n -webkit-appearance: textfield; /* 1 */\\n outline-offset: -2px; /* 2 */\\n}\\n\\n/*\\nRemove the inner padding in Chrome and Safari on macOS.\\n*/\\n\\n::-webkit-search-decoration {\\n -webkit-appearance: none;\\n}\\n\\n/*\\n1. Correct the inability to style clickable types in iOS and Safari.\\n2. Change font properties to \`inherit\` in Safari.\\n*/\\n\\n::-webkit-file-upload-button {\\n -webkit-appearance: button; /* 1 */\\n font: inherit; /* 2 */\\n}\\n\\n/*\\nAdd the correct display in Chrome and Safari.\\n*/\\n\\nsummary {\\n display: list-item;\\n}\\n\\n/*\\nRemoves the default spacing and border for appropriate elements.\\n*/\\n\\nblockquote,\\ndl,\\ndd,\\nh1,\\nh2,\\nh3,\\nh4,\\nh5,\\nh6,\\nhr,\\nfigure,\\np,\\npre {\\n margin: 0;\\n}\\n\\nfieldset {\\n margin: 0;\\n padding: 0;\\n}\\n\\nlegend {\\n padding: 0;\\n}\\n\\nol,\\nul,\\nmenu {\\n list-style: none;\\n margin: 0;\\n padding: 0;\\n}\\n\\n/*\\nReset default styling for dialogs.\\n*/\\ndialog {\\n padding: 0;\\n}\\n\\n/*\\nPrevent resizing textareas horizontally by default.\\n*/\\n\\ntextarea {\\n resize: vertical;\\n}\\n\\n/*\\n1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)\\n2. Set the default placeholder color to the user's configured gray 400 color.\\n*/\\n\\ninput::-moz-placeholder, textarea::-moz-placeholder {\\n opacity: 1; /* 1 */\\n color: #9ca3af; /* 2 */\\n}\\n\\ninput::placeholder,\\ntextarea::placeholder {\\n opacity: 1; /* 1 */\\n color: #9ca3af; /* 2 */\\n}\\n\\n/*\\nSet the default cursor for buttons.\\n*/\\n\\nbutton,\\n[role=\\"button\\"] {\\n cursor: pointer;\\n}\\n\\n/*\\nMake sure disabled buttons don't get the pointer cursor.\\n*/\\n:disabled {\\n cursor: default;\\n}\\n\\n/*\\n1. Make replaced elements \`display: block\` by default. (https://github.com/mozdevs/cssremedy/issues/14)\\n2. Add \`vertical-align: middle\` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)\\n This can trigger a poorly considered lint error in some tools but is included by design.\\n*/\\n\\nimg,\\nsvg,\\nvideo,\\ncanvas,\\naudio,\\niframe,\\nembed,\\nobject {\\n display: block; /* 1 */\\n vertical-align: middle; /* 2 */\\n}\\n\\n/*\\nConstrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)\\n*/\\n\\nimg,\\nvideo {\\n max-width: 100%;\\n height: auto;\\n}\\n\\n/* Make elements with the HTML hidden attribute stay hidden by default */\\n[hidden]:where(:not([hidden=\\"until-found\\"])) {\\n display: none;\\n}\\n.pointer-events-none {\\n pointer-events: none;\\n}\\n.fixed {\\n position: fixed;\\n}\\n.sticky {\\n position: sticky;\\n}\\n.bottom-0 {\\n bottom: 0px;\\n}\\n.left-0 {\\n left: 0px;\\n}\\n.right-0 {\\n right: 0px;\\n}\\n.top-0 {\\n top: 0px;\\n}\\n.z-10 {\\n z-index: 10;\\n}\\n.z-\\\\[-9999\\\\] {\\n z-index: -9999;\\n}\\n.z-\\\\[9999999\\\\] {\\n z-index: 9999999;\\n}\\n.mb-2 {\\n margin-bottom: 0.5rem;\\n}\\n.inline {\\n display: inline;\\n}\\n.flex {\\n display: flex;\\n}\\n.grid {\\n display: grid;\\n}\\n.contents {\\n display: contents;\\n}\\n.h-0 {\\n height: 0px;\\n}\\n.h-5 {\\n height: 1.25rem;\\n}\\n.w-5 {\\n width: 1.25rem;\\n}\\n.w-full {\\n width: 100%;\\n}\\n.flex-grow {\\n flex-grow: 1;\\n}\\n.rotate-90 {\\n --tw-rotate: 90deg;\\n 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));\\n}\\n.transform {\\n 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));\\n}\\n.cursor-default {\\n cursor: default;\\n}\\n.cursor-pointer {\\n cursor: pointer;\\n}\\n.resize {\\n resize: both;\\n}\\n.flex-col {\\n flex-direction: column;\\n}\\n.place-content-center {\\n place-content: center;\\n}\\n.items-start {\\n align-items: flex-start;\\n}\\n.items-center {\\n align-items: center;\\n}\\n.justify-between {\\n justify-content: space-between;\\n}\\n.gap-1 {\\n gap: 0.25rem;\\n}\\n.gap-2 {\\n gap: 0.5rem;\\n}\\n.overflow-hidden {\\n overflow: hidden;\\n}\\n.overflow-scroll {\\n overflow: scroll;\\n}\\n.truncate {\\n overflow: hidden;\\n text-overflow: ellipsis;\\n white-space: nowrap;\\n}\\n.rounded {\\n border-radius: 0.25rem;\\n}\\n.rounded-3xl {\\n border-radius: 1.5rem;\\n}\\n.rounded-full {\\n border-radius: 9999px;\\n}\\n.border {\\n border-width: 1px;\\n}\\n.border-b {\\n border-bottom-width: 1px;\\n}\\n.border-b-2 {\\n border-bottom-width: 2px;\\n}\\n.border-\\\\[\\\\#fff1\\\\] {\\n border-color: #fff1;\\n}\\n.border-neutral-700 {\\n --tw-border-opacity: 1;\\n border-color: rgb(64 64 64 / var(--tw-border-opacity, 1));\\n}\\n.border-neutral-800 {\\n --tw-border-opacity: 1;\\n border-color: rgb(38 38 38 / var(--tw-border-opacity, 1));\\n}\\n.border-white {\\n --tw-border-opacity: 1;\\n border-color: rgb(255 255 255 / var(--tw-border-opacity, 1));\\n}\\n.border-opacity-10 {\\n --tw-border-opacity: 0.1;\\n}\\n.bg-\\\\[\\\\#0003\\\\] {\\n background-color: #0003;\\n}\\n.bg-\\\\[\\\\#1d1d1d\\\\] {\\n --tw-bg-opacity: 1;\\n background-color: rgb(29 29 29 / var(--tw-bg-opacity, 1));\\n}\\n.bg-\\\\[\\\\#212121\\\\] {\\n --tw-bg-opacity: 1;\\n background-color: rgb(33 33 33 / var(--tw-bg-opacity, 1));\\n}\\n.bg-\\\\[\\\\#ffffff04\\\\] {\\n background-color: #ffffff04;\\n}\\n.bg-\\\\[crimson\\\\]\\\\/80 {\\n background-color: rgb(220 20 60 / 0.8);\\n}\\n.bg-crimson {\\n --tw-bg-opacity: 1;\\n background-color: rgb(220 20 60 / var(--tw-bg-opacity, 1));\\n}\\n.bg-neutral-400 {\\n --tw-bg-opacity: 1;\\n background-color: rgb(163 163 163 / var(--tw-bg-opacity, 1));\\n}\\n.bg-opacity-5 {\\n --tw-bg-opacity: 0.05;\\n}\\n.p-1 {\\n padding: 0.25rem;\\n}\\n.p-2 {\\n padding: 0.5rem;\\n}\\n.px-2 {\\n padding-left: 0.5rem;\\n padding-right: 0.5rem;\\n}\\n.py-1 {\\n padding-top: 0.25rem;\\n padding-bottom: 0.25rem;\\n}\\n.pb-2 {\\n padding-bottom: 0.5rem;\\n}\\n.pl-2 {\\n padding-left: 0.5rem;\\n}\\n.pl-6 {\\n padding-left: 1.5rem;\\n}\\n.pr-1 {\\n padding-right: 0.25rem;\\n}\\n.text-\\\\[10px\\\\] {\\n font-size: 10px;\\n}\\n.text-sm {\\n font-size: 0.875rem;\\n line-height: 1.25rem;\\n}\\n.text-xs {\\n font-size: 0.75rem;\\n line-height: 1rem;\\n}\\n.font-bold {\\n font-weight: 700;\\n}\\n.font-medium {\\n font-weight: 500;\\n}\\n.text-neutral-300 {\\n --tw-text-opacity: 1;\\n color: rgb(212 212 212 / var(--tw-text-opacity, 1));\\n}\\n.text-white {\\n --tw-text-opacity: 1;\\n color: rgb(255 255 255 / var(--tw-text-opacity, 1));\\n}\\n.accent-red-500 {\\n accent-color: #ef4444;\\n}\\n.opacity-50 {\\n opacity: 0.5;\\n}\\n.shadow {\\n --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);\\n --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);\\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\\n}\\n.filter {\\n 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);\\n}\\n.transition {\\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;\\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;\\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;\\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\\n transition-duration: 150ms;\\n}\\n.transition-opacity {\\n transition-property: opacity;\\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\\n transition-duration: 150ms;\\n}\\n.will-change-transform {\\n will-change: transform;\\n}\\n.last\\\\:border-b-0:last-child {\\n border-bottom-width: 0px;\\n}\\n.hover\\\\:bg-\\\\[\\\\#0003\\\\]:hover {\\n background-color: #0003;\\n}\\n.hover\\\\:bg-neutral-700:hover {\\n --tw-bg-opacity: 1;\\n background-color: rgb(64 64 64 / var(--tw-bg-opacity, 1));\\n}\\n.hover\\\\:opacity-100:hover {\\n opacity: 1;\\n}\\n.focus\\\\:outline:focus {\\n outline-style: solid;\\n}\\n";
2876
2038
 
2877
- // src/index.ts
2878
- if ("window" in globalThis) {
2879
- const pageRoot = document.createElement("kiru-devtools");
2880
- pageRoot.setAttribute("style", "display: contents");
2881
- document.body.appendChild(pageRoot);
2882
- const shadow = pageRoot.attachShadow({ mode: "open" });
2883
- const sheet = new CSSStyleSheet();
2884
- sheet.replaceSync(style_default);
2885
- shadow.adoptedStyleSheets = [sheet];
2886
- const appRoot = Object.assign(document.createElement("div"), {
2887
- id: "devtools-root",
2888
- className: "fixed flex bottom-0 right-0 z-[9999999]"
2889
- });
2890
- shadow.appendChild(appRoot);
2891
- mount(createElement7(App, {}), appRoot, {
2892
- name: "kiru.devtools"
2893
- });
2894
- const handleMainWindowClose = /* @__PURE__ */ __name(() => popup.value?.close(), "handleMainWindowClose");
2895
- window.addEventListener("close", handleMainWindowClose);
2896
- window.addEventListener("beforeunload", handleMainWindowClose);
2897
- broadcastChannel.addEventListener((msg) => {
2898
- if (msg.data.type === "open-editor") {
2899
- window.open(msg.data.fileLink);
2900
- }
2901
- });
2039
+ /*
2040
+ 1. Change the font styles in all browsers.
2041
+ 2. Remove the margin in Firefox and Safari.
2042
+ 3. Remove default padding in all browsers.
2043
+ */
2044
+
2045
+ button,
2046
+ input,
2047
+ optgroup,
2048
+ select,
2049
+ textarea {
2050
+ font-family: inherit; /* 1 */
2051
+ font-feature-settings: inherit; /* 1 */
2052
+ font-variation-settings: inherit; /* 1 */
2053
+ font-size: 100%; /* 1 */
2054
+ font-weight: inherit; /* 1 */
2055
+ line-height: inherit; /* 1 */
2056
+ letter-spacing: inherit; /* 1 */
2057
+ color: inherit; /* 1 */
2058
+ margin: 0; /* 2 */
2059
+ padding: 0; /* 3 */
2060
+ }
2061
+
2062
+ /*
2063
+ Remove the inheritance of text transform in Edge and Firefox.
2064
+ */
2065
+
2066
+ button,
2067
+ select {
2068
+ text-transform: none;
2069
+ }
2070
+
2071
+ /*
2072
+ 1. Correct the inability to style clickable types in iOS and Safari.
2073
+ 2. Remove default button styles.
2074
+ */
2075
+
2076
+ button,
2077
+ input:where([type='button']),
2078
+ input:where([type='reset']),
2079
+ input:where([type='submit']) {
2080
+ -webkit-appearance: button; /* 1 */
2081
+ background-color: transparent; /* 2 */
2082
+ background-image: none; /* 2 */
2083
+ }
2084
+
2085
+ /*
2086
+ Use the modern Firefox focus style for all focusable elements.
2087
+ */
2088
+
2089
+ :-moz-focusring {
2090
+ outline: auto;
2091
+ }
2092
+
2093
+ /*
2094
+ Remove the additional \\\`:invalid\\\` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
2095
+ */
2096
+
2097
+ :-moz-ui-invalid {
2098
+ box-shadow: none;
2099
+ }
2100
+
2101
+ /*
2102
+ Add the correct vertical alignment in Chrome and Firefox.
2103
+ */
2104
+
2105
+ progress {
2106
+ vertical-align: baseline;
2107
+ }
2108
+
2109
+ /*
2110
+ Correct the cursor style of increment and decrement buttons in Safari.
2111
+ */
2112
+
2113
+ ::-webkit-inner-spin-button,
2114
+ ::-webkit-outer-spin-button {
2115
+ height: auto;
2116
+ }
2117
+
2118
+ /*
2119
+ 1. Correct the odd appearance in Chrome and Safari.
2120
+ 2. Correct the outline style in Safari.
2121
+ */
2122
+
2123
+ [type='search'] {
2124
+ -webkit-appearance: textfield; /* 1 */
2125
+ outline-offset: -2px; /* 2 */
2126
+ }
2127
+
2128
+ /*
2129
+ Remove the inner padding in Chrome and Safari on macOS.
2130
+ */
2131
+
2132
+ ::-webkit-search-decoration {
2133
+ -webkit-appearance: none;
2902
2134
  }
2903
2135
 
2136
+ /*
2137
+ 1. Correct the inability to style clickable types in iOS and Safari.
2138
+ 2. Change font properties to \\\`inherit\\\` in Safari.
2139
+ */
2140
+
2141
+ ::-webkit-file-upload-button {
2142
+ -webkit-appearance: button; /* 1 */
2143
+ font: inherit; /* 2 */
2144
+ }
2145
+
2146
+ /*
2147
+ Add the correct display in Chrome and Safari.
2148
+ */
2149
+
2150
+ summary {
2151
+ display: list-item;
2152
+ }
2153
+
2154
+ /*
2155
+ Removes the default spacing and border for appropriate elements.
2156
+ */
2157
+
2158
+ blockquote,
2159
+ dl,
2160
+ dd,
2161
+ h1,
2162
+ h2,
2163
+ h3,
2164
+ h4,
2165
+ h5,
2166
+ h6,
2167
+ hr,
2168
+ figure,
2169
+ p,
2170
+ pre {
2171
+ margin: 0;
2172
+ }
2173
+
2174
+ fieldset {
2175
+ margin: 0;
2176
+ padding: 0;
2177
+ }
2178
+
2179
+ legend {
2180
+ padding: 0;
2181
+ }
2182
+
2183
+ ol,
2184
+ ul,
2185
+ menu {
2186
+ list-style: none;
2187
+ margin: 0;
2188
+ padding: 0;
2189
+ }
2190
+
2191
+ /*
2192
+ Reset default styling for dialogs.
2193
+ */
2194
+ dialog {
2195
+ padding: 0;
2196
+ }
2197
+
2198
+ /*
2199
+ Prevent resizing textareas horizontally by default.
2200
+ */
2201
+
2202
+ textarea {
2203
+ resize: vertical;
2204
+ }
2205
+
2206
+ /*
2207
+ 1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
2208
+ 2. Set the default placeholder color to the user's configured gray 400 color.
2209
+ */
2210
+
2211
+ input::-moz-placeholder, textarea::-moz-placeholder {
2212
+ opacity: 1; /* 1 */
2213
+ color: #9ca3af; /* 2 */
2214
+ }
2215
+
2216
+ input::placeholder,
2217
+ textarea::placeholder {
2218
+ opacity: 1; /* 1 */
2219
+ color: #9ca3af; /* 2 */
2220
+ }
2221
+
2222
+ /*
2223
+ Set the default cursor for buttons.
2224
+ */
2225
+
2226
+ button,
2227
+ [role="button"] {
2228
+ cursor: pointer;
2229
+ }
2230
+
2231
+ /*
2232
+ Make sure disabled buttons don't get the pointer cursor.
2233
+ */
2234
+ :disabled {
2235
+ cursor: default;
2236
+ }
2237
+
2238
+ /*
2239
+ 1. Make replaced elements \\\`display: block\\\` by default. (https://github.com/mozdevs/cssremedy/issues/14)
2240
+ 2. Add \\\`vertical-align: middle\\\` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
2241
+ This can trigger a poorly considered lint error in some tools but is included by design.
2242
+ */
2243
+
2244
+ img,
2245
+ svg,
2246
+ video,
2247
+ canvas,
2248
+ audio,
2249
+ iframe,
2250
+ embed,
2251
+ object {
2252
+ display: block; /* 1 */
2253
+ vertical-align: middle; /* 2 */
2254
+ }
2255
+
2256
+ /*
2257
+ Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
2258
+ */
2259
+
2260
+ img,
2261
+ video {
2262
+ max-width: 100%;
2263
+ height: auto;
2264
+ }
2265
+
2266
+ /* Make elements with the HTML hidden attribute stay hidden by default */
2267
+ [hidden]:where(:not([hidden="until-found"])) {
2268
+ display: none;
2269
+ }
2270
+ .pointer-events-none {
2271
+ pointer-events: none;
2272
+ }
2273
+ .fixed {
2274
+ position: fixed;
2275
+ }
2276
+ .sticky {
2277
+ position: sticky;
2278
+ }
2279
+ .bottom-0 {
2280
+ bottom: 0px;
2281
+ }
2282
+ .left-0 {
2283
+ left: 0px;
2284
+ }
2285
+ .right-0 {
2286
+ right: 0px;
2287
+ }
2288
+ .top-0 {
2289
+ top: 0px;
2290
+ }
2291
+ .z-10 {
2292
+ z-index: 10;
2293
+ }
2294
+ .z-\\\\[-9999\\\\] {
2295
+ z-index: -9999;
2296
+ }
2297
+ .z-\\\\[9999999\\\\] {
2298
+ z-index: 9999999;
2299
+ }
2300
+ .mb-2 {
2301
+ margin-bottom: 0.5rem;
2302
+ }
2303
+ .inline {
2304
+ display: inline;
2305
+ }
2306
+ .flex {
2307
+ display: flex;
2308
+ }
2309
+ .grid {
2310
+ display: grid;
2311
+ }
2312
+ .contents {
2313
+ display: contents;
2314
+ }
2315
+ .h-0 {
2316
+ height: 0px;
2317
+ }
2318
+ .h-5 {
2319
+ height: 1.25rem;
2320
+ }
2321
+ .w-5 {
2322
+ width: 1.25rem;
2323
+ }
2324
+ .w-full {
2325
+ width: 100%;
2326
+ }
2327
+ .flex-grow {
2328
+ flex-grow: 1;
2329
+ }
2330
+ .rotate-90 {
2331
+ --tw-rotate: 90deg;
2332
+ 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));
2333
+ }
2334
+ .transform {
2335
+ 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));
2336
+ }
2337
+ .cursor-default {
2338
+ cursor: default;
2339
+ }
2340
+ .cursor-pointer {
2341
+ cursor: pointer;
2342
+ }
2343
+ .resize {
2344
+ resize: both;
2345
+ }
2346
+ .flex-col {
2347
+ flex-direction: column;
2348
+ }
2349
+ .place-content-center {
2350
+ place-content: center;
2351
+ }
2352
+ .items-start {
2353
+ align-items: flex-start;
2354
+ }
2355
+ .items-center {
2356
+ align-items: center;
2357
+ }
2358
+ .justify-between {
2359
+ justify-content: space-between;
2360
+ }
2361
+ .gap-1 {
2362
+ gap: 0.25rem;
2363
+ }
2364
+ .gap-2 {
2365
+ gap: 0.5rem;
2366
+ }
2367
+ .overflow-hidden {
2368
+ overflow: hidden;
2369
+ }
2370
+ .overflow-scroll {
2371
+ overflow: scroll;
2372
+ }
2373
+ .truncate {
2374
+ overflow: hidden;
2375
+ text-overflow: ellipsis;
2376
+ white-space: nowrap;
2377
+ }
2378
+ .rounded {
2379
+ border-radius: 0.25rem;
2380
+ }
2381
+ .rounded-3xl {
2382
+ border-radius: 1.5rem;
2383
+ }
2384
+ .rounded-full {
2385
+ border-radius: 9999px;
2386
+ }
2387
+ .border {
2388
+ border-width: 1px;
2389
+ }
2390
+ .border-b {
2391
+ border-bottom-width: 1px;
2392
+ }
2393
+ .border-b-2 {
2394
+ border-bottom-width: 2px;
2395
+ }
2396
+ .border-\\\\[\\\\#fff1\\\\] {
2397
+ border-color: #fff1;
2398
+ }
2399
+ .border-neutral-700 {
2400
+ --tw-border-opacity: 1;
2401
+ border-color: rgb(64 64 64 / var(--tw-border-opacity, 1));
2402
+ }
2403
+ .border-neutral-800 {
2404
+ --tw-border-opacity: 1;
2405
+ border-color: rgb(38 38 38 / var(--tw-border-opacity, 1));
2406
+ }
2407
+ .border-white {
2408
+ --tw-border-opacity: 1;
2409
+ border-color: rgb(255 255 255 / var(--tw-border-opacity, 1));
2410
+ }
2411
+ .border-opacity-10 {
2412
+ --tw-border-opacity: 0.1;
2413
+ }
2414
+ .bg-\\\\[\\\\#0003\\\\] {
2415
+ background-color: #0003;
2416
+ }
2417
+ .bg-\\\\[\\\\#1d1d1d\\\\] {
2418
+ --tw-bg-opacity: 1;
2419
+ background-color: rgb(29 29 29 / var(--tw-bg-opacity, 1));
2420
+ }
2421
+ .bg-\\\\[\\\\#212121\\\\] {
2422
+ --tw-bg-opacity: 1;
2423
+ background-color: rgb(33 33 33 / var(--tw-bg-opacity, 1));
2424
+ }
2425
+ .bg-\\\\[\\\\#ffffff04\\\\] {
2426
+ background-color: #ffffff04;
2427
+ }
2428
+ .bg-\\\\[crimson\\\\]\\\\/80 {
2429
+ background-color: rgb(220 20 60 / 0.8);
2430
+ }
2431
+ .bg-crimson {
2432
+ --tw-bg-opacity: 1;
2433
+ background-color: rgb(220 20 60 / var(--tw-bg-opacity, 1));
2434
+ }
2435
+ .bg-neutral-400 {
2436
+ --tw-bg-opacity: 1;
2437
+ background-color: rgb(163 163 163 / var(--tw-bg-opacity, 1));
2438
+ }
2439
+ .bg-opacity-5 {
2440
+ --tw-bg-opacity: 0.05;
2441
+ }
2442
+ .p-1 {
2443
+ padding: 0.25rem;
2444
+ }
2445
+ .p-2 {
2446
+ padding: 0.5rem;
2447
+ }
2448
+ .px-2 {
2449
+ padding-left: 0.5rem;
2450
+ padding-right: 0.5rem;
2451
+ }
2452
+ .py-1 {
2453
+ padding-top: 0.25rem;
2454
+ padding-bottom: 0.25rem;
2455
+ }
2456
+ .pb-2 {
2457
+ padding-bottom: 0.5rem;
2458
+ }
2459
+ .pl-2 {
2460
+ padding-left: 0.5rem;
2461
+ }
2462
+ .pl-6 {
2463
+ padding-left: 1.5rem;
2464
+ }
2465
+ .pr-1 {
2466
+ padding-right: 0.25rem;
2467
+ }
2468
+ .text-\\\\[10px\\\\] {
2469
+ font-size: 10px;
2470
+ }
2471
+ .text-sm {
2472
+ font-size: 0.875rem;
2473
+ line-height: 1.25rem;
2474
+ }
2475
+ .text-xs {
2476
+ font-size: 0.75rem;
2477
+ line-height: 1rem;
2478
+ }
2479
+ .font-bold {
2480
+ font-weight: 700;
2481
+ }
2482
+ .font-medium {
2483
+ font-weight: 500;
2484
+ }
2485
+ .text-neutral-300 {
2486
+ --tw-text-opacity: 1;
2487
+ color: rgb(212 212 212 / var(--tw-text-opacity, 1));
2488
+ }
2489
+ .text-white {
2490
+ --tw-text-opacity: 1;
2491
+ color: rgb(255 255 255 / var(--tw-text-opacity, 1));
2492
+ }
2493
+ .accent-red-500 {
2494
+ accent-color: #ef4444;
2495
+ }
2496
+ .opacity-50 {
2497
+ opacity: 0.5;
2498
+ }
2499
+ .shadow {
2500
+ --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
2501
+ --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
2502
+ box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
2503
+ }
2504
+ .filter {
2505
+ 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);
2506
+ }
2507
+ .transition {
2508
+ transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
2509
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
2510
+ transition-duration: 150ms;
2511
+ }
2512
+ .transition-opacity {
2513
+ transition-property: opacity;
2514
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
2515
+ transition-duration: 150ms;
2516
+ }
2517
+ .will-change-transform {
2518
+ will-change: transform;
2519
+ }
2520
+ .last\\\\:border-b-0:last-child {
2521
+ border-bottom-width: 0px;
2522
+ }
2523
+ .hover\\\\:bg-\\\\[\\\\#0003\\\\]:hover {
2524
+ background-color: #0003;
2525
+ }
2526
+ .hover\\\\:bg-neutral-700:hover {
2527
+ --tw-bg-opacity: 1;
2528
+ background-color: rgb(64 64 64 / var(--tw-bg-opacity, 1));
2529
+ }
2530
+ .hover\\\\:opacity-100:hover {
2531
+ opacity: 1;
2532
+ }
2533
+ .focus\\\\:outline:focus {
2534
+ outline-style: solid;
2535
+ }
2536
+ \`;if("window"in globalThis){let e=document.createElement("kiru-devtools");e.setAttribute("style","display: contents"),document.body.appendChild(e);let t=e.attachShadow({mode:"open"}),r=new CSSStyleSheet;r.replaceSync(Fr),t.adoptedStyleSheets=[r];let n=Object.assign(document.createElement("div"),{id:"devtools-root",className:"fixed flex bottom-0 right-0 z-[9999999]"});t.appendChild(n),br(p(Et,{}),n,{name:"kiru.devtools"});let o=()=>Y.value?.close();window.addEventListener("close",o),window.addEventListener("beforeunload",o),R.addEventListener(s=>{s.data.type==="open-editor"&&window.open(s.data.fileLink)})}
2537
+
2904
2538
  `;
2905
2539
 
2906
2540
  // src/codegen/shared.ts
@@ -3696,8 +3330,6 @@ function kiru(opts) {
3696
3330
  fileLinkFormatter = opts.devtools.formatFileLink ?? fileLinkFormatter;
3697
3331
  }
3698
3332
  const dtHostScriptPath = "/__devtools_host__.js";
3699
- let transformedDtHostBuild = "";
3700
- let transformedDtClientBuild = "";
3701
3333
  const virtualModules = {};
3702
3334
  const fileToVirtualModules = {};
3703
3335
  let projectRoot = process.cwd().replace(/\\/g, "/");
@@ -3713,23 +3345,6 @@ function kiru(opts) {
3713
3345
  load(id) {
3714
3346
  return virtualModules[id];
3715
3347
  },
3716
- async buildStart() {
3717
- if (!devtoolsEnabled) return;
3718
- log("Preparing devtools...");
3719
- const kiruPath = await this.resolve("kiru");
3720
- if (!kiruPath) {
3721
- throw new Error("[vite-plugin-kiru]: Unable to resolve kiru path.");
3722
- }
3723
- transformedDtHostBuild = dist_default2.replaceAll(
3724
- 'from "kiru"',
3725
- `from "/@fs/${kiruPath.id}"`
3726
- );
3727
- transformedDtClientBuild = dist_default.replaceAll(
3728
- 'from"kiru";',
3729
- `from"/@fs/${kiruPath.id}";`
3730
- );
3731
- log("Devtools ready.");
3732
- },
3733
3348
  config(config) {
3734
3349
  return {
3735
3350
  ...config,
@@ -3774,11 +3389,11 @@ function kiru(opts) {
3774
3389
  log(`Serving devtools host at ${ANSI.magenta(dtHostScriptPath)}`);
3775
3390
  server.middlewares.use(dtHostScriptPath, (_, res) => {
3776
3391
  res.setHeader("Content-Type", "application/javascript");
3777
- res.end(transformedDtHostBuild, "utf-8");
3392
+ res.end(dist_default2, "utf-8");
3778
3393
  });
3779
3394
  log(`Serving devtools client at ${ANSI.magenta(dtClientPathname)}`);
3780
3395
  server.middlewares.use(dtClientPathname, (_, res) => {
3781
- res.end(transformedDtClientBuild);
3396
+ res.end(dist_default, "utf-8");
3782
3397
  });
3783
3398
  }
3784
3399
  server.watcher.on("change", (file) => {