PageSourceSearch

https://tomato.gg/assets/nivo-calendar.es-C12i3G1J.js

js tomato.gg collected 2026-10-04 05:24:20 UTC 23,248 bytes, 1 lines download raw bytes

1import{S as qt,I as $t,bk as ee,bl as me,bm as ge,z as At,c as Nt,O as Et,g as oe,k as Xt,H as Gt,bc as Zt,b8 as Pt,b6 as fe,b4 as ye,b2 as ve,b0 as pe,a_ as xe,aY as be,bn as Se,aW as Tt,e as we,aI as ke,w as We}from"./nivo-core.es-CyZM7F2I.js";import{q as Ce,O as ne,H as Le}from"./nivo-legends.es-BMCEJFtR.js";import{j as f,r as p}from"./index-D6h6POgK.js";import{C as Ht,a as Me}from"./isDate-BCqP632m.js";import{z as je}from"./memoize-DSrEs34_.js";import{r as ze}from"./range-Di8--TfL.js";import"./string-B6NtwyIl.js";import"./_defineProperty-Bz5qGQ-b.js";import"./_isIterateeCall-rO7taIQZ.js";import"./_baseAssignValue-D68-QOrz.js";import"./sortBy-D2IqbDWA.js";import"./identity-CdjJNdvM.js";import"./_initCloneObject-CFOa3ZOr.js";import"./isArrayLikeObject-D5XUxk-U.js";import"./get-DrasMaYq.js";import"./_arrayIncludesWith-XJRwRZaz.js";import"./isEqual-BkuW0-GO.js";import"./linear-dN3TQtjf.js";function g(){return g=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},g.apply(this,arguments)}function Bt(t,e){if(t==null)return{};var o,n,r={},i=Object.keys(t);for(n=0;n<i.length;n++)o=i[n],e.indexOf(o)>=0||(r[o]=t[o]);return r}var Ut,Oe=p.memo((function(t){var e=t.years,o=t.legend,n=t.theme;return f.jsx(f.Fragment,{children:e.map((function(r){return f.jsx("text",{transform:"translate("+r.x+","+r.y+") rotate("+r.rotation+")",textAnchor:"middle",style:n.labels.text,children:o(r.year)},r.year)}))})})),Ie=p.memo((function(t){var e=t.path,o=t.borderWidth,n=t.borderColor;return f.jsx("path",{d:e,style:{fill:"none",strokeWidth:o,stroke:n,pointerEvents:"none"}})})),re=p.memo((function(t){var e=t.months,o=t.legend,n=t.theme;return f.jsx(f.Fragment,{children:e.map((function(r){return f.jsx("text",{transform:"translate("+r.x+","+r.y+") rotate("+r.rotation+")",textAnchor:"middle",style:n.labels.text,children:o(r.year,r.month,r.date)},r.date.toString()+".legend")}))})})),Ve=p.memo((function(t){var e=t.data,o=t.x,n=t.y,r=t.size,i=t.color,d=t.borderWidth,a=t.borderColor,l=t.isInteractive,s=t.tooltip,w=t.onMouseEnter,k=t.onMouseMove,y=t.onMouseLeave,m=t.onClick,v=t.formatValue,x=Xt(),u=x.showTooltipFromEvent,b=x.hideTooltip,C=p.useCallback((function(L){if("value"in e){var F=g({},e,{value:v(e.value),data:g({},e.data)});u(p.createElement(s,g({},F)),L),w?.(e,L)}}),[u,s,e,w,v]),D=p.useCallback((function(L){if("value"in e){var F=g({},e,{value:v(e.value),data:g({},e.data)});u(p.createElement(s,g({},F)),L),k&&k(e,L)}}),[u,s,e,k,v]),S=p.useCallback((function(L){"value"in e&&(b(),y?.(e,L))}),[b,e,y]),R=p.useCallback((function(L){return m?.(e,L)}),[e,m]);return f.jsx("rect",{x:o,y:n,width:r,height:r,style:{fill:i,strokeWidth:d,stroke:a},onMouseEnter:l?C:void 0,onMouseMove:l?D:void 0,onMouseLeave:l?S:void 0,onClick:l?R:void 0})})),De=p.memo((function(t){var e=t.value,o=t.day,n=t.color;return e===void 0||isNaN(Number(e))?null:f.jsx(We,{id:o,value:e,color:n,enableChip:!0})})),Ee=Zt("%b"),ie={colors:["#61cdbb","#97e3d5","#e8c1a0","#f47560"],align:"center",direction:"horizontal",emptyColor:"#fff",minValue:0,maxValue:"auto",yearSpacing:30,yearLegend:function(t){return t},yearLegendPosition:"before",yearLegendOffset:10,monthBorderWidth:2,monthBorderColor:"#000",monthSpacing:0,monthLegend:function(t,e,o){return Ee(o)},monthLegendPosition:"before",monthLegendOffset:10,daySpacing:0,dayBorderWidth:1,dayBorderColor:"#000",isInteractive:!0,legends:[],tooltip:De},z=g({},ie,{role:"img"}),H=g({},ie,{pixelRatio:typeof window<"u"&&(Ut=window.devicePixelRatio)!=null?Ut:1}),B=g({},z,{dayBorderColor:"#fff",dayRadius:0,square:!0,weekdayLegendOffset:75,firstWeekday:"sunday"}),He=function(t,e,o){var n=t.map((function(r){return r.value}));return[e==="auto"?Math.min.apply(Math,n):e,o==="auto"?Math.max.apply(Math,n):o]},Pe=je((function(t){var e,o=t.date,n=t.cellSize,r=t.yearIndex,i=t.yearSpacing,d=t.monthSpacing,a=t.daySpacing,l=t.direction,s=t.originX,w=t.originY,k=new Date(o.getFullYear(),o.getMonth()+1,0),y=Pt.count(Tt(o),o),m=Pt.count(Tt(k),k),v=o.getDay(),x=k.getDay(),u=s,b=w,C=r*(7*(n+a)+i),D=o.getMonth()*d;l==="horizontal"?(b+=C,u+=D):(b+=D,u+=C);var S={x:u,y:b,width:0,height:0};return l==="horizontal"?(e=["M"+(u+(y+1)*(n+a))+","+(b+v*(n+a)),"H"+(u+y*(n+a))+"V"+(b+7*(n+a)),"H"+(u+m*(n+a))+"V"+(b+(x+1)*(n+a)),"H"+(u+(m+1)*(n+a))+"V"+b,"H"+(u+(y+1)*(n+a))+"Z"].join(""),S.x=u+y*(n+a),S.width=u+(m+1)*(n+a)-S.x,S.height=7*(n+a)):(e=["M"+(u+v*(n+a))+","+(b+(y+1)*(n+a)),"H"+u+"V"+(b+(m+1)*(n+a)),"H"+(u+(x+1)*(n+a))+"V"+(b+m*(n+a)),"H"+(u+7*(n+a))+"V"+(b+y*(n+a)),"H"+(u+v*(n+a))+"Z"].join(""),S.y=b+y*(n+a),S.width=7*(n+a),S.height=b+(m+1)*(n+a)-S.y),{path:e,bbox:S}}),(function(t){var e=t.date,o=t.cellSize,n=t.yearIndex,r=t.yearSpacing,i=t.monthSpacing,d=t.daySpacing,a=t.direction,l=t.originX,s=t.originY;return e.toString()+"."+o+"."+n+"."+r+"."+i+"."+d+"."+a+"."+l+"."+s})),Be=Zt("%Y-%m-%d"),Re=function(t){var e,o=t.width,n=t.height,r=t.from,i=t.to,d=t.direction,a=t.yearSpacing,l=t.monthSpacing,s=t.daySpacing,w=t.align,k=Ht(r)?r:new Date(r),y=Ht(i)?i:new Date(i),m=ze(k.getFullYear(),y.getFullYear()+1),v=Math.max.apply(Math,m.map((function(h){return me(new Date(h,0,1),new Date(h+1,0,1)).length})))+1,x=(function(h){var W,M,O=h.width,I=h.height,P=h.direction,V=h.yearRange,X=h.yearSpacing,Z=h.monthSpacing,Q=h.daySpacing,$=h.maxWeeks;return P==="horizontal"?(W=(O-12*Z-Q*$)/$,M=(I-(V.length-1)*X-V.length*(8*Q))/(7*V.length)):(W=(O-(V.length-1)*X-V.length*(8*Q))/(7*V.length),M=(I-12*Z-Q*$)/$),Math.min(W,M)})({width:o,height:n,direction:d,yearRange:m,yearSpacing:a,monthSpacing:l,daySpacing:s,maxWeeks:v}),u=x*v+s*v+12*l,b=7*(x+s)*m.length+a*(m.length-1),C=d==="horizontal"?u:b,D=d==="horizontal"?b:u,S=Se({width:C,height:D},{width:o,height:n},w),R=S[0],L=S[1];e=d==="horizontal"?(function(h,W,M,O){return function(I,P,V,X){return{x:I+Pt.count(Tt(V),V)*(h+O)+O/2+V.getMonth()*M,y:P+V.getDay()*(h+O)+O/2+X*(W+7*(h+O))}}})(x,a,l,s):(function(h,W,M,O){return function(I,P,V,X){var Z=Pt.count(Tt(V),V);return{x:I+V.getDay()*(h+O)+O/2+X*(W+7*(h+O)),y:P+Z*(h+O)+O/2+V.getMonth()*M}}})(x,a,l,s);var F=[],T=[],q=[];return m.forEach((function(h,W){var M=new Date(h,0,1),O=new Date(h+1,0,1);q=q.concat(ee(M,O).map((function(P){return g({date:P,day:Be(P),size:x},e(R,L,P,W))})));var I=Me(M,O).map((function(P){return g({date:P,year:P.getFullYear(),month:P.getMonth()},Pe({originX:R,originY:L,date:P,direction:d,yearIndex:W,yearSpacing:a,monthSpacing:l,daySpacing:s,cellSize:x}))}));
1T=T.concat(I),F.push({year:h,bbox:{x:I[0].bbox.x,y:I[0].bbox.y,width:I[11].bbox.x-I[0].bbox.x+I[11].bbox.width,height:I[11].bbox.y-I[0].bbox.y+I[11].bbox.height}})})),{years:F,months:T,days:q,cellSize:x,calendarWidth:C,calendarHeight:D,originX:R,originY:L}},Fe=function(t){var e=t.days,o=t.data,n=t.colorScale,r=t.emptyColor;return e.map((function(i){var d=o.find((function(a){return a.day===i.day}));return g({},i,d?{color:n(d.value),data:d,value:d.value}:{color:r})}))},Te=function(t){var e=t.years,o=t.direction,n=t.position,r=t.offset;return e.map((function(i){var d=0,a=0,l=0;return o==="horizontal"&&n==="before"?(d=i.bbox.x-r,a=i.bbox.y+i.bbox.height/2,l=-90):o==="horizontal"&&n==="after"?(d=i.bbox.x+i.bbox.width+r,a=i.bbox.y+i.bbox.height/2,l=-90):o==="vertical"&&n==="before"?(d=i.bbox.x+i.bbox.width/2,a=i.bbox.y-r):(d=i.bbox.x+i.bbox.width/2,a=i.bbox.y+i.bbox.height+r),g({},i,{x:d,y:a,rotation:l})}))},Ye=function(t){var e=t.months,o=t.direction,n=t.position,r=t.offset;return e.map((function(i){var d=0,a=0,l=0;return o==="horizontal"&&n==="before"?(d=i.bbox.x+i.bbox.width/2,a=i.bbox.y-r):o==="horizontal"&&n==="after"?(d=i.bbox.x+i.bbox.width/2,a=i.bbox.y+i.bbox.height+r):o==="vertical"&&n==="before"?(d=i.bbox.x-r,a=i.bbox.y+i.bbox.height/2,l=-90):(d=i.bbox.x+i.bbox.width+r,a=i.bbox.y+i.bbox.height/2,l=-90),g({},i,{x:d,y:a,rotation:l})}))},ae=function(t){var e=t.width,o=t.height,n=t.from,r=t.to,i=t.direction,d=t.yearSpacing,a=t.monthSpacing,l=t.daySpacing,s=t.align;return p.useMemo((function(){return Re({width:e,height:o,from:n,to:r,direction:i,yearSpacing:d,monthSpacing:a,daySpacing:l,align:s})}),[e,o,n,r,i,d,a,l,s])},_t=function(t){var e=t.data,o=t.minValue,n=t.maxValue,r=t.colors,i=t.colorScale;return p.useMemo((function(){if(i)return i;var d=He(e,o,n);return Ce().domain(d).range(r)}),[e,o,n,r,i])},de=function(t){var e=t.years,o=t.direction,n=t.yearLegendPosition,r=t.yearLegendOffset;return p.useMemo((function(){return Te({years:e,direction:o,position:n,offset:r})}),[e,o,n,r])},Kt=function(t){var e=t.months,o=t.direction,n=t.monthLegendPosition,r=t.monthLegendOffset;return p.useMemo((function(){return Ye({months:e,direction:o,position:n,offset:r})}),[e,o,n,r])},le=function(t){var e=t.days,o=t.data,n=t.colorScale,r=t.emptyColor;return p.useMemo((function(){return Fe({days:e,data:o,colorScale:n,emptyColor:r})}),[e,o,n,r])},qe=["months","years"],$e=["isInteractive","renderWrapper","theme"],Ae=function(t){var e=t.margin,o=t.width,n=t.height,r=t.align,i=r===void 0?z.align:r,d=t.colors,a=d===void 0?z.colors:d,l=t.colorScale,s=t.data,w=t.direction,k=w===void 0?z.direction:w,y=t.emptyColor,m=y===void 0?z.emptyColor:y,v=t.from,x=t.to,u=t.minValue,b=u===void 0?z.minValue:u,C=t.maxValue,D=C===void 0?z.maxValue:C,S=t.valueFormat,R=t.legendFormat,L=t.yearLegend,F=L===void 0?z.yearLegend:L,T=t.yearLegendOffset,q=T===void 0?z.yearLegendOffset:T,h=t.yearLegendPosition,W=h===void 0?z.yearLegendPosition:h,M=t.yearSpacing,O=M===void 0?z.yearSpacing:M,I=t.monthBorderColor,P=I===void 0?z.monthBorderColor:I,V=t.monthBorderWidth,X=V===void 0?z.monthBorderWidth:V,Z=t.monthLegend,Q=Z===void 0?z.monthLegend:Z,$=t.monthLegendOffset,Lt=$===void 0?z.monthLegendOffset:$,lt=t.monthLegendPosition,Mt=lt===void 0?z.monthLegendPosition:lt,vt=t.monthSpacing,pt=vt===void 0?z.monthSpacing:vt,xt=t.dayBorderColor,tt=xt===void 0?z.dayBorderColor:xt,bt=t.dayBorderWidth,St=bt===void 0?z.dayBorderWidth:bt,wt=t.daySpacing,it=wt===void 0?z.daySpacing:wt,kt=t.isInteractive,Wt=kt===void 0?z.isInteractive:kt,st=t.tooltip,ct=st===void 0?z.tooltip:st,et=t.onClick,G=t.onMouseEnter,jt=t.onMouseLeave,zt=t.onMouseMove,Y=t.legends,at=Y===void 0?z.legends:Y,ut=t.role,dt=ut===void 0?z.role:ut,U=At(),A=Nt(o,n,e),J=A.margin,ht=A.innerWidth,mt=A.innerHeight,gt=A.outerWidth,Ot=A.outerHeight,ot=ae({width:ht,height:mt,from:v,to:x,direction:k,yearSpacing:O,monthSpacing:pt,daySpacing:it,align:i}),Ct=ot.months,It=ot.years,_=Bt(ot,qe),ft=_t({data:s,minValue:b,maxValue:D,colors:a,colorScale:l}),j=Kt({months:Ct,direction:k,monthLegendPosition:Mt,monthLegendOffset:Lt}),nt=de({years:It,direction:k,yearLegendPosition:W,yearLegendOffset:q}),rt=le({days:_.days,data:s,colorScale:ft,emptyColor:m}),yt=Et(R),Rt=Et(S);return f.jsxs(oe,{width:gt,height:Ot,margin:J,role:dt,children:[rt.map((function(N){return f.jsx(Ve,{data:N,x:N.x,y:N.y,size:N.size,color:N.color,borderWidth:St,borderColor:tt,onMouseEnter:G,onMouseLeave:jt,onMouseMove:zt,isInteractive:Wt,tooltip:ct,onClick:et,formatValue:Rt},N.date.toString())})),Ct.map((function(N){return f.jsx(Ie,{path:N.path,borderWidth:X,borderColor:P},N.date.toString())})),f.jsx(re,{months:j,legend:Q,theme:U}),f.jsx(Oe,{years:nt,legend:F,theme:U}),at.map((function(N,Ft){var Vt=ft.ticks(N.itemCount).map((function(Dt){return{id:Dt,label:yt(Dt),color:ft(Dt)}}));return f.jsx(ne,g({},N,{containerWidth:o,containerHeight:n,data:Vt}),Ft)}))]})},Ne=function(t){var e=t.isInteractive,o=e===void 0?z.isInteractive:e,n=t.renderWrapper,r=t.theme,i=Bt(t,$e);return f.jsx(qt,{isInteractive:o,renderWrapper:n,theme:r,children:f.jsx(Ae,g({isInteractive:o},i))})},Xe=Zt("%Y-%m-%d"),Ze=function(t){var e,o,n=t.direction,r=t.daySpacing,i=t.offset,d=t.square,a=t.totalDays,l=t.width,s=t.height;n==="horizontal"?(l-=i,e=7,o=Math.ceil(a/7)):(s-=i,o=7,e=Math.ceil(a/7));var w=(s-r*(e+1))/e,k=(l-r*(o+1))/o,y=Math.min(w,k);return{columns:o,rows:e,cellHeight:d?y:w,cellWidth:d?y:k}}
1,se=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function Qt(t){return se.findIndex((function(e){return e.toLowerCase()===t}))}var Jt=function(t,e){var o=t.getDay()-Qt(e);return[0,1,2,3,4,5,6].slice(o)[0]};function _e(t){var e=t.startDate,o=t.date,n=t.direction,r=t.firstWeekday,i=(function(k){return[Pt,fe,ye,ve,pe,xe,be][Qt(k)]})(r),d=i.count(e,o),a=o.getMonth(),l=o.getFullYear(),s=0,w=0;return n==="horizontal"?(s=d,w=Jt(o,r)):(s=Jt(o,r),w=d),{currentColumn:s,year:l,currentRow:w,firstWeek:d,month:a,date:o}}var Ke=function(t){var e=t.direction,o=t.colorScale,n=t.emptyColor,r=t.from,i=t.to,d=t.data,a=t.cellWidth,l=t.cellHeight,s=t.daySpacing,w=t.offset,k=t.firstWeekday,y=s,m=s;e==="horizontal"?y+=w:m+=w;var v=r||d[0].date,x=i||d[d.length-1].date,u=Ht(v)?v:new Date(v),b=Ht(x)?x:new Date(x);return ee(u,b).map((function(C){return{date:C,day:Xe(C)}})).map((function(C){var D=d.find((function(M){return M.day===C.day})),S=_e({startDate:u,date:C.date,direction:e,firstWeekday:k}),R=S.currentColumn,L=S.currentRow,F=S.firstWeek,T=S.year,q=S.month,h=S.date,W={x:y+s*R+a*R,y:m+s*L+l*L};return D?g({},D,{coordinates:W,firstWeek:F,month:q,year:T,date:h,color:o(D.value),width:a,height:l}):g({},C,{coordinates:W,firstWeek:F,month:q,year:T,date:h,color:n,width:a,height:l})}))},Qe=function(t){var e,o,n=t.cellHeight,r=t.cellWidth,i=t.direction,d=t.daySpacing,a=t.ticks,l=a===void 0?[1,3,5]:a,s=t.firstWeekday,w=t.arrayOfWeekdays,k=w===void 0?(e=se,o=Qt(s),e.length&&o?(o%=e.length,e.slice(o,e.length).concat(e.slice(0,o))):e):w,y=r+d,m=n+d;return l.map((function(v){return{value:k[v],rotation:i==="horizontal"?0:-90,y:i==="horizontal"?m*(v+1)-m/3:0,x:i==="horizontal"?0:y*(v+1)-y/3}}))},Ge=function(t){var e=t.direction,o=t.daySpacing,n=t.days,r=t.cellHeight,i=t.cellWidth;return n.reduce((function(d,a){if(d.weeks.length===a.firstWeek||!d.weeks.length&&a.firstWeek===1){d.weeks.push(a);var l=a.year+"-"+a.month;if(Object.keys(d.months).includes(l))e==="horizontal"?d.months[l].bbox.width=(a.firstWeek-d.months[l].firstWeek)*(i+o):d.months[l].bbox.height=(a.firstWeek-d.months[l].firstWeek)*(r+o);else{var s={x:0,y:0,width:0,height:0};e==="horizontal"?(s.x=a.coordinates.x-o,s.height=r+o,s.width=i+2*o):(s.y=a.coordinates.y-o,s.height=r+2*o,s.width=i+2*o),d.months[l]={date:a.date,bbox:s,firstWeek:a.firstWeek,month:0,year:0}}}return d}),{months:{},weeks:[]})},Ue=function(t){var e,o,n=t.from,r=t.to,i=t.data;return e=n?Ht(n)?n:new Date(n):i[0].date,o=n&&r?Ht(r)?r:new Date(r):i[i.length-1].date,e.getDay()+ge.count(e,o)},Je=p.memo((function(t){var e=t.data,o=t.x,n=t.ry,r=n===void 0?5:n,i=t.rx,d=i===void 0?5:i,a=t.y,l=t.width,s=t.height,w=t.color,k=t.borderWidth,y=t.borderColor,m=t.isInteractive,v=t.tooltip,x=t.onMouseEnter,u=t.onMouseMove,b=t.onMouseLeave,C=t.onClick,D=t.formatValue,S=Xt(),R=S.showTooltipFromEvent,L=S.hideTooltip,F=p.useCallback((function(W){if("value"in e){var M=g({},e,{value:D(e.value)});R(p.createElement(v,g({},M)),W),x?.(e,W)}}),[R,v,e,x,D]),T=p.useCallback((function(W){if("value"in e){var M=g({},e,{value:D(e.value)});R(p.createElement(v,g({},M)),W),u?.(e,W)}}),[R,v,e,u,D]),q=p.useCallback((function(W){"value"in e&&(L(),b?.(e,W))}),[L,e,b]),h=p.useCallback((function(W){return C?.(e,W)}),[e,C]);return f.jsx("rect",{x:o,y:a,rx:d,ry:r,width:l,height:s,style:{fill:w,strokeWidth:k,stroke:y},onMouseEnter:m?F:void 0,onMouseMove:m?T:void 0,onMouseLeave:m?q:void 0,onClick:m?h:void 0})})),to=["isInteractive","renderWrapper","theme"],eo=function(t){var e=t.margin,o=t.width,n=t.height,r=t.square,i=r===void 0?B.square:r,d=t.colors,a=d===void 0?B.colors:d,l=t.colorScale,s=t.emptyColor,w=s===void 0?B.emptyColor:s,k=t.from,y=t.to,m=t.data,v=t.direction,x=v===void 0?B.direction:v,u=t.minValue,b=u===void 0?B.minValue:u,C=t.maxValue,D=C===void 0?B.maxValue:C,S=t.valueFormat,R=t.legendFormat,L=t.monthLegend,F=L===void 0?B.monthLegend:L,T=t.monthLegendOffset,q=T===void 0?B.monthLegendOffset:T,h=t.monthLegendPosition,W=h===void 0?B.monthLegendPosition:h,M=t.weekdayLegendOffset,O=M===void 0?B.weekdayLegendOffset:M,I=t.weekdayTicks,P=t.dayBorderColor,V=P===void 0?B.dayBorderColor:P,X=t.dayBorderWidth,Z=X===void 0?B.dayBorderWidth:X,Q=t.daySpacing,$=Q===void 0?B.daySpacing:Q,Lt=t.dayRadius,lt=Lt===void 0?B.dayRadius:Lt,Mt=t.isInteractive,vt=Mt===void 0?B.isInteractive:Mt,pt=t.tooltip,xt=pt===void 0?B.tooltip:pt,tt=t.onClick,bt=t.onMouseEnter,St=t.onMouseLeave,wt=t.onMouseMove,it=t.legends,kt=it===void 0?B.legends:it,Wt=t.role,st=Wt===void 0?B.role:Wt,ct=t.firstWeekday,et=ct===void 0?B.firstWeekday:ct,G=Nt(o,n,e),jt=G.margin,zt=G.innerWidth,Y=G.innerHe
1ight,at=G.outerWidth,ut=G.outerHeight,dt=p.useMemo((function(){return m.map((function(j){return g({},j,{date:new Date(j.day+"T00:00:00")})})).sort((function(j,nt){return j.day.localeCompare(nt.day)}))}),[m]),U=At(),A=_t({data:dt,minValue:b,maxValue:D,colors:a,colorScale:l}),J=Ue({from:k,to:y,data:dt}),ht=Ze({square:i,offset:O,totalDays:J,width:zt,height:Y,daySpacing:$,direction:x}),mt=ht.cellHeight,gt=ht.cellWidth,Ot=Ke({offset:O,colorScale:A,emptyColor:w,cellHeight:mt,cellWidth:gt,from:k,to:y,data:dt,direction:x,daySpacing:$,firstWeekday:et}),ot=Object.values(Ge({daySpacing:$,direction:x,cellHeight:mt,cellWidth:gt,days:Ot}).months),Ct=Qe({direction:x,cellHeight:mt,cellWidth:gt,daySpacing:$,ticks:I,firstWeekday:et}),It=Kt({months:ot,direction:x,monthLegendPosition:W,monthLegendOffset:q}),_=Et(S),ft=Et(R);return f.jsxs(oe,{width:at,height:ut,margin:jt,role:st,children:[Ct.map((function(j){return f.jsx("text",{transform:"translate("+j.x+","+j.y+") rotate("+j.rotation+")",textAnchor:"left",style:U.labels.text,children:j.value},j.value)})),Ot.map((function(j){return f.jsx(Je,{data:j,x:j.coordinates.x,rx:lt,y:j.coordinates.y,ry:lt,width:gt,height:mt,color:j.color,borderWidth:Z,borderColor:V,onMouseEnter:bt,onMouseLeave:St,onMouseMove:wt,isInteractive:vt,tooltip:xt,onClick:tt,formatValue:_},j.date.toString())})),f.jsx(re,{months:It,legend:F,theme:U}),kt.map((function(j,nt){var rt=A.ticks(j.itemCount).map((function(yt){return{id:yt,label:ft(yt),color:A(yt)}}));return f.jsx(ne,g({},j,{containerWidth:o,containerHeight:n,data:rt}),nt)}))]})},oo=function(t){var e=t.isInteractive,o=e===void 0?B.isInteractive:e,n=t.renderWrapper,r=t.theme,i=Bt(t,to);return f.jsx(qt,{isInteractive:o,renderWrapper:n,theme:r,children:f.jsx(eo,g({isInteractive:o},i))})},Lo=function(t){return f.jsx($t,{children:function(e){var o=e.width,n=e.height;return f.jsx(oo,g({width:o,height:n},t))}})},Mo=function(t){return f.jsx($t,{children:function(e){var o=e.width,n=e.height;return f.jsx(Ne,g({width:o,height:n},t))}})},no=["months","years"],ro=["isInteractive","renderWrapper","theme"],te=function(t,e,o,n,r,i){var d=we(e,t),a=d[0],l=d[1];return o.find((function(s){return"value"in s&&ke(s.x+i.left-r/2,s.y+i.top-r/2,n+r,n+r,a,l)}))},io=p.memo((function(t){var e=t.margin,o=t.width,n=t.height,r=t.pixelRatio,i=r===void 0?H.pixelRatio:r,d=t.align,a=d===void 0?H.align:d,l=t.colors,s=l===void 0?H.colors:l,w=t.colorScale,k=t.data,y=t.direction,m=y===void 0?H.direction:y,v=t.emptyColor,x=v===void 0?H.emptyColor:v,u=t.from,b=t.to,C=t.minValue,D=C===void 0?H.minValue:C,S=t.maxValue,R=S===void 0?H.maxValue:S,L=t.valueFormat,F=t.legendFormat,T=t.yearLegend,q=T===void 0?H.yearLegend:T,h=t.yearLegendOffset,W=h===void 0?H.yearLegendOffset:h,M=t.yearLegendPosition,O=M===void 0?H.yearLegendPosition:M,I=t.yearSpacing,P=I===void 0?H.yearSpacing:I,V=t.monthLegend,X=V===void 0?H.monthLegend:V,Z=t.monthLegendOffset,Q=Z===void 0?H.monthLegendOffset:Z,$=t.monthLegendPosition,Lt=$===void 0?H.monthLegendPosition:$,lt=t.monthSpacing,Mt=lt
1===void 0?H.monthSpacing:lt,vt=t.dayBorderColor,pt=vt===void 0?H.dayBorderColor:vt,xt=t.dayBorderWidth,tt=xt===void 0?H.dayBorderWidth:xt,bt=t.daySpacing,St=bt===void 0?H.daySpacing:bt,wt=t.isInteractive,it=wt===void 0?H.isInteractive:wt,kt=t.tooltip,Wt=kt===void 0?H.tooltip:kt,st=t.onClick,ct=t.onMouseEnter,et=t.onMouseLeave,G=t.onMouseMove,jt=t.legends,zt=jt===void 0?H.legends:jt,Y=p.useRef(null),at=Nt(o,n,e),ut=at.innerWidth,dt=at.innerHeight,U=at.outerWidth,A=at.outerHeight,J=at.margin,ht=ae({width:ut,height:dt,from:u,to:b,direction:m,yearSpacing:P,monthSpacing:Mt,daySpacing:St,align:a}),mt=ht.months,gt=ht.years,Ot=Bt(ht,no),ot=_t({data:k,minValue:D,maxValue:R,colors:s,colorScale:w}),Ct=Kt({months:mt,direction:m,monthLegendPosition:Lt,monthLegendOffset:Q}),It=de({years:gt,direction:m,yearLegendPosition:O,yearLegendOffset:W}),_=le({days:Ot.days,data:k,colorScale:ot,emptyColor:x}),ft=p.useState(null),j=ft[0],nt=ft[1],rt=At(),yt=Et(L),Rt=Et(F),N=Xt(),Ft=N.showTooltipFromEvent,Vt=N.hideTooltip;p.useEffect((function(){var K;if(Y.current){Y.current.width=U*i,Y.current.height=A*i;var c=Y.current.getContext("2d");c&&(c.scale(i,i),c.fillStyle=rt.background,c.fillRect(0,0,U,A),c.translate(J.left,J.top),_.forEach((function(E){c.fillStyle=E.color,tt>0&&(c.strokeStyle=pt,c.lineWidth=tt),c.beginPath(),c.rect(E.x,E.y,E.size,E.size),c.fill(),tt>0&&c.stroke()})),c.textAlign="center",c.textBaseline="middle",c.fillStyle=(K=rt.labels.text.fill)!=null?K:"",c.font=rt.labels.text.fontSize+"px "+rt.labels.text.fontFamily,Ct.forEach((function(E){c.save(),c.translate(E.x,E.y),c.rotate(Gt(E.rotation)),c.fillText(String(X(E.year,E.month,E.date)),0,0),c.restore()})),It.forEach((function(E){c.save(),c.translate(E.x,E.y),c.rotate(Gt(E.rotation)),c.fillText(String(q(E.year)),0,0),c.restore()})),zt.forEach((function(E){var he=ot.ticks(E.itemCount).map((function(Yt){return{id:Yt,label:Rt(Yt),color:ot(Yt)}}));Le(c,g({},E,{data:he,containerWidth:ut,containerHeight:dt,theme:rt}))})))}}),[Y,dt,ut,U,A,i,J,_,pt,tt,w,q,It,X,Ct,zt,rt,Rt,ot]);var Dt=p.useCallback((function(K){if(Y.current){var c=te(K,Y.current,_,_[0].size,tt,J);if(c){if(nt(c),!("value"in c))return;var E=g({},c,{value:yt(c.value),data:g({},c.data)});Ft(p.createElement(Wt,g({},E)),K),!j&&ct?.(c,K),G?.(c,K),j&&et?.(c,K)}else Vt(),c&&et?.(c,K)}}),[Y,j,J,_,nt,yt,tt,Ft,Vt,ct,G,et,Wt]),ce=p.useCallback((function(){nt(null),Vt()}),[nt,Vt]),ue=p.useCallback((function(K){if(st&&Y.current){var c=te(K,Y.current,_,_[0].size,St,J);c&&st(c,K)}}),[Y,St,J,_,st]);return f.jsx("canvas",{ref:Y,width:U*i,height:A*i,style:{width:U,height:A},onMouseEnter:it?Dt:void 0,onMouseMove:it?Dt:void 0,onMouseLeave:it?ce:void 0,onClick:it?ue:void 0})})),ao=function(t){var e=t.isInteractive,o=e===void 0?H.isInteractive:e,n=t.renderWrapper,r=t.theme,i=Bt(t,ro);return f.jsx(qt,{isInteractive:o,renderWrapper:n,theme:r,children:f.jsx(io,g({isInteractive:o},i))})},jo=function(t){return f.jsx($t,{children:function(e){var o=e.width,n=e.height;return f.jsx(ao,g({width:o,height:n},t))}})};export{se as ARRAY_OF_WEEKDAYS,Ne as Calendar,ao as CalendarCanvas,Mo as ResponsiveCalendar,jo as ResponsiveCalendarCanvas,Lo as ResponsiveTimeRange,oo as TimeRange,Fe as bindDaysData,H as calendarCanvasDefaultProps,z as calendarDefaultProps,Ke as computeCellPositions,Ze as computeCellSize,He as computeDomain,Re as computeLayout,Ye as computeMonthLegendPositions,Ge as computeMonthLegends,Ue as computeTotalDays,Qe as computeWeekdays,Te as computeYearLegendPositions,Jt as getDayIndex,Qt as getFirstWeekdayIndex,B as timeRangeDefaultProps,ae as useCalendarLayout,_t as useColorScale,le as useDays,Kt as useMonthLegends,de as useYearLegends};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.