codesaaz-core 0.0.22 → 0.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(Ie,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("vue-router"),require("primevue")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","primevue"],r):(Ie=typeof globalThis<"u"?globalThis:Ie||self,r(Ie.Codesaaz={},Ie.Vue,Ie.VueRouter,Ie.PrimeVue))})(this,function(Ie,r,Ye,Jr){"use strict";var n1=Object.defineProperty;var i1=(Ie,r,Ye)=>r in Ie?n1(Ie,r,{enumerable:!0,configurable:!0,writable:!0,value:Ye}):Ie[r]=Ye;var z=(Ie,r,Ye)=>i1(Ie,typeof r!="symbol"?r+"":r,Ye);var po;const is={get:ss("GET"),post:ss("POST"),put:ss("PUT"),delete:ss("DELETE")};function ss(t){return(e,n)=>{const i={method:t,headers:{}};return n&&(i.headers["Content-Type"]="application/json",i.body=JSON.stringify(n)),fetch(e,i).then(yf)}}function yf(t){return t.text().then(e=>{const n=e&&JSON.parse(e);return t.ok?n:Promise.reject(n)})}/*!
1
+ (function(Ie,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("vue-router"),require("primevue")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","primevue"],r):(Ie=typeof globalThis<"u"?globalThis:Ie||self,r(Ie.Codesaaz={},Ie.Vue,Ie.VueRouter,Ie.PrimeVue))})(this,function(Ie,r,Ye,Jr){"use strict";var t1=Object.defineProperty;var n1=(Ie,r,Ye)=>r in Ie?t1(Ie,r,{enumerable:!0,configurable:!0,writable:!0,value:Ye}):Ie[r]=Ye;var z=(Ie,r,Ye)=>n1(Ie,typeof r!="symbol"?r+"":r,Ye);var po;const is={get:ss("GET"),post:ss("POST"),put:ss("PUT"),delete:ss("DELETE")};function ss(t){return(e,n)=>{const i={method:t,headers:{}};return n&&(i.headers["Content-Type"]="application/json",i.body=JSON.stringify(n)),fetch(e,i).then(yf)}}function yf(t){return t.text().then(e=>{const n=e&&JSON.parse(e);return t.ok?n:Promise.reject(n)})}/*!
2
2
  * pinia v2.3.1
3
3
  * (c) 2025 Eduardo San Martin Morote
4
4
  * @license MIT
@@ -9,7 +9,7 @@
9
9
  */function ut(t){return typeof t=="function"}function oa(t){return t==null}const An=t=>t!==null&&!!t&&typeof t=="object"&&!Array.isArray(t);function _o(t){return Number(t)>=0}function Af(t){return typeof t=="object"&&t!==null}function Mf(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}function ra(t){if(!Af(t)||Mf(t)!=="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Zn(t,e){return Object.keys(e).forEach(n=>{if(ra(e[n])&&ra(t[n])){t[n]||(t[n]={}),Zn(t[n],e[n]);return}t[n]=e[n]}),t}function rs(t){const e=t.split(".");if(!e.length)return"";let n=String(e[0]);for(let i=1;i<e.length;i++){if(_o(e[i])){n+=`[${e[i]}]`;continue}n+=`.${e[i]}`}return n}const Vf={};function Rf(t){return Vf[t]}function aa(t,e,n){typeof n.value=="object"&&(n.value=_e(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||e==="__proto__"?Object.defineProperty(t,e,n):t[e]=n.value}function _e(t){if(typeof t!="object")return t;var e=0,n,i,s,o=Object.prototype.toString.call(t);if(o==="[object Object]"?s=Object.create(t.__proto__||null):o==="[object Array]"?s=Array(t.length):o==="[object Set]"?(s=new Set,t.forEach(function(a){s.add(_e(a))})):o==="[object Map]"?(s=new Map,t.forEach(function(a,l){s.set(_e(l),_e(a))})):o==="[object Date]"?s=new Date(+t):o==="[object RegExp]"?s=new RegExp(t.source,t.flags):o==="[object DataView]"?s=new t.constructor(_e(t.buffer)):o==="[object ArrayBuffer]"?s=t.slice(0):o.slice(-6)==="Array]"&&(s=new t.constructor(t)),s){for(i=Object.getOwnPropertySymbols(t);e<i.length;e++)aa(s,i[e],Object.getOwnPropertyDescriptor(t,i[e]));for(e=0,i=Object.getOwnPropertyNames(t);e<i.length;e++)Object.hasOwnProperty.call(s,n=i[e])&&s[n]===t[n]||aa(s,n,Object.getOwnPropertyDescriptor(t,n))}return s||t}const Ff=Symbol("vee-validate-form"),$f=Symbol("vee-validate-form-context"),Lf=typeof window<"u";function If(t){return ut(t)&&!!t.__locatorRef}function qt(t){return!!t&&ut(t.parse)&&t.__type==="VVTypedSchema"}function la(t){return!!t&&ut(t.validate)}function jf(t){return t==="checkbox"||t==="radio"}function zf(t){return An(t)||Array.isArray(t)}function Uf(t){return Array.isArray(t)?t.length===0:An(t)&&Object.keys(t).length===0}function as(t){return/^\[.+\]$/i.test(t)}function Wf(t){return ca(t)&&t.multiple}function ca(t){return t.tagName==="SELECT"}function Hf(t){return da(t)&&t.target&&"submit"in t.target}function da(t){return t?!!(typeof Event<"u"&&ut(Event)&&t instanceof Event||t&&t.srcElement):!1}function ei(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var n,i,s;if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(i=n;i--!==0;)if(!ei(t[i],e[i]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(i of t.entries())if(!e.has(i[0]))return!1;for(i of t.entries())if(!ei(i[1],e.get(i[0])))return!1;return!0}if(fa(t)&&fa(e))return!(t.size!==e.size||t.name!==e.name||t.lastModified!==e.lastModified||t.type!==e.type);if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(i of t.entries())if(!e.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!=e.length)return!1;for(i=n;i--!==0;)if(t[i]!==e[i])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();if(s=Object.keys(t),n=s.length-ua(t,s),n!==Object.keys(e).length-ua(e,Object.keys(e)))return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(e,s[i]))return!1;for(i=n;i--!==0;){var o=s[i];if(!ei(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function ua(t,e){let n=0;for(let s=e.length;s--!==0;){var i=e[s];t[i]===void 0&&n++}return n}function fa(t){return Lf?t instanceof File:!1}function ko(t){return as(t)?t.replace(/\[|\]/gi,""):t}function Bt(t,e,n){return t?as(e)?t[ko(e)]:(e||"").split(/\.|\[(\d+)\]/).filter(Boolean).reduce((s,o)=>zf(s)&&o in s?s[o]:n,t):n}function Pt(t,e,n){if(as(e)){t[ko(e)]=n;return}const i=e.split(/\.|\[(\d+)\]/).filter(Boolean);let s=t;for(let o=0;o<i.length;o++){if(o===i.length-1){s[i[o]]=n;return}(!(i[o]in s)||oa(s[i[o]]))&&(s[i[o]]=_o(i[o+1])?[]:{}),s=s[i[o]]}}function So(t,e){if(Array.isArray(t)&&_o(e)){t.splice(Number(e),1);return}An(t)&&delete t[e]}function ha(t,e){if(as(e)){delete t[ko(e)];return}const n=e.split(/\.|\[(\d+)\]/).filter(Boolean);let i=t;for(let o=0;o<n.length;o++){if(o===n.length-1){So(i,n[o]);break}if(!(n[o]in i)||oa(i[n[o]]))break;i=i[n[o]]}const s=n.map((o,a)=>Bt(t,n.slice(0,a).join(".")));for(let o=s.length-1;o>=0;o--)if(Uf(s[o])){if(o===0){So(t,n[0]);continue}So(s[o-1],n[o-1])}}function rt(t){return Object.keys(t)}function ma(t,e=0){let n=null,i=[];return function(...s){return n&&clearTimeout(n),n=setTimeout(()=>{const o=t(...s);i.forEach(a=>a(o)),i=[]},e),new Promise(o=>i.push(o))}}function qf(t,e){let n;return async function(...s){const o=t(...s);n=o;const a=await o;return o!==n?a:(n=void 0,e(a,s))}}function pa(t){return Array.isArray(t)?t:t?[t]:[]}function ls(t,e){const n={};for(const i in t)e.includes(i)||(n[i]=t[i]);return n}function Yf(t){let e=null,n=[];return function(...i){const s=r.nextTick(()=>{if(e!==s)return;const o=t(...i);n.forEach(a=>a(o)),n=[],e=null});return e=s,new Promise(o=>n.push(o))}}function wo(t){if(ga(t))return t._value}function ga(t){return"_value"in t}function Kf(t){return t.type==="number"||t.type==="range"?Number.isNaN(t.valueAsNumber)?t.value:t.valueAsNumber:t.value}function ya(t){if(!da(t))return t;const e=t.target;if(jf(e.type)&&ga(e))return wo(e);if(e.type==="file"&&e.files){const n=Array.from(e.files);return e.multiple?n:n[0]}if(Wf(e))return Array.from(e.options).filter(n=>n.selected&&!n.disabled).map(wo);if(ca(e)){const n=Array.from(e.options).find(i=>i.selected);return n?wo(n):e.value}return Kf(e)}function Xf(t){const e={};return Object.defineProperty(e,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),t?An(t)&&t._$$isNormalized?t:An(t)?Object.keys(t).reduce((n,i)=>{const s=Gf(t[i]);return t[i]!==!1&&(n[i]=ba(s)),n},e):typeof t!="string"?e:t.split("|").reduce((n,i)=>{const s=Jf(i);return s.name&&(n[s.name]=ba(s.params)),n},e):e}function Gf(t){return t===!0?[]:Array.isArray(t)||An(t)?t:[t]}function ba(t){const e=n=>typeof n=="string"&&n[0]==="@"?Qf(n.slice(1)):n;return Array.isArray(t)?t.map(e):t instanceof RegExp?[t]:Object.keys(t).reduce((n,i)=>(n[i]=e(t[i]),n),{})}const Jf=t=>{let e=[];const n=t.split(":")[0];return t.includes(":")&&(e=t.split(":").slice(1).join(":").split(",")),{name:n,params:e}};function Qf(t){const e=n=>{var i;return(i=Bt(n,t))!==null&&i!==void 0?i:n[t]};return e.__locatorRef=t,e}let Zf=Object.assign({},{generateMessage:({field:t})=>`${t} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0});const ti=()=>Zf;async function eh(t,e,n={}){const i=n==null?void 0:n.bails,s={name:(n==null?void 0:n.name)||"{field}",rules:e,label:n==null?void 0:n.label,bails:i??!0,formData:(n==null?void 0:n.values)||{}},o=await th(s,t);return Object.assign(Object.assign({},o),{valid:!o.errors.length})}async function th(t,e){const n=t.rules;if(qt(n)||la(n))return ih(e,Object.assign(Object.assign({},t),{rules:n}));if(ut(n)||Array.isArray(n)){const l={field:t.label||t.name,name:t.name,label:t.label,form:t.formData,value:e},c=Array.isArray(n)?n:[n],d=c.length,u=[];for(let f=0;f<d;f++){const h=c[f],m=await h(e,l);if(!(typeof m!="string"&&!Array.isArray(m)&&m)){if(Array.isArray(m))u.push(...m);else{const g=typeof m=="string"?m:_a(l);u.push(g)}if(t.bails)return{errors:u}}}return{errors:u}}const i=Object.assign(Object.assign({},t),{rules:Xf(n)}),s=[],o=Object.keys(i.rules),a=o.length;for(let l=0;l<a;l++){const c=o[l],d=await sh(i,e,{name:c,params:i.rules[c]});if(d.error&&(s.push(d.error),t.bails))return{errors:s}}return{errors:s}}function nh(t){return!!t&&t.name==="ValidationError"}function xa(t){return{__type:"VVTypedSchema",async parse(n,i){var s;try{return{output:await t.validate(n,{abortEarly:!1,context:(i==null?void 0:i.formData)||{}}),errors:[]}}catch(o){if(!nh(o))throw o;if(!(!((s=o.inner)===null||s===void 0)&&s.length)&&o.errors.length)return{errors:[{path:o.path,errors:o.errors}]};const a=o.inner.reduce((l,c)=>{const d=c.path||"";return l[d]||(l[d]={errors:[],path:d}),l[d].errors.push(...c.errors),l},{});return{errors:Object.values(a)}}}}}async function ih(t,e){const i=await(qt(e.rules)?e.rules:xa(e.rules)).parse(t,{formData:e.formData}),s=[];for(const o of i.errors)o.errors.length&&s.push(...o.errors);return{value:i.value,errors:s}}async function sh(t,e,n){const i=Rf(n.name);if(!i)throw new Error(`No such validator '${n.name}' exists.`);const s=oh(n.params,t.formData),o={field:t.label||t.name,name:t.name,label:t.label,value:e,form:t.formData,rule:Object.assign(Object.assign({},n),{params:s})},a=await i(e,s,o);return typeof a=="string"?{error:a}:{error:a?void 0:_a(o)}}function _a(t){const e=ti().generateMessage;return e?e(t):"Field is invalid"}function oh(t,e){const n=i=>If(i)?i(e):i;return Array.isArray(t)?t.map(n):Object.keys(t).reduce((i,s)=>(i[s]=n(t[s]),i),{})}async function rh(t,e){const i=await(qt(t)?t:xa(t)).parse(_e(e),{formData:_e(e)}),s={},o={};for(const a of i.errors){const l=a.errors,c=(a.path||"").replace(/\["(\d+)"\]/g,(d,u)=>`[${u}]`);s[c]={valid:!l.length,errors:l},l.length&&(o[c]=l[0])}return{valid:!i.errors.length,results:s,errors:o,values:i.value,source:"schema"}}async function ah(t,e,n){const s=rt(t).map(async d=>{var u,f,h;const m=(u=n==null?void 0:n.names)===null||u===void 0?void 0:u[d],p=await eh(Bt(e,d),t[d],{name:(m==null?void 0:m.name)||d,label:m==null?void 0:m.label,values:e,bails:(h=(f=n==null?void 0:n.bailsMap)===null||f===void 0?void 0:f[d])!==null&&h!==void 0?h:!0});return Object.assign(Object.assign({},p),{path:d})});let o=!0;const a=await Promise.all(s),l={},c={};for(const d of a)l[d.path]={valid:d.valid,errors:d.errors},d.valid||(o=!1,c[d.path]=d.errors[0]);return{valid:o,results:l,errors:c,source:"schema"}}let lh=0;const cs=["bails","fieldsCount","id","multiple","type","validate"];function ka(t){const e={},n=Object.assign({},r.toValue(e)),i=r.unref(void 0);return i&&qt(i)&&ut(i.cast)?_e(i.cast(n)||{}):_e(n)}function Sa(t){var e;const n=lh++,i="Form";let s=0;const o=r.ref(!1),a=r.ref(!1),l=r.ref(0),c=[],d=r.reactive(ka()),u=r.ref([]),f=r.ref({}),h=r.ref({}),m=Yf(()=>{h.value=u.value.reduce((N,D)=>(N[rs(r.toValue(D.path))]=D,N),{})});function p(N,D){const V=j(N);if(!V){typeof N=="string"&&(f.value[rs(N)]=pa(D));return}if(typeof N=="string"){const q=rs(N);f.value[q]&&delete f.value[q]}V.errors=pa(D),V.valid=!V.errors.length}function g(N){rt(N).forEach(D=>{p(D,N[D])})}const y=r.computed(()=>{const N=u.value.reduce((D,V)=>(V.errors.length&&(D[r.toValue(V.path)]=V.errors),D),{});return Object.assign(Object.assign({},f.value),N)}),b=r.computed(()=>rt(y.value).reduce((N,D)=>{const V=y.value[D];return V!=null&&V.length&&(N[D]=V[0]),N},{})),x=r.computed(()=>u.value.reduce((N,D)=>(N[r.toValue(D.path)]={name:r.toValue(D.path)||"",label:D.label||""},N),{})),w=r.computed(()=>u.value.reduce((N,D)=>{var V;return N[r.toValue(D.path)]=(V=D.bails)!==null&&V!==void 0?V:!0,N},{})),E=Object.assign({},{}),k=(e=void 0)!==null&&e!==void 0?e:!1,{initialValues:C,originalInitialValues:S,setInitialValues:_}=dh(u,d),O=ch(u,d,S,b),P=r.computed(()=>u.value.reduce((N,D)=>{const V=Bt(d,r.toValue(D.path));return Pt(N,r.toValue(D.path),V),N},{})),v=void 0;function T(N,D){var V,q;const te=r.computed(()=>Bt(C.value,r.toValue(N))),le=h.value[r.toValue(N)],Z=(D==null?void 0:D.type)==="checkbox"||(D==null?void 0:D.type)==="radio";if(le&&Z){le.multiple=!0;const Ne=s++;return Array.isArray(le.id)?le.id.push(Ne):le.id=[le.id,Ne],le.fieldsCount++,le.__flags.pendingUnmount[Ne]=!1,le}const M=r.computed(()=>Bt(d,r.toValue(N))),W=r.toValue(N),G=A.findIndex(Ne=>Ne===W);G!==-1&&A.splice(G,1);const X=r.computed(()=>{var Ne,ze,es,ts;const ns=r.toValue(v);if(qt(ns))return(ze=(Ne=ns.describe)===null||Ne===void 0?void 0:Ne.call(ns,r.toValue(N)).required)!==null&&ze!==void 0?ze:!1;const Gr=r.toValue(D==null?void 0:D.schema);return qt(Gr)&&(ts=(es=Gr.describe)===null||es===void 0?void 0:es.call(Gr).required)!==null&&ts!==void 0?ts:!1}),ie=s++,xe=r.reactive({id:ie,path:N,touched:!1,pending:!1,valid:!0,validated:!!(!((V=E[W])===null||V===void 0)&&V.length),required:X,initialValue:te,errors:r.shallowRef([]),bails:(q=D==null?void 0:D.bails)!==null&&q!==void 0?q:!1,label:D==null?void 0:D.label,type:(D==null?void 0:D.type)||"default",value:M,multiple:!1,__flags:{pendingUnmount:{[ie]:!1},pendingReset:!1},fieldsCount:1,validate:D==null?void 0:D.validate,dirty:r.computed(()=>!ei(r.unref(M),r.unref(te)))});return u.value.push(xe),h.value[W]=xe,m(),b.value[W]&&!E[W]&&r.nextTick(()=>{Ze(W,{mode:"silent"})}),r.isRef(N)&&r.watch(N,Ne=>{m();const ze=_e(M.value);h.value[Ne]=xe,r.nextTick(()=>{Pt(d,Ne,ze)})}),xe}const R=ma(dt,5),U=ma(dt,5),Y=qf(async N=>await(N==="silent"?R():U()),(N,[D])=>{const V=rt(ue.errorBag.value),te=[...new Set([...rt(N.results),...u.value.map(le=>le.path),...V])].sort().reduce((le,Z)=>{var M;const W=Z,G=j(W)||$(W),X=((M=N.results[W])===null||M===void 0?void 0:M.errors)||[],ie=r.toValue(G==null?void 0:G.path)||W,xe=uh({errors:X,valid:!X.length},le.results[ie]);return le.results[ie]=xe,xe.valid||(le.errors[ie]=xe.errors[0]),G&&f.value[ie]&&delete f.value[ie],G?(G.valid=xe.valid,D==="silent"||D==="validated-only"&&!G.validated||p(G,xe.errors),le):(p(ie,X),le)},{valid:N.valid,results:{},errors:{},source:N.source});return N.values&&(te.values=N.values,te.source=N.source),rt(te.results).forEach(le=>{var Z;const M=j(le);M&&D!=="silent"&&(D==="validated-only"&&!M.validated||p(M,(Z=te.results[le])===null||Z===void 0?void 0:Z.errors))}),te});function L(N){u.value.forEach(N)}function j(N){const D=typeof N=="string"?rs(N):N;return typeof D=="string"?h.value[D]:D}function $(N){return u.value.filter(V=>N.startsWith(r.toValue(V.path))).reduce((V,q)=>V?q.path.length>V.path.length?q:V:q,void 0)}let A=[],I;function Q(N){return A.push(N),I||(I=r.nextTick(()=>{[...A].sort().reverse().forEach(V=>{ha(d,V)}),A=[],I=null})),I}function ne(N){return function(V,q){return function(le){return le instanceof Event&&(le.preventDefault(),le.stopPropagation()),L(Z=>Z.touched=!0),o.value=!0,l.value++,Te().then(Z=>{const M=_e(d);if(Z.valid&&typeof V=="function"){const W=_e(P.value);let G=N?W:M;return Z.values&&(G=Z.source==="schema"?Z.values:Object.assign({},G,Z.values)),V(G,{evt:le,controlledValues:W,setErrors:g,setFieldError:p,setTouched:pe,setFieldTouched:ct,setValues:qe,setFieldValue:ve,resetForm:ge,resetField:me})}!Z.valid&&typeof q=="function"&&q({values:M,evt:le,errors:Z.errors,results:Z.results})}).then(Z=>(o.value=!1,Z),Z=>{throw o.value=!1,Z})}}}const K=ne(!1);K.withControlled=ne(!0);function J(N,D){const V=u.value.findIndex(te=>te.path===N&&(Array.isArray(te.id)?te.id.includes(D):te.id===D)),q=u.value[V];if(!(V===-1||!q)){if(r.nextTick(()=>{Ze(N,{mode:"silent",warn:!1})}),q.multiple&&q.fieldsCount&&q.fieldsCount--,Array.isArray(q.id)){const te=q.id.indexOf(D);te>=0&&q.id.splice(te,1),delete q.__flags.pendingUnmount[D]}(!q.multiple||q.fieldsCount<=0)&&(u.value.splice(V,1),Tt(N),m(),delete h.value[N])}}function oe(N){rt(h.value).forEach(D=>{D.startsWith(N)&&delete h.value[D]}),u.value=u.value.filter(D=>!D.path.startsWith(N)),r.nextTick(()=>{m()})}const ue={name:i,formId:n,values:d,controlledValues:P,errorBag:y,errors:b,schema:v,submitCount:l,meta:O,isSubmitting:o,isValidating:a,fieldArrays:c,keepValuesOnUnmount:k,validateSchema:r.unref(v)?Y:void 0,validate:Te,setFieldError:p,validateField:Ze,setFieldValue:ve,setValues:qe,setErrors:g,setFieldTouched:ct,setTouched:pe,resetForm:ge,resetField:me,handleSubmit:K,useFieldModel:Bn,defineInputBinds:ee,defineComponentBinds:_t,defineField:un,stageInitialValue:$e,unsetInitialValue:Tt,setFieldInitialValue:et,createPathState:T,getPathState:j,unsetPathValue:Q,removePathState:J,initialValues:C,getAllPathStates:()=>u.value,destroyPath:oe,isFieldTouched:H,isFieldDirty:F,isFieldValid:he};function ve(N,D,V=!0){const q=_e(D),te=typeof N=="string"?N:N.path;j(te)||T(te),Pt(d,te,q),V&&Ze(te)}function st(N,D=!0){rt(d).forEach(V=>{delete d[V]}),rt(N).forEach(V=>{ve(V,N[V],!1)}),D&&Te()}function qe(N,D=!0){Zn(d,N),c.forEach(V=>V&&V.reset()),D&&Te()}function xt(N,D){const V=j(r.toValue(N))||T(N);return r.computed({get(){return V.value},set(q){var te;const le=r.toValue(N);ve(le,q,(te=r.toValue(D))!==null&&te!==void 0?te:!1)}})}function ct(N,D){const V=j(N);V&&(V.touched=D)}function H(N){const D=j(N);return D?D.touched:u.value.filter(V=>V.path.startsWith(N)).some(V=>V.touched)}function F(N){const D=j(N);return D?D.dirty:u.value.filter(V=>V.path.startsWith(N)).some(V=>V.dirty)}function he(N){const D=j(N);return D?D.valid:u.value.filter(V=>V.path.startsWith(N)).every(V=>V.valid)}function pe(N){if(typeof N=="boolean"){L(D=>{D.touched=N});return}rt(N).forEach(D=>{ct(D,!!N[D])})}function me(N,D){var V;const q=D&&"value"in D?D.value:Bt(C.value,N),te=j(N);te&&(te.__flags.pendingReset=!0),et(N,_e(q),!0),ve(N,q,!1),ct(N,(V=D==null?void 0:D.touched)!==null&&V!==void 0?V:!1),p(N,(D==null?void 0:D.errors)||[]),r.nextTick(()=>{te&&(te.__flags.pendingReset=!1)})}function ge(N,D){let V=_e(N!=null&&N.values?N.values:S.value);V=D!=null&&D.force?V:Zn(S.value,V),V=qt(v)&&ut(v.cast)?v.cast(V):V,_(V,{force:D==null?void 0:D.force}),L(q=>{var te;q.__flags.pendingReset=!0,q.validated=!1,q.touched=((te=N==null?void 0:N.touched)===null||te===void 0?void 0:te[r.toValue(q.path)])||!1,ve(r.toValue(q.path),Bt(V,r.toValue(q.path)),!1),p(r.toValue(q.path),void 0)}),D!=null&&D.force?st(V,!1):qe(V,!1),g((N==null?void 0:N.errors)||{}),l.value=(N==null?void 0:N.submitCount)||0,r.nextTick(()=>{Te({mode:"silent"}),L(q=>{q.__flags.pendingReset=!1})})}async function Te(N){const D=(N==null?void 0:N.mode)||"force";if(D==="force"&&L(Z=>Z.validated=!0),ue.validateSchema)return ue.validateSchema(D);a.value=!0;const V=await Promise.all(u.value.map(Z=>Z.validate?Z.validate(N).then(M=>({key:r.toValue(Z.path),valid:M.valid,errors:M.errors,value:M.value})):Promise.resolve({key:r.toValue(Z.path),valid:!0,errors:[],value:void 0})));a.value=!1;const q={},te={},le={};for(const Z of V)q[Z.key]={valid:Z.valid,errors:Z.errors},Z.value&&Pt(le,Z.key,Z.value),Z.errors.length&&(te[Z.key]=Z.errors[0]);return{valid:V.every(Z=>Z.valid),results:q,errors:te,values:le,source:"fields"}}async function Ze(N,D){var V;const q=j(N);return q&&(D==null?void 0:D.mode)!=="silent"&&(q.validated=!0),q!=null&&q.validate?q.validate(D):(!q&&(V=D==null?void 0:D.warn),Promise.resolve({errors:[],valid:!0}))}function Tt(N){ha(C.value,N)}function $e(N,D,V=!1){et(N,D),Pt(d,N,D),V&&Pt(S.value,N,_e(D))}function et(N,D,V=!1){Pt(C.value,N,_e(D)),V&&Pt(S.value,N,_e(D))}async function dt(){const N=r.unref(v);if(!N)return{valid:!0,results:{},errors:{},source:"none"};a.value=!0;const D=la(N)||qt(N)?await rh(N,d):await ah(N,d,{names:x.value,bailsMap:w.value});return a.value=!1,D}const dn=K((N,{evt:D})=>{Hf(D)&&D.target.submit()});r.onMounted(()=>{ue.validateSchema&&ue.validateSchema("silent")}),r.isRef(v)&&r.watch(v,()=>{var N;(N=ue.validateSchema)===null||N===void 0||N.call(ue,"validated-only")}),r.provide(Ff,ue);function un(N,D){const V=ut(D)||D==null?void 0:D.label,q=j(r.toValue(N))||T(N,{label:V}),te=()=>ut(D)?D(ls(q,cs)):D||{};function le(){var X;q.touched=!0,((X=te().validateOnBlur)!==null&&X!==void 0?X:ti().validateOnBlur)&&Ze(r.toValue(q.path))}function Z(){var X;((X=te().validateOnInput)!==null&&X!==void 0?X:ti().validateOnInput)&&r.nextTick(()=>{Ze(r.toValue(q.path))})}function M(){var X;((X=te().validateOnChange)!==null&&X!==void 0?X:ti().validateOnChange)&&r.nextTick(()=>{Ze(r.toValue(q.path))})}const W=r.computed(()=>{const X={onChange:M,onInput:Z,onBlur:le};return ut(D)?Object.assign(Object.assign({},X),D(ls(q,cs)).props||{}):D!=null&&D.props?Object.assign(Object.assign({},X),D.props(ls(q,cs))):X});return[xt(N,()=>{var X,ie,xe;return(xe=(X=te().validateOnModelUpdate)!==null&&X!==void 0?X:(ie=ti())===null||ie===void 0?void 0:ie.validateOnModelUpdate)!==null&&xe!==void 0?xe:!0}),W]}function Bn(N){return Array.isArray(N)?N.map(D=>xt(D,!0)):xt(N)}function ee(N,D){const[V,q]=un(N,D);function te(){q.value.onBlur()}function le(M){const W=ya(M);ve(r.toValue(N),W,!1),q.value.onInput()}function Z(M){const W=ya(M);ve(r.toValue(N),W,!1),q.value.onChange()}return r.computed(()=>Object.assign(Object.assign({},q.value),{onBlur:te,onInput:le,onChange:Z,value:V.value}))}function _t(N,D){const[V,q]=un(N,D),te=j(r.toValue(N));function le(Z){V.value=Z}return r.computed(()=>{const Z=ut(D)?D(ls(te,cs)):D||{};return Object.assign({[Z.model||"modelValue"]:V.value,[`onUpdate:${Z.model||"modelValue"}`]:le},q.value)})}const Ae=Object.assign(Object.assign({},ue),{values:r.readonly(d),handleReset:()=>ge(),submitForm:dn});return r.provide($f,Ae),Ae}function ch(t,e,n,i){const s={touched:"some",pending:"some",valid:"every"},o=r.computed(()=>!ei(e,r.unref(n)));function a(){const c=t.value;return rt(s).reduce((d,u)=>{const f=s[u];return d[u]=c[f](h=>h[u]),d},{})}const l=r.reactive(a());return r.watchEffect(()=>{const c=a();l.touched=c.touched,l.valid=c.valid,l.pending=c.pending}),r.computed(()=>Object.assign(Object.assign({initialValues:r.unref(n)},l),{valid:l.valid&&!rt(i.value).length,dirty:o.value}))}function dh(t,e,n){const i=ka(),s=r.ref(i),o=r.ref(_e(i));function a(l,c){c!=null&&c.force?(s.value=_e(l),o.value=_e(l)):(s.value=Zn(_e(s.value)||{},_e(l)),o.value=Zn(_e(o.value)||{},_e(l))),c!=null&&c.updateFields&&t.value.forEach(d=>{if(d.touched)return;const f=Bt(s.value,r.toValue(d.path));Pt(e,r.toValue(d.path),_e(f))})}return{initialValues:s,originalInitialValues:o,setInitialValues:a}}function uh(t,e){return e?{valid:t.valid&&e.valid,errors:[...t.errors,...e.errors]}:t}function fh(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Eo,wa;function hh(){if(wa)return Eo;wa=1;function t(b){this._maxSize=b,this.clear()}t.prototype.clear=function(){this._size=0,this._values=Object.create(null)},t.prototype.get=function(b){return this._values[b]},t.prototype.set=function(b,x){return this._size>=this._maxSize&&this.clear(),b in this._values||this._size++,this._values[b]=x};var e=/[^.^\]^[]+|(?=\[\]|\.\.)/g,n=/^\d+$/,i=/^\d/,s=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,o=/^\s*(['"]?)(.*?)(\1)\s*$/,a=512,l=new t(a),c=new t(a),d=new t(a);Eo={Cache:t,split:f,normalizePath:u,setter:function(b){var x=u(b);return c.get(b)||c.set(b,function(E,k){for(var C=0,S=x.length,_=E;C<S-1;){var O=x[C];if(O==="__proto__"||O==="constructor"||O==="prototype")return E;_=_[x[C++]]}_[x[C]]=k})},getter:function(b,x){var w=u(b);return d.get(b)||d.set(b,function(k){for(var C=0,S=w.length;C<S;)if(k!=null||!x)k=k[w[C++]];else return;return k})},join:function(b){return b.reduce(function(x,w){return x+(m(w)||n.test(w)?"["+w+"]":(x?".":"")+w)},"")},forEach:function(b,x,w){h(Array.isArray(b)?b:f(b),x,w)}};function u(b){return l.get(b)||l.set(b,f(b).map(function(x){return x.replace(o,"$2")}))}function f(b){return b.match(e)||[""]}function h(b,x,w){var E=b.length,k,C,S,_;for(C=0;C<E;C++)k=b[C],k&&(y(k)&&(k='"'+k+'"'),_=m(k),S=!_&&/^\d+$/.test(k),x.call(w,k,_,S,C,b))}function m(b){return typeof b=="string"&&b&&["'",'"'].indexOf(b.charAt(0))!==-1}function p(b){return b.match(i)&&!b.match(n)}function g(b){return s.test(b)}function y(b){return!m(b)&&(p(b)||g(b))}return Eo}var hn=hh(),Co,Ea;function mh(){if(Ea)return Co;Ea=1;const t=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,e=u=>u.match(t)||[],n=u=>u[0].toUpperCase()+u.slice(1),i=(u,f)=>e(u).join(f).toLowerCase(),s=u=>e(u).reduce((f,h)=>`${f}${f?h[0].toUpperCase()+h.slice(1).toLowerCase():h.toLowerCase()}`,"");return Co={words:e,upperFirst:n,camelCase:s,pascalCase:u=>n(s(u)),snakeCase:u=>i(u,"_"),kebabCase:u=>i(u,"-"),sentenceCase:u=>n(i(u," ")),titleCase:u=>e(u).map(n).join(" ")},Co}var Oo=mh(),ds={exports:{}},Ca;function ph(){if(Ca)return ds.exports;Ca=1,ds.exports=function(s){return t(e(s),s)},ds.exports.array=t;function t(s,o){var a=s.length,l=new Array(a),c={},d=a,u=n(o),f=i(s);for(o.forEach(function(m){if(!f.has(m[0])||!f.has(m[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});d--;)c[d]||h(s[d],d,new Set);return l;function h(m,p,g){if(g.has(m)){var y;try{y=", node was:"+JSON.stringify(m)}catch{y=""}throw new Error("Cyclic dependency"+y)}if(!f.has(m))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(m));if(!c[p]){c[p]=!0;var b=u.get(m)||new Set;if(b=Array.from(b),p=b.length){g.add(m);do{var x=b[--p];h(x,f.get(x),g)}while(p);g.delete(m)}l[--a]=m}}}function e(s){for(var o=new Set,a=0,l=s.length;a<l;a++){var c=s[a];o.add(c[0]),o.add(c[1])}return Array.from(o)}function n(s){for(var o=new Map,a=0,l=s.length;a<l;a++){var c=s[a];o.has(c[0])||o.set(c[0],new Set),o.has(c[1])||o.set(c[1],new Set),o.get(c[0]).add(c[1])}return o}function i(s){for(var o=new Map,a=0,l=s.length;a<l;a++)o.set(s[a],a);return o}return ds.exports}var gh=ph();const yh=fh(gh),bh=Object.prototype.toString,xh=Error.prototype.toString,_h=RegExp.prototype.toString,kh=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Sh=/^Symbol\((.*)\)(.*)$/;function wh(t){return t!=+t?"NaN":t===0&&1/t<0?"-0":""+t}function Oa(t,e=!1){if(t==null||t===!0||t===!1)return""+t;const n=typeof t;if(n==="number")return wh(t);if(n==="string")return e?`"${t}"`:t;if(n==="function")return"[Function "+(t.name||"anonymous")+"]";if(n==="symbol")return kh.call(t).replace(Sh,"Symbol($1)");const i=bh.call(t).slice(8,-1);return i==="Date"?isNaN(t.getTime())?""+t:t.toISOString(t):i==="Error"||t instanceof Error?"["+xh.call(t)+"]":i==="RegExp"?_h.call(t):null}function Yt(t,e){let n=Oa(t,e);return n!==null?n:JSON.stringify(t,function(i,s){let o=Oa(this[i],e);return o!==null?o:s},2)}function va(t){return t==null?[]:[].concat(t)}let Na,Da,Ta,Eh=/\$\{\s*(\w+)\s*\}/g;Na=Symbol.toStringTag;class Ba{constructor(e,n,i,s){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[Na]="Error",this.name="ValidationError",this.value=n,this.path=i,this.type=s,this.errors=[],this.inner=[],va(e).forEach(o=>{if(Ke.isError(o)){this.errors.push(...o.errors);const a=o.inner.length?o.inner:[o];this.inner.push(...a)}else this.errors.push(o)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}Da=Symbol.hasInstance,Ta=Symbol.toStringTag;class Ke extends Error{static formatError(e,n){const i=n.label||n.path||"this";return n=Object.assign({},n,{path:i,originalPath:n.path}),typeof e=="string"?e.replace(Eh,(s,o)=>Yt(n[o])):typeof e=="function"?e(n):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,n,i,s,o){const a=new Ba(e,n,i,s);if(o)return a;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[Ta]="Error",this.name=a.name,this.message=a.message,this.type=a.type,this.value=a.value,this.path=a.path,this.errors=a.errors,this.inner=a.inner,Error.captureStackTrace&&Error.captureStackTrace(this,Ke)}static[Da](e){return Ba[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let kt={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:t,type:e,value:n,originalValue:i})=>{const s=i!=null&&i!==n?` (cast from the value \`${Yt(i,!0)}\`).`:".";return e!=="mixed"?`${t} must be a \`${e}\` type, but the final value was: \`${Yt(n,!0)}\``+s:`${t} must match the configured type. The validated value was: \`${Yt(n,!0)}\``+s}},Xe={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Ch={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},vo={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Oh={isValue:"${path} field must be ${value}"},us={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"};Object.assign(Object.create(null),{mixed:kt,string:Xe,number:Ch,date:vo,object:us,array:{min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},boolean:Oh,tuple:{notType:t=>{const{path:e,value:n,spec:i}=t,s=i.types.length;if(Array.isArray(n)){if(n.length<s)return`${e} tuple value has too few items, expected a length of ${s} but got ${n.length} for value: \`${Yt(n,!0)}\``;if(n.length>s)return`${e} tuple value has too many items, expected a length of ${s} but got ${n.length} for value: \`${Yt(n,!0)}\``}return Ke.formatError(kt.notType,t)}}});const No=t=>t&&t.__isYupSchema__;class fs{static fromOptions(e,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:i,then:s,otherwise:o}=n,a=typeof i=="function"?i:(...l)=>l.every(c=>c===i);return new fs(e,(l,c)=>{var d;let u=a(...l)?s:o;return(d=u==null?void 0:u(c))!=null?d:c})}constructor(e,n){this.fn=void 0,this.refs=e,this.refs=e,this.fn=n}resolve(e,n){let i=this.refs.map(o=>o.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),s=this.fn(i,e,n);if(s===void 0||s===e)return e;if(!No(s))throw new TypeError("conditions must return a schema object");return s.resolve(n)}}const hs={context:"$",value:"."};class mn{constructor(e,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof e!="string")throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===hs.context,this.isValue=this.key[0]===hs.value,this.isSibling=!this.isContext&&!this.isValue;let i=this.isContext?hs.context:this.isValue?hs.value:"";this.path=this.key.slice(i.length),this.getter=this.path&&hn.getter(this.path,!0),this.map=n.map}getValue(e,n,i){let s=this.isContext?i:this.isValue?e:n;return this.getter&&(s=this.getter(s||{})),this.map&&(s=this.map(s)),s}cast(e,n){return this.getValue(e,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}mn.prototype.__isYupRef=!0;const pn=t=>t==null;function Mn(t){function e({value:n,path:i="",options:s,originalValue:o,schema:a},l,c){const{name:d,test:u,params:f,message:h,skipAbsent:m}=t;let{parent:p,context:g,abortEarly:y=a.spec.abortEarly,disableStackTrace:b=a.spec.disableStackTrace}=s;function x(v){return mn.isRef(v)?v.getValue(n,p,g):v}function w(v={}){const T=Object.assign({value:n,originalValue:o,label:a.spec.label,path:v.path||i,spec:a.spec,disableStackTrace:v.disableStackTrace||b},f,v.params);for(const U of Object.keys(T))T[U]=x(T[U]);const R=new Ke(Ke.formatError(v.message||h,T),n,T.path,v.type||d,T.disableStackTrace);return R.params=T,R}const E=y?l:c;let k={path:i,parent:p,type:d,from:s.from,createError:w,resolve:x,options:s,originalValue:o,schema:a};const C=v=>{Ke.isError(v)?E(v):v?c(null):E(w())},S=v=>{Ke.isError(v)?E(v):l(v)};if(m&&pn(n))return C(!0);let O;try{var P;if(O=u.call(k,n,k),typeof((P=O)==null?void 0:P.then)=="function"){if(s.sync)throw new Error(`Validation test of type: "${k.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(O).then(C,S)}}catch(v){S(v);return}C(O)}return e.OPTIONS=t,e}function vh(t,e,n,i=n){let s,o,a;return e?(hn.forEach(e,(l,c,d)=>{let u=c?l.slice(1,l.length-1):l;t=t.resolve({context:i,parent:s,value:n});let f=t.type==="tuple",h=d?parseInt(u,10):0;if(t.innerType||f){if(f&&!d)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${a}" must contain an index to the tuple element, e.g. "${a}[0]"`);if(n&&h>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${l}, in the path: ${e}. because there is no value at that index. `);s=n,n=n&&n[h],t=f?t.spec.types[h]:t.innerType}if(!d){if(!t.fields||!t.fields[u])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${a} which is a type: "${t.type}")`);s=n,n=n&&n[u],t=t.fields[u]}o=u,a=c?"["+l+"]":"."+l}),{schema:t,parent:s,parentPath:o}):{parent:s,parentPath:e,schema:t}}class ms extends Set{describe(){const e=[];for(const n of this.values())e.push(mn.isRef(n)?n.describe():n);return e}resolveAll(e){let n=[];for(const i of this.values())n.push(e(i));return n}clone(){return new ms(this.values())}merge(e,n){const i=this.clone();return e.forEach(s=>i.add(s)),n.forEach(s=>i.delete(s)),i}}function Vn(t,e=new Map){if(No(t)||!t||typeof t!="object")return t;if(e.has(t))return e.get(t);let n;if(t instanceof Date)n=new Date(t.getTime()),e.set(t,n);else if(t instanceof RegExp)n=new RegExp(t),e.set(t,n);else if(Array.isArray(t)){n=new Array(t.length),e.set(t,n);for(let i=0;i<t.length;i++)n[i]=Vn(t[i],e)}else if(t instanceof Map){n=new Map,e.set(t,n);for(const[i,s]of t.entries())n.set(i,Vn(s,e))}else if(t instanceof Set){n=new Set,e.set(t,n);for(const i of t)n.add(Vn(i,e))}else if(t instanceof Object){n={},e.set(t,n);for(const[i,s]of Object.entries(t))n[i]=Vn(s,e)}else throw Error(`Unable to clone ${t}`);return n}class St{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new ms,this._blacklist=new ms,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(kt.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},e==null?void 0:e.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=Vn(Object.assign({},this.spec,e)),n}label(e){let n=this.clone();return n.spec.label=e,n}meta(...e){if(e.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},e[0]),n}withMutation(e){let n=this._mutate;this._mutate=!0;let i=e(this);return this._mutate=n,i}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let n=this,i=e.clone();const s=Object.assign({},n.spec,i.spec);return i.spec=s,i.internalTests=Object.assign({},n.internalTests,i.internalTests),i._whitelist=n._whitelist.merge(e._whitelist,e._blacklist),i._blacklist=n._blacklist.merge(e._blacklist,e._whitelist),i.tests=n.tests,i.exclusiveTests=n.exclusiveTests,i.withMutation(o=>{e.tests.forEach(a=>{o.test(a.OPTIONS)})}),i.transforms=[...n.transforms,...i.transforms],i}isType(e){return e==null?!!(this.spec.nullable&&e===null||this.spec.optional&&e===void 0):this._typeCheck(e)}resolve(e){let n=this;if(n.conditions.length){let i=n.conditions;n=n.clone(),n.conditions=[],n=i.reduce((s,o)=>o.resolve(s,e),n),n=n.resolve(e)}return n}resolveOptions(e){var n,i,s,o;return Object.assign({},e,{from:e.from||[],strict:(n=e.strict)!=null?n:this.spec.strict,abortEarly:(i=e.abortEarly)!=null?i:this.spec.abortEarly,recursive:(s=e.recursive)!=null?s:this.spec.recursive,disableStackTrace:(o=e.disableStackTrace)!=null?o:this.spec.disableStackTrace})}cast(e,n={}){let i=this.resolve(Object.assign({value:e},n)),s=n.assert==="ignore-optionality",o=i._cast(e,n);if(n.assert!==!1&&!i.isType(o)){if(s&&pn(o))return o;let a=Yt(e),l=Yt(o);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${i.type}".
10
10
 
11
11
  attempted value: ${a}
12
- `+(l!==a?`result of cast: ${l}`:""))}return o}_cast(e,n){let i=e===void 0?e:this.transforms.reduce((s,o)=>o.call(this,s,e,this),e);return i===void 0&&(i=this.getDefault(n)),i}_validate(e,n={},i,s){let{path:o,originalValue:a=e,strict:l=this.spec.strict}=n,c=e;l||(c=this._cast(c,Object.assign({assert:!1},n)));let d=[];for(let u of Object.values(this.internalTests))u&&d.push(u);this.runTests({path:o,value:c,originalValue:a,options:n,tests:d},i,u=>{if(u.length)return s(u,c);this.runTests({path:o,value:c,originalValue:a,options:n,tests:this.tests},i,s)})}runTests(e,n,i){let s=!1,{tests:o,value:a,originalValue:l,path:c,options:d}=e,u=g=>{s||(s=!0,n(g,a))},f=g=>{s||(s=!0,i(g,a))},h=o.length,m=[];if(!h)return f([]);let p={value:a,originalValue:l,path:c,options:d,schema:this};for(let g=0;g<o.length;g++){const y=o[g];y(p,u,function(x){x&&(Array.isArray(x)?m.push(...x):m.push(x)),--h<=0&&f(m)})}}asNestedTest({key:e,index:n,parent:i,parentPath:s,originalParent:o,options:a}){const l=e??n;if(l==null)throw TypeError("Must include `key` or `index` for nested validations");const c=typeof l=="number";let d=i[l];const u=Object.assign({},a,{strict:!0,parent:i,value:d,originalValue:o[l],key:void 0,[c?"index":"key"]:l,path:c||l.includes(".")?`${s||""}[${c?l:`"${l}"`}]`:(s?`${s}.`:"")+e});return(f,h,m)=>this.resolve(u)._validate(d,u,h,m)}validate(e,n){var i;let s=this.resolve(Object.assign({},n,{value:e})),o=(i=n==null?void 0:n.disableStackTrace)!=null?i:s.spec.disableStackTrace;return new Promise((a,l)=>s._validate(e,n,(c,d)=>{Ke.isError(c)&&(c.value=d),l(c)},(c,d)=>{c.length?l(new Ke(c,d,void 0,void 0,o)):a(d)}))}validateSync(e,n){var i;let s=this.resolve(Object.assign({},n,{value:e})),o,a=(i=n==null?void 0:n.disableStackTrace)!=null?i:s.spec.disableStackTrace;return s._validate(e,Object.assign({},n,{sync:!0}),(l,c)=>{throw Ke.isError(l)&&(l.value=c),l},(l,c)=>{if(l.length)throw new Ke(l,e,void 0,void 0,a);o=c}),o}isValid(e,n){return this.validate(e,n).then(()=>!0,i=>{if(Ke.isError(i))return!1;throw i})}isValidSync(e,n){try{return this.validateSync(e,n),!0}catch(i){if(Ke.isError(i))return!1;throw i}}_getDefault(e){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,e):Vn(n)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,n){const i=this.clone({nullable:e});return i.internalTests.nullable=Mn({message:n,name:"nullable",test(s){return s===null?this.schema.spec.nullable:!0}}),i}optionality(e,n){const i=this.clone({optional:e});return i.internalTests.optionality=Mn({message:n,name:"optionality",test(s){return s===void 0?this.schema.spec.optional:!0}}),i}optional(){return this.optionality(!0)}defined(e=kt.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=kt.notNull){return this.nullability(!1,e)}required(e=kt.required){return this.clone().withMutation(n=>n.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let n=this.clone();return n.transforms.push(e),n}test(...e){let n;if(e.length===1?typeof e[0]=="function"?n={test:e[0]}:n=e[0]:e.length===2?n={name:e[0],test:e[1]}:n={name:e[0],message:e[1],test:e[2]},n.message===void 0&&(n.message=kt.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let i=this.clone(),s=Mn(n),o=n.exclusive||n.name&&i.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(i.exclusiveTests[n.name]=!!n.exclusive),i.tests=i.tests.filter(a=>!(a.OPTIONS.name===n.name&&(o||a.OPTIONS.test===s.OPTIONS.test))),i.tests.push(s),i}when(e,n){!Array.isArray(e)&&typeof e!="string"&&(n=e,e=".");let i=this.clone(),s=va(e).map(o=>new mn(o));return s.forEach(o=>{o.isSibling&&i.deps.push(o.key)}),i.conditions.push(typeof n=="function"?new fs(s,n):fs.fromOptions(s,n)),i}typeError(e){let n=this.clone();return n.internalTests.typeError=Mn({message:e,name:"typeError",skipAbsent:!0,test(i){return this.schema._typeCheck(i)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(e,n=kt.oneOf){let i=this.clone();return e.forEach(s=>{i._whitelist.add(s),i._blacklist.delete(s)}),i.internalTests.whiteList=Mn({message:n,name:"oneOf",skipAbsent:!0,test(s){let o=this.schema._whitelist,a=o.resolveAll(this.resolve);return a.includes(s)?!0:this.createError({params:{values:Array.from(o).join(", "),resolved:a}})}}),i}notOneOf(e,n=kt.notOneOf){let i=this.clone();return e.forEach(s=>{i._blacklist.add(s),i._whitelist.delete(s)}),i.internalTests.blacklist=Mn({message:n,name:"notOneOf",test(s){let o=this.schema._blacklist,a=o.resolveAll(this.resolve);return a.includes(s)?this.createError({params:{values:Array.from(o).join(", "),resolved:a}}):!0}}),i}strip(e=!0){let n=this.clone();return n.spec.strip=e,n}describe(e){const n=(e?this.resolve(e):this).clone(),{label:i,meta:s,optional:o,nullable:a}=n.spec;return{meta:s,label:i,optional:o,nullable:a,default:n.getDefault(e),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.map(c=>({name:c.OPTIONS.name,params:c.OPTIONS.params})).filter((c,d,u)=>u.findIndex(f=>f.name===c.name)===d)}}}St.prototype.__isYupSchema__=!0;for(const t of["validate","validateSync"])St.prototype[`${t}At`]=function(e,n,i={}){const{parent:s,parentPath:o,schema:a}=vh(this,e,n,i.context);return a[t](s&&s[o],Object.assign({},i,{parent:s,path:e}))};for(const t of["equals","is"])St.prototype[t]=St.prototype.oneOf;for(const t of["not","nope"])St.prototype[t]=St.prototype.notOneOf;const Nh=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function Dh(t){const e=Do(t);if(!e)return Date.parse?Date.parse(t):Number.NaN;if(e.z===void 0&&e.plusMinus===void 0)return new Date(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond).valueOf();let n=0;return e.z!=="Z"&&e.plusMinus!==void 0&&(n=e.hourOffset*60+e.minuteOffset,e.plusMinus==="+"&&(n=0-n)),Date.UTC(e.year,e.month,e.day,e.hour,e.minute+n,e.second,e.millisecond)}function Do(t){var e,n;const i=Nh.exec(t);return i?{year:At(i[1]),month:At(i[2],1)-1,day:At(i[3],1),hour:At(i[4]),minute:At(i[5]),second:At(i[6]),millisecond:i[7]?At(i[7].substring(0,3)):0,precision:(e=(n=i[7])==null?void 0:n.length)!=null?e:void 0,z:i[8]||void 0,plusMinus:i[9]||void 0,hourOffset:At(i[10]),minuteOffset:At(i[11])}:null}function At(t,e=0){return Number(t)||e}let Th=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Bh=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,Ph=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Ah="^\\d{4}-\\d{2}-\\d{2}",Mh="\\d{2}:\\d{2}:\\d{2}",Vh="(([+-]\\d{2}(:?\\d{2})?)|Z)",Rh=new RegExp(`${Ah}T${Mh}(\\.\\d+)?${Vh}$`),Fh=t=>pn(t)||t===t.trim(),$h={}.toString();function To(){return new Pa}class Pa extends St{constructor(){super({type:"string",check(e){return e instanceof String&&(e=e.valueOf()),typeof e=="string"}}),this.withMutation(()=>{this.transform((e,n,i)=>{if(!i.spec.coerce||i.isType(e)||Array.isArray(e))return e;const s=e!=null&&e.toString?e.toString():e;return s===$h?e:s})})}required(e){return super.required(e).withMutation(n=>n.test({message:e||kt.required,name:"required",skipAbsent:!0,test:i=>!!i.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(n=>n.OPTIONS.name!=="required"),e))}length(e,n=Xe.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(i){return i.length===this.resolve(e)}})}min(e,n=Xe.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(i){return i.length>=this.resolve(e)}})}max(e,n=Xe.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:e},skipAbsent:!0,test(i){return i.length<=this.resolve(e)}})}matches(e,n){let i=!1,s,o;return n&&(typeof n=="object"?{excludeEmptyString:i=!1,message:s,name:o}=n:s=n),this.test({name:o||"matches",message:s||Xe.matches,params:{regex:e},skipAbsent:!0,test:a=>a===""&&i||a.search(e)!==-1})}email(e=Xe.email){return this.matches(Th,{name:"email",message:e,excludeEmptyString:!0})}url(e=Xe.url){return this.matches(Bh,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=Xe.uuid){return this.matches(Ph,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let n="",i,s;return e&&(typeof e=="object"?{message:n="",allowOffset:i=!1,precision:s=void 0}=e:n=e),this.matches(Rh,{name:"datetime",message:n||Xe.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||Xe.datetime_offset,params:{allowOffset:i},skipAbsent:!0,test:o=>{if(!o||i)return!0;const a=Do(o);return a?!!a.z:!1}}).test({name:"datetime_precision",message:n||Xe.datetime_precision,params:{precision:s},skipAbsent:!0,test:o=>{if(!o||s==null)return!0;const a=Do(o);return a?a.precision===s:!1}})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=Xe.trim){return this.transform(n=>n!=null?n.trim():n).test({message:e,name:"trim",test:Fh})}lowercase(e=Xe.lowercase){return this.transform(n=>pn(n)?n:n.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>pn(n)||n===n.toLowerCase()})}uppercase(e=Xe.uppercase){return this.transform(n=>pn(n)?n:n.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>pn(n)||n===n.toUpperCase()})}}To.prototype=Pa.prototype;let Lh=new Date(""),Ih=t=>Object.prototype.toString.call(t)==="[object Date]";class ps extends St{constructor(){super({type:"date",check(e){return Ih(e)&&!isNaN(e.getTime())}}),this.withMutation(()=>{this.transform((e,n,i)=>!i.spec.coerce||i.isType(e)||e===null?e:(e=Dh(e),isNaN(e)?ps.INVALID_DATE:new Date(e)))})}prepareParam(e,n){let i;if(mn.isRef(e))i=e;else{let s=this.cast(e);if(!this._typeCheck(s))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);i=s}return i}min(e,n=vo.min){let i=this.prepareParam(e,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(s){return s>=this.resolve(i)}})}max(e,n=vo.max){let i=this.prepareParam(e,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(s){return s<=this.resolve(i)}})}}ps.INVALID_DATE=Lh,ps.prototype;function jh(t,e=[]){let n=[],i=new Set,s=new Set(e.map(([a,l])=>`${a}-${l}`));function o(a,l){let c=hn.split(a)[0];i.add(c),s.has(`${l}-${c}`)||n.push([l,c])}for(const a of Object.keys(t)){let l=t[a];i.add(a),mn.isRef(l)&&l.isSibling?o(l.path,a):No(l)&&"deps"in l&&l.deps.forEach(c=>o(c,a))}return yh.array(Array.from(i),n).reverse()}function Aa(t,e){let n=1/0;return t.some((i,s)=>{var o;if((o=e.path)!=null&&o.includes(i))return n=s,!0}),n}function Ma(t){return(e,n)=>Aa(t,e)-Aa(t,n)}const zh=(t,e,n)=>{if(typeof t!="string")return t;let i=t;try{i=JSON.parse(t)}catch{}return n.isType(i)?i:t};function gs(t){if("fields"in t){const e={};for(const[n,i]of Object.entries(t.fields))e[n]=gs(i);return t.setFields(e)}if(t.type==="array"){const e=t.optional();return e.innerType&&(e.innerType=gs(e.innerType)),e}return t.type==="tuple"?t.optional().clone({types:t.spec.types.map(gs)}):"optional"in t?t.optional():t}const Uh=(t,e)=>{const n=[...hn.normalizePath(e)];if(n.length===1)return n[0]in t;let i=n.pop(),s=hn.getter(hn.join(n),!0)(t);return!!(s&&i in s)};let Va=t=>Object.prototype.toString.call(t)==="[object Object]";function Ra(t,e){let n=Object.keys(t.fields);return Object.keys(e).filter(i=>n.indexOf(i)===-1)}const Wh=Ma([]);function Bo(t){return new Fa(t)}class Fa extends St{constructor(e){super({type:"object",check(n){return Va(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=Wh,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,n={}){var i;let s=super._cast(e,n);if(s===void 0)return this.getDefault(n);if(!this._typeCheck(s))return s;let o=this.fields,a=(i=n.stripUnknown)!=null?i:this.spec.noUnknown,l=[].concat(this._nodes,Object.keys(s).filter(f=>!this._nodes.includes(f))),c={},d=Object.assign({},n,{parent:c,__validating:n.__validating||!1}),u=!1;for(const f of l){let h=o[f],m=f in s;if(h){let p,g=s[f];d.path=(n.path?`${n.path}.`:"")+f,h=h.resolve({value:g,context:n.context,parent:c});let y=h instanceof St?h.spec:void 0,b=y==null?void 0:y.strict;if(y!=null&&y.strip){u=u||f in s;continue}p=!n.__validating||!b?h.cast(s[f],d):s[f],p!==void 0&&(c[f]=p)}else m&&!a&&(c[f]=s[f]);(m!==f in c||c[f]!==s[f])&&(u=!0)}return u?c:s}_validate(e,n={},i,s){let{from:o=[],originalValue:a=e,recursive:l=this.spec.recursive}=n;n.from=[{schema:this,value:a},...o],n.__validating=!0,n.originalValue=a,super._validate(e,n,i,(c,d)=>{if(!l||!Va(d)){s(c,d);return}a=a||d;let u=[];for(let f of this._nodes){let h=this.fields[f];!h||mn.isRef(h)||u.push(h.asNestedTest({options:n,key:f,parent:d,parentPath:n.path,originalParent:a}))}this.runTests({tests:u,value:d,originalValue:a,options:n},i,f=>{s(f.sort(this._sortErrors).concat(c),d)})})}clone(e){const n=super.clone(e);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(e){let n=super.concat(e),i=n.fields;for(let[s,o]of Object.entries(this.fields)){const a=i[s];i[s]=a===void 0?o:a}return n.withMutation(s=>s.setFields(i,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let n={};return this._nodes.forEach(i=>{var s;const o=this.fields[i];let a=e;(s=a)!=null&&s.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[i]})),n[i]=o&&"getDefault"in o?o.getDefault(a):void 0}),n}setFields(e,n){let i=this.clone();return i.fields=e,i._nodes=jh(e,n),i._sortErrors=Ma(Object.keys(e)),n&&(i._excludedEdges=n),i}shape(e,n=[]){return this.clone().withMutation(i=>{let s=i._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),s=[...i._excludedEdges,...n]),i.setFields(Object.assign(i.fields,e),s)})}partial(){const e={};for(const[n,i]of Object.entries(this.fields))e[n]="optional"in i&&i.optional instanceof Function?i.optional():i;return this.setFields(e)}deepPartial(){return gs(this)}pick(e){const n={};for(const i of e)this.fields[i]&&(n[i]=this.fields[i]);return this.setFields(n,this._excludedEdges.filter(([i,s])=>e.includes(i)&&e.includes(s)))}omit(e){const n=[];for(const i of Object.keys(this.fields))e.includes(i)||n.push(i);return this.pick(n)}from(e,n,i){let s=hn.getter(e,!0);return this.transform(o=>{if(!o)return o;let a=o;return Uh(o,e)&&(a=Object.assign({},o),i||delete a[e],a[n]=s(o)),a})}json(){return this.transform(zh)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||us.exact,test(n){if(n==null)return!0;const i=Ra(this.schema,n);return i.length===0||this.createError({params:{properties:i.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,n=us.noUnknown){typeof e!="boolean"&&(n=e,e=!0);let i=this.test({name:"noUnknown",exclusive:!0,message:n,test(s){if(s==null)return!0;const o=Ra(this.schema,s);return!e||o.length===0||this.createError({params:{unknown:o.join(", ")}})}});return i.spec.noUnknown=e,i}unknown(e=!0,n=us.noUnknown){return this.noUnknown(!e,n)}transformKeys(e){return this.transform(n=>{if(!n)return n;const i={};for(const s of Object.keys(n))i[e(s)]=n[s];return i})}camelCase(){return this.transformKeys(Oo.camelCase)}snakeCase(){return this.transformKeys(Oo.snakeCase)}constantCase(){return this.transformKeys(e=>Oo.snakeCase(e).toUpperCase())}describe(e){const n=(e?this.resolve(e):this).clone(),i=super.describe(e);i.fields={};for(const[o,a]of Object.entries(n.fields)){var s;let l=e;(s=l)!=null&&s.value&&(l=Object.assign({},l,{parent:l.value,value:l.value[o]})),i.fields[o]=a.describe(l)}return i}}Bo.prototype=Fa.prototype;function Po(t,e,n){const i=new fn;let s=r.ref({});const o=r.ref({}),a=r.ref({});let l=r.ref([]);const c=r.ref(null),d=r.ref([]);let u=r.ref([]),f=r.ref(!1);const h=r.ref({});let{handleSubmit:m,errors:p,setErrors:g}=Sa();const y=async()=>{var $;try{const A=await i.getEntityRecords(t);A&&A.response&&(s.value=A.response,l.value=($=A.response.entity.entityDefinition)==null?void 0:$.columns,j(),S(),v())}catch(A){toast.add({severity:"error",summary:"Error",detail:A.errorMessage,life:3e3})}finally{}},b=async()=>{var $;try{const A=await i.getRecord(t,e);A&&A.response&&(s.value=A.response,l.value=($=A.response.entity.entityDefinition)==null?void 0:$.columns,j(),o.value=JSON.parse(JSON.stringify(A.response.result[0])),v())}catch(A){console.error("Error fetching entity:",A.errorMessage)}finally{}},x=async()=>{var $,A;try{const I=await i.getRelatedEntityRecord(t,e);I&&I.response&&(s.value=I.response,l.value=(A=($=I.response.entity)==null?void 0:$.entityDefinition)==null?void 0:A.columns,j(),o.value=JSON.parse(JSON.stringify(I.response.result[0])),o.value.entityName&&delete o.value.entityName,o.value.linkedEntities&&delete o.value.linkedEntities,u.value=I.response.result[0].linkedEntities,a.value=JSON.parse(JSON.stringify(o.value)),v())}catch(I){console.error("Error fetching entity:",I.errorMessage)}finally{}},w=async $=>{try{let A=await i.addRecord(t,$);A&&A.response&&n("onSaveDialog",{entityName:t,recordId:e})}catch(A){A.validationErrors&&(d.value=JSON.parse(JSON.stringify(A.validationErrors))),console.error("Error fetching entity:",A.errorMessage)}finally{}},E=async($,A)=>{try{let I=await i.addRecord(t,A);if(I&&I.response){let Q=await i.saveRelatedEntityRecord(t,I.response.recordId,$.linkedEntities);Q&&Q.response&&n("onSaveDialog",{entityName:t,recordId:e})}}catch(I){I.validationErrors&&(d.value=JSON.parse(JSON.stringify(I.validationErrors))),console.error("Error fetching entity:",I.errorMessage)}finally{}},k=async $=>{try{const A=await i.updateRecord(t,e,$);A&&A.response&&(f.value=!1,a.value=JSON.parse(JSON.stringify(o.value)),n("onSaveDialog",{entityName:t,recordId:e}))}catch(A){A.validationErrors&&(d.value=JSON.parse(JSON.stringify(A.errvalidationErrorsors))),console.error("Error fetching entity:",A.errorMessage)}finally{}},C=async($,A,I)=>{try{let Q=await i.saveRelatedEntityRecord($,A,I);Q&&Q.response&&n("onSaveDialog",{entityName:t,enityRecordId:A})}catch(Q){Q.validationErrors&&(d.value=JSON.parse(JSON.stringify(Q.validationErrors))),console.error("Error fetching entity:",Q.errorMessage)}finally{}},S=()=>{for(let $=0;$<l.value.length;$++){let A=l.value[$];A.autoGenerated||(o.value[A.name]="")}},_=$=>{let A="";for(let I=0;I<l.value.length;I++){let Q=l.value[I];if($==Q.name){A=Q.type;break}}return A},O=()=>{const $=l.value.filter(I=>I.autoGenerated).map(I=>I.name);return Object.entries(o.value).filter(([I])=>!$.includes(I)).map(([I,Q])=>({recordColumnName:I,recordColumnValue:Q,columnType:_(I)}))},P=async($={})=>{try{await c.value.validate(o.value,{abortEarly:!1}),g({})}catch(I){const Q=I.inner.reduce((se,K)=>(se[K.path]||(se[K.path]={messages:[]}),se[K.path].messages.push(...K.errors),se),{}),ne=Object.entries(Q).reduce((se,[K,J])=>(se[K]={messages:J.messages},se),{});g(ne);return}const A={dataDefinitions:O()};e?await k(A):$.relationType=="MANY_TO_ONE"?await E($,A):await w(A)},v=()=>{c.value=Bo().shape(l.value.reduce(($,A)=>(A.autoGenerated||($[A.name]=To().nullable(!1).test({name:"custom-validation",test:function(I){const Q=[];let ne="";if(A.required&&(!I||I.trim()===""))if(A.validations){ne=T(A.validations,"VALIDATE_REQUIRED"),Q.push(ne);let se=U(A.validations,"VALIDATE_REQUIRED");se&&(se="hint:"+se,Q.push(se))}else ne=A.displayName+" is required.",Q.push(ne);else{if(A.maxLength&&I.length>A.maxLength)if(A.validations){ne=T(A.validations,"VALIDATE_MAXLENGTH"),Q.push(ne);let se=U(A.validations,"VALIDATE_MAXLENGTH");se&&(se="hint:"+se,Q.push(se))}else ne=A.displayName+" cannot exceed from "+A.maxLength+" characters",Q.push(ne);if(A.regxId&&!new RegExp(R(A.validations,"VALIDATE_REGX")).test(I))if(A.validations){ne=T(A.validations,"VALIDATE_REGX"),Q.push(ne);let se=U(A.validations,"VALIDATE_REGX");se&&(se="hint:"+se,Q.push(se))}else ne=A.displayName+" invalid format.",Q.push(ne)}return Q.length>0?this.createError({message:Q}):!0}})),$),{}))},T=($,A)=>{for(let I=0;I<$.length;I++)if(A==$[I].type)return $[I].message},R=($,A)=>{for(let I=0;I<$.length;I++)if(A==$[I].type)return $[I].regx},U=($,A)=>{for(let I=0;I<$.length;I++)if(A==$[I].type)return $[I].hint},Y=$=>{g({...p.value,[$]:null}),f.value=!0},L=()=>{f.value=!1;for(let $ in o.value)o.value.hasOwnProperty($)&&g({...p.value,[$]:null});o.value=JSON.parse(JSON.stringify(a.value))},j=()=>{for(let $=0;$<l.value.length;$++){const A=l.value[$];if(A.primaryKey&&A.primaryKey==!0){h.value=A;break}}};return{formData:o,columns:l,errors:p,backendErrors:d,isDataChange:f,linkedEntities:u,primarayKeyColumn:h,clearErrors:Y,saveRecord:P,fetchAllRecords:y,fetchRecord:b,getRelatedEntityRecordById:x,cancleRecord:L,saveRelatedEntityRecord:C}}const Hh={key:0,class:"surface-card"},qh={class:"info"},Yh={key:0,class:"list-none p-0"},$a={__name:"EntityFormErrors",props:{errors:Array},setup(t){let e=r.ref(!0);const n=()=>{e.value=!e.value};return(i,s)=>{var a;const o=r.resolveComponent("Message");return((a=t.errors)==null?void 0:a.length)>0?(r.openBlock(),r.createElementBlock("div",Hh,[s[1]||(s[1]=r.createElementVNode("h4",{class:"flex-1 font-bold text-red-500"},"Errors",-1)),r.createElementVNode("div",qh,[r.createElementVNode("span",{onClick:s[0]||(s[0]=l=>n()),class:"cursor-pointer underline showHideColor"},r.toDisplayString(r.unref(e)?"Hide":"Show"),1)]),r.unref(e)?(r.openBlock(),r.createElementBlock("ul",Yh,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.errors,(l,c)=>(r.openBlock(),r.createElementBlock("li",{key:c,class:"mb-2"},[r.createVNode(o,{style:{"word-break":"break-all"},closable:!1,severity:"error"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(l.message),1)]),_:2},1024)]))),128))])):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)}}},Kh={class:"field flex flex-col mb-3"},Xh=["for"],Gh={key:0,class:"flex items-center"},Jh={key:1},Qh={class:"flex items-center"},La={__name:"RelatedEntitySelection",props:{modelValue:{required:!0},entityName:{type:String,required:!0},columnName:{type:String,required:!0},relatedEntityColumn:{type:String,required:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,i=new fn,s=r.ref({});let o=r.ref("");const a=e;r.onMounted(()=>{l()});const l=async()=>{try{const u=await i.getEntityRecords(n.entityName);u&&u.response&&(s.value=u.response,d())}catch{}finally{}},c=()=>{a("update:modelValue",o.value[n.relatedEntityColumn])},d=()=>{for(let u=0;u<s.value.result.length;u++){const f=s.value.result[u];if(f[n.relatedEntityColumn]==n.modelValue){o.value=f;break}}};return(u,f)=>{const h=r.resolveComponent("Select");return r.openBlock(),r.createElementBlock("div",Kh,[r.createElementVNode("label",{for:t.columnName},r.toDisplayString(t.columnName),9,Xh),r.createVNode(h,{modelValue:r.unref(o),"onUpdate:modelValue":[f[0]||(f[0]=m=>r.isRef(o)?o.value=m:o=m),c],"item-value":t.relatedEntityColumn,options:s.value.result,filter:"",optionLabel:t.relatedEntityColumn,placeholder:"Select "+t.relatedEntityColumn,class:"w-full"},{value:r.withCtx(m=>[m.value?(r.openBlock(),r.createElementBlock("div",Gh,[r.createElementVNode("div",null,r.toDisplayString(m.value[t.relatedEntityColumn]),1)])):(r.openBlock(),r.createElementBlock("span",Jh,r.toDisplayString(m.placeholder),1))]),option:r.withCtx(m=>[r.createElementVNode("div",Qh,[r.createElementVNode("div",null,r.toDisplayString(m.option[t.relatedEntityColumn]),1)])]),_:1},8,["modelValue","item-value","options","optionLabel","placeholder"])])}}},Zh={key:0,style:{"font-weight":"700","font-size":"1.25rem"}},em={key:1,style:{"font-weight":"700","font-size":"1.25rem"}},tm={__name:"EntityDialog",props:r.mergeModels({entityName:{type:String,required:!0},recordId:{type:[String,Number],default:null}},{showForm:{},showFormModifiers:{}}),emits:r.mergeModels(["onSaveDialog"],["update:showForm"]),setup(t,{emit:e}){const n=r.useModel(t,"showForm"),i=e,{formData:s,columns:o,errors:a,backendErrors:l,clearErrors:c,saveRecord:d,fetchAllRecords:u,fetchRecord:f}=Po(t.entityName,t.recordId,i);return r.onMounted(()=>{t.recordId?f():u()}),(h,m)=>{const p=r.resolveComponent("Button"),g=r.resolveComponent("Dialog");return n.value?(r.openBlock(),r.createBlock(g,{key:0,showFooter:!1,visible:n.value,"onUpdate:visible":m[2]||(m[2]=y=>n.value=y),style:{width:"50rem"},breakpoints:{"1199px":"75vw","575px":"90vw"},modal:!0,class:"p-fluid"},{header:r.withCtx(()=>[t.recordId?(r.openBlock(),r.createElementBlock("span",Zh,"Edit "+r.toDisplayString(t.entityName)+" record details",1)):r.createCommentVNode("",!0),t.recordId?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",em,"Add "+r.toDisplayString(t.entityName)+" record details",1))]),footer:r.withCtx(()=>[r.createVNode(p,{type:"button",icon:"",label:"Cancel",severity:"secondary",onClick:m[0]||(m[0]=y=>n.value=!1)}),r.createVNode(p,{type:"button",icon:"",label:"Save",severity:"success",onClick:m[1]||(m[1]=y=>r.unref(d)())})]),default:r.withCtx(()=>{var y;return[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(o),(b,x)=>{var w;return r.openBlock(),r.createElementBlock("div",{key:x},[!b.autoGenerated&&!b.foreignKey?(r.openBlock(),r.createBlock(os,{key:0,modelValue:r.unref(s)[b.name],"onUpdate:modelValue":E=>r.unref(s)[b.name]=E,column:b,errors:(w=r.unref(a)[b.name])==null?void 0:w.messages,onInput:r.unref(c)},null,8,["modelValue","onUpdate:modelValue","column","errors","onInput"])):r.createCommentVNode("",!0),!b.autoGenerated&&b.foreignKey?(r.openBlock(),r.createBlock(La,{key:1,modelValue:r.unref(s)[b.name],"onUpdate:modelValue":E=>r.unref(s)[b.name]=E,entityName:b.foreignKey.referencedEntityName,columnName:b.name,relatedEntityColumn:b.foreignKey.referencedColumnName},null,8,["modelValue","onUpdate:modelValue","entityName","columnName","relatedEntityColumn"])):r.createCommentVNode("",!0)])}),128)),((y=r.unref(l))==null?void 0:y.length)>0?(r.openBlock(),r.createBlock($a,{key:0,errors:r.unref(l)},null,8,["errors"])):r.createCommentVNode("",!0)]}),_:1},8,["visible"])):r.createCommentVNode("",!0)}}},nm={__name:"DeleteConfirmationDialog",props:r.mergeModels({entityName:{type:String,required:!0},recordId:{type:[String,Number],default:null}},{showDeleteDialog:{},showDeleteDialogModifiers:{}}),emits:r.mergeModels(["onDeleteItem"],["update:showDeleteDialog"]),setup(t,{emit:e}){const n=new fn,i=r.useModel(t,"showDeleteDialog"),s=e,o=async()=>{try{const a=await n.deleteRecord(t.entityName,t.recordId);a&&a.response&&s("onDeleteItem")}catch(a){console.error("Error deleting record:",a.errorMessage)}finally{}};return(a,l)=>{const c=r.resolveComponent("Button"),d=r.resolveComponent("Dialog");return r.openBlock(),r.createBlock(d,{visible:i.value,"onUpdate:visible":l[1]||(l[1]=u=>i.value=u),style:{width:"450px"},header:"Confirm",modal:!0},{footer:r.withCtx(()=>[r.createVNode(c,{label:"No",icon:"pi pi-times",text:"",onClick:l[0]||(l[0]=u=>i.value=!1)}),r.createVNode(c,{label:"Yes",icon:"pi pi-check",text:"",onClick:o})]),default:r.withCtx(()=>[l[2]||(l[2]=r.createElementVNode("div",{class:"flex items-center justify-center"},[r.createElementVNode("i",{class:"pi pi-exclamation-triangle mr-3",style:{"font-size":"2rem"}}),r.createElementVNode("span",null,"Are you sure you want to delete the selected item?")],-1))]),_:1},8,["visible"])}}};function Ao(t){return t==null||t===""||Array.isArray(t)&&t.length===0||!(t instanceof Date)&&typeof t=="object"&&Object.keys(t).length===0}function Ia(t){return!!(t&&t.constructor&&t.call&&t.apply)}function Ce(t){return!Ao(t)}function Rn(t,e=!0){return t instanceof Object&&t.constructor===Object&&(e||Object.keys(t).length!==0)}function ft(t,...e){return Ia(t)?t(...e):t}function wt(t,e=!0){return typeof t=="string"&&(e||t!=="")}function Kt(t){return wt(t)?t.replace(/(-|_)/g,"").toLowerCase():t}function ja(t,e="",n={}){const i=Kt(e).split("."),s=i.shift();return s?Rn(t)?ja(ft(t[Object.keys(t).find(o=>Kt(o)===s)||""],n),i.join("."),n):void 0:ft(t,n)}function Mo(t,e=!0){return Array.isArray(t)&&(e||t.length!==0)}function im(t){return Ce(t)&&!isNaN(t)}function Mt(t,e){if(e){const n=e.test(t);return e.lastIndex=0,n}return!1}function ni(t){return t&&t.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g,"").replace(/ {2,}/g," ").replace(/ ([{:}]) /g,"$1").replace(/([;,]) /g,"$1").replace(/ !/g,"!").replace(/: /g,":")}function za(t){return wt(t)?t.replace(/(_)/g,"-").replace(/[A-Z]/g,(e,n)=>n===0?e:"-"+e.toLowerCase()).toLowerCase():t}function Ua(t){return wt(t)?t.replace(/[A-Z]/g,(e,n)=>n===0?e:"."+e.toLowerCase()).toLowerCase():t}var Fn={STARTS_WITH:"startsWith",CONTAINS:"contains",NOT_CONTAINS:"notContains",ENDS_WITH:"endsWith",EQUALS:"equals",NOT_EQUALS:"notEquals",IN:"in",LESS_THAN:"lt",LESS_THAN_OR_EQUAL_TO:"lte",GREATER_THAN:"gt",GREATER_THAN_OR_EQUAL_TO:"gte",BETWEEN:"between",DATE_IS:"dateIs",DATE_IS_NOT:"dateIsNot",DATE_BEFORE:"dateBefore",DATE_AFTER:"dateAfter"},sm={AND:"and",OR:"or"};const om={key:0},rm={key:1},Vo={__name:"RecordColumnRenderer",props:{column:Object,value:null},setup(t){const e=r.ref(null),n=Object.assign({"/src/directives/dateFormat.js":()=>Promise.resolve().then(()=>uk),"/src/directives/textFormatUpperCase.js":()=>Promise.resolve().then(()=>fk)});async function i(){await r.nextTick();const s=n[`/src/directives/${t.column.displayFormatKey}.js`];s&&e.value&&s().then(o=>{o.default.beforeMount(e.value,{value:t.value,arg:t.column.displayFormat})})}return r.onMounted(()=>{i()}),r.onUpdated(()=>{i()}),(s,o)=>t.column.displayFormatKey?(r.openBlock(),r.createElementBlock("span",om,[r.createElementVNode("span",{ref_key:"el",ref:e},r.toDisplayString(t.value),513)])):(r.openBlock(),r.createElementBlock("span",rm,r.toDisplayString(t.value),1))}},am={class:"my-2"},lm={class:"flex flex-col md:flex-row md:justify-between md:items-center"},cm={class:"flex flex-row gap-2"},Ro={__name:"Grid",props:{entityName:String,showAddButton:Boolean,showClearFilters:Boolean,columnsToShow:Array,editable:Boolean,deleteable:Boolean,showPagination:Boolean},setup(t){const e=ot(),n=t;console.log("columnsToShow",n.columnsToShow);const i=Ye.useRoute(),s=r.ref(n.entityName||i.params.entityName),o=r.ref({}),a=r.ref(""),l=r.ref(!1),c=r.ref(!1),{items:d,headers:u,first:f,totalRecords:h,pageSize:m,loading:p,sortBy:g,sortDirection:y,operatorMap:b,filterToSend:x,primarayKeyColumn:w,fullTextSearch:E,listingResponse:k,onFullTextSearch:C,getDatatypeByField:S,getColumnDatatype:_,onSort:O,onPage:P,onFilter:v,fetchEntityFilterData:T,fetchEntityByName:R}=Ef(s.value),U=r.ref();let Y=r.ref(!1);const L=K=>{o.value=K.reduce((J,oe)=>{if(!oe.filterable)return J;let ue=Fn.CONTAINS;switch(oe.datatype.toLowerCase()){case"string":case"uuid":ue=Fn.STARTS_WITH;break;case"date":ue=Fn.DATE_IS;break;case"numeric":case"int":case"integer":ue=Fn.EQUALS;break;case"bool":case"boolean":ue=Fn.EQUALS;break}return oe.datatype=="bool"||oe.datatype=="boolean"?J[oe.field]={value:null,matchMode:Fn.EQUALS}:J[oe.field]={operator:sm.AND,constraints:[{value:null,matchMode:ue}]},J},{})},j=()=>{L(u.value),x.value=se(o.value),v()},$=K=>{x.value=se(o.value),v()},A=K=>{K?a.value=K[w.value.name]:a.value="",l.value=!l.value},I=()=>{l.value=!1,T(!1)},Q=K=>{a.value=K[w.value.name],c.value=!0},ne=()=>{c.value=!1,T(!1)},se=K=>Object.keys(K).map(J=>{const oe=K[J];return oe.constraints?oe.constraints.filter(ue=>ue.value!==null&&ue.value!=="").map(ue=>({columnName:J,operator:b[ue.matchMode]??ue.matchMode,value:ue.value,columnType:S(J)})):oe.value!==null&&oe.value!==""?{columnName:J,operator:b[oe.matchMode]??oe.matchMode,value:oe.value,columnType:S(J)}:[]}).flat();return r.watch(()=>e.globalConfigs.appId,async K=>{K&&R(s.value)},{immediate:!0}),r.watch(()=>u.value,K=>{!Y.value&&K&&K.length&&(L(K),Y.value=!0)},{immediate:!0}),(K,J)=>{const oe=r.resolveComponent("Button"),ue=r.resolveComponent("Toolbar"),ve=r.resolveComponent("ProgressSpinner"),st=r.resolveComponent("InputIcon"),qe=r.resolveComponent("IconField"),xt=r.resolveComponent("DatePicker"),ct=r.resolveComponent("InputNumber"),H=r.resolveComponent("Checkbox"),F=r.resolveComponent("Column"),he=r.resolveComponent("DataTable");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",r.normalizeProps(r.guardReactiveProps(K.$attrs)),[r.renderSlot(K.$slots,"header"),t.showClearFilters||t.showAddButton?(r.openBlock(),r.createBlock(ue,{key:0,class:"mb-4 mt-4"},r.createSlots({_:2},[t.showClearFilters?{name:"start",fn:r.withCtx(()=>[r.createElementVNode("div",am,[r.createVNode(oe,{type:"button",icon:"pi pi-filter-slash",label:"Clear",severity:"warning",onClick:J[0]||(J[0]=pe=>j())})])]),key:"0"}:void 0,t.showAddButton?{name:"end",fn:r.withCtx(()=>[r.createVNode(oe,{label:"Add",icon:"pi pi-plus",class:"mr-2",severity:"success",onClick:J[1]||(J[1]=pe=>A())})]),key:"1"}:void 0]),1024)):r.createCommentVNode("",!0),r.createVNode(he,{lazy:"",value:r.unref(d),loading:r.unref(p),ref_key:"dt",ref:U,stripedRows:!0,showGridlines:"",rowHover:!0,paginator:t.showPagination,rows:r.unref(m),rowsPerPageOptions:[10,25,50,100],totalRecords:r.unref(h),first:r.unref(f),sortField:r.unref(g),sortOrder:r.unref(y),filters:o.value,"onUpdate:filters":J[5]||(J[5]=pe=>o.value=pe),filterDisplay:"menu",scrollable:"",scrollHeight:"400px",onSort:r.unref(O),onPage:r.unref(P),onFilter:J[6]||(J[6]=pe=>$()),size:"large",paginatorTemplate:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink CurrentPageReport RowsPerPageDropdown",currentPageReportTemplate:"Showing {first} to {last} of {totalRecords} items"},{empty:r.withCtx(()=>J[9]||(J[9]=[r.createTextVNode(" No data found. ")])),loading:r.withCtx(()=>[r.createVNode(ve)]),header:r.withCtx(()=>[r.createElementVNode("div",lm,[r.createVNode(qe,{iconPosition:"left",class:"block mt-2 md:mt-0"},{default:r.withCtx(()=>[r.createVNode(st,{class:"pi pi-search",onClick:J[2]||(J[2]=pe=>r.unref(C)())}),r.createVNode(r.unref(Jr.InputText),{class:"w-full sm:w-auto",onKeyup:J[3]||(J[3]=r.withKeys(pe=>r.unref(C)(),["enter"])),modelValue:r.unref(E),"onUpdate:modelValue":J[4]||(J[4]=pe=>r.isRef(E)?E.value=pe:null),placeholder:"Search..."},null,8,["modelValue"])]),_:1})])]),default:r.withCtx(()=>{var pe;return[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(u).filter(me=>!n.columnsToShow||n.columnsToShow.length===0||n.columnsToShow.includes(me.field)),me=>(r.openBlock(),r.createBlock(F,{key:me.field,dataType:r.unref(_)(me.datatype),field:me.field,header:me.name,sortable:me.sortable,showAddButton:!1,showFilterOperator:!1,style:{"text-wrap":"nowrap"}},r.createSlots({body:r.withCtx(({data:ge})=>[r.createVNode(Vo,{column:me,value:ge[me.field]},null,8,["column","value"])]),_:2},[me.datatype.toLowerCase()==="date"&&me.filterable?{name:"filter",fn:r.withCtx(({filterModel:ge})=>[r.createVNode(xt,{modelValue:ge.value,"onUpdate:modelValue":Te=>ge.value=Te,dateFormat:"mm/dd/yy",placeholder:"mm/dd/yyyy"},null,8,["modelValue","onUpdate:modelValue"])]),key:"0"}:me.datatype.toLowerCase()==="int"&&me.filterable?{name:"filter",fn:r.withCtx(({filterModel:ge})=>[r.createVNode(ct,{modelValue:ge.value,"onUpdate:modelValue":Te=>ge.value=Te,placeholder:"Search..."},null,8,["modelValue","onUpdate:modelValue"])]),key:"1"}:me.datatype.toLowerCase()==="boolean"&&me.filterable?{name:"filter",fn:r.withCtx(({filterModel:ge})=>[r.createVNode(H,{modelValue:ge.value,"onUpdate:modelValue":Te=>ge.value=Te,indeterminate:ge.value===null,binary:""},null,8,["modelValue","onUpdate:modelValue","indeterminate"])]),key:"2"}:me.filterable?{name:"filter",fn:r.withCtx(({filterModel:ge})=>[r.createVNode(r.unref(Jr.InputText),{style:{width:"150px"},type:"text",modelValue:ge.value,"onUpdate:modelValue":Te=>ge.value=Te,class:"p-column-filter",placeholder:"Search..."},null,8,["modelValue","onUpdate:modelValue"])]),key:"3"}:void 0]),1032,["dataType","field","header","sortable"]))),128)),((pe=r.unref(d))==null?void 0:pe.length)>0&&(t.editable||t.deleteable)?(r.openBlock(),r.createBlock(F,{key:0,header:"Actions"},{body:r.withCtx(({data:me})=>[r.createElementVNode("div",cm,[t.editable?(r.openBlock(),r.createBlock(oe,{key:0,onClick:ge=>A(me),icon:"pi pi-pencil",severity:"success",size:"",rounded:"","aria-label":"Edit"},null,8,["onClick"])):r.createCommentVNode("",!0),t.deleteable?(r.openBlock(),r.createBlock(oe,{key:1,onClick:ge=>Q(me),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"},null,8,["onClick"])):r.createCommentVNode("",!0)])]),_:1})):r.createCommentVNode("",!0)]}),_:1},8,["value","loading","paginator","rows","totalRecords","first","sortField","sortOrder","filters","onSort","onPage"]),r.renderSlot(K.$slots,"footer")],16),l.value?(r.openBlock(),r.createBlock(tm,{key:0,showForm:l.value,"onUpdate:showForm":J[7]||(J[7]=pe=>l.value=pe),entityName:r.unref(k).entityName,recordId:a.value,onOnSaveDialog:I},null,8,["showForm","entityName","recordId"])):r.createCommentVNode("",!0),c.value?(r.openBlock(),r.createBlock(nm,{key:1,showDeleteDialog:c.value,"onUpdate:showDeleteDialog":J[8]||(J[8]=pe=>c.value=pe),entityName:r.unref(k).entityName,recordId:a.value,onOnDeleteItem:ne},null,8,["showDeleteDialog","entityName","recordId"])):r.createCommentVNode("",!0)],64)}}};function dm(){const t=new Map;return{on(e,n){let i=t.get(e);return i?i.push(n):i=[n],t.set(e,i),this},off(e,n){let i=t.get(e);return i&&i.splice(i.indexOf(n)>>>0,1),this},emit(e,n){let i=t.get(e);i&&i.slice().map(s=>{s(n)})},clear(){t.clear()}}}var um=Object.defineProperty,fm=Object.defineProperties,hm=Object.getOwnPropertyDescriptors,ys=Object.getOwnPropertySymbols,Wa=Object.prototype.hasOwnProperty,Ha=Object.prototype.propertyIsEnumerable,qa=(t,e,n)=>e in t?um(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ht=(t,e)=>{for(var n in e||(e={}))Wa.call(e,n)&&qa(t,n,e[n]);if(ys)for(var n of ys(e))Ha.call(e,n)&&qa(t,n,e[n]);return t},Fo=(t,e)=>fm(t,hm(e)),Vt=(t,e)=>{var n={};for(var i in t)Wa.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&ys)for(var i of ys(t))e.indexOf(i)<0&&Ha.call(t,i)&&(n[i]=t[i]);return n},mm=dm(),Xt=mm;function Ya(t,e){Mo(t)?t.push(...e||[]):Rn(t)&&Object.assign(t,e)}function pm(t){return Rn(t)&&t.hasOwnProperty("value")&&t.hasOwnProperty("type")?t.value:t}function gm(t){return t.replaceAll(/ /g,"").replace(/[^\w]/g,"-")}function $o(t="",e=""){return gm(`${wt(t,!1)&&wt(e,!1)?`${t}-`:t}${e}`)}function Ka(t="",e=""){return`--${$o(t,e)}`}function ym(t=""){const e=(t.match(/{/g)||[]).length,n=(t.match(/}/g)||[]).length;return(e+n)%2!==0}function Xa(t,e="",n="",i=[],s){if(wt(t)){const o=/{([^}]*)}/g,a=t.trim();if(ym(a))return;if(Mt(a,o)){const l=a.replaceAll(o,u=>{const h=u.replace(/{|}/g,"").split(".").filter(m=>!i.some(p=>Mt(m,p)));return`var(${Ka(n,za(h.join("-")))}${Ce(s)?`, ${s}`:""})`}),c=/(\d+\s+[\+\-\*\/]\s+\d+)/g,d=/var\([^)]+\)/g;return Mt(l.replace(d,"0"),c)?`calc(${l})`:l}return a}else if(im(t))return t}function bm(t,e,n){wt(e,!1)&&t.push(`${e}:${n};`)}function $n(t,e){return t?`${t}{${e}}`:""}var ii=(...t)=>xm(Re.getTheme(),...t),xm=(t={},e,n,i)=>{if(e){const{variable:s,options:o}=Re.defaults||{},{prefix:a,transform:l}=(t==null?void 0:t.options)||o||{},d=Mt(e,/{([^}]*)}/g)?e:`{${e}}`;return i==="value"||Ao(i)&&l==="strict"?Re.getTokenValue(e):Xa(d,void 0,a,[s.excludedKeyRegex],n)}return""};function _m(t,e={}){const n=Re.defaults.variable,{prefix:i=n.prefix,selector:s=n.selector,excludedKeyRegex:o=n.excludedKeyRegex}=e,a=(d,u="")=>Object.entries(d).reduce((f,[h,m])=>{const p=Mt(h,o)?$o(u):$o(u,za(h)),g=pm(m);if(Rn(g)){const{variables:y,tokens:b}=a(g,p);Ya(f.tokens,b),Ya(f.variables,y)}else f.tokens.push((i?p.replace(`${i}-`,""):p).replaceAll("-",".")),bm(f.variables,Ka(p),Xa(g,p,i,[o]));return f},{variables:[],tokens:[]}),{variables:l,tokens:c}=a(t,i);return{value:l,tokens:c,declarations:l.join(""),css:$n(s,l.join(""))}}var mt={regex:{rules:{class:{pattern:/^\.([a-zA-Z][\w-]*)$/,resolve(t){return{type:"class",selector:t,matched:this.pattern.test(t.trim())}}},attr:{pattern:/^\[(.*)\]$/,resolve(t){return{type:"attr",selector:`:root${t}`,matched:this.pattern.test(t.trim())}}},media:{pattern:/^@media (.*)$/,resolve(t){return{type:"media",selector:`${t}{:root{[CSS]}}`,matched:this.pattern.test(t.trim())}}},system:{pattern:/^system$/,resolve(t){return{type:"system",selector:"@media (prefers-color-scheme: dark){:root{[CSS]}}",matched:this.pattern.test(t.trim())}}},custom:{resolve(t){return{type:"custom",selector:t,matched:!0}}}},resolve(t){const e=Object.keys(this.rules).filter(n=>n!=="custom").map(n=>this.rules[n]);return[t].flat().map(n=>{var i;return(i=e.map(s=>s.resolve(n)).find(s=>s.matched))!=null?i:this.rules.custom.resolve(n)})}},_toVariables(t,e){return _m(t,{prefix:e==null?void 0:e.prefix})},getCommon({name:t="",theme:e={},params:n,set:i,defaults:s}){var o,a,l,c,d,u,f;const{preset:h,options:m}=e;let p,g,y,b,x,w,E;if(Ce(h)&&m.transform!=="strict"){const{primitive:k,semantic:C,extend:S}=h,_=C||{},{colorScheme:O}=_,P=Vt(_,["colorScheme"]),v=S||{},{colorScheme:T}=v,R=Vt(v,["colorScheme"]),U=O||{},{dark:Y}=U,L=Vt(U,["dark"]),j=T||{},{dark:$}=j,A=Vt(j,["dark"]),I=Ce(k)?this._toVariables({primitive:k},m):{},Q=Ce(P)?this._toVariables({semantic:P},m):{},ne=Ce(L)?this._toVariables({light:L},m):{},se=Ce(Y)?this._toVariables({dark:Y},m):{},K=Ce(R)?this._toVariables({semantic:R},m):{},J=Ce(A)?this._toVariables({light:A},m):{},oe=Ce($)?this._toVariables({dark:$},m):{},[ue,ve]=[(o=I.declarations)!=null?o:"",I.tokens],[st,qe]=[(a=Q.declarations)!=null?a:"",Q.tokens||[]],[xt,ct]=[(l=ne.declarations)!=null?l:"",ne.tokens||[]],[H,F]=[(c=se.declarations)!=null?c:"",se.tokens||[]],[he,pe]=[(d=K.declarations)!=null?d:"",K.tokens||[]],[me,ge]=[(u=J.declarations)!=null?u:"",J.tokens||[]],[Te,Ze]=[(f=oe.declarations)!=null?f:"",oe.tokens||[]];p=this.transformCSS(t,ue,"light","variable",m,i,s),g=ve;const Tt=this.transformCSS(t,`${st}${xt}`,"light","variable",m,i,s),$e=this.transformCSS(t,`${H}`,"dark","variable",m,i,s);y=`${Tt}${$e}`,b=[...new Set([...qe,...ct,...F])];const et=this.transformCSS(t,`${he}${me}color-scheme:light`,"light","variable",m,i,s),dt=this.transformCSS(t,`${Te}color-scheme:dark`,"dark","variable",m,i,s);x=`${et}${dt}`,w=[...new Set([...pe,...ge,...Ze])],E=ft(h.css,{dt:ii})}return{primitive:{css:p,tokens:g},semantic:{css:y,tokens:b},global:{css:x,tokens:w},style:E}},getPreset({name:t="",preset:e={},options:n,params:i,set:s,defaults:o,selector:a}){var l,c,d;let u,f,h;if(Ce(e)&&n.transform!=="strict"){const m=t.replace("-directive",""),p=e,{colorScheme:g,extend:y,css:b}=p,x=Vt(p,["colorScheme","extend","css"]),w=y||{},{colorScheme:E}=w,k=Vt(w,["colorScheme"]),C=g||{},{dark:S}=C,_=Vt(C,["dark"]),O=E||{},{dark:P}=O,v=Vt(O,["dark"]),T=Ce(x)?this._toVariables({[m]:ht(ht({},x),k)},n):{},R=Ce(_)?this._toVariables({[m]:ht(ht({},_),v)},n):{},U=Ce(S)?this._toVariables({[m]:ht(ht({},S),P)},n):{},[Y,L]=[(l=T.declarations)!=null?l:"",T.tokens||[]],[j,$]=[(c=R.declarations)!=null?c:"",R.tokens||[]],[A,I]=[(d=U.declarations)!=null?d:"",U.tokens||[]],Q=this.transformCSS(m,`${Y}${j}`,"light","variable",n,s,o,a),ne=this.transformCSS(m,A,"dark","variable",n,s,o,a);u=`${Q}${ne}`,f=[...new Set([...L,...$,...I])],h=ft(b,{dt:ii})}return{css:u,tokens:f,style:h}},getPresetC({name:t="",theme:e={},params:n,set:i,defaults:s}){var o;const{preset:a,options:l}=e,c=(o=a==null?void 0:a.components)==null?void 0:o[t];return this.getPreset({name:t,preset:c,options:l,params:n,set:i,defaults:s})},getPresetD({name:t="",theme:e={},params:n,set:i,defaults:s}){var o;const a=t.replace("-directive",""),{preset:l,options:c}=e,d=(o=l==null?void 0:l.directives)==null?void 0:o[a];return this.getPreset({name:a,preset:d,options:c,params:n,set:i,defaults:s})},applyDarkColorScheme(t){return!(t.darkModeSelector==="none"||t.darkModeSelector===!1)},getColorSchemeOption(t,e){var n;return this.applyDarkColorScheme(t)?this.regex.resolve(t.darkModeSelector===!0?e.options.darkModeSelector:(n=t.darkModeSelector)!=null?n:e.options.darkModeSelector):[]},getLayerOrder(t,e={},n,i){const{cssLayer:s}=e;return s?`@layer ${ft(s.order||"primeui",n)}`:""},getCommonStyleSheet({name:t="",theme:e={},params:n,props:i={},set:s,defaults:o}){const a=this.getCommon({name:t,theme:e,params:n,set:s,defaults:o}),l=Object.entries(i).reduce((c,[d,u])=>c.push(`${d}="${u}"`)&&c,[]).join(" ");return Object.entries(a||{}).reduce((c,[d,u])=>{if(u!=null&&u.css){const f=ni(u==null?void 0:u.css),h=`${d}-variables`;c.push(`<style type="text/css" data-primevue-style-id="${h}" ${l}>${f}</style>`)}return c},[]).join("")},getStyleSheet({name:t="",theme:e={},params:n,props:i={},set:s,defaults:o}){var a;const l={name:t,theme:e,params:n,set:s,defaults:o},c=(a=t.includes("-directive")?this.getPresetD(l):this.getPresetC(l))==null?void 0:a.css,d=Object.entries(i).reduce((u,[f,h])=>u.push(`${f}="${h}"`)&&u,[]).join(" ");return c?`<style type="text/css" data-primevue-style-id="${t}-variables" ${d}>${ni(c)}</style>`:""},createTokens(t={},e,n="",i="",s={}){return Object.entries(t).forEach(([o,a])=>{const l=Mt(o,e.variable.excludedKeyRegex)?n:n?`${n}.${Ua(o)}`:Ua(o),c=i?`${i}.${o}`:o;Rn(a)?this.createTokens(a,e,l,c,s):(s[l]||(s[l]={paths:[],computed(d,u={}){var f,h;return this.paths.length===1?(f=this.paths[0])==null?void 0:f.computed(this.paths[0].scheme,u.binding):d&&d!=="none"?(h=this.paths.find(m=>m.scheme===d))==null?void 0:h.computed(d,u.binding):this.paths.map(m=>m.computed(m.scheme,u[m.scheme]))}}),s[l].paths.push({path:c,value:a,scheme:c.includes("colorScheme.light")?"light":c.includes("colorScheme.dark")?"dark":"none",computed(d,u={}){const f=/{([^}]*)}/g;let h=a;if(u.name=this.path,u.binding||(u.binding={}),Mt(a,f)){const p=a.trim().replaceAll(f,b=>{var x;const w=b.replace(/{|}/g,""),E=(x=s[w])==null?void 0:x.computed(d,u);return Mo(E)&&E.length===2?`light-dark(${E[0].value},${E[1].value})`:E==null?void 0:E.value}),g=/(\d+\w*\s+[\+\-\*\/]\s+\d+\w*)/g,y=/var\([^)]+\)/g;h=Mt(p.replace(y,"0"),g)?`calc(${p})`:p}return Ao(u.binding)&&delete u.binding,{colorScheme:d,path:this.path,paths:u,value:h.includes("undefined")?void 0:h}}}))}),s},getTokenValue(t,e,n){var i;const o=(c=>c.split(".").filter(u=>!Mt(u.toLowerCase(),n.variable.excludedKeyRegex)).join("."))(e),a=e.includes("colorScheme.light")?"light":e.includes("colorScheme.dark")?"dark":void 0,l=[(i=t[o])==null?void 0:i.computed(a)].flat().filter(c=>c);return l.length===1?l[0].value:l.reduce((c={},d)=>{const u=d,{colorScheme:f}=u,h=Vt(u,["colorScheme"]);return c[f]=h,c},void 0)},getSelectorRule(t,e,n,i){return n==="class"||n==="attr"?$n(Ce(e)?`${t}${e},${t} ${e}`:t,i):$n(t,Ce(e)?$n(e,i):i)},transformCSS(t,e,n,i,s={},o,a,l){if(Ce(e)){const{cssLayer:c}=s;if(i!=="style"){const d=this.getColorSchemeOption(s,a);e=n==="dark"?d.reduce((u,{type:f,selector:h})=>(Ce(h)&&(u+=h.includes("[CSS]")?h.replace("[CSS]",e):this.getSelectorRule(h,l,f,e)),u),""):$n(l??":root",e)}if(c){const d={name:"primeui",order:"primeui"};Rn(c)&&(d.name=ft(c.name,{name:t,type:i})),Ce(d.name)&&(e=$n(`@layer ${d.name}`,e),o==null||o.layerNames(d.name))}return e}return""}},Re={defaults:{variable:{prefix:"p",selector:":root",excludedKeyRegex:/^(primitive|semantic|components|directives|variables|colorscheme|light|dark|common|root|states|extend|css)$/gi},options:{prefix:"p",darkModeSelector:"system",cssLayer:!1}},_theme:void 0,_layerNames:new Set,_loadedStyleNames:new Set,_loadingStyles:new Set,_tokens:{},update(t={}){const{theme:e}=t;e&&(this._theme=Fo(ht({},e),{options:ht(ht({},this.defaults.options),e.options)}),this._tokens=mt.createTokens(this.preset,this.defaults),this.clearLoadedStyleNames())},get theme(){return this._theme},get preset(){var t;return((t=this.theme)==null?void 0:t.preset)||{}},get options(){var t;return((t=this.theme)==null?void 0:t.options)||{}},get tokens(){return this._tokens},getTheme(){return this.theme},setTheme(t){this.update({theme:t}),Xt.emit("theme:change",t)},getPreset(){return this.preset},setPreset(t){this._theme=Fo(ht({},this.theme),{preset:t}),this._tokens=mt.createTokens(t,this.defaults),this.clearLoadedStyleNames(),Xt.emit("preset:change",t),Xt.emit("theme:change",this.theme)},getOptions(){return this.options},setOptions(t){this._theme=Fo(ht({},this.theme),{options:t}),this.clearLoadedStyleNames(),Xt.emit("options:change",t),Xt.emit("theme:change",this.theme)},getLayerNames(){return[...this._layerNames]},setLayerNames(t){this._layerNames.add(t)},getLoadedStyleNames(){return this._loadedStyleNames},isStyleNameLoaded(t){return this._loadedStyleNames.has(t)},setLoadedStyleName(t){this._loadedStyleNames.add(t)},deleteLoadedStyleName(t){this._loadedStyleNames.delete(t)},clearLoadedStyleNames(){this._loadedStyleNames.clear()},getTokenValue(t){return mt.getTokenValue(this.tokens,t,this.defaults)},getCommon(t="",e){return mt.getCommon({name:t,theme:this.theme,params:e,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getComponent(t="",e){const n={name:t,theme:this.theme,params:e,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return mt.getPresetC(n)},getDirective(t="",e){const n={name:t,theme:this.theme,params:e,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return mt.getPresetD(n)},getCustomPreset(t="",e,n,i){const s={name:t,preset:e,options:this.options,selector:n,params:i,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return mt.getPreset(s)},getLayerOrderCSS(t=""){return mt.getLayerOrder(t,this.options,{names:this.getLayerNames()},this.defaults)},transformCSS(t="",e,n="style",i){return mt.transformCSS(t,e,i,n,this.options,{layerNames:this.setLayerNames.bind(this)},this.defaults)},getCommonStyleSheet(t="",e,n={}){return mt.getCommonStyleSheet({name:t,theme:this.theme,params:e,props:n,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getStyleSheet(t,e,n={}){return mt.getStyleSheet({name:t,theme:this.theme,params:e,props:n,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},onStyleMounted(t){this._loadingStyles.add(t)},onStyleUpdated(t){this._loadingStyles.add(t)},onStyleLoaded(t,{name:e}){this._loadingStyles.size&&(this._loadingStyles.delete(e),Xt.emit(`theme:${e}:load`,t),!this._loadingStyles.size&&Xt.emit("theme:load"))}};function Lo(t){return typeof HTMLElement=="object"?t instanceof HTMLElement:t&&typeof t=="object"&&t!==null&&t.nodeType===1&&typeof t.nodeName=="string"}function Io(t,e={}){if(Lo(t)){const n=(i,s)=>{var o,a;const l=(o=t==null?void 0:t.$attrs)!=null&&o[i]?[(a=t==null?void 0:t.$attrs)==null?void 0:a[i]]:[];return[s].flat().reduce((c,d)=>{if(d!=null){const u=typeof d;if(u==="string"||u==="number")c.push(d);else if(u==="object"){const f=Array.isArray(d)?n(i,d):Object.entries(d).map(([h,m])=>i==="style"&&(m||m===0)?`${h.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${m}`:m?h:void 0);c=f.length?c.concat(f.filter(h=>!!h)):c}}return c},l)};Object.entries(e).forEach(([i,s])=>{if(s!=null){const o=i.match(/^on(.+)/);o?t.addEventListener(o[1].toLowerCase(),s):i==="p-bind"||i==="pBind"?Io(t,s):(s=i==="class"?[...new Set(n("class",s))].join(" ").trim():i==="style"?n("style",s).join(";").trim():s,(t.$attrs=t.$attrs||{})&&(t.$attrs[i]=s),t.setAttribute(i,s))}})}}function km(t,e){return Lo(t)?t.matches(e)?t:t.querySelector(e):null}function Sm(t){if(t){let e=t.parentNode;return e&&e instanceof ShadowRoot&&e.host&&(e=e.host),e}return null}function wm(t){return!!(t!==null&&typeof t<"u"&&t.nodeName&&Sm(t))}function Ga(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Em(t,e="",n){Lo(t)&&n!==null&&n!==void 0&&t.setAttribute(e,n)}var bs={};function Cm(t="pui_id_"){return bs.hasOwnProperty(t)||(bs[t]=0),bs[t]++,`${t}${bs[t]}`}var si={_loadedStyleNames:new Set,getLoadedStyleNames:function(){return this._loadedStyleNames},isStyleNameLoaded:function(e){return this._loadedStyleNames.has(e)},setLoadedStyleName:function(e){this._loadedStyleNames.add(e)},deleteLoadedStyleName:function(e){this._loadedStyleNames.delete(e)},clearLoadedStyleNames:function(){this._loadedStyleNames.clear()}};function oi(t){"@babel/helpers - typeof";return oi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},oi(t)}function Ja(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,i)}return n}function Qa(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Ja(Object(n),!0).forEach(function(i){Om(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ja(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function Om(t,e,n){return(e=vm(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vm(t){var e=Nm(t,"string");return oi(e)=="symbol"?e:e+""}function Nm(t,e){if(oi(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(oi(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Dm(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;r.getCurrentInstance()?r.onMounted(t):e?t():r.nextTick(t)}var Tm=0;function Bm(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=r.ref(!1),i=r.ref(t),s=r.ref(null),o=Ga()?window.document:void 0,a=e.document,l=a===void 0?o:a,c=e.immediate,d=c===void 0?!0:c,u=e.manual,f=u===void 0?!1:u,h=e.name,m=h===void 0?"style_".concat(++Tm):h,p=e.id,g=p===void 0?void 0:p,y=e.media,b=y===void 0?void 0:y,x=e.nonce,w=x===void 0?void 0:x,E=e.first,k=E===void 0?!1:E,C=e.onMounted,S=C===void 0?void 0:C,_=e.onUpdated,O=_===void 0?void 0:_,P=e.onLoad,v=P===void 0?void 0:P,T=e.props,R=T===void 0?{}:T,U=function(){},Y=function($){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(l){var I=Qa(Qa({},R),A),Q=I.name||m,ne=I.id||g,se=I.nonce||w;s.value=l.querySelector('style[data-primevue-style-id="'.concat(Q,'"]'))||l.getElementById(ne)||l.createElement("style"),s.value.isConnected||(i.value=$||t,Io(s.value,{type:"text/css",id:ne,media:b,nonce:se}),k?l.head.prepend(s.value):l.head.appendChild(s.value),Em(s.value,"data-primevue-style-id",Q),Io(s.value,I),s.value.onload=function(K){return v==null?void 0:v(K,{name:Q})},S==null||S(Q)),!n.value&&(U=r.watch(i,function(K){s.value.textContent=K,O==null||O(Q)},{immediate:!0}),n.value=!0)}},L=function(){!l||!n.value||(U(),wm(s.value)&&l.head.removeChild(s.value),n.value=!1)};return d&&!f&&Dm(Y),{id:g,name:m,el:s,css:i,unload:L,load:Y,isLoaded:r.readonly(n)}}function ri(t){"@babel/helpers - typeof";return ri=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ri(t)}function Za(t,e){return Vm(t)||Mm(t,e)||Am(t,e)||Pm()}function Pm(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
12
+ `+(l!==a?`result of cast: ${l}`:""))}return o}_cast(e,n){let i=e===void 0?e:this.transforms.reduce((s,o)=>o.call(this,s,e,this),e);return i===void 0&&(i=this.getDefault(n)),i}_validate(e,n={},i,s){let{path:o,originalValue:a=e,strict:l=this.spec.strict}=n,c=e;l||(c=this._cast(c,Object.assign({assert:!1},n)));let d=[];for(let u of Object.values(this.internalTests))u&&d.push(u);this.runTests({path:o,value:c,originalValue:a,options:n,tests:d},i,u=>{if(u.length)return s(u,c);this.runTests({path:o,value:c,originalValue:a,options:n,tests:this.tests},i,s)})}runTests(e,n,i){let s=!1,{tests:o,value:a,originalValue:l,path:c,options:d}=e,u=g=>{s||(s=!0,n(g,a))},f=g=>{s||(s=!0,i(g,a))},h=o.length,m=[];if(!h)return f([]);let p={value:a,originalValue:l,path:c,options:d,schema:this};for(let g=0;g<o.length;g++){const y=o[g];y(p,u,function(x){x&&(Array.isArray(x)?m.push(...x):m.push(x)),--h<=0&&f(m)})}}asNestedTest({key:e,index:n,parent:i,parentPath:s,originalParent:o,options:a}){const l=e??n;if(l==null)throw TypeError("Must include `key` or `index` for nested validations");const c=typeof l=="number";let d=i[l];const u=Object.assign({},a,{strict:!0,parent:i,value:d,originalValue:o[l],key:void 0,[c?"index":"key"]:l,path:c||l.includes(".")?`${s||""}[${c?l:`"${l}"`}]`:(s?`${s}.`:"")+e});return(f,h,m)=>this.resolve(u)._validate(d,u,h,m)}validate(e,n){var i;let s=this.resolve(Object.assign({},n,{value:e})),o=(i=n==null?void 0:n.disableStackTrace)!=null?i:s.spec.disableStackTrace;return new Promise((a,l)=>s._validate(e,n,(c,d)=>{Ke.isError(c)&&(c.value=d),l(c)},(c,d)=>{c.length?l(new Ke(c,d,void 0,void 0,o)):a(d)}))}validateSync(e,n){var i;let s=this.resolve(Object.assign({},n,{value:e})),o,a=(i=n==null?void 0:n.disableStackTrace)!=null?i:s.spec.disableStackTrace;return s._validate(e,Object.assign({},n,{sync:!0}),(l,c)=>{throw Ke.isError(l)&&(l.value=c),l},(l,c)=>{if(l.length)throw new Ke(l,e,void 0,void 0,a);o=c}),o}isValid(e,n){return this.validate(e,n).then(()=>!0,i=>{if(Ke.isError(i))return!1;throw i})}isValidSync(e,n){try{return this.validateSync(e,n),!0}catch(i){if(Ke.isError(i))return!1;throw i}}_getDefault(e){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,e):Vn(n)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,n){const i=this.clone({nullable:e});return i.internalTests.nullable=Mn({message:n,name:"nullable",test(s){return s===null?this.schema.spec.nullable:!0}}),i}optionality(e,n){const i=this.clone({optional:e});return i.internalTests.optionality=Mn({message:n,name:"optionality",test(s){return s===void 0?this.schema.spec.optional:!0}}),i}optional(){return this.optionality(!0)}defined(e=kt.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=kt.notNull){return this.nullability(!1,e)}required(e=kt.required){return this.clone().withMutation(n=>n.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let n=this.clone();return n.transforms.push(e),n}test(...e){let n;if(e.length===1?typeof e[0]=="function"?n={test:e[0]}:n=e[0]:e.length===2?n={name:e[0],test:e[1]}:n={name:e[0],message:e[1],test:e[2]},n.message===void 0&&(n.message=kt.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let i=this.clone(),s=Mn(n),o=n.exclusive||n.name&&i.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(i.exclusiveTests[n.name]=!!n.exclusive),i.tests=i.tests.filter(a=>!(a.OPTIONS.name===n.name&&(o||a.OPTIONS.test===s.OPTIONS.test))),i.tests.push(s),i}when(e,n){!Array.isArray(e)&&typeof e!="string"&&(n=e,e=".");let i=this.clone(),s=va(e).map(o=>new mn(o));return s.forEach(o=>{o.isSibling&&i.deps.push(o.key)}),i.conditions.push(typeof n=="function"?new fs(s,n):fs.fromOptions(s,n)),i}typeError(e){let n=this.clone();return n.internalTests.typeError=Mn({message:e,name:"typeError",skipAbsent:!0,test(i){return this.schema._typeCheck(i)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(e,n=kt.oneOf){let i=this.clone();return e.forEach(s=>{i._whitelist.add(s),i._blacklist.delete(s)}),i.internalTests.whiteList=Mn({message:n,name:"oneOf",skipAbsent:!0,test(s){let o=this.schema._whitelist,a=o.resolveAll(this.resolve);return a.includes(s)?!0:this.createError({params:{values:Array.from(o).join(", "),resolved:a}})}}),i}notOneOf(e,n=kt.notOneOf){let i=this.clone();return e.forEach(s=>{i._blacklist.add(s),i._whitelist.delete(s)}),i.internalTests.blacklist=Mn({message:n,name:"notOneOf",test(s){let o=this.schema._blacklist,a=o.resolveAll(this.resolve);return a.includes(s)?this.createError({params:{values:Array.from(o).join(", "),resolved:a}}):!0}}),i}strip(e=!0){let n=this.clone();return n.spec.strip=e,n}describe(e){const n=(e?this.resolve(e):this).clone(),{label:i,meta:s,optional:o,nullable:a}=n.spec;return{meta:s,label:i,optional:o,nullable:a,default:n.getDefault(e),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.map(c=>({name:c.OPTIONS.name,params:c.OPTIONS.params})).filter((c,d,u)=>u.findIndex(f=>f.name===c.name)===d)}}}St.prototype.__isYupSchema__=!0;for(const t of["validate","validateSync"])St.prototype[`${t}At`]=function(e,n,i={}){const{parent:s,parentPath:o,schema:a}=vh(this,e,n,i.context);return a[t](s&&s[o],Object.assign({},i,{parent:s,path:e}))};for(const t of["equals","is"])St.prototype[t]=St.prototype.oneOf;for(const t of["not","nope"])St.prototype[t]=St.prototype.notOneOf;const Nh=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function Dh(t){const e=Do(t);if(!e)return Date.parse?Date.parse(t):Number.NaN;if(e.z===void 0&&e.plusMinus===void 0)return new Date(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond).valueOf();let n=0;return e.z!=="Z"&&e.plusMinus!==void 0&&(n=e.hourOffset*60+e.minuteOffset,e.plusMinus==="+"&&(n=0-n)),Date.UTC(e.year,e.month,e.day,e.hour,e.minute+n,e.second,e.millisecond)}function Do(t){var e,n;const i=Nh.exec(t);return i?{year:At(i[1]),month:At(i[2],1)-1,day:At(i[3],1),hour:At(i[4]),minute:At(i[5]),second:At(i[6]),millisecond:i[7]?At(i[7].substring(0,3)):0,precision:(e=(n=i[7])==null?void 0:n.length)!=null?e:void 0,z:i[8]||void 0,plusMinus:i[9]||void 0,hourOffset:At(i[10]),minuteOffset:At(i[11])}:null}function At(t,e=0){return Number(t)||e}let Th=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Bh=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,Ph=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Ah="^\\d{4}-\\d{2}-\\d{2}",Mh="\\d{2}:\\d{2}:\\d{2}",Vh="(([+-]\\d{2}(:?\\d{2})?)|Z)",Rh=new RegExp(`${Ah}T${Mh}(\\.\\d+)?${Vh}$`),Fh=t=>pn(t)||t===t.trim(),$h={}.toString();function To(){return new Pa}class Pa extends St{constructor(){super({type:"string",check(e){return e instanceof String&&(e=e.valueOf()),typeof e=="string"}}),this.withMutation(()=>{this.transform((e,n,i)=>{if(!i.spec.coerce||i.isType(e)||Array.isArray(e))return e;const s=e!=null&&e.toString?e.toString():e;return s===$h?e:s})})}required(e){return super.required(e).withMutation(n=>n.test({message:e||kt.required,name:"required",skipAbsent:!0,test:i=>!!i.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(n=>n.OPTIONS.name!=="required"),e))}length(e,n=Xe.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(i){return i.length===this.resolve(e)}})}min(e,n=Xe.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(i){return i.length>=this.resolve(e)}})}max(e,n=Xe.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:e},skipAbsent:!0,test(i){return i.length<=this.resolve(e)}})}matches(e,n){let i=!1,s,o;return n&&(typeof n=="object"?{excludeEmptyString:i=!1,message:s,name:o}=n:s=n),this.test({name:o||"matches",message:s||Xe.matches,params:{regex:e},skipAbsent:!0,test:a=>a===""&&i||a.search(e)!==-1})}email(e=Xe.email){return this.matches(Th,{name:"email",message:e,excludeEmptyString:!0})}url(e=Xe.url){return this.matches(Bh,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=Xe.uuid){return this.matches(Ph,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let n="",i,s;return e&&(typeof e=="object"?{message:n="",allowOffset:i=!1,precision:s=void 0}=e:n=e),this.matches(Rh,{name:"datetime",message:n||Xe.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||Xe.datetime_offset,params:{allowOffset:i},skipAbsent:!0,test:o=>{if(!o||i)return!0;const a=Do(o);return a?!!a.z:!1}}).test({name:"datetime_precision",message:n||Xe.datetime_precision,params:{precision:s},skipAbsent:!0,test:o=>{if(!o||s==null)return!0;const a=Do(o);return a?a.precision===s:!1}})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=Xe.trim){return this.transform(n=>n!=null?n.trim():n).test({message:e,name:"trim",test:Fh})}lowercase(e=Xe.lowercase){return this.transform(n=>pn(n)?n:n.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>pn(n)||n===n.toLowerCase()})}uppercase(e=Xe.uppercase){return this.transform(n=>pn(n)?n:n.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>pn(n)||n===n.toUpperCase()})}}To.prototype=Pa.prototype;let Lh=new Date(""),Ih=t=>Object.prototype.toString.call(t)==="[object Date]";class ps extends St{constructor(){super({type:"date",check(e){return Ih(e)&&!isNaN(e.getTime())}}),this.withMutation(()=>{this.transform((e,n,i)=>!i.spec.coerce||i.isType(e)||e===null?e:(e=Dh(e),isNaN(e)?ps.INVALID_DATE:new Date(e)))})}prepareParam(e,n){let i;if(mn.isRef(e))i=e;else{let s=this.cast(e);if(!this._typeCheck(s))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);i=s}return i}min(e,n=vo.min){let i=this.prepareParam(e,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(s){return s>=this.resolve(i)}})}max(e,n=vo.max){let i=this.prepareParam(e,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(s){return s<=this.resolve(i)}})}}ps.INVALID_DATE=Lh,ps.prototype;function jh(t,e=[]){let n=[],i=new Set,s=new Set(e.map(([a,l])=>`${a}-${l}`));function o(a,l){let c=hn.split(a)[0];i.add(c),s.has(`${l}-${c}`)||n.push([l,c])}for(const a of Object.keys(t)){let l=t[a];i.add(a),mn.isRef(l)&&l.isSibling?o(l.path,a):No(l)&&"deps"in l&&l.deps.forEach(c=>o(c,a))}return yh.array(Array.from(i),n).reverse()}function Aa(t,e){let n=1/0;return t.some((i,s)=>{var o;if((o=e.path)!=null&&o.includes(i))return n=s,!0}),n}function Ma(t){return(e,n)=>Aa(t,e)-Aa(t,n)}const zh=(t,e,n)=>{if(typeof t!="string")return t;let i=t;try{i=JSON.parse(t)}catch{}return n.isType(i)?i:t};function gs(t){if("fields"in t){const e={};for(const[n,i]of Object.entries(t.fields))e[n]=gs(i);return t.setFields(e)}if(t.type==="array"){const e=t.optional();return e.innerType&&(e.innerType=gs(e.innerType)),e}return t.type==="tuple"?t.optional().clone({types:t.spec.types.map(gs)}):"optional"in t?t.optional():t}const Uh=(t,e)=>{const n=[...hn.normalizePath(e)];if(n.length===1)return n[0]in t;let i=n.pop(),s=hn.getter(hn.join(n),!0)(t);return!!(s&&i in s)};let Va=t=>Object.prototype.toString.call(t)==="[object Object]";function Ra(t,e){let n=Object.keys(t.fields);return Object.keys(e).filter(i=>n.indexOf(i)===-1)}const Wh=Ma([]);function Bo(t){return new Fa(t)}class Fa extends St{constructor(e){super({type:"object",check(n){return Va(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=Wh,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,n={}){var i;let s=super._cast(e,n);if(s===void 0)return this.getDefault(n);if(!this._typeCheck(s))return s;let o=this.fields,a=(i=n.stripUnknown)!=null?i:this.spec.noUnknown,l=[].concat(this._nodes,Object.keys(s).filter(f=>!this._nodes.includes(f))),c={},d=Object.assign({},n,{parent:c,__validating:n.__validating||!1}),u=!1;for(const f of l){let h=o[f],m=f in s;if(h){let p,g=s[f];d.path=(n.path?`${n.path}.`:"")+f,h=h.resolve({value:g,context:n.context,parent:c});let y=h instanceof St?h.spec:void 0,b=y==null?void 0:y.strict;if(y!=null&&y.strip){u=u||f in s;continue}p=!n.__validating||!b?h.cast(s[f],d):s[f],p!==void 0&&(c[f]=p)}else m&&!a&&(c[f]=s[f]);(m!==f in c||c[f]!==s[f])&&(u=!0)}return u?c:s}_validate(e,n={},i,s){let{from:o=[],originalValue:a=e,recursive:l=this.spec.recursive}=n;n.from=[{schema:this,value:a},...o],n.__validating=!0,n.originalValue=a,super._validate(e,n,i,(c,d)=>{if(!l||!Va(d)){s(c,d);return}a=a||d;let u=[];for(let f of this._nodes){let h=this.fields[f];!h||mn.isRef(h)||u.push(h.asNestedTest({options:n,key:f,parent:d,parentPath:n.path,originalParent:a}))}this.runTests({tests:u,value:d,originalValue:a,options:n},i,f=>{s(f.sort(this._sortErrors).concat(c),d)})})}clone(e){const n=super.clone(e);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(e){let n=super.concat(e),i=n.fields;for(let[s,o]of Object.entries(this.fields)){const a=i[s];i[s]=a===void 0?o:a}return n.withMutation(s=>s.setFields(i,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let n={};return this._nodes.forEach(i=>{var s;const o=this.fields[i];let a=e;(s=a)!=null&&s.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[i]})),n[i]=o&&"getDefault"in o?o.getDefault(a):void 0}),n}setFields(e,n){let i=this.clone();return i.fields=e,i._nodes=jh(e,n),i._sortErrors=Ma(Object.keys(e)),n&&(i._excludedEdges=n),i}shape(e,n=[]){return this.clone().withMutation(i=>{let s=i._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),s=[...i._excludedEdges,...n]),i.setFields(Object.assign(i.fields,e),s)})}partial(){const e={};for(const[n,i]of Object.entries(this.fields))e[n]="optional"in i&&i.optional instanceof Function?i.optional():i;return this.setFields(e)}deepPartial(){return gs(this)}pick(e){const n={};for(const i of e)this.fields[i]&&(n[i]=this.fields[i]);return this.setFields(n,this._excludedEdges.filter(([i,s])=>e.includes(i)&&e.includes(s)))}omit(e){const n=[];for(const i of Object.keys(this.fields))e.includes(i)||n.push(i);return this.pick(n)}from(e,n,i){let s=hn.getter(e,!0);return this.transform(o=>{if(!o)return o;let a=o;return Uh(o,e)&&(a=Object.assign({},o),i||delete a[e],a[n]=s(o)),a})}json(){return this.transform(zh)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||us.exact,test(n){if(n==null)return!0;const i=Ra(this.schema,n);return i.length===0||this.createError({params:{properties:i.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,n=us.noUnknown){typeof e!="boolean"&&(n=e,e=!0);let i=this.test({name:"noUnknown",exclusive:!0,message:n,test(s){if(s==null)return!0;const o=Ra(this.schema,s);return!e||o.length===0||this.createError({params:{unknown:o.join(", ")}})}});return i.spec.noUnknown=e,i}unknown(e=!0,n=us.noUnknown){return this.noUnknown(!e,n)}transformKeys(e){return this.transform(n=>{if(!n)return n;const i={};for(const s of Object.keys(n))i[e(s)]=n[s];return i})}camelCase(){return this.transformKeys(Oo.camelCase)}snakeCase(){return this.transformKeys(Oo.snakeCase)}constantCase(){return this.transformKeys(e=>Oo.snakeCase(e).toUpperCase())}describe(e){const n=(e?this.resolve(e):this).clone(),i=super.describe(e);i.fields={};for(const[o,a]of Object.entries(n.fields)){var s;let l=e;(s=l)!=null&&s.value&&(l=Object.assign({},l,{parent:l.value,value:l.value[o]})),i.fields[o]=a.describe(l)}return i}}Bo.prototype=Fa.prototype;function Po(t,e,n){const i=new fn;let s=r.ref({});const o=r.ref({}),a=r.ref({});let l=r.ref([]);const c=r.ref(null),d=r.ref([]);let u=r.ref([]),f=r.ref(!1);const h=r.ref({});let{handleSubmit:m,errors:p,setErrors:g}=Sa();const y=async()=>{var $;try{const A=await i.getEntityRecords(t);A&&A.response&&(s.value=A.response,l.value=($=A.response.entity.entityDefinition)==null?void 0:$.columns,j(),S(),v())}catch(A){toast.add({severity:"error",summary:"Error",detail:A.errorMessage,life:3e3})}finally{}},b=async()=>{var $;try{const A=await i.getRecord(t,e);A&&A.response&&(s.value=A.response,l.value=($=A.response.entity.entityDefinition)==null?void 0:$.columns,j(),o.value=JSON.parse(JSON.stringify(A.response.result[0])),v())}catch(A){console.error("Error fetching entity:",A.errorMessage)}finally{}},x=async()=>{var $,A;try{const I=await i.getRelatedEntityRecord(t,e);I&&I.response&&(s.value=I.response,l.value=(A=($=I.response.entity)==null?void 0:$.entityDefinition)==null?void 0:A.columns,j(),o.value=JSON.parse(JSON.stringify(I.response.result[0])),o.value.entityName&&delete o.value.entityName,o.value.linkedEntities&&delete o.value.linkedEntities,u.value=I.response.result[0].linkedEntities,a.value=JSON.parse(JSON.stringify(o.value)),v())}catch(I){console.error("Error fetching entity:",I.errorMessage)}finally{}},w=async $=>{try{let A=await i.addRecord(t,$);A&&A.response&&n("onSaveDialog",{entityName:t,recordId:e})}catch(A){A.validationErrors&&(d.value=JSON.parse(JSON.stringify(A.validationErrors))),console.error("Error fetching entity:",A.errorMessage)}finally{}},E=async($,A)=>{try{let I=await i.addRecord(t,A);if(I&&I.response){let Q=await i.saveRelatedEntityRecord(t,I.response.recordId,$.linkedEntities);Q&&Q.response&&n("onSaveDialog",{entityName:t,recordId:e})}}catch(I){I.validationErrors&&(d.value=JSON.parse(JSON.stringify(I.validationErrors))),console.error("Error fetching entity:",I.errorMessage)}finally{}},k=async $=>{try{const A=await i.updateRecord(t,e,$);A&&A.response&&(f.value=!1,a.value=JSON.parse(JSON.stringify(o.value)),n("onSaveDialog",{entityName:t,recordId:e}))}catch(A){A.validationErrors&&(d.value=JSON.parse(JSON.stringify(A.errvalidationErrorsors))),console.error("Error fetching entity:",A.errorMessage)}finally{}},C=async($,A,I)=>{try{let Q=await i.saveRelatedEntityRecord($,A,I);Q&&Q.response&&n("onSaveDialog",{entityName:t,enityRecordId:A})}catch(Q){Q.validationErrors&&(d.value=JSON.parse(JSON.stringify(Q.validationErrors))),console.error("Error fetching entity:",Q.errorMessage)}finally{}},S=()=>{for(let $=0;$<l.value.length;$++){let A=l.value[$];A.autoGenerated||(o.value[A.name]="")}},_=$=>{let A="";for(let I=0;I<l.value.length;I++){let Q=l.value[I];if($==Q.name){A=Q.type;break}}return A},O=()=>{const $=l.value.filter(I=>I.autoGenerated).map(I=>I.name);return Object.entries(o.value).filter(([I])=>!$.includes(I)).map(([I,Q])=>({recordColumnName:I,recordColumnValue:Q,columnType:_(I)}))},P=async($={})=>{try{await c.value.validate(o.value,{abortEarly:!1}),g({})}catch(I){const Q=I.inner.reduce((se,K)=>(se[K.path]||(se[K.path]={messages:[]}),se[K.path].messages.push(...K.errors),se),{}),ne=Object.entries(Q).reduce((se,[K,J])=>(se[K]={messages:J.messages},se),{});g(ne);return}const A={dataDefinitions:O()};e?await k(A):$.relationType=="MANY_TO_ONE"?await E($,A):await w(A)},v=()=>{c.value=Bo().shape(l.value.reduce(($,A)=>(A.autoGenerated||($[A.name]=To().nullable(!1).test({name:"custom-validation",test:function(I){const Q=[];let ne="";if(A.required&&(!I||I.trim()===""))if(A.validations){ne=T(A.validations,"VALIDATE_REQUIRED"),Q.push(ne);let se=U(A.validations,"VALIDATE_REQUIRED");se&&(se="hint:"+se,Q.push(se))}else ne=A.displayName+" is required.",Q.push(ne);else{if(A.maxLength&&I.length>A.maxLength)if(A.validations){ne=T(A.validations,"VALIDATE_MAXLENGTH"),Q.push(ne);let se=U(A.validations,"VALIDATE_MAXLENGTH");se&&(se="hint:"+se,Q.push(se))}else ne=A.displayName+" cannot exceed from "+A.maxLength+" characters",Q.push(ne);if(A.regxId&&!new RegExp(R(A.validations,"VALIDATE_REGX")).test(I))if(A.validations){ne=T(A.validations,"VALIDATE_REGX"),Q.push(ne);let se=U(A.validations,"VALIDATE_REGX");se&&(se="hint:"+se,Q.push(se))}else ne=A.displayName+" invalid format.",Q.push(ne)}return Q.length>0?this.createError({message:Q}):!0}})),$),{}))},T=($,A)=>{for(let I=0;I<$.length;I++)if(A==$[I].type)return $[I].message},R=($,A)=>{for(let I=0;I<$.length;I++)if(A==$[I].type)return $[I].regx},U=($,A)=>{for(let I=0;I<$.length;I++)if(A==$[I].type)return $[I].hint},Y=$=>{g({...p.value,[$]:null}),f.value=!0},L=()=>{f.value=!1;for(let $ in o.value)o.value.hasOwnProperty($)&&g({...p.value,[$]:null});o.value=JSON.parse(JSON.stringify(a.value))},j=()=>{for(let $=0;$<l.value.length;$++){const A=l.value[$];if(A.primaryKey&&A.primaryKey==!0){h.value=A;break}}};return{formData:o,columns:l,errors:p,backendErrors:d,isDataChange:f,linkedEntities:u,primarayKeyColumn:h,clearErrors:Y,saveRecord:P,fetchAllRecords:y,fetchRecord:b,getRelatedEntityRecordById:x,cancleRecord:L,saveRelatedEntityRecord:C}}const Hh={key:0,class:"surface-card"},qh={class:"info"},Yh={key:0,class:"list-none p-0"},$a={__name:"EntityFormErrors",props:{errors:Array},setup(t){let e=r.ref(!0);const n=()=>{e.value=!e.value};return(i,s)=>{var a;const o=r.resolveComponent("Message");return((a=t.errors)==null?void 0:a.length)>0?(r.openBlock(),r.createElementBlock("div",Hh,[s[1]||(s[1]=r.createElementVNode("h4",{class:"flex-1 font-bold text-red-500"},"Errors",-1)),r.createElementVNode("div",qh,[r.createElementVNode("span",{onClick:s[0]||(s[0]=l=>n()),class:"cursor-pointer underline showHideColor"},r.toDisplayString(r.unref(e)?"Hide":"Show"),1)]),r.unref(e)?(r.openBlock(),r.createElementBlock("ul",Yh,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.errors,(l,c)=>(r.openBlock(),r.createElementBlock("li",{key:c,class:"mb-2"},[r.createVNode(o,{style:{"word-break":"break-all"},closable:!1,severity:"error"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(l.message),1)]),_:2},1024)]))),128))])):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)}}},Kh={class:"field flex flex-col mb-3"},Xh=["for"],Gh={key:0,class:"flex items-center"},Jh={key:1},Qh={class:"flex items-center"},La={__name:"RelatedEntitySelection",props:{modelValue:{required:!0},entityName:{type:String,required:!0},columnName:{type:String,required:!0},relatedEntityColumn:{type:String,required:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,i=new fn,s=r.ref({});let o=r.ref("");const a=e;r.onMounted(()=>{l()});const l=async()=>{try{const u=await i.getEntityRecords(n.entityName);u&&u.response&&(s.value=u.response,d())}catch{}finally{}},c=()=>{a("update:modelValue",o.value[n.relatedEntityColumn])},d=()=>{for(let u=0;u<s.value.result.length;u++){const f=s.value.result[u];if(f[n.relatedEntityColumn]==n.modelValue){o.value=f;break}}};return(u,f)=>{const h=r.resolveComponent("Select");return r.openBlock(),r.createElementBlock("div",Kh,[r.createElementVNode("label",{for:t.columnName},r.toDisplayString(t.columnName),9,Xh),r.createVNode(h,{modelValue:r.unref(o),"onUpdate:modelValue":[f[0]||(f[0]=m=>r.isRef(o)?o.value=m:o=m),c],"item-value":t.relatedEntityColumn,options:s.value.result,filter:"",optionLabel:t.relatedEntityColumn,placeholder:"Select "+t.relatedEntityColumn,class:"w-full"},{value:r.withCtx(m=>[m.value?(r.openBlock(),r.createElementBlock("div",Gh,[r.createElementVNode("div",null,r.toDisplayString(m.value[t.relatedEntityColumn]),1)])):(r.openBlock(),r.createElementBlock("span",Jh,r.toDisplayString(m.placeholder),1))]),option:r.withCtx(m=>[r.createElementVNode("div",Qh,[r.createElementVNode("div",null,r.toDisplayString(m.option[t.relatedEntityColumn]),1)])]),_:1},8,["modelValue","item-value","options","optionLabel","placeholder"])])}}},Zh={key:0,style:{"font-weight":"700","font-size":"1.25rem"}},em={key:1,style:{"font-weight":"700","font-size":"1.25rem"}},tm={__name:"EntityDialog",props:r.mergeModels({entityName:{type:String,required:!0},recordId:{type:[String,Number],default:null}},{showForm:{},showFormModifiers:{}}),emits:r.mergeModels(["onSaveDialog"],["update:showForm"]),setup(t,{emit:e}){const n=r.useModel(t,"showForm"),i=e,{formData:s,columns:o,errors:a,backendErrors:l,clearErrors:c,saveRecord:d,fetchAllRecords:u,fetchRecord:f}=Po(t.entityName,t.recordId,i);return r.onMounted(()=>{t.recordId?f():u()}),(h,m)=>{const p=r.resolveComponent("Button"),g=r.resolveComponent("Dialog");return n.value?(r.openBlock(),r.createBlock(g,{key:0,showFooter:!1,visible:n.value,"onUpdate:visible":m[2]||(m[2]=y=>n.value=y),style:{width:"50rem"},breakpoints:{"1199px":"75vw","575px":"90vw"},modal:!0,class:"p-fluid"},{header:r.withCtx(()=>[t.recordId?(r.openBlock(),r.createElementBlock("span",Zh,"Edit "+r.toDisplayString(t.entityName)+" record details",1)):r.createCommentVNode("",!0),t.recordId?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",em,"Add "+r.toDisplayString(t.entityName)+" record details",1))]),footer:r.withCtx(()=>[r.createVNode(p,{type:"button",icon:"",label:"Cancel",severity:"secondary",onClick:m[0]||(m[0]=y=>n.value=!1)}),r.createVNode(p,{type:"button",icon:"",label:"Save",severity:"success",onClick:m[1]||(m[1]=y=>r.unref(d)())})]),default:r.withCtx(()=>{var y;return[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(o),(b,x)=>{var w;return r.openBlock(),r.createElementBlock("div",{key:x},[!b.autoGenerated&&!b.foreignKey?(r.openBlock(),r.createBlock(os,{key:0,modelValue:r.unref(s)[b.name],"onUpdate:modelValue":E=>r.unref(s)[b.name]=E,column:b,errors:(w=r.unref(a)[b.name])==null?void 0:w.messages,onInput:r.unref(c)},null,8,["modelValue","onUpdate:modelValue","column","errors","onInput"])):r.createCommentVNode("",!0),!b.autoGenerated&&b.foreignKey?(r.openBlock(),r.createBlock(La,{key:1,modelValue:r.unref(s)[b.name],"onUpdate:modelValue":E=>r.unref(s)[b.name]=E,entityName:b.foreignKey.referencedEntityName,columnName:b.name,relatedEntityColumn:b.foreignKey.referencedColumnName},null,8,["modelValue","onUpdate:modelValue","entityName","columnName","relatedEntityColumn"])):r.createCommentVNode("",!0)])}),128)),((y=r.unref(l))==null?void 0:y.length)>0?(r.openBlock(),r.createBlock($a,{key:0,errors:r.unref(l)},null,8,["errors"])):r.createCommentVNode("",!0)]}),_:1},8,["visible"])):r.createCommentVNode("",!0)}}},nm={__name:"DeleteConfirmationDialog",props:r.mergeModels({entityName:{type:String,required:!0},recordId:{type:[String,Number],default:null}},{showDeleteDialog:{},showDeleteDialogModifiers:{}}),emits:r.mergeModels(["onDeleteItem"],["update:showDeleteDialog"]),setup(t,{emit:e}){const n=new fn,i=r.useModel(t,"showDeleteDialog"),s=e,o=async()=>{try{const a=await n.deleteRecord(t.entityName,t.recordId);a&&a.response&&s("onDeleteItem")}catch(a){console.error("Error deleting record:",a.errorMessage)}finally{}};return(a,l)=>{const c=r.resolveComponent("Button"),d=r.resolveComponent("Dialog");return r.openBlock(),r.createBlock(d,{visible:i.value,"onUpdate:visible":l[1]||(l[1]=u=>i.value=u),style:{width:"450px"},header:"Confirm",modal:!0},{footer:r.withCtx(()=>[r.createVNode(c,{label:"No",icon:"pi pi-times",text:"",onClick:l[0]||(l[0]=u=>i.value=!1)}),r.createVNode(c,{label:"Yes",icon:"pi pi-check",text:"",onClick:o})]),default:r.withCtx(()=>[l[2]||(l[2]=r.createElementVNode("div",{class:"flex items-center justify-center"},[r.createElementVNode("i",{class:"pi pi-exclamation-triangle mr-3",style:{"font-size":"2rem"}}),r.createElementVNode("span",null,"Are you sure you want to delete the selected item?")],-1))]),_:1},8,["visible"])}}};function Ao(t){return t==null||t===""||Array.isArray(t)&&t.length===0||!(t instanceof Date)&&typeof t=="object"&&Object.keys(t).length===0}function Ia(t){return!!(t&&t.constructor&&t.call&&t.apply)}function Ce(t){return!Ao(t)}function Rn(t,e=!0){return t instanceof Object&&t.constructor===Object&&(e||Object.keys(t).length!==0)}function ft(t,...e){return Ia(t)?t(...e):t}function wt(t,e=!0){return typeof t=="string"&&(e||t!=="")}function Kt(t){return wt(t)?t.replace(/(-|_)/g,"").toLowerCase():t}function ja(t,e="",n={}){const i=Kt(e).split("."),s=i.shift();return s?Rn(t)?ja(ft(t[Object.keys(t).find(o=>Kt(o)===s)||""],n),i.join("."),n):void 0:ft(t,n)}function Mo(t,e=!0){return Array.isArray(t)&&(e||t.length!==0)}function im(t){return Ce(t)&&!isNaN(t)}function Mt(t,e){if(e){const n=e.test(t);return e.lastIndex=0,n}return!1}function ni(t){return t&&t.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g,"").replace(/ {2,}/g," ").replace(/ ([{:}]) /g,"$1").replace(/([;,]) /g,"$1").replace(/ !/g,"!").replace(/: /g,":")}function za(t){return wt(t)?t.replace(/(_)/g,"-").replace(/[A-Z]/g,(e,n)=>n===0?e:"-"+e.toLowerCase()).toLowerCase():t}function Ua(t){return wt(t)?t.replace(/[A-Z]/g,(e,n)=>n===0?e:"."+e.toLowerCase()).toLowerCase():t}var Fn={STARTS_WITH:"startsWith",CONTAINS:"contains",NOT_CONTAINS:"notContains",ENDS_WITH:"endsWith",EQUALS:"equals",NOT_EQUALS:"notEquals",IN:"in",LESS_THAN:"lt",LESS_THAN_OR_EQUAL_TO:"lte",GREATER_THAN:"gt",GREATER_THAN_OR_EQUAL_TO:"gte",BETWEEN:"between",DATE_IS:"dateIs",DATE_IS_NOT:"dateIsNot",DATE_BEFORE:"dateBefore",DATE_AFTER:"dateAfter"},sm={AND:"and",OR:"or"};const om={key:0},rm={key:1},Vo={__name:"RecordColumnRenderer",props:{column:Object,value:null},setup(t){const e=r.ref(null),n=Object.assign({"/src/directives/dateFormat.js":()=>Promise.resolve().then(()=>dk),"/src/directives/textFormatUpperCase.js":()=>Promise.resolve().then(()=>uk)});async function i(){await r.nextTick();const s=n[`/src/directives/${t.column.displayFormatKey}.js`];s&&e.value&&s().then(o=>{o.default.beforeMount(e.value,{value:t.value,arg:t.column.displayFormat})})}return r.onMounted(()=>{i()}),r.onUpdated(()=>{i()}),(s,o)=>t.column.displayFormatKey?(r.openBlock(),r.createElementBlock("span",om,[r.createElementVNode("span",{ref_key:"el",ref:e},r.toDisplayString(t.value),513)])):(r.openBlock(),r.createElementBlock("span",rm,r.toDisplayString(t.value),1))}},am={class:"my-2"},lm={class:"flex flex-col md:flex-row md:justify-between md:items-center"},cm={class:"flex flex-row gap-2"},Ro={__name:"Grid",props:{entityName:String,showAddButton:Boolean,showClearFilters:Boolean,columnsToShow:Array,editable:Boolean,deleteable:Boolean,showPagination:Boolean},setup(t){const e=ot(),n=t;console.log("columnsToShow",n.columnsToShow);const i=Ye.useRoute(),s=r.ref(n.entityName||i.params.entityName),o=r.ref({}),a=r.ref(""),l=r.ref(!1),c=r.ref(!1),{items:d,headers:u,first:f,totalRecords:h,pageSize:m,loading:p,sortBy:g,sortDirection:y,operatorMap:b,filterToSend:x,primarayKeyColumn:w,fullTextSearch:E,listingResponse:k,onFullTextSearch:C,getDatatypeByField:S,getColumnDatatype:_,onSort:O,onPage:P,onFilter:v,fetchEntityFilterData:T,fetchEntityByName:R}=Ef(s.value),U=r.ref();let Y=r.ref(!1);const L=K=>{o.value=K.reduce((J,oe)=>{if(!oe.filterable)return J;let ue=Fn.CONTAINS;switch(oe.datatype.toLowerCase()){case"string":case"uuid":ue=Fn.STARTS_WITH;break;case"date":ue=Fn.DATE_IS;break;case"numeric":case"int":case"integer":ue=Fn.EQUALS;break;case"bool":case"boolean":ue=Fn.EQUALS;break}return oe.datatype=="bool"||oe.datatype=="boolean"?J[oe.field]={value:null,matchMode:Fn.EQUALS}:J[oe.field]={operator:sm.AND,constraints:[{value:null,matchMode:ue}]},J},{})},j=()=>{L(u.value),x.value=se(o.value),v()},$=K=>{x.value=se(o.value),v()},A=K=>{K?a.value=K[w.value.name]:a.value="",l.value=!l.value},I=()=>{l.value=!1,T(!1)},Q=K=>{a.value=K[w.value.name],c.value=!0},ne=()=>{c.value=!1,T(!1)},se=K=>Object.keys(K).map(J=>{const oe=K[J];return oe.constraints?oe.constraints.filter(ue=>ue.value!==null&&ue.value!=="").map(ue=>({columnName:J,operator:b[ue.matchMode]??ue.matchMode,value:ue.value,columnType:S(J)})):oe.value!==null&&oe.value!==""?{columnName:J,operator:b[oe.matchMode]??oe.matchMode,value:oe.value,columnType:S(J)}:[]}).flat();return r.watch(()=>e.globalConfigs.appId,async K=>{K&&R(s.value)},{immediate:!0}),r.watch(()=>u.value,K=>{!Y.value&&K&&K.length&&(L(K),Y.value=!0)},{immediate:!0}),(K,J)=>{const oe=r.resolveComponent("Button"),ue=r.resolveComponent("Toolbar"),ve=r.resolveComponent("ProgressSpinner"),st=r.resolveComponent("InputIcon"),qe=r.resolveComponent("IconField"),xt=r.resolveComponent("DatePicker"),ct=r.resolveComponent("InputNumber"),H=r.resolveComponent("Checkbox"),F=r.resolveComponent("Column"),he=r.resolveComponent("DataTable");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",r.normalizeProps(r.guardReactiveProps(K.$attrs)),[r.renderSlot(K.$slots,"header"),t.showClearFilters||t.showAddButton?(r.openBlock(),r.createBlock(ue,{key:0,class:"mb-4 mt-4"},r.createSlots({_:2},[t.showClearFilters?{name:"start",fn:r.withCtx(()=>[r.createElementVNode("div",am,[r.createVNode(oe,{type:"button",icon:"pi pi-filter-slash",label:"Clear",severity:"warning",onClick:J[0]||(J[0]=pe=>j())})])]),key:"0"}:void 0,t.showAddButton?{name:"end",fn:r.withCtx(()=>[r.createVNode(oe,{label:"Add",icon:"pi pi-plus",class:"mr-2",severity:"success",onClick:J[1]||(J[1]=pe=>A())})]),key:"1"}:void 0]),1024)):r.createCommentVNode("",!0),r.createVNode(he,{lazy:"",value:r.unref(d),loading:r.unref(p),ref_key:"dt",ref:U,stripedRows:!0,showGridlines:"",rowHover:!0,paginator:t.showPagination,rows:r.unref(m),rowsPerPageOptions:[10,25,50,100],totalRecords:r.unref(h),first:r.unref(f),sortField:r.unref(g),sortOrder:r.unref(y),filters:o.value,"onUpdate:filters":J[5]||(J[5]=pe=>o.value=pe),filterDisplay:"menu",scrollable:"",scrollHeight:"400px",onSort:r.unref(O),onPage:r.unref(P),onFilter:J[6]||(J[6]=pe=>$()),size:"large",paginatorTemplate:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink CurrentPageReport RowsPerPageDropdown",currentPageReportTemplate:"Showing {first} to {last} of {totalRecords} items"},{empty:r.withCtx(()=>J[9]||(J[9]=[r.createTextVNode(" No data found. ")])),loading:r.withCtx(()=>[r.createVNode(ve)]),header:r.withCtx(()=>[r.createElementVNode("div",lm,[r.createVNode(qe,{iconPosition:"left",class:"block mt-2 md:mt-0"},{default:r.withCtx(()=>[r.createVNode(st,{class:"pi pi-search",onClick:J[2]||(J[2]=pe=>r.unref(C)())}),r.createVNode(r.unref(Jr.InputText),{class:"w-full sm:w-auto",onKeyup:J[3]||(J[3]=r.withKeys(pe=>r.unref(C)(),["enter"])),modelValue:r.unref(E),"onUpdate:modelValue":J[4]||(J[4]=pe=>r.isRef(E)?E.value=pe:null),placeholder:"Search..."},null,8,["modelValue"])]),_:1})])]),default:r.withCtx(()=>{var pe;return[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(u).filter(me=>!n.columnsToShow||n.columnsToShow.length===0||n.columnsToShow.includes(me.field)),me=>(r.openBlock(),r.createBlock(F,{key:me.field,dataType:r.unref(_)(me.datatype),field:me.field,header:me.name,sortable:me.sortable,showAddButton:!1,showFilterOperator:!1,style:{"text-wrap":"nowrap"}},r.createSlots({body:r.withCtx(({data:ge})=>[r.createVNode(Vo,{column:me,value:ge[me.field]},null,8,["column","value"])]),_:2},[me.datatype.toLowerCase()==="date"&&me.filterable?{name:"filter",fn:r.withCtx(({filterModel:ge})=>[r.createVNode(xt,{modelValue:ge.value,"onUpdate:modelValue":Te=>ge.value=Te,dateFormat:"mm/dd/yy",placeholder:"mm/dd/yyyy"},null,8,["modelValue","onUpdate:modelValue"])]),key:"0"}:me.datatype.toLowerCase()==="int"&&me.filterable?{name:"filter",fn:r.withCtx(({filterModel:ge})=>[r.createVNode(ct,{modelValue:ge.value,"onUpdate:modelValue":Te=>ge.value=Te,placeholder:"Search..."},null,8,["modelValue","onUpdate:modelValue"])]),key:"1"}:me.datatype.toLowerCase()==="boolean"&&me.filterable?{name:"filter",fn:r.withCtx(({filterModel:ge})=>[r.createVNode(H,{modelValue:ge.value,"onUpdate:modelValue":Te=>ge.value=Te,indeterminate:ge.value===null,binary:""},null,8,["modelValue","onUpdate:modelValue","indeterminate"])]),key:"2"}:me.filterable?{name:"filter",fn:r.withCtx(({filterModel:ge})=>[r.createVNode(r.unref(Jr.InputText),{style:{width:"150px"},type:"text",modelValue:ge.value,"onUpdate:modelValue":Te=>ge.value=Te,class:"p-column-filter",placeholder:"Search..."},null,8,["modelValue","onUpdate:modelValue"])]),key:"3"}:void 0]),1032,["dataType","field","header","sortable"]))),128)),((pe=r.unref(d))==null?void 0:pe.length)>0&&(t.editable||t.deleteable)?(r.openBlock(),r.createBlock(F,{key:0,header:"Actions"},{body:r.withCtx(({data:me})=>[r.createElementVNode("div",cm,[t.editable?(r.openBlock(),r.createBlock(oe,{key:0,onClick:ge=>A(me),icon:"pi pi-pencil",severity:"success",size:"",rounded:"","aria-label":"Edit"},null,8,["onClick"])):r.createCommentVNode("",!0),t.deleteable?(r.openBlock(),r.createBlock(oe,{key:1,onClick:ge=>Q(me),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"},null,8,["onClick"])):r.createCommentVNode("",!0)])]),_:1})):r.createCommentVNode("",!0)]}),_:1},8,["value","loading","paginator","rows","totalRecords","first","sortField","sortOrder","filters","onSort","onPage"]),r.renderSlot(K.$slots,"footer")],16),l.value?(r.openBlock(),r.createBlock(tm,{key:0,showForm:l.value,"onUpdate:showForm":J[7]||(J[7]=pe=>l.value=pe),entityName:r.unref(k).entityName,recordId:a.value,onOnSaveDialog:I},null,8,["showForm","entityName","recordId"])):r.createCommentVNode("",!0),c.value?(r.openBlock(),r.createBlock(nm,{key:1,showDeleteDialog:c.value,"onUpdate:showDeleteDialog":J[8]||(J[8]=pe=>c.value=pe),entityName:r.unref(k).entityName,recordId:a.value,onOnDeleteItem:ne},null,8,["showDeleteDialog","entityName","recordId"])):r.createCommentVNode("",!0)],64)}}};function dm(){const t=new Map;return{on(e,n){let i=t.get(e);return i?i.push(n):i=[n],t.set(e,i),this},off(e,n){let i=t.get(e);return i&&i.splice(i.indexOf(n)>>>0,1),this},emit(e,n){let i=t.get(e);i&&i.slice().map(s=>{s(n)})},clear(){t.clear()}}}var um=Object.defineProperty,fm=Object.defineProperties,hm=Object.getOwnPropertyDescriptors,ys=Object.getOwnPropertySymbols,Wa=Object.prototype.hasOwnProperty,Ha=Object.prototype.propertyIsEnumerable,qa=(t,e,n)=>e in t?um(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ht=(t,e)=>{for(var n in e||(e={}))Wa.call(e,n)&&qa(t,n,e[n]);if(ys)for(var n of ys(e))Ha.call(e,n)&&qa(t,n,e[n]);return t},Fo=(t,e)=>fm(t,hm(e)),Vt=(t,e)=>{var n={};for(var i in t)Wa.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&ys)for(var i of ys(t))e.indexOf(i)<0&&Ha.call(t,i)&&(n[i]=t[i]);return n},mm=dm(),Xt=mm;function Ya(t,e){Mo(t)?t.push(...e||[]):Rn(t)&&Object.assign(t,e)}function pm(t){return Rn(t)&&t.hasOwnProperty("value")&&t.hasOwnProperty("type")?t.value:t}function gm(t){return t.replaceAll(/ /g,"").replace(/[^\w]/g,"-")}function $o(t="",e=""){return gm(`${wt(t,!1)&&wt(e,!1)?`${t}-`:t}${e}`)}function Ka(t="",e=""){return`--${$o(t,e)}`}function ym(t=""){const e=(t.match(/{/g)||[]).length,n=(t.match(/}/g)||[]).length;return(e+n)%2!==0}function Xa(t,e="",n="",i=[],s){if(wt(t)){const o=/{([^}]*)}/g,a=t.trim();if(ym(a))return;if(Mt(a,o)){const l=a.replaceAll(o,u=>{const h=u.replace(/{|}/g,"").split(".").filter(m=>!i.some(p=>Mt(m,p)));return`var(${Ka(n,za(h.join("-")))}${Ce(s)?`, ${s}`:""})`}),c=/(\d+\s+[\+\-\*\/]\s+\d+)/g,d=/var\([^)]+\)/g;return Mt(l.replace(d,"0"),c)?`calc(${l})`:l}return a}else if(im(t))return t}function bm(t,e,n){wt(e,!1)&&t.push(`${e}:${n};`)}function $n(t,e){return t?`${t}{${e}}`:""}var ii=(...t)=>xm(Re.getTheme(),...t),xm=(t={},e,n,i)=>{if(e){const{variable:s,options:o}=Re.defaults||{},{prefix:a,transform:l}=(t==null?void 0:t.options)||o||{},d=Mt(e,/{([^}]*)}/g)?e:`{${e}}`;return i==="value"||Ao(i)&&l==="strict"?Re.getTokenValue(e):Xa(d,void 0,a,[s.excludedKeyRegex],n)}return""};function _m(t,e={}){const n=Re.defaults.variable,{prefix:i=n.prefix,selector:s=n.selector,excludedKeyRegex:o=n.excludedKeyRegex}=e,a=(d,u="")=>Object.entries(d).reduce((f,[h,m])=>{const p=Mt(h,o)?$o(u):$o(u,za(h)),g=pm(m);if(Rn(g)){const{variables:y,tokens:b}=a(g,p);Ya(f.tokens,b),Ya(f.variables,y)}else f.tokens.push((i?p.replace(`${i}-`,""):p).replaceAll("-",".")),bm(f.variables,Ka(p),Xa(g,p,i,[o]));return f},{variables:[],tokens:[]}),{variables:l,tokens:c}=a(t,i);return{value:l,tokens:c,declarations:l.join(""),css:$n(s,l.join(""))}}var mt={regex:{rules:{class:{pattern:/^\.([a-zA-Z][\w-]*)$/,resolve(t){return{type:"class",selector:t,matched:this.pattern.test(t.trim())}}},attr:{pattern:/^\[(.*)\]$/,resolve(t){return{type:"attr",selector:`:root${t}`,matched:this.pattern.test(t.trim())}}},media:{pattern:/^@media (.*)$/,resolve(t){return{type:"media",selector:`${t}{:root{[CSS]}}`,matched:this.pattern.test(t.trim())}}},system:{pattern:/^system$/,resolve(t){return{type:"system",selector:"@media (prefers-color-scheme: dark){:root{[CSS]}}",matched:this.pattern.test(t.trim())}}},custom:{resolve(t){return{type:"custom",selector:t,matched:!0}}}},resolve(t){const e=Object.keys(this.rules).filter(n=>n!=="custom").map(n=>this.rules[n]);return[t].flat().map(n=>{var i;return(i=e.map(s=>s.resolve(n)).find(s=>s.matched))!=null?i:this.rules.custom.resolve(n)})}},_toVariables(t,e){return _m(t,{prefix:e==null?void 0:e.prefix})},getCommon({name:t="",theme:e={},params:n,set:i,defaults:s}){var o,a,l,c,d,u,f;const{preset:h,options:m}=e;let p,g,y,b,x,w,E;if(Ce(h)&&m.transform!=="strict"){const{primitive:k,semantic:C,extend:S}=h,_=C||{},{colorScheme:O}=_,P=Vt(_,["colorScheme"]),v=S||{},{colorScheme:T}=v,R=Vt(v,["colorScheme"]),U=O||{},{dark:Y}=U,L=Vt(U,["dark"]),j=T||{},{dark:$}=j,A=Vt(j,["dark"]),I=Ce(k)?this._toVariables({primitive:k},m):{},Q=Ce(P)?this._toVariables({semantic:P},m):{},ne=Ce(L)?this._toVariables({light:L},m):{},se=Ce(Y)?this._toVariables({dark:Y},m):{},K=Ce(R)?this._toVariables({semantic:R},m):{},J=Ce(A)?this._toVariables({light:A},m):{},oe=Ce($)?this._toVariables({dark:$},m):{},[ue,ve]=[(o=I.declarations)!=null?o:"",I.tokens],[st,qe]=[(a=Q.declarations)!=null?a:"",Q.tokens||[]],[xt,ct]=[(l=ne.declarations)!=null?l:"",ne.tokens||[]],[H,F]=[(c=se.declarations)!=null?c:"",se.tokens||[]],[he,pe]=[(d=K.declarations)!=null?d:"",K.tokens||[]],[me,ge]=[(u=J.declarations)!=null?u:"",J.tokens||[]],[Te,Ze]=[(f=oe.declarations)!=null?f:"",oe.tokens||[]];p=this.transformCSS(t,ue,"light","variable",m,i,s),g=ve;const Tt=this.transformCSS(t,`${st}${xt}`,"light","variable",m,i,s),$e=this.transformCSS(t,`${H}`,"dark","variable",m,i,s);y=`${Tt}${$e}`,b=[...new Set([...qe,...ct,...F])];const et=this.transformCSS(t,`${he}${me}color-scheme:light`,"light","variable",m,i,s),dt=this.transformCSS(t,`${Te}color-scheme:dark`,"dark","variable",m,i,s);x=`${et}${dt}`,w=[...new Set([...pe,...ge,...Ze])],E=ft(h.css,{dt:ii})}return{primitive:{css:p,tokens:g},semantic:{css:y,tokens:b},global:{css:x,tokens:w},style:E}},getPreset({name:t="",preset:e={},options:n,params:i,set:s,defaults:o,selector:a}){var l,c,d;let u,f,h;if(Ce(e)&&n.transform!=="strict"){const m=t.replace("-directive",""),p=e,{colorScheme:g,extend:y,css:b}=p,x=Vt(p,["colorScheme","extend","css"]),w=y||{},{colorScheme:E}=w,k=Vt(w,["colorScheme"]),C=g||{},{dark:S}=C,_=Vt(C,["dark"]),O=E||{},{dark:P}=O,v=Vt(O,["dark"]),T=Ce(x)?this._toVariables({[m]:ht(ht({},x),k)},n):{},R=Ce(_)?this._toVariables({[m]:ht(ht({},_),v)},n):{},U=Ce(S)?this._toVariables({[m]:ht(ht({},S),P)},n):{},[Y,L]=[(l=T.declarations)!=null?l:"",T.tokens||[]],[j,$]=[(c=R.declarations)!=null?c:"",R.tokens||[]],[A,I]=[(d=U.declarations)!=null?d:"",U.tokens||[]],Q=this.transformCSS(m,`${Y}${j}`,"light","variable",n,s,o,a),ne=this.transformCSS(m,A,"dark","variable",n,s,o,a);u=`${Q}${ne}`,f=[...new Set([...L,...$,...I])],h=ft(b,{dt:ii})}return{css:u,tokens:f,style:h}},getPresetC({name:t="",theme:e={},params:n,set:i,defaults:s}){var o;const{preset:a,options:l}=e,c=(o=a==null?void 0:a.components)==null?void 0:o[t];return this.getPreset({name:t,preset:c,options:l,params:n,set:i,defaults:s})},getPresetD({name:t="",theme:e={},params:n,set:i,defaults:s}){var o;const a=t.replace("-directive",""),{preset:l,options:c}=e,d=(o=l==null?void 0:l.directives)==null?void 0:o[a];return this.getPreset({name:a,preset:d,options:c,params:n,set:i,defaults:s})},applyDarkColorScheme(t){return!(t.darkModeSelector==="none"||t.darkModeSelector===!1)},getColorSchemeOption(t,e){var n;return this.applyDarkColorScheme(t)?this.regex.resolve(t.darkModeSelector===!0?e.options.darkModeSelector:(n=t.darkModeSelector)!=null?n:e.options.darkModeSelector):[]},getLayerOrder(t,e={},n,i){const{cssLayer:s}=e;return s?`@layer ${ft(s.order||"primeui",n)}`:""},getCommonStyleSheet({name:t="",theme:e={},params:n,props:i={},set:s,defaults:o}){const a=this.getCommon({name:t,theme:e,params:n,set:s,defaults:o}),l=Object.entries(i).reduce((c,[d,u])=>c.push(`${d}="${u}"`)&&c,[]).join(" ");return Object.entries(a||{}).reduce((c,[d,u])=>{if(u!=null&&u.css){const f=ni(u==null?void 0:u.css),h=`${d}-variables`;c.push(`<style type="text/css" data-primevue-style-id="${h}" ${l}>${f}</style>`)}return c},[]).join("")},getStyleSheet({name:t="",theme:e={},params:n,props:i={},set:s,defaults:o}){var a;const l={name:t,theme:e,params:n,set:s,defaults:o},c=(a=t.includes("-directive")?this.getPresetD(l):this.getPresetC(l))==null?void 0:a.css,d=Object.entries(i).reduce((u,[f,h])=>u.push(`${f}="${h}"`)&&u,[]).join(" ");return c?`<style type="text/css" data-primevue-style-id="${t}-variables" ${d}>${ni(c)}</style>`:""},createTokens(t={},e,n="",i="",s={}){return Object.entries(t).forEach(([o,a])=>{const l=Mt(o,e.variable.excludedKeyRegex)?n:n?`${n}.${Ua(o)}`:Ua(o),c=i?`${i}.${o}`:o;Rn(a)?this.createTokens(a,e,l,c,s):(s[l]||(s[l]={paths:[],computed(d,u={}){var f,h;return this.paths.length===1?(f=this.paths[0])==null?void 0:f.computed(this.paths[0].scheme,u.binding):d&&d!=="none"?(h=this.paths.find(m=>m.scheme===d))==null?void 0:h.computed(d,u.binding):this.paths.map(m=>m.computed(m.scheme,u[m.scheme]))}}),s[l].paths.push({path:c,value:a,scheme:c.includes("colorScheme.light")?"light":c.includes("colorScheme.dark")?"dark":"none",computed(d,u={}){const f=/{([^}]*)}/g;let h=a;if(u.name=this.path,u.binding||(u.binding={}),Mt(a,f)){const p=a.trim().replaceAll(f,b=>{var x;const w=b.replace(/{|}/g,""),E=(x=s[w])==null?void 0:x.computed(d,u);return Mo(E)&&E.length===2?`light-dark(${E[0].value},${E[1].value})`:E==null?void 0:E.value}),g=/(\d+\w*\s+[\+\-\*\/]\s+\d+\w*)/g,y=/var\([^)]+\)/g;h=Mt(p.replace(y,"0"),g)?`calc(${p})`:p}return Ao(u.binding)&&delete u.binding,{colorScheme:d,path:this.path,paths:u,value:h.includes("undefined")?void 0:h}}}))}),s},getTokenValue(t,e,n){var i;const o=(c=>c.split(".").filter(u=>!Mt(u.toLowerCase(),n.variable.excludedKeyRegex)).join("."))(e),a=e.includes("colorScheme.light")?"light":e.includes("colorScheme.dark")?"dark":void 0,l=[(i=t[o])==null?void 0:i.computed(a)].flat().filter(c=>c);return l.length===1?l[0].value:l.reduce((c={},d)=>{const u=d,{colorScheme:f}=u,h=Vt(u,["colorScheme"]);return c[f]=h,c},void 0)},getSelectorRule(t,e,n,i){return n==="class"||n==="attr"?$n(Ce(e)?`${t}${e},${t} ${e}`:t,i):$n(t,Ce(e)?$n(e,i):i)},transformCSS(t,e,n,i,s={},o,a,l){if(Ce(e)){const{cssLayer:c}=s;if(i!=="style"){const d=this.getColorSchemeOption(s,a);e=n==="dark"?d.reduce((u,{type:f,selector:h})=>(Ce(h)&&(u+=h.includes("[CSS]")?h.replace("[CSS]",e):this.getSelectorRule(h,l,f,e)),u),""):$n(l??":root",e)}if(c){const d={name:"primeui",order:"primeui"};Rn(c)&&(d.name=ft(c.name,{name:t,type:i})),Ce(d.name)&&(e=$n(`@layer ${d.name}`,e),o==null||o.layerNames(d.name))}return e}return""}},Re={defaults:{variable:{prefix:"p",selector:":root",excludedKeyRegex:/^(primitive|semantic|components|directives|variables|colorscheme|light|dark|common|root|states|extend|css)$/gi},options:{prefix:"p",darkModeSelector:"system",cssLayer:!1}},_theme:void 0,_layerNames:new Set,_loadedStyleNames:new Set,_loadingStyles:new Set,_tokens:{},update(t={}){const{theme:e}=t;e&&(this._theme=Fo(ht({},e),{options:ht(ht({},this.defaults.options),e.options)}),this._tokens=mt.createTokens(this.preset,this.defaults),this.clearLoadedStyleNames())},get theme(){return this._theme},get preset(){var t;return((t=this.theme)==null?void 0:t.preset)||{}},get options(){var t;return((t=this.theme)==null?void 0:t.options)||{}},get tokens(){return this._tokens},getTheme(){return this.theme},setTheme(t){this.update({theme:t}),Xt.emit("theme:change",t)},getPreset(){return this.preset},setPreset(t){this._theme=Fo(ht({},this.theme),{preset:t}),this._tokens=mt.createTokens(t,this.defaults),this.clearLoadedStyleNames(),Xt.emit("preset:change",t),Xt.emit("theme:change",this.theme)},getOptions(){return this.options},setOptions(t){this._theme=Fo(ht({},this.theme),{options:t}),this.clearLoadedStyleNames(),Xt.emit("options:change",t),Xt.emit("theme:change",this.theme)},getLayerNames(){return[...this._layerNames]},setLayerNames(t){this._layerNames.add(t)},getLoadedStyleNames(){return this._loadedStyleNames},isStyleNameLoaded(t){return this._loadedStyleNames.has(t)},setLoadedStyleName(t){this._loadedStyleNames.add(t)},deleteLoadedStyleName(t){this._loadedStyleNames.delete(t)},clearLoadedStyleNames(){this._loadedStyleNames.clear()},getTokenValue(t){return mt.getTokenValue(this.tokens,t,this.defaults)},getCommon(t="",e){return mt.getCommon({name:t,theme:this.theme,params:e,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getComponent(t="",e){const n={name:t,theme:this.theme,params:e,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return mt.getPresetC(n)},getDirective(t="",e){const n={name:t,theme:this.theme,params:e,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return mt.getPresetD(n)},getCustomPreset(t="",e,n,i){const s={name:t,preset:e,options:this.options,selector:n,params:i,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return mt.getPreset(s)},getLayerOrderCSS(t=""){return mt.getLayerOrder(t,this.options,{names:this.getLayerNames()},this.defaults)},transformCSS(t="",e,n="style",i){return mt.transformCSS(t,e,i,n,this.options,{layerNames:this.setLayerNames.bind(this)},this.defaults)},getCommonStyleSheet(t="",e,n={}){return mt.getCommonStyleSheet({name:t,theme:this.theme,params:e,props:n,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getStyleSheet(t,e,n={}){return mt.getStyleSheet({name:t,theme:this.theme,params:e,props:n,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},onStyleMounted(t){this._loadingStyles.add(t)},onStyleUpdated(t){this._loadingStyles.add(t)},onStyleLoaded(t,{name:e}){this._loadingStyles.size&&(this._loadingStyles.delete(e),Xt.emit(`theme:${e}:load`,t),!this._loadingStyles.size&&Xt.emit("theme:load"))}};function Lo(t){return typeof HTMLElement=="object"?t instanceof HTMLElement:t&&typeof t=="object"&&t!==null&&t.nodeType===1&&typeof t.nodeName=="string"}function Io(t,e={}){if(Lo(t)){const n=(i,s)=>{var o,a;const l=(o=t==null?void 0:t.$attrs)!=null&&o[i]?[(a=t==null?void 0:t.$attrs)==null?void 0:a[i]]:[];return[s].flat().reduce((c,d)=>{if(d!=null){const u=typeof d;if(u==="string"||u==="number")c.push(d);else if(u==="object"){const f=Array.isArray(d)?n(i,d):Object.entries(d).map(([h,m])=>i==="style"&&(m||m===0)?`${h.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${m}`:m?h:void 0);c=f.length?c.concat(f.filter(h=>!!h)):c}}return c},l)};Object.entries(e).forEach(([i,s])=>{if(s!=null){const o=i.match(/^on(.+)/);o?t.addEventListener(o[1].toLowerCase(),s):i==="p-bind"||i==="pBind"?Io(t,s):(s=i==="class"?[...new Set(n("class",s))].join(" ").trim():i==="style"?n("style",s).join(";").trim():s,(t.$attrs=t.$attrs||{})&&(t.$attrs[i]=s),t.setAttribute(i,s))}})}}function km(t,e){return Lo(t)?t.matches(e)?t:t.querySelector(e):null}function Sm(t){if(t){let e=t.parentNode;return e&&e instanceof ShadowRoot&&e.host&&(e=e.host),e}return null}function wm(t){return!!(t!==null&&typeof t<"u"&&t.nodeName&&Sm(t))}function Ga(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Em(t,e="",n){Lo(t)&&n!==null&&n!==void 0&&t.setAttribute(e,n)}var bs={};function Cm(t="pui_id_"){return bs.hasOwnProperty(t)||(bs[t]=0),bs[t]++,`${t}${bs[t]}`}var si={_loadedStyleNames:new Set,getLoadedStyleNames:function(){return this._loadedStyleNames},isStyleNameLoaded:function(e){return this._loadedStyleNames.has(e)},setLoadedStyleName:function(e){this._loadedStyleNames.add(e)},deleteLoadedStyleName:function(e){this._loadedStyleNames.delete(e)},clearLoadedStyleNames:function(){this._loadedStyleNames.clear()}};function oi(t){"@babel/helpers - typeof";return oi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},oi(t)}function Ja(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,i)}return n}function Qa(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Ja(Object(n),!0).forEach(function(i){Om(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ja(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function Om(t,e,n){return(e=vm(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vm(t){var e=Nm(t,"string");return oi(e)=="symbol"?e:e+""}function Nm(t,e){if(oi(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(oi(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Dm(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;r.getCurrentInstance()?r.onMounted(t):e?t():r.nextTick(t)}var Tm=0;function Bm(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=r.ref(!1),i=r.ref(t),s=r.ref(null),o=Ga()?window.document:void 0,a=e.document,l=a===void 0?o:a,c=e.immediate,d=c===void 0?!0:c,u=e.manual,f=u===void 0?!1:u,h=e.name,m=h===void 0?"style_".concat(++Tm):h,p=e.id,g=p===void 0?void 0:p,y=e.media,b=y===void 0?void 0:y,x=e.nonce,w=x===void 0?void 0:x,E=e.first,k=E===void 0?!1:E,C=e.onMounted,S=C===void 0?void 0:C,_=e.onUpdated,O=_===void 0?void 0:_,P=e.onLoad,v=P===void 0?void 0:P,T=e.props,R=T===void 0?{}:T,U=function(){},Y=function($){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(l){var I=Qa(Qa({},R),A),Q=I.name||m,ne=I.id||g,se=I.nonce||w;s.value=l.querySelector('style[data-primevue-style-id="'.concat(Q,'"]'))||l.getElementById(ne)||l.createElement("style"),s.value.isConnected||(i.value=$||t,Io(s.value,{type:"text/css",id:ne,media:b,nonce:se}),k?l.head.prepend(s.value):l.head.appendChild(s.value),Em(s.value,"data-primevue-style-id",Q),Io(s.value,I),s.value.onload=function(K){return v==null?void 0:v(K,{name:Q})},S==null||S(Q)),!n.value&&(U=r.watch(i,function(K){s.value.textContent=K,O==null||O(Q)},{immediate:!0}),n.value=!0)}},L=function(){!l||!n.value||(U(),wm(s.value)&&l.head.removeChild(s.value),n.value=!1)};return d&&!f&&Dm(Y),{id:g,name:m,el:s,css:i,unload:L,load:Y,isLoaded:r.readonly(n)}}function ri(t){"@babel/helpers - typeof";return ri=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ri(t)}function Za(t,e){return Vm(t)||Mm(t,e)||Am(t,e)||Pm()}function Pm(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
13
13
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Am(t,e){if(t){if(typeof t=="string")return el(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?el(t,e):void 0}}function el(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function Mm(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var i,s,o,a,l=[],c=!0,d=!1;try{if(o=(n=n.call(t)).next,e!==0)for(;!(c=(i=o.call(n)).done)&&(l.push(i.value),l.length!==e);c=!0);}catch(u){d=!0,s=u}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(d)throw s}}return l}}function Vm(t){if(Array.isArray(t))return t}function tl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,i)}return n}function jo(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?tl(Object(n),!0).forEach(function(i){Rm(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):tl(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function Rm(t,e,n){return(e=Fm(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Fm(t){var e=$m(t,"string");return ri(e)=="symbol"?e:e+""}function $m(t,e){if(ri(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(ri(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Lm=function(e){var n=e.dt;return`
14
14
  *,
15
15
  ::before,
@@ -153,7 +153,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
153
153
  padding-right: `.concat(n("scrollbar.width"),`;
154
154
  }
155
155
  `)},jm={},zm={},Rt={name:"base",css:Im,theme:Lm,classes:jm,inlineStyles:zm,load:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(o){return o},s=i(ft(e,{dt:ii}));return Ce(s)?Bm(ni(s),jo({name:this.name},n)):{}},loadCSS:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.load(this.css,e)},loadTheme:function(){var e=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return this.load(this.theme,n,function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return Re.transformCSS(n.name||e.name,"".concat(s).concat(i))})},getCommonTheme:function(e){return Re.getCommon(this.name,e)},getComponentTheme:function(e){return Re.getComponent(this.name,e)},getDirectiveTheme:function(e){return Re.getDirective(this.name,e)},getPresetTheme:function(e,n,i){return Re.getCustomPreset(this.name,e,n,i)},getLayerOrderThemeCSS:function(){return Re.getLayerOrderCSS(this.name)},getStyleSheet:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.css){var i=ft(this.css,{dt:ii})||"",s=ni("".concat(i).concat(e)),o=Object.entries(n).reduce(function(a,l){var c=Za(l,2),d=c[0],u=c[1];return a.push("".concat(d,'="').concat(u,'"'))&&a},[]).join(" ");return Ce(s)?'<style type="text/css" data-primevue-style-id="'.concat(this.name,'" ').concat(o,">").concat(s,"</style>"):""}return""},getCommonThemeStyleSheet:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Re.getCommonStyleSheet(this.name,e,n)},getThemeStyleSheet:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=[Re.getStyleSheet(this.name,e,n)];if(this.theme){var s=this.name==="base"?"global-style":"".concat(this.name,"-style"),o=ft(this.theme,{dt:ii}),a=ni(Re.transformCSS(s,o)),l=Object.entries(n).reduce(function(c,d){var u=Za(d,2),f=u[0],h=u[1];return c.push("".concat(f,'="').concat(h,'"'))&&c},[]).join(" ");Ce(a)&&i.push('<style type="text/css" data-primevue-style-id="'.concat(s,'" ').concat(l,">").concat(a,"</style>"))}return i.join("")},extend:function(e){return jo(jo({},this),{},{css:void 0,theme:void 0},e)}},nl=Rt.extend({name:"common"});function ai(t){"@babel/helpers - typeof";return ai=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ai(t)}function Um(t){return rl(t)||Wm(t)||sl(t)||il()}function Wm(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function li(t,e){return rl(t)||Hm(t,e)||sl(t,e)||il()}function il(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
156
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sl(t,e){if(t){if(typeof t=="string")return ol(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ol(t,e):void 0}}function ol(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function Hm(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var i,s,o,a,l=[],c=!0,d=!1;try{if(o=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(i=o.call(n)).done)&&(l.push(i.value),l.length!==e);c=!0);}catch(u){d=!0,s=u}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(d)throw s}}return l}}function rl(t){if(Array.isArray(t))return t}function al(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,i)}return n}function ce(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?al(Object(n),!0).forEach(function(i){ci(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):al(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function ci(t,e,n){return(e=qm(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qm(t){var e=Ym(t,"string");return ai(e)=="symbol"?e:e+""}function Ym(t,e){if(ai(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(ai(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Km={name:"BaseComponent",props:{pt:{type:Object,default:void 0},ptOptions:{type:Object,default:void 0},unstyled:{type:Boolean,default:void 0},dt:{type:Object,default:void 0}},inject:{$parentInstance:{default:void 0}},watch:{isUnstyled:{immediate:!0,handler:function(e){e||(this._loadCoreStyles(),this._themeChangeListener(this._loadCoreStyles))}},dt:{immediate:!0,handler:function(e){var n=this;e?(this._loadScopedThemeStyles(e),this._themeChangeListener(function(){return n._loadScopedThemeStyles(e)})):this._unloadScopedThemeStyles()}}},scopedStyleEl:void 0,rootEl:void 0,$attrSelector:void 0,beforeCreate:function(){var e,n,i,s,o,a,l,c,d,u,f,h=(e=this.pt)===null||e===void 0?void 0:e._usept,m=h?(n=this.pt)===null||n===void 0||(n=n.originalValue)===null||n===void 0?void 0:n[this.$.type.name]:void 0,p=h?(i=this.pt)===null||i===void 0||(i=i.value)===null||i===void 0?void 0:i[this.$.type.name]:this.pt;(s=p||m)===null||s===void 0||(s=s.hooks)===null||s===void 0||(o=s.onBeforeCreate)===null||o===void 0||o.call(s);var g=(a=this.$primevueConfig)===null||a===void 0||(a=a.pt)===null||a===void 0?void 0:a._usept,y=g?(l=this.$primevue)===null||l===void 0||(l=l.config)===null||l===void 0||(l=l.pt)===null||l===void 0?void 0:l.originalValue:void 0,b=g?(c=this.$primevue)===null||c===void 0||(c=c.config)===null||c===void 0||(c=c.pt)===null||c===void 0?void 0:c.value:(d=this.$primevue)===null||d===void 0||(d=d.config)===null||d===void 0?void 0:d.pt;(u=b||y)===null||u===void 0||(u=u[this.$.type.name])===null||u===void 0||(u=u.hooks)===null||u===void 0||(f=u.onBeforeCreate)===null||f===void 0||f.call(u),this.$attrSelector=Cm("pc")},created:function(){this._hook("onCreated")},beforeMount:function(){this.rootEl=km(this.$el,'[data-pc-name="'.concat(Kt(this.$.type.name),'"]')),this.rootEl&&(this.$attrSelector&&!this.rootEl.hasAttribute(this.$attrSelector)&&this.rootEl.setAttribute(this.$attrSelector,""),this.rootEl.$pc=ce({name:this.$.type.name,attrSelector:this.$attrSelector},this.$params)),this._loadStyles(),this._hook("onBeforeMount")},mounted:function(){this._hook("onMounted")},beforeUpdate:function(){this._hook("onBeforeUpdate")},updated:function(){this._hook("onUpdated")},beforeUnmount:function(){this._hook("onBeforeUnmount")},unmounted:function(){this._unloadScopedThemeStyles(),this._hook("onUnmounted")},methods:{_hook:function(e){if(!this.$options.hostName){var n=this._usePT(this._getPT(this.pt,this.$.type.name),this._getOptionValue,"hooks.".concat(e)),i=this._useDefaultPT(this._getOptionValue,"hooks.".concat(e));n==null||n(),i==null||i()}},_mergeProps:function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];return Ia(e)?e.apply(void 0,i):r.mergeProps.apply(void 0,i)},_loadStyles:function(){var e=this,n=function(){si.isStyleNameLoaded("base")||(Rt.loadCSS(e.$styleOptions),e._loadGlobalStyles(),si.setLoadedStyleName("base")),e._loadThemeStyles()};n(),this._themeChangeListener(n)},_loadCoreStyles:function(){var e,n;!si.isStyleNameLoaded((e=this.$style)===null||e===void 0?void 0:e.name)&&(n=this.$style)!==null&&n!==void 0&&n.name&&(nl.loadCSS(this.$styleOptions),this.$options.style&&this.$style.loadCSS(this.$styleOptions),si.setLoadedStyleName(this.$style.name))},_loadGlobalStyles:function(){var e=this._useGlobalPT(this._getOptionValue,"global.css",this.$params);Ce(e)&&Rt.load(e,ce({name:"global"},this.$styleOptions))},_loadThemeStyles:function(){var e,n;if(!(this.isUnstyled||this.$theme==="none")){if(!Re.isStyleNameLoaded("common")){var i,s,o=((i=this.$style)===null||i===void 0||(s=i.getCommonTheme)===null||s===void 0?void 0:s.call(i))||{},a=o.primitive,l=o.semantic,c=o.global,d=o.style;Rt.load(a==null?void 0:a.css,ce({name:"primitive-variables"},this.$styleOptions)),Rt.load(l==null?void 0:l.css,ce({name:"semantic-variables"},this.$styleOptions)),Rt.load(c==null?void 0:c.css,ce({name:"global-variables"},this.$styleOptions)),Rt.loadTheme(ce({name:"global-style"},this.$styleOptions),d),Re.setLoadedStyleName("common")}if(!Re.isStyleNameLoaded((e=this.$style)===null||e===void 0?void 0:e.name)&&(n=this.$style)!==null&&n!==void 0&&n.name){var u,f,h,m,p=((u=this.$style)===null||u===void 0||(f=u.getComponentTheme)===null||f===void 0?void 0:f.call(u))||{},g=p.css,y=p.style;(h=this.$style)===null||h===void 0||h.load(g,ce({name:"".concat(this.$style.name,"-variables")},this.$styleOptions)),(m=this.$style)===null||m===void 0||m.loadTheme(ce({name:"".concat(this.$style.name,"-style")},this.$styleOptions),y),Re.setLoadedStyleName(this.$style.name)}if(!Re.isStyleNameLoaded("layer-order")){var b,x,w=(b=this.$style)===null||b===void 0||(x=b.getLayerOrderThemeCSS)===null||x===void 0?void 0:x.call(b);Rt.load(w,ce({name:"layer-order",first:!0},this.$styleOptions)),Re.setLoadedStyleName("layer-order")}}},_loadScopedThemeStyles:function(e){var n,i,s,o=((n=this.$style)===null||n===void 0||(i=n.getPresetTheme)===null||i===void 0?void 0:i.call(n,e,"[".concat(this.$attrSelector,"]")))||{},a=o.css,l=(s=this.$style)===null||s===void 0?void 0:s.load(a,ce({name:"".concat(this.$attrSelector,"-").concat(this.$style.name)},this.$styleOptions));this.scopedStyleEl=l.el},_unloadScopedThemeStyles:function(){var e;(e=this.scopedStyleEl)===null||e===void 0||(e=e.value)===null||e===void 0||e.remove()},_themeChangeListener:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){};si.clearLoadedStyleNames(),Xt.on("theme:change",e)},_getHostInstance:function(e){return e?this.$options.hostName?e.$.type.name===this.$options.hostName?e:this._getHostInstance(e.$parentInstance):e.$parentInstance:void 0},_getPropValue:function(e){var n;return this[e]||((n=this._getHostInstance(this))===null||n===void 0?void 0:n[e])},_getOptionValue:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return ja(e,n,i)},_getPTValue:function(){var e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=/./g.test(i)&&!!s[i.split(".")[0]],l=this._getPropValue("ptOptions")||((e=this.$primevueConfig)===null||e===void 0?void 0:e.ptOptions)||{},c=l.mergeSections,d=c===void 0?!0:c,u=l.mergeProps,f=u===void 0?!1:u,h=o?a?this._useGlobalPT(this._getPTClassValue,i,s):this._useDefaultPT(this._getPTClassValue,i,s):void 0,m=a?void 0:this._getPTSelf(n,this._getPTClassValue,i,ce(ce({},s),{},{global:h||{}})),p=this._getPTDatasets(i);return d||!d&&m?f?this._mergeProps(f,h,m,p):ce(ce(ce({},h),m),p):ce(ce({},m),p)},_getPTSelf:function(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];return r.mergeProps(this._usePT.apply(this,[this._getPT(e,this.$name)].concat(i)),this._usePT.apply(this,[this.$_attrsPT].concat(i)))},_getPTDatasets:function(){var e,n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",s="data-pc-",o=i==="root"&&Ce((e=this.pt)===null||e===void 0?void 0:e["data-pc-section"]);return i!=="transition"&&ce(ce({},i==="root"&&ce(ce(ci({},"".concat(s,"name"),Kt(o?(n=this.pt)===null||n===void 0?void 0:n["data-pc-section"]:this.$.type.name)),o&&ci({},"".concat(s,"extend"),Kt(this.$.type.name))),Ga()&&ci({},"".concat(this.$attrSelector),""))),{},ci({},"".concat(s,"section"),Kt(i)))},_getPTClassValue:function(){var e=this._getOptionValue.apply(this,arguments);return wt(e)||Mo(e)?{class:e}:e},_getPT:function(e){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=arguments.length>2?arguments[2]:void 0,o=function(l){var c,d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,u=s?s(l):l,f=Kt(i),h=Kt(n.$name);return(c=d?f!==h?u==null?void 0:u[f]:void 0:u==null?void 0:u[f])!==null&&c!==void 0?c:u};return e!=null&&e.hasOwnProperty("_usept")?{_usept:e._usept,originalValue:o(e.originalValue),value:o(e.value)}:o(e,!0)},_usePT:function(e,n,i,s){var o=function(g){return n(g,i,s)};if(e!=null&&e.hasOwnProperty("_usept")){var a,l=e._usept||((a=this.$primevueConfig)===null||a===void 0?void 0:a.ptOptions)||{},c=l.mergeSections,d=c===void 0?!0:c,u=l.mergeProps,f=u===void 0?!1:u,h=o(e.originalValue),m=o(e.value);return h===void 0&&m===void 0?void 0:wt(m)?m:wt(h)?h:d||!d&&m?f?this._mergeProps(f,h,m):ce(ce({},h),m):m}return o(e)},_useGlobalPT:function(e,n,i){return this._usePT(this.globalPT,e,n,i)},_useDefaultPT:function(e,n,i){return this._usePT(this.defaultPT,e,n,i)},ptm:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this._getPTValue(this.pt,e,ce(ce({},this.$params),n))},ptmi:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return r.mergeProps(this.$_attrsWithoutPT,this.ptm(e,n))},ptmo:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this._getPTValue(e,n,ce({instance:this},i),!1)},cx:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.isUnstyled?void 0:this._getOptionValue(this.$style.classes,e,ce(ce({},this.$params),n))},sx:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(n){var s=this._getOptionValue(this.$style.inlineStyles,e,ce(ce({},this.$params),i)),o=this._getOptionValue(nl.inlineStyles,e,ce(ce({},this.$params),i));return[o,s]}}},computed:{globalPT:function(){var e,n=this;return this._getPT((e=this.$primevueConfig)===null||e===void 0?void 0:e.pt,void 0,function(i){return ft(i,{instance:n})})},defaultPT:function(){var e,n=this;return this._getPT((e=this.$primevueConfig)===null||e===void 0?void 0:e.pt,void 0,function(i){return n._getOptionValue(i,n.$name,ce({},n.$params))||ft(i,ce({},n.$params))})},isUnstyled:function(){var e;return this.unstyled!==void 0?this.unstyled:(e=this.$primevueConfig)===null||e===void 0?void 0:e.unstyled},$inProps:function(){var e,n=Object.keys(((e=this.$.vnode)===null||e===void 0?void 0:e.props)||{});return Object.fromEntries(Object.entries(this.$props).filter(function(i){var s=li(i,1),o=s[0];return n==null?void 0:n.includes(o)}))},$theme:function(){var e;return(e=this.$primevueConfig)===null||e===void 0?void 0:e.theme},$style:function(){return ce(ce({classes:void 0,inlineStyles:void 0,load:function(){},loadCSS:function(){},loadTheme:function(){}},(this._getHostInstance(this)||{}).$style),this.$options.style)},$styleOptions:function(){var e;return{nonce:(e=this.$primevueConfig)===null||e===void 0||(e=e.csp)===null||e===void 0?void 0:e.nonce}},$primevueConfig:function(){var e;return(e=this.$primevue)===null||e===void 0?void 0:e.config},$name:function(){return this.$options.hostName||this.$.type.name},$params:function(){var e=this._getHostInstance(this)||this.$parent;return{instance:this,props:this.$props,state:this.$data,attrs:this.$attrs,parent:{instance:e,props:e==null?void 0:e.$props,state:e==null?void 0:e.$data,attrs:e==null?void 0:e.$attrs}}},$_attrsPT:function(){return Object.entries(this.$attrs||{}).filter(function(e){var n=li(e,1),i=n[0];return i==null?void 0:i.startsWith("pt:")}).reduce(function(e,n){var i=li(n,2),s=i[0],o=i[1],a=s.split(":"),l=Um(a),c=l.slice(1);return c==null||c.reduce(function(d,u,f,h){return!d[u]&&(d[u]=f===h.length-1?o:{}),d[u]},e),e},{})},$_attrsWithoutPT:function(){return Object.entries(this.$attrs||{}).filter(function(e){var n=li(e,1),i=n[0];return!(i!=null&&i.startsWith("pt:"))}).reduce(function(e,n){var i=li(n,2),s=i[0],o=i[1];return e[s]=o,e},{})}}},Xm={root:{position:"relative"}},Gm={root:"p-chart"},Jm=Rt.extend({name:"chart",classes:Gm,inlineStyles:Xm}),Qm={name:"BaseChart",extends:Km,props:{type:String,data:null,options:null,plugins:null,width:{type:Number,default:300},height:{type:Number,default:150},canvasProps:{type:null,default:null}},style:Jm,provide:function(){return{$pcChart:this,$parentInstance:this}}},ll={name:"Chart",extends:Qm,inheritAttrs:!1,emits:["select","loaded"],chart:null,watch:{data:{handler:function(){this.reinit()},deep:!0},type:function(){this.reinit()},options:function(){this.reinit()}},mounted:function(){this.initChart()},beforeUnmount:function(){this.chart&&(this.chart.destroy(),this.chart=null)},methods:{initChart:function(){var e=this;Promise.resolve().then(()=>t1).then(function(n){e.chart&&(e.chart.destroy(),e.chart=null),n&&n.default&&(e.chart=new n.default(e.$refs.canvas,{type:e.type,data:e.data,options:e.options,plugins:e.plugins})),e.$emit("loaded",e.chart)})},getCanvas:function(){return this.$canvas},getChart:function(){return this.chart},getBase64Image:function(){return this.chart.toBase64Image()},refresh:function(){this.chart&&this.chart.update()},reinit:function(){this.initChart()},onCanvasClick:function(e){if(this.chart){var n=this.chart.getElementsAtEventForMode(e,"nearest",{intersect:!0},!1),i=this.chart.getElementsAtEventForMode(e,"dataset",{intersect:!0},!1);n&&n[0]&&i&&this.$emit("select",{originalEvent:e,element:n[0],dataset:i})}},generateLegend:function(){if(this.chart)return this.chart.generateLegend()}}};function di(t){"@babel/helpers - typeof";return di=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},di(t)}function cl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,i)}return n}function dl(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?cl(Object(n),!0).forEach(function(i){Zm(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):cl(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function Zm(t,e,n){return(e=ep(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ep(t){var e=tp(t,"string");return di(e)=="symbol"?e:e+""}function tp(t,e){if(di(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(di(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var np=["width","height"];function ip(t,e,n,i,s,o){return r.openBlock(),r.createElementBlock("div",r.mergeProps({class:t.cx("root"),style:t.sx("root")},t.ptmi("root")),[r.createElementVNode("canvas",r.mergeProps({ref:"canvas",width:t.width,height:t.height,onClick:e[0]||(e[0]=function(a){return o.onCanvasClick(a)})},dl(dl({},t.canvasProps),t.ptm("canvas"))),null,16,np)],16)}ll.render=ip;function sp(){const t={primary:"#0efcf1",primaryBorder:"#388E3C",secondary:"#0ec6fc",secondaryBorder:"#FBC02D",tertiary:"#f1fc0e",tertiaryBorder:"#FFA000"},e=["linear","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInBounce","easeOutBounce","easeInOutBounce","easeInOutElastic"],n=r.ref("easeInOutElastic"),i=r.computed(()=>({responsive:!0,maintainAspectRatio:!0,plugins:{legend:{position:"top",labels:{font:{size:16}}},tooltip:{enabled:!0,titleFont:{size:14},bodyFont:{size:12}},zoom:{zoom:{wheel:{enabled:!0},drag:{enabled:!0},mode:"xy"},pan:{enabled:!0,mode:"xy"}}},scales:{x:{grid:{display:!1},ticks:{font:{size:14}}},y:{grid:{display:!0,color:"#e0e0e0"},ticks:{font:{size:14}}}},animation:{duration:2e3,easing:n.value,delay:500,loop:!1,animateRotate:!0,animateScale:!0},elements:{point:{radius:6,hoverRadius:10,backgroundColor:t.secondary},line:{tension:.4,borderWidth:2},bar:{borderWidth:2,borderRadius:4}}}));return{colorConfig:t,animationOptions:e,selectedAnimation:n,defaultChartOptions:i}}const op={components:{Chart:ll},props:{type:{type:String,required:!0},chartData:{type:Object,required:!0},chartOptions:{type:Object,default:()=>({})}},setup(t){const{colorConfig:e,defaultChartOptions:n}=sp(),i=r.computed(()=>{const o=t.chartData.datasets.map((a,l)=>{const c=Object.values(e);return{...a,backgroundColor:c[l%c.length],borderColor:c[l%c.length+1]}});return{...t.chartData,datasets:o}}),s=r.computed(()=>({...n.value,maintainAspectRatio:!0,...t.chartOptions}));return{computedChartData:i,computedChartOptions:s}}},rp={class:"chart-container"},ap={key:0},lp={key:1};function cp(t,e,n,i,s,o){const a=r.resolveComponent("Chart",!0);return r.openBlock(),r.createElementBlock("div",rp,[n.chartData?(r.openBlock(),r.createElementBlock("div",ap,[r.createVNode(a,{type:n.type,data:i.computedChartData,options:i.computedChartOptions},null,8,["type","data","options"])])):(r.openBlock(),r.createElementBlock("div",lp,e[0]||(e[0]=[r.createElementVNode("p",null,"No data available for the chart.",-1)])))])}const ui=De(op,[["render",cp],["__scopeId","data-v-8e3e786b"]]);function fi(){const t=r.ref(null),e=r.ref(!1),n=r.ref(null);return{chartData:t,fetchChartData:async({entityName:s,xaxis:o=null,yaxis:a=null})=>{e.value=!0,n.value=null;const l="https://mocki.io/v1/1ab17035-c115-4049-8ebf-a1e1b92d739a";try{const d=await(await fetch(l)).json();if(!d||!d.response||!d.response.result)throw new Error("Invalid data structure from API.");const u=d.response.result;if(!o&&!a){const f=Object.keys(u[0]);o=f[1],a=f.slice(4);const h=u.reduce((g,y)=>(a.forEach(b=>{g[b]||(g[b]=0),g[b]+=y[b]||0}),g),{}),m=Object.keys(h),p=Object.values(h);t.value={labels:m,datasets:[{label:"Default Data",data:p,borderWidth:1}]}}else{const f=u.map(p=>p[o]),m=(Array.isArray(a)?a:[a]).map(p=>({label:p,data:u.map(g=>g[p]||0),borderWidth:1}));t.value={labels:f,datasets:m}}}catch(c){n.value=c.message,t.value=null}finally{e.value=!1}},loading:e,error:n}}const dp={components:{chart:ui},props:{entityName:{type:String,required:!0},title:{type:String,default:"Bar Chart"},yaxis:{type:String,required:!0},xaxis:{type:String,required:!0}},setup(t){const{chartData:e,fetchChartData:n,loading:i,error:s}=fi(),o=r.ref({responsive:!0,plugins:{legend:{position:"top"},tooltip:{callbacks:{label:function(l){return`${l.dataset.label}: ${l.raw}`}}}}}),a=async()=>{if(!t.yaxis||!t.xaxis){console.error("xaxis or yaxis is not defined."),s.value="x-axis or y-axis is not properly configured.";return}await n({entityName:t.entityName,yaxis:t.yaxis,xaxis:t.xaxis})};return r.onMounted(()=>{console.log("Fetching data for yAxis:",t.yaxis),console.log("Fetching data for xAxis:",t.xaxis),a()}),{chartData:e,chartOptions:o,loading:i,error:s}}},up={key:0,class:"chart-container"},fp={key:1},hp={key:0},mp={key:1},pp={key:2};function gp(t,e,n,i,s,o){const a=r.resolveComponent("chart");return r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",null,[r.createElementVNode("h2",null,"Entity name: "+r.toDisplayString(n.entityName),1)]),i.chartData?(r.openBlock(),r.createElementBlock("div",up,[r.createElementVNode("h3",null,r.toDisplayString(n.title)+" , x-axis : "+r.toDisplayString(n.xaxis)+" , y-axis : "+r.toDisplayString(n.yaxis),1),r.createVNode(a,{type:"bar",chartData:i.chartData,chartOptions:i.chartOptions},null,8,["chartData","chartOptions"])])):(r.openBlock(),r.createElementBlock("div",fp,[i.loading?(r.openBlock(),r.createElementBlock("p",hp,"Loading chart data...")):i.error?(r.openBlock(),r.createElementBlock("p",mp,r.toDisplayString(i.error),1)):(r.openBlock(),r.createElementBlock("p",pp,"No data available for the chart."))]))])}const ul=De(dp,[["render",gp],["__scopeId","data-v-67577a46"]]),yp={components:{chart:ui},props:{entityName:{type:String,required:!0},title:{type:String,default:"Bar Chart"},yaxis:{type:String,required:!0},xaxis:{type:String,required:!0}},setup(t){const{chartData:e,fetchChartData:n,loading:i,error:s}=fi(),o=r.ref({responsive:!0,plugins:{legend:{position:"top"},tooltip:{callbacks:{label:function(l){return`${l.dataset.label}: ${l.raw}`}}}}}),a=async()=>{if(!t.yaxis||!t.xaxis){console.error("xaxis or yaxis is not defined."),s.value="x-axis or y-axis is not properly configured.";return}await n({entityName:t.entityName,yaxis:t.yaxis,xaxis:t.xaxis})};return r.onMounted(()=>{console.log("Fetching data for yAxis:",t.yaxis),console.log("Fetching data for xAxis:",t.xaxis),a()}),{chartData:e,chartOptions:o,loading:i,error:s}}},bp={key:0,class:"chart-container"},xp={key:1},_p={key:0},kp={key:1},Sp={key:2};function wp(t,e,n,i,s,o){const a=r.resolveComponent("chart");return r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",null,[r.createElementVNode("h2",null,"Entity name: "+r.toDisplayString(n.entityName),1)]),i.chartData?(r.openBlock(),r.createElementBlock("div",bp,[r.createElementVNode("h3",null,r.toDisplayString(n.title)+" , x-axis : "+r.toDisplayString(n.xaxis)+" , y-axis : "+r.toDisplayString(n.yaxis),1),r.createVNode(a,{type:"line",chartData:i.chartData,chartOptions:i.chartOptions},null,8,["chartData","chartOptions"])])):(r.openBlock(),r.createElementBlock("div",xp,[i.loading?(r.openBlock(),r.createElementBlock("p",_p,"Loading chart data...")):i.error?(r.openBlock(),r.createElementBlock("p",kp,r.toDisplayString(i.error),1)):(r.openBlock(),r.createElementBlock("p",Sp,"No data available for the chart."))]))])}const fl=De(yp,[["render",wp],["__scopeId","data-v-2cfe3d4d"]]),Ep={components:{chart:ui},props:{entityName:{type:String,required:!0},title:{type:String,default:"Pie Chart"},yaxis:{type:String,default:null},xaxis:{type:String,default:null}},setup(t){const{chartData:e,fetchChartData:n,loading:i,error:s}=fi(),o=r.ref({responsive:!0,plugins:{legend:{position:"top"},tooltip:{callbacks:{label:function(l){return`${l.label}: ${l.raw}`}}}}}),a=async()=>{await n({entityName:t.entityName,xaxis:t.xaxis,yaxis:t.yaxis})};return r.onMounted(()=>{a()}),{chartData:e,chartOptions:o,loading:i,error:s}}},Cp={key:0,class:"chart-container"},Op={key:1},vp={key:0},Np={key:1},Dp={key:2};function Tp(t,e,n,i,s,o){const a=r.resolveComponent("chart");return r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",null,[r.createElementVNode("h2",null,"Entity name: "+r.toDisplayString(n.entityName),1)]),i.chartData?(r.openBlock(),r.createElementBlock("div",Cp,[r.createElementVNode("h3",null,r.toDisplayString(n.title),1),r.createVNode(a,{type:"pie",chartData:i.chartData,chartOptions:i.chartOptions},null,8,["chartData","chartOptions"])])):(r.openBlock(),r.createElementBlock("div",Op,[i.loading?(r.openBlock(),r.createElementBlock("p",vp,"Loading chart data...")):i.error?(r.openBlock(),r.createElementBlock("p",Np,r.toDisplayString(i.error),1)):(r.openBlock(),r.createElementBlock("p",Dp,"No data available for the chart."))]))])}const hl=De(Ep,[["render",Tp],["__scopeId","data-v-27f5ea01"]]),Bp={components:{chart:ui},props:{entityName:{type:String,required:!0},title:{type:String,default:"Pie Chart"},yaxis:{type:String,default:null},xaxis:{type:String,default:null}},setup(t){const{chartData:e,fetchChartData:n,loading:i,error:s}=fi(),o=r.ref({responsive:!0,plugins:{legend:{position:"top"},tooltip:{callbacks:{label:function(l){return`${l.label}: ${l.raw}`}}}}}),a=async()=>{await n({entityName:t.entityName,xaxis:t.xaxis,yaxis:t.yaxis})};return r.onMounted(()=>{a()}),{chartData:e,chartOptions:o,loading:i,error:s}}},Pp={key:0,class:"chart-container"},Ap={key:1},Mp={key:0},Vp={key:1},Rp={key:2};function Fp(t,e,n,i,s,o){const a=r.resolveComponent("chart");return r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",null,[r.createElementVNode("h2",null,"Entity name: "+r.toDisplayString(n.entityName),1)]),i.chartData?(r.openBlock(),r.createElementBlock("div",Pp,[r.createElementVNode("h3",null,r.toDisplayString(n.title),1),r.createVNode(a,{type:"polarArea",chartData:i.chartData,chartOptions:i.chartOptions},null,8,["chartData","chartOptions"])])):(r.openBlock(),r.createElementBlock("div",Ap,[i.loading?(r.openBlock(),r.createElementBlock("p",Mp,"Loading chart data...")):i.error?(r.openBlock(),r.createElementBlock("p",Vp,r.toDisplayString(i.error),1)):(r.openBlock(),r.createElementBlock("p",Rp,"No data available for the chart."))]))])}const ml=De(Bp,[["render",Fp],["__scopeId","data-v-941f0d0a"]]),$p={components:{chart:ui},props:{entityName:{type:String,required:!0},title:{type:String,default:"Bar Chart"},yaxis:{type:String,required:!0},xaxis:{type:String,required:!0}},setup(t){const{chartData:e,fetchChartData:n,loading:i,error:s}=fi(),o=r.ref({responsive:!0,plugins:{legend:{position:"top"},tooltip:{callbacks:{label:function(l){return`${l.dataset.label}: ${l.raw}`}}}}}),a=async()=>{if(!t.yaxis||!t.xaxis){console.error("xaxis or yaxis is not defined."),s.value="x-axis or y-axis is not properly configured.";return}await n({entityName:t.entityName,yaxis:t.yaxis,xaxis:t.xaxis})};return r.onMounted(()=>{console.log("Fetching data for yAxis:",t.yaxis),console.log("Fetching data for xAxis:",t.xaxis),a()}),{chartData:e,chartOptions:o,loading:i,error:s}}},Lp={key:0,class:"chart-container"},Ip={key:1},jp={key:0},zp={key:1},Up={key:2};function Wp(t,e,n,i,s,o){const a=r.resolveComponent("chart");return r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",null,[r.createElementVNode("h2",null,"Entity name: "+r.toDisplayString(n.entityName),1)]),i.chartData?(r.openBlock(),r.createElementBlock("div",Lp,[r.createElementVNode("h3",null,r.toDisplayString(n.title)+" , x-axis : "+r.toDisplayString(n.xaxis)+" , y-axis : "+r.toDisplayString(n.yaxis),1),r.createVNode(a,{type:"radar",chartData:i.chartData,chartOptions:i.chartOptions},null,8,["chartData","chartOptions"])])):(r.openBlock(),r.createElementBlock("div",Ip,[i.loading?(r.openBlock(),r.createElementBlock("p",jp,"Loading chart data...")):i.error?(r.openBlock(),r.createElementBlock("p",zp,r.toDisplayString(i.error),1)):(r.openBlock(),r.createElementBlock("p",Up,"No data available for the chart."))]))])}const pl=De($p,[["render",Wp],["__scopeId","data-v-80750171"]]),Hp={class:"flex flex-col p-3"},qp={class:"flex justify-center flex-row mb-2 cursor-pointer"},Yp={style:{"word-break":"break-all"}},Kp={__name:"LinkEntityContent",props:{linkEntityListItem:{type:Object,required:!0}},setup(t){Ye.useRoute();const e=ot(),n=r.ref("");e.getAppId()!=null&&e.getAppId()!=""&&(n.value=e.getAppId());const i=r.ref(),s=r.ref(!1),o=r.ref(!1),a=r.ref({}),l=r.ref([{label:"Remove association",icon:"",command:f=>{c()}}]),c=()=>{console.log(a.value),console.log("Function is calling")},d=(f,h)=>{a.value=h,i.value.show(f),o.value=!0},u=()=>{a.value={},o.value=!1};return(f,h)=>{const m=r.resolveComponent("Button"),p=r.resolveComponent("ContextMenu"),g=r.resolveComponent("router-link");return r.openBlock(),r.createElementBlock("div",{onMouseenter:h[4]||(h[4]=r.withModifiers(y=>s.value=!0,["prevent"])),onMouseleave:h[5]||(h[5]=r.withModifiers(y=>s.value=!1,["prevent"])),class:"flex relative m-3",style:{border:"1px solid var(--surface-border)","border-radius":"5px"}},[r.withDirectives(r.createVNode(m,{onClick:h[0]||(h[0]=y=>d(y,t.linkEntityListItem)),class:"!absolute right-0",size:"small",style:{width:"55px",height:"25px","border-radius":"5px","font-size":"12px"}},{default:r.withCtx(()=>h[6]||(h[6]=[r.createTextVNode(" More")])),_:1},512),[[r.vShow,s.value||o.value]]),r.createVNode(p,{ref_key:"menu",ref:i,model:l.value,onMouseenter:h[1]||(h[1]=r.withModifiers(y=>s.value=!0,["prevent"])),onMouseleave:h[2]||(h[2]=r.withModifiers(y=>s.value=!1,["prevent"])),onHide:h[3]||(h[3]=y=>u())},null,8,["model"]),r.createElementVNode("div",Hp,[r.createElementVNode("div",qp,[r.createElementVNode("div",Yp,r.toDisplayString(t.linkEntityListItem.entityName),1),r.createVNode(g,{to:{name:"entity360view",params:{entityName:t.linkEntityListItem.entityName,id:t.linkEntityListItem.id,appId:n.value}},target:"_blank"},{default:r.withCtx(()=>h[7]||(h[7]=[r.createElementVNode("div",{class:"pi pi-external-link ml-3"},null,-1)])),_:1},8,["to"])]),r.createElementVNode("div",null,"Id: "+r.toDisplayString(t.linkEntityListItem.id),1)])],32)}}},Xp={class:"flex flex-col mt-3"},Gp={class:"flex flex-row items-center"},Jp={class:"flex items-center justify-center mt-5"},Qp={key:0,class:"pi pi-caret-right"},Zp={key:1,class:"pi pi-caret-down"},eg={key:0},tg={class:"flex flex-col mt-5"},ng={class:"col-12"},ig={class:"flex flex-col mt-5"},sg={class:"col-12 font-bold"},og={key:0},rg={class:"flex flex-col mt-5"},ag={class:"col-12"},lg={class:"flex flex-col mt-5"},cg={class:"col-12"},dg={class:"flex flex-col mt-5"},ug={class:"col-12"},fg={class:"flex flex-row justify-between items-center mt-5"},hg={key:1,class:"mt-2"},mg={class:"flex flex-row justify-between items-center"},pg={key:1,class:"text-red-500"},gg={class:"flex flex-col mt-5"},yg={class:"flex flex-row justify-between items-center mt-2"},bg={class:"flex flex-row items-center mt-5 mb-5"},xg={class:"font-bold"},_g={class:"font-bold ml-2 flex-1"},kg={class:"flex flex-row justify-center items-center mb-2"},Sg={class:"ml-2 flex-1"},wg={key:0,class:"pi pi-exclamation-circle"},Eg={class:"flex flex-col justify-center"},Cg={class:"flex flex-row justify-between items-center"},Og={class:"justify-start"},vg={class:"justify-start"},Ng=De({__name:"EntityLookup",props:r.mergeModels({linkedEntity:{type:Object,required:!0},entity360Name:{type:String,required:!0},entity360Id:{required:!0},saveExistingRelatedEntityRecord:{type:Function,required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){Ye.useRoute();const e=t,n=r.useModel(t,"modelValue"),i=new fn,s=r.ref({}),o=r.ref([]),a=r.ref({}),l=r.ref([]),c=r.ref([]),d=r.ref({}),u=r.ref("id"),f=r.ref(1),h=r.ref([]),m=r.ref(25),p=r.ref(0),g=r.ref(0),y=r.ref(0);let b=r.ref([]);const x=r.ref(!1),w={gt:"GREATER_THAN",dateAfter:"GREATER_THAN",equals:"EQUAL",dateIs:"EQUAL",notEquals:"NOT_EQUAL",dateIsNot:"NOT_EQUAL",lt:"LESS_THAN",dateBefore:"LESS_THAN",lte:"LESS_THAN_EQUAL",gte:"GREATER_THAN_EQUAL",between:"BETWEEN",contains:"CONTAINS",startsWith:"STARTS_WITH",notContains:"NOT_CONTAINS",endsWith:"ENDS_WITH"},E={gt:"is greater than",dateAfter:"is after",equals:"is equals",dateIs:"is equals",notEquals:"is not equals",dateIsNot:"is not equals",lt:"is less than",dateBefore:"is before",lte:"is less than or equal to",gte:"is greater than or equal to",between:"between",contains:"contains",startsWith:"starts with",notContains:"not contains",endsWith:"ends with"};r.onMounted(()=>{C()});const k=H=>e.linkedEntity.list.some(F=>F[d.value.name]===H),C=async()=>{try{const H={sortBy:[u.value],sortDirection:f.value===1?"ASC":"DESC",pageSize:m.value,currentPage:p.value,columnList:null,filter:b.value,fullTextSearch:""},F=await i.searchEntityRecords(e.linkedEntity.entityName,H);F&&F.response&&(s.value=F.response,l.value=F.response.entity.entityDefinition.columns,c.value=ve(F.response.entity.entityDefinition.columns),g.value=F.response.totalRecords,await S(),await _(),O())}catch{}finally{}},S=async()=>{for(let H=0;H<l.value.length;H++){const F=l.value[H];!F.autoGeneerated&&F.foreignKey&&F.foreignKey.referencedEntityName.toLowerCase()==e.entity360Name.toLowerCase()&&(a.value=F)}},_=async()=>{for(let H=0;H<l.value.length;H++){const F=l.value[H];if(F.primaryKey&&F.primaryKey==!0){d.value=F;break}}},O=()=>{for(let H=0;H<e.linkedEntity.list.length;H++){const F=e.linkedEntity.list[H];F.is_deleted==!1&&F[a.value.name]==e.entity360Id&&o.value.push(F[d.value.name])}},P=()=>{let H=JSON.parse(JSON.stringify(o.value));H=H.filter(he=>!k(he));let F={linkEntityName:s.value.entityName,linkRecordIdList:[]};for(let he=0;he<H.length;he++){const pe=H[he];F.linkRecordIdList.push(pe)}e.saveExistingRelatedEntityRecord(F)},v=()=>{x.value=!x.value},T=[{label:"Starts with",value:"startsWith"},{label:"Contains",value:"contains"},{label:"Not contains",value:"notContains"},{label:"Ends with",value:"endsWith"},{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"}],R=[{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"},{label:"Less than",value:"lt"},{label:"Less than or equal to",value:"lte"},{label:"Greater than",value:"gt"},{label:"Greater than or equal to",value:"gte"}],U=[{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"}],Y=[{label:"Date is",value:"dateIs"},{label:"Date is not",value:"dateIsNot"},{label:"Date is before",value:"dateBefore"},{label:"Date is after",value:"dateAfter"}],L=[{label:"ASC",value:1},{label:"DESC",value:-1}];let j=[];const $=r.computed(()=>c.value.filter(H=>H.sortable)),A=r.computed(()=>c.value.filter(H=>H.filterable)),I=H=>c.value.filter(F=>{var he;return F.filterable?((he=h.value[H])==null?void 0:he.columnName)===F.name?!0:!h.value.some((pe,me)=>me!==H&&pe.columnName===F.name):!1}).map(F=>({label:F.name,value:F.field})),Q=H=>{let F="";switch(qe(H.columnName).toLowerCase()){case"string":case"uuid":F="startsWith";break;case"date":F="dateIs";break;case"numeric":case"int":case"integer":F="equals";break;case"bool":case"boolean":F="equals";break}H.operator=F,H.value=""},ne=H=>{const F=qe(H.columnName);switch(F&&F.toLowerCase()){case"integer":case"int":case"numeric":j=R;break;case"date":j=Y;break;case"bool":case"boolean":j=U;break;default:j=T}return j},se=H=>{if(H&&H.columnName){const F=qe(H.columnName);return xt(F)}else return""},K=()=>{for(let H=0;H<h.value.length;H++){const F=h.value[H];F.editing=!1}h.value.push({columnName:"",value:"",operator:"",editing:!0})},J=H=>{h.value.splice(H,1)},oe=H=>{H.editing=!H.editing},ue=()=>{let H=JSON.parse(JSON.stringify(h.value));b.value=[];for(let F=0;F<H.length;F++){const he=H[F];delete he.editing,he.columnName&&he.operator&&he.value&&(he.columnType=qe(he.columnName),he.operator=w[he.operator],b.value.push(he))}C()},ve=H=>H.map(F=>({field:F.name,name:F.displayName?F.displayName:F.name,filterable:F.filterable,datatype:F.type,sortable:!0,displayFormatKey:F.displayFormatKey,displayFormat:F.displayFormat})),st=()=>{C()},qe=H=>{const F=c.value.find(he=>he.field===H);return F?F.datatype:null},xt=H=>{switch(H.toLowerCase()){case"integer":case"int":case"numeric":return"numeric";case"date":return"date";case"bool":case"boolean":return"boolean";default:return"text"}},ct=H=>{m.value=H.rows,p.value=H.page,y.value=H.first,C()};return(H,F)=>{var un,Bn;const he=r.resolveComponent("InputIcon"),pe=r.resolveComponent("InputText"),me=r.resolveComponent("IconField"),ge=r.resolveComponent("Select"),Te=r.resolveComponent("Divider"),Ze=r.resolveComponent("InputNumber"),Tt=r.resolveComponent("DatePicker"),$e=r.resolveComponent("Button"),et=r.resolveComponent("Checkbox"),dt=r.resolveComponent("Paginator"),dn=r.resolveDirective("tooltip");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",Xp,[r.createElementVNode("div",Gp,[r.createVNode(me,{class:"block mt-2 md:mt-0 w-full"},{default:r.withCtx(()=>[r.createVNode(he,{onClick:F[0]||(F[0]=()=>{}),class:"pi pi-search"}),r.createVNode(pe,{class:"w-full",onKeyup:F[1]||(F[1]=r.withKeys(()=>{},["enter"])),placeholder:`Search ${s.value.entityName}`},null,8,["placeholder"])]),_:1})]),r.createElementVNode("div",Jp,[r.createElementVNode("div",{class:"flex items-center cursor-pointer sorting-filter-section flex-1 line-height-4",onClick:F[2]||(F[2]=ee=>v())},[x.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Qp)),x.value?(r.openBlock(),r.createElementBlock("div",Zp)):r.createCommentVNode("",!0),F[9]||(F[9]=r.createElementVNode("div",{class:"ml-3 font-bold"}," Sorting & Filters ",-1))])]),x.value?(r.openBlock(),r.createElementBlock("div",eg,[r.createElementVNode("div",tg,[F[10]||(F[10]=r.createElementVNode("div",{class:"col-12 font-bold"},"Sort Column",-1)),r.createElementVNode("div",ng,[r.createVNode(ge,{modelValue:u.value,"onUpdate:modelValue":F[3]||(F[3]=ee=>u.value=ee),options:$.value,optionLabel:"name",optionValue:"field",highlightOnSelect:!1,class:"w-full",onChange:F[4]||(F[4]=ee=>st(H.event))},null,8,["modelValue","options"])])]),r.createElementVNode("div",ig,[F[11]||(F[11]=r.createElementVNode("div",{class:"col-12 font-bold"},[r.createElementVNode("div",{class:"col-12 font-bold"},"Sort Direction")],-1)),r.createElementVNode("div",sg,[r.createVNode(ge,{modelValue:f.value,"onUpdate:modelValue":F[5]||(F[5]=ee=>f.value=ee),options:L,optionLabel:"label",optionValue:"value",highlightOnSelect:!1,class:"w-full",onChange:F[6]||(F[6]=ee=>st(H.event))},null,8,["modelValue"])])]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(h.value,(ee,_t)=>(r.openBlock(),r.createElementBlock("div",{key:_t},[ee.editing?(r.openBlock(),r.createElementBlock("div",og,[r.createVNode(Te,{class:"mt-5"}),r.createElementVNode("div",rg,[F[12]||(F[12]=r.createElementVNode("div",{class:"col-12 font-bold"},"Filter Column",-1)),r.createElementVNode("div",ag,[r.createVNode(ge,{modelValue:ee.columnName,"onUpdate:modelValue":Ae=>ee.columnName=Ae,options:I(_t),optionLabel:"label",placeholder:"Select column",optionValue:"value",highlightOnSelect:!1,class:"w-full",onChange:Ae=>Q(ee)},null,8,["modelValue","onUpdate:modelValue","options","onChange"])])]),r.createElementVNode("div",lg,[F[13]||(F[13]=r.createElementVNode("div",{class:"col-12 font-bold"},"Filter Operator",-1)),r.createElementVNode("div",cg,[r.createVNode(ge,{modelValue:ee.operator,"onUpdate:modelValue":Ae=>ee.operator=Ae,options:ne(ee),optionLabel:"label",placeholder:"Select operator",optionValue:"value",highlightOnSelect:!1,class:"w-full"},null,8,["modelValue","onUpdate:modelValue","options"])])]),r.createElementVNode("div",dg,[F[14]||(F[14]=r.createElementVNode("div",{class:"col-12 font-bold"},"Filter value",-1)),r.createElementVNode("div",ug,[se(ee)=="numeric"?(r.openBlock(),r.createBlock(Ze,{key:0,format:!1,class:"w-full",modelValue:ee.value,"onUpdate:modelValue":Ae=>ee.value=Ae,placeholder:"Search value"},null,8,["modelValue","onUpdate:modelValue"])):se(ee)=="date"?(r.openBlock(),r.createBlock(Tt,{key:1,class:"w-full",modelValue:ee.value,"onUpdate:modelValue":Ae=>ee.value=Ae,dateFormat:"mm/dd/yy",placeholder:"mm/dd/yyyy"},null,8,["modelValue","onUpdate:modelValue"])):(r.openBlock(),r.createBlock(pe,{key:2,modelValue:ee.value,"onUpdate:modelValue":Ae=>ee.value=Ae,class:"w-full",placeholder:"Search value"},null,8,["modelValue","onUpdate:modelValue"]))])]),r.createElementVNode("div",fg,[r.createVNode($e,{style:{width:"100px"},label:"Hide",icon:"",severity:"warning",onClick:Ae=>oe(ee)},null,8,["onClick"]),r.createVNode($e,{style:{width:"100px"},label:"Delete",icon:"",severity:"danger",onClick:Ae=>J(_t)},null,8,["onClick"])])])):r.createCommentVNode("",!0),ee.editing?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",hg,[r.createVNode(Te),r.createElementVNode("div",mg,[r.createElementVNode("span",null,[ee.columnName||ee.operator||ee.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createElementVNode("span",{class:r.normalizeClass({"text-red-500":!ee.columnName})},r.toDisplayString(ee.columnName?" "+ee.columnName:" column"),3),r.createElementVNode("span",{class:r.normalizeClass({"text-red-500":!E[ee.operator]})},r.toDisplayString(ee.operator?" "+E[ee.operator]:" operator"),3),r.createElementVNode("span",{class:r.normalizeClass({"text-red-500":!ee.value})},r.toDisplayString(ee.value?" "+ee.value:" value"),3)],64)):(r.openBlock(),r.createElementBlock("span",pg,"Filter is empty"))]),r.createVNode($e,{style:{width:"100px"},label:"Edit",icon:"",severity:"info",onClick:Ae=>oe(ee)},null,8,["onClick"])])]))]))),128)),r.createElementVNode("div",gg,[r.createVNode(Te),r.createElementVNode("div",yg,[r.createVNode($e,{style:{width:"100px"},label:"Add",disabled:A.value.length===h.value.length,icon:"",severity:"success",onClick:K},null,8,["disabled"]),r.createVNode($e,{style:{width:"100px"},label:"Apply",severity:"info",onClick:ue})])])])):r.createCommentVNode("",!0),r.createElementVNode("div",bg,[r.createElementVNode("div",xg,r.toDisplayString((un=s.value)==null?void 0:un.totalRecords),1),r.createElementVNode("div",_g,r.toDisplayString((Bn=s.value)==null?void 0:Bn.entityName),1)]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value.result,(ee,_t)=>(r.openBlock(),r.createElementBlock("div",{key:_t},[r.createElementVNode("div",kg,[r.createVNode(et,{disabled:k(ee[d.value.name]),modelValue:o.value,"onUpdate:modelValue":F[7]||(F[7]=Ae=>o.value=Ae),value:ee[d.value.name]},null,8,["disabled","modelValue","value"]),r.createElementVNode("div",Sg,[r.createTextVNode(r.toDisplayString(t.linkedEntity.entityName)+" ",1),r.createElementVNode("span",null,r.toDisplayString(ee[d.value.name]),1)]),k(ee[d.value.name])?r.withDirectives((r.openBlock(),r.createElementBlock("div",wg,null,512)),[[dn,"This record is already associated.",void 0,{left:!0}]]):r.createCommentVNode("",!0)])]))),128)),r.createVNode(dt,{rows:m.value,totalRecords:g.value,rowsPerPageOptions:[10,25,50,100],onPage:ct,template:"FirstPageLink PageLinks LastPageLink CurrentPageReport RowsPerPageDropdown",currentPageReportTemplate:""},null,8,["rows","totalRecords"])]),r.createElementVNode("div",Eg,[r.createVNode(Te,{class:"mt-5"}),r.createElementVNode("div",Cg,[r.createElementVNode("div",Og,[r.createVNode($e,{label:"Cancel",icon:"",severity:"secondary",onClick:F[8]||(F[8]=ee=>n.value=!1)})]),r.createElementVNode("div",vg,[r.createVNode($e,{label:"Save",severity:"success",onClick:P})])])])],64)}}},[["__scopeId","data-v-5172abef"]]),Dg={class:"field flex flex-col"},Tg={key:0,class:"flex items-center"},Bg={key:1},Pg={class:"flex items-center"},Ag={class:"flex flex-col justify-center"},Mg={class:"flex flex-row justify-between items-center"},Vg={class:"justify-start"},Rg={class:"justify-start"},Fg={__name:"EntityLookupObject",props:r.mergeModels({linkedEntity:{type:Object,required:!0},entity360Name:{type:String,required:!0},entity360Id:{type:[String,Number]},saveExistingEntityObject:{type:Function}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){Ye.useRoute();const e=t,n=r.useModel(t,"modelValue"),i=new fn,s=r.ref({}),o=r.ref({});let a=r.ref("");const l=r.ref({}),c=r.ref({});r.onMounted(async()=>{console.log("linkedEntity"),console.log(e.linkedEntity),console.log("entity360Name"),console.log(e.entity360Name),console.log("entity360Id"),console.log(e.entity360Id),await u(),await d()});const d=async()=>{try{const g=await i.getEntityRecords(e.linkedEntity.entityName);g&&g.response&&(s.value=g.response,await f(g.response.entity.entityDefinition.columns),await m(),console.log(s.value))}catch{}finally{}},u=async()=>{try{const g=await i.getRecord(e.entity360Name,e.entity360Id);g&&g.response&&(o.value=g.response,await h(g.response.entity.entityDefinition.columns),console.log(o.value))}catch{}finally{}},f=async g=>{for(let y=0;y<g.length;y++){const b=g[y];if(b.primaryKey&&b.primaryKey==!0){l.value=b;break}}},h=async g=>{for(let y=0;y<g.length;y++){const b=g[y];if(!b.autoGeneerated&&b.foreignKey&&b.foreignKey.referencedEntityName.toLowerCase()==e.linkedEntity.entityName.toLowerCase()){c.value=b;break}}},m=async()=>{for(let g=0;g<s.value.result.length;g++){const y=s.value.result[g];if(y[l.value.name]==o.value.result[0][c.value.name]){a.value=y;break}}},p=()=>{const g={linkedEntityRecordId:a.value[l.value.name],linkedEntityName:e.linkedEntity.entityName,relationType:"ManyToOne"};e.saveExistingEntityObject(g)};return(g,y)=>{const b=r.resolveComponent("Select"),x=r.resolveComponent("Divider"),w=r.resolveComponent("Button");return r.openBlock(),r.createElementBlock("div",Dg,[r.createVNode(b,{modelValue:r.unref(a),"onUpdate:modelValue":y[0]||(y[0]=E=>r.isRef(a)?a.value=E:a=E),"item-value":l.value.name,options:s.value.result,filter:"",optionLabel:l.value.name,placeholder:"Select "+l.value.name,class:"w-full"},{value:r.withCtx(E=>[E.value?(r.openBlock(),r.createElementBlock("div",Tg,[r.createElementVNode("div",null,r.toDisplayString(E.value[l.value.name]),1)])):(r.openBlock(),r.createElementBlock("span",Bg,r.toDisplayString(E.placeholder),1))]),option:r.withCtx(E=>[r.createElementVNode("div",Pg,[r.createElementVNode("div",null,r.toDisplayString(E.option[l.value.name]),1)])]),_:1},8,["modelValue","item-value","options","optionLabel","placeholder"]),r.createElementVNode("div",Ag,[r.createVNode(x),r.createElementVNode("div",Mg,[r.createElementVNode("div",Vg,[r.createVNode(w,{label:"Cancel",icon:"",severity:"secondary",onClick:y[1]||(y[1]=E=>n.value=!1)})]),r.createElementVNode("div",Rg,[r.createVNode(w,{label:"Save",severity:"success",onClick:p})])])])])}}},$g={style:{"font-weight":"700","font-size":"1.25rem"}},Lg={class:"flex flex-col"},Ig={class:"flex flex-row justify-between items-center"},jg={class:"justify-start"},zg={class:"justify-start"},Ug="",Wg={__name:"CreateRelatedentity",props:r.mergeModels({entity360Id:{required:!0},entity360Name:{type:String,required:!0},linkedEntity:{type:Object,required:!0}},{showCreateRelatedEntityForm:{},showCreateRelatedEntityFormModifiers:{}}),emits:r.mergeModels(["onSaveDialog"],["update:showCreateRelatedEntityForm"]),setup(t,{emit:e}){const n=r.useModel(t,"showCreateRelatedEntityForm");Ye.useRoute();const i=t,s=i.linkedEntity.entityName,o=e,a=r.ref("Add existing");r.onMounted(()=>{m()});const{formData:l,columns:c,errors:d,backendErrors:u,clearErrors:f,saveRecord:h,fetchAllRecords:m,saveRelatedEntityRecord:p}=Po(s,Ug,o),g=()=>{for(let w=0;w<c.value.length;w++){const E=c.value[w];!E.autoGenerated&&E.foreignKey&&(l.value[E.name]=i.entity360Id)}const x={relationType:i.linkedEntity.relationType,linkedEntities:{entityLinkage:[{linkEntityName:i.entity360Name,linkRecordIdList:[i.entity360Id]}]}};h(x)},y=x=>{var w;if(((w=x==null?void 0:x.linkRecordIdList)==null?void 0:w.length)>0){const E={entityLinkage:[{linkEntityName:x.linkEntityName,linkRecordIdList:x.linkRecordIdList}]};p(i.entity360Name,i.entity360Id,E)}},b=x=>{const w={entityLinkage:[{linkEntityName:i.entity360Name,linkRecordIdList:[i.entity360Id]}]};p(x.linkedEntityName,x.linkedEntityRecordId,w)};return(x,w)=>{const E=r.resolveComponent("Tab"),k=r.resolveComponent("TabList"),C=r.resolveComponent("Divider"),S=r.resolveComponent("Button"),_=r.resolveComponent("TabPanel"),O=r.resolveComponent("TabPanels"),P=r.resolveComponent("Tabs"),v=r.resolveComponent("Drawer");return r.openBlock(),r.createBlock(v,{visible:n.value,"onUpdate:visible":w[3]||(w[3]=T=>n.value=T),blockScroll:!0,position:"right",class:"p-fluid layout-profile-sidebar",style:{width:"40%"},pt:{closeButton:"ml-auto"}},{header:r.withCtx(()=>[r.createElementVNode("span",$g,r.toDisplayString(a.value)+" "+r.toDisplayString(t.linkedEntity.entityName),1)]),default:r.withCtx(()=>[r.createVNode(P,{value:"1"},{default:r.withCtx(()=>[r.createVNode(k,null,{default:r.withCtx(()=>[r.createVNode(E,{value:"0"},{default:r.withCtx(()=>w[4]||(w[4]=[r.createTextVNode("Create new")])),_:1}),r.createVNode(E,{value:"1"},{default:r.withCtx(()=>w[5]||(w[5]=[r.createTextVNode("Add existing")])),_:1})]),_:1}),r.createVNode(O,null,{default:r.withCtx(()=>[r.createVNode(_,{value:"0"},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(c),(T,R)=>{var U;return r.openBlock(),r.createElementBlock("div",{key:R,class:"mt-3"},[!T.autoGenerated&&!T.foreignKey?(r.openBlock(),r.createBlock(os,{key:0,modelValue:r.unref(l)[T.name],"onUpdate:modelValue":Y=>r.unref(l)[T.name]=Y,column:T,errors:(U=r.unref(d)[T.name])==null?void 0:U.messages,onInput:r.unref(f)},null,8,["modelValue","onUpdate:modelValue","column","errors","onInput"])):r.createCommentVNode("",!0)])}),128)),r.createElementVNode("div",Lg,[r.createVNode(C),r.createElementVNode("div",Ig,[r.createElementVNode("div",jg,[r.createVNode(S,{label:"Cancel",icon:"",severity:"secondary",onClick:w[0]||(w[0]=T=>n.value=!1)})]),r.createElementVNode("div",zg,[r.createVNode(S,{label:"Save",severity:"success",onClick:g})])])])]),_:1}),r.createVNode(_,{value:"1"},{default:r.withCtx(()=>[t.linkedEntity.relationType=="ONE_TO_MANY"?(r.openBlock(),r.createBlock(Ng,{key:0,modelValue:n.value,"onUpdate:modelValue":w[1]||(w[1]=T=>n.value=T),linkedEntity:t.linkedEntity,entity360Name:t.entity360Name,entity360Id:t.entity360Id,saveExistingRelatedEntityRecord:y},null,8,["modelValue","linkedEntity","entity360Name","entity360Id"])):r.createCommentVNode("",!0),t.linkedEntity.relationType=="MANY_TO_ONE"?(r.openBlock(),r.createBlock(Fg,{key:1,modelValue:n.value,"onUpdate:modelValue":w[2]||(w[2]=T=>n.value=T),linkedEntity:t.linkedEntity,entity360Name:t.entity360Name,entity360Id:t.entity360Id,saveExistingEntityObject:b},null,8,["modelValue","linkedEntity","entity360Name","entity360Id"])):r.createCommentVNode("",!0)]),_:1})]),_:1})]),_:1})]),_:1},8,["visible"])}}},Hg={class:"flex flex-col border-bottom-section pb-3 pt-3"},qg={class:"flex items-center pl-3 pr-3 justify-between"},Yg={key:0,class:"pi pi-caret-right"},Kg={key:1,class:"pi pi-caret-down"},Xg={class:"ml-3 font-bold"},Gg={class:"ml-1"},Jg={class:"text-right"},Qg={key:0},Zg=De({__name:"LinkEntitySection",props:{entity360Id:{required:!0},entity360Name:{type:String,required:!0},linkedEntity:{type:Object,required:!0},entity360Name:{type:[String,Number]},onSaveRelatedEnttity:{type:Function}},setup(t){Ye.useRoute();const e=t,n=r.ref(!1),i=r.ref(!1),s=()=>{n.value=!n.value},o=()=>{i.value=!i.value},a=()=>{i.value=!1,e.onSaveRelatedEnttity()},l=r.computed(()=>e.linkedEntity.list.filter(c=>!c.is_deleted).length);return(c,d)=>{const u=r.resolveComponent("Button");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",Hg,[r.createElementVNode("div",qg,[r.createElementVNode("div",{class:"flex cursor-pointer items-center linked-entity-section grow line-height-4",onClick:d[0]||(d[0]=f=>s())},[n.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Yg)),n.value?(r.openBlock(),r.createElementBlock("div",Kg)):r.createCommentVNode("",!0),r.createElementVNode("div",Xg,r.toDisplayString(t.linkedEntity.entityName),1),r.createElementVNode("div",Gg," ("+r.toDisplayString(l.value)+") ",1)]),r.createElementVNode("div",Jg,[r.createVNode(u,{label:"Add",icon:"pi pi-plus",size:"small",onClick:d[1]||(d[1]=f=>o())})])]),n.value?(r.openBlock(),r.createElementBlock("div",Qg,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.linkedEntity.list,(f,h)=>(r.openBlock(),r.createElementBlock("div",{class:"flex flex-col",key:h},[f.is_deleted?r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(Kp,{key:0,linkEntityListItem:f},null,8,["linkEntityListItem"]))]))),128))])):r.createCommentVNode("",!0)]),i.value?(r.openBlock(),r.createBlock(Wg,{key:0,showCreateRelatedEntityForm:i.value,"onUpdate:showCreateRelatedEntityForm":d[2]||(d[2]=f=>i.value=f),linkedEntity:t.linkedEntity,entity360Name:t.entity360Name,entity360Id:t.entity360Id,onOnSaveDialog:a},null,8,["showCreateRelatedEntityForm","linkedEntity","entity360Name","entity360Id"])):r.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-412eec44"]]),ey={key:0},ty={class:"flex"},ny={class:"p-3 mt-3 flex-col items-center"},iy={key:0,class:"pi pi-caret-right"},sy={key:1,class:"pi pi-caret-down"},oy={class:"font-bold ml-2"},ry={key:0,class:"flex flex-col mt-4"},ay={class:"flex flex-col mt-2"},ly={class:"flex flex-row flex-wrap justify-between pl-5"},cy={class:"flex flex-col"},dy={class:"font-bold"},uy={class:"mt-2"},fy={key:0,class:"flex flex-col",style:{position:"relative","max-width":"400px","background-color":"var(--surface-card)"}},hy={key:2,style:{width:"350px"},class:"flex flex-col justify-center"},my={key:0,class:"custom-sidebar"},py={class:"custom-sidebar-content"},gy={class:"custom-sidebar-button"},yy={class:"custom-sidebar-text"},gl=De({__name:"Entity360",props:{entityName:{type:String},recordId:{type:String},variable:{type:String,default:"item"},linkedEntity:Array},emits:["onSaveDialog"],setup(t,{expose:e,emit:n}){var v,T;const i=ot(),s=Ye.useRoute(),o=t,a=r.ref(!0),l=r.ref(!1),c=r.ref([]);let d=(v=s==null?void 0:s.params)==null?void 0:v.entityName,u=(T=s==null?void 0:s.params)==null?void 0:T.id;o.entityName&&(d=o.entityName),o.recordId&&(u=o.recordId);const f=n,{formData:h,columns:m,errors:p,backendErrors:g,isDataChange:y,linkedEntities:b,primarayColumn:x,clearErrors:w,saveRecord:E,getRelatedEntityRecordById:k,cancleRecord:C}=Po(d,u,f);r.watch(()=>i.globalConfigs.appId,async R=>{R&&k()},{immediate:!0});const S=()=>{a.value=!a.value},_=()=>{l.value=!l.value},O=()=>{k()},P=R=>{if(!c.value||c.value.length===0)return[];const U=c.value.find(Y=>Y.entityName===R);return U&&U.list?U.list:(console.log("No related entity found"),[])};return e({getRelatedEntity:P}),r.watch(()=>b.value,R=>{Array.isArray(R)&&R.length>0&&R[0]&&(c.value=R)},{immediate:!0,deep:!0}),(R,U)=>{var se;const Y=r.resolveComponent("SplitterPanel"),L=r.resolveComponent("Tab"),j=r.resolveComponent("TabList"),$=r.resolveComponent("TabPanel"),A=r.resolveComponent("TabPanels"),I=r.resolveComponent("Tabs"),Q=r.resolveComponent("Splitter"),ne=r.resolveComponent("Button");return R.$slots["list-item-display-360"]?(r.openBlock(),r.createElementBlock("div",ey,[r.renderSlot(R.$slots,"header",{},void 0,!0),r.createElementVNode("div",null,[r.renderSlot(R.$slots,"list-item-display-360",r.normalizeProps({[t.variable||""]:{formData:r.unref(h),columns:r.unref(m),linkedEntities:r.unref(b),errors:r.unref(p),recordId:r.unref(u),entityName:r.unref(d),getRelatedEntity:P}}),void 0,!0)]),r.renderSlot(R.$slots,"footer",{},void 0,!0)])):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createElementVNode("div",ty,[r.createVNode(Q,{class:"flex-1",layout:"horizontal",gutterSize:8,size:100},{default:r.withCtx(()=>[r.createVNode(Y,{size:20,minSize:10,maxSize:20},{default:r.withCtx(()=>[r.createElementVNode("div",ny,[r.createElementVNode("div",{onClick:U[0]||(U[0]=K=>S()),class:"section-heading cursor-pointer"},[a.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("i",iy)),a.value?(r.openBlock(),r.createElementBlock("i",sy)):r.createCommentVNode("",!0),r.createElementVNode("span",oy," About this "+r.toDisplayString(r.unref(d)),1)]),a.value?(r.openBlock(),r.createElementBlock("div",ry,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(m),(K,J)=>{var oe;return r.openBlock(),r.createElementBlock("div",{key:J},[K.autoGenerated?r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(os,{key:0,modelValue:r.unref(h)[K.name],"onUpdate:modelValue":ue=>r.unref(h)[K.name]=ue,column:K,errors:(oe=r.unref(p)[K.name])==null?void 0:oe.messages,onInput:r.unref(w)},null,8,["modelValue","onUpdate:modelValue","column","errors","onInput"]))])}),128))])):r.createCommentVNode("",!0)])]),_:1}),r.createVNode(Y,{size:55,minSize:35,style:{height:"100%"}},{default:r.withCtx(()=>[r.createVNode(I,{value:"0"},{default:r.withCtx(()=>[r.createVNode(j,null,{default:r.withCtx(()=>[r.createVNode(L,{value:"0"},{default:r.withCtx(()=>U[3]||(U[3]=[r.createTextVNode("Overview")])),_:1}),r.createVNode(L,{value:"1"},{default:r.withCtx(()=>U[4]||(U[4]=[r.createTextVNode("Activity")])),_:1})]),_:1}),r.createVNode(A,null,{default:r.withCtx(()=>[r.createVNode($,{value:"0"},{default:r.withCtx(()=>[r.createElementVNode("div",ay,[U[5]||(U[5]=r.createElementVNode("h3",{class:"mt-2 text-xl font-semibold"},"Data highlights",-1)),r.createElementVNode("div",ly,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(m).filter(K=>K.autoGenerated),(K,J)=>(r.openBlock(),r.createElementBlock("div",{key:J,class:"column-item"},[r.createElementVNode("div",cy,[r.createElementVNode("div",dy,r.toDisplayString(K.name),1),r.createElementVNode("div",uy,[r.createVNode(Vo,{column:K,value:r.unref(h)[K.name]},null,8,["column","value"])])])]))),128))])])]),_:1}),r.createVNode($,{value:"1"})]),_:1})]),_:1})]),_:1})]),_:1}),((se=r.unref(b))==null?void 0:se.length)>0?(r.openBlock(),r.createElementBlock("div",fy,[l.value?(r.openBlock(),r.createBlock(ne,{key:0,icon:"pi pi-caret-right",rounded:"",onClick:_,"aria-label":"Filter",style:{height:"2rem",width:"2rem",left:"-20px"}})):r.createCommentVNode("",!0),l.value?r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(ne,{key:1,icon:"pi pi-caret-left",rounded:"",onClick:_,"aria-label":"Filter",style:{height:"2rem",width:"2rem",left:"-20px"}})),l.value?(r.openBlock(),r.createElementBlock("div",hy,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(b),(K,J)=>(r.openBlock(),r.createElementBlock("div",{key:J},[r.createVNode(Zg,{entity360Name:r.unref(d),entity360Id:r.unref(u),linkedEntity:K,onSaveRelatedEnttity:O},null,8,["entity360Name","entity360Id","linkedEntity"])]))),128))])):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)]),r.unref(y)?(r.openBlock(),r.createElementBlock("div",my,[r.createElementVNode("div",py,[r.createElementVNode("div",gy,[r.createVNode(ne,{severity:"primary",onClick:U[1]||(U[1]=K=>r.unref(E)())},{default:r.withCtx(()=>U[6]||(U[6]=[r.createTextVNode("Save")])),_:1}),r.createVNode(ne,{style:{"margin-left":"10px"},severity:"secondary",onClick:U[2]||(U[2]=K=>r.unref(C)())},{default:r.withCtx(()=>U[7]||(U[7]=[r.createTextVNode("Cancel")])),_:1})]),r.createElementVNode("div",yy," You've changed property in the "+r.toDisplayString(r.unref(d))+". ",1)])])):r.createCommentVNode("",!0)],64))}}},[["__scopeId","data-v-6df84fdd"]]);function xs(){const t=new fn;let{errors:e,setErrors:n}=Sa(),i=r.reactive({data:null});const s=C=>{i.data=C},o=async C=>{try{const S=await t.getEntityRecords(C);if(S&&S.response)return S}catch(S){return console.error("Error fetching entity:",S.errorMessage),S}finally{}},a=async(C,S)=>{try{let _=await t.addRecord(C.entityName,S);if(_)return _}catch(_){return _}finally{}},l=async(C,S,_)=>{try{const O=await t.updateRecord(C.entityName,S,_);if(O&&O.response)return O}catch(O){return O}finally{}},c=async(C,S)=>{try{S.filter==null&&(S.filter={}),Object.keys(S.filter).length===0&&(S.filter=[]);const _=await t.searchEntityRecords(C.entityName,S);if(_)return _.response.sortBy=S.sortBy,_.response.filters=S.filter,_.response.sortDirection=S.sortDirection,_.response.fullTextSearch=S.fullTextSearch,_}catch(_){return _}finally{}},d=async(C,S)=>{try{const _=await t.deleteRecord(C.entityName,S);if(_)return _}catch(_){console.error("Error on deleting record:",_.errorMessage)}finally{}},u=C=>C.result,f=C=>{var S,_;return(_=(S=C==null?void 0:C.entity)==null?void 0:S.entityDefinition)==null?void 0:_.columns},h=C=>{const S=C.entity.entityDefinition.columns;let _={};for(let O=0;O<S.length;O++){const P=S[O];if(P.primaryKey&&P.primaryKey==!0){_=P;break}}return _},m=C=>{const S=C.entity.entityDefinition.columns;let _={};for(let O=0;O<S.length;O++){let P=S[O];P.autoGenerated||(_[P.name]="")}return _},p=(C,S)=>{let _="";const O=C.entity.entityDefinition.columns;for(let P=0;P<O.length;P++){let v=O[P];if(S==v.name){_=v.type;break}}return _},g=(C,S)=>{const O=C.entity.entityDefinition.columns.filter(v=>v.autoGenerated).map(v=>v.name);return Object.entries(S).filter(([v])=>!O.includes(v)).map(([v,T])=>({recordColumnName:v,recordColumnValue:T,columnType:p(i.data,v)}))},y=()=>{const C=i.data.entity.entityDefinition.columns;return Bo().shape(C.reduce((_,O)=>(O.autoGenerated||(_[O.name]=To().nullable(!1).test({name:"custom-validation",test:function(P){const v=[];let T="";if(O.required&&(!P||P.trim()===""))if(O.validations){T=b(O.validations,"VALIDATE_REQUIRED"),v.push(T);let R=w(O.validations,"VALIDATE_REQUIRED");R&&(R="hint:"+R,v.push(R))}else T=O.displayName+" is required.",v.push(T);else{if(O.maxLength&&P.length>O.maxLength)if(O.validations){T=b(O.validations,"VALIDATE_MAXLENGTH"),v.push(T);let R=w(O.validations,"VALIDATE_MAXLENGTH");R&&(R="hint:"+R,v.push(R))}else T=O.displayName+" cannot exceed from "+O.maxLength+" characters",v.push(T);if(O.regxId&&!new RegExp(x(O.validations,"VALIDATE_REGX")).test(P))if(O.validations){T=b(O.validations,"VALIDATE_REGX"),v.push(T);let R=w(O.validations,"VALIDATE_REGX");R&&(R="hint:"+R,v.push(R))}else T=O.displayName+" invalid format.",v.push(T)}return v.length>0?this.createError({message:v}):!0}})),_),{}))},b=(C,S)=>{for(let _=0;_<C.length;_++)if(S==C[_].type)return C[_].message},x=(C,S)=>{for(let _=0;_<C.length;_++)if(S==C[_].type)return C[_].regx},w=(C,S)=>{for(let _=0;_<C.length;_++)if(S==C[_].type)return C[_].hint};return{state:i,setEntity:s,getEntity:o,addRecord:a,updateRecord:l,searchRecord:c,entityRecordDelete:d,getEntityItems:u,getEntityColumns:f,getPrimaryKeyColumn:h,getFormData:m,createDataToSave:g,createValidationSchema:y,clearErrors:C=>(n({...e.value,[C]:null}),e.value),validateData:async(C,S)=>{try{return await C.validate(S,{abortEarly:!1}),n({}),{validate:!0}}catch(_){const O=_.inner.reduce((T,R)=>(T[R.path]||(T[R.path]={messages:[]}),T[R.path].messages.push(...R.errors),T),{}),P=Object.entries(O).reduce((T,[R,U])=>(T[R]={messages:U.messages},T),{});return n(P),{validate:!1,errors:e.value}}}}}const _s={__name:"ConfirmDeleteDialog",props:{showDeleteDialog:{},showDeleteDialogModifiers:{}},emits:r.mergeModels(["onDeleteItem"],["update:showDeleteDialog"]),setup(t,{emit:e}){const n=r.useModel(t,"showDeleteDialog"),i=e,s=o=>{i("onDeleteItem",{remove:o})};return(o,a)=>{const l=r.resolveComponent("Button"),c=r.resolveComponent("Dialog");return r.openBlock(),r.createBlock(c,{visible:n.value,"onUpdate:visible":a[2]||(a[2]=d=>n.value=d),style:{width:"450px"},header:"Confirm",modal:!0},{footer:r.withCtx(()=>[r.createVNode(l,{label:"No",icon:"pi pi-times",text:"",onClick:a[0]||(a[0]=d=>s(!1))}),r.createVNode(l,{label:"Yes",icon:"pi pi-check",text:"",onClick:a[1]||(a[1]=d=>s(!0))})]),default:r.withCtx(()=>[a[3]||(a[3]=r.createElementVNode("div",{class:"flex items-center justify-center"},[r.createElementVNode("i",{class:"pi pi-exclamation-triangle mr-3",style:{"font-size":"2rem"}}),r.createElementVNode("span",null,"Are you sure you want to delete the selected item?")],-1))]),_:1},8,["visible"])}}},by={key:0,style:{"font-weight":"700","font-size":"1.25rem"}},xy={key:1,style:{"font-weight":"700","font-size":"1.25rem"}},hi={__name:"EntityFormDialog",props:r.mergeModels({item:Object},{showEntityForm:{},showEntityFormModifiers:{}}),emits:["update:showEntityForm"],setup(t){const e=r.useModel(t,"showEntityForm"),n=r.inject("entityObject"),i=t;let s=r.ref([]),o=r.ref({}),a=r.ref([]),l=r.ref(null),c=r.ref({});r.onMounted(()=>{s.value=n.getEntityColumns(n.state.data),i.item?o.value=JSON.parse(JSON.stringify(i.item)):o.value=n.getFormData(n.state.data),l.value=n.createValidationSchema()});const d=async()=>{const m=await n.validateData(l.value,o.value);if(!m.validate){c.value=m.errors;return}const p=n.getPrimaryKeyColumn(n.state.data),g=i.item[p.name],y={dataDefinitions:n.createDataToSave(n.state.data,o.value)},b=await n.updateRecord(n.state.data,g,y);if(b&&b.success){e.value=!1;const x={sortBy:n.state.data.sortBy,sortDirection:n.state.data.sortDirection,pageSize:n.state.data.pageSize,currentPage:n.state.data.currentPage,columnList:null,filter:n.state.data.filters,fullTextSearch:n.state.data.fullTextSearch},w=await n.searchRecord(n.state.data,x);if(w!=null&&w.response){let E=w==null?void 0:w.response;n.setEntity(E)}}else b.validationErrors&&(a.value=JSON.parse(JSON.stringify(b.errvalidationErrorsors)))},u=async()=>{const m=await n.validateData(l.value,o.value);if(!m.validate){c.value=m.errors;return}const p={dataDefinitions:n.createDataToSave(n.state.data,o.value)},g=await n.addRecord(n.state.data,p);g&&g.success?(e.value=!1,n.state.data=await n.getEntity(n.state.data.entityName)):g.validationErrors&&(a.value=JSON.parse(JSON.stringify(g.errvalidationErrorsors)))},f=async()=>{i.item?d():u()},h=m=>{c.value=n.clearErrors(m)};return(m,p)=>{const g=r.resolveComponent("Button"),y=r.resolveComponent("Dialog");return e.value?(r.openBlock(),r.createBlock(y,{key:0,showFooter:!1,visible:e.value,"onUpdate:visible":p[2]||(p[2]=b=>e.value=b),style:{width:"50rem"},breakpoints:{"1199px":"75vw","575px":"90vw"},modal:!0,class:"p-fluid"},{header:r.withCtx(()=>[t.item?(r.openBlock(),r.createElementBlock("span",by,"Edit "+r.toDisplayString(r.unref(n).state.data.entityName)+" record details",1)):r.createCommentVNode("",!0),t.item?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",xy,"Add "+r.toDisplayString(r.unref(n).state.data.entityName)+" record details",1))]),footer:r.withCtx(()=>[r.createVNode(g,{type:"button",icon:"",label:"Cancel",severity:"secondary",onClick:p[0]||(p[0]=b=>e.value=!1)}),r.createVNode(g,{type:"button",icon:"",label:"Save",severity:"success",onClick:p[1]||(p[1]=b=>f())})]),default:r.withCtx(()=>{var b;return[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(s),(x,w)=>{var E;return r.openBlock(),r.createElementBlock("div",{key:w},[!x.autoGenerated&&!x.foreignKey?(r.openBlock(),r.createBlock(os,{key:0,modelValue:r.unref(o)[x.name],"onUpdate:modelValue":k=>r.unref(o)[x.name]=k,column:x,errors:(E=r.unref(c)[x.name])==null?void 0:E.messages,onInput:h},null,8,["modelValue","onUpdate:modelValue","column","errors"])):r.createCommentVNode("",!0),!x.autoGenerated&&x.foreignKey?(r.openBlock(),r.createBlock(La,{key:1,modelValue:r.unref(o)[x.name],"onUpdate:modelValue":k=>r.unref(o)[x.name]=k,entityName:x.foreignKey.referencedEntityName,columnName:x.name,relatedEntityColumn:x.foreignKey.referencedColumnName},null,8,["modelValue","onUpdate:modelValue","entityName","columnName","relatedEntityColumn"])):r.createCommentVNode("",!0)])}),128)),((b=r.unref(a))==null?void 0:b.length)>0?(r.openBlock(),r.createBlock($a,{key:0,errors:r.unref(a)},null,8,["errors"])):r.createCommentVNode("",!0)]}),_:1},8,["visible"])):r.createCommentVNode("",!0)}}},_y={class:"flex justify-between items-start"},ky={class:"flex-grow-1"},Sy={class:"tile-grid"},wy={class:"font-bold text-lg text-700"},Ey={class:"flex flex-col gap-2"},Cy=De({__name:"EntityListSingleRecord",props:{item:Object},setup(t){const e=t,n=r.inject("entityObject"),i=r.ref([]),s=r.ref(!1),o=r.ref(!1);r.onMounted(()=>{i.value=n.getEntityColumns(n.state.data)});const a=()=>{s.value=!0},l=()=>{o.value=!0},c=u=>{u.remove==!0?d():s.value=!1},d=async()=>{const u=n.getPrimaryKeyColumn(n.state.data),f=e.item[u.name],h=await n.entityRecordDelete(n.state.data,f);if(h!=null&&h.success){s.value=!1;const m={sortBy:n.state.data.sortBy,sortDirection:n.state.data.sortDirection,pageSize:n.state.data.pageSize,currentPage:n.state.data.currentPage,columnList:null,filter:n.state.data.filters,fullTextSearch:n.state.data.fullTextSearch},p=await n.searchRecord(n.state.data,m);if(p!=null&&p.response){let g=p==null?void 0:p.response;n.setEntity(g)}console.log(h)}};return(u,f)=>{const h=r.resolveComponent("Button");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",_y,[r.createElementVNode("div",ky,[r.createElementVNode("div",Sy,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value,(m,p)=>(r.openBlock(),r.createElementBlock("div",{key:p},[r.createElementVNode("span",wy,r.toDisplayString(m.name)+" : ",1),r.createVNode(Vo,{column:m,value:t.item[m.name]},null,8,["column","value"])]))),128))])]),r.createElementVNode("div",Ey,[r.createVNode(h,{onClick:f[0]||(f[0]=m=>l()),icon:"pi pi-pencil",severity:"success",size:"",rounded:"","aria-label":"Edit"}),r.createVNode(h,{onClick:f[1]||(f[1]=m=>a()),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"})])]),o.value?(r.openBlock(),r.createBlock(hi,{key:0,showEntityForm:o.value,"onUpdate:showEntityForm":f[2]||(f[2]=m=>o.value=m),item:t.item},null,8,["showEntityForm","item"])):r.createCommentVNode("",!0),s.value?(r.openBlock(),r.createBlock(_s,{key:1,showDeleteDialog:s.value,"onUpdate:showDeleteDialog":f[3]||(f[3]=m=>s.value=m),onOnDeleteItem:c},null,8,["showDeleteDialog"])):r.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-ea3b758f"]]),Oy=De({__name:"EntityListRecordParent",props:{listItemDisplay:String},setup(t){const e=r.inject("entityObject"),n=r.ref([]);return r.watch(()=>e.state.data,i=>{i&&(n.value=i.result,console.log("Entity state updated in child:",e))},{immediate:!0}),(i,s)=>(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.value,(o,a)=>(r.openBlock(),r.createElementBlock("div",{key:a,class:"card rounded-md p-5 my-2 shadow-lg relative tile"},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.listItemDisplay!=null&&t.listItemDisplay!=""?t.listItemDisplay:Cy),r.mergeProps({ref_for:!0},{item:o}),null,16))]))),128))}},[["__scopeId","data-v-b13f837f"]]),vy={};function Ny(t,e){return null}const Dy=De(vy,[["render",Ny]]),Ty={class:"my-2"},By={class:"m-0"},Py={__name:"EntityListHeaderSlot",setup(t){const e=r.inject("entityObject");let n=r.ref("");return r.watch(()=>e.state.data,i=>{i&&(n.value=i.entityName)},{immediate:!0}),(i,s)=>{const o=r.resolveComponent("Toolbar");return r.openBlock(),r.createBlock(o,{class:"p-2 my-2"},{start:r.withCtx(()=>[r.createElementVNode("div",Ty,[r.createElementVNode("h2",By,"EntityName: "+r.toDisplayString(r.unref(n)),1)])]),end:r.withCtx(()=>s[0]||(s[0]=[])),_:1})}}},Ay={class:"flex flex-col mb-5"},My={class:"col-12"},Vy={class:"flex flex-col mb-5"},Ry={class:"col-12"},Fy={key:0},$y={class:"flex flex-col mb-5"},Ly={class:"col-12"},Iy={class:"flex flex-col mb-5"},jy={class:"col-12"},zy={class:"flex flex-col mb-5"},Uy={class:"col-12"},Wy={class:"flex flex-row justify-between items-center"},Hy={key:1},qy={class:"flex flex-row justify-between items-center"},Yy={key:1,class:"text-red-500"},Ky={class:"flex flex-col"},Xy={class:"flex flex-row justify-between items-center"},Gy={__name:"FilterSortSidebar",props:r.mergeModels({headers:Array,operatorMap:Object,sortCallback:Function,filterCallback:Function,getColumnDatatype:Function,getDatatypeByField:Function},{sortBy:{},sortByModifiers:{},sortDirection:{},sortDirectionModifiers:{},showFilter:{},showFilterModifiers:{},filters:{},filtersModifiers:{}}),emits:["update:sortBy","update:sortDirection","update:showFilter","update:filters"],setup(t){const e=r.useModel(t,"sortBy"),n=r.useModel(t,"sortDirection"),i=r.useModel(t,"showFilter"),s=r.useModel(t,"filters"),o={gt:"is greater than",dateAfter:"is after",equals:"is equals",dateIs:"is equals",notEquals:"is not equals",dateIsNot:"is not equals",lt:"is less than",dateBefore:"is before",lte:"is less than or equal to",gte:"is greater than or equal to",between:"between",contains:"contains",startsWith:"starts with",notContains:"not contains",endsWith:"ends with"},a=[{label:"Starts with",value:"startsWith"},{label:"Contains",value:"contains"},{label:"Not contains",value:"notContains"},{label:"Ends with",value:"endsWith"},{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"}],l=[{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"},{label:"Less than",value:"lt"},{label:"Less than or equal to",value:"lte"},{label:"Greater than",value:"gt"},{label:"Greater than or equal to",value:"gte"}],c=[{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"}],d=[{label:"Date is",value:"dateIs"},{label:"Date is not",value:"dateIsNot"},{label:"Date is before",value:"dateBefore"},{label:"Date is after",value:"dateAfter"}],u=[{label:"ASC",value:1},{label:"DESC",value:-1}];let f=[];const h=r.computed(()=>t.headers.filter(S=>S.sortable)),m=r.computed(()=>t.headers.filter(S=>S.filterable)),p=S=>t.headers.filter(_=>{var O;return _.filterable?((O=s.value[S])==null?void 0:O.columnName)===_.name?!0:!s.value.some((P,v)=>v!==S&&P.columnName===_.name):!1}).map(_=>({label:_.name,value:_.field})),g=S=>{let _="";switch(t.getDatatypeByField(S.columnName).toLowerCase()){case"string":case"uuid":_="startsWith";break;case"date":_="dateIs";break;case"numeric":case"int":case"integer":_="equals";break;case"bool":case"boolean":_="equals";break}S.operator=_,S.value=""},y=S=>{const _=t.getDatatypeByField(S.columnName);switch(_&&_.toLowerCase()){case"integer":case"int":case"numeric":f=l;break;case"date":f=d;break;case"bool":case"boolean":f=c;break;default:f=a}return f},b=S=>{if(S&&S.columnName){const _=t.getDatatypeByField(S.columnName);return t.getColumnDatatype(_)}else return""},x=()=>{for(let S=0;S<s.value.length;S++){const _=s.value[S];_.editing=!1}s.value.push({columnName:"",value:"",operator:"",editing:!0})},w=S=>{s.value.splice(S,1)},E=S=>{S.editing=!S.editing},k=()=>{let S=[],_=JSON.parse(JSON.stringify(s.value));for(let O=0;O<_.length;O++){const P=_[O];delete P.editing,P.columnName&&P.operator&&P.value&&(P.columnType=t.getDatatypeByField(P.columnName),P.operator=t.operatorMap[P.operator],S.push(P))}t.filterCallback(S)},C=()=>{t.sortCallback()};return(S,_)=>{const O=r.resolveComponent("Select"),P=r.resolveComponent("Divider"),v=r.resolveComponent("InputNumber"),T=r.resolveComponent("DatePicker"),R=r.resolveComponent("InputText"),U=r.resolveComponent("Button"),Y=r.resolveComponent("Drawer");return r.openBlock(),r.createBlock(Y,{visible:i.value,"onUpdate:visible":_[4]||(_[4]=L=>i.value=L),header:"Sorting and Filter",blockScroll:!0,position:"right",class:"layout-profile-sidebar !w-full md:!w-80 lg:!w-[30rem]",pt:{closeButton:"ml-auto"}},{default:r.withCtx(()=>[r.createElementVNode("div",Ay,[_[5]||(_[5]=r.createElementVNode("div",{class:"col-12 font-bold"},"Sort Column",-1)),r.createElementVNode("div",My,[r.createVNode(O,{modelValue:e.value,"onUpdate:modelValue":_[0]||(_[0]=L=>e.value=L),options:h.value,optionLabel:"name",optionValue:"field",highlightOnSelect:!1,class:"w-full",onChange:_[1]||(_[1]=L=>C(S.event))},null,8,["modelValue","options"])])]),r.createElementVNode("div",Vy,[_[6]||(_[6]=r.createElementVNode("div",{class:"col-12 font-bold"},[r.createElementVNode("div",{class:"col-12 font-bold"},"Sort Direction")],-1)),r.createElementVNode("div",Ry,[r.createVNode(O,{modelValue:n.value,"onUpdate:modelValue":_[2]||(_[2]=L=>n.value=L),options:u,optionLabel:"label",optionValue:"value",highlightOnSelect:!1,class:"w-full",onChange:_[3]||(_[3]=L=>C(S.event))},null,8,["modelValue"])])]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value,(L,j)=>(r.openBlock(),r.createElementBlock("div",{key:j},[L.editing?(r.openBlock(),r.createElementBlock("div",Fy,[r.createVNode(P),r.createElementVNode("div",$y,[_[7]||(_[7]=r.createElementVNode("div",{class:"col-12 font-bold"},"Filter Column",-1)),r.createElementVNode("div",Ly,[r.createVNode(O,{modelValue:L.columnName,"onUpdate:modelValue":$=>L.columnName=$,options:p(j),optionLabel:"label",placeholder:"Select column",optionValue:"value",highlightOnSelect:!1,class:"w-full",onChange:$=>g(L)},null,8,["modelValue","onUpdate:modelValue","options","onChange"])])]),r.createElementVNode("div",Iy,[_[8]||(_[8]=r.createElementVNode("div",{class:"col-12 font-bold"},"Filter Operator",-1)),r.createElementVNode("div",jy,[r.createVNode(O,{modelValue:L.operator,"onUpdate:modelValue":$=>L.operator=$,options:y(L),optionLabel:"label",placeholder:"Select operator",optionValue:"value",highlightOnSelect:!1,class:"w-full"},null,8,["modelValue","onUpdate:modelValue","options"])])]),r.createElementVNode("div",zy,[_[9]||(_[9]=r.createElementVNode("div",{class:"col-12 font-bold"},"Filter value",-1)),r.createElementVNode("div",Uy,[b(L)=="numeric"?(r.openBlock(),r.createBlock(v,{key:0,format:!1,class:"w-full",modelValue:L.value,"onUpdate:modelValue":$=>L.value=$,placeholder:"Search value"},null,8,["modelValue","onUpdate:modelValue"])):b(L)=="date"?(r.openBlock(),r.createBlock(T,{key:1,class:"w-full",modelValue:L.value,"onUpdate:modelValue":$=>L.value=$,dateFormat:"mm/dd/yy",placeholder:"mm/dd/yyyy"},null,8,["modelValue","onUpdate:modelValue"])):(r.openBlock(),r.createBlock(R,{key:2,modelValue:L.value,"onUpdate:modelValue":$=>L.value=$,class:"w-full",placeholder:"Search value"},null,8,["modelValue","onUpdate:modelValue"]))])]),r.createElementVNode("div",Wy,[r.createVNode(U,{label:"Hide",icon:"",severity:"warn",onClick:$=>E(L)},null,8,["onClick"]),r.createVNode(U,{label:"Delete",icon:"",severity:"danger",onClick:$=>w(j)},null,8,["onClick"])])])):r.createCommentVNode("",!0),L.editing?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Hy,[r.createVNode(P),r.createElementVNode("div",qy,[r.createElementVNode("span",null,[L.columnName||L.operator||L.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createElementVNode("span",{class:r.normalizeClass({"text-red-500":!L.columnName})},r.toDisplayString(L.columnName?" "+L.columnName:" column"),3),r.createElementVNode("span",{class:r.normalizeClass({"text-red-500":!o[L.operator]})},r.toDisplayString(L.operator?" "+o[L.operator]:" operator"),3),r.createElementVNode("span",{class:r.normalizeClass({"text-red-500":!L.value})},r.toDisplayString(L.value?" "+L.value:" value"),3)],64)):(r.openBlock(),r.createElementBlock("span",Yy,"Filter is empty"))]),r.createVNode(U,{label:"Edit",icon:"",severity:"info",onClick:$=>E(L)},null,8,["onClick"])])]))]))),128)),r.createElementVNode("div",Ky,[r.createVNode(P),r.createElementVNode("div",Xy,[r.createVNode(U,{label:"Add",disabled:m.value.length===s.value.length,icon:"",severity:"success",onClick:x},null,8,["disabled"]),r.createVNode(U,{label:"Apply",severity:"info",onClick:k})])])]),_:1},8,["visible"])}}},Jy={class:"my-2"},Gt={__name:"EntityListFilters",setup(t){const e=r.inject("entityObject"),n=r.ref(!1),i=r.ref([]),s=r.ref([]),o=r.ref(""),a=r.ref(1);let l=r.ref("");const c=r.ref([]),d=r.ref([]),u={gt:"GREATER_THAN",dateAfter:"GREATER_THAN",equals:"EQUAL",dateIs:"EQUAL",notEquals:"NOT_EQUAL",dateIsNot:"NOT_EQUAL",lt:"LESS_THAN",dateBefore:"LESS_THAN",lte:"LESS_THAN_EQUAL",gte:"GREATER_THAN_EQUAL",between:"BETWEEN",contains:"CONTAINS",startsWith:"STARTS_WITH",notContains:"NOT_CONTAINS",endsWith:"ENDS_WITH"};r.watch(()=>e.state.data,E=>{if(E&&(c.value=e.getEntityColumns(E),d.value=b(c.value),o.value=="")){const k=e.getPrimaryKeyColumn(E);o.value=k.name}},{immediate:!0});const f=()=>{n.value=!n.value},h=E=>{s.value=E,m()},m=async()=>{const E={sortBy:[o.value],sortDirection:a.value===1?"ASC":"DESC",pageSize:e.state.data.pageSize,currentPage:e.state.data.currentPage,columnList:null,filter:s.value,fullTextSearch:l.value},k=await e.searchRecord(e.state.data,E);if(k!=null&&k.success){let C=k==null?void 0:k.response;e.setEntity(C)}},p=()=>{m()},g=()=>{i.value=[],s.value=[],m()},y=()=>{m()},b=E=>E.map(k=>({field:k.name,name:k.displayName?k.displayName:k.name,filterable:k.filterable,datatype:k.type,sortable:k.indexColumn,displayFormatKey:k.displayFormatKey,displayFormat:k.displayFormat})),x=E=>{switch(E.toLowerCase()){case"integer":case"int":case"numeric":return"numeric";case"date":return"date";case"bool":case"boolean":return"boolean";default:return"text"}},w=E=>{const k=c.value.find(C=>C.name===E);return k?k.type:null};return(E,k)=>{const C=r.resolveComponent("Button"),S=r.resolveComponent("InputIcon"),_=r.resolveComponent("InputText"),O=r.resolveComponent("IconField"),P=r.resolveComponent("Toolbar");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createVNode(P,{class:"p-2 my-2"},{start:r.withCtx(()=>[r.createElementVNode("div",Jy,[r.createVNode(C,{type:"button",size:"medium",icon:"pi pi-filter",label:"Filter",severity:"info",onClick:k[0]||(k[0]=v=>f())})]),r.createVNode(C,{class:"ml-3",size:"medium",type:"button",icon:"pi pi-filter-slash",label:"Clear",severity:"warn",onClick:k[1]||(k[1]=v=>g())})]),end:r.withCtx(()=>[r.createVNode(O,{iconPosition:"right",class:"block mt-2 md:mt-0"},{default:r.withCtx(()=>[r.createVNode(S,{onClick:k[2]||(k[2]=v=>y()),class:"pi pi-search"}),r.createVNode(_,{class:"w-full sm:w-auto",onKeyup:k[3]||(k[3]=r.withKeys(v=>y(),["enter"])),modelValue:r.unref(l),"onUpdate:modelValue":k[4]||(k[4]=v=>r.isRef(l)?l.value=v:l=v),placeholder:"Search..."},null,8,["modelValue"])]),_:1})]),_:1}),r.createVNode(Gy,{sortBy:o.value,"onUpdate:sortBy":k[5]||(k[5]=v=>o.value=v),sortDirection:a.value,"onUpdate:sortDirection":k[6]||(k[6]=v=>a.value=v),showFilter:n.value,"onUpdate:showFilter":k[7]||(k[7]=v=>n.value=v),filters:i.value,"onUpdate:filters":k[8]||(k[8]=v=>i.value=v),headers:d.value,operatorMap:u,sortCallback:p,filterCallback:h,getColumnDatatype:x,getDatatypeByField:w},null,8,["sortBy","sortDirection","showFilter","filters","headers"])],64)}}},mi={__name:"EntityListPagination",setup(t){const e=r.ref(25),n=r.ref(0),i=r.ref(0),s=r.ref(0);let o=r.inject("entityObject");const a=async l=>{e.value=l.rows,n.value=l.page,s.value=l.first;const c={sortBy:o.state.data.sortBy,sortDirection:o.state.data.sortDirection,columnList:null,filter:o.state.data.filters,fullTextSearch:o.state.data.fullTextSearch,pageSize:e.value,currentPage:n.value},d=await o.searchRecord(o.state.data,c);if(d!=null&&d.success){let u=d==null?void 0:d.response;o.setEntity(u),i.value=d.response.totalRecords,s.value=n.value*e.value}};return r.watch(()=>{var l,c;return(c=(l=o==null?void 0:o.state)==null?void 0:l.data)==null?void 0:c.totalRecords},l=>{i&&(i.value=l)},{immediate:!0}),(l,c)=>{const d=r.resolveComponent("Paginator");return r.openBlock(),r.createBlock(d,{class:"my-4",rows:e.value,totalRecords:i.value,rowsPerPageOptions:[10,25,50,100],onPage:a,template:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink CurrentPageReport RowsPerPageDropdown",currentPageReportTemplate:"Showing {first} to {last} of {totalRecords} items"},null,8,["rows","totalRecords"])}}},Qy={class:"flex flex-row justify-end p-2 my-2"},Jt={__name:"EntityListAddButton",setup(t){const e=r.ref(!1),n=()=>{e.value=!0};return(i,s)=>{const o=r.resolveComponent("Button");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",Qy,[r.createVNode(o,{label:"Add",size:"medium",icon:"pi pi-plus",onClick:s[0]||(s[0]=a=>n())})]),e.value?(r.openBlock(),r.createBlock(hi,{key:0,showEntityForm:e.value,"onUpdate:showEntityForm":s[1]||(s[1]=a=>e.value=a)},null,8,["showEntityForm"])):r.createCommentVNode("",!0)],64)}}},yl={__name:"EntityList",props:{entityName:String,listDisplay:String,listItemDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,showAddButton:Boolean,listFilerSlot:Boolean,className:{type:String,default:"default-class"}},setup(t,{expose:e}){const n=xs(),i=ot();r.provide("entityObject",n);const s=t;return e({props:s,reload:()=>{console.log("reload data")}}),r.watch(()=>i.globalConfigs.appId,async a=>{if(a){const l=await n.getEntity(s.entityName);l.success?n.setEntity(l.response):n.setEntity({result:[]})}},{immediate:!0}),(a,l)=>{var c,d,u;return a.$slots["list-item-display"]?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[t.showAddButton?(r.openBlock(),r.createBlock(Jt,{key:0})):r.createCommentVNode("",!0),t.listFilerSlot?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.listFilter||Gt),{key:1})):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(((u=(d=(c=r.unref(n))==null?void 0:c.state)==null?void 0:d.data)==null?void 0:u.result)||[],f=>r.renderSlot(a.$slots,"list-item-display",{item:f})),256))],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.listHeader||Py))),(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.listFilter||Gt))),t.showAddButton?(r.openBlock(),r.createBlock(Jt,{key:0})):r.createCommentVNode("",!0),(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.listDisplay||Oy),r.normalizeProps(r.guardReactiveProps({listItemDisplay:t.listItemDisplay})),null,16)),(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.listPagination||mi))),(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.listFooter||Dy)))],64))}}},Zy={key:0},eb=["href"],tb={key:1},nb={class:"action-buttons"},ib=De({__name:"EntityListingSingleRecord",props:{item:Object,entityName:String,showAddButton:Boolean,showFilters:Boolean,className:String,listDisplay:String,listHeader:String,listClass:String,listItemClass:String,listFooter:String,listFilter:String,listPagination:String,displayField:String,baseUrl:String,hrefKey:String,listItemDisplay:String,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},editable:Boolean,deletable:Boolean,linkedEntity:Array},setup(t){const e=t;console.log("props entitylistsingle record",e.item);const n=r.inject("entityObject"),i=r.ref([]),s=r.ref(null),o=r.ref(null),a=r.ref(!1),l=r.ref(!1);r.onMounted(()=>{var h;e.linkedEntity&&e.linkedEntity.length>0?i.value=Object.keys(e.linkedEntity[0]).map(m=>({name:m})):i.value=n==null?void 0:n.getEntityColumns(n.state.data),s.value=((h=i==null?void 0:i.value)==null?void 0:h.find(m=>m.name===e.displayField))||null,s.value&&(o.value=e==null?void 0:e.item[s.value.name])});const c=()=>{a.value=!0},d=()=>{l.value=!0},u=async h=>{h.remove?f():a.value=!1},f=async()=>{const h=n.getPrimaryKeyColumn(n.state.data),m=e.item[h.name],p=await n.entityRecordDelete(n.state.data,m);if(p!=null&&p.success){a.value=!1;const g=await n.searchRecord(n.state.data,{sortBy:n.state.data.sortBy,sortDirection:n.state.data.sortDirection,pageSize:n.state.data.pageSize,currentPage:n.state.data.currentPage,columnList:null,filter:n.state.data.filters,fullTextSearch:n.state.data.fullTextSearch});g!=null&&g.response&&n.setEntity(g.response)}};return(h,m)=>{const p=r.resolveComponent("Button");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("ul",{class:r.normalizeClass(e.className)},[s.value?(r.openBlock(),r.createElementBlock("li",Zy,[r.createElementVNode("a",{href:`${t.baseUrl}/${t.item[t.hrefKey]}`,target:"_blank",class:"hover:underline"},r.toDisplayString(o.value),9,eb)])):(r.openBlock(),r.createElementBlock("li",tb,[r.createElementVNode("span",null,"No matching field found for '"+r.toDisplayString(o.value)+"'.",1)])),r.createElementVNode("li",nb,[t.editable?(r.openBlock(),r.createBlock(p,{key:0,onClick:m[0]||(m[0]=g=>d()),icon:"pi pi-pencil",severity:"success",rounded:"","aria-label":"Edit"})):r.createCommentVNode("",!0),t.deletable?(r.openBlock(),r.createBlock(p,{key:1,onClick:m[1]||(m[1]=g=>c()),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"})):r.createCommentVNode("",!0)])],2),l.value?(r.openBlock(),r.createBlock(hi,{key:0,showEntityForm:l.value,"onUpdate:showEntityForm":m[2]||(m[2]=g=>l.value=g),item:t.item},null,8,["showEntityForm","item"])):r.createCommentVNode("",!0),a.value?(r.openBlock(),r.createBlock(_s,{key:1,showDeleteDialog:a.value,"onUpdate:showDeleteDialog":m[3]||(m[3]=g=>a.value=g),onOnDeleteItem:u},null,8,["showDeleteDialog"])):r.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-ff32a72b"]]),sb={key:0,class:"error-message"},ob={class:"text-red-500 font-bold"},rb={key:0},ab={key:1},lb={key:2},cb={key:3},db={key:1},bl=De({__name:"EntityListing",props:{entityName:String,listClass:String,listItemClass:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,listItemDisplay:String,showAddButton:Boolean,showFilters:Boolean,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},displayField:String,baseUrl:String,hrefKey:String,editable:Boolean,deletable:Boolean,linkedEntity:Array},setup(t,{expose:e,emit:n}){const i=xs(),s=ot();r.provide("entityObject",i);const o=n,a=t,l=r.ref([]);return a.linkedEntity?r.watch(()=>a.linkedEntity,u=>{u&&(l.value=u,o("linkedEntityChanged",u))},{immediate:!0}):r.watch(()=>i.state.data,u=>{u&&(l.value=u.result,o("linkedEntityChanged",u.result))},{immediate:!0}),e({props:a,reload:()=>{console.log("reload data")},filter:u=>{console.log("filter data in unordered",u)}}),r.watch(()=>s.globalConfigs.appId,async u=>{if(u)if(a.linkedEntity&&a.linkedEntity.length>0)i.setEntity(a.linkedEntity);else{const f=await i.getEntity(a.entityName);i.setEntity(f.success?f.response:{result:[]})}},{immediate:!0}),(u,f)=>{var h,m,p;return r.openBlock(),r.createElementBlock("div",r.mergeProps(u.$attrs,{class:"flex flex-col"}),[r.renderSlot(u.$slots,"header",{},void 0,!0),u.$slots["list-item-display"]?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[t.showAddButton?(r.openBlock(),r.createBlock(Jt,{key:0})):r.createCommentVNode("",!0),t.showFilters?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.listFilter||Gt),{key:1})):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(t.listClass)},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.linkedEntity&&t.linkedEntity.length>0?t.linkedEntity:((p=(m=(h=r.unref(i))==null?void 0:h.state)==null?void 0:m.data)==null?void 0:p.result)||[],g=>r.renderSlot(u.$slots,"list-item-display",{item:g,class:r.normalizeClass(t.listItemClass)},void 0,!0)),256))],2),t.showPagination?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.listPagination||mi),{key:2})):r.createCommentVNode("",!0)],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[!t.displayField||!t.baseUrl||!t.hrefKey?(r.openBlock(),r.createElementBlock("div",sb,[r.createElementVNode("p",ob,[f[0]||(f[0]=r.createTextVNode(" Error: Missing required props - ")),t.entityName?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",rb,"Entity Name")),t.displayField?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",ab,"Display Field")),t.baseUrl?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",lb,"Base Url")),t.hrefKey?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",cb,"Href Key"))])])):(r.openBlock(),r.createElementBlock("div",db,[t.showFilters?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.listFilter||Gt),{key:0})):r.createCommentVNode("",!0),t.showAddButton?(r.openBlock(),r.createBlock(Jt,{key:1})):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,(g,y)=>(r.openBlock(),r.createElementBlock("div",{key:y},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.listItemDisplay!=null&&t.listItemDisplay!=""?t.listItemDisplay:ib),r.mergeProps({ref_for:!0},{item:g,...a}),null,16))]))),128)),t.showPagination?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.listPagination||mi),{key:2})):r.createCommentVNode("",!0)])),r.renderSlot(u.$slots,"footer",{},void 0,!0)],64)),r.renderSlot(u.$slots,"footer",{},void 0,!0)],16)}}},[["__scopeId","data-v-36faf954"]]),ub={class:"p-6 bg-white shadow-md rounded-lg border border-gray-300 flex flex-col"},fb={class:"flex justify-between items-start gap-4"},hb={class:"flex-grow"},mb={class:"flex flex-col gap-2"},pb={class:"font-bold text-gray-700"},gb={class:"text-gray-600"},yb={class:"flex flex-col gap-2"},bb=De({__name:"EntityListingTileSingleRecord",props:{item:Object,entityName:String,showAddButton:Boolean,showFilters:Boolean,className:String,listDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,listItemDisplay:String,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},editable:Boolean,deletable:Boolean},setup(t){const e=t,n=r.inject("entityObject"),i=r.ref([]),s=r.ref(null),o=r.ref(null),a=r.ref(!1),l=r.ref(!1);r.onMounted(()=>{i.value=n.getEntityColumns(n.state.data),s.value=i.value.find(h=>h.name===e.displayField)||null,s.value&&(o.value=e.item[s.value.name])});const c=()=>{a.value=!0},d=()=>{l.value=!0},u=async h=>{h.remove?f():a.value=!1},f=async()=>{const h=n.getPrimaryKeyColumn(n.state.data),m=e.item[h.name],p=await n.entityRecordDelete(n.state.data,m);if(p!=null&&p.success){a.value=!1;const g=await n.searchRecord(n.state.data,{sortBy:n.state.data.sortBy,sortDirection:n.state.data.sortDirection,pageSize:n.state.data.pageSize,currentPage:n.state.data.currentPage,columnList:null,filter:n.state.data.filters,fullTextSearch:n.state.data.fullTextSearch});g!=null&&g.response&&n.setEntity(g.response)}};return(h,m)=>{const p=r.resolveComponent("Button");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",ub,[r.createElementVNode("div",fb,[r.createElementVNode("div",hb,[r.createElementVNode("div",mb,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value,(g,y)=>(r.openBlock(),r.createElementBlock("div",{key:y,class:"flex flex-col"},[r.createElementVNode("span",pb,r.toDisplayString(g.displayName||g.name)+":",1),r.createElementVNode("span",gb,r.toDisplayString(t.item[g.name]),1)]))),128))])]),r.createElementVNode("div",yb,[t.editable?(r.openBlock(),r.createBlock(p,{key:0,onClick:m[0]||(m[0]=g=>d()),icon:"pi pi-pencil",severity:"success",rounded:"","aria-label":"Edit"})):r.createCommentVNode("",!0),t.deletable?(r.openBlock(),r.createBlock(p,{key:1,onClick:m[1]||(m[1]=g=>c()),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"})):r.createCommentVNode("",!0)])])]),l.value?(r.openBlock(),r.createBlock(hi,{key:0,showEntityForm:l.value,"onUpdate:showEntityForm":m[2]||(m[2]=g=>l.value=g),item:t.item},null,8,["showEntityForm","item"])):r.createCommentVNode("",!0),a.value?(r.openBlock(),r.createBlock(_s,{key:1,showDeleteDialog:a.value,"onUpdate:showDeleteDialog":m[3]||(m[3]=g=>a.value=g),onOnDeleteItem:u},null,8,["showDeleteDialog"])):r.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-6ec4735d"]]),xb={class:"flex flex-wrap gap-4 p-2"},_b={key:0,class:"error-message"},kb={class:"text-red-500 font-bold"},Sb={key:0},wb={key:1},Eb={class:"flex flex-wrap gap-4 p-4"},xl=De({__name:"EntityListingTile",props:{entityName:String,listDisplay:String,listItemDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,showAddButton:Boolean,showFilters:Boolean,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},editable:Boolean,deletable:Boolean,dynamicPropName:{type:String,default:"item"}},setup(t,{expose:e}){const n=xs(),i=ot();r.provide("entityObject",n);const s=t,o=r.ref([]);return r.watch(()=>n.state.data,c=>{c&&(o.value=c.result)},{immediate:!0}),e({props:s,reload:()=>{console.log("reload data")},filter:()=>{console.log("filter data in unordered")}}),r.watch(()=>i.globalConfigs.appId,async c=>{if(c){const d=await n.getEntity(s.entityName);n.setEntity(d.success?d.response:{result:[]})}},{immediate:!0}),(c,d)=>{var u,f,h;return r.openBlock(),r.createElementBlock("div",r.normalizeProps(r.guardReactiveProps(c.$attrs)),[c.$slots["list-item-display-tile"]?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.renderSlot(c.$slots,"header",{},void 0,!0),t.showAddButton?(r.openBlock(),r.createBlock(Jt,{key:0})):r.createCommentVNode("",!0),t.showFilters?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.listFilter||Gt),{key:1})):r.createCommentVNode("",!0),r.createElementVNode("div",xb,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(((h=(f=(u=r.unref(n))==null?void 0:u.state)==null?void 0:f.data)==null?void 0:h.result)||[],(m,p)=>(r.openBlock(),r.createElementBlock("div",{key:p,class:"flex flex-col p-6 border border-gray-300 shadow-md rounded-lg bg-white w-full sm:w-1/2 md:w-1/3 lg:w-1/4 xl:w-1/5 2xl:w-1/8"},[r.renderSlot(c.$slots,"list-item-display-tile",r.normalizeProps({[t.dynamicPropName||""]:m}),void 0,!0)]))),128))]),r.renderSlot(c.$slots,"footer",{},void 0,!0)],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.renderSlot(c.$slots,"header",{},void 0,!0),t.entityName?(r.openBlock(),r.createElementBlock("div",wb,[t.showFilters?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.listFilter||Gt),{key:0})):r.createCommentVNode("",!0),t.showAddButton?(r.openBlock(),r.createBlock(Jt,{key:1})):r.createCommentVNode("",!0),r.createElementVNode("div",Eb,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,(m,p)=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.listItemDisplay!=null&&t.listItemDisplay!=""?t.listItemDisplay:bb),r.mergeProps({key:p,ref_for:!0},{item:m,...s}),null,16))),128))]),t.showPagination?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.listPagination||mi),{key:2})):r.createCommentVNode("",!0)])):(r.openBlock(),r.createElementBlock("div",_b,[r.createElementVNode("p",kb,[d[0]||(d[0]=r.createTextVNode(" Error: Missing required props - ")),t.entityName?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",Sb,"Entity Name"))])])),r.renderSlot(c.$slots,"footer",{},void 0,!0)],64))],16)}}},[["__scopeId","data-v-705f9c5c"]]),Cb={class:"p-6 bg-white shadow-md rounded-lg border border-gray-300 flex flex-col responsive-box"},Ob={class:"flex justify-between items-start gap-4"},vb={class:"flex-grow"},Nb={class:"flex flex-col gap-2"},Db={class:"font-bold text-gray-700"},Tb={class:"text-gray-600"},Bb={class:"flex flex-col gap-2"},Pb=De({__name:"EntityListingCarouselSingleRecord",props:{item:Object,entityName:String,showAddButton:Boolean,showFilters:Boolean,className:String,listDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,listItemDisplay:String,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},editable:Boolean,deletable:Boolean},setup(t){const e=t,n=r.inject("entityObject"),i=r.ref([]),s=r.ref(null),o=r.ref(null),a=r.ref(!1),l=r.ref(!1);r.onMounted(()=>{i.value=n.getEntityColumns(n.state.data),s.value=i.value.find(h=>h.name===e.displayField)||null,s.value&&(o.value=e.item[s.value.name])});const c=()=>{a.value=!0},d=()=>{l.value=!0},u=async h=>{h.remove?f():a.value=!1},f=async()=>{const h=n.getPrimaryKeyColumn(n.state.data),m=e.item[h.name],p=await n.entityRecordDelete(n.state.data,m);if(p!=null&&p.success){a.value=!1;const g=await n.searchRecord(n.state.data,{sortBy:n.state.data.sortBy,sortDirection:n.state.data.sortDirection,pageSize:n.state.data.pageSize,currentPage:n.state.data.currentPage,columnList:null,filter:n.state.data.filters,fullTextSearch:n.state.data.fullTextSearch});g!=null&&g.response&&n.setEntity(g.response)}};return(h,m)=>{const p=r.resolveComponent("Button");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",Cb,[r.createElementVNode("div",Ob,[r.createElementVNode("div",vb,[r.createElementVNode("div",Nb,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value,(g,y)=>(r.openBlock(),r.createElementBlock("div",{key:y,class:"flex flex-col"},[r.createElementVNode("span",Db,r.toDisplayString(g.displayName||g.name)+":",1),r.createElementVNode("span",Tb,r.toDisplayString(t.item[g.name]),1)]))),128))])]),r.createElementVNode("div",Bb,[t.editable?(r.openBlock(),r.createBlock(p,{key:0,onClick:m[0]||(m[0]=g=>d()),icon:"pi pi-pencil",severity:"success",rounded:"","aria-label":"Edit"})):r.createCommentVNode("",!0),t.deletable?(r.openBlock(),r.createBlock(p,{key:1,onClick:m[1]||(m[1]=g=>c()),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"})):r.createCommentVNode("",!0)])])]),l.value?(r.openBlock(),r.createBlock(hi,{key:0,showEntityForm:l.value,"onUpdate:showEntityForm":m[2]||(m[2]=g=>l.value=g),item:t.item},null,8,["showEntityForm","item"])):r.createCommentVNode("",!0),a.value?(r.openBlock(),r.createBlock(_s,{key:1,showDeleteDialog:a.value,"onUpdate:showDeleteDialog":m[3]||(m[3]=g=>a.value=g),onOnDeleteItem:u},null,8,["showDeleteDialog"])):r.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-7e37c710"]]);/**
156
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sl(t,e){if(t){if(typeof t=="string")return ol(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ol(t,e):void 0}}function ol(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function Hm(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var i,s,o,a,l=[],c=!0,d=!1;try{if(o=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(i=o.call(n)).done)&&(l.push(i.value),l.length!==e);c=!0);}catch(u){d=!0,s=u}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(d)throw s}}return l}}function rl(t){if(Array.isArray(t))return t}function al(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,i)}return n}function ce(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?al(Object(n),!0).forEach(function(i){ci(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):al(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function ci(t,e,n){return(e=qm(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qm(t){var e=Ym(t,"string");return ai(e)=="symbol"?e:e+""}function Ym(t,e){if(ai(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(ai(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Km={name:"BaseComponent",props:{pt:{type:Object,default:void 0},ptOptions:{type:Object,default:void 0},unstyled:{type:Boolean,default:void 0},dt:{type:Object,default:void 0}},inject:{$parentInstance:{default:void 0}},watch:{isUnstyled:{immediate:!0,handler:function(e){e||(this._loadCoreStyles(),this._themeChangeListener(this._loadCoreStyles))}},dt:{immediate:!0,handler:function(e){var n=this;e?(this._loadScopedThemeStyles(e),this._themeChangeListener(function(){return n._loadScopedThemeStyles(e)})):this._unloadScopedThemeStyles()}}},scopedStyleEl:void 0,rootEl:void 0,$attrSelector:void 0,beforeCreate:function(){var e,n,i,s,o,a,l,c,d,u,f,h=(e=this.pt)===null||e===void 0?void 0:e._usept,m=h?(n=this.pt)===null||n===void 0||(n=n.originalValue)===null||n===void 0?void 0:n[this.$.type.name]:void 0,p=h?(i=this.pt)===null||i===void 0||(i=i.value)===null||i===void 0?void 0:i[this.$.type.name]:this.pt;(s=p||m)===null||s===void 0||(s=s.hooks)===null||s===void 0||(o=s.onBeforeCreate)===null||o===void 0||o.call(s);var g=(a=this.$primevueConfig)===null||a===void 0||(a=a.pt)===null||a===void 0?void 0:a._usept,y=g?(l=this.$primevue)===null||l===void 0||(l=l.config)===null||l===void 0||(l=l.pt)===null||l===void 0?void 0:l.originalValue:void 0,b=g?(c=this.$primevue)===null||c===void 0||(c=c.config)===null||c===void 0||(c=c.pt)===null||c===void 0?void 0:c.value:(d=this.$primevue)===null||d===void 0||(d=d.config)===null||d===void 0?void 0:d.pt;(u=b||y)===null||u===void 0||(u=u[this.$.type.name])===null||u===void 0||(u=u.hooks)===null||u===void 0||(f=u.onBeforeCreate)===null||f===void 0||f.call(u),this.$attrSelector=Cm("pc")},created:function(){this._hook("onCreated")},beforeMount:function(){this.rootEl=km(this.$el,'[data-pc-name="'.concat(Kt(this.$.type.name),'"]')),this.rootEl&&(this.$attrSelector&&!this.rootEl.hasAttribute(this.$attrSelector)&&this.rootEl.setAttribute(this.$attrSelector,""),this.rootEl.$pc=ce({name:this.$.type.name,attrSelector:this.$attrSelector},this.$params)),this._loadStyles(),this._hook("onBeforeMount")},mounted:function(){this._hook("onMounted")},beforeUpdate:function(){this._hook("onBeforeUpdate")},updated:function(){this._hook("onUpdated")},beforeUnmount:function(){this._hook("onBeforeUnmount")},unmounted:function(){this._unloadScopedThemeStyles(),this._hook("onUnmounted")},methods:{_hook:function(e){if(!this.$options.hostName){var n=this._usePT(this._getPT(this.pt,this.$.type.name),this._getOptionValue,"hooks.".concat(e)),i=this._useDefaultPT(this._getOptionValue,"hooks.".concat(e));n==null||n(),i==null||i()}},_mergeProps:function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];return Ia(e)?e.apply(void 0,i):r.mergeProps.apply(void 0,i)},_loadStyles:function(){var e=this,n=function(){si.isStyleNameLoaded("base")||(Rt.loadCSS(e.$styleOptions),e._loadGlobalStyles(),si.setLoadedStyleName("base")),e._loadThemeStyles()};n(),this._themeChangeListener(n)},_loadCoreStyles:function(){var e,n;!si.isStyleNameLoaded((e=this.$style)===null||e===void 0?void 0:e.name)&&(n=this.$style)!==null&&n!==void 0&&n.name&&(nl.loadCSS(this.$styleOptions),this.$options.style&&this.$style.loadCSS(this.$styleOptions),si.setLoadedStyleName(this.$style.name))},_loadGlobalStyles:function(){var e=this._useGlobalPT(this._getOptionValue,"global.css",this.$params);Ce(e)&&Rt.load(e,ce({name:"global"},this.$styleOptions))},_loadThemeStyles:function(){var e,n;if(!(this.isUnstyled||this.$theme==="none")){if(!Re.isStyleNameLoaded("common")){var i,s,o=((i=this.$style)===null||i===void 0||(s=i.getCommonTheme)===null||s===void 0?void 0:s.call(i))||{},a=o.primitive,l=o.semantic,c=o.global,d=o.style;Rt.load(a==null?void 0:a.css,ce({name:"primitive-variables"},this.$styleOptions)),Rt.load(l==null?void 0:l.css,ce({name:"semantic-variables"},this.$styleOptions)),Rt.load(c==null?void 0:c.css,ce({name:"global-variables"},this.$styleOptions)),Rt.loadTheme(ce({name:"global-style"},this.$styleOptions),d),Re.setLoadedStyleName("common")}if(!Re.isStyleNameLoaded((e=this.$style)===null||e===void 0?void 0:e.name)&&(n=this.$style)!==null&&n!==void 0&&n.name){var u,f,h,m,p=((u=this.$style)===null||u===void 0||(f=u.getComponentTheme)===null||f===void 0?void 0:f.call(u))||{},g=p.css,y=p.style;(h=this.$style)===null||h===void 0||h.load(g,ce({name:"".concat(this.$style.name,"-variables")},this.$styleOptions)),(m=this.$style)===null||m===void 0||m.loadTheme(ce({name:"".concat(this.$style.name,"-style")},this.$styleOptions),y),Re.setLoadedStyleName(this.$style.name)}if(!Re.isStyleNameLoaded("layer-order")){var b,x,w=(b=this.$style)===null||b===void 0||(x=b.getLayerOrderThemeCSS)===null||x===void 0?void 0:x.call(b);Rt.load(w,ce({name:"layer-order",first:!0},this.$styleOptions)),Re.setLoadedStyleName("layer-order")}}},_loadScopedThemeStyles:function(e){var n,i,s,o=((n=this.$style)===null||n===void 0||(i=n.getPresetTheme)===null||i===void 0?void 0:i.call(n,e,"[".concat(this.$attrSelector,"]")))||{},a=o.css,l=(s=this.$style)===null||s===void 0?void 0:s.load(a,ce({name:"".concat(this.$attrSelector,"-").concat(this.$style.name)},this.$styleOptions));this.scopedStyleEl=l.el},_unloadScopedThemeStyles:function(){var e;(e=this.scopedStyleEl)===null||e===void 0||(e=e.value)===null||e===void 0||e.remove()},_themeChangeListener:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){};si.clearLoadedStyleNames(),Xt.on("theme:change",e)},_getHostInstance:function(e){return e?this.$options.hostName?e.$.type.name===this.$options.hostName?e:this._getHostInstance(e.$parentInstance):e.$parentInstance:void 0},_getPropValue:function(e){var n;return this[e]||((n=this._getHostInstance(this))===null||n===void 0?void 0:n[e])},_getOptionValue:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return ja(e,n,i)},_getPTValue:function(){var e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=/./g.test(i)&&!!s[i.split(".")[0]],l=this._getPropValue("ptOptions")||((e=this.$primevueConfig)===null||e===void 0?void 0:e.ptOptions)||{},c=l.mergeSections,d=c===void 0?!0:c,u=l.mergeProps,f=u===void 0?!1:u,h=o?a?this._useGlobalPT(this._getPTClassValue,i,s):this._useDefaultPT(this._getPTClassValue,i,s):void 0,m=a?void 0:this._getPTSelf(n,this._getPTClassValue,i,ce(ce({},s),{},{global:h||{}})),p=this._getPTDatasets(i);return d||!d&&m?f?this._mergeProps(f,h,m,p):ce(ce(ce({},h),m),p):ce(ce({},m),p)},_getPTSelf:function(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];return r.mergeProps(this._usePT.apply(this,[this._getPT(e,this.$name)].concat(i)),this._usePT.apply(this,[this.$_attrsPT].concat(i)))},_getPTDatasets:function(){var e,n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",s="data-pc-",o=i==="root"&&Ce((e=this.pt)===null||e===void 0?void 0:e["data-pc-section"]);return i!=="transition"&&ce(ce({},i==="root"&&ce(ce(ci({},"".concat(s,"name"),Kt(o?(n=this.pt)===null||n===void 0?void 0:n["data-pc-section"]:this.$.type.name)),o&&ci({},"".concat(s,"extend"),Kt(this.$.type.name))),Ga()&&ci({},"".concat(this.$attrSelector),""))),{},ci({},"".concat(s,"section"),Kt(i)))},_getPTClassValue:function(){var e=this._getOptionValue.apply(this,arguments);return wt(e)||Mo(e)?{class:e}:e},_getPT:function(e){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=arguments.length>2?arguments[2]:void 0,o=function(l){var c,d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,u=s?s(l):l,f=Kt(i),h=Kt(n.$name);return(c=d?f!==h?u==null?void 0:u[f]:void 0:u==null?void 0:u[f])!==null&&c!==void 0?c:u};return e!=null&&e.hasOwnProperty("_usept")?{_usept:e._usept,originalValue:o(e.originalValue),value:o(e.value)}:o(e,!0)},_usePT:function(e,n,i,s){var o=function(g){return n(g,i,s)};if(e!=null&&e.hasOwnProperty("_usept")){var a,l=e._usept||((a=this.$primevueConfig)===null||a===void 0?void 0:a.ptOptions)||{},c=l.mergeSections,d=c===void 0?!0:c,u=l.mergeProps,f=u===void 0?!1:u,h=o(e.originalValue),m=o(e.value);return h===void 0&&m===void 0?void 0:wt(m)?m:wt(h)?h:d||!d&&m?f?this._mergeProps(f,h,m):ce(ce({},h),m):m}return o(e)},_useGlobalPT:function(e,n,i){return this._usePT(this.globalPT,e,n,i)},_useDefaultPT:function(e,n,i){return this._usePT(this.defaultPT,e,n,i)},ptm:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this._getPTValue(this.pt,e,ce(ce({},this.$params),n))},ptmi:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return r.mergeProps(this.$_attrsWithoutPT,this.ptm(e,n))},ptmo:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this._getPTValue(e,n,ce({instance:this},i),!1)},cx:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.isUnstyled?void 0:this._getOptionValue(this.$style.classes,e,ce(ce({},this.$params),n))},sx:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(n){var s=this._getOptionValue(this.$style.inlineStyles,e,ce(ce({},this.$params),i)),o=this._getOptionValue(nl.inlineStyles,e,ce(ce({},this.$params),i));return[o,s]}}},computed:{globalPT:function(){var e,n=this;return this._getPT((e=this.$primevueConfig)===null||e===void 0?void 0:e.pt,void 0,function(i){return ft(i,{instance:n})})},defaultPT:function(){var e,n=this;return this._getPT((e=this.$primevueConfig)===null||e===void 0?void 0:e.pt,void 0,function(i){return n._getOptionValue(i,n.$name,ce({},n.$params))||ft(i,ce({},n.$params))})},isUnstyled:function(){var e;return this.unstyled!==void 0?this.unstyled:(e=this.$primevueConfig)===null||e===void 0?void 0:e.unstyled},$inProps:function(){var e,n=Object.keys(((e=this.$.vnode)===null||e===void 0?void 0:e.props)||{});return Object.fromEntries(Object.entries(this.$props).filter(function(i){var s=li(i,1),o=s[0];return n==null?void 0:n.includes(o)}))},$theme:function(){var e;return(e=this.$primevueConfig)===null||e===void 0?void 0:e.theme},$style:function(){return ce(ce({classes:void 0,inlineStyles:void 0,load:function(){},loadCSS:function(){},loadTheme:function(){}},(this._getHostInstance(this)||{}).$style),this.$options.style)},$styleOptions:function(){var e;return{nonce:(e=this.$primevueConfig)===null||e===void 0||(e=e.csp)===null||e===void 0?void 0:e.nonce}},$primevueConfig:function(){var e;return(e=this.$primevue)===null||e===void 0?void 0:e.config},$name:function(){return this.$options.hostName||this.$.type.name},$params:function(){var e=this._getHostInstance(this)||this.$parent;return{instance:this,props:this.$props,state:this.$data,attrs:this.$attrs,parent:{instance:e,props:e==null?void 0:e.$props,state:e==null?void 0:e.$data,attrs:e==null?void 0:e.$attrs}}},$_attrsPT:function(){return Object.entries(this.$attrs||{}).filter(function(e){var n=li(e,1),i=n[0];return i==null?void 0:i.startsWith("pt:")}).reduce(function(e,n){var i=li(n,2),s=i[0],o=i[1],a=s.split(":"),l=Um(a),c=l.slice(1);return c==null||c.reduce(function(d,u,f,h){return!d[u]&&(d[u]=f===h.length-1?o:{}),d[u]},e),e},{})},$_attrsWithoutPT:function(){return Object.entries(this.$attrs||{}).filter(function(e){var n=li(e,1),i=n[0];return!(i!=null&&i.startsWith("pt:"))}).reduce(function(e,n){var i=li(n,2),s=i[0],o=i[1];return e[s]=o,e},{})}}},Xm={root:{position:"relative"}},Gm={root:"p-chart"},Jm=Rt.extend({name:"chart",classes:Gm,inlineStyles:Xm}),Qm={name:"BaseChart",extends:Km,props:{type:String,data:null,options:null,plugins:null,width:{type:Number,default:300},height:{type:Number,default:150},canvasProps:{type:null,default:null}},style:Jm,provide:function(){return{$pcChart:this,$parentInstance:this}}},ll={name:"Chart",extends:Qm,inheritAttrs:!1,emits:["select","loaded"],chart:null,watch:{data:{handler:function(){this.reinit()},deep:!0},type:function(){this.reinit()},options:function(){this.reinit()}},mounted:function(){this.initChart()},beforeUnmount:function(){this.chart&&(this.chart.destroy(),this.chart=null)},methods:{initChart:function(){var e=this;Promise.resolve().then(()=>e1).then(function(n){e.chart&&(e.chart.destroy(),e.chart=null),n&&n.default&&(e.chart=new n.default(e.$refs.canvas,{type:e.type,data:e.data,options:e.options,plugins:e.plugins})),e.$emit("loaded",e.chart)})},getCanvas:function(){return this.$canvas},getChart:function(){return this.chart},getBase64Image:function(){return this.chart.toBase64Image()},refresh:function(){this.chart&&this.chart.update()},reinit:function(){this.initChart()},onCanvasClick:function(e){if(this.chart){var n=this.chart.getElementsAtEventForMode(e,"nearest",{intersect:!0},!1),i=this.chart.getElementsAtEventForMode(e,"dataset",{intersect:!0},!1);n&&n[0]&&i&&this.$emit("select",{originalEvent:e,element:n[0],dataset:i})}},generateLegend:function(){if(this.chart)return this.chart.generateLegend()}}};function di(t){"@babel/helpers - typeof";return di=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},di(t)}function cl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,i)}return n}function dl(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?cl(Object(n),!0).forEach(function(i){Zm(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):cl(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function Zm(t,e,n){return(e=ep(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ep(t){var e=tp(t,"string");return di(e)=="symbol"?e:e+""}function tp(t,e){if(di(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(di(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var np=["width","height"];function ip(t,e,n,i,s,o){return r.openBlock(),r.createElementBlock("div",r.mergeProps({class:t.cx("root"),style:t.sx("root")},t.ptmi("root")),[r.createElementVNode("canvas",r.mergeProps({ref:"canvas",width:t.width,height:t.height,onClick:e[0]||(e[0]=function(a){return o.onCanvasClick(a)})},dl(dl({},t.canvasProps),t.ptm("canvas"))),null,16,np)],16)}ll.render=ip;function sp(){const t={primary:"#0efcf1",primaryBorder:"#388E3C",secondary:"#0ec6fc",secondaryBorder:"#FBC02D",tertiary:"#f1fc0e",tertiaryBorder:"#FFA000"},e=["linear","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInBounce","easeOutBounce","easeInOutBounce","easeInOutElastic"],n=r.ref("easeInOutElastic"),i=r.computed(()=>({responsive:!0,maintainAspectRatio:!0,plugins:{legend:{position:"top",labels:{font:{size:16}}},tooltip:{enabled:!0,titleFont:{size:14},bodyFont:{size:12}},zoom:{zoom:{wheel:{enabled:!0},drag:{enabled:!0},mode:"xy"},pan:{enabled:!0,mode:"xy"}}},scales:{x:{grid:{display:!1},ticks:{font:{size:14}}},y:{grid:{display:!0,color:"#e0e0e0"},ticks:{font:{size:14}}}},animation:{duration:2e3,easing:n.value,delay:500,loop:!1,animateRotate:!0,animateScale:!0},elements:{point:{radius:6,hoverRadius:10,backgroundColor:t.secondary},line:{tension:.4,borderWidth:2},bar:{borderWidth:2,borderRadius:4}}}));return{colorConfig:t,animationOptions:e,selectedAnimation:n,defaultChartOptions:i}}const op={components:{Chart:ll},props:{type:{type:String,required:!0},chartData:{type:Object,required:!0},chartOptions:{type:Object,default:()=>({})}},setup(t){const{colorConfig:e,defaultChartOptions:n}=sp(),i=r.computed(()=>{const o=t.chartData.datasets.map((a,l)=>{const c=Object.values(e);return{...a,backgroundColor:c[l%c.length],borderColor:c[l%c.length+1]}});return{...t.chartData,datasets:o}}),s=r.computed(()=>({...n.value,maintainAspectRatio:!0,...t.chartOptions}));return{computedChartData:i,computedChartOptions:s}}},rp={class:"chart-container"},ap={key:0},lp={key:1};function cp(t,e,n,i,s,o){const a=r.resolveComponent("Chart",!0);return r.openBlock(),r.createElementBlock("div",rp,[n.chartData?(r.openBlock(),r.createElementBlock("div",ap,[r.createVNode(a,{type:n.type,data:i.computedChartData,options:i.computedChartOptions},null,8,["type","data","options"])])):(r.openBlock(),r.createElementBlock("div",lp,e[0]||(e[0]=[r.createElementVNode("p",null,"No data available for the chart.",-1)])))])}const ui=De(op,[["render",cp],["__scopeId","data-v-8e3e786b"]]);function fi(){const t=r.ref(null),e=r.ref(!1),n=r.ref(null);return{chartData:t,fetchChartData:async({entityName:s,xaxis:o=null,yaxis:a=null})=>{e.value=!0,n.value=null;const l="https://mocki.io/v1/1ab17035-c115-4049-8ebf-a1e1b92d739a";try{const d=await(await fetch(l)).json();if(!d||!d.response||!d.response.result)throw new Error("Invalid data structure from API.");const u=d.response.result;if(!o&&!a){const f=Object.keys(u[0]);o=f[1],a=f.slice(4);const h=u.reduce((g,y)=>(a.forEach(b=>{g[b]||(g[b]=0),g[b]+=y[b]||0}),g),{}),m=Object.keys(h),p=Object.values(h);t.value={labels:m,datasets:[{label:"Default Data",data:p,borderWidth:1}]}}else{const f=u.map(p=>p[o]),m=(Array.isArray(a)?a:[a]).map(p=>({label:p,data:u.map(g=>g[p]||0),borderWidth:1}));t.value={labels:f,datasets:m}}}catch(c){n.value=c.message,t.value=null}finally{e.value=!1}},loading:e,error:n}}const dp={components:{chart:ui},props:{entityName:{type:String,required:!0},title:{type:String,default:"Bar Chart"},yaxis:{type:String,required:!0},xaxis:{type:String,required:!0}},setup(t){const{chartData:e,fetchChartData:n,loading:i,error:s}=fi(),o=r.ref({responsive:!0,plugins:{legend:{position:"top"},tooltip:{callbacks:{label:function(l){return`${l.dataset.label}: ${l.raw}`}}}}}),a=async()=>{if(!t.yaxis||!t.xaxis){console.error("xaxis or yaxis is not defined."),s.value="x-axis or y-axis is not properly configured.";return}await n({entityName:t.entityName,yaxis:t.yaxis,xaxis:t.xaxis})};return r.onMounted(()=>{console.log("Fetching data for yAxis:",t.yaxis),console.log("Fetching data for xAxis:",t.xaxis),a()}),{chartData:e,chartOptions:o,loading:i,error:s}}},up={key:0,class:"chart-container"},fp={key:1},hp={key:0},mp={key:1},pp={key:2};function gp(t,e,n,i,s,o){const a=r.resolveComponent("chart");return r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",null,[r.createElementVNode("h2",null,"Entity name: "+r.toDisplayString(n.entityName),1)]),i.chartData?(r.openBlock(),r.createElementBlock("div",up,[r.createElementVNode("h3",null,r.toDisplayString(n.title)+" , x-axis : "+r.toDisplayString(n.xaxis)+" , y-axis : "+r.toDisplayString(n.yaxis),1),r.createVNode(a,{type:"bar",chartData:i.chartData,chartOptions:i.chartOptions},null,8,["chartData","chartOptions"])])):(r.openBlock(),r.createElementBlock("div",fp,[i.loading?(r.openBlock(),r.createElementBlock("p",hp,"Loading chart data...")):i.error?(r.openBlock(),r.createElementBlock("p",mp,r.toDisplayString(i.error),1)):(r.openBlock(),r.createElementBlock("p",pp,"No data available for the chart."))]))])}const ul=De(dp,[["render",gp],["__scopeId","data-v-67577a46"]]),yp={components:{chart:ui},props:{entityName:{type:String,required:!0},title:{type:String,default:"Bar Chart"},yaxis:{type:String,required:!0},xaxis:{type:String,required:!0}},setup(t){const{chartData:e,fetchChartData:n,loading:i,error:s}=fi(),o=r.ref({responsive:!0,plugins:{legend:{position:"top"},tooltip:{callbacks:{label:function(l){return`${l.dataset.label}: ${l.raw}`}}}}}),a=async()=>{if(!t.yaxis||!t.xaxis){console.error("xaxis or yaxis is not defined."),s.value="x-axis or y-axis is not properly configured.";return}await n({entityName:t.entityName,yaxis:t.yaxis,xaxis:t.xaxis})};return r.onMounted(()=>{console.log("Fetching data for yAxis:",t.yaxis),console.log("Fetching data for xAxis:",t.xaxis),a()}),{chartData:e,chartOptions:o,loading:i,error:s}}},bp={key:0,class:"chart-container"},xp={key:1},_p={key:0},kp={key:1},Sp={key:2};function wp(t,e,n,i,s,o){const a=r.resolveComponent("chart");return r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",null,[r.createElementVNode("h2",null,"Entity name: "+r.toDisplayString(n.entityName),1)]),i.chartData?(r.openBlock(),r.createElementBlock("div",bp,[r.createElementVNode("h3",null,r.toDisplayString(n.title)+" , x-axis : "+r.toDisplayString(n.xaxis)+" , y-axis : "+r.toDisplayString(n.yaxis),1),r.createVNode(a,{type:"line",chartData:i.chartData,chartOptions:i.chartOptions},null,8,["chartData","chartOptions"])])):(r.openBlock(),r.createElementBlock("div",xp,[i.loading?(r.openBlock(),r.createElementBlock("p",_p,"Loading chart data...")):i.error?(r.openBlock(),r.createElementBlock("p",kp,r.toDisplayString(i.error),1)):(r.openBlock(),r.createElementBlock("p",Sp,"No data available for the chart."))]))])}const fl=De(yp,[["render",wp],["__scopeId","data-v-2cfe3d4d"]]),Ep={components:{chart:ui},props:{entityName:{type:String,required:!0},title:{type:String,default:"Pie Chart"},yaxis:{type:String,default:null},xaxis:{type:String,default:null}},setup(t){const{chartData:e,fetchChartData:n,loading:i,error:s}=fi(),o=r.ref({responsive:!0,plugins:{legend:{position:"top"},tooltip:{callbacks:{label:function(l){return`${l.label}: ${l.raw}`}}}}}),a=async()=>{await n({entityName:t.entityName,xaxis:t.xaxis,yaxis:t.yaxis})};return r.onMounted(()=>{a()}),{chartData:e,chartOptions:o,loading:i,error:s}}},Cp={key:0,class:"chart-container"},Op={key:1},vp={key:0},Np={key:1},Dp={key:2};function Tp(t,e,n,i,s,o){const a=r.resolveComponent("chart");return r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",null,[r.createElementVNode("h2",null,"Entity name: "+r.toDisplayString(n.entityName),1)]),i.chartData?(r.openBlock(),r.createElementBlock("div",Cp,[r.createElementVNode("h3",null,r.toDisplayString(n.title),1),r.createVNode(a,{type:"pie",chartData:i.chartData,chartOptions:i.chartOptions},null,8,["chartData","chartOptions"])])):(r.openBlock(),r.createElementBlock("div",Op,[i.loading?(r.openBlock(),r.createElementBlock("p",vp,"Loading chart data...")):i.error?(r.openBlock(),r.createElementBlock("p",Np,r.toDisplayString(i.error),1)):(r.openBlock(),r.createElementBlock("p",Dp,"No data available for the chart."))]))])}const hl=De(Ep,[["render",Tp],["__scopeId","data-v-27f5ea01"]]),Bp={components:{chart:ui},props:{entityName:{type:String,required:!0},title:{type:String,default:"Pie Chart"},yaxis:{type:String,default:null},xaxis:{type:String,default:null}},setup(t){const{chartData:e,fetchChartData:n,loading:i,error:s}=fi(),o=r.ref({responsive:!0,plugins:{legend:{position:"top"},tooltip:{callbacks:{label:function(l){return`${l.label}: ${l.raw}`}}}}}),a=async()=>{await n({entityName:t.entityName,xaxis:t.xaxis,yaxis:t.yaxis})};return r.onMounted(()=>{a()}),{chartData:e,chartOptions:o,loading:i,error:s}}},Pp={key:0,class:"chart-container"},Ap={key:1},Mp={key:0},Vp={key:1},Rp={key:2};function Fp(t,e,n,i,s,o){const a=r.resolveComponent("chart");return r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",null,[r.createElementVNode("h2",null,"Entity name: "+r.toDisplayString(n.entityName),1)]),i.chartData?(r.openBlock(),r.createElementBlock("div",Pp,[r.createElementVNode("h3",null,r.toDisplayString(n.title),1),r.createVNode(a,{type:"polarArea",chartData:i.chartData,chartOptions:i.chartOptions},null,8,["chartData","chartOptions"])])):(r.openBlock(),r.createElementBlock("div",Ap,[i.loading?(r.openBlock(),r.createElementBlock("p",Mp,"Loading chart data...")):i.error?(r.openBlock(),r.createElementBlock("p",Vp,r.toDisplayString(i.error),1)):(r.openBlock(),r.createElementBlock("p",Rp,"No data available for the chart."))]))])}const ml=De(Bp,[["render",Fp],["__scopeId","data-v-941f0d0a"]]),$p={components:{chart:ui},props:{entityName:{type:String,required:!0},title:{type:String,default:"Bar Chart"},yaxis:{type:String,required:!0},xaxis:{type:String,required:!0}},setup(t){const{chartData:e,fetchChartData:n,loading:i,error:s}=fi(),o=r.ref({responsive:!0,plugins:{legend:{position:"top"},tooltip:{callbacks:{label:function(l){return`${l.dataset.label}: ${l.raw}`}}}}}),a=async()=>{if(!t.yaxis||!t.xaxis){console.error("xaxis or yaxis is not defined."),s.value="x-axis or y-axis is not properly configured.";return}await n({entityName:t.entityName,yaxis:t.yaxis,xaxis:t.xaxis})};return r.onMounted(()=>{console.log("Fetching data for yAxis:",t.yaxis),console.log("Fetching data for xAxis:",t.xaxis),a()}),{chartData:e,chartOptions:o,loading:i,error:s}}},Lp={key:0,class:"chart-container"},Ip={key:1},jp={key:0},zp={key:1},Up={key:2};function Wp(t,e,n,i,s,o){const a=r.resolveComponent("chart");return r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",null,[r.createElementVNode("h2",null,"Entity name: "+r.toDisplayString(n.entityName),1)]),i.chartData?(r.openBlock(),r.createElementBlock("div",Lp,[r.createElementVNode("h3",null,r.toDisplayString(n.title)+" , x-axis : "+r.toDisplayString(n.xaxis)+" , y-axis : "+r.toDisplayString(n.yaxis),1),r.createVNode(a,{type:"radar",chartData:i.chartData,chartOptions:i.chartOptions},null,8,["chartData","chartOptions"])])):(r.openBlock(),r.createElementBlock("div",Ip,[i.loading?(r.openBlock(),r.createElementBlock("p",jp,"Loading chart data...")):i.error?(r.openBlock(),r.createElementBlock("p",zp,r.toDisplayString(i.error),1)):(r.openBlock(),r.createElementBlock("p",Up,"No data available for the chart."))]))])}const pl=De($p,[["render",Wp],["__scopeId","data-v-80750171"]]),Hp={class:"flex flex-col p-3"},qp={class:"flex justify-center flex-row mb-2 cursor-pointer"},Yp={style:{"word-break":"break-all"}},Kp={__name:"LinkEntityContent",props:{linkEntityListItem:{type:Object,required:!0}},setup(t){Ye.useRoute();const e=ot(),n=r.ref("");e.getAppId()!=null&&e.getAppId()!=""&&(n.value=e.getAppId());const i=r.ref(),s=r.ref(!1),o=r.ref(!1),a=r.ref({}),l=r.ref([{label:"Remove association",icon:"",command:f=>{c()}}]),c=()=>{console.log(a.value),console.log("Function is calling")},d=(f,h)=>{a.value=h,i.value.show(f),o.value=!0},u=()=>{a.value={},o.value=!1};return(f,h)=>{const m=r.resolveComponent("Button"),p=r.resolveComponent("ContextMenu"),g=r.resolveComponent("router-link");return r.openBlock(),r.createElementBlock("div",{onMouseenter:h[4]||(h[4]=r.withModifiers(y=>s.value=!0,["prevent"])),onMouseleave:h[5]||(h[5]=r.withModifiers(y=>s.value=!1,["prevent"])),class:"flex relative m-3",style:{border:"1px solid var(--surface-border)","border-radius":"5px"}},[r.withDirectives(r.createVNode(m,{onClick:h[0]||(h[0]=y=>d(y,t.linkEntityListItem)),class:"!absolute right-0",size:"small",style:{width:"55px",height:"25px","border-radius":"5px","font-size":"12px"}},{default:r.withCtx(()=>h[6]||(h[6]=[r.createTextVNode(" More")])),_:1},512),[[r.vShow,s.value||o.value]]),r.createVNode(p,{ref_key:"menu",ref:i,model:l.value,onMouseenter:h[1]||(h[1]=r.withModifiers(y=>s.value=!0,["prevent"])),onMouseleave:h[2]||(h[2]=r.withModifiers(y=>s.value=!1,["prevent"])),onHide:h[3]||(h[3]=y=>u())},null,8,["model"]),r.createElementVNode("div",Hp,[r.createElementVNode("div",qp,[r.createElementVNode("div",Yp,r.toDisplayString(t.linkEntityListItem.entityName),1),r.createVNode(g,{to:{name:"entity360view",params:{entityName:t.linkEntityListItem.entityName,id:t.linkEntityListItem.id,appId:n.value}},target:"_blank"},{default:r.withCtx(()=>h[7]||(h[7]=[r.createElementVNode("div",{class:"pi pi-external-link ml-3"},null,-1)])),_:1},8,["to"])]),r.createElementVNode("div",null,"Id: "+r.toDisplayString(t.linkEntityListItem.id),1)])],32)}}},Xp={class:"flex flex-col mt-3"},Gp={class:"flex flex-row items-center"},Jp={class:"flex items-center justify-center mt-5"},Qp={key:0,class:"pi pi-caret-right"},Zp={key:1,class:"pi pi-caret-down"},eg={key:0},tg={class:"flex flex-col mt-5"},ng={class:"col-12"},ig={class:"flex flex-col mt-5"},sg={class:"col-12 font-bold"},og={key:0},rg={class:"flex flex-col mt-5"},ag={class:"col-12"},lg={class:"flex flex-col mt-5"},cg={class:"col-12"},dg={class:"flex flex-col mt-5"},ug={class:"col-12"},fg={class:"flex flex-row justify-between items-center mt-5"},hg={key:1,class:"mt-2"},mg={class:"flex flex-row justify-between items-center"},pg={key:1,class:"text-red-500"},gg={class:"flex flex-col mt-5"},yg={class:"flex flex-row justify-between items-center mt-2"},bg={class:"flex flex-row items-center mt-5 mb-5"},xg={class:"font-bold"},_g={class:"font-bold ml-2 flex-1"},kg={class:"flex flex-row justify-center items-center mb-2"},Sg={class:"ml-2 flex-1"},wg={key:0,class:"pi pi-exclamation-circle"},Eg={class:"flex flex-col justify-center"},Cg={class:"flex flex-row justify-between items-center"},Og={class:"justify-start"},vg={class:"justify-start"},Ng=De({__name:"EntityLookup",props:r.mergeModels({linkedEntity:{type:Object,required:!0},entity360Name:{type:String,required:!0},entity360Id:{required:!0},saveExistingRelatedEntityRecord:{type:Function,required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){Ye.useRoute();const e=t,n=r.useModel(t,"modelValue"),i=new fn,s=r.ref({}),o=r.ref([]),a=r.ref({}),l=r.ref([]),c=r.ref([]),d=r.ref({}),u=r.ref("id"),f=r.ref(1),h=r.ref([]),m=r.ref(25),p=r.ref(0),g=r.ref(0),y=r.ref(0);let b=r.ref([]);const x=r.ref(!1),w={gt:"GREATER_THAN",dateAfter:"GREATER_THAN",equals:"EQUAL",dateIs:"EQUAL",notEquals:"NOT_EQUAL",dateIsNot:"NOT_EQUAL",lt:"LESS_THAN",dateBefore:"LESS_THAN",lte:"LESS_THAN_EQUAL",gte:"GREATER_THAN_EQUAL",between:"BETWEEN",contains:"CONTAINS",startsWith:"STARTS_WITH",notContains:"NOT_CONTAINS",endsWith:"ENDS_WITH"},E={gt:"is greater than",dateAfter:"is after",equals:"is equals",dateIs:"is equals",notEquals:"is not equals",dateIsNot:"is not equals",lt:"is less than",dateBefore:"is before",lte:"is less than or equal to",gte:"is greater than or equal to",between:"between",contains:"contains",startsWith:"starts with",notContains:"not contains",endsWith:"ends with"};r.onMounted(()=>{C()});const k=H=>e.linkedEntity.list.some(F=>F[d.value.name]===H),C=async()=>{try{const H={sortBy:[u.value],sortDirection:f.value===1?"ASC":"DESC",pageSize:m.value,currentPage:p.value,columnList:null,filter:b.value,fullTextSearch:""},F=await i.searchEntityRecords(e.linkedEntity.entityName,H);F&&F.response&&(s.value=F.response,l.value=F.response.entity.entityDefinition.columns,c.value=ve(F.response.entity.entityDefinition.columns),g.value=F.response.totalRecords,await S(),await _(),O())}catch{}finally{}},S=async()=>{for(let H=0;H<l.value.length;H++){const F=l.value[H];!F.autoGeneerated&&F.foreignKey&&F.foreignKey.referencedEntityName.toLowerCase()==e.entity360Name.toLowerCase()&&(a.value=F)}},_=async()=>{for(let H=0;H<l.value.length;H++){const F=l.value[H];if(F.primaryKey&&F.primaryKey==!0){d.value=F;break}}},O=()=>{for(let H=0;H<e.linkedEntity.list.length;H++){const F=e.linkedEntity.list[H];F.is_deleted==!1&&F[a.value.name]==e.entity360Id&&o.value.push(F[d.value.name])}},P=()=>{let H=JSON.parse(JSON.stringify(o.value));H=H.filter(he=>!k(he));let F={linkEntityName:s.value.entityName,linkRecordIdList:[]};for(let he=0;he<H.length;he++){const pe=H[he];F.linkRecordIdList.push(pe)}e.saveExistingRelatedEntityRecord(F)},v=()=>{x.value=!x.value},T=[{label:"Starts with",value:"startsWith"},{label:"Contains",value:"contains"},{label:"Not contains",value:"notContains"},{label:"Ends with",value:"endsWith"},{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"}],R=[{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"},{label:"Less than",value:"lt"},{label:"Less than or equal to",value:"lte"},{label:"Greater than",value:"gt"},{label:"Greater than or equal to",value:"gte"}],U=[{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"}],Y=[{label:"Date is",value:"dateIs"},{label:"Date is not",value:"dateIsNot"},{label:"Date is before",value:"dateBefore"},{label:"Date is after",value:"dateAfter"}],L=[{label:"ASC",value:1},{label:"DESC",value:-1}];let j=[];const $=r.computed(()=>c.value.filter(H=>H.sortable)),A=r.computed(()=>c.value.filter(H=>H.filterable)),I=H=>c.value.filter(F=>{var he;return F.filterable?((he=h.value[H])==null?void 0:he.columnName)===F.name?!0:!h.value.some((pe,me)=>me!==H&&pe.columnName===F.name):!1}).map(F=>({label:F.name,value:F.field})),Q=H=>{let F="";switch(qe(H.columnName).toLowerCase()){case"string":case"uuid":F="startsWith";break;case"date":F="dateIs";break;case"numeric":case"int":case"integer":F="equals";break;case"bool":case"boolean":F="equals";break}H.operator=F,H.value=""},ne=H=>{const F=qe(H.columnName);switch(F&&F.toLowerCase()){case"integer":case"int":case"numeric":j=R;break;case"date":j=Y;break;case"bool":case"boolean":j=U;break;default:j=T}return j},se=H=>{if(H&&H.columnName){const F=qe(H.columnName);return xt(F)}else return""},K=()=>{for(let H=0;H<h.value.length;H++){const F=h.value[H];F.editing=!1}h.value.push({columnName:"",value:"",operator:"",editing:!0})},J=H=>{h.value.splice(H,1)},oe=H=>{H.editing=!H.editing},ue=()=>{let H=JSON.parse(JSON.stringify(h.value));b.value=[];for(let F=0;F<H.length;F++){const he=H[F];delete he.editing,he.columnName&&he.operator&&he.value&&(he.columnType=qe(he.columnName),he.operator=w[he.operator],b.value.push(he))}C()},ve=H=>H.map(F=>({field:F.name,name:F.displayName?F.displayName:F.name,filterable:F.filterable,datatype:F.type,sortable:!0,displayFormatKey:F.displayFormatKey,displayFormat:F.displayFormat})),st=()=>{C()},qe=H=>{const F=c.value.find(he=>he.field===H);return F?F.datatype:null},xt=H=>{switch(H.toLowerCase()){case"integer":case"int":case"numeric":return"numeric";case"date":return"date";case"bool":case"boolean":return"boolean";default:return"text"}},ct=H=>{m.value=H.rows,p.value=H.page,y.value=H.first,C()};return(H,F)=>{var un,Bn;const he=r.resolveComponent("InputIcon"),pe=r.resolveComponent("InputText"),me=r.resolveComponent("IconField"),ge=r.resolveComponent("Select"),Te=r.resolveComponent("Divider"),Ze=r.resolveComponent("InputNumber"),Tt=r.resolveComponent("DatePicker"),$e=r.resolveComponent("Button"),et=r.resolveComponent("Checkbox"),dt=r.resolveComponent("Paginator"),dn=r.resolveDirective("tooltip");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",Xp,[r.createElementVNode("div",Gp,[r.createVNode(me,{class:"block mt-2 md:mt-0 w-full"},{default:r.withCtx(()=>[r.createVNode(he,{onClick:F[0]||(F[0]=()=>{}),class:"pi pi-search"}),r.createVNode(pe,{class:"w-full",onKeyup:F[1]||(F[1]=r.withKeys(()=>{},["enter"])),placeholder:`Search ${s.value.entityName}`},null,8,["placeholder"])]),_:1})]),r.createElementVNode("div",Jp,[r.createElementVNode("div",{class:"flex items-center cursor-pointer sorting-filter-section flex-1 line-height-4",onClick:F[2]||(F[2]=ee=>v())},[x.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Qp)),x.value?(r.openBlock(),r.createElementBlock("div",Zp)):r.createCommentVNode("",!0),F[9]||(F[9]=r.createElementVNode("div",{class:"ml-3 font-bold"}," Sorting & Filters ",-1))])]),x.value?(r.openBlock(),r.createElementBlock("div",eg,[r.createElementVNode("div",tg,[F[10]||(F[10]=r.createElementVNode("div",{class:"col-12 font-bold"},"Sort Column",-1)),r.createElementVNode("div",ng,[r.createVNode(ge,{modelValue:u.value,"onUpdate:modelValue":F[3]||(F[3]=ee=>u.value=ee),options:$.value,optionLabel:"name",optionValue:"field",highlightOnSelect:!1,class:"w-full",onChange:F[4]||(F[4]=ee=>st(H.event))},null,8,["modelValue","options"])])]),r.createElementVNode("div",ig,[F[11]||(F[11]=r.createElementVNode("div",{class:"col-12 font-bold"},[r.createElementVNode("div",{class:"col-12 font-bold"},"Sort Direction")],-1)),r.createElementVNode("div",sg,[r.createVNode(ge,{modelValue:f.value,"onUpdate:modelValue":F[5]||(F[5]=ee=>f.value=ee),options:L,optionLabel:"label",optionValue:"value",highlightOnSelect:!1,class:"w-full",onChange:F[6]||(F[6]=ee=>st(H.event))},null,8,["modelValue"])])]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(h.value,(ee,_t)=>(r.openBlock(),r.createElementBlock("div",{key:_t},[ee.editing?(r.openBlock(),r.createElementBlock("div",og,[r.createVNode(Te,{class:"mt-5"}),r.createElementVNode("div",rg,[F[12]||(F[12]=r.createElementVNode("div",{class:"col-12 font-bold"},"Filter Column",-1)),r.createElementVNode("div",ag,[r.createVNode(ge,{modelValue:ee.columnName,"onUpdate:modelValue":Ae=>ee.columnName=Ae,options:I(_t),optionLabel:"label",placeholder:"Select column",optionValue:"value",highlightOnSelect:!1,class:"w-full",onChange:Ae=>Q(ee)},null,8,["modelValue","onUpdate:modelValue","options","onChange"])])]),r.createElementVNode("div",lg,[F[13]||(F[13]=r.createElementVNode("div",{class:"col-12 font-bold"},"Filter Operator",-1)),r.createElementVNode("div",cg,[r.createVNode(ge,{modelValue:ee.operator,"onUpdate:modelValue":Ae=>ee.operator=Ae,options:ne(ee),optionLabel:"label",placeholder:"Select operator",optionValue:"value",highlightOnSelect:!1,class:"w-full"},null,8,["modelValue","onUpdate:modelValue","options"])])]),r.createElementVNode("div",dg,[F[14]||(F[14]=r.createElementVNode("div",{class:"col-12 font-bold"},"Filter value",-1)),r.createElementVNode("div",ug,[se(ee)=="numeric"?(r.openBlock(),r.createBlock(Ze,{key:0,format:!1,class:"w-full",modelValue:ee.value,"onUpdate:modelValue":Ae=>ee.value=Ae,placeholder:"Search value"},null,8,["modelValue","onUpdate:modelValue"])):se(ee)=="date"?(r.openBlock(),r.createBlock(Tt,{key:1,class:"w-full",modelValue:ee.value,"onUpdate:modelValue":Ae=>ee.value=Ae,dateFormat:"mm/dd/yy",placeholder:"mm/dd/yyyy"},null,8,["modelValue","onUpdate:modelValue"])):(r.openBlock(),r.createBlock(pe,{key:2,modelValue:ee.value,"onUpdate:modelValue":Ae=>ee.value=Ae,class:"w-full",placeholder:"Search value"},null,8,["modelValue","onUpdate:modelValue"]))])]),r.createElementVNode("div",fg,[r.createVNode($e,{style:{width:"100px"},label:"Hide",icon:"",severity:"warning",onClick:Ae=>oe(ee)},null,8,["onClick"]),r.createVNode($e,{style:{width:"100px"},label:"Delete",icon:"",severity:"danger",onClick:Ae=>J(_t)},null,8,["onClick"])])])):r.createCommentVNode("",!0),ee.editing?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",hg,[r.createVNode(Te),r.createElementVNode("div",mg,[r.createElementVNode("span",null,[ee.columnName||ee.operator||ee.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createElementVNode("span",{class:r.normalizeClass({"text-red-500":!ee.columnName})},r.toDisplayString(ee.columnName?" "+ee.columnName:" column"),3),r.createElementVNode("span",{class:r.normalizeClass({"text-red-500":!E[ee.operator]})},r.toDisplayString(ee.operator?" "+E[ee.operator]:" operator"),3),r.createElementVNode("span",{class:r.normalizeClass({"text-red-500":!ee.value})},r.toDisplayString(ee.value?" "+ee.value:" value"),3)],64)):(r.openBlock(),r.createElementBlock("span",pg,"Filter is empty"))]),r.createVNode($e,{style:{width:"100px"},label:"Edit",icon:"",severity:"info",onClick:Ae=>oe(ee)},null,8,["onClick"])])]))]))),128)),r.createElementVNode("div",gg,[r.createVNode(Te),r.createElementVNode("div",yg,[r.createVNode($e,{style:{width:"100px"},label:"Add",disabled:A.value.length===h.value.length,icon:"",severity:"success",onClick:K},null,8,["disabled"]),r.createVNode($e,{style:{width:"100px"},label:"Apply",severity:"info",onClick:ue})])])])):r.createCommentVNode("",!0),r.createElementVNode("div",bg,[r.createElementVNode("div",xg,r.toDisplayString((un=s.value)==null?void 0:un.totalRecords),1),r.createElementVNode("div",_g,r.toDisplayString((Bn=s.value)==null?void 0:Bn.entityName),1)]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value.result,(ee,_t)=>(r.openBlock(),r.createElementBlock("div",{key:_t},[r.createElementVNode("div",kg,[r.createVNode(et,{disabled:k(ee[d.value.name]),modelValue:o.value,"onUpdate:modelValue":F[7]||(F[7]=Ae=>o.value=Ae),value:ee[d.value.name]},null,8,["disabled","modelValue","value"]),r.createElementVNode("div",Sg,[r.createTextVNode(r.toDisplayString(t.linkedEntity.entityName)+" ",1),r.createElementVNode("span",null,r.toDisplayString(ee[d.value.name]),1)]),k(ee[d.value.name])?r.withDirectives((r.openBlock(),r.createElementBlock("div",wg,null,512)),[[dn,"This record is already associated.",void 0,{left:!0}]]):r.createCommentVNode("",!0)])]))),128)),r.createVNode(dt,{rows:m.value,totalRecords:g.value,rowsPerPageOptions:[10,25,50,100],onPage:ct,template:"FirstPageLink PageLinks LastPageLink CurrentPageReport RowsPerPageDropdown",currentPageReportTemplate:""},null,8,["rows","totalRecords"])]),r.createElementVNode("div",Eg,[r.createVNode(Te,{class:"mt-5"}),r.createElementVNode("div",Cg,[r.createElementVNode("div",Og,[r.createVNode($e,{label:"Cancel",icon:"",severity:"secondary",onClick:F[8]||(F[8]=ee=>n.value=!1)})]),r.createElementVNode("div",vg,[r.createVNode($e,{label:"Save",severity:"success",onClick:P})])])])],64)}}},[["__scopeId","data-v-5172abef"]]),Dg={class:"field flex flex-col"},Tg={key:0,class:"flex items-center"},Bg={key:1},Pg={class:"flex items-center"},Ag={class:"flex flex-col justify-center"},Mg={class:"flex flex-row justify-between items-center"},Vg={class:"justify-start"},Rg={class:"justify-start"},Fg={__name:"EntityLookupObject",props:r.mergeModels({linkedEntity:{type:Object,required:!0},entity360Name:{type:String,required:!0},entity360Id:{type:[String,Number]},saveExistingEntityObject:{type:Function}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){Ye.useRoute();const e=t,n=r.useModel(t,"modelValue"),i=new fn,s=r.ref({}),o=r.ref({});let a=r.ref("");const l=r.ref({}),c=r.ref({});r.onMounted(async()=>{console.log("linkedEntity"),console.log(e.linkedEntity),console.log("entity360Name"),console.log(e.entity360Name),console.log("entity360Id"),console.log(e.entity360Id),await u(),await d()});const d=async()=>{try{const g=await i.getEntityRecords(e.linkedEntity.entityName);g&&g.response&&(s.value=g.response,await f(g.response.entity.entityDefinition.columns),await m(),console.log(s.value))}catch{}finally{}},u=async()=>{try{const g=await i.getRecord(e.entity360Name,e.entity360Id);g&&g.response&&(o.value=g.response,await h(g.response.entity.entityDefinition.columns),console.log(o.value))}catch{}finally{}},f=async g=>{for(let y=0;y<g.length;y++){const b=g[y];if(b.primaryKey&&b.primaryKey==!0){l.value=b;break}}},h=async g=>{for(let y=0;y<g.length;y++){const b=g[y];if(!b.autoGeneerated&&b.foreignKey&&b.foreignKey.referencedEntityName.toLowerCase()==e.linkedEntity.entityName.toLowerCase()){c.value=b;break}}},m=async()=>{for(let g=0;g<s.value.result.length;g++){const y=s.value.result[g];if(y[l.value.name]==o.value.result[0][c.value.name]){a.value=y;break}}},p=()=>{const g={linkedEntityRecordId:a.value[l.value.name],linkedEntityName:e.linkedEntity.entityName,relationType:"ManyToOne"};e.saveExistingEntityObject(g)};return(g,y)=>{const b=r.resolveComponent("Select"),x=r.resolveComponent("Divider"),w=r.resolveComponent("Button");return r.openBlock(),r.createElementBlock("div",Dg,[r.createVNode(b,{modelValue:r.unref(a),"onUpdate:modelValue":y[0]||(y[0]=E=>r.isRef(a)?a.value=E:a=E),"item-value":l.value.name,options:s.value.result,filter:"",optionLabel:l.value.name,placeholder:"Select "+l.value.name,class:"w-full"},{value:r.withCtx(E=>[E.value?(r.openBlock(),r.createElementBlock("div",Tg,[r.createElementVNode("div",null,r.toDisplayString(E.value[l.value.name]),1)])):(r.openBlock(),r.createElementBlock("span",Bg,r.toDisplayString(E.placeholder),1))]),option:r.withCtx(E=>[r.createElementVNode("div",Pg,[r.createElementVNode("div",null,r.toDisplayString(E.option[l.value.name]),1)])]),_:1},8,["modelValue","item-value","options","optionLabel","placeholder"]),r.createElementVNode("div",Ag,[r.createVNode(x),r.createElementVNode("div",Mg,[r.createElementVNode("div",Vg,[r.createVNode(w,{label:"Cancel",icon:"",severity:"secondary",onClick:y[1]||(y[1]=E=>n.value=!1)})]),r.createElementVNode("div",Rg,[r.createVNode(w,{label:"Save",severity:"success",onClick:p})])])])])}}},$g={style:{"font-weight":"700","font-size":"1.25rem"}},Lg={class:"flex flex-col"},Ig={class:"flex flex-row justify-between items-center"},jg={class:"justify-start"},zg={class:"justify-start"},Ug="",Wg={__name:"CreateRelatedentity",props:r.mergeModels({entity360Id:{required:!0},entity360Name:{type:String,required:!0},linkedEntity:{type:Object,required:!0}},{showCreateRelatedEntityForm:{},showCreateRelatedEntityFormModifiers:{}}),emits:r.mergeModels(["onSaveDialog"],["update:showCreateRelatedEntityForm"]),setup(t,{emit:e}){const n=r.useModel(t,"showCreateRelatedEntityForm");Ye.useRoute();const i=t,s=i.linkedEntity.entityName,o=e,a=r.ref("Add existing");r.onMounted(()=>{m()});const{formData:l,columns:c,errors:d,backendErrors:u,clearErrors:f,saveRecord:h,fetchAllRecords:m,saveRelatedEntityRecord:p}=Po(s,Ug,o),g=()=>{for(let w=0;w<c.value.length;w++){const E=c.value[w];!E.autoGenerated&&E.foreignKey&&(l.value[E.name]=i.entity360Id)}const x={relationType:i.linkedEntity.relationType,linkedEntities:{entityLinkage:[{linkEntityName:i.entity360Name,linkRecordIdList:[i.entity360Id]}]}};h(x)},y=x=>{var w;if(((w=x==null?void 0:x.linkRecordIdList)==null?void 0:w.length)>0){const E={entityLinkage:[{linkEntityName:x.linkEntityName,linkRecordIdList:x.linkRecordIdList}]};p(i.entity360Name,i.entity360Id,E)}},b=x=>{const w={entityLinkage:[{linkEntityName:i.entity360Name,linkRecordIdList:[i.entity360Id]}]};p(x.linkedEntityName,x.linkedEntityRecordId,w)};return(x,w)=>{const E=r.resolveComponent("Tab"),k=r.resolveComponent("TabList"),C=r.resolveComponent("Divider"),S=r.resolveComponent("Button"),_=r.resolveComponent("TabPanel"),O=r.resolveComponent("TabPanels"),P=r.resolveComponent("Tabs"),v=r.resolveComponent("Drawer");return r.openBlock(),r.createBlock(v,{visible:n.value,"onUpdate:visible":w[3]||(w[3]=T=>n.value=T),blockScroll:!0,position:"right",class:"p-fluid layout-profile-sidebar",style:{width:"40%"},pt:{closeButton:"ml-auto"}},{header:r.withCtx(()=>[r.createElementVNode("span",$g,r.toDisplayString(a.value)+" "+r.toDisplayString(t.linkedEntity.entityName),1)]),default:r.withCtx(()=>[r.createVNode(P,{value:"1"},{default:r.withCtx(()=>[r.createVNode(k,null,{default:r.withCtx(()=>[r.createVNode(E,{value:"0"},{default:r.withCtx(()=>w[4]||(w[4]=[r.createTextVNode("Create new")])),_:1}),r.createVNode(E,{value:"1"},{default:r.withCtx(()=>w[5]||(w[5]=[r.createTextVNode("Add existing")])),_:1})]),_:1}),r.createVNode(O,null,{default:r.withCtx(()=>[r.createVNode(_,{value:"0"},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(c),(T,R)=>{var U;return r.openBlock(),r.createElementBlock("div",{key:R,class:"mt-3"},[!T.autoGenerated&&!T.foreignKey?(r.openBlock(),r.createBlock(os,{key:0,modelValue:r.unref(l)[T.name],"onUpdate:modelValue":Y=>r.unref(l)[T.name]=Y,column:T,errors:(U=r.unref(d)[T.name])==null?void 0:U.messages,onInput:r.unref(f)},null,8,["modelValue","onUpdate:modelValue","column","errors","onInput"])):r.createCommentVNode("",!0)])}),128)),r.createElementVNode("div",Lg,[r.createVNode(C),r.createElementVNode("div",Ig,[r.createElementVNode("div",jg,[r.createVNode(S,{label:"Cancel",icon:"",severity:"secondary",onClick:w[0]||(w[0]=T=>n.value=!1)})]),r.createElementVNode("div",zg,[r.createVNode(S,{label:"Save",severity:"success",onClick:g})])])])]),_:1}),r.createVNode(_,{value:"1"},{default:r.withCtx(()=>[t.linkedEntity.relationType=="ONE_TO_MANY"?(r.openBlock(),r.createBlock(Ng,{key:0,modelValue:n.value,"onUpdate:modelValue":w[1]||(w[1]=T=>n.value=T),linkedEntity:t.linkedEntity,entity360Name:t.entity360Name,entity360Id:t.entity360Id,saveExistingRelatedEntityRecord:y},null,8,["modelValue","linkedEntity","entity360Name","entity360Id"])):r.createCommentVNode("",!0),t.linkedEntity.relationType=="MANY_TO_ONE"?(r.openBlock(),r.createBlock(Fg,{key:1,modelValue:n.value,"onUpdate:modelValue":w[2]||(w[2]=T=>n.value=T),linkedEntity:t.linkedEntity,entity360Name:t.entity360Name,entity360Id:t.entity360Id,saveExistingEntityObject:b},null,8,["modelValue","linkedEntity","entity360Name","entity360Id"])):r.createCommentVNode("",!0)]),_:1})]),_:1})]),_:1})]),_:1},8,["visible"])}}},Hg={class:"flex flex-col border-bottom-section pb-3 pt-3"},qg={class:"flex items-center pl-3 pr-3 justify-between"},Yg={key:0,class:"pi pi-caret-right"},Kg={key:1,class:"pi pi-caret-down"},Xg={class:"ml-3 font-bold"},Gg={class:"ml-1"},Jg={class:"text-right"},Qg={key:0},Zg=De({__name:"LinkEntitySection",props:{entity360Id:{required:!0},entity360Name:{type:String,required:!0},linkedEntity:{type:Object,required:!0},entity360Name:{type:[String,Number]},onSaveRelatedEnttity:{type:Function}},setup(t){Ye.useRoute();const e=t,n=r.ref(!1),i=r.ref(!1),s=()=>{n.value=!n.value},o=()=>{i.value=!i.value},a=()=>{i.value=!1,e.onSaveRelatedEnttity()},l=r.computed(()=>e.linkedEntity.list.filter(c=>!c.is_deleted).length);return(c,d)=>{const u=r.resolveComponent("Button");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",Hg,[r.createElementVNode("div",qg,[r.createElementVNode("div",{class:"flex cursor-pointer items-center linked-entity-section grow line-height-4",onClick:d[0]||(d[0]=f=>s())},[n.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Yg)),n.value?(r.openBlock(),r.createElementBlock("div",Kg)):r.createCommentVNode("",!0),r.createElementVNode("div",Xg,r.toDisplayString(t.linkedEntity.entityName),1),r.createElementVNode("div",Gg," ("+r.toDisplayString(l.value)+") ",1)]),r.createElementVNode("div",Jg,[r.createVNode(u,{label:"Add",icon:"pi pi-plus",size:"small",onClick:d[1]||(d[1]=f=>o())})])]),n.value?(r.openBlock(),r.createElementBlock("div",Qg,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.linkedEntity.list,(f,h)=>(r.openBlock(),r.createElementBlock("div",{class:"flex flex-col",key:h},[f.is_deleted?r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(Kp,{key:0,linkEntityListItem:f},null,8,["linkEntityListItem"]))]))),128))])):r.createCommentVNode("",!0)]),i.value?(r.openBlock(),r.createBlock(Wg,{key:0,showCreateRelatedEntityForm:i.value,"onUpdate:showCreateRelatedEntityForm":d[2]||(d[2]=f=>i.value=f),linkedEntity:t.linkedEntity,entity360Name:t.entity360Name,entity360Id:t.entity360Id,onOnSaveDialog:a},null,8,["showCreateRelatedEntityForm","linkedEntity","entity360Name","entity360Id"])):r.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-412eec44"]]),ey={key:0},ty={class:"flex"},ny={class:"p-3 mt-3 flex-col items-center"},iy={key:0,class:"pi pi-caret-right"},sy={key:1,class:"pi pi-caret-down"},oy={class:"font-bold ml-2"},ry={key:0,class:"flex flex-col mt-4"},ay={class:"flex flex-col mt-2"},ly={class:"flex flex-row flex-wrap justify-between pl-5"},cy={class:"flex flex-col"},dy={class:"font-bold"},uy={class:"mt-2"},fy={key:0,class:"flex flex-col",style:{position:"relative","max-width":"400px","background-color":"var(--surface-card)"}},hy={key:2,style:{width:"350px"},class:"flex flex-col justify-center"},my={key:0,class:"custom-sidebar"},py={class:"custom-sidebar-content"},gy={class:"custom-sidebar-button"},yy={class:"custom-sidebar-text"},gl=De({__name:"Entity360",props:{entityName:{type:String},recordId:{type:String},variable:{type:String,default:"item"},linkedEntity:Array},emits:["onSaveDialog"],setup(t,{expose:e,emit:n}){var v,T;const i=ot(),s=Ye.useRoute(),o=t,a=r.ref(!0),l=r.ref(!1),c=r.ref([]);let d=(v=s==null?void 0:s.params)==null?void 0:v.entityName,u=(T=s==null?void 0:s.params)==null?void 0:T.id;o.entityName&&(d=o.entityName),o.recordId&&(u=o.recordId);const f=n,{formData:h,columns:m,errors:p,backendErrors:g,isDataChange:y,linkedEntities:b,primarayColumn:x,clearErrors:w,saveRecord:E,getRelatedEntityRecordById:k,cancleRecord:C}=Po(d,u,f);r.watch(()=>i.globalConfigs.appId,async R=>{R&&k()},{immediate:!0});const S=()=>{a.value=!a.value},_=()=>{l.value=!l.value},O=()=>{k()},P=R=>{if(!c.value||c.value.length===0)return[];const U=c.value.find(Y=>Y.entityName===R);return U&&U.list?U.list:(console.log("No related entity found"),[])};return e({getRelatedEntity:P}),r.watch(()=>b.value,R=>{Array.isArray(R)&&R.length>0&&R[0]&&(c.value=R)},{immediate:!0,deep:!0}),(R,U)=>{var se;const Y=r.resolveComponent("SplitterPanel"),L=r.resolveComponent("Tab"),j=r.resolveComponent("TabList"),$=r.resolveComponent("TabPanel"),A=r.resolveComponent("TabPanels"),I=r.resolveComponent("Tabs"),Q=r.resolveComponent("Splitter"),ne=r.resolveComponent("Button");return R.$slots["list-item-display-360"]?(r.openBlock(),r.createElementBlock("div",ey,[r.renderSlot(R.$slots,"header",{},void 0,!0),r.createElementVNode("div",null,[r.renderSlot(R.$slots,"list-item-display-360",r.normalizeProps({[t.variable||""]:{formData:r.unref(h),columns:r.unref(m),linkedEntities:r.unref(b),errors:r.unref(p),recordId:r.unref(u),entityName:r.unref(d),getRelatedEntity:P}}),void 0,!0)]),r.renderSlot(R.$slots,"footer",{},void 0,!0)])):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createElementVNode("div",ty,[r.createVNode(Q,{class:"flex-1",layout:"horizontal",gutterSize:8,size:100},{default:r.withCtx(()=>[r.createVNode(Y,{size:20,minSize:10,maxSize:20},{default:r.withCtx(()=>[r.createElementVNode("div",ny,[r.createElementVNode("div",{onClick:U[0]||(U[0]=K=>S()),class:"section-heading cursor-pointer"},[a.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("i",iy)),a.value?(r.openBlock(),r.createElementBlock("i",sy)):r.createCommentVNode("",!0),r.createElementVNode("span",oy," About this "+r.toDisplayString(r.unref(d)),1)]),a.value?(r.openBlock(),r.createElementBlock("div",ry,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(m),(K,J)=>{var oe;return r.openBlock(),r.createElementBlock("div",{key:J},[K.autoGenerated?r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(os,{key:0,modelValue:r.unref(h)[K.name],"onUpdate:modelValue":ue=>r.unref(h)[K.name]=ue,column:K,errors:(oe=r.unref(p)[K.name])==null?void 0:oe.messages,onInput:r.unref(w)},null,8,["modelValue","onUpdate:modelValue","column","errors","onInput"]))])}),128))])):r.createCommentVNode("",!0)])]),_:1}),r.createVNode(Y,{size:55,minSize:35,style:{height:"100%"}},{default:r.withCtx(()=>[r.createVNode(I,{value:"0"},{default:r.withCtx(()=>[r.createVNode(j,null,{default:r.withCtx(()=>[r.createVNode(L,{value:"0"},{default:r.withCtx(()=>U[3]||(U[3]=[r.createTextVNode("Overview")])),_:1}),r.createVNode(L,{value:"1"},{default:r.withCtx(()=>U[4]||(U[4]=[r.createTextVNode("Activity")])),_:1})]),_:1}),r.createVNode(A,null,{default:r.withCtx(()=>[r.createVNode($,{value:"0"},{default:r.withCtx(()=>[r.createElementVNode("div",ay,[U[5]||(U[5]=r.createElementVNode("h3",{class:"mt-2 text-xl font-semibold"},"Data highlights",-1)),r.createElementVNode("div",ly,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(m).filter(K=>K.autoGenerated),(K,J)=>(r.openBlock(),r.createElementBlock("div",{key:J,class:"column-item"},[r.createElementVNode("div",cy,[r.createElementVNode("div",dy,r.toDisplayString(K.name),1),r.createElementVNode("div",uy,[r.createVNode(Vo,{column:K,value:r.unref(h)[K.name]},null,8,["column","value"])])])]))),128))])])]),_:1}),r.createVNode($,{value:"1"})]),_:1})]),_:1})]),_:1})]),_:1}),((se=r.unref(b))==null?void 0:se.length)>0?(r.openBlock(),r.createElementBlock("div",fy,[l.value?(r.openBlock(),r.createBlock(ne,{key:0,icon:"pi pi-caret-right",rounded:"",onClick:_,"aria-label":"Filter",style:{height:"2rem",width:"2rem",left:"-20px"}})):r.createCommentVNode("",!0),l.value?r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(ne,{key:1,icon:"pi pi-caret-left",rounded:"",onClick:_,"aria-label":"Filter",style:{height:"2rem",width:"2rem",left:"-20px"}})),l.value?(r.openBlock(),r.createElementBlock("div",hy,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(b),(K,J)=>(r.openBlock(),r.createElementBlock("div",{key:J},[r.createVNode(Zg,{entity360Name:r.unref(d),entity360Id:r.unref(u),linkedEntity:K,onSaveRelatedEnttity:O},null,8,["entity360Name","entity360Id","linkedEntity"])]))),128))])):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)]),r.unref(y)?(r.openBlock(),r.createElementBlock("div",my,[r.createElementVNode("div",py,[r.createElementVNode("div",gy,[r.createVNode(ne,{severity:"primary",onClick:U[1]||(U[1]=K=>r.unref(E)())},{default:r.withCtx(()=>U[6]||(U[6]=[r.createTextVNode("Save")])),_:1}),r.createVNode(ne,{style:{"margin-left":"10px"},severity:"secondary",onClick:U[2]||(U[2]=K=>r.unref(C)())},{default:r.withCtx(()=>U[7]||(U[7]=[r.createTextVNode("Cancel")])),_:1})]),r.createElementVNode("div",yy," You've changed property in the "+r.toDisplayString(r.unref(d))+". ",1)])])):r.createCommentVNode("",!0)],64))}}},[["__scopeId","data-v-6df84fdd"]]);function xs(){const t=new fn;let{errors:e,setErrors:n}=Sa(),i=r.reactive({data:null});const s=C=>{i.data=C},o=async C=>{try{const S=await t.getEntityRecords(C);if(S&&S.response)return S}catch(S){return console.error("Error fetching entity:",S.errorMessage),S}finally{}},a=async(C,S)=>{try{let _=await t.addRecord(C.entityName,S);if(_)return _}catch(_){return _}finally{}},l=async(C,S,_)=>{try{const O=await t.updateRecord(C.entityName,S,_);if(O&&O.response)return O}catch(O){return O}finally{}},c=async(C,S)=>{try{S.filter==null&&(S.filter={}),Object.keys(S.filter).length===0&&(S.filter=[]);const _=await t.searchEntityRecords(C.entityName,S);if(_)return _.response.sortBy=S.sortBy,_.response.filters=S.filter,_.response.sortDirection=S.sortDirection,_.response.fullTextSearch=S.fullTextSearch,_}catch(_){return _}finally{}},d=async(C,S)=>{try{const _=await t.deleteRecord(C.entityName,S);if(_)return _}catch(_){console.error("Error on deleting record:",_.errorMessage)}finally{}},u=C=>C.result,f=C=>{var S,_;return(_=(S=C==null?void 0:C.entity)==null?void 0:S.entityDefinition)==null?void 0:_.columns},h=C=>{const S=C.entity.entityDefinition.columns;let _={};for(let O=0;O<S.length;O++){const P=S[O];if(P.primaryKey&&P.primaryKey==!0){_=P;break}}return _},m=C=>{const S=C.entity.entityDefinition.columns;let _={};for(let O=0;O<S.length;O++){let P=S[O];P.autoGenerated||(_[P.name]="")}return _},p=(C,S)=>{let _="";const O=C.entity.entityDefinition.columns;for(let P=0;P<O.length;P++){let v=O[P];if(S==v.name){_=v.type;break}}return _},g=(C,S)=>{const O=C.entity.entityDefinition.columns.filter(v=>v.autoGenerated).map(v=>v.name);return Object.entries(S).filter(([v])=>!O.includes(v)).map(([v,T])=>({recordColumnName:v,recordColumnValue:T,columnType:p(i.data,v)}))},y=()=>{const C=i.data.entity.entityDefinition.columns;return Bo().shape(C.reduce((_,O)=>(O.autoGenerated||(_[O.name]=To().nullable(!1).test({name:"custom-validation",test:function(P){const v=[];let T="";if(O.required&&(!P||P.trim()===""))if(O.validations){T=b(O.validations,"VALIDATE_REQUIRED"),v.push(T);let R=w(O.validations,"VALIDATE_REQUIRED");R&&(R="hint:"+R,v.push(R))}else T=O.displayName+" is required.",v.push(T);else{if(O.maxLength&&P.length>O.maxLength)if(O.validations){T=b(O.validations,"VALIDATE_MAXLENGTH"),v.push(T);let R=w(O.validations,"VALIDATE_MAXLENGTH");R&&(R="hint:"+R,v.push(R))}else T=O.displayName+" cannot exceed from "+O.maxLength+" characters",v.push(T);if(O.regxId&&!new RegExp(x(O.validations,"VALIDATE_REGX")).test(P))if(O.validations){T=b(O.validations,"VALIDATE_REGX"),v.push(T);let R=w(O.validations,"VALIDATE_REGX");R&&(R="hint:"+R,v.push(R))}else T=O.displayName+" invalid format.",v.push(T)}return v.length>0?this.createError({message:v}):!0}})),_),{}))},b=(C,S)=>{for(let _=0;_<C.length;_++)if(S==C[_].type)return C[_].message},x=(C,S)=>{for(let _=0;_<C.length;_++)if(S==C[_].type)return C[_].regx},w=(C,S)=>{for(let _=0;_<C.length;_++)if(S==C[_].type)return C[_].hint};return{state:i,setEntity:s,getEntity:o,addRecord:a,updateRecord:l,searchRecord:c,entityRecordDelete:d,getEntityItems:u,getEntityColumns:f,getPrimaryKeyColumn:h,getFormData:m,createDataToSave:g,createValidationSchema:y,clearErrors:C=>(n({...e.value,[C]:null}),e.value),validateData:async(C,S)=>{try{return await C.validate(S,{abortEarly:!1}),n({}),{validate:!0}}catch(_){const O=_.inner.reduce((T,R)=>(T[R.path]||(T[R.path]={messages:[]}),T[R.path].messages.push(...R.errors),T),{}),P=Object.entries(O).reduce((T,[R,U])=>(T[R]={messages:U.messages},T),{});return n(P),{validate:!1,errors:e.value}}}}}const _s={__name:"ConfirmDeleteDialog",props:{showDeleteDialog:{},showDeleteDialogModifiers:{}},emits:r.mergeModels(["onDeleteItem"],["update:showDeleteDialog"]),setup(t,{emit:e}){const n=r.useModel(t,"showDeleteDialog"),i=e,s=o=>{i("onDeleteItem",{remove:o})};return(o,a)=>{const l=r.resolveComponent("Button"),c=r.resolveComponent("Dialog");return r.openBlock(),r.createBlock(c,{visible:n.value,"onUpdate:visible":a[2]||(a[2]=d=>n.value=d),style:{width:"450px"},header:"Confirm",modal:!0},{footer:r.withCtx(()=>[r.createVNode(l,{label:"No",icon:"pi pi-times",text:"",onClick:a[0]||(a[0]=d=>s(!1))}),r.createVNode(l,{label:"Yes",icon:"pi pi-check",text:"",onClick:a[1]||(a[1]=d=>s(!0))})]),default:r.withCtx(()=>[a[3]||(a[3]=r.createElementVNode("div",{class:"flex items-center justify-center"},[r.createElementVNode("i",{class:"pi pi-exclamation-triangle mr-3",style:{"font-size":"2rem"}}),r.createElementVNode("span",null,"Are you sure you want to delete the selected item?")],-1))]),_:1},8,["visible"])}}},by={key:0,style:{"font-weight":"700","font-size":"1.25rem"}},xy={key:1,style:{"font-weight":"700","font-size":"1.25rem"}},hi={__name:"EntityFormDialog",props:r.mergeModels({item:Object},{showEntityForm:{},showEntityFormModifiers:{}}),emits:["update:showEntityForm"],setup(t){const e=r.useModel(t,"showEntityForm"),n=r.inject("entityObject"),i=t;let s=r.ref([]),o=r.ref({}),a=r.ref([]),l=r.ref(null),c=r.ref({});r.onMounted(()=>{s.value=n.getEntityColumns(n.state.data),i.item?o.value=JSON.parse(JSON.stringify(i.item)):o.value=n.getFormData(n.state.data),l.value=n.createValidationSchema()});const d=async()=>{const m=await n.validateData(l.value,o.value);if(!m.validate){c.value=m.errors;return}const p=n.getPrimaryKeyColumn(n.state.data),g=i.item[p.name],y={dataDefinitions:n.createDataToSave(n.state.data,o.value)},b=await n.updateRecord(n.state.data,g,y);if(b&&b.success){e.value=!1;const x={sortBy:n.state.data.sortBy,sortDirection:n.state.data.sortDirection,pageSize:n.state.data.pageSize,currentPage:n.state.data.currentPage,columnList:null,filter:n.state.data.filters,fullTextSearch:n.state.data.fullTextSearch},w=await n.searchRecord(n.state.data,x);if(w!=null&&w.response){let E=w==null?void 0:w.response;n.setEntity(E)}}else b.validationErrors&&(a.value=JSON.parse(JSON.stringify(b.errvalidationErrorsors)))},u=async()=>{const m=await n.validateData(l.value,o.value);if(!m.validate){c.value=m.errors;return}const p={dataDefinitions:n.createDataToSave(n.state.data,o.value)},g=await n.addRecord(n.state.data,p);g&&g.success?(e.value=!1,n.state.data=await n.getEntity(n.state.data.entityName)):g.validationErrors&&(a.value=JSON.parse(JSON.stringify(g.errvalidationErrorsors)))},f=async()=>{i.item?d():u()},h=m=>{c.value=n.clearErrors(m)};return(m,p)=>{const g=r.resolveComponent("Button"),y=r.resolveComponent("Dialog");return e.value?(r.openBlock(),r.createBlock(y,{key:0,showFooter:!1,visible:e.value,"onUpdate:visible":p[2]||(p[2]=b=>e.value=b),style:{width:"50rem"},breakpoints:{"1199px":"75vw","575px":"90vw"},modal:!0,class:"p-fluid"},{header:r.withCtx(()=>[t.item?(r.openBlock(),r.createElementBlock("span",by,"Edit "+r.toDisplayString(r.unref(n).state.data.entityName)+" record details",1)):r.createCommentVNode("",!0),t.item?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",xy,"Add "+r.toDisplayString(r.unref(n).state.data.entityName)+" record details",1))]),footer:r.withCtx(()=>[r.createVNode(g,{type:"button",icon:"",label:"Cancel",severity:"secondary",onClick:p[0]||(p[0]=b=>e.value=!1)}),r.createVNode(g,{type:"button",icon:"",label:"Save",severity:"success",onClick:p[1]||(p[1]=b=>f())})]),default:r.withCtx(()=>{var b;return[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(s),(x,w)=>{var E;return r.openBlock(),r.createElementBlock("div",{key:w},[!x.autoGenerated&&!x.foreignKey?(r.openBlock(),r.createBlock(os,{key:0,modelValue:r.unref(o)[x.name],"onUpdate:modelValue":k=>r.unref(o)[x.name]=k,column:x,errors:(E=r.unref(c)[x.name])==null?void 0:E.messages,onInput:h},null,8,["modelValue","onUpdate:modelValue","column","errors"])):r.createCommentVNode("",!0),!x.autoGenerated&&x.foreignKey?(r.openBlock(),r.createBlock(La,{key:1,modelValue:r.unref(o)[x.name],"onUpdate:modelValue":k=>r.unref(o)[x.name]=k,entityName:x.foreignKey.referencedEntityName,columnName:x.name,relatedEntityColumn:x.foreignKey.referencedColumnName},null,8,["modelValue","onUpdate:modelValue","entityName","columnName","relatedEntityColumn"])):r.createCommentVNode("",!0)])}),128)),((b=r.unref(a))==null?void 0:b.length)>0?(r.openBlock(),r.createBlock($a,{key:0,errors:r.unref(a)},null,8,["errors"])):r.createCommentVNode("",!0)]}),_:1},8,["visible"])):r.createCommentVNode("",!0)}}},_y={class:"flex justify-between items-start"},ky={class:"flex-grow-1"},Sy={class:"tile-grid"},wy={class:"font-bold text-lg text-700"},Ey={class:"flex flex-col gap-2"},Cy=De({__name:"EntityListSingleRecord",props:{item:Object},setup(t){const e=t,n=r.inject("entityObject"),i=r.ref([]),s=r.ref(!1),o=r.ref(!1);r.onMounted(()=>{i.value=n.getEntityColumns(n.state.data)});const a=()=>{s.value=!0},l=()=>{o.value=!0},c=u=>{u.remove==!0?d():s.value=!1},d=async()=>{const u=n.getPrimaryKeyColumn(n.state.data),f=e.item[u.name],h=await n.entityRecordDelete(n.state.data,f);if(h!=null&&h.success){s.value=!1;const m={sortBy:n.state.data.sortBy,sortDirection:n.state.data.sortDirection,pageSize:n.state.data.pageSize,currentPage:n.state.data.currentPage,columnList:null,filter:n.state.data.filters,fullTextSearch:n.state.data.fullTextSearch},p=await n.searchRecord(n.state.data,m);if(p!=null&&p.response){let g=p==null?void 0:p.response;n.setEntity(g)}console.log(h)}};return(u,f)=>{const h=r.resolveComponent("Button");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",_y,[r.createElementVNode("div",ky,[r.createElementVNode("div",Sy,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value,(m,p)=>(r.openBlock(),r.createElementBlock("div",{key:p},[r.createElementVNode("span",wy,r.toDisplayString(m.name)+" : ",1),r.createVNode(Vo,{column:m,value:t.item[m.name]},null,8,["column","value"])]))),128))])]),r.createElementVNode("div",Ey,[r.createVNode(h,{onClick:f[0]||(f[0]=m=>l()),icon:"pi pi-pencil",severity:"success",size:"",rounded:"","aria-label":"Edit"}),r.createVNode(h,{onClick:f[1]||(f[1]=m=>a()),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"})])]),o.value?(r.openBlock(),r.createBlock(hi,{key:0,showEntityForm:o.value,"onUpdate:showEntityForm":f[2]||(f[2]=m=>o.value=m),item:t.item},null,8,["showEntityForm","item"])):r.createCommentVNode("",!0),s.value?(r.openBlock(),r.createBlock(_s,{key:1,showDeleteDialog:s.value,"onUpdate:showDeleteDialog":f[3]||(f[3]=m=>s.value=m),onOnDeleteItem:c},null,8,["showDeleteDialog"])):r.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-ea3b758f"]]),Oy=De({__name:"EntityListRecordParent",props:{listItemDisplay:String},setup(t){const e=r.inject("entityObject"),n=r.ref([]);return r.watch(()=>e.state.data,i=>{i&&(n.value=i.result,console.log("Entity state updated in child:",e))},{immediate:!0}),(i,s)=>(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.value,(o,a)=>(r.openBlock(),r.createElementBlock("div",{key:a,class:"card rounded-md p-5 my-2 shadow-lg relative tile"},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.listItemDisplay!=null&&t.listItemDisplay!=""?t.listItemDisplay:Cy),r.mergeProps({ref_for:!0},{item:o}),null,16))]))),128))}},[["__scopeId","data-v-b13f837f"]]),vy={};function Ny(t,e){return null}const Dy=De(vy,[["render",Ny]]),Ty={class:"my-2"},By={class:"m-0"},Py={__name:"EntityListHeaderSlot",setup(t){const e=r.inject("entityObject");let n=r.ref("");return r.watch(()=>e.state.data,i=>{i&&(n.value=i.entityName)},{immediate:!0}),(i,s)=>{const o=r.resolveComponent("Toolbar");return r.openBlock(),r.createBlock(o,{class:"p-2 my-2"},{start:r.withCtx(()=>[r.createElementVNode("div",Ty,[r.createElementVNode("h2",By,"EntityName: "+r.toDisplayString(r.unref(n)),1)])]),end:r.withCtx(()=>s[0]||(s[0]=[])),_:1})}}},Ay={class:"flex flex-col mb-5"},My={class:"col-12"},Vy={class:"flex flex-col mb-5"},Ry={class:"col-12"},Fy={key:0},$y={class:"flex flex-col mb-5"},Ly={class:"col-12"},Iy={class:"flex flex-col mb-5"},jy={class:"col-12"},zy={class:"flex flex-col mb-5"},Uy={class:"col-12"},Wy={class:"flex flex-row justify-between items-center"},Hy={key:1},qy={class:"flex flex-row justify-between items-center"},Yy={key:1,class:"text-red-500"},Ky={class:"flex flex-col"},Xy={class:"flex flex-row justify-between items-center"},Gy={__name:"FilterSortSidebar",props:r.mergeModels({headers:Array,operatorMap:Object,sortCallback:Function,filterCallback:Function,getColumnDatatype:Function,getDatatypeByField:Function},{sortBy:{},sortByModifiers:{},sortDirection:{},sortDirectionModifiers:{},showFilter:{},showFilterModifiers:{},filters:{},filtersModifiers:{}}),emits:["update:sortBy","update:sortDirection","update:showFilter","update:filters"],setup(t){const e=r.useModel(t,"sortBy"),n=r.useModel(t,"sortDirection"),i=r.useModel(t,"showFilter"),s=r.useModel(t,"filters"),o={gt:"is greater than",dateAfter:"is after",equals:"is equals",dateIs:"is equals",notEquals:"is not equals",dateIsNot:"is not equals",lt:"is less than",dateBefore:"is before",lte:"is less than or equal to",gte:"is greater than or equal to",between:"between",contains:"contains",startsWith:"starts with",notContains:"not contains",endsWith:"ends with"},a=[{label:"Starts with",value:"startsWith"},{label:"Contains",value:"contains"},{label:"Not contains",value:"notContains"},{label:"Ends with",value:"endsWith"},{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"}],l=[{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"},{label:"Less than",value:"lt"},{label:"Less than or equal to",value:"lte"},{label:"Greater than",value:"gt"},{label:"Greater than or equal to",value:"gte"}],c=[{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"}],d=[{label:"Date is",value:"dateIs"},{label:"Date is not",value:"dateIsNot"},{label:"Date is before",value:"dateBefore"},{label:"Date is after",value:"dateAfter"}],u=[{label:"ASC",value:1},{label:"DESC",value:-1}];let f=[];const h=r.computed(()=>t.headers.filter(S=>S.sortable)),m=r.computed(()=>t.headers.filter(S=>S.filterable)),p=S=>t.headers.filter(_=>{var O;return _.filterable?((O=s.value[S])==null?void 0:O.columnName)===_.name?!0:!s.value.some((P,v)=>v!==S&&P.columnName===_.name):!1}).map(_=>({label:_.name,value:_.field})),g=S=>{let _="";switch(t.getDatatypeByField(S.columnName).toLowerCase()){case"string":case"uuid":_="startsWith";break;case"date":_="dateIs";break;case"numeric":case"int":case"integer":_="equals";break;case"bool":case"boolean":_="equals";break}S.operator=_,S.value=""},y=S=>{const _=t.getDatatypeByField(S.columnName);switch(_&&_.toLowerCase()){case"integer":case"int":case"numeric":f=l;break;case"date":f=d;break;case"bool":case"boolean":f=c;break;default:f=a}return f},b=S=>{if(S&&S.columnName){const _=t.getDatatypeByField(S.columnName);return t.getColumnDatatype(_)}else return""},x=()=>{for(let S=0;S<s.value.length;S++){const _=s.value[S];_.editing=!1}s.value.push({columnName:"",value:"",operator:"",editing:!0})},w=S=>{s.value.splice(S,1)},E=S=>{S.editing=!S.editing},k=()=>{let S=[],_=JSON.parse(JSON.stringify(s.value));for(let O=0;O<_.length;O++){const P=_[O];delete P.editing,P.columnName&&P.operator&&P.value&&(P.columnType=t.getDatatypeByField(P.columnName),P.operator=t.operatorMap[P.operator],S.push(P))}t.filterCallback(S)},C=()=>{t.sortCallback()};return(S,_)=>{const O=r.resolveComponent("Select"),P=r.resolveComponent("Divider"),v=r.resolveComponent("InputNumber"),T=r.resolveComponent("DatePicker"),R=r.resolveComponent("InputText"),U=r.resolveComponent("Button"),Y=r.resolveComponent("Drawer");return r.openBlock(),r.createBlock(Y,{visible:i.value,"onUpdate:visible":_[4]||(_[4]=L=>i.value=L),header:"Sorting and Filter",blockScroll:!0,position:"right",class:"layout-profile-sidebar !w-full md:!w-80 lg:!w-[30rem]",pt:{closeButton:"ml-auto"}},{default:r.withCtx(()=>[r.createElementVNode("div",Ay,[_[5]||(_[5]=r.createElementVNode("div",{class:"col-12 font-bold"},"Sort Column",-1)),r.createElementVNode("div",My,[r.createVNode(O,{modelValue:e.value,"onUpdate:modelValue":_[0]||(_[0]=L=>e.value=L),options:h.value,optionLabel:"name",optionValue:"field",highlightOnSelect:!1,class:"w-full",onChange:_[1]||(_[1]=L=>C(S.event))},null,8,["modelValue","options"])])]),r.createElementVNode("div",Vy,[_[6]||(_[6]=r.createElementVNode("div",{class:"col-12 font-bold"},[r.createElementVNode("div",{class:"col-12 font-bold"},"Sort Direction")],-1)),r.createElementVNode("div",Ry,[r.createVNode(O,{modelValue:n.value,"onUpdate:modelValue":_[2]||(_[2]=L=>n.value=L),options:u,optionLabel:"label",optionValue:"value",highlightOnSelect:!1,class:"w-full",onChange:_[3]||(_[3]=L=>C(S.event))},null,8,["modelValue"])])]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value,(L,j)=>(r.openBlock(),r.createElementBlock("div",{key:j},[L.editing?(r.openBlock(),r.createElementBlock("div",Fy,[r.createVNode(P),r.createElementVNode("div",$y,[_[7]||(_[7]=r.createElementVNode("div",{class:"col-12 font-bold"},"Filter Column",-1)),r.createElementVNode("div",Ly,[r.createVNode(O,{modelValue:L.columnName,"onUpdate:modelValue":$=>L.columnName=$,options:p(j),optionLabel:"label",placeholder:"Select column",optionValue:"value",highlightOnSelect:!1,class:"w-full",onChange:$=>g(L)},null,8,["modelValue","onUpdate:modelValue","options","onChange"])])]),r.createElementVNode("div",Iy,[_[8]||(_[8]=r.createElementVNode("div",{class:"col-12 font-bold"},"Filter Operator",-1)),r.createElementVNode("div",jy,[r.createVNode(O,{modelValue:L.operator,"onUpdate:modelValue":$=>L.operator=$,options:y(L),optionLabel:"label",placeholder:"Select operator",optionValue:"value",highlightOnSelect:!1,class:"w-full"},null,8,["modelValue","onUpdate:modelValue","options"])])]),r.createElementVNode("div",zy,[_[9]||(_[9]=r.createElementVNode("div",{class:"col-12 font-bold"},"Filter value",-1)),r.createElementVNode("div",Uy,[b(L)=="numeric"?(r.openBlock(),r.createBlock(v,{key:0,format:!1,class:"w-full",modelValue:L.value,"onUpdate:modelValue":$=>L.value=$,placeholder:"Search value"},null,8,["modelValue","onUpdate:modelValue"])):b(L)=="date"?(r.openBlock(),r.createBlock(T,{key:1,class:"w-full",modelValue:L.value,"onUpdate:modelValue":$=>L.value=$,dateFormat:"mm/dd/yy",placeholder:"mm/dd/yyyy"},null,8,["modelValue","onUpdate:modelValue"])):(r.openBlock(),r.createBlock(R,{key:2,modelValue:L.value,"onUpdate:modelValue":$=>L.value=$,class:"w-full",placeholder:"Search value"},null,8,["modelValue","onUpdate:modelValue"]))])]),r.createElementVNode("div",Wy,[r.createVNode(U,{label:"Hide",icon:"",severity:"warn",onClick:$=>E(L)},null,8,["onClick"]),r.createVNode(U,{label:"Delete",icon:"",severity:"danger",onClick:$=>w(j)},null,8,["onClick"])])])):r.createCommentVNode("",!0),L.editing?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Hy,[r.createVNode(P),r.createElementVNode("div",qy,[r.createElementVNode("span",null,[L.columnName||L.operator||L.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createElementVNode("span",{class:r.normalizeClass({"text-red-500":!L.columnName})},r.toDisplayString(L.columnName?" "+L.columnName:" column"),3),r.createElementVNode("span",{class:r.normalizeClass({"text-red-500":!o[L.operator]})},r.toDisplayString(L.operator?" "+o[L.operator]:" operator"),3),r.createElementVNode("span",{class:r.normalizeClass({"text-red-500":!L.value})},r.toDisplayString(L.value?" "+L.value:" value"),3)],64)):(r.openBlock(),r.createElementBlock("span",Yy,"Filter is empty"))]),r.createVNode(U,{label:"Edit",icon:"",severity:"info",onClick:$=>E(L)},null,8,["onClick"])])]))]))),128)),r.createElementVNode("div",Ky,[r.createVNode(P),r.createElementVNode("div",Xy,[r.createVNode(U,{label:"Add",disabled:m.value.length===s.value.length,icon:"",severity:"success",onClick:x},null,8,["disabled"]),r.createVNode(U,{label:"Apply",severity:"info",onClick:k})])])]),_:1},8,["visible"])}}},Jy={class:"my-2"},Gt={__name:"EntityListFilters",setup(t){const e=r.inject("entityObject"),n=r.ref(!1),i=r.ref([]),s=r.ref([]),o=r.ref(""),a=r.ref(1);let l=r.ref("");const c=r.ref([]),d=r.ref([]),u={gt:"GREATER_THAN",dateAfter:"GREATER_THAN",equals:"EQUAL",dateIs:"EQUAL",notEquals:"NOT_EQUAL",dateIsNot:"NOT_EQUAL",lt:"LESS_THAN",dateBefore:"LESS_THAN",lte:"LESS_THAN_EQUAL",gte:"GREATER_THAN_EQUAL",between:"BETWEEN",contains:"CONTAINS",startsWith:"STARTS_WITH",notContains:"NOT_CONTAINS",endsWith:"ENDS_WITH"};r.watch(()=>e.state.data,E=>{if(E&&(c.value=e.getEntityColumns(E),d.value=b(c.value),o.value=="")){const k=e.getPrimaryKeyColumn(E);o.value=k.name}},{immediate:!0});const f=()=>{n.value=!n.value},h=E=>{s.value=E,m()},m=async()=>{const E={sortBy:[o.value],sortDirection:a.value===1?"ASC":"DESC",pageSize:e.state.data.pageSize,currentPage:e.state.data.currentPage,columnList:null,filter:s.value,fullTextSearch:l.value},k=await e.searchRecord(e.state.data,E);if(k!=null&&k.success){let C=k==null?void 0:k.response;e.setEntity(C)}},p=()=>{m()},g=()=>{i.value=[],s.value=[],m()},y=()=>{m()},b=E=>E.map(k=>({field:k.name,name:k.displayName?k.displayName:k.name,filterable:k.filterable,datatype:k.type,sortable:k.indexColumn,displayFormatKey:k.displayFormatKey,displayFormat:k.displayFormat})),x=E=>{switch(E.toLowerCase()){case"integer":case"int":case"numeric":return"numeric";case"date":return"date";case"bool":case"boolean":return"boolean";default:return"text"}},w=E=>{const k=c.value.find(C=>C.name===E);return k?k.type:null};return(E,k)=>{const C=r.resolveComponent("Button"),S=r.resolveComponent("InputIcon"),_=r.resolveComponent("InputText"),O=r.resolveComponent("IconField"),P=r.resolveComponent("Toolbar");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createVNode(P,{class:"p-2 my-2"},{start:r.withCtx(()=>[r.createElementVNode("div",Jy,[r.createVNode(C,{type:"button",size:"medium",icon:"pi pi-filter",label:"Filter",severity:"info",onClick:k[0]||(k[0]=v=>f())})]),r.createVNode(C,{class:"ml-3",size:"medium",type:"button",icon:"pi pi-filter-slash",label:"Clear",severity:"warn",onClick:k[1]||(k[1]=v=>g())})]),end:r.withCtx(()=>[r.createVNode(O,{iconPosition:"right",class:"block mt-2 md:mt-0"},{default:r.withCtx(()=>[r.createVNode(S,{onClick:k[2]||(k[2]=v=>y()),class:"pi pi-search"}),r.createVNode(_,{class:"w-full sm:w-auto",onKeyup:k[3]||(k[3]=r.withKeys(v=>y(),["enter"])),modelValue:r.unref(l),"onUpdate:modelValue":k[4]||(k[4]=v=>r.isRef(l)?l.value=v:l=v),placeholder:"Search..."},null,8,["modelValue"])]),_:1})]),_:1}),r.createVNode(Gy,{sortBy:o.value,"onUpdate:sortBy":k[5]||(k[5]=v=>o.value=v),sortDirection:a.value,"onUpdate:sortDirection":k[6]||(k[6]=v=>a.value=v),showFilter:n.value,"onUpdate:showFilter":k[7]||(k[7]=v=>n.value=v),filters:i.value,"onUpdate:filters":k[8]||(k[8]=v=>i.value=v),headers:d.value,operatorMap:u,sortCallback:p,filterCallback:h,getColumnDatatype:x,getDatatypeByField:w},null,8,["sortBy","sortDirection","showFilter","filters","headers"])],64)}}},mi={__name:"EntityListPagination",setup(t){const e=r.ref(25),n=r.ref(0),i=r.ref(0),s=r.ref(0);let o=r.inject("entityObject");const a=async l=>{e.value=l.rows,n.value=l.page,s.value=l.first;const c={sortBy:o.state.data.sortBy,sortDirection:o.state.data.sortDirection,columnList:null,filter:o.state.data.filters,fullTextSearch:o.state.data.fullTextSearch,pageSize:e.value,currentPage:n.value},d=await o.searchRecord(o.state.data,c);if(d!=null&&d.success){let u=d==null?void 0:d.response;o.setEntity(u),i.value=d.response.totalRecords,s.value=n.value*e.value}};return r.watch(()=>{var l,c;return(c=(l=o==null?void 0:o.state)==null?void 0:l.data)==null?void 0:c.totalRecords},l=>{i&&(i.value=l)},{immediate:!0}),(l,c)=>{const d=r.resolveComponent("Paginator");return r.openBlock(),r.createBlock(d,{class:"my-4",rows:e.value,totalRecords:i.value,rowsPerPageOptions:[10,25,50,100],onPage:a,template:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink CurrentPageReport RowsPerPageDropdown",currentPageReportTemplate:"Showing {first} to {last} of {totalRecords} items"},null,8,["rows","totalRecords"])}}},Qy={class:"flex flex-row justify-end p-2 my-2"},Jt={__name:"EntityListAddButton",setup(t){const e=r.ref(!1),n=()=>{e.value=!0};return(i,s)=>{const o=r.resolveComponent("Button");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",Qy,[r.createVNode(o,{label:"Add",size:"medium",icon:"pi pi-plus",onClick:s[0]||(s[0]=a=>n())})]),e.value?(r.openBlock(),r.createBlock(hi,{key:0,showEntityForm:e.value,"onUpdate:showEntityForm":s[1]||(s[1]=a=>e.value=a)},null,8,["showEntityForm"])):r.createCommentVNode("",!0)],64)}}},yl={__name:"EntityList",props:{entityName:String,listDisplay:String,listItemDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,showAddButton:Boolean,listFilerSlot:Boolean,className:{type:String,default:"default-class"}},setup(t,{expose:e}){const n=xs(),i=ot();r.provide("entityObject",n);const s=t;return e({props:s,reload:()=>{console.log("reload data")}}),r.watch(()=>i.globalConfigs.appId,async a=>{if(a){const l=await n.getEntity(s.entityName);l.success?n.setEntity(l.response):n.setEntity({result:[]})}},{immediate:!0}),(a,l)=>{var c,d,u;return a.$slots["list-item-display"]?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[t.showAddButton?(r.openBlock(),r.createBlock(Jt,{key:0})):r.createCommentVNode("",!0),t.listFilerSlot?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.listFilter||Gt),{key:1})):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(((u=(d=(c=r.unref(n))==null?void 0:c.state)==null?void 0:d.data)==null?void 0:u.result)||[],f=>r.renderSlot(a.$slots,"list-item-display",{item:f})),256))],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.listHeader||Py))),(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.listFilter||Gt))),t.showAddButton?(r.openBlock(),r.createBlock(Jt,{key:0})):r.createCommentVNode("",!0),(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.listDisplay||Oy),r.normalizeProps(r.guardReactiveProps({listItemDisplay:t.listItemDisplay})),null,16)),(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.listPagination||mi))),(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.listFooter||Dy)))],64))}}},Zy={key:0},eb=["href"],tb={key:1},nb={class:"action-buttons"},ib=De({__name:"EntityListingSingleRecord",props:{item:Object,entityName:String,showAddButton:Boolean,showFilters:Boolean,className:String,listDisplay:String,listHeader:String,listClass:String,listItemClass:String,listFooter:String,listFilter:String,listPagination:String,displayField:String,baseUrl:String,hrefKey:String,listItemDisplay:String,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},editable:Boolean,deletable:Boolean,linkedEntity:Array},setup(t){const e=t;console.log("props entitylistsingle record",e.item);const n=r.inject("entityObject"),i=r.ref([]),s=r.ref(null),o=r.ref(null),a=r.ref(!1),l=r.ref(!1);r.onMounted(()=>{var h;e.linkedEntity&&e.linkedEntity.length>0?i.value=Object.keys(e.linkedEntity[0]).map(m=>({name:m})):i.value=n==null?void 0:n.getEntityColumns(n.state.data),s.value=((h=i==null?void 0:i.value)==null?void 0:h.find(m=>m.name===e.displayField))||null,s.value&&(o.value=e==null?void 0:e.item[s.value.name])});const c=()=>{a.value=!0},d=()=>{l.value=!0},u=async h=>{h.remove?f():a.value=!1},f=async()=>{const h=n.getPrimaryKeyColumn(n.state.data),m=e.item[h.name],p=await n.entityRecordDelete(n.state.data,m);if(p!=null&&p.success){a.value=!1;const g=await n.searchRecord(n.state.data,{sortBy:n.state.data.sortBy,sortDirection:n.state.data.sortDirection,pageSize:n.state.data.pageSize,currentPage:n.state.data.currentPage,columnList:null,filter:n.state.data.filters,fullTextSearch:n.state.data.fullTextSearch});g!=null&&g.response&&n.setEntity(g.response)}};return(h,m)=>{const p=r.resolveComponent("Button");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("ul",{class:r.normalizeClass(e.className)},[s.value?(r.openBlock(),r.createElementBlock("li",Zy,[r.createElementVNode("a",{href:`${t.baseUrl}/${t.item[t.hrefKey]}`,target:"_blank",class:"hover:underline"},r.toDisplayString(o.value),9,eb)])):(r.openBlock(),r.createElementBlock("li",tb,[r.createElementVNode("span",null,"No matching field found for '"+r.toDisplayString(o.value)+"'.",1)])),r.createElementVNode("li",nb,[t.editable?(r.openBlock(),r.createBlock(p,{key:0,onClick:m[0]||(m[0]=g=>d()),icon:"pi pi-pencil",severity:"success",rounded:"","aria-label":"Edit"})):r.createCommentVNode("",!0),t.deletable?(r.openBlock(),r.createBlock(p,{key:1,onClick:m[1]||(m[1]=g=>c()),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"})):r.createCommentVNode("",!0)])],2),l.value?(r.openBlock(),r.createBlock(hi,{key:0,showEntityForm:l.value,"onUpdate:showEntityForm":m[2]||(m[2]=g=>l.value=g),item:t.item},null,8,["showEntityForm","item"])):r.createCommentVNode("",!0),a.value?(r.openBlock(),r.createBlock(_s,{key:1,showDeleteDialog:a.value,"onUpdate:showDeleteDialog":m[3]||(m[3]=g=>a.value=g),onOnDeleteItem:u},null,8,["showDeleteDialog"])):r.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-ff32a72b"]]),sb={key:0,class:"error-message"},ob={class:"text-red-500 font-bold"},rb={key:0},ab={key:1},lb={key:2},cb={key:3},db={key:1},bl=De({__name:"EntityListing",props:{entityName:String,listClass:String,listItemClass:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,listItemDisplay:String,showAddButton:Boolean,showFilters:Boolean,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},displayField:String,baseUrl:String,hrefKey:String,editable:Boolean,deletable:Boolean,linkedEntity:Array},setup(t,{expose:e,emit:n}){const i=xs(),s=ot();r.provide("entityObject",i);const o=n,a=t,l=r.ref([]);return a.linkedEntity?r.watch(()=>a.linkedEntity,u=>{u&&(l.value=u,o("linkedEntityChanged",u))},{immediate:!0}):r.watch(()=>i.state.data,u=>{u&&(l.value=u.result,o("linkedEntityChanged",u.result))},{immediate:!0}),e({props:a,reload:()=>{console.log("reload data")},filter:u=>{console.log("filter data in unordered",u)}}),r.watch(()=>s.globalConfigs.appId,async u=>{if(u)if(a.linkedEntity&&a.linkedEntity.length>0)i.setEntity(a.linkedEntity);else{const f=await i.getEntity(a.entityName);i.setEntity(f.success?f.response:{result:[]})}},{immediate:!0}),(u,f)=>{var h,m,p;return r.openBlock(),r.createElementBlock("div",r.mergeProps(u.$attrs,{class:"flex flex-col"}),[r.renderSlot(u.$slots,"header",{},void 0,!0),u.$slots["list-item-display"]?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[t.showAddButton?(r.openBlock(),r.createBlock(Jt,{key:0})):r.createCommentVNode("",!0),t.showFilters?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.listFilter||Gt),{key:1})):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(t.listClass)},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.linkedEntity&&t.linkedEntity.length>0?t.linkedEntity:((p=(m=(h=r.unref(i))==null?void 0:h.state)==null?void 0:m.data)==null?void 0:p.result)||[],g=>r.renderSlot(u.$slots,"list-item-display",{item:g,class:r.normalizeClass(t.listItemClass)},void 0,!0)),256))],2),t.showPagination?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.listPagination||mi),{key:2})):r.createCommentVNode("",!0)],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[!t.displayField||!t.baseUrl||!t.hrefKey?(r.openBlock(),r.createElementBlock("div",sb,[r.createElementVNode("p",ob,[f[0]||(f[0]=r.createTextVNode(" Error: Missing required props - ")),t.entityName?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",rb,"Entity Name")),t.displayField?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",ab,"Display Field")),t.baseUrl?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",lb,"Base Url")),t.hrefKey?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",cb,"Href Key"))])])):(r.openBlock(),r.createElementBlock("div",db,[t.showFilters?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.listFilter||Gt),{key:0})):r.createCommentVNode("",!0),t.showAddButton?(r.openBlock(),r.createBlock(Jt,{key:1})):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,(g,y)=>(r.openBlock(),r.createElementBlock("div",{key:y},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.listItemDisplay!=null&&t.listItemDisplay!=""?t.listItemDisplay:ib),r.mergeProps({ref_for:!0},{item:g,...a}),null,16))]))),128)),t.showPagination?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.listPagination||mi),{key:2})):r.createCommentVNode("",!0)])),r.renderSlot(u.$slots,"footer",{},void 0,!0)],64)),r.renderSlot(u.$slots,"footer",{},void 0,!0)],16)}}},[["__scopeId","data-v-36faf954"]]),ub={class:"p-6 bg-white shadow-md rounded-lg border border-gray-300 flex flex-col"},fb={class:"flex justify-between items-start gap-4"},hb={class:"flex-grow"},mb={class:"flex flex-col gap-2"},pb={class:"font-bold text-gray-700"},gb={class:"text-gray-600"},yb={class:"flex flex-col gap-2"},bb=De({__name:"EntityListingTileSingleRecord",props:{item:Object,entityName:String,showAddButton:Boolean,showFilters:Boolean,className:String,listDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,listItemDisplay:String,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},editable:Boolean,deletable:Boolean},setup(t){const e=t,n=r.inject("entityObject"),i=r.ref([]),s=r.ref(null),o=r.ref(null),a=r.ref(!1),l=r.ref(!1);r.onMounted(()=>{i.value=n.getEntityColumns(n.state.data),s.value=i.value.find(h=>h.name===e.displayField)||null,s.value&&(o.value=e.item[s.value.name])});const c=()=>{a.value=!0},d=()=>{l.value=!0},u=async h=>{h.remove?f():a.value=!1},f=async()=>{const h=n.getPrimaryKeyColumn(n.state.data),m=e.item[h.name],p=await n.entityRecordDelete(n.state.data,m);if(p!=null&&p.success){a.value=!1;const g=await n.searchRecord(n.state.data,{sortBy:n.state.data.sortBy,sortDirection:n.state.data.sortDirection,pageSize:n.state.data.pageSize,currentPage:n.state.data.currentPage,columnList:null,filter:n.state.data.filters,fullTextSearch:n.state.data.fullTextSearch});g!=null&&g.response&&n.setEntity(g.response)}};return(h,m)=>{const p=r.resolveComponent("Button");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",ub,[r.createElementVNode("div",fb,[r.createElementVNode("div",hb,[r.createElementVNode("div",mb,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value,(g,y)=>(r.openBlock(),r.createElementBlock("div",{key:y,class:"flex flex-col"},[r.createElementVNode("span",pb,r.toDisplayString(g.displayName||g.name)+":",1),r.createElementVNode("span",gb,r.toDisplayString(t.item[g.name]),1)]))),128))])]),r.createElementVNode("div",yb,[t.editable?(r.openBlock(),r.createBlock(p,{key:0,onClick:m[0]||(m[0]=g=>d()),icon:"pi pi-pencil",severity:"success",rounded:"","aria-label":"Edit"})):r.createCommentVNode("",!0),t.deletable?(r.openBlock(),r.createBlock(p,{key:1,onClick:m[1]||(m[1]=g=>c()),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"})):r.createCommentVNode("",!0)])])]),l.value?(r.openBlock(),r.createBlock(hi,{key:0,showEntityForm:l.value,"onUpdate:showEntityForm":m[2]||(m[2]=g=>l.value=g),item:t.item},null,8,["showEntityForm","item"])):r.createCommentVNode("",!0),a.value?(r.openBlock(),r.createBlock(_s,{key:1,showDeleteDialog:a.value,"onUpdate:showDeleteDialog":m[3]||(m[3]=g=>a.value=g),onOnDeleteItem:u},null,8,["showDeleteDialog"])):r.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-6ec4735d"]]),xb={class:"flex flex-wrap gap-4 p-2"},_b={key:0,class:"error-message"},kb={class:"text-red-500 font-bold"},Sb={key:0},wb={key:1},Eb={class:"flex flex-wrap gap-4 p-4"},xl=De({__name:"EntityListingTile",props:{entityName:String,listDisplay:String,listItemDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,showAddButton:Boolean,showFilters:Boolean,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},editable:Boolean,deletable:Boolean,dynamicPropName:{type:String,default:"item"}},setup(t,{expose:e}){const n=xs(),i=ot();r.provide("entityObject",n);const s=t,o=r.ref([]);return r.watch(()=>n.state.data,c=>{c&&(o.value=c.result)},{immediate:!0}),e({props:s,reload:()=>{console.log("reload data")},filter:()=>{console.log("filter data in unordered")}}),r.watch(()=>i.globalConfigs.appId,async c=>{if(c){const d=await n.getEntity(s.entityName);n.setEntity(d.success?d.response:{result:[]})}},{immediate:!0}),(c,d)=>{var u,f,h;return r.openBlock(),r.createElementBlock("div",r.normalizeProps(r.guardReactiveProps(c.$attrs)),[c.$slots["list-item-display-tile"]?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.renderSlot(c.$slots,"header",{},void 0,!0),t.showAddButton?(r.openBlock(),r.createBlock(Jt,{key:0})):r.createCommentVNode("",!0),t.showFilters?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.listFilter||Gt),{key:1})):r.createCommentVNode("",!0),r.createElementVNode("div",xb,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(((h=(f=(u=r.unref(n))==null?void 0:u.state)==null?void 0:f.data)==null?void 0:h.result)||[],(m,p)=>(r.openBlock(),r.createElementBlock("div",{key:p,class:"flex flex-col p-6 border border-gray-300 shadow-md rounded-lg bg-white w-full sm:w-1/2 md:w-1/3 lg:w-1/4 xl:w-1/5 2xl:w-1/8"},[r.renderSlot(c.$slots,"list-item-display-tile",r.normalizeProps({[t.dynamicPropName||""]:m}),void 0,!0)]))),128))]),r.renderSlot(c.$slots,"footer",{},void 0,!0)],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.renderSlot(c.$slots,"header",{},void 0,!0),t.entityName?(r.openBlock(),r.createElementBlock("div",wb,[t.showFilters?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.listFilter||Gt),{key:0})):r.createCommentVNode("",!0),t.showAddButton?(r.openBlock(),r.createBlock(Jt,{key:1})):r.createCommentVNode("",!0),r.createElementVNode("div",Eb,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,(m,p)=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.listItemDisplay!=null&&t.listItemDisplay!=""?t.listItemDisplay:bb),r.mergeProps({key:p,ref_for:!0},{item:m,...s}),null,16))),128))]),t.showPagination?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(t.listPagination||mi),{key:2})):r.createCommentVNode("",!0)])):(r.openBlock(),r.createElementBlock("div",_b,[r.createElementVNode("p",kb,[d[0]||(d[0]=r.createTextVNode(" Error: Missing required props - ")),t.entityName?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",Sb,"Entity Name"))])])),r.renderSlot(c.$slots,"footer",{},void 0,!0)],64))],16)}}},[["__scopeId","data-v-705f9c5c"]]),Cb={class:"p-6 bg-white shadow-md rounded-lg border border-gray-300 flex flex-col responsive-box"},Ob={class:"flex justify-between items-start gap-4"},vb={class:"flex-grow"},Nb={class:"flex flex-col gap-2"},Db={class:"font-bold text-gray-700"},Tb={class:"text-gray-600"},Bb={class:"flex flex-col gap-2"},Pb=De({__name:"EntityListingCarouselSingleRecord",props:{item:Object,entityName:String,showAddButton:Boolean,showFilters:Boolean,className:String,listDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,listItemDisplay:String,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},editable:Boolean,deletable:Boolean},setup(t){const e=t,n=r.inject("entityObject"),i=r.ref([]),s=r.ref(null),o=r.ref(null),a=r.ref(!1),l=r.ref(!1);r.onMounted(()=>{i.value=n.getEntityColumns(n.state.data),s.value=i.value.find(h=>h.name===e.displayField)||null,s.value&&(o.value=e.item[s.value.name])});const c=()=>{a.value=!0},d=()=>{l.value=!0},u=async h=>{h.remove?f():a.value=!1},f=async()=>{const h=n.getPrimaryKeyColumn(n.state.data),m=e.item[h.name],p=await n.entityRecordDelete(n.state.data,m);if(p!=null&&p.success){a.value=!1;const g=await n.searchRecord(n.state.data,{sortBy:n.state.data.sortBy,sortDirection:n.state.data.sortDirection,pageSize:n.state.data.pageSize,currentPage:n.state.data.currentPage,columnList:null,filter:n.state.data.filters,fullTextSearch:n.state.data.fullTextSearch});g!=null&&g.response&&n.setEntity(g.response)}};return(h,m)=>{const p=r.resolveComponent("Button");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",Cb,[r.createElementVNode("div",Ob,[r.createElementVNode("div",vb,[r.createElementVNode("div",Nb,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value,(g,y)=>(r.openBlock(),r.createElementBlock("div",{key:y,class:"flex flex-col"},[r.createElementVNode("span",Db,r.toDisplayString(g.displayName||g.name)+":",1),r.createElementVNode("span",Tb,r.toDisplayString(t.item[g.name]),1)]))),128))])]),r.createElementVNode("div",Bb,[t.editable?(r.openBlock(),r.createBlock(p,{key:0,onClick:m[0]||(m[0]=g=>d()),icon:"pi pi-pencil",severity:"success",rounded:"","aria-label":"Edit"})):r.createCommentVNode("",!0),t.deletable?(r.openBlock(),r.createBlock(p,{key:1,onClick:m[1]||(m[1]=g=>c()),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"})):r.createCommentVNode("",!0)])])]),l.value?(r.openBlock(),r.createBlock(hi,{key:0,showEntityForm:l.value,"onUpdate:showEntityForm":m[2]||(m[2]=g=>l.value=g),item:t.item},null,8,["showEntityForm","item"])):r.createCommentVNode("",!0),a.value?(r.openBlock(),r.createBlock(_s,{key:1,showDeleteDialog:a.value,"onUpdate:showDeleteDialog":m[3]||(m[3]=g=>a.value=g),onOnDeleteItem:u},null,8,["showDeleteDialog"])):r.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-7e37c710"]]);/**
157
157
  * Vue 3 Carousel 0.13.0
158
158
  * (c) 2025
159
159
  * @license MIT
@@ -162,21 +162,21 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
162
162
  `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const i=new this(e);return n.forEach(s=>i.set(s)),i}static accessor(e){const i=(this[sc]=this[sc]={accessors:{}}).accessors,s=this.prototype;function o(a){const l=xi(a);i[l]||(lx(s,a),i[l]=!0)}return B.isArray(e)?e.forEach(o):o(e),this}}Ge.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),B.reduceDescriptors(Ge.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(i){this[n]=i}}}),B.freezeMethods(Ge);function er(t,e){const n=this||bi,i=e||n,s=Ge.from(i.headers);let o=i.data;return B.forEach(t,function(l){o=l.call(n,o,s.normalize(),e?e.status:void 0)}),s.normalize(),o}function oc(t){return!!(t&&t.__CANCEL__)}function In(t,e,n){re.call(this,t??"canceled",re.ERR_CANCELED,e,n),this.name="CanceledError"}B.inherits(In,re,{__CANCEL__:!0});function rc(t,e,n){const i=n.config.validateStatus;!n.status||!i||i(n.status)?t(n):e(new re("Request failed with status code "+n.status,[re.ERR_BAD_REQUEST,re.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function cx(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function dx(t,e){t=t||10;const n=new Array(t),i=new Array(t);let s=0,o=0,a;return e=e!==void 0?e:1e3,function(c){const d=Date.now(),u=i[o];a||(a=d),n[s]=c,i[s]=d;let f=o,h=0;for(;f!==s;)h+=n[f++],f=f%t;if(s=(s+1)%t,s===o&&(o=(o+1)%t),d-a<e)return;const m=u&&d-u;return m?Math.round(h*1e3/m):void 0}}function ux(t,e){let n=0,i=1e3/e,s,o;const a=(d,u=Date.now())=>{n=u,s=null,o&&(clearTimeout(o),o=null),t.apply(null,d)};return[(...d)=>{const u=Date.now(),f=u-n;f>=i?a(d,u):(s=d,o||(o=setTimeout(()=>{o=null,a(s)},i-f)))},()=>s&&a(s)]}const Ns=(t,e,n=3)=>{let i=0;const s=dx(50,250);return ux(o=>{const a=o.loaded,l=o.lengthComputable?o.total:void 0,c=a-i,d=s(c),u=a<=l;i=a;const f={loaded:a,total:l,progress:l?a/l:void 0,bytes:c,rate:d||void 0,estimated:d&&l&&u?(l-a)/d:void 0,event:o,lengthComputable:l!=null,[e?"download":"upload"]:!0};t(f)},n)},ac=(t,e)=>{const n=t!=null;return[i=>e[0]({lengthComputable:n,total:t,loaded:i}),e[1]]},lc=t=>(...e)=>B.asap(()=>t(...e)),fx=Ue.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,Ue.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(Ue.origin),Ue.navigator&&/(msie|trident)/i.test(Ue.navigator.userAgent)):()=>!0,hx=Ue.hasStandardBrowserEnv?{write(t,e,n,i,s,o){const a=[t+"="+encodeURIComponent(e)];B.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),B.isString(i)&&a.push("path="+i),B.isString(s)&&a.push("domain="+s),o===!0&&a.push("secure"),document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function mx(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function px(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function cc(t,e){return t&&!mx(e)?px(t,e):e}const dc=t=>t instanceof Ge?{...t}:t;function bn(t,e){e=e||{};const n={};function i(d,u,f,h){return B.isPlainObject(d)&&B.isPlainObject(u)?B.merge.call({caseless:h},d,u):B.isPlainObject(u)?B.merge({},u):B.isArray(u)?u.slice():u}function s(d,u,f,h){if(B.isUndefined(u)){if(!B.isUndefined(d))return i(void 0,d,f,h)}else return i(d,u,f,h)}function o(d,u){if(!B.isUndefined(u))return i(void 0,u)}function a(d,u){if(B.isUndefined(u)){if(!B.isUndefined(d))return i(void 0,d)}else return i(void 0,u)}function l(d,u,f){if(f in e)return i(d,u);if(f in t)return i(void 0,d)}const c={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:l,headers:(d,u,f)=>s(dc(d),dc(u),f,!0)};return B.forEach(Object.keys(Object.assign({},t,e)),function(u){const f=c[u]||s,h=f(t[u],e[u],u);B.isUndefined(h)&&f!==l||(n[u]=h)}),n}const uc=t=>{const e=bn({},t);let{data:n,withXSRFToken:i,xsrfHeaderName:s,xsrfCookieName:o,headers:a,auth:l}=e;e.headers=a=Ge.from(a),e.url=ec(cc(e.baseURL,e.url),t.params,t.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let c;if(B.isFormData(n)){if(Ue.hasStandardBrowserEnv||Ue.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((c=a.getContentType())!==!1){const[d,...u]=c?c.split(";").map(f=>f.trim()).filter(Boolean):[];a.setContentType([d||"multipart/form-data",...u].join("; "))}}if(Ue.hasStandardBrowserEnv&&(i&&B.isFunction(i)&&(i=i(e)),i||i!==!1&&fx(e.url))){const d=s&&o&&hx.read(o);d&&a.set(s,d)}return e},gx=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,i){const s=uc(t);let o=s.data;const a=Ge.from(s.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:d}=s,u,f,h,m,p;function g(){m&&m(),p&&p(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let y=new XMLHttpRequest;y.open(s.method.toUpperCase(),s.url,!0),y.timeout=s.timeout;function b(){if(!y)return;const w=Ge.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),k={data:!l||l==="text"||l==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:w,config:t,request:y};rc(function(S){n(S),g()},function(S){i(S),g()},k),y=null}"onloadend"in y?y.onloadend=b:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(b)},y.onabort=function(){y&&(i(new re("Request aborted",re.ECONNABORTED,t,y)),y=null)},y.onerror=function(){i(new re("Network Error",re.ERR_NETWORK,t,y)),y=null},y.ontimeout=function(){let E=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const k=s.transitional||nc;s.timeoutErrorMessage&&(E=s.timeoutErrorMessage),i(new re(E,k.clarifyTimeoutError?re.ETIMEDOUT:re.ECONNABORTED,t,y)),y=null},o===void 0&&a.setContentType(null),"setRequestHeader"in y&&B.forEach(a.toJSON(),function(E,k){y.setRequestHeader(k,E)}),B.isUndefined(s.withCredentials)||(y.withCredentials=!!s.withCredentials),l&&l!=="json"&&(y.responseType=s.responseType),d&&([h,p]=Ns(d,!0),y.addEventListener("progress",h)),c&&y.upload&&([f,m]=Ns(c),y.upload.addEventListener("progress",f),y.upload.addEventListener("loadend",m)),(s.cancelToken||s.signal)&&(u=w=>{y&&(i(!w||w.type?new In(null,t,y):w),y.abort(),y=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const x=cx(s.url);if(x&&Ue.protocols.indexOf(x)===-1){i(new re("Unsupported protocol "+x+":",re.ERR_BAD_REQUEST,t));return}y.send(o||null)})},yx=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let i=new AbortController,s;const o=function(d){if(!s){s=!0,l();const u=d instanceof Error?d:this.reason;i.abort(u instanceof re?u:new In(u instanceof Error?u.message:u))}};let a=e&&setTimeout(()=>{a=null,o(new re(`timeout ${e} of ms exceeded`,re.ETIMEDOUT))},e);const l=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(d=>{d.unsubscribe?d.unsubscribe(o):d.removeEventListener("abort",o)}),t=null)};t.forEach(d=>d.addEventListener("abort",o));const{signal:c}=i;return c.unsubscribe=()=>B.asap(l),c}},bx=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let i=0,s;for(;i<n;)s=i+e,yield t.slice(i,s),i=s},xx=async function*(t,e){for await(const n of _x(t))yield*bx(n,e)},_x=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:i}=await e.read();if(n)break;yield i}}finally{await e.cancel()}},fc=(t,e,n,i)=>{const s=xx(t,e);let o=0,a,l=c=>{a||(a=!0,i&&i(c))};return new ReadableStream({async pull(c){try{const{done:d,value:u}=await s.next();if(d){l(),c.close();return}let f=u.byteLength;if(n){let h=o+=f;n(h)}c.enqueue(new Uint8Array(u))}catch(d){throw l(d),d}},cancel(c){return l(c),s.return()}},{highWaterMark:2})},Ds=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",hc=Ds&&typeof ReadableStream=="function",kx=Ds&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),mc=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Sx=hc&&mc(()=>{let t=!1;const e=new Request(Ue.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),pc=64*1024,tr=hc&&mc(()=>B.isReadableStream(new Response("").body)),Ts={stream:tr&&(t=>t.body)};Ds&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Ts[e]&&(Ts[e]=B.isFunction(t[e])?n=>n[e]():(n,i)=>{throw new re(`Response type '${e}' is not supported`,re.ERR_NOT_SUPPORT,i)})})})(new Response);const wx=async t=>{if(t==null)return 0;if(B.isBlob(t))return t.size;if(B.isSpecCompliantForm(t))return(await new Request(Ue.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(B.isArrayBufferView(t)||B.isArrayBuffer(t))return t.byteLength;if(B.isURLSearchParams(t)&&(t=t+""),B.isString(t))return(await kx(t)).byteLength},Ex=async(t,e)=>{const n=B.toFiniteNumber(t.getContentLength());return n??wx(e)},nr={http:H0,xhr:gx,fetch:Ds&&(async t=>{let{url:e,method:n,data:i,signal:s,cancelToken:o,timeout:a,onDownloadProgress:l,onUploadProgress:c,responseType:d,headers:u,withCredentials:f="same-origin",fetchOptions:h}=uc(t);d=d?(d+"").toLowerCase():"text";let m=yx([s,o&&o.toAbortSignal()],a),p;const g=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let y;try{if(c&&Sx&&n!=="get"&&n!=="head"&&(y=await Ex(u,i))!==0){let k=new Request(e,{method:"POST",body:i,duplex:"half"}),C;if(B.isFormData(i)&&(C=k.headers.get("content-type"))&&u.setContentType(C),k.body){const[S,_]=ac(y,Ns(lc(c)));i=fc(k.body,pc,S,_)}}B.isString(f)||(f=f?"include":"omit");const b="credentials"in Request.prototype;p=new Request(e,{...h,signal:m,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:i,duplex:"half",credentials:b?f:void 0});let x=await fetch(p);const w=tr&&(d==="stream"||d==="response");if(tr&&(l||w&&g)){const k={};["status","statusText","headers"].forEach(O=>{k[O]=x[O]});const C=B.toFiniteNumber(x.headers.get("content-length")),[S,_]=l&&ac(C,Ns(lc(l),!0))||[];x=new Response(fc(x.body,pc,S,()=>{_&&_(),g&&g()}),k)}d=d||"text";let E=await Ts[B.findKey(Ts,d)||"text"](x,t);return!w&&g&&g(),await new Promise((k,C)=>{rc(k,C,{data:E,headers:Ge.from(x.headers),status:x.status,statusText:x.statusText,config:t,request:p})})}catch(b){throw g&&g(),b&&b.name==="TypeError"&&/fetch/i.test(b.message)?Object.assign(new re("Network Error",re.ERR_NETWORK,t,p),{cause:b.cause||b}):re.from(b,b&&b.code,t,p)}})};B.forEach(nr,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const gc=t=>`- ${t}`,Cx=t=>B.isFunction(t)||t===null||t===!1,yc={getAdapter:t=>{t=B.isArray(t)?t:[t];const{length:e}=t;let n,i;const s={};for(let o=0;o<e;o++){n=t[o];let a;if(i=n,!Cx(n)&&(i=nr[(a=String(n)).toLowerCase()],i===void 0))throw new re(`Unknown adapter '${a}'`);if(i)break;s[a||"#"+o]=i}if(!i){const o=Object.entries(s).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=e?o.length>1?`since :
163
163
  `+o.map(gc).join(`
164
164
  `):" "+gc(o[0]):"as no adapter specified";throw new re("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return i},adapters:nr};function ir(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new In(null,t)}function bc(t){return ir(t),t.headers=Ge.from(t.headers),t.data=er.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),yc.getAdapter(t.adapter||bi.adapter)(t).then(function(i){return ir(t),i.data=er.call(t,t.transformResponse,i),i.headers=Ge.from(i.headers),i},function(i){return oc(i)||(ir(t),i&&i.response&&(i.response.data=er.call(t,t.transformResponse,i.response),i.response.headers=Ge.from(i.response.headers))),Promise.reject(i)})}const xc="1.7.9",Bs={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Bs[t]=function(i){return typeof i===t||"a"+(e<1?"n ":" ")+t}});const _c={};Bs.transitional=function(e,n,i){function s(o,a){return"[Axios v"+xc+"] Transitional option '"+o+"'"+a+(i?". "+i:"")}return(o,a,l)=>{if(e===!1)throw new re(s(a," has been removed"+(n?" in "+n:"")),re.ERR_DEPRECATED);return n&&!_c[a]&&(_c[a]=!0,console.warn(s(a," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(o,a,l):!0}},Bs.spelling=function(e){return(n,i)=>(console.warn(`${i} is likely a misspelling of ${e}`),!0)};function Ox(t,e,n){if(typeof t!="object")throw new re("options must be an object",re.ERR_BAD_OPTION_VALUE);const i=Object.keys(t);let s=i.length;for(;s-- >0;){const o=i[s],a=e[o];if(a){const l=t[o],c=l===void 0||a(l,o,t);if(c!==!0)throw new re("option "+o+" must be "+c,re.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new re("Unknown option "+o,re.ERR_BAD_OPTION)}}const Ps={assertOptions:Ox,validators:Bs},Et=Ps.validators;class xn{constructor(e){this.defaults=e,this.interceptors={request:new tc,response:new tc}}async request(e,n){try{return await this._request(e,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+=`
165
- `+o):i.stack=o}catch{}}throw i}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=bn(this.defaults,n);const{transitional:i,paramsSerializer:s,headers:o}=n;i!==void 0&&Ps.assertOptions(i,{silentJSONParsing:Et.transitional(Et.boolean),forcedJSONParsing:Et.transitional(Et.boolean),clarifyTimeoutError:Et.transitional(Et.boolean)},!1),s!=null&&(B.isFunction(s)?n.paramsSerializer={serialize:s}:Ps.assertOptions(s,{encode:Et.function,serialize:Et.function},!0)),Ps.assertOptions(n,{baseUrl:Et.spelling("baseURL"),withXsrfToken:Et.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&B.merge(o.common,o[n.method]);o&&B.forEach(["delete","get","head","post","put","patch","common"],p=>{delete o[p]}),n.headers=Ge.concat(a,o);const l=[];let c=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(c=c&&g.synchronous,l.unshift(g.fulfilled,g.rejected))});const d=[];this.interceptors.response.forEach(function(g){d.push(g.fulfilled,g.rejected)});let u,f=0,h;if(!c){const p=[bc.bind(this),void 0];for(p.unshift.apply(p,l),p.push.apply(p,d),h=p.length,u=Promise.resolve(n);f<h;)u=u.then(p[f++],p[f++]);return u}h=l.length;let m=n;for(f=0;f<h;){const p=l[f++],g=l[f++];try{m=p(m)}catch(y){g.call(this,y);break}}try{u=bc.call(this,m)}catch(p){return Promise.reject(p)}for(f=0,h=d.length;f<h;)u=u.then(d[f++],d[f++]);return u}getUri(e){e=bn(this.defaults,e);const n=cc(e.baseURL,e.url);return ec(n,e.params,e.paramsSerializer)}}B.forEach(["delete","get","head","options"],function(e){xn.prototype[e]=function(n,i){return this.request(bn(i||{},{method:e,url:n,data:(i||{}).data}))}}),B.forEach(["post","put","patch"],function(e){function n(i){return function(o,a,l){return this.request(bn(l||{},{method:e,headers:i?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}xn.prototype[e]=n(),xn.prototype[e+"Form"]=n(!0)});class sr{constructor(e){if(typeof e!="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 a=new Promise(l=>{i.subscribe(l),o=l}).then(s);return a.cancel=function(){i.unsubscribe(o)},a},e(function(o,a,l){i.reason||(i.reason=new In(o,a,l),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=i=>{e.abort(i)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new sr(function(s){e=s}),cancel:e}}}function vx(t){return function(n){return t.apply(null,n)}}function Nx(t){return B.isObject(t)&&t.isAxiosError===!0}const or={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(or).forEach(([t,e])=>{or[e]=t});function kc(t){const e=new xn(t),n=$l(xn.prototype.request,e);return B.extend(n,xn.prototype,e,{allOwnKeys:!0}),B.extend(n,e,null,{allOwnKeys:!0}),n.create=function(s){return kc(bn(t,s))},n}const Be=kc(bi);Be.Axios=xn,Be.CanceledError=In,Be.CancelToken=sr,Be.isCancel=oc,Be.VERSION=xc,Be.toFormData=Os,Be.AxiosError=re,Be.Cancel=Be.CanceledError,Be.all=function(e){return Promise.all(e)},Be.spread=vx,Be.isAxiosError=Nx,Be.mergeConfig=bn,Be.AxiosHeaders=Ge,Be.formToJSON=t=>ic(B.isHTMLForm(t)?new FormData(t):t),Be.getAdapter=yc.getAdapter,Be.HttpStatusCode=or,Be.default=Be;const Dx=["onMouseenter","onMouseleave"],Tx=["onClick"],Bx=["onClick"],Px={class:"ml-2"},Ax=["onClick"],Mx=["href"],Vx={class:"ml-2"},Rx=De({__name:"SampleMenu",props:{menu:String,layoutType:{type:String,default:"vertical",validator:t=>["horizontal","vertical"].includes(t)},menuName:{type:String,required:!0},variable:String,menuItems:Array},emits:["menuItems"],setup(t,{expose:e,emit:n}){const i=Ye.useRouter(),s=n,o=r.ref([]),a=t;r.onMounted(async()=>{console.log("Menu component mounted",a.menuItems);try{if(a.menuItems)o.value=a.menuItems;else{const d=await Be.get("https://mocki.io/v1/8955d801-36fb-4499-9d7d-6f7329fc8407");o.value=d.data.response}console.log("menuItems.value",o.value),o.value.forEach(d=>{d.children&&d.children.length>0&&(d.isOpen=!1),s("menuItems",o.value)})}catch(d){console.error("Error fetching menu items:",d)}});const l=d=>{o.value[d]&&o.value[d].children&&o.value[d].children.length>0&&(o.value[d].isOpen=!o.value[d].isOpen)},c=d=>{console.log("urlbdfkjdbfjkdbfkdfbdk"),i.push(o.value[index].url)};return e({props:a,goToUrl:c,toggleDropdown:l}),(d,u)=>(r.openBlock(),r.createElementBlock("div",{class:"card rounded-none p-0",style:r.normalizeStyle(t.layoutType==="horizontal"?"width: 100%;":"width: 10%;")},[r.createElementVNode("ul",{class:r.normalizeClass(["layout-menu",[t.layoutType==="horizontal"?"layout-menu-horizontal p-0 m-0 flex flex-row":"layout-menu-vertical p-0 m-0"]])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,(f,h)=>(r.openBlock(),r.createElementBlock("li",{key:f.id,class:r.normalizeClass(["layout-root-menuitem relative",{"is-open":f.isOpen}]),onMouseenter:m=>l(h),onMouseleave:m=>l(h)},[d.$slots["list-item-menu-parent"]?(r.openBlock(),r.createElementBlock("a",{key:0,onClick:m=>c()},[r.renderSlot(d.$slots,"list-item-menu-parent",r.normalizeProps({[t.variable||""]:f}),void 0,!0)],8,Tx)):(r.openBlock(),r.createElementBlock("a",{key:1,onClick:m=>c(),href:"#",class:"flex items-center p-3 text-primary-color cursor-pointer transition-colors duration-300"},[u[0]||(u[0]=r.createElementVNode("i",{class:"pi pi-home text-xl"},null,-1)),r.createElementVNode("span",Px,r.toDisplayString(f.displayLabel),1)],8,Bx)),f.isOpen?(r.openBlock(),r.createElementBlock("ul",{key:2,class:r.normalizeClass(["submenu",[t.layoutType==="horizontal"?"submenu-horizontal absolute top-full left-0 bg-white shadow-md z-1000":"submenu-vertical pl-5"]])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(f.children,(m,p)=>(r.openBlock(),r.createElementBlock("li",{key:m.id},[d.$slots["list-item-menu-child"]?(r.openBlock(),r.createElementBlock("a",{key:0,onClick:g=>l(h)},[r.renderSlot(d.$slots,"list-item-menu-child",r.normalizeProps({[t.variable||""]:m}),void 0,!0)],8,Ax)):(r.openBlock(),r.createElementBlock("a",{key:1,href:m.url,class:"layout-submenu-item flex items-center p-3 text-primary-color cursor-pointer transition-colors duration-300"},[u[1]||(u[1]=r.createElementVNode("i",{class:"pi pi-bars text-xl"},null,-1)),r.createElementVNode("span",Vx,r.toDisplayString(m.displayLabel),1)],8,Mx))]))),128))],2)):r.createCommentVNode("",!0)],42,Dx))),128))],2)],4))}},[["__scopeId","data-v-8f1c5b51"]]),Fx=["onMouseenter","onMouseleave"],$x=["onClick"],Lx=["onClick"],Ix={class:"ml-2"},jx=["onClick"],zx=["href"],Ux={class:"ml-2"},Wx=De({__name:"ContraMenu",props:{menu:String,layoutType:{type:String,default:"vertical",validator:t=>["horizontal","vertical"].includes(t)},menuName:{type:String,required:!0},variable:String,menuItems:Array},setup(t){const e=Ye.useRouter(),n=r.ref([]),i=t;r.onMounted(()=>{n.value=i.menuItems,n.value.forEach(a=>{a.children&&a.children.length>0&&(a.isOpen=!1)})});const s=a=>{n.value[a]&&n.value[a].children&&n.value[a].children.length>0&&(n.value[a].isOpen=!n.value[a].isOpen)},o=a=>{e.push(n.value[index].url)};return(a,l)=>(r.openBlock(),r.createElementBlock("div",{class:"card rounded-none p-0",style:r.normalizeStyle(t.layoutType==="horizontal"?"width: 100%;":"width: 10%;")},[r.createElementVNode("ul",{class:r.normalizeClass(["layout-menu",[t.layoutType==="horizontal"?"layout-menu-horizontal p-0 m-0 flex flex-row space-x-6":"layout-menu-vertical p-0 m-0"]])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.value,(c,d)=>(r.openBlock(),r.createElementBlock("li",{key:c.id,class:r.normalizeClass(["layout-root-menuitem relative group",{"is-open":c.isOpen}]),onMouseenter:u=>s(d),onMouseleave:u=>s(d)},[a.$slots["list-item-menu-parent"]?(r.openBlock(),r.createElementBlock("a",{key:0,onClick:u=>o()},[r.renderSlot(a.$slots,"list-item-menu-parent",r.normalizeProps({[t.variable||""]:c}),void 0,!0)],8,$x)):(r.openBlock(),r.createElementBlock("a",{key:1,onClick:u=>o(),class:"flex items-center p-3 text-white hover:text-green-500 cursor-pointer transition-all duration-300 ease-in-out group-hover:bg-gradient-to-r from-green-400 to-green-600 group-hover:shadow-xl rounded-md"},[l[0]||(l[0]=r.createElementVNode("i",{class:"pi pi-home text-xl"},null,-1)),r.createElementVNode("span",Ix,r.toDisplayString(c.displayLabel),1)],8,Lx)),c.isOpen?(r.openBlock(),r.createElementBlock("ul",{key:2,class:r.normalizeClass(["submenu transition-all ease-in-out duration-300 opacity-0",[t.layoutType==="horizontal"?"submenu-horizontal absolute top-full left-0 bg-black text-white shadow-lg rounded-md p-2":"submenu-vertical pl-5 mt-2 bg-black text-white shadow-lg rounded-md"]])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.children,(u,f)=>(r.openBlock(),r.createElementBlock("li",{key:u.id},[a.$slots["list-item-menu-child"]?(r.openBlock(),r.createElementBlock("a",{key:0,onClick:h=>s(d)},[r.renderSlot(a.$slots,"list-item-menu-child",r.normalizeProps({[t.variable||""]:u}),void 0,!0)],8,jx)):(r.openBlock(),r.createElementBlock("a",{key:1,href:u.url,class:"layout-submenu-item flex items-center p-3 text-white hover:text-green-500 cursor-pointer transition-all duration-300 ease-in-out"},[l[1]||(l[1]=r.createElementVNode("i",{class:"pi pi-bars text-xl"},null,-1)),r.createElementVNode("span",Ux,r.toDisplayString(u.displayLabel),1)],8,zx))]))),128))],2)):r.createCommentVNode("",!0)],42,Fx))),128))],2)],4))}},[["__scopeId","data-v-198f3d06"]]),Hx=["onMouseenter","onMouseleave"],qx=["onClick"],Yx=["onClick"],Kx={class:"ml-2"},Xx=["onClick"],Gx=["href"],Jx={class:"ml-2"},Qx=De({__name:"UltraLightMenu",props:{menu:String,layoutType:{type:String,default:"vertical",validator:t=>["horizontal","vertical"].includes(t)},menuName:{type:String,required:!0},variable:String,menuItems:Array},setup(t){const e=Ye.useRouter(),n=r.ref([]),i=t;r.onMounted(async()=>{console.log("Menu component mounted",i.menuItems);try{if(i.menuItems)n.value=i.menuItems;else{const a=await Be.get("https://mocki.io/v1/8955d801-36fb-4499-9d7d-6f7329fc8407");n.value=a.data.response}console.log("menuItems.value",n.value),n.value.forEach(a=>{a.children&&a.children.length>0&&(a.isOpen=!1)})}catch(a){console.error("Error fetching menu items:",a)}});const s=a=>{n.value[a]&&n.value[a].children&&n.value[a].children.length>0&&(n.value[a].isOpen=!n.value[a].isOpen)},o=a=>{e.push(n.value[a].url)};return(a,l)=>(r.openBlock(),r.createElementBlock("div",{class:"card rounded-none p-0",style:r.normalizeStyle(t.layoutType==="horizontal"?"width: 100%;":"width: 250px;")},[r.createElementVNode("ul",{class:r.normalizeClass(["layout-menu",[t.layoutType==="horizontal"?"layout-menu-horizontal p-0 m-0 flex flex-row justify-around":"layout-menu-vertical p-0 m-0"]])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.value,(c,d)=>(r.openBlock(),r.createElementBlock("li",{key:c.id,class:r.normalizeClass(["layout-root-menuitem relative",{"is-open":c.isOpen}]),onMouseenter:u=>s(d),onMouseleave:u=>s(d)},[a.$slots["list-item-menu-parent"]?(r.openBlock(),r.createElementBlock("a",{key:0,onClick:u=>o(d),class:"menu-item"},[r.renderSlot(a.$slots,"list-item-menu-parent",r.normalizeProps({[t.variable||""]:c}),void 0,!0)],8,qx)):(r.openBlock(),r.createElementBlock("a",{key:1,onClick:u=>o(d),href:"#",class:"flex items-center p-4 text-white rounded-lg cursor-pointer transition-all duration-300 transform hover:scale-105 menu-item"},[l[0]||(l[0]=r.createElementVNode("i",{class:"pi pi-home text-xl"},null,-1)),r.createElementVNode("span",Kx,r.toDisplayString(c.displayLabel),1)],8,Yx)),c.isOpen?(r.openBlock(),r.createElementBlock("ul",{key:2,class:r.normalizeClass(["submenu transition-all ease-in-out duration-300",[t.layoutType==="horizontal"?"submenu-horizontal absolute top-full left-0 bg-blue-600 shadow-xl rounded-lg z-1000":"submenu-vertical pl-5 mt-2 text-white shadow-md rounded-md"]])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.children,(u,f)=>(r.openBlock(),r.createElementBlock("li",{key:u.id},[a.$slots["list-item-menu-child"]?(r.openBlock(),r.createElementBlock("a",{key:0,onClick:h=>s(d),class:"submenu-item"},[r.renderSlot(a.$slots,"list-item-menu-child",r.normalizeProps({[t.variable||""]:u}),void 0,!0)],8,Xx)):(r.openBlock(),r.createElementBlock("a",{key:1,href:u.url,class:"layout-submenu-item flex items-center p-3 text-white hover:text-blue-400 cursor-pointer transition-all duration-300 transform hover:scale-105"},[l[1]||(l[1]=r.createElementVNode("i",{class:"pi pi-bars text-xl"},null,-1)),r.createElementVNode("span",Jx,r.toDisplayString(u.displayLabel),1)],8,Gx))]))),128))],2)):r.createCommentVNode("",!0)],42,Hx))),128))],2)],4))}},[["__scopeId","data-v-70c2ee80"]]),Zx={key:0},e_={key:1},Sc=De({__name:"Menu",props:{menuName:{type:String,required:!0},menu:String,layoutType:{type:String,default:"vertical",validator:t=>["horizontal","vertical"].includes(t)},variable:String,refra:String},emits:["menuItems"],setup(t,{expose:e,emit:n}){const i=r.ref(null),s=n,o=f=>{i.value.goToUrl()},a=f=>{s("menuItems",f),console.log("Menu Items 2nd:",f)},l=t,c=r.ref([]),d=r.ref(!1),u={sample:Rx,contra:Wx,ultra:Qx};return r.onMounted(async()=>{try{const f=await Be.get("https://mocki.io/v1/8955d801-36fb-4499-9d7d-6f7329fc8407");c.value=f.data.response,d.value=!0,c.value.forEach(h=>{h.children&&h.children.length>0&&(h.isOpen=!1)})}catch(f){console.error("Error fetching menu items:",f)}console.log("props.ref",l.refra)}),e({goToUrl:o}),(f,h)=>f.$slots["list-item-menu-parent"]?(r.openBlock(),r.createElementBlock("div",Zx,[d.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(u[l.menuName]),r.mergeProps({key:0},l,{"menu-items":c.value}),r.createSlots({_:2},[r.renderList(f.$slots,(m,p)=>({name:p,fn:r.withCtx(g=>[r.renderSlot(f.$slots,p,r.normalizeProps(r.guardReactiveProps(g)),void 0,!0)])}))]),1040,["menu-items"])):r.createCommentVNode("",!0)])):(r.openBlock(),r.createElementBlock("div",e_,[d.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(u[l.menuName]),r.mergeProps({key:0},l,{"menu-items":c.value,ref_key:"componentsRef",ref:i,onMenuItems:a}),null,16,["menu-items"])):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-48a32302"]]),t_={class:"relative w-full"},n_={class:"absolute left-3 top-[-10px] bg-white px-1 text-xs text-gray-600 text"},i_={class:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"},s_=["placeholder"],o_={key:0,style:{color:"var(--secondary-color)"},class:"absolute left-3 top-full mt-1 text-xs"},wc={__name:"TextInput",props:r.mergeModels({label:{type:String,default:"Label"},placeholder:{type:String,default:"Enter value"},editable:{type:Boolean,default:!0},icon:{type:String,default:""},error:{type:Boolean,default:!1}},{inputValue:{},inputValueModifiers:{}}),emits:["update:inputValue"],setup(t){let e=r.useModel(t,"inputValue");return(n,i)=>(r.openBlock(),r.createElementBlock("div",t_,[r.createElementVNode("label",n_,r.toDisplayString(t.label),1),r.createElementVNode("span",i_,[r.createElementVNode("i",{class:r.normalizeClass(t.icon),style:{"font-size":"1rem"}},null,2)]),r.withDirectives(r.createElementVNode("input",{class:"w-[406px] h-[40px] pl-10 py-2 border border-[var(--border-color)] rounded-lg placeholder:text-xs focus:border-[var(--primary-fore-color)] focus:ring-0 focus:outline-none text","onUpdate:modelValue":i[0]||(i[0]=s=>r.isRef(e)?e.value=s:e=s),placeholder:t.placeholder},null,8,s_),[[r.vModelText,r.unref(e)]]),t.error?(r.openBlock(),r.createElementBlock("small",o_,[r.createElementVNode("pre",null,r.toDisplayString(t.label)+" is required",1)])):r.createCommentVNode("",!0)]))}},r_={install(t,e){t.component("CSEntityGrid",Ro),t.component("csentitygrid",Ro),t.component("CSEntityList",yl),t.component("csentitylist",yl),t.component("CSFieldExpression",Rl),t.component("csfieldexpression",Rl),t.component("CSEntityBarChart",ul),t.component("csentitybarchart",ul),t.component("CSEntityLineChart",fl),t.component("csentitylinechart",fl),t.component("CSEntityPieChart",hl),t.component("csentitypiechart",hl),t.component("CSEntityPolarChart",ml),t.component("csentitypolarchart",ml),t.component("CSEntityRadarChart",pl),t.component("csentityradarchart",pl),t.component("CSEntity360View",gl),t.component("csentity360view",gl),t.component("CSEntityListing",bl),t.component("csentitylisting",bl),t.component("CSEntityListingTile",xl),t.component("csentitylistingtile",xl),t.component("CSEntityListingCarousel",Ml),t.component("csentitylistingcarousel",Ml),t.component("CSEntitySelection",Ho),t.component("csentityselection",Ho),t.component("CSEntityExplorer",Fl),t.component("csentityexplorer",Fl),t.component("CSMenu",Sc),t.component("csmenu",Sc),t.component("CSTextInput",wc),t.component("cstextinput",wc)}},Ec=6048e5,a_=864e5,Cc=Symbol.for("constructDateFrom");function Qt(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&Cc in t?t[Cc](e):t instanceof Date?new t.constructor(e):new Date(e)}function gt(t,e){return Qt(e||t,t)}let l_={};function As(){return l_}function _i(t,e){var l,c,d,u;const n=As(),i=(e==null?void 0:e.weekStartsOn)??((c=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,s=gt(t,e==null?void 0:e.in),o=s.getDay(),a=(o<i?7:0)+o-i;return s.setDate(s.getDate()-a),s.setHours(0,0,0,0),s}function Ms(t,e){return _i(t,{...e,weekStartsOn:1})}function Oc(t,e){const n=gt(t,e==null?void 0:e.in),i=n.getFullYear(),s=Qt(n,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const o=Ms(s),a=Qt(n,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=Ms(a);return n.getTime()>=o.getTime()?i+1:n.getTime()>=l.getTime()?i:i-1}function vc(t){const e=gt(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function c_(t,...e){const n=Qt.bind(null,e.find(i=>typeof i=="object"));return e.map(n)}function Nc(t,e){const n=gt(t,e==null?void 0:e.in);return n.setHours(0,0,0,0),n}function d_(t,e,n){const[i,s]=c_(n==null?void 0:n.in,t,e),o=Nc(i),a=Nc(s),l=+o-vc(o),c=+a-vc(a);return Math.round((l-c)/a_)}function u_(t,e){const n=Oc(t,e),i=Qt(t,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),Ms(i)}function f_(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function h_(t){return!(!f_(t)&&typeof t!="number"||isNaN(+gt(t)))}function m_(t,e){const n=gt(t,e==null?void 0:e.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const p_={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"}},g_=(t,e,n)=>{let i;const s=p_[t];return typeof s=="string"?i=s:e===1?i=s.one:i=s.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function rr(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const y_={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},b_={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},x_={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},__={date:rr({formats:y_,defaultWidth:"full"}),time:rr({formats:b_,defaultWidth:"full"}),dateTime:rr({formats:x_,defaultWidth:"full"})},k_={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},S_=(t,e,n,i)=>k_[t];function ki(t){return(e,n)=>{const i=n!=null&&n.context?String(n.context):"standalone";let s;if(i==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,l=n!=null&&n.width?String(n.width):a;s=t.formattingValues[l]||t.formattingValues[a]}else{const a=t.defaultWidth,l=n!=null&&n.width?String(n.width):t.defaultWidth;s=t.values[l]||t.values[a]}const o=t.argumentCallback?t.argumentCallback(e):e;return s[o]}}const w_={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},E_={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},C_={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"]},O_={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"]},v_={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"}},N_={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"}},D_={ordinalNumber:(t,e)=>{const n=Number(t),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"},era:ki({values:w_,defaultWidth:"wide"}),quarter:ki({values:E_,defaultWidth:"wide",argumentCallback:t=>t-1}),month:ki({values:C_,defaultWidth:"wide"}),day:ki({values:O_,defaultWidth:"wide"}),dayPeriod:ki({values:v_,defaultWidth:"wide",formattingValues:N_,defaultFormattingWidth:"wide"})};function Si(t){return(e,n={})=>{const i=n.width,s=i&&t.matchPatterns[i]||t.matchPatterns[t.defaultMatchWidth],o=e.match(s);if(!o)return null;const a=o[0],l=i&&t.parsePatterns[i]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?B_(l,f=>f.test(a)):T_(l,f=>f.test(a));let d;d=t.valueCallback?t.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const u=e.slice(a.length);return{value:d,rest:u}}}function T_(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function B_(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function P_(t){return(e,n={})=>{const i=e.match(t.matchPattern);if(!i)return null;const s=i[0],o=e.match(t.parsePattern);if(!o)return null;let a=t.valueCallback?t.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;const l=e.slice(s.length);return{value:a,rest:l}}}const A_=/^(\d+)(th|st|nd|rd)?/i,M_=/\d+/i,V_={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},R_={any:[/^b/i,/^(a|c)/i]},F_={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},$_={any:[/1/i,/2/i,/3/i,/4/i]},L_={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},I_={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]},j_={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},z_={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]},U_={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},W_={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}},H_={ordinalNumber:P_({matchPattern:A_,parsePattern:M_,valueCallback:t=>parseInt(t,10)}),era:Si({matchPatterns:V_,defaultMatchWidth:"wide",parsePatterns:R_,defaultParseWidth:"any"}),quarter:Si({matchPatterns:F_,defaultMatchWidth:"wide",parsePatterns:$_,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Si({matchPatterns:L_,defaultMatchWidth:"wide",parsePatterns:I_,defaultParseWidth:"any"}),day:Si({matchPatterns:j_,defaultMatchWidth:"wide",parsePatterns:z_,defaultParseWidth:"any"}),dayPeriod:Si({matchPatterns:U_,defaultMatchWidth:"any",parsePatterns:W_,defaultParseWidth:"any"})},q_={code:"en-US",formatDistance:g_,formatLong:__,formatRelative:S_,localize:D_,match:H_,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Y_(t,e){const n=gt(t,e==null?void 0:e.in);return d_(n,m_(n))+1}function K_(t,e){const n=gt(t,e==null?void 0:e.in),i=+Ms(n)-+u_(n);return Math.round(i/Ec)+1}function Dc(t,e){var u,f,h,m;const n=gt(t,e==null?void 0:e.in),i=n.getFullYear(),s=As(),o=(e==null?void 0:e.firstWeekContainsDate)??((f=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??s.firstWeekContainsDate??((m=(h=s.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,a=Qt((e==null?void 0:e.in)||t,0);a.setFullYear(i+1,0,o),a.setHours(0,0,0,0);const l=_i(a,e),c=Qt((e==null?void 0:e.in)||t,0);c.setFullYear(i,0,o),c.setHours(0,0,0,0);const d=_i(c,e);return+n>=+l?i+1:+n>=+d?i:i-1}function X_(t,e){var l,c,d,u;const n=As(),i=(e==null?void 0:e.firstWeekContainsDate)??((c=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,s=Dc(t,e),o=Qt((e==null?void 0:e.in)||t,0);return o.setFullYear(s,0,i),o.setHours(0,0,0,0),_i(o,e)}function G_(t,e){const n=gt(t,e==null?void 0:e.in),i=+_i(n,e)-+X_(n,e);return Math.round(i/Ec)+1}function ye(t,e){const n=t<0?"-":"",i=Math.abs(t).toString().padStart(e,"0");return n+i}const Zt={y(t,e){const n=t.getFullYear(),i=n>0?n:1-n;return ye(e==="yy"?i%100:i,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):ye(n+1,2)},d(t,e){return ye(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){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(t,e){return ye(t.getHours()%12||12,e.length)},H(t,e){return ye(t.getHours(),e.length)},m(t,e){return ye(t.getMinutes(),e.length)},s(t,e){return ye(t.getSeconds(),e.length)},S(t,e){const n=e.length,i=t.getMilliseconds(),s=Math.trunc(i*Math.pow(10,n-3));return ye(s,e.length)}},jn={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Tc={G:function(t,e,n){const i=t.getFullYear()>0?1:0;switch(e){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(t,e,n){if(e==="yo"){const i=t.getFullYear(),s=i>0?i:1-i;return n.ordinalNumber(s,{unit:"year"})}return Zt.y(t,e)},Y:function(t,e,n,i){const s=Dc(t,i),o=s>0?s:1-s;if(e==="YY"){const a=o%100;return ye(a,2)}return e==="Yo"?n.ordinalNumber(o,{unit:"year"}):ye(o,e.length)},R:function(t,e){const n=Oc(t);return ye(n,e.length)},u:function(t,e){const n=t.getFullYear();return ye(n,e.length)},Q:function(t,e,n){const i=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return ye(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(t,e,n){const i=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return ye(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(t,e,n){const i=t.getMonth();switch(e){case"M":case"MM":return Zt.M(t,e);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(t,e,n){const i=t.getMonth();switch(e){case"L":return String(i+1);case"LL":return ye(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(t,e,n,i){const s=G_(t,i);return e==="wo"?n.ordinalNumber(s,{unit:"week"}):ye(s,e.length)},I:function(t,e,n){const i=K_(t);return e==="Io"?n.ordinalNumber(i,{unit:"week"}):ye(i,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):Zt.d(t,e)},D:function(t,e,n){const i=Y_(t);return e==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):ye(i,e.length)},E:function(t,e,n){const i=t.getDay();switch(e){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(t,e,n,i){const s=t.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return ye(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(t,e,n,i){const s=t.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return ye(o,e.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(t,e,n){const i=t.getDay(),s=i===0?7:i;switch(e){case"i":return String(s);case"ii":return ye(s,e.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(t,e,n){const s=t.getHours()/12>=1?"pm":"am";switch(e){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(t,e,n){const i=t.getHours();let s;switch(i===12?s=jn.noon:i===0?s=jn.midnight:s=i/12>=1?"pm":"am",e){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(t,e,n){const i=t.getHours();let s;switch(i>=17?s=jn.evening:i>=12?s=jn.afternoon:i>=4?s=jn.morning:s=jn.night,e){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(t,e,n){if(e==="ho"){let i=t.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Zt.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):Zt.H(t,e)},K:function(t,e,n){const i=t.getHours()%12;return e==="Ko"?n.ordinalNumber(i,{unit:"hour"}):ye(i,e.length)},k:function(t,e,n){let i=t.getHours();return i===0&&(i=24),e==="ko"?n.ordinalNumber(i,{unit:"hour"}):ye(i,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):Zt.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):Zt.s(t,e)},S:function(t,e){return Zt.S(t,e)},X:function(t,e,n){const i=t.getTimezoneOffset();if(i===0)return"Z";switch(e){case"X":return Pc(i);case"XXXX":case"XX":return _n(i);case"XXXXX":case"XXX":default:return _n(i,":")}},x:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"x":return Pc(i);case"xxxx":case"xx":return _n(i);case"xxxxx":case"xxx":default:return _n(i,":")}},O:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Bc(i,":");case"OOOO":default:return"GMT"+_n(i,":")}},z:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Bc(i,":");case"zzzz":default:return"GMT"+_n(i,":")}},t:function(t,e,n){const i=Math.trunc(+t/1e3);return ye(i,e.length)},T:function(t,e,n){return ye(+t,e.length)}};function Bc(t,e=""){const n=t>0?"-":"+",i=Math.abs(t),s=Math.trunc(i/60),o=i%60;return o===0?n+String(s):n+String(s)+e+ye(o,2)}function Pc(t,e){return t%60===0?(t>0?"-":"+")+ye(Math.abs(t)/60,2):_n(t,e)}function _n(t,e=""){const n=t>0?"-":"+",i=Math.abs(t),s=ye(Math.trunc(i/60),2),o=ye(i%60,2);return n+s+e+o}const Ac=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},Mc=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},J_={p:Mc,P:(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],i=n[1],s=n[2];if(!s)return Ac(t,e);let o;switch(i){case"P":o=e.dateTime({width:"short"});break;case"PP":o=e.dateTime({width:"medium"});break;case"PPP":o=e.dateTime({width:"long"});break;case"PPPP":default:o=e.dateTime({width:"full"});break}return o.replace("{{date}}",Ac(i,e)).replace("{{time}}",Mc(s,e))}},Q_=/^D+$/,Z_=/^Y+$/,ek=["D","DD","YY","YYYY"];function tk(t){return Q_.test(t)}function nk(t){return Z_.test(t)}function ik(t,e,n){const i=sk(t,e,n);if(console.warn(i),ek.includes(t))throw new RangeError(i)}function sk(t,e,n){const i=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const ok=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,rk=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ak=/^'([^]*?)'?$/,lk=/''/g,ck=/[a-zA-Z]/;function Vc(t,e,n){var u,f,h,m;const i=As(),s=i.locale??q_,o=i.firstWeekContainsDate??((f=(u=i.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,a=i.weekStartsOn??((m=(h=i.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??0,l=gt(t,n==null?void 0:n.in);if(!h_(l))throw new RangeError("Invalid time value");let c=e.match(rk).map(p=>{const g=p[0];if(g==="p"||g==="P"){const y=J_[g];return y(p,s.formatLong)}return p}).join("").match(ok).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const g=p[0];if(g==="'")return{isToken:!1,value:dk(p)};if(Tc[g])return{isToken:!0,value:p};if(g.match(ck))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:p}});s.localize.preprocessor&&(c=s.localize.preprocessor(l,c));const d={firstWeekContainsDate:o,weekStartsOn:a,locale:s};return c.map(p=>{if(!p.isToken)return p.value;const g=p.value;(nk(g)||tk(g))&&ik(g,e,String(t));const y=Tc[g[0]];return y(l,g,s.localize,d)}).join("")}function dk(t){const e=t.match(ak);return e?e[1].replace(lk,"'"):t}const uk=Object.freeze(Object.defineProperty({__proto__:null,default:{beforeMount(t,e){const{value:n,arg:i}=e;if(t&&n){const s=Vc(new Date(n),i||"yyyy-MM-dd");t.textContent=s}},updated(t,e){const{value:n,arg:i}=e;if(t&&n){const s=Vc(new Date(n),i||"yyyy-MM-dd");t.textContent=s}}}},Symbol.toStringTag,{value:"Module"})),fk=Object.freeze(Object.defineProperty({__proto__:null,default:{beforeMount(t,e){const{value:n,arg:i}=e;n&&(t.textContent=t.textContent.toUpperCase())},updated(t,e){const{value:n,arg:i}=e;n&&(t.textContent=t.textContent.toUpperCase())}}},Symbol.toStringTag,{value:"Module"}));/*!
165
+ `+o):i.stack=o}catch{}}throw i}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=bn(this.defaults,n);const{transitional:i,paramsSerializer:s,headers:o}=n;i!==void 0&&Ps.assertOptions(i,{silentJSONParsing:Et.transitional(Et.boolean),forcedJSONParsing:Et.transitional(Et.boolean),clarifyTimeoutError:Et.transitional(Et.boolean)},!1),s!=null&&(B.isFunction(s)?n.paramsSerializer={serialize:s}:Ps.assertOptions(s,{encode:Et.function,serialize:Et.function},!0)),Ps.assertOptions(n,{baseUrl:Et.spelling("baseURL"),withXsrfToken:Et.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&B.merge(o.common,o[n.method]);o&&B.forEach(["delete","get","head","post","put","patch","common"],p=>{delete o[p]}),n.headers=Ge.concat(a,o);const l=[];let c=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(c=c&&g.synchronous,l.unshift(g.fulfilled,g.rejected))});const d=[];this.interceptors.response.forEach(function(g){d.push(g.fulfilled,g.rejected)});let u,f=0,h;if(!c){const p=[bc.bind(this),void 0];for(p.unshift.apply(p,l),p.push.apply(p,d),h=p.length,u=Promise.resolve(n);f<h;)u=u.then(p[f++],p[f++]);return u}h=l.length;let m=n;for(f=0;f<h;){const p=l[f++],g=l[f++];try{m=p(m)}catch(y){g.call(this,y);break}}try{u=bc.call(this,m)}catch(p){return Promise.reject(p)}for(f=0,h=d.length;f<h;)u=u.then(d[f++],d[f++]);return u}getUri(e){e=bn(this.defaults,e);const n=cc(e.baseURL,e.url);return ec(n,e.params,e.paramsSerializer)}}B.forEach(["delete","get","head","options"],function(e){xn.prototype[e]=function(n,i){return this.request(bn(i||{},{method:e,url:n,data:(i||{}).data}))}}),B.forEach(["post","put","patch"],function(e){function n(i){return function(o,a,l){return this.request(bn(l||{},{method:e,headers:i?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}xn.prototype[e]=n(),xn.prototype[e+"Form"]=n(!0)});class sr{constructor(e){if(typeof e!="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 a=new Promise(l=>{i.subscribe(l),o=l}).then(s);return a.cancel=function(){i.unsubscribe(o)},a},e(function(o,a,l){i.reason||(i.reason=new In(o,a,l),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=i=>{e.abort(i)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new sr(function(s){e=s}),cancel:e}}}function vx(t){return function(n){return t.apply(null,n)}}function Nx(t){return B.isObject(t)&&t.isAxiosError===!0}const or={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(or).forEach(([t,e])=>{or[e]=t});function kc(t){const e=new xn(t),n=$l(xn.prototype.request,e);return B.extend(n,xn.prototype,e,{allOwnKeys:!0}),B.extend(n,e,null,{allOwnKeys:!0}),n.create=function(s){return kc(bn(t,s))},n}const Be=kc(bi);Be.Axios=xn,Be.CanceledError=In,Be.CancelToken=sr,Be.isCancel=oc,Be.VERSION=xc,Be.toFormData=Os,Be.AxiosError=re,Be.Cancel=Be.CanceledError,Be.all=function(e){return Promise.all(e)},Be.spread=vx,Be.isAxiosError=Nx,Be.mergeConfig=bn,Be.AxiosHeaders=Ge,Be.formToJSON=t=>ic(B.isHTMLForm(t)?new FormData(t):t),Be.getAdapter=yc.getAdapter,Be.HttpStatusCode=or,Be.default=Be;const Dx=["onMouseenter","onMouseleave"],Tx=["onClick"],Bx=["onClick"],Px={class:"ml-2"},Ax=["onClick"],Mx=["href"],Vx={class:"ml-2"},Rx=De({__name:"SampleMenu",props:{menu:String,layoutType:{type:String,default:"vertical",validator:t=>["horizontal","vertical"].includes(t)},menuName:{type:String,required:!0},variable:String,menuItems:Array},emits:["menuItems"],setup(t,{expose:e,emit:n}){const i=Ye.useRouter(),s=n,o=r.ref([]),a=t;r.onMounted(async()=>{console.log("Menu component mounted",a.menuItems);try{if(a.menuItems)o.value=a.menuItems;else{const d=await Be.get("https://mocki.io/v1/8955d801-36fb-4499-9d7d-6f7329fc8407");o.value=d.data.response}console.log("menuItems.value",o.value),o.value.forEach(d=>{d.children&&d.children.length>0&&(d.isOpen=!1),s("menuItems",o.value)})}catch(d){console.error("Error fetching menu items:",d)}});const l=d=>{o.value[d]&&o.value[d].children&&o.value[d].children.length>0&&(o.value[d].isOpen=!o.value[d].isOpen)},c=d=>{console.log("urlbdfkjdbfjkdbfkdfbdk"),i.push(o.value[index].url)};return e({props:a,goToUrl:c,toggleDropdown:l}),(d,u)=>(r.openBlock(),r.createElementBlock("div",{class:"card rounded-none p-0",style:r.normalizeStyle(t.layoutType==="horizontal"?"width: 100%;":"width: 10%;")},[r.createElementVNode("ul",{class:r.normalizeClass(["layout-menu",[t.layoutType==="horizontal"?"layout-menu-horizontal p-0 m-0 flex flex-row":"layout-menu-vertical p-0 m-0"]])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,(f,h)=>(r.openBlock(),r.createElementBlock("li",{key:f.id,class:r.normalizeClass(["layout-root-menuitem relative",{"is-open":f.isOpen}]),onMouseenter:m=>l(h),onMouseleave:m=>l(h)},[d.$slots["list-item-menu-parent"]?(r.openBlock(),r.createElementBlock("a",{key:0,onClick:m=>c()},[r.renderSlot(d.$slots,"list-item-menu-parent",r.normalizeProps({[t.variable||""]:f}),void 0,!0)],8,Tx)):(r.openBlock(),r.createElementBlock("a",{key:1,onClick:m=>c(),href:"#",class:"flex items-center p-3 text-primary-color cursor-pointer transition-colors duration-300"},[u[0]||(u[0]=r.createElementVNode("i",{class:"pi pi-home text-xl"},null,-1)),r.createElementVNode("span",Px,r.toDisplayString(f.displayLabel),1)],8,Bx)),f.isOpen?(r.openBlock(),r.createElementBlock("ul",{key:2,class:r.normalizeClass(["submenu",[t.layoutType==="horizontal"?"submenu-horizontal absolute top-full left-0 bg-white shadow-md z-1000":"submenu-vertical pl-5"]])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(f.children,(m,p)=>(r.openBlock(),r.createElementBlock("li",{key:m.id},[d.$slots["list-item-menu-child"]?(r.openBlock(),r.createElementBlock("a",{key:0,onClick:g=>l(h)},[r.renderSlot(d.$slots,"list-item-menu-child",r.normalizeProps({[t.variable||""]:m}),void 0,!0)],8,Ax)):(r.openBlock(),r.createElementBlock("a",{key:1,href:m.url,class:"layout-submenu-item flex items-center p-3 text-primary-color cursor-pointer transition-colors duration-300"},[u[1]||(u[1]=r.createElementVNode("i",{class:"pi pi-bars text-xl"},null,-1)),r.createElementVNode("span",Vx,r.toDisplayString(m.displayLabel),1)],8,Mx))]))),128))],2)):r.createCommentVNode("",!0)],42,Dx))),128))],2)],4))}},[["__scopeId","data-v-8f1c5b51"]]),Fx=["onMouseenter","onMouseleave"],$x=["onClick"],Lx=["onClick"],Ix={class:"ml-2"},jx=["onClick"],zx=["href"],Ux={class:"ml-2"},Wx=De({__name:"ContraMenu",props:{menu:String,layoutType:{type:String,default:"vertical",validator:t=>["horizontal","vertical"].includes(t)},menuName:{type:String,required:!0},variable:String,menuItems:Array},setup(t){const e=Ye.useRouter(),n=r.ref([]),i=t;r.onMounted(()=>{n.value=i.menuItems,n.value.forEach(a=>{a.children&&a.children.length>0&&(a.isOpen=!1)})});const s=a=>{n.value[a]&&n.value[a].children&&n.value[a].children.length>0&&(n.value[a].isOpen=!n.value[a].isOpen)},o=a=>{e.push(n.value[index].url)};return(a,l)=>(r.openBlock(),r.createElementBlock("div",{class:"card rounded-none p-0",style:r.normalizeStyle(t.layoutType==="horizontal"?"width: 100%;":"width: 10%;")},[r.createElementVNode("ul",{class:r.normalizeClass(["layout-menu",[t.layoutType==="horizontal"?"layout-menu-horizontal p-0 m-0 flex flex-row space-x-6":"layout-menu-vertical p-0 m-0"]])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.value,(c,d)=>(r.openBlock(),r.createElementBlock("li",{key:c.id,class:r.normalizeClass(["layout-root-menuitem relative group",{"is-open":c.isOpen}]),onMouseenter:u=>s(d),onMouseleave:u=>s(d)},[a.$slots["list-item-menu-parent"]?(r.openBlock(),r.createElementBlock("a",{key:0,onClick:u=>o()},[r.renderSlot(a.$slots,"list-item-menu-parent",r.normalizeProps({[t.variable||""]:c}),void 0,!0)],8,$x)):(r.openBlock(),r.createElementBlock("a",{key:1,onClick:u=>o(),class:"flex items-center p-3 text-white hover:text-green-500 cursor-pointer transition-all duration-300 ease-in-out group-hover:bg-gradient-to-r from-green-400 to-green-600 group-hover:shadow-xl rounded-md"},[l[0]||(l[0]=r.createElementVNode("i",{class:"pi pi-home text-xl"},null,-1)),r.createElementVNode("span",Ix,r.toDisplayString(c.displayLabel),1)],8,Lx)),c.isOpen?(r.openBlock(),r.createElementBlock("ul",{key:2,class:r.normalizeClass(["submenu transition-all ease-in-out duration-300 opacity-0",[t.layoutType==="horizontal"?"submenu-horizontal absolute top-full left-0 bg-black text-white shadow-lg rounded-md p-2":"submenu-vertical pl-5 mt-2 bg-black text-white shadow-lg rounded-md"]])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.children,(u,f)=>(r.openBlock(),r.createElementBlock("li",{key:u.id},[a.$slots["list-item-menu-child"]?(r.openBlock(),r.createElementBlock("a",{key:0,onClick:h=>s(d)},[r.renderSlot(a.$slots,"list-item-menu-child",r.normalizeProps({[t.variable||""]:u}),void 0,!0)],8,jx)):(r.openBlock(),r.createElementBlock("a",{key:1,href:u.url,class:"layout-submenu-item flex items-center p-3 text-white hover:text-green-500 cursor-pointer transition-all duration-300 ease-in-out"},[l[1]||(l[1]=r.createElementVNode("i",{class:"pi pi-bars text-xl"},null,-1)),r.createElementVNode("span",Ux,r.toDisplayString(u.displayLabel),1)],8,zx))]))),128))],2)):r.createCommentVNode("",!0)],42,Fx))),128))],2)],4))}},[["__scopeId","data-v-198f3d06"]]),Hx=["onMouseenter","onMouseleave"],qx=["onClick"],Yx=["onClick"],Kx={class:"ml-2"},Xx=["onClick"],Gx=["href"],Jx={class:"ml-2"},Qx=De({__name:"UltraLightMenu",props:{menu:String,layoutType:{type:String,default:"vertical",validator:t=>["horizontal","vertical"].includes(t)},menuName:{type:String,required:!0},variable:String,menuItems:Array},setup(t){const e=Ye.useRouter(),n=r.ref([]),i=t;r.onMounted(async()=>{console.log("Menu component mounted",i.menuItems);try{if(i.menuItems)n.value=i.menuItems;else{const a=await Be.get("https://mocki.io/v1/8955d801-36fb-4499-9d7d-6f7329fc8407");n.value=a.data.response}console.log("menuItems.value",n.value),n.value.forEach(a=>{a.children&&a.children.length>0&&(a.isOpen=!1)})}catch(a){console.error("Error fetching menu items:",a)}});const s=a=>{n.value[a]&&n.value[a].children&&n.value[a].children.length>0&&(n.value[a].isOpen=!n.value[a].isOpen)},o=a=>{e.push(n.value[a].url)};return(a,l)=>(r.openBlock(),r.createElementBlock("div",{class:"card rounded-none p-0",style:r.normalizeStyle(t.layoutType==="horizontal"?"width: 100%;":"width: 250px;")},[r.createElementVNode("ul",{class:r.normalizeClass(["layout-menu",[t.layoutType==="horizontal"?"layout-menu-horizontal p-0 m-0 flex flex-row justify-around":"layout-menu-vertical p-0 m-0"]])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.value,(c,d)=>(r.openBlock(),r.createElementBlock("li",{key:c.id,class:r.normalizeClass(["layout-root-menuitem relative",{"is-open":c.isOpen}]),onMouseenter:u=>s(d),onMouseleave:u=>s(d)},[a.$slots["list-item-menu-parent"]?(r.openBlock(),r.createElementBlock("a",{key:0,onClick:u=>o(d),class:"menu-item"},[r.renderSlot(a.$slots,"list-item-menu-parent",r.normalizeProps({[t.variable||""]:c}),void 0,!0)],8,qx)):(r.openBlock(),r.createElementBlock("a",{key:1,onClick:u=>o(d),href:"#",class:"flex items-center p-4 text-white rounded-lg cursor-pointer transition-all duration-300 transform hover:scale-105 menu-item"},[l[0]||(l[0]=r.createElementVNode("i",{class:"pi pi-home text-xl"},null,-1)),r.createElementVNode("span",Kx,r.toDisplayString(c.displayLabel),1)],8,Yx)),c.isOpen?(r.openBlock(),r.createElementBlock("ul",{key:2,class:r.normalizeClass(["submenu transition-all ease-in-out duration-300",[t.layoutType==="horizontal"?"submenu-horizontal absolute top-full left-0 bg-blue-600 shadow-xl rounded-lg z-1000":"submenu-vertical pl-5 mt-2 text-white shadow-md rounded-md"]])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.children,(u,f)=>(r.openBlock(),r.createElementBlock("li",{key:u.id},[a.$slots["list-item-menu-child"]?(r.openBlock(),r.createElementBlock("a",{key:0,onClick:h=>s(d),class:"submenu-item"},[r.renderSlot(a.$slots,"list-item-menu-child",r.normalizeProps({[t.variable||""]:u}),void 0,!0)],8,Xx)):(r.openBlock(),r.createElementBlock("a",{key:1,href:u.url,class:"layout-submenu-item flex items-center p-3 text-white hover:text-blue-400 cursor-pointer transition-all duration-300 transform hover:scale-105"},[l[1]||(l[1]=r.createElementVNode("i",{class:"pi pi-bars text-xl"},null,-1)),r.createElementVNode("span",Jx,r.toDisplayString(u.displayLabel),1)],8,Gx))]))),128))],2)):r.createCommentVNode("",!0)],42,Hx))),128))],2)],4))}},[["__scopeId","data-v-70c2ee80"]]),Zx={key:0},e_={key:1},Sc=De({__name:"Menu",props:{menuName:{type:String,required:!0},menu:String,layoutType:{type:String,default:"vertical",validator:t=>["horizontal","vertical"].includes(t)},variable:String,refra:String},emits:["menuItems"],setup(t,{expose:e,emit:n}){const i=r.ref(null),s=n,o=f=>{i.value.goToUrl()},a=f=>{s("menuItems",f),console.log("Menu Items 2nd:",f)},l=t,c=r.ref([]),d=r.ref(!1),u={sample:Rx,contra:Wx,ultra:Qx};return r.onMounted(async()=>{try{const f=await Be.get("https://mocki.io/v1/8955d801-36fb-4499-9d7d-6f7329fc8407");c.value=f.data.response,d.value=!0,c.value.forEach(h=>{h.children&&h.children.length>0&&(h.isOpen=!1)})}catch(f){console.error("Error fetching menu items:",f)}console.log("props.ref",l.refra)}),e({goToUrl:o}),(f,h)=>f.$slots["list-item-menu-parent"]?(r.openBlock(),r.createElementBlock("div",Zx,[d.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(u[l.menuName]),r.mergeProps({key:0},l,{"menu-items":c.value}),r.createSlots({_:2},[r.renderList(f.$slots,(m,p)=>({name:p,fn:r.withCtx(g=>[r.renderSlot(f.$slots,p,r.normalizeProps(r.guardReactiveProps(g)),void 0,!0)])}))]),1040,["menu-items"])):r.createCommentVNode("",!0)])):(r.openBlock(),r.createElementBlock("div",e_,[d.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(u[l.menuName]),r.mergeProps({key:0},l,{"menu-items":c.value,ref_key:"componentsRef",ref:i,onMenuItems:a}),null,16,["menu-items"])):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-48a32302"]]),t_={class:"absolute left-3 top-[-10px] px-1 text-xs text-gray-600 text"},n_={class:"absolute left-3 top-1/2 transform -translate-y-1/2 text--[var(--span-color)]"},i_=["placeholder"],s_={key:0,style:{color:"var(--secondary-color)"},class:"absolute left-3 top-full mt-1 text-xs"},wc={__name:"TextInput",props:r.mergeModels({label:{type:String,default:"Label"},placeholder:{type:String,default:"Enter value"},editable:{type:Boolean,default:!0},icon:{type:String,default:""},error:{type:Boolean,default:!1}},{inputValue:{},inputValueModifiers:{}}),emits:["update:inputValue"],setup(t){let e=r.useModel(t,"inputValue");return(n,i)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps({class:"relative"},n.$attrs),[r.createElementVNode("label",t_,r.toDisplayString(t.label),1),r.createElementVNode("span",n_,[r.createElementVNode("i",{class:r.normalizeClass(t.icon),style:{"font-size":"1rem"}},null,2)]),r.withDirectives(r.createElementVNode("input",{class:"w-full h-[40px] pl-10 py-2 border border-[var(--border-color)] rounded-lg placeholder:text-xs focus:border-[var(--primary-fore-color)] focus:ring-0 focus:outline-none text","onUpdate:modelValue":i[0]||(i[0]=s=>r.isRef(e)?e.value=s:e=s),placeholder:t.placeholder},null,8,i_),[[r.vModelText,r.unref(e)]]),t.error?(r.openBlock(),r.createElementBlock("small",s_,[r.createElementVNode("pre",null,r.toDisplayString(t.label)+" is required",1)])):r.createCommentVNode("",!0)],16))}},o_={install(t,e){t.component("CSEntityGrid",Ro),t.component("csentitygrid",Ro),t.component("CSEntityList",yl),t.component("csentitylist",yl),t.component("CSFieldExpression",Rl),t.component("csfieldexpression",Rl),t.component("CSEntityBarChart",ul),t.component("csentitybarchart",ul),t.component("CSEntityLineChart",fl),t.component("csentitylinechart",fl),t.component("CSEntityPieChart",hl),t.component("csentitypiechart",hl),t.component("CSEntityPolarChart",ml),t.component("csentitypolarchart",ml),t.component("CSEntityRadarChart",pl),t.component("csentityradarchart",pl),t.component("CSEntity360View",gl),t.component("csentity360view",gl),t.component("CSEntityListing",bl),t.component("csentitylisting",bl),t.component("CSEntityListingTile",xl),t.component("csentitylistingtile",xl),t.component("CSEntityListingCarousel",Ml),t.component("csentitylistingcarousel",Ml),t.component("CSEntitySelection",Ho),t.component("csentityselection",Ho),t.component("CSEntityExplorer",Fl),t.component("csentityexplorer",Fl),t.component("CSMenu",Sc),t.component("csmenu",Sc),t.component("CSTextInput",wc),t.component("cstextinput",wc)}},Ec=6048e5,r_=864e5,Cc=Symbol.for("constructDateFrom");function Qt(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&Cc in t?t[Cc](e):t instanceof Date?new t.constructor(e):new Date(e)}function gt(t,e){return Qt(e||t,t)}let a_={};function As(){return a_}function _i(t,e){var l,c,d,u;const n=As(),i=(e==null?void 0:e.weekStartsOn)??((c=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,s=gt(t,e==null?void 0:e.in),o=s.getDay(),a=(o<i?7:0)+o-i;return s.setDate(s.getDate()-a),s.setHours(0,0,0,0),s}function Ms(t,e){return _i(t,{...e,weekStartsOn:1})}function Oc(t,e){const n=gt(t,e==null?void 0:e.in),i=n.getFullYear(),s=Qt(n,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const o=Ms(s),a=Qt(n,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=Ms(a);return n.getTime()>=o.getTime()?i+1:n.getTime()>=l.getTime()?i:i-1}function vc(t){const e=gt(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function l_(t,...e){const n=Qt.bind(null,e.find(i=>typeof i=="object"));return e.map(n)}function Nc(t,e){const n=gt(t,e==null?void 0:e.in);return n.setHours(0,0,0,0),n}function c_(t,e,n){const[i,s]=l_(n==null?void 0:n.in,t,e),o=Nc(i),a=Nc(s),l=+o-vc(o),c=+a-vc(a);return Math.round((l-c)/r_)}function d_(t,e){const n=Oc(t,e),i=Qt(t,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),Ms(i)}function u_(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function f_(t){return!(!u_(t)&&typeof t!="number"||isNaN(+gt(t)))}function h_(t,e){const n=gt(t,e==null?void 0:e.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const m_={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"}},p_=(t,e,n)=>{let i;const s=m_[t];return typeof s=="string"?i=s:e===1?i=s.one:i=s.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function rr(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const g_={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},y_={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},b_={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},x_={date:rr({formats:g_,defaultWidth:"full"}),time:rr({formats:y_,defaultWidth:"full"}),dateTime:rr({formats:b_,defaultWidth:"full"})},__={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},k_=(t,e,n,i)=>__[t];function ki(t){return(e,n)=>{const i=n!=null&&n.context?String(n.context):"standalone";let s;if(i==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,l=n!=null&&n.width?String(n.width):a;s=t.formattingValues[l]||t.formattingValues[a]}else{const a=t.defaultWidth,l=n!=null&&n.width?String(n.width):t.defaultWidth;s=t.values[l]||t.values[a]}const o=t.argumentCallback?t.argumentCallback(e):e;return s[o]}}const S_={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},w_={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},E_={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"]},C_={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"]},O_={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"}},v_={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"}},N_={ordinalNumber:(t,e)=>{const n=Number(t),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"},era:ki({values:S_,defaultWidth:"wide"}),quarter:ki({values:w_,defaultWidth:"wide",argumentCallback:t=>t-1}),month:ki({values:E_,defaultWidth:"wide"}),day:ki({values:C_,defaultWidth:"wide"}),dayPeriod:ki({values:O_,defaultWidth:"wide",formattingValues:v_,defaultFormattingWidth:"wide"})};function Si(t){return(e,n={})=>{const i=n.width,s=i&&t.matchPatterns[i]||t.matchPatterns[t.defaultMatchWidth],o=e.match(s);if(!o)return null;const a=o[0],l=i&&t.parsePatterns[i]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?T_(l,f=>f.test(a)):D_(l,f=>f.test(a));let d;d=t.valueCallback?t.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const u=e.slice(a.length);return{value:d,rest:u}}}function D_(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function T_(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function B_(t){return(e,n={})=>{const i=e.match(t.matchPattern);if(!i)return null;const s=i[0],o=e.match(t.parsePattern);if(!o)return null;let a=t.valueCallback?t.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;const l=e.slice(s.length);return{value:a,rest:l}}}const P_=/^(\d+)(th|st|nd|rd)?/i,A_=/\d+/i,M_={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},V_={any:[/^b/i,/^(a|c)/i]},R_={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},F_={any:[/1/i,/2/i,/3/i,/4/i]},$_={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},L_={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]},I_={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},j_={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]},z_={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}},W_={ordinalNumber:B_({matchPattern:P_,parsePattern:A_,valueCallback:t=>parseInt(t,10)}),era:Si({matchPatterns:M_,defaultMatchWidth:"wide",parsePatterns:V_,defaultParseWidth:"any"}),quarter:Si({matchPatterns:R_,defaultMatchWidth:"wide",parsePatterns:F_,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Si({matchPatterns:$_,defaultMatchWidth:"wide",parsePatterns:L_,defaultParseWidth:"any"}),day:Si({matchPatterns:I_,defaultMatchWidth:"wide",parsePatterns:j_,defaultParseWidth:"any"}),dayPeriod:Si({matchPatterns:z_,defaultMatchWidth:"any",parsePatterns:U_,defaultParseWidth:"any"})},H_={code:"en-US",formatDistance:p_,formatLong:x_,formatRelative:k_,localize:N_,match:W_,options:{weekStartsOn:0,firstWeekContainsDate:1}};function q_(t,e){const n=gt(t,e==null?void 0:e.in);return c_(n,h_(n))+1}function Y_(t,e){const n=gt(t,e==null?void 0:e.in),i=+Ms(n)-+d_(n);return Math.round(i/Ec)+1}function Dc(t,e){var u,f,h,m;const n=gt(t,e==null?void 0:e.in),i=n.getFullYear(),s=As(),o=(e==null?void 0:e.firstWeekContainsDate)??((f=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??s.firstWeekContainsDate??((m=(h=s.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,a=Qt((e==null?void 0:e.in)||t,0);a.setFullYear(i+1,0,o),a.setHours(0,0,0,0);const l=_i(a,e),c=Qt((e==null?void 0:e.in)||t,0);c.setFullYear(i,0,o),c.setHours(0,0,0,0);const d=_i(c,e);return+n>=+l?i+1:+n>=+d?i:i-1}function K_(t,e){var l,c,d,u;const n=As(),i=(e==null?void 0:e.firstWeekContainsDate)??((c=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,s=Dc(t,e),o=Qt((e==null?void 0:e.in)||t,0);return o.setFullYear(s,0,i),o.setHours(0,0,0,0),_i(o,e)}function X_(t,e){const n=gt(t,e==null?void 0:e.in),i=+_i(n,e)-+K_(n,e);return Math.round(i/Ec)+1}function ye(t,e){const n=t<0?"-":"",i=Math.abs(t).toString().padStart(e,"0");return n+i}const Zt={y(t,e){const n=t.getFullYear(),i=n>0?n:1-n;return ye(e==="yy"?i%100:i,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):ye(n+1,2)},d(t,e){return ye(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){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(t,e){return ye(t.getHours()%12||12,e.length)},H(t,e){return ye(t.getHours(),e.length)},m(t,e){return ye(t.getMinutes(),e.length)},s(t,e){return ye(t.getSeconds(),e.length)},S(t,e){const n=e.length,i=t.getMilliseconds(),s=Math.trunc(i*Math.pow(10,n-3));return ye(s,e.length)}},jn={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Tc={G:function(t,e,n){const i=t.getFullYear()>0?1:0;switch(e){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(t,e,n){if(e==="yo"){const i=t.getFullYear(),s=i>0?i:1-i;return n.ordinalNumber(s,{unit:"year"})}return Zt.y(t,e)},Y:function(t,e,n,i){const s=Dc(t,i),o=s>0?s:1-s;if(e==="YY"){const a=o%100;return ye(a,2)}return e==="Yo"?n.ordinalNumber(o,{unit:"year"}):ye(o,e.length)},R:function(t,e){const n=Oc(t);return ye(n,e.length)},u:function(t,e){const n=t.getFullYear();return ye(n,e.length)},Q:function(t,e,n){const i=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return ye(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(t,e,n){const i=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return ye(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(t,e,n){const i=t.getMonth();switch(e){case"M":case"MM":return Zt.M(t,e);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(t,e,n){const i=t.getMonth();switch(e){case"L":return String(i+1);case"LL":return ye(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(t,e,n,i){const s=X_(t,i);return e==="wo"?n.ordinalNumber(s,{unit:"week"}):ye(s,e.length)},I:function(t,e,n){const i=Y_(t);return e==="Io"?n.ordinalNumber(i,{unit:"week"}):ye(i,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):Zt.d(t,e)},D:function(t,e,n){const i=q_(t);return e==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):ye(i,e.length)},E:function(t,e,n){const i=t.getDay();switch(e){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(t,e,n,i){const s=t.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return ye(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(t,e,n,i){const s=t.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return ye(o,e.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(t,e,n){const i=t.getDay(),s=i===0?7:i;switch(e){case"i":return String(s);case"ii":return ye(s,e.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(t,e,n){const s=t.getHours()/12>=1?"pm":"am";switch(e){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(t,e,n){const i=t.getHours();let s;switch(i===12?s=jn.noon:i===0?s=jn.midnight:s=i/12>=1?"pm":"am",e){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(t,e,n){const i=t.getHours();let s;switch(i>=17?s=jn.evening:i>=12?s=jn.afternoon:i>=4?s=jn.morning:s=jn.night,e){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(t,e,n){if(e==="ho"){let i=t.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Zt.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):Zt.H(t,e)},K:function(t,e,n){const i=t.getHours()%12;return e==="Ko"?n.ordinalNumber(i,{unit:"hour"}):ye(i,e.length)},k:function(t,e,n){let i=t.getHours();return i===0&&(i=24),e==="ko"?n.ordinalNumber(i,{unit:"hour"}):ye(i,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):Zt.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):Zt.s(t,e)},S:function(t,e){return Zt.S(t,e)},X:function(t,e,n){const i=t.getTimezoneOffset();if(i===0)return"Z";switch(e){case"X":return Pc(i);case"XXXX":case"XX":return _n(i);case"XXXXX":case"XXX":default:return _n(i,":")}},x:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"x":return Pc(i);case"xxxx":case"xx":return _n(i);case"xxxxx":case"xxx":default:return _n(i,":")}},O:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Bc(i,":");case"OOOO":default:return"GMT"+_n(i,":")}},z:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Bc(i,":");case"zzzz":default:return"GMT"+_n(i,":")}},t:function(t,e,n){const i=Math.trunc(+t/1e3);return ye(i,e.length)},T:function(t,e,n){return ye(+t,e.length)}};function Bc(t,e=""){const n=t>0?"-":"+",i=Math.abs(t),s=Math.trunc(i/60),o=i%60;return o===0?n+String(s):n+String(s)+e+ye(o,2)}function Pc(t,e){return t%60===0?(t>0?"-":"+")+ye(Math.abs(t)/60,2):_n(t,e)}function _n(t,e=""){const n=t>0?"-":"+",i=Math.abs(t),s=ye(Math.trunc(i/60),2),o=ye(i%60,2);return n+s+e+o}const Ac=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},Mc=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},G_={p:Mc,P:(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],i=n[1],s=n[2];if(!s)return Ac(t,e);let o;switch(i){case"P":o=e.dateTime({width:"short"});break;case"PP":o=e.dateTime({width:"medium"});break;case"PPP":o=e.dateTime({width:"long"});break;case"PPPP":default:o=e.dateTime({width:"full"});break}return o.replace("{{date}}",Ac(i,e)).replace("{{time}}",Mc(s,e))}},J_=/^D+$/,Q_=/^Y+$/,Z_=["D","DD","YY","YYYY"];function ek(t){return J_.test(t)}function tk(t){return Q_.test(t)}function nk(t,e,n){const i=ik(t,e,n);if(console.warn(i),Z_.includes(t))throw new RangeError(i)}function ik(t,e,n){const i=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const sk=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ok=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,rk=/^'([^]*?)'?$/,ak=/''/g,lk=/[a-zA-Z]/;function Vc(t,e,n){var u,f,h,m;const i=As(),s=i.locale??H_,o=i.firstWeekContainsDate??((f=(u=i.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,a=i.weekStartsOn??((m=(h=i.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??0,l=gt(t,n==null?void 0:n.in);if(!f_(l))throw new RangeError("Invalid time value");let c=e.match(ok).map(p=>{const g=p[0];if(g==="p"||g==="P"){const y=G_[g];return y(p,s.formatLong)}return p}).join("").match(sk).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const g=p[0];if(g==="'")return{isToken:!1,value:ck(p)};if(Tc[g])return{isToken:!0,value:p};if(g.match(lk))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:p}});s.localize.preprocessor&&(c=s.localize.preprocessor(l,c));const d={firstWeekContainsDate:o,weekStartsOn:a,locale:s};return c.map(p=>{if(!p.isToken)return p.value;const g=p.value;(tk(g)||ek(g))&&nk(g,e,String(t));const y=Tc[g[0]];return y(l,g,s.localize,d)}).join("")}function ck(t){const e=t.match(rk);return e?e[1].replace(ak,"'"):t}const dk=Object.freeze(Object.defineProperty({__proto__:null,default:{beforeMount(t,e){const{value:n,arg:i}=e;if(t&&n){const s=Vc(new Date(n),i||"yyyy-MM-dd");t.textContent=s}},updated(t,e){const{value:n,arg:i}=e;if(t&&n){const s=Vc(new Date(n),i||"yyyy-MM-dd");t.textContent=s}}}},Symbol.toStringTag,{value:"Module"})),uk=Object.freeze(Object.defineProperty({__proto__:null,default:{beforeMount(t,e){const{value:n,arg:i}=e;n&&(t.textContent=t.textContent.toUpperCase())},updated(t,e){const{value:n,arg:i}=e;n&&(t.textContent=t.textContent.toUpperCase())}}},Symbol.toStringTag,{value:"Module"}));/*!
166
166
  * @kurkle/color v0.3.4
167
167
  * https://github.com/kurkle/color#readme
168
168
  * (c) 2024 Jukka Kurkela
169
169
  * Released under the MIT License
170
- */function wi(t){return t+.5|0}const en=(t,e,n)=>Math.max(Math.min(t,n),e);function Ei(t){return en(wi(t*2.55),0,255)}function tn(t){return en(wi(t*255),0,255)}function $t(t){return en(wi(t/2.55)/100,0,1)}function Rc(t){return en(wi(t*100),0,100)}const at={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},ar=[..."0123456789ABCDEF"],hk=t=>ar[t&15],mk=t=>ar[(t&240)>>4]+ar[t&15],Vs=t=>(t&240)>>4===(t&15),pk=t=>Vs(t.r)&&Vs(t.g)&&Vs(t.b)&&Vs(t.a);function gk(t){var e=t.length,n;return t[0]==="#"&&(e===4||e===5?n={r:255&at[t[1]]*17,g:255&at[t[2]]*17,b:255&at[t[3]]*17,a:e===5?at[t[4]]*17:255}:(e===7||e===9)&&(n={r:at[t[1]]<<4|at[t[2]],g:at[t[3]]<<4|at[t[4]],b:at[t[5]]<<4|at[t[6]],a:e===9?at[t[7]]<<4|at[t[8]]:255})),n}const yk=(t,e)=>t<255?e(t):"";function bk(t){var e=pk(t)?hk:mk;return t?"#"+e(t.r)+e(t.g)+e(t.b)+yk(t.a,e):void 0}const xk=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Fc(t,e,n){const i=e*Math.min(n,1-n),s=(o,a=(o+t/30)%12)=>n-i*Math.max(Math.min(a-3,9-a,1),-1);return[s(0),s(8),s(4)]}function _k(t,e,n){const i=(s,o=(s+t/60)%6)=>n-n*e*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function kk(t,e,n){const i=Fc(t,1,.5);let s;for(e+n>1&&(s=1/(e+n),e*=s,n*=s),s=0;s<3;s++)i[s]*=1-e-n,i[s]+=e;return i}function Sk(t,e,n,i,s){return t===s?(e-n)/i+(e<n?6:0):e===s?(n-t)/i+2:(t-e)/i+4}function lr(t){const n=t.r/255,i=t.g/255,s=t.b/255,o=Math.max(n,i,s),a=Math.min(n,i,s),l=(o+a)/2;let c,d,u;return o!==a&&(u=o-a,d=l>.5?u/(2-o-a):u/(o+a),c=Sk(n,i,s,u,o),c=c*60+.5),[c|0,d||0,l]}function cr(t,e,n,i){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,i)).map(tn)}function dr(t,e,n){return cr(Fc,t,e,n)}function wk(t,e,n){return cr(kk,t,e,n)}function Ek(t,e,n){return cr(_k,t,e,n)}function $c(t){return(t%360+360)%360}function Ck(t){const e=xk.exec(t);let n=255,i;if(!e)return;e[5]!==i&&(n=e[6]?Ei(+e[5]):tn(+e[5]));const s=$c(+e[2]),o=+e[3]/100,a=+e[4]/100;return e[1]==="hwb"?i=wk(s,o,a):e[1]==="hsv"?i=Ek(s,o,a):i=dr(s,o,a),{r:i[0],g:i[1],b:i[2],a:n}}function Ok(t,e){var n=lr(t);n[0]=$c(n[0]+e),n=dr(n),t.r=n[0],t.g=n[1],t.b=n[2]}function vk(t){if(!t)return;const e=lr(t),n=e[0],i=Rc(e[1]),s=Rc(e[2]);return t.a<255?`hsla(${n}, ${i}%, ${s}%, ${$t(t.a)})`:`hsl(${n}, ${i}%, ${s}%)`}const Lc={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"},Ic={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 Nk(){const t={},e=Object.keys(Ic),n=Object.keys(Lc);let i,s,o,a,l;for(i=0;i<e.length;i++){for(a=l=e[i],s=0;s<n.length;s++)o=n[s],l=l.replace(o,Lc[o]);o=parseInt(Ic[a],16),t[l]=[o>>16&255,o>>8&255,o&255]}return t}let Rs;function Dk(t){Rs||(Rs=Nk(),Rs.transparent=[0,0,0,0]);const e=Rs[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const Tk=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Bk(t){const e=Tk.exec(t);let n=255,i,s,o;if(e){if(e[7]!==i){const a=+e[7];n=e[8]?Ei(a):en(a*255,0,255)}return i=+e[1],s=+e[3],o=+e[5],i=255&(e[2]?Ei(i):en(i,0,255)),s=255&(e[4]?Ei(s):en(s,0,255)),o=255&(e[6]?Ei(o):en(o,0,255)),{r:i,g:s,b:o,a:n}}}function Pk(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${$t(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const ur=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,zn=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function Ak(t,e,n){const i=zn($t(t.r)),s=zn($t(t.g)),o=zn($t(t.b));return{r:tn(ur(i+n*(zn($t(e.r))-i))),g:tn(ur(s+n*(zn($t(e.g))-s))),b:tn(ur(o+n*(zn($t(e.b))-o))),a:t.a+n*(e.a-t.a)}}function Fs(t,e,n){if(t){let i=lr(t);i[e]=Math.max(0,Math.min(i[e]+i[e]*n,e===0?360:1)),i=dr(i),t.r=i[0],t.g=i[1],t.b=i[2]}}function jc(t,e){return t&&Object.assign(e||{},t)}function zc(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=tn(t[3]))):(e=jc(t,{r:0,g:0,b:0,a:1}),e.a=tn(e.a)),e}function Mk(t){return t.charAt(0)==="r"?Bk(t):Ck(t)}class Ci{constructor(e){if(e instanceof Ci)return e;const n=typeof e;let i;n==="object"?i=zc(e):n==="string"&&(i=gk(e)||Dk(e)||Mk(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=jc(this._rgb);return e&&(e.a=$t(e.a)),e}set rgb(e){this._rgb=zc(e)}rgbString(){return this._valid?Pk(this._rgb):void 0}hexString(){return this._valid?bk(this._rgb):void 0}hslString(){return this._valid?vk(this._rgb):void 0}mix(e,n){if(e){const i=this.rgb,s=e.rgb;let o;const a=n===o?.5:n,l=2*a-1,c=i.a-s.a,d=((l*c===-1?l:(l+c)/(1+l*c))+1)/2;o=1-d,i.r=255&d*i.r+o*s.r+.5,i.g=255&d*i.g+o*s.g+.5,i.b=255&d*i.b+o*s.b+.5,i.a=a*i.a+(1-a)*s.a,this.rgb=i}return this}interpolate(e,n){return e&&(this._rgb=Ak(this._rgb,e._rgb,n)),this}clone(){return new Ci(this.rgb)}alpha(e){return this._rgb.a=tn(e),this}clearer(e){const n=this._rgb;return n.a*=1-e,this}greyscale(){const e=this._rgb,n=wi(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=n,this}opaquer(e){const n=this._rgb;return n.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Fs(this._rgb,2,e),this}darken(e){return Fs(this._rgb,2,-e),this}saturate(e){return Fs(this._rgb,1,e),this}desaturate(e){return Fs(this._rgb,1,-e),this}rotate(e){return Ok(this._rgb,e),this}}/*!
170
+ */function wi(t){return t+.5|0}const en=(t,e,n)=>Math.max(Math.min(t,n),e);function Ei(t){return en(wi(t*2.55),0,255)}function tn(t){return en(wi(t*255),0,255)}function $t(t){return en(wi(t/2.55)/100,0,1)}function Rc(t){return en(wi(t*100),0,100)}const at={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},ar=[..."0123456789ABCDEF"],fk=t=>ar[t&15],hk=t=>ar[(t&240)>>4]+ar[t&15],Vs=t=>(t&240)>>4===(t&15),mk=t=>Vs(t.r)&&Vs(t.g)&&Vs(t.b)&&Vs(t.a);function pk(t){var e=t.length,n;return t[0]==="#"&&(e===4||e===5?n={r:255&at[t[1]]*17,g:255&at[t[2]]*17,b:255&at[t[3]]*17,a:e===5?at[t[4]]*17:255}:(e===7||e===9)&&(n={r:at[t[1]]<<4|at[t[2]],g:at[t[3]]<<4|at[t[4]],b:at[t[5]]<<4|at[t[6]],a:e===9?at[t[7]]<<4|at[t[8]]:255})),n}const gk=(t,e)=>t<255?e(t):"";function yk(t){var e=mk(t)?fk:hk;return t?"#"+e(t.r)+e(t.g)+e(t.b)+gk(t.a,e):void 0}const bk=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Fc(t,e,n){const i=e*Math.min(n,1-n),s=(o,a=(o+t/30)%12)=>n-i*Math.max(Math.min(a-3,9-a,1),-1);return[s(0),s(8),s(4)]}function xk(t,e,n){const i=(s,o=(s+t/60)%6)=>n-n*e*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function _k(t,e,n){const i=Fc(t,1,.5);let s;for(e+n>1&&(s=1/(e+n),e*=s,n*=s),s=0;s<3;s++)i[s]*=1-e-n,i[s]+=e;return i}function kk(t,e,n,i,s){return t===s?(e-n)/i+(e<n?6:0):e===s?(n-t)/i+2:(t-e)/i+4}function lr(t){const n=t.r/255,i=t.g/255,s=t.b/255,o=Math.max(n,i,s),a=Math.min(n,i,s),l=(o+a)/2;let c,d,u;return o!==a&&(u=o-a,d=l>.5?u/(2-o-a):u/(o+a),c=kk(n,i,s,u,o),c=c*60+.5),[c|0,d||0,l]}function cr(t,e,n,i){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,i)).map(tn)}function dr(t,e,n){return cr(Fc,t,e,n)}function Sk(t,e,n){return cr(_k,t,e,n)}function wk(t,e,n){return cr(xk,t,e,n)}function $c(t){return(t%360+360)%360}function Ek(t){const e=bk.exec(t);let n=255,i;if(!e)return;e[5]!==i&&(n=e[6]?Ei(+e[5]):tn(+e[5]));const s=$c(+e[2]),o=+e[3]/100,a=+e[4]/100;return e[1]==="hwb"?i=Sk(s,o,a):e[1]==="hsv"?i=wk(s,o,a):i=dr(s,o,a),{r:i[0],g:i[1],b:i[2],a:n}}function Ck(t,e){var n=lr(t);n[0]=$c(n[0]+e),n=dr(n),t.r=n[0],t.g=n[1],t.b=n[2]}function Ok(t){if(!t)return;const e=lr(t),n=e[0],i=Rc(e[1]),s=Rc(e[2]);return t.a<255?`hsla(${n}, ${i}%, ${s}%, ${$t(t.a)})`:`hsl(${n}, ${i}%, ${s}%)`}const Lc={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"},Ic={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 vk(){const t={},e=Object.keys(Ic),n=Object.keys(Lc);let i,s,o,a,l;for(i=0;i<e.length;i++){for(a=l=e[i],s=0;s<n.length;s++)o=n[s],l=l.replace(o,Lc[o]);o=parseInt(Ic[a],16),t[l]=[o>>16&255,o>>8&255,o&255]}return t}let Rs;function Nk(t){Rs||(Rs=vk(),Rs.transparent=[0,0,0,0]);const e=Rs[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const Dk=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Tk(t){const e=Dk.exec(t);let n=255,i,s,o;if(e){if(e[7]!==i){const a=+e[7];n=e[8]?Ei(a):en(a*255,0,255)}return i=+e[1],s=+e[3],o=+e[5],i=255&(e[2]?Ei(i):en(i,0,255)),s=255&(e[4]?Ei(s):en(s,0,255)),o=255&(e[6]?Ei(o):en(o,0,255)),{r:i,g:s,b:o,a:n}}}function Bk(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${$t(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const ur=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,zn=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function Pk(t,e,n){const i=zn($t(t.r)),s=zn($t(t.g)),o=zn($t(t.b));return{r:tn(ur(i+n*(zn($t(e.r))-i))),g:tn(ur(s+n*(zn($t(e.g))-s))),b:tn(ur(o+n*(zn($t(e.b))-o))),a:t.a+n*(e.a-t.a)}}function Fs(t,e,n){if(t){let i=lr(t);i[e]=Math.max(0,Math.min(i[e]+i[e]*n,e===0?360:1)),i=dr(i),t.r=i[0],t.g=i[1],t.b=i[2]}}function jc(t,e){return t&&Object.assign(e||{},t)}function zc(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=tn(t[3]))):(e=jc(t,{r:0,g:0,b:0,a:1}),e.a=tn(e.a)),e}function Ak(t){return t.charAt(0)==="r"?Tk(t):Ek(t)}class Ci{constructor(e){if(e instanceof Ci)return e;const n=typeof e;let i;n==="object"?i=zc(e):n==="string"&&(i=pk(e)||Nk(e)||Ak(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=jc(this._rgb);return e&&(e.a=$t(e.a)),e}set rgb(e){this._rgb=zc(e)}rgbString(){return this._valid?Bk(this._rgb):void 0}hexString(){return this._valid?yk(this._rgb):void 0}hslString(){return this._valid?Ok(this._rgb):void 0}mix(e,n){if(e){const i=this.rgb,s=e.rgb;let o;const a=n===o?.5:n,l=2*a-1,c=i.a-s.a,d=((l*c===-1?l:(l+c)/(1+l*c))+1)/2;o=1-d,i.r=255&d*i.r+o*s.r+.5,i.g=255&d*i.g+o*s.g+.5,i.b=255&d*i.b+o*s.b+.5,i.a=a*i.a+(1-a)*s.a,this.rgb=i}return this}interpolate(e,n){return e&&(this._rgb=Pk(this._rgb,e._rgb,n)),this}clone(){return new Ci(this.rgb)}alpha(e){return this._rgb.a=tn(e),this}clearer(e){const n=this._rgb;return n.a*=1-e,this}greyscale(){const e=this._rgb,n=wi(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=n,this}opaquer(e){const n=this._rgb;return n.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Fs(this._rgb,2,e),this}darken(e){return Fs(this._rgb,2,-e),this}saturate(e){return Fs(this._rgb,1,e),this}desaturate(e){return Fs(this._rgb,1,-e),this}rotate(e){return Ck(this._rgb,e),this}}/*!
171
171
  * Chart.js v4.4.7
172
172
  * https://www.chartjs.org
173
173
  * (c) 2024 Chart.js Contributors
174
174
  * Released under the MIT License
175
- */function Lt(){}const Vk=(()=>{let t=0;return()=>t++})();function fe(t){return t==null}function Oe(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function de(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function Pe(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function nt(t,e){return Pe(t)?t:e}function ae(t,e){return typeof t>"u"?e:t}const Rk=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/e,Uc=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function ke(t,e,n){if(t&&typeof t.call=="function")return t.apply(n,e)}function be(t,e,n,i){let s,o,a;if(Oe(t))for(o=t.length,s=0;s<o;s++)e.call(n,t[s],s);else if(de(t))for(a=Object.keys(t),o=a.length,s=0;s<o;s++)e.call(n,t[a[s]],a[s])}function $s(t,e){let n,i,s,o;if(!t||!e||t.length!==e.length)return!1;for(n=0,i=t.length;n<i;++n)if(s=t[n],o=e[n],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function Ls(t){if(Oe(t))return t.map(Ls);if(de(t)){const e=Object.create(null),n=Object.keys(t),i=n.length;let s=0;for(;s<i;++s)e[n[s]]=Ls(t[n[s]]);return e}return t}function Wc(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function Fk(t,e,n,i){if(!Wc(t))return;const s=e[t],o=n[t];de(s)&&de(o)?Oi(s,o,i):e[t]=Ls(o)}function Oi(t,e,n){const i=Oe(e)?e:[e],s=i.length;if(!de(t))return t;n=n||{};const o=n.merger||Fk;let a;for(let l=0;l<s;++l){if(a=i[l],!de(a))continue;const c=Object.keys(a);for(let d=0,u=c.length;d<u;++d)o(c[d],t,a,n)}return t}function vi(t,e){return Oi(t,e,{merger:$k})}function $k(t,e,n){if(!Wc(t))return;const i=e[t],s=n[t];de(i)&&de(s)?vi(i,s):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=Ls(s))}const Hc={"":t=>t,x:t=>t.x,y:t=>t.y};function Lk(t){const e=t.split("."),n=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function Ik(t){const e=Lk(t);return n=>{for(const i of e){if(i==="")break;n=n&&n[i]}return n}}function nn(t,e){return(Hc[e]||(Hc[e]=Ik(e)))(t)}function fr(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Ni=t=>typeof t<"u",sn=t=>typeof t=="function",qc=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};function jk(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const Se=Math.PI,we=2*Se,zk=we+Se,Is=Number.POSITIVE_INFINITY,Uk=Se/180,Me=Se/2,kn=Se/4,Yc=Se*2/3,on=Math.log10,Ct=Math.sign;function Di(t,e,n){return Math.abs(t-e)<n}function Kc(t){const e=Math.round(t);t=Di(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(on(t))),i=t/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function Wk(t){const e=[],n=Math.sqrt(t);let i;for(i=1;i<n;i++)t%i===0&&(e.push(i),e.push(t/i));return n===(n|0)&&e.push(n),e.sort((s,o)=>s-o).pop(),e}function Un(t){return!isNaN(parseFloat(t))&&isFinite(t)}function Hk(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}function Xc(t,e,n){let i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i][n],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function yt(t){return t*(Se/180)}function hr(t){return t*(180/Se)}function Gc(t){if(!Pe(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function Jc(t,e){const n=e.x-t.x,i=e.y-t.y,s=Math.sqrt(n*n+i*i);let o=Math.atan2(i,n);return o<-.5*Se&&(o+=we),{angle:o,distance:s}}function mr(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function qk(t,e){return(t-e+zk)%we-Se}function it(t){return(t%we+we)%we}function Ti(t,e,n,i){const s=it(t),o=it(e),a=it(n),l=it(o-s),c=it(a-s),d=it(s-o),u=it(s-a);return s===o||s===a||i&&o===a||l>c&&d<u}function Le(t,e,n){return Math.max(e,Math.min(n,t))}function Yk(t){return Le(t,-32768,32767)}function It(t,e,n,i=1e-6){return t>=Math.min(e,n)-i&&t<=Math.max(e,n)+i}function pr(t,e,n){n=n||(a=>t[a]<e);let i=t.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 jt=(t,e,n,i)=>pr(t,n,i?s=>{const o=t[s][e];return o<n||o===n&&t[s+1][e]===n}:s=>t[s][e]<n),Kk=(t,e,n)=>pr(t,n,i=>t[i][e]>=n);function Xk(t,e,n){let i=0,s=t.length;for(;i<s&&t[i]<e;)i++;for(;s>i&&t[s-1]>n;)s--;return i>0||s<t.length?t.slice(i,s):t}const Qc=["push","pop","shift","splice","unshift"];function Gk(t,e){if(t._chartjs){t._chartjs.listeners.push(e);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),Qc.forEach(n=>{const i="_onData"+fr(n),s=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!1,value(...o){const a=s.apply(this,o);return t._chartjs.listeners.forEach(l=>{typeof l[i]=="function"&&l[i](...o)}),a}})})}function Zc(t,e){const n=t._chartjs;if(!n)return;const i=n.listeners,s=i.indexOf(e);s!==-1&&i.splice(s,1),!(i.length>0)&&(Qc.forEach(o=>{delete t[o]}),delete t._chartjs)}function ed(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const td=function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame}();function nd(t,e){let n=[],i=!1;return function(...s){n=s,i||(i=!0,td.call(window,()=>{i=!1,t.apply(e,n)}))}}function Jk(t,e){let n;return function(...i){return e?(clearTimeout(n),n=setTimeout(t,e,i)):t.apply(this,i),e}}const gr=t=>t==="start"?"left":t==="end"?"right":"center",We=(t,e,n)=>t==="start"?e:t==="end"?n:(e+n)/2,Qk=(t,e,n,i)=>t===(i?"left":"right")?n:t==="center"?(e+n)/2:e;function id(t,e,n){const i=e.length;let s=0,o=i;if(t._sorted){const{iScale:a,_parsed:l}=t,c=a.axis,{min:d,max:u,minDefined:f,maxDefined:h}=a.getUserBounds();f&&(s=Le(Math.min(jt(l,c,d).lo,n?i:jt(e,c,a.getPixelForValue(d)).lo),0,i-1)),h?o=Le(Math.max(jt(l,a.axis,u,!0).hi+1,n?0:jt(e,c,a.getPixelForValue(u),!0).hi+1),s,i)-s:o=i-s}return{start:s,count:o}}function sd(t){const{xScale:e,yScale:n,_scaleRanges:i}=t,s={xmin:e.min,xmax:e.max,ymin:n.min,ymax:n.max};if(!i)return t._scaleRanges=s,!0;const o=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,s),o}const js=t=>t===0||t===1,od=(t,e,n)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*we/n)),rd=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*we/n)+1,Bi={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*Me)+1,easeOutSine:t=>Math.sin(t*Me),easeInOutSine:t=>-.5*(Math.cos(Se*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>js(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>js(t)?t:od(t,.075,.3),easeOutElastic:t=>js(t)?t:rd(t,.075,.3),easeInOutElastic(t){return js(t)?t:t<.5?.5*od(t*2,.1125,.45):.5+.5*rd(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-Bi.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?Bi.easeInBounce(t*2)*.5:Bi.easeOutBounce(t*2-1)*.5+.5};function yr(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function ad(t){return yr(t)?t:new Ci(t)}function br(t){return yr(t)?t:new Ci(t).saturate(.5).darken(.1).hexString()}const Zk=["x","y","borderWidth","radius","tension"],eS=["color","borderColor","backgroundColor"];function tS(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),t.set("animations",{colors:{type:"color",properties:eS},numbers:{type:"number",properties:Zk}}),t.describe("animations",{_fallback:"animation"}),t.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:e=>e|0}}}})}function nS(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const ld=new Map;function iS(t,e){e=e||{};const n=t+JSON.stringify(e);let i=ld.get(n);return i||(i=new Intl.NumberFormat(t,e),ld.set(n,i)),i}function Pi(t,e,n){return iS(e,n).format(t)}const cd={values(t){return Oe(t)?t:""+t},numeric(t,e,n){if(t===0)return"0";const i=this.chart.options.locale;let s,o=t;if(n.length>1){const d=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(d<1e-4||d>1e15)&&(s="scientific"),o=sS(t,n)}const a=on(Math.abs(o)),l=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),c={notation:s,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(c,this.options.ticks.format),Pi(t,i,c)},logarithmic(t,e,n){if(t===0)return"0";const i=n[e].significand||t/Math.pow(10,Math.floor(on(t)));return[1,2,3,5,10,15].includes(i)||e>.8*n.length?cd.numeric.call(this,t,e,n):""}};function sS(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t)),n}var Ai={formatters:cd};function oS(t){t.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:(e,n)=>n.lineWidth,tickColor:(e,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:Ai.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const Sn=Object.create(null),xr=Object.create(null);function Mi(t,e){if(!e)return t;const n=e.split(".");for(let i=0,s=n.length;i<s;++i){const o=n[i];t=t[o]||(t[o]=Object.create(null))}return t}function _r(t,e,n){return typeof e=="string"?Oi(Mi(t,e),n):Oi(Mi(t,""),e)}class rS{constructor(e,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)=>br(s.backgroundColor),this.hoverBorderColor=(i,s)=>br(s.borderColor),this.hoverColor=(i,s)=>br(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(e),this.apply(n)}set(e,n){return _r(this,e,n)}get(e){return Mi(this,e)}describe(e,n){return _r(xr,e,n)}override(e,n){return _r(Sn,e,n)}route(e,n,i,s){const o=Mi(this,e),a=Mi(this,i),l="_"+n;Object.defineProperties(o,{[l]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const c=this[l],d=a[s];return de(c)?Object.assign({},d,c):ae(c,d)},set(c){this[l]=c}}})}apply(e){e.forEach(n=>n(this))}}var Ee=new rS({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[tS,nS,oS]);function aS(t){return!t||fe(t.size)||fe(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function zs(t,e,n,i,s){let o=e[s];return o||(o=e[s]=t.measureText(s).width,n.push(s)),o>i&&(i=o),i}function lS(t,e,n,i){i=i||{};let s=i.data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(s=i.data={},o=i.garbageCollect=[],i.font=e),t.save(),t.font=e;let a=0;const l=n.length;let c,d,u,f,h;for(c=0;c<l;c++)if(f=n[c],f!=null&&!Oe(f))a=zs(t,s,o,a,f);else if(Oe(f))for(d=0,u=f.length;d<u;d++)h=f[d],h!=null&&!Oe(h)&&(a=zs(t,s,o,a,h));t.restore();const m=o.length/2;if(m>n.length){for(c=0;c<m;c++)delete s[o[c]];o.splice(0,m)}return a}function wn(t,e,n){const i=t.currentDevicePixelRatio,s=n!==0?Math.max(n/2,.5):0;return Math.round((e-s)*i)/i+s}function dd(t,e){!e&&!t||(e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function kr(t,e,n,i){ud(t,e,n,i,null)}function ud(t,e,n,i,s){let o,a,l,c,d,u,f,h;const m=e.pointStyle,p=e.rotation,g=e.radius;let y=(p||0)*Uk;if(m&&typeof m=="object"&&(o=m.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){t.save(),t.translate(n,i),t.rotate(y),t.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),t.restore();return}if(!(isNaN(g)||g<=0)){switch(t.beginPath(),m){default:s?t.ellipse(n,i,s/2,g,0,0,we):t.arc(n,i,g,0,we),t.closePath();break;case"triangle":u=s?s/2:g,t.moveTo(n+Math.sin(y)*u,i-Math.cos(y)*g),y+=Yc,t.lineTo(n+Math.sin(y)*u,i-Math.cos(y)*g),y+=Yc,t.lineTo(n+Math.sin(y)*u,i-Math.cos(y)*g),t.closePath();break;case"rectRounded":d=g*.516,c=g-d,a=Math.cos(y+kn)*c,f=Math.cos(y+kn)*(s?s/2-d:c),l=Math.sin(y+kn)*c,h=Math.sin(y+kn)*(s?s/2-d:c),t.arc(n-f,i-l,d,y-Se,y-Me),t.arc(n+h,i-a,d,y-Me,y),t.arc(n+f,i+l,d,y,y+Me),t.arc(n-h,i+a,d,y+Me,y+Se),t.closePath();break;case"rect":if(!p){c=Math.SQRT1_2*g,u=s?s/2:c,t.rect(n-u,i-c,2*u,2*c);break}y+=kn;case"rectRot":f=Math.cos(y)*(s?s/2:g),a=Math.cos(y)*g,l=Math.sin(y)*g,h=Math.sin(y)*(s?s/2:g),t.moveTo(n-f,i-l),t.lineTo(n+h,i-a),t.lineTo(n+f,i+l),t.lineTo(n-h,i+a),t.closePath();break;case"crossRot":y+=kn;case"cross":f=Math.cos(y)*(s?s/2:g),a=Math.cos(y)*g,l=Math.sin(y)*g,h=Math.sin(y)*(s?s/2:g),t.moveTo(n-f,i-l),t.lineTo(n+f,i+l),t.moveTo(n+h,i-a),t.lineTo(n-h,i+a);break;case"star":f=Math.cos(y)*(s?s/2:g),a=Math.cos(y)*g,l=Math.sin(y)*g,h=Math.sin(y)*(s?s/2:g),t.moveTo(n-f,i-l),t.lineTo(n+f,i+l),t.moveTo(n+h,i-a),t.lineTo(n-h,i+a),y+=kn,f=Math.cos(y)*(s?s/2:g),a=Math.cos(y)*g,l=Math.sin(y)*g,h=Math.sin(y)*(s?s/2:g),t.moveTo(n-f,i-l),t.lineTo(n+f,i+l),t.moveTo(n+h,i-a),t.lineTo(n-h,i+a);break;case"line":a=s?s/2:Math.cos(y)*g,l=Math.sin(y)*g,t.moveTo(n-a,i-l),t.lineTo(n+a,i+l);break;case"dash":t.moveTo(n,i),t.lineTo(n+Math.cos(y)*(s?s/2:g),i+Math.sin(y)*g);break;case!1:t.closePath();break}t.fill(),e.borderWidth>0&&t.stroke()}}function zt(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.x<e.right+n&&t.y>e.top-n&&t.y<e.bottom+n}function Us(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Ws(t){t.restore()}function cS(t,e,n,i,s){if(!e)return t.lineTo(n.x,n.y);if(s==="middle"){const o=(e.x+n.x)/2;t.lineTo(o,e.y),t.lineTo(o,n.y)}else s==="after"!=!!i?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y);t.lineTo(n.x,n.y)}function dS(t,e,n,i){if(!e)return t.lineTo(n.x,n.y);t.bezierCurveTo(i?e.cp1x:e.cp2x,i?e.cp1y:e.cp2y,i?n.cp2x:n.cp1x,i?n.cp2y:n.cp1y,n.x,n.y)}function uS(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),fe(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}function fS(t,e,n,i,s){if(s.strikethrough||s.underline){const o=t.measureText(i),a=e-o.actualBoundingBoxLeft,l=e+o.actualBoundingBoxRight,c=n-o.actualBoundingBoxAscent,d=n+o.actualBoundingBoxDescent,u=s.strikethrough?(c+d)/2:d;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=s.decorationWidth||2,t.moveTo(a,u),t.lineTo(l,u),t.stroke()}}function hS(t,e){const n=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=n}function En(t,e,n,i,s,o={}){const a=Oe(e)?e:[e],l=o.strokeWidth>0&&o.strokeColor!=="";let c,d;for(t.save(),t.font=s.string,uS(t,o),c=0;c<a.length;++c)d=a[c],o.backdrop&&hS(t,o.backdrop),l&&(o.strokeColor&&(t.strokeStyle=o.strokeColor),fe(o.strokeWidth)||(t.lineWidth=o.strokeWidth),t.strokeText(d,n,i,o.maxWidth)),t.fillText(d,n,i,o.maxWidth),fS(t,n,i,d,o),i+=Number(s.lineHeight);t.restore()}function Vi(t,e){const{x:n,y:i,w:s,h:o,radius:a}=e;t.arc(n+a.topLeft,i+a.topLeft,a.topLeft,1.5*Se,Se,!0),t.lineTo(n,i+o-a.bottomLeft),t.arc(n+a.bottomLeft,i+o-a.bottomLeft,a.bottomLeft,Se,Me,!0),t.lineTo(n+s-a.bottomRight,i+o),t.arc(n+s-a.bottomRight,i+o-a.bottomRight,a.bottomRight,Me,0,!0),t.lineTo(n+s,i+a.topRight),t.arc(n+s-a.topRight,i+a.topRight,a.topRight,0,-Me,!0),t.lineTo(n+a.topLeft,i)}const mS=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,pS=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function gS(t,e){const n=(""+t).match(mS);if(!n||n[1]==="normal")return e*1.2;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100;break}return e*t}const yS=t=>+t||0;function Sr(t,e){const n={},i=de(e),s=i?Object.keys(e):e,o=de(t)?i?a=>ae(t[a],t[e[a]]):a=>t[a]:()=>t;for(const a of s)n[a]=yS(o(a));return n}function fd(t){return Sr(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Cn(t){return Sr(t,["topLeft","topRight","bottomLeft","bottomRight"])}function He(t){const e=fd(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Fe(t,e){t=t||{},e=e||Ee.font;let n=ae(t.size,e.size);typeof n=="string"&&(n=parseInt(n,10));let i=ae(t.style,e.style);i&&!(""+i).match(pS)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:ae(t.family,e.family),lineHeight:gS(ae(t.lineHeight,e.lineHeight),n),size:n,style:i,weight:ae(t.weight,e.weight),string:""};return s.string=aS(s),s}function Ri(t,e,n,i){let s,o,a;for(s=0,o=t.length;s<o;++s)if(a=t[s],a!==void 0&&a!==void 0)return a}function bS(t,e,n){const{min:i,max:s}=t,o=Uc(e,(s-i)/2),a=(l,c)=>n&&l===0?0:l+c;return{min:a(i,-Math.abs(o)),max:a(s,o)}}function rn(t,e){return Object.assign(Object.create(t),e)}function wr(t,e=[""],n,i,s=()=>t[0]){const o=n||t;typeof i>"u"&&(i=yd("_fallback",t));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:i,_getTarget:s,override:l=>wr([l,...t],e,o,i)};return new Proxy(a,{deleteProperty(l,c){return delete l[c],delete l._keys,delete t[0][c],!0},get(l,c){return md(l,c,()=>OS(c,e,t,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(l,c){return bd(l).includes(c)},ownKeys(l){return bd(l)},set(l,c,d){const u=l._storage||(l._storage=s());return l[c]=u[c]=d,delete l._keys,!0}})}function Wn(t,e,n,i){const s={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:hd(t,i),setContext:o=>Wn(t,o,n,i),override:o=>Wn(t.override(o),e,n,i)};return new Proxy(s,{deleteProperty(o,a){return delete o[a],delete t[a],!0},get(o,a,l){return md(o,a,()=>_S(o,a,l))},getOwnPropertyDescriptor(o,a){return o._descriptors.allKeys?Reflect.has(t,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,a)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(o,a){return Reflect.has(t,a)},ownKeys(){return Reflect.ownKeys(t)},set(o,a,l){return t[a]=l,delete o[a],!0}})}function hd(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:i=e.indexable,_allKeys:s=e.allKeys}=t;return{allKeys:s,scriptable:n,indexable:i,isScriptable:sn(n)?n:()=>n,isIndexable:sn(i)?i:()=>i}}const xS=(t,e)=>t?t+fr(e):e,Er=(t,e)=>de(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function md(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e)||e==="constructor")return t[e];const i=n();return t[e]=i,i}function _S(t,e,n){const{_proxy:i,_context:s,_subProxy:o,_descriptors:a}=t;let l=i[e];return sn(l)&&a.isScriptable(e)&&(l=kS(e,l,t,n)),Oe(l)&&l.length&&(l=SS(e,l,t,a.isIndexable)),Er(e,l)&&(l=Wn(l,s,o&&o[e],a)),l}function kS(t,e,n,i){const{_proxy:s,_context:o,_subProxy:a,_stack:l}=n;if(l.has(t))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+t);l.add(t);let c=e(o,a||i);return l.delete(t),Er(t,c)&&(c=Cr(s._scopes,s,t,c)),c}function SS(t,e,n,i){const{_proxy:s,_context:o,_subProxy:a,_descriptors:l}=n;if(typeof o.index<"u"&&i(t))return e[o.index%e.length];if(de(e[0])){const c=e,d=s._scopes.filter(u=>u!==c);e=[];for(const u of c){const f=Cr(d,s,t,u);e.push(Wn(f,o,a&&a[t],l))}}return e}function pd(t,e,n){return sn(t)?t(e,n):t}const wS=(t,e)=>t===!0?e:typeof t=="string"?nn(e,t):void 0;function ES(t,e,n,i,s){for(const o of e){const a=wS(n,o);if(a){t.add(a);const l=pd(a._fallback,n,s);if(typeof l<"u"&&l!==n&&l!==i)return l}else if(a===!1&&typeof i<"u"&&n!==i)return null}return!1}function Cr(t,e,n,i){const s=e._rootScopes,o=pd(e._fallback,n,i),a=[...t,...s],l=new Set;l.add(i);let c=gd(l,a,n,o||n,i);return c===null||typeof o<"u"&&o!==n&&(c=gd(l,a,o,c,i),c===null)?!1:wr(Array.from(l),[""],s,o,()=>CS(e,n,i))}function gd(t,e,n,i,s){for(;n;)n=ES(t,e,n,i,s);return n}function CS(t,e,n){const i=t._getTarget();e in i||(i[e]={});const s=i[e];return Oe(s)&&de(n)?n:s||{}}function OS(t,e,n,i){let s;for(const o of e)if(s=yd(xS(o,t),n),typeof s<"u")return Er(t,s)?Cr(n,i,t,s):s}function yd(t,e){for(const n of e){if(!n)continue;const i=n[t];if(typeof i<"u")return i}}function bd(t){let e=t._keys;return e||(e=t._keys=vS(t._scopes)),e}function vS(t){const e=new Set;for(const n of t)for(const i of Object.keys(n).filter(s=>!s.startsWith("_")))e.add(i);return Array.from(e)}function xd(t,e,n,i){const{iScale:s}=t,{key:o="r"}=this._parsing,a=new Array(i);let l,c,d,u;for(l=0,c=i;l<c;++l)d=l+n,u=e[d],a[l]={r:s.parse(nn(u,o),d)};return a}const NS=Number.EPSILON||1e-14,Hn=(t,e)=>e<t.length&&!t[e].skip&&t[e],_d=t=>t==="x"?"y":"x";function DS(t,e,n,i){const s=t.skip?e:t,o=e,a=n.skip?e:n,l=mr(o,s),c=mr(a,o);let d=l/(l+c),u=c/(l+c);d=isNaN(d)?0:d,u=isNaN(u)?0:u;const f=i*d,h=i*u;return{previous:{x:o.x-f*(a.x-s.x),y:o.y-f*(a.y-s.y)},next:{x:o.x+h*(a.x-s.x),y:o.y+h*(a.y-s.y)}}}function TS(t,e,n){const i=t.length;let s,o,a,l,c,d=Hn(t,0);for(let u=0;u<i-1;++u)if(c=d,d=Hn(t,u+1),!(!c||!d)){if(Di(e[u],0,NS)){n[u]=n[u+1]=0;continue}s=n[u]/e[u],o=n[u+1]/e[u],l=Math.pow(s,2)+Math.pow(o,2),!(l<=9)&&(a=3/Math.sqrt(l),n[u]=s*a*e[u],n[u+1]=o*a*e[u])}}function BS(t,e,n="x"){const i=_d(n),s=t.length;let o,a,l,c=Hn(t,0);for(let d=0;d<s;++d){if(a=l,l=c,c=Hn(t,d+1),!l)continue;const u=l[n],f=l[i];a&&(o=(u-a[n])/3,l[`cp1${n}`]=u-o,l[`cp1${i}`]=f-o*e[d]),c&&(o=(c[n]-u)/3,l[`cp2${n}`]=u+o,l[`cp2${i}`]=f+o*e[d])}}function PS(t,e="x"){const n=_d(e),i=t.length,s=Array(i).fill(0),o=Array(i);let a,l,c,d=Hn(t,0);for(a=0;a<i;++a)if(l=c,c=d,d=Hn(t,a+1),!!c){if(d){const u=d[e]-c[e];s[a]=u!==0?(d[n]-c[n])/u:0}o[a]=l?d?Ct(s[a-1])!==Ct(s[a])?0:(s[a-1]+s[a])/2:s[a-1]:s[a]}TS(t,s,o),BS(t,o,e)}function Hs(t,e,n){return Math.max(Math.min(t,n),e)}function AS(t,e){let n,i,s,o,a,l=zt(t[0],e);for(n=0,i=t.length;n<i;++n)a=o,o=l,l=n<i-1&&zt(t[n+1],e),o&&(s=t[n],a&&(s.cp1x=Hs(s.cp1x,e.left,e.right),s.cp1y=Hs(s.cp1y,e.top,e.bottom)),l&&(s.cp2x=Hs(s.cp2x,e.left,e.right),s.cp2y=Hs(s.cp2y,e.top,e.bottom)))}function MS(t,e,n,i,s){let o,a,l,c;if(e.spanGaps&&(t=t.filter(d=>!d.skip)),e.cubicInterpolationMode==="monotone")PS(t,s);else{let d=i?t[t.length-1]:t[0];for(o=0,a=t.length;o<a;++o)l=t[o],c=DS(d,l,t[Math.min(o+1,a-(i?0:1))%a],e.tension),l.cp1x=c.previous.x,l.cp1y=c.previous.y,l.cp2x=c.next.x,l.cp2y=c.next.y,d=l}e.capBezierPoints&&AS(t,n)}function Or(){return typeof window<"u"&&typeof document<"u"}function vr(t){let e=t.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function qs(t,e,n){let i;return typeof t=="string"?(i=parseInt(t,10),t.indexOf("%")!==-1&&(i=i/100*e.parentNode[n])):i=t,i}const Ys=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function VS(t,e){return Ys(t).getPropertyValue(e)}const RS=["top","right","bottom","left"];function On(t,e,n){const i={};n=n?"-"+n:"";for(let s=0;s<4;s++){const o=RS[s];i[o]=parseFloat(t[e+"-"+o+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const FS=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function $S(t,e){const n=t.touches,i=n&&n.length?n[0]:t,{offsetX:s,offsetY:o}=i;let a=!1,l,c;if(FS(s,o,t.target))l=s,c=o;else{const d=e.getBoundingClientRect();l=i.clientX-d.left,c=i.clientY-d.top,a=!0}return{x:l,y:c,box:a}}function vn(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:i}=e,s=Ys(n),o=s.boxSizing==="border-box",a=On(s,"padding"),l=On(s,"border","width"),{x:c,y:d,box:u}=$S(t,n),f=a.left+(u&&l.left),h=a.top+(u&&l.top);let{width:m,height:p}=e;return o&&(m-=a.width+l.width,p-=a.height+l.height),{x:Math.round((c-f)/m*n.width/i),y:Math.round((d-h)/p*n.height/i)}}function LS(t,e,n){let i,s;if(e===void 0||n===void 0){const o=t&&vr(t);if(!o)e=t.clientWidth,n=t.clientHeight;else{const a=o.getBoundingClientRect(),l=Ys(o),c=On(l,"border","width"),d=On(l,"padding");e=a.width-d.width-c.width,n=a.height-d.height-c.height,i=qs(l.maxWidth,o,"clientWidth"),s=qs(l.maxHeight,o,"clientHeight")}}return{width:e,height:n,maxWidth:i||Is,maxHeight:s||Is}}const Ks=t=>Math.round(t*10)/10;function IS(t,e,n,i){const s=Ys(t),o=On(s,"margin"),a=qs(s.maxWidth,t,"clientWidth")||Is,l=qs(s.maxHeight,t,"clientHeight")||Is,c=LS(t,e,n);let{width:d,height:u}=c;if(s.boxSizing==="content-box"){const h=On(s,"border","width"),m=On(s,"padding");d-=m.width+h.width,u-=m.height+h.height}return d=Math.max(0,d-o.width),u=Math.max(0,i?d/i:u-o.height),d=Ks(Math.min(d,a,c.maxWidth)),u=Ks(Math.min(u,l,c.maxHeight)),d&&!u&&(u=Ks(d/2)),(e!==void 0||n!==void 0)&&i&&c.height&&u>c.height&&(u=c.height,d=Ks(Math.floor(u*i))),{width:d,height:u}}function kd(t,e,n){const i=e||1,s=Math.floor(t.height*i),o=Math.floor(t.width*i);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const a=t.canvas;return a.style&&(n||!a.style.height&&!a.style.width)&&(a.style.height=`${t.height}px`,a.style.width=`${t.width}px`),t.currentDevicePixelRatio!==i||a.height!==s||a.width!==o?(t.currentDevicePixelRatio=i,a.height=s,a.width=o,t.ctx.setTransform(i,0,0,i,0,0),!0):!1}const jS=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};Or()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return t}();function Sd(t,e){const n=VS(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Nn(t,e,n,i){return{x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}}function zS(t,e,n,i){return{x:t.x+n*(e.x-t.x),y:i==="middle"?n<.5?t.y:e.y:i==="after"?n<1?t.y:e.y:n>0?e.y:t.y}}function US(t,e,n,i){const s={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},a=Nn(t,s,n),l=Nn(s,o,n),c=Nn(o,e,n),d=Nn(a,l,n),u=Nn(l,c,n);return Nn(d,u,n)}const WS=function(t,e){return{x(n){return t+t+e-n},setWidth(n){e=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,i){return n-i},leftForLtr(n,i){return n-i}}},HS=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function qn(t,e,n){return t?WS(e,n):HS()}function wd(t,e){let n,i;(e==="ltr"||e==="rtl")&&(n=t.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=i)}function Ed(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Cd(t){return t==="angle"?{between:Ti,compare:qk,normalize:it}:{between:It,compare:(e,n)=>e-n,normalize:e=>e}}function Od({start:t,end:e,count:n,loop:i,style:s}){return{start:t%n,end:e%n,loop:i&&(e-t+1)%n===0,style:s}}function qS(t,e,n){const{property:i,start:s,end:o}=n,{between:a,normalize:l}=Cd(i),c=e.length;let{start:d,end:u,loop:f}=t,h,m;if(f){for(d+=c,u+=c,h=0,m=c;h<m&&a(l(e[d%c][i]),s,o);++h)d--,u--;d%=c,u%=c}return u<d&&(u+=c),{start:d,end:u,loop:f,style:t.style}}function vd(t,e,n){if(!n)return[t];const{property:i,start:s,end:o}=n,a=e.length,{compare:l,between:c,normalize:d}=Cd(i),{start:u,end:f,loop:h,style:m}=qS(t,e,n),p=[];let g=!1,y=null,b,x,w;const E=()=>c(s,w,b)&&l(s,w)!==0,k=()=>l(o,b)===0||c(o,w,b),C=()=>g||E(),S=()=>!g||k();for(let _=u,O=u;_<=f;++_)x=e[_%a],!x.skip&&(b=d(x[i]),b!==w&&(g=c(b,s,o),y===null&&C()&&(y=l(b,s)===0?_:O),y!==null&&S()&&(p.push(Od({start:y,end:_,loop:h,count:a,style:m})),y=null),O=_,w=b));return y!==null&&p.push(Od({start:y,end:f,loop:h,count:a,style:m})),p}function Nd(t,e){const n=[],i=t.segments;for(let s=0;s<i.length;s++){const o=vd(i[s],t.points,e);o.length&&n.push(...o)}return n}function YS(t,e,n,i){let s=0,o=e-1;if(n&&!i)for(;s<e&&!t[s].skip;)s++;for(;s<e&&t[s].skip;)s++;for(s%=e,n&&(o+=s);o>s&&t[o%e].skip;)o--;return o%=e,{start:s,end:o}}function KS(t,e,n,i){const s=t.length,o=[];let a=e,l=t[e],c;for(c=e+1;c<=n;++c){const d=t[c%s];d.skip||d.stop?l.skip||(i=!1,o.push({start:e%s,end:(c-1)%s,loop:i}),e=a=d.stop?c:null):(a=c,l.skip&&(e=c)),l=d}return a!==null&&o.push({start:e%s,end:a%s,loop:i}),o}function XS(t,e){const n=t.points,i=t.options.spanGaps,s=n.length;if(!s)return[];const o=!!t._loop,{start:a,end:l}=YS(n,s,o,i);if(i===!0)return Dd(t,[{start:a,end:l,loop:o}],n,e);const c=l<a?l+s:l,d=!!t._fullLoop&&a===0&&l===s-1;return Dd(t,KS(n,a,c,d),n,e)}function Dd(t,e,n,i){return!i||!i.setContext||!n?e:GS(t,e,n,i)}function GS(t,e,n,i){const s=t._chart.getContext(),o=Td(t.options),{_datasetIndex:a,options:{spanGaps:l}}=t,c=n.length,d=[];let u=o,f=e[0].start,h=f;function m(p,g,y,b){const x=l?-1:1;if(p!==g){for(p+=c;n[p%c].skip;)p-=x;for(;n[g%c].skip;)g+=x;p%c!==g%c&&(d.push({start:p%c,end:g%c,loop:y,style:b}),u=b,f=g%c)}}for(const p of e){f=l?f:p.start;let g=n[f%c],y;for(h=f+1;h<=p.end;h++){const b=n[h%c];y=Td(i.setContext(rn(s,{type:"segment",p0:g,p1:b,p0DataIndex:(h-1)%c,p1DataIndex:h%c,datasetIndex:a}))),JS(y,u)&&m(f,h-1,p.loop,u),g=b,u=y}f<h-1&&m(f,h-1,p.loop,u)}return d}function Td(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function JS(t,e){if(!e)return!1;const n=[],i=function(s,o){return yr(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(t,i)!==JSON.stringify(e,i)}/*!
175
+ */function Lt(){}const Mk=(()=>{let t=0;return()=>t++})();function fe(t){return t==null}function Oe(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function de(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function Pe(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function nt(t,e){return Pe(t)?t:e}function ae(t,e){return typeof t>"u"?e:t}const Vk=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/e,Uc=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function ke(t,e,n){if(t&&typeof t.call=="function")return t.apply(n,e)}function be(t,e,n,i){let s,o,a;if(Oe(t))for(o=t.length,s=0;s<o;s++)e.call(n,t[s],s);else if(de(t))for(a=Object.keys(t),o=a.length,s=0;s<o;s++)e.call(n,t[a[s]],a[s])}function $s(t,e){let n,i,s,o;if(!t||!e||t.length!==e.length)return!1;for(n=0,i=t.length;n<i;++n)if(s=t[n],o=e[n],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function Ls(t){if(Oe(t))return t.map(Ls);if(de(t)){const e=Object.create(null),n=Object.keys(t),i=n.length;let s=0;for(;s<i;++s)e[n[s]]=Ls(t[n[s]]);return e}return t}function Wc(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function Rk(t,e,n,i){if(!Wc(t))return;const s=e[t],o=n[t];de(s)&&de(o)?Oi(s,o,i):e[t]=Ls(o)}function Oi(t,e,n){const i=Oe(e)?e:[e],s=i.length;if(!de(t))return t;n=n||{};const o=n.merger||Rk;let a;for(let l=0;l<s;++l){if(a=i[l],!de(a))continue;const c=Object.keys(a);for(let d=0,u=c.length;d<u;++d)o(c[d],t,a,n)}return t}function vi(t,e){return Oi(t,e,{merger:Fk})}function Fk(t,e,n){if(!Wc(t))return;const i=e[t],s=n[t];de(i)&&de(s)?vi(i,s):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=Ls(s))}const Hc={"":t=>t,x:t=>t.x,y:t=>t.y};function $k(t){const e=t.split("."),n=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function Lk(t){const e=$k(t);return n=>{for(const i of e){if(i==="")break;n=n&&n[i]}return n}}function nn(t,e){return(Hc[e]||(Hc[e]=Lk(e)))(t)}function fr(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Ni=t=>typeof t<"u",sn=t=>typeof t=="function",qc=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};function Ik(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const Se=Math.PI,we=2*Se,jk=we+Se,Is=Number.POSITIVE_INFINITY,zk=Se/180,Me=Se/2,kn=Se/4,Yc=Se*2/3,on=Math.log10,Ct=Math.sign;function Di(t,e,n){return Math.abs(t-e)<n}function Kc(t){const e=Math.round(t);t=Di(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(on(t))),i=t/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function Uk(t){const e=[],n=Math.sqrt(t);let i;for(i=1;i<n;i++)t%i===0&&(e.push(i),e.push(t/i));return n===(n|0)&&e.push(n),e.sort((s,o)=>s-o).pop(),e}function Un(t){return!isNaN(parseFloat(t))&&isFinite(t)}function Wk(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}function Xc(t,e,n){let i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i][n],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function yt(t){return t*(Se/180)}function hr(t){return t*(180/Se)}function Gc(t){if(!Pe(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function Jc(t,e){const n=e.x-t.x,i=e.y-t.y,s=Math.sqrt(n*n+i*i);let o=Math.atan2(i,n);return o<-.5*Se&&(o+=we),{angle:o,distance:s}}function mr(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Hk(t,e){return(t-e+jk)%we-Se}function it(t){return(t%we+we)%we}function Ti(t,e,n,i){const s=it(t),o=it(e),a=it(n),l=it(o-s),c=it(a-s),d=it(s-o),u=it(s-a);return s===o||s===a||i&&o===a||l>c&&d<u}function Le(t,e,n){return Math.max(e,Math.min(n,t))}function qk(t){return Le(t,-32768,32767)}function It(t,e,n,i=1e-6){return t>=Math.min(e,n)-i&&t<=Math.max(e,n)+i}function pr(t,e,n){n=n||(a=>t[a]<e);let i=t.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 jt=(t,e,n,i)=>pr(t,n,i?s=>{const o=t[s][e];return o<n||o===n&&t[s+1][e]===n}:s=>t[s][e]<n),Yk=(t,e,n)=>pr(t,n,i=>t[i][e]>=n);function Kk(t,e,n){let i=0,s=t.length;for(;i<s&&t[i]<e;)i++;for(;s>i&&t[s-1]>n;)s--;return i>0||s<t.length?t.slice(i,s):t}const Qc=["push","pop","shift","splice","unshift"];function Xk(t,e){if(t._chartjs){t._chartjs.listeners.push(e);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),Qc.forEach(n=>{const i="_onData"+fr(n),s=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!1,value(...o){const a=s.apply(this,o);return t._chartjs.listeners.forEach(l=>{typeof l[i]=="function"&&l[i](...o)}),a}})})}function Zc(t,e){const n=t._chartjs;if(!n)return;const i=n.listeners,s=i.indexOf(e);s!==-1&&i.splice(s,1),!(i.length>0)&&(Qc.forEach(o=>{delete t[o]}),delete t._chartjs)}function ed(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const td=function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame}();function nd(t,e){let n=[],i=!1;return function(...s){n=s,i||(i=!0,td.call(window,()=>{i=!1,t.apply(e,n)}))}}function Gk(t,e){let n;return function(...i){return e?(clearTimeout(n),n=setTimeout(t,e,i)):t.apply(this,i),e}}const gr=t=>t==="start"?"left":t==="end"?"right":"center",We=(t,e,n)=>t==="start"?e:t==="end"?n:(e+n)/2,Jk=(t,e,n,i)=>t===(i?"left":"right")?n:t==="center"?(e+n)/2:e;function id(t,e,n){const i=e.length;let s=0,o=i;if(t._sorted){const{iScale:a,_parsed:l}=t,c=a.axis,{min:d,max:u,minDefined:f,maxDefined:h}=a.getUserBounds();f&&(s=Le(Math.min(jt(l,c,d).lo,n?i:jt(e,c,a.getPixelForValue(d)).lo),0,i-1)),h?o=Le(Math.max(jt(l,a.axis,u,!0).hi+1,n?0:jt(e,c,a.getPixelForValue(u),!0).hi+1),s,i)-s:o=i-s}return{start:s,count:o}}function sd(t){const{xScale:e,yScale:n,_scaleRanges:i}=t,s={xmin:e.min,xmax:e.max,ymin:n.min,ymax:n.max};if(!i)return t._scaleRanges=s,!0;const o=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,s),o}const js=t=>t===0||t===1,od=(t,e,n)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*we/n)),rd=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*we/n)+1,Bi={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*Me)+1,easeOutSine:t=>Math.sin(t*Me),easeInOutSine:t=>-.5*(Math.cos(Se*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>js(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>js(t)?t:od(t,.075,.3),easeOutElastic:t=>js(t)?t:rd(t,.075,.3),easeInOutElastic(t){return js(t)?t:t<.5?.5*od(t*2,.1125,.45):.5+.5*rd(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-Bi.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?Bi.easeInBounce(t*2)*.5:Bi.easeOutBounce(t*2-1)*.5+.5};function yr(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function ad(t){return yr(t)?t:new Ci(t)}function br(t){return yr(t)?t:new Ci(t).saturate(.5).darken(.1).hexString()}const Qk=["x","y","borderWidth","radius","tension"],Zk=["color","borderColor","backgroundColor"];function eS(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),t.set("animations",{colors:{type:"color",properties:Zk},numbers:{type:"number",properties:Qk}}),t.describe("animations",{_fallback:"animation"}),t.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:e=>e|0}}}})}function tS(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const ld=new Map;function nS(t,e){e=e||{};const n=t+JSON.stringify(e);let i=ld.get(n);return i||(i=new Intl.NumberFormat(t,e),ld.set(n,i)),i}function Pi(t,e,n){return nS(e,n).format(t)}const cd={values(t){return Oe(t)?t:""+t},numeric(t,e,n){if(t===0)return"0";const i=this.chart.options.locale;let s,o=t;if(n.length>1){const d=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(d<1e-4||d>1e15)&&(s="scientific"),o=iS(t,n)}const a=on(Math.abs(o)),l=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),c={notation:s,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(c,this.options.ticks.format),Pi(t,i,c)},logarithmic(t,e,n){if(t===0)return"0";const i=n[e].significand||t/Math.pow(10,Math.floor(on(t)));return[1,2,3,5,10,15].includes(i)||e>.8*n.length?cd.numeric.call(this,t,e,n):""}};function iS(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t)),n}var Ai={formatters:cd};function sS(t){t.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:(e,n)=>n.lineWidth,tickColor:(e,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:Ai.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const Sn=Object.create(null),xr=Object.create(null);function Mi(t,e){if(!e)return t;const n=e.split(".");for(let i=0,s=n.length;i<s;++i){const o=n[i];t=t[o]||(t[o]=Object.create(null))}return t}function _r(t,e,n){return typeof e=="string"?Oi(Mi(t,e),n):Oi(Mi(t,""),e)}class oS{constructor(e,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)=>br(s.backgroundColor),this.hoverBorderColor=(i,s)=>br(s.borderColor),this.hoverColor=(i,s)=>br(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(e),this.apply(n)}set(e,n){return _r(this,e,n)}get(e){return Mi(this,e)}describe(e,n){return _r(xr,e,n)}override(e,n){return _r(Sn,e,n)}route(e,n,i,s){const o=Mi(this,e),a=Mi(this,i),l="_"+n;Object.defineProperties(o,{[l]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const c=this[l],d=a[s];return de(c)?Object.assign({},d,c):ae(c,d)},set(c){this[l]=c}}})}apply(e){e.forEach(n=>n(this))}}var Ee=new oS({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[eS,tS,sS]);function rS(t){return!t||fe(t.size)||fe(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function zs(t,e,n,i,s){let o=e[s];return o||(o=e[s]=t.measureText(s).width,n.push(s)),o>i&&(i=o),i}function aS(t,e,n,i){i=i||{};let s=i.data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(s=i.data={},o=i.garbageCollect=[],i.font=e),t.save(),t.font=e;let a=0;const l=n.length;let c,d,u,f,h;for(c=0;c<l;c++)if(f=n[c],f!=null&&!Oe(f))a=zs(t,s,o,a,f);else if(Oe(f))for(d=0,u=f.length;d<u;d++)h=f[d],h!=null&&!Oe(h)&&(a=zs(t,s,o,a,h));t.restore();const m=o.length/2;if(m>n.length){for(c=0;c<m;c++)delete s[o[c]];o.splice(0,m)}return a}function wn(t,e,n){const i=t.currentDevicePixelRatio,s=n!==0?Math.max(n/2,.5):0;return Math.round((e-s)*i)/i+s}function dd(t,e){!e&&!t||(e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function kr(t,e,n,i){ud(t,e,n,i,null)}function ud(t,e,n,i,s){let o,a,l,c,d,u,f,h;const m=e.pointStyle,p=e.rotation,g=e.radius;let y=(p||0)*zk;if(m&&typeof m=="object"&&(o=m.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){t.save(),t.translate(n,i),t.rotate(y),t.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),t.restore();return}if(!(isNaN(g)||g<=0)){switch(t.beginPath(),m){default:s?t.ellipse(n,i,s/2,g,0,0,we):t.arc(n,i,g,0,we),t.closePath();break;case"triangle":u=s?s/2:g,t.moveTo(n+Math.sin(y)*u,i-Math.cos(y)*g),y+=Yc,t.lineTo(n+Math.sin(y)*u,i-Math.cos(y)*g),y+=Yc,t.lineTo(n+Math.sin(y)*u,i-Math.cos(y)*g),t.closePath();break;case"rectRounded":d=g*.516,c=g-d,a=Math.cos(y+kn)*c,f=Math.cos(y+kn)*(s?s/2-d:c),l=Math.sin(y+kn)*c,h=Math.sin(y+kn)*(s?s/2-d:c),t.arc(n-f,i-l,d,y-Se,y-Me),t.arc(n+h,i-a,d,y-Me,y),t.arc(n+f,i+l,d,y,y+Me),t.arc(n-h,i+a,d,y+Me,y+Se),t.closePath();break;case"rect":if(!p){c=Math.SQRT1_2*g,u=s?s/2:c,t.rect(n-u,i-c,2*u,2*c);break}y+=kn;case"rectRot":f=Math.cos(y)*(s?s/2:g),a=Math.cos(y)*g,l=Math.sin(y)*g,h=Math.sin(y)*(s?s/2:g),t.moveTo(n-f,i-l),t.lineTo(n+h,i-a),t.lineTo(n+f,i+l),t.lineTo(n-h,i+a),t.closePath();break;case"crossRot":y+=kn;case"cross":f=Math.cos(y)*(s?s/2:g),a=Math.cos(y)*g,l=Math.sin(y)*g,h=Math.sin(y)*(s?s/2:g),t.moveTo(n-f,i-l),t.lineTo(n+f,i+l),t.moveTo(n+h,i-a),t.lineTo(n-h,i+a);break;case"star":f=Math.cos(y)*(s?s/2:g),a=Math.cos(y)*g,l=Math.sin(y)*g,h=Math.sin(y)*(s?s/2:g),t.moveTo(n-f,i-l),t.lineTo(n+f,i+l),t.moveTo(n+h,i-a),t.lineTo(n-h,i+a),y+=kn,f=Math.cos(y)*(s?s/2:g),a=Math.cos(y)*g,l=Math.sin(y)*g,h=Math.sin(y)*(s?s/2:g),t.moveTo(n-f,i-l),t.lineTo(n+f,i+l),t.moveTo(n+h,i-a),t.lineTo(n-h,i+a);break;case"line":a=s?s/2:Math.cos(y)*g,l=Math.sin(y)*g,t.moveTo(n-a,i-l),t.lineTo(n+a,i+l);break;case"dash":t.moveTo(n,i),t.lineTo(n+Math.cos(y)*(s?s/2:g),i+Math.sin(y)*g);break;case!1:t.closePath();break}t.fill(),e.borderWidth>0&&t.stroke()}}function zt(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.x<e.right+n&&t.y>e.top-n&&t.y<e.bottom+n}function Us(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Ws(t){t.restore()}function lS(t,e,n,i,s){if(!e)return t.lineTo(n.x,n.y);if(s==="middle"){const o=(e.x+n.x)/2;t.lineTo(o,e.y),t.lineTo(o,n.y)}else s==="after"!=!!i?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y);t.lineTo(n.x,n.y)}function cS(t,e,n,i){if(!e)return t.lineTo(n.x,n.y);t.bezierCurveTo(i?e.cp1x:e.cp2x,i?e.cp1y:e.cp2y,i?n.cp2x:n.cp1x,i?n.cp2y:n.cp1y,n.x,n.y)}function dS(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),fe(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}function uS(t,e,n,i,s){if(s.strikethrough||s.underline){const o=t.measureText(i),a=e-o.actualBoundingBoxLeft,l=e+o.actualBoundingBoxRight,c=n-o.actualBoundingBoxAscent,d=n+o.actualBoundingBoxDescent,u=s.strikethrough?(c+d)/2:d;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=s.decorationWidth||2,t.moveTo(a,u),t.lineTo(l,u),t.stroke()}}function fS(t,e){const n=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=n}function En(t,e,n,i,s,o={}){const a=Oe(e)?e:[e],l=o.strokeWidth>0&&o.strokeColor!=="";let c,d;for(t.save(),t.font=s.string,dS(t,o),c=0;c<a.length;++c)d=a[c],o.backdrop&&fS(t,o.backdrop),l&&(o.strokeColor&&(t.strokeStyle=o.strokeColor),fe(o.strokeWidth)||(t.lineWidth=o.strokeWidth),t.strokeText(d,n,i,o.maxWidth)),t.fillText(d,n,i,o.maxWidth),uS(t,n,i,d,o),i+=Number(s.lineHeight);t.restore()}function Vi(t,e){const{x:n,y:i,w:s,h:o,radius:a}=e;t.arc(n+a.topLeft,i+a.topLeft,a.topLeft,1.5*Se,Se,!0),t.lineTo(n,i+o-a.bottomLeft),t.arc(n+a.bottomLeft,i+o-a.bottomLeft,a.bottomLeft,Se,Me,!0),t.lineTo(n+s-a.bottomRight,i+o),t.arc(n+s-a.bottomRight,i+o-a.bottomRight,a.bottomRight,Me,0,!0),t.lineTo(n+s,i+a.topRight),t.arc(n+s-a.topRight,i+a.topRight,a.topRight,0,-Me,!0),t.lineTo(n+a.topLeft,i)}const hS=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,mS=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function pS(t,e){const n=(""+t).match(hS);if(!n||n[1]==="normal")return e*1.2;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100;break}return e*t}const gS=t=>+t||0;function Sr(t,e){const n={},i=de(e),s=i?Object.keys(e):e,o=de(t)?i?a=>ae(t[a],t[e[a]]):a=>t[a]:()=>t;for(const a of s)n[a]=gS(o(a));return n}function fd(t){return Sr(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Cn(t){return Sr(t,["topLeft","topRight","bottomLeft","bottomRight"])}function He(t){const e=fd(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Fe(t,e){t=t||{},e=e||Ee.font;let n=ae(t.size,e.size);typeof n=="string"&&(n=parseInt(n,10));let i=ae(t.style,e.style);i&&!(""+i).match(mS)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:ae(t.family,e.family),lineHeight:pS(ae(t.lineHeight,e.lineHeight),n),size:n,style:i,weight:ae(t.weight,e.weight),string:""};return s.string=rS(s),s}function Ri(t,e,n,i){let s,o,a;for(s=0,o=t.length;s<o;++s)if(a=t[s],a!==void 0&&a!==void 0)return a}function yS(t,e,n){const{min:i,max:s}=t,o=Uc(e,(s-i)/2),a=(l,c)=>n&&l===0?0:l+c;return{min:a(i,-Math.abs(o)),max:a(s,o)}}function rn(t,e){return Object.assign(Object.create(t),e)}function wr(t,e=[""],n,i,s=()=>t[0]){const o=n||t;typeof i>"u"&&(i=yd("_fallback",t));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:i,_getTarget:s,override:l=>wr([l,...t],e,o,i)};return new Proxy(a,{deleteProperty(l,c){return delete l[c],delete l._keys,delete t[0][c],!0},get(l,c){return md(l,c,()=>CS(c,e,t,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(l,c){return bd(l).includes(c)},ownKeys(l){return bd(l)},set(l,c,d){const u=l._storage||(l._storage=s());return l[c]=u[c]=d,delete l._keys,!0}})}function Wn(t,e,n,i){const s={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:hd(t,i),setContext:o=>Wn(t,o,n,i),override:o=>Wn(t.override(o),e,n,i)};return new Proxy(s,{deleteProperty(o,a){return delete o[a],delete t[a],!0},get(o,a,l){return md(o,a,()=>xS(o,a,l))},getOwnPropertyDescriptor(o,a){return o._descriptors.allKeys?Reflect.has(t,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,a)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(o,a){return Reflect.has(t,a)},ownKeys(){return Reflect.ownKeys(t)},set(o,a,l){return t[a]=l,delete o[a],!0}})}function hd(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:i=e.indexable,_allKeys:s=e.allKeys}=t;return{allKeys:s,scriptable:n,indexable:i,isScriptable:sn(n)?n:()=>n,isIndexable:sn(i)?i:()=>i}}const bS=(t,e)=>t?t+fr(e):e,Er=(t,e)=>de(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function md(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e)||e==="constructor")return t[e];const i=n();return t[e]=i,i}function xS(t,e,n){const{_proxy:i,_context:s,_subProxy:o,_descriptors:a}=t;let l=i[e];return sn(l)&&a.isScriptable(e)&&(l=_S(e,l,t,n)),Oe(l)&&l.length&&(l=kS(e,l,t,a.isIndexable)),Er(e,l)&&(l=Wn(l,s,o&&o[e],a)),l}function _S(t,e,n,i){const{_proxy:s,_context:o,_subProxy:a,_stack:l}=n;if(l.has(t))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+t);l.add(t);let c=e(o,a||i);return l.delete(t),Er(t,c)&&(c=Cr(s._scopes,s,t,c)),c}function kS(t,e,n,i){const{_proxy:s,_context:o,_subProxy:a,_descriptors:l}=n;if(typeof o.index<"u"&&i(t))return e[o.index%e.length];if(de(e[0])){const c=e,d=s._scopes.filter(u=>u!==c);e=[];for(const u of c){const f=Cr(d,s,t,u);e.push(Wn(f,o,a&&a[t],l))}}return e}function pd(t,e,n){return sn(t)?t(e,n):t}const SS=(t,e)=>t===!0?e:typeof t=="string"?nn(e,t):void 0;function wS(t,e,n,i,s){for(const o of e){const a=SS(n,o);if(a){t.add(a);const l=pd(a._fallback,n,s);if(typeof l<"u"&&l!==n&&l!==i)return l}else if(a===!1&&typeof i<"u"&&n!==i)return null}return!1}function Cr(t,e,n,i){const s=e._rootScopes,o=pd(e._fallback,n,i),a=[...t,...s],l=new Set;l.add(i);let c=gd(l,a,n,o||n,i);return c===null||typeof o<"u"&&o!==n&&(c=gd(l,a,o,c,i),c===null)?!1:wr(Array.from(l),[""],s,o,()=>ES(e,n,i))}function gd(t,e,n,i,s){for(;n;)n=wS(t,e,n,i,s);return n}function ES(t,e,n){const i=t._getTarget();e in i||(i[e]={});const s=i[e];return Oe(s)&&de(n)?n:s||{}}function CS(t,e,n,i){let s;for(const o of e)if(s=yd(bS(o,t),n),typeof s<"u")return Er(t,s)?Cr(n,i,t,s):s}function yd(t,e){for(const n of e){if(!n)continue;const i=n[t];if(typeof i<"u")return i}}function bd(t){let e=t._keys;return e||(e=t._keys=OS(t._scopes)),e}function OS(t){const e=new Set;for(const n of t)for(const i of Object.keys(n).filter(s=>!s.startsWith("_")))e.add(i);return Array.from(e)}function xd(t,e,n,i){const{iScale:s}=t,{key:o="r"}=this._parsing,a=new Array(i);let l,c,d,u;for(l=0,c=i;l<c;++l)d=l+n,u=e[d],a[l]={r:s.parse(nn(u,o),d)};return a}const vS=Number.EPSILON||1e-14,Hn=(t,e)=>e<t.length&&!t[e].skip&&t[e],_d=t=>t==="x"?"y":"x";function NS(t,e,n,i){const s=t.skip?e:t,o=e,a=n.skip?e:n,l=mr(o,s),c=mr(a,o);let d=l/(l+c),u=c/(l+c);d=isNaN(d)?0:d,u=isNaN(u)?0:u;const f=i*d,h=i*u;return{previous:{x:o.x-f*(a.x-s.x),y:o.y-f*(a.y-s.y)},next:{x:o.x+h*(a.x-s.x),y:o.y+h*(a.y-s.y)}}}function DS(t,e,n){const i=t.length;let s,o,a,l,c,d=Hn(t,0);for(let u=0;u<i-1;++u)if(c=d,d=Hn(t,u+1),!(!c||!d)){if(Di(e[u],0,vS)){n[u]=n[u+1]=0;continue}s=n[u]/e[u],o=n[u+1]/e[u],l=Math.pow(s,2)+Math.pow(o,2),!(l<=9)&&(a=3/Math.sqrt(l),n[u]=s*a*e[u],n[u+1]=o*a*e[u])}}function TS(t,e,n="x"){const i=_d(n),s=t.length;let o,a,l,c=Hn(t,0);for(let d=0;d<s;++d){if(a=l,l=c,c=Hn(t,d+1),!l)continue;const u=l[n],f=l[i];a&&(o=(u-a[n])/3,l[`cp1${n}`]=u-o,l[`cp1${i}`]=f-o*e[d]),c&&(o=(c[n]-u)/3,l[`cp2${n}`]=u+o,l[`cp2${i}`]=f+o*e[d])}}function BS(t,e="x"){const n=_d(e),i=t.length,s=Array(i).fill(0),o=Array(i);let a,l,c,d=Hn(t,0);for(a=0;a<i;++a)if(l=c,c=d,d=Hn(t,a+1),!!c){if(d){const u=d[e]-c[e];s[a]=u!==0?(d[n]-c[n])/u:0}o[a]=l?d?Ct(s[a-1])!==Ct(s[a])?0:(s[a-1]+s[a])/2:s[a-1]:s[a]}DS(t,s,o),TS(t,o,e)}function Hs(t,e,n){return Math.max(Math.min(t,n),e)}function PS(t,e){let n,i,s,o,a,l=zt(t[0],e);for(n=0,i=t.length;n<i;++n)a=o,o=l,l=n<i-1&&zt(t[n+1],e),o&&(s=t[n],a&&(s.cp1x=Hs(s.cp1x,e.left,e.right),s.cp1y=Hs(s.cp1y,e.top,e.bottom)),l&&(s.cp2x=Hs(s.cp2x,e.left,e.right),s.cp2y=Hs(s.cp2y,e.top,e.bottom)))}function AS(t,e,n,i,s){let o,a,l,c;if(e.spanGaps&&(t=t.filter(d=>!d.skip)),e.cubicInterpolationMode==="monotone")BS(t,s);else{let d=i?t[t.length-1]:t[0];for(o=0,a=t.length;o<a;++o)l=t[o],c=NS(d,l,t[Math.min(o+1,a-(i?0:1))%a],e.tension),l.cp1x=c.previous.x,l.cp1y=c.previous.y,l.cp2x=c.next.x,l.cp2y=c.next.y,d=l}e.capBezierPoints&&PS(t,n)}function Or(){return typeof window<"u"&&typeof document<"u"}function vr(t){let e=t.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function qs(t,e,n){let i;return typeof t=="string"?(i=parseInt(t,10),t.indexOf("%")!==-1&&(i=i/100*e.parentNode[n])):i=t,i}const Ys=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function MS(t,e){return Ys(t).getPropertyValue(e)}const VS=["top","right","bottom","left"];function On(t,e,n){const i={};n=n?"-"+n:"";for(let s=0;s<4;s++){const o=VS[s];i[o]=parseFloat(t[e+"-"+o+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const RS=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function FS(t,e){const n=t.touches,i=n&&n.length?n[0]:t,{offsetX:s,offsetY:o}=i;let a=!1,l,c;if(RS(s,o,t.target))l=s,c=o;else{const d=e.getBoundingClientRect();l=i.clientX-d.left,c=i.clientY-d.top,a=!0}return{x:l,y:c,box:a}}function vn(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:i}=e,s=Ys(n),o=s.boxSizing==="border-box",a=On(s,"padding"),l=On(s,"border","width"),{x:c,y:d,box:u}=FS(t,n),f=a.left+(u&&l.left),h=a.top+(u&&l.top);let{width:m,height:p}=e;return o&&(m-=a.width+l.width,p-=a.height+l.height),{x:Math.round((c-f)/m*n.width/i),y:Math.round((d-h)/p*n.height/i)}}function $S(t,e,n){let i,s;if(e===void 0||n===void 0){const o=t&&vr(t);if(!o)e=t.clientWidth,n=t.clientHeight;else{const a=o.getBoundingClientRect(),l=Ys(o),c=On(l,"border","width"),d=On(l,"padding");e=a.width-d.width-c.width,n=a.height-d.height-c.height,i=qs(l.maxWidth,o,"clientWidth"),s=qs(l.maxHeight,o,"clientHeight")}}return{width:e,height:n,maxWidth:i||Is,maxHeight:s||Is}}const Ks=t=>Math.round(t*10)/10;function LS(t,e,n,i){const s=Ys(t),o=On(s,"margin"),a=qs(s.maxWidth,t,"clientWidth")||Is,l=qs(s.maxHeight,t,"clientHeight")||Is,c=$S(t,e,n);let{width:d,height:u}=c;if(s.boxSizing==="content-box"){const h=On(s,"border","width"),m=On(s,"padding");d-=m.width+h.width,u-=m.height+h.height}return d=Math.max(0,d-o.width),u=Math.max(0,i?d/i:u-o.height),d=Ks(Math.min(d,a,c.maxWidth)),u=Ks(Math.min(u,l,c.maxHeight)),d&&!u&&(u=Ks(d/2)),(e!==void 0||n!==void 0)&&i&&c.height&&u>c.height&&(u=c.height,d=Ks(Math.floor(u*i))),{width:d,height:u}}function kd(t,e,n){const i=e||1,s=Math.floor(t.height*i),o=Math.floor(t.width*i);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const a=t.canvas;return a.style&&(n||!a.style.height&&!a.style.width)&&(a.style.height=`${t.height}px`,a.style.width=`${t.width}px`),t.currentDevicePixelRatio!==i||a.height!==s||a.width!==o?(t.currentDevicePixelRatio=i,a.height=s,a.width=o,t.ctx.setTransform(i,0,0,i,0,0),!0):!1}const IS=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};Or()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return t}();function Sd(t,e){const n=MS(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Nn(t,e,n,i){return{x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}}function jS(t,e,n,i){return{x:t.x+n*(e.x-t.x),y:i==="middle"?n<.5?t.y:e.y:i==="after"?n<1?t.y:e.y:n>0?e.y:t.y}}function zS(t,e,n,i){const s={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},a=Nn(t,s,n),l=Nn(s,o,n),c=Nn(o,e,n),d=Nn(a,l,n),u=Nn(l,c,n);return Nn(d,u,n)}const US=function(t,e){return{x(n){return t+t+e-n},setWidth(n){e=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,i){return n-i},leftForLtr(n,i){return n-i}}},WS=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function qn(t,e,n){return t?US(e,n):WS()}function wd(t,e){let n,i;(e==="ltr"||e==="rtl")&&(n=t.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=i)}function Ed(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Cd(t){return t==="angle"?{between:Ti,compare:Hk,normalize:it}:{between:It,compare:(e,n)=>e-n,normalize:e=>e}}function Od({start:t,end:e,count:n,loop:i,style:s}){return{start:t%n,end:e%n,loop:i&&(e-t+1)%n===0,style:s}}function HS(t,e,n){const{property:i,start:s,end:o}=n,{between:a,normalize:l}=Cd(i),c=e.length;let{start:d,end:u,loop:f}=t,h,m;if(f){for(d+=c,u+=c,h=0,m=c;h<m&&a(l(e[d%c][i]),s,o);++h)d--,u--;d%=c,u%=c}return u<d&&(u+=c),{start:d,end:u,loop:f,style:t.style}}function vd(t,e,n){if(!n)return[t];const{property:i,start:s,end:o}=n,a=e.length,{compare:l,between:c,normalize:d}=Cd(i),{start:u,end:f,loop:h,style:m}=HS(t,e,n),p=[];let g=!1,y=null,b,x,w;const E=()=>c(s,w,b)&&l(s,w)!==0,k=()=>l(o,b)===0||c(o,w,b),C=()=>g||E(),S=()=>!g||k();for(let _=u,O=u;_<=f;++_)x=e[_%a],!x.skip&&(b=d(x[i]),b!==w&&(g=c(b,s,o),y===null&&C()&&(y=l(b,s)===0?_:O),y!==null&&S()&&(p.push(Od({start:y,end:_,loop:h,count:a,style:m})),y=null),O=_,w=b));return y!==null&&p.push(Od({start:y,end:f,loop:h,count:a,style:m})),p}function Nd(t,e){const n=[],i=t.segments;for(let s=0;s<i.length;s++){const o=vd(i[s],t.points,e);o.length&&n.push(...o)}return n}function qS(t,e,n,i){let s=0,o=e-1;if(n&&!i)for(;s<e&&!t[s].skip;)s++;for(;s<e&&t[s].skip;)s++;for(s%=e,n&&(o+=s);o>s&&t[o%e].skip;)o--;return o%=e,{start:s,end:o}}function YS(t,e,n,i){const s=t.length,o=[];let a=e,l=t[e],c;for(c=e+1;c<=n;++c){const d=t[c%s];d.skip||d.stop?l.skip||(i=!1,o.push({start:e%s,end:(c-1)%s,loop:i}),e=a=d.stop?c:null):(a=c,l.skip&&(e=c)),l=d}return a!==null&&o.push({start:e%s,end:a%s,loop:i}),o}function KS(t,e){const n=t.points,i=t.options.spanGaps,s=n.length;if(!s)return[];const o=!!t._loop,{start:a,end:l}=qS(n,s,o,i);if(i===!0)return Dd(t,[{start:a,end:l,loop:o}],n,e);const c=l<a?l+s:l,d=!!t._fullLoop&&a===0&&l===s-1;return Dd(t,YS(n,a,c,d),n,e)}function Dd(t,e,n,i){return!i||!i.setContext||!n?e:XS(t,e,n,i)}function XS(t,e,n,i){const s=t._chart.getContext(),o=Td(t.options),{_datasetIndex:a,options:{spanGaps:l}}=t,c=n.length,d=[];let u=o,f=e[0].start,h=f;function m(p,g,y,b){const x=l?-1:1;if(p!==g){for(p+=c;n[p%c].skip;)p-=x;for(;n[g%c].skip;)g+=x;p%c!==g%c&&(d.push({start:p%c,end:g%c,loop:y,style:b}),u=b,f=g%c)}}for(const p of e){f=l?f:p.start;let g=n[f%c],y;for(h=f+1;h<=p.end;h++){const b=n[h%c];y=Td(i.setContext(rn(s,{type:"segment",p0:g,p1:b,p0DataIndex:(h-1)%c,p1DataIndex:h%c,datasetIndex:a}))),GS(y,u)&&m(f,h-1,p.loop,u),g=b,u=y}f<h-1&&m(f,h-1,p.loop,u)}return d}function Td(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function GS(t,e){if(!e)return!1;const n=[],i=function(s,o){return yr(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(t,i)!==JSON.stringify(e,i)}/*!
176
176
  * Chart.js v4.4.7
177
177
  * https://www.chartjs.org
178
178
  * (c) 2024 Chart.js Contributors
179
179
  * Released under the MIT License
180
- */class QS{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,n,i,s){const o=n.listeners[s],a=n.duration;o.forEach(l=>l({chart:e,initial:n.initial,numSteps:a,currentStep:Math.min(i-n.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=td.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let n=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const o=i.items;let a=o.length-1,l=!1,c;for(;a>=0;--a)c=o[a],c._active?(c._total>i.duration&&(i.duration=c._total),c.tick(e),l=!0):(o[a]=o[o.length-1],o.pop());l&&(s.draw(),this._notify(s,i,e,"progress")),o.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),n+=o.length}),this._lastDate=e,n===0&&(this._running=!1)}_getAnims(e){const n=this._charts;let i=n.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(e,i)),i}listen(e,n,i){this._getAnims(e).listeners[n].push(i)}add(e,n){!n||!n.length||this._getAnims(e).items.push(...n)}has(e){return this._getAnims(e).items.length>0}start(e){const n=this._charts.get(e);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const n=this._charts.get(e);return!(!n||!n.running||!n.items.length)}stop(e){const n=this._charts.get(e);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(e,n,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Ot=new QS;const Bd="transparent",ZS={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const i=ad(t||Bd),s=i.valid&&ad(e||Bd);return s&&s.valid?s.mix(i,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class Pd{constructor(e,n,i,s){const o=n[i];s=Ri([e.to,s,o,e.from]);const a=Ri([e.from,o,s]);this._active=!0,this._fn=e.fn||ZS[e.type||typeof a],this._easing=Bi[e.easing]||Bi.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=n,this._prop=i,this._from=a,this._to=s,this._promises=void 0}active(){return this._active}update(e,n,i){if(this._active){this._notify(!1);const s=this._target[this._prop],o=i-this._start,a=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(a,e.duration)),this._total+=o,this._loop=!!e.loop,this._to=Ri([e.to,n,s,e.from]),this._from=Ri([e.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const n=e-this._start,i=this._duration,s=this._prop,o=this._from,a=this._loop,l=this._to;let c;if(this._active=o!==l&&(a||n<i),!this._active){this._target[s]=l,this._notify(!0);return}if(n<0){this._target[s]=o;return}c=n/i%2,c=a&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[s]=this._fn(o,l,c)}wait(){const e=this._promises||(this._promises=[]);return new Promise((n,i)=>{e.push({res:n,rej:i})})}_notify(e){const n=e?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][n]()}}class Nr{constructor(e,n){this._chart=e,this._properties=new Map,this.configure(n)}configure(e){if(!de(e))return;const n=Object.keys(Ee.animation),i=this._properties;Object.getOwnPropertyNames(e).forEach(s=>{const o=e[s];if(!de(o))return;const a={};for(const l of n)a[l]=o[l];(Oe(o.properties)&&o.properties||[s]).forEach(l=>{(l===s||!i.has(l))&&i.set(l,a)})})}_animateOptions(e,n){const i=n.options,s=tw(e,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&ew(e.options.$animations,i).then(()=>{e.options=i},()=>{}),o}_createAnimations(e,n){const i=this._properties,s=[],o=e.$animations||(e.$animations={}),a=Object.keys(n),l=Date.now();let c;for(c=a.length-1;c>=0;--c){const d=a[c];if(d.charAt(0)==="$")continue;if(d==="options"){s.push(...this._animateOptions(e,n));continue}const u=n[d];let f=o[d];const h=i.get(d);if(f)if(h&&f.active()){f.update(h,u,l);continue}else f.cancel();if(!h||!h.duration){e[d]=u;continue}o[d]=f=new Pd(h,e,d,u),s.push(f)}return s}update(e,n){if(this._properties.size===0){Object.assign(e,n);return}const i=this._createAnimations(e,n);if(i.length)return Ot.add(this._chart,i),!0}}function ew(t,e){const n=[],i=Object.keys(e);for(let s=0;s<i.length;s++){const o=t[i[s]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function tw(t,e){if(!e)return;let n=t.options;if(!n){t.options=e;return}return n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function Ad(t,e){const n=t&&t.options||{},i=n.reverse,s=n.min===void 0?e:0,o=n.max===void 0?e:0;return{start:i?o:s,end:i?s:o}}function nw(t,e,n){if(n===!1)return!1;const i=Ad(t,n),s=Ad(e,n);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function iw(t){let e,n,i,s;return de(t)?(e=t.top,n=t.right,i=t.bottom,s=t.left):e=n=i=s=t,{top:e,right:n,bottom:i,left:s,disabled:t===!1}}function Md(t,e){const n=[],i=t._getSortedDatasetMetas(e);let s,o;for(s=0,o=i.length;s<o;++s)n.push(i[s].index);return n}function Vd(t,e,n,i={}){const s=t.keys,o=i.mode==="single";let a,l,c,d;if(e===null)return;let u=!1;for(a=0,l=s.length;a<l;++a){if(c=+s[a],c===n){if(u=!0,i.all)continue;break}d=t.values[c],Pe(d)&&(o||e===0||Ct(e)===Ct(d))&&(e+=d)}return!u&&!i.all?0:e}function sw(t,e){const{iScale:n,vScale:i}=e,s=n.axis==="x"?"x":"y",o=i.axis==="x"?"x":"y",a=Object.keys(t),l=new Array(a.length);let c,d,u;for(c=0,d=a.length;c<d;++c)u=a[c],l[c]={[s]:u,[o]:t[u]};return l}function Dr(t,e){const n=t&&t.options.stacked;return n||n===void 0&&e.stack!==void 0}function ow(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}function rw(t){const{min:e,max:n,minDefined:i,maxDefined:s}=t.getUserBounds();return{min:i?e:Number.NEGATIVE_INFINITY,max:s?n:Number.POSITIVE_INFINITY}}function aw(t,e,n){const i=t[e]||(t[e]={});return i[n]||(i[n]={})}function Rd(t,e,n,i){for(const s of e.getMatchingVisibleMetas(i).reverse()){const o=t[s.index];if(n&&o>0||!n&&o<0)return s.index}return null}function Fd(t,e){const{chart:n,_cachedMeta:i}=t,s=n._stacks||(n._stacks={}),{iScale:o,vScale:a,index:l}=i,c=o.axis,d=a.axis,u=ow(o,a,i),f=e.length;let h;for(let m=0;m<f;++m){const p=e[m],{[c]:g,[d]:y}=p,b=p._stacks||(p._stacks={});h=b[d]=aw(s,u,g),h[l]=y,h._top=Rd(h,a,!0,i.type),h._bottom=Rd(h,a,!1,i.type);const x=h._visualValues||(h._visualValues={});x[l]=y}}function Tr(t,e){const n=t.scales;return Object.keys(n).filter(i=>n[i].axis===e).shift()}function lw(t,e){return rn(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function cw(t,e,n){return rn(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}function Fi(t,e){const n=t.controller.index,i=t.vScale&&t.vScale.axis;if(i){e=e||t._parsed;for(const s of e){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 Br=t=>t==="reset"||t==="none",$d=(t,e)=>e?t:Object.assign({},t),dw=(t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:Md(n,!0),values:null};class lt{constructor(e,n){this.chart=e,this._ctx=e.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 e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Dr(e.vScale,e),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(e){this.index!==e&&Fi(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(f,h,m,p)=>f==="x"?h:f==="r"?p:m,o=n.xAxisID=ae(i.xAxisID,Tr(e,"x")),a=n.yAxisID=ae(i.yAxisID,Tr(e,"y")),l=n.rAxisID=ae(i.rAxisID,Tr(e,"r")),c=n.indexAxis,d=n.iAxisID=s(c,o,a,l),u=n.vAxisID=s(c,a,o,l);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(a),n.rScale=this.getScaleForId(l),n.iScale=this.getScaleForId(d),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const n=this._cachedMeta;return e===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&Zc(this._data,this),e._stacked&&Fi(e)}_dataCheck(){const e=this.getDataset(),n=e.data||(e.data=[]),i=this._data;if(de(n)){const s=this._cachedMeta;this._data=sw(n,s)}else if(i!==n){if(i){Zc(i,this);const s=this._cachedMeta;Fi(s),s._parsed=[]}n&&Object.isExtensible(n)&&Gk(n,this),this._syncList=[],this._data=n}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const n=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const o=n._stacked;n._stacked=Dr(n.vScale,n),n.stack!==i.stack&&(s=!0,Fi(n),n.stack=i.stack),this._resyncElements(e),(s||o!==n._stacked)&&(Fd(this,n._parsed),n._stacked=Dr(n.vScale,n))}configure(){const e=this.chart.config,n=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),n,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,n){const{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:a}=i,l=o.axis;let c=e===0&&n===s.length?!0:i._sorted,d=e>0&&i._parsed[e-1],u,f,h;if(this._parsing===!1)i._parsed=s,i._sorted=!0,h=s;else{Oe(s[e])?h=this.parseArrayData(i,s,e,n):de(s[e])?h=this.parseObjectData(i,s,e,n):h=this.parsePrimitiveData(i,s,e,n);const m=()=>f[l]===null||d&&f[l]<d[l];for(u=0;u<n;++u)i._parsed[u+e]=f=h[u],c&&(m()&&(c=!1),d=f);i._sorted=c}a&&Fd(this,h)}parsePrimitiveData(e,n,i,s){const{iScale:o,vScale:a}=e,l=o.axis,c=a.axis,d=o.getLabels(),u=o===a,f=new Array(s);let h,m,p;for(h=0,m=s;h<m;++h)p=h+i,f[h]={[l]:u||o.parse(d[p],p),[c]:a.parse(n[p],p)};return f}parseArrayData(e,n,i,s){const{xScale:o,yScale:a}=e,l=new Array(s);let c,d,u,f;for(c=0,d=s;c<d;++c)u=c+i,f=n[u],l[c]={x:o.parse(f[0],u),y:a.parse(f[1],u)};return l}parseObjectData(e,n,i,s){const{xScale:o,yScale:a}=e,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=new Array(s);let u,f,h,m;for(u=0,f=s;u<f;++u)h=u+i,m=n[h],d[u]={x:o.parse(nn(m,l),h),y:a.parse(nn(m,c),h)};return d}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,n,i){const s=this.chart,o=this._cachedMeta,a=n[e.axis],l={keys:Md(s,!0),values:n._stacks[e.axis]._visualValues};return Vd(l,a,o.index,{mode:i})}updateRangeFromParsed(e,n,i,s){const o=i[n.axis];let a=o===null?NaN:o;const l=s&&i._stacks[n.axis];s&&l&&(s.values=l,a=Vd(s,o,this._cachedMeta.index)),e.min=Math.min(e.min,a),e.max=Math.max(e.max,a)}getMinMax(e,n){const i=this._cachedMeta,s=i._parsed,o=i._sorted&&e===i.iScale,a=s.length,l=this._getOtherScale(e),c=dw(n,i,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=rw(l);let h,m;function p(){m=s[h];const g=m[l.axis];return!Pe(m[e.axis])||u>g||f<g}for(h=0;h<a&&!(!p()&&(this.updateRangeFromParsed(d,e,m,c),o));++h);if(o){for(h=a-1;h>=0;--h)if(!p()){this.updateRangeFromParsed(d,e,m,c);break}}return d}getAllParsedValues(e){const n=this._cachedMeta._parsed,i=[];let s,o,a;for(s=0,o=n.length;s<o;++s)a=n[s][e.axis],Pe(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(e){const n=this._cachedMeta,i=n.iScale,s=n.vScale,o=this.getParsed(e);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(e){const n=this._cachedMeta;this.update(e||"default"),n._clip=iw(ae(this.options.clip,nw(n.xScale,n.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,n=this.chart,i=this._cachedMeta,s=i.data||[],o=n.chartArea,a=[],l=this._drawStart||0,c=this._drawCount||s.length-l,d=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(e,o,l,c),u=l;u<l+c;++u){const f=s[u];f.hidden||(f.active&&d?a.push(f):f.draw(e,o))}for(u=0;u<a.length;++u)a[u].draw(e,o)}getStyle(e,n){const i=n?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(e||0,i)}getContext(e,n,i){const s=this.getDataset();let o;if(e>=0&&e<this._cachedMeta.data.length){const a=this._cachedMeta.data[e];o=a.$context||(a.$context=cw(this.getContext(),e,a)),o.parsed=this.getParsed(e),o.raw=s.data[e],o.index=o.dataIndex=e}else o=this.$context||(this.$context=lw(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=i,o}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,n){return this._resolveElementOptions(this.dataElementType.id,n,e)}_resolveElementOptions(e,n="default",i){const s=n==="active",o=this._cachedDataOpts,a=e+"-"+n,l=o[a],c=this.enableOptionSharing&&Ni(i);if(l)return $d(l,c);const d=this.chart.config,u=d.datasetElementScopeKeys(this._type,e),f=s?[`${e}Hover`,"hover",e,""]:[e,""],h=d.getOptionScopes(this.getDataset(),u),m=Object.keys(Ee.elements[e]),p=()=>this.getContext(i,s,n),g=d.resolveNamedOptions(h,m,p,f);return g.$shared&&(g.$shared=c,o[a]=Object.freeze($d(g,c))),g}_resolveAnimations(e,n,i){const s=this.chart,o=this._cachedDataOpts,a=`animation-${n}`,l=o[a];if(l)return l;let c;if(s.options.animation!==!1){const u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,n),h=u.getOptionScopes(this.getDataset(),f);c=u.createResolver(h,this.getContext(e,i,n))}const d=new Nr(s,c&&c.animations);return c&&c._cacheable&&(o[a]=Object.freeze(d)),d}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,n){return!n||Br(e)||this.chart._animationsDisabled}_getSharedOptions(e,n){const i=this.resolveDataElementOptions(e,n),s=this._sharedOptions,o=this.getSharedOptions(i),a=this.includeOptions(n,o)||o!==s;return this.updateSharedOptions(o,n,i),{sharedOptions:o,includeOptions:a}}updateElement(e,n,i,s){Br(s)?Object.assign(e,i):this._resolveAnimations(n,s).update(e,i)}updateSharedOptions(e,n,i){e&&!Br(n)&&this._resolveAnimations(void 0,n).update(e,i)}_setStyle(e,n,i,s){e.active=s;const o=this.getStyle(n,s);this._resolveAnimations(n,i,s).update(e,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(e,n,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,n,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const n=this._data,i=this._cachedMeta.data;for(const[l,c,d]of this._syncList)this[l](c,d);this._syncList=[];const s=i.length,o=n.length,a=Math.min(o,s);a&&this.parse(0,a),o>s?this._insertElements(s,o-s,e):o<s&&this._removeElements(o,s-o)}_insertElements(e,n,i=!0){const s=this._cachedMeta,o=s.data,a=e+n;let l;const c=d=>{for(d.length+=n,l=d.length-1;l>=a;l--)d[l]=d[l-n]};for(c(o),l=e;l<a;++l)o[l]=new this.dataElementType;this._parsing&&c(s._parsed),this.parse(e,n),i&&this.updateElements(o,e,n,"reset")}updateElements(e,n,i,s){}_removeElements(e,n){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(e,n);i._stacked&&Fi(i,s)}i.data.splice(e,n)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[n,i,s]=e;this[n](i,s)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,n){n&&this._sync(["_removeElements",e,n]);const i=arguments.length-2;i&&this._sync(["_insertElements",e,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}z(lt,"defaults",{}),z(lt,"datasetElementType",null),z(lt,"dataElementType",null);function uw(t,e){if(!t._cache.$bar){const n=t.getMatchingVisibleMetas(e);let i=[];for(let s=0,o=n.length;s<o;s++)i=i.concat(n[s].controller.getAllParsedValues(t));t._cache.$bar=ed(i.sort((s,o)=>s-o))}return t._cache.$bar}function fw(t){const e=t.iScale,n=uw(e,t.type);let i=e._length,s,o,a,l;const c=()=>{a===32767||a===-32768||(Ni(l)&&(i=Math.min(i,Math.abs(a-l)||i)),l=a)};for(s=0,o=n.length;s<o;++s)a=e.getPixelForValue(n[s]),c();for(l=void 0,s=0,o=e.ticks.length;s<o;++s)a=e.getPixelForTick(s),c();return i}function hw(t,e,n,i){const s=n.barThickness;let o,a;return fe(s)?(o=e.min*n.categoryPercentage,a=n.barPercentage):(o=s*i,a=1),{chunk:o/i,ratio:a,start:e.pixels[t]-o/2}}function mw(t,e,n,i){const s=e.pixels,o=s[t];let a=t>0?s[t-1]:null,l=t<s.length-1?s[t+1]:null;const c=n.categoryPercentage;a===null&&(a=o-(l===null?e.end-e.start:l-o)),l===null&&(l=o+o-a);const d=o-(o-Math.min(a,l))/2*c;return{chunk:Math.abs(l-a)/2*c/i,ratio:n.barPercentage,start:d}}function pw(t,e,n,i){const s=n.parse(t[0],i),o=n.parse(t[1],i),a=Math.min(s,o),l=Math.max(s,o);let c=a,d=l;Math.abs(a)>Math.abs(l)&&(c=l,d=a),e[n.axis]=d,e._custom={barStart:c,barEnd:d,start:s,end:o,min:a,max:l}}function Ld(t,e,n,i){return Oe(t)?pw(t,e,n,i):e[n.axis]=n.parse(t,i),e}function Id(t,e,n,i){const s=t.iScale,o=t.vScale,a=s.getLabels(),l=s===o,c=[];let d,u,f,h;for(d=n,u=n+i;d<u;++d)h=e[d],f={},f[s.axis]=l||s.parse(a[d],d),c.push(Ld(h,f,o,d));return c}function Pr(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function gw(t,e,n){return t!==0?Ct(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}function yw(t){let e,n,i,s,o;return t.horizontal?(e=t.base>t.x,n="left",i="right"):(e=t.base<t.y,n="bottom",i="top"),e?(s="end",o="start"):(s="start",o="end"),{start:n,end:i,reverse:e,top:s,bottom:o}}function bw(t,e,n,i){let s=e.borderSkipped;const o={};if(!s){t.borderSkipped=o;return}if(s===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:l,reverse:c,top:d,bottom:u}=yw(t);s==="middle"&&n&&(t.enableBorderRadius=!0,(n._top||0)===i?s=d:(n._bottom||0)===i?s=u:(o[jd(u,a,l,c)]=!0,s=d)),o[jd(s,a,l,c)]=!0,t.borderSkipped=o}function jd(t,e,n,i){return i?(t=xw(t,e,n),t=zd(t,n,e)):t=zd(t,e,n),t}function xw(t,e,n){return t===e?n:t===n?e:t}function zd(t,e,n){return t==="start"?e:t==="end"?n:t}function _w(t,{inflateAmount:e},n){t.inflateAmount=e==="auto"?n===1?.33:0:e}class $i extends lt{parsePrimitiveData(e,n,i,s){return Id(e,n,i,s)}parseArrayData(e,n,i,s){return Id(e,n,i,s)}parseObjectData(e,n,i,s){const{iScale:o,vScale:a}=e,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=o.axis==="x"?l:c,u=a.axis==="x"?l:c,f=[];let h,m,p,g;for(h=i,m=i+s;h<m;++h)g=n[h],p={},p[o.axis]=o.parse(nn(g,d),h),f.push(Ld(nn(g,u),p,a,h));return f}updateRangeFromParsed(e,n,i,s){super.updateRangeFromParsed(e,n,i,s);const o=i._custom;o&&n===this._cachedMeta.vScale&&(e.min=Math.min(e.min,o.min),e.max=Math.max(e.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const n=this._cachedMeta,{iScale:i,vScale:s}=n,o=this.getParsed(e),a=o._custom,l=Pr(a)?"["+a.start+", "+a.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+i.getLabelForValue(o[i.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();const e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,e)}updateElements(e,n,i,s){const o=s==="reset",{index:a,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),d=l.isHorizontal(),u=this._getRuler(),{sharedOptions:f,includeOptions:h}=this._getSharedOptions(n,s);for(let m=n;m<n+i;m++){const p=this.getParsed(m),g=o||fe(p[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(m),y=this._calculateBarIndexPixels(m,u),b=(p._stacks||{})[l.axis],x={horizontal:d,base:g.base,enableBorderRadius:!b||Pr(p._custom)||a===b._top||a===b._bottom,x:d?g.head:y.center,y:d?y.center:g.head,height:d?y.size:Math.abs(g.size),width:d?Math.abs(g.size):y.size};h&&(x.options=f||this.resolveDataElementOptions(m,e[m].active?"active":s));const w=x.options||e[m].options;bw(x,w,b,a),_w(x,w,u.ratio),this.updateElement(e[m],m,x,s)}}_getStacks(e,n){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),o=i.options.stacked,a=[],l=this._cachedMeta.controller.getParsed(n),c=l&&l[i.axis],d=u=>{const f=u._parsed.find(m=>m[i.axis]===c),h=f&&f[u.vScale.axis];if(fe(h)||isNaN(h))return!0};for(const u of s)if(!(n!==void 0&&d(u))&&((o===!1||a.indexOf(u.stack)===-1||o===void 0&&u.stack===void 0)&&a.push(u.stack),u.index===e))break;return a.length||a.push(void 0),a}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,n,i){const s=this._getStacks(e,i),o=n!==void 0?s.indexOf(n):-1;return o===-1?s.length-1:o}_getRuler(){const e=this.options,n=this._cachedMeta,i=n.iScale,s=[];let o,a;for(o=0,a=n.data.length;o<a;++o)s.push(i.getPixelForValue(this.getParsed(o)[i.axis],o));const l=e.barThickness;return{min:l||fw(n),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:e.grouped,ratio:l?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:n,_stacked:i,index:s},options:{base:o,minBarLength:a}}=this,l=o||0,c=this.getParsed(e),d=c._custom,u=Pr(d);let f=c[n.axis],h=0,m=i?this.applyStack(n,c,i):f,p,g;m!==f&&(h=m-f,m=f),u&&(f=d.barStart,m=d.barEnd-d.barStart,f!==0&&Ct(f)!==Ct(d.barEnd)&&(h=0),h+=f);const y=!fe(o)&&!u?o:h;let b=n.getPixelForValue(y);if(this.chart.getDataVisibility(e)?p=n.getPixelForValue(h+m):p=b,g=p-b,Math.abs(g)<a){g=gw(g,n,l)*a,f===l&&(b-=g/2);const x=n.getPixelForDecimal(0),w=n.getPixelForDecimal(1),E=Math.min(x,w),k=Math.max(x,w);b=Math.max(Math.min(b,k),E),p=b+g,i&&!u&&(c._stacks[n.axis]._visualValues[s]=n.getValueForPixel(p)-n.getValueForPixel(b))}if(b===n.getPixelForValue(l)){const x=Ct(g)*n.getLineWidthForValue(l)/2;b+=x,g-=x}return{size:g,base:b,head:p,center:p+g/2}}_calculateBarIndexPixels(e,n){const i=n.scale,s=this.options,o=s.skipNull,a=ae(s.maxBarThickness,1/0);let l,c;if(n.grouped){const d=o?this._getStackCount(e):n.stackCount,u=s.barThickness==="flex"?mw(e,n,s,d):hw(e,n,s,d),f=this._getStackIndex(this.index,this._cachedMeta.stack,o?e:void 0);l=u.start+u.chunk*f+u.chunk/2,c=Math.min(a,u.chunk*u.ratio)}else l=i.getPixelForValue(this.getParsed(e)[i.axis],e),c=Math.min(a,n.min*n.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){const e=this._cachedMeta,n=e.vScale,i=e.data,s=i.length;let o=0;for(;o<s;++o)this.getParsed(o)[n.axis]!==null&&!i[o].hidden&&i[o].draw(this._ctx)}}z($i,"id","bar"),z($i,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),z($i,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Li extends lt{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,n,i,s){const o=super.parsePrimitiveData(e,n,i,s);for(let a=0;a<o.length;a++)o[a]._custom=this.resolveDataElementOptions(a+i).radius;return o}parseArrayData(e,n,i,s){const o=super.parseArrayData(e,n,i,s);for(let a=0;a<o.length;a++){const l=n[i+a];o[a]._custom=ae(l[2],this.resolveDataElementOptions(a+i).radius)}return o}parseObjectData(e,n,i,s){const o=super.parseObjectData(e,n,i,s);for(let a=0;a<o.length;a++){const l=n[i+a];o[a]._custom=ae(l&&l.r&&+l.r,this.resolveDataElementOptions(a+i).radius)}return o}getMaxOverflow(){const e=this._cachedMeta.data;let n=0;for(let i=e.length-1;i>=0;--i)n=Math.max(n,e[i].size(this.resolveDataElementOptions(i))/2);return n>0&&n}getLabelAndValue(e){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=n,a=this.getParsed(e),l=s.getLabelForValue(a.x),c=o.getLabelForValue(a.y),d=a._custom;return{label:i[e]||"",value:"("+l+", "+c+(d?", "+d:"")+")"}}update(e){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,e)}updateElements(e,n,i,s){const o=s==="reset",{iScale:a,vScale:l}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(n,s),u=a.axis,f=l.axis;for(let h=n;h<n+i;h++){const m=e[h],p=!o&&this.getParsed(h),g={},y=g[u]=o?a.getPixelForDecimal(.5):a.getPixelForValue(p[u]),b=g[f]=o?l.getBasePixel():l.getPixelForValue(p[f]);g.skip=isNaN(y)||isNaN(b),d&&(g.options=c||this.resolveDataElementOptions(h,m.active?"active":s),o&&(g.options.radius=0)),this.updateElement(m,h,g,s)}}resolveDataElementOptions(e,n){const i=this.getParsed(e);let s=super.resolveDataElementOptions(e,n);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const o=s.radius;return n!=="active"&&(s.radius=0),s.radius+=ae(i&&i._custom,o),s}}z(Li,"id","bubble"),z(Li,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),z(Li,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function kw(t,e,n){let i=1,s=1,o=0,a=0;if(e<we){const l=t,c=l+e,d=Math.cos(l),u=Math.sin(l),f=Math.cos(c),h=Math.sin(c),m=(w,E,k)=>Ti(w,l,c,!0)?1:Math.max(E,E*n,k,k*n),p=(w,E,k)=>Ti(w,l,c,!0)?-1:Math.min(E,E*n,k,k*n),g=m(0,d,f),y=m(Me,u,h),b=p(Se,d,f),x=p(Se+Me,u,h);i=(g-b)/2,s=(y-x)/2,o=-(g+b)/2,a=-(y+x)/2}return{ratioX:i,ratioY:s,offsetX:o,offsetY:a}}class an extends lt{constructor(e,n){super(e,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,n){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let o=c=>+i[c];if(de(i[e])){const{key:c="value"}=this._parsing;o=d=>+nn(i[d],c)}let a,l;for(a=e,l=e+n;a<l;++a)s._parsed[a]=o(a)}}_getRotation(){return yt(this.options.rotation-90)}_getCircumference(){return yt(this.options.circumference)}_getRotationExtents(){let e=we,n=-we;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(),a=s._getCircumference();e=Math.min(e,o),n=Math.max(n,o+a)}return{rotation:e,circumference:n-e}}update(e){const n=this.chart,{chartArea:i}=n,s=this._cachedMeta,o=s.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,l=Math.max((Math.min(i.width,i.height)-a)/2,0),c=Math.min(Rk(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:h,ratioY:m,offsetX:p,offsetY:g}=kw(f,u,c),y=(i.width-a)/h,b=(i.height-a)/m,x=Math.max(Math.min(y,b)/2,0),w=Uc(this.options.radius,x),E=Math.max(w*c,0),k=(w-E)/this._getVisibleDatasetWeightTotal();this.offsetX=p*w,this.offsetY=g*w,s.total=this.calculateTotal(),this.outerRadius=w-k*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-k*d,0),this.updateElements(o,0,o.length,e)}_circumference(e,n){const i=this.options,s=this._cachedMeta,o=this._getCircumference();return n&&i.animation.animateRotate||!this.chart.getDataVisibility(e)||s._parsed[e]===null||s.data[e].hidden?0:this.calculateCircumference(s._parsed[e]*o/we)}updateElements(e,n,i,s){const o=s==="reset",a=this.chart,l=a.chartArea,d=a.options.animation,u=(l.left+l.right)/2,f=(l.top+l.bottom)/2,h=o&&d.animateScale,m=h?0:this.innerRadius,p=h?0:this.outerRadius,{sharedOptions:g,includeOptions:y}=this._getSharedOptions(n,s);let b=this._getRotation(),x;for(x=0;x<n;++x)b+=this._circumference(x,o);for(x=n;x<n+i;++x){const w=this._circumference(x,o),E=e[x],k={x:u+this.offsetX,y:f+this.offsetY,startAngle:b,endAngle:b+w,circumference:w,outerRadius:p,innerRadius:m};y&&(k.options=g||this.resolveDataElementOptions(x,E.active?"active":s)),b+=w,this.updateElement(E,x,k,s)}}calculateTotal(){const e=this._cachedMeta,n=e.data;let i=0,s;for(s=0;s<n.length;s++){const o=e._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!n[s].hidden&&(i+=Math.abs(o))}return i}calculateCircumference(e){const n=this._cachedMeta.total;return n>0&&!isNaN(e)?we*(Math.abs(e)/n):0}getLabelAndValue(e){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=Pi(n._parsed[e],i.options.locale);return{label:s[e]||"",value:o}}getMaxBorderWidth(e){let n=0;const i=this.chart;let s,o,a,l,c;if(!e){for(s=0,o=i.data.datasets.length;s<o;++s)if(i.isDatasetVisible(s)){a=i.getDatasetMeta(s),e=a.data,l=a.controller;break}}if(!e)return 0;for(s=0,o=e.length;s<o;++s)c=l.resolveDataElementOptions(s),c.borderAlign!=="inner"&&(n=Math.max(n,c.borderWidth||0,c.hoverBorderWidth||0));return n}getMaxOffset(e){let n=0;for(let i=0,s=e.length;i<s;++i){const o=this.resolveDataElementOptions(i);n=Math.max(n,o.offset||0,o.hoverOffset||0)}return n}_getRingWeightOffset(e){let n=0;for(let i=0;i<e;++i)this.chart.isDatasetVisible(i)&&(n+=this._getRingWeight(i));return n}_getRingWeight(e){return Math.max(ae(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}z(an,"id","doughnut"),z(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"}),z(an,"descriptors",{_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")}),z(an,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const n=e.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=e.legend.options;return n.labels.map((o,a)=>{const c=e.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:s,lineWidth:c.borderWidth,pointStyle:i,hidden:!e.getDataVisibility(a),index:a}})}return[]}},onClick(e,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}});class Ii extends lt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const n=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=n,a=this.chart._animationsDisabled;let{start:l,count:c}=id(n,s,a);this._drawStart=l,this._drawCount=c,sd(n)&&(l=0,c=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;const d=this.resolveDatasetElementOptions(e);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:d},e),this.updateElements(s,l,c,e)}updateElements(e,n,i,s){const o=s==="reset",{iScale:a,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(n,s),h=a.axis,m=l.axis,{spanGaps:p,segment:g}=this.options,y=Un(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||s==="none",x=n+i,w=e.length;let E=n>0&&this.getParsed(n-1);for(let k=0;k<w;++k){const C=e[k],S=b?C:{};if(k<n||k>=x){S.skip=!0;continue}const _=this.getParsed(k),O=fe(_[m]),P=S[h]=a.getPixelForValue(_[h],k),v=S[m]=o||O?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,_,c):_[m],k);S.skip=isNaN(P)||isNaN(v)||O,S.stop=k>0&&Math.abs(_[h]-E[h])>y,g&&(S.parsed=_,S.raw=d.data[k]),f&&(S.options=u||this.resolveDataElementOptions(k,C.active?"active":s)),b||this.updateElement(C,k,S,s),E=_}}getMaxOverflow(){const e=this._cachedMeta,n=e.dataset,i=n.options&&n.options.borderWidth||0,s=e.data||[];if(!s.length)return i;const o=s[0].size(this.resolveDataElementOptions(0)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,o,a)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}z(Ii,"id","line"),z(Ii,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),z(Ii,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Yn extends lt{constructor(e,n){super(e,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=Pi(n._parsed[e].r,i.options.locale);return{label:s[e]||"",value:o}}parseObjectData(e,n,i,s){return xd.bind(this)(e,n,i,s)}update(e){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,e)}getMinMax(){const e=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((i,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<n.min&&(n.min=o),o>n.max&&(n.max=o))}),n}_updateRadius(){const e=this.chart,n=e.chartArea,i=e.options,s=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(s/2,0),a=Math.max(i.cutoutPercentage?o/100*i.cutoutPercentage:1,0),l=(o-a)/e.getVisibleDatasetCount();this.outerRadius=o-l*this.index,this.innerRadius=this.outerRadius-l}updateElements(e,n,i,s){const o=s==="reset",a=this.chart,c=a.options.animation,d=this._cachedMeta.rScale,u=d.xCenter,f=d.yCenter,h=d.getIndexAngle(0)-.5*Se;let m=h,p;const g=360/this.countVisibleElements();for(p=0;p<n;++p)m+=this._computeAngle(p,s,g);for(p=n;p<n+i;p++){const y=e[p];let b=m,x=m+this._computeAngle(p,s,g),w=a.getDataVisibility(p)?d.getDistanceFromCenterForValue(this.getParsed(p).r):0;m=x,o&&(c.animateScale&&(w=0),c.animateRotate&&(b=x=h));const E={x:u,y:f,innerRadius:0,outerRadius:w,startAngle:b,endAngle:x,options:this.resolveDataElementOptions(p,y.active?"active":s)};this.updateElement(y,p,E,s)}}countVisibleElements(){const e=this._cachedMeta;let n=0;return e.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(e,n,i){return this.chart.getDataVisibility(e)?yt(this.resolveDataElementOptions(e,n).angle||i):0}}z(Yn,"id","polarArea"),z(Yn,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),z(Yn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const n=e.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=e.legend.options;return n.labels.map((o,a)=>{const c=e.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:s,lineWidth:c.borderWidth,pointStyle:i,hidden:!e.getDataVisibility(a),index:a}})}return[]}},onClick(e,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Xs extends an{}z(Xs,"id","pie"),z(Xs,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class ji extends lt{getLabelAndValue(e){const n=this._cachedMeta.vScale,i=this.getParsed(e);return{label:n.getLabels()[e],value:""+n.getLabelForValue(i[n.axis])}}parseObjectData(e,n,i,s){return xd.bind(this)(e,n,i,s)}update(e){const n=this._cachedMeta,i=n.dataset,s=n.data||[],o=n.iScale.getLabels();if(i.points=s,e!=="resize"){const a=this.resolveDatasetElementOptions(e);this.options.showLine||(a.borderWidth=0);const l={_loop:!0,_fullLoop:o.length===s.length,options:a};this.updateElement(i,void 0,l,e)}this.updateElements(s,0,s.length,e)}updateElements(e,n,i,s){const o=this._cachedMeta.rScale,a=s==="reset";for(let l=n;l<n+i;l++){const c=e[l],d=this.resolveDataElementOptions(l,c.active?"active":s),u=o.getPointPositionForValue(l,this.getParsed(l).r),f=a?o.xCenter:u.x,h=a?o.yCenter:u.y,m={x:f,y:h,angle:u.angle,skip:isNaN(f)||isNaN(h),options:d};this.updateElement(c,l,m,s)}}}z(ji,"id","radar"),z(ji,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),z(ji,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class zi extends lt{getLabelAndValue(e){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=n,a=this.getParsed(e),l=s.getLabelForValue(a.x),c=o.getLabelForValue(a.y);return{label:i[e]||"",value:"("+l+", "+c+")"}}update(e){const n=this._cachedMeta,{data:i=[]}=n,s=this.chart._animationsDisabled;let{start:o,count:a}=id(n,i,s);if(this._drawStart=o,this._drawCount=a,sd(n)&&(o=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:l,_dataset:c}=n;l._chart=this.chart,l._datasetIndex=this.index,l._decimated=!!c._decimated,l.points=i;const d=this.resolveDatasetElementOptions(e);d.segment=this.options.segment,this.updateElement(l,void 0,{animated:!s,options:d},e)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(i,o,a,e)}addElements(){const{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(e,n,i,s){const o=s==="reset",{iScale:a,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,u=this.resolveDataElementOptions(n,s),f=this.getSharedOptions(u),h=this.includeOptions(s,f),m=a.axis,p=l.axis,{spanGaps:g,segment:y}=this.options,b=Un(g)?g:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||s==="none";let w=n>0&&this.getParsed(n-1);for(let E=n;E<n+i;++E){const k=e[E],C=this.getParsed(E),S=x?k:{},_=fe(C[p]),O=S[m]=a.getPixelForValue(C[m],E),P=S[p]=o||_?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,C,c):C[p],E);S.skip=isNaN(O)||isNaN(P)||_,S.stop=E>0&&Math.abs(C[m]-w[m])>b,y&&(S.parsed=C,S.raw=d.data[E]),h&&(S.options=f||this.resolveDataElementOptions(E,k.active?"active":s)),x||this.updateElement(k,E,S,s),w=C}this.updateSharedOptions(f,s,u)}getMaxOverflow(){const e=this._cachedMeta,n=e.data||[];if(!this.options.showLine){let l=0;for(let c=n.length-1;c>=0;--c)l=Math.max(l,n[c].size(this.resolveDataElementOptions(c))/2);return l>0&&l}const i=e.dataset,s=i.options&&i.options.borderWidth||0;if(!n.length)return s;const o=n[0].size(this.resolveDataElementOptions(0)),a=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,a)/2}}z(zi,"id","scatter"),z(zi,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),z(zi,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Ud=Object.freeze({__proto__:null,BarController:$i,BubbleController:Li,DoughnutController:an,LineController:Ii,PieController:Xs,PolarAreaController:Yn,RadarController:ji,ScatterController:zi});function Dn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Ar{constructor(e){z(this,"options");this.options=e||{}}static override(e){Object.assign(Ar.prototype,e)}init(){}formats(){return Dn()}parse(){return Dn()}format(){return Dn()}add(){return Dn()}diff(){return Dn()}startOf(){return Dn()}endOf(){return Dn()}}var Wd={_date:Ar};function Sw(t,e,n,i){const{controller:s,data:o,_sorted:a}=t,l=s._cachedMeta.iScale;if(l&&e===l.axis&&e!=="r"&&a&&o.length){const c=l._reversePixels?Kk:jt;if(i){if(s._sharedOptions){const d=o[0],u=typeof d.getRange=="function"&&d.getRange(e);if(u){const f=c(o,e,n-u),h=c(o,e,n+u);return{lo:f.lo,hi:h.hi}}}}else return c(o,e,n)}return{lo:0,hi:o.length-1}}function Ui(t,e,n,i,s){const o=t.getSortedVisibleDatasetMetas(),a=n[e];for(let l=0,c=o.length;l<c;++l){const{index:d,data:u}=o[l],{lo:f,hi:h}=Sw(o[l],e,a,s);for(let m=f;m<=h;++m){const p=u[m];p.skip||i(p,d,m)}}}function ww(t){const e=t.indexOf("x")!==-1,n=t.indexOf("y")!==-1;return function(i,s){const o=e?Math.abs(i.x-s.x):0,a=n?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function Mr(t,e,n,i,s){const o=[];return!s&&!t.isPointInArea(e)||Ui(t,n,e,function(l,c,d){!s&&!zt(l,t.chartArea,0)||l.inRange(e.x,e.y,i)&&o.push({element:l,datasetIndex:c,index:d})},!0),o}function Ew(t,e,n,i){let s=[];function o(a,l,c){const{startAngle:d,endAngle:u}=a.getProps(["startAngle","endAngle"],i),{angle:f}=Jc(a,{x:e.x,y:e.y});Ti(f,d,u)&&s.push({element:a,datasetIndex:l,index:c})}return Ui(t,n,e,o),s}function Cw(t,e,n,i,s,o){let a=[];const l=ww(n);let c=Number.POSITIVE_INFINITY;function d(u,f,h){const m=u.inRange(e.x,e.y,s);if(i&&!m)return;const p=u.getCenterPoint(s);if(!(!!o||t.isPointInArea(p))&&!m)return;const y=l(e,p);y<c?(a=[{element:u,datasetIndex:f,index:h}],c=y):y===c&&a.push({element:u,datasetIndex:f,index:h})}return Ui(t,n,e,d),a}function Vr(t,e,n,i,s,o){return!o&&!t.isPointInArea(e)?[]:n==="r"&&!i?Ew(t,e,n,s):Cw(t,e,n,i,s,o)}function Hd(t,e,n,i,s){const o=[],a=n==="x"?"inXRange":"inYRange";let l=!1;return Ui(t,n,e,(c,d,u)=>{c[a]&&c[a](e[n],s)&&(o.push({element:c,datasetIndex:d,index:u}),l=l||c.inRange(e.x,e.y,s))}),i&&!l?[]:o}var qd={evaluateInteractionItems:Ui,modes:{index(t,e,n,i){const s=vn(e,t),o=n.axis||"x",a=n.includeInvisible||!1,l=n.intersect?Mr(t,s,o,i,a):Vr(t,s,o,!1,i,a),c=[];return l.length?(t.getSortedVisibleDatasetMetas().forEach(d=>{const u=l[0].index,f=d.data[u];f&&!f.skip&&c.push({element:f,datasetIndex:d.index,index:u})}),c):[]},dataset(t,e,n,i){const s=vn(e,t),o=n.axis||"xy",a=n.includeInvisible||!1;let l=n.intersect?Mr(t,s,o,i,a):Vr(t,s,o,!1,i,a);if(l.length>0){const c=l[0].datasetIndex,d=t.getDatasetMeta(c).data;l=[];for(let u=0;u<d.length;++u)l.push({element:d[u],datasetIndex:c,index:u})}return l},point(t,e,n,i){const s=vn(e,t),o=n.axis||"xy",a=n.includeInvisible||!1;return Mr(t,s,o,i,a)},nearest(t,e,n,i){const s=vn(e,t),o=n.axis||"xy",a=n.includeInvisible||!1;return Vr(t,s,o,n.intersect,i,a)},x(t,e,n,i){const s=vn(e,t);return Hd(t,s,"x",n.intersect,i)},y(t,e,n,i){const s=vn(e,t);return Hd(t,s,"y",n.intersect,i)}}};const Yd=["left","top","right","bottom"];function Wi(t,e){return t.filter(n=>n.pos===e)}function Kd(t,e){return t.filter(n=>Yd.indexOf(n.pos)===-1&&n.box.axis===e)}function Hi(t,e){return t.sort((n,i)=>{const s=e?i:n,o=e?n:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function Ow(t){const e=[];let n,i,s,o,a,l;for(n=0,i=(t||[]).length;n<i;++n)s=t[n],{position:o,options:{stack:a,stackWeight:l=1}}=s,e.push({index:n,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:a&&o+a,stackWeight:l});return e}function vw(t){const e={};for(const n of t){const{stack:i,pos:s,stackWeight:o}=n;if(!i||!Yd.includes(s))continue;const a=e[i]||(e[i]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return e}function Nw(t,e){const n=vw(t),{vBoxMaxWidth:i,hBoxMaxHeight:s}=e;let o,a,l;for(o=0,a=t.length;o<a;++o){l=t[o];const{fullSize:c}=l.box,d=n[l.stack],u=d&&l.stackWeight/d.weight;l.horizontal?(l.width=u?u*i:c&&e.availableWidth,l.height=s):(l.width=i,l.height=u?u*s:c&&e.availableHeight)}return n}function Dw(t){const e=Ow(t),n=Hi(e.filter(d=>d.box.fullSize),!0),i=Hi(Wi(e,"left"),!0),s=Hi(Wi(e,"right")),o=Hi(Wi(e,"top"),!0),a=Hi(Wi(e,"bottom")),l=Kd(e,"x"),c=Kd(e,"y");return{fullSize:n,leftAndTop:i.concat(o),rightAndBottom:s.concat(c).concat(a).concat(l),chartArea:Wi(e,"chartArea"),vertical:i.concat(s).concat(c),horizontal:o.concat(a).concat(l)}}function Xd(t,e,n,i){return Math.max(t[n],e[n])+Math.max(t[i],e[i])}function Gd(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function Tw(t,e,n,i){const{pos:s,box:o}=n,a=t.maxPadding;if(!de(s)){n.size&&(t[s]-=n.size);const f=i[n.stack]||{size:0,count:1};f.size=Math.max(f.size,n.horizontal?o.height:o.width),n.size=f.size/f.count,t[s]+=n.size}o.getPadding&&Gd(a,o.getPadding());const l=Math.max(0,e.outerWidth-Xd(a,t,"left","right")),c=Math.max(0,e.outerHeight-Xd(a,t,"top","bottom")),d=l!==t.w,u=c!==t.h;return t.w=l,t.h=c,n.horizontal?{same:d,other:u}:{same:u,other:d}}function Bw(t){const e=t.maxPadding;function n(i){const s=Math.max(e[i]-t[i],0);return t[i]+=s,s}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}function Pw(t,e){const n=e.maxPadding;function i(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(a=>{o[a]=Math.max(e[a],n[a])}),o}return i(t?["left","right"]:["top","bottom"])}function qi(t,e,n,i){const s=[];let o,a,l,c,d,u;for(o=0,a=t.length,d=0;o<a;++o){l=t[o],c=l.box,c.update(l.width||e.w,l.height||e.h,Pw(l.horizontal,e));const{same:f,other:h}=Tw(e,n,l,i);d|=f&&s.length,u=u||h,c.fullSize||s.push(l)}return d&&qi(s,e,n,i)||u}function Gs(t,e,n,i,s){t.top=n,t.left=e,t.right=e+i,t.bottom=n+s,t.width=i,t.height=s}function Jd(t,e,n,i){const s=n.padding;let{x:o,y:a}=e;for(const l of t){const c=l.box,d=i[l.stack]||{count:1,placed:0,weight:1},u=l.stackWeight/d.weight||1;if(l.horizontal){const f=e.w*u,h=d.size||c.height;Ni(d.start)&&(a=d.start),c.fullSize?Gs(c,s.left,a,n.outerWidth-s.right-s.left,h):Gs(c,e.left+d.placed,a,f,h),d.start=a,d.placed+=f,a=c.bottom}else{const f=e.h*u,h=d.size||c.width;Ni(d.start)&&(o=d.start),c.fullSize?Gs(c,o,s.top,h,n.outerHeight-s.bottom-s.top):Gs(c,o,e.top+d.placed,h,f),d.start=o,d.placed+=f,o=c.right}}e.x=o,e.y=a}var je={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(n){e.draw(n)}}]},t.boxes.push(e)},removeBox(t,e){const n=t.boxes?t.boxes.indexOf(e):-1;n!==-1&&t.boxes.splice(n,1)},configure(t,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},update(t,e,n,i){if(!t)return;const s=He(t.options.layout.padding),o=Math.max(e-s.width,0),a=Math.max(n-s.height,0),l=Dw(t.boxes),c=l.vertical,d=l.horizontal;be(t.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const u=c.reduce((g,y)=>y.box.options&&y.box.options.display===!1?g:g+1,0)||1,f=Object.freeze({outerWidth:e,outerHeight:n,padding:s,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/u,hBoxMaxHeight:a/2}),h=Object.assign({},s);Gd(h,He(i));const m=Object.assign({maxPadding:h,w:o,h:a,x:s.left,y:s.top},s),p=Nw(c.concat(d),f);qi(l.fullSize,m,f,p),qi(c,m,f,p),qi(d,m,f,p)&&qi(c,m,f,p),Bw(m),Jd(l.leftAndTop,m,f,p),m.x+=m.w,m.y+=m.h,Jd(l.rightAndBottom,m,f,p),t.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},be(l.chartArea,g=>{const y=g.box;Object.assign(y,t.chartArea),y.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Rr{acquireContext(e,n){}releaseContext(e){return!1}addEventListener(e,n,i){}removeEventListener(e,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,n,i,s){return n=Math.max(0,n||e.width),i=i||e.height,{width:n,height:Math.max(0,s?Math.floor(n/s):i)}}isAttached(e){return!0}updateConfig(e){}}class Qd extends Rr{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const Js="$chartjs",Aw={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Zd=t=>t===null||t==="";function Mw(t,e){const n=t.style,i=t.getAttribute("height"),s=t.getAttribute("width");if(t[Js]={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",Zd(s)){const o=Sd(t,"width");o!==void 0&&(t.width=o)}if(Zd(i))if(t.style.height==="")t.height=t.width/(e||2);else{const o=Sd(t,"height");o!==void 0&&(t.height=o)}return t}const eu=jS?{passive:!0}:!1;function Vw(t,e,n){t&&t.addEventListener(e,n,eu)}function Rw(t,e,n){t&&t.canvas&&t.canvas.removeEventListener(e,n,eu)}function Fw(t,e){const n=Aw[t.type]||t.type,{x:i,y:s}=vn(t,e);return{type:n,chart:e,native:t,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Qs(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function $w(t,e,n){const i=t.canvas,s=new MutationObserver(o=>{let a=!1;for(const l of o)a=a||Qs(l.addedNodes,i),a=a&&!Qs(l.removedNodes,i);a&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function Lw(t,e,n){const i=t.canvas,s=new MutationObserver(o=>{let a=!1;for(const l of o)a=a||Qs(l.removedNodes,i),a=a&&!Qs(l.addedNodes,i);a&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const Yi=new Map;let tu=0;function nu(){const t=window.devicePixelRatio;t!==tu&&(tu=t,Yi.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function Iw(t,e){Yi.size||window.addEventListener("resize",nu),Yi.set(t,e)}function jw(t){Yi.delete(t),Yi.size||window.removeEventListener("resize",nu)}function zw(t,e,n){const i=t.canvas,s=i&&vr(i);if(!s)return;const o=nd((l,c)=>{const d=s.clientWidth;n(l,c),d<s.clientWidth&&n()},window),a=new ResizeObserver(l=>{const c=l[0],d=c.contentRect.width,u=c.contentRect.height;d===0&&u===0||o(d,u)});return a.observe(s),Iw(t,o),a}function Fr(t,e,n){n&&n.disconnect(),e==="resize"&&jw(t)}function Uw(t,e,n){const i=t.canvas,s=nd(o=>{t.ctx!==null&&n(Fw(o,t))},t);return Vw(i,e,s),s}class iu extends Rr{acquireContext(e,n){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(Mw(e,n),i):null}releaseContext(e){const n=e.canvas;if(!n[Js])return!1;const i=n[Js].initial;["height","width"].forEach(o=>{const a=i[o];fe(a)?n.removeAttribute(o):n.setAttribute(o,a)});const s=i.style||{};return Object.keys(s).forEach(o=>{n.style[o]=s[o]}),n.width=n.width,delete n[Js],!0}addEventListener(e,n,i){this.removeEventListener(e,n);const s=e.$proxies||(e.$proxies={}),a={attach:$w,detach:Lw,resize:zw}[n]||Uw;s[n]=a(e,n,i)}removeEventListener(e,n){const i=e.$proxies||(e.$proxies={}),s=i[n];if(!s)return;({attach:Fr,detach:Fr,resize:Fr}[n]||Rw)(e,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,i,s){return IS(e,n,i,s)}isAttached(e){const n=e&&vr(e);return!!(n&&n.isConnected)}}function su(t){return!Or()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?Qd:iu}let vt=(po=class{constructor(){z(this,"x");z(this,"y");z(this,"active",!1);z(this,"options");z(this,"$animations")}tooltipPosition(e){const{x:n,y:i}=this.getProps(["x","y"],e);return{x:n,y:i}}hasValue(){return Un(this.x)&&Un(this.y)}getProps(e,n){const i=this.$animations;if(!n||!i)return this;const s={};return e.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}},z(po,"defaults",{}),z(po,"defaultRoutes"),po);function Ww(t,e){const n=t.options.ticks,i=Hw(t),s=Math.min(n.maxTicksLimit||i,i),o=n.major.enabled?Yw(e):[],a=o.length,l=o[0],c=o[a-1],d=[];if(a>s)return Kw(e,d,o,a/s),d;const u=qw(o,e,s);if(a>0){let f,h;const m=a>1?Math.round((c-l)/(a-1)):null;for(Zs(e,d,u,fe(m)?0:l-m,l),f=0,h=a-1;f<h;f++)Zs(e,d,u,o[f],o[f+1]);return Zs(e,d,u,c,fe(m)?e.length:c+m),d}return Zs(e,d,u),d}function Hw(t){const e=t.options.offset,n=t._tickSize(),i=t._length/n+(e?0:1),s=t._maxLength/n;return Math.floor(Math.min(i,s))}function qw(t,e,n){const i=Xw(t),s=e.length/n;if(!i)return Math.max(s,1);const o=Wk(i);for(let a=0,l=o.length-1;a<l;a++){const c=o[a];if(c>s)return c}return Math.max(s,1)}function Yw(t){const e=[];let n,i;for(n=0,i=t.length;n<i;n++)t[n].major&&e.push(n);return e}function Kw(t,e,n,i){let s=0,o=n[0],a;for(i=Math.ceil(i),a=0;a<t.length;a++)a===o&&(e.push(t[a]),s++,o=n[s*i])}function Zs(t,e,n,i,s){const o=ae(i,0),a=Math.min(ae(s,t.length),t.length);let l=0,c,d,u;for(n=Math.ceil(n),s&&(c=s-i,n=c/Math.floor(c/n)),u=o;u<0;)l++,u=Math.round(o+l*n);for(d=Math.max(o,0);d<a;d++)d===u&&(e.push(t[d]),l++,u=Math.round(o+l*n))}function Xw(t){const e=t.length;let n,i;if(e<2)return!1;for(i=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==i)return!1;return i}const Gw=t=>t==="left"?"right":t==="right"?"left":t,ou=(t,e,n)=>e==="top"||e==="left"?t[e]+n:t[e]-n,ru=(t,e)=>Math.min(e||t,t);function au(t,e){const n=[],i=t.length/e,s=t.length;let o=0;for(;o<s;o+=i)n.push(t[Math.floor(o)]);return n}function Jw(t,e,n){const i=t.ticks.length,s=Math.min(e,i-1),o=t._startPixel,a=t._endPixel,l=1e-6;let c=t.getPixelForTick(s),d;if(!(n&&(i===1?d=Math.max(c-o,a-c):e===0?d=(t.getPixelForTick(1)-c)/2:d=(c-t.getPixelForTick(s-1))/2,c+=s<e?d:-d,c<o-l||c>a+l)))return c}function Qw(t,e){be(t,n=>{const i=n.gc,s=i.length/2;let o;if(s>e){for(o=0;o<s;++o)delete n.data[i[o]];i.splice(0,s)}})}function Ki(t){return t.drawTicks?t.tickLength:0}function lu(t,e){if(!t.display)return 0;const n=Fe(t.font,e),i=He(t.padding);return(Oe(t.text)?t.text.length:1)*n.lineHeight+i.height}function Zw(t,e){return rn(t,{scale:e,type:"scale"})}function eE(t,e,n){return rn(t,{tick:n,index:e,type:"tick"})}function tE(t,e,n){let i=gr(t);return(n&&e!=="right"||!n&&e==="right")&&(i=Gw(i)),i}function nE(t,e,n,i){const{top:s,left:o,bottom:a,right:l,chart:c}=t,{chartArea:d,scales:u}=c;let f=0,h,m,p;const g=a-s,y=l-o;if(t.isHorizontal()){if(m=We(i,o,l),de(n)){const b=Object.keys(n)[0],x=n[b];p=u[b].getPixelForValue(x)+g-e}else n==="center"?p=(d.bottom+d.top)/2+g-e:p=ou(t,n,e);h=l-o}else{if(de(n)){const b=Object.keys(n)[0],x=n[b];m=u[b].getPixelForValue(x)-y+e}else n==="center"?m=(d.left+d.right)/2-y+e:m=ou(t,n,e);p=We(i,a,s),f=n==="left"?-Me:Me}return{titleX:m,titleY:p,maxWidth:h,rotation:f}}class ln extends vt{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.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(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,n){return e}getUserBounds(){let{_userMin:e,_userMax:n,_suggestedMin:i,_suggestedMax:s}=this;return e=nt(e,Number.POSITIVE_INFINITY),n=nt(n,Number.NEGATIVE_INFINITY),i=nt(i,Number.POSITIVE_INFINITY),s=nt(s,Number.NEGATIVE_INFINITY),{min:nt(e,i),max:nt(n,s),minDefined:Pe(e),maxDefined:Pe(n)}}getMinMax(e){let{min:n,max:i,minDefined:s,maxDefined:o}=this.getUserBounds(),a;if(s&&o)return{min:n,max:i};const l=this.getMatchingVisibleMetas();for(let c=0,d=l.length;c<d;++c)a=l[c].controller.getMinMax(this,e),s||(n=Math.min(n,a.min)),o||(i=Math.max(i,a.max));return n=o&&n>i?i:n,i=s&&n>i?n:i,{min:nt(n,nt(i,n)),max:nt(i,nt(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){ke(this.options.beforeUpdate,[this])}update(e,n,i){const{beginAtZero:s,grace:o,ticks:a}=this.options,l=a.sampleSize;this.beforeUpdate(),this.maxWidth=e,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=bS(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=l<this.ticks.length;this._convertTicksToLabels(c?au(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=Ww(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,n,i;this.isHorizontal()?(n=this.left,i=this.right):(n=this.top,i=this.bottom,e=!e),this._startPixel=n,this._endPixel=i,this._reversePixels=e,this._length=i-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){ke(this.options.afterUpdate,[this])}beforeSetDimensions(){ke(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(){ke(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),ke(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){ke(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const n=this.options.ticks;let i,s,o;for(i=0,s=e.length;i<s;i++)o=e[i],o.label=ke(n.callback,[o.value,i,e],this)}afterTickToLabelConversion(){ke(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){ke(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,n=e.ticks,i=ru(this.ticks.length,e.ticks.maxTicksLimit),s=n.minRotation||0,o=n.maxRotation;let a=s,l,c,d;if(!this._isVisible()||!n.display||s>=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),f=u.widest.width,h=u.highest.height,m=Le(this.chart.width-f,0,this.maxWidth);l=e.offset?this.maxWidth/i:m/(i-1),f+6>l&&(l=m/(i-(e.offset?.5:1)),c=this.maxHeight-Ki(e.grid)-n.padding-lu(e.title,this.chart.options.font),d=Math.sqrt(f*f+h*h),a=hr(Math.min(Math.asin(Le((u.highest.height+6)/l,-1,1)),Math.asin(Le(c/d,-1,1))-Math.asin(Le(h/d,-1,1)))),a=Math.max(s,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){ke(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ke(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:o}}=this,a=this._isVisible(),l=this.isHorizontal();if(a){const c=lu(s,n.options.font);if(l?(e.width=this.maxWidth,e.height=Ki(o)+c):(e.height=this.maxHeight,e.width=Ki(o)+c),i.display&&this.ticks.length){const{first:d,last:u,widest:f,highest:h}=this._getLabelSizes(),m=i.padding*2,p=yt(this.labelRotation),g=Math.cos(p),y=Math.sin(p);if(l){const b=i.mirror?0:y*f.width+g*h.height;e.height=Math.min(this.maxHeight,e.height+b+m)}else{const b=i.mirror?0:g*f.width+y*h.height;e.width=Math.min(this.maxWidth,e.width+b+m)}this._calculatePadding(d,u,y,g)}}this._handleMargins(),l?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,n,i,s){const{ticks:{align:o,padding:a},position:l}=this.options,c=this.labelRotation!==0,d=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,m=0;c?d?(h=s*e.width,m=i*n.height):(h=i*e.height,m=s*n.width):o==="start"?m=n.width:o==="end"?h=e.width:o!=="inner"&&(h=e.width/2,m=n.width/2),this.paddingLeft=Math.max((h-u+a)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-f+a)*this.width/(this.width-f),0)}else{let u=n.height/2,f=e.height/2;o==="start"?(u=0,f=e.height):o==="end"&&(u=n.height,f=0),this.paddingTop=u+a,this.paddingBottom=f+a}}_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(){ke(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:n}=this.options;return n==="top"||n==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let n,i;for(n=0,i=e.length;n<i;n++)fe(e[n].label)&&(e.splice(n,1),i--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const n=this.options.ticks.sampleSize;let i=this.ticks;n<i.length&&(i=au(i,n)),this._labelSizes=e=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,n,i){const{ctx:s,_longestTextCache:o}=this,a=[],l=[],c=Math.floor(n/ru(n,i));let d=0,u=0,f,h,m,p,g,y,b,x,w,E,k;for(f=0;f<n;f+=c){if(p=e[f].label,g=this._resolveTickFontOptions(f),s.font=y=g.string,b=o[y]=o[y]||{data:{},gc:[]},x=g.lineHeight,w=E=0,!fe(p)&&!Oe(p))w=zs(s,b.data,b.gc,w,p),E=x;else if(Oe(p))for(h=0,m=p.length;h<m;++h)k=p[h],!fe(k)&&!Oe(k)&&(w=zs(s,b.data,b.gc,w,k),E+=x);a.push(w),l.push(E),d=Math.max(w,d),u=Math.max(E,u)}Qw(o,n);const C=a.indexOf(d),S=l.indexOf(u),_=O=>({width:a[O]||0,height:l[O]||0});return{first:_(0),last:_(n-1),widest:_(C),highest:_(S),widths:a,heights:l}}getLabelForValue(e){return e}getPixelForValue(e,n){return NaN}getValueForPixel(e){}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const n=this._startPixel+e*this._length;return Yk(this._alignToPixels?wn(this.chart,n,0):n)}getDecimalForPixel(e){const n=(e-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:n}=this;return e<0&&n<0?n:e>0&&n>0?e:0}getContext(e){const n=this.ticks||[];if(e>=0&&e<n.length){const i=n[e];return i.$context||(i.$context=eE(this.getContext(),e,i))}return this.$context||(this.$context=Zw(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,n=yt(this.labelRotation),i=Math.abs(Math.cos(n)),s=Math.abs(Math.sin(n)),o=this._getLabelSizes(),a=e.autoSkipPadding||0,l=o?o.widest.width+a:0,c=o?o.highest.height+a:0;return this.isHorizontal()?c*i>l*s?l/i:c/s:c*s<l*i?c/i:l/s}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const n=this.axis,i=this.chart,s=this.options,{grid:o,position:a,border:l}=s,c=o.offset,d=this.isHorizontal(),f=this.ticks.length+(c?1:0),h=Ki(o),m=[],p=l.setContext(this.getContext()),g=p.display?p.width:0,y=g/2,b=function(L){return wn(i,L,g)};let x,w,E,k,C,S,_,O,P,v,T,R;if(a==="top")x=b(this.bottom),S=this.bottom-h,O=x-y,v=b(e.top)+y,R=e.bottom;else if(a==="bottom")x=b(this.top),v=e.top,R=b(e.bottom)-y,S=x+y,O=this.top+h;else if(a==="left")x=b(this.right),C=this.right-h,_=x-y,P=b(e.left)+y,T=e.right;else if(a==="right")x=b(this.left),P=e.left,T=b(e.right)-y,C=x+y,_=this.left+h;else if(n==="x"){if(a==="center")x=b((e.top+e.bottom)/2+.5);else if(de(a)){const L=Object.keys(a)[0],j=a[L];x=b(this.chart.scales[L].getPixelForValue(j))}v=e.top,R=e.bottom,S=x+y,O=S+h}else if(n==="y"){if(a==="center")x=b((e.left+e.right)/2);else if(de(a)){const L=Object.keys(a)[0],j=a[L];x=b(this.chart.scales[L].getPixelForValue(j))}C=x-y,_=C-h,P=e.left,T=e.right}const U=ae(s.ticks.maxTicksLimit,f),Y=Math.max(1,Math.ceil(f/U));for(w=0;w<f;w+=Y){const L=this.getContext(w),j=o.setContext(L),$=l.setContext(L),A=j.lineWidth,I=j.color,Q=$.dash||[],ne=$.dashOffset,se=j.tickWidth,K=j.tickColor,J=j.tickBorderDash||[],oe=j.tickBorderDashOffset;E=Jw(this,w,c),E!==void 0&&(k=wn(i,E,A),d?C=_=P=T=k:S=O=v=R=k,m.push({tx1:C,ty1:S,tx2:_,ty2:O,x1:P,y1:v,x2:T,y2:R,width:A,color:I,borderDash:Q,borderDashOffset:ne,tickWidth:se,tickColor:K,tickBorderDash:J,tickBorderDashOffset:oe}))}return this._ticksLength=f,this._borderValue=x,m}_computeLabelItems(e){const n=this.axis,i=this.options,{position:s,ticks:o}=i,a=this.isHorizontal(),l=this.ticks,{align:c,crossAlign:d,padding:u,mirror:f}=o,h=Ki(i.grid),m=h+u,p=f?-u:m,g=-yt(this.labelRotation),y=[];let b,x,w,E,k,C,S,_,O,P,v,T,R="middle";if(s==="top")C=this.bottom-p,S=this._getXAxisLabelAlignment();else if(s==="bottom")C=this.top+p,S=this._getXAxisLabelAlignment();else if(s==="left"){const Y=this._getYAxisLabelAlignment(h);S=Y.textAlign,k=Y.x}else if(s==="right"){const Y=this._getYAxisLabelAlignment(h);S=Y.textAlign,k=Y.x}else if(n==="x"){if(s==="center")C=(e.top+e.bottom)/2+m;else if(de(s)){const Y=Object.keys(s)[0],L=s[Y];C=this.chart.scales[Y].getPixelForValue(L)+m}S=this._getXAxisLabelAlignment()}else if(n==="y"){if(s==="center")k=(e.left+e.right)/2-m;else if(de(s)){const Y=Object.keys(s)[0],L=s[Y];k=this.chart.scales[Y].getPixelForValue(L)}S=this._getYAxisLabelAlignment(h).textAlign}n==="y"&&(c==="start"?R="top":c==="end"&&(R="bottom"));const U=this._getLabelSizes();for(b=0,x=l.length;b<x;++b){w=l[b],E=w.label;const Y=o.setContext(this.getContext(b));_=this.getPixelForTick(b)+o.labelOffset,O=this._resolveTickFontOptions(b),P=O.lineHeight,v=Oe(E)?E.length:1;const L=v/2,j=Y.color,$=Y.textStrokeColor,A=Y.textStrokeWidth;let I=S;a?(k=_,S==="inner"&&(b===x-1?I=this.options.reverse?"left":"right":b===0?I=this.options.reverse?"right":"left":I="center"),s==="top"?d==="near"||g!==0?T=-v*P+P/2:d==="center"?T=-U.highest.height/2-L*P+P:T=-U.highest.height+P/2:d==="near"||g!==0?T=P/2:d==="center"?T=U.highest.height/2-L*P:T=U.highest.height-v*P,f&&(T*=-1),g!==0&&!Y.showLabelBackdrop&&(k+=P/2*Math.sin(g))):(C=_,T=(1-v)*P/2);let Q;if(Y.showLabelBackdrop){const ne=He(Y.backdropPadding),se=U.heights[b],K=U.widths[b];let J=T-ne.top,oe=0-ne.left;switch(R){case"middle":J-=se/2;break;case"bottom":J-=se;break}switch(S){case"center":oe-=K/2;break;case"right":oe-=K;break;case"inner":b===x-1?oe-=K:b>0&&(oe-=K/2);break}Q={left:oe,top:J,width:K+ne.width,height:se+ne.height,color:Y.backdropColor}}y.push({label:E,font:O,textOffset:T,options:{rotation:g,color:j,strokeColor:$,strokeWidth:A,textAlign:I,textBaseline:R,translation:[k,C],backdrop:Q}})}return y}_getXAxisLabelAlignment(){const{position:e,ticks:n}=this.options;if(-yt(this.labelRotation))return e==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(e){const{position:n,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,a=this._getLabelSizes(),l=e+o,c=a.widest.width;let d,u;return n==="left"?s?(u=this.right+o,i==="near"?d="left":i==="center"?(d="center",u+=c/2):(d="right",u+=c)):(u=this.right-l,i==="near"?d="right":i==="center"?(d="center",u-=c/2):(d="left",u=this.left)):n==="right"?s?(u=this.left+o,i==="near"?d="right":i==="center"?(d="center",u-=c/2):(d="left",u-=c)):(u=this.left+l,i==="near"?d="left":i==="center"?(d="center",u+=c/2):(d="right",u=this.right)):d="right",{textAlign:d,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:n},left:i,top:s,width:o,height:a}=this;n&&(e.save(),e.fillStyle=n,e.fillRect(i,s,o,a),e.restore())}getLineWidthForValue(e){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(o=>o.value===e);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(e){const n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let o,a;const l=(c,d,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(c.x,c.y),i.lineTo(d.x,d.y),i.stroke(),i.restore())};if(n.display)for(o=0,a=s.length;o<a;++o){const c=s[o];n.drawOnChartArea&&l({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),n.drawTicks&&l({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:n,options:{border:i,grid:s}}=this,o=i.setContext(this.getContext()),a=i.display?o.width:0;if(!a)return;const l=s.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let d,u,f,h;this.isHorizontal()?(d=wn(e,this.left,a)-a/2,u=wn(e,this.right,l)+l/2,f=h=c):(f=wn(e,this.top,a)-a/2,h=wn(e,this.bottom,l)+l/2,d=u=c),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(d,f),n.lineTo(u,h),n.stroke(),n.restore()}drawLabels(e){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&Us(i,s);const o=this.getLabelItems(e);for(const a of o){const l=a.options,c=a.font,d=a.label,u=a.textOffset;En(i,d,0,u,c,l)}s&&Ws(i)}drawTitle(){const{ctx:e,options:{position:n,title:i,reverse:s}}=this;if(!i.display)return;const o=Fe(i.font),a=He(i.padding),l=i.align;let c=o.lineHeight/2;n==="bottom"||n==="center"||de(n)?(c+=a.bottom,Oe(i.text)&&(c+=o.lineHeight*(i.text.length-1))):c+=a.top;const{titleX:d,titleY:u,maxWidth:f,rotation:h}=nE(this,c,n,l);En(e,i.text,0,0,o,{color:i.color,maxWidth:f,rotation:h,textAlign:tE(l,n,s),textBaseline:"middle",translation:[d,u]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,n=e.ticks&&e.ticks.z||0,i=ae(e.grid&&e.grid.z,-1),s=ae(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==ln.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(e){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let o,a;for(o=0,a=n.length;o<a;++o){const l=n[o];l[i]===this.id&&(!e||l.type===e)&&s.push(l)}return s}_resolveTickFontOptions(e){const n=this.options.ticks.setContext(this.getContext(e));return Fe(n.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class eo{constructor(e,n,i){this.type=e,this.scope=n,this.override=i,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const n=Object.getPrototypeOf(e);let i;oE(n)&&(i=this.register(n));const s=this.items,o=e.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+e);return o in s||(s[o]=e,iE(e,a,i),this.override&&Ee.override(e.id,e.overrides)),a}get(e){return this.items[e]}unregister(e){const n=this.items,i=e.id,s=this.scope;i in n&&delete n[i],s&&i in Ee[s]&&(delete Ee[s][i],this.override&&delete Sn[i])}}function iE(t,e,n){const i=Oi(Object.create(null),[n?Ee.get(n):{},Ee.get(e),t.defaults]);Ee.set(e,i),t.defaultRoutes&&sE(e,t.defaultRoutes),t.descriptors&&Ee.describe(e,t.descriptors)}function sE(t,e){Object.keys(e).forEach(n=>{const i=n.split("."),s=i.pop(),o=[t].concat(i).join("."),a=e[n].split("."),l=a.pop(),c=a.join(".");Ee.route(o,s,c,l)})}function oE(t){return"id"in t&&"defaults"in t}class rE{constructor(){this.controllers=new eo(lt,"datasets",!0),this.elements=new eo(vt,"elements"),this.plugins=new eo(Object,"plugins"),this.scales=new eo(ln,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,n,i){[...n].forEach(s=>{const o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(e,o,s):be(s,a=>{const l=i||this._getRegistryForType(a);this._exec(e,l,a)})})}_exec(e,n,i){const s=fr(e);ke(i["before"+s],[],i),n[e](i),ke(i["after"+s],[],i)}_getRegistryForType(e){for(let n=0;n<this._typedRegistries.length;n++){const i=this._typedRegistries[n];if(i.isForType(e))return i}return this.plugins}_get(e,n,i){const s=n.get(e);if(s===void 0)throw new Error('"'+e+'" is not a registered '+i+".");return s}}var bt=new rE;class aE{constructor(){this._init=[]}notify(e,n,i,s){n==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const o=s?this._descriptors(e).filter(s):this._descriptors(e),a=this._notify(o,e,n,i);return n==="afterDestroy"&&(this._notify(o,e,"stop"),this._notify(this._init,e,"uninstall")),a}_notify(e,n,i,s){s=s||{};for(const o of e){const a=o.plugin,l=a[i],c=[n,s,o.options];if(ke(l,c,a)===!1&&s.cancelable)return!1}return!0}invalidate(){fe(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),n}_createDescriptors(e,n){const i=e&&e.config,s=ae(i.options&&i.options.plugins,{}),o=lE(i);return s===!1&&!n?[]:dE(e,o,s,n)}_notifyStateChanges(e){const n=this._oldCache||[],i=this._cache,s=(o,a)=>o.filter(l=>!a.some(c=>l.plugin.id===c.plugin.id));this._notify(s(n,i),e,"stop"),this._notify(s(i,n),e,"start")}}function lE(t){const e={},n=[],i=Object.keys(bt.plugins.items);for(let o=0;o<i.length;o++)n.push(bt.getPlugin(i[o]));const s=t.plugins||[];for(let o=0;o<s.length;o++){const a=s[o];n.indexOf(a)===-1&&(n.push(a),e[a.id]=!0)}return{plugins:n,localIds:e}}function cE(t,e){return!e&&t===!1?null:t===!0?{}:t}function dE(t,{plugins:e,localIds:n},i,s){const o=[],a=t.getContext();for(const l of e){const c=l.id,d=cE(i[c],s);d!==null&&o.push({plugin:l,options:uE(t.config,{plugin:l,local:n[c]},d,a)})}return o}function uE(t,{plugin:e,local:n},i,s){const o=t.pluginScopeKeys(e),a=t.getOptionScopes(i,o);return n&&e.defaults&&a.push(e.defaults),t.createResolver(a,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function $r(t,e){const n=Ee.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function fE(t,e){let n=t;return t==="_index_"?n=e:t==="_value_"&&(n=e==="x"?"y":"x"),n}function hE(t,e){return t===e?"_index_":"_value_"}function cu(t){if(t==="x"||t==="y"||t==="r")return t}function mE(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function Lr(t,...e){if(cu(t))return t;for(const n of e){const i=n.axis||mE(n.position)||t.length>1&&cu(t[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function du(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function pE(t,e){if(e.data&&e.data.datasets){const n=e.data.datasets.filter(i=>i.xAxisID===t||i.yAxisID===t);if(n.length)return du(t,"x",n[0])||du(t,"y",n[0])}return{}}function gE(t,e){const n=Sn[t.type]||{scales:{}},i=e.scales||{},s=$r(t.type,e),o=Object.create(null);return Object.keys(i).forEach(a=>{const l=i[a];if(!de(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const c=Lr(a,l,pE(a,t),Ee.scales[l.type]),d=hE(c,s),u=n.scales||{};o[a]=vi(Object.create(null),[{axis:c},l,u[c],u[d]])}),t.data.datasets.forEach(a=>{const l=a.type||t.type,c=a.indexAxis||$r(l,e),u=(Sn[l]||{}).scales||{};Object.keys(u).forEach(f=>{const h=fE(f,c),m=a[h+"AxisID"]||h;o[m]=o[m]||Object.create(null),vi(o[m],[{axis:h},i[m],u[f]])})}),Object.keys(o).forEach(a=>{const l=o[a];vi(l,[Ee.scales[l.type],Ee.scale])}),o}function uu(t){const e=t.options||(t.options={});e.plugins=ae(e.plugins,{}),e.scales=gE(t,e)}function fu(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function yE(t){return t=t||{},t.data=fu(t.data),uu(t),t}const hu=new Map,mu=new Set;function to(t,e){let n=hu.get(t);return n||(n=e(),hu.set(t,n),mu.add(n)),n}const Xi=(t,e,n)=>{const i=nn(e,n);i!==void 0&&t.add(i)};class bE{constructor(e){this._config=yE(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=fu(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),uu(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return to(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return to(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return to(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,i=this.type;return to(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,n){const i=this._scopeCache;let s=i.get(e);return(!s||n)&&(s=new Map,i.set(e,s)),s}getOptionScopes(e,n,i){const{options:s,type:o}=this,a=this._cachedScopes(e,i),l=a.get(n);if(l)return l;const c=new Set;n.forEach(u=>{e&&(c.add(e),u.forEach(f=>Xi(c,e,f))),u.forEach(f=>Xi(c,s,f)),u.forEach(f=>Xi(c,Sn[o]||{},f)),u.forEach(f=>Xi(c,Ee,f)),u.forEach(f=>Xi(c,xr,f))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),mu.has(n)&&a.set(n,d),d}chartOptionScopes(){const{options:e,type:n}=this;return[e,Sn[n]||{},Ee.datasets[n]||{},{type:n},Ee,xr]}resolveNamedOptions(e,n,i,s=[""]){const o={$shared:!0},{resolver:a,subPrefixes:l}=pu(this._resolverCache,e,s);let c=a;if(_E(a,n)){o.$shared=!1,i=sn(i)?i():i;const d=this.createResolver(e,i,l);c=Wn(a,i,d)}for(const d of n)o[d]=c[d];return o}createResolver(e,n,i=[""],s){const{resolver:o}=pu(this._resolverCache,e,i);return de(n)?Wn(o,n,void 0,s):o}}function pu(t,e,n){let i=t.get(e);i||(i=new Map,t.set(e,i));const s=n.join();let o=i.get(s);return o||(o={resolver:wr(e,n),subPrefixes:n.filter(l=>!l.toLowerCase().includes("hover"))},i.set(s,o)),o}const xE=t=>de(t)&&Object.getOwnPropertyNames(t).some(e=>sn(t[e]));function _E(t,e){const{isScriptable:n,isIndexable:i}=hd(t);for(const s of e){const o=n(s),a=i(s),l=(a||o)&&t[s];if(o&&(sn(l)||xE(l))||a&&Oe(l))return!0}return!1}var kE="4.4.7";const SE=["top","bottom","left","right","chartArea"];function gu(t,e){return t==="top"||t==="bottom"||SE.indexOf(t)===-1&&e==="x"}function yu(t,e){return function(n,i){return n[t]===i[t]?n[e]-i[e]:n[t]-i[t]}}function bu(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),ke(n&&n.onComplete,[t],e)}function wE(t){const e=t.chart,n=e.options.animation;ke(n&&n.onProgress,[t],e)}function xu(t){return Or()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const no={},_u=t=>{const e=xu(t);return Object.values(no).filter(n=>n.canvas===e).pop()};function EE(t,e,n){const i=Object.keys(t);for(const s of i){const o=+s;if(o>=e){const a=t[s];delete t[s],(n>0||o>e)&&(t[o+n]=a)}}}function CE(t,e,n,i){return!n||t.type==="mouseout"?null:i?e:t}function io(t,e,n){return t.options.clip?t[n]:e[n]}function OE(t,e){const{xScale:n,yScale:i}=t;return n&&i?{left:io(n,e,"left"),right:io(n,e,"right"),top:io(i,e,"top"),bottom:io(i,e,"bottom")}:e}class Nt{static register(...e){bt.add(...e),ku()}static unregister(...e){bt.remove(...e),ku()}constructor(e,n){const i=this.config=new bE(n),s=xu(e),o=_u(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 a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||su(s)),this.platform.updateConfig(i);const l=this.platform.acquireContext(s,a.aspectRatio),c=l&&l.canvas,d=c&&c.height,u=c&&c.width;if(this.id=Vk(),this.ctx=l,this.canvas=c,this.width=u,this.height=d,this._options=a,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 aE,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Jk(f=>this.update(f),a.resizeDelay||0),this._dataChanges=[],no[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}Ot.listen(this,"complete",bu),Ot.listen(this,"progress",wE),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:n},width:i,height:s,_aspectRatio:o}=this;return fe(e)?n&&o?o:s?i/s:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return bt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():kd(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return dd(this.canvas,this.ctx),this}stop(){return Ot.stop(this),this}resize(e,n){Ot.running(this)?this._resizeBeforeDraw={width:e,height:n}:this._resize(e,n)}_resize(e,n){const i=this.options,s=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,e,n,o),l=i.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,kd(this,l,!0)&&(this.notifyPlugins("resize",{size:a}),ke(i.onResize,[this,a],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};be(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){const e=this.options,n=e.scales,i=this.scales,s=Object.keys(i).reduce((a,l)=>(a[l]=!1,a),{});let o=[];n&&(o=o.concat(Object.keys(n).map(a=>{const l=n[a],c=Lr(a,l),d=c==="r",u=c==="x";return{options:l,dposition:d?"chartArea":u?"bottom":"left",dtype:d?"radialLinear":u?"category":"linear"}}))),be(o,a=>{const l=a.options,c=l.id,d=Lr(c,l),u=ae(l.type,a.dtype);(l.position===void 0||gu(l.position,d)!==gu(a.dposition))&&(l.position=a.dposition),s[c]=!0;let f=null;if(c in i&&i[c].type===u)f=i[c];else{const h=bt.getScale(u);f=new h({id:c,type:u,ctx:this.ctx,chart:this}),i[f.id]=f}f.init(l,e)}),be(s,(a,l)=>{a||delete i[l]}),be(i,a=>{je.configure(this,a,a.options),je.addBox(this,a)})}_updateMetasets(){const e=this._metasets,n=this.data.datasets.length,i=e.length;if(e.sort((s,o)=>s.index-o.index),i>n){for(let s=n;s<i;++s)this._destroyDatasetMeta(s);e.splice(n,i-n)}this._sortedMetasets=e.slice(0).sort(yu("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:n}}=this;e.length>n.length&&delete this._stacks,e.forEach((i,s)=>{n.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const e=[],n=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i<s;i++){const o=n[i];let a=this.getDatasetMeta(i);const l=o.type||this.config.type;if(a.type&&a.type!==l&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=l,a.indexAxis=o.indexAxis||$r(l,this.options),a.order=o.order||0,a.index=i,a.label=""+o.label,a.visible=this.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else{const c=bt.getController(l),{datasetElementType:d,dataElementType:u}=Ee.datasets[l];Object.assign(c,{dataElementType:bt.getElement(u),datasetElementType:d&&bt.getElement(d)}),a.controller=new c(this,i),e.push(a.controller)}}return this._updateMetasets(),e}_resetElements(){be(this.data.datasets,(e,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){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:e,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let d=0,u=this.data.datasets.length;d<u;d++){const{controller:f}=this.getDatasetMeta(d),h=!s&&o.indexOf(f)===-1;f.buildOrUpdateElements(h),a=Math.max(+f.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),s||be(o,d=>{d.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(yu("z","_idx"));const{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){be(this.scales,e=>{je.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!qc(n,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:o}of n){const a=i==="_removeElements"?-o:o;EE(e,s,a)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=o=>new Set(e.filter(a=>a[0]===o).map((a,l)=>l+","+a.splice(1).join(","))),s=i(0);for(let o=1;o<n;o++)if(!qc(s,i(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;je.update(this,this.width,this.height,e);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],be(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(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,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,sn(e)?e({datasetIndex:n}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,n){const i=this.getDatasetMeta(e),s={meta:i,index:e,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&&(Ot.has(this)?this.attached&&!Ot.running(this)&&Ot.start(this):(this.draw(),bu({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(e=0;e<n.length&&n[e].z<=0;++e)n[e].draw(this.chartArea);for(this._drawDatasets();e<n.length;++e)n[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const n=this._sortedMetasets,i=[];let s,o;for(s=0,o=n.length;s<o;++s){const a=n[s];(!e||a.visible)&&i.push(a)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let n=e.length-1;n>=0;--n)this._drawDataset(e[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const n=this.ctx,i=e._clip,s=!i.disabled,o=OE(e,this.chartArea),a={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(s&&Us(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}),e.controller.draw(),s&&Ws(n),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(e){return zt(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,n,i,s){const o=qd.modes[n];return typeof o=="function"?o(this,e,i,s):[]}getDatasetMeta(e){const n=this.data.datasets[e],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:e,_dataset:n,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=rn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const n=this.data.datasets[e];if(!n)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(e,n){const i=this.getDatasetMeta(e);i.hidden=!n}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,n,i){const s=i?"show":"hide",o=this.getDatasetMeta(e),a=o.controller._resolveAnimations(void 0,s);Ni(n)?(o.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),a.update(o,{visible:i}),this.update(l=>l.datasetIndex===e?s:void 0))}hide(e,n){this._updateVisibility(e,n,!1)}show(e,n){this._updateVisibility(e,n,!0)}_destroyDatasetMeta(e){const n=this._metasets[e];n&&n.controller&&n.controller._destroy(),delete this._metasets[e]}_stop(){let e,n;for(this.stop(),Ot.remove(this),e=0,n=this.data.datasets.length;e<n;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:n}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),dd(e,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete no[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,n=this.platform,i=(o,a)=>{n.addEventListener(this,o,a),e[o]=a},s=(o,a,l)=>{o.offsetX=a,o.offsetY=l,this._eventHandler(o)};be(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,n=this.platform,i=(c,d)=>{n.addEventListener(this,c,d),e[c]=d},s=(c,d)=>{e[c]&&(n.removeEventListener(this,c,d),delete e[c])},o=(c,d)=>{this.canvas&&this.resize(c,d)};let a;const l=()=>{s("attach",l),this.attached=!0,this.resize(),i("resize",o),i("detach",a)};a=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),i("attach",l)},n.isAttached(this.canvas)?l():a()}unbindEvents(){be(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},be(this._responsiveListeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,n,i){const s=i?"set":"remove";let o,a,l,c;for(n==="dataset"&&(o=this.getDatasetMeta(e[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),l=0,c=e.length;l<c;++l){a=e[l];const d=a&&this.getDatasetMeta(a.datasetIndex).controller;d&&d[s+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const n=this._active||[],i=e.map(({datasetIndex:o,index:a})=>{const l=this.getDatasetMeta(o);if(!l)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:l.data[a],index:a}});!$s(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(e,n,i){return this._plugins.notify(this,e,n,i)}isPluginEnabled(e){return this._plugins._cache.filter(n=>n.plugin.id===e).length===1}_updateHoverStyles(e,n,i){const s=this.options.hover,o=(c,d)=>c.filter(u=>!d.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.index)),a=o(n,e),l=i?e:o(e,n);a.length&&this.updateHoverStyle(a,s.mode,!1),l.length&&s.mode&&this.updateHoverStyle(l,s.mode,!0)}_eventHandler(e,n){const i={event:e,replay:n,cancelable:!0,inChartArea:this.isPointInArea(e)},s=a=>(a.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const o=this._handleEvent(e,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(o||i.changed)&&this.render(),this}_handleEvent(e,n,i){const{_active:s=[],options:o}=this,a=n,l=this._getActiveElements(e,s,i,a),c=jk(e),d=CE(e,this._lastEvent,i,c);i&&(this._lastEvent=null,ke(o.onHover,[e,l,this],this),c&&ke(o.onClick,[e,l,this],this));const u=!$s(l,s);return(u||n)&&(this._active=l,this._updateHoverStyles(l,s,n)),this._lastEvent=d,u}_getActiveElements(e,n,i,s){if(e.type==="mouseout")return[];if(!i)return n;const o=this.options.hover;return this.getElementsAtEventForMode(e,o.mode,o,s)}}z(Nt,"defaults",Ee),z(Nt,"instances",no),z(Nt,"overrides",Sn),z(Nt,"registry",bt),z(Nt,"version",kE),z(Nt,"getChart",_u);function ku(){return be(Nt.instances,t=>t._plugins.invalidate())}function vE(t,e,n){const{startAngle:i,pixelMargin:s,x:o,y:a,outerRadius:l,innerRadius:c}=e;let d=s/l;t.beginPath(),t.arc(o,a,l,i-d,n+d),c>s?(d=s/c,t.arc(o,a,c,n+d,i-d,!0)):t.arc(o,a,s,n+Me,i-Me),t.closePath(),t.clip()}function NE(t){return Sr(t,["outerStart","outerEnd","innerStart","innerEnd"])}function DE(t,e,n,i){const s=NE(t.options.borderRadius),o=(n-e)/2,a=Math.min(o,i*e/2),l=c=>{const d=(n-Math.min(o,c))*i/2;return Le(c,0,Math.min(o,d))};return{outerStart:l(s.outerStart),outerEnd:l(s.outerEnd),innerStart:Le(s.innerStart,0,a),innerEnd:Le(s.innerEnd,0,a)}}function Kn(t,e,n,i){return{x:n+t*Math.cos(e),y:i+t*Math.sin(e)}}function so(t,e,n,i,s,o){const{x:a,y:l,startAngle:c,pixelMargin:d,innerRadius:u}=e,f=Math.max(e.outerRadius+i+n-d,0),h=u>0?u+i+n+d:0;let m=0;const p=s-c;if(i){const Y=u>0?u-i:0,L=f>0?f-i:0,j=(Y+L)/2,$=j!==0?p*j/(j+i):p;m=(p-$)/2}const g=Math.max(.001,p*f-n/Se)/f,y=(p-g)/2,b=c+y+m,x=s-y-m,{outerStart:w,outerEnd:E,innerStart:k,innerEnd:C}=DE(e,h,f,x-b),S=f-w,_=f-E,O=b+w/S,P=x-E/_,v=h+k,T=h+C,R=b+k/v,U=x-C/T;if(t.beginPath(),o){const Y=(O+P)/2;if(t.arc(a,l,f,O,Y),t.arc(a,l,f,Y,P),E>0){const A=Kn(_,P,a,l);t.arc(A.x,A.y,E,P,x+Me)}const L=Kn(T,x,a,l);if(t.lineTo(L.x,L.y),C>0){const A=Kn(T,U,a,l);t.arc(A.x,A.y,C,x+Me,U+Math.PI)}const j=(x-C/h+(b+k/h))/2;if(t.arc(a,l,h,x-C/h,j,!0),t.arc(a,l,h,j,b+k/h,!0),k>0){const A=Kn(v,R,a,l);t.arc(A.x,A.y,k,R+Math.PI,b-Me)}const $=Kn(S,b,a,l);if(t.lineTo($.x,$.y),w>0){const A=Kn(S,O,a,l);t.arc(A.x,A.y,w,b-Me,O)}}else{t.moveTo(a,l);const Y=Math.cos(O)*f+a,L=Math.sin(O)*f+l;t.lineTo(Y,L);const j=Math.cos(P)*f+a,$=Math.sin(P)*f+l;t.lineTo(j,$)}t.closePath()}function TE(t,e,n,i,s){const{fullCircles:o,startAngle:a,circumference:l}=e;let c=e.endAngle;if(o){so(t,e,n,i,c,s);for(let d=0;d<o;++d)t.fill();isNaN(l)||(c=a+(l%we||we))}return so(t,e,n,i,c,s),t.fill(),c}function BE(t,e,n,i,s){const{fullCircles:o,startAngle:a,circumference:l,options:c}=e,{borderWidth:d,borderJoinStyle:u,borderDash:f,borderDashOffset:h}=c,m=c.borderAlign==="inner";if(!d)return;t.setLineDash(f||[]),t.lineDashOffset=h,m?(t.lineWidth=d*2,t.lineJoin=u||"round"):(t.lineWidth=d,t.lineJoin=u||"bevel");let p=e.endAngle;if(o){so(t,e,n,i,p,s);for(let g=0;g<o;++g)t.stroke();isNaN(l)||(p=a+(l%we||we))}m&&vE(t,e,p),o||(so(t,e,n,i,p,s),t.stroke())}class Xn extends vt{constructor(n){super();z(this,"circumference");z(this,"endAngle");z(this,"fullCircles");z(this,"innerRadius");z(this,"outerRadius");z(this,"pixelMargin");z(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:a,distance:l}=Jc(o,{x:n,y:i}),{startAngle:c,endAngle:d,innerRadius:u,outerRadius:f,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),m=(this.options.spacing+this.options.borderWidth)/2,p=ae(h,d-c),g=Ti(a,c,d)&&c!==d,y=p>=we||g,b=It(l,u+m,f+m);return y&&b}getCenterPoint(n){const{x:i,y:s,startAngle:o,endAngle:a,innerRadius:l,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:d,spacing:u}=this.options,f=(o+a)/2,h=(l+c+u+d)/2;return{x:i+Math.cos(f)*h,y:s+Math.sin(f)*h}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:i,circumference:s}=this,o=(i.offset||0)/4,a=(i.spacing||0)/2,l=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>we?Math.floor(s/we):0,s===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const c=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(c)*o,Math.sin(c)*o);const d=1-Math.sin(Math.min(Se,s||0)),u=o*d;n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,TE(n,this,u,a,l),BE(n,this,u,a,l),n.restore()}}z(Xn,"id","arc"),z(Xn,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),z(Xn,"defaultRoutes",{backgroundColor:"backgroundColor"}),z(Xn,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function Su(t,e,n=e){t.lineCap=ae(n.borderCapStyle,e.borderCapStyle),t.setLineDash(ae(n.borderDash,e.borderDash)),t.lineDashOffset=ae(n.borderDashOffset,e.borderDashOffset),t.lineJoin=ae(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=ae(n.borderWidth,e.borderWidth),t.strokeStyle=ae(n.borderColor,e.borderColor)}function PE(t,e,n){t.lineTo(n.x,n.y)}function AE(t){return t.stepped?cS:t.tension||t.cubicInterpolationMode==="monotone"?dS:PE}function wu(t,e,n={}){const i=t.length,{start:s=0,end:o=i-1}=n,{start:a,end:l}=e,c=Math.max(s,a),d=Math.min(o,l),u=s<a&&o<a||s>l&&o>l;return{count:i,start:c,loop:e.loop,ilen:d<c&&!u?i+d-c:d-c}}function ME(t,e,n,i){const{points:s,options:o}=e,{count:a,start:l,loop:c,ilen:d}=wu(s,n,i),u=AE(o);let{move:f=!0,reverse:h}=i||{},m,p,g;for(m=0;m<=d;++m)p=s[(l+(h?d-m:m))%a],!p.skip&&(f?(t.moveTo(p.x,p.y),f=!1):u(t,g,p,h,o.stepped),g=p);return c&&(p=s[(l+(h?d:0))%a],u(t,g,p,h,o.stepped)),!!c}function VE(t,e,n,i){const s=e.points,{count:o,start:a,ilen:l}=wu(s,n,i),{move:c=!0,reverse:d}=i||{};let u=0,f=0,h,m,p,g,y,b;const x=E=>(a+(d?l-E:E))%o,w=()=>{g!==y&&(t.lineTo(u,y),t.lineTo(u,g),t.lineTo(u,b))};for(c&&(m=s[x(0)],t.moveTo(m.x,m.y)),h=0;h<=l;++h){if(m=s[x(h)],m.skip)continue;const E=m.x,k=m.y,C=E|0;C===p?(k<g?g=k:k>y&&(y=k),u=(f*u+E)/++f):(w(),t.lineTo(E,k),p=C,f=0,g=y=k),b=k}w()}function Ir(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!n?VE:ME}function RE(t){return t.stepped?zS:t.tension||t.cubicInterpolationMode==="monotone"?US:Nn}function FE(t,e,n,i){let s=e._path;s||(s=e._path=new Path2D,e.path(s,n,i)&&s.closePath()),Su(t,e.options),t.stroke(s)}function $E(t,e,n,i){const{segments:s,options:o}=e,a=Ir(e);for(const l of s)Su(t,o,l.style),t.beginPath(),a(t,e,l,{start:n,end:n+i-1})&&t.closePath(),t.stroke()}const LE=typeof Path2D=="function";function IE(t,e,n,i){LE&&!e.options.segment?FE(t,e,n,i):$E(t,e,n,i)}class Ut extends vt{constructor(e){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,e&&Object.assign(this,e)}updateControlPoints(e,n){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;MS(this._points,i,e,s,n),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=XS(this,this.options.segment))}first(){const e=this.segments,n=this.points;return e.length&&n[e[0].start]}last(){const e=this.segments,n=this.points,i=e.length;return i&&n[e[i-1].end]}interpolate(e,n){const i=this.options,s=e[n],o=this.points,a=Nd(this,{property:n,start:s,end:s});if(!a.length)return;const l=[],c=RE(i);let d,u;for(d=0,u=a.length;d<u;++d){const{start:f,end:h}=a[d],m=o[f],p=o[h];if(m===p){l.push(m);continue}const g=Math.abs((s-m[n])/(p[n]-m[n])),y=c(m,p,g,i.stepped);y[n]=e[n],l.push(y)}return l.length===1?l[0]:l}pathSegment(e,n,i){return Ir(this)(e,this,n,i)}path(e,n,i){const s=this.segments,o=Ir(this);let a=this._loop;n=n||0,i=i||this.points.length-n;for(const l of s)a&=o(e,this,l,{start:n,end:n+i-1});return!!a}draw(e,n,i,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(e.save(),IE(e,this,i,s),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}z(Ut,"id","line"),z(Ut,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),z(Ut,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),z(Ut,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"});function Eu(t,e,n,i){const s=t.options,{[n]:o}=t.getProps([n],i);return Math.abs(e-o)<s.radius+s.hitRadius}class Gi extends vt{constructor(n){super();z(this,"parsed");z(this,"skip");z(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:a,y:l}=this.getProps(["x","y"],s);return Math.pow(n-a,2)+Math.pow(i-l,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(n,i){return Eu(this,n,"x",i)}inYRange(n,i){return Eu(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||!zt(this,i,this.size(s)/2)||(n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.fillStyle=s.backgroundColor,kr(n,s,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}z(Gi,"id","point"),z(Gi,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),z(Gi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Cu(t,e){const{x:n,y:i,base:s,width:o,height:a}=t.getProps(["x","y","base","width","height"],e);let l,c,d,u,f;return t.horizontal?(f=a/2,l=Math.min(n,s),c=Math.max(n,s),d=i-f,u=i+f):(f=o/2,l=n-f,c=n+f,d=Math.min(i,s),u=Math.max(i,s)),{left:l,top:d,right:c,bottom:u}}function cn(t,e,n,i){return t?0:Le(e,n,i)}function jE(t,e,n){const i=t.options.borderWidth,s=t.borderSkipped,o=fd(i);return{t:cn(s.top,o.top,0,n),r:cn(s.right,o.right,0,e),b:cn(s.bottom,o.bottom,0,n),l:cn(s.left,o.left,0,e)}}function zE(t,e,n){const{enableBorderRadius:i}=t.getProps(["enableBorderRadius"]),s=t.options.borderRadius,o=Cn(s),a=Math.min(e,n),l=t.borderSkipped,c=i||de(s);return{topLeft:cn(!c||l.top||l.left,o.topLeft,0,a),topRight:cn(!c||l.top||l.right,o.topRight,0,a),bottomLeft:cn(!c||l.bottom||l.left,o.bottomLeft,0,a),bottomRight:cn(!c||l.bottom||l.right,o.bottomRight,0,a)}}function UE(t){const e=Cu(t),n=e.right-e.left,i=e.bottom-e.top,s=jE(t,n/2,i/2),o=zE(t,n/2,i/2);return{outer:{x:e.left,y:e.top,w:n,h:i,radius:o},inner:{x:e.left+s.l,y:e.top+s.t,w:n-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function jr(t,e,n,i){const s=e===null,o=n===null,l=t&&!(s&&o)&&Cu(t,i);return l&&(s||It(e,l.left,l.right))&&(o||It(n,l.top,l.bottom))}function WE(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function HE(t,e){t.rect(e.x,e.y,e.w,e.h)}function zr(t,e,n={}){const i=t.x!==n.x?-e:0,s=t.y!==n.y?-e:0,o=(t.x+t.w!==n.x+n.w?e:0)-i,a=(t.y+t.h!==n.y+n.h?e:0)-s;return{x:t.x+i,y:t.y+s,w:t.w+o,h:t.h+a,radius:t.radius}}class Ji extends vt{constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:n,options:{borderColor:i,backgroundColor:s}}=this,{inner:o,outer:a}=UE(this),l=WE(a.radius)?Vi:HE;e.save(),(a.w!==o.w||a.h!==o.h)&&(e.beginPath(),l(e,zr(a,n,o)),e.clip(),l(e,zr(o,-n,a)),e.fillStyle=i,e.fill("evenodd")),e.beginPath(),l(e,zr(o,n)),e.fillStyle=s,e.fill(),e.restore()}inRange(e,n,i){return jr(this,e,n,i)}inXRange(e,n){return jr(this,e,null,n)}inYRange(e,n){return jr(this,null,e,n)}getCenterPoint(e){const{x:n,y:i,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],e);return{x:o?(n+s)/2:n,y:o?i:(i+s)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}z(Ji,"id","bar"),z(Ji,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),z(Ji,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Ou=Object.freeze({__proto__:null,ArcElement:Xn,BarElement:Ji,LineElement:Ut,PointElement:Gi});const Ur=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],vu=Ur.map(t=>t.replace("rgb(","rgba(").replace(")",", 0.5)"));function Nu(t){return Ur[t%Ur.length]}function Du(t){return vu[t%vu.length]}function qE(t,e){return t.borderColor=Nu(e),t.backgroundColor=Du(e),++e}function YE(t,e){return t.backgroundColor=t.data.map(()=>Nu(e++)),e}function KE(t,e){return t.backgroundColor=t.data.map(()=>Du(e++)),e}function XE(t){let e=0;return(n,i)=>{const s=t.getDatasetMeta(i).controller;s instanceof an?e=YE(n,e):s instanceof Yn?e=KE(n,e):s&&(e=qE(n,e))}}function Tu(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}function GE(t){return t&&(t.borderColor||t.backgroundColor)}function JE(){return Ee.borderColor!=="rgba(0,0,0,0.1)"||Ee.backgroundColor!=="rgba(0,0,0,0.1)"}var Bu={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,n){if(!n.enabled)return;const{data:{datasets:i},options:s}=t.config,{elements:o}=s,a=Tu(i)||GE(s)||o&&Tu(o)||JE();if(!n.forceOverride&&a)return;const l=XE(t);i.forEach(l)}};function QE(t,e,n,i,s){const o=s.samples||i;if(o>=n)return t.slice(e,e+n);const a=[],l=(n-2)/(o-2);let c=0;const d=e+n-1;let u=e,f,h,m,p,g;for(a[c++]=t[u],f=0;f<o-2;f++){let y=0,b=0,x;const w=Math.floor((f+1)*l)+1+e,E=Math.min(Math.floor((f+2)*l)+1,n)+e,k=E-w;for(x=w;x<E;x++)y+=t[x].x,b+=t[x].y;y/=k,b/=k;const C=Math.floor(f*l)+1+e,S=Math.min(Math.floor((f+1)*l)+1,n)+e,{x:_,y:O}=t[u];for(m=p=-1,x=C;x<S;x++)p=.5*Math.abs((_-y)*(t[x].y-O)-(_-t[x].x)*(b-O)),p>m&&(m=p,h=t[x],g=x);a[c++]=h,u=g}return a[c++]=t[d],a}function ZE(t,e,n,i){let s=0,o=0,a,l,c,d,u,f,h,m,p,g;const y=[],b=e+n-1,x=t[e].x,E=t[b].x-x;for(a=e;a<e+n;++a){l=t[a],c=(l.x-x)/E*i,d=l.y;const k=c|0;if(k===u)d<p?(p=d,f=a):d>g&&(g=d,h=a),s=(o*s+l.x)/++o;else{const C=a-1;if(!fe(f)&&!fe(h)){const S=Math.min(f,h),_=Math.max(f,h);S!==m&&S!==C&&y.push({...t[S],x:s}),_!==m&&_!==C&&y.push({...t[_],x:s})}a>0&&C!==m&&y.push(t[C]),y.push(l),u=k,o=0,p=g=d,f=h=m=a}}return y}function Pu(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function Au(t){t.data.datasets.forEach(e=>{Pu(e)})}function eC(t,e){const n=e.length;let i=0,s;const{iScale:o}=t,{min:a,max:l,minDefined:c,maxDefined:d}=o.getUserBounds();return c&&(i=Le(jt(e,o.axis,a).lo,0,n-1)),d?s=Le(jt(e,o.axis,l).hi+1,i,n)-i:s=n-i,{start:i,count:s}}var Mu={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,n)=>{if(!n.enabled){Au(t);return}const i=t.width;t.data.datasets.forEach((s,o)=>{const{_data:a,indexAxis:l}=s,c=t.getDatasetMeta(o),d=a||s.data;if(Ri([l,t.options.indexAxis])==="y"||!c.controller.supportsDecimation)return;const u=t.scales[c.xAxisID];if(u.type!=="linear"&&u.type!=="time"||t.options.parsing)return;let{start:f,count:h}=eC(c,d);const m=n.threshold||4*i;if(h<=m){Pu(s);return}fe(a)&&(s._data=d,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let p;switch(n.algorithm){case"lttb":p=QE(d,f,h,i,n);break;case"min-max":p=ZE(d,f,h,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}s._decimated=p})},destroy(t){Au(t)}};function tC(t,e,n){const i=t.segments,s=t.points,o=e.points,a=[];for(const l of i){let{start:c,end:d}=l;d=Hr(c,d,s);const u=Wr(n,s[c],s[d],l.loop);if(!e.segments){a.push({source:l,target:u,start:s[c],end:s[d]});continue}const f=Nd(e,u);for(const h of f){const m=Wr(n,o[h.start],o[h.end],h.loop),p=vd(l,s,m);for(const g of p)a.push({source:g,target:h,start:{[n]:Vu(u,m,"start",Math.max)},end:{[n]:Vu(u,m,"end",Math.min)}})}}return a}function Wr(t,e,n,i){if(i)return;let s=e[t],o=n[t];return t==="angle"&&(s=it(s),o=it(o)),{property:t,start:s,end:o}}function nC(t,e){const{x:n=null,y:i=null}=t||{},s=e.points,o=[];return e.segments.forEach(({start:a,end:l})=>{l=Hr(a,l,s);const c=s[a],d=s[l];i!==null?(o.push({x:c.x,y:i}),o.push({x:d.x,y:i})):n!==null&&(o.push({x:n,y:c.y}),o.push({x:n,y:d.y}))}),o}function Hr(t,e,n){for(;e>t;e--){const i=n[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function Vu(t,e,n,i){return t&&e?i(t[n],e[n]):t?t[n]:e?e[n]:0}function Ru(t,e){let n=[],i=!1;return Oe(t)?(i=!0,n=t):n=nC(t,e),n.length?new Ut({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function Fu(t){return t&&t.fill!==!1}function iC(t,e,n){let s=t[e].fill;const o=[e];let a;if(!n)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!Pe(s))return s;if(a=t[s],!a)return!1;if(a.visible)return s;o.push(s),s=a.fill}return!1}function sC(t,e,n){const i=lC(t);if(de(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Pe(s)&&Math.floor(s)===s?oC(i[0],e,s,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function oC(t,e,n,i){return(t==="-"||t==="+")&&(n=e+n),n===e||n<0||n>=i?!1:n}function rC(t,e){let n=null;return t==="start"?n=e.bottom:t==="end"?n=e.top:de(t)?n=e.getPixelForValue(t.value):e.getBasePixel&&(n=e.getBasePixel()),n}function aC(t,e,n){let i;return t==="start"?i=n:t==="end"?i=e.options.reverse?e.min:e.max:de(t)?i=t.value:i=e.getBaseValue(),i}function lC(t){const e=t.options,n=e.fill;let i=ae(n&&n.target,n);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function cC(t){const{scale:e,index:n,line:i}=t,s=[],o=i.segments,a=i.points,l=dC(e,n);l.push(Ru({x:null,y:e.bottom},i));for(let c=0;c<o.length;c++){const d=o[c];for(let u=d.start;u<=d.end;u++)uC(s,a[u],l)}return new Ut({points:s,options:{}})}function dC(t,e){const n=[],i=t.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const o=i[s];if(o.index===e)break;o.hidden||n.unshift(o.dataset)}return n}function uC(t,e,n){const i=[];for(let s=0;s<n.length;s++){const o=n[s],{first:a,last:l,point:c}=fC(o,e,"x");if(!(!c||a&&l)){if(a)i.unshift(c);else if(t.push(c),!l)break}}t.push(...i)}function fC(t,e,n){const i=t.interpolate(e,n);if(!i)return{};const s=i[n],o=t.segments,a=t.points;let l=!1,c=!1;for(let d=0;d<o.length;d++){const u=o[d],f=a[u.start][n],h=a[u.end][n];if(It(s,f,h)){l=s===f,c=s===h;break}}return{first:l,last:c,point:i}}class $u{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,n,i){const{x:s,y:o,radius:a}=this;return n=n||{start:0,end:we},e.arc(s,o,a,n.end,n.start,!0),!i.bounds}interpolate(e){const{x:n,y:i,radius:s}=this,o=e.angle;return{x:n+Math.cos(o)*s,y:i+Math.sin(o)*s,angle:o}}}function hC(t){const{chart:e,fill:n,line:i}=t;if(Pe(n))return mC(e,n);if(n==="stack")return cC(t);if(n==="shape")return!0;const s=pC(t);return s instanceof $u?s:Ru(s,i)}function mC(t,e){const n=t.getDatasetMeta(e);return n&&t.isDatasetVisible(e)?n.dataset:null}function pC(t){return(t.scale||{}).getPointPositionForValue?yC(t):gC(t)}function gC(t){const{scale:e={},fill:n}=t,i=rC(n,e);if(Pe(i)){const s=e.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function yC(t){const{scale:e,fill:n}=t,i=e.options,s=e.getLabels().length,o=i.reverse?e.max:e.min,a=aC(n,e,o),l=[];if(i.grid.circular){const c=e.getPointPositionForValue(0,o);return new $u({x:c.x,y:c.y,radius:e.getDistanceFromCenterForValue(a)})}for(let c=0;c<s;++c)l.push(e.getPointPositionForValue(c,a));return l}function qr(t,e,n){const i=hC(e),{line:s,scale:o,axis:a}=e,l=s.options,c=l.fill,d=l.backgroundColor,{above:u=d,below:f=d}=c||{};i&&s.points.length&&(Us(t,n),bC(t,{line:s,target:i,above:u,below:f,area:n,scale:o,axis:a}),Ws(t))}function bC(t,e){const{line:n,target:i,above:s,below:o,area:a,scale:l}=e,c=n._loop?"angle":e.axis;t.save(),c==="x"&&o!==s&&(Lu(t,i,a.top),Iu(t,{line:n,target:i,color:s,scale:l,property:c}),t.restore(),t.save(),Lu(t,i,a.bottom)),Iu(t,{line:n,target:i,color:o,scale:l,property:c}),t.restore()}function Lu(t,e,n){const{segments:i,points:s}=e;let o=!0,a=!1;t.beginPath();for(const l of i){const{start:c,end:d}=l,u=s[c],f=s[Hr(c,d,s)];o?(t.moveTo(u.x,u.y),o=!1):(t.lineTo(u.x,n),t.lineTo(u.x,u.y)),a=!!e.pathSegment(t,l,{move:a}),a?t.closePath():t.lineTo(f.x,n)}t.lineTo(e.first().x,n),t.closePath(),t.clip()}function Iu(t,e){const{line:n,target:i,property:s,color:o,scale:a}=e,l=tC(n,i,s);for(const{source:c,target:d,start:u,end:f}of l){const{style:{backgroundColor:h=o}={}}=c,m=i!==!0;t.save(),t.fillStyle=h,xC(t,a,m&&Wr(s,u,f)),t.beginPath();const p=!!n.pathSegment(t,c);let g;if(m){p?t.closePath():ju(t,i,f,s);const y=!!i.pathSegment(t,d,{move:p,reverse:!0});g=p&&y,g||ju(t,i,u,s)}t.closePath(),t.fill(g?"evenodd":"nonzero"),t.restore()}}function xC(t,e,n){const{top:i,bottom:s}=e.chart.chartArea,{property:o,start:a,end:l}=n||{};o==="x"&&(t.beginPath(),t.rect(a,i,l-a,s-i),t.clip())}function ju(t,e,n,i){const s=e.interpolate(n,i);s&&t.lineTo(s.x,s.y)}var zu={id:"filler",afterDatasetsUpdate(t,e,n){const i=(t.data.datasets||[]).length,s=[];let o,a,l,c;for(a=0;a<i;++a)o=t.getDatasetMeta(a),l=o.dataset,c=null,l&&l.options&&l instanceof Ut&&(c={visible:t.isDatasetVisible(a),index:a,fill:sC(l,a,i),chart:t,axis:o.controller.options.indexAxis,scale:o.vScale,line:l}),o.$filler=c,s.push(c);for(a=0;a<i;++a)c=s[a],!(!c||c.fill===!1)&&(c.fill=iC(s,a,n.propagate))},beforeDraw(t,e,n){const i=n.drawTime==="beforeDraw",s=t.getSortedVisibleDatasetMetas(),o=t.chartArea;for(let a=s.length-1;a>=0;--a){const l=s[a].$filler;l&&(l.line.updateControlPoints(o,l.axis),i&&l.fill&&qr(t.ctx,l,o))}},beforeDatasetsDraw(t,e,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=t.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const o=i[s].$filler;Fu(o)&&qr(t.ctx,o,t.chartArea)}},beforeDatasetDraw(t,e,n){const i=e.meta.$filler;!Fu(i)||n.drawTime!=="beforeDatasetDraw"||qr(t.ctx,i,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Uu=(t,e)=>{let{boxHeight:n=e,boxWidth:i=e}=t;return t.usePointStyle&&(n=Math.min(n,e),i=t.pointStyleWidth||Math.min(i,e)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(e,n)}},_C=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class Wu extends vt{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,n,i){this.maxWidth=e,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 e=this.options.labels||{};let n=ke(e.generateLabels,[this.chart],this)||[];e.filter&&(n=n.filter(i=>e.filter(i,this.chart.data))),e.sort&&(n=n.sort((i,s)=>e.sort(i,s,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:e,ctx:n}=this;if(!e.display){this.width=this.height=0;return}const i=e.labels,s=Fe(i.font),o=s.size,a=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=Uu(i,o);let d,u;n.font=s.string,this.isHorizontal()?(d=this.maxWidth,u=this._fitRows(a,o,l,c)+10):(u=this.maxHeight,d=this._fitCols(a,s,l,c)+10),this.width=Math.min(d,e.maxWidth||this.maxWidth),this.height=Math.min(u,e.maxHeight||this.maxHeight)}_fitRows(e,n,i,s){const{ctx:o,maxWidth:a,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],u=s+l;let f=e;o.textAlign="left",o.textBaseline="middle";let h=-1,m=-u;return this.legendItems.forEach((p,g)=>{const y=i+n/2+o.measureText(p.text).width;(g===0||d[d.length-1]+y+2*l>a)&&(f+=u,d[d.length-(g>0?0:1)]=0,m+=u,h++),c[g]={left:0,top:m,row:h,width:y,height:s},d[d.length-1]+=y+l}),f}_fitCols(e,n,i,s){const{ctx:o,maxHeight:a,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.columnSizes=[],u=a-e;let f=l,h=0,m=0,p=0,g=0;return this.legendItems.forEach((y,b)=>{const{itemWidth:x,itemHeight:w}=kC(i,n,o,y,s);b>0&&m+w+2*l>u&&(f+=h+l,d.push({width:h,height:m}),p+=h+l,g++,h=m=0),c[b]={left:p,top:m,col:g,width:x,height:w},h=Math.max(h,x),m+=w+l}),f+=h,d.push({width:h,height:m}),f}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:o}}=this,a=qn(o,this.left,this.width);if(this.isHorizontal()){let l=0,c=We(i,this.left+s,this.right-this.lineWidths[l]);for(const d of n)l!==d.row&&(l=d.row,c=We(i,this.left+s,this.right-this.lineWidths[l])),d.top+=this.top+e+s,d.left=a.leftForLtr(a.x(c),d.width),c+=d.width+s}else{let l=0,c=We(i,this.top+e+s,this.bottom-this.columnSizes[l].height);for(const d of n)d.col!==l&&(l=d.col,c=We(i,this.top+e+s,this.bottom-this.columnSizes[l].height)),d.top=c,d.left+=this.left+s,d.left=a.leftForLtr(a.x(d.left),d.width),c+=d.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;Us(e,this),this._draw(),Ws(e)}}_draw(){const{options:e,columnSizes:n,lineWidths:i,ctx:s}=this,{align:o,labels:a}=e,l=Ee.color,c=qn(e.rtl,this.left,this.width),d=Fe(a.font),{padding:u}=a,f=d.size,h=f/2;let m;this.drawTitle(),s.textAlign=c.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=d.string;const{boxWidth:p,boxHeight:g,itemHeight:y}=Uu(a,f),b=function(C,S,_){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;s.save();const O=ae(_.lineWidth,1);if(s.fillStyle=ae(_.fillStyle,l),s.lineCap=ae(_.lineCap,"butt"),s.lineDashOffset=ae(_.lineDashOffset,0),s.lineJoin=ae(_.lineJoin,"miter"),s.lineWidth=O,s.strokeStyle=ae(_.strokeStyle,l),s.setLineDash(ae(_.lineDash,[])),a.usePointStyle){const P={radius:g*Math.SQRT2/2,pointStyle:_.pointStyle,rotation:_.rotation,borderWidth:O},v=c.xPlus(C,p/2),T=S+h;ud(s,P,v,T,a.pointStyleWidth&&p)}else{const P=S+Math.max((f-g)/2,0),v=c.leftForLtr(C,p),T=Cn(_.borderRadius);s.beginPath(),Object.values(T).some(R=>R!==0)?Vi(s,{x:v,y:P,w:p,h:g,radius:T}):s.rect(v,P,p,g),s.fill(),O!==0&&s.stroke()}s.restore()},x=function(C,S,_){En(s,_.text,C,S+y/2,d,{strikethrough:_.hidden,textAlign:c.textAlign(_.textAlign)})},w=this.isHorizontal(),E=this._computeTitleHeight();w?m={x:We(o,this.left+u,this.right-i[0]),y:this.top+u+E,line:0}:m={x:this.left+u,y:We(o,this.top+E+u,this.bottom-n[0].height),line:0},wd(this.ctx,e.textDirection);const k=y+u;this.legendItems.forEach((C,S)=>{s.strokeStyle=C.fontColor,s.fillStyle=C.fontColor;const _=s.measureText(C.text).width,O=c.textAlign(C.textAlign||(C.textAlign=a.textAlign)),P=p+h+_;let v=m.x,T=m.y;c.setWidth(this.width),w?S>0&&v+P+u>this.right&&(T=m.y+=k,m.line++,v=m.x=We(o,this.left+u,this.right-i[m.line])):S>0&&T+k>this.bottom&&(v=m.x=v+n[m.line].width+u,m.line++,T=m.y=We(o,this.top+E+u,this.bottom-n[m.line].height));const R=c.x(v);if(b(R,T,C),v=Qk(O,v+p+h,w?v+P:this.right,e.rtl),x(c.x(v),T,C),w)m.x+=P+u;else if(typeof C.text!="string"){const U=d.lineHeight;m.y+=Hu(C,U)+u}else m.y+=k}),Ed(this.ctx,e.textDirection)}drawTitle(){const e=this.options,n=e.title,i=Fe(n.font),s=He(n.padding);if(!n.display)return;const o=qn(e.rtl,this.left,this.width),a=this.ctx,l=n.position,c=i.size/2,d=s.top+c;let u,f=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+d,f=We(e.align,f,this.right-h);else{const p=this.columnSizes.reduce((g,y)=>Math.max(g,y.height),0);u=d+We(e.align,this.top,this.bottom-p-e.labels.padding-this._computeTitleHeight())}const m=We(l,f,f+h);a.textAlign=o.textAlign(gr(l)),a.textBaseline="middle",a.strokeStyle=n.color,a.fillStyle=n.color,a.font=i.string,En(a,n.text,m,u,i)}_computeTitleHeight(){const e=this.options.title,n=Fe(e.font),i=He(e.padding);return e.display?n.lineHeight+i.height:0}_getLegendItemAt(e,n){let i,s,o;if(It(e,this.left,this.right)&&It(n,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],It(e,s.left,s.left+s.width)&&It(n,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(e){const n=this.options;if(!EC(e.type,n))return;const i=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const s=this._hoveredItem,o=_C(s,i);s&&!o&&ke(n.onLeave,[e,s,this],this),this._hoveredItem=i,i&&!o&&ke(n.onHover,[e,i,this],this)}else i&&ke(n.onClick,[e,i,this],this)}}function kC(t,e,n,i,s){const o=SC(i,t,e,n),a=wC(s,i,e.lineHeight);return{itemWidth:o,itemHeight:a}}function SC(t,e,n,i){let s=t.text;return s&&typeof s!="string"&&(s=s.reduce((o,a)=>o.length>a.length?o:a)),e+n.size/2+i.measureText(s).width}function wC(t,e,n){let i=t;return typeof e.text!="string"&&(i=Hu(e,n)),i}function Hu(t,e){const n=t.text?t.text.length:0;return e*n}function EC(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var qu={id:"legend",_element:Wu,start(t,e,n){const i=t.legend=new Wu({ctx:t.ctx,options:n,chart:t});je.configure(t,i,n),je.addBox(t,i)},stop(t){je.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const i=t.legend;je.configure(t,i,n),i.options=n},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,n){const i=e.datasetIndex,s=n.chart;s.isDatasetVisible(i)?(s.hide(i),e.hidden=!0):(s.show(i),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:s,color:o,useBorderRadius:a,borderRadius:l}}=t.legend.options;return t._getSortedDatasetMetas().map(c=>{const d=c.controller.getStyle(n?0:void 0),u=He(d.borderWidth);return{text:e[c.index].label,fillStyle:d.backgroundColor,fontColor:o,hidden:!c.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:d.borderColor,pointStyle:i||d.pointStyle,rotation:d.rotation,textAlign:s||d.textAlign,borderRadius:a&&(l||d.borderRadius),datasetIndex:c.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class Yr extends vt{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,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=e,this.height=this.bottom=n;const s=Oe(i.text)?i.text.length:1;this._padding=He(i.padding);const o=s*Fe(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:n,left:i,bottom:s,right:o,options:a}=this,l=a.align;let c=0,d,u,f;return this.isHorizontal()?(u=We(l,i,o),f=n+e,d=o-i):(a.position==="left"?(u=i+e,f=We(l,s,n),c=Se*-.5):(u=o-e,f=We(l,n,s),c=Se*.5),d=s-n),{titleX:u,titleY:f,maxWidth:d,rotation:c}}draw(){const e=this.ctx,n=this.options;if(!n.display)return;const i=Fe(n.font),o=i.lineHeight/2+this._padding.top,{titleX:a,titleY:l,maxWidth:c,rotation:d}=this._drawArgs(o);En(e,n.text,0,0,i,{color:n.color,maxWidth:c,rotation:d,textAlign:gr(n.align),textBaseline:"middle",translation:[a,l]})}}function CC(t,e){const n=new Yr({ctx:t.ctx,options:e,chart:t});je.configure(t,n,e),je.addBox(t,n),t.titleBlock=n}var Yu={id:"title",_element:Yr,start(t,e,n){CC(t,n)},stop(t){const e=t.titleBlock;je.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const i=t.titleBlock;je.configure(t,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 oo=new WeakMap;var Ku={id:"subtitle",start(t,e,n){const i=new Yr({ctx:t.ctx,options:n,chart:t});je.configure(t,i,n),je.addBox(t,i),oo.set(t,i)},stop(t){je.removeBox(t,oo.get(t)),oo.delete(t)},beforeUpdate(t,e,n){const i=oo.get(t);je.configure(t,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Qi={average(t){if(!t.length)return!1;let e,n,i=new Set,s=0,o=0;for(e=0,n=t.length;e<n;++e){const l=t[e].element;if(l&&l.hasValue()){const c=l.tooltipPosition();i.add(c.x),s+=c.y,++o}}return o===0||i.size===0?!1:{x:[...i].reduce((l,c)=>l+c)/i.size,y:s/o}},nearest(t,e){if(!t.length)return!1;let n=e.x,i=e.y,s=Number.POSITIVE_INFINITY,o,a,l;for(o=0,a=t.length;o<a;++o){const c=t[o].element;if(c&&c.hasValue()){const d=c.getCenterPoint(),u=mr(e,d);u<s&&(s=u,l=c)}}if(l){const c=l.tooltipPosition();n=c.x,i=c.y}return{x:n,y:i}}};function Dt(t,e){return e&&(Oe(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Wt(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
180
+ */class JS{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,n,i,s){const o=n.listeners[s],a=n.duration;o.forEach(l=>l({chart:e,initial:n.initial,numSteps:a,currentStep:Math.min(i-n.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=td.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let n=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const o=i.items;let a=o.length-1,l=!1,c;for(;a>=0;--a)c=o[a],c._active?(c._total>i.duration&&(i.duration=c._total),c.tick(e),l=!0):(o[a]=o[o.length-1],o.pop());l&&(s.draw(),this._notify(s,i,e,"progress")),o.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),n+=o.length}),this._lastDate=e,n===0&&(this._running=!1)}_getAnims(e){const n=this._charts;let i=n.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(e,i)),i}listen(e,n,i){this._getAnims(e).listeners[n].push(i)}add(e,n){!n||!n.length||this._getAnims(e).items.push(...n)}has(e){return this._getAnims(e).items.length>0}start(e){const n=this._charts.get(e);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const n=this._charts.get(e);return!(!n||!n.running||!n.items.length)}stop(e){const n=this._charts.get(e);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(e,n,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Ot=new JS;const Bd="transparent",QS={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const i=ad(t||Bd),s=i.valid&&ad(e||Bd);return s&&s.valid?s.mix(i,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class Pd{constructor(e,n,i,s){const o=n[i];s=Ri([e.to,s,o,e.from]);const a=Ri([e.from,o,s]);this._active=!0,this._fn=e.fn||QS[e.type||typeof a],this._easing=Bi[e.easing]||Bi.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=n,this._prop=i,this._from=a,this._to=s,this._promises=void 0}active(){return this._active}update(e,n,i){if(this._active){this._notify(!1);const s=this._target[this._prop],o=i-this._start,a=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(a,e.duration)),this._total+=o,this._loop=!!e.loop,this._to=Ri([e.to,n,s,e.from]),this._from=Ri([e.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const n=e-this._start,i=this._duration,s=this._prop,o=this._from,a=this._loop,l=this._to;let c;if(this._active=o!==l&&(a||n<i),!this._active){this._target[s]=l,this._notify(!0);return}if(n<0){this._target[s]=o;return}c=n/i%2,c=a&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[s]=this._fn(o,l,c)}wait(){const e=this._promises||(this._promises=[]);return new Promise((n,i)=>{e.push({res:n,rej:i})})}_notify(e){const n=e?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][n]()}}class Nr{constructor(e,n){this._chart=e,this._properties=new Map,this.configure(n)}configure(e){if(!de(e))return;const n=Object.keys(Ee.animation),i=this._properties;Object.getOwnPropertyNames(e).forEach(s=>{const o=e[s];if(!de(o))return;const a={};for(const l of n)a[l]=o[l];(Oe(o.properties)&&o.properties||[s]).forEach(l=>{(l===s||!i.has(l))&&i.set(l,a)})})}_animateOptions(e,n){const i=n.options,s=ew(e,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&ZS(e.options.$animations,i).then(()=>{e.options=i},()=>{}),o}_createAnimations(e,n){const i=this._properties,s=[],o=e.$animations||(e.$animations={}),a=Object.keys(n),l=Date.now();let c;for(c=a.length-1;c>=0;--c){const d=a[c];if(d.charAt(0)==="$")continue;if(d==="options"){s.push(...this._animateOptions(e,n));continue}const u=n[d];let f=o[d];const h=i.get(d);if(f)if(h&&f.active()){f.update(h,u,l);continue}else f.cancel();if(!h||!h.duration){e[d]=u;continue}o[d]=f=new Pd(h,e,d,u),s.push(f)}return s}update(e,n){if(this._properties.size===0){Object.assign(e,n);return}const i=this._createAnimations(e,n);if(i.length)return Ot.add(this._chart,i),!0}}function ZS(t,e){const n=[],i=Object.keys(e);for(let s=0;s<i.length;s++){const o=t[i[s]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function ew(t,e){if(!e)return;let n=t.options;if(!n){t.options=e;return}return n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function Ad(t,e){const n=t&&t.options||{},i=n.reverse,s=n.min===void 0?e:0,o=n.max===void 0?e:0;return{start:i?o:s,end:i?s:o}}function tw(t,e,n){if(n===!1)return!1;const i=Ad(t,n),s=Ad(e,n);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function nw(t){let e,n,i,s;return de(t)?(e=t.top,n=t.right,i=t.bottom,s=t.left):e=n=i=s=t,{top:e,right:n,bottom:i,left:s,disabled:t===!1}}function Md(t,e){const n=[],i=t._getSortedDatasetMetas(e);let s,o;for(s=0,o=i.length;s<o;++s)n.push(i[s].index);return n}function Vd(t,e,n,i={}){const s=t.keys,o=i.mode==="single";let a,l,c,d;if(e===null)return;let u=!1;for(a=0,l=s.length;a<l;++a){if(c=+s[a],c===n){if(u=!0,i.all)continue;break}d=t.values[c],Pe(d)&&(o||e===0||Ct(e)===Ct(d))&&(e+=d)}return!u&&!i.all?0:e}function iw(t,e){const{iScale:n,vScale:i}=e,s=n.axis==="x"?"x":"y",o=i.axis==="x"?"x":"y",a=Object.keys(t),l=new Array(a.length);let c,d,u;for(c=0,d=a.length;c<d;++c)u=a[c],l[c]={[s]:u,[o]:t[u]};return l}function Dr(t,e){const n=t&&t.options.stacked;return n||n===void 0&&e.stack!==void 0}function sw(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}function ow(t){const{min:e,max:n,minDefined:i,maxDefined:s}=t.getUserBounds();return{min:i?e:Number.NEGATIVE_INFINITY,max:s?n:Number.POSITIVE_INFINITY}}function rw(t,e,n){const i=t[e]||(t[e]={});return i[n]||(i[n]={})}function Rd(t,e,n,i){for(const s of e.getMatchingVisibleMetas(i).reverse()){const o=t[s.index];if(n&&o>0||!n&&o<0)return s.index}return null}function Fd(t,e){const{chart:n,_cachedMeta:i}=t,s=n._stacks||(n._stacks={}),{iScale:o,vScale:a,index:l}=i,c=o.axis,d=a.axis,u=sw(o,a,i),f=e.length;let h;for(let m=0;m<f;++m){const p=e[m],{[c]:g,[d]:y}=p,b=p._stacks||(p._stacks={});h=b[d]=rw(s,u,g),h[l]=y,h._top=Rd(h,a,!0,i.type),h._bottom=Rd(h,a,!1,i.type);const x=h._visualValues||(h._visualValues={});x[l]=y}}function Tr(t,e){const n=t.scales;return Object.keys(n).filter(i=>n[i].axis===e).shift()}function aw(t,e){return rn(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function lw(t,e,n){return rn(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}function Fi(t,e){const n=t.controller.index,i=t.vScale&&t.vScale.axis;if(i){e=e||t._parsed;for(const s of e){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 Br=t=>t==="reset"||t==="none",$d=(t,e)=>e?t:Object.assign({},t),cw=(t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:Md(n,!0),values:null};class lt{constructor(e,n){this.chart=e,this._ctx=e.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 e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Dr(e.vScale,e),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(e){this.index!==e&&Fi(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(f,h,m,p)=>f==="x"?h:f==="r"?p:m,o=n.xAxisID=ae(i.xAxisID,Tr(e,"x")),a=n.yAxisID=ae(i.yAxisID,Tr(e,"y")),l=n.rAxisID=ae(i.rAxisID,Tr(e,"r")),c=n.indexAxis,d=n.iAxisID=s(c,o,a,l),u=n.vAxisID=s(c,a,o,l);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(a),n.rScale=this.getScaleForId(l),n.iScale=this.getScaleForId(d),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const n=this._cachedMeta;return e===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&Zc(this._data,this),e._stacked&&Fi(e)}_dataCheck(){const e=this.getDataset(),n=e.data||(e.data=[]),i=this._data;if(de(n)){const s=this._cachedMeta;this._data=iw(n,s)}else if(i!==n){if(i){Zc(i,this);const s=this._cachedMeta;Fi(s),s._parsed=[]}n&&Object.isExtensible(n)&&Xk(n,this),this._syncList=[],this._data=n}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const n=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const o=n._stacked;n._stacked=Dr(n.vScale,n),n.stack!==i.stack&&(s=!0,Fi(n),n.stack=i.stack),this._resyncElements(e),(s||o!==n._stacked)&&(Fd(this,n._parsed),n._stacked=Dr(n.vScale,n))}configure(){const e=this.chart.config,n=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),n,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,n){const{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:a}=i,l=o.axis;let c=e===0&&n===s.length?!0:i._sorted,d=e>0&&i._parsed[e-1],u,f,h;if(this._parsing===!1)i._parsed=s,i._sorted=!0,h=s;else{Oe(s[e])?h=this.parseArrayData(i,s,e,n):de(s[e])?h=this.parseObjectData(i,s,e,n):h=this.parsePrimitiveData(i,s,e,n);const m=()=>f[l]===null||d&&f[l]<d[l];for(u=0;u<n;++u)i._parsed[u+e]=f=h[u],c&&(m()&&(c=!1),d=f);i._sorted=c}a&&Fd(this,h)}parsePrimitiveData(e,n,i,s){const{iScale:o,vScale:a}=e,l=o.axis,c=a.axis,d=o.getLabels(),u=o===a,f=new Array(s);let h,m,p;for(h=0,m=s;h<m;++h)p=h+i,f[h]={[l]:u||o.parse(d[p],p),[c]:a.parse(n[p],p)};return f}parseArrayData(e,n,i,s){const{xScale:o,yScale:a}=e,l=new Array(s);let c,d,u,f;for(c=0,d=s;c<d;++c)u=c+i,f=n[u],l[c]={x:o.parse(f[0],u),y:a.parse(f[1],u)};return l}parseObjectData(e,n,i,s){const{xScale:o,yScale:a}=e,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=new Array(s);let u,f,h,m;for(u=0,f=s;u<f;++u)h=u+i,m=n[h],d[u]={x:o.parse(nn(m,l),h),y:a.parse(nn(m,c),h)};return d}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,n,i){const s=this.chart,o=this._cachedMeta,a=n[e.axis],l={keys:Md(s,!0),values:n._stacks[e.axis]._visualValues};return Vd(l,a,o.index,{mode:i})}updateRangeFromParsed(e,n,i,s){const o=i[n.axis];let a=o===null?NaN:o;const l=s&&i._stacks[n.axis];s&&l&&(s.values=l,a=Vd(s,o,this._cachedMeta.index)),e.min=Math.min(e.min,a),e.max=Math.max(e.max,a)}getMinMax(e,n){const i=this._cachedMeta,s=i._parsed,o=i._sorted&&e===i.iScale,a=s.length,l=this._getOtherScale(e),c=cw(n,i,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=ow(l);let h,m;function p(){m=s[h];const g=m[l.axis];return!Pe(m[e.axis])||u>g||f<g}for(h=0;h<a&&!(!p()&&(this.updateRangeFromParsed(d,e,m,c),o));++h);if(o){for(h=a-1;h>=0;--h)if(!p()){this.updateRangeFromParsed(d,e,m,c);break}}return d}getAllParsedValues(e){const n=this._cachedMeta._parsed,i=[];let s,o,a;for(s=0,o=n.length;s<o;++s)a=n[s][e.axis],Pe(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(e){const n=this._cachedMeta,i=n.iScale,s=n.vScale,o=this.getParsed(e);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(e){const n=this._cachedMeta;this.update(e||"default"),n._clip=nw(ae(this.options.clip,tw(n.xScale,n.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,n=this.chart,i=this._cachedMeta,s=i.data||[],o=n.chartArea,a=[],l=this._drawStart||0,c=this._drawCount||s.length-l,d=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(e,o,l,c),u=l;u<l+c;++u){const f=s[u];f.hidden||(f.active&&d?a.push(f):f.draw(e,o))}for(u=0;u<a.length;++u)a[u].draw(e,o)}getStyle(e,n){const i=n?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(e||0,i)}getContext(e,n,i){const s=this.getDataset();let o;if(e>=0&&e<this._cachedMeta.data.length){const a=this._cachedMeta.data[e];o=a.$context||(a.$context=lw(this.getContext(),e,a)),o.parsed=this.getParsed(e),o.raw=s.data[e],o.index=o.dataIndex=e}else o=this.$context||(this.$context=aw(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=i,o}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,n){return this._resolveElementOptions(this.dataElementType.id,n,e)}_resolveElementOptions(e,n="default",i){const s=n==="active",o=this._cachedDataOpts,a=e+"-"+n,l=o[a],c=this.enableOptionSharing&&Ni(i);if(l)return $d(l,c);const d=this.chart.config,u=d.datasetElementScopeKeys(this._type,e),f=s?[`${e}Hover`,"hover",e,""]:[e,""],h=d.getOptionScopes(this.getDataset(),u),m=Object.keys(Ee.elements[e]),p=()=>this.getContext(i,s,n),g=d.resolveNamedOptions(h,m,p,f);return g.$shared&&(g.$shared=c,o[a]=Object.freeze($d(g,c))),g}_resolveAnimations(e,n,i){const s=this.chart,o=this._cachedDataOpts,a=`animation-${n}`,l=o[a];if(l)return l;let c;if(s.options.animation!==!1){const u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,n),h=u.getOptionScopes(this.getDataset(),f);c=u.createResolver(h,this.getContext(e,i,n))}const d=new Nr(s,c&&c.animations);return c&&c._cacheable&&(o[a]=Object.freeze(d)),d}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,n){return!n||Br(e)||this.chart._animationsDisabled}_getSharedOptions(e,n){const i=this.resolveDataElementOptions(e,n),s=this._sharedOptions,o=this.getSharedOptions(i),a=this.includeOptions(n,o)||o!==s;return this.updateSharedOptions(o,n,i),{sharedOptions:o,includeOptions:a}}updateElement(e,n,i,s){Br(s)?Object.assign(e,i):this._resolveAnimations(n,s).update(e,i)}updateSharedOptions(e,n,i){e&&!Br(n)&&this._resolveAnimations(void 0,n).update(e,i)}_setStyle(e,n,i,s){e.active=s;const o=this.getStyle(n,s);this._resolveAnimations(n,i,s).update(e,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(e,n,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,n,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const n=this._data,i=this._cachedMeta.data;for(const[l,c,d]of this._syncList)this[l](c,d);this._syncList=[];const s=i.length,o=n.length,a=Math.min(o,s);a&&this.parse(0,a),o>s?this._insertElements(s,o-s,e):o<s&&this._removeElements(o,s-o)}_insertElements(e,n,i=!0){const s=this._cachedMeta,o=s.data,a=e+n;let l;const c=d=>{for(d.length+=n,l=d.length-1;l>=a;l--)d[l]=d[l-n]};for(c(o),l=e;l<a;++l)o[l]=new this.dataElementType;this._parsing&&c(s._parsed),this.parse(e,n),i&&this.updateElements(o,e,n,"reset")}updateElements(e,n,i,s){}_removeElements(e,n){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(e,n);i._stacked&&Fi(i,s)}i.data.splice(e,n)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[n,i,s]=e;this[n](i,s)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,n){n&&this._sync(["_removeElements",e,n]);const i=arguments.length-2;i&&this._sync(["_insertElements",e,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}z(lt,"defaults",{}),z(lt,"datasetElementType",null),z(lt,"dataElementType",null);function dw(t,e){if(!t._cache.$bar){const n=t.getMatchingVisibleMetas(e);let i=[];for(let s=0,o=n.length;s<o;s++)i=i.concat(n[s].controller.getAllParsedValues(t));t._cache.$bar=ed(i.sort((s,o)=>s-o))}return t._cache.$bar}function uw(t){const e=t.iScale,n=dw(e,t.type);let i=e._length,s,o,a,l;const c=()=>{a===32767||a===-32768||(Ni(l)&&(i=Math.min(i,Math.abs(a-l)||i)),l=a)};for(s=0,o=n.length;s<o;++s)a=e.getPixelForValue(n[s]),c();for(l=void 0,s=0,o=e.ticks.length;s<o;++s)a=e.getPixelForTick(s),c();return i}function fw(t,e,n,i){const s=n.barThickness;let o,a;return fe(s)?(o=e.min*n.categoryPercentage,a=n.barPercentage):(o=s*i,a=1),{chunk:o/i,ratio:a,start:e.pixels[t]-o/2}}function hw(t,e,n,i){const s=e.pixels,o=s[t];let a=t>0?s[t-1]:null,l=t<s.length-1?s[t+1]:null;const c=n.categoryPercentage;a===null&&(a=o-(l===null?e.end-e.start:l-o)),l===null&&(l=o+o-a);const d=o-(o-Math.min(a,l))/2*c;return{chunk:Math.abs(l-a)/2*c/i,ratio:n.barPercentage,start:d}}function mw(t,e,n,i){const s=n.parse(t[0],i),o=n.parse(t[1],i),a=Math.min(s,o),l=Math.max(s,o);let c=a,d=l;Math.abs(a)>Math.abs(l)&&(c=l,d=a),e[n.axis]=d,e._custom={barStart:c,barEnd:d,start:s,end:o,min:a,max:l}}function Ld(t,e,n,i){return Oe(t)?mw(t,e,n,i):e[n.axis]=n.parse(t,i),e}function Id(t,e,n,i){const s=t.iScale,o=t.vScale,a=s.getLabels(),l=s===o,c=[];let d,u,f,h;for(d=n,u=n+i;d<u;++d)h=e[d],f={},f[s.axis]=l||s.parse(a[d],d),c.push(Ld(h,f,o,d));return c}function Pr(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function pw(t,e,n){return t!==0?Ct(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}function gw(t){let e,n,i,s,o;return t.horizontal?(e=t.base>t.x,n="left",i="right"):(e=t.base<t.y,n="bottom",i="top"),e?(s="end",o="start"):(s="start",o="end"),{start:n,end:i,reverse:e,top:s,bottom:o}}function yw(t,e,n,i){let s=e.borderSkipped;const o={};if(!s){t.borderSkipped=o;return}if(s===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:l,reverse:c,top:d,bottom:u}=gw(t);s==="middle"&&n&&(t.enableBorderRadius=!0,(n._top||0)===i?s=d:(n._bottom||0)===i?s=u:(o[jd(u,a,l,c)]=!0,s=d)),o[jd(s,a,l,c)]=!0,t.borderSkipped=o}function jd(t,e,n,i){return i?(t=bw(t,e,n),t=zd(t,n,e)):t=zd(t,e,n),t}function bw(t,e,n){return t===e?n:t===n?e:t}function zd(t,e,n){return t==="start"?e:t==="end"?n:t}function xw(t,{inflateAmount:e},n){t.inflateAmount=e==="auto"?n===1?.33:0:e}class $i extends lt{parsePrimitiveData(e,n,i,s){return Id(e,n,i,s)}parseArrayData(e,n,i,s){return Id(e,n,i,s)}parseObjectData(e,n,i,s){const{iScale:o,vScale:a}=e,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=o.axis==="x"?l:c,u=a.axis==="x"?l:c,f=[];let h,m,p,g;for(h=i,m=i+s;h<m;++h)g=n[h],p={},p[o.axis]=o.parse(nn(g,d),h),f.push(Ld(nn(g,u),p,a,h));return f}updateRangeFromParsed(e,n,i,s){super.updateRangeFromParsed(e,n,i,s);const o=i._custom;o&&n===this._cachedMeta.vScale&&(e.min=Math.min(e.min,o.min),e.max=Math.max(e.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const n=this._cachedMeta,{iScale:i,vScale:s}=n,o=this.getParsed(e),a=o._custom,l=Pr(a)?"["+a.start+", "+a.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+i.getLabelForValue(o[i.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();const e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,e)}updateElements(e,n,i,s){const o=s==="reset",{index:a,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),d=l.isHorizontal(),u=this._getRuler(),{sharedOptions:f,includeOptions:h}=this._getSharedOptions(n,s);for(let m=n;m<n+i;m++){const p=this.getParsed(m),g=o||fe(p[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(m),y=this._calculateBarIndexPixels(m,u),b=(p._stacks||{})[l.axis],x={horizontal:d,base:g.base,enableBorderRadius:!b||Pr(p._custom)||a===b._top||a===b._bottom,x:d?g.head:y.center,y:d?y.center:g.head,height:d?y.size:Math.abs(g.size),width:d?Math.abs(g.size):y.size};h&&(x.options=f||this.resolveDataElementOptions(m,e[m].active?"active":s));const w=x.options||e[m].options;yw(x,w,b,a),xw(x,w,u.ratio),this.updateElement(e[m],m,x,s)}}_getStacks(e,n){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),o=i.options.stacked,a=[],l=this._cachedMeta.controller.getParsed(n),c=l&&l[i.axis],d=u=>{const f=u._parsed.find(m=>m[i.axis]===c),h=f&&f[u.vScale.axis];if(fe(h)||isNaN(h))return!0};for(const u of s)if(!(n!==void 0&&d(u))&&((o===!1||a.indexOf(u.stack)===-1||o===void 0&&u.stack===void 0)&&a.push(u.stack),u.index===e))break;return a.length||a.push(void 0),a}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,n,i){const s=this._getStacks(e,i),o=n!==void 0?s.indexOf(n):-1;return o===-1?s.length-1:o}_getRuler(){const e=this.options,n=this._cachedMeta,i=n.iScale,s=[];let o,a;for(o=0,a=n.data.length;o<a;++o)s.push(i.getPixelForValue(this.getParsed(o)[i.axis],o));const l=e.barThickness;return{min:l||uw(n),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:e.grouped,ratio:l?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:n,_stacked:i,index:s},options:{base:o,minBarLength:a}}=this,l=o||0,c=this.getParsed(e),d=c._custom,u=Pr(d);let f=c[n.axis],h=0,m=i?this.applyStack(n,c,i):f,p,g;m!==f&&(h=m-f,m=f),u&&(f=d.barStart,m=d.barEnd-d.barStart,f!==0&&Ct(f)!==Ct(d.barEnd)&&(h=0),h+=f);const y=!fe(o)&&!u?o:h;let b=n.getPixelForValue(y);if(this.chart.getDataVisibility(e)?p=n.getPixelForValue(h+m):p=b,g=p-b,Math.abs(g)<a){g=pw(g,n,l)*a,f===l&&(b-=g/2);const x=n.getPixelForDecimal(0),w=n.getPixelForDecimal(1),E=Math.min(x,w),k=Math.max(x,w);b=Math.max(Math.min(b,k),E),p=b+g,i&&!u&&(c._stacks[n.axis]._visualValues[s]=n.getValueForPixel(p)-n.getValueForPixel(b))}if(b===n.getPixelForValue(l)){const x=Ct(g)*n.getLineWidthForValue(l)/2;b+=x,g-=x}return{size:g,base:b,head:p,center:p+g/2}}_calculateBarIndexPixels(e,n){const i=n.scale,s=this.options,o=s.skipNull,a=ae(s.maxBarThickness,1/0);let l,c;if(n.grouped){const d=o?this._getStackCount(e):n.stackCount,u=s.barThickness==="flex"?hw(e,n,s,d):fw(e,n,s,d),f=this._getStackIndex(this.index,this._cachedMeta.stack,o?e:void 0);l=u.start+u.chunk*f+u.chunk/2,c=Math.min(a,u.chunk*u.ratio)}else l=i.getPixelForValue(this.getParsed(e)[i.axis],e),c=Math.min(a,n.min*n.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){const e=this._cachedMeta,n=e.vScale,i=e.data,s=i.length;let o=0;for(;o<s;++o)this.getParsed(o)[n.axis]!==null&&!i[o].hidden&&i[o].draw(this._ctx)}}z($i,"id","bar"),z($i,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),z($i,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Li extends lt{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,n,i,s){const o=super.parsePrimitiveData(e,n,i,s);for(let a=0;a<o.length;a++)o[a]._custom=this.resolveDataElementOptions(a+i).radius;return o}parseArrayData(e,n,i,s){const o=super.parseArrayData(e,n,i,s);for(let a=0;a<o.length;a++){const l=n[i+a];o[a]._custom=ae(l[2],this.resolveDataElementOptions(a+i).radius)}return o}parseObjectData(e,n,i,s){const o=super.parseObjectData(e,n,i,s);for(let a=0;a<o.length;a++){const l=n[i+a];o[a]._custom=ae(l&&l.r&&+l.r,this.resolveDataElementOptions(a+i).radius)}return o}getMaxOverflow(){const e=this._cachedMeta.data;let n=0;for(let i=e.length-1;i>=0;--i)n=Math.max(n,e[i].size(this.resolveDataElementOptions(i))/2);return n>0&&n}getLabelAndValue(e){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=n,a=this.getParsed(e),l=s.getLabelForValue(a.x),c=o.getLabelForValue(a.y),d=a._custom;return{label:i[e]||"",value:"("+l+", "+c+(d?", "+d:"")+")"}}update(e){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,e)}updateElements(e,n,i,s){const o=s==="reset",{iScale:a,vScale:l}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(n,s),u=a.axis,f=l.axis;for(let h=n;h<n+i;h++){const m=e[h],p=!o&&this.getParsed(h),g={},y=g[u]=o?a.getPixelForDecimal(.5):a.getPixelForValue(p[u]),b=g[f]=o?l.getBasePixel():l.getPixelForValue(p[f]);g.skip=isNaN(y)||isNaN(b),d&&(g.options=c||this.resolveDataElementOptions(h,m.active?"active":s),o&&(g.options.radius=0)),this.updateElement(m,h,g,s)}}resolveDataElementOptions(e,n){const i=this.getParsed(e);let s=super.resolveDataElementOptions(e,n);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const o=s.radius;return n!=="active"&&(s.radius=0),s.radius+=ae(i&&i._custom,o),s}}z(Li,"id","bubble"),z(Li,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),z(Li,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function _w(t,e,n){let i=1,s=1,o=0,a=0;if(e<we){const l=t,c=l+e,d=Math.cos(l),u=Math.sin(l),f=Math.cos(c),h=Math.sin(c),m=(w,E,k)=>Ti(w,l,c,!0)?1:Math.max(E,E*n,k,k*n),p=(w,E,k)=>Ti(w,l,c,!0)?-1:Math.min(E,E*n,k,k*n),g=m(0,d,f),y=m(Me,u,h),b=p(Se,d,f),x=p(Se+Me,u,h);i=(g-b)/2,s=(y-x)/2,o=-(g+b)/2,a=-(y+x)/2}return{ratioX:i,ratioY:s,offsetX:o,offsetY:a}}class an extends lt{constructor(e,n){super(e,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,n){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let o=c=>+i[c];if(de(i[e])){const{key:c="value"}=this._parsing;o=d=>+nn(i[d],c)}let a,l;for(a=e,l=e+n;a<l;++a)s._parsed[a]=o(a)}}_getRotation(){return yt(this.options.rotation-90)}_getCircumference(){return yt(this.options.circumference)}_getRotationExtents(){let e=we,n=-we;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(),a=s._getCircumference();e=Math.min(e,o),n=Math.max(n,o+a)}return{rotation:e,circumference:n-e}}update(e){const n=this.chart,{chartArea:i}=n,s=this._cachedMeta,o=s.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,l=Math.max((Math.min(i.width,i.height)-a)/2,0),c=Math.min(Vk(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:h,ratioY:m,offsetX:p,offsetY:g}=_w(f,u,c),y=(i.width-a)/h,b=(i.height-a)/m,x=Math.max(Math.min(y,b)/2,0),w=Uc(this.options.radius,x),E=Math.max(w*c,0),k=(w-E)/this._getVisibleDatasetWeightTotal();this.offsetX=p*w,this.offsetY=g*w,s.total=this.calculateTotal(),this.outerRadius=w-k*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-k*d,0),this.updateElements(o,0,o.length,e)}_circumference(e,n){const i=this.options,s=this._cachedMeta,o=this._getCircumference();return n&&i.animation.animateRotate||!this.chart.getDataVisibility(e)||s._parsed[e]===null||s.data[e].hidden?0:this.calculateCircumference(s._parsed[e]*o/we)}updateElements(e,n,i,s){const o=s==="reset",a=this.chart,l=a.chartArea,d=a.options.animation,u=(l.left+l.right)/2,f=(l.top+l.bottom)/2,h=o&&d.animateScale,m=h?0:this.innerRadius,p=h?0:this.outerRadius,{sharedOptions:g,includeOptions:y}=this._getSharedOptions(n,s);let b=this._getRotation(),x;for(x=0;x<n;++x)b+=this._circumference(x,o);for(x=n;x<n+i;++x){const w=this._circumference(x,o),E=e[x],k={x:u+this.offsetX,y:f+this.offsetY,startAngle:b,endAngle:b+w,circumference:w,outerRadius:p,innerRadius:m};y&&(k.options=g||this.resolveDataElementOptions(x,E.active?"active":s)),b+=w,this.updateElement(E,x,k,s)}}calculateTotal(){const e=this._cachedMeta,n=e.data;let i=0,s;for(s=0;s<n.length;s++){const o=e._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!n[s].hidden&&(i+=Math.abs(o))}return i}calculateCircumference(e){const n=this._cachedMeta.total;return n>0&&!isNaN(e)?we*(Math.abs(e)/n):0}getLabelAndValue(e){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=Pi(n._parsed[e],i.options.locale);return{label:s[e]||"",value:o}}getMaxBorderWidth(e){let n=0;const i=this.chart;let s,o,a,l,c;if(!e){for(s=0,o=i.data.datasets.length;s<o;++s)if(i.isDatasetVisible(s)){a=i.getDatasetMeta(s),e=a.data,l=a.controller;break}}if(!e)return 0;for(s=0,o=e.length;s<o;++s)c=l.resolveDataElementOptions(s),c.borderAlign!=="inner"&&(n=Math.max(n,c.borderWidth||0,c.hoverBorderWidth||0));return n}getMaxOffset(e){let n=0;for(let i=0,s=e.length;i<s;++i){const o=this.resolveDataElementOptions(i);n=Math.max(n,o.offset||0,o.hoverOffset||0)}return n}_getRingWeightOffset(e){let n=0;for(let i=0;i<e;++i)this.chart.isDatasetVisible(i)&&(n+=this._getRingWeight(i));return n}_getRingWeight(e){return Math.max(ae(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}z(an,"id","doughnut"),z(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"}),z(an,"descriptors",{_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")}),z(an,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const n=e.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=e.legend.options;return n.labels.map((o,a)=>{const c=e.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:s,lineWidth:c.borderWidth,pointStyle:i,hidden:!e.getDataVisibility(a),index:a}})}return[]}},onClick(e,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}});class Ii extends lt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const n=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=n,a=this.chart._animationsDisabled;let{start:l,count:c}=id(n,s,a);this._drawStart=l,this._drawCount=c,sd(n)&&(l=0,c=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;const d=this.resolveDatasetElementOptions(e);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:d},e),this.updateElements(s,l,c,e)}updateElements(e,n,i,s){const o=s==="reset",{iScale:a,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(n,s),h=a.axis,m=l.axis,{spanGaps:p,segment:g}=this.options,y=Un(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||s==="none",x=n+i,w=e.length;let E=n>0&&this.getParsed(n-1);for(let k=0;k<w;++k){const C=e[k],S=b?C:{};if(k<n||k>=x){S.skip=!0;continue}const _=this.getParsed(k),O=fe(_[m]),P=S[h]=a.getPixelForValue(_[h],k),v=S[m]=o||O?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,_,c):_[m],k);S.skip=isNaN(P)||isNaN(v)||O,S.stop=k>0&&Math.abs(_[h]-E[h])>y,g&&(S.parsed=_,S.raw=d.data[k]),f&&(S.options=u||this.resolveDataElementOptions(k,C.active?"active":s)),b||this.updateElement(C,k,S,s),E=_}}getMaxOverflow(){const e=this._cachedMeta,n=e.dataset,i=n.options&&n.options.borderWidth||0,s=e.data||[];if(!s.length)return i;const o=s[0].size(this.resolveDataElementOptions(0)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,o,a)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}z(Ii,"id","line"),z(Ii,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),z(Ii,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Yn extends lt{constructor(e,n){super(e,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=Pi(n._parsed[e].r,i.options.locale);return{label:s[e]||"",value:o}}parseObjectData(e,n,i,s){return xd.bind(this)(e,n,i,s)}update(e){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,e)}getMinMax(){const e=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((i,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<n.min&&(n.min=o),o>n.max&&(n.max=o))}),n}_updateRadius(){const e=this.chart,n=e.chartArea,i=e.options,s=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(s/2,0),a=Math.max(i.cutoutPercentage?o/100*i.cutoutPercentage:1,0),l=(o-a)/e.getVisibleDatasetCount();this.outerRadius=o-l*this.index,this.innerRadius=this.outerRadius-l}updateElements(e,n,i,s){const o=s==="reset",a=this.chart,c=a.options.animation,d=this._cachedMeta.rScale,u=d.xCenter,f=d.yCenter,h=d.getIndexAngle(0)-.5*Se;let m=h,p;const g=360/this.countVisibleElements();for(p=0;p<n;++p)m+=this._computeAngle(p,s,g);for(p=n;p<n+i;p++){const y=e[p];let b=m,x=m+this._computeAngle(p,s,g),w=a.getDataVisibility(p)?d.getDistanceFromCenterForValue(this.getParsed(p).r):0;m=x,o&&(c.animateScale&&(w=0),c.animateRotate&&(b=x=h));const E={x:u,y:f,innerRadius:0,outerRadius:w,startAngle:b,endAngle:x,options:this.resolveDataElementOptions(p,y.active?"active":s)};this.updateElement(y,p,E,s)}}countVisibleElements(){const e=this._cachedMeta;let n=0;return e.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(e,n,i){return this.chart.getDataVisibility(e)?yt(this.resolveDataElementOptions(e,n).angle||i):0}}z(Yn,"id","polarArea"),z(Yn,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),z(Yn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const n=e.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=e.legend.options;return n.labels.map((o,a)=>{const c=e.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:s,lineWidth:c.borderWidth,pointStyle:i,hidden:!e.getDataVisibility(a),index:a}})}return[]}},onClick(e,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Xs extends an{}z(Xs,"id","pie"),z(Xs,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class ji extends lt{getLabelAndValue(e){const n=this._cachedMeta.vScale,i=this.getParsed(e);return{label:n.getLabels()[e],value:""+n.getLabelForValue(i[n.axis])}}parseObjectData(e,n,i,s){return xd.bind(this)(e,n,i,s)}update(e){const n=this._cachedMeta,i=n.dataset,s=n.data||[],o=n.iScale.getLabels();if(i.points=s,e!=="resize"){const a=this.resolveDatasetElementOptions(e);this.options.showLine||(a.borderWidth=0);const l={_loop:!0,_fullLoop:o.length===s.length,options:a};this.updateElement(i,void 0,l,e)}this.updateElements(s,0,s.length,e)}updateElements(e,n,i,s){const o=this._cachedMeta.rScale,a=s==="reset";for(let l=n;l<n+i;l++){const c=e[l],d=this.resolveDataElementOptions(l,c.active?"active":s),u=o.getPointPositionForValue(l,this.getParsed(l).r),f=a?o.xCenter:u.x,h=a?o.yCenter:u.y,m={x:f,y:h,angle:u.angle,skip:isNaN(f)||isNaN(h),options:d};this.updateElement(c,l,m,s)}}}z(ji,"id","radar"),z(ji,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),z(ji,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class zi extends lt{getLabelAndValue(e){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=n,a=this.getParsed(e),l=s.getLabelForValue(a.x),c=o.getLabelForValue(a.y);return{label:i[e]||"",value:"("+l+", "+c+")"}}update(e){const n=this._cachedMeta,{data:i=[]}=n,s=this.chart._animationsDisabled;let{start:o,count:a}=id(n,i,s);if(this._drawStart=o,this._drawCount=a,sd(n)&&(o=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:l,_dataset:c}=n;l._chart=this.chart,l._datasetIndex=this.index,l._decimated=!!c._decimated,l.points=i;const d=this.resolveDatasetElementOptions(e);d.segment=this.options.segment,this.updateElement(l,void 0,{animated:!s,options:d},e)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(i,o,a,e)}addElements(){const{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(e,n,i,s){const o=s==="reset",{iScale:a,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,u=this.resolveDataElementOptions(n,s),f=this.getSharedOptions(u),h=this.includeOptions(s,f),m=a.axis,p=l.axis,{spanGaps:g,segment:y}=this.options,b=Un(g)?g:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||s==="none";let w=n>0&&this.getParsed(n-1);for(let E=n;E<n+i;++E){const k=e[E],C=this.getParsed(E),S=x?k:{},_=fe(C[p]),O=S[m]=a.getPixelForValue(C[m],E),P=S[p]=o||_?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,C,c):C[p],E);S.skip=isNaN(O)||isNaN(P)||_,S.stop=E>0&&Math.abs(C[m]-w[m])>b,y&&(S.parsed=C,S.raw=d.data[E]),h&&(S.options=f||this.resolveDataElementOptions(E,k.active?"active":s)),x||this.updateElement(k,E,S,s),w=C}this.updateSharedOptions(f,s,u)}getMaxOverflow(){const e=this._cachedMeta,n=e.data||[];if(!this.options.showLine){let l=0;for(let c=n.length-1;c>=0;--c)l=Math.max(l,n[c].size(this.resolveDataElementOptions(c))/2);return l>0&&l}const i=e.dataset,s=i.options&&i.options.borderWidth||0;if(!n.length)return s;const o=n[0].size(this.resolveDataElementOptions(0)),a=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,a)/2}}z(zi,"id","scatter"),z(zi,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),z(zi,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Ud=Object.freeze({__proto__:null,BarController:$i,BubbleController:Li,DoughnutController:an,LineController:Ii,PieController:Xs,PolarAreaController:Yn,RadarController:ji,ScatterController:zi});function Dn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Ar{constructor(e){z(this,"options");this.options=e||{}}static override(e){Object.assign(Ar.prototype,e)}init(){}formats(){return Dn()}parse(){return Dn()}format(){return Dn()}add(){return Dn()}diff(){return Dn()}startOf(){return Dn()}endOf(){return Dn()}}var Wd={_date:Ar};function kw(t,e,n,i){const{controller:s,data:o,_sorted:a}=t,l=s._cachedMeta.iScale;if(l&&e===l.axis&&e!=="r"&&a&&o.length){const c=l._reversePixels?Yk:jt;if(i){if(s._sharedOptions){const d=o[0],u=typeof d.getRange=="function"&&d.getRange(e);if(u){const f=c(o,e,n-u),h=c(o,e,n+u);return{lo:f.lo,hi:h.hi}}}}else return c(o,e,n)}return{lo:0,hi:o.length-1}}function Ui(t,e,n,i,s){const o=t.getSortedVisibleDatasetMetas(),a=n[e];for(let l=0,c=o.length;l<c;++l){const{index:d,data:u}=o[l],{lo:f,hi:h}=kw(o[l],e,a,s);for(let m=f;m<=h;++m){const p=u[m];p.skip||i(p,d,m)}}}function Sw(t){const e=t.indexOf("x")!==-1,n=t.indexOf("y")!==-1;return function(i,s){const o=e?Math.abs(i.x-s.x):0,a=n?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function Mr(t,e,n,i,s){const o=[];return!s&&!t.isPointInArea(e)||Ui(t,n,e,function(l,c,d){!s&&!zt(l,t.chartArea,0)||l.inRange(e.x,e.y,i)&&o.push({element:l,datasetIndex:c,index:d})},!0),o}function ww(t,e,n,i){let s=[];function o(a,l,c){const{startAngle:d,endAngle:u}=a.getProps(["startAngle","endAngle"],i),{angle:f}=Jc(a,{x:e.x,y:e.y});Ti(f,d,u)&&s.push({element:a,datasetIndex:l,index:c})}return Ui(t,n,e,o),s}function Ew(t,e,n,i,s,o){let a=[];const l=Sw(n);let c=Number.POSITIVE_INFINITY;function d(u,f,h){const m=u.inRange(e.x,e.y,s);if(i&&!m)return;const p=u.getCenterPoint(s);if(!(!!o||t.isPointInArea(p))&&!m)return;const y=l(e,p);y<c?(a=[{element:u,datasetIndex:f,index:h}],c=y):y===c&&a.push({element:u,datasetIndex:f,index:h})}return Ui(t,n,e,d),a}function Vr(t,e,n,i,s,o){return!o&&!t.isPointInArea(e)?[]:n==="r"&&!i?ww(t,e,n,s):Ew(t,e,n,i,s,o)}function Hd(t,e,n,i,s){const o=[],a=n==="x"?"inXRange":"inYRange";let l=!1;return Ui(t,n,e,(c,d,u)=>{c[a]&&c[a](e[n],s)&&(o.push({element:c,datasetIndex:d,index:u}),l=l||c.inRange(e.x,e.y,s))}),i&&!l?[]:o}var qd={evaluateInteractionItems:Ui,modes:{index(t,e,n,i){const s=vn(e,t),o=n.axis||"x",a=n.includeInvisible||!1,l=n.intersect?Mr(t,s,o,i,a):Vr(t,s,o,!1,i,a),c=[];return l.length?(t.getSortedVisibleDatasetMetas().forEach(d=>{const u=l[0].index,f=d.data[u];f&&!f.skip&&c.push({element:f,datasetIndex:d.index,index:u})}),c):[]},dataset(t,e,n,i){const s=vn(e,t),o=n.axis||"xy",a=n.includeInvisible||!1;let l=n.intersect?Mr(t,s,o,i,a):Vr(t,s,o,!1,i,a);if(l.length>0){const c=l[0].datasetIndex,d=t.getDatasetMeta(c).data;l=[];for(let u=0;u<d.length;++u)l.push({element:d[u],datasetIndex:c,index:u})}return l},point(t,e,n,i){const s=vn(e,t),o=n.axis||"xy",a=n.includeInvisible||!1;return Mr(t,s,o,i,a)},nearest(t,e,n,i){const s=vn(e,t),o=n.axis||"xy",a=n.includeInvisible||!1;return Vr(t,s,o,n.intersect,i,a)},x(t,e,n,i){const s=vn(e,t);return Hd(t,s,"x",n.intersect,i)},y(t,e,n,i){const s=vn(e,t);return Hd(t,s,"y",n.intersect,i)}}};const Yd=["left","top","right","bottom"];function Wi(t,e){return t.filter(n=>n.pos===e)}function Kd(t,e){return t.filter(n=>Yd.indexOf(n.pos)===-1&&n.box.axis===e)}function Hi(t,e){return t.sort((n,i)=>{const s=e?i:n,o=e?n:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function Cw(t){const e=[];let n,i,s,o,a,l;for(n=0,i=(t||[]).length;n<i;++n)s=t[n],{position:o,options:{stack:a,stackWeight:l=1}}=s,e.push({index:n,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:a&&o+a,stackWeight:l});return e}function Ow(t){const e={};for(const n of t){const{stack:i,pos:s,stackWeight:o}=n;if(!i||!Yd.includes(s))continue;const a=e[i]||(e[i]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return e}function vw(t,e){const n=Ow(t),{vBoxMaxWidth:i,hBoxMaxHeight:s}=e;let o,a,l;for(o=0,a=t.length;o<a;++o){l=t[o];const{fullSize:c}=l.box,d=n[l.stack],u=d&&l.stackWeight/d.weight;l.horizontal?(l.width=u?u*i:c&&e.availableWidth,l.height=s):(l.width=i,l.height=u?u*s:c&&e.availableHeight)}return n}function Nw(t){const e=Cw(t),n=Hi(e.filter(d=>d.box.fullSize),!0),i=Hi(Wi(e,"left"),!0),s=Hi(Wi(e,"right")),o=Hi(Wi(e,"top"),!0),a=Hi(Wi(e,"bottom")),l=Kd(e,"x"),c=Kd(e,"y");return{fullSize:n,leftAndTop:i.concat(o),rightAndBottom:s.concat(c).concat(a).concat(l),chartArea:Wi(e,"chartArea"),vertical:i.concat(s).concat(c),horizontal:o.concat(a).concat(l)}}function Xd(t,e,n,i){return Math.max(t[n],e[n])+Math.max(t[i],e[i])}function Gd(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function Dw(t,e,n,i){const{pos:s,box:o}=n,a=t.maxPadding;if(!de(s)){n.size&&(t[s]-=n.size);const f=i[n.stack]||{size:0,count:1};f.size=Math.max(f.size,n.horizontal?o.height:o.width),n.size=f.size/f.count,t[s]+=n.size}o.getPadding&&Gd(a,o.getPadding());const l=Math.max(0,e.outerWidth-Xd(a,t,"left","right")),c=Math.max(0,e.outerHeight-Xd(a,t,"top","bottom")),d=l!==t.w,u=c!==t.h;return t.w=l,t.h=c,n.horizontal?{same:d,other:u}:{same:u,other:d}}function Tw(t){const e=t.maxPadding;function n(i){const s=Math.max(e[i]-t[i],0);return t[i]+=s,s}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}function Bw(t,e){const n=e.maxPadding;function i(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(a=>{o[a]=Math.max(e[a],n[a])}),o}return i(t?["left","right"]:["top","bottom"])}function qi(t,e,n,i){const s=[];let o,a,l,c,d,u;for(o=0,a=t.length,d=0;o<a;++o){l=t[o],c=l.box,c.update(l.width||e.w,l.height||e.h,Bw(l.horizontal,e));const{same:f,other:h}=Dw(e,n,l,i);d|=f&&s.length,u=u||h,c.fullSize||s.push(l)}return d&&qi(s,e,n,i)||u}function Gs(t,e,n,i,s){t.top=n,t.left=e,t.right=e+i,t.bottom=n+s,t.width=i,t.height=s}function Jd(t,e,n,i){const s=n.padding;let{x:o,y:a}=e;for(const l of t){const c=l.box,d=i[l.stack]||{count:1,placed:0,weight:1},u=l.stackWeight/d.weight||1;if(l.horizontal){const f=e.w*u,h=d.size||c.height;Ni(d.start)&&(a=d.start),c.fullSize?Gs(c,s.left,a,n.outerWidth-s.right-s.left,h):Gs(c,e.left+d.placed,a,f,h),d.start=a,d.placed+=f,a=c.bottom}else{const f=e.h*u,h=d.size||c.width;Ni(d.start)&&(o=d.start),c.fullSize?Gs(c,o,s.top,h,n.outerHeight-s.bottom-s.top):Gs(c,o,e.top+d.placed,h,f),d.start=o,d.placed+=f,o=c.right}}e.x=o,e.y=a}var je={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(n){e.draw(n)}}]},t.boxes.push(e)},removeBox(t,e){const n=t.boxes?t.boxes.indexOf(e):-1;n!==-1&&t.boxes.splice(n,1)},configure(t,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},update(t,e,n,i){if(!t)return;const s=He(t.options.layout.padding),o=Math.max(e-s.width,0),a=Math.max(n-s.height,0),l=Nw(t.boxes),c=l.vertical,d=l.horizontal;be(t.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const u=c.reduce((g,y)=>y.box.options&&y.box.options.display===!1?g:g+1,0)||1,f=Object.freeze({outerWidth:e,outerHeight:n,padding:s,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/u,hBoxMaxHeight:a/2}),h=Object.assign({},s);Gd(h,He(i));const m=Object.assign({maxPadding:h,w:o,h:a,x:s.left,y:s.top},s),p=vw(c.concat(d),f);qi(l.fullSize,m,f,p),qi(c,m,f,p),qi(d,m,f,p)&&qi(c,m,f,p),Tw(m),Jd(l.leftAndTop,m,f,p),m.x+=m.w,m.y+=m.h,Jd(l.rightAndBottom,m,f,p),t.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},be(l.chartArea,g=>{const y=g.box;Object.assign(y,t.chartArea),y.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Rr{acquireContext(e,n){}releaseContext(e){return!1}addEventListener(e,n,i){}removeEventListener(e,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,n,i,s){return n=Math.max(0,n||e.width),i=i||e.height,{width:n,height:Math.max(0,s?Math.floor(n/s):i)}}isAttached(e){return!0}updateConfig(e){}}class Qd extends Rr{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const Js="$chartjs",Pw={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Zd=t=>t===null||t==="";function Aw(t,e){const n=t.style,i=t.getAttribute("height"),s=t.getAttribute("width");if(t[Js]={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",Zd(s)){const o=Sd(t,"width");o!==void 0&&(t.width=o)}if(Zd(i))if(t.style.height==="")t.height=t.width/(e||2);else{const o=Sd(t,"height");o!==void 0&&(t.height=o)}return t}const eu=IS?{passive:!0}:!1;function Mw(t,e,n){t&&t.addEventListener(e,n,eu)}function Vw(t,e,n){t&&t.canvas&&t.canvas.removeEventListener(e,n,eu)}function Rw(t,e){const n=Pw[t.type]||t.type,{x:i,y:s}=vn(t,e);return{type:n,chart:e,native:t,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Qs(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function Fw(t,e,n){const i=t.canvas,s=new MutationObserver(o=>{let a=!1;for(const l of o)a=a||Qs(l.addedNodes,i),a=a&&!Qs(l.removedNodes,i);a&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function $w(t,e,n){const i=t.canvas,s=new MutationObserver(o=>{let a=!1;for(const l of o)a=a||Qs(l.removedNodes,i),a=a&&!Qs(l.addedNodes,i);a&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const Yi=new Map;let tu=0;function nu(){const t=window.devicePixelRatio;t!==tu&&(tu=t,Yi.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function Lw(t,e){Yi.size||window.addEventListener("resize",nu),Yi.set(t,e)}function Iw(t){Yi.delete(t),Yi.size||window.removeEventListener("resize",nu)}function jw(t,e,n){const i=t.canvas,s=i&&vr(i);if(!s)return;const o=nd((l,c)=>{const d=s.clientWidth;n(l,c),d<s.clientWidth&&n()},window),a=new ResizeObserver(l=>{const c=l[0],d=c.contentRect.width,u=c.contentRect.height;d===0&&u===0||o(d,u)});return a.observe(s),Lw(t,o),a}function Fr(t,e,n){n&&n.disconnect(),e==="resize"&&Iw(t)}function zw(t,e,n){const i=t.canvas,s=nd(o=>{t.ctx!==null&&n(Rw(o,t))},t);return Mw(i,e,s),s}class iu extends Rr{acquireContext(e,n){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(Aw(e,n),i):null}releaseContext(e){const n=e.canvas;if(!n[Js])return!1;const i=n[Js].initial;["height","width"].forEach(o=>{const a=i[o];fe(a)?n.removeAttribute(o):n.setAttribute(o,a)});const s=i.style||{};return Object.keys(s).forEach(o=>{n.style[o]=s[o]}),n.width=n.width,delete n[Js],!0}addEventListener(e,n,i){this.removeEventListener(e,n);const s=e.$proxies||(e.$proxies={}),a={attach:Fw,detach:$w,resize:jw}[n]||zw;s[n]=a(e,n,i)}removeEventListener(e,n){const i=e.$proxies||(e.$proxies={}),s=i[n];if(!s)return;({attach:Fr,detach:Fr,resize:Fr}[n]||Vw)(e,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,i,s){return LS(e,n,i,s)}isAttached(e){const n=e&&vr(e);return!!(n&&n.isConnected)}}function su(t){return!Or()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?Qd:iu}let vt=(po=class{constructor(){z(this,"x");z(this,"y");z(this,"active",!1);z(this,"options");z(this,"$animations")}tooltipPosition(e){const{x:n,y:i}=this.getProps(["x","y"],e);return{x:n,y:i}}hasValue(){return Un(this.x)&&Un(this.y)}getProps(e,n){const i=this.$animations;if(!n||!i)return this;const s={};return e.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}},z(po,"defaults",{}),z(po,"defaultRoutes"),po);function Uw(t,e){const n=t.options.ticks,i=Ww(t),s=Math.min(n.maxTicksLimit||i,i),o=n.major.enabled?qw(e):[],a=o.length,l=o[0],c=o[a-1],d=[];if(a>s)return Yw(e,d,o,a/s),d;const u=Hw(o,e,s);if(a>0){let f,h;const m=a>1?Math.round((c-l)/(a-1)):null;for(Zs(e,d,u,fe(m)?0:l-m,l),f=0,h=a-1;f<h;f++)Zs(e,d,u,o[f],o[f+1]);return Zs(e,d,u,c,fe(m)?e.length:c+m),d}return Zs(e,d,u),d}function Ww(t){const e=t.options.offset,n=t._tickSize(),i=t._length/n+(e?0:1),s=t._maxLength/n;return Math.floor(Math.min(i,s))}function Hw(t,e,n){const i=Kw(t),s=e.length/n;if(!i)return Math.max(s,1);const o=Uk(i);for(let a=0,l=o.length-1;a<l;a++){const c=o[a];if(c>s)return c}return Math.max(s,1)}function qw(t){const e=[];let n,i;for(n=0,i=t.length;n<i;n++)t[n].major&&e.push(n);return e}function Yw(t,e,n,i){let s=0,o=n[0],a;for(i=Math.ceil(i),a=0;a<t.length;a++)a===o&&(e.push(t[a]),s++,o=n[s*i])}function Zs(t,e,n,i,s){const o=ae(i,0),a=Math.min(ae(s,t.length),t.length);let l=0,c,d,u;for(n=Math.ceil(n),s&&(c=s-i,n=c/Math.floor(c/n)),u=o;u<0;)l++,u=Math.round(o+l*n);for(d=Math.max(o,0);d<a;d++)d===u&&(e.push(t[d]),l++,u=Math.round(o+l*n))}function Kw(t){const e=t.length;let n,i;if(e<2)return!1;for(i=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==i)return!1;return i}const Xw=t=>t==="left"?"right":t==="right"?"left":t,ou=(t,e,n)=>e==="top"||e==="left"?t[e]+n:t[e]-n,ru=(t,e)=>Math.min(e||t,t);function au(t,e){const n=[],i=t.length/e,s=t.length;let o=0;for(;o<s;o+=i)n.push(t[Math.floor(o)]);return n}function Gw(t,e,n){const i=t.ticks.length,s=Math.min(e,i-1),o=t._startPixel,a=t._endPixel,l=1e-6;let c=t.getPixelForTick(s),d;if(!(n&&(i===1?d=Math.max(c-o,a-c):e===0?d=(t.getPixelForTick(1)-c)/2:d=(c-t.getPixelForTick(s-1))/2,c+=s<e?d:-d,c<o-l||c>a+l)))return c}function Jw(t,e){be(t,n=>{const i=n.gc,s=i.length/2;let o;if(s>e){for(o=0;o<s;++o)delete n.data[i[o]];i.splice(0,s)}})}function Ki(t){return t.drawTicks?t.tickLength:0}function lu(t,e){if(!t.display)return 0;const n=Fe(t.font,e),i=He(t.padding);return(Oe(t.text)?t.text.length:1)*n.lineHeight+i.height}function Qw(t,e){return rn(t,{scale:e,type:"scale"})}function Zw(t,e,n){return rn(t,{tick:n,index:e,type:"tick"})}function eE(t,e,n){let i=gr(t);return(n&&e!=="right"||!n&&e==="right")&&(i=Xw(i)),i}function tE(t,e,n,i){const{top:s,left:o,bottom:a,right:l,chart:c}=t,{chartArea:d,scales:u}=c;let f=0,h,m,p;const g=a-s,y=l-o;if(t.isHorizontal()){if(m=We(i,o,l),de(n)){const b=Object.keys(n)[0],x=n[b];p=u[b].getPixelForValue(x)+g-e}else n==="center"?p=(d.bottom+d.top)/2+g-e:p=ou(t,n,e);h=l-o}else{if(de(n)){const b=Object.keys(n)[0],x=n[b];m=u[b].getPixelForValue(x)-y+e}else n==="center"?m=(d.left+d.right)/2-y+e:m=ou(t,n,e);p=We(i,a,s),f=n==="left"?-Me:Me}return{titleX:m,titleY:p,maxWidth:h,rotation:f}}class ln extends vt{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.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(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,n){return e}getUserBounds(){let{_userMin:e,_userMax:n,_suggestedMin:i,_suggestedMax:s}=this;return e=nt(e,Number.POSITIVE_INFINITY),n=nt(n,Number.NEGATIVE_INFINITY),i=nt(i,Number.POSITIVE_INFINITY),s=nt(s,Number.NEGATIVE_INFINITY),{min:nt(e,i),max:nt(n,s),minDefined:Pe(e),maxDefined:Pe(n)}}getMinMax(e){let{min:n,max:i,minDefined:s,maxDefined:o}=this.getUserBounds(),a;if(s&&o)return{min:n,max:i};const l=this.getMatchingVisibleMetas();for(let c=0,d=l.length;c<d;++c)a=l[c].controller.getMinMax(this,e),s||(n=Math.min(n,a.min)),o||(i=Math.max(i,a.max));return n=o&&n>i?i:n,i=s&&n>i?n:i,{min:nt(n,nt(i,n)),max:nt(i,nt(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){ke(this.options.beforeUpdate,[this])}update(e,n,i){const{beginAtZero:s,grace:o,ticks:a}=this.options,l=a.sampleSize;this.beforeUpdate(),this.maxWidth=e,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=yS(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=l<this.ticks.length;this._convertTicksToLabels(c?au(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=Uw(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,n,i;this.isHorizontal()?(n=this.left,i=this.right):(n=this.top,i=this.bottom,e=!e),this._startPixel=n,this._endPixel=i,this._reversePixels=e,this._length=i-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){ke(this.options.afterUpdate,[this])}beforeSetDimensions(){ke(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(){ke(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),ke(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){ke(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const n=this.options.ticks;let i,s,o;for(i=0,s=e.length;i<s;i++)o=e[i],o.label=ke(n.callback,[o.value,i,e],this)}afterTickToLabelConversion(){ke(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){ke(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,n=e.ticks,i=ru(this.ticks.length,e.ticks.maxTicksLimit),s=n.minRotation||0,o=n.maxRotation;let a=s,l,c,d;if(!this._isVisible()||!n.display||s>=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),f=u.widest.width,h=u.highest.height,m=Le(this.chart.width-f,0,this.maxWidth);l=e.offset?this.maxWidth/i:m/(i-1),f+6>l&&(l=m/(i-(e.offset?.5:1)),c=this.maxHeight-Ki(e.grid)-n.padding-lu(e.title,this.chart.options.font),d=Math.sqrt(f*f+h*h),a=hr(Math.min(Math.asin(Le((u.highest.height+6)/l,-1,1)),Math.asin(Le(c/d,-1,1))-Math.asin(Le(h/d,-1,1)))),a=Math.max(s,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){ke(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ke(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:o}}=this,a=this._isVisible(),l=this.isHorizontal();if(a){const c=lu(s,n.options.font);if(l?(e.width=this.maxWidth,e.height=Ki(o)+c):(e.height=this.maxHeight,e.width=Ki(o)+c),i.display&&this.ticks.length){const{first:d,last:u,widest:f,highest:h}=this._getLabelSizes(),m=i.padding*2,p=yt(this.labelRotation),g=Math.cos(p),y=Math.sin(p);if(l){const b=i.mirror?0:y*f.width+g*h.height;e.height=Math.min(this.maxHeight,e.height+b+m)}else{const b=i.mirror?0:g*f.width+y*h.height;e.width=Math.min(this.maxWidth,e.width+b+m)}this._calculatePadding(d,u,y,g)}}this._handleMargins(),l?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,n,i,s){const{ticks:{align:o,padding:a},position:l}=this.options,c=this.labelRotation!==0,d=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,m=0;c?d?(h=s*e.width,m=i*n.height):(h=i*e.height,m=s*n.width):o==="start"?m=n.width:o==="end"?h=e.width:o!=="inner"&&(h=e.width/2,m=n.width/2),this.paddingLeft=Math.max((h-u+a)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-f+a)*this.width/(this.width-f),0)}else{let u=n.height/2,f=e.height/2;o==="start"?(u=0,f=e.height):o==="end"&&(u=n.height,f=0),this.paddingTop=u+a,this.paddingBottom=f+a}}_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(){ke(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:n}=this.options;return n==="top"||n==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let n,i;for(n=0,i=e.length;n<i;n++)fe(e[n].label)&&(e.splice(n,1),i--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const n=this.options.ticks.sampleSize;let i=this.ticks;n<i.length&&(i=au(i,n)),this._labelSizes=e=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,n,i){const{ctx:s,_longestTextCache:o}=this,a=[],l=[],c=Math.floor(n/ru(n,i));let d=0,u=0,f,h,m,p,g,y,b,x,w,E,k;for(f=0;f<n;f+=c){if(p=e[f].label,g=this._resolveTickFontOptions(f),s.font=y=g.string,b=o[y]=o[y]||{data:{},gc:[]},x=g.lineHeight,w=E=0,!fe(p)&&!Oe(p))w=zs(s,b.data,b.gc,w,p),E=x;else if(Oe(p))for(h=0,m=p.length;h<m;++h)k=p[h],!fe(k)&&!Oe(k)&&(w=zs(s,b.data,b.gc,w,k),E+=x);a.push(w),l.push(E),d=Math.max(w,d),u=Math.max(E,u)}Jw(o,n);const C=a.indexOf(d),S=l.indexOf(u),_=O=>({width:a[O]||0,height:l[O]||0});return{first:_(0),last:_(n-1),widest:_(C),highest:_(S),widths:a,heights:l}}getLabelForValue(e){return e}getPixelForValue(e,n){return NaN}getValueForPixel(e){}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const n=this._startPixel+e*this._length;return qk(this._alignToPixels?wn(this.chart,n,0):n)}getDecimalForPixel(e){const n=(e-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:n}=this;return e<0&&n<0?n:e>0&&n>0?e:0}getContext(e){const n=this.ticks||[];if(e>=0&&e<n.length){const i=n[e];return i.$context||(i.$context=Zw(this.getContext(),e,i))}return this.$context||(this.$context=Qw(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,n=yt(this.labelRotation),i=Math.abs(Math.cos(n)),s=Math.abs(Math.sin(n)),o=this._getLabelSizes(),a=e.autoSkipPadding||0,l=o?o.widest.width+a:0,c=o?o.highest.height+a:0;return this.isHorizontal()?c*i>l*s?l/i:c/s:c*s<l*i?c/i:l/s}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const n=this.axis,i=this.chart,s=this.options,{grid:o,position:a,border:l}=s,c=o.offset,d=this.isHorizontal(),f=this.ticks.length+(c?1:0),h=Ki(o),m=[],p=l.setContext(this.getContext()),g=p.display?p.width:0,y=g/2,b=function(L){return wn(i,L,g)};let x,w,E,k,C,S,_,O,P,v,T,R;if(a==="top")x=b(this.bottom),S=this.bottom-h,O=x-y,v=b(e.top)+y,R=e.bottom;else if(a==="bottom")x=b(this.top),v=e.top,R=b(e.bottom)-y,S=x+y,O=this.top+h;else if(a==="left")x=b(this.right),C=this.right-h,_=x-y,P=b(e.left)+y,T=e.right;else if(a==="right")x=b(this.left),P=e.left,T=b(e.right)-y,C=x+y,_=this.left+h;else if(n==="x"){if(a==="center")x=b((e.top+e.bottom)/2+.5);else if(de(a)){const L=Object.keys(a)[0],j=a[L];x=b(this.chart.scales[L].getPixelForValue(j))}v=e.top,R=e.bottom,S=x+y,O=S+h}else if(n==="y"){if(a==="center")x=b((e.left+e.right)/2);else if(de(a)){const L=Object.keys(a)[0],j=a[L];x=b(this.chart.scales[L].getPixelForValue(j))}C=x-y,_=C-h,P=e.left,T=e.right}const U=ae(s.ticks.maxTicksLimit,f),Y=Math.max(1,Math.ceil(f/U));for(w=0;w<f;w+=Y){const L=this.getContext(w),j=o.setContext(L),$=l.setContext(L),A=j.lineWidth,I=j.color,Q=$.dash||[],ne=$.dashOffset,se=j.tickWidth,K=j.tickColor,J=j.tickBorderDash||[],oe=j.tickBorderDashOffset;E=Gw(this,w,c),E!==void 0&&(k=wn(i,E,A),d?C=_=P=T=k:S=O=v=R=k,m.push({tx1:C,ty1:S,tx2:_,ty2:O,x1:P,y1:v,x2:T,y2:R,width:A,color:I,borderDash:Q,borderDashOffset:ne,tickWidth:se,tickColor:K,tickBorderDash:J,tickBorderDashOffset:oe}))}return this._ticksLength=f,this._borderValue=x,m}_computeLabelItems(e){const n=this.axis,i=this.options,{position:s,ticks:o}=i,a=this.isHorizontal(),l=this.ticks,{align:c,crossAlign:d,padding:u,mirror:f}=o,h=Ki(i.grid),m=h+u,p=f?-u:m,g=-yt(this.labelRotation),y=[];let b,x,w,E,k,C,S,_,O,P,v,T,R="middle";if(s==="top")C=this.bottom-p,S=this._getXAxisLabelAlignment();else if(s==="bottom")C=this.top+p,S=this._getXAxisLabelAlignment();else if(s==="left"){const Y=this._getYAxisLabelAlignment(h);S=Y.textAlign,k=Y.x}else if(s==="right"){const Y=this._getYAxisLabelAlignment(h);S=Y.textAlign,k=Y.x}else if(n==="x"){if(s==="center")C=(e.top+e.bottom)/2+m;else if(de(s)){const Y=Object.keys(s)[0],L=s[Y];C=this.chart.scales[Y].getPixelForValue(L)+m}S=this._getXAxisLabelAlignment()}else if(n==="y"){if(s==="center")k=(e.left+e.right)/2-m;else if(de(s)){const Y=Object.keys(s)[0],L=s[Y];k=this.chart.scales[Y].getPixelForValue(L)}S=this._getYAxisLabelAlignment(h).textAlign}n==="y"&&(c==="start"?R="top":c==="end"&&(R="bottom"));const U=this._getLabelSizes();for(b=0,x=l.length;b<x;++b){w=l[b],E=w.label;const Y=o.setContext(this.getContext(b));_=this.getPixelForTick(b)+o.labelOffset,O=this._resolveTickFontOptions(b),P=O.lineHeight,v=Oe(E)?E.length:1;const L=v/2,j=Y.color,$=Y.textStrokeColor,A=Y.textStrokeWidth;let I=S;a?(k=_,S==="inner"&&(b===x-1?I=this.options.reverse?"left":"right":b===0?I=this.options.reverse?"right":"left":I="center"),s==="top"?d==="near"||g!==0?T=-v*P+P/2:d==="center"?T=-U.highest.height/2-L*P+P:T=-U.highest.height+P/2:d==="near"||g!==0?T=P/2:d==="center"?T=U.highest.height/2-L*P:T=U.highest.height-v*P,f&&(T*=-1),g!==0&&!Y.showLabelBackdrop&&(k+=P/2*Math.sin(g))):(C=_,T=(1-v)*P/2);let Q;if(Y.showLabelBackdrop){const ne=He(Y.backdropPadding),se=U.heights[b],K=U.widths[b];let J=T-ne.top,oe=0-ne.left;switch(R){case"middle":J-=se/2;break;case"bottom":J-=se;break}switch(S){case"center":oe-=K/2;break;case"right":oe-=K;break;case"inner":b===x-1?oe-=K:b>0&&(oe-=K/2);break}Q={left:oe,top:J,width:K+ne.width,height:se+ne.height,color:Y.backdropColor}}y.push({label:E,font:O,textOffset:T,options:{rotation:g,color:j,strokeColor:$,strokeWidth:A,textAlign:I,textBaseline:R,translation:[k,C],backdrop:Q}})}return y}_getXAxisLabelAlignment(){const{position:e,ticks:n}=this.options;if(-yt(this.labelRotation))return e==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(e){const{position:n,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,a=this._getLabelSizes(),l=e+o,c=a.widest.width;let d,u;return n==="left"?s?(u=this.right+o,i==="near"?d="left":i==="center"?(d="center",u+=c/2):(d="right",u+=c)):(u=this.right-l,i==="near"?d="right":i==="center"?(d="center",u-=c/2):(d="left",u=this.left)):n==="right"?s?(u=this.left+o,i==="near"?d="right":i==="center"?(d="center",u-=c/2):(d="left",u-=c)):(u=this.left+l,i==="near"?d="left":i==="center"?(d="center",u+=c/2):(d="right",u=this.right)):d="right",{textAlign:d,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:n},left:i,top:s,width:o,height:a}=this;n&&(e.save(),e.fillStyle=n,e.fillRect(i,s,o,a),e.restore())}getLineWidthForValue(e){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(o=>o.value===e);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(e){const n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let o,a;const l=(c,d,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(c.x,c.y),i.lineTo(d.x,d.y),i.stroke(),i.restore())};if(n.display)for(o=0,a=s.length;o<a;++o){const c=s[o];n.drawOnChartArea&&l({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),n.drawTicks&&l({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:n,options:{border:i,grid:s}}=this,o=i.setContext(this.getContext()),a=i.display?o.width:0;if(!a)return;const l=s.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let d,u,f,h;this.isHorizontal()?(d=wn(e,this.left,a)-a/2,u=wn(e,this.right,l)+l/2,f=h=c):(f=wn(e,this.top,a)-a/2,h=wn(e,this.bottom,l)+l/2,d=u=c),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(d,f),n.lineTo(u,h),n.stroke(),n.restore()}drawLabels(e){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&Us(i,s);const o=this.getLabelItems(e);for(const a of o){const l=a.options,c=a.font,d=a.label,u=a.textOffset;En(i,d,0,u,c,l)}s&&Ws(i)}drawTitle(){const{ctx:e,options:{position:n,title:i,reverse:s}}=this;if(!i.display)return;const o=Fe(i.font),a=He(i.padding),l=i.align;let c=o.lineHeight/2;n==="bottom"||n==="center"||de(n)?(c+=a.bottom,Oe(i.text)&&(c+=o.lineHeight*(i.text.length-1))):c+=a.top;const{titleX:d,titleY:u,maxWidth:f,rotation:h}=tE(this,c,n,l);En(e,i.text,0,0,o,{color:i.color,maxWidth:f,rotation:h,textAlign:eE(l,n,s),textBaseline:"middle",translation:[d,u]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,n=e.ticks&&e.ticks.z||0,i=ae(e.grid&&e.grid.z,-1),s=ae(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==ln.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(e){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let o,a;for(o=0,a=n.length;o<a;++o){const l=n[o];l[i]===this.id&&(!e||l.type===e)&&s.push(l)}return s}_resolveTickFontOptions(e){const n=this.options.ticks.setContext(this.getContext(e));return Fe(n.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class eo{constructor(e,n,i){this.type=e,this.scope=n,this.override=i,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const n=Object.getPrototypeOf(e);let i;sE(n)&&(i=this.register(n));const s=this.items,o=e.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+e);return o in s||(s[o]=e,nE(e,a,i),this.override&&Ee.override(e.id,e.overrides)),a}get(e){return this.items[e]}unregister(e){const n=this.items,i=e.id,s=this.scope;i in n&&delete n[i],s&&i in Ee[s]&&(delete Ee[s][i],this.override&&delete Sn[i])}}function nE(t,e,n){const i=Oi(Object.create(null),[n?Ee.get(n):{},Ee.get(e),t.defaults]);Ee.set(e,i),t.defaultRoutes&&iE(e,t.defaultRoutes),t.descriptors&&Ee.describe(e,t.descriptors)}function iE(t,e){Object.keys(e).forEach(n=>{const i=n.split("."),s=i.pop(),o=[t].concat(i).join("."),a=e[n].split("."),l=a.pop(),c=a.join(".");Ee.route(o,s,c,l)})}function sE(t){return"id"in t&&"defaults"in t}class oE{constructor(){this.controllers=new eo(lt,"datasets",!0),this.elements=new eo(vt,"elements"),this.plugins=new eo(Object,"plugins"),this.scales=new eo(ln,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,n,i){[...n].forEach(s=>{const o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(e,o,s):be(s,a=>{const l=i||this._getRegistryForType(a);this._exec(e,l,a)})})}_exec(e,n,i){const s=fr(e);ke(i["before"+s],[],i),n[e](i),ke(i["after"+s],[],i)}_getRegistryForType(e){for(let n=0;n<this._typedRegistries.length;n++){const i=this._typedRegistries[n];if(i.isForType(e))return i}return this.plugins}_get(e,n,i){const s=n.get(e);if(s===void 0)throw new Error('"'+e+'" is not a registered '+i+".");return s}}var bt=new oE;class rE{constructor(){this._init=[]}notify(e,n,i,s){n==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const o=s?this._descriptors(e).filter(s):this._descriptors(e),a=this._notify(o,e,n,i);return n==="afterDestroy"&&(this._notify(o,e,"stop"),this._notify(this._init,e,"uninstall")),a}_notify(e,n,i,s){s=s||{};for(const o of e){const a=o.plugin,l=a[i],c=[n,s,o.options];if(ke(l,c,a)===!1&&s.cancelable)return!1}return!0}invalidate(){fe(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),n}_createDescriptors(e,n){const i=e&&e.config,s=ae(i.options&&i.options.plugins,{}),o=aE(i);return s===!1&&!n?[]:cE(e,o,s,n)}_notifyStateChanges(e){const n=this._oldCache||[],i=this._cache,s=(o,a)=>o.filter(l=>!a.some(c=>l.plugin.id===c.plugin.id));this._notify(s(n,i),e,"stop"),this._notify(s(i,n),e,"start")}}function aE(t){const e={},n=[],i=Object.keys(bt.plugins.items);for(let o=0;o<i.length;o++)n.push(bt.getPlugin(i[o]));const s=t.plugins||[];for(let o=0;o<s.length;o++){const a=s[o];n.indexOf(a)===-1&&(n.push(a),e[a.id]=!0)}return{plugins:n,localIds:e}}function lE(t,e){return!e&&t===!1?null:t===!0?{}:t}function cE(t,{plugins:e,localIds:n},i,s){const o=[],a=t.getContext();for(const l of e){const c=l.id,d=lE(i[c],s);d!==null&&o.push({plugin:l,options:dE(t.config,{plugin:l,local:n[c]},d,a)})}return o}function dE(t,{plugin:e,local:n},i,s){const o=t.pluginScopeKeys(e),a=t.getOptionScopes(i,o);return n&&e.defaults&&a.push(e.defaults),t.createResolver(a,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function $r(t,e){const n=Ee.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function uE(t,e){let n=t;return t==="_index_"?n=e:t==="_value_"&&(n=e==="x"?"y":"x"),n}function fE(t,e){return t===e?"_index_":"_value_"}function cu(t){if(t==="x"||t==="y"||t==="r")return t}function hE(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function Lr(t,...e){if(cu(t))return t;for(const n of e){const i=n.axis||hE(n.position)||t.length>1&&cu(t[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function du(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function mE(t,e){if(e.data&&e.data.datasets){const n=e.data.datasets.filter(i=>i.xAxisID===t||i.yAxisID===t);if(n.length)return du(t,"x",n[0])||du(t,"y",n[0])}return{}}function pE(t,e){const n=Sn[t.type]||{scales:{}},i=e.scales||{},s=$r(t.type,e),o=Object.create(null);return Object.keys(i).forEach(a=>{const l=i[a];if(!de(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const c=Lr(a,l,mE(a,t),Ee.scales[l.type]),d=fE(c,s),u=n.scales||{};o[a]=vi(Object.create(null),[{axis:c},l,u[c],u[d]])}),t.data.datasets.forEach(a=>{const l=a.type||t.type,c=a.indexAxis||$r(l,e),u=(Sn[l]||{}).scales||{};Object.keys(u).forEach(f=>{const h=uE(f,c),m=a[h+"AxisID"]||h;o[m]=o[m]||Object.create(null),vi(o[m],[{axis:h},i[m],u[f]])})}),Object.keys(o).forEach(a=>{const l=o[a];vi(l,[Ee.scales[l.type],Ee.scale])}),o}function uu(t){const e=t.options||(t.options={});e.plugins=ae(e.plugins,{}),e.scales=pE(t,e)}function fu(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function gE(t){return t=t||{},t.data=fu(t.data),uu(t),t}const hu=new Map,mu=new Set;function to(t,e){let n=hu.get(t);return n||(n=e(),hu.set(t,n),mu.add(n)),n}const Xi=(t,e,n)=>{const i=nn(e,n);i!==void 0&&t.add(i)};class yE{constructor(e){this._config=gE(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=fu(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),uu(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return to(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return to(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return to(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,i=this.type;return to(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,n){const i=this._scopeCache;let s=i.get(e);return(!s||n)&&(s=new Map,i.set(e,s)),s}getOptionScopes(e,n,i){const{options:s,type:o}=this,a=this._cachedScopes(e,i),l=a.get(n);if(l)return l;const c=new Set;n.forEach(u=>{e&&(c.add(e),u.forEach(f=>Xi(c,e,f))),u.forEach(f=>Xi(c,s,f)),u.forEach(f=>Xi(c,Sn[o]||{},f)),u.forEach(f=>Xi(c,Ee,f)),u.forEach(f=>Xi(c,xr,f))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),mu.has(n)&&a.set(n,d),d}chartOptionScopes(){const{options:e,type:n}=this;return[e,Sn[n]||{},Ee.datasets[n]||{},{type:n},Ee,xr]}resolveNamedOptions(e,n,i,s=[""]){const o={$shared:!0},{resolver:a,subPrefixes:l}=pu(this._resolverCache,e,s);let c=a;if(xE(a,n)){o.$shared=!1,i=sn(i)?i():i;const d=this.createResolver(e,i,l);c=Wn(a,i,d)}for(const d of n)o[d]=c[d];return o}createResolver(e,n,i=[""],s){const{resolver:o}=pu(this._resolverCache,e,i);return de(n)?Wn(o,n,void 0,s):o}}function pu(t,e,n){let i=t.get(e);i||(i=new Map,t.set(e,i));const s=n.join();let o=i.get(s);return o||(o={resolver:wr(e,n),subPrefixes:n.filter(l=>!l.toLowerCase().includes("hover"))},i.set(s,o)),o}const bE=t=>de(t)&&Object.getOwnPropertyNames(t).some(e=>sn(t[e]));function xE(t,e){const{isScriptable:n,isIndexable:i}=hd(t);for(const s of e){const o=n(s),a=i(s),l=(a||o)&&t[s];if(o&&(sn(l)||bE(l))||a&&Oe(l))return!0}return!1}var _E="4.4.7";const kE=["top","bottom","left","right","chartArea"];function gu(t,e){return t==="top"||t==="bottom"||kE.indexOf(t)===-1&&e==="x"}function yu(t,e){return function(n,i){return n[t]===i[t]?n[e]-i[e]:n[t]-i[t]}}function bu(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),ke(n&&n.onComplete,[t],e)}function SE(t){const e=t.chart,n=e.options.animation;ke(n&&n.onProgress,[t],e)}function xu(t){return Or()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const no={},_u=t=>{const e=xu(t);return Object.values(no).filter(n=>n.canvas===e).pop()};function wE(t,e,n){const i=Object.keys(t);for(const s of i){const o=+s;if(o>=e){const a=t[s];delete t[s],(n>0||o>e)&&(t[o+n]=a)}}}function EE(t,e,n,i){return!n||t.type==="mouseout"?null:i?e:t}function io(t,e,n){return t.options.clip?t[n]:e[n]}function CE(t,e){const{xScale:n,yScale:i}=t;return n&&i?{left:io(n,e,"left"),right:io(n,e,"right"),top:io(i,e,"top"),bottom:io(i,e,"bottom")}:e}class Nt{static register(...e){bt.add(...e),ku()}static unregister(...e){bt.remove(...e),ku()}constructor(e,n){const i=this.config=new yE(n),s=xu(e),o=_u(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 a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||su(s)),this.platform.updateConfig(i);const l=this.platform.acquireContext(s,a.aspectRatio),c=l&&l.canvas,d=c&&c.height,u=c&&c.width;if(this.id=Mk(),this.ctx=l,this.canvas=c,this.width=u,this.height=d,this._options=a,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 rE,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Gk(f=>this.update(f),a.resizeDelay||0),this._dataChanges=[],no[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}Ot.listen(this,"complete",bu),Ot.listen(this,"progress",SE),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:n},width:i,height:s,_aspectRatio:o}=this;return fe(e)?n&&o?o:s?i/s:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return bt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():kd(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return dd(this.canvas,this.ctx),this}stop(){return Ot.stop(this),this}resize(e,n){Ot.running(this)?this._resizeBeforeDraw={width:e,height:n}:this._resize(e,n)}_resize(e,n){const i=this.options,s=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,e,n,o),l=i.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,kd(this,l,!0)&&(this.notifyPlugins("resize",{size:a}),ke(i.onResize,[this,a],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};be(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){const e=this.options,n=e.scales,i=this.scales,s=Object.keys(i).reduce((a,l)=>(a[l]=!1,a),{});let o=[];n&&(o=o.concat(Object.keys(n).map(a=>{const l=n[a],c=Lr(a,l),d=c==="r",u=c==="x";return{options:l,dposition:d?"chartArea":u?"bottom":"left",dtype:d?"radialLinear":u?"category":"linear"}}))),be(o,a=>{const l=a.options,c=l.id,d=Lr(c,l),u=ae(l.type,a.dtype);(l.position===void 0||gu(l.position,d)!==gu(a.dposition))&&(l.position=a.dposition),s[c]=!0;let f=null;if(c in i&&i[c].type===u)f=i[c];else{const h=bt.getScale(u);f=new h({id:c,type:u,ctx:this.ctx,chart:this}),i[f.id]=f}f.init(l,e)}),be(s,(a,l)=>{a||delete i[l]}),be(i,a=>{je.configure(this,a,a.options),je.addBox(this,a)})}_updateMetasets(){const e=this._metasets,n=this.data.datasets.length,i=e.length;if(e.sort((s,o)=>s.index-o.index),i>n){for(let s=n;s<i;++s)this._destroyDatasetMeta(s);e.splice(n,i-n)}this._sortedMetasets=e.slice(0).sort(yu("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:n}}=this;e.length>n.length&&delete this._stacks,e.forEach((i,s)=>{n.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const e=[],n=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i<s;i++){const o=n[i];let a=this.getDatasetMeta(i);const l=o.type||this.config.type;if(a.type&&a.type!==l&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=l,a.indexAxis=o.indexAxis||$r(l,this.options),a.order=o.order||0,a.index=i,a.label=""+o.label,a.visible=this.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else{const c=bt.getController(l),{datasetElementType:d,dataElementType:u}=Ee.datasets[l];Object.assign(c,{dataElementType:bt.getElement(u),datasetElementType:d&&bt.getElement(d)}),a.controller=new c(this,i),e.push(a.controller)}}return this._updateMetasets(),e}_resetElements(){be(this.data.datasets,(e,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){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:e,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let d=0,u=this.data.datasets.length;d<u;d++){const{controller:f}=this.getDatasetMeta(d),h=!s&&o.indexOf(f)===-1;f.buildOrUpdateElements(h),a=Math.max(+f.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),s||be(o,d=>{d.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(yu("z","_idx"));const{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){be(this.scales,e=>{je.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!qc(n,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:o}of n){const a=i==="_removeElements"?-o:o;wE(e,s,a)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=o=>new Set(e.filter(a=>a[0]===o).map((a,l)=>l+","+a.splice(1).join(","))),s=i(0);for(let o=1;o<n;o++)if(!qc(s,i(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;je.update(this,this.width,this.height,e);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],be(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(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,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,sn(e)?e({datasetIndex:n}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,n){const i=this.getDatasetMeta(e),s={meta:i,index:e,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&&(Ot.has(this)?this.attached&&!Ot.running(this)&&Ot.start(this):(this.draw(),bu({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(e=0;e<n.length&&n[e].z<=0;++e)n[e].draw(this.chartArea);for(this._drawDatasets();e<n.length;++e)n[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const n=this._sortedMetasets,i=[];let s,o;for(s=0,o=n.length;s<o;++s){const a=n[s];(!e||a.visible)&&i.push(a)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let n=e.length-1;n>=0;--n)this._drawDataset(e[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const n=this.ctx,i=e._clip,s=!i.disabled,o=CE(e,this.chartArea),a={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(s&&Us(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}),e.controller.draw(),s&&Ws(n),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(e){return zt(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,n,i,s){const o=qd.modes[n];return typeof o=="function"?o(this,e,i,s):[]}getDatasetMeta(e){const n=this.data.datasets[e],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:e,_dataset:n,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=rn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const n=this.data.datasets[e];if(!n)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(e,n){const i=this.getDatasetMeta(e);i.hidden=!n}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,n,i){const s=i?"show":"hide",o=this.getDatasetMeta(e),a=o.controller._resolveAnimations(void 0,s);Ni(n)?(o.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),a.update(o,{visible:i}),this.update(l=>l.datasetIndex===e?s:void 0))}hide(e,n){this._updateVisibility(e,n,!1)}show(e,n){this._updateVisibility(e,n,!0)}_destroyDatasetMeta(e){const n=this._metasets[e];n&&n.controller&&n.controller._destroy(),delete this._metasets[e]}_stop(){let e,n;for(this.stop(),Ot.remove(this),e=0,n=this.data.datasets.length;e<n;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:n}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),dd(e,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete no[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,n=this.platform,i=(o,a)=>{n.addEventListener(this,o,a),e[o]=a},s=(o,a,l)=>{o.offsetX=a,o.offsetY=l,this._eventHandler(o)};be(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,n=this.platform,i=(c,d)=>{n.addEventListener(this,c,d),e[c]=d},s=(c,d)=>{e[c]&&(n.removeEventListener(this,c,d),delete e[c])},o=(c,d)=>{this.canvas&&this.resize(c,d)};let a;const l=()=>{s("attach",l),this.attached=!0,this.resize(),i("resize",o),i("detach",a)};a=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),i("attach",l)},n.isAttached(this.canvas)?l():a()}unbindEvents(){be(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},be(this._responsiveListeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,n,i){const s=i?"set":"remove";let o,a,l,c;for(n==="dataset"&&(o=this.getDatasetMeta(e[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),l=0,c=e.length;l<c;++l){a=e[l];const d=a&&this.getDatasetMeta(a.datasetIndex).controller;d&&d[s+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const n=this._active||[],i=e.map(({datasetIndex:o,index:a})=>{const l=this.getDatasetMeta(o);if(!l)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:l.data[a],index:a}});!$s(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(e,n,i){return this._plugins.notify(this,e,n,i)}isPluginEnabled(e){return this._plugins._cache.filter(n=>n.plugin.id===e).length===1}_updateHoverStyles(e,n,i){const s=this.options.hover,o=(c,d)=>c.filter(u=>!d.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.index)),a=o(n,e),l=i?e:o(e,n);a.length&&this.updateHoverStyle(a,s.mode,!1),l.length&&s.mode&&this.updateHoverStyle(l,s.mode,!0)}_eventHandler(e,n){const i={event:e,replay:n,cancelable:!0,inChartArea:this.isPointInArea(e)},s=a=>(a.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const o=this._handleEvent(e,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(o||i.changed)&&this.render(),this}_handleEvent(e,n,i){const{_active:s=[],options:o}=this,a=n,l=this._getActiveElements(e,s,i,a),c=Ik(e),d=EE(e,this._lastEvent,i,c);i&&(this._lastEvent=null,ke(o.onHover,[e,l,this],this),c&&ke(o.onClick,[e,l,this],this));const u=!$s(l,s);return(u||n)&&(this._active=l,this._updateHoverStyles(l,s,n)),this._lastEvent=d,u}_getActiveElements(e,n,i,s){if(e.type==="mouseout")return[];if(!i)return n;const o=this.options.hover;return this.getElementsAtEventForMode(e,o.mode,o,s)}}z(Nt,"defaults",Ee),z(Nt,"instances",no),z(Nt,"overrides",Sn),z(Nt,"registry",bt),z(Nt,"version",_E),z(Nt,"getChart",_u);function ku(){return be(Nt.instances,t=>t._plugins.invalidate())}function OE(t,e,n){const{startAngle:i,pixelMargin:s,x:o,y:a,outerRadius:l,innerRadius:c}=e;let d=s/l;t.beginPath(),t.arc(o,a,l,i-d,n+d),c>s?(d=s/c,t.arc(o,a,c,n+d,i-d,!0)):t.arc(o,a,s,n+Me,i-Me),t.closePath(),t.clip()}function vE(t){return Sr(t,["outerStart","outerEnd","innerStart","innerEnd"])}function NE(t,e,n,i){const s=vE(t.options.borderRadius),o=(n-e)/2,a=Math.min(o,i*e/2),l=c=>{const d=(n-Math.min(o,c))*i/2;return Le(c,0,Math.min(o,d))};return{outerStart:l(s.outerStart),outerEnd:l(s.outerEnd),innerStart:Le(s.innerStart,0,a),innerEnd:Le(s.innerEnd,0,a)}}function Kn(t,e,n,i){return{x:n+t*Math.cos(e),y:i+t*Math.sin(e)}}function so(t,e,n,i,s,o){const{x:a,y:l,startAngle:c,pixelMargin:d,innerRadius:u}=e,f=Math.max(e.outerRadius+i+n-d,0),h=u>0?u+i+n+d:0;let m=0;const p=s-c;if(i){const Y=u>0?u-i:0,L=f>0?f-i:0,j=(Y+L)/2,$=j!==0?p*j/(j+i):p;m=(p-$)/2}const g=Math.max(.001,p*f-n/Se)/f,y=(p-g)/2,b=c+y+m,x=s-y-m,{outerStart:w,outerEnd:E,innerStart:k,innerEnd:C}=NE(e,h,f,x-b),S=f-w,_=f-E,O=b+w/S,P=x-E/_,v=h+k,T=h+C,R=b+k/v,U=x-C/T;if(t.beginPath(),o){const Y=(O+P)/2;if(t.arc(a,l,f,O,Y),t.arc(a,l,f,Y,P),E>0){const A=Kn(_,P,a,l);t.arc(A.x,A.y,E,P,x+Me)}const L=Kn(T,x,a,l);if(t.lineTo(L.x,L.y),C>0){const A=Kn(T,U,a,l);t.arc(A.x,A.y,C,x+Me,U+Math.PI)}const j=(x-C/h+(b+k/h))/2;if(t.arc(a,l,h,x-C/h,j,!0),t.arc(a,l,h,j,b+k/h,!0),k>0){const A=Kn(v,R,a,l);t.arc(A.x,A.y,k,R+Math.PI,b-Me)}const $=Kn(S,b,a,l);if(t.lineTo($.x,$.y),w>0){const A=Kn(S,O,a,l);t.arc(A.x,A.y,w,b-Me,O)}}else{t.moveTo(a,l);const Y=Math.cos(O)*f+a,L=Math.sin(O)*f+l;t.lineTo(Y,L);const j=Math.cos(P)*f+a,$=Math.sin(P)*f+l;t.lineTo(j,$)}t.closePath()}function DE(t,e,n,i,s){const{fullCircles:o,startAngle:a,circumference:l}=e;let c=e.endAngle;if(o){so(t,e,n,i,c,s);for(let d=0;d<o;++d)t.fill();isNaN(l)||(c=a+(l%we||we))}return so(t,e,n,i,c,s),t.fill(),c}function TE(t,e,n,i,s){const{fullCircles:o,startAngle:a,circumference:l,options:c}=e,{borderWidth:d,borderJoinStyle:u,borderDash:f,borderDashOffset:h}=c,m=c.borderAlign==="inner";if(!d)return;t.setLineDash(f||[]),t.lineDashOffset=h,m?(t.lineWidth=d*2,t.lineJoin=u||"round"):(t.lineWidth=d,t.lineJoin=u||"bevel");let p=e.endAngle;if(o){so(t,e,n,i,p,s);for(let g=0;g<o;++g)t.stroke();isNaN(l)||(p=a+(l%we||we))}m&&OE(t,e,p),o||(so(t,e,n,i,p,s),t.stroke())}class Xn extends vt{constructor(n){super();z(this,"circumference");z(this,"endAngle");z(this,"fullCircles");z(this,"innerRadius");z(this,"outerRadius");z(this,"pixelMargin");z(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:a,distance:l}=Jc(o,{x:n,y:i}),{startAngle:c,endAngle:d,innerRadius:u,outerRadius:f,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),m=(this.options.spacing+this.options.borderWidth)/2,p=ae(h,d-c),g=Ti(a,c,d)&&c!==d,y=p>=we||g,b=It(l,u+m,f+m);return y&&b}getCenterPoint(n){const{x:i,y:s,startAngle:o,endAngle:a,innerRadius:l,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:d,spacing:u}=this.options,f=(o+a)/2,h=(l+c+u+d)/2;return{x:i+Math.cos(f)*h,y:s+Math.sin(f)*h}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:i,circumference:s}=this,o=(i.offset||0)/4,a=(i.spacing||0)/2,l=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>we?Math.floor(s/we):0,s===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const c=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(c)*o,Math.sin(c)*o);const d=1-Math.sin(Math.min(Se,s||0)),u=o*d;n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,DE(n,this,u,a,l),TE(n,this,u,a,l),n.restore()}}z(Xn,"id","arc"),z(Xn,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),z(Xn,"defaultRoutes",{backgroundColor:"backgroundColor"}),z(Xn,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function Su(t,e,n=e){t.lineCap=ae(n.borderCapStyle,e.borderCapStyle),t.setLineDash(ae(n.borderDash,e.borderDash)),t.lineDashOffset=ae(n.borderDashOffset,e.borderDashOffset),t.lineJoin=ae(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=ae(n.borderWidth,e.borderWidth),t.strokeStyle=ae(n.borderColor,e.borderColor)}function BE(t,e,n){t.lineTo(n.x,n.y)}function PE(t){return t.stepped?lS:t.tension||t.cubicInterpolationMode==="monotone"?cS:BE}function wu(t,e,n={}){const i=t.length,{start:s=0,end:o=i-1}=n,{start:a,end:l}=e,c=Math.max(s,a),d=Math.min(o,l),u=s<a&&o<a||s>l&&o>l;return{count:i,start:c,loop:e.loop,ilen:d<c&&!u?i+d-c:d-c}}function AE(t,e,n,i){const{points:s,options:o}=e,{count:a,start:l,loop:c,ilen:d}=wu(s,n,i),u=PE(o);let{move:f=!0,reverse:h}=i||{},m,p,g;for(m=0;m<=d;++m)p=s[(l+(h?d-m:m))%a],!p.skip&&(f?(t.moveTo(p.x,p.y),f=!1):u(t,g,p,h,o.stepped),g=p);return c&&(p=s[(l+(h?d:0))%a],u(t,g,p,h,o.stepped)),!!c}function ME(t,e,n,i){const s=e.points,{count:o,start:a,ilen:l}=wu(s,n,i),{move:c=!0,reverse:d}=i||{};let u=0,f=0,h,m,p,g,y,b;const x=E=>(a+(d?l-E:E))%o,w=()=>{g!==y&&(t.lineTo(u,y),t.lineTo(u,g),t.lineTo(u,b))};for(c&&(m=s[x(0)],t.moveTo(m.x,m.y)),h=0;h<=l;++h){if(m=s[x(h)],m.skip)continue;const E=m.x,k=m.y,C=E|0;C===p?(k<g?g=k:k>y&&(y=k),u=(f*u+E)/++f):(w(),t.lineTo(E,k),p=C,f=0,g=y=k),b=k}w()}function Ir(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!n?ME:AE}function VE(t){return t.stepped?jS:t.tension||t.cubicInterpolationMode==="monotone"?zS:Nn}function RE(t,e,n,i){let s=e._path;s||(s=e._path=new Path2D,e.path(s,n,i)&&s.closePath()),Su(t,e.options),t.stroke(s)}function FE(t,e,n,i){const{segments:s,options:o}=e,a=Ir(e);for(const l of s)Su(t,o,l.style),t.beginPath(),a(t,e,l,{start:n,end:n+i-1})&&t.closePath(),t.stroke()}const $E=typeof Path2D=="function";function LE(t,e,n,i){$E&&!e.options.segment?RE(t,e,n,i):FE(t,e,n,i)}class Ut extends vt{constructor(e){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,e&&Object.assign(this,e)}updateControlPoints(e,n){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;AS(this._points,i,e,s,n),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=KS(this,this.options.segment))}first(){const e=this.segments,n=this.points;return e.length&&n[e[0].start]}last(){const e=this.segments,n=this.points,i=e.length;return i&&n[e[i-1].end]}interpolate(e,n){const i=this.options,s=e[n],o=this.points,a=Nd(this,{property:n,start:s,end:s});if(!a.length)return;const l=[],c=VE(i);let d,u;for(d=0,u=a.length;d<u;++d){const{start:f,end:h}=a[d],m=o[f],p=o[h];if(m===p){l.push(m);continue}const g=Math.abs((s-m[n])/(p[n]-m[n])),y=c(m,p,g,i.stepped);y[n]=e[n],l.push(y)}return l.length===1?l[0]:l}pathSegment(e,n,i){return Ir(this)(e,this,n,i)}path(e,n,i){const s=this.segments,o=Ir(this);let a=this._loop;n=n||0,i=i||this.points.length-n;for(const l of s)a&=o(e,this,l,{start:n,end:n+i-1});return!!a}draw(e,n,i,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(e.save(),LE(e,this,i,s),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}z(Ut,"id","line"),z(Ut,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),z(Ut,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),z(Ut,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"});function Eu(t,e,n,i){const s=t.options,{[n]:o}=t.getProps([n],i);return Math.abs(e-o)<s.radius+s.hitRadius}class Gi extends vt{constructor(n){super();z(this,"parsed");z(this,"skip");z(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:a,y:l}=this.getProps(["x","y"],s);return Math.pow(n-a,2)+Math.pow(i-l,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(n,i){return Eu(this,n,"x",i)}inYRange(n,i){return Eu(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||!zt(this,i,this.size(s)/2)||(n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.fillStyle=s.backgroundColor,kr(n,s,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}z(Gi,"id","point"),z(Gi,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),z(Gi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Cu(t,e){const{x:n,y:i,base:s,width:o,height:a}=t.getProps(["x","y","base","width","height"],e);let l,c,d,u,f;return t.horizontal?(f=a/2,l=Math.min(n,s),c=Math.max(n,s),d=i-f,u=i+f):(f=o/2,l=n-f,c=n+f,d=Math.min(i,s),u=Math.max(i,s)),{left:l,top:d,right:c,bottom:u}}function cn(t,e,n,i){return t?0:Le(e,n,i)}function IE(t,e,n){const i=t.options.borderWidth,s=t.borderSkipped,o=fd(i);return{t:cn(s.top,o.top,0,n),r:cn(s.right,o.right,0,e),b:cn(s.bottom,o.bottom,0,n),l:cn(s.left,o.left,0,e)}}function jE(t,e,n){const{enableBorderRadius:i}=t.getProps(["enableBorderRadius"]),s=t.options.borderRadius,o=Cn(s),a=Math.min(e,n),l=t.borderSkipped,c=i||de(s);return{topLeft:cn(!c||l.top||l.left,o.topLeft,0,a),topRight:cn(!c||l.top||l.right,o.topRight,0,a),bottomLeft:cn(!c||l.bottom||l.left,o.bottomLeft,0,a),bottomRight:cn(!c||l.bottom||l.right,o.bottomRight,0,a)}}function zE(t){const e=Cu(t),n=e.right-e.left,i=e.bottom-e.top,s=IE(t,n/2,i/2),o=jE(t,n/2,i/2);return{outer:{x:e.left,y:e.top,w:n,h:i,radius:o},inner:{x:e.left+s.l,y:e.top+s.t,w:n-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function jr(t,e,n,i){const s=e===null,o=n===null,l=t&&!(s&&o)&&Cu(t,i);return l&&(s||It(e,l.left,l.right))&&(o||It(n,l.top,l.bottom))}function UE(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function WE(t,e){t.rect(e.x,e.y,e.w,e.h)}function zr(t,e,n={}){const i=t.x!==n.x?-e:0,s=t.y!==n.y?-e:0,o=(t.x+t.w!==n.x+n.w?e:0)-i,a=(t.y+t.h!==n.y+n.h?e:0)-s;return{x:t.x+i,y:t.y+s,w:t.w+o,h:t.h+a,radius:t.radius}}class Ji extends vt{constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:n,options:{borderColor:i,backgroundColor:s}}=this,{inner:o,outer:a}=zE(this),l=UE(a.radius)?Vi:WE;e.save(),(a.w!==o.w||a.h!==o.h)&&(e.beginPath(),l(e,zr(a,n,o)),e.clip(),l(e,zr(o,-n,a)),e.fillStyle=i,e.fill("evenodd")),e.beginPath(),l(e,zr(o,n)),e.fillStyle=s,e.fill(),e.restore()}inRange(e,n,i){return jr(this,e,n,i)}inXRange(e,n){return jr(this,e,null,n)}inYRange(e,n){return jr(this,null,e,n)}getCenterPoint(e){const{x:n,y:i,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],e);return{x:o?(n+s)/2:n,y:o?i:(i+s)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}z(Ji,"id","bar"),z(Ji,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),z(Ji,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Ou=Object.freeze({__proto__:null,ArcElement:Xn,BarElement:Ji,LineElement:Ut,PointElement:Gi});const Ur=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],vu=Ur.map(t=>t.replace("rgb(","rgba(").replace(")",", 0.5)"));function Nu(t){return Ur[t%Ur.length]}function Du(t){return vu[t%vu.length]}function HE(t,e){return t.borderColor=Nu(e),t.backgroundColor=Du(e),++e}function qE(t,e){return t.backgroundColor=t.data.map(()=>Nu(e++)),e}function YE(t,e){return t.backgroundColor=t.data.map(()=>Du(e++)),e}function KE(t){let e=0;return(n,i)=>{const s=t.getDatasetMeta(i).controller;s instanceof an?e=qE(n,e):s instanceof Yn?e=YE(n,e):s&&(e=HE(n,e))}}function Tu(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}function XE(t){return t&&(t.borderColor||t.backgroundColor)}function GE(){return Ee.borderColor!=="rgba(0,0,0,0.1)"||Ee.backgroundColor!=="rgba(0,0,0,0.1)"}var Bu={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,n){if(!n.enabled)return;const{data:{datasets:i},options:s}=t.config,{elements:o}=s,a=Tu(i)||XE(s)||o&&Tu(o)||GE();if(!n.forceOverride&&a)return;const l=KE(t);i.forEach(l)}};function JE(t,e,n,i,s){const o=s.samples||i;if(o>=n)return t.slice(e,e+n);const a=[],l=(n-2)/(o-2);let c=0;const d=e+n-1;let u=e,f,h,m,p,g;for(a[c++]=t[u],f=0;f<o-2;f++){let y=0,b=0,x;const w=Math.floor((f+1)*l)+1+e,E=Math.min(Math.floor((f+2)*l)+1,n)+e,k=E-w;for(x=w;x<E;x++)y+=t[x].x,b+=t[x].y;y/=k,b/=k;const C=Math.floor(f*l)+1+e,S=Math.min(Math.floor((f+1)*l)+1,n)+e,{x:_,y:O}=t[u];for(m=p=-1,x=C;x<S;x++)p=.5*Math.abs((_-y)*(t[x].y-O)-(_-t[x].x)*(b-O)),p>m&&(m=p,h=t[x],g=x);a[c++]=h,u=g}return a[c++]=t[d],a}function QE(t,e,n,i){let s=0,o=0,a,l,c,d,u,f,h,m,p,g;const y=[],b=e+n-1,x=t[e].x,E=t[b].x-x;for(a=e;a<e+n;++a){l=t[a],c=(l.x-x)/E*i,d=l.y;const k=c|0;if(k===u)d<p?(p=d,f=a):d>g&&(g=d,h=a),s=(o*s+l.x)/++o;else{const C=a-1;if(!fe(f)&&!fe(h)){const S=Math.min(f,h),_=Math.max(f,h);S!==m&&S!==C&&y.push({...t[S],x:s}),_!==m&&_!==C&&y.push({...t[_],x:s})}a>0&&C!==m&&y.push(t[C]),y.push(l),u=k,o=0,p=g=d,f=h=m=a}}return y}function Pu(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function Au(t){t.data.datasets.forEach(e=>{Pu(e)})}function ZE(t,e){const n=e.length;let i=0,s;const{iScale:o}=t,{min:a,max:l,minDefined:c,maxDefined:d}=o.getUserBounds();return c&&(i=Le(jt(e,o.axis,a).lo,0,n-1)),d?s=Le(jt(e,o.axis,l).hi+1,i,n)-i:s=n-i,{start:i,count:s}}var Mu={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,n)=>{if(!n.enabled){Au(t);return}const i=t.width;t.data.datasets.forEach((s,o)=>{const{_data:a,indexAxis:l}=s,c=t.getDatasetMeta(o),d=a||s.data;if(Ri([l,t.options.indexAxis])==="y"||!c.controller.supportsDecimation)return;const u=t.scales[c.xAxisID];if(u.type!=="linear"&&u.type!=="time"||t.options.parsing)return;let{start:f,count:h}=ZE(c,d);const m=n.threshold||4*i;if(h<=m){Pu(s);return}fe(a)&&(s._data=d,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let p;switch(n.algorithm){case"lttb":p=JE(d,f,h,i,n);break;case"min-max":p=QE(d,f,h,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}s._decimated=p})},destroy(t){Au(t)}};function eC(t,e,n){const i=t.segments,s=t.points,o=e.points,a=[];for(const l of i){let{start:c,end:d}=l;d=Hr(c,d,s);const u=Wr(n,s[c],s[d],l.loop);if(!e.segments){a.push({source:l,target:u,start:s[c],end:s[d]});continue}const f=Nd(e,u);for(const h of f){const m=Wr(n,o[h.start],o[h.end],h.loop),p=vd(l,s,m);for(const g of p)a.push({source:g,target:h,start:{[n]:Vu(u,m,"start",Math.max)},end:{[n]:Vu(u,m,"end",Math.min)}})}}return a}function Wr(t,e,n,i){if(i)return;let s=e[t],o=n[t];return t==="angle"&&(s=it(s),o=it(o)),{property:t,start:s,end:o}}function tC(t,e){const{x:n=null,y:i=null}=t||{},s=e.points,o=[];return e.segments.forEach(({start:a,end:l})=>{l=Hr(a,l,s);const c=s[a],d=s[l];i!==null?(o.push({x:c.x,y:i}),o.push({x:d.x,y:i})):n!==null&&(o.push({x:n,y:c.y}),o.push({x:n,y:d.y}))}),o}function Hr(t,e,n){for(;e>t;e--){const i=n[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function Vu(t,e,n,i){return t&&e?i(t[n],e[n]):t?t[n]:e?e[n]:0}function Ru(t,e){let n=[],i=!1;return Oe(t)?(i=!0,n=t):n=tC(t,e),n.length?new Ut({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function Fu(t){return t&&t.fill!==!1}function nC(t,e,n){let s=t[e].fill;const o=[e];let a;if(!n)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!Pe(s))return s;if(a=t[s],!a)return!1;if(a.visible)return s;o.push(s),s=a.fill}return!1}function iC(t,e,n){const i=aC(t);if(de(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Pe(s)&&Math.floor(s)===s?sC(i[0],e,s,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function sC(t,e,n,i){return(t==="-"||t==="+")&&(n=e+n),n===e||n<0||n>=i?!1:n}function oC(t,e){let n=null;return t==="start"?n=e.bottom:t==="end"?n=e.top:de(t)?n=e.getPixelForValue(t.value):e.getBasePixel&&(n=e.getBasePixel()),n}function rC(t,e,n){let i;return t==="start"?i=n:t==="end"?i=e.options.reverse?e.min:e.max:de(t)?i=t.value:i=e.getBaseValue(),i}function aC(t){const e=t.options,n=e.fill;let i=ae(n&&n.target,n);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function lC(t){const{scale:e,index:n,line:i}=t,s=[],o=i.segments,a=i.points,l=cC(e,n);l.push(Ru({x:null,y:e.bottom},i));for(let c=0;c<o.length;c++){const d=o[c];for(let u=d.start;u<=d.end;u++)dC(s,a[u],l)}return new Ut({points:s,options:{}})}function cC(t,e){const n=[],i=t.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const o=i[s];if(o.index===e)break;o.hidden||n.unshift(o.dataset)}return n}function dC(t,e,n){const i=[];for(let s=0;s<n.length;s++){const o=n[s],{first:a,last:l,point:c}=uC(o,e,"x");if(!(!c||a&&l)){if(a)i.unshift(c);else if(t.push(c),!l)break}}t.push(...i)}function uC(t,e,n){const i=t.interpolate(e,n);if(!i)return{};const s=i[n],o=t.segments,a=t.points;let l=!1,c=!1;for(let d=0;d<o.length;d++){const u=o[d],f=a[u.start][n],h=a[u.end][n];if(It(s,f,h)){l=s===f,c=s===h;break}}return{first:l,last:c,point:i}}class $u{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,n,i){const{x:s,y:o,radius:a}=this;return n=n||{start:0,end:we},e.arc(s,o,a,n.end,n.start,!0),!i.bounds}interpolate(e){const{x:n,y:i,radius:s}=this,o=e.angle;return{x:n+Math.cos(o)*s,y:i+Math.sin(o)*s,angle:o}}}function fC(t){const{chart:e,fill:n,line:i}=t;if(Pe(n))return hC(e,n);if(n==="stack")return lC(t);if(n==="shape")return!0;const s=mC(t);return s instanceof $u?s:Ru(s,i)}function hC(t,e){const n=t.getDatasetMeta(e);return n&&t.isDatasetVisible(e)?n.dataset:null}function mC(t){return(t.scale||{}).getPointPositionForValue?gC(t):pC(t)}function pC(t){const{scale:e={},fill:n}=t,i=oC(n,e);if(Pe(i)){const s=e.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function gC(t){const{scale:e,fill:n}=t,i=e.options,s=e.getLabels().length,o=i.reverse?e.max:e.min,a=rC(n,e,o),l=[];if(i.grid.circular){const c=e.getPointPositionForValue(0,o);return new $u({x:c.x,y:c.y,radius:e.getDistanceFromCenterForValue(a)})}for(let c=0;c<s;++c)l.push(e.getPointPositionForValue(c,a));return l}function qr(t,e,n){const i=fC(e),{line:s,scale:o,axis:a}=e,l=s.options,c=l.fill,d=l.backgroundColor,{above:u=d,below:f=d}=c||{};i&&s.points.length&&(Us(t,n),yC(t,{line:s,target:i,above:u,below:f,area:n,scale:o,axis:a}),Ws(t))}function yC(t,e){const{line:n,target:i,above:s,below:o,area:a,scale:l}=e,c=n._loop?"angle":e.axis;t.save(),c==="x"&&o!==s&&(Lu(t,i,a.top),Iu(t,{line:n,target:i,color:s,scale:l,property:c}),t.restore(),t.save(),Lu(t,i,a.bottom)),Iu(t,{line:n,target:i,color:o,scale:l,property:c}),t.restore()}function Lu(t,e,n){const{segments:i,points:s}=e;let o=!0,a=!1;t.beginPath();for(const l of i){const{start:c,end:d}=l,u=s[c],f=s[Hr(c,d,s)];o?(t.moveTo(u.x,u.y),o=!1):(t.lineTo(u.x,n),t.lineTo(u.x,u.y)),a=!!e.pathSegment(t,l,{move:a}),a?t.closePath():t.lineTo(f.x,n)}t.lineTo(e.first().x,n),t.closePath(),t.clip()}function Iu(t,e){const{line:n,target:i,property:s,color:o,scale:a}=e,l=eC(n,i,s);for(const{source:c,target:d,start:u,end:f}of l){const{style:{backgroundColor:h=o}={}}=c,m=i!==!0;t.save(),t.fillStyle=h,bC(t,a,m&&Wr(s,u,f)),t.beginPath();const p=!!n.pathSegment(t,c);let g;if(m){p?t.closePath():ju(t,i,f,s);const y=!!i.pathSegment(t,d,{move:p,reverse:!0});g=p&&y,g||ju(t,i,u,s)}t.closePath(),t.fill(g?"evenodd":"nonzero"),t.restore()}}function bC(t,e,n){const{top:i,bottom:s}=e.chart.chartArea,{property:o,start:a,end:l}=n||{};o==="x"&&(t.beginPath(),t.rect(a,i,l-a,s-i),t.clip())}function ju(t,e,n,i){const s=e.interpolate(n,i);s&&t.lineTo(s.x,s.y)}var zu={id:"filler",afterDatasetsUpdate(t,e,n){const i=(t.data.datasets||[]).length,s=[];let o,a,l,c;for(a=0;a<i;++a)o=t.getDatasetMeta(a),l=o.dataset,c=null,l&&l.options&&l instanceof Ut&&(c={visible:t.isDatasetVisible(a),index:a,fill:iC(l,a,i),chart:t,axis:o.controller.options.indexAxis,scale:o.vScale,line:l}),o.$filler=c,s.push(c);for(a=0;a<i;++a)c=s[a],!(!c||c.fill===!1)&&(c.fill=nC(s,a,n.propagate))},beforeDraw(t,e,n){const i=n.drawTime==="beforeDraw",s=t.getSortedVisibleDatasetMetas(),o=t.chartArea;for(let a=s.length-1;a>=0;--a){const l=s[a].$filler;l&&(l.line.updateControlPoints(o,l.axis),i&&l.fill&&qr(t.ctx,l,o))}},beforeDatasetsDraw(t,e,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=t.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const o=i[s].$filler;Fu(o)&&qr(t.ctx,o,t.chartArea)}},beforeDatasetDraw(t,e,n){const i=e.meta.$filler;!Fu(i)||n.drawTime!=="beforeDatasetDraw"||qr(t.ctx,i,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Uu=(t,e)=>{let{boxHeight:n=e,boxWidth:i=e}=t;return t.usePointStyle&&(n=Math.min(n,e),i=t.pointStyleWidth||Math.min(i,e)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(e,n)}},xC=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class Wu extends vt{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,n,i){this.maxWidth=e,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 e=this.options.labels||{};let n=ke(e.generateLabels,[this.chart],this)||[];e.filter&&(n=n.filter(i=>e.filter(i,this.chart.data))),e.sort&&(n=n.sort((i,s)=>e.sort(i,s,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:e,ctx:n}=this;if(!e.display){this.width=this.height=0;return}const i=e.labels,s=Fe(i.font),o=s.size,a=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=Uu(i,o);let d,u;n.font=s.string,this.isHorizontal()?(d=this.maxWidth,u=this._fitRows(a,o,l,c)+10):(u=this.maxHeight,d=this._fitCols(a,s,l,c)+10),this.width=Math.min(d,e.maxWidth||this.maxWidth),this.height=Math.min(u,e.maxHeight||this.maxHeight)}_fitRows(e,n,i,s){const{ctx:o,maxWidth:a,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],u=s+l;let f=e;o.textAlign="left",o.textBaseline="middle";let h=-1,m=-u;return this.legendItems.forEach((p,g)=>{const y=i+n/2+o.measureText(p.text).width;(g===0||d[d.length-1]+y+2*l>a)&&(f+=u,d[d.length-(g>0?0:1)]=0,m+=u,h++),c[g]={left:0,top:m,row:h,width:y,height:s},d[d.length-1]+=y+l}),f}_fitCols(e,n,i,s){const{ctx:o,maxHeight:a,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.columnSizes=[],u=a-e;let f=l,h=0,m=0,p=0,g=0;return this.legendItems.forEach((y,b)=>{const{itemWidth:x,itemHeight:w}=_C(i,n,o,y,s);b>0&&m+w+2*l>u&&(f+=h+l,d.push({width:h,height:m}),p+=h+l,g++,h=m=0),c[b]={left:p,top:m,col:g,width:x,height:w},h=Math.max(h,x),m+=w+l}),f+=h,d.push({width:h,height:m}),f}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:o}}=this,a=qn(o,this.left,this.width);if(this.isHorizontal()){let l=0,c=We(i,this.left+s,this.right-this.lineWidths[l]);for(const d of n)l!==d.row&&(l=d.row,c=We(i,this.left+s,this.right-this.lineWidths[l])),d.top+=this.top+e+s,d.left=a.leftForLtr(a.x(c),d.width),c+=d.width+s}else{let l=0,c=We(i,this.top+e+s,this.bottom-this.columnSizes[l].height);for(const d of n)d.col!==l&&(l=d.col,c=We(i,this.top+e+s,this.bottom-this.columnSizes[l].height)),d.top=c,d.left+=this.left+s,d.left=a.leftForLtr(a.x(d.left),d.width),c+=d.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;Us(e,this),this._draw(),Ws(e)}}_draw(){const{options:e,columnSizes:n,lineWidths:i,ctx:s}=this,{align:o,labels:a}=e,l=Ee.color,c=qn(e.rtl,this.left,this.width),d=Fe(a.font),{padding:u}=a,f=d.size,h=f/2;let m;this.drawTitle(),s.textAlign=c.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=d.string;const{boxWidth:p,boxHeight:g,itemHeight:y}=Uu(a,f),b=function(C,S,_){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;s.save();const O=ae(_.lineWidth,1);if(s.fillStyle=ae(_.fillStyle,l),s.lineCap=ae(_.lineCap,"butt"),s.lineDashOffset=ae(_.lineDashOffset,0),s.lineJoin=ae(_.lineJoin,"miter"),s.lineWidth=O,s.strokeStyle=ae(_.strokeStyle,l),s.setLineDash(ae(_.lineDash,[])),a.usePointStyle){const P={radius:g*Math.SQRT2/2,pointStyle:_.pointStyle,rotation:_.rotation,borderWidth:O},v=c.xPlus(C,p/2),T=S+h;ud(s,P,v,T,a.pointStyleWidth&&p)}else{const P=S+Math.max((f-g)/2,0),v=c.leftForLtr(C,p),T=Cn(_.borderRadius);s.beginPath(),Object.values(T).some(R=>R!==0)?Vi(s,{x:v,y:P,w:p,h:g,radius:T}):s.rect(v,P,p,g),s.fill(),O!==0&&s.stroke()}s.restore()},x=function(C,S,_){En(s,_.text,C,S+y/2,d,{strikethrough:_.hidden,textAlign:c.textAlign(_.textAlign)})},w=this.isHorizontal(),E=this._computeTitleHeight();w?m={x:We(o,this.left+u,this.right-i[0]),y:this.top+u+E,line:0}:m={x:this.left+u,y:We(o,this.top+E+u,this.bottom-n[0].height),line:0},wd(this.ctx,e.textDirection);const k=y+u;this.legendItems.forEach((C,S)=>{s.strokeStyle=C.fontColor,s.fillStyle=C.fontColor;const _=s.measureText(C.text).width,O=c.textAlign(C.textAlign||(C.textAlign=a.textAlign)),P=p+h+_;let v=m.x,T=m.y;c.setWidth(this.width),w?S>0&&v+P+u>this.right&&(T=m.y+=k,m.line++,v=m.x=We(o,this.left+u,this.right-i[m.line])):S>0&&T+k>this.bottom&&(v=m.x=v+n[m.line].width+u,m.line++,T=m.y=We(o,this.top+E+u,this.bottom-n[m.line].height));const R=c.x(v);if(b(R,T,C),v=Jk(O,v+p+h,w?v+P:this.right,e.rtl),x(c.x(v),T,C),w)m.x+=P+u;else if(typeof C.text!="string"){const U=d.lineHeight;m.y+=Hu(C,U)+u}else m.y+=k}),Ed(this.ctx,e.textDirection)}drawTitle(){const e=this.options,n=e.title,i=Fe(n.font),s=He(n.padding);if(!n.display)return;const o=qn(e.rtl,this.left,this.width),a=this.ctx,l=n.position,c=i.size/2,d=s.top+c;let u,f=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+d,f=We(e.align,f,this.right-h);else{const p=this.columnSizes.reduce((g,y)=>Math.max(g,y.height),0);u=d+We(e.align,this.top,this.bottom-p-e.labels.padding-this._computeTitleHeight())}const m=We(l,f,f+h);a.textAlign=o.textAlign(gr(l)),a.textBaseline="middle",a.strokeStyle=n.color,a.fillStyle=n.color,a.font=i.string,En(a,n.text,m,u,i)}_computeTitleHeight(){const e=this.options.title,n=Fe(e.font),i=He(e.padding);return e.display?n.lineHeight+i.height:0}_getLegendItemAt(e,n){let i,s,o;if(It(e,this.left,this.right)&&It(n,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],It(e,s.left,s.left+s.width)&&It(n,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(e){const n=this.options;if(!wC(e.type,n))return;const i=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const s=this._hoveredItem,o=xC(s,i);s&&!o&&ke(n.onLeave,[e,s,this],this),this._hoveredItem=i,i&&!o&&ke(n.onHover,[e,i,this],this)}else i&&ke(n.onClick,[e,i,this],this)}}function _C(t,e,n,i,s){const o=kC(i,t,e,n),a=SC(s,i,e.lineHeight);return{itemWidth:o,itemHeight:a}}function kC(t,e,n,i){let s=t.text;return s&&typeof s!="string"&&(s=s.reduce((o,a)=>o.length>a.length?o:a)),e+n.size/2+i.measureText(s).width}function SC(t,e,n){let i=t;return typeof e.text!="string"&&(i=Hu(e,n)),i}function Hu(t,e){const n=t.text?t.text.length:0;return e*n}function wC(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var qu={id:"legend",_element:Wu,start(t,e,n){const i=t.legend=new Wu({ctx:t.ctx,options:n,chart:t});je.configure(t,i,n),je.addBox(t,i)},stop(t){je.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const i=t.legend;je.configure(t,i,n),i.options=n},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,n){const i=e.datasetIndex,s=n.chart;s.isDatasetVisible(i)?(s.hide(i),e.hidden=!0):(s.show(i),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:s,color:o,useBorderRadius:a,borderRadius:l}}=t.legend.options;return t._getSortedDatasetMetas().map(c=>{const d=c.controller.getStyle(n?0:void 0),u=He(d.borderWidth);return{text:e[c.index].label,fillStyle:d.backgroundColor,fontColor:o,hidden:!c.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:d.borderColor,pointStyle:i||d.pointStyle,rotation:d.rotation,textAlign:s||d.textAlign,borderRadius:a&&(l||d.borderRadius),datasetIndex:c.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class Yr extends vt{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,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=e,this.height=this.bottom=n;const s=Oe(i.text)?i.text.length:1;this._padding=He(i.padding);const o=s*Fe(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:n,left:i,bottom:s,right:o,options:a}=this,l=a.align;let c=0,d,u,f;return this.isHorizontal()?(u=We(l,i,o),f=n+e,d=o-i):(a.position==="left"?(u=i+e,f=We(l,s,n),c=Se*-.5):(u=o-e,f=We(l,n,s),c=Se*.5),d=s-n),{titleX:u,titleY:f,maxWidth:d,rotation:c}}draw(){const e=this.ctx,n=this.options;if(!n.display)return;const i=Fe(n.font),o=i.lineHeight/2+this._padding.top,{titleX:a,titleY:l,maxWidth:c,rotation:d}=this._drawArgs(o);En(e,n.text,0,0,i,{color:n.color,maxWidth:c,rotation:d,textAlign:gr(n.align),textBaseline:"middle",translation:[a,l]})}}function EC(t,e){const n=new Yr({ctx:t.ctx,options:e,chart:t});je.configure(t,n,e),je.addBox(t,n),t.titleBlock=n}var Yu={id:"title",_element:Yr,start(t,e,n){EC(t,n)},stop(t){const e=t.titleBlock;je.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const i=t.titleBlock;je.configure(t,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 oo=new WeakMap;var Ku={id:"subtitle",start(t,e,n){const i=new Yr({ctx:t.ctx,options:n,chart:t});je.configure(t,i,n),je.addBox(t,i),oo.set(t,i)},stop(t){je.removeBox(t,oo.get(t)),oo.delete(t)},beforeUpdate(t,e,n){const i=oo.get(t);je.configure(t,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Qi={average(t){if(!t.length)return!1;let e,n,i=new Set,s=0,o=0;for(e=0,n=t.length;e<n;++e){const l=t[e].element;if(l&&l.hasValue()){const c=l.tooltipPosition();i.add(c.x),s+=c.y,++o}}return o===0||i.size===0?!1:{x:[...i].reduce((l,c)=>l+c)/i.size,y:s/o}},nearest(t,e){if(!t.length)return!1;let n=e.x,i=e.y,s=Number.POSITIVE_INFINITY,o,a,l;for(o=0,a=t.length;o<a;++o){const c=t[o].element;if(c&&c.hasValue()){const d=c.getCenterPoint(),u=mr(e,d);u<s&&(s=u,l=c)}}if(l){const c=l.tooltipPosition();n=c.x,i=c.y}return{x:n,y:i}}};function Dt(t,e){return e&&(Oe(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Wt(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
181
181
  `)>-1?t.split(`
182
- `):t}function OC(t,e){const{element:n,datasetIndex:i,index:s}=e,o=t.getDatasetMeta(i).controller,{label:a,value:l}=o.getLabelAndValue(s);return{chart:t,label:a,parsed:o.getParsed(s),raw:t.data.datasets[i].data[s],formattedValue:l,dataset:o.getDataset(),dataIndex:s,datasetIndex:i,element:n}}function Xu(t,e){const n=t.chart.ctx,{body:i,footer:s,title:o}=t,{boxWidth:a,boxHeight:l}=e,c=Fe(e.bodyFont),d=Fe(e.titleFont),u=Fe(e.footerFont),f=o.length,h=s.length,m=i.length,p=He(e.padding);let g=p.height,y=0,b=i.reduce((E,k)=>E+k.before.length+k.lines.length+k.after.length,0);if(b+=t.beforeBody.length+t.afterBody.length,f&&(g+=f*d.lineHeight+(f-1)*e.titleSpacing+e.titleMarginBottom),b){const E=e.displayColors?Math.max(l,c.lineHeight):c.lineHeight;g+=m*E+(b-m)*c.lineHeight+(b-1)*e.bodySpacing}h&&(g+=e.footerMarginTop+h*u.lineHeight+(h-1)*e.footerSpacing);let x=0;const w=function(E){y=Math.max(y,n.measureText(E).width+x)};return n.save(),n.font=d.string,be(t.title,w),n.font=c.string,be(t.beforeBody.concat(t.afterBody),w),x=e.displayColors?a+2+e.boxPadding:0,be(i,E=>{be(E.before,w),be(E.lines,w),be(E.after,w)}),x=0,n.font=u.string,be(t.footer,w),n.restore(),y+=p.width,{width:y,height:g}}function vC(t,e){const{y:n,height:i}=e;return n<i/2?"top":n>t.height-i/2?"bottom":"center"}function NC(t,e,n,i){const{x:s,width:o}=i,a=n.caretSize+n.caretPadding;if(t==="left"&&s+o+a>e.width||t==="right"&&s-o-a<0)return!0}function DC(t,e,n,i){const{x:s,width:o}=n,{width:a,chartArea:{left:l,right:c}}=t;let d="center";return i==="center"?d=s<=(l+c)/2?"left":"right":s<=o/2?d="left":s>=a-o/2&&(d="right"),NC(d,t,e,n)&&(d="center"),d}function Gu(t,e,n){const i=n.yAlign||e.yAlign||vC(t,n);return{xAlign:n.xAlign||e.xAlign||DC(t,e,n,i),yAlign:i}}function TC(t,e){let{x:n,width:i}=t;return e==="right"?n-=i:e==="center"&&(n-=i/2),n}function BC(t,e,n){let{y:i,height:s}=t;return e==="top"?i+=n:e==="bottom"?i-=s+n:i-=s/2,i}function Ju(t,e,n,i){const{caretSize:s,caretPadding:o,cornerRadius:a}=t,{xAlign:l,yAlign:c}=n,d=s+o,{topLeft:u,topRight:f,bottomLeft:h,bottomRight:m}=Cn(a);let p=TC(e,l);const g=BC(e,c,d);return c==="center"?l==="left"?p+=d:l==="right"&&(p-=d):l==="left"?p-=Math.max(u,h)+s:l==="right"&&(p+=Math.max(f,m)+s),{x:Le(p,0,i.width-e.width),y:Le(g,0,i.height-e.height)}}function ro(t,e,n){const i=He(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-i.right:t.x+i.left}function Qu(t){return Dt([],Wt(t))}function PC(t,e,n){return rn(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function Zu(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const ef={beforeTitle:Lt,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex<i)return n[e.dataIndex]}return""},afterTitle:Lt,beforeBody:Lt,beforeLabel:Lt,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return fe(n)||(e+=n),e},labelColor(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.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(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Lt,afterBody:Lt,beforeFooter:Lt,footer:Lt,afterFooter:Lt};function Je(t,e,n,i){const s=t[e].call(n,i);return typeof s>"u"?ef[e].call(n,i):s}class Kr extends vt{constructor(e){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=e.chart,this.options=e.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(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const n=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&n.options.animation&&i.animations,o=new Nr(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=PC(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:i}=n,s=Je(i,"beforeTitle",this,e),o=Je(i,"title",this,e),a=Je(i,"afterTitle",this,e);let l=[];return l=Dt(l,Wt(s)),l=Dt(l,Wt(o)),l=Dt(l,Wt(a)),l}getBeforeBody(e,n){return Qu(Je(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:i}=n,s=[];return be(e,o=>{const a={before:[],lines:[],after:[]},l=Zu(i,o);Dt(a.before,Wt(Je(l,"beforeLabel",this,o))),Dt(a.lines,Je(l,"label",this,o)),Dt(a.after,Wt(Je(l,"afterLabel",this,o))),s.push(a)}),s}getAfterBody(e,n){return Qu(Je(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:i}=n,s=Je(i,"beforeFooter",this,e),o=Je(i,"footer",this,e),a=Je(i,"afterFooter",this,e);let l=[];return l=Dt(l,Wt(s)),l=Dt(l,Wt(o)),l=Dt(l,Wt(a)),l}_createItems(e){const n=this._active,i=this.chart.data,s=[],o=[],a=[];let l=[],c,d;for(c=0,d=n.length;c<d;++c)l.push(OC(this.chart,n[c]));return e.filter&&(l=l.filter((u,f,h)=>e.filter(u,f,h,i))),e.itemSort&&(l=l.sort((u,f)=>e.itemSort(u,f,i))),be(l,u=>{const f=Zu(e.callbacks,u);s.push(Je(f,"labelColor",this,u)),o.push(Je(f,"labelPointStyle",this,u)),a.push(Je(f,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=l,l}update(e,n){const i=this.options.setContext(this.getContext()),s=this._active;let o,a=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const l=Qi[i.position].call(this,s,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const c=this._size=Xu(this,i),d=Object.assign({},l,c),u=Gu(this.chart,i,d),f=Ju(i,d,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:f.x,y:f.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,i,s){const o=this.getCaretPosition(e,i,s);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(e,n,i){const{xAlign:s,yAlign:o}=this,{caretSize:a,cornerRadius:l}=i,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=Cn(l),{x:h,y:m}=e,{width:p,height:g}=n;let y,b,x,w,E,k;return o==="center"?(E=m+g/2,s==="left"?(y=h,b=y-a,w=E+a,k=E-a):(y=h+p,b=y+a,w=E-a,k=E+a),x=y):(s==="left"?b=h+Math.max(c,u)+a:s==="right"?b=h+p-Math.max(d,f)-a:b=this.caretX,o==="top"?(w=m,E=w-a,y=b-a,x=b+a):(w=m+g,E=w+a,y=b+a,x=b-a),k=w),{x1:y,x2:b,x3:x,y1:w,y2:E,y3:k}}drawTitle(e,n,i){const s=this.title,o=s.length;let a,l,c;if(o){const d=qn(i.rtl,this.x,this.width);for(e.x=ro(this,i.titleAlign,i),n.textAlign=d.textAlign(i.titleAlign),n.textBaseline="middle",a=Fe(i.titleFont),l=i.titleSpacing,n.fillStyle=i.titleColor,n.font=a.string,c=0;c<o;++c)n.fillText(s[c],d.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+l,c+1===o&&(e.y+=i.titleMarginBottom-l)}}_drawColorBox(e,n,i,s,o){const a=this.labelColors[i],l=this.labelPointStyles[i],{boxHeight:c,boxWidth:d}=o,u=Fe(o.bodyFont),f=ro(this,"left",o),h=s.x(f),m=c<u.lineHeight?(u.lineHeight-c)/2:0,p=n.y+m;if(o.usePointStyle){const g={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},y=s.leftForLtr(h,d)+d/2,b=p+c/2;e.strokeStyle=o.multiKeyBackground,e.fillStyle=o.multiKeyBackground,kr(e,g,y,b),e.strokeStyle=a.borderColor,e.fillStyle=a.backgroundColor,kr(e,g,y,b)}else{e.lineWidth=de(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,e.strokeStyle=a.borderColor,e.setLineDash(a.borderDash||[]),e.lineDashOffset=a.borderDashOffset||0;const g=s.leftForLtr(h,d),y=s.leftForLtr(s.xPlus(h,1),d-2),b=Cn(a.borderRadius);Object.values(b).some(x=>x!==0)?(e.beginPath(),e.fillStyle=o.multiKeyBackground,Vi(e,{x:g,y:p,w:d,h:c,radius:b}),e.fill(),e.stroke(),e.fillStyle=a.backgroundColor,e.beginPath(),Vi(e,{x:y,y:p+1,w:d-2,h:c-2,radius:b}),e.fill()):(e.fillStyle=o.multiKeyBackground,e.fillRect(g,p,d,c),e.strokeRect(g,p,d,c),e.fillStyle=a.backgroundColor,e.fillRect(y,p+1,d-2,c-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,n,i){const{body:s}=this,{bodySpacing:o,bodyAlign:a,displayColors:l,boxHeight:c,boxWidth:d,boxPadding:u}=i,f=Fe(i.bodyFont);let h=f.lineHeight,m=0;const p=qn(i.rtl,this.x,this.width),g=function(_){n.fillText(_,p.x(e.x+m),e.y+h/2),e.y+=h+o},y=p.textAlign(a);let b,x,w,E,k,C,S;for(n.textAlign=a,n.textBaseline="middle",n.font=f.string,e.x=ro(this,y,i),n.fillStyle=i.bodyColor,be(this.beforeBody,g),m=l&&y!=="right"?a==="center"?d/2+u:d+2+u:0,E=0,C=s.length;E<C;++E){for(b=s[E],x=this.labelTextColors[E],n.fillStyle=x,be(b.before,g),w=b.lines,l&&w.length&&(this._drawColorBox(n,e,E,p,i),h=Math.max(f.lineHeight,c)),k=0,S=w.length;k<S;++k)g(w[k]),h=f.lineHeight;be(b.after,g)}m=0,h=f.lineHeight,be(this.afterBody,g),e.y-=o}drawFooter(e,n,i){const s=this.footer,o=s.length;let a,l;if(o){const c=qn(i.rtl,this.x,this.width);for(e.x=ro(this,i.footerAlign,i),e.y+=i.footerMarginTop,n.textAlign=c.textAlign(i.footerAlign),n.textBaseline="middle",a=Fe(i.footerFont),n.fillStyle=i.footerColor,n.font=a.string,l=0;l<o;++l)n.fillText(s[l],c.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+i.footerSpacing}}drawBackground(e,n,i,s){const{xAlign:o,yAlign:a}=this,{x:l,y:c}=e,{width:d,height:u}=i,{topLeft:f,topRight:h,bottomLeft:m,bottomRight:p}=Cn(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(l+f,c),a==="top"&&this.drawCaret(e,n,i,s),n.lineTo(l+d-h,c),n.quadraticCurveTo(l+d,c,l+d,c+h),a==="center"&&o==="right"&&this.drawCaret(e,n,i,s),n.lineTo(l+d,c+u-p),n.quadraticCurveTo(l+d,c+u,l+d-p,c+u),a==="bottom"&&this.drawCaret(e,n,i,s),n.lineTo(l+m,c+u),n.quadraticCurveTo(l,c+u,l,c+u-m),a==="center"&&o==="left"&&this.drawCaret(e,n,i,s),n.lineTo(l,c+f),n.quadraticCurveTo(l,c,l+f,c),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){const a=Qi[e.position].call(this,this._active,this._eventPosition);if(!a)return;const l=this._size=Xu(this,e),c=Object.assign({},a,this._size),d=Gu(n,e,c),u=Ju(e,c,d,n);(s._to!==u.x||o._to!==u.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=l.width,this.height=l.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(e){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 a=He(n.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&l&&(e.save(),e.globalAlpha=i,this.drawBackground(o,e,s,n),wd(e,n.textDirection),o.y+=a.top,this.drawTitle(o,e,n),this.drawBody(o,e,n),this.drawFooter(o,e,n),Ed(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const i=this._active,s=e.map(({datasetIndex:l,index:c})=>{const d=this.chart.getDatasetMeta(l);if(!d)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:d.data[c],index:c}}),o=!$s(i,s),a=this._positionChanged(s,n);(o||a)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],a=this._getActiveElements(e,o,n,i),l=this._positionChanged(a,e),c=n||!$s(a,o)||l;return c&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),c}_getActiveElements(e,n,i,s){const o=this.options;if(e.type==="mouseout")return[];if(!s)return n.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const a=this.chart.getElementsAtEventForMode(e,o.mode,o,i);return o.reverse&&a.reverse(),a}_positionChanged(e,n){const{caretX:i,caretY:s,options:o}=this,a=Qi[o.position].call(this,e,n);return a!==!1&&(i!==a.x||s!==a.y)}}z(Kr,"positioners",Qi);var tf={id:"tooltip",_element:Kr,positioners:Qi,afterInit(t,e,n){n&&(t.tooltip=new Kr({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.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:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.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:ef},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},nf=Object.freeze({__proto__:null,Colors:Bu,Decimation:Mu,Filler:zu,Legend:qu,SubTitle:Ku,Title:Yu,Tooltip:tf});const AC=(t,e,n,i)=>(typeof e=="string"?(n=t.push(e)-1,i.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function MC(t,e,n,i){const s=t.indexOf(e);if(s===-1)return AC(t,e,n,i);const o=t.lastIndexOf(e);return s!==o?n:s}const VC=(t,e)=>t===null?null:Le(Math.round(t),0,e);function sf(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class ao extends ln{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){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(e)}parse(e,n){if(fe(e))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===e?n:MC(i,e,ae(n,e),this._addedLabels),VC(n,i.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(i=0),n||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const e=this.min,n=this.max,i=this.options.offset,s=[];let o=this.getLabels();o=e===0&&n===o.length-1?o:o.slice(e,n+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=e;a<=n;a++)s.push({value:a});return s}getLabelForValue(e){return sf.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}z(ao,"id","category"),z(ao,"defaults",{ticks:{callback:sf}});function RC(t,e){const n=[],{bounds:s,step:o,min:a,max:l,precision:c,count:d,maxTicks:u,maxDigits:f,includeBounds:h}=t,m=o||1,p=u-1,{min:g,max:y}=e,b=!fe(a),x=!fe(l),w=!fe(d),E=(y-g)/(f+1);let k=Kc((y-g)/p/m)*m,C,S,_,O;if(k<1e-14&&!b&&!x)return[{value:g},{value:y}];O=Math.ceil(y/k)-Math.floor(g/k),O>p&&(k=Kc(O*k/p/m)*m),fe(c)||(C=Math.pow(10,c),k=Math.ceil(k*C)/C),s==="ticks"?(S=Math.floor(g/k)*k,_=Math.ceil(y/k)*k):(S=g,_=y),b&&x&&o&&Hk((l-a)/o,k/1e3)?(O=Math.round(Math.min((l-a)/k,u)),k=(l-a)/O,S=a,_=l):w?(S=b?a:S,_=x?l:_,O=d-1,k=(_-S)/O):(O=(_-S)/k,Di(O,Math.round(O),k/1e3)?O=Math.round(O):O=Math.ceil(O));const P=Math.max(Gc(k),Gc(S));C=Math.pow(10,fe(c)?P:c),S=Math.round(S*C)/C,_=Math.round(_*C)/C;let v=0;for(b&&(h&&S!==a?(n.push({value:a}),S<a&&v++,Di(Math.round((S+v*k)*C)/C,a,of(a,E,t))&&v++):S<a&&v++);v<O;++v){const T=Math.round((S+v*k)*C)/C;if(x&&T>l)break;n.push({value:T})}return x&&h&&_!==l?n.length&&Di(n[n.length-1].value,l,of(l,E,t))?n[n.length-1].value=l:n.push({value:l}):(!x||_===l)&&n.push({value:_}),n}function of(t,e,{horizontal:n,minRotation:i}){const s=yt(i),o=(n?Math.sin(s):Math.cos(s))||.001,a=.75*e*(""+t).length;return Math.min(e/o,a)}class lo extends ln{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,n){return fe(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:s,max:o}=this;const a=c=>s=n?s:c,l=c=>o=i?o:c;if(e){const c=Ct(s),d=Ct(o);c<0&&d<0?l(0):c>0&&d>0&&a(0)}if(s===o){let c=o===0?1:Math.abs(o*.05);l(o+c),e||a(s-c)}this.min=s,this.max=o}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=e,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 e=this.options,n=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:e.bounds,min:e.min,max:e.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,a=RC(s,o);return e.bounds==="ticks"&&Xc(a,this,"value"),e.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const e=this.ticks;let n=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const s=(i-n)/Math.max(e.length-1,1)/2;n-=s,i+=s}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(e){return Pi(e,this.chart.options.locale,this.options.ticks.format)}}class co extends lo{determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=Pe(e)?e:0,this.max=Pe(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,i=yt(this.options.ticks.minRotation),s=(e?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/s))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}z(co,"id","linear"),z(co,"defaults",{ticks:{callback:Ai.formatters.numeric}});const Zi=t=>Math.floor(on(t)),Tn=(t,e)=>Math.pow(10,Zi(t)+e);function rf(t){return t/Math.pow(10,Zi(t))===1}function af(t,e,n){const i=Math.pow(10,n),s=Math.floor(t/i);return Math.ceil(e/i)-s}function FC(t,e){const n=e-t;let i=Zi(n);for(;af(t,e,i)>10;)i++;for(;af(t,e,i)<10;)i--;return Math.min(i,Zi(t))}function $C(t,{min:e,max:n}){e=nt(t.min,e);const i=[],s=Zi(e);let o=FC(e,n),a=o<0?Math.pow(10,Math.abs(o)):1;const l=Math.pow(10,o),c=s>o?Math.pow(10,s):0,d=Math.round((e-c)*a)/a,u=Math.floor((e-c)/l/10)*l*10;let f=Math.floor((d-u)/Math.pow(10,o)),h=nt(t.min,Math.round((c+u+f*Math.pow(10,o))*a)/a);for(;h<n;)i.push({value:h,major:rf(h),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(o++,f=2,a=o>=0?1:a),h=Math.round((c+u+f*Math.pow(10,o))*a)/a;const m=nt(t.max,h);return i.push({value:m,major:rf(m),significand:f}),i}class uo extends ln{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,n){const i=lo.prototype.parse.apply(this,[e,n]);if(i===0){this._zero=!0;return}return Pe(i)&&i>0?i:null}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=Pe(e)?Math.max(0,e):null,this.max=Pe(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Pe(this._userMin)&&(this.min=e===Tn(this.min,0)?Tn(this.min,-1):Tn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let i=this.min,s=this.max;const o=l=>i=e?i:l,a=l=>s=n?s:l;i===s&&(i<=0?(o(1),a(10)):(o(Tn(i,-1)),a(Tn(s,1)))),i<=0&&o(Tn(s,-1)),s<=0&&a(Tn(i,1)),this.min=i,this.max=s}buildTicks(){const e=this.options,n={min:this._userMin,max:this._userMax},i=$C(n,this);return e.bounds==="ticks"&&Xc(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(e){return e===void 0?"0":Pi(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=on(e),this._valueRange=on(this.max)-on(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(on(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const n=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+n*this._valueRange)}}z(uo,"id","logarithmic"),z(uo,"defaults",{ticks:{callback:Ai.formatters.logarithmic,major:{enabled:!0}}});function Xr(t){const e=t.ticks;if(e.display&&t.display){const n=He(e.backdropPadding);return ae(e.font&&e.font.size,Ee.font.size)+n.height}return 0}function LC(t,e,n){return n=Oe(n)?n:[n],{w:lS(t,e.string,n),h:n.length*e.lineHeight}}function lf(t,e,n,i,s){return t===i||t===s?{start:e-n/2,end:e+n/2}:t<i||t>s?{start:e-n,end:e}:{start:e,end:e+n}}function IC(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},n=Object.assign({},e),i=[],s=[],o=t._pointLabels.length,a=t.options.pointLabels,l=a.centerPointLabels?Se/o:0;for(let c=0;c<o;c++){const d=a.setContext(t.getPointLabelContext(c));s[c]=d.padding;const u=t.getPointPosition(c,t.drawingArea+s[c],l),f=Fe(d.font),h=LC(t.ctx,f,t._pointLabels[c]);i[c]=h;const m=it(t.getIndexAngle(c)+l),p=Math.round(hr(m)),g=lf(p,u.x,h.w,0,180),y=lf(p,u.y,h.h,90,270);jC(n,e,m,g,y)}t.setCenterPoint(e.l-n.l,n.r-e.r,e.t-n.t,n.b-e.b),t._pointLabelItems=WC(t,i,s)}function jC(t,e,n,i,s){const o=Math.abs(Math.sin(n)),a=Math.abs(Math.cos(n));let l=0,c=0;i.start<e.l?(l=(e.l-i.start)/o,t.l=Math.min(t.l,e.l-l)):i.end>e.r&&(l=(i.end-e.r)/o,t.r=Math.max(t.r,e.r+l)),s.start<e.t?(c=(e.t-s.start)/a,t.t=Math.min(t.t,e.t-c)):s.end>e.b&&(c=(s.end-e.b)/a,t.b=Math.max(t.b,e.b+c))}function zC(t,e,n){const i=t.drawingArea,{extra:s,additionalAngle:o,padding:a,size:l}=n,c=t.getPointPosition(e,i+s+a,o),d=Math.round(hr(it(c.angle+Me))),u=YC(c.y,l.h,d),f=HC(d),h=qC(c.x,l.w,f);return{visible:!0,x:c.x,y:u,textAlign:f,left:h,top:u,right:h+l.w,bottom:u+l.h}}function UC(t,e){if(!e)return!0;const{left:n,top:i,right:s,bottom:o}=t;return!(zt({x:n,y:i},e)||zt({x:n,y:o},e)||zt({x:s,y:i},e)||zt({x:s,y:o},e))}function WC(t,e,n){const i=[],s=t._pointLabels.length,o=t.options,{centerPointLabels:a,display:l}=o.pointLabels,c={extra:Xr(o)/2,additionalAngle:a?Se/s:0};let d;for(let u=0;u<s;u++){c.padding=n[u],c.size=e[u];const f=zC(t,u,c);i.push(f),l==="auto"&&(f.visible=UC(f,d),f.visible&&(d=f))}return i}function HC(t){return t===0||t===180?"center":t<180?"left":"right"}function qC(t,e,n){return n==="right"?t-=e:n==="center"&&(t-=e/2),t}function YC(t,e,n){return n===90||n===270?t-=e/2:(n>270||n<90)&&(t-=e),t}function KC(t,e,n){const{left:i,top:s,right:o,bottom:a}=n,{backdropColor:l}=e;if(!fe(l)){const c=Cn(e.borderRadius),d=He(e.backdropPadding);t.fillStyle=l;const u=i-d.left,f=s-d.top,h=o-i+d.width,m=a-s+d.height;Object.values(c).some(p=>p!==0)?(t.beginPath(),Vi(t,{x:u,y:f,w:h,h:m,radius:c}),t.fill()):t.fillRect(u,f,h,m)}}function XC(t,e){const{ctx:n,options:{pointLabels:i}}=t;for(let s=e-1;s>=0;s--){const o=t._pointLabelItems[s];if(!o.visible)continue;const a=i.setContext(t.getPointLabelContext(s));KC(n,a,o);const l=Fe(a.font),{x:c,y:d,textAlign:u}=o;En(n,t._pointLabels[s],c,d+l.lineHeight/2,l,{color:a.color,textAlign:u,textBaseline:"middle"})}}function cf(t,e,n,i){const{ctx:s}=t;if(n)s.arc(t.xCenter,t.yCenter,e,0,we);else{let o=t.getPointPosition(0,e);s.moveTo(o.x,o.y);for(let a=1;a<i;a++)o=t.getPointPosition(a,e),s.lineTo(o.x,o.y)}}function GC(t,e,n,i,s){const o=t.ctx,a=e.circular,{color:l,lineWidth:c}=e;!a&&!i||!l||!c||n<0||(o.save(),o.strokeStyle=l,o.lineWidth=c,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),cf(t,n,a,i),o.closePath(),o.stroke(),o.restore())}function JC(t,e,n){return rn(t,{label:n,index:e,type:"pointLabel"})}class Gn extends lo{constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=He(Xr(this.options)/2),n=this.width=this.maxWidth-e.width,i=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+n/2+e.left),this.yCenter=Math.floor(this.top+i/2+e.top),this.drawingArea=Math.floor(Math.min(n,i)/2)}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!1);this.min=Pe(e)&&!isNaN(e)?e:0,this.max=Pe(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Xr(this.options))}generateTickLabels(e){lo.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((n,i)=>{const s=ke(this.options.pointLabels.callback,[n,i],this);return s||s===0?s:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const e=this.options;e.display&&e.pointLabels.display?IC(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,n,i,s){this.xCenter+=Math.floor((e-n)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,n,i,s))}getIndexAngle(e){const n=we/(this._pointLabels.length||1),i=this.options.startAngle||0;return it(e*n+yt(i))}getDistanceFromCenterForValue(e){if(fe(e))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*n:(e-this.min)*n}getValueForDistanceFromCenter(e){if(fe(e))return NaN;const n=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(e){const n=this._pointLabels||[];if(e>=0&&e<n.length){const i=n[e];return JC(this.getContext(),e,i)}}getPointPosition(e,n,i=0){const s=this.getIndexAngle(e)-Me+i;return{x:Math.cos(s)*n+this.xCenter,y:Math.sin(s)*n+this.yCenter,angle:s}}getPointPositionForValue(e,n){return this.getPointPosition(e,this.getDistanceFromCenterForValue(n))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:n,top:i,right:s,bottom:o}=this._pointLabelItems[e];return{left:n,top:i,right:s,bottom:o}}drawBackground(){const{backgroundColor:e,grid:{circular:n}}=this.options;if(e){const i=this.ctx;i.save(),i.beginPath(),cf(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),i.closePath(),i.fillStyle=e,i.fill(),i.restore()}}drawGrid(){const e=this.ctx,n=this.options,{angleLines:i,grid:s,border:o}=n,a=this._pointLabels.length;let l,c,d;if(n.pointLabels.display&&XC(this,a),s.display&&this.ticks.forEach((u,f)=>{if(f!==0||f===0&&this.min<0){c=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(f),m=s.setContext(h),p=o.setContext(h);GC(this,m,c,a,p)}}),i.display){for(e.save(),l=a-1;l>=0;l--){const u=i.setContext(this.getPointLabelContext(l)),{color:f,lineWidth:h}=u;!h||!f||(e.lineWidth=h,e.strokeStyle=f,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,c=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),d=this.getPointPosition(l,c),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(d.x,d.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let o,a;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(s),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((l,c)=>{if(c===0&&this.min>=0&&!n.reverse)return;const d=i.setContext(this.getContext(c)),u=Fe(d.font);if(o=this.getDistanceFromCenterForValue(this.ticks[c].value),d.showLabelBackdrop){e.font=u.string,a=e.measureText(l.label).width,e.fillStyle=d.backdropColor;const f=He(d.backdropPadding);e.fillRect(-a/2-f.left,-o-u.size/2-f.top,a+f.width,u.size+f.height)}En(e,l.label,0,-o,u,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),e.restore()}drawTitle(){}}z(Gn,"id","radialLinear"),z(Gn,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ai.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),z(Gn,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),z(Gn,"descriptors",{angleLines:{_fallback:"grid"}});const fo={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}},Qe=Object.keys(fo);function df(t,e){return t-e}function uf(t,e){if(fe(e))return null;const n=t._adapter,{parser:i,round:s,isoWeekday:o}=t._parseOpts;let a=e;return typeof i=="function"&&(a=i(a)),Pe(a)||(a=typeof i=="string"?n.parse(a,i):n.parse(a)),a===null?null:(s&&(a=s==="week"&&(Un(o)||o===!0)?n.startOf(a,"isoWeek",o):n.startOf(a,s)),+a)}function ff(t,e,n,i){const s=Qe.length;for(let o=Qe.indexOf(t);o<s-1;++o){const a=fo[Qe[o]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-e)/(l*a.size))<=i)return Qe[o]}return Qe[s-1]}function QC(t,e,n,i,s){for(let o=Qe.length-1;o>=Qe.indexOf(n);o--){const a=Qe[o];if(fo[a].common&&t._adapter.diff(s,i,a)>=e-1)return a}return Qe[n?Qe.indexOf(n):0]}function ZC(t){for(let e=Qe.indexOf(t)+1,n=Qe.length;e<n;++e)if(fo[Qe[e]].common)return Qe[e]}function hf(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:i,hi:s}=pr(n,e),o=n[i]>=e?n[i]:n[s];t[o]=!0}}function e1(t,e,n,i){const s=t._adapter,o=+s.startOf(e[0].value,i),a=e[e.length-1].value;let l,c;for(l=o;l<=a;l=+s.add(l,1,i))c=n[l],c>=0&&(e[c].major=!0);return e}function mf(t,e,n){const i=[],s={},o=e.length;let a,l;for(a=0;a<o;++a)l=e[a],s[l]=a,i.push({value:l,major:!1});return o===0||!n?i:e1(t,i,s,n)}class Jn extends ln{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,n={}){const i=e.time||(e.time={}),s=this._adapter=new Wd._date(e.adapters.date);s.init(n),vi(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(e),this._normalized=n.normalized}parse(e,n){return e===void 0?null:uf(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,n=this._adapter,i=e.time.unit||"day";let{min:s,max:o,minDefined:a,maxDefined:l}=this.getUserBounds();function c(d){!a&&!isNaN(d.min)&&(s=Math.min(s,d.min)),!l&&!isNaN(d.max)&&(o=Math.max(o,d.max))}(!a||!l)&&(c(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&c(this.getMinMax(!1))),s=Pe(s)&&!isNaN(s)?s:+n.startOf(Date.now(),i),o=Pe(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 e=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return e.length&&(n=e[0],i=e[e.length-1]),{min:n,max:i}}buildTicks(){const e=this.options,n=e.time,i=e.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,a=this.max,l=Xk(s,o,a);return this._unit=n.unit||(i.autoSkip?ff(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):QC(this,l.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:ZC(this._unit),this.initOffsets(s),e.reverse&&l.reverse(),mf(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let n=0,i=0,s,o;this.options.offset&&e.length&&(s=this.getDecimalForValue(e[0]),e.length===1?n=1-s:n=(this.getDecimalForValue(e[1])-s)/2,o=this.getDecimalForValue(e[e.length-1]),e.length===1?i=o:i=(o-this.getDecimalForValue(e[e.length-2]))/2);const a=e.length<3?.5:.25;n=Le(n,0,a),i=Le(i,0,a),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const e=this._adapter,n=this.min,i=this.max,s=this.options,o=s.time,a=o.unit||ff(o.minUnit,n,i,this._getLabelCapacity(n)),l=ae(s.ticks.stepSize,1),c=a==="week"?o.isoWeekday:!1,d=Un(c)||c===!0,u={};let f=n,h,m;if(d&&(f=+e.startOf(f,"isoWeek",c)),f=+e.startOf(f,d?"day":a),e.diff(i,n,a)>1e5*l)throw new Error(n+" and "+i+" are too far apart with stepSize of "+l+" "+a);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(h=f,m=0;h<i;h=+e.add(h,l,a),m++)hf(u,h,p);return(h===i||s.bounds==="ticks"||m===1)&&hf(u,h,p),Object.keys(u).sort(df).map(g=>+g)}getLabelForValue(e){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(e,i.tooltipFormat):n.format(e,i.displayFormats.datetime)}format(e,n){const s=this.options.time.displayFormats,o=this._unit,a=n||s[o];return this._adapter.format(e,a)}_tickFormatFunction(e,n,i,s){const o=this.options,a=o.ticks.callback;if(a)return ke(a,[e,n,i],this);const l=o.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&l[c],f=d&&l[d],h=i[n],m=d&&f&&h&&h.major;return this._adapter.format(e,s||(m?f:u))}generateTickLabels(e){let n,i,s;for(n=0,i=e.length;n<i;++n)s=e[n],s.label=this._tickFormatFunction(s.value,n,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const n=this._offsets,i=this.getDecimalForValue(e);return this.getPixelForDecimal((n.start+i)*n.factor)}getValueForPixel(e){const n=this._offsets,i=this.getDecimalForPixel(e)/n.factor-n.end;return this.min+i*(this.max-this.min)}_getLabelSize(e){const n=this.options.ticks,i=this.ctx.measureText(e).width,s=yt(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(s),a=Math.sin(s),l=this._resolveTickFontOptions(0).size;return{w:i*o+l*a,h:i*a+l*o}}_getLabelCapacity(e){const n=this.options.time,i=n.displayFormats,s=i[n.unit]||i.millisecond,o=this._tickFormatFunction(e,0,mf(this,[e],this._majorUnit),s),a=this._getLabelSize(o),l=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return l>0?l:1}getDataTimestamps(){let e=this._cache.data||[],n,i;if(e.length)return e;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)e=e.concat(s[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let n,i;if(e.length)return e;const s=this.getLabels();for(n=0,i=s.length;n<i;++n)e.push(uf(this,s[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return ed(e.sort(df))}}z(Jn,"id","time"),z(Jn,"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 ho(t,e,n){let i=0,s=t.length-1,o,a,l,c;n?(e>=t[i].pos&&e<=t[s].pos&&({lo:i,hi:s}=jt(t,"pos",e)),{pos:o,time:l}=t[i],{pos:a,time:c}=t[s]):(e>=t[i].time&&e<=t[s].time&&({lo:i,hi:s}=jt(t,"time",e)),{time:o,pos:l}=t[i],{time:a,pos:c}=t[s]);const d=a-o;return d?l+(c-l)*(e-o)/d:l}class mo extends Jn{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(e);this._minPos=ho(n,this.min),this._tableRange=ho(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:i}=this,s=[],o=[];let a,l,c,d,u;for(a=0,l=e.length;a<l;++a)d=e[a],d>=n&&d<=i&&s.push(d);if(s.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(a=0,l=s.length;a<l;++a)u=s[a+1],c=s[a-1],d=s[a],Math.round((u+c)/2)!==d&&o.push({time:d,pos:a/(l-1)});return o}_generate(){const e=this.min,n=this.max;let i=super.getDataTimestamps();return(!i.includes(e)||!i.length)&&i.splice(0,0,e),(!i.includes(n)||i.length===1)&&i.push(n),i.sort((s,o)=>s-o)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?e=this.normalize(n.concat(i)):e=n.length?n:i,e=this._cache.all=e,e}getDecimalForValue(e){return(ho(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,i=this.getDecimalForPixel(e)/n.factor-n.end;return ho(this._table,i*this._tableRange+this._minPos,!0)}}z(mo,"id","timeseries"),z(mo,"defaults",Jn.defaults);var pf=Object.freeze({__proto__:null,CategoryScale:ao,LinearScale:co,LogarithmicScale:uo,RadialLinearScale:Gn,TimeScale:Jn,TimeSeriesScale:mo});const gf=[Ud,Ou,nf,pf];Nt.register(...gf);const t1=Object.freeze(Object.defineProperty({__proto__:null,Animation:Pd,Animations:Nr,ArcElement:Xn,BarController:$i,BarElement:Ji,BasePlatform:Rr,BasicPlatform:Qd,BubbleController:Li,CategoryScale:ao,Chart:Nt,Colors:Bu,DatasetController:lt,Decimation:Mu,DomPlatform:iu,DoughnutController:an,Element:vt,Filler:zu,Interaction:qd,Legend:qu,LineController:Ii,LineElement:Ut,LinearScale:co,LogarithmicScale:uo,PieController:Xs,PointElement:Gi,PolarAreaController:Yn,RadarController:ji,RadialLinearScale:Gn,Scale:ln,ScatterController:zi,SubTitle:Ku,Ticks:Ai,TimeScale:Jn,TimeSeriesScale:mo,Title:Yu,Tooltip:tf,_adapters:Wd,_detectPlatform:su,animator:Ot,controllers:Ud,default:Nt,defaults:Ee,elements:Ou,layouts:je,plugins:nf,registerables:gf,registry:bt,scales:pf},Symbol.toStringTag,{value:"Module"}));Ie.default=r_,Ie.useEntitiesStore=Vl,Ie.useGlobalConfigsStore=ot,Object.defineProperties(Ie,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
182
+ `):t}function CC(t,e){const{element:n,datasetIndex:i,index:s}=e,o=t.getDatasetMeta(i).controller,{label:a,value:l}=o.getLabelAndValue(s);return{chart:t,label:a,parsed:o.getParsed(s),raw:t.data.datasets[i].data[s],formattedValue:l,dataset:o.getDataset(),dataIndex:s,datasetIndex:i,element:n}}function Xu(t,e){const n=t.chart.ctx,{body:i,footer:s,title:o}=t,{boxWidth:a,boxHeight:l}=e,c=Fe(e.bodyFont),d=Fe(e.titleFont),u=Fe(e.footerFont),f=o.length,h=s.length,m=i.length,p=He(e.padding);let g=p.height,y=0,b=i.reduce((E,k)=>E+k.before.length+k.lines.length+k.after.length,0);if(b+=t.beforeBody.length+t.afterBody.length,f&&(g+=f*d.lineHeight+(f-1)*e.titleSpacing+e.titleMarginBottom),b){const E=e.displayColors?Math.max(l,c.lineHeight):c.lineHeight;g+=m*E+(b-m)*c.lineHeight+(b-1)*e.bodySpacing}h&&(g+=e.footerMarginTop+h*u.lineHeight+(h-1)*e.footerSpacing);let x=0;const w=function(E){y=Math.max(y,n.measureText(E).width+x)};return n.save(),n.font=d.string,be(t.title,w),n.font=c.string,be(t.beforeBody.concat(t.afterBody),w),x=e.displayColors?a+2+e.boxPadding:0,be(i,E=>{be(E.before,w),be(E.lines,w),be(E.after,w)}),x=0,n.font=u.string,be(t.footer,w),n.restore(),y+=p.width,{width:y,height:g}}function OC(t,e){const{y:n,height:i}=e;return n<i/2?"top":n>t.height-i/2?"bottom":"center"}function vC(t,e,n,i){const{x:s,width:o}=i,a=n.caretSize+n.caretPadding;if(t==="left"&&s+o+a>e.width||t==="right"&&s-o-a<0)return!0}function NC(t,e,n,i){const{x:s,width:o}=n,{width:a,chartArea:{left:l,right:c}}=t;let d="center";return i==="center"?d=s<=(l+c)/2?"left":"right":s<=o/2?d="left":s>=a-o/2&&(d="right"),vC(d,t,e,n)&&(d="center"),d}function Gu(t,e,n){const i=n.yAlign||e.yAlign||OC(t,n);return{xAlign:n.xAlign||e.xAlign||NC(t,e,n,i),yAlign:i}}function DC(t,e){let{x:n,width:i}=t;return e==="right"?n-=i:e==="center"&&(n-=i/2),n}function TC(t,e,n){let{y:i,height:s}=t;return e==="top"?i+=n:e==="bottom"?i-=s+n:i-=s/2,i}function Ju(t,e,n,i){const{caretSize:s,caretPadding:o,cornerRadius:a}=t,{xAlign:l,yAlign:c}=n,d=s+o,{topLeft:u,topRight:f,bottomLeft:h,bottomRight:m}=Cn(a);let p=DC(e,l);const g=TC(e,c,d);return c==="center"?l==="left"?p+=d:l==="right"&&(p-=d):l==="left"?p-=Math.max(u,h)+s:l==="right"&&(p+=Math.max(f,m)+s),{x:Le(p,0,i.width-e.width),y:Le(g,0,i.height-e.height)}}function ro(t,e,n){const i=He(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-i.right:t.x+i.left}function Qu(t){return Dt([],Wt(t))}function BC(t,e,n){return rn(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function Zu(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const ef={beforeTitle:Lt,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex<i)return n[e.dataIndex]}return""},afterTitle:Lt,beforeBody:Lt,beforeLabel:Lt,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return fe(n)||(e+=n),e},labelColor(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.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(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Lt,afterBody:Lt,beforeFooter:Lt,footer:Lt,afterFooter:Lt};function Je(t,e,n,i){const s=t[e].call(n,i);return typeof s>"u"?ef[e].call(n,i):s}class Kr extends vt{constructor(e){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=e.chart,this.options=e.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(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const n=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&n.options.animation&&i.animations,o=new Nr(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=BC(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:i}=n,s=Je(i,"beforeTitle",this,e),o=Je(i,"title",this,e),a=Je(i,"afterTitle",this,e);let l=[];return l=Dt(l,Wt(s)),l=Dt(l,Wt(o)),l=Dt(l,Wt(a)),l}getBeforeBody(e,n){return Qu(Je(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:i}=n,s=[];return be(e,o=>{const a={before:[],lines:[],after:[]},l=Zu(i,o);Dt(a.before,Wt(Je(l,"beforeLabel",this,o))),Dt(a.lines,Je(l,"label",this,o)),Dt(a.after,Wt(Je(l,"afterLabel",this,o))),s.push(a)}),s}getAfterBody(e,n){return Qu(Je(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:i}=n,s=Je(i,"beforeFooter",this,e),o=Je(i,"footer",this,e),a=Je(i,"afterFooter",this,e);let l=[];return l=Dt(l,Wt(s)),l=Dt(l,Wt(o)),l=Dt(l,Wt(a)),l}_createItems(e){const n=this._active,i=this.chart.data,s=[],o=[],a=[];let l=[],c,d;for(c=0,d=n.length;c<d;++c)l.push(CC(this.chart,n[c]));return e.filter&&(l=l.filter((u,f,h)=>e.filter(u,f,h,i))),e.itemSort&&(l=l.sort((u,f)=>e.itemSort(u,f,i))),be(l,u=>{const f=Zu(e.callbacks,u);s.push(Je(f,"labelColor",this,u)),o.push(Je(f,"labelPointStyle",this,u)),a.push(Je(f,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=l,l}update(e,n){const i=this.options.setContext(this.getContext()),s=this._active;let o,a=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const l=Qi[i.position].call(this,s,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const c=this._size=Xu(this,i),d=Object.assign({},l,c),u=Gu(this.chart,i,d),f=Ju(i,d,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:f.x,y:f.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,i,s){const o=this.getCaretPosition(e,i,s);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(e,n,i){const{xAlign:s,yAlign:o}=this,{caretSize:a,cornerRadius:l}=i,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=Cn(l),{x:h,y:m}=e,{width:p,height:g}=n;let y,b,x,w,E,k;return o==="center"?(E=m+g/2,s==="left"?(y=h,b=y-a,w=E+a,k=E-a):(y=h+p,b=y+a,w=E-a,k=E+a),x=y):(s==="left"?b=h+Math.max(c,u)+a:s==="right"?b=h+p-Math.max(d,f)-a:b=this.caretX,o==="top"?(w=m,E=w-a,y=b-a,x=b+a):(w=m+g,E=w+a,y=b+a,x=b-a),k=w),{x1:y,x2:b,x3:x,y1:w,y2:E,y3:k}}drawTitle(e,n,i){const s=this.title,o=s.length;let a,l,c;if(o){const d=qn(i.rtl,this.x,this.width);for(e.x=ro(this,i.titleAlign,i),n.textAlign=d.textAlign(i.titleAlign),n.textBaseline="middle",a=Fe(i.titleFont),l=i.titleSpacing,n.fillStyle=i.titleColor,n.font=a.string,c=0;c<o;++c)n.fillText(s[c],d.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+l,c+1===o&&(e.y+=i.titleMarginBottom-l)}}_drawColorBox(e,n,i,s,o){const a=this.labelColors[i],l=this.labelPointStyles[i],{boxHeight:c,boxWidth:d}=o,u=Fe(o.bodyFont),f=ro(this,"left",o),h=s.x(f),m=c<u.lineHeight?(u.lineHeight-c)/2:0,p=n.y+m;if(o.usePointStyle){const g={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},y=s.leftForLtr(h,d)+d/2,b=p+c/2;e.strokeStyle=o.multiKeyBackground,e.fillStyle=o.multiKeyBackground,kr(e,g,y,b),e.strokeStyle=a.borderColor,e.fillStyle=a.backgroundColor,kr(e,g,y,b)}else{e.lineWidth=de(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,e.strokeStyle=a.borderColor,e.setLineDash(a.borderDash||[]),e.lineDashOffset=a.borderDashOffset||0;const g=s.leftForLtr(h,d),y=s.leftForLtr(s.xPlus(h,1),d-2),b=Cn(a.borderRadius);Object.values(b).some(x=>x!==0)?(e.beginPath(),e.fillStyle=o.multiKeyBackground,Vi(e,{x:g,y:p,w:d,h:c,radius:b}),e.fill(),e.stroke(),e.fillStyle=a.backgroundColor,e.beginPath(),Vi(e,{x:y,y:p+1,w:d-2,h:c-2,radius:b}),e.fill()):(e.fillStyle=o.multiKeyBackground,e.fillRect(g,p,d,c),e.strokeRect(g,p,d,c),e.fillStyle=a.backgroundColor,e.fillRect(y,p+1,d-2,c-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,n,i){const{body:s}=this,{bodySpacing:o,bodyAlign:a,displayColors:l,boxHeight:c,boxWidth:d,boxPadding:u}=i,f=Fe(i.bodyFont);let h=f.lineHeight,m=0;const p=qn(i.rtl,this.x,this.width),g=function(_){n.fillText(_,p.x(e.x+m),e.y+h/2),e.y+=h+o},y=p.textAlign(a);let b,x,w,E,k,C,S;for(n.textAlign=a,n.textBaseline="middle",n.font=f.string,e.x=ro(this,y,i),n.fillStyle=i.bodyColor,be(this.beforeBody,g),m=l&&y!=="right"?a==="center"?d/2+u:d+2+u:0,E=0,C=s.length;E<C;++E){for(b=s[E],x=this.labelTextColors[E],n.fillStyle=x,be(b.before,g),w=b.lines,l&&w.length&&(this._drawColorBox(n,e,E,p,i),h=Math.max(f.lineHeight,c)),k=0,S=w.length;k<S;++k)g(w[k]),h=f.lineHeight;be(b.after,g)}m=0,h=f.lineHeight,be(this.afterBody,g),e.y-=o}drawFooter(e,n,i){const s=this.footer,o=s.length;let a,l;if(o){const c=qn(i.rtl,this.x,this.width);for(e.x=ro(this,i.footerAlign,i),e.y+=i.footerMarginTop,n.textAlign=c.textAlign(i.footerAlign),n.textBaseline="middle",a=Fe(i.footerFont),n.fillStyle=i.footerColor,n.font=a.string,l=0;l<o;++l)n.fillText(s[l],c.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+i.footerSpacing}}drawBackground(e,n,i,s){const{xAlign:o,yAlign:a}=this,{x:l,y:c}=e,{width:d,height:u}=i,{topLeft:f,topRight:h,bottomLeft:m,bottomRight:p}=Cn(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(l+f,c),a==="top"&&this.drawCaret(e,n,i,s),n.lineTo(l+d-h,c),n.quadraticCurveTo(l+d,c,l+d,c+h),a==="center"&&o==="right"&&this.drawCaret(e,n,i,s),n.lineTo(l+d,c+u-p),n.quadraticCurveTo(l+d,c+u,l+d-p,c+u),a==="bottom"&&this.drawCaret(e,n,i,s),n.lineTo(l+m,c+u),n.quadraticCurveTo(l,c+u,l,c+u-m),a==="center"&&o==="left"&&this.drawCaret(e,n,i,s),n.lineTo(l,c+f),n.quadraticCurveTo(l,c,l+f,c),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){const a=Qi[e.position].call(this,this._active,this._eventPosition);if(!a)return;const l=this._size=Xu(this,e),c=Object.assign({},a,this._size),d=Gu(n,e,c),u=Ju(e,c,d,n);(s._to!==u.x||o._to!==u.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=l.width,this.height=l.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(e){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 a=He(n.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&l&&(e.save(),e.globalAlpha=i,this.drawBackground(o,e,s,n),wd(e,n.textDirection),o.y+=a.top,this.drawTitle(o,e,n),this.drawBody(o,e,n),this.drawFooter(o,e,n),Ed(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const i=this._active,s=e.map(({datasetIndex:l,index:c})=>{const d=this.chart.getDatasetMeta(l);if(!d)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:d.data[c],index:c}}),o=!$s(i,s),a=this._positionChanged(s,n);(o||a)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],a=this._getActiveElements(e,o,n,i),l=this._positionChanged(a,e),c=n||!$s(a,o)||l;return c&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),c}_getActiveElements(e,n,i,s){const o=this.options;if(e.type==="mouseout")return[];if(!s)return n.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const a=this.chart.getElementsAtEventForMode(e,o.mode,o,i);return o.reverse&&a.reverse(),a}_positionChanged(e,n){const{caretX:i,caretY:s,options:o}=this,a=Qi[o.position].call(this,e,n);return a!==!1&&(i!==a.x||s!==a.y)}}z(Kr,"positioners",Qi);var tf={id:"tooltip",_element:Kr,positioners:Qi,afterInit(t,e,n){n&&(t.tooltip=new Kr({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.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:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.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:ef},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},nf=Object.freeze({__proto__:null,Colors:Bu,Decimation:Mu,Filler:zu,Legend:qu,SubTitle:Ku,Title:Yu,Tooltip:tf});const PC=(t,e,n,i)=>(typeof e=="string"?(n=t.push(e)-1,i.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function AC(t,e,n,i){const s=t.indexOf(e);if(s===-1)return PC(t,e,n,i);const o=t.lastIndexOf(e);return s!==o?n:s}const MC=(t,e)=>t===null?null:Le(Math.round(t),0,e);function sf(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class ao extends ln{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){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(e)}parse(e,n){if(fe(e))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===e?n:AC(i,e,ae(n,e),this._addedLabels),MC(n,i.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(i=0),n||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const e=this.min,n=this.max,i=this.options.offset,s=[];let o=this.getLabels();o=e===0&&n===o.length-1?o:o.slice(e,n+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=e;a<=n;a++)s.push({value:a});return s}getLabelForValue(e){return sf.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}z(ao,"id","category"),z(ao,"defaults",{ticks:{callback:sf}});function VC(t,e){const n=[],{bounds:s,step:o,min:a,max:l,precision:c,count:d,maxTicks:u,maxDigits:f,includeBounds:h}=t,m=o||1,p=u-1,{min:g,max:y}=e,b=!fe(a),x=!fe(l),w=!fe(d),E=(y-g)/(f+1);let k=Kc((y-g)/p/m)*m,C,S,_,O;if(k<1e-14&&!b&&!x)return[{value:g},{value:y}];O=Math.ceil(y/k)-Math.floor(g/k),O>p&&(k=Kc(O*k/p/m)*m),fe(c)||(C=Math.pow(10,c),k=Math.ceil(k*C)/C),s==="ticks"?(S=Math.floor(g/k)*k,_=Math.ceil(y/k)*k):(S=g,_=y),b&&x&&o&&Wk((l-a)/o,k/1e3)?(O=Math.round(Math.min((l-a)/k,u)),k=(l-a)/O,S=a,_=l):w?(S=b?a:S,_=x?l:_,O=d-1,k=(_-S)/O):(O=(_-S)/k,Di(O,Math.round(O),k/1e3)?O=Math.round(O):O=Math.ceil(O));const P=Math.max(Gc(k),Gc(S));C=Math.pow(10,fe(c)?P:c),S=Math.round(S*C)/C,_=Math.round(_*C)/C;let v=0;for(b&&(h&&S!==a?(n.push({value:a}),S<a&&v++,Di(Math.round((S+v*k)*C)/C,a,of(a,E,t))&&v++):S<a&&v++);v<O;++v){const T=Math.round((S+v*k)*C)/C;if(x&&T>l)break;n.push({value:T})}return x&&h&&_!==l?n.length&&Di(n[n.length-1].value,l,of(l,E,t))?n[n.length-1].value=l:n.push({value:l}):(!x||_===l)&&n.push({value:_}),n}function of(t,e,{horizontal:n,minRotation:i}){const s=yt(i),o=(n?Math.sin(s):Math.cos(s))||.001,a=.75*e*(""+t).length;return Math.min(e/o,a)}class lo extends ln{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,n){return fe(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:s,max:o}=this;const a=c=>s=n?s:c,l=c=>o=i?o:c;if(e){const c=Ct(s),d=Ct(o);c<0&&d<0?l(0):c>0&&d>0&&a(0)}if(s===o){let c=o===0?1:Math.abs(o*.05);l(o+c),e||a(s-c)}this.min=s,this.max=o}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=e,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 e=this.options,n=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:e.bounds,min:e.min,max:e.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,a=VC(s,o);return e.bounds==="ticks"&&Xc(a,this,"value"),e.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const e=this.ticks;let n=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const s=(i-n)/Math.max(e.length-1,1)/2;n-=s,i+=s}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(e){return Pi(e,this.chart.options.locale,this.options.ticks.format)}}class co extends lo{determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=Pe(e)?e:0,this.max=Pe(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,i=yt(this.options.ticks.minRotation),s=(e?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/s))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}z(co,"id","linear"),z(co,"defaults",{ticks:{callback:Ai.formatters.numeric}});const Zi=t=>Math.floor(on(t)),Tn=(t,e)=>Math.pow(10,Zi(t)+e);function rf(t){return t/Math.pow(10,Zi(t))===1}function af(t,e,n){const i=Math.pow(10,n),s=Math.floor(t/i);return Math.ceil(e/i)-s}function RC(t,e){const n=e-t;let i=Zi(n);for(;af(t,e,i)>10;)i++;for(;af(t,e,i)<10;)i--;return Math.min(i,Zi(t))}function FC(t,{min:e,max:n}){e=nt(t.min,e);const i=[],s=Zi(e);let o=RC(e,n),a=o<0?Math.pow(10,Math.abs(o)):1;const l=Math.pow(10,o),c=s>o?Math.pow(10,s):0,d=Math.round((e-c)*a)/a,u=Math.floor((e-c)/l/10)*l*10;let f=Math.floor((d-u)/Math.pow(10,o)),h=nt(t.min,Math.round((c+u+f*Math.pow(10,o))*a)/a);for(;h<n;)i.push({value:h,major:rf(h),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(o++,f=2,a=o>=0?1:a),h=Math.round((c+u+f*Math.pow(10,o))*a)/a;const m=nt(t.max,h);return i.push({value:m,major:rf(m),significand:f}),i}class uo extends ln{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,n){const i=lo.prototype.parse.apply(this,[e,n]);if(i===0){this._zero=!0;return}return Pe(i)&&i>0?i:null}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=Pe(e)?Math.max(0,e):null,this.max=Pe(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Pe(this._userMin)&&(this.min=e===Tn(this.min,0)?Tn(this.min,-1):Tn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let i=this.min,s=this.max;const o=l=>i=e?i:l,a=l=>s=n?s:l;i===s&&(i<=0?(o(1),a(10)):(o(Tn(i,-1)),a(Tn(s,1)))),i<=0&&o(Tn(s,-1)),s<=0&&a(Tn(i,1)),this.min=i,this.max=s}buildTicks(){const e=this.options,n={min:this._userMin,max:this._userMax},i=FC(n,this);return e.bounds==="ticks"&&Xc(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(e){return e===void 0?"0":Pi(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=on(e),this._valueRange=on(this.max)-on(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(on(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const n=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+n*this._valueRange)}}z(uo,"id","logarithmic"),z(uo,"defaults",{ticks:{callback:Ai.formatters.logarithmic,major:{enabled:!0}}});function Xr(t){const e=t.ticks;if(e.display&&t.display){const n=He(e.backdropPadding);return ae(e.font&&e.font.size,Ee.font.size)+n.height}return 0}function $C(t,e,n){return n=Oe(n)?n:[n],{w:aS(t,e.string,n),h:n.length*e.lineHeight}}function lf(t,e,n,i,s){return t===i||t===s?{start:e-n/2,end:e+n/2}:t<i||t>s?{start:e-n,end:e}:{start:e,end:e+n}}function LC(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},n=Object.assign({},e),i=[],s=[],o=t._pointLabels.length,a=t.options.pointLabels,l=a.centerPointLabels?Se/o:0;for(let c=0;c<o;c++){const d=a.setContext(t.getPointLabelContext(c));s[c]=d.padding;const u=t.getPointPosition(c,t.drawingArea+s[c],l),f=Fe(d.font),h=$C(t.ctx,f,t._pointLabels[c]);i[c]=h;const m=it(t.getIndexAngle(c)+l),p=Math.round(hr(m)),g=lf(p,u.x,h.w,0,180),y=lf(p,u.y,h.h,90,270);IC(n,e,m,g,y)}t.setCenterPoint(e.l-n.l,n.r-e.r,e.t-n.t,n.b-e.b),t._pointLabelItems=UC(t,i,s)}function IC(t,e,n,i,s){const o=Math.abs(Math.sin(n)),a=Math.abs(Math.cos(n));let l=0,c=0;i.start<e.l?(l=(e.l-i.start)/o,t.l=Math.min(t.l,e.l-l)):i.end>e.r&&(l=(i.end-e.r)/o,t.r=Math.max(t.r,e.r+l)),s.start<e.t?(c=(e.t-s.start)/a,t.t=Math.min(t.t,e.t-c)):s.end>e.b&&(c=(s.end-e.b)/a,t.b=Math.max(t.b,e.b+c))}function jC(t,e,n){const i=t.drawingArea,{extra:s,additionalAngle:o,padding:a,size:l}=n,c=t.getPointPosition(e,i+s+a,o),d=Math.round(hr(it(c.angle+Me))),u=qC(c.y,l.h,d),f=WC(d),h=HC(c.x,l.w,f);return{visible:!0,x:c.x,y:u,textAlign:f,left:h,top:u,right:h+l.w,bottom:u+l.h}}function zC(t,e){if(!e)return!0;const{left:n,top:i,right:s,bottom:o}=t;return!(zt({x:n,y:i},e)||zt({x:n,y:o},e)||zt({x:s,y:i},e)||zt({x:s,y:o},e))}function UC(t,e,n){const i=[],s=t._pointLabels.length,o=t.options,{centerPointLabels:a,display:l}=o.pointLabels,c={extra:Xr(o)/2,additionalAngle:a?Se/s:0};let d;for(let u=0;u<s;u++){c.padding=n[u],c.size=e[u];const f=jC(t,u,c);i.push(f),l==="auto"&&(f.visible=zC(f,d),f.visible&&(d=f))}return i}function WC(t){return t===0||t===180?"center":t<180?"left":"right"}function HC(t,e,n){return n==="right"?t-=e:n==="center"&&(t-=e/2),t}function qC(t,e,n){return n===90||n===270?t-=e/2:(n>270||n<90)&&(t-=e),t}function YC(t,e,n){const{left:i,top:s,right:o,bottom:a}=n,{backdropColor:l}=e;if(!fe(l)){const c=Cn(e.borderRadius),d=He(e.backdropPadding);t.fillStyle=l;const u=i-d.left,f=s-d.top,h=o-i+d.width,m=a-s+d.height;Object.values(c).some(p=>p!==0)?(t.beginPath(),Vi(t,{x:u,y:f,w:h,h:m,radius:c}),t.fill()):t.fillRect(u,f,h,m)}}function KC(t,e){const{ctx:n,options:{pointLabels:i}}=t;for(let s=e-1;s>=0;s--){const o=t._pointLabelItems[s];if(!o.visible)continue;const a=i.setContext(t.getPointLabelContext(s));YC(n,a,o);const l=Fe(a.font),{x:c,y:d,textAlign:u}=o;En(n,t._pointLabels[s],c,d+l.lineHeight/2,l,{color:a.color,textAlign:u,textBaseline:"middle"})}}function cf(t,e,n,i){const{ctx:s}=t;if(n)s.arc(t.xCenter,t.yCenter,e,0,we);else{let o=t.getPointPosition(0,e);s.moveTo(o.x,o.y);for(let a=1;a<i;a++)o=t.getPointPosition(a,e),s.lineTo(o.x,o.y)}}function XC(t,e,n,i,s){const o=t.ctx,a=e.circular,{color:l,lineWidth:c}=e;!a&&!i||!l||!c||n<0||(o.save(),o.strokeStyle=l,o.lineWidth=c,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),cf(t,n,a,i),o.closePath(),o.stroke(),o.restore())}function GC(t,e,n){return rn(t,{label:n,index:e,type:"pointLabel"})}class Gn extends lo{constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=He(Xr(this.options)/2),n=this.width=this.maxWidth-e.width,i=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+n/2+e.left),this.yCenter=Math.floor(this.top+i/2+e.top),this.drawingArea=Math.floor(Math.min(n,i)/2)}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!1);this.min=Pe(e)&&!isNaN(e)?e:0,this.max=Pe(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Xr(this.options))}generateTickLabels(e){lo.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((n,i)=>{const s=ke(this.options.pointLabels.callback,[n,i],this);return s||s===0?s:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const e=this.options;e.display&&e.pointLabels.display?LC(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,n,i,s){this.xCenter+=Math.floor((e-n)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,n,i,s))}getIndexAngle(e){const n=we/(this._pointLabels.length||1),i=this.options.startAngle||0;return it(e*n+yt(i))}getDistanceFromCenterForValue(e){if(fe(e))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*n:(e-this.min)*n}getValueForDistanceFromCenter(e){if(fe(e))return NaN;const n=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(e){const n=this._pointLabels||[];if(e>=0&&e<n.length){const i=n[e];return GC(this.getContext(),e,i)}}getPointPosition(e,n,i=0){const s=this.getIndexAngle(e)-Me+i;return{x:Math.cos(s)*n+this.xCenter,y:Math.sin(s)*n+this.yCenter,angle:s}}getPointPositionForValue(e,n){return this.getPointPosition(e,this.getDistanceFromCenterForValue(n))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:n,top:i,right:s,bottom:o}=this._pointLabelItems[e];return{left:n,top:i,right:s,bottom:o}}drawBackground(){const{backgroundColor:e,grid:{circular:n}}=this.options;if(e){const i=this.ctx;i.save(),i.beginPath(),cf(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),i.closePath(),i.fillStyle=e,i.fill(),i.restore()}}drawGrid(){const e=this.ctx,n=this.options,{angleLines:i,grid:s,border:o}=n,a=this._pointLabels.length;let l,c,d;if(n.pointLabels.display&&KC(this,a),s.display&&this.ticks.forEach((u,f)=>{if(f!==0||f===0&&this.min<0){c=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(f),m=s.setContext(h),p=o.setContext(h);XC(this,m,c,a,p)}}),i.display){for(e.save(),l=a-1;l>=0;l--){const u=i.setContext(this.getPointLabelContext(l)),{color:f,lineWidth:h}=u;!h||!f||(e.lineWidth=h,e.strokeStyle=f,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,c=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),d=this.getPointPosition(l,c),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(d.x,d.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let o,a;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(s),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((l,c)=>{if(c===0&&this.min>=0&&!n.reverse)return;const d=i.setContext(this.getContext(c)),u=Fe(d.font);if(o=this.getDistanceFromCenterForValue(this.ticks[c].value),d.showLabelBackdrop){e.font=u.string,a=e.measureText(l.label).width,e.fillStyle=d.backdropColor;const f=He(d.backdropPadding);e.fillRect(-a/2-f.left,-o-u.size/2-f.top,a+f.width,u.size+f.height)}En(e,l.label,0,-o,u,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),e.restore()}drawTitle(){}}z(Gn,"id","radialLinear"),z(Gn,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ai.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),z(Gn,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),z(Gn,"descriptors",{angleLines:{_fallback:"grid"}});const fo={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}},Qe=Object.keys(fo);function df(t,e){return t-e}function uf(t,e){if(fe(e))return null;const n=t._adapter,{parser:i,round:s,isoWeekday:o}=t._parseOpts;let a=e;return typeof i=="function"&&(a=i(a)),Pe(a)||(a=typeof i=="string"?n.parse(a,i):n.parse(a)),a===null?null:(s&&(a=s==="week"&&(Un(o)||o===!0)?n.startOf(a,"isoWeek",o):n.startOf(a,s)),+a)}function ff(t,e,n,i){const s=Qe.length;for(let o=Qe.indexOf(t);o<s-1;++o){const a=fo[Qe[o]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-e)/(l*a.size))<=i)return Qe[o]}return Qe[s-1]}function JC(t,e,n,i,s){for(let o=Qe.length-1;o>=Qe.indexOf(n);o--){const a=Qe[o];if(fo[a].common&&t._adapter.diff(s,i,a)>=e-1)return a}return Qe[n?Qe.indexOf(n):0]}function QC(t){for(let e=Qe.indexOf(t)+1,n=Qe.length;e<n;++e)if(fo[Qe[e]].common)return Qe[e]}function hf(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:i,hi:s}=pr(n,e),o=n[i]>=e?n[i]:n[s];t[o]=!0}}function ZC(t,e,n,i){const s=t._adapter,o=+s.startOf(e[0].value,i),a=e[e.length-1].value;let l,c;for(l=o;l<=a;l=+s.add(l,1,i))c=n[l],c>=0&&(e[c].major=!0);return e}function mf(t,e,n){const i=[],s={},o=e.length;let a,l;for(a=0;a<o;++a)l=e[a],s[l]=a,i.push({value:l,major:!1});return o===0||!n?i:ZC(t,i,s,n)}class Jn extends ln{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,n={}){const i=e.time||(e.time={}),s=this._adapter=new Wd._date(e.adapters.date);s.init(n),vi(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(e),this._normalized=n.normalized}parse(e,n){return e===void 0?null:uf(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,n=this._adapter,i=e.time.unit||"day";let{min:s,max:o,minDefined:a,maxDefined:l}=this.getUserBounds();function c(d){!a&&!isNaN(d.min)&&(s=Math.min(s,d.min)),!l&&!isNaN(d.max)&&(o=Math.max(o,d.max))}(!a||!l)&&(c(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&c(this.getMinMax(!1))),s=Pe(s)&&!isNaN(s)?s:+n.startOf(Date.now(),i),o=Pe(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 e=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return e.length&&(n=e[0],i=e[e.length-1]),{min:n,max:i}}buildTicks(){const e=this.options,n=e.time,i=e.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,a=this.max,l=Kk(s,o,a);return this._unit=n.unit||(i.autoSkip?ff(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):JC(this,l.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:QC(this._unit),this.initOffsets(s),e.reverse&&l.reverse(),mf(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let n=0,i=0,s,o;this.options.offset&&e.length&&(s=this.getDecimalForValue(e[0]),e.length===1?n=1-s:n=(this.getDecimalForValue(e[1])-s)/2,o=this.getDecimalForValue(e[e.length-1]),e.length===1?i=o:i=(o-this.getDecimalForValue(e[e.length-2]))/2);const a=e.length<3?.5:.25;n=Le(n,0,a),i=Le(i,0,a),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const e=this._adapter,n=this.min,i=this.max,s=this.options,o=s.time,a=o.unit||ff(o.minUnit,n,i,this._getLabelCapacity(n)),l=ae(s.ticks.stepSize,1),c=a==="week"?o.isoWeekday:!1,d=Un(c)||c===!0,u={};let f=n,h,m;if(d&&(f=+e.startOf(f,"isoWeek",c)),f=+e.startOf(f,d?"day":a),e.diff(i,n,a)>1e5*l)throw new Error(n+" and "+i+" are too far apart with stepSize of "+l+" "+a);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(h=f,m=0;h<i;h=+e.add(h,l,a),m++)hf(u,h,p);return(h===i||s.bounds==="ticks"||m===1)&&hf(u,h,p),Object.keys(u).sort(df).map(g=>+g)}getLabelForValue(e){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(e,i.tooltipFormat):n.format(e,i.displayFormats.datetime)}format(e,n){const s=this.options.time.displayFormats,o=this._unit,a=n||s[o];return this._adapter.format(e,a)}_tickFormatFunction(e,n,i,s){const o=this.options,a=o.ticks.callback;if(a)return ke(a,[e,n,i],this);const l=o.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&l[c],f=d&&l[d],h=i[n],m=d&&f&&h&&h.major;return this._adapter.format(e,s||(m?f:u))}generateTickLabels(e){let n,i,s;for(n=0,i=e.length;n<i;++n)s=e[n],s.label=this._tickFormatFunction(s.value,n,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const n=this._offsets,i=this.getDecimalForValue(e);return this.getPixelForDecimal((n.start+i)*n.factor)}getValueForPixel(e){const n=this._offsets,i=this.getDecimalForPixel(e)/n.factor-n.end;return this.min+i*(this.max-this.min)}_getLabelSize(e){const n=this.options.ticks,i=this.ctx.measureText(e).width,s=yt(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(s),a=Math.sin(s),l=this._resolveTickFontOptions(0).size;return{w:i*o+l*a,h:i*a+l*o}}_getLabelCapacity(e){const n=this.options.time,i=n.displayFormats,s=i[n.unit]||i.millisecond,o=this._tickFormatFunction(e,0,mf(this,[e],this._majorUnit),s),a=this._getLabelSize(o),l=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return l>0?l:1}getDataTimestamps(){let e=this._cache.data||[],n,i;if(e.length)return e;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)e=e.concat(s[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let n,i;if(e.length)return e;const s=this.getLabels();for(n=0,i=s.length;n<i;++n)e.push(uf(this,s[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return ed(e.sort(df))}}z(Jn,"id","time"),z(Jn,"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 ho(t,e,n){let i=0,s=t.length-1,o,a,l,c;n?(e>=t[i].pos&&e<=t[s].pos&&({lo:i,hi:s}=jt(t,"pos",e)),{pos:o,time:l}=t[i],{pos:a,time:c}=t[s]):(e>=t[i].time&&e<=t[s].time&&({lo:i,hi:s}=jt(t,"time",e)),{time:o,pos:l}=t[i],{time:a,pos:c}=t[s]);const d=a-o;return d?l+(c-l)*(e-o)/d:l}class mo extends Jn{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(e);this._minPos=ho(n,this.min),this._tableRange=ho(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:i}=this,s=[],o=[];let a,l,c,d,u;for(a=0,l=e.length;a<l;++a)d=e[a],d>=n&&d<=i&&s.push(d);if(s.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(a=0,l=s.length;a<l;++a)u=s[a+1],c=s[a-1],d=s[a],Math.round((u+c)/2)!==d&&o.push({time:d,pos:a/(l-1)});return o}_generate(){const e=this.min,n=this.max;let i=super.getDataTimestamps();return(!i.includes(e)||!i.length)&&i.splice(0,0,e),(!i.includes(n)||i.length===1)&&i.push(n),i.sort((s,o)=>s-o)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?e=this.normalize(n.concat(i)):e=n.length?n:i,e=this._cache.all=e,e}getDecimalForValue(e){return(ho(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,i=this.getDecimalForPixel(e)/n.factor-n.end;return ho(this._table,i*this._tableRange+this._minPos,!0)}}z(mo,"id","timeseries"),z(mo,"defaults",Jn.defaults);var pf=Object.freeze({__proto__:null,CategoryScale:ao,LinearScale:co,LogarithmicScale:uo,RadialLinearScale:Gn,TimeScale:Jn,TimeSeriesScale:mo});const gf=[Ud,Ou,nf,pf];Nt.register(...gf);const e1=Object.freeze(Object.defineProperty({__proto__:null,Animation:Pd,Animations:Nr,ArcElement:Xn,BarController:$i,BarElement:Ji,BasePlatform:Rr,BasicPlatform:Qd,BubbleController:Li,CategoryScale:ao,Chart:Nt,Colors:Bu,DatasetController:lt,Decimation:Mu,DomPlatform:iu,DoughnutController:an,Element:vt,Filler:zu,Interaction:qd,Legend:qu,LineController:Ii,LineElement:Ut,LinearScale:co,LogarithmicScale:uo,PieController:Xs,PointElement:Gi,PolarAreaController:Yn,RadarController:ji,RadialLinearScale:Gn,Scale:ln,ScatterController:zi,SubTitle:Ku,Ticks:Ai,TimeScale:Jn,TimeSeriesScale:mo,Title:Yu,Tooltip:tf,_adapters:Wd,_detectPlatform:su,animator:Ot,controllers:Ud,default:Nt,defaults:Ee,elements:Ou,layouts:je,plugins:nf,registerables:gf,registry:bt,scales:pf},Symbol.toStringTag,{value:"Module"}));Ie.default=o_,Ie.useEntitiesStore=Vl,Ie.useGlobalConfigsStore=ot,Object.defineProperties(Ie,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});