UNPKG

@rero/rero-ils-ui

Version:

User interface for RERO integrated library system (RERO ILS).

2 lines 221 kB
import{b as oo,c as ao,d as ro,e as lo}from"./chunk-3BCXOE3D.js";import{a as so}from"./chunk-XSGSXDXU.js";import{a as io}from"./chunk-BR2J44KJ.js";import{a as no}from"./chunk-CGU6MK6Q.js";import{D as to,R as he,h as Zs,j as Zi,k as Qs,ua as eo}from"./chunk-4GRLSOJZ.js";import{c as Js}from"./chunk-WOV5KKTV.js";import{Tb as Ks,U as Ys,Wa as Xs,ec as qs,fc as Gs,ma as Us}from"./chunk-MTJX6JRK.js";import{a as Ns,b as Bt,c as zt}from"./chunk-GQ5FIRIY.js";import{k as $s}from"./chunk-4A4J5SA3.js";import{ma as ai}from"./chunk-4MYHQLZQ.js";import{Ba as Ws,Fa as Hs,Ga as Te,Ha as js,ya as Vs}from"./chunk-FRI676LD.js";import{Fa as zs,ha as si,na as Fs,ua as oi,wa as Bs}from"./chunk-WKOKZ3JO.js";import{$b as Ts,Aa as De,Bb as Ms,Ca as vs,Cb as Cs,Db as ce,Dd as Is,Eb as ws,Fa as ti,Fc as Os,Gc as Es,Ha as Ss,Hc as F,Ic as vt,Jc as xt,Kc as ii,Sb as ks,Vb as tt,Vc as ni,Xb as et,Xc as Zt,Yb as Ps,_b as Ds,a as Je,ac as K,b as Ze,bc as T,cc as R,da as Qe,dc as J,dd as q,ed as nt,fd as qi,ga as ms,gb as O,gd as Gi,ia as Q,jd as Ls,kc as As,oa as bs,pa as xs,pd as Ji,qb as Ki,r as Pe,rc as ei,sc as N,v as Ft,va as _s,vd as pt,wa as ys,yb as lt,yd as Rs}from"./chunk-3WD6XLXL.js";var co=(()=>{class e{constructor(){this.recordService=Q(Xs)}getPatronTransaction(t){return this.recordService.getRecords("patron_transactions",{query:`pid:${t}`,page:1,itemsPerPage:1,headers:Zs.reroJsonheaders}).pipe(Ft(n=>+this.recordService.totalHits(n.hits.total)==0?[]:n.hits.hits),Ft(n=>n.find(Boolean)),Ft(n=>new ao(n.metadata)))}static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();function ho(e){return[e.last_name||null,e.first_name||null].filter(i=>i!==null).map(i=>i.trim()).join(", ")}var ri=(()=>{class e{constructor(){this.patronService=Q(lo)}transform(t){return this.patronService.getPatronByPid(t).pipe(Ft(n=>ho(n)))}static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275pipe=Ms({name:"patronName",type:e,pure:!0})}}return e})();var Fr=e=>["/records","patrons","detail",e];function Br(e,i){if(e&1&&(T(0,"h5"),F(1),q(2,"translate"),R()),e&2){let t=N();O(),ii(" [",nt(2,2,"Note"),": ",t.parent().note,"] ")}}var li=(()=>{class e{constructor(){this.event=pt(),this.parent=pt()}static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275cmp=lt({type:e,selectors:[["admin-patron-transaction-event-default"]],inputs:{event:[1,"event"],parent:[1,"parent"]},decls:9,vars:9,consts:[[1,"metadata"],["translate",""],[3,"routerLink"]],template:function(n,s){n&1&&(tt(0,Br,3,4,"h5"),T(1,"dl",0)(2,"dt",1),F(3,"Patron"),R(),T(4,"dd")(5,"a",2),F(6),q(7,"patronName"),q(8,"async"),R()()()),n&2&&(et(s.parent().note?0:-1),O(5),K("routerLink",Zt(7,Fr,s.parent().patron.pid)),O(),vt(nt(8,5,nt(7,3,s.parent().patron.pid))))},dependencies:[Bt,ai,si,zt,ri],encapsulation:2,changeDetection:0})}}return e})();var zr=e=>["/records","items","detail",e],Nr=e=>["/circulation","patron",e,"fees"],Vr=e=>({event:e}),Wr=e=>["/records","patrons","detail",e];function Hr(e,i){if(e&1&&(F(0),q(1,"mainTitle")),e&2){let t=N();xt(" ",nt(1,1,t.parent().document.title)," ")}}function jr(e,i){if(e&1&&(F(0),q(1,"translate")),e&2){let t=N();ii(" [",nt(1,2,"Note"),": ",t.parent().note,"] ")}}function $r(e,i){if(e&1&&(J(0,"shared-inherited-call-number",5),F(1," ("),T(2,"a",3),F(3),R(),F(4,") ")),e&2){let t,n=N(2);K("item",(t=n.parent().loan)==null?null:t.item),O(2),K("routerLink",Zt(3,zr,n.parent().loan.item.pid)),O(),vt(n.parent().loan.item.barcode)}}function Yr(e,i){if(e&1&&(T(0,"span",4),F(1),R()),e&2){let t=N(2);O(),xt("[item_pid:",t.parent().loan.item_pid.value,"]")}}function Ur(e,i){if(e&1&&(T(0,"dt",1),F(1,"Call number"),R(),T(2,"dd"),tt(3,$r,5,5)(4,Yr,2,1,"span",4),R()),e&2){let t=N();O(3),et(t.parent().loan.item?3:4)}}function Xr(e,i){if(e&1&&(T(0,"a",2),F(1),q(2,"patronName"),q(3,"async"),R()),e&2){let t=N();K("routerLink",Zt(7,Nr,t.parent().patron.barcode))("queryParams",Zt(9,Vr,t.parent().pid)),O(),vt(nt(3,5,nt(2,3,t.parent().patron.pid)))}}function Kr(e,i){if(e&1&&(T(0,"a",3),F(1),q(2,"patronName"),q(3,"async"),R()),e&2){let t=N();K("routerLink",Zt(6,Wr,t.parent().patron.pid)),O(),vt(nt(3,4,nt(2,2,t.parent().patron.pid)))}}var uo=(()=>{class e extends li{static{this.\u0275fac=(()=>{let t;return function(s){return(t||(t=ti(e)))(s||e)}})()}static{this.\u0275cmp=lt({type:e,selectors:[["admin-patron-transaction-event-overdue"]],features:[ce],decls:10,vars:3,consts:[[1,"metadata"],["translate",""],[3,"routerLink","queryParams"],[3,"routerLink"],[1,"ui:text-muted-color","ui:italic"],[3,"item"]],template:function(n,s){n&1&&(T(0,"h5"),tt(1,Hr,2,3)(2,jr,2,4),R(),T(3,"dl",0),tt(4,Ur,5,1),T(5,"dt",1),F(6,"Patron"),R(),T(7,"dd"),tt(8,Xr,4,11,"a",2)(9,Kr,4,8,"a",3),R()()),n&2&&(O(),et(s.parent().document?1:s.parent().note?2:-1),O(3),et(s.parent().loan?4:-1),O(4),et(s.parent().patron.barcode?8:9))},dependencies:[Bt,eo,ai,si,zt,to,ri],encapsulation:2,changeDetection:0})}}return e})();function qr(e,i){if(e&1&&J(0,"admin-patron-transaction-event-overdue",2),e&2){let t=N(2);K("parent",t.parent)("event",t.event())}}function Gr(e,i){if(e&1&&J(0,"admin-patron-transaction-event-default",2),e&2){let t=N(2);K("parent",t.parent)("event",t.event())}}function Jr(e,i){if(e&1&&(F(0),q(1,"currency")),e&2){let t,n=N(2);xt(" ",qi(1,1,n.event().amount,(t=n.organisation())==null?null:t.default_currency)," ")}}function Zr(e,i){e&1&&(F(0),q(1,"translate")),e&2&&xt(" ",nt(1,1,"dispute")," ")}function Qr(e,i){if(e&1&&(T(0,"p-tag",6),J(1,"i",9),F(2),R()),e&2){let t=N(2);O(2),xt("\xA0",t.event().operator.name," ")}}function tl(e,i){if(e&1&&(T(0,"p-tag",6),J(1,"i",10),F(2),R()),e&2){let t=N(2);O(2),xt("\xA0",t.event().library.name," ")}}function el(e,i){if(e&1&&(T(0,"div",0)(1,"div",1),tt(2,qr,1,2,"admin-patron-transaction-event-overdue",2)(3,Gr,1,2,"admin-patron-transaction-event-default",2),R(),T(4,"div")(5,"p-tag",3),tt(6,Jr,2,4)(7,Zr,2,3),R()()(),T(8,"div",4)(9,"div",5),tt(10,Qr,3,1,"p-tag",6),tt(11,tl,3,1,"p-tag",6),T(12,"p-tag",6),J(13,"i",7),F(14),q(15,"translate"),R()(),T(16,"p-tag",6),J(17,"i",8),F(18),q(19,"date"),R()()),e&2){let t,n=N();O(2),et((t=n.parent.type)==="overdue"?2:3),O(3),K("severity",n.severity()),O(),et(n.event().type!==n.eventTypes.DISPUTE?6:7),O(4),et(n.event().operator?10:-1),O(),et(n.event().library?11:-1),O(3),xt("\xA0",nt(15,7,n.parent.type)," "),O(4),xt("\xA0",qi(19,9,n.event().creation_date,"short")," ")}}function il(e,i){e&1&&(J(0,"i",11),F(1),q(2,"translate")),e&2&&(O(),xt("\xA0",nt(2,1,"Loading in progress\u2026"),` `))}var fo=(()=>{class e{constructor(){this.appStore=Q(he),this.patronTransactionService=Q(co),this.detailUrl=pt(),this.record=pt(),this.type=pt(),this.loaded=De(!1),this.event=De(null),this.organisation=Ji(()=>this.appStore.organisation()),this.eventTypes=oo,this.severity=Ji(()=>{switch(this.event().type){case"fee":return"danger";case"payment":return"success";case"dispute":return"warn";default:return"secondary"}})}ngOnInit(){this.event.set(new ro(this.record().metadata)),this.patronTransactionService.getPatronTransaction(this.event().parent.pid).subscribe(t=>{this.parent=t,this.loaded.set(!0)})}static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275cmp=lt({type:e,selectors:[["admin-patron-transaction-events-brief-view"]],inputs:{detailUrl:[1,"detailUrl"],record:[1,"record"],type:[1,"type"]},decls:2,vars:1,consts:[[1,"ui:flex","ui:gap-2"],[1,"ui:grow"],[3,"parent","event"],[3,"severity"],[1,"ui:flex","ui:gap-2","ui:flex-wrap","ui:mt-2"],[1,"ui:flex","ui:grow","ui:flex-wrap","ui:gap-2"],["severity","secondary"],[1,"fa","fa-exchange"],[1,"fa","fa-clock-o"],[1,"fa","fa-user-circle-o"],[1,"fa","fa-university"],[1,"fa","fa-spin","fa-spinner"]],template:function(n,s){n&1&&tt(0,el,20,12)(1,il,3,3),n&2&&et(s.loaded()&&s.parent?0:1)},dependencies:[uo,li,Js,oi,Fs,zt],encapsulation:2,changeDetection:0})}}return e})();function nl(e,i){if(e&1&&(T(0,"li")(1,"div",3)(2,"span",4),F(3),q(4,"translate"),R(),T(5,"span"),F(6),q(7,"currency"),R()()()),e&2){let t=i.$implicit,n=N();O(3),vt(nt(4,2,t.name)),O(3),vt(Gi(7,4,t.total,n.org_currency,"symbol"))}}var po=(()=>{class e{constructor(){this.appStore=Q(he),this.data=pt()}get org_currency(){return this.appStore.organisation()?.default_currency}static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275cmp=lt({type:e,selectors:[["admin-payments-data-table"]],inputs:{data:[1,"data"]},decls:10,vars:5,consts:[[1,"ui:list-none","ui:m-0","ui:p-0","ui:text-sm"],[1,"ui:flex","ui:font-bold"],["translate","",1,"ui:grow"],[1,"ui:flex"],[1,"ui:grow"]],template:function(n,s){if(n&1&&(T(0,"ul",0),Ds(1,nl,8,8,"li",null,Ps),J(3,"p-divider"),T(4,"li",1)(5,"span",2),F(6,"Total"),R(),T(7,"span"),F(8),q(9,"currency"),R()()()),n&2){let o,a;O(),Ts((o=s.data())==null?null:o.subtypes),O(7),vt(Gi(9,1,(a=s.data())==null?null:a.total,s.org_currency,"symbol"))}},dependencies:[Us,Bt,oi,zt],encapsulation:2,changeDetection:0})}}return e})();function Ee(e){return e+.5|0}var Nt=(e,i,t)=>Math.max(Math.min(e,t),i);function Ae(e){return Nt(Ee(e*2.55),0,255)}function Vt(e){return Nt(Ee(e*255),0,255)}function Tt(e){return Nt(Ee(e/2.55)/100,0,1)}function go(e){return Nt(Ee(e*100),0,100)}var gt={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},tn=[..."0123456789ABCDEF"],sl=e=>tn[e&15],ol=e=>tn[(e&240)>>4]+tn[e&15],ci=e=>(e&240)>>4===(e&15),al=e=>ci(e.r)&&ci(e.g)&&ci(e.b)&&ci(e.a);function rl(e){var i=e.length,t;return e[0]==="#"&&(i===4||i===5?t={r:255&gt[e[1]]*17,g:255&gt[e[2]]*17,b:255&gt[e[3]]*17,a:i===5?gt[e[4]]*17:255}:(i===7||i===9)&&(t={r:gt[e[1]]<<4|gt[e[2]],g:gt[e[3]]<<4|gt[e[4]],b:gt[e[5]]<<4|gt[e[6]],a:i===9?gt[e[7]]<<4|gt[e[8]]:255})),t}var ll=(e,i)=>e<255?i(e):"";function cl(e){var i=al(e)?sl:ol;return e?"#"+i(e.r)+i(e.g)+i(e.b)+ll(e.a,i):void 0}var hl=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function _o(e,i,t){let n=i*Math.min(t,1-t),s=(o,a=(o+e/30)%12)=>t-n*Math.max(Math.min(a-3,9-a,1),-1);return[s(0),s(8),s(4)]}function dl(e,i,t){let n=(s,o=(s+e/60)%6)=>t-t*i*Math.max(Math.min(o,4-o,1),0);return[n(5),n(3),n(1)]}function ul(e,i,t){let n=_o(e,1,.5),s;for(i+t>1&&(s=1/(i+t),i*=s,t*=s),s=0;s<3;s++)n[s]*=1-i-t,n[s]+=i;return n}function fl(e,i,t,n,s){return e===s?(i-t)/n+(i<t?6:0):i===s?(t-e)/n+2:(e-i)/n+4}function en(e){let t=e.r/255,n=e.g/255,s=e.b/255,o=Math.max(t,n,s),a=Math.min(t,n,s),r=(o+a)/2,l,c,h;return o!==a&&(h=o-a,c=r>.5?h/(2-o-a):h/(o+a),l=fl(t,n,s,h,o),l=l*60+.5),[l|0,c||0,r]}function nn(e,i,t,n){return(Array.isArray(i)?e(i[0],i[1],i[2]):e(i,t,n)).map(Vt)}function sn(e,i,t){return nn(_o,e,i,t)}function pl(e,i,t){return nn(ul,e,i,t)}function gl(e,i,t){return nn(dl,e,i,t)}function yo(e){return(e%360+360)%360}function ml(e){let i=hl.exec(e),t=255,n;if(!i)return;i[5]!==n&&(t=i[6]?Ae(+i[5]):Vt(+i[5]));let s=yo(+i[2]),o=+i[3]/100,a=+i[4]/100;return i[1]==="hwb"?n=pl(s,o,a):i[1]==="hsv"?n=gl(s,o,a):n=sn(s,o,a),{r:n[0],g:n[1],b:n[2],a:t}}function bl(e,i){var t=en(e);t[0]=yo(t[0]+i),t=sn(t),e.r=t[0],e.g=t[1],e.b=t[2]}function xl(e){if(!e)return;let i=en(e),t=i[0],n=go(i[1]),s=go(i[2]);return e.a<255?`hsla(${t}, ${n}%, ${s}%, ${Tt(e.a)})`:`hsl(${t}, ${n}%, ${s}%)`}var mo={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"},bo={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 _l(){let e={},i=Object.keys(bo),t=Object.keys(mo),n,s,o,a,r;for(n=0;n<i.length;n++){for(a=r=i[n],s=0;s<t.length;s++)o=t[s],r=r.replace(o,mo[o]);o=parseInt(bo[a],16),e[r]=[o>>16&255,o>>8&255,o&255]}return e}var hi;function yl(e){hi||(hi=_l(),hi.transparent=[0,0,0,0]);let i=hi[e.toLowerCase()];return i&&{r:i[0],g:i[1],b:i[2],a:i.length===4?i[3]:255}}var vl=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Sl(e){let i=vl.exec(e),t=255,n,s,o;if(i){if(i[7]!==n){let a=+i[7];t=i[8]?Ae(a):Nt(a*255,0,255)}return n=+i[1],s=+i[3],o=+i[5],n=255&(i[2]?Ae(n):Nt(n,0,255)),s=255&(i[4]?Ae(s):Nt(s,0,255)),o=255&(i[6]?Ae(o):Nt(o,0,255)),{r:n,g:s,b:o,a:t}}}function Ml(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Tt(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}var Qi=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,de=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function Cl(e,i,t){let n=de(Tt(e.r)),s=de(Tt(e.g)),o=de(Tt(e.b));return{r:Vt(Qi(n+t*(de(Tt(i.r))-n))),g:Vt(Qi(s+t*(de(Tt(i.g))-s))),b:Vt(Qi(o+t*(de(Tt(i.b))-o))),a:e.a+t*(i.a-e.a)}}function di(e,i,t){if(e){let n=en(e);n[i]=Math.max(0,Math.min(n[i]+n[i]*t,i===0?360:1)),n=sn(n),e.r=n[0],e.g=n[1],e.b=n[2]}}function vo(e,i){return e&&Object.assign(i||{},e)}function xo(e){var i={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(i={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(i.a=Vt(e[3]))):(i=vo(e,{r:0,g:0,b:0,a:1}),i.a=Vt(i.a)),i}function wl(e){return e.charAt(0)==="r"?Sl(e):ml(e)}var Oe=class e{constructor(i){if(i instanceof e)return i;let t=typeof i,n;t==="object"?n=xo(i):t==="string"&&(n=rl(i)||yl(i)||wl(i)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var i=vo(this._rgb);return i&&(i.a=Tt(i.a)),i}set rgb(i){this._rgb=xo(i)}rgbString(){return this._valid?Ml(this._rgb):void 0}hexString(){return this._valid?cl(this._rgb):void 0}hslString(){return this._valid?xl(this._rgb):void 0}mix(i,t){if(i){let n=this.rgb,s=i.rgb,o,a=t===o?.5:t,r=2*a-1,l=n.a-s.a,c=((r*l===-1?r:(r+l)/(1+r*l))+1)/2;o=1-c,n.r=255&c*n.r+o*s.r+.5,n.g=255&c*n.g+o*s.g+.5,n.b=255&c*n.b+o*s.b+.5,n.a=a*n.a+(1-a)*s.a,this.rgb=n}return this}interpolate(i,t){return i&&(this._rgb=Cl(this._rgb,i._rgb,t)),this}clone(){return new e(this.rgb)}alpha(i){return this._rgb.a=Vt(i),this}clearer(i){let t=this._rgb;return t.a*=1-i,this}greyscale(){let i=this._rgb,t=Ee(i.r*.3+i.g*.59+i.b*.11);return i.r=i.g=i.b=t,this}opaquer(i){let t=this._rgb;return t.a*=1+i,this}negate(){let i=this._rgb;return i.r=255-i.r,i.g=255-i.g,i.b=255-i.b,this}lighten(i){return di(this._rgb,2,i),this}darken(i){return di(this._rgb,2,-i),this}saturate(i){return di(this._rgb,1,i),this}desaturate(i){return di(this._rgb,1,-i),this}rotate(i){return bl(this._rgb,i),this}};function Ct(){}var Eo=(()=>{let e=0;return()=>e++})();function A(e){return e==null}function W(e){if(Array.isArray&&Array.isArray(e))return!0;let i=Object.prototype.toString.call(e);return i.slice(0,7)==="[object"&&i.slice(-6)==="Array]"}function E(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function Y(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function ht(e,i){return Y(e)?e:i}function k(e,i){return typeof e>"u"?i:e}var Lo=(e,i)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/i,ln=(e,i)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*i:+e;function V(e,i,t){if(e&&typeof e.call=="function")return e.apply(t,i)}function B(e,i,t,n){let s,o,a;if(W(e))if(o=e.length,n)for(s=o-1;s>=0;s--)i.call(t,e[s],s);else for(s=0;s<o;s++)i.call(t,e[s],s);else if(E(e))for(a=Object.keys(e),o=a.length,s=0;s<o;s++)i.call(t,e[a[s]],a[s])}function Ie(e,i){let t,n,s,o;if(!e||!i||e.length!==i.length)return!1;for(t=0,n=e.length;t<n;++t)if(s=e[t],o=i[t],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function gi(e){if(W(e))return e.map(gi);if(E(e)){let i=Object.create(null),t=Object.keys(e),n=t.length,s=0;for(;s<n;++s)i[t[s]]=gi(e[t[s]]);return i}return e}function Ro(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function kl(e,i,t,n){if(!Ro(e))return;let s=i[e],o=t[e];E(s)&&E(o)?fe(s,o,n):i[e]=gi(o)}function fe(e,i,t){let n=W(i)?i:[i],s=n.length;if(!E(e))return e;t=t||{};let o=t.merger||kl,a;for(let r=0;r<s;++r){if(a=n[r],!E(a))continue;let l=Object.keys(a);for(let c=0,h=l.length;c<h;++c)o(l[c],e,a,t)}return e}function ge(e,i){return fe(e,i,{merger:Pl})}function Pl(e,i,t){if(!Ro(e))return;let n=i[e],s=t[e];E(n)&&E(s)?ge(n,s):Object.prototype.hasOwnProperty.call(i,e)||(i[e]=gi(s))}var So={"":e=>e,x:e=>e.x,y:e=>e.y};function Dl(e){let i=e.split("."),t=[],n="";for(let s of i)n+=s,n.endsWith("\\")?n=n.slice(0,-1)+".":(t.push(n),n="");return t}function Tl(e){let i=Dl(e);return t=>{for(let n of i){if(n==="")break;t=t&&t[n]}return t}}function Et(e,i){return(So[i]||(So[i]=Tl(i)))(e)}function _i(e){return e.charAt(0).toUpperCase()+e.slice(1)}var me=e=>typeof e<"u",At=e=>typeof e=="function",cn=(e,i)=>{if(e.size!==i.size)return!1;for(let t of e)if(!i.has(t))return!1;return!0};function Io(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}var I=Math.PI,H=2*I,Al=H+I,mi=Number.POSITIVE_INFINITY,Ol=I/180,U=I/2,Qt=I/4,Mo=I*2/3,Ot=Math.log10,_t=Math.sign;function be(e,i,t){return Math.abs(e-i)<t}function hn(e){let i=Math.round(e);e=be(e,i,e/1e3)?i:e;let t=Math.pow(10,Math.floor(Ot(e))),n=e/t;return(n<=1?1:n<=2?2:n<=5?5:10)*t}function Fo(e){let i=[],t=Math.sqrt(e),n;for(n=1;n<t;n++)e%n===0&&(i.push(n),i.push(e/n));return t===(t|0)&&i.push(t),i.sort((s,o)=>s-o).pop(),i}function El(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function ie(e){return!El(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function Bo(e,i){let t=Math.round(e);return t-i<=e&&t+i>=e}function dn(e,i,t){let n,s,o;for(n=0,s=e.length;n<s;n++)o=e[n][t],isNaN(o)||(i.min=Math.min(i.min,o),i.max=Math.max(i.max,o))}function mt(e){return e*(I/180)}function yi(e){return e*(180/I)}function un(e){if(!Y(e))return;let i=1,t=0;for(;Math.round(e*i)/i!==e;)i*=10,t++;return t}function fn(e,i){let t=i.x-e.x,n=i.y-e.y,s=Math.sqrt(t*t+n*n),o=Math.atan2(n,t);return o<-.5*I&&(o+=H),{angle:o,distance:s}}function bi(e,i){return Math.sqrt(Math.pow(i.x-e.x,2)+Math.pow(i.y-e.y,2))}function Ll(e,i){return(e-i+Al)%H-I}function st(e){return(e%H+H)%H}function xe(e,i,t,n){let s=st(e),o=st(i),a=st(t),r=st(o-s),l=st(a-s),c=st(s-o),h=st(s-a);return s===o||s===a||n&&o===a||r>l&&c<h}function Z(e,i,t){return Math.max(i,Math.min(t,e))}function zo(e){return Z(e,-32768,32767)}function wt(e,i,t,n=1e-6){return e>=Math.min(i,t)-n&&e<=Math.max(i,t)+n}function vi(e,i,t){t=t||(a=>e[a]<i);let n=e.length-1,s=0,o;for(;n-s>1;)o=s+n>>1,t(o)?s=o:n=o;return{lo:s,hi:n}}var St=(e,i,t,n)=>vi(e,t,n?s=>{let o=e[s][i];return o<t||o===t&&e[s+1][i]===t}:s=>e[s][i]<t),No=(e,i,t)=>vi(e,t,n=>e[n][i]>=t);function Vo(e,i,t){let n=0,s=e.length;for(;n<s&&e[n]<i;)n++;for(;s>n&&e[s-1]>t;)s--;return n>0||s<e.length?e.slice(n,s):e}var Wo=["push","pop","shift","splice","unshift"];function Ho(e,i){if(e._chartjs){e._chartjs.listeners.push(i);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[i]}}),Wo.forEach(t=>{let n="_onData"+_i(t),s=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value(...o){let a=s.apply(this,o);return e._chartjs.listeners.forEach(r=>{typeof r[n]=="function"&&r[n](...o)}),a}})})}function pn(e,i){let t=e._chartjs;if(!t)return;let n=t.listeners,s=n.indexOf(i);s!==-1&&n.splice(s,1),!(n.length>0)&&(Wo.forEach(o=>{delete e[o]}),delete e._chartjs)}function gn(e){let i=new Set(e);return i.size===e.length?e:Array.from(i)}var mn=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function bn(e,i){let t=[],n=!1;return function(...s){t=s,n||(n=!0,mn.call(window,()=>{n=!1,e.apply(i,t)}))}}function jo(e,i){let t;return function(...n){return i?(clearTimeout(t),t=setTimeout(e,i,n)):e.apply(this,n),i}}var Si=e=>e==="start"?"left":e==="end"?"right":"center",ot=(e,i,t)=>e==="start"?i:e==="end"?t:(i+t)/2,$o=(e,i,t,n)=>e===(n?"left":"right")?t:e==="center"?(i+t)/2:i;function xn(e,i,t){let n=i.length,s=0,o=n;if(e._sorted){let{iScale:a,vScale:r,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,h=a.axis,{min:d,max:u,minDefined:f,maxDefined:g}=a.getUserBounds();if(f){if(s=Math.min(St(l,h,d).lo,t?n:St(i,h,a.getPixelForValue(d)).lo),c){let p=l.slice(0,s+1).reverse().findIndex(m=>!A(m[r.axis]));s-=Math.max(0,p)}s=Z(s,0,n-1)}if(g){let p=Math.max(St(l,a.axis,u,!0).hi+1,t?0:St(i,h,a.getPixelForValue(u),!0).hi+1);if(c){let m=l.slice(p-1).findIndex(b=>!A(b[r.axis]));p+=Math.max(0,m)}o=Z(p,s,n)-s}else o=n-s}return{start:s,count:o}}function _n(e){let{xScale:i,yScale:t,_scaleRanges:n}=e,s={xmin:i.min,xmax:i.max,ymin:t.min,ymax:t.max};if(!n)return e._scaleRanges=s,!0;let o=n.xmin!==i.min||n.xmax!==i.max||n.ymin!==t.min||n.ymax!==t.max;return Object.assign(n,s),o}var ui=e=>e===0||e===1,Co=(e,i,t)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-i)*H/t)),wo=(e,i,t)=>Math.pow(2,-10*e)*Math.sin((e-i)*H/t)+1,ue={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*U)+1,easeOutSine:e=>Math.sin(e*U),easeInOutSine:e=>-.5*(Math.cos(I*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>ui(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>ui(e)?e:Co(e,.075,.3),easeOutElastic:e=>ui(e)?e:wo(e,.075,.3),easeInOutElastic(e){return ui(e)?e:e<.5?.5*Co(e*2,.1125,.45):.5+.5*wo(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let i=1.70158;return(e/=.5)<1?.5*(e*e*(((i*=1.525)+1)*e-i)):.5*((e-=2)*e*(((i*=1.525)+1)*e+i)+2)},easeInBounce:e=>1-ue.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?ue.easeInBounce(e*2)*.5:ue.easeOutBounce(e*2-1)*.5+.5};function yn(e){if(e&&typeof e=="object"){let i=e.toString();return i==="[object CanvasPattern]"||i==="[object CanvasGradient]"}return!1}function vn(e){return yn(e)?e:new Oe(e)}function on(e){return yn(e)?e:new Oe(e).saturate(.5).darken(.1).hexString()}var Rl=["x","y","borderWidth","radius","tension"],Il=["color","borderColor","backgroundColor"];function Fl(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:i=>i!=="onProgress"&&i!=="onComplete"&&i!=="fn"}),e.set("animations",{colors:{type:"color",properties:Il},numbers:{type:"number",properties:Rl}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:i=>i|0}}}})}function Bl(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var ko=new Map;function zl(e,i){i=i||{};let t=e+JSON.stringify(i),n=ko.get(t);return n||(n=new Intl.NumberFormat(e,i),ko.set(t,n)),n}function _e(e,i,t){return zl(i,t).format(e)}var Yo={values(e){return W(e)?e:""+e},numeric(e,i,t){if(e===0)return"0";let n=this.chart.options.locale,s,o=e;if(t.length>1){let c=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=Nl(e,t)}let a=Ot(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:s,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),_e(e,n,l)},logarithmic(e,i,t){if(e===0)return"0";let n=t[i].significand||e/Math.pow(10,Math.floor(Ot(e)));return[1,2,3,5,10,15].includes(n)||i>.8*t.length?Yo.numeric.call(this,e,i,t):""}};function Nl(e,i){let t=i.length>3?i[2].value-i[1].value:i[1].value-i[0].value;return Math.abs(t)>=1&&e!==Math.floor(e)&&(t=e-Math.floor(e)),t}var Fe={formatters:Yo};function Vl(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(i,t)=>t.lineWidth,tickColor:(i,t)=>t.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:Fe.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:i=>!i.startsWith("before")&&!i.startsWith("after")&&i!=="callback"&&i!=="parser",_indexable:i=>i!=="borderDash"&&i!=="tickBorderDash"&&i!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:i=>i!=="backdropPadding"&&i!=="callback",_indexable:i=>i!=="backdropPadding"})}var jt=Object.create(null),Mi=Object.create(null);function Le(e,i){if(!i)return e;let t=i.split(".");for(let n=0,s=t.length;n<s;++n){let o=t[n];e=e[o]||(e[o]=Object.create(null))}return e}function an(e,i,t){return typeof i=="string"?fe(Le(e,i),t):fe(Le(e,""),i)}var rn=class{constructor(i,t){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=n=>n.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=(n,s)=>on(s.backgroundColor),this.hoverBorderColor=(n,s)=>on(s.borderColor),this.hoverColor=(n,s)=>on(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(i),this.apply(t)}set(i,t){return an(this,i,t)}get(i){return Le(this,i)}describe(i,t){return an(Mi,i,t)}override(i,t){return an(jt,i,t)}route(i,t,n,s){let o=Le(this,i),a=Le(this,n),r="_"+t;Object.defineProperties(o,{[r]:{value:o[t],writable:!0},[t]:{enumerable:!0,get(){let l=this[r],c=a[s];return E(l)?Object.assign({},c,l):k(l,c)},set(l){this[r]=l}}})}apply(i){i.forEach(t=>t(this))}},j=new rn({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Fl,Bl,Vl]);function Wl(e){return!e||A(e.size)||A(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Re(e,i,t,n,s){let o=i[s];return o||(o=i[s]=e.measureText(s).width,t.push(s)),o>n&&(n=o),n}function Uo(e,i,t,n){n=n||{};let s=n.data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==i&&(s=n.data={},o=n.garbageCollect=[],n.font=i),e.save(),e.font=i;let a=0,r=t.length,l,c,h,d,u;for(l=0;l<r;l++)if(d=t[l],d!=null&&!W(d))a=Re(e,s,o,a,d);else if(W(d))for(c=0,h=d.length;c<h;c++)u=d[c],u!=null&&!W(u)&&(a=Re(e,s,o,a,u));e.restore();let f=o.length/2;if(f>t.length){for(l=0;l<f;l++)delete s[o[l]];o.splice(0,f)}return a}function $t(e,i,t){let n=e.currentDevicePixelRatio,s=t!==0?Math.max(t/2,.5):0;return Math.round((i-s)*n)/n+s}function Sn(e,i){!i&&!e||(i=i||e.getContext("2d"),i.save(),i.resetTransform(),i.clearRect(0,0,e.width,e.height),i.restore())}function Ci(e,i,t,n){Mn(e,i,t,n,null)}function Mn(e,i,t,n,s){let o,a,r,l,c,h,d,u,f=i.pointStyle,g=i.rotation,p=i.radius,m=(g||0)*Ol;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(t,n),e.rotate(m),e.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),e.restore();return}if(!(isNaN(p)||p<=0)){switch(e.beginPath(),f){default:s?e.ellipse(t,n,s/2,p,0,0,H):e.arc(t,n,p,0,H),e.closePath();break;case"triangle":h=s?s/2:p,e.moveTo(t+Math.sin(m)*h,n-Math.cos(m)*p),m+=Mo,e.lineTo(t+Math.sin(m)*h,n-Math.cos(m)*p),m+=Mo,e.lineTo(t+Math.sin(m)*h,n-Math.cos(m)*p),e.closePath();break;case"rectRounded":c=p*.516,l=p-c,a=Math.cos(m+Qt)*l,d=Math.cos(m+Qt)*(s?s/2-c:l),r=Math.sin(m+Qt)*l,u=Math.sin(m+Qt)*(s?s/2-c:l),e.arc(t-d,n-r,c,m-I,m-U),e.arc(t+u,n-a,c,m-U,m),e.arc(t+d,n+r,c,m,m+U),e.arc(t-u,n+a,c,m+U,m+I),e.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*p,h=s?s/2:l,e.rect(t-h,n-l,2*h,2*l);break}m+=Qt;case"rectRot":d=Math.cos(m)*(s?s/2:p),a=Math.cos(m)*p,r=Math.sin(m)*p,u=Math.sin(m)*(s?s/2:p),e.moveTo(t-d,n-r),e.lineTo(t+u,n-a),e.lineTo(t+d,n+r),e.lineTo(t-u,n+a),e.closePath();break;case"crossRot":m+=Qt;case"cross":d=Math.cos(m)*(s?s/2:p),a=Math.cos(m)*p,r=Math.sin(m)*p,u=Math.sin(m)*(s?s/2:p),e.moveTo(t-d,n-r),e.lineTo(t+d,n+r),e.moveTo(t+u,n-a),e.lineTo(t-u,n+a);break;case"star":d=Math.cos(m)*(s?s/2:p),a=Math.cos(m)*p,r=Math.sin(m)*p,u=Math.sin(m)*(s?s/2:p),e.moveTo(t-d,n-r),e.lineTo(t+d,n+r),e.moveTo(t+u,n-a),e.lineTo(t-u,n+a),m+=Qt,d=Math.cos(m)*(s?s/2:p),a=Math.cos(m)*p,r=Math.sin(m)*p,u=Math.sin(m)*(s?s/2:p),e.moveTo(t-d,n-r),e.lineTo(t+d,n+r),e.moveTo(t+u,n-a),e.lineTo(t-u,n+a);break;case"line":a=s?s/2:Math.cos(m)*p,r=Math.sin(m)*p,e.moveTo(t-a,n-r),e.lineTo(t+a,n+r);break;case"dash":e.moveTo(t,n),e.lineTo(t+Math.cos(m)*(s?s/2:p),n+Math.sin(m)*p);break;case!1:e.closePath();break}e.fill(),i.borderWidth>0&&e.stroke()}}function Mt(e,i,t){return t=t||.5,!i||e&&e.x>i.left-t&&e.x<i.right+t&&e.y>i.top-t&&e.y<i.bottom+t}function Be(e,i){e.save(),e.beginPath(),e.rect(i.left,i.top,i.right-i.left,i.bottom-i.top),e.clip()}function ze(e){e.restore()}function Xo(e,i,t,n,s){if(!i)return e.lineTo(t.x,t.y);if(s==="middle"){let o=(i.x+t.x)/2;e.lineTo(o,i.y),e.lineTo(o,t.y)}else s==="after"!=!!n?e.lineTo(i.x,t.y):e.lineTo(t.x,i.y);e.lineTo(t.x,t.y)}function Ko(e,i,t,n){if(!i)return e.lineTo(t.x,t.y);e.bezierCurveTo(n?i.cp1x:i.cp2x,n?i.cp1y:i.cp2y,n?t.cp2x:t.cp1x,n?t.cp2y:t.cp1y,t.x,t.y)}function Hl(e,i){i.translation&&e.translate(i.translation[0],i.translation[1]),A(i.rotation)||e.rotate(i.rotation),i.color&&(e.fillStyle=i.color),i.textAlign&&(e.textAlign=i.textAlign),i.textBaseline&&(e.textBaseline=i.textBaseline)}function jl(e,i,t,n,s){if(s.strikethrough||s.underline){let o=e.measureText(n),a=i-o.actualBoundingBoxLeft,r=i+o.actualBoundingBoxRight,l=t-o.actualBoundingBoxAscent,c=t+o.actualBoundingBoxDescent,h=s.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=s.decorationWidth||2,e.moveTo(a,h),e.lineTo(r,h),e.stroke()}}function $l(e,i){let t=e.fillStyle;e.fillStyle=i.color,e.fillRect(i.left,i.top,i.width,i.height),e.fillStyle=t}function Yt(e,i,t,n,s,o={}){let a=W(i)?i:[i],r=o.strokeWidth>0&&o.strokeColor!=="",l,c;for(e.save(),e.font=s.string,Hl(e,o),l=0;l<a.length;++l)c=a[l],o.backdrop&&$l(e,o.backdrop),r&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),A(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,t,n,o.maxWidth)),e.fillText(c,t,n,o.maxWidth),jl(e,t,n,c,o),n+=Number(s.lineHeight);e.restore()}function ye(e,i){let{x:t,y:n,w:s,h:o,radius:a}=i;e.arc(t+a.topLeft,n+a.topLeft,a.topLeft,1.5*I,I,!0),e.lineTo(t,n+o-a.bottomLeft),e.arc(t+a.bottomLeft,n+o-a.bottomLeft,a.bottomLeft,I,U,!0),e.lineTo(t+s-a.bottomRight,n+o),e.arc(t+s-a.bottomRight,n+o-a.bottomRight,a.bottomRight,U,0,!0),e.lineTo(t+s,n+a.topRight),e.arc(t+s-a.topRight,n+a.topRight,a.topRight,0,-U,!0),e.lineTo(t+a.topLeft,n)}var Yl=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Ul=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Xl(e,i){let t=(""+e).match(Yl);if(!t||t[1]==="normal")return i*1.2;switch(e=+t[2],t[3]){case"px":return e;case"%":e/=100;break}return i*e}var Kl=e=>+e||0;function wi(e,i){let t={},n=E(i),s=n?Object.keys(i):i,o=E(e)?n?a=>k(e[a],e[i[a]]):a=>e[a]:()=>e;for(let a of s)t[a]=Kl(o(a));return t}function Cn(e){return wi(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Ut(e){return wi(e,["topLeft","topRight","bottomLeft","bottomRight"])}function at(e){let i=Cn(e);return i.width=i.left+i.right,i.height=i.top+i.bottom,i}function G(e,i){e=e||{},i=i||j.font;let t=k(e.size,i.size);typeof t=="string"&&(t=parseInt(t,10));let n=k(e.style,i.style);n&&!(""+n).match(Ul)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);let s={family:k(e.family,i.family),lineHeight:Xl(k(e.lineHeight,i.lineHeight),t),size:t,style:n,weight:k(e.weight,i.weight),string:""};return s.string=Wl(s),s}function ve(e,i,t,n){let s=!0,o,a,r;for(o=0,a=e.length;o<a;++o)if(r=e[o],r!==void 0&&(i!==void 0&&typeof r=="function"&&(r=r(i),s=!1),t!==void 0&&W(r)&&(r=r[t%r.length],s=!1),r!==void 0))return n&&!s&&(n.cacheable=!1),r}function qo(e,i,t){let{min:n,max:s}=e,o=ln(i,(s-n)/2),a=(r,l)=>t&&r===0?0:r+l;return{min:a(n,-Math.abs(o)),max:a(s,o)}}function Lt(e,i){return Object.assign(Object.create(e),i)}function ki(e,i=[""],t,n,s=()=>e[0]){let o=t||e;typeof n>"u"&&(n=Zo("_fallback",e));let a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:n,_getTarget:s,override:r=>ki([r,...e],i,o,n)};return new Proxy(a,{deleteProperty(r,l){return delete r[l],delete r._keys,delete e[0][l],!0},get(r,l){return Go(r,l,()=>ic(l,i,e,r))},getOwnPropertyDescriptor(r,l){return Reflect.getOwnPropertyDescriptor(r._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(r,l){return Do(r).includes(l)},ownKeys(r){return Do(r)},set(r,l,c){let h=r._storage||(r._storage=s());return r[l]=h[l]=c,delete r._keys,!0}})}function ee(e,i,t,n){let s={_cacheable:!1,_proxy:e,_context:i,_subProxy:t,_stack:new Set,_descriptors:wn(e,n),setContext:o=>ee(e,o,t,n),override:o=>ee(e.override(o),i,t,n)};return new Proxy(s,{deleteProperty(o,a){return delete o[a],delete e[a],!0},get(o,a,r){return Go(o,a,()=>Gl(o,a,r))},getOwnPropertyDescriptor(o,a){return o._descriptors.allKeys?Reflect.has(e,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,a)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,a){return Reflect.has(e,a)},ownKeys(){return Reflect.ownKeys(e)},set(o,a,r){return e[a]=r,delete o[a],!0}})}function wn(e,i={scriptable:!0,indexable:!0}){let{_scriptable:t=i.scriptable,_indexable:n=i.indexable,_allKeys:s=i.allKeys}=e;return{allKeys:s,scriptable:t,indexable:n,isScriptable:At(t)?t:()=>t,isIndexable:At(n)?n:()=>n}}var ql=(e,i)=>e?e+_i(i):i,kn=(e,i)=>E(i)&&e!=="adapters"&&(Object.getPrototypeOf(i)===null||i.constructor===Object);function Go(e,i,t){if(Object.prototype.hasOwnProperty.call(e,i)||i==="constructor")return e[i];let n=t();return e[i]=n,n}function Gl(e,i,t){let{_proxy:n,_context:s,_subProxy:o,_descriptors:a}=e,r=n[i];return At(r)&&a.isScriptable(i)&&(r=Jl(i,r,e,t)),W(r)&&r.length&&(r=Zl(i,r,e,a.isIndexable)),kn(i,r)&&(r=ee(r,s,o&&o[i],a)),r}function Jl(e,i,t,n){let{_proxy:s,_context:o,_subProxy:a,_stack:r}=t;if(r.has(e))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+e);r.add(e);let l=i(o,a||n);return r.delete(e),kn(e,l)&&(l=Pn(s._scopes,s,e,l)),l}function Zl(e,i,t,n){let{_proxy:s,_context:o,_subProxy:a,_descriptors:r}=t;if(typeof o.index<"u"&&n(e))return i[o.index%i.length];if(E(i[0])){let l=i,c=s._scopes.filter(h=>h!==l);i=[];for(let h of l){let d=Pn(c,s,e,h);i.push(ee(d,o,a&&a[e],r))}}return i}function Jo(e,i,t){return At(e)?e(i,t):e}var Ql=(e,i)=>e===!0?i:typeof e=="string"?Et(i,e):void 0;function tc(e,i,t,n,s){for(let o of i){let a=Ql(t,o);if(a){e.add(a);let r=Jo(a._fallback,t,s);if(typeof r<"u"&&r!==t&&r!==n)return r}else if(a===!1&&typeof n<"u"&&t!==n)return null}return!1}function Pn(e,i,t,n){let s=i._rootScopes,o=Jo(i._fallback,t,n),a=[...e,...s],r=new Set;r.add(n);let l=Po(r,a,t,o||t,n);return l===null||typeof o<"u"&&o!==t&&(l=Po(r,a,o,l,n),l===null)?!1:ki(Array.from(r),[""],s,o,()=>ec(i,t,n))}function Po(e,i,t,n,s){for(;t;)t=tc(e,i,t,n,s);return t}function ec(e,i,t){let n=e._getTarget();i in n||(n[i]={});let s=n[i];return W(s)&&E(t)?t:s||{}}function ic(e,i,t,n){let s;for(let o of i)if(s=Zo(ql(o,e),t),typeof s<"u")return kn(e,s)?Pn(t,n,e,s):s}function Zo(e,i){for(let t of i){if(!t)continue;let n=t[e];if(typeof n<"u")return n}}function Do(e){let i=e._keys;return i||(i=e._keys=nc(e._scopes)),i}function nc(e){let i=new Set;for(let t of e)for(let n of Object.keys(t).filter(s=>!s.startsWith("_")))i.add(n);return Array.from(i)}function Dn(e,i,t,n){let{iScale:s}=e,{key:o="r"}=this._parsing,a=new Array(n),r,l,c,h;for(r=0,l=n;r<l;++r)c=r+t,h=i[c],a[r]={r:s.parse(Et(h,o),c)};return a}var sc=Number.EPSILON||1e-14,pe=(e,i)=>i<e.length&&!e[i].skip&&e[i],Qo=e=>e==="x"?"y":"x";function oc(e,i,t,n){let s=e.skip?i:e,o=i,a=t.skip?i:t,r=bi(o,s),l=bi(a,o),c=r/(r+l),h=l/(r+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;let d=n*c,u=n*h;return{previous:{x:o.x-d*(a.x-s.x),y:o.y-d*(a.y-s.y)},next:{x:o.x+u*(a.x-s.x),y:o.y+u*(a.y-s.y)}}}function ac(e,i,t){let n=e.length,s,o,a,r,l,c=pe(e,0);for(let h=0;h<n-1;++h)if(l=c,c=pe(e,h+1),!(!l||!c)){if(be(i[h],0,sc)){t[h]=t[h+1]=0;continue}s=t[h]/i[h],o=t[h+1]/i[h],r=Math.pow(s,2)+Math.pow(o,2),!(r<=9)&&(a=3/Math.sqrt(r),t[h]=s*a*i[h],t[h+1]=o*a*i[h])}}function rc(e,i,t="x"){let n=Qo(t),s=e.length,o,a,r,l=pe(e,0);for(let c=0;c<s;++c){if(a=r,r=l,l=pe(e,c+1),!r)continue;let h=r[t],d=r[n];a&&(o=(h-a[t])/3,r[`cp1${t}`]=h-o,r[`cp1${n}`]=d-o*i[c]),l&&(o=(l[t]-h)/3,r[`cp2${t}`]=h+o,r[`cp2${n}`]=d+o*i[c])}}function lc(e,i="x"){let t=Qo(i),n=e.length,s=Array(n).fill(0),o=Array(n),a,r,l,c=pe(e,0);for(a=0;a<n;++a)if(r=l,l=c,c=pe(e,a+1),!!l){if(c){let h=c[i]-l[i];s[a]=h!==0?(c[t]-l[t])/h:0}o[a]=r?c?_t(s[a-1])!==_t(s[a])?0:(s[a-1]+s[a])/2:s[a-1]:s[a]}ac(e,s,o),rc(e,o,i)}function fi(e,i,t){return Math.max(Math.min(e,t),i)}function cc(e,i){let t,n,s,o,a,r=Mt(e[0],i);for(t=0,n=e.length;t<n;++t)a=o,o=r,r=t<n-1&&Mt(e[t+1],i),o&&(s=e[t],a&&(s.cp1x=fi(s.cp1x,i.left,i.right),s.cp1y=fi(s.cp1y,i.top,i.bottom)),r&&(s.cp2x=fi(s.cp2x,i.left,i.right),s.cp2y=fi(s.cp2y,i.top,i.bottom)))}function ta(e,i,t,n,s){let o,a,r,l;if(i.spanGaps&&(e=e.filter(c=>!c.skip)),i.cubicInterpolationMode==="monotone")lc(e,s);else{let c=n?e[e.length-1]:e[0];for(o=0,a=e.length;o<a;++o)r=e[o],l=oc(c,r,e[Math.min(o+1,a-(n?0:1))%a],i.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,c=r}i.capBezierPoints&&cc(e,t)}function Pi(){return typeof window<"u"&&typeof document<"u"}function Di(e){let i=e.parentNode;return i&&i.toString()==="[object ShadowRoot]"&&(i=i.host),i}function xi(e,i,t){let n;return typeof e=="string"?(n=parseInt(e,10),e.indexOf("%")!==-1&&(n=n/100*i.parentNode[t])):n=e,n}var Ti=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function hc(e,i){return Ti(e).getPropertyValue(i)}var dc=["top","right","bottom","left"];function te(e,i,t){let n={};t=t?"-"+t:"";for(let s=0;s<4;s++){let o=dc[s];n[o]=parseFloat(e[i+"-"+o+t])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}var uc=(e,i,t)=>(e>0||i>0)&&(!t||!t.shadowRoot);function fc(e,i){let t=e.touches,n=t&&t.length?t[0]:e,{offsetX:s,offsetY:o}=n,a=!1,r,l;if(uc(s,o,e.target))r=s,l=o;else{let c=i.getBoundingClientRect();r=n.clientX-c.left,l=n.clientY-c.top,a=!0}return{x:r,y:l,box:a}}function Xt(e,i){if("native"in e)return e;let{canvas:t,currentDevicePixelRatio:n}=i,s=Ti(t),o=s.boxSizing==="border-box",a=te(s,"padding"),r=te(s,"border","width"),{x:l,y:c,box:h}=fc(e,t),d=a.left+(h&&r.left),u=a.top+(h&&r.top),{width:f,height:g}=i;return o&&(f-=a.width+r.width,g-=a.height+r.height),{x:Math.round((l-d)/f*t.width/n),y:Math.round((c-u)/g*t.height/n)}}function pc(e,i,t){let n,s;if(i===void 0||t===void 0){let o=e&&Di(e);if(!o)i=e.clientWidth,t=e.clientHeight;else{let a=o.getBoundingClientRect(),r=Ti(o),l=te(r,"border","width"),c=te(r,"padding");i=a.width-c.width-l.width,t=a.height-c.height-l.height,n=xi(r.maxWidth,o,"clientWidth"),s=xi(r.maxHeight,o,"clientHeight")}}return{width:i,height:t,maxWidth:n||mi,maxHeight:s||mi}}var Ht=e=>Math.round(e*10)/10;function ea(e,i,t,n){let s=Ti(e),o=te(s,"margin"),a=xi(s.maxWidth,e,"clientWidth")||mi,r=xi(s.maxHeight,e,"clientHeight")||mi,l=pc(e,i,t),{width:c,height:h}=l;if(s.boxSizing==="content-box"){let u=te(s,"border","width"),f=te(s,"padding");c-=f.width+u.width,h-=f.height+u.height}return c=Math.max(0,c-o.width),h=Math.max(0,n?c/n:h-o.height),c=Ht(Math.min(c,a,l.maxWidth)),h=Ht(Math.min(h,r,l.maxHeight)),c&&!h&&(h=Ht(c/2)),(i!==void 0||t!==void 0)&&n&&l.height&&h>l.height&&(h=l.height,c=Ht(Math.floor(h*n))),{width:c,height:h}}function Tn(e,i,t){let n=i||1,s=Ht(e.height*n),o=Ht(e.width*n);e.height=Ht(e.height),e.width=Ht(e.width);let a=e.canvas;return a.style&&(t||!a.style.height&&!a.style.width)&&(a.style.height=`${e.height}px`,a.style.width=`${e.width}px`),e.currentDevicePixelRatio!==n||a.height!==s||a.width!==o?(e.currentDevicePixelRatio=n,a.height=s,a.width=o,e.ctx.setTransform(n,0,0,n,0,0),!0):!1}var ia=(function(){let e=!1;try{let i={get passive(){return e=!0,!1}};Pi()&&(window.addEventListener("test",null,i),window.removeEventListener("test",null,i))}catch{}return e})();function An(e,i){let t=hc(e,i),n=t&&t.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Wt(e,i,t,n){return{x:e.x+t*(i.x-e.x),y:e.y+t*(i.y-e.y)}}function na(e,i,t,n){return{x:e.x+t*(i.x-e.x),y:n==="middle"?t<.5?e.y:i.y:n==="after"?t<1?e.y:i.y:t>0?i.y:e.y}}function sa(e,i,t,n){let s={x:e.cp2x,y:e.cp2y},o={x:i.cp1x,y:i.cp1y},a=Wt(e,s,t),r=Wt(s,o,t),l=Wt(o,i,t),c=Wt(a,r,t),h=Wt(r,l,t);return Wt(c,h,t)}var gc=function(e,i){return{x(t){return e+e+i-t},setWidth(t){i=t},textAlign(t){return t==="center"?t:t==="right"?"left":"right"},xPlus(t,n){return t-n},leftForLtr(t,n){return t-n}}},mc=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,i){return e+i},leftForLtr(e,i){return e}}};function ne(e,i,t){return e?gc(i,t):mc()}function On(e,i){let t,n;(i==="ltr"||i==="rtl")&&(t=e.canvas.style,n=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",i,"important"),e.prevTextDirection=n)}function En(e,i){i!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",i[0],i[1]))}function oa(e){return e==="angle"?{between:xe,compare:Ll,normalize:st}:{between:wt,compare:(i,t)=>i-t,normalize:i=>i}}function To({start:e,end:i,count:t,loop:n,style:s}){return{start:e%t,end:i%t,loop:n&&(i-e+1)%t===0,style:s}}function bc(e,i,t){let{property:n,start:s,end:o}=t,{between:a,normalize:r}=oa(n),l=i.length,{start:c,end:h,loop:d}=e,u,f;if(d){for(c+=l,h+=l,u=0,f=l;u<f&&a(r(i[c%l][n]),s,o);++u)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:d,style:e.style}}function Ln(e,i,t){if(!t)return[e];let{property:n,start:s,end:o}=t,a=i.length,{compare:r,between:l,normalize:c}=oa(n),{start:h,end:d,loop:u,style:f}=bc(e,i,t),g=[],p=!1,m=null,b,x,y,S=()=>l(s,y,b)&&r(s,y)!==0,_=()=>r(o,b)===0||l(o,y,b),v=()=>p||S(),C=()=>!p||_();for(let M=h,w=h;M<=d;++M)x=i[M%a],!x.skip&&(b=c(x[n]),b!==y&&(p=l(b,s,o),m===null&&v()&&(m=r(b,s)===0?M:w),m!==null&&C()&&(g.push(To({start:m,end:M,loop:u,count:a,style:f})),m=null),w=M,y=b));return m!==null&&g.push(To({start:m,end:d,loop:u,count:a,style:f})),g}function Rn(e,i){let t=[],n=e.segments;for(let s=0;s<n.length;s++){let o=Ln(n[s],e.points,i);o.length&&t.push(...o)}return t}function xc(e,i,t,n){let s=0,o=i-1;if(t&&!n)for(;s<i&&!e[s].skip;)s++;for(;s<i&&e[s].skip;)s++;for(s%=i,t&&(o+=s);o>s&&e[o%i].skip;)o--;return o%=i,{start:s,end:o}}function _c(e,i,t,n){let s=e.length,o=[],a=i,r=e[i],l;for(l=i+1;l<=t;++l){let c=e[l%s];c.skip||c.stop?r.skip||(n=!1,o.push({start:i%s,end:(l-1)%s,loop:n}),i=a=c.stop?l:null):(a=l,r.skip&&(i=l)),r=c}return a!==null&&o.push({start:i%s,end:a%s,loop:n}),o}function aa(e,i){let t=e.points,n=e.options.spanGaps,s=t.length;if(!s)return[];let o=!!e._loop,{start:a,end:r}=xc(t,s,o,n);if(n===!0)return Ao(e,[{start:a,end:r,loop:o}],t,i);let l=r<a?r+s:r,c=!!e._fullLoop&&a===0&&r===s-1;return Ao(e,_c(t,a,l,c),t,i)}function Ao(e,i,t,n){return!n||!n.setContext||!t?i:yc(e,i,t,n)}function yc(e,i,t,n){let s=e._chart.getContext(),o=Oo(e.options),{_datasetIndex:a,options:{spanGaps:r}}=e,l=t.length,c=[],h=o,d=i[0].start,u=d;function f(g,p,m,b){let x=r?-1:1;if(g!==p){for(g+=l;t[g%l].skip;)g-=x;for(;t[p%l].skip;)p+=x;g%l!==p%l&&(c.push({start:g%l,end:p%l,loop:m,style:b}),h=b,d=p%l)}}for(let g of i){d=r?d:g.start;let p=t[d%l],m;for(u=d+1;u<=g.end;u++){let b=t[u%l];m=Oo(n.setContext(Lt(s,{type:"segment",p0:p,p1:b,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:a}))),vc(m,h)&&f(d,u-1,g.loop,h),p=b,h=m}d<u-1&&f(d,u-1,g.loop,h)}return c}function Oo(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function vc(e,i){if(!i)return!1;let t=[],n=function(s,o){return yn(o)?(t.includes(o)||t.push(o),t.indexOf(o)):o};return JSON.stringify(e,n)!==JSON.stringify(i,n)}function pi(e,i,t){return e.options.clip?e[t]:i[t]}function Sc(e,i){let{xScale:t,yScale:n}=e;return t&&n?{left:pi(t,i,"left"),right:pi(t,i,"right"),top:pi(n,i,"top"),bottom:pi(n,i,"bottom")}:i}function In(e,i){let t=i._clip;if(t.disabled)return!1;let n=Sc(i,e.chartArea);return{left:t.left===!1?0:n.left-(t.left===!0?0:t.left),right:t.right===!1?e.width:n.right+(t.right===!0?0:t.right),top:t.top===!1?0:n.top-(t.top===!0?0:t.top),bottom:t.bottom===!1?e.height:n.bottom+(t.bottom===!0?0:t.bottom)}}var Xn=class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(i,t,n,s){let o=t.listeners[s],a=t.duration;o.forEach(r=>r({chart:i,initial:t.initial,numSteps:a,currentStep:Math.min(n-t.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=mn.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(i=Date.now()){let t=0;this._charts.forEach((n,s)=>{if(!n.running||!n.items.length)return;let o=n.items,a=o.length-1,r=!1,l;for(;a>=0;--a)l=o[a],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(i),r=!0):(o[a]=o[o.length-1],o.pop());r&&(s.draw(),this._notify(s,n,i,"progress")),o.length||(n.running=!1,this._notify(s,n,i,"complete"),n.initial=!1),t+=o.length}),this._lastDate=i,t===0&&(this._running=!1)}_getAnims(i){let t=this._charts,n=t.get(i);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(i,n)),n}listen(i,t,n){this._getAnims(i).listeners[t].push(n)}add(i,t){!t||!t.length||this._getAnims(i).items.push(...t)}has(i){return this._getAnims(i).items.length>0}start(i){let t=this._charts.get(i);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((n,s)=>Math.max(n,s._duration),0),this._refresh())}running(i){if(!this._running)return!1;let t=this._charts.get(i);return!(!t||!t.running||!t.items.length)}stop(i){let t=this._charts.get(i);if(!t||!t.items.length)return;let n=t.items,s=n.length-1;for(;s>=0;--s)n[s].cancel();t.items=[],this._notify(i,t,Date.now(),"complete")}remove(i){return this._charts.delete(i)}},Rt=new Xn,ra="transparent",Mc={boolean(e,i,t){return t>.5?i:e},color(e,i,t){let n=vn(e||ra),s=n.valid&&vn(i||ra);return s&&s.valid?s.mix(n,t).hexString():i},number(e,i,t){return e+(i-e)*t}},Kn=class{constructor(i,t,n,s){let o=t[n];s=ve([i.to,s,o,i.from]);let a=ve([i.from,o,s]);this._active=!0,this._fn=i.fn