cardamon 0.2.0

Cardamon is a tool to help development teams measure the power consumption and carbon emissions of their software.
Documentation
var Fc=Object.defineProperty;var Ic=(e,t,n)=>t in e?Fc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var T=(e,t,n)=>(Ic(e,typeof t!="symbol"?t+"":t,n),n);import{D as Ia,d as ct,z as zc,c as ot,x as fi,o as j,b as X,e as F,f as pi,g as xn,u as kt,j as $c,t as Rt,q as za,s as $a,_ as Na,E as V,n as nt,G as Ba,H as gs,I as Nc,r as Bc,k as Wc,J as Hc,w as jc,K as ms,B as Wa,L as Ha,M as Vc,N as Uc,h as Jt,a as Ln,A as ja,O as Yc,P as Va,p as vt,F as ri,i as qc,Q as Ki,R as gi,S as Xc,T as Ji,U as Gc,V as Kc,W as Jc}from"./index-ByA9DPlo.js";var at=(e=>(e.METRIC="METRIC",e.CHART="CHART",e.TABLE="TABLE",e.CPU_USAGE="CPU_USAGE",e))(at||{});function Ua(e,t){return function(){return e.apply(t,arguments)}}const{toString:Qc}=Object.prototype,{getPrototypeOf:Hs}=Object,Li=(e=>t=>{const n=Qc.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Mt=e=>(e=e.toLowerCase(),t=>Li(t)===e),Fi=e=>t=>typeof t===e,{isArray:He}=Array,_n=Fi("undefined");function Zc(e){return e!==null&&!_n(e)&&e.constructor!==null&&!_n(e.constructor)&&bt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Ya=Mt("ArrayBuffer");function th(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Ya(e.buffer),t}const eh=Fi("string"),bt=Fi("function"),qa=Fi("number"),Ii=e=>e!==null&&typeof e=="object",nh=e=>e===!0||e===!1,ai=e=>{if(Li(e)!=="object")return!1;const t=Hs(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},ih=Mt("Date"),sh=Mt("File"),oh=Mt("Blob"),rh=Mt("FileList"),ah=e=>Ii(e)&&bt(e.pipe),lh=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||bt(e.append)&&((t=Li(e))==="formdata"||t==="object"&&bt(e.toString)&&e.toString()==="[object FormData]"))},ch=Mt("URLSearchParams"),[hh,dh,uh,fh]=["ReadableStream","Request","Response","Headers"].map(Mt),ph=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Fn(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let i,s;if(typeof e!="object"&&(e=[e]),He(e))for(i=0,s=e.length;i<s;i++)t.call(null,e[i],i,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),r=o.length;let a;for(i=0;i<r;i++)a=o[i],t.call(null,e[a],a,e)}}function Xa(e,t){t=t.toLowerCase();const n=Object.keys(e);let i=n.length,s;for(;i-- >0;)if(s=n[i],t===s.toLowerCase())return s;return null}const Ga=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ka=e=>!_n(e)&&e!==Ga;function bs(){const{caseless:e}=Ka(this)&&this||{},t={},n=(i,s)=>{const o=e&&Xa(t,s)||s;ai(t[o])&&ai(i)?t[o]=bs(t[o],i):ai(i)?t[o]=bs({},i):He(i)?t[o]=i.slice():t[o]=i};for(let i=0,s=arguments.length;i<s;i++)arguments[i]&&Fn(arguments[i],n);return t}const gh=(e,t,n,{allOwnKeys:i}={})=>(Fn(t,(s,o)=>{n&&bt(s)?e[o]=Ua(s,n):e[o]=s},{allOwnKeys:i}),e),mh=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),bh=(e,t,n,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},yh=(e,t,n,i)=>{let s,o,r;const a={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)r=s[o],(!i||i(r,e,t))&&!a[r]&&(t[r]=e[r],a[r]=!0);e=n!==!1&&Hs(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},xh=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const i=e.indexOf(t,n);return i!==-1&&i===n},_h=e=>{if(!e)return null;if(He(e))return e;let t=e.length;if(!qa(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},wh=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Hs(Uint8Array)),vh=(e,t)=>{const i=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=i.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},Sh=(e,t)=>{let n;const i=[];for(;(n=e.exec(t))!==null;)i.push(n);return i},kh=Mt("HTMLFormElement"),Ch=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,s){return i.toUpperCase()+s}),Co=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Oh=Mt("RegExp"),Ja=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),i={};Fn(n,(s,o)=>{let r;(r=t(s,o,e))!==!1&&(i[o]=r||s)}),Object.defineProperties(e,i)},Mh=e=>{Ja(e,(t,n)=>{if(bt(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const i=e[n];if(bt(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Th=(e,t)=>{const n={},i=s=>{s.forEach(o=>{n[o]=!0})};return He(e)?i(e):i(String(e).split(t)),n},Ph=()=>{},Ah=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Qi="abcdefghijklmnopqrstuvwxyz",Oo="0123456789",Qa={DIGIT:Oo,ALPHA:Qi,ALPHA_DIGIT:Qi+Qi.toUpperCase()+Oo},Dh=(e=16,t=Qa.ALPHA_DIGIT)=>{let n="";const{length:i}=t;for(;e--;)n+=t[Math.random()*i|0];return n};function Eh(e){return!!(e&&bt(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Rh=e=>{const t=new Array(10),n=(i,s)=>{if(Ii(i)){if(t.indexOf(i)>=0)return;if(!("toJSON"in i)){t[s]=i;const o=He(i)?[]:{};return Fn(i,(r,a)=>{const l=n(r,s+1);!_n(l)&&(o[a]=l)}),t[s]=void 0,o}}return i};return n(e,0)},Lh=Mt("AsyncFunction"),Fh=e=>e&&(Ii(e)||bt(e))&&bt(e.then)&&bt(e.catch),w={isArray:He,isArrayBuffer:Ya,isBuffer:Zc,isFormData:lh,isArrayBufferView:th,isString:eh,isNumber:qa,isBoolean:nh,isObject:Ii,isPlainObject:ai,isReadableStream:hh,isRequest:dh,isResponse:uh,isHeaders:fh,isUndefined:_n,isDate:ih,isFile:sh,isBlob:oh,isRegExp:Oh,isFunction:bt,isStream:ah,isURLSearchParams:ch,isTypedArray:wh,isFileList:rh,forEach:Fn,merge:bs,extend:gh,trim:ph,stripBOM:mh,inherits:bh,toFlatObject:yh,kindOf:Li,kindOfTest:Mt,endsWith:xh,toArray:_h,forEachEntry:vh,matchAll:Sh,isHTMLForm:kh,hasOwnProperty:Co,hasOwnProp:Co,reduceDescriptors:Ja,freezeMethods:Mh,toObjectSet:Th,toCamelCase:Ch,noop:Ph,toFiniteNumber:Ah,findKey:Xa,global:Ga,isContextDefined:Ka,ALPHABET:Qa,generateString:Dh,isSpecCompliantForm:Eh,toJSONObject:Rh,isAsyncFn:Lh,isThenable:Fh};function E(e,t,n,i,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),i&&(this.request=i),s&&(this.response=s)}w.inherits(E,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:w.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Za=E.prototype,tl={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{tl[e]={value:e}});Object.defineProperties(E,tl);Object.defineProperty(Za,"isAxiosError",{value:!0});E.from=(e,t,n,i,s,o)=>{const r=Object.create(Za);return w.toFlatObject(e,r,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),E.call(r,e.message,t,n,i,s),r.cause=e,r.name=e.name,o&&Object.assign(r,o),r};const Ih=null;function ys(e){return w.isPlainObject(e)||w.isArray(e)}function el(e){return w.endsWith(e,"[]")?e.slice(0,-2):e}function Mo(e,t,n){return e?e.concat(t).map(function(s,o){return s=el(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function zh(e){return w.isArray(e)&&!e.some(ys)}const $h=w.toFlatObject(w,{},null,function(t){return/^is[A-Z]/.test(t)});function zi(e,t,n){if(!w.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=w.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,m){return!w.isUndefined(m[g])});const i=n.metaTokens,s=n.visitor||h,o=n.dots,r=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&w.isSpecCompliantForm(t);if(!w.isFunction(s))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(w.isDate(p))return p.toISOString();if(!l&&w.isBlob(p))throw new E("Blob is not supported. Use a Buffer instead.");return w.isArrayBuffer(p)||w.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function h(p,g,m){let b=p;if(p&&!m&&typeof p=="object"){if(w.endsWith(g,"{}"))g=i?g:g.slice(0,-2),p=JSON.stringify(p);else if(w.isArray(p)&&zh(p)||(w.isFileList(p)||w.endsWith(g,"[]"))&&(b=w.toArray(p)))return g=el(g),b.forEach(function(_,v){!(w.isUndefined(_)||_===null)&&t.append(r===!0?Mo([g],v,o):r===null?g:g+"[]",c(_))}),!1}return ys(p)?!0:(t.append(Mo(m,g,o),c(p)),!1)}const d=[],u=Object.assign($h,{defaultVisitor:h,convertValue:c,isVisitable:ys});function f(p,g){if(!w.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+g.join("."));d.push(p),w.forEach(p,function(b,y){(!(w.isUndefined(b)||b===null)&&s.call(t,b,w.isString(y)?y.trim():y,g,u))===!0&&f(b,g?g.concat(y):[y])}),d.pop()}}if(!w.isObject(e))throw new TypeError("data must be an object");return f(e),t}function To(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function js(e,t){this._pairs=[],e&&zi(e,this,t)}const nl=js.prototype;nl.append=function(t,n){this._pairs.push([t,n])};nl.toString=function(t){const n=t?function(i){return t.call(this,i,To)}:To;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Nh(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function il(e,t,n){if(!t)return e;const i=n&&n.encode||Nh,s=n&&n.serialize;let o;if(s?o=s(t,n):o=w.isURLSearchParams(t)?t.toString():new js(t,n).toString(i),o){const r=e.indexOf("#");r!==-1&&(e=e.slice(0,r)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Po{constructor(){this.handlers=[]}use(t,n,i){return this.handlers.push({fulfilled:t,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){w.forEach(this.handlers,function(i){i!==null&&t(i)})}}const sl={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Bh=typeof URLSearchParams<"u"?URLSearchParams:js,Wh=typeof FormData<"u"?FormData:null,Hh=typeof Blob<"u"?Blob:null,jh={isBrowser:!0,classes:{URLSearchParams:Bh,FormData:Wh,Blob:Hh},protocols:["http","https","file","blob","url","data"]},Vs=typeof window<"u"&&typeof document<"u",Vh=(e=>Vs&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),Uh=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Yh=Vs&&window.location.href||"http://localhost",qh=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Vs,hasStandardBrowserEnv:Vh,hasStandardBrowserWebWorkerEnv:Uh,origin:Yh},Symbol.toStringTag,{value:"Module"})),Ct={...qh,...jh};function Xh(e,t){return zi(e,new Ct.classes.URLSearchParams,Object.assign({visitor:function(n,i,s,o){return Ct.isNode&&w.isBuffer(n)?(this.append(i,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function Gh(e){return w.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Kh(e){const t={},n=Object.keys(e);let i;const s=n.length;let o;for(i=0;i<s;i++)o=n[i],t[o]=e[o];return t}function ol(e){function t(n,i,s,o){let r=n[o++];if(r==="__proto__")return!0;const a=Number.isFinite(+r),l=o>=n.length;return r=!r&&w.isArray(s)?s.length:r,l?(w.hasOwnProp(s,r)?s[r]=[s[r],i]:s[r]=i,!a):((!s[r]||!w.isObject(s[r]))&&(s[r]=[]),t(n,i,s[r],o)&&w.isArray(s[r])&&(s[r]=Kh(s[r])),!a)}if(w.isFormData(e)&&w.isFunction(e.entries)){const n={};return w.forEachEntry(e,(i,s)=>{t(Gh(i),s,n,0)}),n}return null}function Jh(e,t,n){if(w.isString(e))try{return(t||JSON.parse)(e),w.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(e)}const In={transitional:sl,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const i=n.getContentType()||"",s=i.indexOf("application/json")>-1,o=w.isObject(t);if(o&&w.isHTMLForm(t)&&(t=new FormData(t)),w.isFormData(t))return s?JSON.stringify(ol(t)):t;if(w.isArrayBuffer(t)||w.isBuffer(t)||w.isStream(t)||w.isFile(t)||w.isBlob(t)||w.isReadableStream(t))return t;if(w.isArrayBufferView(t))return t.buffer;if(w.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(o){if(i.indexOf("application/x-www-form-urlencoded")>-1)return Xh(t,this.formSerializer).toString();if((a=w.isFileList(t))||i.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return zi(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),Jh(t)):t}],transformResponse:[function(t){const n=this.transitional||In.transitional,i=n&&n.forcedJSONParsing,s=this.responseType==="json";if(w.isResponse(t)||w.isReadableStream(t))return t;if(t&&w.isString(t)&&(i&&!this.responseType||s)){const r=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(a){if(r)throw a.name==="SyntaxError"?E.from(a,E.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ct.classes.FormData,Blob:Ct.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};w.forEach(["delete","get","head","post","put","patch"],e=>{In.headers[e]={}});const Qh=w.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Zh=e=>{const t={};let n,i,s;return e&&e.split(`
`).forEach(function(r){s=r.indexOf(":"),n=r.substring(0,s).trim().toLowerCase(),i=r.substring(s+1).trim(),!(!n||t[n]&&Qh[n])&&(n==="set-cookie"?t[n]?t[n].push(i):t[n]=[i]:t[n]=t[n]?t[n]+", "+i:i)}),t},Ao=Symbol("internals");function Xe(e){return e&&String(e).trim().toLowerCase()}function li(e){return e===!1||e==null?e:w.isArray(e)?e.map(li):String(e)}function td(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=n.exec(e);)t[i[1]]=i[2];return t}const ed=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Zi(e,t,n,i,s){if(w.isFunction(i))return i.call(this,t,n);if(s&&(t=n),!!w.isString(t)){if(w.isString(i))return t.indexOf(i)!==-1;if(w.isRegExp(i))return i.test(t)}}function nd(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,i)=>n.toUpperCase()+i)}function id(e,t){const n=w.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(e,i+n,{value:function(s,o,r){return this[i].call(this,t,s,o,r)},configurable:!0})})}class ft{constructor(t){t&&this.set(t)}set(t,n,i){const s=this;function o(a,l,c){const h=Xe(l);if(!h)throw new Error("header name must be a non-empty string");const d=w.findKey(s,h);(!d||s[d]===void 0||c===!0||c===void 0&&s[d]!==!1)&&(s[d||l]=li(a))}const r=(a,l)=>w.forEach(a,(c,h)=>o(c,h,l));if(w.isPlainObject(t)||t instanceof this.constructor)r(t,n);else if(w.isString(t)&&(t=t.trim())&&!ed(t))r(Zh(t),n);else if(w.isHeaders(t))for(const[a,l]of t.entries())o(l,a,i);else t!=null&&o(n,t,i);return this}get(t,n){if(t=Xe(t),t){const i=w.findKey(this,t);if(i){const s=this[i];if(!n)return s;if(n===!0)return td(s);if(w.isFunction(n))return n.call(this,s,i);if(w.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Xe(t),t){const i=w.findKey(this,t);return!!(i&&this[i]!==void 0&&(!n||Zi(this,this[i],i,n)))}return!1}delete(t,n){const i=this;let s=!1;function o(r){if(r=Xe(r),r){const a=w.findKey(i,r);a&&(!n||Zi(i,i[a],a,n))&&(delete i[a],s=!0)}}return w.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let i=n.length,s=!1;for(;i--;){const o=n[i];(!t||Zi(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,i={};return w.forEach(this,(s,o)=>{const r=w.findKey(i,o);if(r){n[r]=li(s),delete n[o];return}const a=t?nd(o):String(o).trim();a!==o&&delete n[o],n[a]=li(s),i[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return w.forEach(this,(i,s)=>{i!=null&&i!==!1&&(n[s]=t&&w.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const i=new this(t);return n.forEach(s=>i.set(s)),i}static accessor(t){const i=(this[Ao]=this[Ao]={accessors:{}}).accessors,s=this.prototype;function o(r){const a=Xe(r);i[a]||(id(s,r),i[a]=!0)}return w.isArray(t)?t.forEach(o):o(t),this}}ft.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);w.reduceDescriptors(ft.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(i){this[n]=i}}});w.freezeMethods(ft);function ts(e,t){const n=this||In,i=t||n,s=ft.from(i.headers);let o=i.data;return w.forEach(e,function(a){o=a.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function rl(e){return!!(e&&e.__CANCEL__)}function je(e,t,n){E.call(this,e??"canceled",E.ERR_CANCELED,t,n),this.name="CanceledError"}w.inherits(je,E,{__CANCEL__:!0});function al(e,t,n){const i=n.config.validateStatus;!n.status||!i||i(n.status)?e(n):t(new E("Request failed with status code "+n.status,[E.ERR_BAD_REQUEST,E.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function sd(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function od(e,t){e=e||10;const n=new Array(e),i=new Array(e);let s=0,o=0,r;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),h=i[o];r||(r=c),n[s]=l,i[s]=c;let d=o,u=0;for(;d!==s;)u+=n[d++],d=d%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),c-r<t)return;const f=h&&c-h;return f?Math.round(u*1e3/f):void 0}}function rd(e,t){let n=0;const i=1e3/t;let s=null;return function(){const r=this===!0,a=Date.now();if(r||a-n>i)return s&&(clearTimeout(s),s=null),n=a,e.apply(null,arguments);s||(s=setTimeout(()=>(s=null,n=Date.now(),e.apply(null,arguments)),i-(a-n)))}}const mi=(e,t,n=3)=>{let i=0;const s=od(50,250);return rd(o=>{const r=o.loaded,a=o.lengthComputable?o.total:void 0,l=r-i,c=s(l),h=r<=a;i=r;const d={loaded:r,total:a,progress:a?r/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&h?(a-r)/c:void 0,event:o,lengthComputable:a!=null};d[t?"download":"upload"]=!0,e(d)},n)},ad=Ct.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let i;function s(o){let r=o;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return i=s(window.location.href),function(r){const a=w.isString(r)?s(r):r;return a.protocol===i.protocol&&a.host===i.host}}():function(){return function(){return!0}}(),ld=Ct.hasStandardBrowserEnv?{write(e,t,n,i,s,o){const r=[e+"="+encodeURIComponent(t)];w.isNumber(n)&&r.push("expires="+new Date(n).toGMTString()),w.isString(i)&&r.push("path="+i),w.isString(s)&&r.push("domain="+s),o===!0&&r.push("secure"),document.cookie=r.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function cd(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function hd(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ll(e,t){return e&&!cd(t)?hd(e,t):t}const Do=e=>e instanceof ft?{...e}:e;function _e(e,t){t=t||{};const n={};function i(c,h,d){return w.isPlainObject(c)&&w.isPlainObject(h)?w.merge.call({caseless:d},c,h):w.isPlainObject(h)?w.merge({},h):w.isArray(h)?h.slice():h}function s(c,h,d){if(w.isUndefined(h)){if(!w.isUndefined(c))return i(void 0,c,d)}else return i(c,h,d)}function o(c,h){if(!w.isUndefined(h))return i(void 0,h)}function r(c,h){if(w.isUndefined(h)){if(!w.isUndefined(c))return i(void 0,c)}else return i(void 0,h)}function a(c,h,d){if(d in t)return i(c,h);if(d in e)return i(void 0,c)}const l={url:o,method:o,data:o,baseURL:r,transformRequest:r,transformResponse:r,paramsSerializer:r,timeout:r,timeoutMessage:r,withCredentials:r,withXSRFToken:r,adapter:r,responseType:r,xsrfCookieName:r,xsrfHeaderName:r,onUploadProgress:r,onDownloadProgress:r,decompress:r,maxContentLength:r,maxBodyLength:r,beforeRedirect:r,transport:r,httpAgent:r,httpsAgent:r,cancelToken:r,socketPath:r,responseEncoding:r,validateStatus:a,headers:(c,h)=>s(Do(c),Do(h),!0)};return w.forEach(Object.keys(Object.assign({},e,t)),function(h){const d=l[h]||s,u=d(e[h],t[h],h);w.isUndefined(u)&&d!==a||(n[h]=u)}),n}const cl=e=>{const t=_e({},e);let{data:n,withXSRFToken:i,xsrfHeaderName:s,xsrfCookieName:o,headers:r,auth:a}=t;t.headers=r=ft.from(r),t.url=il(ll(t.baseURL,t.url),e.params,e.paramsSerializer),a&&r.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if(w.isFormData(n)){if(Ct.hasStandardBrowserEnv||Ct.hasStandardBrowserWebWorkerEnv)r.setContentType(void 0);else if((l=r.getContentType())!==!1){const[c,...h]=l?l.split(";").map(d=>d.trim()).filter(Boolean):[];r.setContentType([c||"multipart/form-data",...h].join("; "))}}if(Ct.hasStandardBrowserEnv&&(i&&w.isFunction(i)&&(i=i(t)),i||i!==!1&&ad(t.url))){const c=s&&o&&ld.read(o);c&&r.set(s,c)}return t},dd=typeof XMLHttpRequest<"u",ud=dd&&function(e){return new Promise(function(n,i){const s=cl(e);let o=s.data;const r=ft.from(s.headers).normalize();let{responseType:a}=s,l;function c(){s.cancelToken&&s.cancelToken.unsubscribe(l),s.signal&&s.signal.removeEventListener("abort",l)}let h=new XMLHttpRequest;h.open(s.method.toUpperCase(),s.url,!0),h.timeout=s.timeout;function d(){if(!h)return;const f=ft.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),g={data:!a||a==="text"||a==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:f,config:e,request:h};al(function(b){n(b),c()},function(b){i(b),c()},g),h=null}"onloadend"in h?h.onloadend=d:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(d)},h.onabort=function(){h&&(i(new E("Request aborted",E.ECONNABORTED,s,h)),h=null)},h.onerror=function(){i(new E("Network Error",E.ERR_NETWORK,s,h)),h=null},h.ontimeout=function(){let p=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const g=s.transitional||sl;s.timeoutErrorMessage&&(p=s.timeoutErrorMessage),i(new E(p,g.clarifyTimeoutError?E.ETIMEDOUT:E.ECONNABORTED,s,h)),h=null},o===void 0&&r.setContentType(null),"setRequestHeader"in h&&w.forEach(r.toJSON(),function(p,g){h.setRequestHeader(g,p)}),w.isUndefined(s.withCredentials)||(h.withCredentials=!!s.withCredentials),a&&a!=="json"&&(h.responseType=s.responseType),typeof s.onDownloadProgress=="function"&&h.addEventListener("progress",mi(s.onDownloadProgress,!0)),typeof s.onUploadProgress=="function"&&h.upload&&h.upload.addEventListener("progress",mi(s.onUploadProgress)),(s.cancelToken||s.signal)&&(l=f=>{h&&(i(!f||f.type?new je(null,e,h):f),h.abort(),h=null)},s.cancelToken&&s.cancelToken.subscribe(l),s.signal&&(s.signal.aborted?l():s.signal.addEventListener("abort",l)));const u=sd(s.url);if(u&&Ct.protocols.indexOf(u)===-1){i(new E("Unsupported protocol "+u+":",E.ERR_BAD_REQUEST,e));return}h.send(o||null)})},fd=(e,t)=>{let n=new AbortController,i;const s=function(l){if(!i){i=!0,r();const c=l instanceof Error?l:this.reason;n.abort(c instanceof E?c:new je(c instanceof Error?c.message:c))}};let o=t&&setTimeout(()=>{s(new E(`timeout ${t} of ms exceeded`,E.ETIMEDOUT))},t);const r=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(l=>{l&&(l.removeEventListener?l.removeEventListener("abort",s):l.unsubscribe(s))}),e=null)};e.forEach(l=>l&&l.addEventListener&&l.addEventListener("abort",s));const{signal:a}=n;return a.unsubscribe=r,[a,()=>{o&&clearTimeout(o),o=null}]},pd=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let i=0,s;for(;i<n;)s=i+t,yield e.slice(i,s),i=s},gd=async function*(e,t,n){for await(const i of e)yield*pd(ArrayBuffer.isView(i)?i:await n(String(i)),t)},Eo=(e,t,n,i,s)=>{const o=gd(e,t,s);let r=0;return new ReadableStream({type:"bytes",async pull(a){const{done:l,value:c}=await o.next();if(l){a.close(),i();return}let h=c.byteLength;n&&n(r+=h),a.enqueue(new Uint8Array(c))},cancel(a){return i(a),o.return()}},{highWaterMark:2})},Ro=(e,t)=>{const n=e!=null;return i=>setTimeout(()=>t({lengthComputable:n,total:e,loaded:i}))},$i=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",hl=$i&&typeof ReadableStream=="function",xs=$i&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),md=hl&&(()=>{let e=!1;const t=new Request(Ct.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})(),Lo=64*1024,_s=hl&&!!(()=>{try{return w.isReadableStream(new Response("").body)}catch{}})(),bi={stream:_s&&(e=>e.body)};$i&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!bi[t]&&(bi[t]=w.isFunction(e[t])?n=>n[t]():(n,i)=>{throw new E(`Response type '${t}' is not supported`,E.ERR_NOT_SUPPORT,i)})})})(new Response);const bd=async e=>{if(e==null)return 0;if(w.isBlob(e))return e.size;if(w.isSpecCompliantForm(e))return(await new Request(e).arrayBuffer()).byteLength;if(w.isArrayBufferView(e))return e.byteLength;if(w.isURLSearchParams(e)&&(e=e+""),w.isString(e))return(await xs(e)).byteLength},yd=async(e,t)=>{const n=w.toFiniteNumber(e.getContentLength());return n??bd(t)},xd=$i&&(async e=>{let{url:t,method:n,data:i,signal:s,cancelToken:o,timeout:r,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:h,withCredentials:d="same-origin",fetchOptions:u}=cl(e);c=c?(c+"").toLowerCase():"text";let[f,p]=s||o||r?fd([s,o],r):[],g,m;const b=()=>{!g&&setTimeout(()=>{f&&f.unsubscribe()}),g=!0};let y;try{if(l&&md&&n!=="get"&&n!=="head"&&(y=await yd(h,i))!==0){let k=new Request(t,{method:"POST",body:i,duplex:"half"}),S;w.isFormData(i)&&(S=k.headers.get("content-type"))&&h.setContentType(S),k.body&&(i=Eo(k.body,Lo,Ro(y,mi(l)),null,xs))}w.isString(d)||(d=d?"cors":"omit"),m=new Request(t,{...u,signal:f,method:n.toUpperCase(),headers:h.normalize().toJSON(),body:i,duplex:"half",withCredentials:d});let _=await fetch(m);const v=_s&&(c==="stream"||c==="response");if(_s&&(a||v)){const k={};["status","statusText","headers"].forEach(C=>{k[C]=_[C]});const S=w.toFiniteNumber(_.headers.get("content-length"));_=new Response(Eo(_.body,Lo,a&&Ro(S,mi(a,!0)),v&&b,xs),k)}c=c||"text";let x=await bi[w.findKey(bi,c)||"text"](_,e);return!v&&b(),p&&p(),await new Promise((k,S)=>{al(k,S,{data:x,headers:ft.from(_.headers),status:_.status,statusText:_.statusText,config:e,request:m})})}catch(_){throw b(),_&&_.name==="TypeError"&&/fetch/i.test(_.message)?Object.assign(new E("Network Error",E.ERR_NETWORK,e,m),{cause:_.cause||_}):E.from(_,_&&_.code,e,m)}}),ws={http:Ih,xhr:ud,fetch:xd};w.forEach(ws,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Fo=e=>`- ${e}`,_d=e=>w.isFunction(e)||e===null||e===!1,dl={getAdapter:e=>{e=w.isArray(e)?e:[e];const{length:t}=e;let n,i;const s={};for(let o=0;o<t;o++){n=e[o];let r;if(i=n,!_d(n)&&(i=ws[(r=String(n)).toLowerCase()],i===void 0))throw new E(`Unknown adapter '${r}'`);if(i)break;s[r||"#"+o]=i}if(!i){const o=Object.entries(s).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let r=t?o.length>1?`since :
`+o.map(Fo).join(`
`):" "+Fo(o[0]):"as no adapter specified";throw new E("There is no suitable adapter to dispatch the request "+r,"ERR_NOT_SUPPORT")}return i},adapters:ws};function es(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new je(null,e)}function Io(e){return es(e),e.headers=ft.from(e.headers),e.data=ts.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),dl.getAdapter(e.adapter||In.adapter)(e).then(function(i){return es(e),i.data=ts.call(e,e.transformResponse,i),i.headers=ft.from(i.headers),i},function(i){return rl(i)||(es(e),i&&i.response&&(i.response.data=ts.call(e,e.transformResponse,i.response),i.response.headers=ft.from(i.response.headers))),Promise.reject(i)})}const ul="1.7.2",Us={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Us[e]=function(i){return typeof i===e||"a"+(t<1?"n ":" ")+e}});const zo={};Us.transitional=function(t,n,i){function s(o,r){return"[Axios v"+ul+"] Transitional option '"+o+"'"+r+(i?". "+i:"")}return(o,r,a)=>{if(t===!1)throw new E(s(r," has been removed"+(n?" in "+n:"")),E.ERR_DEPRECATED);return n&&!zo[r]&&(zo[r]=!0,console.warn(s(r," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,r,a):!0}};function wd(e,t,n){if(typeof e!="object")throw new E("options must be an object",E.ERR_BAD_OPTION_VALUE);const i=Object.keys(e);let s=i.length;for(;s-- >0;){const o=i[s],r=t[o];if(r){const a=e[o],l=a===void 0||r(a,o,e);if(l!==!0)throw new E("option "+o+" must be "+l,E.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new E("Unknown option "+o,E.ERR_BAD_OPTION)}}const vs={assertOptions:wd,validators:Us},Vt=vs.validators;class be{constructor(t){this.defaults=t,this.interceptors={request:new Po,response:new Po}}async request(t,n){try{return await this._request(t,n)}catch(i){if(i instanceof Error){let s;Error.captureStackTrace?Error.captureStackTrace(s={}):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{i.stack?o&&!String(i.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(i.stack+=`
`+o):i.stack=o}catch{}}throw i}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=_e(this.defaults,n);const{transitional:i,paramsSerializer:s,headers:o}=n;i!==void 0&&vs.assertOptions(i,{silentJSONParsing:Vt.transitional(Vt.boolean),forcedJSONParsing:Vt.transitional(Vt.boolean),clarifyTimeoutError:Vt.transitional(Vt.boolean)},!1),s!=null&&(w.isFunction(s)?n.paramsSerializer={serialize:s}:vs.assertOptions(s,{encode:Vt.function,serialize:Vt.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let r=o&&w.merge(o.common,o[n.method]);o&&w.forEach(["delete","get","head","post","put","patch","common"],p=>{delete o[p]}),n.headers=ft.concat(r,o);const a=[];let l=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(l=l&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});const c=[];this.interceptors.response.forEach(function(g){c.push(g.fulfilled,g.rejected)});let h,d=0,u;if(!l){const p=[Io.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,c),u=p.length,h=Promise.resolve(n);d<u;)h=h.then(p[d++],p[d++]);return h}u=a.length;let f=n;for(d=0;d<u;){const p=a[d++],g=a[d++];try{f=p(f)}catch(m){g.call(this,m);break}}try{h=Io.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,u=c.length;d<u;)h=h.then(c[d++],c[d++]);return h}getUri(t){t=_e(this.defaults,t);const n=ll(t.baseURL,t.url);return il(n,t.params,t.paramsSerializer)}}w.forEach(["delete","get","head","options"],function(t){be.prototype[t]=function(n,i){return this.request(_e(i||{},{method:t,url:n,data:(i||{}).data}))}});w.forEach(["post","put","patch"],function(t){function n(i){return function(o,r,a){return this.request(_e(a||{},{method:t,headers:i?{"Content-Type":"multipart/form-data"}:{},url:o,data:r}))}}be.prototype[t]=n(),be.prototype[t+"Form"]=n(!0)});class Ys{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const i=this;this.promise.then(s=>{if(!i._listeners)return;let o=i._listeners.length;for(;o-- >0;)i._listeners[o](s);i._listeners=null}),this.promise.then=s=>{let o;const r=new Promise(a=>{i.subscribe(a),o=a}).then(s);return r.cancel=function(){i.unsubscribe(o)},r},t(function(o,r,a){i.reason||(i.reason=new je(o,r,a),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new Ys(function(s){t=s}),cancel:t}}}function vd(e){return function(n){return e.apply(null,n)}}function Sd(e){return w.isObject(e)&&e.isAxiosError===!0}const Ss={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ss).forEach(([e,t])=>{Ss[t]=e});function fl(e){const t=new be(e),n=Ua(be.prototype.request,t);return w.extend(n,be.prototype,t,{allOwnKeys:!0}),w.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return fl(_e(e,s))},n}const tt=fl(In);tt.Axios=be;tt.CanceledError=je;tt.CancelToken=Ys;tt.isCancel=rl;tt.VERSION=ul;tt.toFormData=zi;tt.AxiosError=E;tt.Cancel=tt.CanceledError;tt.all=function(t){return Promise.all(t)};tt.spread=vd;tt.isAxiosError=Sd;tt.mergeConfig=_e;tt.AxiosHeaders=ft;tt.formToJSON=e=>ol(w.isHTMLForm(e)?new FormData(e):e);tt.getAdapter=dl.getAdapter;tt.HttpStatusCode=Ss;tt.default=tt;const Ni=tt.create({timeout:1e4,headers:{Accept:"applications/json","Content-Type":"application/json"}});Ni.interceptors.request.use(e=>e,e=>Promise.reject(e));Ni.interceptors.response.use(async e=>{switch(+e.status){case 2e5:case 200:return await Promise.resolve(e);case 401:return await Promise.reject(e);case 404:case 500:case 400:return await Promise.reject("Failed to fetch data");default:return await Promise.reject("Failed to fetch data")}},e=>Promise.reject(e));const kd=async e=>(await Ni.get("/api/scenarios",{params:e})).data,Cd=async(e,t)=>(await Ni.get(`/api/runs/${e}`,{params:t})).data,$o=Ia("scenarioStore",{state:()=>({scenariosData:{},scenarioDetails:{},loading:!1,error:null}),actions:{async fetchScenarios(e){this.loading=!0,this.error=null;try{const t=await kd(e);this.scenariosData=t}catch{this.error="Failed to fetch scenarios"}finally{setTimeout(()=>{this.loading=!1},100)}},async fetchScenarioDetails(e,t){this.loading=!0,this.error=null;try{const n=await Cd(e,t);console.log(1111,n),this.scenarioDetails[e]=n}catch{this.error=`Failed to fetch details for scenario: ${e}`}finally{this.loading=!1}}},getters:{getScenariosData:e=>()=>{var t;return((t=e.scenariosData)==null?void 0:t.scenarios)||null},getScenarioDetails:e=>t=>e.scenarioDetails[t]||null}}),Od="data:image/svg+xml,%3csvg%20width='37'%20height='37'%20viewBox='0%200%2037%2037'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M26.9792%204.23926C27.6178%204.23926%2028.1355%204.75693%2028.1355%205.39551V8.86426H31.6042C32.2428%208.86426%2032.7605%209.38193%2032.7605%2010.0205C32.7605%2010.6591%2032.2428%2011.1768%2031.6042%2011.1768H28.1355V14.6455C28.1355%2015.2841%2027.6178%2015.8018%2026.9792%2015.8018C26.3407%2015.8018%2025.823%2015.2841%2025.823%2014.6455V11.1768H22.3542C21.7157%2011.1768%2021.198%2010.6591%2021.198%2010.0205C21.198%209.38193%2021.7157%208.86426%2022.3542%208.86426H25.823V5.39551C25.823%204.75693%2026.3407%204.23926%2026.9792%204.23926Z'%20fill='%231C274C'/%3e%3cpath%20d='M3.08325%2010.0205C3.08325%206.75014%203.08325%205.11496%204.09923%204.09898C5.1152%203.08301%206.75038%203.08301%2010.0208%203.08301C13.2911%203.08301%2014.9263%203.08301%2015.9423%204.09898C16.9583%205.11496%2016.9583%206.75014%2016.9583%2010.0205C16.9583%2013.2909%2016.9583%2014.9261%2015.9423%2015.942C14.9263%2016.958%2013.2911%2016.958%2010.0208%2016.958C6.75038%2016.958%205.1152%2016.958%204.09923%2015.942C3.08325%2014.9261%203.08325%2013.2909%203.08325%2010.0205Z'%20fill='%231C274C'/%3e%3cpath%20d='M20.0417%2026.9795C20.0417%2023.7092%2020.0417%2022.0739%2021.0577%2021.058C22.0737%2020.042%2023.7089%2020.042%2026.9792%2020.042C30.2496%2020.042%2031.8848%2020.042%2032.9008%2021.058C33.9167%2022.0739%2033.9167%2023.7092%2033.9167%2026.9795C33.9167%2030.2498%2033.9167%2031.8851%2032.9008%2032.901C31.8848%2033.917%2030.2496%2033.917%2026.9792%2033.917C23.7089%2033.917%2022.0737%2033.917%2021.0577%2032.901C20.0417%2031.8851%2020.0417%2030.2498%2020.0417%2026.9795Z'%20fill='%231C274C'/%3e%3cpath%20d='M3.08325%2026.9795C3.08325%2023.7092%203.08325%2022.0739%204.09923%2021.058C5.1152%2020.042%206.75038%2020.042%2010.0208%2020.042C13.2911%2020.042%2014.9263%2020.042%2015.9423%2021.058C16.9583%2022.0739%2016.9583%2023.7092%2016.9583%2026.9795C16.9583%2030.2498%2016.9583%2031.8851%2015.9423%2032.901C14.9263%2033.917%2013.2911%2033.917%2010.0208%2033.917C6.75038%2033.917%205.1152%2033.917%204.09923%2032.901C3.08325%2031.8851%203.08325%2030.2498%203.08325%2026.9795Z'%20fill='%231C274C'/%3e%3c/svg%3e",Md="data:image/svg+xml,%3csvg%20width='219'%20height='135'%20viewBox='0%200%20219%20135'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0.947266%2026.3093C0.947266%2012.3098%2012.258%200.960938%2026.2104%200.960938H192.789C206.742%200.960938%20218.053%2012.3098%20218.053%2026.3093V108.691C218.053%20122.691%20206.742%20134.04%20192.789%20134.04H26.2104C12.258%20134.04%200.947266%20122.691%200.947266%20108.691V26.3093Z'%20fill='%2382E6AC'/%3e%3c/svg%3e",Td="/assets/co2-metric-card-widget-B41Hu-R3.svg",Pd="/assets/cpu-metric-card-widget-Dn_ik0PF.svg",Ad="/assets/cpu-widget-CpXM1Jkn.svg",Dd="/assets/dynamic-chart-widget-DZIqhA8J.svg",Ed="data:image/svg+xml,%3csvg%20width='219'%20height='135'%20viewBox='0%200%20219%20135'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0.947266%2026.3093C0.947266%2012.3098%2012.258%200.960938%2026.2104%200.960938H192.789C206.742%200.960938%20218.053%2012.3098%20218.053%2026.3093V108.691C218.053%20122.691%20206.742%20134.04%20192.789%20134.04H26.2104C12.258%20134.04%200.947266%20122.691%200.947266%20108.691V26.3093Z'%20fill='%2382E6AC'/%3e%3c/svg%3e",Rd="/assets/power-metric-card-widget-CJZ82h0T.svg",Ld="data:image/svg+xml,%3csvg%20width='8'%20height='7'%20viewBox='0%200%208%207'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%207H7.32864V0L0%207Z'%20fill='white'/%3e%3c/svg%3e",Fd="/assets/table-widget-1sVsrNov.svg",Te=(e,t)=>new URL(Object.assign({"../assets/images/add-widget.svg":Od,"../assets/images/card-info.svg":Md,"../assets/images/co2-metric-card-widget.svg":Td,"../assets/images/cpu-metric-card-widget.svg":Pd,"../assets/images/cpu-widget.svg":Ad,"../assets/images/dynamic-chart-widget.svg":Dd,"../assets/images/metric-card-widget.svg":Ed,"../assets/images/power-metric-card-widget.svg":Rd,"../assets/images/resize-widget.svg":Ld,"../assets/images/table-widget.svg":Fd})[`../assets/images/${e}.${t}`],import.meta.url).href,Id=[{id:"1",title:"Avg. CO2 Emission",type:at.METRIC,grid:{w:1,h:2,x:0,y:0},metadata:{key:"CO2",unit:"kg"}},{id:"2",title:"Avg. Power Consumption",type:at.METRIC,grid:{w:1,h:2,x:1,y:0},metadata:{key:"POWER",unit:"kWh"}},{id:"3",title:"Avg. CPU Utilization",type:at.METRIC,grid:{w:1,h:2,x:2,y:0},metadata:{key:"CPU",unit:"%"}},{id:"4",title:"Data Table",type:at.TABLE,grid:{w:6,h:5,x:0,y:2},metadata:{key:"RUNS"}},{id:"5",title:"Dynamic Chart",type:at.CHART,grid:{w:3,h:5,x:0,y:7},metadata:{key:"TOTAL"}},{id:"6",title:"CPU Usage Timeline",type:at.CPU_USAGE,grid:{w:3,h:5,x:3,y:7},metadata:{key:"CPU"}}];Te("dynamic-chart-widget","svg"),at.CHART,Te("table-widget","svg"),at.TABLE,Te("cpu-widget","svg"),at.CPU_USAGE,Te("co2-metric-card-widget","svg"),at.METRIC,Te("power-metric-card-widget","svg"),at.METRIC,Te("cpu-metric-card-widget","svg"),at.METRIC;const zd=Ia("widgets",{state:()=>({scenarioWidgets:{},sidebarVisible:!1,selectedRun:null}),actions:{async initializeWidgets(e){var n;if((n=this.scenarioWidgets[e])!=null&&n.length){const s=await $o().getScenarioDetails(e);await this.updateWidgetsData(e,s);return}const t=JSON.parse(JSON.stringify(Id));await this.addWidgets(e,t)},async getMetrics(e){return[{metricType:"CO2",value:e.scenario.avgCo2Emission},{metricType:"POWER",value:e.scenario.avgPowerConsumption},{metricType:"CPU",value:e.scenario.avgCpuUtilization}]},async updateWidgetMetadata(e,t){switch(e.type){case at.CHART:{e.metadata.runs=t.runs||[];break}case at.CPU_USAGE:{e.metadata.runs=t.runs||[];break}case at.TABLE:{e.metadata.runs=t.runs||[],e.metadata.pagination=t.pagination||{};break}}},async addWidgets(e,t){const i=await $o().getScenarioDetails(e);this.scenarioWidgets[e]||(this.scenarioWidgets[e]=[]);for(const s of t)await this.updateWidgetMetadata(s,i),this.scenarioWidgets[e].push(s)},async updateWidgetsData(e,t){if(this.scenarioWidgets[e])for(const n of this.scenarioWidgets[e])await this.updateWidgetMetadata(n,t)},async deleteWidget(e,t){this.scenarioWidgets[e]&&(this.scenarioWidgets[e]=this.scenarioWidgets[e].filter(n=>n.id!==t))},async duplicateWidget(e,t){const n=JSON.parse(JSON.stringify(t));n.id=this.getWidgetId(e),await this.addWidgets(e,[n])},updateWidgetsPos(e,t){const n=this.scenarioWidgets[e];n&&t.forEach(i=>{const s=n.find(o=>o.id===i.id);s&&(s.grid.x=i.x,s.grid.y=i.y,s.grid.w=i.w,s.grid.h=i.h)})},setSidebarVisible(e){this.sidebarVisible=e},setSelectedRun(e){this.selectedRun=e}},getters:{getWidgetId:e=>t=>{let n=0;return e.scenarioWidgets[t]&&(n=Math.max(...e.scenarioWidgets[t].map(i=>parseInt(i.id,10)),0)),(n+1).toString()}}}),$d="/assets/logo-dark-BnZuN90d.svg",Nd="/assets/logo-light-Dqnf9hlY.svg",pl=e=>(za("data-v-6a02d662"),e=e(),$a(),e),Bd={class:"app-header"},Wd={class:"app-header__container"},Hd={class:"app-header__logo-section"},jd=pl(()=>F("img",{src:$d,alt:"Logo",class:"app-header__logo-image block dark:hidden"},null,-1)),Vd=pl(()=>F("img",{src:Nd,alt:"Logo",class:"app-header__logo-image hidden dark:block"},null,-1)),Ud={class:"app-header__right-section"},Yd=ct({__name:"AppHeader",setup(e){const t=zc(),n=ot(()=>t.darkMode),i=()=>{t.toggleDarkMode()};return(s,o)=>{const r=fi("router-link");return j(),X("header",Bd,[F("div",Wd,[F("div",Hd,[pi(r,{to:"/dashboard"},{default:xn(()=>[jd,Vd]),_:1})]),F("div",Ud,[F("button",{onClick:i,class:"app-header__toggle-theme-button"},[pi(kt($c),{icon:n.value?"moon":"sun"},null,8,["icon"]),F("span",null,Rt(n.value?"Dark Mode":"Light Mode"),1)])])])])}}}),qd=Na(Yd,[["__scopeId","data-v-6a02d662"]]),Xd={class:"layout"},Gd={class:"layout__content"},Kd={class:"layout__title"},Jd={class:"layout__filters"},Qd={class:"layout__breadcrumbs"},Zd={class:"layout__dashboard"},tu=ct({__name:"MainLayout",setup(e){const t=zd();return(n,i)=>(j(),X("div",Xd,[F("div",{class:nt([{blurred:kt(t).sidebarVisible},"layout__main"])},[pi(qd),F("div",Gd,[F("div",Kd,[V(n.$slots,"title",{},void 0,!0)]),F("div",Jd,[V(n.$slots,"filters",{},void 0,!0)]),F("div",Qd,[V(n.$slots,"breadcrumbs",{},void 0,!0)]),F("div",Zd,[V(n.$slots,"dashboard",{},void 0,!0)])])],2)]))}}),F_=Na(tu,[["__scopeId","data-v-26240dbd"]]);function Tt(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function we(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const gl=6048e5,eu=864e5,I_=6e4,z_=36e5,$_=1e3;let nu={};function Bi(){return nu}function wn(e,t){var a,l,c,h;const n=Bi(),i=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((h=(c=n.locale)==null?void 0:c.options)==null?void 0:h.weekStartsOn)??0,s=Tt(e),o=s.getDay(),r=(o<i?7:0)+o-i;return s.setDate(s.getDate()-r),s.setHours(0,0,0,0),s}function yi(e){return wn(e,{weekStartsOn:1})}function ml(e){const t=Tt(e),n=t.getFullYear(),i=we(e,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const s=yi(i),o=we(e,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);const r=yi(o);return t.getTime()>=s.getTime()?n+1:t.getTime()>=r.getTime()?n:n-1}function No(e){const t=Tt(e);return t.setHours(0,0,0,0),t}function Bo(e){const t=Tt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function iu(e,t){const n=No(e),i=No(t),s=+n-Bo(n),o=+i-Bo(i);return Math.round((s-o)/eu)}function su(e){const t=ml(e),n=we(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),yi(n)}function ou(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function ru(e){if(!ou(e)&&typeof e!="number")return!1;const t=Tt(e);return!isNaN(Number(t))}function au(e){const t=Tt(e),n=we(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}const lu={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},cu=(e,t,n)=>{let i;const s=lu[e];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function ns(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const hu={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},du={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},uu={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},fu={date:ns({formats:hu,defaultWidth:"full"}),time:ns({formats:du,defaultWidth:"full"}),dateTime:ns({formats:uu,defaultWidth:"full"})},pu={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},gu=(e,t,n,i)=>pu[e];function Ge(e){return(t,n)=>{const i=n!=null&&n.context?String(n.context):"standalone";let s;if(i==="formatting"&&e.formattingValues){const r=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):r;s=e.formattingValues[a]||e.formattingValues[r]}else{const r=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;s=e.values[a]||e.values[r]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}const mu={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},bu={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},yu={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},xu={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},_u={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},wu={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},vu=(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Su={ordinalNumber:vu,era:Ge({values:mu,defaultWidth:"wide"}),quarter:Ge({values:bu,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Ge({values:yu,defaultWidth:"wide"}),day:Ge({values:xu,defaultWidth:"wide"}),dayPeriod:Ge({values:_u,defaultWidth:"wide",formattingValues:wu,defaultFormattingWidth:"wide"})};function Ke(e){return(t,n={})=>{const i=n.width,s=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const r=o[0],a=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?Cu(a,d=>d.test(r)):ku(a,d=>d.test(r));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const h=t.slice(r.length);return{value:c,rest:h}}}function ku(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Cu(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Ou(e){return(t,n={})=>{const i=t.match(e.matchPattern);if(!i)return null;const s=i[0],o=t.match(e.parsePattern);if(!o)return null;let r=e.valueCallback?e.valueCallback(o[0]):o[0];r=n.valueCallback?n.valueCallback(r):r;const a=t.slice(s.length);return{value:r,rest:a}}}const Mu=/^(\d+)(th|st|nd|rd)?/i,Tu=/\d+/i,Pu={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Au={any:[/^b/i,/^(a|c)/i]},Du={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Eu={any:[/1/i,/2/i,/3/i,/4/i]},Ru={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Lu={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Fu={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Iu={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},zu={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},$u={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Nu={ordinalNumber:Ou({matchPattern:Mu,parsePattern:Tu,valueCallback:e=>parseInt(e,10)}),era:Ke({matchPatterns:Pu,defaultMatchWidth:"wide",parsePatterns:Au,defaultParseWidth:"any"}),quarter:Ke({matchPatterns:Du,defaultMatchWidth:"wide",parsePatterns:Eu,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ke({matchPatterns:Ru,defaultMatchWidth:"wide",parsePatterns:Lu,defaultParseWidth:"any"}),day:Ke({matchPatterns:Fu,defaultMatchWidth:"wide",parsePatterns:Iu,defaultParseWidth:"any"}),dayPeriod:Ke({matchPatterns:zu,defaultMatchWidth:"any",parsePatterns:$u,defaultParseWidth:"any"})},Bu={code:"en-US",formatDistance:cu,formatLong:fu,formatRelative:gu,localize:Su,match:Nu,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Wu(e){const t=Tt(e);return iu(t,au(t))+1}function Hu(e){const t=Tt(e),n=+yi(t)-+su(t);return Math.round(n/gl)+1}function bl(e,t){var h,d,u,f;const n=Tt(e),i=n.getFullYear(),s=Bi(),o=(t==null?void 0:t.firstWeekContainsDate)??((d=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:d.firstWeekContainsDate)??s.firstWeekContainsDate??((f=(u=s.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,r=we(e,0);r.setFullYear(i+1,0,o),r.setHours(0,0,0,0);const a=wn(r,t),l=we(e,0);l.setFullYear(i,0,o),l.setHours(0,0,0,0);const c=wn(l,t);return n.getTime()>=a.getTime()?i+1:n.getTime()>=c.getTime()?i:i-1}function ju(e,t){var a,l,c,h;const n=Bi(),i=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((h=(c=n.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??1,s=bl(e,t),o=we(e,0);return o.setFullYear(s,0,i),o.setHours(0,0,0,0),wn(o,t)}function Vu(e,t){const n=Tt(e),i=+wn(n,t)-+ju(n,t);return Math.round(i/gl)+1}function W(e,t){const n=e<0?"-":"",i=Math.abs(e).toString().padStart(t,"0");return n+i}const Ut={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return W(t==="yy"?i%100:i,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):W(n+1,2)},d(e,t){return W(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return W(e.getHours()%12||12,t.length)},H(e,t){return W(e.getHours(),t.length)},m(e,t){return W(e.getMinutes(),t.length)},s(e,t){return W(e.getSeconds(),t.length)},S(e,t){const n=t.length,i=e.getMilliseconds(),s=Math.trunc(i*Math.pow(10,n-3));return W(s,t.length)}},Pe={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Wo={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const i=e.getFullYear(),s=i>0?i:1-i;return n.ordinalNumber(s,{unit:"year"})}return Ut.y(e,t)},Y:function(e,t,n,i){const s=bl(e,i),o=s>0?s:1-s;if(t==="YY"){const r=o%100;return W(r,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):W(o,t.length)},R:function(e,t){const n=ml(e);return W(n,t.length)},u:function(e,t){const n=e.getFullYear();return W(n,t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return W(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return W(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return Ut.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return W(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const s=Vu(e,i);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):W(s,t.length)},I:function(e,t,n){const i=Hu(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):W(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Ut.d(e,t)},D:function(e,t,n){const i=Wu(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):W(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const s=e.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return W(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const s=e.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return W(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return W(s,t.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let s;switch(i===12?s=Pe.noon:i===0?s=Pe.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let s;switch(i>=17?s=Pe.evening:i>=12?s=Pe.afternoon:i>=4?s=Pe.morning:s=Pe.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let i=e.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Ut.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Ut.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):W(i,t.length)},k:function(e,t,n){let i=e.getHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):W(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ut.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Ut.s(e,t)},S:function(e,t){return Ut.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return jo(i);case"XXXX":case"XX":return de(i);case"XXXXX":case"XXX":default:return de(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return jo(i);case"xxxx":case"xx":return de(i);case"xxxxx":case"xxx":default:return de(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Ho(i,":");case"OOOO":default:return"GMT"+de(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Ho(i,":");case"zzzz":default:return"GMT"+de(i,":")}},t:function(e,t,n){const i=Math.trunc(e.getTime()/1e3);return W(i,t.length)},T:function(e,t,n){const i=e.getTime();return W(i,t.length)}};function Ho(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Math.trunc(i/60),o=i%60;return o===0?n+String(s):n+String(s)+t+W(o,2)}function jo(e,t){return e%60===0?(e>0?"-":"+")+W(Math.abs(e)/60,2):de(e,t)}function de(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=W(Math.trunc(i/60),2),o=W(i%60,2);return n+s+t+o}const Vo=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},yl=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Uu=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],s=n[2];if(!s)return Vo(e,t);let o;switch(i){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",Vo(i,t)).replace("{{time}}",yl(s,t))},Yu={p:yl,P:Uu},qu=/^D+$/,Xu=/^Y+$/,Gu=["D","DD","YY","YYYY"];function Ku(e){return qu.test(e)}function Ju(e){return Xu.test(e)}function Qu(e,t,n){const i=Zu(e,t,n);if(console.warn(i),Gu.includes(e))throw new RangeError(i)}function Zu(e,t,n){const i=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const tf=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ef=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,nf=/^'([^]*?)'?$/,sf=/''/g,of=/[a-zA-Z]/;function N_(e,t,n){var h,d,u,f,p,g,m,b;const i=Bi(),s=(n==null?void 0:n.locale)??i.locale??Bu,o=(n==null?void 0:n.firstWeekContainsDate)??((d=(h=n==null?void 0:n.locale)==null?void 0:h.options)==null?void 0:d.firstWeekContainsDate)??i.firstWeekContainsDate??((f=(u=i.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,r=(n==null?void 0:n.weekStartsOn)??((g=(p=n==null?void 0:n.locale)==null?void 0:p.options)==null?void 0:g.weekStartsOn)??i.weekStartsOn??((b=(m=i.locale)==null?void 0:m.options)==null?void 0:b.weekStartsOn)??0,a=Tt(e);if(!ru(a))throw new RangeError("Invalid time value");let l=t.match(ef).map(y=>{const _=y[0];if(_==="p"||_==="P"){const v=Yu[_];return v(y,s.formatLong)}return y}).join("").match(tf).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const _=y[0];if(_==="'")return{isToken:!1,value:rf(y)};if(Wo[_])return{isToken:!0,value:y};if(_.match(of))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");return{isToken:!1,value:y}});s.localize.preprocessor&&(l=s.localize.preprocessor(a,l));const c={firstWeekContainsDate:o,weekStartsOn:r,locale:s};return l.map(y=>{if(!y.isToken)return y.value;const _=y.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&Ju(_)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&Ku(_))&&Qu(_,t,String(e));const v=Wo[_[0]];return v(a,_,s.localize,c)}).join("")}function rf(e){const t=e.match(nf);return t?t[1].replace(sf,"'"):e}/*!
 * @kurkle/color v0.3.2
 * https://github.com/kurkle/color#readme
 * (c) 2023 Jukka Kurkela
 * Released under the MIT License
 */function zn(e){return e+.5|0}const Qt=(e,t,n)=>Math.max(Math.min(e,n),t);function rn(e){return Qt(zn(e*2.55),0,255)}function Zt(e){return Qt(zn(e*255),0,255)}function Ht(e){return Qt(zn(e/2.55)/100,0,1)}function Uo(e){return Qt(zn(e*100),0,100)}const pt={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},ks=[..."0123456789ABCDEF"],af=e=>ks[e&15],lf=e=>ks[(e&240)>>4]+ks[e&15],Wn=e=>(e&240)>>4===(e&15),cf=e=>Wn(e.r)&&Wn(e.g)&&Wn(e.b)&&Wn(e.a);function hf(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&pt[e[1]]*17,g:255&pt[e[2]]*17,b:255&pt[e[3]]*17,a:t===5?pt[e[4]]*17:255}:(t===7||t===9)&&(n={r:pt[e[1]]<<4|pt[e[2]],g:pt[e[3]]<<4|pt[e[4]],b:pt[e[5]]<<4|pt[e[6]],a:t===9?pt[e[7]]<<4|pt[e[8]]:255})),n}const df=(e,t)=>e<255?t(e):"";function uf(e){var t=cf(e)?af:lf;return e?"#"+t(e.r)+t(e.g)+t(e.b)+df(e.a,t):void 0}const ff=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function xl(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 pf(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 gf(e,t,n){const i=xl(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 mf(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 qs(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=mf(n,i,s,h,o),l=l*60+.5),[l|0,c||0,a]}function Xs(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(Zt)}function Gs(e,t,n){return Xs(xl,e,t,n)}function bf(e,t,n){return Xs(gf,e,t,n)}function yf(e,t,n){return Xs(pf,e,t,n)}function _l(e){return(e%360+360)%360}function xf(e){const t=ff.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?rn(+t[5]):Zt(+t[5]));const s=_l(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?i=bf(s,o,r):t[1]==="hsv"?i=yf(s,o,r):i=Gs(s,o,r),{r:i[0],g:i[1],b:i[2],a:n}}function _f(e,t){var n=qs(e);n[0]=_l(n[0]+t),n=Gs(n),e.r=n[0],e.g=n[1],e.b=n[2]}function wf(e){if(!e)return;const t=qs(e),n=t[0],i=Uo(t[1]),s=Uo(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${s}%, ${Ht(e.a)})`:`hsl(${n}, ${i}%, ${s}%)`}const Yo={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 vf(){const e={},t=Object.keys(qo),n=Object.keys(Yo);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,Yo[o]);o=parseInt(qo[r],16),e[a]=[o>>16&255,o>>8&255,o&255]}return e}let Hn;function Sf(e){Hn||(Hn=vf(),Hn.transparent=[0,0,0,0]);const t=Hn[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const kf=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Cf(e){const t=kf.exec(e);let n=255,i,s,o;if(t){if(t[7]!==i){const r=+t[7];n=t[8]?rn(r):Qt(r*255,0,255)}return i=+t[1],s=+t[3],o=+t[5],i=255&(t[2]?rn(i):Qt(i,0,255)),s=255&(t[4]?rn(s):Qt(s,0,255)),o=255&(t[6]?rn(o):Qt(o,0,255)),{r:i,g:s,b:o,a:n}}}function Of(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Ht(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const is=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Ae=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function Mf(e,t,n){const i=Ae(Ht(e.r)),s=Ae(Ht(e.g)),o=Ae(Ht(e.b));return{r:Zt(is(i+n*(Ae(Ht(t.r))-i))),g:Zt(is(s+n*(Ae(Ht(t.g))-s))),b:Zt(is(o+n*(Ae(Ht(t.b))-o))),a:e.a+n*(t.a-e.a)}}function jn(e,t,n){if(e){let i=qs(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=Gs(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function wl(e,t){return e&&Object.assign(t||{},e)}function Xo(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=Zt(e[3]))):(t=wl(e,{r:0,g:0,b:0,a:1}),t.a=Zt(t.a)),t}function Tf(e){return e.charAt(0)==="r"?Cf(e):xf(e)}class vn{constructor(t){if(t instanceof vn)return t;const n=typeof t;let i;n==="object"?i=Xo(t):n==="string"&&(i=hf(t)||Sf(t)||Tf(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=wl(this._rgb);return t&&(t.a=Ht(t.a)),t}set rgb(t){this._rgb=Xo(t)}rgbString(){return this._valid?Of(this._rgb):void 0}hexString(){return this._valid?uf(this._rgb):void 0}hslString(){return this._valid?wf(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=Mf(this._rgb,t._rgb,n)),this}clone(){return new vn(this.rgb)}alpha(t){return this._rgb.a=Zt(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=zn(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 jn(this._rgb,2,t),this}darken(t){return jn(this._rgb,2,-t),this}saturate(t){return jn(this._rgb,1,t),this}desaturate(t){return jn(this._rgb,1,-t),this}rotate(t){return _f(this._rgb,t),this}}/*!
 * Chart.js v4.4.3
 * https://www.chartjs.org
 * (c) 2024 Chart.js Contributors
 * Released under the MIT License
 */function Nt(){}const Pf=(()=>{let e=0;return()=>e++})();function K(e){return e===null||typeof e>"u"}function it(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 yt(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function At(e,t){return yt(e)?e:t}function I(e,t){return typeof e>"u"?t:e}const Af=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,vl=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function q(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function H(e,t,n,i){let s,o,r;if(it(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 xi(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(it(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 Sl(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function Df(e,t,n,i){if(!Sl(e))return;const s=t[e],o=n[e];B(s)&&B(o)?Sn(s,o,i):t[e]=_i(o)}function Sn(e,t,n){const i=it(t)?t:[t],s=i.length;if(!B(e))return e;n=n||{};const o=n.merger||Df;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 hn(e,t){return Sn(e,t,{merger:Ef})}function Ef(e,t,n){if(!Sl(e))return;const i=t[e],s=n[e];B(i)&&B(s)?hn(i,s):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=_i(s))}const Go={"":e=>e,x:e=>e.x,y:e=>e.y};function Rf(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 Lf(e){const t=Rf(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function kn(e,t){return(Go[t]||(Go[t]=Lf(t)))(e)}function Ks(e){return e.charAt(0).toUpperCase()+e.slice(1)}const wi=e=>typeof e<"u",ne=e=>typeof e=="function",Ko=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function Ff(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Q=Math.PI,J=2*Q,If=J+Q,vi=Number.POSITIVE_INFINITY,zf=Q/180,et=Q/2,ae=Q/4,Jo=Q*2/3,Cs=Math.log10,ze=Math.sign;function dn(e,t,n){return Math.abs(e-t)<n}function Qo(e){const t=Math.round(e);e=dn(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(Cs(e))),i=e/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function $f(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 Cn(e){return!isNaN(parseFloat(e))&&isFinite(e)}function Nf(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function Bf(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 jt(e){return e*(Q/180)}function Wf(e){return e*(180/Q)}function Zo(e){if(!yt(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function kl(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*Q&&(o+=J),{angle:o,distance:s}}function Os(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Hf(e,t){return(e-t+If)%J-Q}function Xt(e){return(e%J+J)%J}function On(e,t,n,i){const s=Xt(e),o=Xt(t),r=Xt(n),a=Xt(o-s),l=Xt(r-s),c=Xt(s-o),h=Xt(s-r);return s===o||s===r||i&&o===r||a>l&&c<h}function ht(e,t,n){return Math.max(t,Math.min(n,e))}function jf(e){return ht(e,-32768,32767)}function Re(e,t,n,i=1e-6){return e>=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function Js(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 ge=(e,t,n,i)=>Js(e,n,i?s=>{const o=e[s][t];return o<n||o===n&&e[s+1][t]===n}:s=>e[s][t]<n),Vf=(e,t,n)=>Js(e,n,i=>e[i][t]>=n);function Uf(e,t,n){let i=0,s=e.length;for(;i<s&&e[i]<t;)i++;for(;s>i&&e[s-1]>n;)s--;return i>0||s<e.length?e.slice(i,s):e}const Cl=["push","pop","shift","splice","unshift"];function Yf(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Cl.forEach(n=>{const i="_onData"+Ks(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 tr(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(Cl.forEach(o=>{delete e[o]}),delete e._chartjs)}function qf(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const Ol=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function Ml(e,t){let n=[],i=!1;return function(...s){n=s,i||(i=!0,Ol.call(window,()=>{i=!1,e.apply(t,n)}))}}function Xf(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const Qs=e=>e==="start"?"left":e==="end"?"right":"center",rt=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,Gf=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function Kf(e,t,n){const i=t.length;let s=0,o=i;if(e._sorted){const{iScale:r,_parsed:a}=e,l=r.axis,{min:c,max:h,minDefined:d,maxDefined:u}=r.getUserBounds();d&&(s=ht(Math.min(ge(a,l,c).lo,n?i:ge(t,l,r.getPixelForValue(c)).lo),0,i-1)),u?o=ht(Math.max(ge(a,r.axis,h,!0).hi+1,n?0:ge(t,l,r.getPixelForValue(h),!0).hi+1),s,i)-s:o=i-s}return{start:s,count:o}}function Jf(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 Vn=e=>e===0||e===1,er=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*J/n)),nr=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*J/n)+1,un={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*et)+1,easeOutSine:e=>Math.sin(e*et),easeInOutSine:e=>-.5*(Math.cos(Q*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=>Vn(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=>Vn(e)?e:er(e,.075,.3),easeOutElastic:e=>Vn(e)?e:nr(e,.075,.3),easeInOutElastic(e){return Vn(e)?e:e<.5?.5*er(e*2,.1125,.45):.5+.5*nr(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-un.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?un.easeInBounce(e*2)*.5:un.easeOutBounce(e*2-1)*.5+.5};function Zs(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function ir(e){return Zs(e)?e:new vn(e)}function ss(e){return Zs(e)?e:new vn(e).saturate(.5).darken(.1).hexString()}const Qf=["x","y","borderWidth","radius","tension"],Zf=["color","borderColor","backgroundColor"];function tp(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:Zf},numbers:{type:"number",properties:Qf}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function ep(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const sr=new Map;function np(e,t){t=t||{};const n=e+JSON.stringify(t);let i=sr.get(n);return i||(i=new Intl.NumberFormat(e,t),sr.set(n,i)),i}function to(e,t,n){return np(t,n).format(e)}const Tl={values(e){return it(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=ip(e,n)}const r=Cs(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),to(e,i,l)},logarithmic(e,t,n){if(e===0)return"0";const i=n[t].significand||e/Math.pow(10,Math.floor(Cs(e)));return[1,2,3,5,10,15].includes(i)||t>.8*n.length?Tl.numeric.call(this,e,t,n):""}};function ip(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 Pl={formatters:Tl};function sp(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:Pl.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 ve=Object.create(null),Ms=Object.create(null);function fn(e,t){if(!t)return e;const n=t.split(".");for(let i=0,s=n.length;i<s;++i){const o=n[i];e=e[o]||(e[o]=Object.create(null))}return e}function os(e,t,n){return typeof t=="string"?Sn(fn(e,t),n):Sn(fn(e,""),t)}class op{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,s)=>ss(s.backgroundColor),this.hoverBorderColor=(i,s)=>ss(s.borderColor),this.hoverColor=(i,s)=>ss(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return os(this,t,n)}get(t){return fn(this,t)}describe(t,n){return os(Ms,t,n)}override(t,n){return os(ve,t,n)}route(t,n,i,s){const o=fn(this,t),r=fn(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):I(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var Z=new op({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[tp,ep,sp]);function rp(e){return!e||K(e.size)||K(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function or(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 rr(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Ts(e,t,n,i){Al(e,t,n,i,null)}function Al(e,t,n,i,s){let o,r,a,l,c,h,d,u;const f=t.pointStyle,p=t.rotation,g=t.radius;let m=(p||0)*zf;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(n,i),e.rotate(m),e.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),e.restore();return}if(!(isNaN(g)||g<=0)){switch(e.beginPath(),f){default:s?e.ellipse(n,i,s/2,g,0,0,J):e.arc(n,i,g,0,J),e.closePath();break;case"triangle":h=s?s/2:g,e.moveTo(n+Math.sin(m)*h,i-Math.cos(m)*g),m+=Jo,e.lineTo(n+Math.sin(m)*h,i-Math.cos(m)*g),m+=Jo,e.lineTo(n+Math.sin(m)*h,i-Math.cos(m)*g),e.closePath();break;case"rectRounded":c=g*.516,l=g-c,r=Math.cos(m+ae)*l,d=Math.cos(m+ae)*(s?s/2-c:l),a=Math.sin(m+ae)*l,u=Math.sin(m+ae)*(s?s/2-c:l),e.arc(n-d,i-a,c,m-Q,m-et),e.arc(n+u,i-r,c,m-et,m),e.arc(n+d,i+a,c,m,m+et),e.arc(n-u,i+r,c,m+et,m+Q),e.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,h=s?s/2:l,e.rect(n-h,i-l,2*h,2*l);break}m+=ae;case"rectRot":d=Math.cos(m)*(s?s/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(s?s/2:g),e.moveTo(n-d,i-a),e.lineTo(n+u,i-r),e.lineTo(n+d,i+a),e.lineTo(n-u,i+r),e.closePath();break;case"crossRot":m+=ae;case"cross":d=Math.cos(m)*(s?s/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(s?s/2:g),e.moveTo(n-d,i-a),e.lineTo(n+d,i+a),e.moveTo(n+u,i-r),e.lineTo(n-u,i+r);break;case"star":d=Math.cos(m)*(s?s/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(s?s/2:g),e.moveTo(n-d,i-a),e.lineTo(n+d,i+a),e.moveTo(n+u,i-r),e.lineTo(n-u,i+r),m+=ae,d=Math.cos(m)*(s?s/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(s?s/2:g),e.moveTo(n-d,i-a),e.lineTo(n+d,i+a),e.moveTo(n+u,i-r),e.lineTo(n-u,i+r);break;case"line":r=s?s/2:Math.cos(m)*g,a=Math.sin(m)*g,e.moveTo(n-r,i-a),e.lineTo(n+r,i+a);break;case"dash":e.moveTo(n,i),e.lineTo(n+Math.cos(m)*(s?s/2:g),i+Math.sin(m)*g);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Mn(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 eo(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function no(e){e.restore()}function ap(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 lp(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 cp(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),K(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 hp(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 dp(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Tn(e,t,n,i,s,o={}){const r=it(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(e.save(),e.font=s.string,cp(e,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&dp(e,o.backdrop),a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),K(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,n,i,o.maxWidth)),e.fillText(c,n,i,o.maxWidth),hp(e,n,i,c,o),i+=Number(s.lineHeight);e.restore()}function Ps(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*Q,Q,!0),e.lineTo(n,i+o-r.bottomLeft),e.arc(n+r.bottomLeft,i+o-r.bottomLeft,r.bottomLeft,Q,et,!0),e.lineTo(n+s-r.bottomRight,i+o),e.arc(n+s-r.bottomRight,i+o-r.bottomRight,r.bottomRight,et,0,!0),e.lineTo(n+s,i+r.topRight),e.arc(n+s-r.topRight,i+r.topRight,r.topRight,0,-et,!0),e.lineTo(n+r.topLeft,i)}const up=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,fp=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function pp(e,t){const n=(""+e).match(up);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 gp=e=>+e||0;function io(e,t){const n={},i=B(t),s=i?Object.keys(t):t,o=B(e)?i?r=>I(e[r],e[t[r]]):r=>e[r]:()=>e;for(const r of s)n[r]=gp(o(r));return n}function mp(e){return io(e,{top:"y",right:"x",bottom:"y",left:"x"})}function pn(e){return io(e,["topLeft","topRight","bottomLeft","bottomRight"])}function xt(e){const t=mp(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function lt(e,t){e=e||{},t=t||Z.font;let n=I(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=I(e.style,t.style);i&&!(""+i).match(fp)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:I(e.family,t.family),lineHeight:pp(I(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:I(e.weight,t.weight),string:""};return s.string=rp(s),s}function Un(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 bp(e,t,n){const{min:i,max:s}=e,o=vl(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 ke(e,t){return Object.assign(Object.create(e),t)}function so(e,t=[""],n,i,s=()=>e[0]){const o=n||e;typeof i>"u"&&(i=Ll("_fallback",e));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:i,_getTarget:s,override:a=>so([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 El(a,l,()=>Cp(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return lr(a).includes(l)},ownKeys(a){return lr(a)},set(a,l,c){const h=a._storage||(a._storage=s());return a[l]=h[l]=c,delete a._keys,!0}})}function $e(e,t,n,i){const s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:Dl(e,i),setContext:o=>$e(e,o,n,i),override:o=>$e(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 El(o,r,()=>xp(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 Dl(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:ne(n)?n:()=>n,isIndexable:ne(i)?i:()=>i}}const yp=(e,t)=>e?e+Ks(t):t,oo=(e,t)=>B(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function El(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const i=n();return e[t]=i,i}function xp(e,t,n){const{_proxy:i,_context:s,_subProxy:o,_descriptors:r}=e;let a=i[t];return ne(a)&&r.isScriptable(t)&&(a=_p(t,a,e,n)),it(a)&&a.length&&(a=wp(t,a,e,r.isIndexable)),oo(t,a)&&(a=$e(a,s,o&&o[t],r)),a}function _p(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),oo(e,l)&&(l=ro(s._scopes,s,e,l)),l}function wp(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=ro(c,s,e,h);t.push($e(d,o,r&&r[e],a))}}return t}function Rl(e,t,n){return ne(e)?e(t,n):e}const vp=(e,t)=>e===!0?t:typeof e=="string"?kn(t,e):void 0;function Sp(e,t,n,i,s){for(const o of t){const r=vp(n,o);if(r){e.add(r);const a=Rl(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 ro(e,t,n,i){const s=t._rootScopes,o=Rl(t._fallback,n,i),r=[...e,...s],a=new Set;a.add(i);let l=ar(a,r,n,o||n,i);return l===null||typeof o<"u"&&o!==n&&(l=ar(a,r,o,l,i),l===null)?!1:so(Array.from(a),[""],s,o,()=>kp(t,n,i))}function ar(e,t,n,i,s){for(;n;)n=Sp(e,t,n,i,s);return n}function kp(e,t,n){const i=e._getTarget();t in i||(i[t]={});const s=i[t];return it(s)&&B(n)?n:s||{}}function Cp(e,t,n,i){let s;for(const o of t)if(s=Ll(yp(o,e),n),typeof s<"u")return oo(e,s)?ro(n,i,e,s):s}function Ll(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function lr(e){let t=e._keys;return t||(t=e._keys=Op(e._scopes)),t}function Op(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 Mp=Number.EPSILON||1e-14,Ne=(e,t)=>t<e.length&&!e[t].skip&&e[t],Fl=e=>e==="x"?"y":"x";function Tp(e,t,n,i){const s=e.skip?t:e,o=t,r=n.skip?t:n,a=Os(o,s),l=Os(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,u=i*h;return{previous:{x:o.x-d*(r.x-s.x),y:o.y-d*(r.y-s.y)},next:{x:o.x+u*(r.x-s.x),y:o.y+u*(r.y-s.y)}}}function Pp(e,t,n){const i=e.length;let s,o,r,a,l,c=Ne(e,0);for(let h=0;h<i-1;++h)if(l=c,c=Ne(e,h+1),!(!l||!c)){if(dn(t[h],0,Mp)){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 Ap(e,t,n="x"){const i=Fl(n),s=e.length;let o,r,a,l=Ne(e,0);for(let c=0;c<s;++c){if(r=a,a=l,l=Ne(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 Dp(e,t="x"){const n=Fl(t),i=e.length,s=Array(i).fill(0),o=Array(i);let r,a,l,c=Ne(e,0);for(r=0;r<i;++r)if(a=l,l=c,c=Ne(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?ze(s[r-1])!==ze(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}Pp(e,s,o),Ap(e,o,t)}function Yn(e,t,n){return Math.max(Math.min(e,n),t)}function Ep(e,t){let n,i,s,o,r,a=Mn(e[0],t);for(n=0,i=e.length;n<i;++n)r=o,o=a,a=n<i-1&&Mn(e[n+1],t),o&&(s=e[n],r&&(s.cp1x=Yn(s.cp1x,t.left,t.right),s.cp1y=Yn(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=Yn(s.cp2x,t.left,t.right),s.cp2y=Yn(s.cp2y,t.top,t.bottom)))}function Rp(e,t,n,i,s){let o,r,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Dp(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=Tp(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&&Ep(e,n)}function ao(){return typeof window<"u"&&typeof document<"u"}function lo(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Si(e,t,n){let i;return typeof e=="string"?(i=parseInt(e,10),e.indexOf("%")!==-1&&(i=i/100*t.parentNode[n])):i=e,i}const Wi=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function Lp(e,t){return Wi(e).getPropertyValue(t)}const Fp=["top","right","bottom","left"];function ye(e,t,n){const i={};n=n?"-"+n:"";for(let s=0;s<4;s++){const o=Fp[s];i[o]=parseFloat(e[t+"-"+o+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Ip=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function zp(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:s,offsetY:o}=i;let r=!1,a,l;if(Ip(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 ue(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,s=Wi(n),o=s.boxSizing==="border-box",r=ye(s,"padding"),a=ye(s,"border","width"),{x:l,y:c,box:h}=zp(e,n),d=r.left+(h&&a.left),u=r.top+(h&&a.top);let{width:f,height:p}=t;return o&&(f-=r.width+a.width,p-=r.height+a.height),{x:Math.round((l-d)/f*n.width/i),y:Math.round((c-u)/p*n.height/i)}}function $p(e,t,n){let i,s;if(t===void 0||n===void 0){const o=e&&lo(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const r=o.getBoundingClientRect(),a=Wi(o),l=ye(a,"border","width"),c=ye(a,"padding");t=r.width-c.width-l.width,n=r.height-c.height-l.height,i=Si(a.maxWidth,o,"clientWidth"),s=Si(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:i||vi,maxHeight:s||vi}}const qn=e=>Math.round(e*10)/10;function Np(e,t,n,i){const s=Wi(e),o=ye(s,"margin"),r=Si(s.maxWidth,e,"clientWidth")||vi,a=Si(s.maxHeight,e,"clientHeight")||vi,l=$p(e,t,n);let{width:c,height:h}=l;if(s.boxSizing==="content-box"){const u=ye(s,"border","width"),f=ye(s,"padding");c-=f.width+u.width,h-=f.height+u.height}return c=Math.max(0,c-o.width),h=Math.max(0,i?c/i:h-o.height),c=qn(Math.min(c,r,l.maxWidth)),h=qn(Math.min(h,a,l.maxHeight)),c&&!h&&(h=qn(c/2)),(t!==void 0||n!==void 0)&&i&&l.height&&h>l.height&&(h=l.height,c=qn(Math.floor(h*i))),{width:c,height:h}}function cr(e,t,n){const i=t||1,s=Math.floor(e.height*i),o=Math.floor(e.width*i);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const r=e.canvas;return r.style&&(n||!r.style.height&&!r.style.width)&&(r.style.height=`${e.height}px`,r.style.width=`${e.width}px`),e.currentDevicePixelRatio!==i||r.height!==s||r.width!==o?(e.currentDevicePixelRatio=i,r.height=s,r.width=o,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Bp=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};ao()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function hr(e,t){const n=Lp(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function fe(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function Wp(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 Hp(e,t,n,i){const s={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},r=fe(e,s,n),a=fe(s,o,n),l=fe(o,t,n),c=fe(r,a,n),h=fe(a,l,n);return fe(c,h,n)}const jp=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}}},Vp=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Le(e,t,n){return e?jp(t,n):Vp()}function Il(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 zl(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function $l(e){return e==="angle"?{between:On,compare:Hf,normalize:Xt}:{between:Re,compare:(t,n)=>t-n,normalize:t=>t}}function dr({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 Up(e,t,n){const{property:i,start:s,end:o}=n,{between:r,normalize:a}=$l(i),l=t.length;let{start:c,end:h,loop:d}=e,u,f;if(d){for(c+=l,h+=l,u=0,f=l;u<f&&r(a(t[c%l][i]),s,o);++u)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:d,style:e.style}}function Yp(e,t,n){if(!n)return[e];const{property:i,start:s,end:o}=n,r=t.length,{compare:a,between:l,normalize:c}=$l(i),{start:h,end:d,loop:u,style:f}=Up(e,t,n),p=[];let g=!1,m=null,b,y,_;const v=()=>l(s,_,b)&&a(s,_)!==0,x=()=>a(o,b)===0||l(o,_,b),k=()=>g||v(),S=()=>!g||x();for(let C=h,O=h;C<=d;++C)y=t[C%r],!y.skip&&(b=c(y[i]),b!==_&&(g=l(b,s,o),m===null&&k()&&(m=a(b,s)===0?C:O),m!==null&&S()&&(p.push(dr({start:m,end:C,loop:u,count:r,style:f})),m=null),O=C,_=b));return m!==null&&p.push(dr({start:m,end:d,loop:u,count:r,style:f})),p}function qp(e,t){const n=[],i=e.segments;for(let s=0;s<i.length;s++){const o=Yp(i[s],e.points,t);o.length&&n.push(...o)}return n}function Xp(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 Gp(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 Kp(e,t){const n=e.points,i=e.options.spanGaps,s=n.length;if(!s)return[];const o=!!e._loop,{start:r,end:a}=Xp(n,s,o,i);if(i===!0)return ur(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 ur(e,Gp(n,r,l,c),n,t)}function ur(e,t,n,i){return!i||!i.setContext||!n?t:Jp(e,t,n,i)}function Jp(e,t,n,i){const s=e._chart.getContext(),o=fr(e.options),{_datasetIndex:r,options:{spanGaps:a}}=e,l=n.length,c=[];let h=o,d=t[0].start,u=d;function f(p,g,m,b){const y=a?-1:1;if(p!==g){for(p+=l;n[p%l].skip;)p-=y;for(;n[g%l].skip;)g+=y;p%l!==g%l&&(c.push({start:p%l,end:g%l,loop:m,style:b}),h=b,d=g%l)}}for(const p of t){d=a?d:p.start;let g=n[d%l],m;for(u=d+1;u<=p.end;u++){const b=n[u%l];m=fr(i.setContext(ke(s,{type:"segment",p0:g,p1:b,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:r}))),Qp(m,h)&&f(d,u-1,p.loop,h),g=b,h=m}d<u-1&&f(d,u-1,p.loop,h)}return c}function fr(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function Qp(e,t){if(!t)return!1;const n=[],i=function(s,o){return Zs(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(e,i)!==JSON.stringify(t,i)}/*!
 * Chart.js v4.4.3
 * https://www.chartjs.org
 * (c) 2024 Chart.js Contributors
 * Released under the MIT License
 */class Zp{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,i,s){const o=n.listeners[s],r=n.duration;o.forEach(a=>a({chart:t,initial:n.initial,numSteps:r,currentStep:Math.min(i-n.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=Ol.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const o=i.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),o.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const i=n.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Bt=new Zp;const pr="transparent",tg={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=ir(e||pr),s=i.valid&&ir(t||pr);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class eg{constructor(t,n,i,s){const o=n[i];s=Un([t.to,s,o,t.from]);const r=Un([t.from,o,s]);this._active=!0,this._fn=t.fn||tg[t.type||typeof r],this._easing=un[t.easing]||un.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=i,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);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=Un([t.to,n,s,t.from]),this._from=Un([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 Nl{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!B(t))return;const n=Object.keys(Z.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];(it(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,r)})})}_animateOptions(t,n){const i=n.options,s=ig(t,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&ng(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 u=i.get(c);if(d)if(u&&d.active()){d.update(u,h,a);continue}else d.cancel();if(!u||!u.duration){t[c]=h;continue}o[c]=d=new eg(u,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 Bt.add(this._chart,i),!0}}function ng(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 ig(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 gr(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 sg(e,t,n){if(n===!1)return!1;const i=gr(e,n),s=gr(t,n);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function og(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 Bl(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 mr(e,t,n,i={}){const s=e.keys,o=i.mode==="single";let r,a,l,c;if(t!==null){for(r=0,a=s.length;r<a;++r){if(l=+s[r],l===n){if(i.all)continue;break}c=e.values[l],yt(c)&&(o||t===0||ze(t)===ze(c))&&(t+=c)}return t}}function rg(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 br(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function ag(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function lg(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 cg(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,h=ag(o,r,i),d=t.length;let u;for(let f=0;f<d;++f){const p=t[f],{[l]:g,[c]:m}=p,b=p._stacks||(p._stacks={});u=b[c]=cg(s,h,g),u[a]=m,u._top=yr(u,r,!0,i.type),u._bottom=yr(u,r,!1,i.type);const y=u._visualValues||(u._visualValues={});y[a]=m}}function rs(e,t){const n=e.scales;return Object.keys(n).filter(i=>n[i].axis===t).shift()}function hg(e,t){return ke(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function dg(e,t,n){return ke(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Je(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const s of t){const o=s._stacks;if(!o||o[i]===void 0||o[i][n]===void 0)return;delete o[i][n],o[i]._visualValues!==void 0&&o[i]._visualValues[n]!==void 0&&delete o[i]._visualValues[n]}}}const as=e=>e==="reset"||e==="none",_r=(e,t)=>t?e:Object.assign({},e),ug=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Bl(n,!0),values:null};class Fe{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=br(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&&Je(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(d,u,f,p)=>d==="x"?u:d==="r"?p:f,o=n.xAxisID=I(i.xAxisID,rs(t,"x")),r=n.yAxisID=I(i.yAxisID,rs(t,"y")),a=n.rAxisID=I(i.rAxisID,rs(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&&tr(this._data,this),t._stacked&&Je(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(B(n)){const s=this._cachedMeta;this._data=rg(n,s)}else if(i!==n){if(i){tr(i,this);const s=this._cachedMeta;Je(s),s._parsed=[]}n&&Object.isExtensible(n)&&Yf(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const o=n._stacked;n._stacked=br(n.vScale,n),n.stack!==i.stack&&(s=!0,Je(n),n.stack=i.stack),this._resyncElements(t),(s||o!==n._stacked)&&xr(this,n._parsed)}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,u;if(this._parsing===!1)i._parsed=s,i._sorted=!0,u=s;else{it(s[t])?u=this.parseArrayData(i,s,t,n):B(s[t])?u=this.parseObjectData(i,s,t,n):u=this.parsePrimitiveData(i,s,t,n);const f=()=>d[a]===null||c&&d[a]<c[a];for(h=0;h<n;++h)i._parsed[h+t]=d=u[h],l&&(f()&&(l=!1),c=d);i._sorted=l}r&&xr(this,u)}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 u,f,p;for(u=0,f=s;u<f;++u)p=u+i,d[u]={[a]:h||o.parse(c[p],p),[l]:r.parse(n[p],p)};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,u,f;for(h=0,d=s;h<d;++h)u=h+i,f=n[u],c[h]={x:o.parse(kn(f,a),u),y:r.parse(kn(f,l),u)};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:Bl(s,!0),values:n._stacks[t.axis]._visualValues};return mr(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=mr(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=ug(n,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=lg(a);let u,f;function p(){f=s[u];const g=f[a.axis];return!yt(f[t.axis])||h>g||d<g}for(u=0;u<r&&!(!p()&&(this.updateRangeFromParsed(c,t,f,l),o));++u);if(o){for(u=r-1;u>=0;--u)if(!p()){this.updateRangeFromParsed(c,t,f,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],yt(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=og(I(this.options.clip,sg(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=dg(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=hg(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&&wi(i);if(a)return _r(a,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],u=c.getOptionScopes(this.getDataset(),h),f=Object.keys(Z.elements[t]),p=()=>this.getContext(i,s,n),g=c.resolveNamedOptions(u,f,p,d);return g.$shared&&(g.$shared=l,o[r]=Object.freeze(_r(g,l))),g}_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),u=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(u,this.getContext(t,i,n))}const c=new Nl(s,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||as(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),s=this._sharedOptions,o=this.getSharedOptions(i),r=this.includeOptions(n,o)||o!==s;return this.updateSharedOptions(o,n,i),{sharedOptions:o,includeOptions:r}}updateElement(t,n,i,s){as(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!as(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,s){t.active=s;const o=this.getStyle(n,s);this._resolveAnimations(n,i,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,o=n.length,r=Math.min(o,s);r&&this.parse(0,r),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,n,i=!0){const s=this._cachedMeta,o=s.data,r=t+n;let a;const l=c=>{for(c.length+=n,a=c.length-1;a>=r;a--)c[a]=c[a-n]};for(l(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,n),i&&this.updateElements(o,t,n,"reset")}updateElements(t,n,i,s){}_removeElements(t,n){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,n);i._stacked&&Je(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])}}T(Fe,"defaults",{}),T(Fe,"datasetElementType",null),T(Fe,"dataElementType",null);function fg(e,t,n){let i=1,s=1,o=0,r=0;if(t<J){const a=e,l=a+t,c=Math.cos(a),h=Math.sin(a),d=Math.cos(l),u=Math.sin(l),f=(_,v,x)=>On(_,a,l,!0)?1:Math.max(v,v*n,x,x*n),p=(_,v,x)=>On(_,a,l,!0)?-1:Math.min(v,v*n,x,x*n),g=f(0,c,d),m=f(et,h,u),b=p(Q,c,d),y=p(Q+et,h,u);i=(g-b)/2,s=(m-y)/2,o=-(g+b)/2,r=-(m+y)/2}return{ratioX:i,ratioY:s,offsetX:o,offsetY:r}}class an extends Fe{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let o=l=>+i[l];if(B(i[t])){const{key:l="value"}=this._parsing;o=c=>+kn(i[c],l)}let r,a;for(r=t,a=t+n;r<a;++r)s._parsed[r]=o(r)}}_getRotation(){return jt(this.options.rotation-90)}_getCircumference(){return jt(this.options.circumference)}_getRotationExtents(){let t=J,n=-J;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,o=s._getRotation(),r=s._getCircumference();t=Math.min(t,o),n=Math.max(n,o+r)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:i}=n,s=this._cachedMeta,o=s.data,r=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-r)/2,0),l=Math.min(Af(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:h,rotation:d}=this._getRotationExtents(),{ratioX:u,ratioY:f,offsetX:p,offsetY:g}=fg(d,h,l),m=(i.width-r)/u,b=(i.height-r)/f,y=Math.max(Math.min(m,b)/2,0),_=vl(this.options.radius,y),v=Math.max(_*l,0),x=(_-v)/this._getVisibleDatasetWeightTotal();this.offsetX=p*_,this.offsetY=g*_,s.total=this.calculateTotal(),this.outerRadius=_-x*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-x*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,n){const i=this.options,s=this._cachedMeta,o=this._getCircumference();return n&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/J)}updateElements(t,n,i,s){const o=s==="reset",r=this.chart,a=r.chartArea,c=r.options.animation,h=(a.left+a.right)/2,d=(a.top+a.bottom)/2,u=o&&c.animateScale,f=u?0:this.innerRadius,p=u?0:this.outerRadius,{sharedOptions:g,includeOptions:m}=this._getSharedOptions(n,s);let b=this._getRotation(),y;for(y=0;y<n;++y)b+=this._circumference(y,o);for(y=n;y<n+i;++y){const _=this._circumference(y,o),v=t[y],x={x:h+this.offsetX,y:d+this.offsetY,startAngle:b,endAngle:b+_,circumference:_,outerRadius:p,innerRadius:f};m&&(x.options=g||this.resolveDataElementOptions(y,v.active?"active":s)),b+=_,this.updateElement(v,y,x,s)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let i=0,s;for(s=0;s<n.length;s++){const o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!n[s].hidden&&(i+=Math.abs(o))}return i}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?J*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=to(n._parsed[t],i.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let n=0;const i=this.chart;let s,o,r,a,l;if(!t){for(s=0,o=i.data.datasets.length;s<o;++s)if(i.isDatasetVisible(s)){r=i.getDatasetMeta(s),t=r.data,a=r.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let i=0,s=t.length;i<s;++i){const o=this.resolveDataElementOptions(i);n=Math.max(n,o.offset||0,o.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(n+=this._getRingWeight(i));return n}_getRingWeight(t){return Math.max(I(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}T(an,"id","doughnut"),T(an,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),T(an,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),T(an,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return n.labels.map((o,r)=>{const l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}});class ci extends Fe{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=n,r=this.chart._animationsDisabled;let{start:a,count:l}=Kf(n,s,r);this._drawStart=a,this._drawCount=l,Jf(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),u=r.axis,f=a.axis,{spanGaps:p,segment:g}=this.options,m=Cn(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||s==="none",y=n+i,_=t.length;let v=n>0&&this.getParsed(n-1);for(let x=0;x<_;++x){const k=t[x],S=b?k:{};if(x<n||x>=y){S.skip=!0;continue}const C=this.getParsed(x),O=K(C[f]),P=S[u]=r.getPixelForValue(C[u],x),A=S[f]=o||O?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,C,l):C[f],x);S.skip=isNaN(P)||isNaN(A)||O,S.stop=x>0&&Math.abs(C[u]-v[u])>m,g&&(S.parsed=C,S.raw=c.data[x]),d&&(S.options=h||this.resolveDataElementOptions(x,k.active?"active":s)),b||this.updateElement(k,x,S,s),v=C}}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()}}T(ci,"id","line"),T(ci,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),T(ci,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class As extends an{}T(As,"id","pie"),T(As,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});function ce(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class co{constructor(t){T(this,"options");this.options=t||{}}static override(t){Object.assign(co.prototype,t)}init(){}formats(){return ce()}parse(){return ce()}format(){return ce()}add(){return ce()}diff(){return ce()}startOf(){return ce()}endOf(){return ce()}}var pg={_date:co};function gg(e,t,n,i){const{controller:s,data:o,_sorted:r}=e,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const l=a._reversePixels?Vf:ge;if(i){if(s._sharedOptions){const c=o[0],h=typeof c.getRange=="function"&&c.getRange(t);if(h){const d=l(o,t,n-h),u=l(o,t,n+h);return{lo:d.lo,hi:u.hi}}}}else return l(o,t,n)}return{lo:0,hi:o.length-1}}function $n(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:u}=gg(o[a],t,r,s);for(let f=d;f<=u;++f){const p=h[f];p.skip||i(p,c,f)}}}function mg(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(i,s){const o=t?Math.abs(i.x-s.x):0,r=n?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function ls(e,t,n,i,s){const o=[];return!s&&!e.isPointInArea(t)||$n(e,n,t,function(a,l,c){!s&&!Mn(a,e.chartArea,0)||a.inRange(t.x,t.y,i)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function bg(e,t,n,i){let s=[];function o(r,a,l){const{startAngle:c,endAngle:h}=r.getProps(["startAngle","endAngle"],i),{angle:d}=kl(r,{x:t.x,y:t.y});On(d,c,h)&&s.push({element:r,datasetIndex:a,index:l})}return $n(e,n,t,o),s}function yg(e,t,n,i,s,o){let r=[];const a=mg(n);let l=Number.POSITIVE_INFINITY;function c(h,d,u){const f=h.inRange(t.x,t.y,s);if(i&&!f)return;const p=h.getCenterPoint(s);if(!(!!o||e.isPointInArea(p))&&!f)return;const m=a(t,p);m<l?(r=[{element:h,datasetIndex:d,index:u}],l=m):m===l&&r.push({element:h,datasetIndex:d,index:u})}return $n(e,n,t,c),r}function cs(e,t,n,i,s,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!i?bg(e,t,n,s):yg(e,t,n,i,s,o)}function wr(e,t,n,i,s){const o=[],r=n==="x"?"inXRange":"inYRange";let a=!1;return $n(e,n,t,(l,c,h)=>{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 xg={evaluateInteractionItems:$n,modes:{index(e,t,n,i){const s=ue(t,e),o=n.axis||"x",r=n.includeInvisible||!1,a=n.intersect?ls(e,s,o,i,r):cs(e,s,o,!1,i,r),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const 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=ue(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;let a=n.intersect?ls(e,s,o,i,r):cs(e,s,o,!1,i,r);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let h=0;h<c.length;++h)a.push({element:c[h],datasetIndex:l,index:h})}return a},point(e,t,n,i){const s=ue(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;return ls(e,s,o,i,r)},nearest(e,t,n,i){const s=ue(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;return cs(e,s,o,n.intersect,i,r)},x(e,t,n,i){const s=ue(t,e);return wr(e,s,"x",n.intersect,i)},y(e,t,n,i){const s=ue(t,e);return wr(e,s,"y",n.intersect,i)}}};const Wl=["left","top","right","bottom"];function Qe(e,t){return e.filter(n=>n.pos===t)}function vr(e,t){return e.filter(n=>Wl.indexOf(n.pos)===-1&&n.box.axis===t)}function Ze(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 _g(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 wg(e){const t={};for(const n of e){const{stack:i,pos:s,stackWeight:o}=n;if(!i||!Wl.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 vg(e,t){const n=wg(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 Sg(e){const t=_g(e),n=Ze(t.filter(c=>c.box.fullSize),!0),i=Ze(Qe(t,"left"),!0),s=Ze(Qe(t,"right")),o=Ze(Qe(t,"top"),!0),r=Ze(Qe(t,"bottom")),a=vr(t,"x"),l=vr(t,"y");return{fullSize:n,leftAndTop:i.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:Qe(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 Hl(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 kg(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&&Hl(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,h=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:h}:{same:h,other:c}}function Cg(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 Og(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 ln(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,Og(a.horizontal,t));const{same:d,other:u}=kg(t,n,a,i);c|=d&&s.length,h=h||u,l.fullSize||s.push(a)}return c&&ln(s,t,n,i)||h}function Xn(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]||{count:1,placed:0,weight:1},h=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*h,u=c.size||l.height;wi(c.start)&&(r=c.start),l.fullSize?Xn(l,s.left,r,n.outerWidth-s.right-s.left,u):Xn(l,t.left+c.placed,r,d,u),c.start=r,c.placed+=d,r=l.bottom}else{const d=t.h*h,u=c.size||l.width;wi(c.start)&&(o=c.start),l.fullSize?Xn(l,o,s.top,u,n.outerHeight-s.bottom-s.top):Xn(l,o,t.top+c.placed,u,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=r}var gt={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=xt(e.options.layout.padding),o=Math.max(t-s.width,0),r=Math.max(n-s.height,0),a=Sg(e.boxes),l=a.vertical,c=a.horizontal;H(e.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const h=l.reduce((g,m)=>m.box.options&&m.box.options.display===!1?g:g+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},s);Hl(u,xt(i));const f=Object.assign({maxPadding:u,w:o,h:r,x:s.left,y:s.top},s),p=vg(l.concat(c),d);ln(a.fullSize,f,d,p),ln(l,f,d,p),ln(c,f,d,p)&&ln(l,f,d,p),Cg(f),kr(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,kr(a.rightAndBottom,f,d,p),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},H(a.chartArea,g=>{const m=g.box;Object.assign(m,e.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class jl{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 Mg extends jl{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const hi="$chartjs",Tg={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Cr=e=>e===null||e==="";function Pg(e,t){const n=e.style,i=e.getAttribute("height"),s=e.getAttribute("width");if(e[hi]={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",Cr(s)){const o=hr(e,"width");o!==void 0&&(e.width=o)}if(Cr(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 Vl=Bp?{passive:!0}:!1;function Ag(e,t,n){e&&e.addEventListener(t,n,Vl)}function Dg(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,Vl)}function Eg(e,t){const n=Tg[e.type]||e.type,{x:i,y:s}=ue(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:s!==void 0?s:null}}function ki(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function Rg(e,t,n){const i=e.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||ki(a.addedNodes,i),r=r&&!ki(a.removedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function Lg(e,t,n){const i=e.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||ki(a.removedNodes,i),r=r&&!ki(a.addedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const Pn=new Map;let Or=0;function Ul(){const e=window.devicePixelRatio;e!==Or&&(Or=e,Pn.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function Fg(e,t){Pn.size||window.addEventListener("resize",Ul),Pn.set(e,t)}function Ig(e){Pn.delete(e),Pn.size||window.removeEventListener("resize",Ul)}function zg(e,t,n){const i=e.canvas,s=i&&lo(i);if(!s)return;const o=Ml((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),Fg(e,o),r}function hs(e,t,n){n&&n.disconnect(),t==="resize"&&Ig(e)}function $g(e,t,n){const i=e.canvas,s=Ml(o=>{e.ctx!==null&&n(Eg(o,e))},e);return Ag(i,t,s),s}class Ng extends jl{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Pg(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[hi])return!1;const i=n[hi].initial;["height","width"].forEach(o=>{const r=i[o];K(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[hi],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),r={attach:Rg,detach:Lg,resize:zg}[n]||$g;s[n]=r(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:hs,detach:hs,resize:hs}[n]||Dg)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return Np(t,n,i,s)}isAttached(t){const n=t&&lo(t);return!!(n&&n.isConnected)}}function Bg(e){return!ao()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Mg:Ng}class It{constructor(){T(this,"x");T(this,"y");T(this,"active",!1);T(this,"options");T(this,"$animations")}tooltipPosition(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return Cn(this.x)&&Cn(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}}T(It,"defaults",{}),T(It,"defaultRoutes");function Wg(e,t){const n=e.options.ticks,i=Hg(e),s=Math.min(n.maxTicksLimit||i,i),o=n.major.enabled?Vg(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return Ug(t,c,o,r/s),c;const h=jg(o,t,s);if(r>0){let d,u;const f=r>1?Math.round((l-a)/(r-1)):null;for(Gn(t,c,h,K(f)?0:a-f,a),d=0,u=r-1;d<u;d++)Gn(t,c,h,o[d],o[d+1]);return Gn(t,c,h,l,K(f)?t.length:l+f),c}return Gn(t,c,h),c}function Hg(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 jg(e,t,n){const i=Yg(e),s=t.length/n;if(!i)return Math.max(s,1);const o=$f(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 Vg(e){const t=[];let n,i;for(n=0,i=e.length;n<i;n++)e[n].major&&t.push(n);return t}function Ug(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 Gn(e,t,n,i,s){const o=I(i,0),r=Math.min(I(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 Yg(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 qg=e=>e==="left"?"right":e==="right"?"left":e,Mr=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Tr=(e,t)=>Math.min(t||e,e);function Pr(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 Xg(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 Gg(e,t){H(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 tn(e){return e.drawTicks?e.tickLength:0}function Ar(e,t){if(!e.display)return 0;const n=lt(e.font,t),i=xt(e.padding);return(it(e.text)?e.text.length:1)*n.lineHeight+i.height}function Kg(e,t){return ke(e,{scale:t,type:"scale"})}function Jg(e,t,n){return ke(e,{tick:n,index:t,type:"tick"})}function Qg(e,t,n){let i=Qs(e);return(n&&t!=="right"||!n&&t==="right")&&(i=qg(i)),i}function Zg(e,t,n,i){const{top:s,left:o,bottom:r,right:a,chart:l}=e,{chartArea:c,scales:h}=l;let d=0,u,f,p;const g=r-s,m=a-o;if(e.isHorizontal()){if(f=rt(i,o,a),B(n)){const b=Object.keys(n)[0],y=n[b];p=h[b].getPixelForValue(y)+g-t}else n==="center"?p=(c.bottom+c.top)/2+g-t:p=Mr(e,n,t);u=a-o}else{if(B(n)){const b=Object.keys(n)[0],y=n[b];f=h[b].getPixelForValue(y)-m+t}else n==="center"?f=(c.left+c.right)/2-m+t:f=Mr(e,n,t);p=rt(i,r,s),d=n==="left"?-et:et}return{titleX:f,titleY:p,maxWidth:u,rotation:d}}class Ve extends It{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:i,_suggestedMax:s}=this;return t=At(t,Number.POSITIVE_INFINITY),n=At(n,Number.NEGATIVE_INFINITY),i=At(i,Number.POSITIVE_INFINITY),s=At(s,Number.NEGATIVE_INFINITY),{min:At(t,i),max:At(n,s),minDefined:yt(t),maxDefined:yt(n)}}getMinMax(t){let{min:n,max:i,minDefined:s,maxDefined:o}=this.getUserBounds(),r;if(s&&o)return{min:n,max:i};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,t),s||(n=Math.min(n,r.min)),o||(i=Math.max(i,r.max));return n=o&&n>i?i:n,i=s&&n>i?n:i,{min:At(n,At(i,n)),max:At(i,At(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){q(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=bp(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Pr(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=Wg(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(){q(this.options.afterUpdate,[this])}beforeSetDimensions(){q(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(){q(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),q(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){q(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=q(n.callback,[o.value,i,t],this)}afterTickToLabelConversion(){q(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){q(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,i=Tr(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,u=h.highest.height,f=ht(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:f/(i-1),d+6>a&&(a=f/(i-(t.offset?.5:1)),l=this.maxHeight-tn(t.grid)-n.padding-Ar(t.title,this.chart.options.font),c=Math.sqrt(d*d+u*u),r=Wf(Math.min(Math.asin(ht((h.highest.height+6)/a,-1,1)),Math.asin(ht(l/c,-1,1))-Math.asin(ht(u/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){q(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){q(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=Ar(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=tn(o)+l):(t.height=this.maxHeight,t.width=tn(o)+l),i.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:u}=this._getLabelSizes(),f=i.padding*2,p=jt(this.labelRotation),g=Math.cos(p),m=Math.sin(p);if(a){const b=i.mirror?0:m*d.width+g*u.height;t.height=Math.min(this.maxHeight,t.height+b+f)}else{const b=i.mirror?0:g*d.width+m*u.height;t.width=Math.min(this.maxWidth,t.width+b+f)}this._calculatePadding(c,h,m,g)}}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 u=0,f=0;l?c?(u=s*t.width,f=i*n.height):(u=i*t.height,f=s*n.width):o==="start"?f=n.width:o==="end"?u=t.width:o!=="inner"&&(u=t.width/2,f=n.width/2),this.paddingLeft=Math.max((u-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-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(){q(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++)K(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=Pr(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/Tr(n,i));let c=0,h=0,d,u,f,p,g,m,b,y,_,v,x;for(d=0;d<n;d+=l){if(p=t[d].label,g=this._resolveTickFontOptions(d),s.font=m=g.string,b=o[m]=o[m]||{data:{},gc:[]},y=g.lineHeight,_=v=0,!K(p)&&!it(p))_=or(s,b.data,b.gc,_,p),v=y;else if(it(p))for(u=0,f=p.length;u<f;++u)x=p[u],!K(x)&&!it(x)&&(_=or(s,b.data,b.gc,_,x),v+=y);r.push(_),a.push(v),c=Math.max(_,c),h=Math.max(v,h)}Gg(o,n);const k=r.indexOf(c),S=a.indexOf(h),C=O=>({width:r[O]||0,height:a[O]||0});return{first:C(0),last:C(n-1),widest:C(k),highest:C(S),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return jf(this._alignToPixels?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=Jg(this.getContext(),t,i))}return this.$context||(this.$context=Kg(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=jt(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),u=tn(o),f=[],p=a.setContext(this.getContext()),g=p.display?p.width:0,m=g/2,b=function(R){return le(i,R,g)};let y,_,v,x,k,S,C,O,P,A,M,U;if(r==="top")y=b(this.bottom),S=this.bottom-u,O=y-m,A=b(t.top)+m,U=t.bottom;else if(r==="bottom")y=b(this.top),A=t.top,U=b(t.bottom)-m,S=y+m,O=this.top+u;else if(r==="left")y=b(this.right),k=this.right-u,C=y-m,P=b(t.left)+m,M=t.right;else if(r==="right")y=b(this.left),P=t.left,M=b(t.right)-m,k=y+m,C=this.left+u;else if(n==="x"){if(r==="center")y=b((t.top+t.bottom)/2+.5);else if(B(r)){const R=Object.keys(r)[0],z=r[R];y=b(this.chart.scales[R].getPixelForValue(z))}A=t.top,U=t.bottom,S=y+m,O=S+u}else if(n==="y"){if(r==="center")y=b((t.left+t.right)/2);else if(B(r)){const R=Object.keys(r)[0],z=r[R];y=b(this.chart.scales[R].getPixelForValue(z))}k=y-m,C=k-u,P=t.left,M=t.right}const N=I(s.ticks.maxTicksLimit,d),D=Math.max(1,Math.ceil(d/N));for(_=0;_<d;_+=D){const R=this.getContext(_),z=o.setContext(R),st=a.setContext(R),G=z.lineWidth,$t=z.color,Pt=st.dash||[],_t=st.dashOffset,Ye=z.tickWidth,oe=z.tickColor,qe=z.tickBorderDash||[],re=z.tickBorderDashOffset;v=Xg(this,_,l),v!==void 0&&(x=le(i,v,G),c?k=C=P=M=x:S=O=A=U=x,f.push({tx1:k,ty1:S,tx2:C,ty2:O,x1:P,y1:A,x2:M,y2:U,width:G,color:$t,borderDash:Pt,borderDashOffset:_t,tickWidth:Ye,tickColor:oe,tickBorderDash:qe,tickBorderDashOffset:re}))}return this._ticksLength=d,this._borderValue=y,f}_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,u=tn(i.grid),f=u+h,p=d?-h:f,g=-jt(this.labelRotation),m=[];let b,y,_,v,x,k,S,C,O,P,A,M,U="middle";if(s==="top")k=this.bottom-p,S=this._getXAxisLabelAlignment();else if(s==="bottom")k=this.top+p,S=this._getXAxisLabelAlignment();else if(s==="left"){const D=this._getYAxisLabelAlignment(u);S=D.textAlign,x=D.x}else if(s==="right"){const D=this._getYAxisLabelAlignment(u);S=D.textAlign,x=D.x}else if(n==="x"){if(s==="center")k=(t.top+t.bottom)/2+f;else if(B(s)){const D=Object.keys(s)[0],R=s[D];k=this.chart.scales[D].getPixelForValue(R)+f}S=this._getXAxisLabelAlignment()}else if(n==="y"){if(s==="center")x=(t.left+t.right)/2-f;else if(B(s)){const D=Object.keys(s)[0],R=s[D];x=this.chart.scales[D].getPixelForValue(R)}S=this._getYAxisLabelAlignment(u).textAlign}n==="y"&&(l==="start"?U="top":l==="end"&&(U="bottom"));const N=this._getLabelSizes();for(b=0,y=a.length;b<y;++b){_=a[b],v=_.label;const D=o.setContext(this.getContext(b));C=this.getPixelForTick(b)+o.labelOffset,O=this._resolveTickFontOptions(b),P=O.lineHeight,A=it(v)?v.length:1;const R=A/2,z=D.color,st=D.textStrokeColor,G=D.textStrokeWidth;let $t=S;r?(x=C,S==="inner"&&(b===y-1?$t=this.options.reverse?"left":"right":b===0?$t=this.options.reverse?"right":"left":$t="center"),s==="top"?c==="near"||g!==0?M=-A*P+P/2:c==="center"?M=-N.highest.height/2-R*P+P:M=-N.highest.height+P/2:c==="near"||g!==0?M=P/2:c==="center"?M=N.highest.height/2-R*P:M=N.highest.height-A*P,d&&(M*=-1),g!==0&&!D.showLabelBackdrop&&(x+=P/2*Math.sin(g))):(k=C,M=(1-A)*P/2);let Pt;if(D.showLabelBackdrop){const _t=xt(D.backdropPadding),Ye=N.heights[b],oe=N.widths[b];let qe=M-_t.top,re=0-_t.left;switch(U){case"middle":qe-=Ye/2;break;case"bottom":qe-=Ye;break}switch(S){case"center":re-=oe/2;break;case"right":re-=oe;break;case"inner":b===y-1?re-=oe:b>0&&(re-=oe/2);break}Pt={left:re,top:qe,width:oe+_t.width,height:Ye+_t.height,color:D.backdropColor}}m.push({label:v,font:O,textOffset:M,options:{rotation:g,color:z,strokeColor:st,strokeWidth:G,textAlign:$t,textBaseline:U,translation:[x,k],backdrop:Pt}})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-jt(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,u;this.isHorizontal()?(c=le(t,this.left,r)-r/2,h=le(t,this.right,a)+a/2,d=u=l):(d=le(t,this.top,r)-r/2,u=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,u),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&eo(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;Tn(i,c,0,h,l,a)}s&&no(i)}drawTitle(){const{ctx:t,options:{position:n,title:i,reverse:s}}=this;if(!i.display)return;const o=lt(i.font),r=xt(i.padding),a=i.align;let l=o.lineHeight/2;n==="bottom"||n==="center"||B(n)?(l+=r.bottom,it(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=r.top;const{titleX:c,titleY:h,maxWidth:d,rotation:u}=Zg(this,l,n,a);Tn(t,i.text,0,0,o,{color:i.color,maxWidth:d,rotation:u,textAlign:Qg(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=I(t.grid&&t.grid.z,-1),s=I(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Ve.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 Kn{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;nm(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,tm(t,r,i),this.override&&Z.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 Z[s]&&(delete Z[s][i],this.override&&delete ve[i])}}function tm(e,t,n){const i=Sn(Object.create(null),[n?Z.get(n):{},Z.get(t),e.defaults]);Z.set(t,i),e.defaultRoutes&&em(t,e.defaultRoutes),e.descriptors&&Z.describe(t,e.descriptors)}function em(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(".");Z.route(o,s,l,a)})}function nm(e){return"id"in e&&"defaults"in e}class im{constructor(){this.controllers=new Kn(Fe,"datasets",!0),this.elements=new Kn(It,"elements"),this.plugins=new Kn(Object,"plugins"),this.scales=new Kn(Ve,"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):H(s,r=>{const a=i||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,n,i){const s=Ks(t);q(i["before"+s],[],i),n[t](i),q(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 Et=new im;class sm{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(q(a,l,r)===!1&&s.cancelable)return!1}return!0}invalidate(){K(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=I(i.options&&i.options.plugins,{}),o=om(i);return s===!1&&!n?[]:am(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 om(e){const t={},n=[],i=Object.keys(Et.plugins.items);for(let o=0;o<i.length;o++)n.push(Et.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 rm(e,t){return!t&&e===!1?null:e===!0?{}:e}function am(e,{plugins:t,localIds:n},i,s){const o=[],r=e.getContext();for(const a of t){const l=a.id,c=rm(i[l],s);c!==null&&o.push({plugin:a,options:lm(e.config,{plugin:a,local:n[l]},c,r)})}return o}function lm(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 Ds(e,t){const n=Z.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function cm(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function hm(e,t){return e===t?"_index_":"_value_"}function Dr(e){if(e==="x"||e==="y"||e==="r")return e}function dm(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Es(e,...t){if(Dr(e))return e;for(const n of t){const i=n.axis||dm(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 Er(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function um(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 Er(e,"x",n[0])||Er(e,"y",n[0])}return{}}function fm(e,t){const n=ve[e.type]||{scales:{}},i=t.scales||{},s=Ds(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=Es(r,a,um(r,e),Z.scales[a.type]),c=hm(l,s),h=n.scales||{};o[r]=hn(Object.create(null),[{axis:l},a,h[l],h[c]])}),e.data.datasets.forEach(r=>{const a=r.type||e.type,l=r.indexAxis||Ds(a,t),h=(ve[a]||{}).scales||{};Object.keys(h).forEach(d=>{const u=cm(d,l),f=r[u+"AxisID"]||u;o[f]=o[f]||Object.create(null),hn(o[f],[{axis:u},i[f],h[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];hn(a,[Z.scales[a.type],Z.scale])}),o}function Yl(e){const t=e.options||(e.options={});t.plugins=I(t.plugins,{}),t.scales=fm(e,t)}function ql(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function pm(e){return e=e||{},e.data=ql(e.data),Yl(e),e}const Rr=new Map,Xl=new Set;function Jn(e,t){let n=Rr.get(e);return n||(n=t(),Rr.set(e,n),Xl.add(n)),n}const en=(e,t,n)=>{const i=kn(t,n);i!==void 0&&e.add(i)};class gm{constructor(t){this._config=pm(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=ql(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(),Yl(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Jn(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Jn(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Jn(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return Jn(`${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=>en(l,t,d))),h.forEach(d=>en(l,s,d)),h.forEach(d=>en(l,ve[o]||{},d)),h.forEach(d=>en(l,Z,d)),h.forEach(d=>en(l,Ms,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Xl.has(n)&&r.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,ve[n]||{},Z.datasets[n]||{},{type:n},Z,Ms]}resolveNamedOptions(t,n,i,s=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=Lr(this._resolverCache,t,s);let l=r;if(bm(r,n)){o.$shared=!1,i=ne(i)?i():i;const c=this.createResolver(t,i,a);l=$e(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)?$e(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:so(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,o)),o}const mm=e=>B(e)&&Object.getOwnPropertyNames(e).some(t=>ne(e[t]));function bm(e,t){const{isScriptable:n,isIndexable:i}=Dl(e);for(const s of t){const o=n(s),r=i(s),a=(r||o)&&e[s];if(o&&(ne(a)||mm(a))||r&&it(a))return!0}return!1}var ym="4.4.3";const xm=["top","bottom","left","right","chartArea"];function Fr(e,t){return e==="top"||e==="bottom"||xm.indexOf(e)===-1&&t==="x"}function Ir(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"),q(n&&n.onComplete,[e],t)}function _m(e){const t=e.chart,n=t.options.animation;q(n&&n.onProgress,[e],t)}function Gl(e){return ao()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const di={},$r=e=>{const t=Gl(e);return Object.values(di).filter(n=>n.canvas===t).pop()};function wm(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 vm(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}function Qn(e,t,n){return e.options.clip?e[n]:t[n]}function Sm(e,t){const{xScale:n,yScale:i}=e;return n&&i?{left:Qn(n,t,"left"),right:Qn(n,t,"right"),top:Qn(i,t,"top"),bottom:Qn(i,t,"bottom")}:t}var qt;let ho=(qt=class{static register(...t){Et.add(...t),Nr()}static unregister(...t){Et.remove(...t),Nr()}constructor(t,n){const i=this.config=new gm(n),s=Gl(t),o=$r(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||Bg(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=Pf(),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 sm,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Xf(d=>this.update(d),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}Bt.listen(this,"complete",zr),Bt.listen(this,"progress",_m),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:s,_aspectRatio:o}=this;return K(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 Et}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():cr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return rr(this.canvas,this.ctx),this}stop(){return Bt.stop(this),this}resize(t,n){Bt.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,s=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,t,n,o),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,cr(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),q(i.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};H(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=Es(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),H(o,r=>{const a=r.options,l=a.id,c=Es(l,a),h=I(a.type,r.dtype);(a.position===void 0||Fr(a.position,c)!==Fr(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 u=Et.getScale(h);d=new u({id:l,type:h,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),H(s,(r,a)=>{r||delete i[a]}),H(i,r=>{gt.configure(this,r,r.options),gt.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(Ir("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||Ds(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=Et.getController(a),{datasetElementType:c,dataElementType:h}=Z.datasets[a];Object.assign(l,{dataElementType:Et.getElement(h),datasetElementType:c&&Et.getElement(c)}),r.controller=new l(this,i),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){H(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),u=!s&&o.indexOf(d)===-1;d.buildOrUpdateElements(u),r=Math.max(+d.getMaxOverflow(),r)}r=this._minPadding=i.layout.autoPadding?r:0,this._updateLayout(r),s||H(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Ir("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){H(this.scales,t=>{gt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Ko(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;wm(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(!Ko(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;gt.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],H(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n<i;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,i=this.data.datasets.length;n<i;++n)this._updateDataset(n,ne(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){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&&(Bt.has(this)?this.attached&&!Bt.running(this)&&Bt.start(this):(this.draw(),zr({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resize(i,s),this._resizeBeforeDraw=null}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=t._clip,s=!i.disabled,o=Sm(t,this.chartArea),r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(s&&eo(n,{left:i.left===!1?0:o.left-i.left,right:i.right===!1?this.width:o.right+i.right,top:i.top===!1?0:o.top-i.top,bottom:i.bottom===!1?this.height:o.bottom+i.bottom}),t.controller.draw(),s&&no(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return Mn(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){const o=xg.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=ke(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);wi(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(),Bt.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(),rr(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)};H(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(){H(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},H(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}});!xi(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=Ff(t),c=vm(t,this._lastEvent,i,l);i&&(this._lastEvent=null,q(o.onHover,[t,a,this],this),l&&q(o.onClick,[t,a,this],this));const h=!xi(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)}},T(qt,"defaults",Z),T(qt,"instances",di),T(qt,"overrides",ve),T(qt,"registry",Et),T(qt,"version",ym),T(qt,"getChart",$r),qt);function Nr(){return H(ho.instances,e=>e._plugins.invalidate())}function km(e,t,n){const{startAngle:i,pixelMargin:s,x:o,y:r,outerRadius:a,innerRadius:l}=t;let c=s/a;e.beginPath(),e.arc(o,r,a,i-c,n+c),l>s?(c=s/l,e.arc(o,r,l,n+c,i-c,!0)):e.arc(o,r,s,n+et,i-et),e.closePath(),e.clip()}function Cm(e){return io(e,["outerStart","outerEnd","innerStart","innerEnd"])}function Om(e,t,n,i){const s=Cm(e.options.borderRadius),o=(n-t)/2,r=Math.min(o,i*t/2),a=l=>{const c=(n-Math.min(o,l))*i/2;return ht(l,0,Math.min(o,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:ht(s.innerStart,0,r),innerEnd:ht(s.innerEnd,0,r)}}function De(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function Ci(e,t,n,i,s,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,d=Math.max(t.outerRadius+i+n-c,0),u=h>0?h+i+n+c:0;let f=0;const p=s-l;if(i){const D=h>0?h-i:0,R=d>0?d-i:0,z=(D+R)/2,st=z!==0?p*z/(z+i):p;f=(p-st)/2}const g=Math.max(.001,p*d-n/Q)/d,m=(p-g)/2,b=l+m+f,y=s-m-f,{outerStart:_,outerEnd:v,innerStart:x,innerEnd:k}=Om(t,u,d,y-b),S=d-_,C=d-v,O=b+_/S,P=y-v/C,A=u+x,M=u+k,U=b+x/A,N=y-k/M;if(e.beginPath(),o){const D=(O+P)/2;if(e.arc(r,a,d,O,D),e.arc(r,a,d,D,P),v>0){const G=De(C,P,r,a);e.arc(G.x,G.y,v,P,y+et)}const R=De(M,y,r,a);if(e.lineTo(R.x,R.y),k>0){const G=De(M,N,r,a);e.arc(G.x,G.y,k,y+et,N+Math.PI)}const z=(y-k/u+(b+x/u))/2;if(e.arc(r,a,u,y-k/u,z,!0),e.arc(r,a,u,z,b+x/u,!0),x>0){const G=De(A,U,r,a);e.arc(G.x,G.y,x,U+Math.PI,b-et)}const st=De(S,b,r,a);if(e.lineTo(st.x,st.y),_>0){const G=De(S,O,r,a);e.arc(G.x,G.y,_,b-et,O)}}else{e.moveTo(r,a);const D=Math.cos(O)*d+r,R=Math.sin(O)*d+a;e.lineTo(D,R);const z=Math.cos(P)*d+r,st=Math.sin(P)*d+a;e.lineTo(z,st)}e.closePath()}function Mm(e,t,n,i,s){const{fullCircles:o,startAngle:r,circumference:a}=t;let l=t.endAngle;if(o){Ci(e,t,n,i,l,s);for(let c=0;c<o;++c)e.fill();isNaN(a)||(l=r+(a%J||J))}return Ci(e,t,n,i,l,s),e.fill(),l}function Tm(e,t,n,i,s){const{fullCircles:o,startAngle:r,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:h,borderDash:d,borderDashOffset:u}=l,f=l.borderAlign==="inner";if(!c)return;e.setLineDash(d||[]),e.lineDashOffset=u,f?(e.lineWidth=c*2,e.lineJoin=h||"round"):(e.lineWidth=c,e.lineJoin=h||"bevel");let p=t.endAngle;if(o){Ci(e,t,n,i,p,s);for(let g=0;g<o;++g)e.stroke();isNaN(a)||(p=r+(a%J||J))}f&&km(e,t,p),o||(Ci(e,t,n,i,p,s),e.stroke())}class Zn extends It{constructor(n){super();T(this,"circumference");T(this,"endAngle");T(this,"fullCircles");T(this,"innerRadius");T(this,"outerRadius");T(this,"pixelMargin");T(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,n&&Object.assign(this,n)}inRange(n,i,s){const o=this.getProps(["x","y"],s),{angle:r,distance:a}=kl(o,{x:n,y:i}),{startAngle:l,endAngle:c,innerRadius:h,outerRadius:d,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),f=(this.options.spacing+this.options.borderWidth)/2,g=I(u,c-l)>=J||On(r,l,c),m=Re(a,h+f,d+f);return g&&m}getCenterPoint(n){const{x:i,y:s,startAngle:o,endAngle:r,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:h}=this.options,d=(o+r)/2,u=(a+l+h+c)/2;return{x:i+Math.cos(d)*u,y:s+Math.sin(d)*u}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:i,circumference:s}=this,o=(i.offset||0)/4,r=(i.spacing||0)/2,a=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>J?Math.floor(s/J):0,s===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*o,Math.sin(l)*o);const c=1-Math.sin(Math.min(Q,s||0)),h=o*c;n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,Mm(n,this,h,r,a),Tm(n,this,h,r,a),n.restore()}}T(Zn,"id","arc"),T(Zn,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),T(Zn,"defaultRoutes",{backgroundColor:"backgroundColor"}),T(Zn,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function Kl(e,t,n=t){e.lineCap=I(n.borderCapStyle,t.borderCapStyle),e.setLineDash(I(n.borderDash,t.borderDash)),e.lineDashOffset=I(n.borderDashOffset,t.borderDashOffset),e.lineJoin=I(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=I(n.borderWidth,t.borderWidth),e.strokeStyle=I(n.borderColor,t.borderColor)}function Pm(e,t,n){e.lineTo(n.x,n.y)}function Am(e){return e.stepped?ap:e.tension||e.cubicInterpolationMode==="monotone"?lp:Pm}function Jl(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 Dm(e,t,n,i){const{points:s,options:o}=t,{count:r,start:a,loop:l,ilen:c}=Jl(s,n,i),h=Am(o);let{move:d=!0,reverse:u}=i||{},f,p,g;for(f=0;f<=c;++f)p=s[(a+(u?c-f:f))%r],!p.skip&&(d?(e.moveTo(p.x,p.y),d=!1):h(e,g,p,u,o.stepped),g=p);return l&&(p=s[(a+(u?c:0))%r],h(e,g,p,u,o.stepped)),!!l}function Em(e,t,n,i){const s=t.points,{count:o,start:r,ilen:a}=Jl(s,n,i),{move:l=!0,reverse:c}=i||{};let h=0,d=0,u,f,p,g,m,b;const y=v=>(r+(c?a-v:v))%o,_=()=>{g!==m&&(e.lineTo(h,m),e.lineTo(h,g),e.lineTo(h,b))};for(l&&(f=s[y(0)],e.moveTo(f.x,f.y)),u=0;u<=a;++u){if(f=s[y(u)],f.skip)continue;const v=f.x,x=f.y,k=v|0;k===p?(x<g?g=x:x>m&&(m=x),h=(d*h+v)/++d):(_(),e.lineTo(v,x),p=k,d=0,g=m=x),b=x}_()}function Rs(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?Em:Dm}function Rm(e){return e.stepped?Wp:e.tension||e.cubicInterpolationMode==="monotone"?Hp:fe}function Lm(e,t,n,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,i)&&s.closePath()),Kl(e,t.options),e.stroke(s)}function Fm(e,t,n,i){const{segments:s,options:o}=t,r=Rs(t);for(const a of s)Kl(e,o,a.style),e.beginPath(),r(e,t,a,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const Im=typeof Path2D=="function";function zm(e,t,n,i){Im&&!t.options.segment?Lm(e,t,n,i):Fm(e,t,n,i)}class ti extends It{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;Rp(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=Kp(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=qp(this,{property:n,start:s,end:s});if(!r.length)return;const a=[],l=Rm(i);let c,h;for(c=0,h=r.length;c<h;++c){const{start:d,end:u}=r[c],f=o[d],p=o[u];if(f===p){a.push(f);continue}const g=Math.abs((s-f[n])/(p[n]-f[n])),m=l(f,p,g,i.stepped);m[n]=t[n],a.push(m)}return a.length===1?a[0]:a}pathSegment(t,n,i){return Rs(this)(t,this,n,i)}path(t,n,i){const s=this.segments,o=Rs(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(),zm(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}T(ti,"id","line"),T(ti,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),T(ti,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),T(ti,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});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 ds extends It{constructor(n){super();T(this,"parsed");T(this,"skip");T(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,i,s){const o=this.options,{x:r,y:a}=this.getProps(["x","y"],s);return Math.pow(n-r,2)+Math.pow(i-a,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(n,i){return Br(this,n,"x",i)}inYRange(n,i){return Br(this,n,"y",i)}getCenterPoint(n){const{x:i,y:s}=this.getProps(["x","y"],n);return{x:i,y:s}}size(n){n=n||this.options||{};let i=n.radius||0;i=Math.max(i,i&&n.hoverRadius||0);const s=i&&n.borderWidth||0;return(i+s)*2}draw(n,i){const s=this.options;this.skip||s.radius<.1||!Mn(this,i,this.size(s)/2)||(n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.fillStyle=s.backgroundColor,Ts(n,s,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}T(ds,"id","point"),T(ds,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),T(ds,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});const Wr=(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)}},$m=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Hr extends It{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=q(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}=Wr(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 u=-1,f=-h;return this.legendItems.forEach((p,g)=>{const m=i+n/2+o.measureText(p.text).width;(g===0||c[c.length-1]+m+2*a>r)&&(d+=h,c[c.length-(g>0?0:1)]=0,f+=h,u++),l[g]={left:0,top:f,row:u,width:m,height:s},c[c.length-1]+=m+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,u=0,f=0,p=0,g=0;return this.legendItems.forEach((m,b)=>{const{itemWidth:y,itemHeight:_}=Nm(i,n,o,m,s);b>0&&f+_+2*a>h&&(d+=u+a,c.push({width:u,height:f}),p+=u+a,g++,u=f=0),l[b]={left:p,top:f,col:g,width:y,height:_},u=Math.max(u,y),f+=_+a}),d+=u,c.push({width:u,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:o}}=this,r=Le(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=rt(i,this.left+s,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=rt(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+s}else{let a=0,l=rt(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=rt(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;eo(t,this),this._draw(),no(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:s}=this,{align:o,labels:r}=t,a=Z.color,l=Le(t.rtl,this.left,this.width),c=lt(r.font),{padding:h}=r,d=c.size,u=d/2;let f;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:p,boxHeight:g,itemHeight:m}=Wr(r,d),b=function(k,S,C){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;s.save();const O=I(C.lineWidth,1);if(s.fillStyle=I(C.fillStyle,a),s.lineCap=I(C.lineCap,"butt"),s.lineDashOffset=I(C.lineDashOffset,0),s.lineJoin=I(C.lineJoin,"miter"),s.lineWidth=O,s.strokeStyle=I(C.strokeStyle,a),s.setLineDash(I(C.lineDash,[])),r.usePointStyle){const P={radius:g*Math.SQRT2/2,pointStyle:C.pointStyle,rotation:C.rotation,borderWidth:O},A=l.xPlus(k,p/2),M=S+u;Al(s,P,A,M,r.pointStyleWidth&&p)}else{const P=S+Math.max((d-g)/2,0),A=l.leftForLtr(k,p),M=pn(C.borderRadius);s.beginPath(),Object.values(M).some(U=>U!==0)?Ps(s,{x:A,y:P,w:p,h:g,radius:M}):s.rect(A,P,p,g),s.fill(),O!==0&&s.stroke()}s.restore()},y=function(k,S,C){Tn(s,C.text,k,S+m/2,c,{strikethrough:C.hidden,textAlign:l.textAlign(C.textAlign)})},_=this.isHorizontal(),v=this._computeTitleHeight();_?f={x:rt(o,this.left+h,this.right-i[0]),y:this.top+h+v,line:0}:f={x:this.left+h,y:rt(o,this.top+v+h,this.bottom-n[0].height),line:0},Il(this.ctx,t.textDirection);const x=m+h;this.legendItems.forEach((k,S)=>{s.strokeStyle=k.fontColor,s.fillStyle=k.fontColor;const C=s.measureText(k.text).width,O=l.textAlign(k.textAlign||(k.textAlign=r.textAlign)),P=p+u+C;let A=f.x,M=f.y;l.setWidth(this.width),_?S>0&&A+P+h>this.right&&(M=f.y+=x,f.line++,A=f.x=rt(o,this.left+h,this.right-i[f.line])):S>0&&M+x>this.bottom&&(A=f.x=A+n[f.line].width+h,f.line++,M=f.y=rt(o,this.top+v+h,this.bottom-n[f.line].height));const U=l.x(A);if(b(U,M,k),A=Gf(O,A+p+u,_?A+P:this.right,t.rtl),y(l.x(A),M,k),_)f.x+=P+h;else if(typeof k.text!="string"){const N=c.lineHeight;f.y+=Ql(k,N)+h}else f.y+=x}),zl(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=lt(n.font),s=xt(n.padding);if(!n.display)return;const o=Le(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,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+c,d=rt(t.align,d,this.right-u);else{const p=this.columnSizes.reduce((g,m)=>Math.max(g,m.height),0);h=c+rt(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const f=rt(a,d,d+u);r.textAlign=o.textAlign(Qs(a)),r.textBaseline="middle",r.strokeStyle=n.color,r.fillStyle=n.color,r.font=i.string,Tn(r,n.text,f,h,i)}_computeTitleHeight(){const t=this.options.title,n=lt(t.font),i=xt(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,s,o;if(Re(t,this.left,this.right)&&Re(n,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],Re(t,s.left,s.left+s.width)&&Re(n,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const n=this.options;if(!Hm(t.type,n))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=$m(s,i);s&&!o&&q(n.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!o&&q(n.onHover,[t,i,this],this)}else i&&q(n.onClick,[t,i,this],this)}}function Nm(e,t,n,i,s){const o=Bm(i,e,t,n),r=Wm(s,i,t.lineHeight);return{itemWidth:o,itemHeight:r}}function Bm(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 Wm(e,t,n){let i=e;return typeof t.text!="string"&&(i=Ql(t,n)),i}function Ql(e,t){const n=e.text?e.text.length:0;return t*n}function Hm(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var W_={id:"legend",_element:Hr,start(e,t,n){const i=e.legend=new Hr({ctx:e.ctx,options:n,chart:e});gt.configure(e,i,n),gt.addBox(e,i)},stop(e){gt.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;gt.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=xt(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)}}};class Zl extends It{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,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.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const s=it(i.text)?i.text.length:1;this._padding=xt(i.padding);const o=s*lt(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:i,bottom:s,right:o,options:r}=this,a=r.align;let l=0,c,h,d;return this.isHorizontal()?(h=rt(a,i,o),d=n+t,c=o-i):(r.position==="left"?(h=i+t,d=rt(a,s,n),l=Q*-.5):(h=o-t,d=rt(a,n,s),l=Q*.5),c=s-n),{titleX:h,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=lt(n.font),o=i.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);Tn(t,n.text,0,0,i,{color:n.color,maxWidth:l,rotation:c,textAlign:Qs(n.align),textBaseline:"middle",translation:[r,a]})}}function jm(e,t){const n=new Zl({ctx:e.ctx,options:t,chart:e});gt.configure(e,n,t),gt.addBox(e,n),e.titleBlock=n}var H_={id:"title",_element:Zl,start(e,t,n){jm(e,n)},stop(e){const t=e.titleBlock;gt.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;gt.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const cn={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{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=Os(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 Dt(e,t){return t&&(it(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Wt(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
`)>-1?e.split(`
`):e}function Vm(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=lt(t.bodyFont),c=lt(t.titleFont),h=lt(t.footerFont),d=o.length,u=s.length,f=i.length,p=xt(t.padding);let g=p.height,m=0,b=i.reduce((v,x)=>v+x.before.length+x.lines.length+x.after.length,0);if(b+=e.beforeBody.length+e.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const v=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;g+=f*v+(b-f)*l.lineHeight+(b-1)*t.bodySpacing}u&&(g+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let y=0;const _=function(v){m=Math.max(m,n.measureText(v).width+y)};return n.save(),n.font=c.string,H(e.title,_),n.font=l.string,H(e.beforeBody.concat(e.afterBody),_),y=t.displayColors?r+2+t.boxPadding:0,H(i,v=>{H(v.before,_),H(v.lines,_),H(v.after,_)}),y=0,n.font=h.string,H(e.footer,_),n.restore(),m+=p.width,{width:m,height:g}}function Um(e,t){const{y:n,height:i}=t;return n<i/2?"top":n>e.height-i/2?"bottom":"center"}function Ym(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 qm(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"),Ym(c,e,t,n)&&(c="center"),c}function Vr(e,t,n){const i=n.yAlign||t.yAlign||Um(e,n);return{xAlign:n.xAlign||t.xAlign||qm(e,t,n,i),yAlign:i}}function Xm(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function Gm(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function Ur(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:u,bottomRight:f}=pn(r);let p=Xm(t,a);const g=Gm(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(h,u)+s:a==="right"&&(p+=Math.max(d,f)+s),{x:ht(p,0,i.width-t.width),y:ht(g,0,i.height-t.height)}}function ei(e,t,n){const i=xt(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([],Wt(e))}function Km(e,t,n){return ke(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function qr(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const tc={beforeTitle:Nt,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:Nt,beforeBody:Nt,beforeLabel:Nt,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 K(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:Nt,afterBody:Nt,beforeFooter:Nt,footer:Nt,afterFooter:Nt};function dt(e,t,n,i){const s=e[t].call(n,i);return typeof s>"u"?tc[t].call(n,i):s}class Ls extends It{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 Nl(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Km(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,s=dt(i,"beforeTitle",this,t),o=dt(i,"title",this,t),r=dt(i,"afterTitle",this,t);let a=[];return a=Dt(a,Wt(s)),a=Dt(a,Wt(o)),a=Dt(a,Wt(r)),a}getBeforeBody(t,n){return Yr(dt(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,s=[];return H(t,o=>{const r={before:[],lines:[],after:[]},a=qr(i,o);Dt(r.before,Wt(dt(a,"beforeLabel",this,o))),Dt(r.lines,dt(a,"label",this,o)),Dt(r.after,Wt(dt(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,n){return Yr(dt(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,s=dt(i,"beforeFooter",this,t),o=dt(i,"footer",this,t),r=dt(i,"afterFooter",this,t);let a=[];return a=Dt(a,Wt(s)),a=Dt(a,Wt(o)),a=Dt(a,Wt(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(Vm(this.chart,n[l]));return t.filter&&(a=a.filter((h,d,u)=>t.filter(h,d,u,i))),t.itemSort&&(a=a.sort((h,d)=>t.itemSort(h,d,i))),H(a,h=>{const d=qr(t.callbacks,h);s.push(dt(d,"labelColor",this,h)),o.push(dt(d,"labelPointStyle",this,h)),r.push(dt(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=cn[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),h=Vr(this.chart,i,c),d=Ur(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}=pn(a),{x:u,y:f}=t,{width:p,height:g}=n;let m,b,y,_,v,x;return o==="center"?(v=f+g/2,s==="left"?(m=u,b=m-r,_=v+r,x=v-r):(m=u+p,b=m+r,_=v-r,x=v+r),y=m):(s==="left"?b=u+Math.max(l,h)+r:s==="right"?b=u+p-Math.max(c,d)-r:b=this.caretX,o==="top"?(_=f,v=_-r,m=b-r,y=b+r):(_=f+g,v=_+r,m=b+r,y=b-r),x=_),{x1:m,x2:b,x3:y,y1:_,y2:v,y3:x}}drawTitle(t,n,i){const s=this.title,o=s.length;let r,a,l;if(o){const c=Le(i.rtl,this.x,this.width);for(t.x=ei(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=ei(this,"left",o),u=s.x(d),f=l<h.lineHeight?(h.lineHeight-l)/2:0,p=n.y+f;if(o.usePointStyle){const g={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},m=s.leftForLtr(u,c)+c/2,b=p+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Ts(t,g,m,b),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,Ts(t,g,m,b)}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 g=s.leftForLtr(u,c),m=s.leftForLtr(s.xPlus(u,1),c-2),b=pn(r.borderRadius);Object.values(b).some(y=>y!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Ps(t,{x:g,y:p,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),Ps(t,{x:m,y:p+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(g,p,c,l),t.strokeRect(g,p,c,l),t.fillStyle=r.backgroundColor,t.fillRect(m,p+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 u=d.lineHeight,f=0;const p=Le(i.rtl,this.x,this.width),g=function(C){n.fillText(C,p.x(t.x+f),t.y+u/2),t.y+=u+o},m=p.textAlign(r);let b,y,_,v,x,k,S;for(n.textAlign=r,n.textBaseline="middle",n.font=d.string,t.x=ei(this,m,i),n.fillStyle=i.bodyColor,H(this.beforeBody,g),f=a&&m!=="right"?r==="center"?c/2+h:c+2+h:0,v=0,k=s.length;v<k;++v){for(b=s[v],y=this.labelTextColors[v],n.fillStyle=y,H(b.before,g),_=b.lines,a&&_.length&&(this._drawColorBox(n,t,v,p,i),u=Math.max(d.lineHeight,l)),x=0,S=_.length;x<S;++x)g(_[x]),u=d.lineHeight;H(b.after,g)}f=0,u=d.lineHeight,H(this.afterBody,g),t.y-=o}drawFooter(t,n,i){const s=this.footer,o=s.length;let r,a;if(o){const l=Le(i.rtl,this.x,this.width);for(t.x=ei(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:u,bottomLeft:f,bottomRight:p}=pn(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-u,l),n.quadraticCurveTo(a+c,l,a+c,l+u),r==="center"&&o==="right"&&this.drawCaret(t,n,i,s),n.lineTo(a+c,l+h-p),n.quadraticCurveTo(a+c,l+h,a+c-p,l+h),r==="bottom"&&this.drawCaret(t,n,i,s),n.lineTo(a+f,l+h),n.quadraticCurveTo(a,l+h,a,l+h-f),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=cn[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=Vr(n,t,l),h=Ur(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=xt(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),Il(t,n.textDirection),o.y+=r.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),zl(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=!xi(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||!xi(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=cn[o.position].call(this,t,n);return r!==!1&&(i!==r.x||s!==r.y)}}T(Ls,"positioners",cn);var j_={id:"tooltip",_element:Ls,positioners:cn,afterInit(e,t,n){n&&(e.tooltip=new Ls({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){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:tc},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 Jm=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function Qm(e,t,n,i){const s=e.indexOf(t);if(s===-1)return Jm(e,t,n,i);const o=e.lastIndexOf(t);return s!==o?n:s}const Zm=(e,t)=>e===null?null:ht(Math.round(e),0,t);function Xr(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Gr extends Ve{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(K(t))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:Qm(i,t,I(n,t),this._addedLabels),Zm(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 Xr.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}}T(Gr,"id","category"),T(Gr,"defaults",{ticks:{callback:Xr}});function t0(e,t){const n=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:u}=e,f=o||1,p=h-1,{min:g,max:m}=t,b=!K(r),y=!K(a),_=!K(c),v=(m-g)/(d+1);let x=Qo((m-g)/p/f)*f,k,S,C,O;if(x<1e-14&&!b&&!y)return[{value:g},{value:m}];O=Math.ceil(m/x)-Math.floor(g/x),O>p&&(x=Qo(O*x/p/f)*f),K(l)||(k=Math.pow(10,l),x=Math.ceil(x*k)/k),s==="ticks"?(S=Math.floor(g/x)*x,C=Math.ceil(m/x)*x):(S=g,C=m),b&&y&&o&&Nf((a-r)/o,x/1e3)?(O=Math.round(Math.min((a-r)/x,h)),x=(a-r)/O,S=r,C=a):_?(S=b?r:S,C=y?a:C,O=c-1,x=(C-S)/O):(O=(C-S)/x,dn(O,Math.round(O),x/1e3)?O=Math.round(O):O=Math.ceil(O));const P=Math.max(Zo(x),Zo(S));k=Math.pow(10,K(l)?P:l),S=Math.round(S*k)/k,C=Math.round(C*k)/k;let A=0;for(b&&(u&&S!==r?(n.push({value:r}),S<r&&A++,dn(Math.round((S+A*x)*k)/k,r,Kr(r,v,e))&&A++):S<r&&A++);A<O;++A){const M=Math.round((S+A*x)*k)/k;if(y&&M>a)break;n.push({value:M})}return y&&u&&C!==a?n.length&&dn(n[n.length-1].value,a,Kr(a,v,e))?n[n.length-1].value=a:n.push({value:a}):(!y||C===a)&&n.push({value:C}),n}function Kr(e,t,{horizontal:n,minRotation:i}){const s=jt(i),o=(n?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+e).length;return Math.min(t/o,r)}class e0 extends Ve{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 K(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=ze(s),c=ze(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=t0(s,o);return t.bounds==="ticks"&&Bf(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 to(t,this.chart.options.locale,this.options.ticks.format)}}class Jr extends e0{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=yt(t)?t:0,this.max=yt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=jt(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}}T(Jr,"id","linear"),T(Jr,"defaults",{ticks:{callback:Pl.formatters.numeric}});const Hi={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ut=Object.keys(Hi);function Qr(e,t){return e-t}function Zr(e,t){if(K(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)),yt(r)||(r=typeof i=="string"?n.parse(r,i):n.parse(r)),r===null?null:(s&&(r=s==="week"&&(Cn(o)||o===!0)?n.startOf(r,"isoWeek",o):n.startOf(r,s)),+r)}function ta(e,t,n,i){const s=ut.length;for(let o=ut.indexOf(e);o<s-1;++o){const r=Hi[ut[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((n-t)/(a*r.size))<=i)return ut[o]}return ut[s-1]}function n0(e,t,n,i,s){for(let o=ut.length-1;o>=ut.indexOf(n);o--){const r=ut[o];if(Hi[r].common&&e._adapter.diff(s,i,r)>=t-1)return r}return ut[n?ut.indexOf(n):0]}function i0(e){for(let t=ut.indexOf(e)+1,n=ut.length;t<n;++t)if(Hi[ut[t]].common)return ut[t]}function ea(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:i,hi:s}=Js(n,t),o=n[i]>=t?n[i]:n[s];e[o]=!0}}function s0(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 na(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:s0(e,i,s,n)}class Oi extends Ve{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 pg._date(t.adapters.date);s.init(n),hn(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:Zr(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=yt(s)&&!isNaN(s)?s:+n.startOf(Date.now(),i),o=yt(o)&&!isNaN(o)?o:+n.endOf(Date.now(),i)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],i=t[t.length-1]),{min:n,max:i}}buildTicks(){const t=this.options,n=t.time,i=t.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,r=this.max,a=Uf(s,o,r);return this._unit=n.unit||(i.autoSkip?ta(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):n0(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:i0(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),na(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=ht(n,0,r),i=ht(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||ta(o.minUnit,n,i,this._getLabelCapacity(n)),a=I(s.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=Cn(l)||l===!0,h={};let d=n,u,f;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 p=s.ticks.source==="data"&&this.getDataTimestamps();for(u=d,f=0;u<i;u=+t.add(u,a,r),f++)ea(h,u,p);return(u===i||s.bounds==="ticks"||f===1)&&ea(h,u,p),Object.keys(h).sort(Qr).map(g=>+g)}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 q(r,[t,n,i],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],d=c&&a[c],u=i[n],f=c&&d&&u&&u.major;return this._adapter.format(t,s||(f?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=jt(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,na(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(Zr(this,s[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return qf(t.sort(Qr))}}T(Oi,"id","time"),T(Oi,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function ni(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}=ge(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}=ge(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 ia extends Oi{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=ni(n,this.min),this._tableRange=ni(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(ni(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return ni(this._table,i*this._tableRange+this._minPos,!0)}}T(ia,"id","timeseries"),T(ia,"defaults",Oi.defaults);const ec={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},o0={ariaLabel:{type:String},ariaDescribedby:{type:String}},r0={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...ec,...o0},a0=Nc[0]==="2"?(e,t)=>Object.assign(e,{attrs:t}):(e,t)=>Object.assign(e,t);function Ee(e){return Ha(e)?ms(e):e}function l0(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;return Ha(t)?new Proxy(e,{}):e}function c0(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function nc(e,t){e.labels=t}function ic(e,t,n){const i=[];e.datasets=t.map(s=>{const o=e.datasets.find(r=>r[n]===s[n]);return!o||!s.data||i.includes(o)?{...s}:(i.push(o),Object.assign(o,s),o)})}function h0(e,t){const n={labels:[],datasets:[]};return nc(n,e.labels),ic(n,e.datasets,t),n}const d0=ct({props:r0,setup(e,t){let{expose:n,slots:i}=t;const s=Bc(null),o=Ba(null);n({chart:o});const r=()=>{if(!s.value)return;const{type:c,data:h,options:d,plugins:u,datasetIdKey:f}=e,p=h0(h,f),g=l0(p,h);o.value=new ho(s.value,{type:c,data:g,options:{...d},plugins:u})},a=()=>{const c=ms(o.value);c&&(e.destroyDelay>0?setTimeout(()=>{c.destroy(),o.value=null},e.destroyDelay):(c.destroy(),o.value=null))},l=c=>{c.update(e.updateMode)};return Wc(r),Hc(a),jc([()=>e.options,()=>e.data],(c,h)=>{let[d,u]=c,[f,p]=h;const g=ms(o.value);if(!g)return;let m=!1;if(d){const b=Ee(d),y=Ee(f);b&&b!==y&&(c0(g,b),m=!0)}if(u){const b=Ee(u.labels),y=Ee(p.labels),_=Ee(u.datasets),v=Ee(p.datasets);b!==y&&(nc(g.config.data,b),m=!0),_&&_!==v&&(ic(g.config.data,_,e.datasetIdKey),m=!0)}m&&Wa(()=>{l(g)})},{deep:!0}),()=>gs("canvas",{role:"img",ariaLabel:e.ariaLabel,ariaDescribedby:e.ariaDescribedby,ref:s},[gs("p",{},[i.default?i.default():""])])}});function sc(e,t){return ho.register(t),ct({props:ec,setup(n,i){let{expose:s}=i;const o=Ba(null),r=a=>{o.value=a==null?void 0:a.chart};return s({chart:o}),()=>gs(d0,a0({ref:r},{type:e,...n}))}})}const V_=sc("line",ci),U_=sc("pie",As);Vc({});function u0(){for(var e=0,t,n,i="";e<arguments.length;)(t=arguments[e++])&&(n=oc(t))&&(i&&(i+=" "),i+=n);return i}function oc(e){if(typeof e=="string")return e;for(var t,n="",i=0;i<e.length;i++)e[i]&&(t=oc(e[i]))&&(n&&(n+=" "),n+=t);return n}var uo="-";function f0(e){var t=g0(e),n=e.conflictingClassGroups,i=e.conflictingClassGroupModifiers,s=i===void 0?{}:i;function o(a){var l=a.split(uo);return l[0]===""&&l.length!==1&&l.shift(),rc(l,t)||p0(a)}function r(a,l){var c=n[a]||[];return l&&s[a]?[].concat(c,s[a]):c}return{getClassGroupId:o,getConflictingClassGroupIds:r}}function rc(e,t){var r;if(e.length===0)return t.classGroupId;var n=e[0],i=t.nextPart.get(n),s=i?rc(e.slice(1),i):void 0;if(s)return s;if(t.validators.length!==0){var o=e.join(uo);return(r=t.validators.find(function(a){var l=a.validator;return l(o)}))==null?void 0:r.classGroupId}}var sa=/^\[(.+)\]$/;function p0(e){if(sa.test(e)){var t=sa.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function g0(e){var t=e.theme,n=e.prefix,i={nextPart:new Map,validators:[]},s=b0(Object.entries(e.classGroups),n);return s.forEach(function(o){var r=o[0],a=o[1];Fs(a,i,r,t)}),i}function Fs(e,t,n,i){e.forEach(function(s){if(typeof s=="string"){var o=s===""?t:oa(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(m0(s)){Fs(s(i),t,n,i);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(function(r){var a=r[0],l=r[1];Fs(l,oa(t,a),n,i)})})}function oa(e,t){var n=e;return t.split(uo).forEach(function(i){n.nextPart.has(i)||n.nextPart.set(i,{nextPart:new Map,validators:[]}),n=n.nextPart.get(i)}),n}function m0(e){return e.isThemeGetter}function b0(e,t){return t?e.map(function(n){var i=n[0],s=n[1],o=s.map(function(r){return typeof r=="string"?t+r:typeof r=="object"?Object.fromEntries(Object.entries(r).map(function(a){var l=a[0],c=a[1];return[t+l,c]})):r});return[i,o]}):e}function y0(e){if(e<1)return{get:function(){},set:function(){}};var t=0,n=new Map,i=new Map;function s(o,r){n.set(o,r),t++,t>e&&(t=0,i=n,n=new Map)}return{get:function(o){var r=n.get(o);if(r!==void 0)return r;if((r=i.get(o))!==void 0)return s(o,r),r},set:function(o,r){n.has(o)?n.set(o,r):s(o,r)}}}var ac="!";function x0(e){var t=e.separator||":",n=t.length===1,i=t[0],s=t.length;return function(o){for(var r=[],a=0,l=0,c,h=0;h<o.length;h++){var d=o[h];if(a===0){if(d===i&&(n||o.slice(h,h+s)===t)){r.push(o.slice(l,h)),l=h+s;continue}if(d==="/"){c=h;continue}}d==="["?a++:d==="]"&&a--}var u=r.length===0?o:o.substring(l),f=u.startsWith(ac),p=f?u.substring(1):u,g=c&&c>l?c-l:void 0;return{modifiers:r,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:g}}}function _0(e){if(e.length<=1)return e;var t=[],n=[];return e.forEach(function(i){var s=i[0]==="[";s?(t.push.apply(t,n.sort().concat([i])),n=[]):n.push(i)}),t.push.apply(t,n.sort()),t}function w0(e){return{cache:y0(e.cacheSize),splitModifiers:x0(e),...f0(e)}}var v0=/\s+/;function S0(e,t){var n=t.splitModifiers,i=t.getClassGroupId,s=t.getConflictingClassGroupIds,o=new Set;return e.trim().split(v0).map(function(r){var a=n(r),l=a.modifiers,c=a.hasImportantModifier,h=a.baseClassName,d=a.maybePostfixModifierPosition,u=i(d?h.substring(0,d):h),f=!!d;if(!u){if(!d)return{isTailwindClass:!1,originalClassName:r};if(u=i(h),!u)return{isTailwindClass:!1,originalClassName:r};f=!1}var p=_0(l).join(":"),g=c?p+ac:p;return{isTailwindClass:!0,modifierId:g,classGroupId:u,originalClassName:r,hasPostfixModifier:f}}).reverse().filter(function(r){if(!r.isTailwindClass)return!0;var a=r.modifierId,l=r.classGroupId,c=r.hasPostfixModifier,h=a+l;return o.has(h)?!1:(o.add(h),s(l,c).forEach(function(d){return o.add(a+d)}),!0)}).reverse().map(function(r){return r.originalClassName}).join(" ")}function k0(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var i,s,o,r=a;function a(c){var h=t[0],d=t.slice(1),u=d.reduce(function(f,p){return p(f)},h());return i=w0(u),s=i.cache.get,o=i.cache.set,r=l,l(c)}function l(c){var h=s(c);if(h)return h;var d=S0(c,i);return o(c,d),d}return function(){return r(u0.apply(null,arguments))}}function Y(e){var t=function(n){return n[e]||[]};return t.isThemeGetter=!0,t}var lc=/^\[(?:([a-z-]+):)?(.+)\]$/i,C0=/^\d+\/\d+$/,O0=new Set(["px","full","screen"]),M0=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,T0=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,P0=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;function wt(e){return me(e)||O0.has(e)||C0.test(e)||Is(e)}function Is(e){return Ce(e,"length",F0)}function A0(e){return Ce(e,"size",cc)}function D0(e){return Ce(e,"position",cc)}function E0(e){return Ce(e,"url",I0)}function ii(e){return Ce(e,"number",me)}function me(e){return!Number.isNaN(Number(e))}function R0(e){return e.endsWith("%")&&me(e.slice(0,-1))}function nn(e){return ra(e)||Ce(e,"number",ra)}function L(e){return lc.test(e)}function sn(){return!0}function Yt(e){return M0.test(e)}function L0(e){return Ce(e,"",z0)}function Ce(e,t,n){var i=lc.exec(e);return i?i[1]?i[1]===t:n(i[2]):!1}function F0(e){return T0.test(e)}function cc(){return!1}function I0(e){return e.startsWith("url(")}function ra(e){return Number.isInteger(Number(e))}function z0(e){return P0.test(e)}function $0(){var e=Y("colors"),t=Y("spacing"),n=Y("blur"),i=Y("brightness"),s=Y("borderColor"),o=Y("borderRadius"),r=Y("borderSpacing"),a=Y("borderWidth"),l=Y("contrast"),c=Y("grayscale"),h=Y("hueRotate"),d=Y("invert"),u=Y("gap"),f=Y("gradientColorStops"),p=Y("gradientColorStopPositions"),g=Y("inset"),m=Y("margin"),b=Y("opacity"),y=Y("padding"),_=Y("saturate"),v=Y("scale"),x=Y("sepia"),k=Y("skew"),S=Y("space"),C=Y("translate"),O=function(){return["auto","contain","none"]},P=function(){return["auto","hidden","clip","visible","scroll"]},A=function(){return["auto",L,t]},M=function(){return[L,t]},U=function(){return["",wt]},N=function(){return["auto",me,L]},D=function(){return["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"]},R=function(){return["solid","dashed","dotted","double","none"]},z=function(){return["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"]},st=function(){return["start","end","center","between","around","evenly","stretch"]},G=function(){return["","0",L]},$t=function(){return["auto","avoid","all","avoid-page","page","left","right","column"]},Pt=function(){return[me,ii]},_t=function(){return[me,L]};return{cacheSize:500,theme:{colors:[sn],spacing:[wt],blur:["none","",Yt,L],brightness:Pt(),borderColor:[e],borderRadius:["none","","full",Yt,L],borderSpacing:M(),borderWidth:U(),contrast:Pt(),grayscale:G(),hueRotate:_t(),invert:G(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[R0,Is],inset:A(),margin:A(),opacity:Pt(),padding:M(),saturate:Pt(),scale:Pt(),sepia:G(),skew:_t(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",L]}],container:["container"],columns:[{columns:[Yt]}],"break-after":[{"break-after":$t()}],"break-before":[{"break-before":$t()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none"]}],clear:[{clear:["left","right","both","none"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[].concat(D(),[L])}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",nn]}],basis:[{basis:A()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",L]}],grow:[{grow:G()}],shrink:[{shrink:G()}],order:[{order:["first","last","none",nn]}],"grid-cols":[{"grid-cols":[sn]}],"col-start-end":[{col:["auto",{span:["full",nn]},L]}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":[sn]}],"row-start-end":[{row:["auto",{span:[nn]},L]}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",L]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",L]}],gap:[{gap:[u]}],"gap-x":[{"gap-x":[u]}],"gap-y":[{"gap-y":[u]}],"justify-content":[{justify:["normal"].concat(st())}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal"].concat(st(),["baseline"])}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[].concat(st(),["baseline"])}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",L,t]}],"min-w":[{"min-w":["min","max","fit",L,wt]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[Yt]},Yt,L]}],h:[{h:[L,t,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",L,wt]}],"max-h":[{"max-h":[L,t,"min","max","fit"]}],"font-size":[{text:["base",Yt,Is]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ii]}],"font-family":[{font:[sn]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",L]}],"line-clamp":[{"line-clamp":["none",me,ii]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",L,wt]}],"list-image":[{"list-image":["none",L]}],"list-style-type":[{list:["none","disc","decimal",L]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[].concat(R(),["wavy"])}],"text-decoration-thickness":[{decoration:["auto","from-font",wt]}],"underline-offset":[{"underline-offset":["auto",L,wt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",L]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",L]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[].concat(D(),[D0])}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",A0]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},E0]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[].concat(R(),["hidden"])}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:R()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:[""].concat(R())}],"outline-offset":[{"outline-offset":[L,wt]}],"outline-w":[{outline:[wt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[wt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Yt,L0]}],"shadow-color":[{shadow:[sn]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":z()}],"bg-blend":[{"bg-blend":z()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[i]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Yt,L]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[d]}],saturate:[{saturate:[_]}],sepia:[{sepia:[x]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[i]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[x]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[r]}],"border-spacing-x":[{"border-spacing-x":[r]}],"border-spacing-y":[{"border-spacing-y":[r]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",L]}],duration:[{duration:_t()}],ease:[{ease:["linear","in","out","in-out",L]}],delay:[{delay:_t()}],animate:[{animate:["none","spin","ping","pulse","bounce",L]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[v]}],"scale-x":[{"scale-x":[v]}],"scale-y":[{"scale-y":[v]}],rotate:[{rotate:[nn,L]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",L]}],accent:[{accent:["auto",e]}],appearance:["appearance-none"],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",L]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","pinch-zoom","manipulation",{pan:["x","left","right","y","up","down"]}]}],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",L]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[wt,ii]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}var Mi=k0($0);const hc=(e,t)=>{const n=e.__vccOpts||e;for(const[i,s]of t)n[i]=s;return n};function N0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var dc={exports:{}};/*!
	Copyright (c) 2018 Jed Watson.
	Licensed under the MIT License (MIT), see
	http://jedwatson.github.io/classnames
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var i=[],s=0;s<arguments.length;s++){var o=arguments[s];if(o){var r=typeof o;if(r==="string"||r==="number")i.push(o);else if(Array.isArray(o)){if(o.length){var a=n.apply(null,o);a&&i.push(a)}}else if(r==="object"){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){i.push(o.toString());continue}for(var l in o)t.call(o,l)&&o[l]&&i.push(l)}}}return i.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(dc);var B0=dc.exports;const Be=N0(B0),W0="inline-flex items-center space-x-1 md:space-x-3",H0={default:"flex",solid:"flex px-5 py-3 text-gray-700 border border-gray-200 rounded-lg bg-gray-50 dark:bg-gray-800 dark:border-gray-700"};function j0(e){const t=ot(()=>Be(W0)),n=ot(()=>Be(H0[e.solid.value?"solid":"defauilt"]));return{breadcrumbClasses:t,breadcrumbWrapperClasses:n}}const Y_=ct({__name:"FwbBreadcrumb",props:{solid:{type:Boolean,default:!1}},setup(e){const t=e,{breadcrumbClasses:n,breadcrumbWrapperClasses:i}=j0(Va(t));return(s,o)=>(j(),X("nav",{class:nt(kt(i)),"aria-label":"Breadcrumb"},[F("ol",{class:nt(kt(n))},[V(s.$slots,"default")],2)],2))}}),V0="ml-1 inline-flex items-center text-sm font-medium dark:text-gray-400",U0="text-gray-700 hover:text-gray-900 dark:hover:text-white",Y0="text-gray-500";function q0(e){return{breadcrumbItemClasses:ot(()=>Be(V0,e.href.value?U0:Y0))}}const X0={class:"inline-flex items-center"},G0={key:0,class:"w-6 h-6 text-gray-400 mr-1",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},K0=F("path",{"clip-rule":"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z","fill-rule":"evenodd"},null,-1),J0=[K0],Q0={key:0,class:"w-4 h-4 mr-2",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Z0=F("path",{d:"M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"},null,-1),tb=[Z0],q_=ct({__name:"FwbBreadcrumbItem",props:{href:{type:String,default:null},home:{type:Boolean,default:!1}},setup(e){const t=e,n=ot(()=>t.href?"a":"span"),{breadcrumbItemClasses:i}=q0(Va(t));return(s,o)=>(j(),X("li",X0,[V(s.$slots,"arrow-icon",{},()=>[e.home?vt("",!0):(j(),X("svg",G0,J0))]),(j(),Ln(ja(n.value),{class:nt(kt(i)),href:e.href},{default:xn(()=>[V(s.$slots,"home-icon",{},()=>[e.home?(j(),X("svg",Q0,tb)):vt("",!0)]),V(s.$slots,"default")]),_:3},8,["class","href"]))]))}});var aa;const eb=typeof window<"u";eb&&(aa=window==null?void 0:window.navigator)!=null&&aa.userAgent&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function nb(e){return e}const la=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ca="__vueuse_ssr_handlers__";la[ca]=la[ca]||{};var ha;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(ha||(ha={}));var ib=Object.defineProperty,da=Object.getOwnPropertySymbols,sb=Object.prototype.hasOwnProperty,ob=Object.prototype.propertyIsEnumerable,ua=(e,t,n)=>t in e?ib(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rb=(e,t)=>{for(var n in t||(t={}))sb.call(t,n)&&ua(e,n,t[n]);if(da)for(var n of da(t))ob.call(t,n)&&ua(e,n,t[n]);return e};const ab={easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]};rb({linear:nb},ab);var lb=typeof global=="object"&&global&&global.Object===Object&&global;const cb=lb;var hb=typeof self=="object"&&self&&self.Object===Object&&self,db=cb||hb||Function("return this")();const fo=db;var ub=fo.Symbol;const ie=ub;var uc=Object.prototype,fb=uc.hasOwnProperty,pb=uc.toString,on=ie?ie.toStringTag:void 0;function gb(e){var t=fb.call(e,on),n=e[on];try{e[on]=void 0;var i=!0}catch{}var s=pb.call(e);return i&&(t?e[on]=n:delete e[on]),s}var mb=Object.prototype,bb=mb.toString;function yb(e){return bb.call(e)}var xb="[object Null]",_b="[object Undefined]",fa=ie?ie.toStringTag:void 0;function po(e){return e==null?e===void 0?_b:xb:fa&&fa in Object(e)?gb(e):yb(e)}function go(e){return e!=null&&typeof e=="object"}var wb="[object Symbol]";function mo(e){return typeof e=="symbol"||go(e)&&po(e)==wb}function vb(e,t){for(var n=-1,i=e==null?0:e.length,s=Array(i);++n<i;)s[n]=t(e[n],n,e);return s}var Sb=Array.isArray;const Nn=Sb;var kb=1/0,pa=ie?ie.prototype:void 0,ga=pa?pa.toString:void 0;function fc(e){if(typeof e=="string")return e;if(Nn(e))return vb(e,fc)+"";if(mo(e))return ga?ga.call(e):"";var t=e+"";return t=="0"&&1/e==-kb?"-0":t}function Ti(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Cb(e){return e}var Ob="[object AsyncFunction]",Mb="[object Function]",Tb="[object GeneratorFunction]",Pb="[object Proxy]";function Ab(e){if(!Ti(e))return!1;var t=po(e);return t==Mb||t==Tb||t==Ob||t==Pb}var Db=fo["__core-js_shared__"];const us=Db;var ma=function(){var e=/[^.]+$/.exec(us&&us.keys&&us.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Eb(e){return!!ma&&ma in e}var Rb=Function.prototype,Lb=Rb.toString;function Fb(e){if(e!=null){try{return Lb.call(e)}catch{}try{return e+""}catch{}}return""}var Ib=/[\\^$.*+?()[\]{}|]/g,zb=/^\[object .+?Constructor\]$/,$b=Function.prototype,Nb=Object.prototype,Bb=$b.toString,Wb=Nb.hasOwnProperty,Hb=RegExp("^"+Bb.call(Wb).replace(Ib,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function jb(e){if(!Ti(e)||Eb(e))return!1;var t=Ab(e)?Hb:zb;return t.test(Fb(e))}function Vb(e,t){return e==null?void 0:e[t]}function bo(e,t){var n=Vb(e,t);return jb(n)?n:void 0}function Ub(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var Yb=800,qb=16,Xb=Date.now;function Gb(e){var t=0,n=0;return function(){var i=Xb(),s=qb-(i-n);if(n=i,s>0){if(++t>=Yb)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Kb(e){return function(){return e}}var Jb=function(){try{var e=bo(Object,"defineProperty");return e({},"",{}),e}catch{}}();const Pi=Jb;var Qb=Pi?function(e,t){return Pi(e,"toString",{configurable:!0,enumerable:!1,value:Kb(t),writable:!0})}:Cb;const Zb=Qb;var ty=Gb(Zb);const ey=ty;var ny=9007199254740991,iy=/^(?:0|[1-9]\d*)$/;function pc(e,t){var n=typeof e;return t=t??ny,!!t&&(n=="number"||n!="symbol"&&iy.test(e))&&e>-1&&e%1==0&&e<t}function sy(e,t,n){t=="__proto__"&&Pi?Pi(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function gc(e,t){return e===t||e!==e&&t!==t}var oy=Object.prototype,ry=oy.hasOwnProperty;function ay(e,t,n){var i=e[t];(!(ry.call(e,t)&&gc(i,n))||n===void 0&&!(t in e))&&sy(e,t,n)}var ba=Math.max;function ly(e,t,n){return t=ba(t===void 0?e.length-1:t,0),function(){for(var i=arguments,s=-1,o=ba(i.length-t,0),r=Array(o);++s<o;)r[s]=i[t+s];s=-1;for(var a=Array(t+1);++s<t;)a[s]=i[s];return a[t]=n(r),Ub(e,this,a)}}var cy=9007199254740991;function hy(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=cy}var dy="[object Arguments]";function ya(e){return go(e)&&po(e)==dy}var mc=Object.prototype,uy=mc.hasOwnProperty,fy=mc.propertyIsEnumerable,py=ya(function(){return arguments}())?ya:function(e){return go(e)&&uy.call(e,"callee")&&!fy.call(e,"callee")};const bc=py;var gy=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,my=/^\w*$/;function by(e,t){if(Nn(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||mo(e)?!0:my.test(e)||!gy.test(e)||t!=null&&e in Object(t)}var yy=bo(Object,"create");const An=yy;function xy(){this.__data__=An?An(null):{},this.size=0}function _y(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var wy="__lodash_hash_undefined__",vy=Object.prototype,Sy=vy.hasOwnProperty;function ky(e){var t=this.__data__;if(An){var n=t[e];return n===wy?void 0:n}return Sy.call(t,e)?t[e]:void 0}var Cy=Object.prototype,Oy=Cy.hasOwnProperty;function My(e){var t=this.__data__;return An?t[e]!==void 0:Oy.call(t,e)}var Ty="__lodash_hash_undefined__";function Py(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=An&&t===void 0?Ty:t,this}function Se(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}Se.prototype.clear=xy;Se.prototype.delete=_y;Se.prototype.get=ky;Se.prototype.has=My;Se.prototype.set=Py;function Ay(){this.__data__=[],this.size=0}function ji(e,t){for(var n=e.length;n--;)if(gc(e[n][0],t))return n;return-1}var Dy=Array.prototype,Ey=Dy.splice;function Ry(e){var t=this.__data__,n=ji(t,e);if(n<0)return!1;var i=t.length-1;return n==i?t.pop():Ey.call(t,n,1),--this.size,!0}function Ly(e){var t=this.__data__,n=ji(t,e);return n<0?void 0:t[n][1]}function Fy(e){return ji(this.__data__,e)>-1}function Iy(e,t){var n=this.__data__,i=ji(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}function Ue(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}Ue.prototype.clear=Ay;Ue.prototype.delete=Ry;Ue.prototype.get=Ly;Ue.prototype.has=Fy;Ue.prototype.set=Iy;var zy=bo(fo,"Map");const $y=zy;function Ny(){this.size=0,this.__data__={hash:new Se,map:new($y||Ue),string:new Se}}function By(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Vi(e,t){var n=e.__data__;return By(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Wy(e){var t=Vi(this,e).delete(e);return this.size-=t?1:0,t}function Hy(e){return Vi(this,e).get(e)}function jy(e){return Vi(this,e).has(e)}function Vy(e,t){var n=Vi(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}function Oe(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}Oe.prototype.clear=Ny;Oe.prototype.delete=Wy;Oe.prototype.get=Hy;Oe.prototype.has=jy;Oe.prototype.set=Vy;var Uy="Expected a function";function yo(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Uy);var n=function(){var i=arguments,s=t?t.apply(this,i):i[0],o=n.cache;if(o.has(s))return o.get(s);var r=e.apply(this,i);return n.cache=o.set(s,r)||o,r};return n.cache=new(yo.Cache||Oe),n}yo.Cache=Oe;var Yy=500;function qy(e){var t=yo(e,function(i){return n.size===Yy&&n.clear(),i}),n=t.cache;return t}var Xy=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Gy=/\\(\\)?/g,Ky=qy(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Xy,function(n,i,s,o){t.push(s?o.replace(Gy,"$1"):i||n)}),t});const Jy=Ky;function Qy(e){return e==null?"":fc(e)}function Ui(e,t){return Nn(e)?e:by(e,t)?[e]:Jy(Qy(e))}var Zy=1/0;function xo(e){if(typeof e=="string"||mo(e))return e;var t=e+"";return t=="0"&&1/e==-Zy?"-0":t}function tx(e,t){t=Ui(t,e);for(var n=0,i=t.length;e!=null&&n<i;)e=e[xo(t[n++])];return n&&n==i?e:void 0}function ex(e,t){for(var n=-1,i=t.length,s=e.length;++n<i;)e[s+n]=t[n];return e}var xa=ie?ie.isConcatSpreadable:void 0;function nx(e){return Nn(e)||bc(e)||!!(xa&&e&&e[xa])}function ix(e,t,n,i,s){var o=-1,r=e.length;for(n||(n=nx),s||(s=[]);++o<r;){var a=e[o];n(a)?ex(s,a):s[s.length]=a}return s}function sx(e){var t=e==null?0:e.length;return t?ix(e):[]}function ox(e){return ey(ly(e,void 0,sx),e+"")}function rx(e,t){return e!=null&&t in Object(e)}function ax(e,t,n){t=Ui(t,e);for(var i=-1,s=t.length,o=!1;++i<s;){var r=xo(t[i]);if(!(o=e!=null&&n(e,r)))break;e=e[r]}return o||++i!=s?o:(s=e==null?0:e.length,!!s&&hy(s)&&pc(r,s)&&(Nn(e)||bc(e)))}function lx(e,t){return e!=null&&ax(e,t,rx)}function cx(e,t,n,i){if(!Ti(e))return e;t=Ui(t,e);for(var s=-1,o=t.length,r=o-1,a=e;a!=null&&++s<o;){var l=xo(t[s]),c=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(s!=r){var h=a[l];c=void 0,c===void 0&&(c=Ti(h)?h:pc(t[s+1])?[]:{})}ay(a,l,c),a=a[l]}return e}function hx(e,t,n){for(var i=-1,s=t.length,o={};++i<s;){var r=t[i],a=tx(e,r);n(a,r)&&cx(o,Ui(r,e),a)}return o}function dx(e,t){return hx(e,t,function(n,i){return lx(e,i)})}ox(function(e,t){return e==null?{}:dx(e,t)});new Date().getFullYear();const ux={"aria-label":"Navigation"},fx={class:"font-semibold text-gray-900 dark:text-white"},px={class:"font-semibold text-gray-900 dark:text-white"},gx={class:"font-semibold text-gray-900 dark:text-white"},mx=["disabled"],bx=["disabled"],yx={key:0,stroke:"currentColor",fill:"currentColor","stroke-width":"0",viewBox:"0 0 20 20","aria-hidden":"true",class:"h-5 w-5",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg"},xx=F("path",{"fill-rule":"evenodd",d:"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z","clip-rule":"evenodd"},null,-1),_x=[xx],wx=["disabled","onClick"],vx=["disabled"],Sx={key:0,stroke:"currentColor",fill:"currentColor","stroke-width":"0",viewBox:"0 0 20 20","aria-hidden":"true",class:"h-5 w-5",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg"},kx=F("path",{"fill-rule":"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z","clip-rule":"evenodd"},null,-1),Cx=[kx],Ox=["disabled"],X_=ct({__name:"FwbPagination",props:{modelValue:{default:1},totalPages:{default:void 0},perPage:{default:10},totalItems:{default:10},layout:{default:"pagination"},showIcons:{type:Boolean,default:!1},sliceLength:{default:2},previousLabel:{default:"Prev"},nextLabel:{default:"Next"},enableFirstAndLastButtons:{type:Boolean,default:!1},showLabels:{type:Boolean,default:!0},large:{type:Boolean,default:!1}},emits:["update:model-value","page-changed"],setup(e,{emit:t}){const n=t,i=e;function s(x){n("update:model-value",x),n("page-changed",x)}function o(){n("update:model-value",i.modelValue-1),n("page-changed",i.modelValue-1)}function r(){n("update:model-value",i.modelValue+1),n("page-changed",i.modelValue+1)}function a(){n("update:model-value",1),n("page-changed",1)}function l(){const x=c.value;n("update:model-value",x),n("page-changed",x)}const c=ot(()=>i.totalPages?i.totalPages:Math.ceil(i.totalItems/i.perPage)),h=ot(()=>i.modelValue<=1),d=ot(()=>i.modelValue>=c.value),u=x=>x===i.modelValue,f=ot(()=>{if(i.layout==="navigation")return[];if(i.layout==="table")return[];if(c.value<=i.sliceLength*2+1){const S=[];for(let C=1;C<=c.value;C++)S.push(C);return S}if(i.modelValue<=i.sliceLength){const S=[],C=Math.abs(i.modelValue-i.sliceLength)+i.modelValue+i.sliceLength+1;for(let O=1;O<=C;O++)S.push(O);return S}if(i.modelValue>=c.value-i.sliceLength){const S=[];for(let C=Math.abs(c.value-i.sliceLength*2);C<=c.value;C++)S.push(C);return S}const x=[],k=i.modelValue-i.sliceLength>0?i.modelValue-i.sliceLength:1;for(let S=k;S<i.modelValue+i.sliceLength+1&&!(S>=c.value);S++)x.push(S);return x}),p=ot(()=>i.modelValue*i.perPage-i.perPage+1),g=ot(()=>{const x=i.modelValue*i.perPage;return i.totalItems&&x>i.totalItems?i.totalItems:x}),m=ot(()=>i.totalItems?i.totalItems:c.value*i.perPage),b=ot(()=>i.modelValue===1),y=ot(()=>i.modelValue===c.value);function _(x){return Mi("flex items-center justify-center px-3 h-8 leading-tight text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white",x&&"text-blue-600 bg-blue-50 hover:bg-blue-100 hover:text-blue-700 dark:bg-gray-700 dark:text-white",i.large&&"px-4 h-10")}function v(x){const k="flex items-center justify-center first:rounded-l-lg last:rounded-r-lg px-3 h-8 ml-0 leading-tight text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white",S="bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-white cursor-not-allowed";return Mi(k,x===i.modelValue&&S,i.large&&"px-4 h-10",(x>c.value||x<1)&&S,i.layout==="navigation"&&"first:mr-3",(i.layout==="navigation"||i.layout==="table")&&"rounded-lg",i.layout==="table"&&"border-none text-white hover:text-white bg-gray-800 rounded-none first:rounded-l last:rounded-r hover:bg-gray-900 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white")}return(x,k)=>(j(),X("nav",ux,[x.layout==="table"?(j(),X("div",{key:0,class:nt(["text-gray-700 dark:text-gray-400 mb-2",x.large?"text-base":"text-sm"])},[Jt(" Showing "),F("span",fx,Rt(p.value),1),Jt(" to "),F("span",px,Rt(g.value),1),Jt(" of "),F("span",gx,Rt(m.value),1)],2)):vt("",!0),F("div",{class:nt(["inline-flex",x.large&&"text-base h-10"])},[V(x.$slots,"start"),x.enableFirstAndLastButtons?V(x.$slots,"first-button",{key:0},()=>[F("button",{disabled:b.value,class:nt(v(1)),onClick:a}," First ",10,mx)]):vt("",!0),V(x.$slots,"prev-button",{disabled:h.value,decreasePage:o},()=>[F("button",{disabled:h.value,class:nt(v(x.modelValue-1)),onClick:o},[V(x.$slots,"prev-icon",{},()=>[x.showIcons||x.$slots["prev-icon"]?(j(),X("svg",yx,_x)):vt("",!0)]),x.showLabels?(j(),X(ri,{key:0},[Jt(Rt(x.previousLabel),1)],64)):vt("",!0)],10,bx)]),(j(!0),X(ri,null,qc(f.value,S=>V(x.$slots,"page-button",{key:S,page:S,setPage:s,disabled:u(S)},()=>[F("button",{disabled:u(S),class:nt(_(S===x.modelValue)),onClick:C=>s(S)},Rt(S),11,wx)])),128)),V(x.$slots,"next-button",{disabled:d.value,increasePage:r},()=>[F("button",{disabled:d.value,class:nt(v(x.modelValue+1)),onClick:r},[x.showLabels?(j(),X(ri,{key:0},[Jt(Rt(x.nextLabel),1)],64)):vt("",!0),V(x.$slots,"next-icon",{},()=>[x.showIcons||x.$slots["next-icon"]?(j(),X("svg",Sx,Cx)):vt("",!0)])],10,vx)]),x.enableFirstAndLastButtons?V(x.$slots,"last-button",{key:1},()=>[F("button",{disabled:y.value,class:nt(v(c.value)),onClick:l}," Last ",10,Ox)]):vt("",!0),V(x.$slots,"end")],2)]))}}),Mx={class:"relative overflow-x-auto shadow-md sm:rounded-lg"},Tx={class:"w-full text-sm text-left text-gray-500 dark:text-gray-400"},G_=ct({__name:"FwbTable",props:{striped:{type:Boolean,default:!1},stripedColumns:{type:Boolean,default:!1},hoverable:{type:Boolean,default:!1}},setup(e){const t=e;return Ki("hoverable",t.hoverable),Ki("striped",t.striped),Ki("stripedColumns",t.stripedColumns),(n,i)=>(j(),X("div",Mx,[F("table",Tx,[V(n.$slots,"default")])]))}}),Px={};function Ax(e,t){return j(),X("tbody",null,[V(e.$slots,"default")])}const K_=hc(Px,[["render",Ax]]),Dx="px-6 py-4 first:font-medium first:text-gray-900 first:dark:text-white first:whitespace-nowrap last:text-right",Ex="even:bg-gray-white even:dark:bg-gray-900 odd:dark:bg-gray-800 odd:bg-gray-50";function Rx(){const e=gi("stripedColumns");return{tableCellClasses:ot(()=>Be(Dx,{[Ex]:e}))}}const J_=ct({__name:"FwbTableCell",setup(e){const{tableCellClasses:t}=Rx();return(n,i)=>(j(),X("td",{class:nt(kt(t))},[V(n.$slots,"default")],2))}}),Lx={},Fx={class:"text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400"};function Ix(e,t){return j(),X("thead",Fx,[F("tr",null,[V(e.$slots,"default")])])}const Q_=hc(Lx,[["render",Ix]]),zx="px-6 py-3 text-xs uppercase",$x="even:bg-white even:dark:bg-gray-900 odd:dark:bg-gray-800 odd:bg-gray-50";function Nx(){const e=gi("stripedColumns");return{tableHeadCellClasses:ot(()=>Be(zx,{[$x]:e}))}}const Z_=ct({__name:"FwbTableHeadCell",setup(e){const{tableHeadCellClasses:t}=Nx();return(n,i)=>(j(),X("th",{scope:"col",class:nt(kt(t))},[V(n.$slots,"default")],2))}}),Bx="bg-white dark:bg-gray-800 [&:not(:last-child)]:border-b [&:not(:last-child)]:dark:border-gray-700",Wx="odd:bg-white even:bg-gray-50 odd:dark:bg-gray-800 even:dark:bg-gray-700",Hx="hover:bg-gray-50 dark:hover:bg-gray-600";function jx(){const e=gi("striped"),t=gi("hoverable");return{tableRowClasses:ot(()=>Be(Bx,{[Hx]:t,[Wx]:e}))}}const tw=ct({__name:"FwbTableRow",setup(e){const{tableRowClasses:t}=jx();return(n,i)=>(j(),X("tr",{class:nt(kt(t))},[V(n.$slots,"default")],2))}}),Vx=["top","right","bottom","left"],_a=["start","end"],wa=Vx.reduce((e,t)=>e.concat(t,t+"-"+_a[0],t+"-"+_a[1]),[]),Dn=Math.min,pe=Math.max,Ux={left:"right",right:"left",bottom:"top",top:"bottom"},Yx={start:"end",end:"start"};function zs(e,t,n){return pe(e,Dn(t,n))}function Me(e,t){return typeof e=="function"?e(t):e}function zt(e){return e.split("-")[0]}function Ot(e){return e.split("-")[1]}function yc(e){return e==="x"?"y":"x"}function _o(e){return e==="y"?"height":"width"}function Bn(e){return["top","bottom"].includes(zt(e))?"y":"x"}function wo(e){return yc(Bn(e))}function xc(e,t,n){n===void 0&&(n=!1);const i=Ot(e),s=wo(e),o=_o(s);let r=s==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(r=Di(r)),[r,Di(r)]}function qx(e){const t=Di(e);return[Ai(e),t,Ai(t)]}function Ai(e){return e.replace(/start|end/g,t=>Yx[t])}function Xx(e,t,n){const i=["left","right"],s=["right","left"],o=["top","bottom"],r=["bottom","top"];switch(e){case"top":case"bottom":return n?t?s:i:t?i:s;case"left":case"right":return t?o:r;default:return[]}}function Gx(e,t,n,i){const s=Ot(e);let o=Xx(zt(e),n==="start",i);return s&&(o=o.map(r=>r+"-"+s),t&&(o=o.concat(o.map(Ai)))),o}function Di(e){return e.replace(/left|right|bottom|top/g,t=>Ux[t])}function Kx(e){return{top:0,right:0,bottom:0,left:0,...e}}function _c(e){return typeof e!="number"?Kx(e):{top:e,right:e,bottom:e,left:e}}function gn(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function va(e,t,n){let{reference:i,floating:s}=e;const o=Bn(t),r=wo(t),a=_o(r),l=zt(t),c=o==="y",h=i.x+i.width/2-s.width/2,d=i.y+i.height/2-s.height/2,u=i[a]/2-s[a]/2;let f;switch(l){case"top":f={x:h,y:i.y-s.height};break;case"bottom":f={x:h,y:i.y+i.height};break;case"right":f={x:i.x+i.width,y:d};break;case"left":f={x:i.x-s.width,y:d};break;default:f={x:i.x,y:i.y}}switch(Ot(t)){case"start":f[r]-=u*(n&&c?-1:1);break;case"end":f[r]+=u*(n&&c?-1:1);break}return f}const Jx=async(e,t,n)=>{const{placement:i="bottom",strategy:s="absolute",middleware:o=[],platform:r}=n,a=o.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(t));let c=await r.getElementRects({reference:e,floating:t,strategy:s}),{x:h,y:d}=va(c,i,l),u=i,f={},p=0;for(let g=0;g<a.length;g++){const{name:m,fn:b}=a[g],{x:y,y:_,data:v,reset:x}=await b({x:h,y:d,initialPlacement:i,placement:u,strategy:s,middlewareData:f,rects:c,platform:r,elements:{reference:e,floating:t}});h=y??h,d=_??d,f={...f,[m]:{...f[m],...v}},x&&p<=50&&(p++,typeof x=="object"&&(x.placement&&(u=x.placement),x.rects&&(c=x.rects===!0?await r.getElementRects({reference:e,floating:t,strategy:s}):x.rects),{x:h,y:d}=va(c,u,l)),g=-1)}return{x:h,y:d,placement:u,strategy:s,middlewareData:f}};async function Yi(e,t){var n;t===void 0&&(t={});const{x:i,y:s,platform:o,rects:r,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:u=!1,padding:f=0}=Me(t,e),p=_c(f),g=a[u?d==="floating"?"reference":"floating":d],m=gn(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(g)))==null||n?g:g.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),b=d==="floating"?{...r.floating,x:i,y:s}:r.reference,y=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),_=await(o.isElement==null?void 0:o.isElement(y))?await(o.getScale==null?void 0:o.getScale(y))||{x:1,y:1}:{x:1,y:1},v=gn(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:y,strategy:l}):b);return{top:(m.top-v.top+p.top)/_.y,bottom:(v.bottom-m.bottom+p.bottom)/_.y,left:(m.left-v.left+p.left)/_.x,right:(v.right-m.right+p.right)/_.x}}const Qx=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:i,placement:s,rects:o,platform:r,elements:a,middlewareData:l}=t,{element:c,padding:h=0}=Me(e,t)||{};if(c==null)return{};const d=_c(h),u={x:n,y:i},f=wo(s),p=_o(f),g=await r.getDimensions(c),m=f==="y",b=m?"top":"left",y=m?"bottom":"right",_=m?"clientHeight":"clientWidth",v=o.reference[p]+o.reference[f]-u[f]-o.floating[p],x=u[f]-o.reference[f],k=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c));let S=k?k[_]:0;(!S||!await(r.isElement==null?void 0:r.isElement(k)))&&(S=a.floating[_]||o.floating[p]);const C=v/2-x/2,O=S/2-g[p]/2-1,P=Dn(d[b],O),A=Dn(d[y],O),M=P,U=S-g[p]-A,N=S/2-g[p]/2+C,D=zs(M,N,U),R=!l.arrow&&Ot(s)!=null&&N!==D&&o.reference[p]/2-(N<M?P:A)-g[p]/2<0,z=R?N<M?N-M:N-U:0;return{[f]:u[f]+z,data:{[f]:D,centerOffset:N-D-z,...R&&{alignmentOffset:z}},reset:R}}});function Zx(e,t,n){return(e?[...n.filter(i=>Ot(i)===e),...n.filter(i=>Ot(i)!==e)]:n.filter(i=>zt(i)===i)).filter(i=>e?Ot(i)===e||(t?Ai(i)!==i:!1):!0)}const t_=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,i,s;const{rects:o,middlewareData:r,placement:a,platform:l,elements:c}=t,{crossAxis:h=!1,alignment:d,allowedPlacements:u=wa,autoAlignment:f=!0,...p}=Me(e,t),g=d!==void 0||u===wa?Zx(d||null,f,u):u,m=await Yi(t,p),b=((n=r.autoPlacement)==null?void 0:n.index)||0,y=g[b];if(y==null)return{};const _=xc(y,o,await(l.isRTL==null?void 0:l.isRTL(c.floating)));if(a!==y)return{reset:{placement:g[0]}};const v=[m[zt(y)],m[_[0]],m[_[1]]],x=[...((i=r.autoPlacement)==null?void 0:i.overflows)||[],{placement:y,overflows:v}],k=g[b+1];if(k)return{data:{index:b+1,overflows:x},reset:{placement:k}};const S=x.map(O=>{const P=Ot(O.placement);return[O.placement,P&&h?O.overflows.slice(0,2).reduce((A,M)=>A+M,0):O.overflows[0],O.overflows]}).sort((O,P)=>O[1]-P[1]),C=((s=S.filter(O=>O[2].slice(0,Ot(O[0])?2:3).every(P=>P<=0))[0])==null?void 0:s[0])||S[0][0];return C!==a?{data:{index:b+1,overflows:x},reset:{placement:C}}:{}}}},e_=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,i;const{placement:s,middlewareData:o,rects:r,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:u,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...m}=Me(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const b=zt(s),y=zt(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(c.floating)),v=u||(y||!g?[Di(a)]:qx(a));!u&&p!=="none"&&v.push(...Gx(a,g,p,_));const x=[a,...v],k=await Yi(t,m),S=[];let C=((i=o.flip)==null?void 0:i.overflows)||[];if(h&&S.push(k[b]),d){const M=xc(s,r,_);S.push(k[M[0]],k[M[1]])}if(C=[...C,{placement:s,overflows:S}],!S.every(M=>M<=0)){var O,P;const M=(((O=o.flip)==null?void 0:O.index)||0)+1,U=x[M];if(U)return{data:{index:M,overflows:C},reset:{placement:U}};let N=(P=C.filter(D=>D.overflows[0]<=0).sort((D,R)=>D.overflows[1]-R.overflows[1])[0])==null?void 0:P.placement;if(!N)switch(f){case"bestFit":{var A;const D=(A=C.map(R=>[R.placement,R.overflows.filter(z=>z>0).reduce((z,st)=>z+st,0)]).sort((R,z)=>R[1]-z[1])[0])==null?void 0:A[0];D&&(N=D);break}case"initialPlacement":N=a;break}if(s!==N)return{reset:{placement:N}}}return{}}}};async function n_(e,t){const{placement:n,platform:i,elements:s}=e,o=await(i.isRTL==null?void 0:i.isRTL(s.floating)),r=zt(n),a=Ot(n),l=Bn(n)==="y",c=["left","top"].includes(r)?-1:1,h=o&&l?-1:1,d=Me(t,e);let{mainAxis:u,crossAxis:f,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof p=="number"&&(f=a==="end"?p*-1:p),l?{x:f*h,y:u*c}:{x:u*c,y:f*h}}const i_=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,i;const{x:s,y:o,placement:r,middlewareData:a}=t,l=await n_(t,e);return r===((n=a.offset)==null?void 0:n.placement)&&(i=a.arrow)!=null&&i.alignmentOffset?{}:{x:s+l.x,y:o+l.y,data:{...l,placement:r}}}}},s_=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:i,placement:s}=t,{mainAxis:o=!0,crossAxis:r=!1,limiter:a={fn:m=>{let{x:b,y}=m;return{x:b,y}}},...l}=Me(e,t),c={x:n,y:i},h=await Yi(t,l),d=Bn(zt(s)),u=yc(d);let f=c[u],p=c[d];if(o){const m=u==="y"?"top":"left",b=u==="y"?"bottom":"right",y=f+h[m],_=f-h[b];f=zs(y,f,_)}if(r){const m=d==="y"?"top":"left",b=d==="y"?"bottom":"right",y=p+h[m],_=p-h[b];p=zs(y,p,_)}const g=a.fn({...t,[u]:f,[d]:p});return{...g,data:{x:g.x-n,y:g.y-i}}}}},o_=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:i,platform:s,elements:o}=t,{apply:r=()=>{},...a}=Me(e,t),l=await Yi(t,a),c=zt(n),h=Ot(n),d=Bn(n)==="y",{width:u,height:f}=i.floating;let p,g;c==="top"||c==="bottom"?(p=c,g=h===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(g=c,p=h==="end"?"top":"bottom");const m=f-l[p],b=u-l[g],y=!t.middlewareData.shift;let _=m,v=b;if(d){const k=u-l.left-l.right;v=h||y?Dn(b,k):k}else{const k=f-l.top-l.bottom;_=h||y?Dn(m,k):k}if(y&&!h){const k=pe(l.left,0),S=pe(l.right,0),C=pe(l.top,0),O=pe(l.bottom,0);d?v=u-2*(k!==0||S!==0?k+S:pe(l.left,l.right)):_=f-2*(C!==0||O!==0?C+O:pe(l.top,l.bottom))}await r({...t,availableWidth:v,availableHeight:_});const x=await s.getDimensions(o.floating);return u!==x.width||f!==x.height?{reset:{rects:!0}}:{}}}};function mt(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Lt(e){return mt(e).getComputedStyle(e)}const Sa=Math.min,mn=Math.max,Ei=Math.round;function wc(e){const t=Lt(e);let n=parseFloat(t.width),i=parseFloat(t.height);const s=e.offsetWidth,o=e.offsetHeight,r=Ei(n)!==s||Ei(i)!==o;return r&&(n=s,i=o),{width:n,height:i,fallback:r}}function se(e){return Sc(e)?(e.nodeName||"").toLowerCase():""}let si;function vc(){if(si)return si;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(si=e.brands.map(t=>t.brand+"/"+t.version).join(" "),si):navigator.userAgent}function Ft(e){return e instanceof mt(e).HTMLElement}function te(e){return e instanceof mt(e).Element}function Sc(e){return e instanceof mt(e).Node}function ka(e){return typeof ShadowRoot>"u"?!1:e instanceof mt(e).ShadowRoot||e instanceof ShadowRoot}function qi(e){const{overflow:t,overflowX:n,overflowY:i,display:s}=Lt(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&!["inline","contents"].includes(s)}function r_(e){return["table","td","th"].includes(se(e))}function $s(e){const t=/firefox/i.test(vc()),n=Lt(e),i=n.backdropFilter||n.WebkitBackdropFilter;return n.transform!=="none"||n.perspective!=="none"||!!i&&i!=="none"||t&&n.willChange==="filter"||t&&!!n.filter&&n.filter!=="none"||["transform","perspective"].some(s=>n.willChange.includes(s))||["paint","layout","strict","content"].some(s=>{const o=n.contain;return o!=null&&o.includes(s)})}function kc(){return!/^((?!chrome|android).)*safari/i.test(vc())}function vo(e){return["html","body","#document"].includes(se(e))}function Cc(e){return te(e)?e:e.contextElement}const Oc={x:1,y:1};function Ie(e){const t=Cc(e);if(!Ft(t))return Oc;const n=t.getBoundingClientRect(),{width:i,height:s,fallback:o}=wc(t);let r=(o?Ei(n.width):n.width)/i,a=(o?Ei(n.height):n.height)/s;return r&&Number.isFinite(r)||(r=1),a&&Number.isFinite(a)||(a=1),{x:r,y:a}}function En(e,t,n,i){var s,o;t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),a=Cc(e);let l=Oc;t&&(i?te(i)&&(l=Ie(i)):l=Ie(e));const c=a?mt(a):window,h=!kc()&&n;let d=(r.left+(h&&((s=c.visualViewport)==null?void 0:s.offsetLeft)||0))/l.x,u=(r.top+(h&&((o=c.visualViewport)==null?void 0:o.offsetTop)||0))/l.y,f=r.width/l.x,p=r.height/l.y;if(a){const g=mt(a),m=i&&te(i)?mt(i):i;let b=g.frameElement;for(;b&&i&&m!==g;){const y=Ie(b),_=b.getBoundingClientRect(),v=getComputedStyle(b);_.x+=(b.clientLeft+parseFloat(v.paddingLeft))*y.x,_.y+=(b.clientTop+parseFloat(v.paddingTop))*y.y,d*=y.x,u*=y.y,f*=y.x,p*=y.y,d+=_.x,u+=_.y,b=mt(b).frameElement}}return{width:f,height:p,top:u,right:d+f,bottom:u+p,left:d,x:d,y:u}}function ee(e){return((Sc(e)?e.ownerDocument:e.document)||window.document).documentElement}function Xi(e){return te(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Mc(e){return En(ee(e)).left+Xi(e).scrollLeft}function Rn(e){if(se(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ka(e)&&e.host||ee(e);return ka(t)?t.host:t}function Tc(e){const t=Rn(e);return vo(t)?t.ownerDocument.body:Ft(t)&&qi(t)?t:Tc(t)}function Ri(e,t){var n;t===void 0&&(t=[]);const i=Tc(e),s=i===((n=e.ownerDocument)==null?void 0:n.body),o=mt(i);return s?t.concat(o,o.visualViewport||[],qi(i)?i:[]):t.concat(i,Ri(i))}function Ca(e,t,n){return t==="viewport"?gn(function(i,s){const o=mt(i),r=ee(i),a=o.visualViewport;let l=r.clientWidth,c=r.clientHeight,h=0,d=0;if(a){l=a.width,c=a.height;const u=kc();(u||!u&&s==="fixed")&&(h=a.offsetLeft,d=a.offsetTop)}return{width:l,height:c,x:h,y:d}}(e,n)):te(t)?gn(function(i,s){const o=En(i,!0,s==="fixed"),r=o.top+i.clientTop,a=o.left+i.clientLeft,l=Ft(i)?Ie(i):{x:1,y:1};return{width:i.clientWidth*l.x,height:i.clientHeight*l.y,x:a*l.x,y:r*l.y}}(t,n)):gn(function(i){const s=ee(i),o=Xi(i),r=i.ownerDocument.body,a=mn(s.scrollWidth,s.clientWidth,r.scrollWidth,r.clientWidth),l=mn(s.scrollHeight,s.clientHeight,r.scrollHeight,r.clientHeight);let c=-o.scrollLeft+Mc(i);const h=-o.scrollTop;return Lt(r).direction==="rtl"&&(c+=mn(s.clientWidth,r.clientWidth)-a),{width:a,height:l,x:c,y:h}}(ee(e)))}function Oa(e){return Ft(e)&&Lt(e).position!=="fixed"?e.offsetParent:null}function Ma(e){const t=mt(e);let n=Oa(e);for(;n&&r_(n)&&Lt(n).position==="static";)n=Oa(n);return n&&(se(n)==="html"||se(n)==="body"&&Lt(n).position==="static"&&!$s(n))?t:n||function(i){let s=Rn(i);for(;Ft(s)&&!vo(s);){if($s(s))return s;s=Rn(s)}return null}(e)||t}function a_(e,t,n){const i=Ft(t),s=ee(t),o=En(e,!0,n==="fixed",t);let r={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(i||!i&&n!=="fixed")if((se(t)!=="body"||qi(s))&&(r=Xi(t)),Ft(t)){const l=En(t,!0);a.x=l.x+t.clientLeft,a.y=l.y+t.clientTop}else s&&(a.x=Mc(s));return{x:o.left+r.scrollLeft-a.x,y:o.top+r.scrollTop-a.y,width:o.width,height:o.height}}const l_={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:i,strategy:s}=e;const o=n==="clippingAncestors"?function(c,h){const d=h.get(c);if(d)return d;let u=Ri(c).filter(m=>te(m)&&se(m)!=="body"),f=null;const p=Lt(c).position==="fixed";let g=p?Rn(c):c;for(;te(g)&&!vo(g);){const m=Lt(g),b=$s(g);(p?b||f:b||m.position!=="static"||!f||!["absolute","fixed"].includes(f.position))?f=m:u=u.filter(y=>y!==g),g=Rn(g)}return h.set(c,u),u}(t,this._c):[].concat(n),r=[...o,i],a=r[0],l=r.reduce((c,h)=>{const d=Ca(t,h,s);return c.top=mn(d.top,c.top),c.right=Sa(d.right,c.right),c.bottom=Sa(d.bottom,c.bottom),c.left=mn(d.left,c.left),c},Ca(t,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:i}=e;const s=Ft(n),o=ee(n);if(n===o)return t;let r={scrollLeft:0,scrollTop:0},a={x:1,y:1};const l={x:0,y:0};if((s||!s&&i!=="fixed")&&((se(n)!=="body"||qi(o))&&(r=Xi(n)),Ft(n))){const c=En(n);a=Ie(n),l.x=c.x+n.clientLeft,l.y=c.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-r.scrollLeft*a.x+l.x,y:t.y*a.y-r.scrollTop*a.y+l.y}},isElement:te,getDimensions:function(e){return Ft(e)?wc(e):e.getBoundingClientRect()},getOffsetParent:Ma,getDocumentElement:ee,getScale:Ie,async getElementRects(e){let{reference:t,floating:n,strategy:i}=e;const s=this.getOffsetParent||Ma,o=this.getDimensions;return{reference:a_(t,await s(n),i),floating:{x:0,y:0,...await o(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>Lt(e).direction==="rtl"},c_=(e,t,n)=>{const i=new Map,s={platform:l_,...n},o={...s.platform,_c:i};return Jx(e,t,{...s,platform:o})},xe={disabled:!1,distance:5,skidding:0,container:"body",boundary:void 0,instantMove:!1,disposeTimeout:5e3,popperTriggers:[],strategy:"absolute",preventOverflow:!0,flip:!0,shift:!0,overflowPadding:0,arrowPadding:0,arrowOverflow:!0,themes:{tooltip:{placement:"top",triggers:["hover","focus","touch"],hideTriggers:e=>[...e,"click"],delay:{show:200,hide:0},handleResize:!1,html:!1,loadingContent:"..."},dropdown:{placement:"bottom",triggers:["click"],delay:0,handleResize:!0,autoHide:!0},menu:{$extend:"dropdown",triggers:["hover","focus"],popperTriggers:["hover","focus"],delay:{show:0,hide:400}}}};function Ns(e,t){let n=xe.themes[e]||{},i;do i=n[t],typeof i>"u"?n.$extend?n=xe.themes[n.$extend]||{}:(n=null,i=xe[t]):n=null;while(n);return i}function h_(e){const t=[e];let n=xe.themes[e]||{};do n.$extend&&!n.$resetCss?(t.push(n.$extend),n=xe.themes[n.$extend]||{}):n=null;while(n);return t.map(i=>`v-popper--theme-${i}`)}function Ta(e){const t=[e];let n=xe.themes[e]||{};do n.$extend?(t.push(n.$extend),n=xe.themes[n.$extend]||{}):n=null;while(n);return t}let We=!1;if(typeof window<"u"){We=!1;try{const e=Object.defineProperty({},"passive",{get(){We=!0}});window.addEventListener("test",null,e)}catch{}}let Pc=!1;typeof window<"u"&&typeof navigator<"u"&&(Pc=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream);const d_=["auto","top","bottom","left","right"].reduce((e,t)=>e.concat([t,`${t}-start`,`${t}-end`]),[]),Pa={hover:"mouseenter",focus:"focus",click:"click",touch:"touchstart",pointer:"pointerdown"},Aa={hover:"mouseleave",focus:"blur",click:"click",touch:"touchend",pointer:"pointerup"};function Da(e,t){const n=e.indexOf(t);n!==-1&&e.splice(n,1)}function fs(){return new Promise(e=>requestAnimationFrame(()=>{requestAnimationFrame(e)}))}const St=[];let he=null;const Ea={};function Ra(e){let t=Ea[e];return t||(t=Ea[e]=[]),t}let Bs=function(){};typeof window<"u"&&(Bs=window.Element);function $(e){return function(t){return Ns(t.theme,e)}}const ps="__floating-vue__popper",Ac=()=>ct({name:"VPopper",provide(){return{[ps]:{parentPopper:this}}},inject:{[ps]:{default:null}},props:{theme:{type:String,required:!0},targetNodes:{type:Function,required:!0},referenceNode:{type:Function,default:null},popperNode:{type:Function,required:!0},shown:{type:Boolean,default:!1},showGroup:{type:String,default:null},ariaId:{default:null},disabled:{type:Boolean,default:$("disabled")},positioningDisabled:{type:Boolean,default:$("positioningDisabled")},placement:{type:String,default:$("placement"),validator:e=>d_.includes(e)},delay:{type:[String,Number,Object],default:$("delay")},distance:{type:[Number,String],default:$("distance")},skidding:{type:[Number,String],default:$("skidding")},triggers:{type:Array,default:$("triggers")},showTriggers:{type:[Array,Function],default:$("showTriggers")},hideTriggers:{type:[Array,Function],default:$("hideTriggers")},popperTriggers:{type:Array,default:$("popperTriggers")},popperShowTriggers:{type:[Array,Function],default:$("popperShowTriggers")},popperHideTriggers:{type:[Array,Function],default:$("popperHideTriggers")},container:{type:[String,Object,Bs,Boolean],default:$("container")},boundary:{type:[String,Bs],default:$("boundary")},strategy:{type:String,validator:e=>["absolute","fixed"].includes(e),default:$("strategy")},autoHide:{type:[Boolean,Function],default:$("autoHide")},handleResize:{type:Boolean,default:$("handleResize")},instantMove:{type:Boolean,default:$("instantMove")},eagerMount:{type:Boolean,default:$("eagerMount")},popperClass:{type:[String,Array,Object],default:$("popperClass")},computeTransformOrigin:{type:Boolean,default:$("computeTransformOrigin")},autoMinSize:{type:Boolean,default:$("autoMinSize")},autoSize:{type:[Boolean,String],default:$("autoSize")},autoMaxSize:{type:Boolean,default:$("autoMaxSize")},autoBoundaryMaxSize:{type:Boolean,default:$("autoBoundaryMaxSize")},preventOverflow:{type:Boolean,default:$("preventOverflow")},overflowPadding:{type:[Number,String],default:$("overflowPadding")},arrowPadding:{type:[Number,String],default:$("arrowPadding")},arrowOverflow:{type:Boolean,default:$("arrowOverflow")},flip:{type:Boolean,default:$("flip")},shift:{type:Boolean,default:$("shift")},shiftCrossAxis:{type:Boolean,default:$("shiftCrossAxis")},noAutoFocus:{type:Boolean,default:$("noAutoFocus")},disposeTimeout:{type:Number,default:$("disposeTimeout")}},emits:["show","hide","update:shown","apply-show","apply-hide","close-group","close-directive","auto-hide","resize","dispose"],data(){return{isShown:!1,isMounted:!1,skipTransition:!1,classes:{showFrom:!1,showTo:!1,hideFrom:!1,hideTo:!0},result:{x:0,y:0,placement:"",strategy:this.strategy,arrow:{x:0,y:0,centerOffset:0},transformOrigin:null},shownChildren:new Set,lastAutoHide:!0}},computed:{popperId(){return this.ariaId!=null?this.ariaId:this.randomId},shouldMountContent(){return this.eagerMount||this.isMounted},slotData(){return{popperId:this.popperId,isShown:this.isShown,shouldMountContent:this.shouldMountContent,skipTransition:this.skipTransition,autoHide:typeof this.autoHide=="function"?this.lastAutoHide:this.autoHide,show:this.show,hide:this.hide,handleResize:this.handleResize,onResize:this.onResize,classes:{...this.classes,popperClass:this.popperClass},result:this.positioningDisabled?null:this.result,attrs:this.$attrs}},parentPopper(){var e;return(e=this[ps])==null?void 0:e.parentPopper},hasPopperShowTriggerHover(){var e,t;return((e=this.popperTriggers)==null?void 0:e.includes("hover"))||((t=this.popperShowTriggers)==null?void 0:t.includes("hover"))}},watch:{shown:"$_autoShowHide",disabled(e){e?this.dispose():this.init()},async container(){this.isShown&&(this.$_ensureTeleport(),await this.$_computePosition())},...["triggers","positioningDisabled"].reduce((e,t)=>(e[t]="$_refreshListeners",e),{}),...["placement","distance","skidding","boundary","strategy","overflowPadding","arrowPadding","preventOverflow","shift","shiftCrossAxis","flip"].reduce((e,t)=>(e[t]="$_computePosition",e),{})},created(){this.$_isDisposed=!0,this.randomId=`popper_${[Math.random(),Date.now()].map(e=>e.toString(36).substring(2,10)).join("_")}`,this.autoMinSize&&console.warn('[floating-vue] `autoMinSize` option is deprecated. Use `autoSize="min"` instead.'),this.autoMaxSize&&console.warn("[floating-vue] `autoMaxSize` option is deprecated. Use `autoBoundaryMaxSize` instead.")},mounted(){this.init(),this.$_detachPopperNode()},activated(){this.$_autoShowHide()},deactivated(){this.hide()},beforeUnmount(){this.dispose()},methods:{show({event:e=null,skipDelay:t=!1,force:n=!1}={}){var i,s;(i=this.parentPopper)!=null&&i.lockedChild&&this.parentPopper.lockedChild!==this||(this.$_pendingHide=!1,(n||!this.disabled)&&(((s=this.parentPopper)==null?void 0:s.lockedChild)===this&&(this.parentPopper.lockedChild=null),this.$_scheduleShow(e,t),this.$emit("show"),this.$_showFrameLocked=!0,requestAnimationFrame(()=>{this.$_showFrameLocked=!1})),this.$emit("update:shown",!0))},hide({event:e=null,skipDelay:t=!1}={}){var n;if(!this.$_hideInProgress){if(this.shownChildren.size>0){this.$_pendingHide=!0;return}if(this.hasPopperShowTriggerHover&&this.$_isAimingPopper()){this.parentPopper&&(this.parentPopper.lockedChild=this,clearTimeout(this.parentPopper.lockedChildTimer),this.parentPopper.lockedChildTimer=setTimeout(()=>{this.parentPopper.lockedChild===this&&(this.parentPopper.lockedChild.hide({skipDelay:t}),this.parentPopper.lockedChild=null)},1e3));return}((n=this.parentPopper)==null?void 0:n.lockedChild)===this&&(this.parentPopper.lockedChild=null),this.$_pendingHide=!1,this.$_scheduleHide(e,t),this.$emit("hide"),this.$emit("update:shown",!1)}},init(){var e;this.$_isDisposed&&(this.$_isDisposed=!1,this.isMounted=!1,this.$_events=[],this.$_preventShow=!1,this.$_referenceNode=((e=this.referenceNode)==null?void 0:e.call(this))??this.$el,this.$_targetNodes=this.targetNodes().filter(t=>t.nodeType===t.ELEMENT_NODE),this.$_popperNode=this.popperNode(),this.$_innerNode=this.$_popperNode.querySelector(".v-popper__inner"),this.$_arrowNode=this.$_popperNode.querySelector(".v-popper__arrow-container"),this.$_swapTargetAttrs("title","data-original-title"),this.$_detachPopperNode(),this.triggers.length&&this.$_addEventListeners(),this.shown&&this.show())},dispose(){this.$_isDisposed||(this.$_isDisposed=!0,this.$_removeEventListeners(),this.hide({skipDelay:!0}),this.$_detachPopperNode(),this.isMounted=!1,this.isShown=!1,this.$_updateParentShownChildren(!1),this.$_swapTargetAttrs("data-original-title","title"),this.$emit("dispose"))},async onResize(){this.isShown&&(await this.$_computePosition(),this.$emit("resize"))},async $_computePosition(){if(this.$_isDisposed||this.positioningDisabled)return;const e={strategy:this.strategy,middleware:[]};(this.distance||this.skidding)&&e.middleware.push(i_({mainAxis:this.distance,crossAxis:this.skidding}));const t=this.placement.startsWith("auto");if(t?e.middleware.push(t_({alignment:this.placement.split("-")[1]??""})):e.placement=this.placement,this.preventOverflow&&(this.shift&&e.middleware.push(s_({padding:this.overflowPadding,boundary:this.boundary,crossAxis:this.shiftCrossAxis})),!t&&this.flip&&e.middleware.push(e_({padding:this.overflowPadding,boundary:this.boundary}))),e.middleware.push(Qx({element:this.$_arrowNode,padding:this.arrowPadding})),this.arrowOverflow&&e.middleware.push({name:"arrowOverflow",fn:({placement:i,rects:s,middlewareData:o})=>{let r;const{centerOffset:a}=o.arrow;return i.startsWith("top")||i.startsWith("bottom")?r=Math.abs(a)>s.reference.width/2:r=Math.abs(a)>s.reference.height/2,{data:{overflow:r}}}}),this.autoMinSize||this.autoSize){const i=this.autoSize?this.autoSize:this.autoMinSize?"min":null;e.middleware.push({name:"autoSize",fn:({rects:s,placement:o,middlewareData:r})=>{var a;if((a=r.autoSize)!=null&&a.skip)return{};let l,c;return o.startsWith("top")||o.startsWith("bottom")?l=s.reference.width:c=s.reference.height,this.$_innerNode.style[i==="min"?"minWidth":i==="max"?"maxWidth":"width"]=l!=null?`${l}px`:null,this.$_innerNode.style[i==="min"?"minHeight":i==="max"?"maxHeight":"height"]=c!=null?`${c}px`:null,{data:{skip:!0},reset:{rects:!0}}}})}(this.autoMaxSize||this.autoBoundaryMaxSize)&&(this.$_innerNode.style.maxWidth=null,this.$_innerNode.style.maxHeight=null,e.middleware.push(o_({boundary:this.boundary,padding:this.overflowPadding,apply:({availableWidth:i,availableHeight:s})=>{this.$_innerNode.style.maxWidth=i!=null?`${i}px`:null,this.$_innerNode.style.maxHeight=s!=null?`${s}px`:null}})));const n=await c_(this.$_referenceNode,this.$_popperNode,e);Object.assign(this.result,{x:n.x,y:n.y,placement:n.placement,strategy:n.strategy,arrow:{...n.middlewareData.arrow,...n.middlewareData.arrowOverflow}})},$_scheduleShow(e=null,t=!1){if(this.$_updateParentShownChildren(!0),this.$_hideInProgress=!1,clearTimeout(this.$_scheduleTimer),he&&this.instantMove&&he.instantMove&&he!==this.parentPopper){he.$_applyHide(!0),this.$_applyShow(!0);return}t?this.$_applyShow():this.$_scheduleTimer=setTimeout(this.$_applyShow.bind(this),this.$_computeDelay("show"))},$_scheduleHide(e=null,t=!1){if(this.shownChildren.size>0){this.$_pendingHide=!0;return}this.$_updateParentShownChildren(!1),this.$_hideInProgress=!0,clearTimeout(this.$_scheduleTimer),this.isShown&&(he=this),t?this.$_applyHide():this.$_scheduleTimer=setTimeout(this.$_applyHide.bind(this),this.$_computeDelay("hide"))},$_computeDelay(e){const t=this.delay;return parseInt(t&&t[e]||t||0)},async $_applyShow(e=!1){clearTimeout(this.$_disposeTimer),clearTimeout(this.$_scheduleTimer),this.skipTransition=e,!this.isShown&&(this.$_ensureTeleport(),await fs(),await this.$_computePosition(),await this.$_applyShowEffect(),this.positioningDisabled||this.$_registerEventListeners([...Ri(this.$_referenceNode),...Ri(this.$_popperNode)],"scroll",()=>{this.$_computePosition()}))},async $_applyShowEffect(){if(this.$_hideInProgress)return;if(this.computeTransformOrigin){const t=this.$_referenceNode.getBoundingClientRect(),n=this.$_popperNode.querySelector(".v-popper__wrapper"),i=n.parentNode.getBoundingClientRect(),s=t.x+t.width/2-(i.left+n.offsetLeft),o=t.y+t.height/2-(i.top+n.offsetTop);this.result.transformOrigin=`${s}px ${o}px`}this.isShown=!0,this.$_applyAttrsToTarget({"aria-describedby":this.popperId,"data-popper-shown":""});const e=this.showGroup;if(e){let t;for(let n=0;n<St.length;n++)t=St[n],t.showGroup!==e&&(t.hide(),t.$emit("close-group"))}St.push(this),document.body.classList.add("v-popper--some-open");for(const t of Ta(this.theme))Ra(t).push(this),document.body.classList.add(`v-popper--some-open--${t}`);this.$emit("apply-show"),this.classes.showFrom=!0,this.classes.showTo=!1,this.classes.hideFrom=!1,this.classes.hideTo=!1,await fs(),this.classes.showFrom=!1,this.classes.showTo=!0,this.noAutoFocus||this.$_popperNode.focus()},async $_applyHide(e=!1){if(this.shownChildren.size>0){this.$_pendingHide=!0,this.$_hideInProgress=!1;return}if(clearTimeout(this.$_scheduleTimer),!this.isShown)return;this.skipTransition=e,Da(St,this),St.length===0&&document.body.classList.remove("v-popper--some-open");for(const n of Ta(this.theme)){const i=Ra(n);Da(i,this),i.length===0&&document.body.classList.remove(`v-popper--some-open--${n}`)}he===this&&(he=null),this.isShown=!1,this.$_applyAttrsToTarget({"aria-describedby":void 0,"data-popper-shown":void 0}),clearTimeout(this.$_disposeTimer);const t=this.disposeTimeout;t!==null&&(this.$_disposeTimer=setTimeout(()=>{this.$_popperNode&&(this.$_detachPopperNode(),this.isMounted=!1)},t)),this.$_removeEventListeners("scroll"),this.$emit("apply-hide"),this.classes.showFrom=!1,this.classes.showTo=!1,this.classes.hideFrom=!0,this.classes.hideTo=!1,await fs(),this.classes.hideFrom=!1,this.classes.hideTo=!0},$_autoShowHide(){this.shown?this.show():this.hide()},$_ensureTeleport(){if(this.$_isDisposed)return;let e=this.container;if(typeof e=="string"?e=window.document.querySelector(e):e===!1&&(e=this.$_targetNodes[0].parentNode),!e)throw new Error("No container for popover: "+this.container);e.appendChild(this.$_popperNode),this.isMounted=!0},$_addEventListeners(){const e=n=>{this.isShown&&!this.$_hideInProgress||(n.usedByTooltip=!0,!this.$_preventShow&&this.show({event:n}))};this.$_registerTriggerListeners(this.$_targetNodes,Pa,this.triggers,this.showTriggers,e),this.$_registerTriggerListeners([this.$_popperNode],Pa,this.popperTriggers,this.popperShowTriggers,e);const t=n=>{n.usedByTooltip||this.hide({event:n})};this.$_registerTriggerListeners(this.$_targetNodes,Aa,this.triggers,this.hideTriggers,t),this.$_registerTriggerListeners([this.$_popperNode],Aa,this.popperTriggers,this.popperHideTriggers,t)},$_registerEventListeners(e,t,n){this.$_events.push({targetNodes:e,eventType:t,handler:n}),e.forEach(i=>i.addEventListener(t,n,We?{passive:!0}:void 0))},$_registerTriggerListeners(e,t,n,i,s){let o=n;i!=null&&(o=typeof i=="function"?i(o):i),o.forEach(r=>{const a=t[r];a&&this.$_registerEventListeners(e,a,s)})},$_removeEventListeners(e){const t=[];this.$_events.forEach(n=>{const{targetNodes:i,eventType:s,handler:o}=n;!e||e===s?i.forEach(r=>r.removeEventListener(s,o)):t.push(n)}),this.$_events=t},$_refreshListeners(){this.$_isDisposed||(this.$_removeEventListeners(),this.$_addEventListeners())},$_handleGlobalClose(e,t=!1){this.$_showFrameLocked||(this.hide({event:e}),e.closePopover?this.$emit("close-directive"):this.$emit("auto-hide"),t&&(this.$_preventShow=!0,setTimeout(()=>{this.$_preventShow=!1},300)))},$_detachPopperNode(){this.$_popperNode.parentNode&&this.$_popperNode.parentNode.removeChild(this.$_popperNode)},$_swapTargetAttrs(e,t){for(const n of this.$_targetNodes){const i=n.getAttribute(e);i&&(n.removeAttribute(e),n.setAttribute(t,i))}},$_applyAttrsToTarget(e){for(const t of this.$_targetNodes)for(const n in e){const i=e[n];i==null?t.removeAttribute(n):t.setAttribute(n,i)}},$_updateParentShownChildren(e){let t=this.parentPopper;for(;t;)e?t.shownChildren.add(this.randomId):(t.shownChildren.delete(this.randomId),t.$_pendingHide&&t.hide()),t=t.parentPopper},$_isAimingPopper(){const e=this.$_referenceNode.getBoundingClientRect();if(bn>=e.left&&bn<=e.right&&yn>=e.top&&yn<=e.bottom){const t=this.$_popperNode.getBoundingClientRect(),n=bn-Gt,i=yn-Kt,s=t.left+t.width/2-Gt+(t.top+t.height/2)-Kt+t.width+t.height,o=Gt+n*s,r=Kt+i*s;return oi(Gt,Kt,o,r,t.left,t.top,t.left,t.bottom)||oi(Gt,Kt,o,r,t.left,t.top,t.right,t.top)||oi(Gt,Kt,o,r,t.right,t.top,t.right,t.bottom)||oi(Gt,Kt,o,r,t.left,t.bottom,t.right,t.bottom)}return!1}},render(){return this.$slots.default(this.slotData)}});typeof document<"u"&&typeof window<"u"&&(Pc?(document.addEventListener("touchstart",La,We?{passive:!0,capture:!0}:!0),document.addEventListener("touchend",f_,We?{passive:!0,capture:!0}:!0)):(window.addEventListener("mousedown",La,!0),window.addEventListener("click",u_,!0)),window.addEventListener("resize",m_));function La(e){for(let t=0;t<St.length;t++){const n=St[t];try{const i=n.popperNode();n.$_mouseDownContains=i.contains(e.target)}catch{}}}function u_(e){Dc(e)}function f_(e){Dc(e,!0)}function Dc(e,t=!1){const n={};for(let i=St.length-1;i>=0;i--){const s=St[i];try{const o=s.$_containsGlobalTarget=p_(s,e);s.$_pendingHide=!1,requestAnimationFrame(()=>{if(s.$_pendingHide=!1,!n[s.randomId]&&Fa(s,o,e)){if(s.$_handleGlobalClose(e,t),!e.closeAllPopover&&e.closePopover&&o){let a=s.parentPopper;for(;a;)n[a.randomId]=!0,a=a.parentPopper;return}let r=s.parentPopper;for(;r&&Fa(r,r.$_containsGlobalTarget,e);)r.$_handleGlobalClose(e,t),r=r.parentPopper}})}catch{}}}function p_(e,t){const n=e.popperNode();return e.$_mouseDownContains||n.contains(t.target)}function Fa(e,t,n){return n.closeAllPopover||n.closePopover&&t||g_(e,n)&&!t}function g_(e,t){if(typeof e.autoHide=="function"){const n=e.autoHide(t);return e.lastAutoHide=n,n}return e.autoHide}function m_(e){for(let t=0;t<St.length;t++)St[t].$_computePosition(e)}let Gt=0,Kt=0,bn=0,yn=0;typeof window<"u"&&window.addEventListener("mousemove",e=>{Gt=bn,Kt=yn,bn=e.clientX,yn=e.clientY},We?{passive:!0}:void 0);function oi(e,t,n,i,s,o,r,a){const l=((r-s)*(t-o)-(a-o)*(e-s))/((a-o)*(n-e)-(r-s)*(i-t)),c=((n-e)*(t-o)-(i-t)*(e-s))/((a-o)*(n-e)-(r-s)*(i-t));return l>=0&&l<=1&&c>=0&&c<=1}const b_={extends:Ac()},So=(e,t)=>{const n=e.__vccOpts||e;for(const[i,s]of t)n[i]=s;return n};function y_(e,t,n,i,s,o){return j(),X("div",{ref:"reference",class:nt(["v-popper",{"v-popper--shown":e.slotData.isShown}])},[V(e.$slots,"default",Kc(Jc(e.slotData)))],2)}const x_=So(b_,[["render",y_]]);function __(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);var n=e.indexOf("Trident/");if(n>0){var i=e.indexOf("rv:");return parseInt(e.substring(i+3,e.indexOf(".",i)),10)}var s=e.indexOf("Edge/");return s>0?parseInt(e.substring(s+5,e.indexOf(".",s)),10):-1}let ui;function Ws(){Ws.init||(Ws.init=!0,ui=__()!==-1)}var Gi={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:["notify"],mounted(){Ws(),Wa(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});const e=document.createElement("object");this._resizeObject=e,e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex",-1),e.onload=this.addResizeHandlers,e.type="text/html",ui&&this.$el.appendChild(e),e.data="about:blank",ui||this.$el.appendChild(e)},beforeUnmount(){this.removeResizeHandlers()},methods:{compareAndNotify(){(!this.ignoreWidth&&this._w!==this.$el.offsetWidth||!this.ignoreHeight&&this._h!==this.$el.offsetHeight)&&(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitSize())},emitSize(){this.$emit("notify",{width:this._w,height:this._h})},addResizeHandlers(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers(){this._resizeObject&&this._resizeObject.onload&&(!ui&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const w_=Xc();za("data-v-b329ee4c");const v_={class:"resize-observer",tabindex:"-1"};$a();const S_=w_((e,t,n,i,s,o)=>(j(),Ln("div",v_)));Gi.render=S_;Gi.__scopeId="data-v-b329ee4c";Gi.__file="src/components/ResizeObserver.vue";const Ec=(e="theme")=>({computed:{themeClass(){return h_(this[e])}}}),k_=ct({name:"VPopperContent",components:{ResizeObserver:Gi},mixins:[Ec()],props:{popperId:String,theme:String,shown:Boolean,mounted:Boolean,skipTransition:Boolean,autoHide:Boolean,handleResize:Boolean,classes:Object,result:Object},emits:["hide","resize"],methods:{toPx(e){return e!=null&&!isNaN(e)?`${e}px`:null}}}),C_=["id","aria-hidden","tabindex","data-popper-placement"],O_={ref:"inner",class:"v-popper__inner"},M_=F("div",{class:"v-popper__arrow-outer"},null,-1),T_=F("div",{class:"v-popper__arrow-inner"},null,-1),P_=[M_,T_];function A_(e,t,n,i,s,o){const r=fi("ResizeObserver");return j(),X("div",{id:e.popperId,ref:"popover",class:nt(["v-popper__popper",[e.themeClass,e.classes.popperClass,{"v-popper__popper--shown":e.shown,"v-popper__popper--hidden":!e.shown,"v-popper__popper--show-from":e.classes.showFrom,"v-popper__popper--show-to":e.classes.showTo,"v-popper__popper--hide-from":e.classes.hideFrom,"v-popper__popper--hide-to":e.classes.hideTo,"v-popper__popper--skip-transition":e.skipTransition,"v-popper__popper--arrow-overflow":e.result&&e.result.arrow.overflow,"v-popper__popper--no-positioning":!e.result}]]),style:Ji(e.result?{position:e.result.strategy,transform:`translate3d(${Math.round(e.result.x)}px,${Math.round(e.result.y)}px,0)`}:void 0),"aria-hidden":e.shown?"false":"true",tabindex:e.autoHide?0:void 0,"data-popper-placement":e.result?e.result.placement:void 0,onKeyup:t[2]||(t[2]=Gc(a=>e.autoHide&&e.$emit("hide"),["esc"]))},[F("div",{class:"v-popper__backdrop",onClick:t[0]||(t[0]=a=>e.autoHide&&e.$emit("hide"))}),F("div",{class:"v-popper__wrapper",style:Ji(e.result?{transformOrigin:e.result.transformOrigin}:void 0)},[F("div",O_,[e.mounted?(j(),X(ri,{key:0},[F("div",null,[V(e.$slots,"default")]),e.handleResize?(j(),Ln(r,{key:0,onNotify:t[1]||(t[1]=a=>e.$emit("resize",a))})):vt("",!0)],64)):vt("",!0)],512),F("div",{ref:"arrow",class:"v-popper__arrow-container",style:Ji(e.result?{left:e.toPx(e.result.arrow.x),top:e.toPx(e.result.arrow.y)}:void 0)},P_,4)],4)],46,C_)}const Rc=So(k_,[["render",A_]]),Lc={methods:{show(...e){return this.$refs.popper.show(...e)},hide(...e){return this.$refs.popper.hide(...e)},dispose(...e){return this.$refs.popper.dispose(...e)},onResize(...e){return this.$refs.popper.onResize(...e)}}},D_=ct({name:"VPopperWrapper",components:{Popper:x_,PopperContent:Rc},mixins:[Lc,Ec("finalTheme")],props:{theme:{type:String,default:null}},computed:{finalTheme(){return this.theme??this.$options.vPopperTheme}},methods:{getTargetNodes(){return Array.from(this.$el.children).filter(e=>e!==this.$refs.popperContent.$el)}}});function E_(e,t,n,i,s,o){const r=fi("PopperContent"),a=fi("Popper");return j(),Ln(a,{ref:"popper",theme:e.finalTheme,"target-nodes":e.getTargetNodes,"popper-node":()=>e.$refs.popperContent.$el,class:nt([e.themeClass])},{default:xn(({popperId:l,isShown:c,shouldMountContent:h,skipTransition:d,autoHide:u,show:f,hide:p,handleResize:g,onResize:m,classes:b,result:y})=>[V(e.$slots,"default",{shown:c,show:f,hide:p}),pi(r,{ref:"popperContent","popper-id":l,theme:e.finalTheme,shown:c,mounted:h,"skip-transition":d,"auto-hide":u,"handle-resize":g,classes:b,result:y,onHide:p,onResize:m},{default:xn(()=>[V(e.$slots,"popper",{shown:c,hide:p})]),_:2},1032,["popper-id","theme","shown","mounted","skip-transition","auto-hide","handle-resize","classes","result","onHide","onResize"])]),_:3},8,["theme","target-nodes","popper-node","class"])}const ko=So(D_,[["render",E_]]);({...ko});({...ko});({...ko});ct({name:"VTooltipDirective",components:{Popper:Ac(),PopperContent:Rc},mixins:[Lc],inheritAttrs:!1,props:{theme:{type:String,default:"tooltip"},html:{type:Boolean,default:e=>Ns(e.theme,"html")},content:{type:[String,Number,Function],default:null},loadingContent:{type:String,default:e=>Ns(e.theme,"loadingContent")},targetNodes:{type:Function,required:!0}},data(){return{asyncContent:null}},computed:{isContentAsync(){return typeof this.content=="function"},loading(){return this.isContentAsync&&this.asyncContent==null},finalContent(){return this.isContentAsync?this.loading?this.loadingContent:this.asyncContent:this.content}},watch:{content:{handler(){this.fetchContent(!0)},immediate:!0},async finalContent(){await this.$nextTick(),this.$refs.popper.onResize()}},created(){this.$_fetchId=0},methods:{fetchContent(e){if(typeof this.content=="function"&&this.$_isShown&&(e||!this.$_loading&&this.asyncContent==null)){this.asyncContent=null,this.$_loading=!0;const t=++this.$_fetchId,n=this.content(this);n.then?n.then(i=>this.onResult(t,i)):this.onResult(t,n)}},onResult(e,t){e===this.$_fetchId&&(this.$_loading=!1,this.asyncContent=t)},onShow(){this.$_isShown=!0,this.fetchContent()},onHide(){this.$_isShown=!1}}});export{X_ as $,q_ as A,G_ as B,ho as C,Y_ as D,J_ as E,H_ as F,W_ as G,Zn as H,U_ as I,zd as J,pg as K,ti as L,K_ as M,Z_ as N,ru as O,ds as P,au as Q,tw as R,No as S,Oi as T,at as W,Jr as a,Gr as b,V_ as c,Q_ as d,F_ as e,N_ as f,we as g,I_ as h,iu as i,Bi as j,$_ as k,bl as l,z_ as m,yi as n,Vu as o,j_ as p,Hu as q,Bo as r,wn as s,Tt as t,$o as u,Bu as v,Yu as w,Ju as x,Qu as y,Ku as z};