import{j as w}from"./chunk-AFBR3FKX.js";w();(function(p){var H={xaxis:{timezone:null,timeformat:null,twelveHourClock:!1,monthNames:null}};function S(i,s){return s*Math.floor(i/s)}function v(i,s,m,h){if(p.isFunction(i.strftime))return i.strftime(s);var t=function(o,c){return o=""+o,c=""+(c??"0"),o.length===1?c+o:o},f=[],u=!1,e=i.getHours(),k=e<12,r,a;m==null&&(m=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),h==null&&(h=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]),e>12?a=e-12:e===0?a=12:a=e;for(var l=0;l<s.length;++l)if(r=s.charAt(l),u){switch(r){case"a":r=""+h[i.getDay()];break;case"b":r=""+m[i.getMonth()];break;case"d":r=t(i.getDate());break;case"e":r=t(i.getDate()," ");break;case"h":case"H":r=t(e);break;case"I":r=t(a);break;case"l":r=t(a," ");break;case"m":r=t(i.getMonth()+1);break;case"M":r=t(i.getMinutes());break;case"q":r=""+(Math.floor(i.getMonth()/3)+1);break;case"S":r=t(i.getSeconds());break;case"y":r=t(i.getFullYear()%100);break;case"Y":r=""+i.getFullYear();break;case"p":r=k?"am":"pm";break;case"P":r=k?"AM":"PM";break;case"w":r=""+i.getDay();break}f.push(r),u=!1}else r==="%"?u=!0:f.push(r);return f.join("")}function b(i){function s(f,u,e,k){f[u]=function(){return e[k].apply(e,arguments)}}var m={date:i};i.strftime!==void 0&&s(m,"strftime",i,"strftime"),s(m,"getTime",i,"getTime"),s(m,"setTime",i,"setTime");for(var h=["Date","Day","FullYear","Hours","Milliseconds","Minutes","Month","Seconds"],t=0;t<h.length;t++)s(m,"get"+h[t],i,"getUTC"+h[t]),s(m,"set"+h[t],i,"setUTC"+h[t]);return m}function T(i,s){if(s.timezone==="browser")return new Date(i);if(!s.timezone||s.timezone==="utc")return b(new Date(i));if(typeof timezoneJS<"u"&&typeof timezoneJS.Date<"u"){var m=new timezoneJS.Date;return m.setTimezone(s.timezone),m.setTime(i),m}else return b(new Date(i))}var n={second:1e3,minute:60*1e3,hour:60*60*1e3,day:24*60*60*1e3,month:30*24*60*60*1e3,quarter:3*30*24*60*60*1e3,year:365.2425*24*60*60*1e3},d=[[1,"second"],[2,"second"],[5,"second"],[10,"second"],[30,"second"],[1,"minute"],[2,"minute"],[5,"minute"],[10,"minute"],[30,"minute"],[1,"hour"],[2,"hour"],[4,"hour"],[8,"hour"],[12,"hour"],[1,"day"],[2,"day"],[3,"day"],[.25,"month"],[.5,"month"],[1,"month"],[2,"month"]],F=d.concat([[3,"month"],[6,"month"],[1,"year"]]),Y=d.concat([[1,"quarter"],[2,"quarter"],[1,"year"]]);function N(i){i.hooks.processOptions.push(function(s){p.each(s.getAxes(),function(m,h){var t=h.options;t.mode==="time"&&(h.tickGenerator=function(f){var u=[],e=T(f.min,t),k=0,r=t.tickSize&&t.tickSize[1]==="quarter"||t.minTickSize&&t.minTickSize[1]==="quarter"?Y:F;t.minTickSize!=null&&(typeof t.tickSize=="number"?k=t.tickSize:k=t.minTickSize[0]*n[t.minTickSize[1]]);for(var a=0;a<r.length-1&&!(f.delta<(r[a][0]*n[r[a][1]]+r[a+1][0]*n[r[a+1][1]])/2&&r[a][0]*n[r[a][1]]>=k);++a);var l=r[a][0],o=r[a][1];if(o==="year"){if(t.minTickSize!=null&&t.minTickSize[1]==="year")l=Math.floor(t.minTickSize[0]);else{var c=Math.pow(10,Math.floor(Math.log(f.delta/n.year)/Math.LN10)),y=f.delta/n.year/c;y<1.5?l=1:y<3?l=2:y<7.5?l=5:l=10,l*=c}l<1&&(l=1)}f.tickSize=t.tickSize||[l,o];var M=f.tickSize[0];o=f.tickSize[1];var g=M*n[o];o==="second"?e.setSeconds(S(e.getSeconds(),M)):o==="minute"?e.setMinutes(S(e.getMinutes(),M)):o==="hour"?e.setHours(S(e.getHours(),M)):o==="month"?e.setMonth(S(e.getMonth(),M)):o==="quarter"?e.setMonth(3*S(e.getMonth()/3,M)):o==="year"&&e.setFullYear(S(e.getFullYear(),M)),e.setMilliseconds(0),g>=n.minute&&e.setSeconds(0),g>=n.hour&&e.setMinutes(0),g>=n.day&&e.setHours(0),g>=n.day*4&&e.setDate(1),g>=n.month*2&&e.setMonth(S(e.getMonth(),3)),g>=n.quarter*2&&e.setMonth(S(e.getMonth(),6)),g>=n.year&&e.setMonth(0);var q=0,z=Number.NaN,D;do if(D=z,z=e.getTime(),u.push(z),o==="month"||o==="quarter")if(M<1){e.setDate(1);var A=e.getTime();e.setMonth(e.getMonth()+(o==="quarter"?3:1));var C=e.getTime();e.setTime(z+q*n.hour+(C-A)*M),q=e.getHours(),e.setHours(0)}else e.setMonth(e.getMonth()+M*(o==="quarter"?3:1));else o==="year"?e.setFullYear(e.getFullYear()+M):e.setTime(z+g);while(z<f.max&&z!==D);return u},h.tickFormatter=function(f,u){var e=T(f,u.options);if(t.timeformat!=null)return v(e,t.timeformat,t.monthNames,t.dayNames);var k=u.options.tickSize&&u.options.tickSize[1]==="quarter"||u.options.minTickSize&&u.options.minTickSize[1]==="quarter",r=u.tickSize[0]*n[u.tickSize[1]],a=u.max-u.min,l=t.twelveHourClock?" %p":"",o=t.twelveHourClock?"%I":"%H",c;r<n.minute?c=o+":%M:%S"+l:r<n.day?a<2*n.day?c=o+":%M"+l:c="%b %d "+o+":%M"+l:r<n.month?c="%b %d":k&&r<n.quarter||!k&&r<n.year?a<n.year?c="%b":c="%b %Y":k&&r<n.year?a<n.year?c="Q%q":c="Q%q %Y":c="%Y";var y=v(e,c,t.monthNames,t.dayNames);return y})})})}p.plot.plugins.push({init:N,options:H,name:"time",version:"1.0"}),p.plot.formatDate=v})(jQuery);
