hosp_2025/public/js/filament/widgets/components/stats-overview/stat/chart.js

23 lines
201 KiB
JavaScript
Raw Permalink Normal View History

2025-12-11 15:10:26 -04:00
var Jo=Object.defineProperty;var Zo=(i,t,e)=>t in i?Jo(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var M=(i,t,e)=>Zo(i,typeof t!="symbol"?t+"":t,e);function ve(i){return i+.5|0}var wt=(i,t,e)=>Math.max(Math.min(i,e),t);function _e(i){return wt(ve(i*2.55),0,255)}function St(i){return wt(ve(i*255),0,255)}function mt(i){return wt(ve(i/2.55)/100,0,1)}function zs(i){return wt(ve(i*100),0,100)}var nt={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},Ai=[..."0123456789ABCDEF"],Qo=i=>Ai[i&15],ta=i=>Ai[(i&240)>>4]+Ai[i&15],Ue=i=>(i&240)>>4===(i&15),ea=i=>Ue(i.r)&&Ue(i.g)&&Ue(i.b)&&Ue(i.a);function ia(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&nt[i[1]]*17,g:255&nt[i[2]]*17,b:255&nt[i[3]]*17,a:t===5?nt[i[4]]*17:255}:(t===7||t===9)&&(e={r:nt[i[1]]<<4|nt[i[2]],g:nt[i[3]]<<4|nt[i[4]],b:nt[i[5]]<<4|nt[i[6]],a:t===9?nt[i[7]]<<4|nt[i[8]]:255})),e}var sa=(i,t)=>i<255?t(i):"";function na(i){var t=ea(i)?Qo:ta;return i?"#"+t(i.r)+t(i.g)+t(i.b)+sa(i.a,t):void 0}var oa=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ns(i,t,e){let s=t*Math.min(e,1-e),n=(o,a=(o+i/30)%12)=>e-s*Math.max(Math.min(a-3,9-a,1),-1);return[n(0),n(8),n(4)]}function aa(i,t,e){let s=(n,o=(n+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function ra(i,t,e){let s=Ns(i,1,.5),n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)s[n]*=1-t-e,s[n]+=t;return s}function la(i,t,e,s,n){return i===n?(t-e)/s+(t<e?6:0):t===n?(e-i)/s+2:(i-t)/s+4}function Ti(i){let e=i.r/255,s=i.g/255,n=i.b/255,o=Math.max(e,s,n),a=Math.min(e,s,n),r=(o+a)/2,l,c,h;return o!==a&&(h=o-a,c=r>.5?h/(2-o-a):h/(o+a),l=la(e,s,n,h,o),l=l*60+.5),[l|0,c||0,r]}function Li(i,t,e,s){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,s)).map(St)}function Ri(i,t,e){return Li(Ns,i,t,e)}function ca(i,t,e){return Li(ra,i,t,e)}function ha(i,t,e){return Li(aa,i,t,e)}function Hs(i){return(i%360+360)%360}function da(i){let t=oa.exec(i),e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?_e(+t[5]):St(+t[5]));let n=Hs(+t[2]),o=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?s=ca(n,o,a):t[1]==="hsv"?s=ha(n,o,a):s=Ri(n,o,a),{r:s[0],g:s[1],b:s[2],a:e}}function ua(i,t){var e=Ti(i);e[0]=Hs(e[0]+t),e=Ri(e),i.r=e[0],i.g=e[1],i.b=e[2]}function fa(i){if(!i)return;let t=Ti(i),e=t[0],s=zs(t[1]),n=zs(t[2]);return i.a<255?`hsla(${e}, ${s}%, ${n}%, ${mt(i.a)})`:`hsl(${e}, ${s}%, ${n}%)`}var Bs={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"},Vs={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:"9370
`)>-1?i.split(`
`):i}function Qc(i,t){let{element:e,datasetIndex:s,index:n}=t,o=i.getDatasetMeta(s).controller,{label:a,value:r}=o.getLabelAndValue(n);return{chart:i,label:a,parsed:o.getParsed(n),raw:i.data.datasets[s].data[n],formattedValue:r,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function po(i,t){let e=i.chart.ctx,{body:s,footer:n,title:o}=i,{boxWidth:a,boxHeight:r}=t,l=$(t.bodyFont),c=$(t.titleFont),h=$(t.footerFont),d=o.length,u=n.length,f=s.length,g=q(t.padding),p=g.height,m=0,b=s.reduce((y,_)=>y+_.before.length+_.lines.length+_.after.length,0);if(b+=i.beforeBody.length+i.afterBody.length,d&&(p+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){let y=t.displayColors?Math.max(r,l.lineHeight):l.lineHeight;p+=f*y+(b-f)*l.lineHeight+(b-1)*t.bodySpacing}u&&(p+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let x=0,v=function(y){m=Math.max(m,e.measureText(y).width+x)};return e.save(),e.font=c.string,E(i.title,v),e.font=l.string,E(i.beforeBody.concat(i.afterBody),v),x=t.displayColors?a+2+t.boxPadding:0,E(s,y=>{E(y.before,v),E(y.lines,v),E(y.after,v)}),x=0,e.font=h.string,E(i.footer,v),e.restore(),m+=g.width,{width:m,height:p}}function th(i,t){let{y:e,height:s}=t;return e<s/2?"top":e>i.height-s/2?"bottom":"center"}function eh(i,t,e,s){let{x:n,width:o}=s,a=e.caretSize+e.caretPadding;if(i==="left"&&n+o+a>t.width||i==="right"&&n-o-a<0)return!0}function ih(i,t,e,s){let{x:n,width:o}=e,{width:a,chartArea:{left:r,right:l}}=i,c="center";return s==="center"?c=n<=(r+l)/2?"left":"right":n<=o/2?c="left":n>=a-o/2&&(c="right"),eh(c,i,t,e)&&(c="center"),c}function mo(i,t,e){let s=e.yAlign||t.yAlign||th(i,e);return{xAlign:e.xAlign||t.xAlign||ih(i,t,e,s),yAlign:s}}function sh(i,t){let{x:e,width:s}=i;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function nh(i,t,e){let{y:s,height:n}=i;return t==="top"?s+=e:t==="bottom"?s-=n+e:s-=n/2,s}function bo(i,t,e,s){let{caretSize:n,caretPadding:o,cornerRadius:a}=i,{xAlign:r,yAlign:l}=e,c=n+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=Tt(a),g=sh(t,r),p=nh(t,l,c);return l==="center"?r==="left"?g+=c:r==="right"&&(g-=c):r==="left"?g-=Math.max(h,u)+n:r==="right"&&(g+=Math.max(d,f)+n),{x:Y(g,0,s.width-t.width),y:Y(p,0,s.height-t.height)}}function bi(i,t,e){let s=q(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-s.right:i.x+s.left}function xo(i){return ft([],Mt(i))}function oh(i,t,e){return yt(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function _o(i,t){let e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}var Ko={beforeTitle:dt,title(i){if(i.length>0){let t=i[0],e=t.chart.data.labels,s=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex<s)return e[t.dataIndex]}return""},afterTitle:dt,beforeBody:dt,beforeLabel:dt,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let t=i.dataset.label||"";t&&(t+=": ");let e=i.formattedValue;return A(e)||(t+=e),t},labelColor(i){let e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(i){let e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:dt,afterBody:dt,beforeFooter:dt,footer:dt,afterFooter:dt};function Q(i,t,e,s){let n=i[t].call(e,s);return typeof n>"u"?Ko[t].call(e,s):n}var We=class extends st{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=vo
/*! Bundled license information:
@kurkle/color/dist/color.esm.js:
(*!
* @kurkle/color v0.3.4
* https://github.com/kurkle/color#readme
* (c) 2024 Jukka Kurkela
* Released under the MIT License
*)
chart.js/dist/chunks/helpers.dataset.js:
chart.js/dist/chart.js:
(*!
* Chart.js v4.5.1
* https://www.chartjs.org
* (c) 2025 Chart.js Contributors
* Released under the MIT License
*)
*/