mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-21 07:56:26 +01:00
2 lines
466 KiB
JavaScript
2 lines
466 KiB
JavaScript
/*! For license information please see main.4b213512.js.LICENSE.txt */
|
|
(()=>{var e={61:(e,t,n)=>{"use strict";var r=n(375),a=n(629),o=a(r("String.prototype.indexOf"));e.exports=function(e,t){var n=r(e,!!t);return"function"===typeof n&&o(e,".prototype.")>-1?a(n):n}},629:(e,t,n)=>{"use strict";var r=n(989),a=n(375),o=n(259),i=n(277),l=a("%Function.prototype.apply%"),s=a("%Function.prototype.call%"),c=a("%Reflect.apply%",!0)||r.call(s,l),u=n(709),d=a("%Math.max%");e.exports=function(e){if("function"!==typeof e)throw new i("a function is required");var t=c(r,s,arguments);return o(t,1+d(0,e.length-(arguments.length-1)),!0)};var h=function(){return c(r,l,arguments)};u?u(e.exports,"apply",{value:h}):e.exports.apply=h},159:function(e){e.exports=function(){"use strict";var e=1e3,t=6e4,n=36e5,r="millisecond",a="second",o="minute",i="hour",l="day",s="week",c="month",u="quarter",d="year",h="date",m="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},g=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},y={s:g,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),a=n%60;return(t<=0?"+":"-")+g(r,2,"0")+":"+g(a,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),a=t.clone().add(r,c),o=n-a<0,i=t.clone().add(r+(o?-1:1),c);return+(-(r+(n-a)/(o?a-i:i-a))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:c,y:d,w:s,d:l,D:h,h:i,m:o,s:a,ms:r,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},_="en",b={};b[_]=v;var w="$isDayjsObject",k=function(e){return e instanceof E||!(!e||!e[w])},x=function e(t,n,r){var a;if(!t)return _;if("string"==typeof t){var o=t.toLowerCase();b[o]&&(a=o),n&&(b[o]=n,a=o);var i=t.split("-");if(!a&&i.length>1)return e(i[0])}else{var l=t.name;b[l]=t,a=l}return!r&&a&&(_=a),a||!r&&_},S=function(e,t){if(k(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new E(n)},C=y;C.l=x,C.i=k,C.w=function(e,t){return S(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function v(e){this.$L=x(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[w]=!0}var g=v.prototype;return g.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(C.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(p);if(r){var a=r[2]-1||0,o=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],a,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)):new Date(r[1],a,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)}}return new Date(t)}(e),this.init()},g.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},g.$utils=function(){return C},g.isValid=function(){return!(this.$d.toString()===m)},g.isSame=function(e,t){var n=S(e);return this.startOf(t)<=n&&n<=this.endOf(t)},g.isAfter=function(e,t){return S(e)<this.startOf(t)},g.isBefore=function(e,t){return this.endOf(t)<S(e)},g.$g=function(e,t,n){return C.u(e)?this[t]:this.set(n,e)},g.unix=function(){return Math.floor(this.valueOf()/1e3)},g.valueOf=function(){return this.$d.getTime()},g.startOf=function(e,t){var n=this,r=!!C.u(t)||t,u=C.p(e),m=function(e,t){var a=C.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?a:a.endOf(l)},p=function(e,t){return C.w(n.toDate()[e].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},f=this.$W,v=this.$M,g=this.$D,y="set"+(this.$u?"UTC":"");switch(u){case d:return r?m(1,0):m(31,11);case c:return r?m(1,v):m(0,v+1);case s:var _=this.$locale().weekStart||0,b=(f<_?f+7:f)-_;return m(r?g-b:g+(6-b),v);case l:case h:return p(y+"Hours",0);case i:return p(y+"Minutes",1);case o:return p(y+"Seconds",2);case a:return p(y+"Milliseconds",3);default:return this.clone()}},g.endOf=function(e){return this.startOf(e,!1)},g.$set=function(e,t){var n,s=C.p(e),u="set"+(this.$u?"UTC":""),m=(n={},n[l]=u+"Date",n[h]=u+"Date",n[c]=u+"Month",n[d]=u+"FullYear",n[i]=u+"Hours",n[o]=u+"Minutes",n[a]=u+"Seconds",n[r]=u+"Milliseconds",n)[s],p=s===l?this.$D+(t-this.$W):t;if(s===c||s===d){var f=this.clone().set(h,1);f.$d[m](p),f.init(),this.$d=f.set(h,Math.min(this.$D,f.daysInMonth())).$d}else m&&this.$d[m](p);return this.init(),this},g.set=function(e,t){return this.clone().$set(e,t)},g.get=function(e){return this[C.p(e)]()},g.add=function(r,u){var h,m=this;r=Number(r);var p=C.p(u),f=function(e){var t=S(m);return C.w(t.date(t.date()+Math.round(e*r)),m)};if(p===c)return this.set(c,this.$M+r);if(p===d)return this.set(d,this.$y+r);if(p===l)return f(1);if(p===s)return f(7);var v=(h={},h[o]=t,h[i]=n,h[a]=e,h)[p]||1,g=this.$d.getTime()+r*v;return C.w(g,this)},g.subtract=function(e,t){return this.add(-1*e,t)},g.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||m;var r=e||"YYYY-MM-DDTHH:mm:ssZ",a=C.z(this),o=this.$H,i=this.$m,l=this.$M,s=n.weekdays,c=n.months,u=n.meridiem,d=function(e,n,a,o){return e&&(e[n]||e(t,r))||a[n].slice(0,o)},h=function(e){return C.s(o%12||12,e,"0")},p=u||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(f,(function(e,r){return r||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return C.s(t.$y,4,"0");case"M":return l+1;case"MM":return C.s(l+1,2,"0");case"MMM":return d(n.monthsShort,l,c,3);case"MMMM":return d(c,l);case"D":return t.$D;case"DD":return C.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return d(n.weekdaysMin,t.$W,s,2);case"ddd":return d(n.weekdaysShort,t.$W,s,3);case"dddd":return s[t.$W];case"H":return String(o);case"HH":return C.s(o,2,"0");case"h":return h(1);case"hh":return h(2);case"a":return p(o,i,!0);case"A":return p(o,i,!1);case"m":return String(i);case"mm":return C.s(i,2,"0");case"s":return String(t.$s);case"ss":return C.s(t.$s,2,"0");case"SSS":return C.s(t.$ms,3,"0");case"Z":return a}return null}(e)||a.replace(":","")}))},g.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},g.diff=function(r,h,m){var p,f=this,v=C.p(h),g=S(r),y=(g.utcOffset()-this.utcOffset())*t,_=this-g,b=function(){return C.m(f,g)};switch(v){case d:p=b()/12;break;case c:p=b();break;case u:p=b()/3;break;case s:p=(_-y)/6048e5;break;case l:p=(_-y)/864e5;break;case i:p=_/n;break;case o:p=_/t;break;case a:p=_/e;break;default:p=_}return m?p:C.a(p)},g.daysInMonth=function(){return this.endOf(c).$D},g.$locale=function(){return b[this.$L]},g.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=x(e,t,!0);return r&&(n.$L=r),n},g.clone=function(){return C.w(this.$d,this)},g.toDate=function(){return new Date(this.valueOf())},g.toJSON=function(){return this.isValid()?this.toISOString():null},g.toISOString=function(){return this.$d.toISOString()},g.toString=function(){return this.$d.toUTCString()},v}(),N=E.prototype;return S.prototype=N,[["$ms",r],["$s",a],["$m",o],["$H",i],["$W",l],["$M",c],["$y",d],["$D",h]].forEach((function(e){N[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),S.extend=function(e,t){return e.$i||(e(t,E,S),e.$i=!0),S},S.locale=x,S.isDayjs=k,S.unix=function(e){return S(1e3*e)},S.en=b[_],S.Ls=b,S.p={},S}()},648:function(e){e.exports=function(){"use strict";var e,t,n=1e3,r=6e4,a=36e5,o=864e5,i=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,l=31536e6,s=2628e6,c=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,u={years:l,months:s,days:o,hours:a,minutes:r,seconds:n,milliseconds:1,weeks:6048e5},d=function(e){return e instanceof y},h=function(e,t,n){return new y(e,n,t.$l)},m=function(e){return t.p(e)+"s"},p=function(e){return e<0},f=function(e){return p(e)?Math.ceil(e):Math.floor(e)},v=function(e){return Math.abs(e)},g=function(e,t){return e?p(e)?{negative:!0,format:""+v(e)+t}:{negative:!1,format:""+e+t}:{negative:!1,format:""}},y=function(){function p(e,t,n){var r=this;if(this.$d={},this.$l=n,void 0===e&&(this.$ms=0,this.parseFromMilliseconds()),t)return h(e*u[m(t)],this);if("number"==typeof e)return this.$ms=e,this.parseFromMilliseconds(),this;if("object"==typeof e)return Object.keys(e).forEach((function(t){r.$d[m(t)]=e[t]})),this.calMilliseconds(),this;if("string"==typeof e){var a=e.match(c);if(a){var o=a.slice(2).map((function(e){return null!=e?Number(e):0}));return this.$d.years=o[0],this.$d.months=o[1],this.$d.weeks=o[2],this.$d.days=o[3],this.$d.hours=o[4],this.$d.minutes=o[5],this.$d.seconds=o[6],this.calMilliseconds(),this}}return this}var v=p.prototype;return v.calMilliseconds=function(){var e=this;this.$ms=Object.keys(this.$d).reduce((function(t,n){return t+(e.$d[n]||0)*u[n]}),0)},v.parseFromMilliseconds=function(){var e=this.$ms;this.$d.years=f(e/l),e%=l,this.$d.months=f(e/s),e%=s,this.$d.days=f(e/o),e%=o,this.$d.hours=f(e/a),e%=a,this.$d.minutes=f(e/r),e%=r,this.$d.seconds=f(e/n),e%=n,this.$d.milliseconds=e},v.toISOString=function(){var e=g(this.$d.years,"Y"),t=g(this.$d.months,"M"),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var r=g(n,"D"),a=g(this.$d.hours,"H"),o=g(this.$d.minutes,"M"),i=this.$d.seconds||0;this.$d.milliseconds&&(i+=this.$d.milliseconds/1e3,i=Math.round(1e3*i)/1e3);var l=g(i,"S"),s=e.negative||t.negative||r.negative||a.negative||o.negative||l.negative,c=a.format||o.format||l.format?"T":"",u=(s?"-":"")+"P"+e.format+t.format+r.format+c+a.format+o.format+l.format;return"P"===u||"-P"===u?"P0D":u},v.toJSON=function(){return this.toISOString()},v.format=function(e){var n=e||"YYYY-MM-DDTHH:mm:ss",r={Y:this.$d.years,YY:t.s(this.$d.years,2,"0"),YYYY:t.s(this.$d.years,4,"0"),M:this.$d.months,MM:t.s(this.$d.months,2,"0"),D:this.$d.days,DD:t.s(this.$d.days,2,"0"),H:this.$d.hours,HH:t.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,"0"),SSS:t.s(this.$d.milliseconds,3,"0")};return n.replace(i,(function(e,t){return t||String(r[e])}))},v.as=function(e){return this.$ms/u[m(e)]},v.get=function(e){var t=this.$ms,n=m(e);return"milliseconds"===n?t%=1e3:t="weeks"===n?f(t/u[n]):this.$d[n],t||0},v.add=function(e,t,n){var r;return r=t?e*u[m(t)]:d(e)?e.$ms:h(e,this).$ms,h(this.$ms+r*(n?-1:1),this)},v.subtract=function(e,t){return this.add(e,t,!0)},v.locale=function(e){var t=this.clone();return t.$l=e,t},v.clone=function(){return h(this.$ms,this)},v.humanize=function(t){return e().add(this.$ms,"ms").locale(this.$l).fromNow(!t)},v.valueOf=function(){return this.asMilliseconds()},v.milliseconds=function(){return this.get("milliseconds")},v.asMilliseconds=function(){return this.as("milliseconds")},v.seconds=function(){return this.get("seconds")},v.asSeconds=function(){return this.as("seconds")},v.minutes=function(){return this.get("minutes")},v.asMinutes=function(){return this.as("minutes")},v.hours=function(){return this.get("hours")},v.asHours=function(){return this.as("hours")},v.days=function(){return this.get("days")},v.asDays=function(){return this.as("days")},v.weeks=function(){return this.get("weeks")},v.asWeeks=function(){return this.as("weeks")},v.months=function(){return this.get("months")},v.asMonths=function(){return this.as("months")},v.years=function(){return this.get("years")},v.asYears=function(){return this.as("years")},p}(),_=function(e,t,n){return e.add(t.years()*n,"y").add(t.months()*n,"M").add(t.days()*n,"d").add(t.hours()*n,"h").add(t.minutes()*n,"m").add(t.seconds()*n,"s").add(t.milliseconds()*n,"ms")};return function(n,r,a){e=a,t=a().$utils(),a.duration=function(e,t){var n=a.locale();return h(e,{$l:n},t)},a.isDuration=d;var o=r.prototype.add,i=r.prototype.subtract;r.prototype.add=function(e,t){return d(e)?_(this,e,1):o.bind(this)(e,t)},r.prototype.subtract=function(e,t){return d(e)?_(this,e,-1):i.bind(this)(e,t)}}}()},7:function(e){e.exports=function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(n,r,a){var o,i=function(e,n,r){void 0===r&&(r={});var a=new Date(e),o=function(e,n){void 0===n&&(n={});var r=n.timeZoneName||"short",a=e+"|"+r,o=t[a];return o||(o=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:r}),t[a]=o),o}(n,r);return o.formatToParts(a)},l=function(t,n){for(var r=i(t,n),o=[],l=0;l<r.length;l+=1){var s=r[l],c=s.type,u=s.value,d=e[c];d>=0&&(o[d]=parseInt(u,10))}var h=o[3],m=24===h?0:h,p=o[0]+"-"+o[1]+"-"+o[2]+" "+m+":"+o[4]+":"+o[5]+":000",f=+t;return(a.utc(p).valueOf()-(f-=f%1e3))/6e4},s=r.prototype;s.tz=function(e,t){void 0===e&&(e=o);var n=this.utcOffset(),r=this.toDate(),i=r.toLocaleString("en-US",{timeZone:e}),l=Math.round((r-new Date(i))/1e3/60),s=a(i,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(15*-Math.round(r.getTimezoneOffset()/15)-l,!0);if(t){var c=s.utcOffset();s=s.add(n-c,"minute")}return s.$x.$timezone=e,s},s.offsetName=function(e){var t=this.$x.$timezone||a.tz.guess(),n=i(this.valueOf(),t,{timeZoneName:e}).find((function(e){return"timezonename"===e.type.toLowerCase()}));return n&&n.value};var c=s.startOf;s.startOf=function(e,t){if(!this.$x||!this.$x.$timezone)return c.call(this,e,t);var n=a(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return c.call(n,e,t).tz(this.$x.$timezone,!0)},a.tz=function(e,t,n){var r=n&&t,i=n||t||o,s=l(+a(),i);if("string"!=typeof e)return a(e).tz(i);var c=function(e,t,n){var r=e-60*t*1e3,a=l(r,n);if(t===a)return[r,t];var o=l(r-=60*(a-t)*1e3,n);return a===o?[r,a]:[e-60*Math.min(a,o)*1e3,Math.max(a,o)]}(a.utc(e,r).valueOf(),s,i),u=c[0],d=c[1],h=a(u).utcOffset(d);return h.$x.$timezone=i,h},a.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},a.tz.setDefault=function(e){o=e}}}()},220:function(e){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,a,o){var i=a.prototype;o.utc=function(e){return new a({date:e,utc:!0,args:arguments})},i.utc=function(t){var n=o(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},i.local=function(){return o(this.toDate(),{locale:this.$L,utc:!1})};var l=i.parse;i.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),l.call(this,e)};var s=i.init;i.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else s.call(this)};var c=i.utcOffset;i.utcOffset=function(r,a){var o=this.$utils().u;if(o(r))return this.$u?0:o(this.$offset)?c.call(this):this.$offset;if("string"==typeof r&&(r=function(e){void 0===e&&(e="");var r=e.match(t);if(!r)return null;var a=(""+r[0]).match(n)||["-",0,0],o=a[0],i=60*+a[1]+ +a[2];return 0===i?0:"+"===o?i:-i}(r),null===r))return this;var i=Math.abs(r)<=16?60*r:r,l=this;if(a)return l.$offset=i,l.$u=0===r,l;if(0!==r){var s=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(l=this.local().add(i+s,e)).$offset=i,l.$x.$localOffset=s}else l=this.utc();return l};var u=i.format;i.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return u.call(this,t)},i.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},i.isUTC=function(){return!!this.$u},i.toISOString=function(){return this.toDate().toISOString()},i.toString=function(){return this.toDate().toUTCString()};var d=i.toDate;i.toDate=function(e){return"s"===e&&this.$offset?o(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var h=i.diff;i.diff=function(e,t,n){if(e&&this.$u===e.$u)return h.call(this,e,t,n);var r=this.local(),a=o(e).local();return h.call(r,a,t,n)}}}()},411:(e,t,n)=>{"use strict";var r=n(709),a=n(430),o=n(277),i=n(553);e.exports=function(e,t,n){if(!e||"object"!==typeof e&&"function"!==typeof e)throw new o("`obj` must be an object or a function`");if("string"!==typeof t&&"symbol"!==typeof t)throw new o("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!==typeof arguments[3]&&null!==arguments[3])throw new o("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!==typeof arguments[4]&&null!==arguments[4])throw new o("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!==typeof arguments[5]&&null!==arguments[5])throw new o("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!==typeof arguments[6])throw new o("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],d=!!i&&i(e,t);if(r)r(e,t,{configurable:null===c&&d?d.configurable:!c,enumerable:null===l&&d?d.enumerable:!l,value:n,writable:null===s&&d?d.writable:!s});else{if(!u&&(l||s||c))throw new a("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=n}}},709:(e,t,n)=>{"use strict";var r=n(375)("%Object.defineProperty%",!0)||!1;if(r)try{r({},"a",{value:1})}catch(a){r=!1}e.exports=r},123:e=>{"use strict";e.exports=EvalError},953:e=>{"use strict";e.exports=Error},780:e=>{"use strict";e.exports=RangeError},768:e=>{"use strict";e.exports=ReferenceError},430:e=>{"use strict";e.exports=SyntaxError},277:e=>{"use strict";e.exports=TypeError},619:e=>{"use strict";e.exports=URIError},307:e=>{"use strict";var t=Object.prototype.toString,n=Math.max,r=function(e,t){for(var n=[],r=0;r<e.length;r+=1)n[r]=e[r];for(var a=0;a<t.length;a+=1)n[a+e.length]=t[a];return n};e.exports=function(e){var a=this;if("function"!==typeof a||"[object Function]"!==t.apply(a))throw new TypeError("Function.prototype.bind called on incompatible "+a);for(var o,i=function(e,t){for(var n=[],r=t||0,a=0;r<e.length;r+=1,a+=1)n[a]=e[r];return n}(arguments,1),l=n(0,a.length-i.length),s=[],c=0;c<l;c++)s[c]="$"+c;if(o=Function("binder","return function ("+function(e,t){for(var n="",r=0;r<e.length;r+=1)n+=e[r],r+1<e.length&&(n+=t);return n}(s,",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof o){var t=a.apply(this,r(i,arguments));return Object(t)===t?t:this}return a.apply(e,r(i,arguments))})),a.prototype){var u=function(){};u.prototype=a.prototype,o.prototype=new u,u.prototype=null}return o}},989:(e,t,n)=>{"use strict";var r=n(307);e.exports=Function.prototype.bind||r},375:(e,t,n)=>{"use strict";var r,a=n(953),o=n(123),i=n(780),l=n(768),s=n(430),c=n(277),u=n(619),d=Function,h=function(e){try{return d('"use strict"; return ('+e+").constructor;")()}catch(t){}},m=Object.getOwnPropertyDescriptor;if(m)try{m({},"")}catch(R){m=null}var p=function(){throw new c},f=m?function(){try{return p}catch(e){try{return m(arguments,"callee").get}catch(t){return p}}}():p,v=n(757)(),g=n(442)(),y=Object.getPrototypeOf||(g?function(e){return e.__proto__}:null),_={},b="undefined"!==typeof Uint8Array&&y?y(Uint8Array):r,w={__proto__:null,"%AggregateError%":"undefined"===typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"===typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":v&&y?y([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":_,"%AsyncGenerator%":_,"%AsyncGeneratorFunction%":_,"%AsyncIteratorPrototype%":_,"%Atomics%":"undefined"===typeof Atomics?r:Atomics,"%BigInt%":"undefined"===typeof BigInt?r:BigInt,"%BigInt64Array%":"undefined"===typeof BigInt64Array?r:BigInt64Array,"%BigUint64Array%":"undefined"===typeof BigUint64Array?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"===typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":a,"%eval%":eval,"%EvalError%":o,"%Float32Array%":"undefined"===typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"===typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"===typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":d,"%GeneratorFunction%":_,"%Int8Array%":"undefined"===typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"===typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"===typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":v&&y?y(y([][Symbol.iterator]())):r,"%JSON%":"object"===typeof JSON?JSON:r,"%Map%":"undefined"===typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!==typeof Map&&v&&y?y((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"===typeof Promise?r:Promise,"%Proxy%":"undefined"===typeof Proxy?r:Proxy,"%RangeError%":i,"%ReferenceError%":l,"%Reflect%":"undefined"===typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"===typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!==typeof Set&&v&&y?y((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"===typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":v&&y?y(""[Symbol.iterator]()):r,"%Symbol%":v?Symbol:r,"%SyntaxError%":s,"%ThrowTypeError%":f,"%TypedArray%":b,"%TypeError%":c,"%Uint8Array%":"undefined"===typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"===typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"===typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"===typeof Uint32Array?r:Uint32Array,"%URIError%":u,"%WeakMap%":"undefined"===typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"===typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"===typeof WeakSet?r:WeakSet};if(y)try{null.error}catch(R){var k=y(y(R));w["%Error.prototype%"]=k}var x=function e(t){var n;if("%AsyncFunction%"===t)n=h("async function () {}");else if("%GeneratorFunction%"===t)n=h("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=h("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var a=e("%AsyncGenerator%");a&&y&&(n=y(a.prototype))}return w[t]=n,n},S={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},C=n(989),E=n(155),N=C.call(Function.call,Array.prototype.concat),A=C.call(Function.apply,Array.prototype.splice),M=C.call(Function.call,String.prototype.replace),T=C.call(Function.call,String.prototype.slice),L=C.call(Function.call,RegExp.prototype.exec),O=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,P=/\\(\\)?/g,I=function(e,t){var n,r=e;if(E(S,r)&&(r="%"+(n=S[r])[0]+"%"),E(w,r)){var a=w[r];if(a===_&&(a=x(r)),"undefined"===typeof a&&!t)throw new c("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:a}}throw new s("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!==typeof e||0===e.length)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!==typeof t)throw new c('"allowMissing" argument must be a boolean');if(null===L(/^%?[^%]*%?$/,e))throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(e){var t=T(e,0,1),n=T(e,-1);if("%"===t&&"%"!==n)throw new s("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new s("invalid intrinsic syntax, expected opening `%`");var r=[];return M(e,O,(function(e,t,n,a){r[r.length]=n?M(a,P,"$1"):t||e})),r}(e),r=n.length>0?n[0]:"",a=I("%"+r+"%",t),o=a.name,i=a.value,l=!1,u=a.alias;u&&(r=u[0],A(n,N([0,1],u)));for(var d=1,h=!0;d<n.length;d+=1){var p=n[d],f=T(p,0,1),v=T(p,-1);if(('"'===f||"'"===f||"`"===f||'"'===v||"'"===v||"`"===v)&&f!==v)throw new s("property names with quotes must have matching quotes");if("constructor"!==p&&h||(l=!0),E(w,o="%"+(r+="."+p)+"%"))i=w[o];else if(null!=i){if(!(p in i)){if(!t)throw new c("base intrinsic for "+e+" exists, but the property is not available.");return}if(m&&d+1>=n.length){var g=m(i,p);i=(h=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:i[p]}else h=E(i,p),i=i[p];h&&!l&&(w[o]=i)}}return i}},553:(e,t,n)=>{"use strict";var r=n(375)("%Object.getOwnPropertyDescriptor%",!0);if(r)try{r([],"length")}catch(a){r=null}e.exports=r},734:(e,t,n)=>{"use strict";var r=n(709),a=function(){return!!r};a.hasArrayLengthDefineBug=function(){if(!r)return null;try{return 1!==r([],"length",{value:1}).length}catch(e){return!0}},e.exports=a},442:e=>{"use strict";var t={foo:{}},n=Object;e.exports=function(){return{__proto__:t}.foo===t.foo&&!({__proto__:null}instanceof n)}},757:(e,t,n)=>{"use strict";var r="undefined"!==typeof Symbol&&Symbol,a=n(175);e.exports=function(){return"function"===typeof r&&("function"===typeof Symbol&&("symbol"===typeof r("foo")&&("symbol"===typeof Symbol("bar")&&a())))}},175:e=>{"use strict";e.exports=function(){if("function"!==typeof Symbol||"function"!==typeof Object.getOwnPropertySymbols)return!1;if("symbol"===typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"===typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"===typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"===typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"===typeof Object.getOwnPropertyDescriptor){var a=Object.getOwnPropertyDescriptor(e,t);if(42!==a.value||!0!==a.enumerable)return!1}return!0}},155:(e,t,n)=>{"use strict";var r=Function.prototype.call,a=Object.prototype.hasOwnProperty,o=n(989);e.exports=o.call(r,a)},267:(e,t,n)=>{var r=NaN,a="[object Symbol]",o=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,s=/^0o[0-7]+$/i,c=parseInt,u="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,d="object"==typeof self&&self&&self.Object===Object&&self,h=u||d||Function("return this")(),m=Object.prototype.toString,p=Math.max,f=Math.min,v=function(){return h.Date.now()};function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function y(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&m.call(e)==a}(e))return r;if(g(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=g(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var n=l.test(e);return n||s.test(e)?c(e.slice(2),n?2:8):i.test(e)?r:+e}e.exports=function(e,t,n){var r,a,o,i,l,s,c=0,u=!1,d=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var n=r,o=a;return r=a=void 0,c=t,i=e.apply(o,n)}function _(e){var n=e-s;return void 0===s||n>=t||n<0||d&&e-c>=o}function b(){var e=v();if(_(e))return w(e);l=setTimeout(b,function(e){var n=t-(e-s);return d?f(n,o-(e-c)):n}(e))}function w(e){return l=void 0,h&&r?m(e):(r=a=void 0,i)}function k(){var e=v(),n=_(e);if(r=arguments,a=this,s=e,n){if(void 0===l)return function(e){return c=e,l=setTimeout(b,t),u?m(e):i}(s);if(d)return l=setTimeout(b,t),m(s)}return void 0===l&&(l=setTimeout(b,t)),i}return t=y(t)||0,g(n)&&(u=!!n.leading,o=(d="maxWait"in n)?p(y(n.maxWait)||0,t):o,h="trailing"in n?!!n.trailing:h),k.cancel=function(){void 0!==l&&clearTimeout(l),c=0,r=s=a=l=void 0},k.flush=function(){return void 0===l?i:w(v())},k}},424:(e,t,n)=>{var r="__lodash_hash_undefined__",a=1/0,o="[object Function]",i="[object GeneratorFunction]",l="[object Symbol]",s=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,c=/^\w*$/,u=/^\./,d=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,h=/\\(\\)?/g,m=/^\[object .+?Constructor\]$/,p="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,f="object"==typeof self&&self&&self.Object===Object&&self,v=p||f||Function("return this")();var g=Array.prototype,y=Function.prototype,_=Object.prototype,b=v["__core-js_shared__"],w=function(){var e=/[^.]+$/.exec(b&&b.keys&&b.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),k=y.toString,x=_.hasOwnProperty,S=_.toString,C=RegExp("^"+k.call(x).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),E=v.Symbol,N=g.splice,A=j(v,"Map"),M=j(Object,"create"),T=E?E.prototype:void 0,L=T?T.toString:void 0;function O(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function P(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function I(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function R(e,t){for(var n,r,a=e.length;a--;)if((n=e[a][0])===(r=t)||n!==n&&r!==r)return a;return-1}function D(e,t){var n;t=function(e,t){if(U(e))return!1;var n=typeof e;if("number"==n||"symbol"==n||"boolean"==n||null==e||q(e))return!0;return c.test(e)||!s.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:U(n=t)?n:H(n);for(var r=0,a=t.length;null!=e&&r<a;)e=e[V(t[r++])];return r&&r==a?e:void 0}function z(e){if(!B(e)||(t=e,w&&w in t))return!1;var t,n=function(e){var t=B(e)?S.call(e):"";return t==o||t==i}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(n){}return t}(e)?C:m;return n.test(function(e){if(null!=e){try{return k.call(e)}catch(t){}try{return e+""}catch(t){}}return""}(e))}function F(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map}function j(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return z(n)?n:void 0}O.prototype.clear=function(){this.__data__=M?M(null):{}},O.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},O.prototype.get=function(e){var t=this.__data__;if(M){var n=t[e];return n===r?void 0:n}return x.call(t,e)?t[e]:void 0},O.prototype.has=function(e){var t=this.__data__;return M?void 0!==t[e]:x.call(t,e)},O.prototype.set=function(e,t){return this.__data__[e]=M&&void 0===t?r:t,this},P.prototype.clear=function(){this.__data__=[]},P.prototype.delete=function(e){var t=this.__data__,n=R(t,e);return!(n<0)&&(n==t.length-1?t.pop():N.call(t,n,1),!0)},P.prototype.get=function(e){var t=this.__data__,n=R(t,e);return n<0?void 0:t[n][1]},P.prototype.has=function(e){return R(this.__data__,e)>-1},P.prototype.set=function(e,t){var n=this.__data__,r=R(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},I.prototype.clear=function(){this.__data__={hash:new O,map:new(A||P),string:new O}},I.prototype.delete=function(e){return F(this,e).delete(e)},I.prototype.get=function(e){return F(this,e).get(e)},I.prototype.has=function(e){return F(this,e).has(e)},I.prototype.set=function(e,t){return F(this,e).set(e,t),this};var H=$((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(q(e))return L?L.call(e):"";var t=e+"";return"0"==t&&1/e==-a?"-0":t}(t);var n=[];return u.test(e)&&n.push(""),e.replace(d,(function(e,t,r,a){n.push(r?a.replace(h,"$1"):t||e)})),n}));function V(e){if("string"==typeof e||q(e))return e;var t=e+"";return"0"==t&&1/e==-a?"-0":t}function $(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],o=n.cache;if(o.has(a))return o.get(a);var i=e.apply(this,r);return n.cache=o.set(a,i),i};return n.cache=new($.Cache||I),n}$.Cache=I;var U=Array.isArray;function B(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function q(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&S.call(e)==l}e.exports=function(e,t,n){var r=null==e?void 0:D(e,t);return void 0===r?n:r}},141:(e,t,n)=>{var r="function"===typeof Map&&Map.prototype,a=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,o=r&&a&&"function"===typeof a.get?a.get:null,i=r&&Map.prototype.forEach,l="function"===typeof Set&&Set.prototype,s=Object.getOwnPropertyDescriptor&&l?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=l&&s&&"function"===typeof s.get?s.get:null,u=l&&Set.prototype.forEach,d="function"===typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,h="function"===typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,m="function"===typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,f=Object.prototype.toString,v=Function.prototype.toString,g=String.prototype.match,y=String.prototype.slice,_=String.prototype.replace,b=String.prototype.toUpperCase,w=String.prototype.toLowerCase,k=RegExp.prototype.test,x=Array.prototype.concat,S=Array.prototype.join,C=Array.prototype.slice,E=Math.floor,N="function"===typeof BigInt?BigInt.prototype.valueOf:null,A=Object.getOwnPropertySymbols,M="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?Symbol.prototype.toString:null,T="function"===typeof Symbol&&"object"===typeof Symbol.iterator,L="function"===typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===T||"symbol")?Symbol.toStringTag:null,O=Object.prototype.propertyIsEnumerable,P=("function"===typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function I(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||k.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"===typeof e){var r=e<0?-E(-e):E(e);if(r!==e){var a=String(r),o=y.call(t,a.length+1);return _.call(a,n,"$&_")+"."+_.call(_.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return _.call(t,n,"$&_")}var R=n(634),D=R.custom,z=$(D)?D:null;function F(e,t,n){var r="double"===(n.quoteStyle||t)?'"':"'";return r+e+r}function j(e){return _.call(String(e),/"/g,""")}function H(e){return"[object Array]"===q(e)&&(!L||!("object"===typeof e&&L in e))}function V(e){return"[object RegExp]"===q(e)&&(!L||!("object"===typeof e&&L in e))}function $(e){if(T)return e&&"object"===typeof e&&e instanceof Symbol;if("symbol"===typeof e)return!0;if(!e||"object"!==typeof e||!M)return!1;try{return M.call(e),!0}catch(t){}return!1}e.exports=function e(t,r,a,l){var s=r||{};if(B(s,"quoteStyle")&&"single"!==s.quoteStyle&&"double"!==s.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(B(s,"maxStringLength")&&("number"===typeof s.maxStringLength?s.maxStringLength<0&&s.maxStringLength!==1/0:null!==s.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var f=!B(s,"customInspect")||s.customInspect;if("boolean"!==typeof f&&"symbol"!==f)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(B(s,"indent")&&null!==s.indent&&"\t"!==s.indent&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(B(s,"numericSeparator")&&"boolean"!==typeof s.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var b=s.numericSeparator;if("undefined"===typeof t)return"undefined";if(null===t)return"null";if("boolean"===typeof t)return t?"true":"false";if("string"===typeof t)return W(t,s);if("number"===typeof t){if(0===t)return 1/0/t>0?"0":"-0";var k=String(t);return b?I(t,k):k}if("bigint"===typeof t){var E=String(t)+"n";return b?I(t,E):E}var A="undefined"===typeof s.depth?5:s.depth;if("undefined"===typeof a&&(a=0),a>=A&&A>0&&"object"===typeof t)return H(t)?"[Array]":"[Object]";var D=function(e,t){var n;if("\t"===e.indent)n="\t";else{if(!("number"===typeof e.indent&&e.indent>0))return null;n=S.call(Array(e.indent+1)," ")}return{base:n,prev:S.call(Array(t+1),n)}}(s,a);if("undefined"===typeof l)l=[];else if(Y(l,t)>=0)return"[Circular]";function U(t,n,r){if(n&&(l=C.call(l)).push(n),r){var o={depth:s.depth};return B(s,"quoteStyle")&&(o.quoteStyle=s.quoteStyle),e(t,o,a+1,l)}return e(t,s,a+1,l)}if("function"===typeof t&&!V(t)){var K=function(e){if(e.name)return e.name;var t=g.call(v.call(e),/^function\s*([\w$]+)/);if(t)return t[1];return null}(t),ee=X(t,U);return"[Function"+(K?": "+K:" (anonymous)")+"]"+(ee.length>0?" { "+S.call(ee,", ")+" }":"")}if($(t)){var te=T?_.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):M.call(t);return"object"!==typeof t||T?te:Q(te)}if(function(e){if(!e||"object"!==typeof e)return!1;if("undefined"!==typeof HTMLElement&&e instanceof HTMLElement)return!0;return"string"===typeof e.nodeName&&"function"===typeof e.getAttribute}(t)){for(var ne="<"+w.call(String(t.nodeName)),re=t.attributes||[],ae=0;ae<re.length;ae++)ne+=" "+re[ae].name+"="+F(j(re[ae].value),"double",s);return ne+=">",t.childNodes&&t.childNodes.length&&(ne+="..."),ne+="</"+w.call(String(t.nodeName))+">"}if(H(t)){if(0===t.length)return"[]";var oe=X(t,U);return D&&!function(e){for(var t=0;t<e.length;t++)if(Y(e[t],"\n")>=0)return!1;return!0}(oe)?"["+J(oe,D)+"]":"[ "+S.call(oe,", ")+" ]"}if(function(e){return"[object Error]"===q(e)&&(!L||!("object"===typeof e&&L in e))}(t)){var ie=X(t,U);return"cause"in Error.prototype||!("cause"in t)||O.call(t,"cause")?0===ie.length?"["+String(t)+"]":"{ ["+String(t)+"] "+S.call(ie,", ")+" }":"{ ["+String(t)+"] "+S.call(x.call("[cause]: "+U(t.cause),ie),", ")+" }"}if("object"===typeof t&&f){if(z&&"function"===typeof t[z]&&R)return R(t,{depth:A-a});if("symbol"!==f&&"function"===typeof t.inspect)return t.inspect()}if(function(e){if(!o||!e||"object"!==typeof e)return!1;try{o.call(e);try{c.call(e)}catch(ne){return!0}return e instanceof Map}catch(t){}return!1}(t)){var le=[];return i&&i.call(t,(function(e,n){le.push(U(n,t,!0)+" => "+U(e,t))})),G("Map",o.call(t),le,D)}if(function(e){if(!c||!e||"object"!==typeof e)return!1;try{c.call(e);try{o.call(e)}catch(t){return!0}return e instanceof Set}catch(n){}return!1}(t)){var se=[];return u&&u.call(t,(function(e){se.push(U(e,t))})),G("Set",c.call(t),se,D)}if(function(e){if(!d||!e||"object"!==typeof e)return!1;try{d.call(e,d);try{h.call(e,h)}catch(ne){return!0}return e instanceof WeakMap}catch(t){}return!1}(t))return Z("WeakMap");if(function(e){if(!h||!e||"object"!==typeof e)return!1;try{h.call(e,h);try{d.call(e,d)}catch(ne){return!0}return e instanceof WeakSet}catch(t){}return!1}(t))return Z("WeakSet");if(function(e){if(!m||!e||"object"!==typeof e)return!1;try{return m.call(e),!0}catch(t){}return!1}(t))return Z("WeakRef");if(function(e){return"[object Number]"===q(e)&&(!L||!("object"===typeof e&&L in e))}(t))return Q(U(Number(t)));if(function(e){if(!e||"object"!==typeof e||!N)return!1;try{return N.call(e),!0}catch(t){}return!1}(t))return Q(U(N.call(t)));if(function(e){return"[object Boolean]"===q(e)&&(!L||!("object"===typeof e&&L in e))}(t))return Q(p.call(t));if(function(e){return"[object String]"===q(e)&&(!L||!("object"===typeof e&&L in e))}(t))return Q(U(String(t)));if("undefined"!==typeof window&&t===window)return"{ [object Window] }";if(t===n.g)return"{ [object globalThis] }";if(!function(e){return"[object Date]"===q(e)&&(!L||!("object"===typeof e&&L in e))}(t)&&!V(t)){var ce=X(t,U),ue=P?P(t)===Object.prototype:t instanceof Object||t.constructor===Object,de=t instanceof Object?"":"null prototype",he=!ue&&L&&Object(t)===t&&L in t?y.call(q(t),8,-1):de?"Object":"",me=(ue||"function"!==typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(he||de?"["+S.call(x.call([],he||[],de||[]),": ")+"] ":"");return 0===ce.length?me+"{}":D?me+"{"+J(ce,D)+"}":me+"{ "+S.call(ce,", ")+" }"}return String(t)};var U=Object.prototype.hasOwnProperty||function(e){return e in this};function B(e,t){return U.call(e,t)}function q(e){return f.call(e)}function Y(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function W(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return W(y.call(e,0,t.maxStringLength),t)+r}return F(_.call(_.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,K),"single",t)}function K(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+b.call(t.toString(16))}function Q(e){return"Object("+e+")"}function Z(e){return e+" { ? }"}function G(e,t,n,r){return e+" ("+t+") {"+(r?J(n,r):S.call(n,", "))+"}"}function J(e,t){if(0===e.length)return"";var n="\n"+t.prev+t.base;return n+S.call(e,","+n)+"\n"+t.prev}function X(e,t){var n=H(e),r=[];if(n){r.length=e.length;for(var a=0;a<e.length;a++)r[a]=B(e,a)?t(e[a],e):""}var o,i="function"===typeof A?A(e):[];if(T){o={};for(var l=0;l<i.length;l++)o["$"+i[l]]=i[l]}for(var s in e)B(e,s)&&(n&&String(Number(s))===s&&s<e.length||T&&o["$"+s]instanceof Symbol||(k.call(/[^\w$]/,s)?r.push(t(s,e)+": "+t(e[s],e)):r.push(s+": "+t(e[s],e))));if("function"===typeof A)for(var c=0;c<i.length;c++)O.call(e,i[c])&&r.push("["+t(i[c])+"]: "+t(e[i[c]],e));return r}},609:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Children:()=>Y,Component:()=>l.uA,Fragment:()=>l.FK,PureComponent:()=>H,StrictMode:()=>Oe,Suspense:()=>G,SuspenseList:()=>ee,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>ke,cloneElement:()=>Ne,createContext:()=>l.q6,createElement:()=>l.n,createFactory:()=>Se,createPortal:()=>ae,createRef:()=>l._3,default:()=>He,findDOMNode:()=>Me,flushSync:()=>Le,forwardRef:()=>B,hydrate:()=>he,isElement:()=>ze,isFragment:()=>Ee,isValidElement:()=>Ce,lazy:()=>X,memo:()=>V,render:()=>de,startTransition:()=>Pe,unmountComponentAtNode:()=>Ae,unstable_batchedUpdates:()=>Te,useCallback:()=>E,useContext:()=>N,useDebugValue:()=>A,useDeferredValue:()=>Ie,useEffect:()=>w,useErrorBoundary:()=>M,useId:()=>T,useImperativeHandle:()=>S,useInsertionEffect:()=>De,useLayoutEffect:()=>k,useMemo:()=>C,useReducer:()=>b,useRef:()=>x,useState:()=>_,useSyncExternalStore:()=>Fe,useTransition:()=>Re,version:()=>xe});var r,a,o,i,l=n(746),s=0,c=[],u=[],d=l.fF,h=d.__b,m=d.__r,p=d.diffed,f=d.__c,v=d.unmount,g=d.__;function y(e,t){d.__h&&d.__h(a,e,s||t),s=0;var n=a.__H||(a.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:u}),n.__[e]}function _(e){return s=1,b(z,e)}function b(e,t,n){var o=y(r++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):z(void 0,t),function(e){var t=o.__N?o.__N[0]:o.__[0],n=o.t(t,e);t!==n&&(o.__N=[n,o.__[1]],o.__c.setState({}))}],o.__c=a,!a.u)){var i=function(e,t,n){if(!o.__c.__H)return!0;var r=o.__c.__H.__.filter((function(e){return!!e.__c}));if(r.every((function(e){return!e.__N})))return!l||l.call(this,e,t,n);var a=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}})),!(!a&&o.__c.props===e)&&(!l||l.call(this,e,t,n))};a.u=!0;var l=a.shouldComponentUpdate,s=a.componentWillUpdate;a.componentWillUpdate=function(e,t,n){if(this.__e){var r=l;l=void 0,i(e,t,n),l=r}s&&s.call(this,e,t,n)},a.shouldComponentUpdate=i}return o.__N||o.__}function w(e,t){var n=y(r++,3);!d.__s&&D(n.__H,t)&&(n.__=e,n.i=t,a.__H.__h.push(n))}function k(e,t){var n=y(r++,4);!d.__s&&D(n.__H,t)&&(n.__=e,n.i=t,a.__h.push(n))}function x(e){return s=5,C((function(){return{current:e}}),[])}function S(e,t,n){s=6,k((function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0}),null==n?n:n.concat(e))}function C(e,t){var n=y(r++,7);return D(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function E(e,t){return s=8,C((function(){return e}),t)}function N(e){var t=a.context[e.__c],n=y(r++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(a)),t.props.value):e.__}function A(e,t){d.useDebugValue&&d.useDebugValue(t?t(e):e)}function M(e){var t=y(r++,10),n=_();return t.__=e,a.componentDidCatch||(a.componentDidCatch=function(e,r){t.__&&t.__(e,r),n[1](e)}),[n[0],function(){n[1](void 0)}]}function T(){var e=y(r++,11);if(!e.__){for(var t=a.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function L(){for(var e;e=c.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(I),e.__H.__h.forEach(R),e.__H.__h=[]}catch(r){e.__H.__h=[],d.__e(r,e.__v)}}d.__b=function(e){a=null,h&&h(e)},d.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),g&&g(e,t)},d.__r=function(e){m&&m(e),r=0;var t=(a=e.__c).__H;t&&(o===a?(t.__h=[],a.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=u,e.__N=e.i=void 0}))):(t.__h.forEach(I),t.__h.forEach(R),t.__h=[],r=0)),o=a},d.diffed=function(e){p&&p(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==c.push(t)&&i===d.requestAnimationFrame||((i=d.requestAnimationFrame)||P)(L)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==u&&(e.__=e.__V),e.i=void 0,e.__V=u}))),o=a=null},d.__c=function(e,t){t.some((function(e){try{e.__h.forEach(I),e.__h=e.__h.filter((function(e){return!e.__||R(e)}))}catch(a){t.some((function(e){e.__h&&(e.__h=[])})),t=[],d.__e(a,e.__v)}})),f&&f(e,t)},d.unmount=function(e){v&&v(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{I(e)}catch(e){t=e}})),n.__H=void 0,t&&d.__e(t,n.__v))};var O="function"==typeof requestAnimationFrame;function P(e){var t,n=function(){clearTimeout(r),O&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);O&&(t=requestAnimationFrame(n))}function I(e){var t=a,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),a=t}function R(e){var t=a;e.__c=e.__(),a=t}function D(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function z(e,t){return"function"==typeof t?t(e):t}function F(e,t){for(var n in t)e[n]=t[n];return e}function j(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function H(e,t){this.props=e,this.context=t}function V(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:j(this.props,e)}function r(t){return this.shouldComponentUpdate=n,(0,l.n)(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(H.prototype=new l.uA).isPureReactComponent=!0,H.prototype.shouldComponentUpdate=function(e,t){return j(this.props,e)||j(this.state,t)};var $=l.fF.__b;l.fF.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),$&&$(e)};var U="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function B(e){function t(t){var n=F({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=U,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var q=function(e,t){return null==e?null:(0,l.v2)((0,l.v2)(e).map(t))},Y={map:q,forEach:q,count:function(e){return e?(0,l.v2)(e).length:0},only:function(e){var t=(0,l.v2)(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:l.v2},W=l.fF.__e;l.fF.__e=function(e,t,n,r){if(e.then)for(var a,o=t;o=o.__;)if((a=o.__c)&&a.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),a.__c(e,t);W(e,t,n,r)};var K=l.fF.unmount;function Q(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=F({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return Q(e,t,n)}))),e}function Z(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return Z(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function G(){this.__u=0,this.t=null,this.__b=null}function J(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function X(e){var t,n,r;function a(a){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){r=e})),r)throw r;if(!n)throw t;return(0,l.n)(n,a)}return a.displayName="Lazy",a.__f=!0,a}function ee(){this.u=null,this.o=null}l.fF.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),K&&K(e)},(G.prototype=new l.uA).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var a=J(r.__v),o=!1,i=function(){o||(o=!0,n.__R=null,a?a(l):l())};n.__R=i;var l=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=Z(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(i,i)},G.prototype.componentWillUnmount=function(){this.t=[]},G.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Q(this.__b,n,r.__O=r.__P)}this.__b=null}var a=t.__a&&(0,l.n)(l.FK,null,e.fallback);return a&&(a.__u&=-33),[(0,l.n)(l.FK,null,t.__a?null:e.children),a]};var te=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function ne(e){return this.getChildContext=function(){return e.context},e.children}function re(e){var t=this,n=e.i;t.componentWillUnmount=function(){(0,l.XX)(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(e){this.childNodes.push(e),t.i.appendChild(e)},insertBefore:function(e,n){this.childNodes.push(e),t.i.appendChild(e)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.i.removeChild(e)}}),(0,l.XX)((0,l.n)(ne,{context:t.context},e.__v),t.l)}function ae(e,t){var n=(0,l.n)(re,{__v:e,i:t});return n.containerInfo=t,n}(ee.prototype=new l.uA).__a=function(e){var t=this,n=J(t.__v),r=t.o.get(e);return r[0]++,function(a){var o=function(){t.props.revealOrder?(r.push(a),te(t,e,r)):a()};n?n(o):o()}},ee.prototype.render=function(e){this.u=null,this.o=new Map;var t=(0,l.v2)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},ee.prototype.componentDidUpdate=ee.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){te(e,n,t)}))};var oe="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,ie=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,le=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,se=/[A-Z0-9]/g,ce="undefined"!=typeof document,ue=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};function de(e,t,n){return null==t.__k&&(t.textContent=""),(0,l.XX)(e,t),"function"==typeof n&&n(),e?e.__c:null}function he(e,t,n){return(0,l.Qv)(e,t),"function"==typeof n&&n(),e?e.__c:null}l.uA.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(l.uA.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var me=l.fF.event;function pe(){}function fe(){return this.cancelBubble}function ve(){return this.defaultPrevented}l.fF.event=function(e){return me&&(e=me(e)),e.persist=pe,e.isPropagationStopped=fe,e.isDefaultPrevented=ve,e.nativeEvent=e};var ge,ye={enumerable:!1,configurable:!0,get:function(){return this.class}},_e=l.fF.vnode;l.fF.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,r={};for(var a in t){var o=t[a];if(!("value"===a&&"defaultValue"in t&&null==o||ce&&"children"===a&&"noscript"===n||"class"===a||"className"===a)){var i=a.toLowerCase();"defaultValue"===a&&"value"in t&&null==t.value?a="value":"download"===a&&!0===o?o="":"translate"===i&&"no"===o?o=!1:"ondoubleclick"===i?a="ondblclick":"onchange"!==i||"input"!==n&&"textarea"!==n||ue(t.type)?"onfocus"===i?a="onfocusin":"onblur"===i?a="onfocusout":le.test(a)?a=i:-1===n.indexOf("-")&&ie.test(a)?a=a.replace(se,"-$&").toLowerCase():null===o&&(o=void 0):i=a="oninput","oninput"===i&&r[a=i]&&(a="oninputCapture"),r[a]=o}}"select"==n&&r.multiple&&Array.isArray(r.value)&&(r.value=(0,l.v2)(t.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==n&&null!=r.defaultValue&&(r.value=(0,l.v2)(t.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",ye)):(t.className&&!t.class||t.class&&t.className)&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=oe,_e&&_e(e)};var be=l.fF.__r;l.fF.__r=function(e){be&&be(e),ge=e.__c};var we=l.fF.diffed;l.fF.diffed=function(e){we&&we(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),ge=null};var ke={ReactCurrentDispatcher:{current:{readContext:function(e){return ge.__n[e.__c].props.value}}}},xe="17.0.2";function Se(e){return l.n.bind(null,e)}function Ce(e){return!!e&&e.$$typeof===oe}function Ee(e){return Ce(e)&&e.type===l.FK}function Ne(e){return Ce(e)?l.Ob.apply(null,arguments):e}function Ae(e){return!!e.__k&&((0,l.XX)(null,e),!0)}function Me(e){return e&&(e.base||1===e.nodeType&&e)||null}var Te=function(e,t){return e(t)},Le=function(e,t){return e(t)},Oe=l.FK;function Pe(e){e()}function Ie(e){return e}function Re(){return[!1,Pe]}var De=k,ze=Ce;function Fe(e,t){var n=t(),r=_({h:{__:n,v:t}}),a=r[0].h,o=r[1];return k((function(){a.__=n,a.v=t,je(a)&&o({h:a})}),[e,n,t]),w((function(){return je(a)&&o({h:a}),e((function(){je(a)&&o({h:a})}))}),[e]),n}function je(e){var t,n,r=e.v,a=e.__;try{var o=r();return!((t=a)===(n=o)&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}}var He={useState:_,useId:T,useReducer:b,useEffect:w,useLayoutEffect:k,useInsertionEffect:De,useTransition:Re,useDeferredValue:Ie,useSyncExternalStore:Fe,startTransition:Pe,useRef:x,useImperativeHandle:S,useMemo:C,useCallback:E,useContext:N,useDebugValue:A,version:"17.0.2",Children:Y,render:de,hydrate:he,unmountComponentAtNode:Ae,createPortal:ae,createElement:l.n,createContext:l.q6,createFactory:Se,cloneElement:Ne,createRef:l._3,Fragment:l.FK,isValidElement:Ce,isElement:ze,isFragment:Ee,findDOMNode:Me,Component:l.uA,PureComponent:H,memo:V,forwardRef:B,flushSync:Le,unstable_batchedUpdates:Te,StrictMode:Oe,Suspense:G,SuspenseList:ee,lazy:X,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:ke}},746:(e,t,n)=>{"use strict";n.d(t,{FK:()=>b,Ob:()=>B,Qv:()=>U,XX:()=>$,_3:()=>_,fF:()=>a,n:()=>g,q6:()=>q,uA:()=>w,v2:()=>T});var r,a,o,i,l,s,c,u,d={},h=[],m=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,p=Array.isArray;function f(e,t){for(var n in t)e[n]=t[n];return e}function v(e){var t=e.parentNode;t&&t.removeChild(e)}function g(e,t,n){var a,o,i,l={};for(i in t)"key"==i?a=t[i]:"ref"==i?o=t[i]:l[i]=t[i];if(arguments.length>2&&(l.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===l[i]&&(l[i]=e.defaultProps[i]);return y(e,l,a,o,null)}function y(e,t,n,r,i){var l={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==i?++o:i,__i:-1,__u:0};return null==i&&null!=a.vnode&&a.vnode(l),l}function _(){return{current:null}}function b(e){return e.children}function w(e,t){this.props=e,this.context=t}function k(e,t){if(null==t)return e.__?k(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?k(e):null}function x(e,t,n){var r,o=e.__v,i=o.__e,l=e.__P;if(l)return(r=f({},o)).__v=o.__v+1,a.vnode&&a.vnode(r),D(l,r,o,e.__n,void 0!==l.ownerSVGElement,32&o.__u?[i]:null,t,null==i?k(o):i,!!(32&o.__u),n),r.__v=o.__v,r.__.__k[r.__i]=r,r.__d=void 0,r.__e!=i&&S(r),r}function S(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return S(e)}}function C(e){(!e.__d&&(e.__d=!0)&&i.push(e)&&!E.__r++||l!==a.debounceRendering)&&((l=a.debounceRendering)||s)(E)}function E(){var e,t,n,r=[],o=[];for(i.sort(c);e=i.shift();)e.__d&&(n=i.length,t=x(e,r,o)||t,0===n||i.length>n?(z(r,t,o),o.length=r.length=0,t=void 0,i.sort(c)):t&&a.__c&&a.__c(t,h));t&&z(r,t,o),E.__r=0}function N(e,t,n,r,a,o,i,l,s,c,u){var m,p,f,v,g,y=r&&r.__k||h,_=t.length;for(n.__d=s,A(n,t,y),s=n.__d,m=0;m<_;m++)null!=(f=n.__k[m])&&"boolean"!=typeof f&&"function"!=typeof f&&(p=-1===f.__i?d:y[f.__i]||d,f.__i=m,D(e,f,p,a,o,i,l,s,c,u),v=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&j(p.ref,null,f),u.push(f.ref,f.__c||v,f)),null==g&&null!=v&&(g=v),65536&f.__u||p.__k===f.__k?s=M(f,s,e):"function"==typeof f.type&&void 0!==f.__d?s=f.__d:v&&(s=v.nextSibling),f.__d=void 0,f.__u&=-196609);n.__d=s,n.__e=g}function A(e,t,n){var r,a,o,i,l,s=t.length,c=n.length,u=c,d=0;for(e.__k=[],r=0;r<s;r++)null!=(a=e.__k[r]=null==(a=t[r])||"boolean"==typeof a||"function"==typeof a?null:"string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?y(null,a,null,null,a):p(a)?y(b,{children:a},null,null,null):void 0===a.constructor&&a.__b>0?y(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a)?(a.__=e,a.__b=e.__b+1,l=L(a,n,i=r+d,u),a.__i=l,o=null,-1!==l&&(u--,(o=n[l])&&(o.__u|=131072)),null==o||null===o.__v?(-1==l&&d--,"function"!=typeof a.type&&(a.__u|=65536)):l!==i&&(l===i+1?d++:l>i?u>s-i?d+=l-i:d--:d=l<i&&l==i-1?l-i:0,l!==r+d&&(a.__u|=65536))):(o=n[r])&&null==o.key&&o.__e&&0==(131072&o.__u)&&(o.__e==e.__d&&(e.__d=k(o)),H(o,o,!1),n[r]=null,u--);if(u)for(r=0;r<c;r++)null!=(o=n[r])&&0==(131072&o.__u)&&(o.__e==e.__d&&(e.__d=k(o)),H(o,o))}function M(e,t,n){var r,a;if("function"==typeof e.type){for(r=e.__k,a=0;r&&a<r.length;a++)r[a]&&(r[a].__=e,t=M(r[a],t,n));return t}e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8===t.nodeType);return t}function T(e,t){return t=t||[],null==e||"boolean"==typeof e||(p(e)?e.some((function(e){T(e,t)})):t.push(e)),t}function L(e,t,n,r){var a=e.key,o=e.type,i=n-1,l=n+1,s=t[n];if(null===s||s&&a==s.key&&o===s.type)return n;if(r>(null!=s&&0==(131072&s.__u)?1:0))for(;i>=0||l<t.length;){if(i>=0){if((s=t[i])&&0==(131072&s.__u)&&a==s.key&&o===s.type)return i;i--}if(l<t.length){if((s=t[l])&&0==(131072&s.__u)&&a==s.key&&o===s.type)return l;l++}}return-1}function O(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||m.test(t)?n:n+"px"}function P(e,t,n,r,a){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||O(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||O(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,o?R:I,o)):e.removeEventListener(t,o?R:I,o);else{if(a)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function I(e){if(this.l){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(a.event?a.event(e):e)}}function R(e){if(this.l)return this.l[e.type+!0](a.event?a.event(e):e)}function D(e,t,n,r,o,i,l,s,c,u){var d,h,m,v,g,y,_,k,x,S,C,E,A,M,T,L=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(c=!!(32&n.__u),i=[s=t.__e=n.__e]),(d=a.__b)&&d(t);e:if("function"==typeof L)try{if(k=t.props,x=(d=L.contextType)&&r[d.__c],S=d?x?x.props.value:d.__:r,n.__c?_=(h=t.__c=n.__c).__=h.__E:("prototype"in L&&L.prototype.render?t.__c=h=new L(k,S):(t.__c=h=new w(k,S),h.constructor=L,h.render=V),x&&x.sub(h),h.props=k,h.state||(h.state={}),h.context=S,h.__n=r,m=h.__d=!0,h.__h=[],h._sb=[]),null==h.__s&&(h.__s=h.state),null!=L.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=f({},h.__s)),f(h.__s,L.getDerivedStateFromProps(k,h.__s))),v=h.props,g=h.state,h.__v=t,m)null==L.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==L.getDerivedStateFromProps&&k!==v&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(k,S),!h.__e&&(null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(k,h.__s,S)||t.__v===n.__v)){for(t.__v!==n.__v&&(h.props=k,h.state=h.__s,h.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),C=0;C<h._sb.length;C++)h.__h.push(h._sb[C]);h._sb=[],h.__h.length&&l.push(h);break e}null!=h.componentWillUpdate&&h.componentWillUpdate(k,h.__s,S),null!=h.componentDidUpdate&&h.__h.push((function(){h.componentDidUpdate(v,g,y)}))}if(h.context=S,h.props=k,h.__P=e,h.__e=!1,E=a.__r,A=0,"prototype"in L&&L.prototype.render){for(h.state=h.__s,h.__d=!1,E&&E(t),d=h.render(h.props,h.state,h.context),M=0;M<h._sb.length;M++)h.__h.push(h._sb[M]);h._sb=[]}else do{h.__d=!1,E&&E(t),d=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++A<25);h.state=h.__s,null!=h.getChildContext&&(r=f(f({},r),h.getChildContext())),m||null==h.getSnapshotBeforeUpdate||(y=h.getSnapshotBeforeUpdate(v,g)),N(e,p(T=null!=d&&d.type===b&&null==d.key?d.props.children:d)?T:[T],t,n,r,o,i,l,s,c,u),h.base=t.__e,t.__u&=-161,h.__h.length&&l.push(h),_&&(h.__E=h.__=null)}catch(e){t.__v=null,c||null!=i?(t.__e=s,t.__u|=c?160:32,i[i.indexOf(s)]=null):(t.__e=n.__e,t.__k=n.__k),a.__e(e,t,n)}else null==i&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=F(n.__e,t,n,r,o,i,l,c,u);(d=a.diffed)&&d(t)}function z(e,t,n){for(var r=0;r<n.length;r++)j(n[r],n[++r],n[++r]);a.__c&&a.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){a.__e(e,t.__v)}}))}function F(e,t,n,a,o,i,l,s,c){var u,h,m,f,g,y,_,b=n.props,w=t.props,x=t.type;if("svg"===x&&(o=!0),null!=i)for(u=0;u<i.length;u++)if((g=i[u])&&"setAttribute"in g==!!x&&(x?g.localName===x:3===g.nodeType)){e=g,i[u]=null;break}if(null==e){if(null===x)return document.createTextNode(w);e=o?document.createElementNS("http://www.w3.org/2000/svg",x):document.createElement(x,w.is&&w),i=null,s=!1}if(null===x)b===w||s&&e.data===w||(e.data=w);else{if(i=i&&r.call(e.childNodes),b=n.props||d,!s&&null!=i)for(b={},u=0;u<e.attributes.length;u++)b[(g=e.attributes[u]).name]=g.value;for(u in b)g=b[u],"children"==u||("dangerouslySetInnerHTML"==u?m=g:"key"===u||u in w||P(e,u,null,g,o));for(u in w)g=w[u],"children"==u?f=g:"dangerouslySetInnerHTML"==u?h=g:"value"==u?y=g:"checked"==u?_=g:"key"===u||s&&"function"!=typeof g||b[u]===g||P(e,u,g,b[u],o);if(h)s||m&&(h.__html===m.__html||h.__html===e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(m&&(e.innerHTML=""),N(e,p(f)?f:[f],t,n,a,o&&"foreignObject"!==x,i,l,i?i[0]:n.__k&&k(n,0),s,c),null!=i)for(u=i.length;u--;)null!=i[u]&&v(i[u]);s||(u="value",void 0!==y&&(y!==e[u]||"progress"===x&&!y||"option"===x&&y!==b[u])&&P(e,u,y,b[u],!1),u="checked",void 0!==_&&_!==e[u]&&P(e,u,_,b[u],!1))}return e}function j(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){a.__e(e,n)}}function H(e,t,n){var r,o;if(a.unmount&&a.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||j(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){a.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&H(r[o],t,n||"function"!=typeof e.type);n||null==e.__e||v(e.__e),e.__=e.__e=e.__d=void 0}function V(e,t,n){return this.constructor(e,n)}function $(e,t,n){var o,i,l,s;a.__&&a.__(e,t),i=(o="function"==typeof n)?null:n&&n.__k||t.__k,l=[],s=[],D(t,e=(!o&&n||t).__k=g(b,null,[e]),i||d,d,void 0!==t.ownerSVGElement,!o&&n?[n]:i?null:t.firstChild?r.call(t.childNodes):null,l,!o&&n?n:i?i.__e:t.firstChild,o,s),e.__d=void 0,z(l,e,s)}function U(e,t){$(e,t,U)}function B(e,t,n){var a,o,i,l,s=f({},e.props);for(i in e.type&&e.type.defaultProps&&(l=e.type.defaultProps),t)"key"==i?a=t[i]:"ref"==i?o=t[i]:s[i]=void 0===t[i]&&void 0!==l?l[i]:t[i];return arguments.length>2&&(s.children=arguments.length>3?r.call(arguments,2):n),y(e.type,s,a||e.key,o||e.ref,null)}function q(e,t){var n={__c:t="__cC"+u++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,C(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}r=h.slice,a={__e:function(e,t,n,r){for(var a,o,i;t=t.__;)if((a=t.__c)&&!a.__)try{if((o=a.constructor)&&null!=o.getDerivedStateFromError&&(a.setState(o.getDerivedStateFromError(e)),i=a.__d),null!=a.componentDidCatch&&(a.componentDidCatch(e,r||{}),i=a.__d),i)return a.__E=a}catch(t){e=t}throw e}},o=0,w.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=f({},this.state),"function"==typeof e&&(e=e(f({},n),this.props)),e&&f(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),C(this))},w.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),C(this))},w.prototype.render=b,i=[],s="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,c=function(e,t){return e.__v.__b-t.__v.__b},E.__r=0,u=0},640:e=>{"use strict";var t=String.prototype.replace,n=/%20/g,r="RFC1738",a="RFC3986";e.exports={default:a,formatters:{RFC1738:function(e){return t.call(e,n,"+")},RFC3986:function(e){return String(e)}},RFC1738:r,RFC3986:a}},215:(e,t,n)=>{"use strict";var r=n(518),a=n(968),o=n(640);e.exports={formats:o,parse:a,stringify:r}},968:(e,t,n)=>{"use strict";var r=n(570),a=Object.prototype.hasOwnProperty,o=Array.isArray,i={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},l=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},s=function(e,t){return e&&"string"===typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},c=function(e,t,n,r){if(e){var o=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/g,l=n.depth>0&&/(\[[^[\]]*])/.exec(o),c=l?o.slice(0,l.index):o,u=[];if(c){if(!n.plainObjects&&a.call(Object.prototype,c)&&!n.allowPrototypes)return;u.push(c)}for(var d=0;n.depth>0&&null!==(l=i.exec(o))&&d<n.depth;){if(d+=1,!n.plainObjects&&a.call(Object.prototype,l[1].slice(1,-1))&&!n.allowPrototypes)return;u.push(l[1])}return l&&u.push("["+o.slice(l.index)+"]"),function(e,t,n,r){for(var a=r?t:s(t,n),o=e.length-1;o>=0;--o){var i,l=e[o];if("[]"===l&&n.parseArrays)i=[].concat(a);else{i=n.plainObjects?Object.create(null):{};var c="["===l.charAt(0)&&"]"===l.charAt(l.length-1)?l.slice(1,-1):l,u=parseInt(c,10);n.parseArrays||""!==c?!isNaN(u)&&l!==c&&String(u)===c&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(i=[])[u]=a:"__proto__"!==c&&(i[c]=a):i={0:a}}a=i}return a}(u,t,n,r)}};e.exports=function(e,t){var n=function(e){if(!e)return i;if(null!==e.decoder&&void 0!==e.decoder&&"function"!==typeof e.decoder)throw new TypeError("Decoder has to be a function.");if("undefined"!==typeof e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t="undefined"===typeof e.charset?i.charset:e.charset;return{allowDots:"undefined"===typeof e.allowDots?i.allowDots:!!e.allowDots,allowPrototypes:"boolean"===typeof e.allowPrototypes?e.allowPrototypes:i.allowPrototypes,allowSparse:"boolean"===typeof e.allowSparse?e.allowSparse:i.allowSparse,arrayLimit:"number"===typeof e.arrayLimit?e.arrayLimit:i.arrayLimit,charset:t,charsetSentinel:"boolean"===typeof e.charsetSentinel?e.charsetSentinel:i.charsetSentinel,comma:"boolean"===typeof e.comma?e.comma:i.comma,decoder:"function"===typeof e.decoder?e.decoder:i.decoder,delimiter:"string"===typeof e.delimiter||r.isRegExp(e.delimiter)?e.delimiter:i.delimiter,depth:"number"===typeof e.depth||!1===e.depth?+e.depth:i.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"===typeof e.interpretNumericEntities?e.interpretNumericEntities:i.interpretNumericEntities,parameterLimit:"number"===typeof e.parameterLimit?e.parameterLimit:i.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"===typeof e.plainObjects?e.plainObjects:i.plainObjects,strictNullHandling:"boolean"===typeof e.strictNullHandling?e.strictNullHandling:i.strictNullHandling}}(t);if(""===e||null===e||"undefined"===typeof e)return n.plainObjects?Object.create(null):{};for(var u="string"===typeof e?function(e,t){var n,c={__proto__:null},u=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,d=t.parameterLimit===1/0?void 0:t.parameterLimit,h=u.split(t.delimiter,d),m=-1,p=t.charset;if(t.charsetSentinel)for(n=0;n<h.length;++n)0===h[n].indexOf("utf8=")&&("utf8=%E2%9C%93"===h[n]?p="utf-8":"utf8=%26%2310003%3B"===h[n]&&(p="iso-8859-1"),m=n,n=h.length);for(n=0;n<h.length;++n)if(n!==m){var f,v,g=h[n],y=g.indexOf("]="),_=-1===y?g.indexOf("="):y+1;-1===_?(f=t.decoder(g,i.decoder,p,"key"),v=t.strictNullHandling?null:""):(f=t.decoder(g.slice(0,_),i.decoder,p,"key"),v=r.maybeMap(s(g.slice(_+1),t),(function(e){return t.decoder(e,i.decoder,p,"value")}))),v&&t.interpretNumericEntities&&"iso-8859-1"===p&&(v=l(v)),g.indexOf("[]=")>-1&&(v=o(v)?[v]:v),a.call(c,f)?c[f]=r.combine(c[f],v):c[f]=v}return c}(e,n):e,d=n.plainObjects?Object.create(null):{},h=Object.keys(u),m=0;m<h.length;++m){var p=h[m],f=c(p,u[p],n,"string"===typeof e);d=r.merge(d,f,n)}return!0===n.allowSparse?d:r.compact(d)}},518:(e,t,n)=>{"use strict";var r=n(670),a=n(570),o=n(640),i=Object.prototype.hasOwnProperty,l={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},s=Array.isArray,c=Array.prototype.push,u=function(e,t){c.apply(e,s(t)?t:[t])},d=Date.prototype.toISOString,h=o.default,m={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:a.encode,encodeValuesOnly:!1,format:h,formatter:o.formatters[h],indices:!1,serializeDate:function(e){return d.call(e)},skipNulls:!1,strictNullHandling:!1},p={},f=function e(t,n,o,i,l,c,d,h,f,v,g,y,_,b,w,k){for(var x,S=t,C=k,E=0,N=!1;void 0!==(C=C.get(p))&&!N;){var A=C.get(t);if(E+=1,"undefined"!==typeof A){if(A===E)throw new RangeError("Cyclic object value");N=!0}"undefined"===typeof C.get(p)&&(E=0)}if("function"===typeof h?S=h(n,S):S instanceof Date?S=g(S):"comma"===o&&s(S)&&(S=a.maybeMap(S,(function(e){return e instanceof Date?g(e):e}))),null===S){if(l)return d&&!b?d(n,m.encoder,w,"key",y):n;S=""}if("string"===typeof(x=S)||"number"===typeof x||"boolean"===typeof x||"symbol"===typeof x||"bigint"===typeof x||a.isBuffer(S))return d?[_(b?n:d(n,m.encoder,w,"key",y))+"="+_(d(S,m.encoder,w,"value",y))]:[_(n)+"="+_(String(S))];var M,T=[];if("undefined"===typeof S)return T;if("comma"===o&&s(S))b&&d&&(S=a.maybeMap(S,d)),M=[{value:S.length>0?S.join(",")||null:void 0}];else if(s(h))M=h;else{var L=Object.keys(S);M=f?L.sort(f):L}for(var O=i&&s(S)&&1===S.length?n+"[]":n,P=0;P<M.length;++P){var I=M[P],R="object"===typeof I&&"undefined"!==typeof I.value?I.value:S[I];if(!c||null!==R){var D=s(S)?"function"===typeof o?o(O,I):O:O+(v?"."+I:"["+I+"]");k.set(t,E);var z=r();z.set(p,k),u(T,e(R,D,o,i,l,c,"comma"===o&&b&&s(S)?null:d,h,f,v,g,y,_,b,w,z))}}return T};e.exports=function(e,t){var n,a=e,c=function(e){if(!e)return m;if(null!==e.encoder&&"undefined"!==typeof e.encoder&&"function"!==typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||m.charset;if("undefined"!==typeof e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=o.default;if("undefined"!==typeof e.format){if(!i.call(o.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var r=o.formatters[n],a=m.filter;return("function"===typeof e.filter||s(e.filter))&&(a=e.filter),{addQueryPrefix:"boolean"===typeof e.addQueryPrefix?e.addQueryPrefix:m.addQueryPrefix,allowDots:"undefined"===typeof e.allowDots?m.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"===typeof e.charsetSentinel?e.charsetSentinel:m.charsetSentinel,delimiter:"undefined"===typeof e.delimiter?m.delimiter:e.delimiter,encode:"boolean"===typeof e.encode?e.encode:m.encode,encoder:"function"===typeof e.encoder?e.encoder:m.encoder,encodeValuesOnly:"boolean"===typeof e.encodeValuesOnly?e.encodeValuesOnly:m.encodeValuesOnly,filter:a,format:n,formatter:r,serializeDate:"function"===typeof e.serializeDate?e.serializeDate:m.serializeDate,skipNulls:"boolean"===typeof e.skipNulls?e.skipNulls:m.skipNulls,sort:"function"===typeof e.sort?e.sort:null,strictNullHandling:"boolean"===typeof e.strictNullHandling?e.strictNullHandling:m.strictNullHandling}}(t);"function"===typeof c.filter?a=(0,c.filter)("",a):s(c.filter)&&(n=c.filter);var d,h=[];if("object"!==typeof a||null===a)return"";d=t&&t.arrayFormat in l?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var p=l[d];if(t&&"commaRoundTrip"in t&&"boolean"!==typeof t.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var v="comma"===p&&t&&t.commaRoundTrip;n||(n=Object.keys(a)),c.sort&&n.sort(c.sort);for(var g=r(),y=0;y<n.length;++y){var _=n[y];c.skipNulls&&null===a[_]||u(h,f(a[_],_,p,v,c.strictNullHandling,c.skipNulls,c.encode?c.encoder:null,c.filter,c.sort,c.allowDots,c.serializeDate,c.format,c.formatter,c.encodeValuesOnly,c.charset,g))}var b=h.join(c.delimiter),w=!0===c.addQueryPrefix?"?":"";return c.charsetSentinel&&("iso-8859-1"===c.charset?w+="utf8=%26%2310003%3B&":w+="utf8=%E2%9C%93&"),b.length>0?w+b:""}},570:(e,t,n)=>{"use strict";var r=n(640),a=Object.prototype.hasOwnProperty,o=Array.isArray,i=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),l=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)"undefined"!==typeof e[r]&&(n[r]=e[r]);return n};e.exports={arrayToObject:l,assign:function(e,t){return Object.keys(t).reduce((function(e,n){return e[n]=t[n],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var a=t[r],i=a.obj[a.prop],l=Object.keys(i),s=0;s<l.length;++s){var c=l[s],u=i[c];"object"===typeof u&&null!==u&&-1===n.indexOf(u)&&(t.push({obj:i,prop:c}),n.push(u))}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(o(n)){for(var r=[],a=0;a<n.length;++a)"undefined"!==typeof n[a]&&r.push(n[a]);t.obj[t.prop]=r}}}(t),e},decode:function(e,t,n){var r=e.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(a){return r}},encode:function(e,t,n,a,o){if(0===e.length)return e;var l=e;if("symbol"===typeof e?l=Symbol.prototype.toString.call(e):"string"!==typeof e&&(l=String(e)),"iso-8859-1"===n)return escape(l).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var s="",c=0;c<l.length;++c){var u=l.charCodeAt(c);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||o===r.RFC1738&&(40===u||41===u)?s+=l.charAt(c):u<128?s+=i[u]:u<2048?s+=i[192|u>>6]+i[128|63&u]:u<55296||u>=57344?s+=i[224|u>>12]+i[128|u>>6&63]+i[128|63&u]:(c+=1,u=65536+((1023&u)<<10|1023&l.charCodeAt(c)),s+=i[240|u>>18]+i[128|u>>12&63]+i[128|u>>6&63]+i[128|63&u])}return s},isBuffer:function(e){return!(!e||"object"!==typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(o(e)){for(var n=[],r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)},merge:function e(t,n,r){if(!n)return t;if("object"!==typeof n){if(o(t))t.push(n);else{if(!t||"object"!==typeof t)return[t,n];(r&&(r.plainObjects||r.allowPrototypes)||!a.call(Object.prototype,n))&&(t[n]=!0)}return t}if(!t||"object"!==typeof t)return[t].concat(n);var i=t;return o(t)&&!o(n)&&(i=l(t,r)),o(t)&&o(n)?(n.forEach((function(n,o){if(a.call(t,o)){var i=t[o];i&&"object"===typeof i&&n&&"object"===typeof n?t[o]=e(i,n,r):t.push(n)}else t[o]=n})),t):Object.keys(n).reduce((function(t,o){var i=n[o];return a.call(t,o)?t[o]=e(t[o],i,r):t[o]=i,t}),i)}}},494:(e,t,n)=>{e.exports=n(204)},204:(e,t,n)=>{"use strict";var r=function(e){return e&&"object"==typeof e&&"default"in e?e.default:e}(n(609)),a=n(609);function o(){return(o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function i(e,t){e.prototype=Object.create(t.prototype),function(e,t){for(var n=Object.getOwnPropertyNames(t),r=0;r<n.length;r++){var a=n[r],o=Object.getOwnPropertyDescriptor(t,a);o&&o.configurable&&void 0===e[a]&&Object.defineProperty(e,a,o)}}(e.prototype.constructor=e,t)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var s=function(e,t,n,r,a,o,i,l){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,a,o,i,l],u=0;(s=new Error(t.replace(/%s/g,(function(){return c[u++]})))).name="Invariant Violation"}throw s.framesToPop=1,s}};function c(e,t,n){if("selectionStart"in e&&"selectionEnd"in e)e.selectionStart=t,e.selectionEnd=n;else{var r=e.createTextRange();r.collapse(!0),r.moveStart("character",t),r.moveEnd("character",n-t),r.select()}}var u={9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"};function d(e,t,n){var r="",a="",o=null,i=[];if(void 0===t&&(t="_"),null==n&&(n=u),!e||"string"!=typeof e)return{maskChar:t,formatChars:n,mask:null,prefix:null,lastEditablePosition:null,permanents:[]};var l=!1;return e.split("").forEach((function(e){l=!l&&"\\"===e||(l||!n[e]?(i.push(r.length),r.length===i.length-1&&(a+=e)):o=r.length+1,r+=e,!1)})),{maskChar:t,formatChars:n,prefix:a,mask:r,lastEditablePosition:o,permanents:i}}function h(e,t){return-1!==e.permanents.indexOf(t)}function m(e,t,n){var r=e.mask,a=e.formatChars;if(!n)return!1;if(h(e,t))return r[t]===n;var o=a[r[t]];return new RegExp(o).test(n)}function p(e,t){return t.split("").every((function(t,n){return h(e,n)||!m(e,n,t)}))}function f(e,t){var n=e.maskChar,r=e.prefix;if(!n){for(;t.length>r.length&&h(e,t.length-1);)t=t.slice(0,t.length-1);return t.length}for(var a=r.length,o=t.length;o>=r.length;o--){var i=t[o];if(!h(e,o)&&m(e,o,i)){a=o+1;break}}return a}function v(e,t){return f(e,t)===e.mask.length}function g(e,t){var n=e.maskChar,r=e.mask,a=e.prefix;if(!n){for((t=y(e,"",t,0)).length<a.length&&(t=a);t.length<r.length&&h(e,t.length);)t+=r[t.length];return t}if(t)return y(e,g(e,""),t,0);for(var o=0;o<r.length;o++)h(e,o)?t+=r[o]:t+=n;return t}function y(e,t,n,r){var a=e.mask,o=e.maskChar,i=e.prefix,l=n.split(""),s=v(e,t);return!o&&r>t.length&&(t+=a.slice(t.length,r)),l.every((function(n){for(;u=n,h(e,c=r)&&u!==a[c];){if(r>=t.length&&(t+=a[r]),l=n,o&&h(e,r)&&l===o)return!0;if(++r>=a.length)return!1}var l,c,u;return!m(e,r,n)&&n!==o||(r<t.length?t=o||s||r<i.length?t.slice(0,r)+n+t.slice(r+1):(t=t.slice(0,r)+n+t.slice(r),g(e,t)):o||(t+=n),++r<a.length)})),t}function _(e,t){for(var n=e.mask,r=t;r<n.length;++r)if(!h(e,r))return r;return null}function b(e){return e||0===e?e+"":""}function w(e,t,n,r,a){var o=e.mask,i=e.prefix,l=e.lastEditablePosition,s=t,c="",u=0,d=0,p=Math.min(a.start,n.start);return n.end>a.start?d=(u=function(e,t,n,r){var a=e.mask,o=e.maskChar,i=n.split(""),l=r;return i.every((function(t){for(;i=t,h(e,n=r)&&i!==a[n];)if(++r>=a.length)return!1;var n,i;return(m(e,r,t)||t===o)&&r++,r<a.length})),r-l}(e,0,c=s.slice(a.start,n.end),p))?a.length:0:s.length<r.length&&(d=r.length-s.length),s=r,d&&(1!==d||a.length||(p=a.start===n.start?_(e,n.start):function(e,t){for(var n=t;0<=n;--n)if(!h(e,n))return n;return null}(e,n.start)),s=function(e,t,n,r){var a=n+r,o=e.maskChar,i=e.mask,l=e.prefix,s=t.split("");if(o)return s.map((function(t,r){return r<n||a<=r?t:h(e,r)?i[r]:o})).join("");for(var c=a;c<s.length;c++)h(e,c)&&(s[c]="");return n=Math.max(l.length,n),s.splice(n,a-n),t=s.join(""),g(e,t)}(e,s,p,d)),s=y(e,s,c,p),(p+=u)>=o.length?p=o.length:p<i.length&&!u?p=i.length:p>=i.length&&p<l&&u&&(p=_(e,p)),c||(c=null),{value:s=g(e,s),enteredString:c,selection:{start:p,end:p}}}function k(e){return"function"==typeof e}function x(){return window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame}function S(e){return(x()?window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame:function(){return setTimeout(e,1e3/60)})(e)}function C(e){(x()||clearTimeout)(e)}var E=function(e){function t(t){var n=e.call(this,t)||this;n.focused=!1,n.mounted=!1,n.previousSelection=null,n.selectionDeferId=null,n.saveSelectionLoopDeferId=null,n.saveSelectionLoop=function(){n.previousSelection=n.getSelection(),n.saveSelectionLoopDeferId=S(n.saveSelectionLoop)},n.runSaveSelectionLoop=function(){null===n.saveSelectionLoopDeferId&&n.saveSelectionLoop()},n.stopSaveSelectionLoop=function(){null!==n.saveSelectionLoopDeferId&&(C(n.saveSelectionLoopDeferId),n.saveSelectionLoopDeferId=null,n.previousSelection=null)},n.getInputDOMNode=function(){if(!n.mounted)return null;var e=a.findDOMNode(l(l(n))),t="undefined"!=typeof window&&e instanceof window.Element;if(e&&!t)return null;if("INPUT"!==e.nodeName&&(e=e.querySelector("input")),!e)throw new Error("react-input-mask: inputComponent doesn't contain input node");return e},n.getInputValue=function(){var e=n.getInputDOMNode();return e?e.value:null},n.setInputValue=function(e){var t=n.getInputDOMNode();t&&(n.value=e,t.value=e)},n.setCursorToEnd=function(){var e=f(n.maskOptions,n.value),t=_(n.maskOptions,e);null!==t&&n.setCursorPosition(t)},n.setSelection=function(e,t,r){void 0===r&&(r={});var a=n.getInputDOMNode(),o=n.isFocused();a&&o&&(r.deferred||c(a,e,t),null!==n.selectionDeferId&&C(n.selectionDeferId),n.selectionDeferId=S((function(){n.selectionDeferId=null,c(a,e,t)})),n.previousSelection={start:e,end:t,length:Math.abs(t-e)})},n.getSelection=function(){return function(e){var t=0,n=0;if("selectionStart"in e&&"selectionEnd"in e)t=e.selectionStart,n=e.selectionEnd;else{var r=document.selection.createRange();r.parentElement()===e&&(t=-r.moveStart("character",-e.value.length),n=-r.moveEnd("character",-e.value.length))}return{start:t,end:n,length:n-t}}(n.getInputDOMNode())},n.getCursorPosition=function(){return n.getSelection().start},n.setCursorPosition=function(e){n.setSelection(e,e)},n.isFocused=function(){return n.focused},n.getBeforeMaskedValueChangeConfig=function(){var e=n.maskOptions,t=e.mask,r=e.maskChar,a=e.permanents,o=e.formatChars;return{mask:t,maskChar:r,permanents:a,alwaysShowMask:!!n.props.alwaysShowMask,formatChars:o}},n.isInputAutofilled=function(e,t,r,a){var o=n.getInputDOMNode();try{if(o.matches(":-webkit-autofill"))return!0}catch(u){}return!n.focused||a.end<r.length&&t.end===e.length},n.onChange=function(e){var t=l(l(n)).beforePasteState,r=l(l(n)).previousSelection,a=n.props.beforeMaskedValueChange,o=n.getInputValue(),i=n.value,s=n.getSelection();n.isInputAutofilled(o,s,i,r)&&(i=g(n.maskOptions,""),r={start:0,end:0,length:0}),t&&(r=t.selection,i=t.value,s={start:r.start+o.length,end:r.start+o.length,length:0},o=i.slice(0,r.start)+o+i.slice(r.end),n.beforePasteState=null);var c=w(n.maskOptions,o,s,i,r),u=c.enteredString,d=c.selection,h=c.value;if(k(a)){var m=a({value:h,selection:d},{value:i,selection:r},u,n.getBeforeMaskedValueChangeConfig());h=m.value,d=m.selection}n.setInputValue(h),k(n.props.onChange)&&n.props.onChange(e),n.isWindowsPhoneBrowser?n.setSelection(d.start,d.end,{deferred:!0}):n.setSelection(d.start,d.end)},n.onFocus=function(e){var t=n.props.beforeMaskedValueChange,r=n.maskOptions,a=r.mask,o=r.prefix;if(n.focused=!0,n.mounted=!0,a){if(n.value)f(n.maskOptions,n.value)<n.maskOptions.mask.length&&n.setCursorToEnd();else{var i=g(n.maskOptions,o),l=g(n.maskOptions,i),s=f(n.maskOptions,l),c=_(n.maskOptions,s),u={start:c,end:c};if(k(t)){var d=t({value:l,selection:u},{value:n.value,selection:null},null,n.getBeforeMaskedValueChangeConfig());l=d.value,u=d.selection}var h=l!==n.getInputValue();h&&n.setInputValue(l),h&&k(n.props.onChange)&&n.props.onChange(e),n.setSelection(u.start,u.end)}n.runSaveSelectionLoop()}k(n.props.onFocus)&&n.props.onFocus(e)},n.onBlur=function(e){var t=n.props.beforeMaskedValueChange,r=n.maskOptions.mask;if(n.stopSaveSelectionLoop(),n.focused=!1,r&&!n.props.alwaysShowMask&&p(n.maskOptions,n.value)){var a="";k(t)&&(a=t({value:a,selection:null},{value:n.value,selection:n.previousSelection},null,n.getBeforeMaskedValueChangeConfig()).value);var o=a!==n.getInputValue();o&&n.setInputValue(a),o&&k(n.props.onChange)&&n.props.onChange(e)}k(n.props.onBlur)&&n.props.onBlur(e)},n.onMouseDown=function(e){if(!n.focused&&document.addEventListener){n.mouseDownX=e.clientX,n.mouseDownY=e.clientY,n.mouseDownTime=(new Date).getTime();document.addEventListener("mouseup",(function e(t){if(document.removeEventListener("mouseup",e),n.focused){var r=Math.abs(t.clientX-n.mouseDownX),a=Math.abs(t.clientY-n.mouseDownY),o=Math.max(r,a),i=(new Date).getTime()-n.mouseDownTime;(o<=10&&i<=200||o<=5&&i<=300)&&n.setCursorToEnd()}}))}k(n.props.onMouseDown)&&n.props.onMouseDown(e)},n.onPaste=function(e){k(n.props.onPaste)&&n.props.onPaste(e),e.defaultPrevented||(n.beforePasteState={value:n.getInputValue(),selection:n.getSelection()},n.setInputValue(""))},n.handleRef=function(e){null==n.props.children&&k(n.props.inputRef)&&n.props.inputRef(e)};var r=t.mask,o=t.maskChar,i=t.formatChars,s=t.alwaysShowMask,u=t.beforeMaskedValueChange,h=t.defaultValue,m=t.value;n.maskOptions=d(r,o,i),null==h&&(h=""),null==m&&(m=h);var v=b(m);if(n.maskOptions.mask&&(s||v)&&(v=g(n.maskOptions,v),k(u))){var y=t.value;null==t.value&&(y=h),v=u({value:v,selection:null},{value:y=b(y),selection:null},null,n.getBeforeMaskedValueChangeConfig()).value}return n.value=v,n}i(t,e);var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.getInputDOMNode()&&(this.isWindowsPhoneBrowser=function(){var e=new RegExp("windows","i"),t=new RegExp("phone","i"),n=navigator.userAgent;return e.test(n)&&t.test(n)}(),this.maskOptions.mask&&this.getInputValue()!==this.value&&this.setInputValue(this.value))},n.componentDidUpdate=function(){var e=this.previousSelection,t=this.props,n=t.beforeMaskedValueChange,r=t.alwaysShowMask,a=t.mask,o=t.maskChar,i=t.formatChars,l=this.maskOptions,s=r||this.isFocused(),c=null!=this.props.value,u=c?b(this.props.value):this.value,h=e?e.start:null;if(this.maskOptions=d(a,o,i),this.maskOptions.mask){!l.mask&&this.isFocused()&&this.runSaveSelectionLoop();var m=this.maskOptions.mask&&this.maskOptions.mask!==l.mask;if(l.mask||c||(u=this.getInputValue()),(m||this.maskOptions.mask&&(u||s))&&(u=g(this.maskOptions,u)),m){var y=f(this.maskOptions,u);(null===h||y<h)&&(h=v(this.maskOptions,u)?y:_(this.maskOptions,y))}!this.maskOptions.mask||!p(this.maskOptions,u)||s||c&&this.props.value||(u="");var w={start:h,end:h};if(k(n)){var x=n({value:u,selection:w},{value:this.value,selection:this.previousSelection},null,this.getBeforeMaskedValueChangeConfig());u=x.value,w=x.selection}this.value=u;var S=this.getInputValue()!==this.value;S?(this.setInputValue(this.value),this.forceUpdate()):m&&this.forceUpdate();var C=!1;null!=w.start&&null!=w.end&&(C=!e||e.start!==w.start||e.end!==w.end),(C||S)&&this.setSelection(w.start,w.end)}else l.mask&&(this.stopSaveSelectionLoop(),this.forceUpdate())},n.componentWillUnmount=function(){this.mounted=!1,null!==this.selectionDeferId&&C(this.selectionDeferId),this.stopSaveSelectionLoop()},n.render=function(){var e,t=this.props,n=(t.mask,t.alwaysShowMask,t.maskChar,t.formatChars,t.inputRef,t.beforeMaskedValueChange,t.children),a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],0<=t.indexOf(n)||(a[n]=e[n]);return a}(t,["mask","alwaysShowMask","maskChar","formatChars","inputRef","beforeMaskedValueChange","children"]);if(n){k(n)||s(!1);var i=["onChange","onPaste","onMouseDown","onFocus","onBlur","value","disabled","readOnly"],l=o({},a);i.forEach((function(e){return delete l[e]})),e=n(l),i.filter((function(t){return null!=e.props[t]&&e.props[t]!==a[t]})).length&&s(!1)}else e=r.createElement("input",o({ref:this.handleRef},a));var c={onFocus:this.onFocus,onBlur:this.onBlur};return this.maskOptions.mask&&(a.disabled||a.readOnly||(c.onChange=this.onChange,c.onPaste=this.onPaste,c.onMouseDown=this.onMouseDown),null!=a.value&&(c.value=this.value)),e=r.cloneElement(e,c)},t}(r.Component);e.exports=E},259:(e,t,n)=>{"use strict";var r=n(375),a=n(411),o=n(734)(),i=n(553),l=n(277),s=r("%Math.floor%");e.exports=function(e,t){if("function"!==typeof e)throw new l("`fn` is not a function");if("number"!==typeof t||t<0||t>4294967295||s(t)!==t)throw new l("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],r=!0,c=!0;if("length"in e&&i){var u=i(e,"length");u&&!u.configurable&&(r=!1),u&&!u.writable&&(c=!1)}return(r||c||!n)&&(o?a(e,"length",t,!0,!0):a(e,"length",t)),e}},670:(e,t,n)=>{"use strict";var r=n(375),a=n(61),o=n(141),i=n(277),l=r("%WeakMap%",!0),s=r("%Map%",!0),c=a("WeakMap.prototype.get",!0),u=a("WeakMap.prototype.set",!0),d=a("WeakMap.prototype.has",!0),h=a("Map.prototype.get",!0),m=a("Map.prototype.set",!0),p=a("Map.prototype.has",!0),f=function(e,t){for(var n,r=e;null!==(n=r.next);r=n)if(n.key===t)return r.next=n.next,n.next=e.next,e.next=n,n};e.exports=function(){var e,t,n,r={assert:function(e){if(!r.has(e))throw new i("Side channel does not contain "+o(e))},get:function(r){if(l&&r&&("object"===typeof r||"function"===typeof r)){if(e)return c(e,r)}else if(s){if(t)return h(t,r)}else if(n)return function(e,t){var n=f(e,t);return n&&n.value}(n,r)},has:function(r){if(l&&r&&("object"===typeof r||"function"===typeof r)){if(e)return d(e,r)}else if(s){if(t)return p(t,r)}else if(n)return function(e,t){return!!f(e,t)}(n,r);return!1},set:function(r,a){l&&r&&("object"===typeof r||"function"===typeof r)?(e||(e=new l),u(e,r,a)):s?(t||(t=new s),m(t,r,a)):(n||(n={key:{},next:null}),function(e,t,n){var r=f(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}}(n,r,a))}};return r}},634:()=>{},738:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function a(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,o(n)))}return e}function o(e){if("string"===typeof e||"number"===typeof e)return e;if("object"!==typeof e)return"";if(Array.isArray(e))return a.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)r.call(e,n)&&e[n]&&(t=i(t,n));return t}function i(e,t){return t?e?e+" "+t:e+t:e}e.exports?(a.default=a,e.exports=a):void 0===(n=function(){return a}.apply(t,[]))||(e.exports=n)}()}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.m=e,n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>"static/js/"+e+".bebe1265.chunk.js",n.miniCssF=e=>{},n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={},t="vmui:";n.l=(r,a,o,i)=>{if(e[r])e[r].push(a);else{var l,s;if(void 0!==o)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var d=c[u];if(d.getAttribute("src")==r||d.getAttribute("data-webpack")==t+o){l=d;break}}l||(s=!0,(l=document.createElement("script")).charset="utf-8",l.timeout=120,n.nc&&l.setAttribute("nonce",n.nc),l.setAttribute("data-webpack",t+o),l.src=r),e[r]=[a];var h=(t,n)=>{l.onerror=l.onload=null,clearTimeout(m);var a=e[r];if(delete e[r],l.parentNode&&l.parentNode.removeChild(l),a&&a.forEach((e=>e(n))),t)return t(n)},m=setTimeout(h.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=h.bind(null,l.onerror),l.onload=h.bind(null,l.onload),s&&document.head.appendChild(l)}}})(),n.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.p="./",(()=>{var e={792:0};n.f.j=(t,r)=>{var a=n.o(e,t)?e[t]:void 0;if(0!==a)if(a)r.push(a[2]);else{var o=new Promise(((n,r)=>a=e[t]=[n,r]));r.push(a[2]=o);var i=n.p+n.u(t),l=new Error;n.l(i,(r=>{if(n.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var o=r&&("load"===r.type?"missing":r.type),i=r&&r.target&&r.target.src;l.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",l.name="ChunkLoadError",l.type=o,l.request=i,a[1](l)}}),"chunk-"+t,t)}};var t=(t,r)=>{var a,o,i=r[0],l=r[1],s=r[2],c=0;if(i.some((t=>0!==e[t]))){for(a in l)n.o(l,a)&&(n.m[a]=l[a]);if(s)s(n)}for(t&&t(r);c<i.length;c++)o=i[c],n.o(e,o)&&e[o]&&e[o][0](),e[o]=0},r=self.webpackChunkvmui=self.webpackChunkvmui||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})(),(()=>{"use strict";var e={};n.r(e),n.d(e,{AlarmIcon:()=>$n,ArrowDownIcon:()=>Fn,ArrowDropDownIcon:()=>jn,CalendarIcon:()=>Vn,ChartIcon:()=>Yn,ClockIcon:()=>Hn,CloseIcon:()=>Ln,CodeIcon:()=>Kn,CopyIcon:()=>nr,DeleteIcon:()=>Qn,DoneIcon:()=>Jn,DownloadIcon:()=>_r,DragIcon:()=>rr,ErrorIcon:()=>Rn,FunctionIcon:()=>vr,InfoIcon:()=>Pn,IssueIcon:()=>ir,KeyboardIcon:()=>Un,LabelIcon:()=>gr,ListIcon:()=>hr,LogoAnomalyIcon:()=>An,LogoIcon:()=>En,LogoLogsIcon:()=>Nn,LogoShortIcon:()=>Mn,MetricIcon:()=>fr,MinusIcon:()=>Gn,MoreIcon:()=>cr,PlayCircleOutlineIcon:()=>qn,PlayIcon:()=>Bn,PlusIcon:()=>Zn,Prettify:()=>tr,QuestionIcon:()=>lr,RefreshIcon:()=>zn,RestartIcon:()=>On,SettingsIcon:()=>Tn,StarBorderIcon:()=>mr,StarIcon:()=>pr,StorageIcon:()=>sr,SuccessIcon:()=>Dn,TableIcon:()=>Wn,TimelineIcon:()=>ar,TipIcon:()=>dr,TuneIcon:()=>ur,ValueIcon:()=>yr,VisibilityIcon:()=>Xn,VisibilityOffIcon:()=>er,WarningIcon:()=>In,WikiIcon:()=>or});var t,r=n(609),a=n(159),o=n.n(a),i=n(7),l=n.n(i),s=n(648),c=n.n(s),u=n(220),d=n.n(u);function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h.apply(this,arguments)}o().extend(l()),o().extend(c()),o().extend(d()),function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(t||(t={}));const m="popstate";function p(e,t){if(!1===e||null===e||"undefined"===typeof e)throw new Error(t)}function f(e,t){if(!e){"undefined"!==typeof console&&console.warn(t);try{throw new Error(t)}catch(n){}}}function v(e,t){return{usr:e.state,key:e.key,idx:t}}function g(e,t,n,r){return void 0===n&&(n=null),h({pathname:"string"===typeof e?e:e.pathname,search:"",hash:""},"string"===typeof t?_(t):t,{state:n,key:t&&t.key||r||Math.random().toString(36).substr(2,8)})}function y(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&"?"!==n&&(t+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(t+="#"===r.charAt(0)?r:"#"+r),t}function _(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function b(e,n,r,a){void 0===a&&(a={});let{window:o=document.defaultView,v5Compat:i=!1}=a,l=o.history,s=t.Pop,c=null,u=d();function d(){return(l.state||{idx:null}).idx}function f(){s=t.Pop;let e=d(),n=null==e?null:e-u;u=e,c&&c({action:s,location:b.location,delta:n})}function _(e){let t="null"!==o.location.origin?o.location.origin:o.location.href,n="string"===typeof e?e:y(e);return n=n.replace(/ $/,"%20"),p(t,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,t)}null==u&&(u=0,l.replaceState(h({},l.state,{idx:u}),""));let b={get action(){return s},get location(){return e(o,l)},listen(e){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(m,f),c=e,()=>{o.removeEventListener(m,f),c=null}},createHref:e=>n(o,e),createURL:_,encodeLocation(e){let t=_(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,n){s=t.Push;let a=g(b.location,e,n);r&&r(a,e),u=d()+1;let h=v(a,u),m=b.createHref(a);try{l.pushState(h,"",m)}catch(p){if(p instanceof DOMException&&"DataCloneError"===p.name)throw p;o.location.assign(m)}i&&c&&c({action:s,location:b.location,delta:1})},replace:function(e,n){s=t.Replace;let a=g(b.location,e,n);r&&r(a,e),u=d();let o=v(a,u),h=b.createHref(a);l.replaceState(o,"",h),i&&c&&c({action:s,location:b.location,delta:0})},go:e=>l.go(e)};return b}var w;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(w||(w={}));new Set(["lazy","caseSensitive","path","id","index","children"]);function k(e,t,n){void 0===n&&(n="/");let r=D(("string"===typeof t?_(t):t).pathname||"/",n);if(null==r)return null;let a=x(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(a);let o=null;for(let i=0;null==o&&i<a.length;++i){let e=R(r);o=P(a[i],e)}return o}function x(e,t,n,r){void 0===t&&(t=[]),void 0===n&&(n=[]),void 0===r&&(r="");let a=(e,a,o)=>{let i={relativePath:void 0===o?e.path||"":o,caseSensitive:!0===e.caseSensitive,childrenIndex:a,route:e};i.relativePath.startsWith("/")&&(p(i.relativePath.startsWith(r),'Absolute route path "'+i.relativePath+'" nested under path "'+r+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),i.relativePath=i.relativePath.slice(r.length));let l=V([r,i.relativePath]),s=n.concat(i);e.children&&e.children.length>0&&(p(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+l+'".'),x(e.children,t,s,l)),(null!=e.path||e.index)&&t.push({path:l,score:O(l,e.index),routesMeta:s})};return e.forEach(((e,t)=>{var n;if(""!==e.path&&null!=(n=e.path)&&n.includes("?"))for(let r of S(e.path))a(e,t,r);else a(e,t)})),t}function S(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,a=n.endsWith("?"),o=n.replace(/\?$/,"");if(0===r.length)return a?[o,""]:[o];let i=S(r.join("/")),l=[];return l.push(...i.map((e=>""===e?o:[o,e].join("/")))),a&&l.push(...i),l.map((t=>e.startsWith("/")&&""===t?"/":t))}const C=/^:[\w-]+$/,E=3,N=2,A=1,M=10,T=-2,L=e=>"*"===e;function O(e,t){let n=e.split("/"),r=n.length;return n.some(L)&&(r+=T),t&&(r+=N),n.filter((e=>!L(e))).reduce(((e,t)=>e+(C.test(t)?E:""===t?A:M)),r)}function P(e,t){let{routesMeta:n}=e,r={},a="/",o=[];for(let i=0;i<n.length;++i){let e=n[i],l=i===n.length-1,s="/"===a?t:t.slice(a.length)||"/",c=I({path:e.relativePath,caseSensitive:e.caseSensitive,end:l},s);if(!c)return null;Object.assign(r,c.params);let u=e.route;o.push({params:r,pathname:V([a,c.pathname]),pathnameBase:$(V([a,c.pathnameBase])),route:u}),"/"!==c.pathnameBase&&(a=V([a,c.pathnameBase]))}return o}function I(e,t){"string"===typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=!0);f("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((e,t,n)=>(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)")));e.endsWith("*")?(r.push({paramName:"*"}),a+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":""!==e&&"/"!==e&&(a+="(?:(?=\\/|$))");let o=new RegExp(a,t?void 0:"i");return[o,r]}(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:r.reduce(((e,t,n)=>{let{paramName:r,isOptional:a}=t;if("*"===r){let e=l[n]||"";i=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const s=l[n];return e[r]=a&&!s?void 0:(s||"").replace(/%2F/g,"/"),e}),{}),pathname:o,pathnameBase:i,pattern:e}}function R(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return f(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function D(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function z(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function F(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function j(e,t){let n=F(e);return t?n.map(((t,n)=>n===e.length-1?t.pathname:t.pathnameBase)):n.map((e=>e.pathnameBase))}function H(e,t,n,r){let a;void 0===r&&(r=!1),"string"===typeof e?a=_(e):(a=h({},e),p(!a.pathname||!a.pathname.includes("?"),z("?","pathname","search",a)),p(!a.pathname||!a.pathname.includes("#"),z("#","pathname","hash",a)),p(!a.search||!a.search.includes("#"),z("#","search","hash",a)));let o,i=""===e||""===a.pathname,l=i?"/":a.pathname;if(null==l)o=n;else{let e=t.length-1;if(!r&&l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}o=e>=0?t[e]:"/"}let s=function(e,t){void 0===t&&(t="/");let{pathname:n,search:r="",hash:a=""}="string"===typeof e?_(e):e,o=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:o,search:U(r),hash:B(a)}}(a,o),c=l&&"/"!==l&&l.endsWith("/"),u=(i||"."===l)&&n.endsWith("/");return s.pathname.endsWith("/")||!c&&!u||(s.pathname+="/"),s}const V=e=>e.join("/").replace(/\/\/+/g,"/"),$=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),U=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",B=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";Error;function q(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"boolean"===typeof e.internal&&"data"in e}const Y=["post","put","patch","delete"],W=(new Set(Y),["get",...Y]);new Set(W),new Set([301,302,303,307,308]),new Set([307,308]);Symbol("deferred");function K(){return K=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},K.apply(this,arguments)}const Q=r.createContext(null);const Z=r.createContext(null);const G=r.createContext(null);const J=r.createContext(null);const X=r.createContext({outlet:null,matches:[],isDataRoute:!1});const ee=r.createContext(null);function te(){return null!=r.useContext(J)}function ne(){return te()||p(!1),r.useContext(J).location}function re(e){r.useContext(G).static||r.useLayoutEffect(e)}function ae(){let{isDataRoute:e}=r.useContext(X);return e?function(){let{router:e}=fe(me.UseNavigateStable),t=ge(pe.UseNavigateStable),n=r.useRef(!1);re((()=>{n.current=!0}));let a=r.useCallback((function(r,a){void 0===a&&(a={}),n.current&&("number"===typeof r?e.navigate(r):e.navigate(r,K({fromRouteId:t},a)))}),[e,t]);return a}():function(){te()||p(!1);let e=r.useContext(Q),{basename:t,future:n,navigator:a}=r.useContext(G),{matches:o}=r.useContext(X),{pathname:i}=ne(),l=JSON.stringify(j(o,n.v7_relativeSplatPath)),s=r.useRef(!1);re((()=>{s.current=!0}));let c=r.useCallback((function(n,r){if(void 0===r&&(r={}),!s.current)return;if("number"===typeof n)return void a.go(n);let o=H(n,JSON.parse(l),i,"path"===r.relative);null==e&&"/"!==t&&(o.pathname="/"===o.pathname?t:V([t,o.pathname])),(r.replace?a.replace:a.push)(o,r.state,r)}),[t,a,l,i,e]);return c}()}const oe=r.createContext(null);function ie(e,t){let{relative:n}=void 0===t?{}:t,{future:a}=r.useContext(G),{matches:o}=r.useContext(X),{pathname:i}=ne(),l=JSON.stringify(j(o,a.v7_relativeSplatPath));return r.useMemo((()=>H(e,JSON.parse(l),i,"path"===n)),[e,l,i,n])}function le(e,n,a,o){te()||p(!1);let{navigator:i}=r.useContext(G),{matches:l}=r.useContext(X),s=l[l.length-1],c=s?s.params:{},u=(s&&s.pathname,s?s.pathnameBase:"/");s&&s.route;let d,h=ne();if(n){var m;let e="string"===typeof n?_(n):n;"/"===u||(null==(m=e.pathname)?void 0:m.startsWith(u))||p(!1),d=e}else d=h;let f=d.pathname||"/",v=f;if("/"!==u){let e=u.replace(/^\//,"").split("/");v="/"+f.replace(/^\//,"").split("/").slice(e.length).join("/")}let g=k(e,{pathname:v});let y=he(g&&g.map((e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:V([u,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?u:V([u,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),l,a,o);return n&&y?r.createElement(J.Provider,{value:{location:K({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:t.Pop}},y):y}function se(){let e=function(){var e;let t=r.useContext(ee),n=ve(pe.UseRouteError),a=ge(pe.UseRouteError);if(void 0!==t)return t;return null==(e=n.errors)?void 0:e[a]}(),t=q(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:a};return r.createElement(r.Fragment,null,r.createElement("h2",null,"Unexpected Application Error!"),r.createElement("h3",{style:{fontStyle:"italic"}},t),n?r.createElement("pre",{style:o},n):null,null)}const ce=r.createElement(se,null);class ue extends r.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?r.createElement(X.Provider,{value:this.props.routeContext},r.createElement(ee.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function de(e){let{routeContext:t,match:n,children:a}=e,o=r.useContext(Q);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),r.createElement(X.Provider,{value:t},a)}function he(e,t,n,a){var o;if(void 0===t&&(t=[]),void 0===n&&(n=null),void 0===a&&(a=null),null==e){var i;if(null==(i=n)||!i.errors)return null;e=n.matches}let l=e,s=null==(o=n)?void 0:o.errors;if(null!=s){let e=l.findIndex((e=>e.route.id&&(null==s?void 0:s[e.route.id])));e>=0||p(!1),l=l.slice(0,Math.min(l.length,e+1))}let c=!1,u=-1;if(n&&a&&a.v7_partialHydration)for(let r=0;r<l.length;r++){let e=l[r];if((e.route.HydrateFallback||e.route.hydrateFallbackElement)&&(u=r),e.route.id){let{loaderData:t,errors:r}=n,a=e.route.loader&&void 0===t[e.route.id]&&(!r||void 0===r[e.route.id]);if(e.route.lazy||a){c=!0,l=u>=0?l.slice(0,u+1):[l[0]];break}}}return l.reduceRight(((e,a,o)=>{let i,d=!1,h=null,m=null;var p;n&&(i=s&&a.route.id?s[a.route.id]:void 0,h=a.route.errorElement||ce,c&&(u<0&&0===o?(p="route-fallback",!1||ye[p]||(ye[p]=!0),d=!0,m=null):u===o&&(d=!0,m=a.route.hydrateFallbackElement||null)));let f=t.concat(l.slice(0,o+1)),v=()=>{let t;return t=i?h:d?m:a.route.Component?r.createElement(a.route.Component,null):a.route.element?a.route.element:e,r.createElement(de,{match:a,routeContext:{outlet:e,matches:f,isDataRoute:null!=n},children:t})};return n&&(a.route.ErrorBoundary||a.route.errorElement||0===o)?r.createElement(ue,{location:n.location,revalidation:n.revalidation,component:h,error:i,children:v(),routeContext:{outlet:null,matches:f,isDataRoute:!0}}):v()}),null)}var me=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(me||{}),pe=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(pe||{});function fe(e){let t=r.useContext(Q);return t||p(!1),t}function ve(e){let t=r.useContext(Z);return t||p(!1),t}function ge(e){let t=function(e){let t=r.useContext(X);return t||p(!1),t}(),n=t.matches[t.matches.length-1];return n.route.id||p(!1),n.route.id}const ye={};r.startTransition;function _e(e){return function(e){let t=r.useContext(X).outlet;return t?r.createElement(oe.Provider,{value:e},t):t}(e.context)}function be(e){p(!1)}function we(e){let{basename:n="/",children:a=null,location:o,navigationType:i=t.Pop,navigator:l,static:s=!1,future:c}=e;te()&&p(!1);let u=n.replace(/^\/*/,"/"),d=r.useMemo((()=>({basename:u,navigator:l,static:s,future:K({v7_relativeSplatPath:!1},c)})),[u,c,l,s]);"string"===typeof o&&(o=_(o));let{pathname:h="/",search:m="",hash:f="",state:v=null,key:g="default"}=o,y=r.useMemo((()=>{let e=D(h,u);return null==e?null:{location:{pathname:e,search:m,hash:f,state:v,key:g},navigationType:i}}),[u,h,m,f,v,g,i]);return null==y?null:r.createElement(G.Provider,{value:d},r.createElement(J.Provider,{children:a,value:y}))}function ke(e){let{children:t,location:n}=e;return le(xe(t),n)}new Promise((()=>{}));r.Component;function xe(e,t){void 0===t&&(t=[]);let n=[];return r.Children.forEach(e,((e,a)=>{if(!r.isValidElement(e))return;let o=[...t,a];if(e.type===r.Fragment)return void n.push.apply(n,xe(e.props.children,o));e.type!==be&&p(!1),e.props.index&&e.props.children&&p(!1);let i={id:e.props.id||o.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(i.children=xe(e.props.children,o)),n.push(i)})),n}function Se(){return Se=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Se.apply(this,arguments)}function Ce(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}function Ee(e){return void 0===e&&(e=""),new URLSearchParams("string"===typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce(((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map((e=>[n,e])):[[n,r]])}),[]))}new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const Ne=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],Ae=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"];try{window.__reactRouterVersion="6"}catch(Ap){}const Me=r.createContext({isTransitioning:!1});new Map;const Te=r.startTransition;r.flushSync,r.useId;function Le(e){let{basename:t,children:n,future:a,window:o}=e,i=r.useRef();null==i.current&&(i.current=function(e){return void 0===e&&(e={}),b((function(e,t){let{pathname:n="/",search:r="",hash:a=""}=_(e.location.hash.substr(1));return n.startsWith("/")||n.startsWith(".")||(n="/"+n),g("",{pathname:n,search:r,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let n=e.document.querySelector("base"),r="";if(n&&n.getAttribute("href")){let t=e.location.href,n=t.indexOf("#");r=-1===n?t:t.slice(0,n)}return r+"#"+("string"===typeof t?t:y(t))}),(function(e,t){f("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),e)}({window:o,v5Compat:!0}));let l=i.current,[s,c]=r.useState({action:l.action,location:l.location}),{v7_startTransition:u}=a||{},d=r.useCallback((e=>{u&&Te?Te((()=>c(e))):c(e)}),[c,u]);return r.useLayoutEffect((()=>l.listen(d)),[l,d]),r.createElement(we,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:l,future:a})}const Oe="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement,Pe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ie=r.forwardRef((function(e,t){let n,{onClick:a,relative:o,reloadDocument:i,replace:l,state:s,target:c,to:u,preventScrollReset:d,unstable_viewTransition:h}=e,m=Ce(e,Ne),{basename:f}=r.useContext(G),v=!1;if("string"===typeof u&&Pe.test(u)&&(n=u,Oe))try{let e=new URL(window.location.href),t=u.startsWith("//")?new URL(e.protocol+u):new URL(u),n=D(t.pathname,f);t.origin===e.origin&&null!=n?u=n+t.search+t.hash:v=!0}catch(Ap){}let g=function(e,t){let{relative:n}=void 0===t?{}:t;te()||p(!1);let{basename:a,navigator:o}=r.useContext(G),{hash:i,pathname:l,search:s}=ie(e,{relative:n}),c=l;return"/"!==a&&(c="/"===l?a:V([a,l])),o.createHref({pathname:c,search:s,hash:i})}(u,{relative:o}),_=function(e,t){let{target:n,replace:a,state:o,preventScrollReset:i,relative:l,unstable_viewTransition:s}=void 0===t?{}:t,c=ae(),u=ne(),d=ie(e,{relative:l});return r.useCallback((t=>{if(function(e,t){return 0===e.button&&(!t||"_self"===t)&&!function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)}(t,n)){t.preventDefault();let n=void 0!==a?a:y(u)===y(d);c(e,{replace:n,state:o,preventScrollReset:i,relative:l,unstable_viewTransition:s})}}),[u,c,d,a,o,n,e,i,l,s])}(u,{replace:l,state:s,target:c,preventScrollReset:d,relative:o,unstable_viewTransition:h});return r.createElement("a",Se({},m,{href:n||g,onClick:v||i?a:function(e){a&&a(e),e.defaultPrevented||_(e)},ref:t,target:c}))}));const Re=r.forwardRef((function(e,t){let{"aria-current":n="page",caseSensitive:a=!1,className:o="",end:i=!1,style:l,to:s,unstable_viewTransition:c,children:u}=e,d=Ce(e,Ae),h=ie(s,{relative:d.relative}),m=ne(),f=r.useContext(Z),{navigator:v,basename:g}=r.useContext(G),y=null!=f&&function(e,t){void 0===t&&(t={});let n=r.useContext(Me);null==n&&p(!1);let{basename:a}=Fe(De.useViewTransitionState),o=ie(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=D(n.currentLocation.pathname,a)||n.currentLocation.pathname,l=D(n.nextLocation.pathname,a)||n.nextLocation.pathname;return null!=I(o.pathname,l)||null!=I(o.pathname,i)}(h)&&!0===c,_=v.encodeLocation?v.encodeLocation(h).pathname:h.pathname,b=m.pathname,w=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;a||(b=b.toLowerCase(),w=w?w.toLowerCase():null,_=_.toLowerCase()),w&&g&&(w=D(w,g)||w);const k="/"!==_&&_.endsWith("/")?_.length-1:_.length;let x,S=b===_||!i&&b.startsWith(_)&&"/"===b.charAt(k),C=null!=w&&(w===_||!i&&w.startsWith(_)&&"/"===w.charAt(_.length)),E={isActive:S,isPending:C,isTransitioning:y},N=S?n:void 0;x="function"===typeof o?o(E):[o,S?"active":null,C?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let A="function"===typeof l?l(E):l;return r.createElement(Ie,Se({},d,{"aria-current":N,className:x,ref:t,style:A,to:s,unstable_viewTransition:c}),"function"===typeof u?u(E):u)}));var De,ze;function Fe(e){let t=r.useContext(Q);return t||p(!1),t}function je(e){let t=r.useRef(Ee(e)),n=r.useRef(!1),a=ne(),o=r.useMemo((()=>function(e,t){let n=Ee(e);return t&&t.forEach(((e,r)=>{n.has(r)||t.getAll(r).forEach((e=>{n.append(r,e)}))})),n}(a.search,n.current?null:t.current)),[a.search]),i=ae(),l=r.useCallback(((e,t)=>{const r=Ee("function"===typeof e?e(o):e);n.current=!0,i("?"+r,t)}),[i,o]);return[o,l]}(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(De||(De={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(ze||(ze={}));let He=function(e){return e.logs="logs",e.anomaly="anomaly",e}({});const Ve={home:"/",metrics:"/metrics",dashboards:"/dashboards",cardinality:"/cardinality",topQueries:"/top-queries",trace:"/trace",withTemplate:"/expand-with-exprs",relabel:"/relabeling",logs:"/logs",activeQueries:"/active-queries",queryAnalyzer:"/query-analyzer",icons:"/icons",anomaly:"/anomaly",query:"/query"},{REACT_APP_TYPE:$e}={},Ue=$e===He.logs,Be={header:{tenant:!0,stepControl:!Ue,timeSelector:!Ue,executionControls:!Ue}},qe={[Ve.home]:{title:"Query",...Be},[Ve.metrics]:{title:"Explore Prometheus metrics",header:{tenant:!0,stepControl:!0,timeSelector:!0}},[Ve.cardinality]:{title:"Explore cardinality",header:{tenant:!0,cardinalityDatePicker:!0}},[Ve.topQueries]:{title:"Top queries",header:{tenant:!0}},[Ve.trace]:{title:"Trace analyzer",header:{}},[Ve.queryAnalyzer]:{title:"Query analyzer",header:{}},[Ve.dashboards]:{title:"Dashboards",...Be},[Ve.withTemplate]:{title:"WITH templates",header:{}},[Ve.relabel]:{title:"Metric relabel debug",header:{}},[Ve.logs]:{title:"Logs Explorer",header:{}},[Ve.activeQueries]:{title:"Active Queries",header:{}},[Ve.icons]:{title:"Icons",header:{}},[Ve.anomaly]:{title:"Anomaly exploration",...Be},[Ve.query]:{title:"Query",...Be}},Ye=Ve,We=()=>{var e;const t=(null===(e=document.getElementById("root"))||void 0===e?void 0:e.dataset.params)||"{}";try{return JSON.parse(t)}catch(Ap){return console.error(Ap),{}}},Ke=()=>!!Object.keys(We()).length,Qe=/(\/select\/)(\d+|\d.+)(\/)(.+)/,Ze=(e,t)=>e.replace(Qe,"$1".concat(t,"/$4")),Ge=e=>{var t;return(null===(t=e.match(Qe))||void 0===t?void 0:t[2])||""},Je=(e,t)=>{t?window.localStorage.setItem(e,JSON.stringify({value:t})):et([e]),window.dispatchEvent(new Event("storage"))},Xe=e=>{const t=window.localStorage.getItem(e);if(null!==t)try{var n;return null===(n=JSON.parse(t))||void 0===n?void 0:n.value}catch(Ap){return t}},et=e=>e.forEach((e=>window.localStorage.removeItem(e))),{REACT_APP_TYPE:tt}={};var nt=n(215),rt=n.n(nt),at=n(424),ot=n.n(at);const it={table:100,chart:20,code:1e3},lt=[{id:"small",isDefault:!0,height:()=>.2*window.innerHeight},{id:"medium",height:()=>.4*window.innerHeight},{id:"large",height:()=>.8*window.innerHeight}],st=["min","median","max"],ct=(e,t)=>{const n=window.location.hash.split("?")[1],r=rt().parse(n,{ignoreQueryPrefix:!0});return ot()(r,e,t||"")},ut=()=>{var e;const t=(null===(e=(window.location.hash.split("?")[1]||"").match(/g\d+\.expr/g))||void 0===e?void 0:e.length)||1;return new Array(t>4?4:t).fill(1).map(((e,t)=>ct("g".concat(t,".expr"),"")))};let dt=function(e){return e.yhat="yhat",e.yhatUpper="yhat_upper",e.yhatLower="yhat_lower",e.anomaly="vmui_anomalies_points",e.training="vmui_training_data",e.actual="actual",e.anomalyScore="anomaly_score",e}({}),ht=function(e){return e.table="table",e.chart="chart",e.code="code",e}({}),mt=function(e){return e.emptyServer="Please enter Server URL",e.validServer="Please provide a valid Server URL",e.validQuery="Please enter a valid Query and execute it",e.traceNotFound="Not found the tracing information",e.emptyTitle="Please enter title",e.positiveNumber="Please enter positive number",e.validStep="Please enter a valid step",e.unknownType="Unknown server response format: must have 'errorType'",e}({}),pt=function(e){return e.system="system",e.light="light",e.dark="dark",e}({}),ft=function(e){return e.empty="empty",e.metricsql="metricsql",e.label="label",e.labelValue="labelValue",e}({});const vt=e=>getComputedStyle(document.documentElement).getPropertyValue("--".concat(e)),gt=(e,t)=>{document.documentElement.style.setProperty("--".concat(e),t)},yt=()=>window.matchMedia("(prefers-color-scheme: dark)").matches,_t=e=>{let t;try{t=new URL(e)}catch(n){return!1}return"http:"===t.protocol||"https:"===t.protocol},bt=e=>e.replace(/\/$/,""),wt=ct("g0.tenantID",""),kt={serverUrl:bt((e=>{const{serverURL:t}=We(),n=Xe("SERVER_URL"),r=window.location.href.replace(/\/(select\/)?(vmui)\/.*/,""),a="".concat(window.location.origin).concat(window.location.pathname),o=window.location.href.replace(/\/(?:prometheus\/)?(?:graph|vmui)\/.*/,"/prometheus"),i=t||n||o;switch(tt){case He.logs:return r;case He.anomaly:return n||a;default:return e?Ze(i,e):i}})(wt)),tenantId:wt,theme:Xe("THEME")||pt.system,isDarkTheme:null};function xt(e,t){switch(t.type){case"SET_SERVER":return{...e,serverUrl:bt(t.payload)};case"SET_TENANT_ID":return{...e,tenantId:t.payload};case"SET_THEME":return Je("THEME",t.payload),{...e,theme:t.payload};case"SET_DARK_THEME":return{...e,isDarkTheme:(n=e.theme,n===pt.system&&yt()||n===pt.dark)};default:throw new Error}var n}var St=n(746);var Ct=0;Array.isArray;function Et(e,t,n,r,a,o){var i,l,s={};for(l in t)"ref"==l?i=t[l]:s[l]=t[l];var c={type:e,props:s,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Ct,__i:-1,__u:0,__source:a,__self:o};if("function"==typeof e&&(i=e.defaultProps))for(l in i)void 0===s[l]&&(s[l]=i[l]);return St.fF.vnode&&St.fF.vnode(c),c}const Nt=(0,r.createContext)({}),At=()=>(0,r.useContext)(Nt).state,Mt=()=>(0,r.useContext)(Nt).dispatch,Tt=Object.entries(kt).reduce(((e,t)=>{let[n,r]=t;return{...e,[n]:ct(n)||r}}),{}),Lt="YYYY-MM-DD",Ot="YYYY-MM-DD HH:mm:ss",Pt="YYYY-MM-DD HH:mm:ss:SSS (Z)",It="YYYY-MM-DD[T]HH:mm:ss",Rt="YYYY-MM-DD_HHmmss",Dt=window.innerWidth/4,zt=window.innerWidth/40,Ft=1,jt=1578e8,Ht=Intl.supportedValuesOf,Vt=Ht?Ht("timeZone"):["Africa/Abidjan","Africa/Accra","Africa/Addis_Ababa","Africa/Algiers","Africa/Asmera","Africa/Bamako","Africa/Bangui","Africa/Banjul","Africa/Bissau","Africa/Blantyre","Africa/Brazzaville","Africa/Bujumbura","Africa/Cairo","Africa/Casablanca","Africa/Ceuta","Africa/Conakry","Africa/Dakar","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Douala","Africa/El_Aaiun","Africa/Freetown","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Kigali","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Lome","Africa/Luanda","Africa/Lubumbashi","Africa/Lusaka","Africa/Malabo","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Africa/Mogadishu","Africa/Monrovia","Africa/Nairobi","Africa/Ndjamena","Africa/Niamey","Africa/Nouakchott","Africa/Ouagadougou","Africa/Porto-Novo","Africa/Sao_Tome","Africa/Tripoli","Africa/Tunis","Africa/Windhoek","America/Adak","America/Anchorage","America/Anguilla","America/Antigua","America/Araguaina","America/Argentina/La_Rioja","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Aruba","America/Asuncion","America/Bahia","America/Bahia_Banderas","America/Barbados","America/Belem","America/Belize","America/Blanc-Sablon","America/Boa_Vista","America/Bogota","America/Boise","America/Buenos_Aires","America/Cambridge_Bay","America/Campo_Grande","America/Cancun","America/Caracas","America/Catamarca","America/Cayenne","America/Cayman","America/Chicago","America/Chihuahua","America/Coral_Harbour","America/Cordoba","America/Costa_Rica","America/Creston","America/Cuiaba","America/Curacao","America/Danmarkshavn","America/Dawson","America/Dawson_Creek","America/Denver","America/Detroit","America/Dominica","America/Edmonton","America/Eirunepe","America/El_Salvador","America/Fort_Nelson","America/Fortaleza","America/Glace_Bay","America/Godthab","America/Goose_Bay","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guatemala","America/Guayaquil","America/Guyana","America/Halifax","America/Havana","America/Hermosillo","America/Indiana/Knox","America/Indiana/Marengo","America/Indiana/Petersburg","America/Indiana/Tell_City","America/Indiana/Vevay","America/Indiana/Vincennes","America/Indiana/Winamac","America/Indianapolis","America/Inuvik","America/Iqaluit","America/Jamaica","America/Jujuy","America/Juneau","America/Kentucky/Monticello","America/Kralendijk","America/La_Paz","America/Lima","America/Los_Angeles","America/Louisville","America/Lower_Princes","America/Maceio","America/Managua","America/Manaus","America/Marigot","America/Martinique","America/Matamoros","America/Mazatlan","America/Mendoza","America/Menominee","America/Merida","America/Metlakatla","America/Mexico_City","America/Miquelon","America/Moncton","America/Monterrey","America/Montevideo","America/Montreal","America/Montserrat","America/Nassau","America/New_York","America/Nipigon","America/Nome","America/Noronha","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Ojinaga","America/Panama","America/Pangnirtung","America/Paramaribo","America/Phoenix","America/Port-au-Prince","America/Port_of_Spain","America/Porto_Velho","America/Puerto_Rico","America/Punta_Arenas","America/Rainy_River","America/Rankin_Inlet","America/Recife","America/Regina","America/Resolute","America/Rio_Branco","America/Santa_Isabel","America/Santarem","America/Santiago","America/Santo_Domingo","America/Sao_Paulo","America/Scoresbysund","America/Sitka","America/St_Barthelemy","America/St_Johns","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Swift_Current","America/Tegucigalpa","America/Thule","America/Thunder_Bay","America/Tijuana","America/Toronto","America/Tortola","America/Vancouver","America/Whitehorse","America/Winnipeg","America/Yakutat","America/Yellowknife","Antarctica/Casey","Antarctica/Davis","Antarctica/DumontDUrville","Antarctica/Macquarie","Antarctica/Mawson","Antarctica/McMurdo","Antarctica/Palmer","Antarctica/Rothera","Antarctica/Syowa","Antarctica/Troll","Antarctica/Vostok","Arctic/Longyearbyen","Asia/Aden","Asia/Almaty","Asia/Amman","Asia/Anadyr","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Atyrau","Asia/Baghdad","Asia/Bahrain","Asia/Baku","Asia/Bangkok","Asia/Barnaul","Asia/Beirut","Asia/Bishkek","Asia/Brunei","Asia/Calcutta","Asia/Chita","Asia/Choibalsan","Asia/Colombo","Asia/Damascus","Asia/Dhaka","Asia/Dili","Asia/Dubai","Asia/Dushanbe","Asia/Famagusta","Asia/Gaza","Asia/Hebron","Asia/Hong_Kong","Asia/Hovd","Asia/Irkutsk","Asia/Jakarta","Asia/Jayapura","Asia/Jerusalem","Asia/Kabul","Asia/Kamchatka","Asia/Karachi","Asia/Katmandu","Asia/Khandyga","Asia/Krasnoyarsk","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Kuwait","Asia/Macau","Asia/Magadan","Asia/Makassar","Asia/Manila","Asia/Muscat","Asia/Nicosia","Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk","Asia/Oral","Asia/Phnom_Penh","Asia/Pontianak","Asia/Pyongyang","Asia/Qatar","Asia/Qostanay","Asia/Qyzylorda","Asia/Rangoon","Asia/Riyadh","Asia/Saigon","Asia/Sakhalin","Asia/Samarkand","Asia/Seoul","Asia/Shanghai","Asia/Singapore","Asia/Srednekolymsk","Asia/Taipei","Asia/Tashkent","Asia/Tbilisi","Asia/Tehran","Asia/Thimphu","Asia/Tokyo","Asia/Tomsk","Asia/Ulaanbaatar","Asia/Urumqi","Asia/Ust-Nera","Asia/Vientiane","Asia/Vladivostok","Asia/Yakutsk","Asia/Yekaterinburg","Asia/Yerevan","Atlantic/Azores","Atlantic/Bermuda","Atlantic/Canary","Atlantic/Cape_Verde","Atlantic/Faeroe","Atlantic/Madeira","Atlantic/Reykjavik","Atlantic/South_Georgia","Atlantic/St_Helena","Atlantic/Stanley","Australia/Adelaide","Australia/Brisbane","Australia/Broken_Hill","Australia/Currie","Australia/Darwin","Australia/Eucla","Australia/Hobart","Australia/Lindeman","Australia/Lord_Howe","Australia/Melbourne","Australia/Perth","Australia/Sydney","Europe/Amsterdam","Europe/Andorra","Europe/Astrakhan","Europe/Athens","Europe/Belgrade","Europe/Berlin","Europe/Bratislava","Europe/Brussels","Europe/Bucharest","Europe/Budapest","Europe/Busingen","Europe/Chisinau","Europe/Copenhagen","Europe/Dublin","Europe/Gibraltar","Europe/Guernsey","Europe/Helsinki","Europe/Isle_of_Man","Europe/Istanbul","Europe/Jersey","Europe/Kaliningrad","Europe/Kiev","Europe/Kirov","Europe/Lisbon","Europe/Ljubljana","Europe/London","Europe/Luxembourg","Europe/Madrid","Europe/Malta","Europe/Mariehamn","Europe/Minsk","Europe/Monaco","Europe/Moscow","Europe/Oslo","Europe/Paris","Europe/Podgorica","Europe/Prague","Europe/Riga","Europe/Rome","Europe/Samara","Europe/San_Marino","Europe/Sarajevo","Europe/Saratov","Europe/Simferopol","Europe/Skopje","Europe/Sofia","Europe/Stockholm","Europe/Tallinn","Europe/Tirane","Europe/Ulyanovsk","Europe/Uzhgorod","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Vilnius","Europe/Volgograd","Europe/Warsaw","Europe/Zagreb","Europe/Zaporozhye","Europe/Zurich","Indian/Antananarivo","Indian/Chagos","Indian/Christmas","Indian/Cocos","Indian/Comoro","Indian/Kerguelen","Indian/Mahe","Indian/Maldives","Indian/Mauritius","Indian/Mayotte","Indian/Reunion","Pacific/Apia","Pacific/Auckland","Pacific/Bougainville","Pacific/Chatham","Pacific/Easter","Pacific/Efate","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Fiji","Pacific/Funafuti","Pacific/Galapagos","Pacific/Gambier","Pacific/Guadalcanal","Pacific/Guam","Pacific/Honolulu","Pacific/Johnston","Pacific/Kiritimati","Pacific/Kosrae","Pacific/Kwajalein","Pacific/Majuro","Pacific/Marquesas","Pacific/Midway","Pacific/Nauru","Pacific/Niue","Pacific/Norfolk","Pacific/Noumea","Pacific/Pago_Pago","Pacific/Palau","Pacific/Pitcairn","Pacific/Ponape","Pacific/Port_Moresby","Pacific/Rarotonga","Pacific/Saipan","Pacific/Tahiti","Pacific/Tarawa","Pacific/Tongatapu","Pacific/Truk","Pacific/Wake","Pacific/Wallis"],$t=[{long:"years",short:"y",possible:"year"},{long:"weeks",short:"w",possible:"week"},{long:"days",short:"d",possible:"day"},{long:"hours",short:"h",possible:"hour"},{long:"minutes",short:"m",possible:"min"},{long:"seconds",short:"s",possible:"sec"},{long:"milliseconds",short:"ms",possible:"millisecond"}],Ut=$t.map((e=>e.short)),Bt=e=>Math.round(1e3*e)/1e3,qt=e=>Xt(o().duration(e,"seconds").asMilliseconds()),Yt=e=>{let t=Bt(e);const n=Math.round(e);e>=100&&(t=n-n%10),e<100&&e>=10&&(t=n-n%5),e<10&&e>=1&&(t=n),e<1&&e>.01&&(t=Math.round(40*e)/40);return qt(t||.001).replace(/\s/g,"")},Wt=e=>{const t=e.match(/\d+/g),n=e.match(/[a-zA-Z]+/g);if(n&&t&&Ut.includes(n[0]))return{[n[0]]:t[0]}},Kt=e=>{const t=$t.map((e=>e.short)).join("|"),n=new RegExp("\\d+(\\.\\d+)?[".concat(t,"]+"),"g"),r=(e.match(n)||[]).reduce(((e,t)=>{const n=Wt(t);return n?{...e,...n}:{...e}}),{});return o().duration(r).asSeconds()},Qt=(e,t)=>Yt(e/(t?zt:Dt)),Zt=(e,t)=>{const n=(t||o()().toDate()).valueOf()/1e3,r=Kt(e);return{start:n-r,end:n,step:Qt(r),date:Gt(t||o()().toDate())}},Gt=e=>o().tz(e).utc().format(It),Jt=e=>o().tz(e).format(It),Xt=e=>{const t=Math.floor(e%1e3),n=Math.floor(e/1e3%60),r=Math.floor(e/1e3/60%60),a=Math.floor(e/1e3/3600%24),o=Math.floor(e/864e5),i=["d","h","m","s","ms"],l=[o,a,r,n,t].map(((e,t)=>e?"".concat(e).concat(i[t]):""));return l.filter((e=>e)).join("")},en=e=>{const t=o()(1e3*e);return t.isValid()?t.toDate():new Date},tn={NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!1}.REACT_APP_TYPE===He.logs,nn=[{title:"Last 5 minutes",duration:"5m",isDefault:tn},{title:"Last 15 minutes",duration:"15m"},{title:"Last 30 minutes",duration:"30m",isDefault:!tn},{title:"Last 1 hour",duration:"1h"},{title:"Last 3 hours",duration:"3h"},{title:"Last 6 hours",duration:"6h"},{title:"Last 12 hours",duration:"12h"},{title:"Last 24 hours",duration:"24h"},{title:"Last 2 days",duration:"2d"},{title:"Last 7 days",duration:"7d"},{title:"Last 30 days",duration:"30d"},{title:"Last 90 days",duration:"90d"},{title:"Last 180 days",duration:"180d"},{title:"Last 1 year",duration:"1y"},{title:"Yesterday",duration:"1d",until:()=>o()().tz().subtract(1,"day").endOf("day").toDate()},{title:"Today",duration:"1d",until:()=>o()().tz().endOf("day").toDate()}].map((e=>({id:e.title.replace(/\s/g,"_").toLocaleLowerCase(),until:e.until?e.until:()=>o()().tz().toDate(),...e}))),rn=e=>{var t;let{relativeTimeId:n,defaultDuration:r,defaultEndInput:a}=e;const o=null===(t=nn.find((e=>e.isDefault)))||void 0===t?void 0:t.id,i=n||ct("g0.relative_time",o),l=nn.find((e=>e.id===i));return{relativeTimeId:l?i:"none",duration:l?l.duration:r,endInput:l?l.until():a}},an=e=>{const t=o()().tz(e);return"UTC".concat(t.format("Z"))},on=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const t=new RegExp(e,"i");return Vt.reduce(((n,r)=>{const a=(r.match(/^(.*?)\//)||[])[1]||"unknown",o=an(r),i=o.replace(/UTC|0/,""),l=r.replace(/[/_]/g," "),s={region:r,utc:o,search:"".concat(r," ").concat(o," ").concat(l," ").concat(i)},c=!e||e&&t.test(s.search);return c&&n[a]?n[a].push(s):c&&(n[a]=[s]),n}),{})},ln=e=>{o().tz.setDefault(e)},sn=()=>{const e=o().tz.guess(),t=(e=>{try{return o()().tz(e),!0}catch(Ap){return!1}})(e);return{isValid:t,title:t?"Browser Time (".concat(e,")"):"Browser timezone (UTC)",region:t?e:"UTC"}},cn=Xe("TIMEZONE")||sn().region;ln(cn);const un=()=>{const e=ct("g0.range_input"),{duration:t,endInput:n,relativeTimeId:r}=rn({defaultDuration:e||"1h",defaultEndInput:(a=ct("g0.end_input",o()().utc().format(It)),o()(a).utcOffset(0,!0).toDate()),relativeTimeId:e?ct("g0.relative_time","none"):void 0});var a;return{duration:t,period:Zt(t,n),relativeTime:r}},dn={...un(),timezone:cn};function hn(e,t){switch(t.type){case"SET_TIME_STATE":return{...e,...t.payload};case"SET_DURATION":return{...e,duration:t.payload,period:Zt(t.payload,en(e.period.end)),relativeTime:"none"};case"SET_RELATIVE_TIME":return{...e,duration:t.payload.duration,period:Zt(t.payload.duration,t.payload.until),relativeTime:t.payload.id};case"SET_PERIOD":const n=(e=>{const t=e.to.valueOf()-e.from.valueOf();return Xt(t)})(t.payload);return{...e,duration:n,period:Zt(n,t.payload.to),relativeTime:"none"};case"RUN_QUERY":const{duration:r,endInput:a}=rn({relativeTimeId:e.relativeTime,defaultDuration:e.duration,defaultEndInput:en(e.period.end)});return{...e,period:Zt(r,a)};case"RUN_QUERY_TO_NOW":return{...e,period:Zt(e.duration)};case"SET_TIMEZONE":return ln(t.payload),Je("TIMEZONE",t.payload),e.defaultTimezone&&Je("DISABLED_DEFAULT_TIMEZONE",t.payload!==e.defaultTimezone),{...e,timezone:t.payload};case"SET_DEFAULT_TIMEZONE":return{...e,defaultTimezone:t.payload};default:throw new Error}}const mn=(0,r.createContext)({}),pn=()=>(0,r.useContext)(mn).state,fn=()=>(0,r.useContext)(mn).dispatch,vn=e=>{const t=Xe(e);return t?JSON.parse(t):[]},gn=50,yn=1e3,_n=1e3;const bn=ut(),wn={query:bn,queryHistory:bn.map((e=>({index:0,values:[e]}))),autocomplete:Xe("AUTOCOMPLETE")||!1,autocompleteQuick:!1,autocompleteCache:new class{constructor(){this.maxSize=void 0,this.map=void 0,this.maxSize=_n,this.map=new Map}get(e){for(const[t,n]of this.map){const r=JSON.parse(t),a=r.start===e.start&&r.end===e.end,o=r.type===e.type,i=e.value&&r.value&&e.value.includes(r.value),l=r.match===e.match||i,s=n.length<yn;if(l&&a&&o&&s)return n}return this.map.get(JSON.stringify(e))}put(e,t){if(this.map.size>=this.maxSize){const e=this.map.keys().next().value;this.map.delete(e)}this.map.set(JSON.stringify(e),t)}},metricsQLFunctions:[]};function kn(e,t){switch(t.type){case"SET_QUERY":return{...e,query:t.payload.map((e=>e))};case"SET_QUERY_HISTORY":return(e=>{const t=e.map((e=>e.values[e.index])),n=vn("QUERY_HISTORY");n[0]||(n[0]=[]);const r=n[0];t.forEach((e=>{!r.includes(e)&&e&&r.unshift(e),r.length>100&&r.shift()})),Je("QUERY_HISTORY",JSON.stringify(n))})(t.payload),{...e,queryHistory:t.payload};case"SET_QUERY_HISTORY_BY_INDEX":return e.queryHistory.splice(t.payload.queryNumber,1,t.payload.value),{...e,queryHistory:e.queryHistory};case"TOGGLE_AUTOCOMPLETE":return Je("AUTOCOMPLETE",!e.autocomplete),{...e,autocomplete:!e.autocomplete};case"SET_AUTOCOMPLETE_QUICK":return{...e,autocompleteQuick:t.payload};case"SET_AUTOCOMPLETE_CACHE":return e.autocompleteCache.put(t.payload.key,t.payload.value),{...e};case"SET_METRICSQL_FUNCTIONS":return{...e,metricsQLFunctions:t.payload};default:throw new Error}}const xn=(0,r.createContext)({}),Sn=()=>(0,r.useContext)(xn).state,Cn=()=>(0,r.useContext)(xn).dispatch,En=()=>Et("svg",{viewBox:"0 0 74 24",fill:"currentColor",children:Et("path",{d:"M6.12 10.48c.36.28.8.43 1.26.43h.05c.48 0 .96-.19 1.25-.44 1.5-1.28 5.88-5.29 5.88-5.29C15.73 4.1 12.46 3.01 7.43 3h-.06C2.33 3-.93 4.1.24 5.18c0 0 4.37 4 5.88 5.3Zm2.56 2.16c-.36.28-.8.44-1.26.45h-.04c-.46 0-.9-.17-1.26-.45-1.04-.88-4.74-4.22-6.12-5.5v1.94c0 .21.08.5.22.63l.07.06c1.05.96 4.55 4.16 5.83 5.25.36.28.8.43 1.26.44h.04c.49-.02.96-.2 1.26-.44 1.3-1.11 4.94-4.45 5.88-5.31.15-.14.23-.42.23-.63V7.15a454.94 454.94 0 0 1-6.11 5.5Zm-1.26 4.99c.46 0 .9-.16 1.26-.44a454.4 454.4 0 0 0 6.1-5.5v1.94c0 .2-.07.48-.22.62-.94.87-4.57 4.2-5.88 5.3-.3.26-.77.44-1.26.45h-.04c-.46 0-.9-.16-1.26-.44-1.2-1.02-4.38-3.92-5.62-5.06l-.28-.25c-.14-.14-.22-.42-.22-.62v-1.94c1.38 1.26 5.08 4.6 6.12 5.5.36.28.8.43 1.26.44h.04ZM35 5l-5.84 14.46h-2.43L20.89 5h2.16a.9.9 0 0 1 .9.61l3.41 8.82a18.8 18.8 0 0 1 .62 2.02 19.44 19.44 0 0 1 .57-2.02l3.39-8.82c.05-.15.16-.3.31-.42a.9.9 0 0 1 .58-.19H35Zm17.18 0v14.46H49.8v-9.34c0-.37.02-.78.06-1.21l-4.37 8.21c-.21.4-.53.59-.95.59h-.38c-.43 0-.75-.2-.95-.59L38.8 8.88a22.96 22.96 0 0 1 .07 1.24v9.34H36.5V5h2.03l.3.01c.1 0 .17.02.24.05.07.03.13.07.19.13a1 1 0 0 1 .17.24l4.33 8.03a16.97 16.97 0 0 1 .6 1.36 14.34 14.34 0 0 1 .6-1.38l4.28-8.01c.05-.1.1-.18.17-.24.06-.06.12-.1.19-.13a.9.9 0 0 1 .24-.05l.3-.01h2.04Zm8.88 13.73a4.5 4.5 0 0 0 1.82-.35 3.96 3.96 0 0 0 2.22-2.47c.2-.57.3-1.19.3-1.85V5.31h1.02v8.75c0 .78-.12 1.51-.37 2.19a4.88 4.88 0 0 1-2.76 2.95c-.66.29-1.4.43-2.23.43-.82 0-1.57-.14-2.24-.43a5.01 5.01 0 0 1-2.75-2.95 6.37 6.37 0 0 1-.37-2.19V5.31h1.03v8.74c0 .66.1 1.28.3 1.85a3.98 3.98 0 0 0 2.21 2.47c.53.24 1.14.36 1.82.36Zm10.38.73h-1.03V5.31h1.03v14.15Z"})}),Nn=()=>Et("svg",{viewBox:"0 0 85 38",fill:"currentColor",children:[Et("path",{d:"M11.12 10.48c.36.28.8.43 1.26.43h.05c.48 0 .96-.19 1.25-.44 1.5-1.28 5.88-5.29 5.88-5.29 1.17-1.09-2.1-2.17-7.13-2.18h-.06c-5.04 0-8.3 1.1-7.13 2.18 0 0 4.37 4 5.88 5.3Zm2.56 2.16c-.36.28-.8.44-1.26.45h-.04c-.46 0-.9-.17-1.26-.45-1.04-.88-4.74-4.22-6.12-5.5v1.94c0 .21.08.5.22.63l.07.06c1.05.96 4.55 4.16 5.83 5.25.36.28.8.43 1.26.44h.04c.49-.02.96-.2 1.26-.44 1.3-1.11 4.94-4.45 5.88-5.31.15-.14.23-.42.23-.63V7.15a455.13 455.13 0 0 1-6.11 5.5Zm-1.26 4.99c.46 0 .9-.16 1.26-.44 2.05-1.82 4.09-3.65 6.1-5.5v1.94c0 .2-.07.48-.22.62-.94.87-4.57 4.2-5.88 5.3-.3.26-.77.44-1.26.45h-.04c-.46 0-.9-.16-1.26-.44-1.2-1.02-4.38-3.92-5.62-5.06l-.28-.25c-.14-.14-.22-.42-.22-.62v-1.94c1.38 1.26 5.08 4.6 6.12 5.5.36.28.8.43 1.26.44h.04ZM40 5l-5.84 14.46h-2.43L25.89 5h2.16a.9.9 0 0 1 .9.61l3.41 8.82a18.8 18.8 0 0 1 .62 2.02 19.44 19.44 0 0 1 .57-2.02l3.39-8.82c.05-.15.16-.3.31-.42a.9.9 0 0 1 .58-.19H40Zm17.18 0v14.46H54.8v-9.34c0-.37.02-.78.06-1.21l-4.37 8.21c-.21.4-.53.59-.95.59h-.38c-.43 0-.75-.2-.95-.59L43.8 8.88a22.96 22.96 0 0 1 .07 1.24v9.34H41.5V5h2.03l.3.01c.1 0 .17.02.24.05.07.03.13.07.19.13a1 1 0 0 1 .17.24l4.33 8.03a16.97 16.97 0 0 1 .6 1.36 14.34 14.34 0 0 1 .6-1.38l4.28-8.01c.05-.1.1-.18.17-.24.06-.06.12-.1.19-.13a.9.9 0 0 1 .24-.05l.3-.01h2.04Zm8.88 13.73a4.5 4.5 0 0 0 1.82-.35 3.96 3.96 0 0 0 2.22-2.47c.2-.57.3-1.19.3-1.85V5.31h1.02v8.75c0 .78-.12 1.51-.37 2.19a4.88 4.88 0 0 1-2.76 2.95c-.66.29-1.4.43-2.23.43-.82 0-1.57-.14-2.24-.43a5.01 5.01 0 0 1-2.75-2.95 6.37 6.37 0 0 1-.37-2.19V5.31h1.03v8.74c0 .66.1 1.28.3 1.85a3.98 3.98 0 0 0 2.21 2.47c.53.24 1.14.36 1.82.36Zm10.38.73h-1.03V5.31h1.03v14.15ZM1.73 36v-5.17l-.67-.07a.6.6 0 0 1-.21-.1.23.23 0 0 1-.08-.18v-.44h.96v-.59c0-.34.05-.65.14-.92a1.79 1.79 0 0 1 1.08-1.11 2.45 2.45 0 0 1 1.62-.02l-.03.53c0 .1-.06.15-.16.16H4c-.18 0-.35.03-.5.08a.95.95 0 0 0-.39.23c-.1.11-.19.25-.25.43-.05.18-.08.4-.08.65v.56h1.75v.78H2.8V36H1.73Zm6.17-6.17c.45 0 .85.07 1.2.22a2.57 2.57 0 0 1 1.5 1.62c.13.38.2.81.2 1.29s-.07.91-.2 1.3a2.57 2.57 0 0 1-1.49 1.61c-.36.14-.76.21-1.2.21-.45 0-.86-.07-1.22-.21a2.57 2.57 0 0 1-1.5-1.62c-.12-.38-.19-.81-.19-1.3 0-.47.07-.9.2-1.28a2.57 2.57 0 0 1 1.5-1.62c.35-.15.76-.22 1.2-.22Zm0 5.42c.6 0 1.05-.2 1.35-.6.3-.4.44-.97.44-1.69s-.15-1.28-.44-1.69c-.3-.4-.75-.6-1.35-.6-.3 0-.57.05-.8.15-.22.1-.4.26-.56.45-.15.2-.26.44-.33.73-.08.28-.11.6-.11.96 0 .72.15 1.29.44 1.69.3.4.76.6 1.36.6Zm5.26-4.11c.2-.42.43-.74.71-.97.28-.24.62-.36 1.03-.36.13 0 .25.02.36.05.12.02.23.07.32.13l-.08.8c-.02.1-.08.15-.18.15l-.24-.04a1.7 1.7 0 0 0-.88.05c-.15.05-.29.14-.4.25-.12.1-.23.24-.32.4-.1.17-.18.35-.26.56V36h-1.07v-6.08h.61c.12 0 .2.02.24.07.05.04.08.12.1.23l.06.92Zm13.73-3.82L23.39 36h-1.46l-3.5-8.68h1.29a.54.54 0 0 1 .54.37l2.04 5.3a11.31 11.31 0 0 1 .37 1.21 11.65 11.65 0 0 1 .35-1.22l2.03-5.29c.03-.1.1-.18.19-.25.1-.08.21-.12.35-.12h1.3Zm2.2 2.52V36H27.6v-6.16h1.49Zm.2-1.79c0 .13-.02.25-.08.36a1 1 0 0 1-.51.5.96.96 0 0 1-.73 0 1.02 1.02 0 0 1-.5-.5.96.96 0 0 1 0-.73.93.93 0 0 1 .86-.58.9.9 0 0 1 .37.08c.12.05.22.11.3.2a.94.94 0 0 1 .3.67Zm5.72 3.1a.68.68 0 0 1-.13.13c-.04.03-.1.05-.18.05a.42.42 0 0 1-.22-.07 3.95 3.95 0 0 0-.62-.31c-.14-.05-.3-.07-.51-.07-.26 0-.5.04-.69.14-.2.1-.36.23-.49.4-.13.18-.22.4-.29.64-.06.25-.1.53-.1.85 0 .33.04.62.1.88.08.25.18.47.32.64.13.18.29.3.48.4.18.09.4.13.63.13a1.6 1.6 0 0 0 .94-.27l.26-.2a.4.4 0 0 1 .25-.09.3.3 0 0 1 .27.14l.43.54a2.76 2.76 0 0 1-1.77.96c-.22.03-.43.05-.65.05a2.57 2.57 0 0 1-1.96-.83c-.25-.28-.45-.6-.6-1-.14-.4-.21-.85-.21-1.35 0-.45.06-.87.2-1.25a2.61 2.61 0 0 1 1.51-1.67c.37-.16.8-.24 1.28-.24.46 0 .86.07 1.2.22.35.15.66.36.94.64l-.4.54Zm3.43 4.95c-.54 0-.95-.15-1.24-.45-.28-.3-.42-.73-.42-1.26v-3.44h-.63a.29.29 0 0 1-.2-.07c-.06-.06-.09-.13-.09-.24v-.59l.99-.16.31-1.68a.33.33 0 0 1 .12-.18.34.34 0 0 1 .21-.07h.77v1.94h1.64v1.05h-1.64v3.34c0 .2.05.34.14.45.1.1.22.16.39.16a.73.73 0 0 0 .39-.1l.12-.07a.2.2 0 0 1 .11-.03c.05 0 .08.01.11.03l.09.1.44.72c-.21.18-.46.32-.74.4-.28.1-.57.15-.87.15Zm5.09-6.35c.46 0 .87.07 1.24.22a2.7 2.7 0 0 1 1.58 1.63c.14.39.22.83.22 1.31 0 .49-.08.93-.22 1.32-.14.4-.35.73-.62 1-.26.28-.58.49-.96.64-.37.15-.78.22-1.24.22a3.4 3.4 0 0 1-1.25-.22 2.71 2.71 0 0 1-1.59-1.64 3.8 3.8 0 0 1-.21-1.32c0-.48.07-.92.21-1.31a2.75 2.75 0 0 1 1.58-1.63c.38-.15.8-.22 1.26-.22Zm0 5.2c.51 0 .89-.17 1.13-.52.25-.34.38-.84.38-1.5a2.6 2.6 0 0 0-.38-1.53c-.24-.34-.62-.52-1.13-.52-.52 0-.9.18-1.16.53-.25.35-.37.85-.37 1.51s.12 1.17.37 1.51c.25.35.64.52 1.16.52Zm5.56-4.04c.2-.37.42-.65.69-.86.26-.21.57-.32.94-.32.28 0 .5.06.68.19l-.1 1.1a.3.3 0 0 1-.09.16.24.24 0 0 1-.15.04 1.8 1.8 0 0 1-.27-.03 2.01 2.01 0 0 0-.34-.03c-.16 0-.3.03-.44.08a1.1 1.1 0 0 0-.34.2c-.1.1-.2.2-.27.33-.08.13-.15.27-.22.44V36H47.7v-6.16h.87c.15 0 .26.03.31.09.06.05.1.15.13.29l.09.7Zm4.62-1.07V36h-1.49v-6.16h1.49Zm.2-1.79c0 .13-.02.25-.07.36a1 1 0 0 1-.51.5.96.96 0 0 1-.74 0 1.02 1.02 0 0 1-.5-.5.96.96 0 0 1 0-.73.93.93 0 0 1 .86-.58.9.9 0 0 1 .38.08c.11.05.21.11.3.2a.94.94 0 0 1 .28.67Zm4.56 5.32a7.8 7.8 0 0 0-1.08.12c-.29.05-.52.12-.7.2a.92.92 0 0 0-.38.3.64.64 0 0 0-.11.36c0 .26.07.45.23.56.15.11.35.17.6.17.3 0 .57-.06.79-.17.22-.1.44-.28.65-.5v-1.04Zm-3.4-2.67c.71-.65 1.57-.97 2.56-.97.36 0 .68.06.97.18a1.99 1.99 0 0 1 1.16 1.24c.1.3.16.61.16.96V36h-.67a.7.7 0 0 1-.33-.06c-.07-.04-.13-.13-.18-.26l-.13-.44c-.16.14-.3.26-.46.37a2.8 2.8 0 0 1-.97.43 2.77 2.77 0 0 1-1.32-.05 1.62 1.62 0 0 1-.57-.31 1.41 1.41 0 0 1-.38-.53 1.85 1.85 0 0 1-.05-1.18c.05-.16.14-.3.25-.45.12-.14.28-.27.46-.4a3 3 0 0 1 .7-.32 9.19 9.19 0 0 1 2.2-.33v-.36c0-.41-.09-.71-.26-.91-.18-.2-.43-.3-.76-.3a1.84 1.84 0 0 0-1.02.28l-.33.18c-.1.06-.2.09-.32.09-.1 0-.2-.03-.27-.08a.72.72 0 0 1-.17-.2l-.26-.47Zm11.49 4.32V36h-4.88v-8.6h1.16v7.62h3.72Zm3.16-5.2c.44 0 .84.08 1.2.23a2.57 2.57 0 0 1 1.49 1.62c.13.38.2.81.2 1.29s-.07.91-.2 1.3a2.57 2.57 0 0 1-1.49 1.61c-.36.14-.76.21-1.2.21-.45 0-.85-.07-1.21-.21a2.57 2.57 0 0 1-1.5-1.62c-.13-.38-.2-.81-.2-1.3 0-.47.07-.9.2-1.28.14-.39.33-.72.59-1 .25-.26.55-.47.9-.62.37-.15.77-.22 1.22-.22Zm0 5.43c.6 0 1.05-.2 1.34-.6.3-.4.45-.97.45-1.69s-.15-1.28-.45-1.69c-.3-.4-.74-.6-1.34-.6-.3 0-.57.05-.8.15-.22.1-.4.26-.56.45-.15.2-.26.44-.34.73-.07.28-.1.6-.1.96 0 .72.14 1.29.44 1.69.3.4.75.6 1.36.6Zm6.33-2.22c.22 0 .4-.03.57-.09.16-.06.3-.14.41-.25.12-.11.2-.24.26-.39.05-.15.08-.31.08-.5 0-.37-.11-.66-.34-.88-.23-.22-.55-.33-.98-.33-.43 0-.76.1-.99.33-.22.22-.34.51-.34.89 0 .18.03.34.09.5a1.1 1.1 0 0 0 .67.63c.16.06.35.09.57.09Zm1.93 3.3a.51.51 0 0 0-.13-.36.84.84 0 0 0-.34-.22 8.57 8.57 0 0 0-1.73-.2 7.5 7.5 0 0 1-.62-.05c-.23.1-.41.23-.56.4a.8.8 0 0 0-.1.92c.07.12.18.22.32.3.14.1.32.16.54.21a3.5 3.5 0 0 0 1.55 0c.23-.05.42-.12.57-.22.16-.1.29-.21.37-.34a.8.8 0 0 0 .13-.44Zm1.08-6.17v.4c0 .13-.08.21-.25.25l-.69.09c.14.26.2.56.2.88a1.86 1.86 0 0 1-1.36 1.82 3.07 3.07 0 0 1-1.72.04c-.12.08-.22.16-.29.25a.44.44 0 0 0-.1.27c0 .15.06.26.17.33.12.08.28.13.47.16a5 5 0 0 0 .66.06 16.56 16.56 0 0 1 1.5.13c.26.05.48.12.67.22.19.1.34.24.46.41.12.18.18.4.18.69 0 .26-.07.5-.2.75s-.31.46-.56.65c-.24.2-.54.34-.9.46a4.57 4.57 0 0 1-2.36.04c-.33-.09-.6-.2-.82-.36a1.56 1.56 0 0 1-.5-.51c-.1-.2-.16-.4-.16-.6 0-.3.1-.56.28-.77.19-.2.45-.37.77-.5a1.15 1.15 0 0 1-.43-.32.88.88 0 0 1-.15-.54c0-.09.01-.18.04-.27.04-.1.08-.2.15-.28a1.55 1.55 0 0 1 .58-.5c-.3-.16-.53-.39-.7-.66-.17-.28-.25-.6-.25-.97 0-.3.05-.57.16-.8.12-.25.28-.46.48-.63.2-.17.45-.3.73-.4a3 3 0 0 1 2.3.21h1.64Zm4.65.76a.24.24 0 0 1-.23.14.42.42 0 0 1-.2-.07 3.59 3.59 0 0 0-.67-.3 1.8 1.8 0 0 0-1.03 0c-.14.05-.27.11-.37.2a.87.87 0 0 0-.23.27.75.75 0 0 0-.08.35c0 .15.04.28.13.39.1.1.21.19.36.27.15.07.32.14.5.2a13.63 13.63 0 0 1 1.16.4c.2.08.36.18.5.3a1.33 1.33 0 0 1 .5 1.07 2 2 0 0 1-.15.78c-.1.24-.25.44-.45.62-.2.17-.43.3-.72.4a3.1 3.1 0 0 1-2.14-.05 2.97 2.97 0 0 1-.87-.53l.25-.41c.04-.05.07-.1.12-.12a.3.3 0 0 1 .17-.04.4.4 0 0 1 .22.08l.3.19a1.91 1.91 0 0 0 1.03.27c.2 0 .38-.03.54-.08.16-.06.29-.13.4-.22a.96.96 0 0 0 .3-.7c0-.17-.05-.31-.14-.42-.09-.11-.2-.2-.36-.28a2.6 2.6 0 0 0-.5-.2l-.59-.19c-.2-.06-.39-.14-.58-.22a2.14 2.14 0 0 1-.5-.3 1.45 1.45 0 0 1-.36-.46c-.1-.19-.14-.41-.14-.67a1.6 1.6 0 0 1 .57-1.23c.18-.16.4-.3.68-.39.26-.1.57-.14.91-.14a2.84 2.84 0 0 1 1.9.7l-.23.4Z"}),Et("defs",{children:Et("path",{d:"M0 0h85v38H0z"})})]}),An=()=>Et("svg",{viewBox:"0 0 85 38",fill:"currentColor",children:Et("path",{d:"M11.118 10.476c.36.28.801.433 1.257.436h.052c.48-.007.961-.192 1.25-.444 1.509-1.279 5.88-5.287 5.88-5.287 1.168-1.087-2.093-2.174-7.13-2.181h-.06c-5.036.007-8.298 1.094-7.13 2.181 0 0 4.372 4.008 5.88 5.295zm2.559 2.166c-.359.283-.801.439-1.258.444h-.044a2.071 2.071 0 0 1-1.257-.444C10.082 11.755 6.384 8.42 5 7.148v1.93c0 .215.081.496.222.629l.07.064c1.045.955 4.546 4.154 5.825 5.245.358.283.8.438 1.257.444h.044c.489-.015.962-.2 1.258-.444 1.309-1.11 4.948-4.444 5.887-5.31.148-.132.222-.413.222-.628v-1.93a455.127 455.127 0 0 1-6.11 5.494zm-1.258 4.984a2.071 2.071 0 0 0 1.258-.436c2.053-1.815 4.09-3.65 6.11-5.502v1.938c0 .207-.075.488-.223.621-.94.873-4.578 4.2-5.887 5.31-.296.25-.77.436-1.258.443h-.044a2.071 2.071 0 0 1-1.257-.436c-1.204-1.027-4.376-3.928-5.616-5.062l-.28-.255c-.14-.133-.221-.414-.221-.621v-1.938c1.383 1.265 5.081 4.607 6.117 5.495.358.282.8.438 1.257.443h.044zM40 5l-5.84 14.46h-2.43L25.89 5h2.16c.233 0 .423.057.57.17.146.113.256.26.33.44l3.41 8.82c.113.287.22.603.32.95.106.34.206.697.3 1.07.08-.373.166-.73.26-1.07a8.84 8.84 0 0 1 .31-.95l3.39-8.82a.959.959 0 0 1 .31-.42.906.906 0 0 1 .58-.19H40zm17.176 0v14.46h-2.37v-9.34c0-.373.02-.777.06-1.21l-4.37 8.21c-.206.393-.523.59-.95.59h-.38c-.426 0-.743-.197-.95-.59l-4.42-8.24c.02.22.037.437.05.65.014.213.02.41.02.59v9.34h-2.37V5h2.03c.12 0 .224.003.31.01a.778.778 0 0 1 .23.05c.074.027.137.07.19.13.06.06.117.14.17.24l4.33 8.03c.114.213.217.433.31.66.1.227.197.46.29.7.094-.247.19-.483.29-.71.1-.233.207-.457.32-.67l4.27-8.01c.054-.1.11-.18.17-.24a.57.57 0 0 1 .19-.13.903.903 0 0 1 .24-.05c.087-.007.19-.01.31-.01h2.03zm8.887 13.73c.68 0 1.286-.117 1.82-.35.54-.24.996-.57 1.37-.99a4.28 4.28 0 0 0 .85-1.48c.2-.573.3-1.19.3-1.85V5.31h1.02v8.75c0 .78-.124 1.51-.37 2.19a5.248 5.248 0 0 1-1.07 1.77c-.46.5-1.024.893-1.69 1.18-.66.287-1.404.43-2.23.43-.827 0-1.574-.143-2.24-.43a5.012 5.012 0 0 1-1.69-1.18 5.33 5.33 0 0 1-1.06-1.77 6.373 6.373 0 0 1-.37-2.19V5.31h1.03v8.74c0 .66.096 1.277.29 1.85.2.567.483 1.06.85 1.48.373.42.826.75 1.36.99.54.24 1.15.36 1.83.36zm10.38.73h-1.03V5.31h1.03v14.15zM4.242 35v-5.166l-.672-.078a.595.595 0 0 1-.21-.09.23.23 0 0 1-.078-.186v-.438h.96v-.588c0-.348.048-.656.144-.924.1-.272.24-.5.42-.684a1.79 1.79 0 0 1 .66-.426c.256-.096.544-.144.864-.144.272 0 .522.04.75.12l-.024.534c-.008.096-.062.148-.162.156a4.947 4.947 0 0 1-.39.012c-.184 0-.352.024-.504.072a.949.949 0 0 0-.384.234c-.108.108-.192.25-.252.426a2.184 2.184 0 0 0-.084.654v.558h1.752v.774H5.316V35H4.242zM10.416 28.826a3.1 3.1 0 0 1 1.2.222c.356.148.66.358.912.63s.444.602.576.99c.136.384.204.814.204 1.29 0 .48-.068.912-.204 1.296a2.735 2.735 0 0 1-.576.984 2.572 2.572 0 0 1-.912.63 3.175 3.175 0 0 1-1.2.216c-.448 0-.852-.072-1.212-.216a2.572 2.572 0 0 1-.912-.63 2.805 2.805 0 0 1-.582-.984 3.972 3.972 0 0 1-.198-1.296c0-.476.066-.906.198-1.29.136-.388.33-.718.582-.99.252-.272.556-.482.912-.63.36-.148.764-.222 1.212-.222zm0 5.424c.6 0 1.048-.2 1.344-.6.296-.404.444-.966.444-1.686 0-.724-.148-1.288-.444-1.692-.296-.404-.744-.606-1.344-.606-.304 0-.57.052-.798.156a1.507 1.507 0 0 0-.564.45c-.148.196-.26.438-.336.726a3.941 3.941 0 0 0-.108.966c0 .72.148 1.282.444 1.686.3.4.754.6 1.362.6zM15.677 30.14c.192-.416.428-.74.708-.972.28-.236.622-.354 1.026-.354.128 0 .25.014.366.042.12.028.226.072.318.132l-.078.798c-.024.1-.084.15-.18.15-.056 0-.138-.012-.246-.036a1.694 1.694 0 0 0-.366-.036c-.192 0-.364.028-.516.084-.148.056-.282.14-.402.252a1.782 1.782 0 0 0-.318.408c-.092.16-.176.344-.252.552V35h-1.074v-6.078h.612c.116 0 .196.022.24.066.044.044.074.12.09.228l.072.924zM26.761 28.922 24.283 35h-.96l-2.478-6.078h.87a.33.33 0 0 1 .33.222l1.542 3.912c.048.148.09.292.126.432.036.14.07.28.102.42.032-.14.066-.28.102-.42.036-.14.08-.284.132-.432l1.56-3.912a.33.33 0 0 1 .12-.156.311.311 0 0 1 .198-.066h.834zM27.74 35v-6.078h.643c.152 0 .246.074.282.222l.078.624c.224-.276.476-.502.756-.678.28-.176.604-.264.972-.264.408 0 .738.114.99.342.256.228.44.536.552.924.088-.22.2-.41.336-.57a1.987 1.987 0 0 1 1.014-.624c.196-.048.394-.072.594-.072.32 0 .604.052.852.156.252.1.464.248.636.444.176.196.31.438.402.726.092.284.138.61.138.978V35H34.91v-3.87c0-.476-.104-.836-.312-1.08-.208-.248-.508-.372-.9-.372-.176 0-.344.032-.504.096-.156.06-.294.15-.414.27-.12.12-.216.272-.288.456-.068.18-.102.39-.102.63V35h-1.074v-3.87c0-.488-.098-.852-.294-1.092-.196-.24-.482-.36-.858-.36-.264 0-.508.072-.732.216a2.38 2.38 0 0 0-.618.576V35H27.74zM40.746 32.372c-.428.02-.788.058-1.08.114-.292.052-.526.12-.702.204a.923.923 0 0 0-.378.294.639.639 0 0 0-.114.366c0 .26.076.446.228.558.156.112.358.168.606.168.304 0 .566-.054.786-.162.224-.112.442-.28.654-.504v-1.038zm-3.396-2.67c.708-.648 1.56-.972 2.556-.972.36 0 .682.06.966.18.284.116.524.28.72.492.196.208.344.458.444.75.104.292.156.612.156.96V35h-.672a.708.708 0 0 1-.324-.06c-.076-.044-.136-.13-.18-.258l-.132-.444c-.156.14-.308.264-.456.372a2.804 2.804 0 0 1-.462.264c-.16.072-.332.126-.516.162-.18.04-.38.06-.6.06-.26 0-.5-.034-.72-.102a1.618 1.618 0 0 1-.57-.318 1.414 1.414 0 0 1-.372-.522 1.852 1.852 0 0 1-.132-.726 1.419 1.419 0 0 1 .33-.906c.12-.14.274-.272.462-.396s.418-.232.69-.324c.276-.092.596-.166.96-.222.364-.06.78-.096 1.248-.108v-.36c0-.412-.088-.716-.264-.912-.176-.2-.43-.3-.762-.3-.24 0-.44.028-.6.084-.156.056-.294.12-.414.192l-.33.186a.631.631 0 0 1-.324.084.439.439 0 0 1-.264-.078.716.716 0 0 1-.174-.192l-.264-.474zM44.974 29.6c.124-.124.254-.238.39-.342a2.395 2.395 0 0 1 .936-.444c.176-.044.368-.066.576-.066.336 0 .634.058.894.174.26.112.476.272.648.48.176.204.308.45.396.738.092.284.138.598.138.942V35H47.47v-3.918c0-.376-.086-.666-.258-.87-.172-.208-.434-.312-.786-.312-.256 0-.496.058-.72.174a2.58 2.58 0 0 0-.636.474V35h-1.482v-6.156h.906c.192 0 .318.09.378.27l.102.486zM53.085 28.748c.456 0 .87.074 1.242.222a2.692 2.692 0 0 1 1.578 1.626c.144.392.216.83.216 1.314 0 .488-.072.928-.216 1.32-.144.392-.35.726-.618 1.002a2.653 2.653 0 0 1-.96.636 3.333 3.333 0 0 1-1.242.222c-.46 0-.878-.074-1.254-.222a2.712 2.712 0 0 1-.966-.636 2.922 2.922 0 0 1-.618-1.002 3.807 3.807 0 0 1-.216-1.32c0-.484.072-.922.216-1.314.148-.392.354-.724.618-.996.268-.272.59-.482.966-.63a3.397 3.397 0 0 1 1.254-.222zm0 5.202c.512 0 .89-.172 1.134-.516.248-.344.372-.848.372-1.512s-.124-1.17-.372-1.518c-.244-.348-.622-.522-1.134-.522-.52 0-.906.176-1.158.528-.248.348-.372.852-.372 1.512s.124 1.164.372 1.512c.252.344.638.516 1.158.516zM57.252 35v-6.156h.906c.192 0 .318.09.378.27l.096.456c.108-.12.22-.23.336-.33a2.017 2.017 0 0 1 1.32-.492c.388 0 .706.106.954.318.252.208.44.486.564.834a1.93 1.93 0 0 1 .834-.882c.172-.092.354-.16.546-.204.196-.044.392-.066.588-.066.34 0 .642.052.906.156.264.104.486.256.666.456.18.2.316.444.408.732.096.288.144.618.144.99V35h-1.482v-3.918c0-.392-.086-.686-.258-.882-.172-.2-.424-.3-.756-.3-.152 0-.294.026-.426.078a1.026 1.026 0 0 0-.342.228 1.019 1.019 0 0 0-.228.366 1.435 1.435 0 0 0-.084.51V35h-1.488v-3.918c0-.412-.084-.712-.252-.9-.164-.188-.406-.282-.726-.282-.216 0-.418.054-.606.162a1.979 1.979 0 0 0-.516.432V35h-1.482zM70.558 32.372c-.428.02-.788.058-1.08.114-.292.052-.526.12-.702.204a.923.923 0 0 0-.378.294.639.639 0 0 0-.114.366c0 .26.076.446.228.558.156.112.358.168.606.168.304 0 .566-.054.786-.162.224-.112.442-.28.654-.504v-1.038zm-3.396-2.67c.708-.648 1.56-.972 2.556-.972.36 0 .682.06.966.18.284.116.524.28.72.492.196.208.344.458.444.75.104.292.156.612.156.96V35h-.672a.708.708 0 0 1-.324-.06c-.076-.044-.136-.13-.18-.258l-.132-.444c-.156.14-.308.264-.456.372a2.804 2.804 0 0 1-.462.264c-.16.072-.332.126-.516.162-.18.04-.38.06-.6.06-.26 0-.5-.034-.72-.102a1.618 1.618 0 0 1-.57-.318 1.414 1.414 0 0 1-.372-.522 1.852 1.852 0 0 1-.132-.726 1.419 1.419 0 0 1 .33-.906c.12-.14.274-.272.462-.396s.418-.232.69-.324c.276-.092.596-.166.96-.222.364-.06.78-.096 1.248-.108v-.36c0-.412-.088-.716-.264-.912-.176-.2-.43-.3-.762-.3-.24 0-.44.028-.6.084-.156.056-.294.12-.414.192l-.33.186a.631.631 0 0 1-.324.084.439.439 0 0 1-.264-.078.716.716 0 0 1-.174-.192l-.264-.474zM74.9 26.084V35h-1.482v-8.916H74.9zM81.969 28.844l-3.354 7.848a.538.538 0 0 1-.174.234c-.068.056-.174.084-.318.084h-1.104l1.152-2.472-2.49-5.694h1.302c.116 0 .206.028.27.084.068.056.118.12.15.192l1.308 3.192c.044.108.08.216.108.324.032.108.062.218.09.33a32.3 32.3 0 0 1 .108-.33c.036-.112.076-.222.12-.33l1.236-3.186a.437.437 0 0 1 .408-.276h1.188z"})}),Mn=()=>Et("svg",{viewBox:"0 0 15 17",fill:"currentColor",children:Et("path",{d:"M6.11767 7.47586C6.47736 7.75563 6.91931 7.90898 7.37503 7.91213H7.42681C7.90756 7.90474 8.38832 7.71987 8.67677 7.46846C10.1856 6.18921 14.5568 2.18138 14.5568 2.18138C15.7254 1.09438 12.4637 0.00739 7.42681 0H7.36764C2.3308 0.00739 -0.930935 1.09438 0.237669 2.18138C0.237669 2.18138 4.60884 6.18921 6.11767 7.47586ZM8.67677 9.64243C8.31803 9.92483 7.87599 10.0808 7.41941 10.0861H7.37503C6.91845 10.0808 6.47641 9.92483 6.11767 9.64243C5.0822 8.75513 1.38409 5.42018 0.000989555 4.14832V6.07829C0.000989555 6.29273 0.0823481 6.57372 0.222877 6.70682L0.293316 6.7712L0.293344 6.77122C1.33784 7.72579 4.83903 10.9255 6.11767 12.0161C6.47641 12.2985 6.91845 12.4545 7.37503 12.4597H7.41941C7.90756 12.4449 8.38092 12.2601 8.67677 12.0161C9.9859 10.9069 13.6249 7.57198 14.5642 6.70682C14.7121 6.57372 14.7861 6.29273 14.7861 6.07829V4.14832C12.7662 5.99804 10.7297 7.82949 8.67677 9.64243ZM7.41941 14.6263C7.87513 14.6232 8.31708 14.4698 8.67677 14.19C10.7298 12.3746 12.7663 10.5407 14.7861 8.68853V10.6259C14.7861 10.8329 14.7121 11.1139 14.5642 11.247C13.6249 12.1196 9.9859 15.4471 8.67677 16.5563C8.38092 16.8077 7.90756 16.9926 7.41941 17H7.37503C6.91931 16.9968 6.47736 16.8435 6.11767 16.5637C4.91427 15.5373 1.74219 12.6364 0.502294 11.5025C0.393358 11.4029 0.299337 11.3169 0.222877 11.247C0.0823481 11.1139 0.000989555 10.8329 0.000989555 10.6259V8.68853C1.38409 9.95303 5.0822 13.2953 6.11767 14.1827C6.47641 14.4651 6.91845 14.6211 7.37503 14.6263H7.41941Z"})}),Tn=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"})}),Ln=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})}),On=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"M12 5V2L8 6l4 4V7c3.31 0 6 2.69 6 6 0 2.97-2.17 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93 0-4.42-3.58-8-8-8zm-6 8c0-1.65.67-3.15 1.76-4.24L6.34 7.34C4.9 8.79 4 10.79 4 13c0 4.08 3.05 7.44 7 7.93v-2.02c-2.83-.48-5-2.94-5-5.91z"})}),Pn=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})}),In=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),Rn=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),Dn=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}),zn=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6zm6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26z"})}),Fn=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"})}),jn=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"m7 10 5 5 5-5z"})}),Hn=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:[Et("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),Et("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),Vn=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 18H4V8h16v13z"})}),$n=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"m22 5.72-4.6-3.86-1.29 1.53 4.6 3.86L22 5.72zM7.88 3.39 6.6 1.86 2 5.71l1.29 1.53 4.59-3.85zM12.5 8H11v6l4.75 2.85.75-1.23-4-2.37V8zM12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9c4.97 0 9-4.03 9-9s-4.03-9-9-9zm0 16c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"})}),Un=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"M20 5H4c-1.1 0-1.99.9-1.99 2L2 17c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm-9 3h2v2h-2V8zm0 3h2v2h-2v-2zM8 8h2v2H8V8zm0 3h2v2H8v-2zm-1 2H5v-2h2v2zm0-3H5V8h2v2zm9 7H8v-2h8v2zm0-4h-2v-2h2v2zm0-3h-2V8h2v2zm3 3h-2v-2h2v2zm0-3h-2V8h2v2z"})}),Bn=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"M8 5v14l11-7z"})}),qn=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"m10 16.5 6-4.5-6-4.5v9zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"})}),Yn=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"m3.5 18.49 6-6.01 4 4L22 6.92l-1.41-1.41-7.09 7.97-4-4L2 16.99z"})}),Wn=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"M10 10.02h5V21h-5zM17 21h3c1.1 0 2-.9 2-2v-9h-5v11zm3-18H5c-1.1 0-2 .9-2 2v3h19V5c0-1.1-.9-2-2-2zM3 19c0 1.1.9 2 2 2h3V10H3v9z"})}),Kn=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"})}),Qn=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"})}),Zn=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})}),Gn=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"M19 13H5v-2h14v2z"})}),Jn=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"M8.9999 14.7854L18.8928 4.8925C19.0803 4.70497 19.3347 4.59961 19.5999 4.59961C19.8651 4.59961 20.1195 4.70497 20.307 4.8925L21.707 6.2925C22.0975 6.68303 22.0975 7.31619 21.707 7.70672L9.70701 19.7067C9.31648 20.0972 8.68332 20.0972 8.2928 19.7067L2.6928 14.1067C2.50526 13.9192 2.3999 13.6648 2.3999 13.3996C2.3999 13.1344 2.50526 12.88 2.6928 12.6925L4.0928 11.2925C4.48332 10.902 5.11648 10.902 5.50701 11.2925L8.9999 14.7854Z"})}),Xn=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"})}),er=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"})}),tr=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"M19 9l1.25-2.75L23 5l-2.75-1.25L19 1l-1.25 2.75L15 5l2.75 1.25L19 9zm-7.5.5L9 4 6.5 9.5 1 12l5.5 2.5L9 20l2.5-5.5L17 12l-5.5-2.5zM19 15l-1.25 2.75L15 19l2.75 1.25L19 23l1.25-2.75L23 19l-2.75-1.25L19 15z"})}),nr=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})}),rr=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"M20 9H4v2h16V9zM4 15h16v-2H4v2z"})}),ar=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"M23 8c0 1.1-.9 2-2 2-.18 0-.35-.02-.51-.07l-3.56 3.55c.05.16.07.34.07.52 0 1.1-.9 2-2 2s-2-.9-2-2c0-.18.02-.36.07-.52l-2.55-2.55c-.16.05-.34.07-.52.07s-.36-.02-.52-.07l-4.55 4.56c.05.16.07.33.07.51 0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2c.18 0 .35.02.51.07l4.56-4.55C8.02 9.36 8 9.18 8 9c0-1.1.9-2 2-2s2 .9 2 2c0 .18-.02.36-.07.52l2.55 2.55c.16-.05.34-.07.52-.07s.36.02.52.07l3.55-3.56C19.02 8.35 19 8.18 19 8c0-1.1.9-2 2-2s2 .9 2 2z"})}),or=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:[Et("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21 5C19.89 4.65 18.67 4.5 17.5 4.5C15.55 4.5 13.45 4.9 12 6C10.55 4.9 8.45 4.5 6.5 4.5C5.33 4.5 4.11 4.65 3 5C2.25 5.25 1.6 5.55 1 6V20.6C1 20.85 1.25 21.1 1.5 21.1C1.6 21.1 1.65 21.1 1.75 21.05C3.15 20.3 4.85 20 6.5 20C8.2 20 10.65 20.65 12 21.5C13.35 20.65 15.8 20 17.5 20C19.15 20 20.85 20.3 22.25 21.05C22.35 21.1 22.4 21.1 22.5 21.1C22.75 21.1 23 20.85 23 20.6V6C22.4 5.55 21.75 5.25 21 5ZM21 18.5C19.9 18.15 18.7 18 17.5 18C15.8 18 13.35 18.65 12 19.5C10.65 18.65 8.2 18 6.5 18C5.3 18 4.1 18.15 3 18.5V7C4.1 6.65 5.3 6.5 6.5 6.5C8.2 6.5 10.65 7.15 12 8C13.35 7.15 15.8 6.5 17.5 6.5C18.7 6.5 19.9 6.65 21 7V18.5Z"}),Et("path",{d:"M17.5 10.5C18.38 10.5 19.23 10.59 20 10.76V9.24C19.21 9.09 18.36 9 17.5 9C15.8 9 14.26 9.29 13 9.83V11.49C14.13 10.85 15.7 10.5 17.5 10.5ZM13 12.49V14.15C14.13 13.51 15.7 13.16 17.5 13.16C18.38 13.16 19.23 13.25 20 13.42V11.9C19.21 11.75 18.36 11.66 17.5 11.66C15.8 11.66 14.26 11.96 13 12.49ZM17.5 14.33C15.8 14.33 14.26 14.62 13 15.16V16.82C14.13 16.18 15.7 15.83 17.5 15.83C18.38 15.83 19.23 15.92 20 16.09V14.57C19.21 14.41 18.36 14.33 17.5 14.33Z"}),Et("path",{d:"M6.5 10.5C5.62 10.5 4.77 10.59 4 10.76V9.24C4.79 9.09 5.64 9 6.5 9C8.2 9 9.74 9.29 11 9.83V11.49C9.87 10.85 8.3 10.5 6.5 10.5ZM11 12.49V14.15C9.87 13.51 8.3 13.16 6.5 13.16C5.62 13.16 4.77 13.25 4 13.42V11.9C4.79 11.75 5.64 11.66 6.5 11.66C8.2 11.66 9.74 11.96 11 12.49ZM6.5 14.33C8.2 14.33 9.74 14.62 11 15.16V16.82C9.87 16.18 8.3 15.83 6.5 15.83C5.62 15.83 4.77 15.92 4 16.09V14.57C4.79 14.41 5.64 14.33 6.5 14.33Z"})]}),ir=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10 10-4.49 10-10S17.51 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm3-8c0 1.66-1.34 3-3 3s-3-1.34-3-3 1.34-3 3-3 3 1.34 3 3z"})}),lr=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 6C9.79 6 8 7.79 8 10H10C10 8.9 10.9 8 12 8C13.1 8 14 8.9 14 10C14 10.8792 13.4202 11.3236 12.7704 11.8217C11.9421 12.4566 11 13.1787 11 15H13C13 13.9046 13.711 13.2833 14.4408 12.6455C15.21 11.9733 16 11.2829 16 10C16 7.79 14.21 6 12 6ZM13 16V18H11V16H13Z"})}),sr=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"M4 20h16c1.1 0 2-.9 2-2s-.9-2-2-2H4c-1.1 0-2 .9-2 2s.9 2 2 2zm0-3h2v2H4v-2zM2 6c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2s-.9-2-2-2H4c-1.1 0-2 .9-2 2zm4 1H4V5h2v2zm-2 7h16c1.1 0 2-.9 2-2s-.9-2-2-2H4c-1.1 0-2 .9-2 2s.9 2 2 2zm0-3h2v2H4v-2z"})}),cr=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})}),ur=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z"})}),dr=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"M7 20h4c0 1.1-.9 2-2 2s-2-.9-2-2zm-2-1h8v-2H5v2zm11.5-9.5c0 3.82-2.66 5.86-3.77 6.5H5.27c-1.11-.64-3.77-2.68-3.77-6.5C1.5 5.36 4.86 2 9 2s7.5 3.36 7.5 7.5zm4.87-2.13L20 8l1.37.63L22 10l.63-1.37L24 8l-1.37-.63L22 6l-.63 1.37zM19 6l.94-2.06L22 3l-2.06-.94L19 0l-.94 2.06L16 3l2.06.94L19 6z"})}),hr=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"M3 14h4v-4H3v4zm0 5h4v-4H3v4zM3 9h4V5H3v4zm5 5h13v-4H8v4zm0 5h13v-4H8v4zM8 5v4h13V5H8z"})}),mr=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"m22 9.24-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"})}),pr=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"M12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"})}),fr=()=>Et("svg",{viewBox:"0 0 16 16",fill:vt("color-error"),children:Et("path",{d:"M13.5095 4L8.50952 1H7.50952L2.50952 4L2.01953 4.85999V10.86L2.50952 11.71L7.50952 14.71H8.50952L13.5095 11.71L13.9995 10.86V4.85999L13.5095 4ZM7.50952 13.5601L3.00952 10.86V5.69995L7.50952 8.15002V13.5601ZM3.26953 4.69995L8.00952 1.85999L12.7495 4.69995L8.00952 7.29004L3.26953 4.69995ZM13.0095 10.86L8.50952 13.5601V8.15002L13.0095 5.69995V10.86Z"})}),vr=()=>Et("svg",{viewBox:"0 0 16 16",fill:vt("color-primary"),children:Et("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 5H4V4H1.5L1 4.5V12.5L1.5 13H4V12H2V5ZM14.5 4H12V5H14V12H12V13H14.5L15 12.5V4.5L14.5 4ZM11.76 6.56995L12 7V9.51001L11.7 9.95996L7.19995 11.96H6.73999L4.23999 10.46L4 10.03V7.53003L4.30005 7.06995L8.80005 5.06995H9.26001L11.76 6.56995ZM5 9.70996L6.5 10.61V9.28003L5 8.38V9.70996ZM5.57996 7.56006L7.03003 8.43005L10.42 6.93005L8.96997 6.06006L5.57996 7.56006ZM7.53003 10.73L11.03 9.17004V7.77002L7.53003 9.31995V10.73Z"})}),gr=()=>Et("svg",{viewBox:"0 0 16 16",fill:vt("color-warning"),children:Et("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 2H8L7 3V6H8V3H14V8H10V9H14L15 8V3L14 2ZM9 6H13V7H9.41L9 6.59V6ZM7 7H2L1 8V13L2 14H8L9 13V8L8 7H7ZM8 13H2V8H8V9V13ZM3 9H7V10H3V9ZM3 11H7V12H3V11ZM9 4H13V5H9V4Z"})}),yr=()=>Et("svg",{viewBox:"0 0 16 16",fill:vt("color-primary"),children:Et("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 3L8 2H14L15 3V8L14 9H10V8H14V3H8V6H7V3ZM9 9V8L8 7H7H2L1 8V13L2 14H8L9 13V9ZM8 8V9V13H2V8H7H8ZM9.41421 7L9 6.58579V6H13V7H9.41421ZM9 4H13V5H9V4ZM7 10H3V11H7V10Z"})}),_r=()=>Et("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:Et("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"})});var br=n(738),wr=n.n(br);const kr=e=>{let{to:t,isNavLink:n,children:r,...a}=e;return n?Et(Re,{to:t,...a,children:r}):Et("div",{...a,children:r})},xr=e=>{let{activeItem:t,item:n,color:r=vt("color-primary"),activeNavRef:a,onChange:o,isNavLink:i}=e;return Et(kr,{className:wr()({"vm-tabs-item":!0,"vm-tabs-item_active":t===n.value,[n.className||""]:n.className}),isNavLink:i,to:n.value,style:{color:r},onClick:(l=n.value,()=>{o&&o(l)}),ref:t===n.value?a:void 0,children:[n.icon&&Et("div",{className:wr()({"vm-tabs-item__icon":!0,"vm-tabs-item__icon_single":!n.label}),children:n.icon}),n.label]});var l};const Sr=function(e,t,n,a){const o=(0,r.useRef)(t);(0,r.useEffect)((()=>{o.current=t}),[t]),(0,r.useEffect)((()=>{var t;const r=null!==(t=null===n||void 0===n?void 0:n.current)&&void 0!==t?t:window;if(!r||!r.addEventListener)return;const i=e=>o.current(e);return r.addEventListener(e,i,a),()=>{r.removeEventListener(e,i,a)}}),[e,n,a])},Cr=()=>{const[e,t]=(0,r.useState)({width:0,height:0}),n=()=>{t({width:window.innerWidth,height:window.innerHeight})};return Sr("resize",n),(0,r.useEffect)(n,[]),e},Er=e=>{let{activeItem:t,items:n,color:a=vt("color-primary"),onChange:o,indicatorPlacement:i="bottom",isNavLink:l}=e;const s=Cr(),c=(0,r.useRef)(null),[u,d]=(0,r.useState)({left:0,width:0,bottom:0});return(0,r.useEffect)((()=>{var e;if((null===(e=c.current)||void 0===e?void 0:e.base)instanceof HTMLElement){const{offsetLeft:e,offsetWidth:t,offsetHeight:n}=c.current.base;d({left:e,width:t,bottom:"top"===i?n-2:0})}}),[s,t,c,n]),Et("div",{className:"vm-tabs",children:[n.map((e=>Et(xr,{activeItem:t,item:e,onChange:o,color:a,activeNavRef:c,isNavLink:l},e.value))),Et("div",{className:"vm-tabs__indicator",style:{...u,borderColor:a}})]})},Nr=[{value:ht.chart,icon:Et(Yn,{}),label:"Graph",prometheusCode:0},{value:ht.code,icon:Et(Kn,{}),label:"JSON",prometheusCode:3},{value:ht.table,icon:Et(Wn,{}),label:"Table",prometheusCode:1}],Ar=()=>{const{displayType:e}=Ir(),t=Rr();return Et(Er,{activeItem:e,items:Nr,onChange:n=>{var r;t({type:"SET_DISPLAY_TYPE",payload:null!==(r=n)&&void 0!==r?r:e})}})},Mr=()=>{const e=ct("g0.tab",0),t=Nr.find((t=>t.prometheusCode===+e||t.value===e));return(null===t||void 0===t?void 0:t.value)||ht.chart},Tr=Xe("SERIES_LIMITS"),Lr={displayType:Mr(),nocache:!1,isTracingEnabled:!1,seriesLimits:Tr?JSON.parse(Tr):it,tableCompact:Xe("TABLE_COMPACT")||!1};function Or(e,t){switch(t.type){case"SET_DISPLAY_TYPE":return{...e,displayType:t.payload};case"SET_SERIES_LIMITS":return Je("SERIES_LIMITS",JSON.stringify(t.payload)),{...e,seriesLimits:t.payload};case"TOGGLE_QUERY_TRACING":return{...e,isTracingEnabled:!e.isTracingEnabled};case"TOGGLE_NO_CACHE":return{...e,nocache:!e.nocache};case"TOGGLE_TABLE_COMPACT":return Je("TABLE_COMPACT",!e.tableCompact),{...e,tableCompact:!e.tableCompact};default:throw new Error}}const Pr=(0,r.createContext)({}),Ir=()=>(0,r.useContext)(Pr).state,Rr=()=>(0,r.useContext)(Pr).dispatch,Dr={customStep:ct("g0.step_input",""),yaxis:{limits:{enable:!1,range:{1:[0,0]}}},isHistogram:!1,spanGaps:!1};function zr(e,t){switch(t.type){case"TOGGLE_ENABLE_YAXIS_LIMITS":return{...e,yaxis:{...e.yaxis,limits:{...e.yaxis.limits,enable:!e.yaxis.limits.enable}}};case"SET_CUSTOM_STEP":return{...e,customStep:t.payload};case"SET_YAXIS_LIMITS":return{...e,yaxis:{...e.yaxis,limits:{...e.yaxis.limits,range:t.payload}}};case"SET_IS_HISTOGRAM":return{...e,isHistogram:t.payload};case"SET_SPAN_GAPS":return{...e,spanGaps:t.payload};default:throw new Error}}const Fr=(0,r.createContext)({}),jr=()=>(0,r.useContext)(Fr).state,Hr=()=>(0,r.useContext)(Fr).dispatch,Vr={windows:"Windows",mac:"Mac OS",linux:"Linux"},$r=()=>(Object.values(Vr).find((e=>navigator.userAgent.indexOf(e)>=0))||"unknown")===Vr.mac;function Ur(){const e=Cr(),t=()=>{const e=["Android","webOS","iPhone","iPad","iPod","BlackBerry","Windows Phone"].map((e=>navigator.userAgent.match(new RegExp(e,"i")))).some((e=>e)),t=window.innerWidth<500;return e||t},[n,a]=(0,r.useState)(t());return(0,r.useEffect)((()=>{a(t())}),[e]),{isMobile:n}}const Br={success:Et(Dn,{}),error:Et(Rn,{}),warning:Et(In,{}),info:Et(Pn,{})},qr=e=>{let{variant:t,children:n}=e;const{isDarkTheme:r}=At(),{isMobile:a}=Ur();return Et("div",{className:wr()({"vm-alert":!0,["vm-alert_".concat(t)]:t,"vm-alert_dark":r,"vm-alert_mobile":a}),children:[Et("div",{className:"vm-alert__icon",children:Br[t||"info"]}),Et("div",{className:"vm-alert__content",children:n})]})},Yr=(0,r.createContext)({showInfoMessage:()=>{}}),Wr={dashboardsSettings:[],dashboardsLoading:!1,dashboardsError:""};function Kr(e,t){switch(t.type){case"SET_DASHBOARDS_SETTINGS":return{...e,dashboardsSettings:t.payload};case"SET_DASHBOARDS_LOADING":return{...e,dashboardsLoading:t.payload};case"SET_DASHBOARDS_ERROR":return{...e,dashboardsError:t.payload};default:throw new Error}}const Qr=(0,r.createContext)({}),Zr=()=>(0,r.useContext)(Qr).state,Gr=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce(((e,t)=>n=>{let{children:r}=n;return Et(e,{children:Et(t,{children:r})})}),(e=>{let{children:t}=e;return Et(St.FK,{children:t})}))}(...[e=>{let{children:t}=e;const[n,a]=(0,r.useReducer)(xt,Tt),o=(0,r.useMemo)((()=>({state:n,dispatch:a})),[n,a]);return Et(Nt.Provider,{value:o,children:t})},e=>{let{children:t}=e;const[n,a]=(0,r.useReducer)(hn,dn),o=(0,r.useMemo)((()=>({state:n,dispatch:a})),[n,a]);return Et(mn.Provider,{value:o,children:t})},e=>{let{children:t}=e;const[n,a]=(0,r.useReducer)(kn,wn),o=(0,r.useMemo)((()=>({state:n,dispatch:a})),[n,a]);return Et(xn.Provider,{value:o,children:t})},e=>{let{children:t}=e;const[n,a]=(0,r.useReducer)(Or,Lr),o=(0,r.useMemo)((()=>({state:n,dispatch:a})),[n,a]);return Et(Pr.Provider,{value:o,children:t})},e=>{let{children:t}=e;const[n,a]=(0,r.useReducer)(zr,Dr),o=(0,r.useMemo)((()=>({state:n,dispatch:a})),[n,a]);return Et(Fr.Provider,{value:o,children:t})},e=>{let{children:t}=e;const{isMobile:n}=Ur(),[a,o]=(0,r.useState)({}),[i,l]=(0,r.useState)(!1),[s,c]=(0,r.useState)(void 0);(0,r.useEffect)((()=>{if(!s)return;o({message:s.text,variant:s.type,key:Date.now()}),l(!0);const e=setTimeout(u,4e3);return()=>clearTimeout(e)}),[s]);const u=()=>{c(void 0),l(!1)};return Et(Yr.Provider,{value:{showInfoMessage:c},children:[i&&Et("div",{className:wr()({"vm-snackbar":!0,"vm-snackbar_mobile":n}),children:Et(qr,{variant:a.variant,children:Et("div",{className:"vm-snackbar-content",children:[Et("span",{children:a.message}),Et("div",{className:"vm-snackbar-content__close",onClick:u,children:Et(Ln,{})})]})})}),t]})},e=>{let{children:t}=e;const[n,a]=(0,r.useReducer)(Kr,Wr),o=(0,r.useMemo)((()=>({state:n,dispatch:a})),[n,a]);return Et(Qr.Provider,{value:o,children:t})}]),Jr=e=>{let{activeMenu:t,label:n,value:r,color:a}=e;return Et(Re,{className:wr()({"vm-header-nav-item":!0,"vm-header-nav-item_active":t===r}),style:{color:a},to:r,children:n})},Xr=(e,t,n)=>{const a=(0,r.useCallback)((r=>{const a=null===e||void 0===e?void 0:e.current,o=r.target,i=(null===n||void 0===n?void 0:n.current)&&n.current.contains(o);!a||a.contains((null===r||void 0===r?void 0:r.target)||null)||i||t(r)}),[e,t]);Sr("mousedown",a),Sr("touchstart",a)},ea=e=>{let{variant:t="contained",color:n="primary",size:r="medium",ariaLabel:a,children:o,endIcon:i,startIcon:l,fullWidth:s=!1,className:c,disabled:u,onClick:d,onMouseDown:h}=e;return Et("button",{className:wr()({"vm-button":!0,["vm-button_".concat(t,"_").concat(n)]:!0,["vm-button_".concat(r)]:r,"vm-button_icon":(l||i)&&!o,"vm-button_full-width":s,"vm-button_with-icon":l||i,"vm-button_disabled":u,[c||""]:c}),disabled:u,"aria-label":a,onClick:d,onMouseDown:h,children:Et(St.FK,{children:[l&&Et("span",{className:"vm-button__start-icon",children:l}),o&&Et("span",{children:o}),i&&Et("span",{className:"vm-button__end-icon",children:i})]})})},ta=e=>{let{children:t,buttonRef:n,placement:a="bottom-left",open:o=!1,onClose:i,offset:l={top:6,left:0},clickOutside:s=!0,fullWidth:c,title:u,disabledFullScreen:d,variant:h}=e;const{isMobile:m}=Ur(),p=ae(),f=ne(),[v,g]=(0,r.useState)({width:0,height:0}),[y,_]=(0,r.useState)(!1),b=(0,r.useRef)(null);(0,r.useEffect)((()=>(_(o),!o&&i&&i(),o&&m&&!d&&(document.body.style.overflow="hidden"),()=>{document.body.style.overflow="auto"})),[o]),(0,r.useEffect)((()=>{var e,t;g({width:(null===b||void 0===b||null===(e=b.current)||void 0===e?void 0:e.clientWidth)||0,height:(null===b||void 0===b||null===(t=b.current)||void 0===t?void 0:t.clientHeight)||0}),_(!1)}),[b]);const w=(0,r.useMemo)((()=>{const e=n.current;if(!e||!y)return{};const t=e.getBoundingClientRect(),r={top:0,left:0,width:"auto"},o="bottom-right"===a||"top-right"===a,i=null===a||void 0===a?void 0:a.includes("top"),s=(null===l||void 0===l?void 0:l.top)||0,u=(null===l||void 0===l?void 0:l.left)||0;r.left=r.left=t.left+u,r.top=t.height+t.top+s,o&&(r.left=t.right-v.width),i&&(r.top=t.top-v.height-s);const{innerWidth:d,innerHeight:h}=window,m=r.top+v.height+20>h,p=r.top-20<0,f=r.left+v.width+20>d,g=r.left-20<0;return m&&(r.top=t.top-v.height-s),p&&(r.top=t.height+t.top+s),f&&(r.left=t.right-v.width-u),g&&(r.left=t.left+u),c&&(r.width="".concat(t.width,"px")),r.top<0&&(r.top=20),r.left<0&&(r.left=20),r}),[n,a,y,t,c]),k=()=>{_(!1),i()};(0,r.useEffect)((()=>{if(!b.current||!y||m&&!d)return;const{right:e,width:t}=b.current.getBoundingClientRect();if(e>window.innerWidth){const e=window.innerWidth-20-t;b.current.style.left=e<window.innerWidth?"0":"".concat(e,"px")}}),[y,b]);const x=(0,r.useCallback)((()=>{y&&m&&!d&&(p(f,{replace:!0}),i())}),[y,m,d,f,i]);return Sr("scroll",k),Sr("popstate",x),Xr(b,(()=>{s&&k()}),n),Et(St.FK,{children:(y||!v.width)&&r.default.createPortal(Et("div",{className:wr()({"vm-popper":!0,["vm-popper_".concat(h)]:h,"vm-popper_mobile":m&&!d,"vm-popper_open":(m||Object.keys(w).length)&&y}),ref:b,style:m&&!d?{}:w,children:[(u||m&&!d)&&Et("div",{className:"vm-popper-header",children:[Et("p",{className:"vm-popper-header__title",children:u}),Et(ea,{variant:"text",color:"dark"===h?"white":"primary",size:"small",onClick:e=>{e.stopPropagation(),i()},ariaLabel:"close",children:Et(Ln,{})})]}),t]}),document.body)})},na=e=>{const[t,n]=(0,r.useState)(!!e),a=(0,r.useCallback)((()=>n(!0)),[]),o=(0,r.useCallback)((()=>n(!1)),[]),i=(0,r.useCallback)((()=>n((e=>!e))),[]);return{value:t,setValue:n,setTrue:a,setFalse:o,toggle:i}},ra=e=>{let{activeMenu:t,label:n,color:a,background:o,submenu:i,direction:l}=e;const{pathname:s}=ne(),[c,u]=(0,r.useState)(null),d=(0,r.useRef)(null),{value:h,setFalse:m,setTrue:p}=na(!1),f=()=>{c&&clearTimeout(c);const e=setTimeout(m,300);u(e)};return(0,r.useEffect)((()=>{m()}),[s]),"column"===l?Et(St.FK,{children:i.map((e=>Et(Jr,{activeMenu:t,value:e.value||"",label:e.label||""},e.value)))}):Et("div",{className:wr()({"vm-header-nav-item":!0,"vm-header-nav-item_sub":!0,"vm-header-nav-item_open":h,"vm-header-nav-item_active":i.find((e=>e.value===t))}),style:{color:a},onMouseEnter:()=>{p(),c&&clearTimeout(c)},onMouseLeave:f,ref:d,children:[n,Et(jn,{}),Et(ta,{open:h,placement:"bottom-left",offset:{top:12,left:0},onClose:m,buttonRef:d,children:Et("div",{className:"vm-header-nav-item-submenu",style:{background:o},onMouseLeave:f,onMouseEnter:()=>{c&&clearTimeout(c)},children:i.map((e=>Et(Jr,{activeMenu:t,value:e.value||"",label:e.label||"",color:a},e.value)))})})]})},aa={label:"Explore",submenu:[{label:qe[Ye.metrics].title,value:Ye.metrics},{label:qe[Ye.cardinality].title,value:Ye.cardinality},{label:qe[Ye.topQueries].title,value:Ye.topQueries},{label:qe[Ye.activeQueries].title,value:Ye.activeQueries}]},oa={label:"Tools",submenu:[{label:qe[Ye.trace].title,value:Ye.trace},{label:qe[Ye.queryAnalyzer].title,value:Ye.queryAnalyzer},{label:qe[Ye.withTemplate].title,value:Ye.withTemplate},{label:qe[Ye.relabel].title,value:Ye.relabel}]},ia=[{label:qe[Ye.logs].title,value:Ye.home}],la=[{label:qe[Ye.anomaly].title,value:Ye.home}],sa=[{label:qe[Ye.home].title,value:Ye.home},aa,oa],ca=e=>{let{color:t,background:n,direction:a}=e;const o=Ke(),{dashboardsSettings:i}=Zr(),{pathname:l}=ne(),[s,c]=(0,r.useState)(l),u=(0,r.useMemo)((()=>{switch({NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!1}.REACT_APP_TYPE){case He.logs:return ia;case He.anomaly:return la;default:return[...sa,{label:qe[Ye.dashboards].title,value:Ye.dashboards,hide:o||!i.length}].filter((e=>!e.hide))}}),[o,i]);return(0,r.useEffect)((()=>{c(l)}),[l]),Et("nav",{className:wr()({"vm-header-nav":!0,["vm-header-nav_".concat(a)]:a}),children:u.map((e=>e.submenu?Et(ra,{activeMenu:s,label:e.label||"",submenu:e.submenu,color:t,background:n,direction:a},e.label):Et(Jr,{activeMenu:s,value:e.value||"",label:e.label||"",color:t},e.value)))})},ua=e=>{let{title:t,children:n,onClose:a,className:o,isOpen:i=!0}=e;const{isMobile:l}=Ur(),s=ae(),c=ne(),u=(0,r.useCallback)((e=>{i&&"Escape"===e.key&&a()}),[i]),d=e=>{e.stopPropagation()},h=(0,r.useCallback)((()=>{i&&(s(c,{replace:!0}),a())}),[i,c,a]);return(0,r.useEffect)((()=>{if(i)return document.body.style.overflow="hidden",()=>{document.body.style.overflow="auto"}}),[i]),Sr("popstate",h),Sr("keyup",u),r.default.createPortal(Et("div",{className:wr()({"vm-modal":!0,"vm-modal_mobile":l,["".concat(o)]:o}),onMouseDown:a,children:Et("div",{className:"vm-modal-content",children:[Et("div",{className:"vm-modal-content-header",onMouseDown:d,children:[t&&Et("div",{className:"vm-modal-content-header__title",children:t}),Et("div",{className:"vm-modal-header__close",children:Et(ea,{variant:"text",size:"small",onClick:a,ariaLabel:"close",children:Et(Ln,{})})})]}),Et("div",{className:"vm-modal-content-body",onMouseDown:d,tabIndex:0,children:n})]})}),document.body)},da=e=>{let{children:t,title:n,open:a,placement:o="bottom-center",offset:i={top:6,left:0}}=e;const{isMobile:l}=Ur(),[s,c]=(0,r.useState)(!1),[u,d]=(0,r.useState)({width:0,height:0}),h=(0,r.useRef)(null),m=(0,r.useRef)(null),p=()=>c(!1);(0,r.useEffect)((()=>{if(m.current&&s)return d({width:m.current.clientWidth,height:m.current.clientHeight}),window.addEventListener("scroll",p),()=>{window.removeEventListener("scroll",p)}}),[s,n]);const f=(0,r.useMemo)((()=>{var e;const t=null===h||void 0===h||null===(e=h.current)||void 0===e?void 0:e.base;if(!t||!s)return{};const n=t.getBoundingClientRect(),r={top:0,left:0},a="bottom-right"===o||"top-right"===o,l="bottom-left"===o||"top-left"===o,c=null===o||void 0===o?void 0:o.includes("top"),d=(null===i||void 0===i?void 0:i.top)||0,m=(null===i||void 0===i?void 0:i.left)||0;r.left=n.left-(u.width-n.width)/2+m,r.top=n.height+n.top+d,a&&(r.left=n.right-u.width),l&&(r.left=n.left+m),c&&(r.top=n.top-u.height-d);const{innerWidth:p,innerHeight:f}=window,v=r.top+u.height+20>f,g=r.top-20<0,y=r.left+u.width+20>p,_=r.left-20<0;return v&&(r.top=n.top-u.height-d),g&&(r.top=n.height+n.top+d),y&&(r.left=n.right-u.width-m),_&&(r.left=n.left+m),r.top<0&&(r.top=20),r.left<0&&(r.left=20),r}),[h,o,s,u]),v=()=>{"boolean"!==typeof a&&c(!0)},g=()=>{c(!1)};return(0,r.useEffect)((()=>{"boolean"===typeof a&&c(a)}),[a]),(0,r.useEffect)((()=>{var e;const t=null===h||void 0===h||null===(e=h.current)||void 0===e?void 0:e.base;if(t)return t.addEventListener("mouseenter",v),t.addEventListener("mouseleave",g),()=>{t.removeEventListener("mouseenter",v),t.removeEventListener("mouseleave",g)}}),[h]),Et(St.FK,{children:[Et(r.Fragment,{ref:h,children:t}),!l&&s&&r.default.createPortal(Et("div",{className:"vm-tooltip",ref:m,style:f,children:n}),document.body)]})},ha=Et("code",{children:$r()?"Cmd":"Ctrl"}),ma=[{title:"Zoom in",description:Et(St.FK,{children:["To zoom in, hold down the ",ha," + ",Et("code",{children:"scroll up"}),", or press the ",Et("code",{children:"+"}),". Also, you can zoom in on a range on the graph by holding down your mouse button and selecting the range."]})},{title:"Zoom out",description:Et(St.FK,{children:["To zoom out, hold down the ",ha," + ",Et("code",{children:"scroll down"}),", or press the ",Et("code",{children:"-"}),"."]})},{title:"Move horizontal axis",description:Et(St.FK,{children:["To move the graph, hold down the ",ha," + ",Et("code",{children:"drag"})," the graph to the right or left."]})},{title:"Fixing a tooltip",description:Et(St.FK,{children:["To fix the tooltip, ",Et("code",{children:"click"})," mouse when it's open. Then, you can drag the fixed tooltip by ",Et("code",{children:"clicking"})," and ",Et("code",{children:"dragging"})," on the ",Et(rr,{})," icon."]})},{title:"Set a custom range for the vertical axis",description:Et(St.FK,{children:["To set a custom range for the vertical axis, click on the ",Et(Tn,{})," icon located in the upper right corner of the graph, activate the toggle, and set the values."]})}],pa=[{title:"Show/hide a legend item",description:Et(St.FK,{children:[Et("code",{children:"click"})," on a legend item to isolate it on the graph.",ha," + ",Et("code",{children:"click"})," on a legend item to remove it from the graph. To revert to the previous state, click again."]})},{title:"Copy label key-value pairs",description:Et(St.FK,{children:[Et("code",{children:"click"})," on a label key-value pair to save it to the clipboard."]})},{title:"Collapse/Expand the legend group",description:Et(St.FK,{children:[Et("code",{children:"click"})," on the group name (e.g. ",Et("b",{children:'Query 1: {__name__!=""}'}),") to collapse or expand the legend."]})}],fa=ma.concat(pa),va=()=>{const{value:e,setFalse:t,setTrue:n}=na(!1);return Et(St.FK,{children:[Et(da,{title:"Show tips on working with the graph",children:Et(ea,{variant:"text",color:"gray",startIcon:Et(dr,{}),onClick:n,ariaLabel:"open the tips"})}),e&&Et(ua,{title:"Tips on working with the graph and the legend",onClose:t,children:Et("div",{className:"fc-graph-tips",children:fa.map((e=>{let{title:t,description:n}=e;return Et("div",{className:"fc-graph-tips-item",children:[Et("h4",{className:"fc-graph-tips-item__action",children:t}),Et("p",{className:"fc-graph-tips-item__description",children:n})]},t)}))})})]})},ga=Et("code",{children:$r()?"Cmd":"Ctrl"}),ya=Et(St.FK,{children:[Et("code",{children:$r()?"Option":"Ctrl"})," + ",Et("code",{children:"Space"})]}),_a=[{title:"Query",list:[{keys:Et("code",{children:"Enter"}),description:"Run"},{keys:Et(St.FK,{children:[Et("code",{children:"Shift"})," + ",Et("code",{children:"Enter"})]}),description:"Multi-line queries"},{keys:Et(St.FK,{children:[ga," + ",Et("code",{children:"Arrow Up"})]}),description:"Previous command from the Query history"},{keys:Et(St.FK,{children:[ga," + ",Et("code",{children:"Arrow Down"})]}),description:"Next command from the Query history"},{keys:Et(St.FK,{children:[ga," + ",Et("code",{children:"click"})," by ",Et(Xn,{})]}),description:"Toggle multiple queries"},{keys:ya,description:"Show quick autocomplete tips"}]},{title:"Graph",readMore:Et(va,{}),list:[{keys:Et(St.FK,{children:[ga," + ",Et("code",{children:"scroll Up"})," or ",Et("code",{children:"+"})]}),description:"Zoom in"},{keys:Et(St.FK,{children:[ga," + ",Et("code",{children:"scroll Down"})," or ",Et("code",{children:"-"})]}),description:"Zoom out"},{keys:Et(St.FK,{children:[ga," + ",Et("code",{children:"drag"})]}),description:"Move the graph left/right"},{keys:Et(St.FK,{children:Et("code",{children:"click"})}),description:"Select the series in the legend"},{keys:Et(St.FK,{children:[ga," + ",Et("code",{children:"click"})]}),description:"Toggle multiple series in the legend"}]}],ba="Shortcut keys",wa=$r(),ka=wa?"Cmd + /":"F1",xa=e=>{let{showTitle:t}=e;const n=Ke(),{value:a,setTrue:o,setFalse:i}=na(!1),l=(0,r.useCallback)((e=>{const t=wa&&"/"===e.key&&e.metaKey,n=!wa&&"F1"===e.key&&!e.metaKey;(t||n)&&o()}),[o]);return Sr("keydown",l),Et(St.FK,{children:[Et(da,{open:!0!==t&&void 0,title:"".concat(ba," (").concat(ka,")"),placement:"bottom-center",children:Et(ea,{className:n?"":"vm-header-button",variant:"contained",color:"primary",startIcon:Et(Un,{}),onClick:o,ariaLabel:ba,children:t&&ba})}),a&&Et(ua,{title:"Shortcut keys",onClose:i,children:Et("div",{className:"vm-shortcuts",children:_a.map((e=>Et("div",{className:"vm-shortcuts-section",children:[e.readMore&&Et("div",{className:"vm-shortcuts-section__read-more",children:e.readMore}),Et("h3",{className:"vm-shortcuts-section__title",children:e.title}),Et("div",{className:"vm-shortcuts-section-list",children:e.list.map(((t,n)=>Et("div",{className:"vm-shortcuts-section-list-item",children:[Et("div",{className:"vm-shortcuts-section-list-item__key",children:t.keys}),Et("p",{className:"vm-shortcuts-section-list-item__description",children:t.description})]},"".concat(e.title,"_").concat(n))))})]},e.title)))})})]})},Sa=e=>{let{open:t}=e;return Et("button",{className:wr()({"vm-menu-burger":!0,"vm-menu-burger_opened":t}),"aria-label":"menu",children:Et("span",{})})},{REACT_APP_TYPE:Ca}={},Ea=Ca===He.logs,Na=e=>{let{background:t,color:n}=e;const{pathname:a}=ne(),{isMobile:o}=Ur(),i=(0,r.useRef)(null),{value:l,toggle:s,setFalse:c}=na(!1);return(0,r.useEffect)(c,[a]),Xr(i,c),Et("div",{className:"vm-header-sidebar",ref:i,children:[Et("div",{className:wr()({"vm-header-sidebar-button":!0,"vm-header-sidebar-button_open":l}),onClick:s,children:Et(Sa,{open:l})}),Et("div",{className:wr()({"vm-header-sidebar-menu":!0,"vm-header-sidebar-menu_open":l}),children:[Et("div",{children:Et(ca,{color:n,background:t,direction:"column"})}),Et("div",{className:"vm-header-sidebar-menu-settings",children:!o&&!Ea&&Et(xa,{showTitle:!0})})]})]})},Aa=e=>{let{controlsComponent:t,isMobile:n,...a}=e;const o=Ke(),{pathname:i}=ne(),{accountIds:l}=(()=>{const{useTenantID:e}=We(),t=Ke(),{serverUrl:n}=At(),[a,o]=(0,r.useState)(!1),[i,l]=(0,r.useState)(),[s,c]=(0,r.useState)([]),u=(0,r.useMemo)((()=>"".concat(n.replace(/^(.+)(\/select.+)/,"$1"),"/admin/tenants")),[n]),d=(0,r.useMemo)((()=>!!Ge(n)),[n]),h=t?!e:!d;return(0,r.useEffect)((()=>{h||(async()=>{o(!0);try{const e=await fetch(u),t=await e.json(),n=t.data||[];c(n.sort(((e,t)=>e.localeCompare(t)))),e.ok?l(void 0):l("".concat(t.errorType,"\r\n").concat(null===t||void 0===t?void 0:t.error))}catch(Ap){Ap instanceof Error&&l("".concat(Ap.name,": ").concat(Ap.message))}o(!1)})().catch(console.error)}),[u]),{accountIds:s,isLoading:a,error:i}})(),{value:s,toggle:c,setFalse:u}=na(!1),d=Et(t,{...a,isMobile:n,accountIds:l,headerSetup:(0,r.useMemo)((()=>(qe[i]||{}).header||{}),[i])});return n?Et(St.FK,{children:[Et("div",{children:Et(ea,{className:wr()({"vm-header-button":!o}),startIcon:Et(cr,{}),onClick:c,ariaLabel:"controls"})}),Et(ua,{title:"Controls",onClose:u,isOpen:s,className:wr()({"vm-header-controls-modal":!0,"vm-header-controls-modal_open":s}),children:d})]}):d},{REACT_APP_TYPE:Ma}={},Ta=Ma===He.logs||Ma===He.anomaly,La=()=>{switch(Ma){case He.logs:return Et(Nn,{});case He.anomaly:return Et(An,{});default:return Et(En,{})}},Oa=e=>{let{controlsComponent:t}=e;const{isMobile:n}=Ur(),a=Cr(),o=(0,r.useMemo)((()=>window.innerWidth<1e3),[a]),{isDarkTheme:i}=At(),l=Ke(),s=(0,r.useMemo)((()=>vt(i?"color-background-block":"color-primary")),[i]),{background:c,color:u}=(0,r.useMemo)((()=>{const{headerStyles:{background:e=(l?"#FFF":s),color:t=(l?s:"#FFF")}={}}=We();return{background:e,color:t}}),[s]),d=ae(),h=()=>{d({pathname:Ye.home}),window.location.reload()};return Et("header",{className:wr()({"vm-header":!0,"vm-header_app":l,"vm-header_dark":i,"vm-header_sidebar":o,"vm-header_mobile":n}),style:{background:c,color:u},children:[o?Et(Na,{background:c,color:u}):Et(St.FK,{children:[!l&&Et("div",{className:wr()({"vm-header-logo":!0,"vm-header-logo_logs":Ta}),onClick:h,style:{color:u},children:Et(La,{})}),Et(ca,{color:u,background:c})]}),o&&Et("div",{className:wr()({"vm-header-logo":!0,"vm-header-logo_mobile":!0,"vm-header-logo_logs":Ta}),onClick:h,style:{color:u},children:Et(La,{})}),Et(Aa,{controlsComponent:t,displaySidebar:o,isMobile:n})]})},Pa={href:"https://github.com/VictoriaMetrics/VictoriaMetrics/issues/new/choose",Icon:ir,title:"Create an issue"},Ia=[{href:"https://docs.victoriametrics.com/MetricsQL.html",Icon:Kn,title:"MetricsQL"},{href:"https://docs.victoriametrics.com/#vmui",Icon:or,title:"Documentation"},Pa],Ra=(0,r.memo)((e=>{let{links:t=Ia}=e;const n="2019-".concat((new Date).getFullYear());return Et("footer",{className:"vm-footer",children:[Et("a",{className:"vm-link vm-footer__website",target:"_blank",href:"https://victoriametrics.com/",rel:"me noreferrer",children:[Et(Mn,{}),"victoriametrics.com"]}),t.map((e=>{let{href:t,Icon:n,title:r}=e;return Et("a",{className:"vm-link vm-footer__link",target:"_blank",href:t,rel:"help noreferrer",children:[Et(n,{}),r]},"".concat(t,"-").concat(r))})),Et("div",{className:"vm-footer__copyright",children:["\xa9 ",n," VictoriaMetrics"]})]})})),Da=Ra,za=()=>{const e=Ke(),{serverUrl:t}=At(),n=(0,r.useContext)(Qr).dispatch,[a,o]=(0,r.useState)(!1),[i,l]=(0,r.useState)(""),[s,c]=(0,r.useState)([]),u=async()=>{try{const e=window.__VMUI_PREDEFINED_DASHBOARDS__;if(null===e||void 0===e||!e.length)return[];const t=await Promise.all(e.map((async e=>(async e=>{const t=await fetch("./dashboards/".concat(e));return await t.json()})(e))));c((e=>[...t,...e]))}catch(Ap){Ap instanceof Error&&l("".concat(Ap.name,": ").concat(Ap.message))}};return(0,r.useEffect)((()=>{e||(c([]),(async()=>{if(t&&!{NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!1}.REACT_APP_TYPE){l(""),o(!0);try{const e=await fetch("".concat(t,"/vmui/custom-dashboards")),n=await e.json();if(e.ok){const{dashboardsSettings:e}=n;e&&e.length>0?c((t=>[...t,...e])):await u(),o(!1)}else await u(),l(n.error),o(!1)}catch(Ap){o(!1),Ap instanceof Error&&l("".concat(Ap.name,": ").concat(Ap.message)),await u()}}})())}),[t]),(0,r.useEffect)((()=>{n({type:"SET_DASHBOARDS_SETTINGS",payload:s})}),[s]),(0,r.useEffect)((()=>{n({type:"SET_DASHBOARDS_LOADING",payload:a})}),[a]),(0,r.useEffect)((()=>{n({type:"SET_DASHBOARDS_ERROR",payload:i})}),[i]),{dashboardsSettings:s,isLoading:a,error:i}},Fa=e=>{let{error:t,warning:n,info:a}=e;const o=(0,r.useRef)(null),[i,l]=(0,r.useState)(!1),[s,c]=(0,r.useState)(!1),u=(0,r.useMemo)((()=>t?"ERROR: ":n?"WARNING: ":""),[t,n]),d="".concat(u).concat(t||n||a),h=()=>{const e=o.current;if(e){const{offsetWidth:t,scrollWidth:n,offsetHeight:r,scrollHeight:a}=e;l(t+1<n||r+1<a)}else l(!1)};return(0,r.useEffect)((()=>{c(!1),h()}),[o,d]),Sr("resize",h),t||n||a?Et("span",{className:wr()({"vm-text-field__error":!0,"vm-text-field__warning":n&&!t,"vm-text-field__helper-text":!n&&!t,"vm-text-field__error_overflowed":i,"vm-text-field__error_full":s}),"data-show":!!d,ref:o,onClick:()=>{i&&(c(!0),l(!1))},children:d}):null},ja=e=>{let{label:t,value:n,type:a="text",error:o="",warning:i="",helperText:l="",placeholder:s,endIcon:c,startIcon:u,disabled:d=!1,autofocus:h=!1,inputmode:m="text",caretPosition:p,onChange:f,onEnter:v,onKeyDown:g,onFocus:y,onBlur:_,onChangeCaret:b}=e;const{isDarkTheme:w}=At(),{isMobile:k}=Ur(),x=(0,r.useRef)(null),S=(0,r.useRef)(null),C=(0,r.useMemo)((()=>"textarea"===a?S:x),[a]),[E,N]=(0,r.useState)([0,0]),A=wr()({"vm-text-field__input":!0,"vm-text-field__input_error":o,"vm-text-field__input_warning":!o&&i,"vm-text-field__input_icon-start":u,"vm-text-field__input_disabled":d,"vm-text-field__input_textarea":"textarea"===a}),M=e=>{const{selectionStart:t,selectionEnd:n}=e;N([t||0,n||0])},T=e=>{M(e.currentTarget)},L=e=>{g&&g(e);const{key:t,ctrlKey:n,metaKey:r}=e,o="Enter"===t;("textarea"!==a?o:o&&(r||n))&&v&&(e.preventDefault(),v())},O=e=>{M(e.currentTarget)},P=e=>{d||(f&&f(e.currentTarget.value),M(e.currentTarget))},I=()=>{y&&y()},R=()=>{_&&_()},D=e=>{try{C.current&&C.current.setSelectionRange(e[0],e[1])}catch(Ap){return Ap}};return(0,r.useEffect)((()=>{var e;h&&!k&&(null===C||void 0===C||null===(e=C.current)||void 0===e?void 0:e.focus)&&C.current.focus()}),[C,h]),(0,r.useEffect)((()=>{b&&b(E)}),[E]),(0,r.useEffect)((()=>{D(E)}),[n]),(0,r.useEffect)((()=>{p&&D(p)}),[p]),Et("label",{className:wr()({"vm-text-field":!0,"vm-text-field_textarea":"textarea"===a,"vm-text-field_dark":w}),"data-replicated-value":n,children:[u&&Et("div",{className:"vm-text-field__icon-start",children:u}),c&&Et("div",{className:"vm-text-field__icon-end",children:c}),"textarea"===a?Et("textarea",{className:A,disabled:d,ref:S,value:n,rows:1,inputMode:m,placeholder:s,autoCapitalize:"none",onInput:P,onKeyDown:L,onKeyUp:O,onFocus:I,onBlur:R,onMouseUp:T}):Et("input",{className:A,disabled:d,ref:x,value:n,type:a,placeholder:s,inputMode:m,autoCapitalize:"none",onInput:P,onKeyDown:L,onKeyUp:O,onFocus:I,onBlur:R,onMouseUp:T}),t&&Et("span",{className:"vm-text-field__label",children:t}),Et(Fa,{error:o,warning:i,info:l})]})},Ha=e=>{let{accountIds:t}=e;const n=Ke(),{isMobile:a}=Ur(),{tenantId:o,serverUrl:i}=At(),l=Mt(),s=fn(),[c,u]=(0,r.useState)(""),d=(0,r.useRef)(null),{value:h,toggle:m,setFalse:p}=na(!1),f=(0,r.useMemo)((()=>{if(!c)return t;try{const e=new RegExp(c,"i");return t.filter((t=>e.test(t))).sort(((t,n)=>{var r,a;return((null===(r=t.match(e))||void 0===r?void 0:r.index)||0)-((null===(a=n.match(e))||void 0===a?void 0:a.index)||0)}))}catch(Ap){return[]}}),[c,t]),v=(0,r.useMemo)((()=>t.length>1),[t]),g=e=>()=>{const t=e;if(l({type:"SET_TENANT_ID",payload:t}),i){const e=Ze(i,t);if(e===i)return;l({type:"SET_SERVER",payload:e}),s({type:"RUN_QUERY"})}p()};return(0,r.useEffect)((()=>{const e=Ge(i);o&&o!==e?g(o)():g(e)()}),[i]),v?Et("div",{className:"vm-tenant-input",children:[Et(da,{title:"Define Tenant ID if you need request to another storage",children:Et("div",{ref:d,children:a?Et("div",{className:"vm-mobile-option",onClick:m,children:[Et("span",{className:"vm-mobile-option__icon",children:Et(sr,{})}),Et("div",{className:"vm-mobile-option-text",children:[Et("span",{className:"vm-mobile-option-text__label",children:"Tenant ID"}),Et("span",{className:"vm-mobile-option-text__value",children:o})]}),Et("span",{className:"vm-mobile-option__arrow",children:Et(Fn,{})})]}):Et(ea,{className:n?"":"vm-header-button",variant:"contained",color:"primary",fullWidth:!0,startIcon:Et(sr,{}),endIcon:Et("div",{className:wr()({"vm-execution-controls-buttons__arrow":!0,"vm-execution-controls-buttons__arrow_open":h}),children:Et(Fn,{})}),onClick:m,children:o})})}),Et(ta,{open:h,placement:"bottom-right",onClose:p,buttonRef:d,title:a?"Define Tenant ID":void 0,children:Et("div",{className:wr()({"vm-list vm-tenant-input-list":!0,"vm-list vm-tenant-input-list_mobile":a}),children:[Et("div",{className:"vm-tenant-input-list__search",children:Et(ja,{autofocus:!0,label:"Search",value:c,onChange:u,type:"search"})}),f.map((e=>Et("div",{className:wr()({"vm-list-item":!0,"vm-list-item_mobile":a,"vm-list-item_active":e===o}),onClick:g(e),children:e},e)))]})})]}):null};const Va=function(e){const t=(0,r.useRef)();return(0,r.useEffect)((()=>{t.current=e}),[e]),t.current},$a=()=>{const e=Ke(),{isMobile:t}=Ur(),{customStep:n,isHistogram:a}=jr(),{period:{step:o,end:i,start:l}}=pn(),s=Hr(),c=Va(i-l),u=(0,r.useMemo)((()=>Qt(i-l,a)),[o,a]),[d,h]=(0,r.useState)(n||u),[m,p]=(0,r.useState)(""),{value:f,toggle:v,setFalse:g}=na(!1),y=(0,r.useRef)(null),_=e=>{const t=e||d||u||"1s",n=(t.match(/[a-zA-Z]+/g)||[]).length?t:"".concat(t,"s");s({type:"SET_CUSTOM_STEP",payload:n}),h(n),p("")},b=()=>{_(),g()},w=e=>{const t=e.match(/[-+]?([0-9]*\.[0-9]+|[0-9]+)/g)||[],n=e.match(/[a-zA-Z]+/g)||[],r=t.length&&t.every((e=>parseFloat(e)>0)),a=n.every((e=>$t.find((t=>t.short===e)))),o=r&&a;h(e),p(o?"":mt.validStep)};return(0,r.useEffect)((()=>{n&&_(n)}),[n]),(0,r.useEffect)((()=>{!n&&u&&_(u)}),[u]),(0,r.useEffect)((()=>{i-l!==c&&c&&u&&_(u)}),[i,l,c,u]),(0,r.useEffect)((()=>{o!==n&&o!==u||_(u)}),[a]),Et("div",{className:"vm-step-control",ref:y,children:[t?Et("div",{className:"vm-mobile-option",onClick:v,children:[Et("span",{className:"vm-mobile-option__icon",children:Et(ar,{})}),Et("div",{className:"vm-mobile-option-text",children:[Et("span",{className:"vm-mobile-option-text__label",children:"Step"}),Et("span",{className:"vm-mobile-option-text__value",children:d})]}),Et("span",{className:"vm-mobile-option__arrow",children:Et(Fn,{})})]}):Et(da,{title:"Query resolution step width",children:Et(ea,{className:e?"":"vm-header-button",variant:"contained",color:"primary",startIcon:Et(ar,{}),onClick:v,children:Et("p",{children:["STEP",Et("p",{className:"vm-step-control__value",children:d})]})})}),Et(ta,{open:f,placement:"bottom-right",onClose:b,buttonRef:y,title:t?"Query resolution step width":void 0,children:Et("div",{className:wr()({"vm-step-control-popper":!0,"vm-step-control-popper_mobile":t}),children:[Et(ja,{autofocus:!0,label:"Step value",value:d,error:m,onChange:w,onEnter:()=>{_(),b()},onFocus:()=>{document.activeElement instanceof HTMLInputElement&&document.activeElement.select()},onBlur:_,endIcon:Et(da,{title:"Set default step value: ".concat(u),children:Et(ea,{size:"small",variant:"text",color:"primary",startIcon:Et(On,{}),onClick:()=>{const e=u||"1s";w(e),_(e)},ariaLabel:"reset step"})})}),Et("div",{className:"vm-step-control-popper-info",children:[Et("code",{children:"step"})," - the ",Et("a",{className:"vm-link vm-link_colored",href:"https://prometheus.io/docs/prometheus/latest/querying/basics/#time-durations",target:"_blank",rel:"noreferrer",children:"interval"}),"between datapoints, which must be returned from the range query. The ",Et("code",{children:"query"})," is executed at",Et("code",{children:"start"}),", ",Et("code",{children:"start+step"}),", ",Et("code",{children:"start+2*step"}),", \u2026, ",Et("code",{children:"end"})," timestamps.",Et("a",{className:"vm-link vm-link_colored",href:"https://docs.victoriametrics.com/keyConcepts.html#range-query",target:"_blank",rel:"help noreferrer",children:"Read more about Range query"})]})]})})]})},Ua=e=>{let{relativeTime:t,setDuration:n}=e;const{isMobile:r}=Ur();return Et("div",{className:wr()({"vm-time-duration":!0,"vm-time-duration_mobile":r}),children:nn.map((e=>{let{id:a,duration:o,until:i,title:l}=e;return Et("div",{className:wr()({"vm-list-item":!0,"vm-list-item_mobile":r,"vm-list-item_active":a===t}),onClick:(s={duration:o,until:i(),id:a},()=>{n(s)}),children:l||o},a);var s}))})},Ba=e=>{let{viewDate:t,showArrowNav:n,onChangeViewDate:r,toggleDisplayYears:a}=e;return Et("div",{className:"vm-calendar-header",children:[Et("div",{className:"vm-calendar-header-left",onClick:a,children:[Et("span",{className:"vm-calendar-header-left__date",children:t.format("MMMM YYYY")}),Et("div",{className:"vm-calendar-header-left__select-year",children:Et(jn,{})})]}),n&&Et("div",{className:"vm-calendar-header-right",children:[Et("div",{className:"vm-calendar-header-right__prev",onClick:()=>{r(t.subtract(1,"month"))},children:Et(Fn,{})}),Et("div",{className:"vm-calendar-header-right__next",onClick:()=>{r(t.add(1,"month"))},children:Et(Fn,{})})]})]})},qa=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Ya=e=>{let{viewDate:t,selectDate:n,onChangeSelectDate:a}=e;const i="YYYY-MM-DD",l=o().tz(),s=o()(t.format(i)),c=(0,r.useMemo)((()=>{const e=new Array(42).fill(null),t=s.startOf("month"),n=s.endOf("month").diff(t,"day")+1,r=new Array(n).fill(t).map(((e,t)=>e.add(t,"day"))),a=t.day();return e.splice(a,n,...r),e}),[s]),u=e=>()=>{e&&a(e)};return Et("div",{className:"vm-calendar-body",children:[qa.map((e=>Et(da,{title:e,children:Et("div",{className:"vm-calendar-body-cell vm-calendar-body-cell_weekday",children:e[0]})},e))),c.map(((e,t)=>Et("div",{className:wr()({"vm-calendar-body-cell":!0,"vm-calendar-body-cell_day":!0,"vm-calendar-body-cell_day_empty":!e,"vm-calendar-body-cell_day_active":(e&&e.format(i))===n.format(i),"vm-calendar-body-cell_day_today":(e&&e.format(i))===l.format(i)}),onClick:u(e),children:e&&e.format("D")},e?e.format(i):t)))]})},Wa=e=>{let{viewDate:t,onChangeViewDate:n}=e;const a=o()().format("YYYY"),i=(0,r.useMemo)((()=>t.format("YYYY")),[t]),l=(0,r.useMemo)((()=>{const e=o()().subtract(9,"year");return new Array(18).fill(e).map(((e,t)=>e.add(t,"year")))}),[t]);(0,r.useEffect)((()=>{const e=document.getElementById("vm-calendar-year-".concat(i));e&&e.scrollIntoView({block:"center"})}),[]);return Et("div",{className:"vm-calendar-years",children:l.map((e=>{return Et("div",{className:wr()({"vm-calendar-years__year":!0,"vm-calendar-years__year_selected":e.format("YYYY")===i,"vm-calendar-years__year_today":e.format("YYYY")===a}),id:"vm-calendar-year-".concat(e.format("YYYY")),onClick:(t=e,()=>{n(t)}),children:e.format("YYYY")},e.format("YYYY"));var t}))})},Ka=e=>{let{viewDate:t,selectDate:n,onChangeViewDate:a}=e;const i=o()().format("MM"),l=(0,r.useMemo)((()=>n.format("MM")),[n]),s=(0,r.useMemo)((()=>new Array(12).fill("").map(((e,n)=>o()(t).month(n)))),[t]);(0,r.useEffect)((()=>{const e=document.getElementById("vm-calendar-year-".concat(l));e&&e.scrollIntoView({block:"center"})}),[]);return Et("div",{className:"vm-calendar-years",children:s.map((e=>{return Et("div",{className:wr()({"vm-calendar-years__year":!0,"vm-calendar-years__year_selected":e.format("MM")===l,"vm-calendar-years__year_today":e.format("MM")===i}),id:"vm-calendar-year-".concat(e.format("MM")),onClick:(t=e,()=>{a(t)}),children:e.format("MMMM")},e.format("MM"));var t}))})};var Qa=function(e){return e[e.days=0]="days",e[e.months=1]="months",e[e.years=2]="years",e}(Qa||{});const Za=e=>{let{date:t,format:n=Ot,onChange:a}=e;const[i,l]=(0,r.useState)(Qa.days),[s,c]=(0,r.useState)(o().tz(t)),[u,d]=(0,r.useState)(o().tz(t)),h=o().tz(),m=h.format(Lt)===s.format(Lt),{isMobile:p}=Ur(),f=e=>{c(e),l((e=>e===Qa.years?Qa.months:Qa.days))};return(0,r.useEffect)((()=>{u.format()!==o().tz(t).format()&&a(u.format(n))}),[u]),(0,r.useEffect)((()=>{const e=o().tz(t);c(e),d(e)}),[t]),Et("div",{className:wr()({"vm-calendar":!0,"vm-calendar_mobile":p}),children:[Et(Ba,{viewDate:s,onChangeViewDate:f,toggleDisplayYears:()=>{l((e=>e===Qa.years?Qa.days:Qa.years))},showArrowNav:i===Qa.days}),i===Qa.days&&Et(Ya,{viewDate:s,selectDate:u,onChangeSelectDate:e=>{d(e)}}),i===Qa.years&&Et(Wa,{viewDate:s,onChangeViewDate:f}),i===Qa.months&&Et(Ka,{selectDate:u,viewDate:s,onChangeViewDate:f}),!m&&i===Qa.days&&Et("div",{className:"vm-calendar-footer",children:Et(ea,{variant:"text",size:"small",onClick:()=>{c(h)},children:"show today"})})]})},Ga=(0,r.forwardRef)(((e,t)=>{let{date:n,targetRef:a,format:i=Ot,onChange:l,label:s}=e;const c=(0,r.useMemo)((()=>o()(n).isValid()?o().tz(n):o()().tz()),[n]),{isMobile:u}=Ur(),{value:d,toggle:h,setFalse:m}=na(!1);return Sr("click",h,a),Sr("keyup",(e=>{"Escape"!==e.key&&"Enter"!==e.key||m()})),Et(St.FK,{children:Et(ta,{open:d,buttonRef:a,placement:"bottom-right",onClose:m,title:u?s:void 0,children:Et("div",{ref:t,children:Et(Za,{date:c,format:i,onChange:e=>{l(e),m()}})})})})}));var Ja=n(494),Xa=n.n(Ja);const eo=e=>o()(e).isValid()?o().tz(e).format(Ot):e,to=e=>{let{value:t="",label:n,pickerLabel:a,pickerRef:i,onChange:l,onEnter:s}=e;const c=(0,r.useRef)(null),[u,d]=(0,r.useState)(null),[h,m]=(0,r.useState)(eo(t)),[p,f]=(0,r.useState)(!1),[v,g]=(0,r.useState)(!1),y=o()(h).isValid()?"":"Invalid date format";return(0,r.useEffect)((()=>{const e=eo(t);e!==h&&m(e),v&&(s(),g(!1))}),[t]),(0,r.useEffect)((()=>{p&&u&&(u.focus(),u.setSelectionRange(11,11),f(!1))}),[p]),Et("div",{className:wr()({"vm-date-time-input":!0,"vm-date-time-input_error":y}),children:[Et("label",{children:n}),Et(Xa(),{tabIndex:1,inputRef:d,mask:"9999-99-99 99:99:99",placeholder:"YYYY-MM-DD HH:mm:ss",value:h,autoCapitalize:"none",inputMode:"numeric",maskChar:null,onChange:e=>{m(e.currentTarget.value)},onBlur:()=>{l(h)},onKeyUp:e=>{"Enter"===e.key&&(l(h),g(!0))}}),y&&Et("span",{className:"vm-date-time-input__error-text",children:y}),Et("div",{className:"vm-date-time-input__icon",ref:c,children:Et(ea,{variant:"text",color:"gray",size:"small",startIcon:Et(Vn,{}),ariaLabel:"calendar"})}),Et(Ga,{label:a,ref:i,date:h,onChange:e=>{m(e),f(!0)},targetRef:c})]})},no=()=>{const{isMobile:e}=Ur(),{isDarkTheme:t}=At(),n=(0,r.useRef)(null),a=Cr(),i=(0,r.useMemo)((()=>a.width>1120),[a]),[l,s]=(0,r.useState)(),[c,u]=(0,r.useState)(),{period:{end:d,start:h},relativeTime:m,timezone:p,duration:f}=pn(),v=fn(),g=Ke(),y=Va(p),{value:_,toggle:b,setFalse:w}=na(!1),k=(0,r.useMemo)((()=>({region:p,utc:an(p)})),[p]);(0,r.useEffect)((()=>{s(Jt(en(d)))}),[p,d]),(0,r.useEffect)((()=>{u(Jt(en(h)))}),[p,h]);const x=e=>{let{duration:t,until:n,id:r}=e;v({type:"SET_RELATIVE_TIME",payload:{duration:t,until:n,id:r}}),w()},S=(0,r.useMemo)((()=>({start:o().tz(en(h)).format(Ot),end:o().tz(en(d)).format(Ot)})),[h,d,p]),C=(0,r.useMemo)((()=>m&&"none"!==m?m.replace(/_/g," "):"".concat(S.start," - ").concat(S.end)),[m,S]),E=(0,r.useRef)(null),N=(0,r.useRef)(null),A=(0,r.useRef)(null),M=()=>{c&&l&&v({type:"SET_PERIOD",payload:{from:o().tz(c).toDate(),to:o().tz(l).toDate()}}),w()};return(0,r.useEffect)((()=>{const e=rn({relativeTimeId:m,defaultDuration:f,defaultEndInput:en(d)});y&&p!==y&&x({id:e.relativeTimeId,duration:e.duration,until:e.endInput})}),[p,y]),Xr(n,(t=>{var n,r;if(e)return;const a=t.target,o=(null===E||void 0===E?void 0:E.current)&&(null===E||void 0===E||null===(n=E.current)||void 0===n?void 0:n.contains(a)),i=(null===N||void 0===N?void 0:N.current)&&(null===N||void 0===N||null===(r=N.current)||void 0===r?void 0:r.contains(a));o||i||w()})),Et(St.FK,{children:[Et("div",{ref:A,children:e?Et("div",{className:"vm-mobile-option",onClick:b,children:[Et("span",{className:"vm-mobile-option__icon",children:Et(Hn,{})}),Et("div",{className:"vm-mobile-option-text",children:[Et("span",{className:"vm-mobile-option-text__label",children:"Time range"}),Et("span",{className:"vm-mobile-option-text__value",children:C})]}),Et("span",{className:"vm-mobile-option__arrow",children:Et(Fn,{})})]}):Et(da,{title:i?"Time range controls":C,children:Et(ea,{className:g?"":"vm-header-button",variant:"contained",color:"primary",startIcon:Et(Hn,{}),onClick:b,ariaLabel:"time range controls",children:i&&Et("span",{children:C})})})}),Et(ta,{open:_,buttonRef:A,placement:"bottom-right",onClose:w,clickOutside:!1,title:e?"Time range controls":"",children:Et("div",{className:wr()({"vm-time-selector":!0,"vm-time-selector_mobile":e}),ref:n,children:[Et("div",{className:"vm-time-selector-left",children:[Et("div",{className:wr()({"vm-time-selector-left-inputs":!0,"vm-time-selector-left-inputs_dark":t}),children:[Et(to,{value:c,label:"From:",pickerLabel:"Date From",pickerRef:E,onChange:u,onEnter:M}),Et(to,{value:l,label:"To:",pickerLabel:"Date To",pickerRef:N,onChange:s,onEnter:M})]}),Et("div",{className:"vm-time-selector-left-timezone",children:[Et("div",{className:"vm-time-selector-left-timezone__title",children:k.region}),Et("div",{className:"vm-time-selector-left-timezone__utc",children:k.utc})]}),Et(ea,{variant:"text",startIcon:Et($n,{}),onClick:()=>v({type:"RUN_QUERY_TO_NOW"}),children:"switch to now"}),Et("div",{className:"vm-time-selector-left__controls",children:[Et(ea,{color:"error",variant:"outlined",onClick:()=>{s(Jt(en(d))),u(Jt(en(h))),w()},children:"Cancel"}),Et(ea,{color:"primary",onClick:M,children:"Apply"})]})]}),Et(Ua,{relativeTime:m||"",setDuration:x})]})})]})},ro=()=>{const e=ae(),[t,n]=je();return{setSearchParamsFromKeys:(0,r.useCallback)((r=>{const a=!!Array.from(t.values()).length;let o=!1;Object.entries(r).forEach((e=>{let[n,r]=e;t.get(n)!=="".concat(r)&&(t.set(n,"".concat(r)),o=!0)})),o&&(a?n(t):e("?".concat(t.toString()),{replace:!0}))}),[t,e])}},ao=()=>{const{isMobile:e}=Ur(),t=Ke(),n=(0,r.useRef)(null),[a]=je(),{setSearchParamsFromKeys:i}=ro(),l=a.get("date")||o()().tz().format(Lt),s=(0,r.useMemo)((()=>o().tz(l).format(Lt)),[l]),c=e=>{i({date:e})};return(0,r.useEffect)((()=>{c(l)}),[]),Et("div",{children:[Et("div",{ref:n,children:e?Et("div",{className:"vm-mobile-option",children:[Et("span",{className:"vm-mobile-option__icon",children:Et(Vn,{})}),Et("div",{className:"vm-mobile-option-text",children:[Et("span",{className:"vm-mobile-option-text__label",children:"Date control"}),Et("span",{className:"vm-mobile-option-text__value",children:s})]}),Et("span",{className:"vm-mobile-option__arrow",children:Et(Fn,{})})]}):Et(da,{title:"Date control",children:Et(ea,{className:t?"":"vm-header-button",variant:"contained",color:"primary",startIcon:Et(Vn,{}),children:s})})}),Et(Ga,{label:"Date control",date:l||"",format:Lt,onChange:c,targetRef:n})]})},oo=[{seconds:0,title:"Off"},{seconds:1,title:"1s"},{seconds:2,title:"2s"},{seconds:5,title:"5s"},{seconds:10,title:"10s"},{seconds:30,title:"30s"},{seconds:60,title:"1m"},{seconds:300,title:"5m"},{seconds:900,title:"15m"},{seconds:1800,title:"30m"},{seconds:3600,title:"1h"},{seconds:7200,title:"2h"}],io=()=>{const{isMobile:e}=Ur(),t=fn(),n=Ke(),[a,o]=(0,r.useState)(!1),[i,l]=(0,r.useState)(oo[0]),{value:s,toggle:c,setFalse:u}=na(!1),d=(0,r.useRef)(null);(0,r.useEffect)((()=>{const e=i.seconds;let n;return a?n=setInterval((()=>{t({type:"RUN_QUERY"})}),1e3*e):l(oo[0]),()=>{n&&clearInterval(n)}}),[i,a]);const h=e=>()=>{(e=>{(a&&!e.seconds||!a&&e.seconds)&&o((e=>!e)),l(e),u()})(e)};return Et(St.FK,{children:[Et("div",{className:"vm-execution-controls",children:Et("div",{className:wr()({"vm-execution-controls-buttons":!0,"vm-execution-controls-buttons_mobile":e,"vm-header-button":!n}),children:[!e&&Et(da,{title:"Refresh dashboard",children:Et(ea,{variant:"contained",color:"primary",onClick:()=>{t({type:"RUN_QUERY"})},startIcon:Et(zn,{}),ariaLabel:"refresh dashboard"})}),e?Et("div",{className:"vm-mobile-option",onClick:c,children:[Et("span",{className:"vm-mobile-option__icon",children:Et(On,{})}),Et("div",{className:"vm-mobile-option-text",children:[Et("span",{className:"vm-mobile-option-text__label",children:"Auto-refresh"}),Et("span",{className:"vm-mobile-option-text__value",children:i.title})]}),Et("span",{className:"vm-mobile-option__arrow",children:Et(Fn,{})})]}):Et(da,{title:"Auto-refresh control",children:Et("div",{ref:d,children:Et(ea,{variant:"contained",color:"primary",fullWidth:!0,endIcon:Et("div",{className:wr()({"vm-execution-controls-buttons__arrow":!0,"vm-execution-controls-buttons__arrow_open":s}),children:Et(Fn,{})}),onClick:c,children:i.title})})})]})}),Et(ta,{open:s,placement:"bottom-right",onClose:u,buttonRef:d,title:e?"Auto-refresh duration":void 0,children:Et("div",{className:wr()({"vm-execution-controls-list":!0,"vm-execution-controls-list_mobile":e}),children:oo.map((t=>Et("div",{className:wr()({"vm-list-item":!0,"vm-list-item_mobile":e,"vm-list-item_active":t.seconds===i.seconds}),onClick:h(t),children:t.title},t.seconds)))})})]})},lo="Enable to save the modified server URL to local storage, preventing reset upon page refresh.",so="Disable to stop saving the server URL to local storage, reverting to the default URL on page refresh.",co=e=>{let{serverUrl:t,stateServerUrl:n,onChange:a,onEnter:o}=e;const{value:i,toggle:l}=na(!!Xe("SERVER_URL")),[s,c]=(0,r.useState)("");return(0,r.useEffect)((()=>{n||c(mt.emptyServer),_t(n)||c(mt.validServer)}),[n]),(0,r.useEffect)((()=>{i?Je("SERVER_URL",t):et(["SERVER_URL"])}),[i]),(0,r.useEffect)((()=>{i&&Je("SERVER_URL",t)}),[t]),Et("div",{children:[Et("div",{className:"vm-server-configurator__title",children:"Server URL"}),Et("div",{className:"vm-server-configurator-url",children:[Et(ja,{autofocus:!0,value:t,error:s,onChange:e=>{a(e||""),c("")},onEnter:o,inputmode:"url"}),Et(da,{title:i?so:lo,children:Et(ea,{className:"vm-server-configurator-url__button",variant:"text",color:i?"primary":"gray",onClick:l,startIcon:Et(sr,{})})})]})]})},uo=[{label:"Graph",type:ht.chart},{label:"JSON",type:ht.code},{label:"Table",type:ht.table}],ho=e=>{let{limits:t,onChange:n,onEnter:a}=e;const{isMobile:o}=Ur(),[i,l]=(0,r.useState)({table:"",chart:"",code:""}),s=e=>r=>{((e,r)=>{const a=e||"";l((e=>({...e,[r]:+a<0?mt.positiveNumber:""}))),n({...t,[r]:a||1/0})})(r,e)};return Et("div",{className:"vm-limits-configurator",children:[Et("div",{className:"vm-server-configurator__title",children:["Series limits by tabs",Et(da,{title:"Set to 0 to disable the limit",children:Et(ea,{variant:"text",color:"primary",size:"small",startIcon:Et(Pn,{})})}),Et("div",{className:"vm-limits-configurator-title__reset",children:Et(ea,{variant:"text",color:"primary",size:"small",startIcon:Et(On,{}),onClick:()=>{n(it)},children:"Reset limits"})})]}),Et("div",{className:wr()({"vm-limits-configurator__inputs":!0,"vm-limits-configurator__inputs_mobile":o}),children:uo.map((e=>Et("div",{children:Et(ja,{label:e.label,value:t[e.type],error:i[e.type],onChange:s(e.type),onEnter:a,type:"number"})},e.type)))})]})},mo=e=>{let{defaultExpanded:t=!1,onChange:n,title:a,children:o}=e;const[i,l]=(0,r.useState)(t);return(0,r.useEffect)((()=>{n&&n(i)}),[i]),Et(St.FK,{children:[Et("header",{className:"vm-accordion-header ".concat(i&&"vm-accordion-header_open"),onClick:()=>{l((e=>!e))},children:[a,Et("div",{className:"vm-accordion-header__arrow ".concat(i&&"vm-accordion-header__arrow_open"),children:Et(Fn,{})})]}),i&&Et("section",{className:"vm-accordion-section",children:o},"content")]})},po=()=>Et(da,{title:"Browser timezone is not recognized, supported, or could not be determined.",children:Et(In,{})}),fo=sn(),vo=e=>{let{timezoneState:t,defaultTimezone:n,onChange:a}=e;const{isMobile:o}=Ur(),i=on(),[l,s]=(0,r.useState)(""),c=(0,r.useRef)(null),{value:u,toggle:d,setFalse:h}=na(!1),m=(0,r.useMemo)((()=>[{title:"Default time (".concat(n,")"),region:n,utc:n?an(n):"UTC"},{title:fo.title,region:fo.region,utc:an(fo.region),isInvalid:!fo.isValid},{title:"UTC (Coordinated Universal Time)",region:"UTC",utc:"UTC"}].filter((e=>e.region))),[n]),p=(0,r.useMemo)((()=>{if(!l)return i;try{return on(l)}catch(Ap){return{}}}),[l,i]),f=(0,r.useMemo)((()=>Object.keys(p)),[p]),v=(0,r.useMemo)((()=>({region:t,utc:an(t)})),[t]),g=e=>()=>{(e=>{a(e.region),s(""),h()})(e)};return Et("div",{className:"vm-timezones",children:[Et("div",{className:"vm-server-configurator__title",children:"Time zone"}),Et("div",{className:"vm-timezones-item vm-timezones-item_selected",onClick:d,ref:c,children:[Et("div",{className:"vm-timezones-item__title",children:v.region}),Et("div",{className:"vm-timezones-item__utc",children:v.utc}),Et("div",{className:wr()({"vm-timezones-item__icon":!0,"vm-timezones-item__icon_open":u}),children:Et(jn,{})})]}),Et(ta,{open:u,buttonRef:c,placement:"bottom-left",onClose:h,fullWidth:!0,title:o?"Time zone":void 0,children:Et("div",{className:wr()({"vm-timezones-list":!0,"vm-timezones-list_mobile":o}),children:[Et("div",{className:"vm-timezones-list-header",children:[Et("div",{className:"vm-timezones-list-header__search",children:Et(ja,{autofocus:!0,label:"Search",value:l,onChange:e=>{s(e)}})}),m.map(((e,t)=>e&&Et("div",{className:"vm-timezones-item vm-timezones-list-group-options__item",onClick:g(e),children:[Et("div",{className:"vm-timezones-item__title",children:[e.title,e.isInvalid&&Et(po,{})]}),Et("div",{className:"vm-timezones-item__utc",children:e.utc})]},"".concat(t,"_").concat(e.region))))]}),f.map((e=>Et("div",{className:"vm-timezones-list-group",children:Et(mo,{defaultExpanded:!0,title:Et("div",{className:"vm-timezones-list-group__title",children:e}),children:Et("div",{className:"vm-timezones-list-group-options",children:p[e]&&p[e].map((e=>Et("div",{className:"vm-timezones-item vm-timezones-list-group-options__item",onClick:g(e),children:[Et("div",{className:"vm-timezones-item__title",children:e.region}),Et("div",{className:"vm-timezones-item__utc",children:e.utc})]},e.search)))})})},e)))]})})]})},go=e=>{let{options:t,value:n,label:a,onChange:o}=e;const i=(0,r.useRef)(null),[l,s]=(0,r.useState)({width:"0px",left:"0px",borderRadius:"0px"}),c=e=>()=>{o(e)};return(0,r.useEffect)((()=>{if(!i.current)return void s({width:"0px",left:"0px",borderRadius:"0px"});const e=t.findIndex((e=>e.value===n)),{width:r}=i.current.getBoundingClientRect();let a=r,o=e*a,l="0";0===e&&(l="16px 0 0 16px"),e===t.length-1&&(l="10px",o-=1,l="0 16px 16px 0"),0!==e&&e!==t.length-1&&(a+=1,o-=1),s({width:"".concat(a,"px"),left:"".concat(o,"px"),borderRadius:l})}),[i,n,t]),Et("div",{className:"vm-toggles",children:[a&&Et("label",{className:"vm-toggles__label",children:a}),Et("div",{className:"vm-toggles-group",style:{gridTemplateColumns:"repeat(".concat(t.length,", 1fr)")},children:[l.borderRadius&&Et("div",{className:"vm-toggles-group__highlight",style:l}),t.map(((e,t)=>Et("div",{className:wr()({"vm-toggles-group-item":!0,"vm-toggles-group-item_first":0===t,"vm-toggles-group-item_active":e.value===n,"vm-toggles-group-item_icon":e.icon&&e.title}),onClick:c(e.value),ref:e.value===n?i:null,children:[e.icon,e.title]},e.value)))]})]})},yo=Object.values(pt).map((e=>({title:e,value:e}))),_o=e=>{let{theme:t,onChange:n}=e;const{isMobile:r}=Ur();return Et("div",{className:wr()({"vm-theme-control":!0,"vm-theme-control_mobile":r}),children:[Et("div",{className:"vm-server-configurator__title",children:"Theme preferences"}),Et("div",{className:"vm-theme-control__toggle",children:Et(go,{options:yo,value:t,onChange:e=>{n(e)}})},"".concat(r))]})},bo="Settings",{REACT_APP_TYPE:wo}={},ko=wo===He.logs,xo=()=>{const{isMobile:e}=Ur(),t=Ke(),{serverUrl:n,theme:a}=At(),{timezone:o,defaultTimezone:i}=pn(),{seriesLimits:l}=Ir(),s=Mt(),c=fn(),u=Rr(),[d,h]=(0,r.useState)(n),[m,p]=(0,r.useState)(l),[f,v]=(0,r.useState)(o),{value:g,setTrue:y,setFalse:_}=na(!1),b=()=>{_(),h(n),p(l),v(o)},w=()=>{const e=Ge(d);""!==e&&s({type:"SET_TENANT_ID",payload:e}),s({type:"SET_SERVER",payload:d}),c({type:"SET_TIMEZONE",payload:f}),u({type:"SET_SERIES_LIMITS",payload:m}),_()};(0,r.useEffect)((()=>{n!==d&&h(n)}),[n]),(0,r.useEffect)((()=>{v(o)}),[o]);const k=[{show:!t&&!ko,component:Et(co,{stateServerUrl:n,serverUrl:d,onChange:h,onEnter:w})},{show:!ko,component:Et(ho,{limits:m,onChange:p,onEnter:w})},{show:!0,component:Et(vo,{timezoneState:f,defaultTimezone:i,onChange:v})},{show:!t,component:Et(_o,{theme:a,onChange:e=>{s({type:"SET_THEME",payload:e})}})}].filter((e=>e.show));return Et(St.FK,{children:[e?Et("div",{className:"vm-mobile-option",onClick:y,children:[Et("span",{className:"vm-mobile-option__icon",children:Et(Tn,{})}),Et("div",{className:"vm-mobile-option-text",children:Et("span",{className:"vm-mobile-option-text__label",children:bo})}),Et("span",{className:"vm-mobile-option__arrow",children:Et(Fn,{})})]}):Et(da,{title:bo,children:Et(ea,{className:wr()({"vm-header-button":!t}),variant:"contained",color:"primary",startIcon:Et(Tn,{}),onClick:y,ariaLabel:"settings"})}),g&&Et(ua,{title:bo,onClose:b,children:Et("div",{className:wr()({"vm-server-configurator":!0,"vm-server-configurator_mobile":e}),children:[k.map(((e,t)=>Et("div",{className:"vm-server-configurator__input",children:e.component},t))),Et("div",{className:"vm-server-configurator-footer",children:[Et(ea,{color:"error",variant:"outlined",onClick:b,children:"Cancel"}),Et(ea,{color:"primary",variant:"contained",onClick:w,children:"Apply"})]})]})})]})},So=e=>{let{displaySidebar:t,isMobile:n,headerSetup:r,accountIds:a}=e;return Et("div",{className:wr()({"vm-header-controls":!0,"vm-header-controls_mobile":n}),children:[(null===r||void 0===r?void 0:r.tenant)&&Et(Ha,{accountIds:a||[]}),(null===r||void 0===r?void 0:r.stepControl)&&Et($a,{}),(null===r||void 0===r?void 0:r.timeSelector)&&Et(no,{}),(null===r||void 0===r?void 0:r.cardinalityDatePicker)&&Et(ao,{}),(null===r||void 0===r?void 0:r.executionControls)&&Et(io,{}),Et(xo,{}),!t&&Et(xa,{})]})},Co=Boolean(Xe("DISABLED_DEFAULT_TIMEZONE")),Eo=()=>{const{serverUrl:e}=At(),t=fn(),[n,a]=(0,r.useState)(!1),[i,l]=(0,r.useState)(""),s=async()=>{if(e&&!{NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!1}.REACT_APP_TYPE){l(""),a(!0);try{const n=await fetch("".concat(e,"/vmui/timezone")),r=await n.json();n.ok?((e=>{const n="local"===e.toLowerCase()?sn().region:e;try{if(o()().tz(n).isValid(),t({type:"SET_DEFAULT_TIMEZONE",payload:n}),Co)return;t({type:"SET_TIMEZONE",payload:n})}catch(Ap){Ap instanceof Error&&l("".concat(Ap.name,": ").concat(Ap.message))}})(r.timezone),a(!1)):(l(r.error),a(!1))}catch(Ap){a(!1),Ap instanceof Error&&l("".concat(Ap.name,": ").concat(Ap.message))}}};return(0,r.useEffect)((()=>{s()}),[e]),{isLoading:n,error:i}},No=()=>{const e=Ke(),{isMobile:t}=Ur(),{pathname:n}=ne(),[a,o]=je();za(),Eo();return(0,r.useEffect)((()=>{var e;const t="vmui",r=null===(e=qe[n])||void 0===e?void 0:e.title;document.title=r?"".concat(r," - ").concat(t):t}),[n]),(0,r.useEffect)((()=>{const{search:e,href:t}=window.location;if(e){const t=rt().parse(e,{ignoreQueryPrefix:!0});Object.entries(t).forEach((e=>{let[t,n]=e;return a.set(t,n)})),o(a),window.location.search=""}const n=t.replace(/\/\?#\//,"/#/");n!==t&&window.location.replace(n)}),[]),Et("section",{className:"vm-container",children:[Et(Oa,{controlsComponent:So}),Et("div",{className:wr()({"vm-container-body":!0,"vm-container-body_mobile":t,"vm-container-body_app":e}),children:Et(_e,{})}),!e&&Et(Da,{})]})};var Ao=function(e){return e[e.mouse=0]="mouse",e[e.keyboard=1]="keyboard",e}(Ao||{});const Mo=e=>{var t;let{value:n,options:a,anchor:o,disabled:i,minLength:l=2,fullWidth:s,selected:c,noOptionsText:u,label:d,disabledFullScreen:h,offset:m,maxDisplayResults:p,loading:f,onSelect:v,onOpenAutocomplete:g,onFoundOptions:y,onChangeWrapperRef:_}=e;const{isMobile:b}=Ur(),w=(0,r.useRef)(null),[k,x]=(0,r.useState)({index:-1}),[S,C]=(0,r.useState)(""),[E,N]=(0,r.useState)(0),{value:A,setValue:M,setFalse:T}=na(!1),L=(0,r.useMemo)((()=>{if(!A)return[];try{const e=new RegExp(String(n.trim()),"i"),t=a.filter((t=>e.test(t.value))).sort(((t,r)=>{var a,o;return t.value.toLowerCase()===n.trim().toLowerCase()?-1:r.value.toLowerCase()===n.trim().toLowerCase()?1:((null===(a=t.value.match(e))||void 0===a?void 0:a.index)||0)-((null===(o=r.value.match(e))||void 0===o?void 0:o.index)||0)}));return N(t.length),C(t.length>Number(null===p||void 0===p?void 0:p.limit)&&(null===p||void 0===p?void 0:p.message)||""),null!==p&&void 0!==p&&p.limit?t.slice(0,p.limit):t}catch(Ap){return[]}}),[A,a,n]),O=(0,r.useMemo)((()=>{var e;return 1===L.length&&(null===(e=L[0])||void 0===e?void 0:e.value)===n}),[L]),P=(0,r.useMemo)((()=>u&&!L.length),[u,L]),I=()=>{x({index:-1})},R=(0,r.useCallback)((e=>{const{key:t,ctrlKey:n,metaKey:r,shiftKey:a}=e,o=n||r||a,i=L.length&&!O;if("ArrowUp"===t&&!o&&i&&(e.preventDefault(),x((e=>{let{index:t}=e;return{index:t<=0?0:t-1,type:Ao.keyboard}}))),"ArrowDown"===t&&!o&&i){e.preventDefault();const t=L.length-1;x((e=>{let{index:n}=e;return{index:n>=t?t:n+1,type:Ao.keyboard}}))}if("Enter"===t){const e=L[k.index];e&&v(e.value),c||T()}"Escape"===t&&T()}),[k,L,O,T,v,c]);return(0,r.useEffect)((()=>{M(n.length>=l)}),[n,a]),Sr("keydown",R),(0,r.useEffect)((()=>{if(!w.current||k.type===Ao.mouse)return;const e=w.current.childNodes[k.index];null!==e&&void 0!==e&&e.scrollIntoView&&e.scrollIntoView({block:"center"})}),[k,L]),(0,r.useEffect)((()=>{x({index:-1})}),[L]),(0,r.useEffect)((()=>{g&&g(A)}),[A]),(0,r.useEffect)((()=>{y&&y(O?[]:L)}),[L,O]),(0,r.useEffect)((()=>{_&&_(w)}),[w]),Et(ta,{open:A,buttonRef:o,placement:"bottom-left",onClose:T,fullWidth:s,title:b?d:void 0,disabledFullScreen:h,offset:m,children:[Et("div",{className:wr()({"vm-autocomplete":!0,"vm-autocomplete_mobile":b&&!h}),ref:w,children:[f&&Et("div",{className:"vm-autocomplete__loader",children:[Et(zn,{}),Et("span",{children:"Loading..."})]}),P&&Et("div",{className:"vm-autocomplete__no-options",children:u}),!O&&L.map(((e,t)=>{return Et("div",{className:wr()({"vm-list-item":!0,"vm-list-item_mobile":b,"vm-list-item_active":t===k.index,"vm-list-item_multiselect":c,"vm-list-item_multiselect_selected":null===c||void 0===c?void 0:c.includes(e.value),"vm-list-item_with-icon":e.icon}),id:"$autocomplete$".concat(e.value),onClick:(r=e.value,()=>{i||(v(r),c||T())}),onMouseEnter:(n=t,()=>{x({index:n,type:Ao.mouse})}),onMouseLeave:I,children:[(null===c||void 0===c?void 0:c.includes(e.value))&&Et(Jn,{}),Et(St.FK,{children:e.icon}),Et("span",{children:e.value})]},"".concat(t).concat(e.value));var n,r}))]}),S&&Et("div",{className:"vm-autocomplete-message",children:["Shown ",null===p||void 0===p?void 0:p.limit," results out of ",E,". ",S]}),(null===(t=L[k.index])||void 0===t?void 0:t.description)&&Et("div",{className:"vm-autocomplete-info",children:[Et("div",{className:"vm-autocomplete-info__type",children:L[k.index].type}),Et("div",{className:"vm-autocomplete-info__description",dangerouslySetInnerHTML:{__html:L[k.index].description||""}})]})]})};var To=n(267),Lo=n.n(To);const Oo=e=>e.replace(/[/\-\\^$*+?.()|[\]{}]/g,"\\$&"),Po=e=>JSON.stringify(e).slice(1,-1);var Io=function(e){return e.metric="metric",e.label="label",e.labelValue="labelValue",e}(Io||{});const Ro={[Io.metric]:Et(fr,{}),[Io.label]:Et(gr,{}),[Io.labelValue]:Et(yr,{})};function Do(e,t){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.add(e)}function zo(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}function Fo(e){return Fo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fo(e)}function jo(e){var t=function(e,t){if("object"!=Fo(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Fo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Fo(t)?t:String(t)}function Ho(e,t,n){return(t=jo(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vo(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let $o={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function Uo(e){$o=e}const Bo=/[&<>"']/,qo=new RegExp(Bo.source,"g"),Yo=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Wo=new RegExp(Yo.source,"g"),Ko={"&":"&","<":"<",">":">",'"':""","'":"'"},Qo=e=>Ko[e];function Zo(e,t){if(t){if(Bo.test(e))return e.replace(qo,Qo)}else if(Yo.test(e))return e.replace(Wo,Qo);return e}const Go=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function Jo(e){return e.replace(Go,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const Xo=/(^|[^\[])\^/g;function ei(e,t){let n="string"===typeof e?e:e.source;t=t||"";const r={replace:(e,t)=>{let a="string"===typeof t?t:t.source;return a=a.replace(Xo,"$1"),n=n.replace(e,a),r},getRegex:()=>new RegExp(n,t)};return r}function ti(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(Ap){return null}return e}const ni={exec:()=>null};function ri(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,a=t;for(;--a>=0&&"\\"===n[a];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function ai(e,t,n){const r=e.length;if(0===r)return"";let a=0;for(;a<r;){const o=e.charAt(r-a-1);if(o!==t||n){if(o===t||!n)break;a++}else a++}return e.slice(0,r-a)}function oi(e,t,n,r){const a=t.href,o=t.title?Zo(t.title):null,i=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:a,title:o,text:i,tokens:r.inlineTokens(i)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:a,title:o,text:Zo(i)}}class ii{constructor(e){Ho(this,"options",void 0),Ho(this,"rules",void 0),Ho(this,"lexer",void 0),this.options=e||$o}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:ai(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=ai(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=t[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n $1");e=ai(e.replace(/^ *>[ \t]?/gm,""),"\n");const n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,a={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?"\\d{1,9}\\".concat(n.slice(-1)):"\\".concat(n),this.options.pedantic&&(n=r?n:"[*+-]");const o=new RegExp("^( {0,3}".concat(n,")((?:[\t ][^\\n]*)?(?:\\n|$))"));let i="",l="",s=!1;for(;e;){let n=!1;if(!(t=o.exec(e)))break;if(this.rules.block.hr.test(e))break;i=t[0],e=e.substring(i.length);let r=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),c=e.split("\n",1)[0],u=0;this.options.pedantic?(u=2,l=r.trimStart()):(u=t[2].search(/[^ ]/),u=u>4?1:u,l=r.slice(u),u+=t[1].length);let d=!1;if(!r&&/^ *$/.test(c)&&(i+=c+"\n",e=e.substring(c.length+1),n=!0),!n){const t=new RegExp("^ {0,".concat(Math.min(3,u-1),"}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))")),n=new RegExp("^ {0,".concat(Math.min(3,u-1),"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)")),a=new RegExp("^ {0,".concat(Math.min(3,u-1),"}(?:```|~~~)")),o=new RegExp("^ {0,".concat(Math.min(3,u-1),"}#"));for(;e;){const s=e.split("\n",1)[0];if(c=s,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),a.test(c))break;if(o.test(c))break;if(t.test(c))break;if(n.test(e))break;if(c.search(/[^ ]/)>=u||!c.trim())l+="\n"+c.slice(u);else{if(d)break;if(r.search(/[^ ]/)>=4)break;if(a.test(r))break;if(o.test(r))break;if(n.test(r))break;l+="\n"+c}d||c.trim()||(d=!0),i+=s+"\n",e=e.substring(s.length+1),r=c.slice(u)}}a.loose||(s?a.loose=!0:/\n *\n *$/.test(i)&&(s=!0));let h,m=null;this.options.gfm&&(m=/^\[[ xX]\] /.exec(l),m&&(h="[ ] "!==m[0],l=l.replace(/^\[[ xX]\] +/,""))),a.items.push({type:"list_item",raw:i,task:!!m,checked:h,loose:!1,text:l,tokens:[]}),a.raw+=i}a.items[a.items.length-1].raw=i.trimEnd(),a.items[a.items.length-1].text=l.trimEnd(),a.raw=a.raw.trimEnd();for(let e=0;e<a.items.length;e++)if(this.lexer.state.top=!1,a.items[e].tokens=this.lexer.blockTokens(a.items[e].text,[]),!a.loose){const t=a.items[e].tokens.filter((e=>"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));a.loose=n}if(a.loose)for(let e=0;e<a.items.length;e++)a.items[e].loose=!0;return a}}html(e){const t=this.rules.block.html.exec(e);if(t){return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!/[:|]/.test(t[2]))return;const n=ri(t[1]),r=t[2].replace(/^\||\| *$/g,"").split("|"),a=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const e of r)/^ *-+: *$/.test(e)?o.align.push("right"):/^ *:-+: *$/.test(e)?o.align.push("center"):/^ *:-+ *$/.test(e)?o.align.push("left"):o.align.push(null);for(const e of n)o.header.push({text:e,tokens:this.lexer.inline(e)});for(const e of a)o.rows.push(ri(e,o.header.length).map((e=>({text:e,tokens:this.lexer.inline(e)}))));return o}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:Zo(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=ai(e.slice(0,-1),"\\");if((e.length-t.length)%2===0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),oi(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(/\s+/g," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return oi(n,e,n[0],this.lexer)}}emStrong(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=this.rules.inline.emStrongLDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...r[0]].length-1;let a,o,i=n,l=0;const s="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(s.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=s.exec(t));){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){i+=o;continue}if((r[5]||r[6])&&n%3&&!((n+o)%3)){l+=o;continue}if(i-=o,i>0)continue;o=Math.min(o,o+i+l);const t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+o);if(Math.min(n,o)%2){const e=s.slice(1,-1);return{type:"em",raw:s,text:e,tokens:this.lexer.inlineTokens(e)}}const c=s.slice(2,-2);return{type:"strong",raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=Zo(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=Zo(t[1]),n="mailto:"+e):(e=Zo(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,a;if("@"===t[2])e=Zo(t[0]),a="mailto:"+e;else{let o;do{var n,r;o=t[0],t[0]=null!==(n=null===(r=this.rules.inline._backpedal.exec(t[0]))||void 0===r?void 0:r[0])&&void 0!==n?n:""}while(o!==t[0]);e=Zo(t[0]),a="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:a,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:Zo(t[0]),{type:"text",raw:t[0],text:e}}}}const li=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,si=/(?:[*+-]|\d{1,9}[.)])/,ci=ei(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,si).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),ui=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,di=/(?!\s*\])(?:\\.|[^\[\]\\])+/,hi=ei(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",di).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),mi=ei(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,si).getRegex(),pi="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",fi=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,vi=ei("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",fi).replace("tag",pi).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),gi=ei(ui).replace("hr",li).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",pi).getRegex(),yi={blockquote:ei(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",gi).getRegex(),code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,def:hi,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:li,html:vi,lheading:ci,list:mi,newline:/^(?: *(?:\n|$))+/,paragraph:gi,table:ni,text:/^[^\n]+/},_i=ei("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",li).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",pi).getRegex(),bi={...yi,table:_i,paragraph:ei(ui).replace("hr",li).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",_i).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",pi).getRegex()},wi={...yi,html:ei("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",fi).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ni,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ei(ui).replace("hr",li).replace("heading"," *#{1,6} *[^\n]").replace("lheading",ci).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ki=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,xi=/^( {2,}|\\)\n(?!\s*$)/,Si="\\p{P}\\p{S}",Ci=ei(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,Si).getRegex(),Ei=ei(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,Si).getRegex(),Ni=ei("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,Si).getRegex(),Ai=ei("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,Si).getRegex(),Mi=ei(/\\([punct])/,"gu").replace(/punct/g,Si).getRegex(),Ti=ei(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[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])?)+(?![-_])/).getRegex(),Li=ei(fi).replace("(?:--\x3e|$)","--\x3e").getRegex(),Oi=ei("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Li).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Pi=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ii=ei(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Pi).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ri=ei(/^!?\[(label)\]\[(ref)\]/).replace("label",Pi).replace("ref",di).getRegex(),Di=ei(/^!?\[(ref)\](?:\[\])?/).replace("ref",di).getRegex(),zi={_backpedal:ni,anyPunctuation:Mi,autolink:Ti,blockSkip:/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,br:xi,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:ni,emStrongLDelim:Ei,emStrongRDelimAst:Ni,emStrongRDelimUnd:Ai,escape:ki,link:Ii,nolink:Di,punctuation:Ci,reflink:Ri,reflinkSearch:ei("reflink|nolink(?!\\()","g").replace("reflink",Ri).replace("nolink",Di).getRegex(),tag:Oi,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:ni},Fi={...zi,link:ei(/^!?\[(label)\]\((.*?)\)/).replace("label",Pi).getRegex(),reflink:ei(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Pi).getRegex()},ji={...zi,escape:ei(ki).replace("])","~|])").getRegex(),url:ei(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Hi={...ji,br:ei(xi).replace("{2,}","*").getRegex(),text:ei(ji.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Vi={normal:yi,gfm:bi,pedantic:wi},$i={normal:zi,gfm:ji,breaks:Hi,pedantic:Fi};class Ui{constructor(e){Ho(this,"tokens",void 0),Ho(this,"options",void 0),Ho(this,"state",void 0),Ho(this,"tokenizer",void 0),Ho(this,"inlineQueue",void 0),this.tokens=[],this.tokens.links=Object.create(null),this.options=e||$o,this.options.tokenizer=this.options.tokenizer||new ii,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:Vi.normal,inline:$i.normal};this.options.pedantic?(t.block=Vi.pedantic,t.inline=$i.pedantic):this.options.gfm&&(t.block=Vi.gfm,this.options.breaks?t.inline=$i.breaks:t.inline=$i.gfm),this.tokenizer.rules=t}static get rules(){return{block:Vi,inline:$i}}static lex(e,t){return new Ui(t).lex(e)}static lexInline(e,t){return new Ui(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const e=this.inlineQueue[t];this.inlineTokens(e.src,e.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e){let t,n,r,a,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((n=>!!(t=n.call({lexer:this},e,o))&&(e=e.substring(t.raw.length),o.push(t),!0)))))if(t=this.tokenizer.space(e))e=e.substring(t.raw.length),1===t.raw.length&&o.length>0?o[o.length-1].raw+="\n":o.push(t);else if(t=this.tokenizer.code(e))e=e.substring(t.raw.length),n=o[o.length-1],!n||"paragraph"!==n.type&&"text"!==n.type?o.push(t):(n.raw+="\n"+t.raw,n.text+="\n"+t.text,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(t=this.tokenizer.fences(e))e=e.substring(t.raw.length),o.push(t);else if(t=this.tokenizer.heading(e))e=e.substring(t.raw.length),o.push(t);else if(t=this.tokenizer.hr(e))e=e.substring(t.raw.length),o.push(t);else if(t=this.tokenizer.blockquote(e))e=e.substring(t.raw.length),o.push(t);else if(t=this.tokenizer.list(e))e=e.substring(t.raw.length),o.push(t);else if(t=this.tokenizer.html(e))e=e.substring(t.raw.length),o.push(t);else if(t=this.tokenizer.def(e))e=e.substring(t.raw.length),n=o[o.length-1],!n||"paragraph"!==n.type&&"text"!==n.type?this.tokens.links[t.tag]||(this.tokens.links[t.tag]={href:t.href,title:t.title}):(n.raw+="\n"+t.raw,n.text+="\n"+t.raw,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(t=this.tokenizer.table(e))e=e.substring(t.raw.length),o.push(t);else if(t=this.tokenizer.lheading(e))e=e.substring(t.raw.length),o.push(t);else{if(r=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let a;this.options.extensions.startBlock.forEach((e=>{a=e.call({lexer:this},n),"number"===typeof a&&a>=0&&(t=Math.min(t,a))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(this.state.top&&(t=this.tokenizer.paragraph(r)))n=o[o.length-1],a&&"paragraph"===n.type?(n.raw+="\n"+t.raw,n.text+="\n"+t.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):o.push(t),a=r.length!==e.length,e=e.substring(t.raw.length);else if(t=this.tokenizer.text(e))e=e.substring(t.raw.length),n=o[o.length-1],n&&"text"===n.type?(n.raw+="\n"+t.raw,n.text+="\n"+t.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):o.push(t);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,o}inline(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e){let t,n,r,a,o,i,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],s=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(a=this.tokenizer.rules.inline.reflinkSearch.exec(s));)e.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(a=this.tokenizer.rules.inline.blockSkip.exec(s));)s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(a=this.tokenizer.rules.inline.anyPunctuation.exec(s));)s=s.slice(0,a.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(o||(i=""),o=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((n=>!!(t=n.call({lexer:this},e,l))&&(e=e.substring(t.raw.length),l.push(t),!0)))))if(t=this.tokenizer.escape(e))e=e.substring(t.raw.length),l.push(t);else if(t=this.tokenizer.tag(e))e=e.substring(t.raw.length),n=l[l.length-1],n&&"text"===t.type&&"text"===n.type?(n.raw+=t.raw,n.text+=t.text):l.push(t);else if(t=this.tokenizer.link(e))e=e.substring(t.raw.length),l.push(t);else if(t=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(t.raw.length),n=l[l.length-1],n&&"text"===t.type&&"text"===n.type?(n.raw+=t.raw,n.text+=t.text):l.push(t);else if(t=this.tokenizer.emStrong(e,s,i))e=e.substring(t.raw.length),l.push(t);else if(t=this.tokenizer.codespan(e))e=e.substring(t.raw.length),l.push(t);else if(t=this.tokenizer.br(e))e=e.substring(t.raw.length),l.push(t);else if(t=this.tokenizer.del(e))e=e.substring(t.raw.length),l.push(t);else if(t=this.tokenizer.autolink(e))e=e.substring(t.raw.length),l.push(t);else if(this.state.inLink||!(t=this.tokenizer.url(e))){if(r=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let a;this.options.extensions.startInline.forEach((e=>{a=e.call({lexer:this},n),"number"===typeof a&&a>=0&&(t=Math.min(t,a))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(t=this.tokenizer.inlineText(r))e=e.substring(t.raw.length),"_"!==t.raw.slice(-1)&&(i=t.raw.slice(-1)),o=!0,n=l[l.length-1],n&&"text"===n.type?(n.raw+=t.raw,n.text+=t.text):l.push(t);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(t.raw.length),l.push(t);return l}}class Bi{constructor(e){Ho(this,"options",void 0),this.options=e||$o}code(e,t,n){var r;const a=null===(r=(t||"").match(/^\S*/))||void 0===r?void 0:r[0];return e=e.replace(/\n$/,"")+"\n",a?'<pre><code class="language-'+Zo(a)+'">'+(n?e:Zo(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:Zo(e,!0))+"</code></pre>\n"}blockquote(e){return"<blockquote>\n".concat(e,"</blockquote>\n")}html(e,t){return e}heading(e,t,n){return"<h".concat(t,">").concat(e,"</h").concat(t,">\n")}hr(){return"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e,t,n){return"<li>".concat(e,"</li>\n")}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){return"<p>".concat(e,"</p>\n")}table(e,t){return t&&(t="<tbody>".concat(t,"</tbody>")),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return"<tr>\n".concat(e,"</tr>\n")}tablecell(e,t){const n=t.header?"th":"td";return(t.align?"<".concat(n,' align="').concat(t.align,'">'):"<".concat(n,">"))+e+"</".concat(n,">\n")}strong(e){return"<strong>".concat(e,"</strong>")}em(e){return"<em>".concat(e,"</em>")}codespan(e){return"<code>".concat(e,"</code>")}br(){return"<br>"}del(e){return"<del>".concat(e,"</del>")}link(e,t,n){const r=ti(e);if(null===r)return n;let a='<a href="'+(e=r)+'"';return t&&(a+=' title="'+t+'"'),a+=">"+n+"</a>",a}image(e,t,n){const r=ti(e);if(null===r)return n;let a='<img src="'.concat(e=r,'" alt="').concat(n,'"');return t&&(a+=' title="'.concat(t,'"')),a+=">",a}text(e){return e}}class qi{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class Yi{constructor(e){Ho(this,"options",void 0),Ho(this,"renderer",void 0),Ho(this,"textRenderer",void 0),this.options=e||$o,this.options.renderer=this.options.renderer||new Bi,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new qi}static parse(e,t){return new Yi(t).parse(e)}static parseInline(e,t){return new Yi(t).parseInline(e)}parse(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="";for(let r=0;r<e.length;r++){const a=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[a.type]){const e=a,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){n+=t||"";continue}}switch(a.type){case"space":continue;case"hr":n+=this.renderer.hr();continue;case"heading":{const e=a;n+=this.renderer.heading(this.parseInline(e.tokens),e.depth,Jo(this.parseInline(e.tokens,this.textRenderer)));continue}case"code":{const e=a;n+=this.renderer.code(e.text,e.lang,!!e.escaped);continue}case"table":{const e=a;let t="",r="";for(let n=0;n<e.header.length;n++)r+=this.renderer.tablecell(this.parseInline(e.header[n].tokens),{header:!0,align:e.align[n]});t+=this.renderer.tablerow(r);let o="";for(let n=0;n<e.rows.length;n++){const t=e.rows[n];r="";for(let n=0;n<t.length;n++)r+=this.renderer.tablecell(this.parseInline(t[n].tokens),{header:!1,align:e.align[n]});o+=this.renderer.tablerow(r)}n+=this.renderer.table(t,o);continue}case"blockquote":{const e=a,t=this.parse(e.tokens);n+=this.renderer.blockquote(t);continue}case"list":{const e=a,t=e.ordered,r=e.start,o=e.loose;let i="";for(let n=0;n<e.items.length;n++){const t=e.items[n],r=t.checked,a=t.task;let l="";if(t.task){const e=this.renderer.checkbox(!!r);o?t.tokens.length>0&&"paragraph"===t.tokens[0].type?(t.tokens[0].text=e+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&"text"===t.tokens[0].tokens[0].type&&(t.tokens[0].tokens[0].text=e+" "+t.tokens[0].tokens[0].text)):t.tokens.unshift({type:"text",text:e+" "}):l+=e+" "}l+=this.parse(t.tokens,o),i+=this.renderer.listitem(l,a,!!r)}n+=this.renderer.list(i,t,r);continue}case"html":{const e=a;n+=this.renderer.html(e.text,e.block);continue}case"paragraph":{const e=a;n+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let o=a,i=o.tokens?this.parseInline(o.tokens):o.text;for(;r+1<e.length&&"text"===e[r+1].type;)o=e[++r],i+="\n"+(o.tokens?this.parseInline(o.tokens):o.text);n+=t?this.renderer.paragraph(i):i;continue}default:{const e='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}parseInline(e,t){t=t||this.renderer;let n="";for(let r=0;r<e.length;r++){const a=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[a.type]){const e=this.options.extensions.renderers[a.type].call({parser:this},a);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){n+=e||"";continue}}switch(a.type){case"escape":{const e=a;n+=t.text(e.text);break}case"html":{const e=a;n+=t.html(e.text);break}case"link":{const e=a;n+=t.link(e.href,e.title,this.parseInline(e.tokens,t));break}case"image":{const e=a;n+=t.image(e.href,e.title,e.text);break}case"strong":{const e=a;n+=t.strong(this.parseInline(e.tokens,t));break}case"em":{const e=a;n+=t.em(this.parseInline(e.tokens,t));break}case"codespan":{const e=a;n+=t.codespan(e.text);break}case"br":n+=t.br();break;case"del":{const e=a;n+=t.del(this.parseInline(e.tokens,t));break}case"text":{const e=a;n+=t.text(e.text);break}default:{const e='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}}class Wi{constructor(e){Ho(this,"options",void 0),this.options=e||$o}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}Ho(Wi,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));var Ki=new WeakSet,Qi=new WeakSet;function Zi(e,t){return(n,r)=>{const a={...r},o={...this.defaults,...a};!0===this.defaults.async&&!1===a.async&&(o.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),o.async=!0);const i=zo(this,Qi,Gi).call(this,!!o.silent,!!o.async);if("undefined"===typeof n||null===n)return i(new Error("marked(): input parameter is undefined or null"));if("string"!==typeof n)return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(o.hooks&&(o.hooks.options=o),o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(n):n).then((t=>e(t,o))).then((e=>o.hooks?o.hooks.processAllTokens(e):e)).then((e=>o.walkTokens?Promise.all(this.walkTokens(e,o.walkTokens)).then((()=>e)):e)).then((e=>t(e,o))).then((e=>o.hooks?o.hooks.postprocess(e):e)).catch(i);try{o.hooks&&(n=o.hooks.preprocess(n));let r=e(n,o);o.hooks&&(r=o.hooks.processAllTokens(r)),o.walkTokens&&this.walkTokens(r,o.walkTokens);let a=t(r,o);return o.hooks&&(a=o.hooks.postprocess(a)),a}catch(Ap){return i(Ap)}}}function Gi(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+Zo(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}const Ji=new class{constructor(){Do(this,Qi),Do(this,Ki),Ho(this,"defaults",{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}),Ho(this,"options",this.setOptions),Ho(this,"parse",zo(this,Ki,Zi).call(this,Ui.lex,Yi.parse)),Ho(this,"parseInline",zo(this,Ki,Zi).call(this,Ui.lexInline,Yi.parseInline)),Ho(this,"Parser",Yi),Ho(this,"Renderer",Bi),Ho(this,"TextRenderer",qi),Ho(this,"Lexer",Ui),Ho(this,"Tokenizer",ii),Ho(this,"Hooks",Wi),this.use(...arguments)}walkTokens(e,t){let n=[];for(const a of e)switch(n=n.concat(t.call(this,a)),a.type){case"table":{const e=a;for(const r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(const r of e.rows)for(const e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=a;n=n.concat(this.walkTokens(e.items,t));break}default:{var r;const e=a;null!==(r=this.defaults.extensions)&&void 0!==r&&null!==(r=r.childTokens)&&void 0!==r&&r[e.type]?this.defaults.extensions.childTokens[e.type].forEach((r=>{const a=e[r].flat(1/0);n=n.concat(this.walkTokens(a,t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(){const e=this.defaults.extensions||{renderers:{},childTokens:{}};for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return n.forEach((t=>{const n={...t};if(n.async=this.defaults.async||n.async||!1,t.extensions&&(t.extensions.forEach((t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){const n=e.renderers[t.name];e.renderers[t.name]=n?function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];let o=t.renderer.apply(this,r);return!1===o&&(o=n.apply(this,r)),o}:t.renderer}if("tokenizer"in t){if(!t.level||"block"!==t.level&&"inline"!==t.level)throw new Error("extension level must be 'block' or 'inline'");const n=e[t.level];n?n.unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&("block"===t.level?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:"inline"===t.level&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}"childTokens"in t&&t.childTokens&&(e.childTokens[t.name]=t.childTokens)})),n.extensions=e),t.renderer){const e=this.defaults.renderer||new Bi(this.defaults);for(const n in t.renderer){if(!(n in e))throw new Error("renderer '".concat(n,"' does not exist"));if("options"===n)continue;const r=n,a=t.renderer[r],o=e[r];e[r]=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];let i=a.apply(e,n);return!1===i&&(i=o.apply(e,n)),i||""}}n.renderer=e}if(t.tokenizer){const e=this.defaults.tokenizer||new ii(this.defaults);for(const n in t.tokenizer){if(!(n in e))throw new Error("tokenizer '".concat(n,"' does not exist"));if(["options","rules","lexer"].includes(n))continue;const r=n,a=t.tokenizer[r],o=e[r];e[r]=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];let i=a.apply(e,n);return!1===i&&(i=o.apply(e,n)),i}}n.tokenizer=e}if(t.hooks){const e=this.defaults.hooks||new Wi;for(const n in t.hooks){if(!(n in e))throw new Error("hook '".concat(n,"' does not exist"));if("options"===n)continue;const r=n,a=t.hooks[r],o=e[r];Wi.passThroughHooks.has(n)?e[r]=t=>{if(this.defaults.async)return Promise.resolve(a.call(e,t)).then((t=>o.call(e,t)));const n=a.call(e,t);return o.call(e,n)}:e[r]=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];let i=a.apply(e,n);return!1===i&&(i=o.apply(e,n)),i}}n.hooks=e}if(t.walkTokens){const e=this.defaults.walkTokens,r=t.walkTokens;n.walkTokens=function(t){let n=[];return n.push(r.call(this,t)),e&&(n=n.concat(e.call(this,t))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Ui.lex(e,null!==t&&void 0!==t?t:this.defaults)}parser(e,t){return Yi.parse(e,null!==t&&void 0!==t?t:this.defaults)}};function Xi(e,t){return Ji.parse(e,t)}Xi.options=Xi.setOptions=function(e){return Ji.setOptions(e),Xi.defaults=Ji.defaults,Uo(Xi.defaults),Xi},Xi.getDefaults=Vo,Xi.defaults=$o,Xi.use=function(){return Ji.use(...arguments),Xi.defaults=Ji.defaults,Uo(Xi.defaults),Xi},Xi.walkTokens=function(e,t){return Ji.walkTokens(e,t)},Xi.parseInline=Ji.parseInline,Xi.Parser=Yi,Xi.parser=Yi.parse,Xi.Renderer=Bi,Xi.TextRenderer=qi,Xi.Lexer=Ui,Xi.lexer=Ui.lex,Xi.Tokenizer=ii,Xi.Hooks=Wi,Xi.parse=Xi;Xi.options,Xi.setOptions,Xi.use,Xi.walkTokens,Xi.parseInline,Yi.parse,Ui.lex;const el=n.p+"static/media/MetricsQL.aaabf95f2c9bf356bde4.md",tl=e=>{const t='$1 target="_blank" class="'.concat("vm-link vm-link_colored",'" $2').concat("https://docs.victoriametrics.com/MetricsQL.html","#");return e.replace(/(<a) (href=")#/gm,t)},nl=e=>{let t="";return Array.from(e).map((e=>{var n;const r="h3"===e.tagName.toLowerCase();return t=r?null!==(n=e.textContent)&&void 0!==n?n:"":t,r?null:((e,t)=>{var n;const r=null!==(n=t.textContent)&&void 0!==n?n:"",a=(e=>{const t=[];let n=e.nextElementSibling;for(;n&&"p"===n.tagName.toLowerCase();)n&&t.push(n),n=n.nextElementSibling;return t})(t).map((e=>{var t;return null!==(t=e.outerHTML)&&void 0!==t?t:""})).join("\n");return{type:e,value:r,description:tl(a),icon:Et(vr,{})}})(t,e)})).filter(Boolean)},rl=()=>{const{metricsQLFunctions:e}=Sn(),t=Cn();return(0,r.useEffect)((()=>{e.length||(async()=>{try{const e=await fetch(el),n=(e=>{const t=document.createElement("div");t.innerHTML=Xi(e);const n=t.querySelectorAll("".concat("h3",", ").concat("h4"));return nl(n)})(await e.text());t({type:"SET_METRICSQL_FUNCTIONS",payload:n})}catch(Ap){console.error("Error fetching or processing the MetricsQL.md file:",Ap)}})()}),[]),e},al=e=>{let{value:t,anchorEl:n,caretPosition:a,hasHelperText:i,onSelect:l,onFoundOptions:s}=e;const[c,u]=(0,r.useState)({top:0,left:0}),d=rl(),h=(0,r.useMemo)((()=>{if(a[0]!==a[1])return{beforeCursor:t,afterCursor:""};return{beforeCursor:t.substring(0,a[0]),afterCursor:t.substring(a[1])}}),[t,a]),m=(0,r.useMemo)((()=>{const e=h.beforeCursor.split("}");return e[e.length-1]}),[h]),p=(0,r.useMemo)((()=>{const e=m.match(/\b[^{}(),\s]+(?={|$)/g);return e?e[0]:""}),[m]),f=(0,r.useMemo)((()=>{const e=m.match(/[a-z_:-][\w\-.:/]*\b(?=\s*(=|!=|=~|!~))/g);return e?e[e.length-1]:""}),[m]),v=(0,r.useMemo)((()=>{if(!h.beforeCursor||h.beforeCursor.endsWith("}")||(e=>{const t=e.split(/\s+/),n=t.length,r=t[n-1],a=t[n-2],o=!r&&(e=>{const t=e.match(/"/g);return!!t&&t.length%2!==0})(e),i=(!r||t.length>1)&&!/([{(),+\-*/^]|\b(?:or|and|unless|default|ifnot|if|group_left|group_right)\b)/.test(a);return o||i})(h.beforeCursor))return ft.empty;const e=/\{[^}]*$/;switch(!0){case new RegExp("(".concat(Oo(p),")?{?.+").concat(Oo(f),'(=|!=|=~|!~)"?([^"]*)$'),"g").test(h.beforeCursor):return ft.labelValue;case e.test(h.beforeCursor):return ft.label;default:return ft.metricsql}}),[h,p,f]),g=(0,r.useMemo)((()=>{const e=h.beforeCursor.match(/([\w_\-.:/]+(?![},]))$/);return e?e[0]:""}),[h.beforeCursor]),{metrics:y,labels:_,labelValues:b,loading:w}=(e=>{let{valueByContext:t,metric:n,label:a,context:i}=e;const{serverUrl:l}=At(),{period:{start:s,end:c}}=pn(),{autocompleteCache:u}=Sn(),d=Cn(),[h,m]=(0,r.useState)(!1),[p,f]=(0,r.useState)(t),v=Lo()(f,500);(0,r.useEffect)((()=>(v(t),v.cancel)),[t,v]);const[g,y]=(0,r.useState)([]),[_,b]=(0,r.useState)([]),[w,k]=(0,r.useState)([]),x=(0,r.useRef)(new AbortController),S=(0,r.useCallback)((e=>{const t=o()(1e3*s).startOf("day").valueOf()/1e3,n=o()(1e3*c).endOf("day").valueOf()/1e3;return new URLSearchParams({...e||{},limit:"".concat(yn),start:"".concat(t),end:"".concat(n)})}),[s,c]),C=(e,t)=>e.map((e=>({value:e,type:"".concat(t),icon:Ro[t]}))),E=async e=>{let{value:t,urlSuffix:n,setter:r,type:a,params:o}=e;if(!t&&a===Io.metric)return;x.current.abort(),x.current=new AbortController;const{signal:i}=x.current,s={type:a,value:t,start:(null===o||void 0===o?void 0:o.get("start"))||"",end:(null===o||void 0===o?void 0:o.get("end"))||"",match:(null===o||void 0===o?void 0:o.get("match[]"))||""};m(!0);try{const e=u.get(s);if(e)return r(C(e,a)),void m(!1);const t=await fetch("".concat(l,"/api/v1/").concat(n,"?").concat(o),{signal:i});if(t.ok){const{data:e}=await t.json();r(C(e,a)),d({type:"SET_AUTOCOMPLETE_CACHE",payload:{key:s,value:e}})}m(!1)}catch(Ap){Ap instanceof Error&&"AbortError"!==Ap.name&&(d({type:"SET_AUTOCOMPLETE_CACHE",payload:{key:s,value:[]}}),m(!1),console.error(Ap))}};return(0,r.useEffect)((()=>{const e=i!==ft.metricsql&&i!==ft.empty;if(!l||!n||e)return;y([]);const t=Po(Oo(n));return E({value:p,urlSuffix:"label/__name__/values",setter:y,type:Io.metric,params:S({"match[]":'{__name__=~".*'.concat(t,'.*"}')})}),()=>{var e;return null===(e=x.current)||void 0===e?void 0:e.abort()}}),[l,p,i,n]),(0,r.useEffect)((()=>{if(!l||!n||i!==ft.label)return;b([]);const e=Po(n);return E({value:p,urlSuffix:"labels",setter:b,type:Io.label,params:S({"match[]":'{__name__="'.concat(e,'"}')})}),()=>{var e;return null===(e=x.current)||void 0===e?void 0:e.abort()}}),[l,p,i,n]),(0,r.useEffect)((()=>{if(!l||!n||!a||i!==ft.labelValue)return;k([]);const e=Po(n),t=Po(Oo(p));return E({value:p,urlSuffix:"label/".concat(a,"/values"),setter:k,type:Io.labelValue,params:S({"match[]":'{__name__="'.concat(e,'", ').concat(a,'=~".*').concat(t,'.*"}')})}),()=>{var e;return null===(e=x.current)||void 0===e?void 0:e.abort()}}),[l,p,i,n,a]),{metrics:g,labels:_,labelValues:w,loading:h}})({valueByContext:g,metric:p,label:f,context:v}),k=(0,r.useMemo)((()=>{switch(v){case ft.metricsql:return[...y,...d];case ft.label:return _;case ft.labelValue:return b;default:return[]}}),[v,y,_,b]),x=(0,r.useCallback)((e=>{const t=h.beforeCursor;let n=h.afterCursor;const r=t.lastIndexOf(g,a[0]),o=r+g.length,i=t.substring(0,r),s=t.substring(o);if(v===ft.labelValue){const t='"',r=/(?:=|!=|=~|!~)$/.test(i);n=n.replace(/^[^\s"|},]*/,""),e="".concat(r?t:"").concat(e)}v===ft.label&&(n=n.replace(/^[^\s=!,{}()"|+\-/*^]*/,"")),v===ft.metricsql&&(n=n.replace(/^[^\s[\]{}()"|+\-/*^]*/,""));const c="".concat(i).concat(e).concat(s).concat(n);l(c,i.length+e.length)}),[h]);return(0,r.useEffect)((()=>{if(!n.current)return void u({top:0,left:0});const e=n.current.querySelector("textarea")||n.current,t=window.getComputedStyle(e),r="".concat(t.getPropertyValue("font-size")),a="".concat(t.getPropertyValue("font-family")),o=parseInt("".concat(t.getPropertyValue("line-height"))),l=document.createElement("div");l.style.font="".concat(r," ").concat(a),l.style.padding=t.getPropertyValue("padding"),l.style.lineHeight="".concat(o,"px"),l.style.width="".concat(e.offsetWidth,"px"),l.style.maxWidth="".concat(e.offsetWidth,"px"),l.style.whiteSpace=t.getPropertyValue("white-space"),l.style.overflowWrap=t.getPropertyValue("overflow-wrap");const s=document.createElement("span");l.appendChild(document.createTextNode(h.beforeCursor)),l.appendChild(s),l.appendChild(document.createTextNode(h.afterCursor)),document.body.appendChild(l);const c=l.getBoundingClientRect(),d=s.getBoundingClientRect(),m=d.left-c.left,p=d.bottom-c.bottom-(i?o:0);u({top:p,left:m}),l.remove(),s.remove()}),[n,a,i]),Et(St.FK,{children:Et(Mo,{loading:w,disabledFullScreen:!0,value:g,options:k,anchor:n,minLength:0,offset:c,onSelect:x,onFoundOptions:s,maxDisplayResults:{limit:gn,message:"Please, specify the query more precisely."}})})},ol="No match! \nThis query hasn't selected any time series from database.\nEither the requested metrics are missing in the database,\nor there is a typo in series selector.",il="The shown results are marked as PARTIAL.\nThe result is marked as partial if one or more vmstorage nodes failed to respond to the query.",ll=e=>{let{value:t,onChange:n,onEnter:a,onArrowUp:o,onArrowDown:i,autocomplete:l,error:s,stats:c,label:u,disabled:d=!1}=e;const{autocompleteQuick:h}=Sn(),{isMobile:m}=Ur(),[p,f]=(0,r.useState)(!1),[v,g]=(0,r.useState)([0,0]),y=(0,r.useRef)(null),[_,b]=(0,r.useState)(l),w=(0,r.useRef)(Lo()(b,500)).current,k=[{show:"0"===(null===c||void 0===c?void 0:c.seriesFetched)&&!c.resultLength,text:ol},{show:null===c||void 0===c?void 0:c.isPartial,text:il}].filter((e=>e.show)).map((e=>e.text)).join("");c&&(u="".concat(u," (").concat(c.executionTimeMsec||0,"ms)"));return(0,r.useEffect)((()=>{f(l)}),[h]),(0,r.useEffect)((()=>{b(!1),w(!0)}),[v]),Et("div",{className:"vm-query-editor",ref:y,children:[Et(ja,{value:t,label:u,type:"textarea",autofocus:!m,error:s,warning:k,onKeyDown:e=>{const{key:t,ctrlKey:n,metaKey:r,shiftKey:l}=e,s=(e.target.value||"").split("\n").length>1,c=n||r,u="ArrowDown"===t,d="Enter"===t;"ArrowUp"===t&&c&&(e.preventDefault(),o()),u&&c&&(e.preventDefault(),i()),d&&p&&e.preventDefault(),!d||l||s&&!c||p||(e.preventDefault(),a())},onChange:n,onChangeCaret:e=>{g((t=>t[0]===e[0]&&t[1]===e[1]?t:e))},disabled:d,inputmode:"search",caretPosition:v}),_&&l&&Et(al,{value:t,anchorEl:y,caretPosition:v,hasHelperText:Boolean(k||s),onSelect:(e,t)=>{n(e),g([t,t])},onFoundOptions:e=>{f(!!e.length)}})]})},sl=e=>{let{value:t=!1,disabled:n=!1,label:r,color:a="secondary",fullWidth:o,onChange:i}=e;return Et("div",{className:wr()({"vm-switch":!0,"vm-switch_full-width":o,"vm-switch_disabled":n,"vm-switch_active":t,["vm-switch_".concat(a,"_active")]:t,["vm-switch_".concat(a)]:a}),onClick:()=>{n||i(!t)},children:[Et("div",{className:"vm-switch-track",children:Et("div",{className:"vm-switch-track__thumb"})}),r&&Et("span",{className:"vm-switch__label",children:r})]})},cl=e=>{let{isMobile:t,hideButtons:n}=e;const{autocomplete:r}=Sn(),a=Cn(),{nocache:o,isTracingEnabled:i}=Ir(),l=Rr();return Sr("keydown",(e=>{const{code:t,ctrlKey:n,altKey:r}=e;"Space"===t&&(n||r)&&(e.preventDefault(),a({type:"SET_AUTOCOMPLETE_QUICK",payload:!0}))})),Et("div",{className:wr()({"vm-additional-settings":!0,"vm-additional-settings_mobile":t}),children:[!(null!==n&&void 0!==n&&n.autocomplete)&&Et(da,{title:Et(St.FK,{children:["Quick tip: ",ya]}),children:Et(sl,{label:"Autocomplete",value:r,onChange:()=>{a({type:"TOGGLE_AUTOCOMPLETE"})},fullWidth:t})}),Et(sl,{label:"Disable cache",value:o,onChange:()=>{l({type:"TOGGLE_NO_CACHE"})},fullWidth:t}),!(null!==n&&void 0!==n&&n.traceQuery)&&Et(sl,{label:"Trace query",value:i,onChange:()=>{l({type:"TOGGLE_QUERY_TRACING"})},fullWidth:t})]})},ul=e=>{const{isMobile:t}=Ur(),n=(0,r.useRef)(null),{value:a,toggle:o,setFalse:i}=na(!1);return t?Et(St.FK,{children:[Et("div",{ref:n,children:Et(ea,{variant:"outlined",startIcon:Et(ur,{}),onClick:o,ariaLabel:"additional the query settings"})}),Et(ta,{open:a,buttonRef:n,placement:"bottom-left",onClose:i,title:"Query settings",children:Et(cl,{isMobile:t,...e})})]}):Et(cl,{...e})},dl=(e,t)=>e.length===t.length&&e.every(((e,n)=>e===t[n]));const hl=()=>{const{showInfoMessage:e}=(0,r.useContext)(Yr);return async(t,n)=>{var r;if(null===(r=navigator)||void 0===r||!r.clipboard)return e({text:"Clipboard not supported",type:"error"}),console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(t),n&&e({text:n,type:"success"}),!0}catch(a){return a instanceof Error&&e({text:"".concat(a.name,": ").concat(a.message),type:"error"}),console.warn("Copy failed",a),!1}}},ml=e=>{let{query:t,favorites:n,onRun:a,onToggleFavorite:o}=e;const i=hl(),l=(0,r.useMemo)((()=>n.includes(t)),[t,n]);return Et("div",{className:"vm-query-history-item",children:[Et("span",{className:"vm-query-history-item__value",children:t}),Et("div",{className:"vm-query-history-item__buttons",children:[Et(da,{title:"Execute query",children:Et(ea,{size:"small",variant:"text",onClick:()=>{a(t)},startIcon:Et(qn,{})})}),Et(da,{title:"Copy query",children:Et(ea,{size:"small",variant:"text",onClick:async()=>{await i(t,"Query has been copied")},startIcon:Et(nr,{})})}),Et(da,{title:l?"Remove Favorite":"Add to Favorites",children:Et(ea,{size:"small",variant:"text",color:l?"warning":"primary",onClick:()=>{o(t,l)},startIcon:Et(l?pr:mr,{})})})]})]})},pl="saved",fl="favorite",vl=[{label:"Session history",value:"session"},{label:"Saved history",value:pl},{label:"Favorite queries",value:fl}],gl=e=>{let{handleSelectQuery:t}=e;const{queryHistory:n}=Sn(),{isMobile:a}=Ur(),{value:o,setTrue:i,setFalse:l}=na(!1),[s,c]=(0,r.useState)(vl[0].value),[u,d]=(0,r.useState)(vn("QUERY_HISTORY")),[h,m]=(0,r.useState)(vn("QUERY_FAVORITES")),p=(0,r.useMemo)((()=>n.map((e=>e.values.filter((e=>e)).reverse()))),[n]),f=(0,r.useMemo)((()=>{switch(s){case fl:return h;case pl:return u;default:return p}}),[s,h,u,p]),v=null===f||void 0===f?void 0:f.every((e=>!e.length)),g=(0,r.useMemo)((()=>s===fl?"Favorites queries are empty.\nTo see your favorites, mark a query as a favorite.":"Query history is empty.\nTo see the history, please make a query."),[s]),y=e=>n=>{t(n,e),l()},_=(e,t)=>{m((n=>{const r=n[0]||[];return t?[r.filter((t=>t!==e))]:t||r.includes(e)?n:[[...r,e]]}))};return(0,r.useEffect)((()=>{const e=h[0]||[],t=vn("QUERY_FAVORITES")[0]||[];dl(e,t)||Je("QUERY_FAVORITES",JSON.stringify(h))}),[h]),Sr("storage",(()=>{d(vn("QUERY_HISTORY")),m(vn("QUERY_FAVORITES"))})),Et(St.FK,{children:[Et(da,{title:"Show history",children:Et(ea,{color:"primary",variant:"text",onClick:i,startIcon:Et(Hn,{}),ariaLabel:"Show history"})}),o&&Et(ua,{title:"Query history",onClose:l,children:Et("div",{className:wr()({"vm-query-history":!0,"vm-query-history_mobile":a}),children:[Et("div",{className:wr()({"vm-query-history__tabs":!0,"vm-section-header__tabs":!0,"vm-query-history__tabs_mobile":a}),children:Et(Er,{activeItem:s,items:vl,onChange:c})}),Et("div",{className:"vm-query-history-list",children:[v&&Et("div",{className:"vm-query-history-list__no-data",children:g}),f.map(((e,t)=>Et("div",{children:[f.length>1&&Et("div",{className:wr()({"vm-query-history-list__group-title":!0,"vm-query-history-list__group-title_first":0===t}),children:["Query ",t+1]}),e.map(((e,n)=>Et(ml,{query:e,favorites:h.flat(),onRun:y(t),onToggleFavorite:_},n)))]},t))),s===pl&&!v&&Et("div",{className:"vm-query-history-footer",children:Et(ea,{color:"error",variant:"outlined",size:"small",startIcon:Et(Qn,{}),onClick:()=>{Je("QUERY_HISTORY","")},children:"clear history"})})]})]})})]})},yl=e=>{let{containerStyles:t,message:n}=e;const{isDarkTheme:r}=At();return Et("div",{className:wr()({"vm-spinner":!0,"vm-spinner_dark":r}),style:t,children:[Et("div",{className:"half-circle-spinner",children:[Et("div",{className:"circle circle-1"}),Et("div",{className:"circle circle-2"})]}),n&&Et("div",{className:"vm-spinner__message",children:n})]})},_l=()=>{const{serverUrl:e}=At(),{isMobile:t}=Ur(),{value:n,setTrue:a,setFalse:o}=na(!1),{query:i}=Sn(),{period:l}=pn(),[s,c]=(0,r.useState)(!1),[u,d]=(0,r.useState)(""),[h,m]=(0,r.useState)(""),[p,f]=(0,r.useState)("");return Et(St.FK,{children:[Et(ea,{color:"secondary",variant:"outlined",onClick:()=>{a(),f(""),URL.revokeObjectURL(h),d(""),m(""),(async()=>{c(!0);try{const t=encodeURIComponent(i[0]||""),n=encodeURIComponent(l.step||Qt(l.end-l.start,!1)),r="".concat(e,"/api/vmanomaly/config.yaml?query=").concat(t,"&step=").concat(n),a=await fetch(r),o=a.headers.get("Content-Type");if(a.ok)if("application/yaml"==o){const e=await a.blob(),t=await e.text();d(t),m(URL.createObjectURL(e))}else f("Response Content-Type is not YAML, does `Server URL` point to VMAnomaly server?");else{const e=await a.text();f(" ".concat(a.status," ").concat(a.statusText,": ").concat(e))}}catch(p){console.error(p),f(String(p))}c(!1)})()},children:"Open Config"}),n&&Et(ua,{title:"Download config",onClose:o,children:Et("div",{className:wr()({"vm-anomaly-config":!0,"vm-anomaly-config_mobile":t}),children:[s&&Et(yl,{containerStyles:{position:"relative"},message:"Loading config..."}),!s&&p&&Et("div",{className:"vm-anomaly-config-error",children:[Et("div",{className:"vm-anomaly-config-error__icon",children:Et(Rn,{})}),Et("h3",{className:"vm-anomaly-config-error__title",children:"Cannot download config"}),Et("p",{className:"vm-anomaly-config-error__text",children:p})]}),!s&&u&&Et(ja,{value:u,label:"config.yaml",type:"textarea",disabled:!0}),Et("div",{className:"vm-anomaly-config-footer",children:h&&Et("a",{href:h,download:"config.yaml",children:Et(ea,{variant:"contained",startIcon:Et(_r,{}),children:"download"})})})]})})]})},bl=e=>{let{queryErrors:t,setQueryErrors:n,setHideError:a,stats:o,onHideQuery:i,onRunQuery:l,hideButtons:s}=e;const{isMobile:c}=Ur(),{query:u,queryHistory:d,autocomplete:h,autocompleteQuick:m}=Sn(),p=Cn(),f=fn(),[v,g]=(0,r.useState)(u||[]),[y,_]=(0,r.useState)([]),[b,w]=(0,r.useState)(!1),k=Va(v),x=(()=>{const{serverUrl:e}=At();return async t=>{try{const n=encodeURIComponent(t),r="".concat(e,"/prettify-query?query=").concat(n),a=await fetch(r);if(200!=a.status)return{query:t,error:"Error requesting /prettify-query, status: "+a.status};const o=await a.json();return"success"!=o.status?{query:t,error:String(o.msg)}:{query:String(o.query),error:""}}catch(Ap){return console.error(Ap),Ap instanceof Error&&"AbortError"!==Ap.name?{query:t,error:"".concat(Ap.name,": ").concat(Ap.message)}:{query:t,error:String(Ap)}}}})(),S=()=>{p({type:"SET_QUERY_HISTORY",payload:v.map(((e,t)=>{const n=d[t]||{values:[]},r=e===n.values[n.values.length-1],a=!r&&e?[...n.values,e]:n.values;return a.length>25&&a.shift(),{index:n.values.length-Number(r),values:a}}))}),p({type:"SET_QUERY",payload:v}),f({type:"RUN_QUERY"}),l()},C=(e,t)=>{g((n=>n.map(((n,r)=>r===t?e:n))))},E=(e,t)=>()=>{((e,t)=>{const{index:n,values:r}=d[t],a=n+e;a<0||a>=r.length||(C(r[a]||"",t),p({type:"SET_QUERY_HISTORY_BY_INDEX",payload:{value:{values:r,index:a},queryNumber:t}}))})(e,t)},N=e=>t=>{C(t,e),p({type:"SET_AUTOCOMPLETE_QUICK",payload:!1})},A=e=>()=>{var t;t=e,g((e=>e.filter(((e,n)=>n!==t)))),_((t=>t.includes(e)?t.filter((t=>t!==e)):t.map((t=>t>e?t-1:t))))},M=e=>t=>{((e,t)=>{const{ctrlKey:n,metaKey:r}=e;if(n||r){const e=v.map(((e,t)=>t)).filter((e=>e!==t));_((t=>dl(e,t)?[]:e))}else _((e=>e.includes(t)?e.filter((e=>e!==t)):[...e,t]))})(t,e)};return(0,r.useEffect)((()=>{k&&v.length<k.length&&S()}),[v]),(0,r.useEffect)((()=>{i&&i(y)}),[y]),(0,r.useEffect)((()=>{b&&(S(),w(!1))}),[v,b]),(0,r.useEffect)((()=>{g(u||[])}),[u]),Et("div",{className:wr()({"vm-query-configurator":!0,"vm-block":!0,"vm-block_mobile":c}),children:[Et("div",{className:"vm-query-configurator-list",children:v.map(((e,r)=>Et("div",{className:wr()({"vm-query-configurator-list-row":!0,"vm-query-configurator-list-row_disabled":y.includes(r),"vm-query-configurator-list-row_mobile":c}),children:[Et(ll,{value:v[r],autocomplete:!(null!==s&&void 0!==s&&s.autocomplete)&&(h||m),error:t[r],stats:o[r],onArrowUp:E(-1,r),onArrowDown:E(1,r),onEnter:S,onChange:N(r),label:"Query ".concat(v.length>1?r+1:""),disabled:y.includes(r)}),i&&Et(da,{title:y.includes(r)?"Enable query":"Disable query",children:Et("div",{className:"vm-query-configurator-list-row__button",children:Et(ea,{variant:"text",color:"gray",startIcon:y.includes(r)?Et(er,{}):Et(Xn,{}),onClick:M(r),ariaLabel:"visibility query"})})}),!(null!==s&&void 0!==s&&s.prettify)&&Et(da,{title:"Prettify query",children:Et("div",{className:"vm-query-configurator-list-row__button",children:Et(ea,{variant:"text",color:"gray",startIcon:Et(tr,{}),onClick:async()=>await(async e=>{const t=await x(v[e]);a(!1),C(t.query,e),n((n=>(n[e]=t.error,[...n])))})(r),className:"prettify",ariaLabel:"prettify the query"})})}),v.length>1&&Et(da,{title:"Remove Query",children:Et("div",{className:"vm-query-configurator-list-row__button",children:Et(ea,{variant:"text",color:"error",startIcon:Et(Qn,{}),onClick:A(r),ariaLabel:"remove query"})})})]},r)))}),Et("div",{className:"vm-query-configurator-settings",children:[Et(ul,{hideButtons:s}),Et("div",{className:"vm-query-configurator-settings__buttons",children:[Et(gl,{handleSelectQuery:(e,t)=>{C(e,t),w(!0)}}),(null===s||void 0===s?void 0:s.anomalyConfig)&&Et(_l,{}),!(null!==s&&void 0!==s&&s.addQuery)&&v.length<4&&Et(ea,{variant:"outlined",onClick:()=>{g((e=>[...e,""]))},startIcon:Et(Zn,{}),children:"Add Query"}),Et(ea,{variant:"contained",onClick:S,startIcon:Et(Bn,{}),children:c?"Execute":"Execute Query"})]})]})]})};let wl=0;class kl{constructor(e,t){this.tracing=void 0,this.query=void 0,this.tracingChildren=void 0,this.originalTracing=void 0,this.id=void 0,this.tracing=e,this.originalTracing=JSON.parse(JSON.stringify(e)),this.query=t,this.id=wl++;const n=e.children||[];this.tracingChildren=n.map((e=>new kl(e,t)))}get queryValue(){return this.query}get idValue(){return this.id}get children(){return this.tracingChildren}get message(){return this.tracing.message}get duration(){return this.tracing.duration_msec}get JSON(){return JSON.stringify(this.tracing,null,2)}get originalJSON(){return JSON.stringify(this.originalTracing,null,2)}setTracing(e){this.tracing=e;const t=e.children||[];this.tracingChildren=t.map((e=>new kl(e,this.query)))}setQuery(e){this.query=e}resetTracing(){this.tracing=this.originalTracing}}const xl=function(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const{__name__:r,...a}=e.metric,o=t||"".concat(n?"[Query ".concat(e.group,"] "):"").concat(r||"");return 0==Object.keys(a).length?o||"value":"".concat(o,"{").concat(Object.entries(a).map((e=>"".concat(e[0],"=").concat(JSON.stringify(e[1])))).join(", "),"}")},Sl=e=>{switch(e){case"NaN":return NaN;case"Inf":case"+Inf":return 1/0;case"-Inf":return-1/0;default:return parseFloat(e)}},Cl=e=>{if(e.length<2)return!1;const t=["le","vmrange"],n=Object.keys(e[0].metric).filter((e=>!t.includes(e))),r=e.every((r=>{const a=Object.keys(r.metric).filter((e=>!t.includes(e)));return n.length===a.length&&a.every((t=>r.metric[t]===e[0].metric[t]))}));return r&&e.every((e=>t.some((t=>t in e.metric))))},El=He.anomaly==={NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!1}.REACT_APP_TYPE,Nl=e=>{let{predefinedQuery:t,visible:n,display:a,customStep:o,hideQuery:i,showAllSeries:l}=e;const{query:s}=Sn(),{period:c}=pn(),{displayType:u,nocache:d,isTracingEnabled:h,seriesLimits:m}=Ir(),{serverUrl:p}=At(),{isHistogram:f}=jr(),[v,g]=(0,r.useState)(!1),[y,_]=(0,r.useState)(),[b,w]=(0,r.useState)(),[k,x]=(0,r.useState)(),[S,C]=(0,r.useState)(),[E,N]=(0,r.useState)([]),[A,M]=(0,r.useState)([]),[T,L]=(0,r.useState)(),[O,P]=(0,r.useState)([]),[I,R]=(0,r.useState)(!1),D=(0,r.useMemo)((()=>{const{end:e,start:t}=c;return Qt(e-t,f)}),[c,f]),z=(0,r.useCallback)(Lo()((async e=>{let{fetchUrl:t,fetchQueue:n,displayType:r,query:a,stateSeriesLimits:o,showAllSeries:i,hideQuery:l}=e;const s=new AbortController;P([...n,s]);try{const e=r===ht.chart,n=i?1/0:+o[r]||1/0;let c=n;const u=[],d=[];let h=1,m=0,p=!1;for await(const r of t){if(null===l||void 0===l?void 0:l.includes(h-1)){N((e=>[...e,""])),M((e=>[...e,{}])),h++;continue}const t=await fetch(r,{signal:s.signal}),o=await t.json();if(t.ok){if(M((e=>[...e,{...null===o||void 0===o?void 0:o.stats,isPartial:null===o||void 0===o?void 0:o.isPartial,resultLength:o.data.result.length}])),N((e=>[...e,""])),o.trace){const e=new kl(o.trace,a[h-1]);d.push(e)}p=!El&&e&&Cl(o.data.result),c=p?1/0:n;const t=c-u.length;o.data.result.slice(0,t).forEach((e=>{e.group=h,u.push(e)})),m+=o.data.result.length}else{u.push({metric:{},values:[],group:h});const e=o.errorType||mt.unknownType,t=[e,(null===o||void 0===o?void 0:o.error)||(null===o||void 0===o?void 0:o.message)||"see console for more details"].join(",\r\n");N((e=>[...e,"".concat(t)])),console.error("Fetch query error: ".concat(e),o)}h++}const f="Showing ".concat(u.length," series out of ").concat(m," series due to performance reasons. Please narrow down the query, so it returns less series");L(m>c?f:""),e?_(u):w(u),x(d),R((e=>m?p:e))}catch(Ap){const t=Ap;if("AbortError"===t.name)return;const n="Please check your serverURL settings and confirm server availability.";let r="Error executing query: ".concat(t.message,". ").concat(n);"Unexpected end of JSON input"===t.message&&(r+="\nAdditionally, this error can occur if the server response is too large to process. Apply more specific filters to reduce the data volume."),C(r)}g(!1)}),300),[]),F=(0,r.useMemo)((()=>{C(""),N([]),M([]);const e=null!==t&&void 0!==t?t:s,n=(a||u)===ht.chart;if(c)if(p)if(e.every((e=>!e.trim())))N(e.map((()=>mt.validQuery)));else{if(_t(p)){const t={...c};return t.step=o,e.map((e=>n?((e,t,n,r,a)=>"".concat(e,"/api/v1/query_range?query=").concat(encodeURIComponent(t),"&start=").concat(n.start,"&end=").concat(n.end,"&step=").concat(n.step).concat(r?"&nocache=1":"").concat(a?"&trace=1":""))(p,e,t,d,h):((e,t,n,r,a)=>"".concat(e,"/api/v1/query?query=").concat(encodeURIComponent(t),"&time=").concat(n.end,"&step=").concat(n.step).concat(r?"&nocache=1":"").concat(a?"&trace=1":""))(p,e,t,d,h)))}C(mt.validServer)}else C(mt.emptyServer)}),[p,c,u,o,i]),[j,H]=(0,r.useState)([]);return(0,r.useEffect)((()=>{const e=F===j&&!!t;if(!n||null===F||void 0===F||!F.length||e)return;g(!0);z({fetchUrl:F,fetchQueue:O,displayType:a||u,query:null!==t&&void 0!==t?t:s,stateSeriesLimits:m,showAllSeries:l,hideQuery:i}),H(F)}),[F,n,m,l]),(0,r.useEffect)((()=>{const e=O.slice(0,-1);e.length&&(e.map((e=>e.abort())),P(O.filter((e=>!e.signal.aborted))))}),[O]),(0,r.useEffect)((()=>{D===o&&_([])}),[I]),{fetchUrl:F,isLoading:v,graphData:y,liveData:b,error:S,queryErrors:E,setQueryErrors:N,queryStats:A,warning:T,traces:k,isHistogram:I}},Al=()=>{const{tenantId:e}=At(),{displayType:t}=Ir(),{query:n}=Sn(),{duration:a,relativeTime:o,period:{date:i,step:l}}=pn(),{customStep:s}=jr(),[c,u]=je(),d=Mt(),h=fn(),m=Hr(),p=Cn(),f=Rr(),[v,g]=(0,r.useState)(!1),y=(0,r.useCallback)((()=>{if(v)return void g(!1);const r=new URLSearchParams(c);n.forEach(((n,u)=>{var d;const h="g".concat(u);c.get("".concat(h,".expr"))!==n&&n&&r.set("".concat(h,".expr"),n),c.get("".concat(h,".range_input"))!==a&&r.set("".concat(h,".range_input"),a),c.get("".concat(h,".end_input"))!==i&&r.set("".concat(h,".end_input"),i),c.get("".concat(h,".relative_time"))!==o&&r.set("".concat(h,".relative_time"),o||"none");const m=c.get("".concat(h,".step_input"))||l;m&&m!==s&&r.set("".concat(h,".step_input"),s);const p="".concat((null===(d=Nr.find((e=>e.value===t)))||void 0===d?void 0:d.prometheusCode)||0);c.get("".concat(h,".tab"))!==p&&r.set("".concat(h,".tab"),"".concat(p)),c.get("".concat(h,".tenantID"))!==e&&e&&r.set("".concat(h,".tenantID"),e)})),!((e,t)=>{if(Array.from(e.entries()).length!==Array.from(t.entries()).length)return!1;for(const[n,r]of e)if(t.get(n)!==r)return!1;return!0})(r,c)&&r.size&&u(r)}),[e,t,n,a,o,i,l,s]);(0,r.useEffect)((()=>{const e=setTimeout(y,200);return()=>clearTimeout(e)}),[y]),(0,r.useEffect)((()=>{if(!v)return;const r=un(),u=r.duration!==a,g=r.relativeTime!==o,y="none"===r.relativeTime&&r.period.date!==i;(u||g||y)&&h({type:"SET_TIME_STATE",payload:r});const _=Mr();_!==t&&f({type:"SET_DISPLAY_TYPE",payload:_});const b=c.get("g0.tenantID")||"";b!==e&&d({type:"SET_TENANT_ID",payload:b});const w=ut();dl(w,n)||(p({type:"SET_QUERY",payload:w}),h({type:"RUN_QUERY"}));const k=setTimeout((()=>{const e=c.get("g0.step_input")||l;e&&e!==s&&m({type:"SET_CUSTOM_STEP",payload:e})}),50);return()=>clearTimeout(k)}),[c,v]),Sr("popstate",(()=>{g(!0)}))},Ml=e=>{let{text:t,href:n,children:r,colored:a=!0,underlined:o=!1,withIcon:i=!1}=e;return Et("a",{href:n,className:wr()({"vm-link":!0,"vm-link_colored":a,"vm-link_underlined":o,"vm-link_with-icon":i}),target:"_blank",rel:"noreferrer",children:t||r})},Tl=Et(Ml,{text:"last_over_time",href:"https://docs.victoriametrics.com/MetricsQL.html#last_over_time",underlined:!0}),Ll=Et(Ml,{text:"instant query",href:"https://docs.victoriametrics.com/keyConcepts.html#instant-query",underlined:!0}),Ol=()=>Et("div",{children:[Et("p",{children:["This tab shows ",Ll," results for the last 5 minutes ending at the selected time range."]}),Et("p",{children:["Please wrap the query into ",Tl," if you need results over arbitrary lookbehind interval."]})]}),Pl=e=>{let{value:t}=e;return Et("div",{className:"vm-line-progress",children:[Et("div",{className:"vm-line-progress-track",children:Et("div",{className:"vm-line-progress-track__thumb",style:{width:"".concat(t,"%")}})}),Et("span",{children:[t.toFixed(2),"%"]})]})},Il=e=>{let{isRoot:t,trace:n,totalMsec:a,isExpandedAll:o}=e;const{isDarkTheme:i}=At(),{isMobile:l}=Ur(),[s,c]=(0,r.useState)({}),u=(0,r.useRef)(null),[d,h]=(0,r.useState)(!1),[m,p]=(0,r.useState)(!1),f=qt(n.duration/1e3)||"".concat(n.duration,"ms");(0,r.useEffect)((()=>{if(!u.current)return;const e=u.current,t=u.current.children[0],{height:n}=t.getBoundingClientRect();h(n>e.clientHeight)}),[n]);const v=n.children&&!!n.children.length,g=n.duration/a*100,y=e=>{var t;const n=[e.idValue];return null===e||void 0===e||null===(t=e.children)||void 0===t||t.forEach((e=>{n.push(...y(e))})),n};return(0,r.useEffect)((()=>{if(!o)return void c([]);const e=y(n),t={};e.forEach((e=>{t[e]=!0})),c(t)}),[o]),Et("div",{className:wr()({"vm-nested-nav":!0,"vm-nested-nav_root":t,"vm-nested-nav_dark":i,"vm-nested-nav_mobile":l}),children:[Et("div",{className:wr()({"vm-nested-nav-header":!0,"vm-nested-nav-header_open":s[n.idValue]}),onClick:(_=n.idValue,()=>{v&&c((e=>({...e,[_]:!e[_]})))}),children:[v&&Et("div",{className:wr()({"vm-nested-nav-header__icon":!0,"vm-nested-nav-header__icon_open":s[n.idValue]}),children:Et(Fn,{})}),Et("div",{className:"vm-nested-nav-header__progress",children:Et(Pl,{value:g})}),Et("div",{className:wr()({"vm-nested-nav-header__message":!0,"vm-nested-nav-header__message_show-full":m}),ref:u,children:[Et("span",{className:"vm-nested-nav-header__message_duration",children:f}),":\xa0",Et("span",{children:n.message})]}),Et("div",{className:"vm-nested-nav-header-bottom",children:(d||m)&&Et(ea,{variant:"text",size:"small",onClick:e=>{e.stopPropagation(),p((e=>!e))},children:m?"Hide":"Show full query"})})]}),s[n.idValue]&&Et("div",{className:"vm-nested-nav__childrens",children:v&&n.children.map((e=>Et(Il,{trace:e,totalMsec:a,isExpandedAll:o},e.duration)))})]});var _},Rl=Il,Dl=e=>{let{editable:t=!1,defaultTile:n="JSON",displayTitle:a=!0,defaultJson:o="",resetValue:i="",onClose:l,onUpload:s}=e;const c=hl(),{isMobile:u}=Ur(),[d,h]=(0,r.useState)(o),[m,p]=(0,r.useState)(n),[f,v]=(0,r.useState)(""),[g,y]=(0,r.useState)(""),_=(0,r.useMemo)((()=>{try{const e=JSON.parse(d),t=e.trace||e;return t.duration_msec?(new kl(t,""),""):mt.traceNotFound}catch(Ap){return Ap instanceof Error?Ap.message:"Unknown error"}}),[d]),b=()=>{y(_);m.trim()||v(mt.emptyTitle),_||f||(s(d,m),l())};return Et("div",{className:wr()({"vm-json-form":!0,"vm-json-form_one-field":!a,"vm-json-form_one-field_mobile":!a&&u,"vm-json-form_mobile":u}),children:[a&&Et(ja,{value:m,label:"Title",error:f,onEnter:b,onChange:e=>{p(e)}}),Et(ja,{value:d,label:"JSON",type:"textarea",error:g,autofocus:!0,onChange:e=>{y(""),h(e)},onEnter:b,disabled:!t}),Et("div",{className:"vm-json-form-footer",children:[Et("div",{className:"vm-json-form-footer__controls",children:[Et(ea,{variant:"outlined",startIcon:Et(nr,{}),onClick:async()=>{await c(d,"Formatted JSON has been copied")},children:"Copy JSON"}),i&&Et(ea,{variant:"text",startIcon:Et(On,{}),onClick:()=>{h(i)},children:"Reset JSON"})]}),Et("div",{className:"vm-json-form-footer__controls vm-json-form-footer__controls_right",children:[Et(ea,{variant:"outlined",color:"error",onClick:l,children:"Cancel"}),Et(ea,{variant:"contained",onClick:b,children:"apply"})]})]})]})},zl=e=>{let{traces:t,jsonEditor:n=!1,onDeleteClick:a}=e;const{isMobile:o}=Ur(),[i,l]=(0,r.useState)(null),[s,c]=(0,r.useState)([]),u=()=>{l(null)};if(!t.length)return Et(qr,{variant:"info",children:"Please re-run the query to see results of the tracing"});const d=e=>()=>{a(e)},h=e=>()=>{l(e)},m=e=>()=>{const t=new Blob([e.originalJSON],{type:"application/json"}),n=URL.createObjectURL(t),r=document.createElement("a");r.href=n,r.download="vmui_trace_".concat(e.queryValue,".json"),document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)};return Et(St.FK,{children:[Et("div",{className:"vm-tracings-view",children:t.map((e=>{return Et("div",{className:"vm-tracings-view-trace vm-block vm-block_empty-padding",children:[Et("div",{className:"vm-tracings-view-trace-header",children:[Et("h3",{className:"vm-tracings-view-trace-header-title",children:["Trace for ",Et("b",{className:"vm-tracings-view-trace-header-title__query",children:e.queryValue})]}),Et(da,{title:s.includes(e.idValue)?"Collapse All":"Expand All",children:Et(ea,{variant:"text",startIcon:Et("div",{className:wr()({"vm-tracings-view-trace-header__expand-icon":!0,"vm-tracings-view-trace-header__expand-icon_open":s.includes(e.idValue)}),children:Et(Fn,{})}),onClick:(t=e,()=>{c((e=>e.includes(t.idValue)?e.filter((e=>e!==t.idValue)):[...e,t.idValue]))}),ariaLabel:s.includes(e.idValue)?"Collapse All":"Expand All"})}),Et(da,{title:"Save Trace to JSON",children:Et(ea,{variant:"text",startIcon:Et(_r,{}),onClick:m(e),ariaLabel:"Save trace to JSON"})}),Et(da,{title:"Open JSON",children:Et(ea,{variant:"text",startIcon:Et(Kn,{}),onClick:h(e),ariaLabel:"open JSON"})}),Et(da,{title:"Remove trace",children:Et(ea,{variant:"text",color:"error",startIcon:Et(Qn,{}),onClick:d(e),ariaLabel:"remove trace"})})]}),Et("nav",{className:wr()({"vm-tracings-view-trace__nav":!0,"vm-tracings-view-trace__nav_mobile":o}),children:Et(Rl,{isRoot:!0,trace:e,totalMsec:e.duration,isExpandedAll:s.includes(e.idValue)})})]},e.idValue);var t}))}),i&&Et(ua,{title:i.queryValue,onClose:u,children:Et(Dl,{editable:n,displayTitle:n,defaultTile:i.queryValue,defaultJson:i.JSON,resetValue:i.originalJSON,onClose:u,onUpload:(e,t)=>{if(n&&i)try{i.setTracing(JSON.parse(e)),i.setQuery(t),l(null)}catch(Ap){console.error(Ap)}}})})]})},Fl=e=>{let{traces:t,displayType:n}=e;const{isTracingEnabled:a}=Ir(),[o,i]=(0,r.useState)([]);return(0,r.useEffect)((()=>{t&&i([...o,...t])}),[t]),(0,r.useEffect)((()=>{i([])}),[n]),Et(St.FK,{children:a&&Et("div",{className:"vm-custom-panel__trace",children:Et(zl,{traces:o,onDeleteClick:e=>{const t=o.filter((t=>t.idValue!==e.idValue));i([...t])}})})})},jl=e=>{let{warning:t,query:n,onChange:a}=e;const{isMobile:o}=Ur(),{value:i,setTrue:l,setFalse:s}=na(!1);return(0,r.useEffect)(s,[n]),(0,r.useEffect)((()=>{a(i)}),[i]),Et(qr,{variant:"warning",children:Et("div",{className:wr()({"vm-custom-panel__warning":!0,"vm-custom-panel__warning_mobile":o}),children:[Et("p",{children:t}),Et(ea,{color:"warning",variant:"outlined",onClick:l,children:"Show all"})]})})},Hl="u-off",Vl="u-label",$l="width",Ul="height",Bl="top",ql="bottom",Yl="left",Wl="right",Kl="#000",Ql=Kl+"0",Zl="mousemove",Gl="mousedown",Jl="mouseup",Xl="mouseenter",es="mouseleave",ts="dblclick",ns="change",rs="dppxchange",as="--",os="undefined"!=typeof window,is=os?document:null,ls=os?window:null,ss=os?navigator:null;let cs,us;function ds(e,t){if(null!=t){let n=e.classList;!n.contains(t)&&n.add(t)}}function hs(e,t){let n=e.classList;n.contains(t)&&n.remove(t)}function ms(e,t,n){e.style[t]=n+"px"}function ps(e,t,n,r){let a=is.createElement(e);return null!=t&&ds(a,t),null!=n&&n.insertBefore(a,r),a}function fs(e,t){return ps("div",e,t)}const vs=new WeakMap;function gs(e,t,n,r,a){let o="translate("+t+"px,"+n+"px)";o!=vs.get(e)&&(e.style.transform=o,vs.set(e,o),t<0||n<0||t>r||n>a?ds(e,Hl):hs(e,Hl))}const ys=new WeakMap;function _s(e,t,n){let r=t+n;r!=ys.get(e)&&(ys.set(e,r),e.style.background=t,e.style.borderColor=n)}const bs=new WeakMap;function ws(e,t,n,r){let a=t+""+n;a!=bs.get(e)&&(bs.set(e,a),e.style.height=n+"px",e.style.width=t+"px",e.style.marginLeft=r?-t/2+"px":0,e.style.marginTop=r?-n/2+"px":0)}const ks={passive:!0},xs={...ks,capture:!0};function Ss(e,t,n,r){t.addEventListener(e,n,r?xs:ks)}function Cs(e,t,n,r){t.removeEventListener(e,n,r?xs:ks)}function Es(e,t,n,r){let a;n=n||0;let o=(r=r||t.length-1)<=2147483647;for(;r-n>1;)a=o?n+r>>1:$s((n+r)/2),t[a]<e?n=a:r=a;return e-t[n]<=t[r]-e?n:r}function Ns(e,t,n,r){for(let a=1==r?t:n;a>=t&&a<=n;a+=r)if(null!=e[a])return a;return-1}function As(e,t,n,r){let a=Ks(e),o=Ks(t);e==t&&(-1==a?(e*=n,t/=n):(e/=n,t*=n));let i=10==n?Qs:Zs,l=1==o?Bs:$s,s=(1==a?$s:Bs)(i(Vs(e))),c=l(i(Vs(t))),u=Ws(n,s),d=Ws(n,c);return 10==n&&(s<0&&(u=dc(u,-s)),c<0&&(d=dc(d,-c))),r||2==n?(e=u*a,t=d*o):(e=uc(e,u),t=cc(t,d)),[e,t]}function Ms(e,t,n,r){let a=As(e,t,n,r);return 0==e&&(a[0]=0),0==t&&(a[1]=0),a}os&&function e(){let t=devicePixelRatio;cs!=t&&(cs=t,us&&Cs(ns,us,e),us=matchMedia("(min-resolution: ".concat(cs-.001,"dppx) and (max-resolution: ").concat(cs+.001,"dppx)")),Ss(ns,us,e),ls.dispatchEvent(new CustomEvent(rs)))}();const Ts=.1,Ls={mode:3,pad:Ts},Os={pad:0,soft:null,mode:0},Ps={min:Os,max:Os};function Is(e,t,n,r){return wc(n)?Ds(e,t,n):(Os.pad=n,Os.soft=r?0:null,Os.mode=r?3:0,Ds(e,t,Ps))}function Rs(e,t){return null==e?t:e}function Ds(e,t,n){let r=n.min,a=n.max,o=Rs(r.pad,0),i=Rs(a.pad,0),l=Rs(r.hard,-Js),s=Rs(a.hard,Js),c=Rs(r.soft,Js),u=Rs(a.soft,-Js),d=Rs(r.mode,0),h=Rs(a.mode,0),m=t-e,p=Qs(m),f=Ys(Vs(e),Vs(t)),v=Qs(f),g=Vs(v-p);(m<1e-9||g>10)&&(m=0,0!=e&&0!=t||(m=1e-9,2==d&&c!=Js&&(o=0),2==h&&u!=-Js&&(i=0)));let y=m||f||1e3,_=Qs(y),b=Ws(10,$s(_)),w=dc(uc(e-y*(0==m?0==e?.1:1:o),b/10),9),k=e>=c&&(1==d||3==d&&w<=c||2==d&&w>=c)?c:Js,x=Ys(l,w<k&&e>=k?k:qs(k,w)),S=dc(cc(t+y*(0==m?0==t?.1:1:i),b/10),9),C=t<=u&&(1==h||3==h&&S>=u||2==h&&S<=u)?u:-Js,E=qs(s,S>C&&t<=C?C:Ys(C,S));return x==E&&0==x&&(E=100),[x,E]}const zs=new Intl.NumberFormat(os?ss.language:"en-US"),Fs=e=>zs.format(e),js=Math,Hs=js.PI,Vs=js.abs,$s=js.floor,Us=js.round,Bs=js.ceil,qs=js.min,Ys=js.max,Ws=js.pow,Ks=js.sign,Qs=js.log10,Zs=js.log2,Gs=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return js.asinh(e/t)},Js=1/0;function Xs(e){return 1+(0|Qs((e^e>>31)-(e>>31)))}function ec(e,t,n){return qs(Ys(e,t),n)}function tc(e){return"function"==typeof e?e:()=>e}const nc=e=>e,rc=(e,t)=>t,ac=e=>null,oc=e=>!0,ic=(e,t)=>e==t,lc=e=>dc(e,14);function sc(e,t){return lc(dc(lc(e/t))*t)}function cc(e,t){return lc(Bs(lc(e/t))*t)}function uc(e,t){return lc($s(lc(e/t))*t)}function dc(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(_c(e))return e;let n=10**t,r=e*n*(1+Number.EPSILON);return Us(r)/n}const hc=new Map;function mc(e){return((""+e).split(".")[1]||"").length}function pc(e,t,n,r){let a=[],o=r.map(mc);for(let i=t;i<n;i++){let t=Vs(i),n=dc(Ws(e,i),t);for(let e=0;e<r.length;e++){let l=r[e]*n,s=(l>=0&&i>=0?0:t)+(i>=o[e]?0:o[e]),c=dc(l,s);a.push(c),hc.set(c,s)}}return a}const fc={},vc=[],gc=[null,null],yc=Array.isArray,_c=Number.isInteger;function bc(e){return"string"==typeof e}function wc(e){let t=!1;if(null!=e){let n=e.constructor;t=null==n||n==Object}return t}function kc(e){return null!=e&&"object"==typeof e}const xc=Object.getPrototypeOf(Uint8Array);function Sc(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:wc;if(yc(e)){let r=e.find((e=>null!=e));if(yc(r)||n(r)){t=Array(e.length);for(let r=0;r<e.length;r++)t[r]=Sc(e[r],n)}else t=e.slice()}else if(e instanceof xc)t=e.slice();else if(n(e)){t={};for(let r in e)t[r]=Sc(e[r],n)}else t=e;return t}function Cc(e){let t=arguments;for(let n=1;n<t.length;n++){let r=t[n];for(let t in r)wc(e[t])?Cc(e[t],Sc(r[t])):e[t]=Sc(r[t])}return e}function Ec(e,t,n){for(let r,a=0,o=-1;a<t.length;a++){let i=t[a];if(i>o){for(r=i-1;r>=0&&null==e[r];)e[r--]=null;for(r=i+1;r<n&&null==e[r];)e[o=r++]=null}}}const Nc="undefined"==typeof queueMicrotask?e=>Promise.resolve().then(e):queueMicrotask;const Ac=["January","February","March","April","May","June","July","August","September","October","November","December"],Mc=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function Tc(e){return e.slice(0,3)}const Lc=Mc.map(Tc),Oc=Ac.map(Tc),Pc={MMMM:Ac,MMM:Oc,WWWW:Mc,WWW:Lc};function Ic(e){return(e<10?"0":"")+e}const Rc={YYYY:e=>e.getFullYear(),YY:e=>(e.getFullYear()+"").slice(2),MMMM:(e,t)=>t.MMMM[e.getMonth()],MMM:(e,t)=>t.MMM[e.getMonth()],MM:e=>Ic(e.getMonth()+1),M:e=>e.getMonth()+1,DD:e=>Ic(e.getDate()),D:e=>e.getDate(),WWWW:(e,t)=>t.WWWW[e.getDay()],WWW:(e,t)=>t.WWW[e.getDay()],HH:e=>Ic(e.getHours()),H:e=>e.getHours(),h:e=>{let t=e.getHours();return 0==t?12:t>12?t-12:t},AA:e=>e.getHours()>=12?"PM":"AM",aa:e=>e.getHours()>=12?"pm":"am",a:e=>e.getHours()>=12?"p":"a",mm:e=>Ic(e.getMinutes()),m:e=>e.getMinutes(),ss:e=>Ic(e.getSeconds()),s:e=>e.getSeconds(),fff:e=>{return((t=e.getMilliseconds())<10?"00":t<100?"0":"")+t;var t}};function Dc(e,t){t=t||Pc;let n,r=[],a=/\{([a-z]+)\}|[^{]+/gi;for(;n=a.exec(e);)r.push("{"==n[0][0]?Rc[n[1]]:n[0]);return e=>{let n="";for(let a=0;a<r.length;a++)n+="string"==typeof r[a]?r[a]:r[a](e,t);return n}}const zc=(new Intl.DateTimeFormat).resolvedOptions().timeZone;const Fc=e=>e%1==0,jc=[1,2,2.5,5],Hc=pc(10,-16,0,jc),Vc=pc(10,0,16,jc),$c=Vc.filter(Fc),Uc=Hc.concat(Vc),Bc="{YYYY}",qc="\n"+Bc,Yc="{M}/{D}",Wc="\n"+Yc,Kc=Wc+"/{YY}",Qc="{aa}",Zc="{h}:{mm}"+Qc,Gc="\n"+Zc,Jc=":{ss}",Xc=null;function eu(e){let t=1e3*e,n=60*t,r=60*n,a=24*r,o=30*a,i=365*a;return[(1==e?pc(10,0,3,jc).filter(Fc):pc(10,-3,0,jc)).concat([t,5*t,10*t,15*t,30*t,n,5*n,10*n,15*n,30*n,r,2*r,3*r,4*r,6*r,8*r,12*r,a,2*a,3*a,4*a,5*a,6*a,7*a,8*a,9*a,10*a,15*a,o,2*o,3*o,4*o,6*o,i,2*i,5*i,10*i,25*i,50*i,100*i]),[[i,Bc,Xc,Xc,Xc,Xc,Xc,Xc,1],[28*a,"{MMM}",qc,Xc,Xc,Xc,Xc,Xc,1],[a,Yc,qc,Xc,Xc,Xc,Xc,Xc,1],[r,"{h}"+Qc,Kc,Xc,Wc,Xc,Xc,Xc,1],[n,Zc,Kc,Xc,Wc,Xc,Xc,Xc,1],[t,Jc,Kc+" "+Zc,Xc,Wc+" "+Zc,Xc,Gc,Xc,1],[e,Jc+".{fff}",Kc+" "+Zc,Xc,Wc+" "+Zc,Xc,Gc,Xc,1]],function(t){return(l,s,c,u,d,h)=>{let m=[],p=d>=i,f=d>=o&&d<i,v=t(c),g=dc(v*e,3),y=cu(v.getFullYear(),p?0:v.getMonth(),f||p?1:v.getDate()),_=dc(y*e,3);if(f||p){let n=f?d/o:0,r=p?d/i:0,a=g==_?g:dc(cu(y.getFullYear()+r,y.getMonth()+n,1)*e,3),l=new Date(Us(a/e)),s=l.getFullYear(),c=l.getMonth();for(let o=0;a<=u;o++){let i=cu(s+r*o,c+n*o,1),l=i-t(dc(i*e,3));a=dc((+i+l)*e,3),a<=u&&m.push(a)}}else{let o=d>=a?a:d,i=_+($s(c)-$s(g))+cc(g-_,o);m.push(i);let p=t(i),f=p.getHours()+p.getMinutes()/n+p.getSeconds()/r,v=d/r,y=h/l.axes[s]._space;for(;i=dc(i+d,1==e?0:3),!(i>u);)if(v>1){let e=$s(dc(f+v,6))%24,n=t(i).getHours()-e;n>1&&(n=-1),i-=n*r,f=(f+v)%24,dc((i-m[m.length-1])/d,3)*y>=.7&&m.push(i)}else m.push(i)}return m}}]}const[tu,nu,ru]=eu(1),[au,ou,iu]=eu(.001);function lu(e,t){return e.map((e=>e.map(((n,r)=>0==r||8==r||null==n?n:t(1==r||0==e[8]?n:e[1]+n)))))}function su(e,t){return(n,r,a,o,i)=>{let l,s,c,u,d,h,m=t.find((e=>i>=e[0]))||t[t.length-1];return r.map((t=>{let n=e(t),r=n.getFullYear(),a=n.getMonth(),o=n.getDate(),i=n.getHours(),p=n.getMinutes(),f=n.getSeconds(),v=r!=l&&m[2]||a!=s&&m[3]||o!=c&&m[4]||i!=u&&m[5]||p!=d&&m[6]||f!=h&&m[7]||m[1];return l=r,s=a,c=o,u=i,d=p,h=f,v(n)}))}}function cu(e,t,n){return new Date(e,t,n)}function uu(e,t){return t(e)}pc(2,-53,53,[1]);function du(e,t){return(n,r,a,o)=>null==o?as:t(e(r))}const hu={show:!0,live:!0,isolate:!1,mount:()=>{},markers:{show:!0,width:2,stroke:function(e,t){let n=e.series[t];return n.width?n.stroke(e,t):n.points.width?n.points.stroke(e,t):null},fill:function(e,t){return e.series[t].fill(e,t)},dash:"solid"},idx:null,idxs:null,values:[]};const mu=[0,0];function pu(e,t,n){let r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return e=>{0==e.button&&(!r||e.target==t)&&n(e)}}function fu(e,t,n){let r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return e=>{(!r||e.target==t)&&n(e)}}const vu={show:!0,x:!0,y:!0,lock:!1,move:function(e,t,n){return mu[0]=t,mu[1]=n,mu},points:{show:function(e,t){let n=e.cursor.points,r=fs(),a=n.size(e,t);ms(r,$l,a),ms(r,Ul,a);let o=a/-2;ms(r,"marginLeft",o),ms(r,"marginTop",o);let i=n.width(e,t,a);return i&&ms(r,"borderWidth",i),r},size:function(e,t){return e.series[t].points.size},width:0,stroke:function(e,t){let n=e.series[t].points;return n._stroke||n._fill},fill:function(e,t){let n=e.series[t].points;return n._fill||n._stroke}},bind:{mousedown:pu,mouseup:pu,click:pu,dblclick:pu,mousemove:fu,mouseleave:fu,mouseenter:fu},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,click:(e,t)=>{t.stopPropagation(),t.stopImmediatePropagation()},_x:!1,_y:!1},focus:{dist:(e,t,n,r,a)=>r-a,prox:-1,bias:0},hover:{skip:[void 0],prox:null,bias:0},left:-10,top:-10,idx:null,dataIdx:null,idxs:null,event:null},gu={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},yu=Cc({},gu,{filter:rc}),_u=Cc({},yu,{size:10}),bu=Cc({},gu,{show:!1}),wu='12px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',ku="bold "+wu,xu={show:!0,scale:"x",stroke:Kl,space:50,gap:5,size:50,labelGap:0,labelSize:30,labelFont:ku,side:2,grid:yu,ticks:_u,border:bu,font:wu,lineGap:1.5,rotate:0},Su={show:!0,scale:"x",auto:!1,sorted:1,min:Js,max:-Js,idxs:[]};function Cu(e,t,n,r,a){return t.map((e=>null==e?"":Fs(e)))}function Eu(e,t,n,r,a,o,i){let l=[],s=hc.get(a)||0;for(let c=n=i?n:dc(cc(n,a),s);c<=r;c=dc(c+a,s))l.push(Object.is(c,-0)?0:c);return l}function Nu(e,t,n,r,a,o,i){const l=[],s=e.scales[e.axes[t].scale].log,c=$s((10==s?Qs:Zs)(n));a=Ws(s,c),10==s&&c<0&&(a=dc(a,-c));let u=n;do{l.push(u),u+=a,10==s&&(u=dc(u,hc.get(a))),u>=a*s&&(a=u)}while(u<=r);return l}function Au(e,t,n,r,a,o,i){let l=e.scales[e.axes[t].scale].asinh,s=r>l?Nu(e,t,Ys(l,n),r,a):[l],c=r>=0&&n<=0?[0]:[];return(n<-l?Nu(e,t,Ys(l,-r),-n,a):[l]).reverse().map((e=>-e)).concat(c,s)}const Mu=/./,Tu=/[12357]/,Lu=/[125]/,Ou=/1/,Pu=(e,t,n,r)=>e.map(((e,a)=>4==t&&0==e||a%r==0&&n.test(e.toExponential()[e<0?1:0])?e:null));function Iu(e,t,n,r,a){let o=e.axes[n],i=o.scale,l=e.scales[i],s=e.valToPos,c=o._space,u=s(10,i),d=s(9,i)-u>=c?Mu:s(7,i)-u>=c?Tu:s(5,i)-u>=c?Lu:Ou;if(d==Ou){let e=Vs(s(1,i)-u);if(e<c)return Pu(t.slice().reverse(),l.distr,d,Bs(c/e)).reverse()}return Pu(t,l.distr,d,1)}function Ru(e,t,n,r,a){let o=e.axes[n],i=o.scale,l=o._space,s=e.valToPos,c=Vs(s(1,i)-s(2,i));return c<l?Pu(t.slice().reverse(),3,Mu,Bs(l/c)).reverse():t}function Du(e,t,n,r){return null==r?as:null==t?"":Fs(t)}const zu={show:!0,scale:"y",stroke:Kl,space:30,gap:5,size:50,labelGap:0,labelSize:30,labelFont:ku,side:3,grid:yu,ticks:_u,border:bu,font:wu,lineGap:1.5,rotate:0};const Fu={scale:null,auto:!0,sorted:0,min:Js,max:-Js},ju=(e,t,n,r,a)=>a,Hu={show:!0,auto:!0,sorted:0,gaps:ju,alpha:1,facets:[Cc({},Fu,{scale:"x"}),Cc({},Fu,{scale:"y"})]},Vu={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:ju,alpha:1,points:{show:function(e,t){let{scale:n,idxs:r}=e.series[0],a=e._data[0],o=e.valToPos(a[r[0]],n,!0),i=e.valToPos(a[r[1]],n,!0),l=Vs(i-o)/(e.series[t].points.space*cs);return r[1]-r[0]<=l},filter:null},values:null,min:Js,max:-Js,idxs:[],path:null,clip:null};function $u(e,t,n,r,a){return n/10}const Uu={time:!0,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},Bu=Cc({},Uu,{time:!1,ori:1}),qu={};function Yu(e,t){let n=qu[e];return n||(n={key:e,plots:[],sub(e){n.plots.push(e)},unsub(e){n.plots=n.plots.filter((t=>t!=e))},pub(e,t,r,a,o,i,l){for(let s=0;s<n.plots.length;s++)n.plots[s]!=t&&n.plots[s].pub(e,t,r,a,o,i,l)}},null!=e&&(qu[e]=n)),n}const Wu=1;function Ku(e,t,n){const r=e.mode,a=e.series[t],o=2==r?e._data[t]:e._data,i=e.scales,l=e.bbox;let s=o[0],c=2==r?o[1]:o[t],u=2==r?i[a.facets[0].scale]:i[e.series[0].scale],d=2==r?i[a.facets[1].scale]:i[a.scale],h=l.left,m=l.top,p=l.width,f=l.height,v=e.valToPosH,g=e.valToPosV;return 0==u.ori?n(a,s,c,u,d,v,g,h,m,p,f,nd,ad,id,sd,ud):n(a,s,c,u,d,g,v,m,h,f,p,rd,od,ld,cd,dd)}function Qu(e,t){let n=0,r=0,a=Rs(e.bands,vc);for(let o=0;o<a.length;o++){let e=a[o];e.series[0]==t?n=e.dir:e.series[1]==t&&(1==e.dir?r|=1:r|=2)}return[n,1==r?-1:2==r?1:3==r?2:0]}function Zu(e,t,n,r,a){let o=e.mode,i=e.series[t],l=2==o?i.facets[1].scale:i.scale,s=e.scales[l];return-1==a?s.min:1==a?s.max:3==s.distr?1==s.dir?s.min:s.max:0}function Gu(e,t,n,r,a,o){return Ku(e,t,((e,t,i,l,s,c,u,d,h,m,p)=>{let f=e.pxRound;const v=l.dir*(0==l.ori?1:-1),g=0==l.ori?ad:od;let y,_;1==v?(y=n,_=r):(y=r,_=n);let b=f(c(t[y],l,m,d)),w=f(u(i[y],s,p,h)),k=f(c(t[_],l,m,d)),x=f(u(1==o?s.max:s.min,s,p,h)),S=new Path2D(a);return g(S,k,x),g(S,b,x),g(S,b,w),S}))}function Ju(e,t,n,r,a,o){let i=null;if(e.length>0){i=new Path2D;const l=0==t?id:ld;let s=n;for(let t=0;t<e.length;t++){let n=e[t];if(n[1]>n[0]){let e=n[0]-s;e>0&&l(i,s,r,e,r+o),s=n[1]}}let c=n+a-s,u=10;c>0&&l(i,s,r-u/2,c,r+o+u)}return i}function Xu(e,t,n,r,a,o,i){let l=[],s=e.length;for(let c=1==a?n:r;c>=n&&c<=r;c+=a){if(null===t[c]){let u=c,d=c;if(1==a)for(;++c<=r&&null===t[c];)d=c;else for(;--c>=n&&null===t[c];)d=c;let h=o(e[u]),m=d==u?h:o(e[d]),p=u-a;h=i<=0&&p>=0&&p<s?o(e[p]):h;let f=d+a;m=i>=0&&f>=0&&f<s?o(e[f]):m,m>=h&&l.push([h,m])}}return l}function ed(e){return 0==e?nc:1==e?Us:t=>sc(t,e)}function td(e){let t=0==e?nd:rd,n=0==e?(e,t,n,r,a,o)=>{e.arcTo(t,n,r,a,o)}:(e,t,n,r,a,o)=>{e.arcTo(n,t,a,r,o)},r=0==e?(e,t,n,r,a)=>{e.rect(t,n,r,a)}:(e,t,n,r,a)=>{e.rect(n,t,a,r)};return function(e,a,o,i,l){let s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,c=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;0==s&&0==c?r(e,a,o,i,l):(s=qs(s,i/2,l/2),c=qs(c,i/2,l/2),t(e,a+s,o),n(e,a+i,o,a+i,o+l,s),n(e,a+i,o+l,a,o+l,c),n(e,a,o+l,a,o,c),n(e,a,o,a+i,o,s),e.closePath())}}const nd=(e,t,n)=>{e.moveTo(t,n)},rd=(e,t,n)=>{e.moveTo(n,t)},ad=(e,t,n)=>{e.lineTo(t,n)},od=(e,t,n)=>{e.lineTo(n,t)},id=td(0),ld=td(1),sd=(e,t,n,r,a,o)=>{e.arc(t,n,r,a,o)},cd=(e,t,n,r,a,o)=>{e.arc(n,t,r,a,o)},ud=(e,t,n,r,a,o,i)=>{e.bezierCurveTo(t,n,r,a,o,i)},dd=(e,t,n,r,a,o,i)=>{e.bezierCurveTo(n,t,a,r,i,o)};function hd(e){return(e,t,n,r,a)=>Ku(e,t,((t,o,i,l,s,c,u,d,h,m,p)=>{let f,v,{pxRound:g,points:y}=t;0==l.ori?(f=nd,v=sd):(f=rd,v=cd);const _=dc(y.width*cs,3);let b=(y.size-y.width)/2*cs,w=dc(2*b,3),k=new Path2D,x=new Path2D,{left:S,top:C,width:E,height:N}=e.bbox;id(x,S-w,C-w,E+2*w,N+2*w);const A=e=>{if(null!=i[e]){let t=g(c(o[e],l,m,d)),n=g(u(i[e],s,p,h));f(k,t+b,n),v(k,t,n,b,0,2*Hs)}};if(a)a.forEach(A);else for(let e=n;e<=r;e++)A(e);return{stroke:_>0?k:null,fill:k,clip:x,flags:2|Wu}}))}function md(e){return(t,n,r,a,o,i)=>{r!=a&&(o!=r&&i!=r&&e(t,n,r),o!=a&&i!=a&&e(t,n,a),e(t,n,i))}}const pd=md(ad),fd=md(od);function vd(e){const t=Rs(null===e||void 0===e?void 0:e.alignGaps,0);return(e,n,r,a)=>Ku(e,n,((o,i,l,s,c,u,d,h,m,p,f)=>{let v,g,y=o.pxRound,_=e=>y(u(e,s,p,h)),b=e=>y(d(e,c,f,m));0==s.ori?(v=ad,g=pd):(v=od,g=fd);const w=s.dir*(0==s.ori?1:-1),k={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:Wu},x=k.stroke;let S,C,E,N=Js,A=-Js,M=_(i[1==w?r:a]),T=Ns(l,r,a,1*w),L=Ns(l,r,a,-1*w),O=_(i[T]),P=_(i[L]),I=!1;for(let e=1==w?r:a;e>=r&&e<=a;e+=w){let t=_(i[e]),n=l[e];t==M?null!=n?(C=b(n),N==Js&&(v(x,t,C),S=C),N=qs(C,N),A=Ys(C,A)):null===n&&(I=!0):(N!=Js&&(g(x,M,N,A,S,C),E=M),null!=n?(C=b(n),v(x,t,C),N=A=S=C):(N=Js,A=-Js,null===n&&(I=!0)),M=t)}N!=Js&&N!=A&&E!=M&&g(x,M,N,A,S,C);let[R,D]=Qu(e,n);if(null!=o.fill||0!=R){let t=k.fill=new Path2D(x),r=b(o.fillTo(e,n,o.min,o.max,R));v(t,P,r),v(t,O,r)}if(!o.spanGaps){let c=[];I&&c.push(...Xu(i,l,r,a,w,_,t)),k.gaps=c=o.gaps(e,n,r,a,c),k.clip=Ju(c,s.ori,h,m,p,f)}return 0!=D&&(k.band=2==D?[Gu(e,n,r,a,x,-1),Gu(e,n,r,a,x,1)]:Gu(e,n,r,a,x,D)),k}))}function gd(e,t,n,r,a,o){let i=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Js;if(e.length>1){let l=null;for(let s=0,c=1/0;s<e.length;s++)if(void 0!==t[s]){if(null!=l){let t=Vs(e[s]-e[l]);t<c&&(c=t,i=Vs(n(e[s],r,a,o)-n(e[l],r,a,o)))}l=s}}return i}function yd(e,t,n,r,a,o){const i=e.length;if(i<2)return null;const l=new Path2D;if(n(l,e[0],t[0]),2==i)r(l,e[1],t[1]);else{let n=Array(i),r=Array(i-1),o=Array(i-1),s=Array(i-1);for(let a=0;a<i-1;a++)o[a]=t[a+1]-t[a],s[a]=e[a+1]-e[a],r[a]=o[a]/s[a];n[0]=r[0];for(let e=1;e<i-1;e++)0===r[e]||0===r[e-1]||r[e-1]>0!==r[e]>0?n[e]=0:(n[e]=3*(s[e-1]+s[e])/((2*s[e]+s[e-1])/r[e-1]+(s[e]+2*s[e-1])/r[e]),isFinite(n[e])||(n[e]=0));n[i-1]=r[i-2];for(let c=0;c<i-1;c++)a(l,e[c]+s[c]/3,t[c]+n[c]*s[c]/3,e[c+1]-s[c]/3,t[c+1]-n[c+1]*s[c]/3,e[c+1],t[c+1])}return l}const _d=new Set;function bd(){for(let e of _d)e.syncRect(!0)}os&&(Ss("resize",ls,bd),Ss("scroll",ls,bd,!0),Ss(rs,ls,(()=>{Rd.pxRatio=cs})));const wd=vd(),kd=hd();function xd(e,t,n,r){return(r?[e[0],e[1]].concat(e.slice(2)):[e[0]].concat(e.slice(1))).map(((e,r)=>Sd(e,r,t,n)))}function Sd(e,t,n,r){return Cc({},0==t?n:r,e)}function Cd(e,t,n){return null==t?gc:[t,n]}const Ed=Cd;function Nd(e,t,n){return null==t?gc:Is(t,n,Ts,!0)}function Ad(e,t,n,r){return null==t?gc:As(t,n,e.scales[r].log,!1)}const Md=Ad;function Td(e,t,n,r){return null==t?gc:Ms(t,n,e.scales[r].log,!1)}const Ld=Td;function Od(e,t,n,r,a){let o=Ys(Xs(e),Xs(t)),i=t-e,l=Es(a/r*i,n);do{let e=n[l],t=r*e/i;if(t>=a&&o+(e<5?hc.get(e):0)<=17)return[e,t]}while(++l<n.length);return[0,0]}function Pd(e){let t,n;return[e=e.replace(/(\d+)px/,((e,r)=>(t=Us((n=+r)*cs))+"px")),t,n]}function Id(e){e.show&&[e.font,e.labelFont].forEach((e=>{let t=dc(e[2]*cs,1);e[0]=e[0].replace(/[0-9.]+px/,t+"px"),e[1]=t}))}function Rd(e,t,n){const r={mode:Rs(e.mode,1)},a=r.mode;function o(e,t){return((3==t.distr?Qs(e>0?e:t.clamp(r,e,t.min,t.max,t.key)):4==t.distr?Gs(e,t.asinh):e)-t._min)/(t._max-t._min)}function i(e,t,n,r){let a=o(e,t);return r+n*(-1==t.dir?1-a:a)}function l(e,t,n,r){let a=o(e,t);return r+n*(-1==t.dir?a:1-a)}function s(e,t,n,r){return 0==t.ori?i(e,t,n,r):l(e,t,n,r)}r.valToPosH=i,r.valToPosV=l;let c=!1;r.status=0;const u=r.root=fs("uplot");if(null!=e.id&&(u.id=e.id),ds(u,e.class),e.title){fs("u-title",u).textContent=e.title}const d=ps("canvas"),h=r.ctx=d.getContext("2d"),m=fs("u-wrap",u);Ss("click",m,(e=>{if(e.target===f){(Mt!=Ct||Tt!=Et)&&jt.click(r,e)}}),!0);const p=r.under=fs("u-under",m);m.appendChild(d);const f=r.over=fs("u-over",m),v=+Rs((e=Sc(e)).pxAlign,1),g=ed(v);(e.plugins||[]).forEach((t=>{t.opts&&(e=t.opts(r,e)||e)}));const y=e.ms||.001,_=r.series=1==a?xd(e.series||[],Su,Vu,!1):(b=e.series||[null],w=Hu,b.map(((e,t)=>0==t?null:Cc({},w,e))));var b,w;const k=r.axes=xd(e.axes||[],xu,zu,!0),x=r.scales={},S=r.bands=e.bands||[];S.forEach((e=>{e.fill=tc(e.fill||null),e.dir=Rs(e.dir,-1)}));const C=2==a?_[1].facets[0].scale:_[0].scale,E={axes:function(){for(let e=0;e<k.length;e++){let t=k[e];if(!t.show||!t._show)continue;let n,a,o=t.side,i=o%2,l=t.stroke(r,e),c=0==o||3==o?-1:1;if(t.label){let e=t.labelGap*c,r=Us((t._lpos+e)*cs);it(t.labelFont[0],l,"center",2==o?Bl:ql),h.save(),1==i?(n=a=0,h.translate(r,Us(pe+ve/2)),h.rotate((3==o?-Hs:Hs)/2)):(n=Us(me+fe/2),a=r),h.fillText(t.label,n,a),h.restore()}let[u,d]=t._found;if(0==d)continue;let m=x[t.scale],p=0==i?fe:ve,f=0==i?me:pe,v=Us(t.gap*cs),y=t._splits,_=2==m.distr?y.map((e=>tt[e])):y,b=2==m.distr?tt[y[1]]-tt[y[0]]:u,w=t.ticks,S=t.border,C=w.show?Us(w.size*cs):0,E=t._rotate*-Hs/180,N=g(t._pos*cs),A=N+(C+v)*c;a=0==i?A:0,n=1==i?A:0,it(t.font[0],l,1==t.align?Yl:2==t.align?Wl:E>0?Yl:E<0?Wl:0==i?"center":3==o?Wl:Yl,E||1==i?"middle":2==o?Bl:ql);let M=t.font[1]*t.lineGap,T=y.map((e=>g(s(e,m,p,f)))),L=t._values;for(let e=0;e<L.length;e++){let t=L[e];if(null!=t){0==i?n=T[e]:a=T[e],t=""+t;let r=-1==t.indexOf("\n")?[t]:t.split(/\n/gm);for(let e=0;e<r.length;e++){let t=r[e];E?(h.save(),h.translate(n,a+e*M),h.rotate(E),h.fillText(t,0,0),h.restore()):h.fillText(t,n,a+e*M)}}}w.show&&ft(T,w.filter(r,_,e,d,b),i,o,N,C,dc(w.width*cs,3),w.stroke(r,e),w.dash,w.cap);let O=t.grid;O.show&&ft(T,O.filter(r,_,e,d,b),i,0==i?2:1,0==i?pe:me,0==i?ve:fe,dc(O.width*cs,3),O.stroke(r,e),O.dash,O.cap),S.show&&ft([N],[1],0==i?1:0,0==i?1:2,1==i?pe:me,1==i?ve:fe,dc(S.width*cs,3),S.stroke(r,e),S.dash,S.cap)}kn("drawAxes")},series:function(){Ve>0&&(_.forEach(((e,n)=>{if(n>0&&e.show&&(ct(n,!1),ct(n,!0),null==e._paths)){et!=e.alpha&&(h.globalAlpha=et=e.alpha);let o=2==a?[0,t[n][0].length-1]:function(e){let t=ec($e-1,0,Ve-1),n=ec(Ue+1,0,Ve-1);for(;null==e[t]&&t>0;)t--;for(;null==e[n]&&n<Ve-1;)n++;return[t,n]}(t[n]);e._paths=e.paths(r,n,o[0],o[1]),1!=et&&(h.globalAlpha=et=1)}})),_.forEach(((e,t)=>{if(t>0&&e.show){et!=e.alpha&&(h.globalAlpha=et=e.alpha),null!=e._paths&&ut(t,!1);{let n=null!=e._paths?e._paths.gaps:null,a=e.points.show(r,t,$e,Ue,n),o=e.points.filter(r,t,a,n);(a||o)&&(e.points._paths=e.points.paths(r,t,$e,Ue,o),ut(t,!0))}1!=et&&(h.globalAlpha=et=1),kn("drawSeries",t)}})))}},N=(e.drawOrder||["axes","series"]).map((e=>E[e]));function A(t){let n=x[t];if(null==n){let r=(e.scales||fc)[t]||fc;if(null!=r.from)A(r.from),x[t]=Cc({},x[r.from],r,{key:t});else{n=x[t]=Cc({},t==C?Uu:Bu,r),n.key=t;let e=n.time,o=n.range,i=yc(o);if((t!=C||2==a&&!e)&&(!i||null!=o[0]&&null!=o[1]||(o={min:null==o[0]?Ls:{mode:1,hard:o[0],soft:o[0]},max:null==o[1]?Ls:{mode:1,hard:o[1],soft:o[1]}},i=!1),!i&&wc(o))){let e=o;o=(t,n,r)=>null==n?gc:Is(n,r,e)}n.range=tc(o||(e?Ed:t==C?3==n.distr?Md:4==n.distr?Ld:Cd:3==n.distr?Ad:4==n.distr?Td:Nd)),n.auto=tc(!i&&n.auto),n.clamp=tc(n.clamp||$u),n._min=n._max=null}}}A("x"),A("y"),1==a&&_.forEach((e=>{A(e.scale)})),k.forEach((e=>{A(e.scale)}));for(let Mn in e.scales)A(Mn);const M=x[C],T=M.distr;let L,O;0==M.ori?(ds(u,"u-hz"),L=i,O=l):(ds(u,"u-vt"),L=l,O=i);const P={};for(let Mn in x){let e=x[Mn];null==e.min&&null==e.max||(P[Mn]={min:e.min,max:e.max},e.min=e.max=null)}const I=e.tzDate||(e=>new Date(Us(e/y))),R=e.fmtDate||Dc,D=1==y?ru(I):iu(I),z=su(I,lu(1==y?nu:ou,R)),F=du(I,uu("{YYYY}-{MM}-{DD} {h}:{mm}{aa}",R)),j=[],H=r.legend=Cc({},hu,e.legend),V=H.show,$=H.markers;let U,B,q;H.idxs=j,$.width=tc($.width),$.dash=tc($.dash),$.stroke=tc($.stroke),$.fill=tc($.fill);let Y,W=[],K=[],Q=!1,Z={};if(H.live){const e=_[1]?_[1].values:null;Q=null!=e,Y=Q?e(r,1,0):{_:0};for(let t in Y)Z[t]=as}if(V)if(U=ps("table","u-legend",u),q=ps("tbody",null,U),H.mount(r,U),Q){B=ps("thead",null,U,q);let e=ps("tr",null,B);for(var G in ps("th",null,e),Y)ps("th",Vl,e).textContent=G}else ds(U,"u-inline"),H.live&&ds(U,"u-live");const J={show:!0},X={show:!1};const ee=new Map;function te(e,t,n){let a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];const o=ee.get(t)||{},i=Ee.bind[e](r,t,n,a);i&&(Ss(e,t,o[e]=i),ee.set(t,o))}function ne(e,t,n){const r=ee.get(t)||{};for(let a in r)null!=e&&a!=e||(Cs(a,t,r[a]),delete r[a]);null==e&&ee.delete(t)}let re=0,ae=0,oe=0,ie=0,le=0,se=0,ce=le,ue=se,de=oe,he=ie,me=0,pe=0,fe=0,ve=0;r.bbox={};let ge=!1,ye=!1,_e=!1,be=!1,we=!1,ke=!1;function xe(e,t,n){(n||e!=r.width||t!=r.height)&&Se(e,t),yt(!1),_e=!0,ye=!0,Rt()}function Se(e,t){r.width=re=oe=e,r.height=ae=ie=t,le=se=0,function(){let e=!1,t=!1,n=!1,r=!1;k.forEach(((a,o)=>{if(a.show&&a._show){let{side:o,_size:i}=a,l=o%2,s=i+(null!=a.label?a.labelSize:0);s>0&&(l?(oe-=s,3==o?(le+=s,r=!0):n=!0):(ie-=s,0==o?(se+=s,e=!0):t=!0))}})),ze[0]=e,ze[1]=n,ze[2]=t,ze[3]=r,oe-=He[1]+He[3],le+=He[3],ie-=He[2]+He[0],se+=He[0]}(),function(){let e=le+oe,t=se+ie,n=le,r=se;function a(a,o){switch(a){case 1:return e+=o,e-o;case 2:return t+=o,t-o;case 3:return n-=o,n+o;case 0:return r-=o,r+o}}k.forEach(((e,t)=>{if(e.show&&e._show){let t=e.side;e._pos=a(t,e._size),null!=e.label&&(e._lpos=a(t,e.labelSize))}}))}();let n=r.bbox;me=n.left=sc(le*cs,.5),pe=n.top=sc(se*cs,.5),fe=n.width=sc(oe*cs,.5),ve=n.height=sc(ie*cs,.5)}const Ce=3;r.setSize=function(e){let{width:t,height:n}=e;xe(t,n)};const Ee=r.cursor=Cc({},vu,{drag:{y:2==a}},e.cursor);if(null==Ee.dataIdx){var Ne,Ae;let e=Ee.hover,n=e.skip=new Set(null!==(Ne=e.skip)&&void 0!==Ne?Ne:[]);n.add(void 0);let r=e.prox=tc(e.prox),a=null!==(Ae=e.bias)&&void 0!==Ae?Ae:e.bias=0;Ee.dataIdx=(e,o,i,l)=>{var s;if(0==o)return i;let c=i,u=null!==(s=r(e,o,i,l))&&void 0!==s?s:Js,d=u>=0&&u<Js,h=0==M.ori?oe:ie,m=Ee.left,p=t[0],f=t[o];if(n.has(f[i])){c=null;let e,t=null,r=null;if(0==a||-1==a)for(e=i;null==t&&e-- >0;)n.has(f[e])||(t=e);if(0==a||1==a)for(e=i;null==r&&e++<f.length;)n.has(f[e])||(r=e);if(null!=t||null!=r)if(d){let e=m-(null==t?-1/0:L(p[t],M,h,0)),n=(null==r?1/0:L(p[r],M,h,0))-m;e<=n?e<=u&&(c=t):n<=u&&(c=r)}else c=null==r?t:null==t?r:i-t<=r-i?t:r}else if(d){Vs(m-L(p[i],M,h,0))>u&&(c=null)}return c}}const Me=e=>{Ee.event=e};Ee.idxs=j,Ee._lock=!1;let Te=Ee.points;Te.show=tc(Te.show),Te.size=tc(Te.size),Te.stroke=tc(Te.stroke),Te.width=tc(Te.width),Te.fill=tc(Te.fill);const Le=r.focus=Cc({},e.focus||{alpha:.3},Ee.focus),Oe=Le.prox>=0;let Pe=[null],Ie=[null],Re=[null];function De(e,t){if(1==a||t>0){let t=1==a&&x[e.scale].time,n=e.value;e.value=t?bc(n)?du(I,uu(n,R)):n||F:n||Du,e.label=e.label||(t?"Time":"Value")}if(t>0){e.width=null==e.width?1:e.width,e.paths=e.paths||wd||ac,e.fillTo=tc(e.fillTo||Zu),e.pxAlign=+Rs(e.pxAlign,v),e.pxRound=ed(e.pxAlign),e.stroke=tc(e.stroke||null),e.fill=tc(e.fill||null),e._stroke=e._fill=e._paths=e._focus=null;let t=dc((3+2*(Ys(1,e.width)||1))*1,3),n=e.points=Cc({},{size:t,width:Ys(1,.2*t),stroke:e.stroke,space:2*t,paths:kd,_stroke:null,_fill:null},e.points);n.show=tc(n.show),n.filter=tc(n.filter),n.fill=tc(n.fill),n.stroke=tc(n.stroke),n.paths=tc(n.paths),n.pxAlign=e.pxAlign}if(V){let n=function(e,t){if(0==t&&(Q||!H.live||2==a))return gc;let n=[],o=ps("tr","u-series",q,q.childNodes[t]);ds(o,e.class),e.show||ds(o,Hl);let i=ps("th",null,o);if($.show){let e=fs("u-marker",i);if(t>0){let n=$.width(r,t);n&&(e.style.border=n+"px "+$.dash(r,t)+" "+$.stroke(r,t)),e.style.background=$.fill(r,t)}}let l=fs(Vl,i);for(var s in l.textContent=e.label,t>0&&($.show||(l.style.color=e.width>0?$.stroke(r,t):$.fill(r,t)),te("click",i,(t=>{if(Ee._lock)return;Me(t);let n=_.indexOf(e);if((t.ctrlKey||t.metaKey)!=H.isolate){let e=_.some(((e,t)=>t>0&&t!=n&&e.show));_.forEach(((t,r)=>{r>0&&Yt(r,e?r==n?J:X:J,!0,Sn.setSeries)}))}else Yt(n,{show:!e.show},!0,Sn.setSeries)}),!1),Oe&&te(Xl,i,(t=>{Ee._lock||(Me(t),Yt(_.indexOf(e),Zt,!0,Sn.setSeries))}),!1)),Y){let e=ps("td","u-value",o);e.textContent="--",n.push(e)}return[o,n]}(e,t);W.splice(t,0,n[0]),K.splice(t,0,n[1]),H.values.push(null)}if(Ee.show){j.splice(t,0,null);let n=function(e,t){if(t>0){let n=Ee.points.show(r,t);if(n)return ds(n,"u-cursor-pt"),ds(n,e.class),gs(n,-10,-10,oe,ie),f.insertBefore(n,Pe[t]),n}}(e,t);null!=n&&(Pe.splice(t,0,n),Ie.splice(t,0,0),Re.splice(t,0,0))}kn("addSeries",t)}r.addSeries=function(e,t){t=null==t?_.length:t,e=1==a?Sd(e,t,Su,Vu):Sd(e,t,null,Hu),_.splice(t,0,e),De(_[t],t)},r.delSeries=function(e){if(_.splice(e,1),V){H.values.splice(e,1),K.splice(e,1);let t=W.splice(e,1)[0];ne(null,t.firstChild),t.remove()}Ee.show&&(j.splice(e,1),Pe.length>1&&(Pe.splice(e,1)[0].remove(),Ie.splice(e,1),Re.splice(e,1))),kn("delSeries",e)};const ze=[!1,!1,!1,!1];function Fe(e,t,n,r){let[a,o,i,l]=n,s=t%2,c=0;return 0==s&&(l||o)&&(c=0==t&&!a||2==t&&!i?Us(xu.size/3):0),1==s&&(a||i)&&(c=1==t&&!o||3==t&&!l?Us(zu.size/2):0),c}const je=r.padding=(e.padding||[Fe,Fe,Fe,Fe]).map((e=>tc(Rs(e,Fe)))),He=r._padding=je.map(((e,t)=>e(r,t,ze,0)));let Ve,$e=null,Ue=null;const Be=1==a?_[0].idxs:null;let qe,Ye,We,Ke,Qe,Ze,Ge,Je,Xe,et,tt=null,nt=!1;function rt(e,n){if(t=null==e?[]:e,r.data=r._data=t,2==a){Ve=0;for(let e=1;e<_.length;e++)Ve+=t[e][0].length}else{0==t.length&&(r.data=r._data=t=[[]]),tt=t[0],Ve=tt.length;let e=t;if(2==T){e=t.slice();let n=e[0]=Array(Ve);for(let e=0;e<Ve;e++)n[e]=e}r._data=t=e}if(yt(!0),kn("setData"),2==T&&(_e=!0),!1!==n){let e=M;e.auto(r,nt)?at():qt(C,e.min,e.max),be=be||Ee.left>=0,ke=!0,Rt()}}function at(){let e,n;nt=!0,1==a&&(Ve>0?($e=Be[0]=0,Ue=Be[1]=Ve-1,e=t[0][$e],n=t[0][Ue],2==T?(e=$e,n=Ue):e==n&&(3==T?[e,n]=As(e,e,M.log,!1):4==T?[e,n]=Ms(e,e,M.log,!1):M.time?n=e+Us(86400/y):[e,n]=Is(e,n,Ts,!0))):($e=Be[0]=e=null,Ue=Be[1]=n=null)),qt(C,e,n)}function ot(e,t,n,r,a,o){var i,l,s,c,u;null!==(i=e)&&void 0!==i||(e=Ql),null!==(l=n)&&void 0!==l||(n=vc),null!==(s=r)&&void 0!==s||(r="butt"),null!==(c=a)&&void 0!==c||(a=Ql),null!==(u=o)&&void 0!==u||(o="round"),e!=qe&&(h.strokeStyle=qe=e),a!=Ye&&(h.fillStyle=Ye=a),t!=We&&(h.lineWidth=We=t),o!=Qe&&(h.lineJoin=Qe=o),r!=Ze&&(h.lineCap=Ze=r),n!=Ke&&h.setLineDash(Ke=n)}function it(e,t,n,r){t!=Ye&&(h.fillStyle=Ye=t),e!=Ge&&(h.font=Ge=e),n!=Je&&(h.textAlign=Je=n),r!=Xe&&(h.textBaseline=Xe=r)}function lt(e,t,n,a){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(a.length>0&&e.auto(r,nt)&&(null==t||null==t.min)){let t=Rs($e,0),r=Rs(Ue,a.length-1),i=null==n.min?3==e.distr?function(e,t,n){let r=Js,a=-Js;for(let o=t;o<=n;o++){let t=e[o];null!=t&&t>0&&(t<r&&(r=t),t>a&&(a=t))}return[r,a]}(a,t,r):function(e,t,n,r){let a=Js,o=-Js;if(1==r)a=e[t],o=e[n];else if(-1==r)a=e[n],o=e[t];else for(let i=t;i<=n;i++){let t=e[i];null!=t&&(t<a&&(a=t),t>o&&(o=t))}return[a,o]}(a,t,r,o):[n.min,n.max];e.min=qs(e.min,n.min=i[0]),e.max=Ys(e.max,n.max=i[1])}}r.setData=rt;const st={min:null,max:null};function ct(e,t){let n=t?_[e].points:_[e];n._stroke=n.stroke(r,e),n._fill=n.fill(r,e)}function ut(e,n){let a=n?_[e].points:_[e],{stroke:o,fill:i,clip:l,flags:s,_stroke:c=a._stroke,_fill:u=a._fill,_width:d=a.width}=a._paths;d=dc(d*cs,3);let m=null,p=d%2/2;n&&null==u&&(u=d>0?"#fff":c);let f=1==a.pxAlign&&p>0;if(f&&h.translate(p,p),!n){let e=me-d/2,t=pe-d/2,n=fe+d,r=ve+d;m=new Path2D,m.rect(e,t,n,r)}n?ht(c,d,a.dash,a.cap,u,o,i,s,l):function(e,n,a,o,i,l,s,c,u,d,h){let m=!1;0!=u&&S.forEach(((p,f)=>{if(p.series[0]==e){let e,v=_[p.series[1]],g=t[p.series[1]],y=(v._paths||fc).band;yc(y)&&(y=1==p.dir?y[0]:y[1]);let b=null;v.show&&y&&function(e,t,n){for(t=Rs(t,0),n=Rs(n,e.length-1);t<=n;){if(null!=e[t])return!0;t++}return!1}(g,$e,Ue)?(b=p.fill(r,f)||l,e=v._paths.clip):y=null,ht(n,a,o,i,b,s,c,u,d,h,e,y),m=!0}})),m||ht(n,a,o,i,l,s,c,u,d,h)}(e,c,d,a.dash,a.cap,u,o,i,s,m,l),f&&h.translate(-p,-p)}const dt=2|Wu;function ht(e,t,n,r,a,o,i,l,s,c,u,d){ot(e,t,n,r,a),(s||c||d)&&(h.save(),s&&h.clip(s),c&&h.clip(c)),d?(l&dt)==dt?(h.clip(d),u&&h.clip(u),pt(a,i),mt(e,o,t)):2&l?(pt(a,i),h.clip(d),mt(e,o,t)):l&Wu&&(h.save(),h.clip(d),u&&h.clip(u),pt(a,i),h.restore(),mt(e,o,t)):(pt(a,i),mt(e,o,t)),(s||c||d)&&h.restore()}function mt(e,t,n){n>0&&(t instanceof Map?t.forEach(((e,t)=>{h.strokeStyle=qe=t,h.stroke(e)})):null!=t&&e&&h.stroke(t))}function pt(e,t){t instanceof Map?t.forEach(((e,t)=>{h.fillStyle=Ye=t,h.fill(e)})):null!=t&&e&&h.fill(t)}function ft(e,t,n,r,a,o,i,l,s,c){let u=i%2/2;1==v&&h.translate(u,u),ot(l,i,s,c,l),h.beginPath();let d,m,p,f,g=a+(0==r||3==r?-o:o);0==n?(m=a,f=g):(d=a,p=g);for(let v=0;v<e.length;v++)null!=t[v]&&(0==n?d=p=e[v]:m=f=e[v],h.moveTo(d,m),h.lineTo(p,f));h.stroke(),1==v&&h.translate(-u,-u)}function vt(e){let t=!0;return k.forEach(((n,a)=>{if(!n.show)return;let o=x[n.scale];if(null==o.min)return void(n._show&&(t=!1,n._show=!1,yt(!1)));n._show||(t=!1,n._show=!0,yt(!1));let i=n.side,l=i%2,{min:s,max:c}=o,[u,d]=function(e,t,n,a){let o,i=k[e];if(a<=0)o=[0,0];else{let l=i._space=i.space(r,e,t,n,a);o=Od(t,n,i._incrs=i.incrs(r,e,t,n,a,l),a,l)}return i._found=o}(a,s,c,0==l?oe:ie);if(0==d)return;let h=2==o.distr,m=n._splits=n.splits(r,a,s,c,u,d,h),p=2==o.distr?m.map((e=>tt[e])):m,f=2==o.distr?tt[m[1]]-tt[m[0]]:u,v=n._values=n.values(r,n.filter(r,p,a,d,f),a,d,f);n._rotate=2==i?n.rotate(r,v,a,d):0;let g=n._size;n._size=Bs(n.size(r,v,a,e)),null!=g&&n._size!=g&&(t=!1)})),t}function gt(e){let t=!0;return je.forEach(((n,a)=>{let o=n(r,a,ze,e);o!=He[a]&&(t=!1),He[a]=o})),t}function yt(e){_.forEach(((t,n)=>{n>0&&(t._paths=null,e&&(1==a?(t.min=null,t.max=null):t.facets.forEach((e=>{e.min=null,e.max=null}))))}))}let _t,bt,wt,kt,xt,St,Ct,Et,Nt,At,Mt,Tt,Lt=!1,Ot=!1,Pt=[];function It(){Ot=!1;for(let e=0;e<Pt.length;e++)kn(...Pt[e]);Pt.length=0}function Rt(){Lt||(Nc(Dt),Lt=!0)}function Dt(){if(ge&&(!function(){for(let t in x){let e=x[t];null==P[t]&&(null==e.min||null!=P[C]&&e.auto(r,nt))&&(P[t]=st)}for(let t in x){let e=x[t];null==P[t]&&null!=e.from&&null!=P[e.from]&&(P[t]=st)}null!=P[C]&&yt(!0);let e={};for(let t in P){let n=P[t];if(null!=n){let o=e[t]=Sc(x[t],kc);if(null!=n.min)Cc(o,n);else if(t!=C||2==a)if(0==Ve&&null==o.from){let e=o.range(r,null,null,t);o.min=e[0],o.max=e[1]}else o.min=Js,o.max=-Js}}if(Ve>0){_.forEach(((n,o)=>{if(1==a){let a=n.scale,i=P[a];if(null==i)return;let l=e[a];if(0==o){let e=l.range(r,l.min,l.max,a);l.min=e[0],l.max=e[1],$e=Es(l.min,t[0]),Ue=Es(l.max,t[0]),Ue-$e>1&&(t[0][$e]<l.min&&$e++,t[0][Ue]>l.max&&Ue--),n.min=tt[$e],n.max=tt[Ue]}else n.show&&n.auto&<(l,i,n,t[o],n.sorted);n.idxs[0]=$e,n.idxs[1]=Ue}else if(o>0&&n.show&&n.auto){let[r,a]=n.facets,i=r.scale,l=a.scale,[s,c]=t[o],u=e[i],d=e[l];null!=u&<(u,P[i],r,s,r.sorted),null!=d&<(d,P[l],a,c,a.sorted),n.min=a.min,n.max=a.max}}));for(let t in e){let n=e[t],a=P[t];if(null==n.from&&(null==a||null==a.min)){let e=n.range(r,n.min==Js?null:n.min,n.max==-Js?null:n.max,t);n.min=e[0],n.max=e[1]}}}for(let t in e){let n=e[t];if(null!=n.from){let a=e[n.from];if(null==a.min)n.min=n.max=null;else{let e=n.range(r,a.min,a.max,t);n.min=e[0],n.max=e[1]}}}let n={},o=!1;for(let t in e){let r=e[t],a=x[t];if(a.min!=r.min||a.max!=r.max){a.min=r.min,a.max=r.max;let e=a.distr;a._min=3==e?Qs(a.min):4==e?Gs(a.min,a.asinh):a.min,a._max=3==e?Qs(a.max):4==e?Gs(a.max,a.asinh):a.max,n[t]=o=!0}}if(o){_.forEach(((e,t)=>{2==a?t>0&&n.y&&(e._paths=null):n[e.scale]&&(e._paths=null)}));for(let e in n)_e=!0,kn("setScale",e);Ee.show&&Ee.left>=0&&(be=ke=!0)}for(let t in P)P[t]=null}(),ge=!1),_e&&(!function(){let e=!1,t=0;for(;!e;){t++;let n=vt(t),a=gt(t);e=t==Ce||n&&a,e||(Se(r.width,r.height),ye=!0)}}(),_e=!1),ye){if(ms(p,Yl,le),ms(p,Bl,se),ms(p,$l,oe),ms(p,Ul,ie),ms(f,Yl,le),ms(f,Bl,se),ms(f,$l,oe),ms(f,Ul,ie),ms(m,$l,re),ms(m,Ul,ae),d.width=Us(re*cs),d.height=Us(ae*cs),k.forEach((e=>{let{_el:t,_show:n,_size:r,_pos:a,side:o}=e;if(null!=t)if(n){let e=o%2==1;ms(t,e?"left":"top",a-(3===o||0===o?r:0)),ms(t,e?"width":"height",r),ms(t,e?"top":"left",e?se:le),ms(t,e?"height":"width",e?ie:oe),hs(t,Hl)}else ds(t,Hl)})),qe=Ye=We=Qe=Ze=Ge=Je=Xe=Ke=null,et=1,ln(!0),le!=ce||se!=ue||oe!=de||ie!=he){yt(!1);let e=oe/de,t=ie/he;if(Ee.show&&!be&&Ee.left>=0){Ee.left*=e,Ee.top*=t,wt&&gs(wt,Us(Ee.left),0,oe,ie),kt&&gs(kt,0,Us(Ee.top),oe,ie);for(let n=1;n<Pe.length;n++)Ie[n]*=e,Re[n]*=t,gs(Pe[n],cc(Ie[n],1),cc(Re[n],1),oe,ie)}if($t.show&&!we&&$t.left>=0&&$t.width>0){$t.left*=e,$t.width*=e,$t.top*=t,$t.height*=t;for(let e in un)ms(Ut,e,$t[e])}ce=le,ue=se,de=oe,he=ie}kn("setSize"),ye=!1}re>0&&ae>0&&(h.clearRect(0,0,d.width,d.height),kn("drawClear"),N.forEach((e=>e())),kn("draw")),$t.show&&we&&(Bt($t),we=!1),Ee.show&&be&&(an(null,!0,!1),be=!1),H.show&&H.live&&ke&&(nn(),ke=!1),c||(c=!0,r.status=1,kn("ready")),nt=!1,Lt=!1}function zt(e,n){let a=x[e];if(null==a.from){if(0==Ve){let t=a.range(r,n.min,n.max,e);n.min=t[0],n.max=t[1]}if(n.min>n.max){let e=n.min;n.min=n.max,n.max=e}if(Ve>1&&null!=n.min&&null!=n.max&&n.max-n.min<1e-16)return;e==C&&2==a.distr&&Ve>0&&(n.min=Es(n.min,t[0]),n.max=Es(n.max,t[0]),n.min==n.max&&n.max++),P[e]=n,ge=!0,Rt()}}r.batch=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Lt=!0,Ot=t,e(r),Dt(),t&&Pt.length>0&&queueMicrotask(It)},r.redraw=(e,t)=>{_e=t||!1,!1!==e?qt(C,M.min,M.max):Rt()},r.setScale=zt;let Ft=!1;const jt=Ee.drag;let Ht=jt.x,Vt=jt.y;Ee.show&&(Ee.x&&(_t=fs("u-cursor-x",f)),Ee.y&&(bt=fs("u-cursor-y",f)),0==M.ori?(wt=_t,kt=bt):(wt=bt,kt=_t),Mt=Ee.left,Tt=Ee.top);const $t=r.select=Cc({show:!0,over:!0,left:0,width:0,top:0,height:0},e.select),Ut=$t.show?fs("u-select",$t.over?f:p):null;function Bt(e,t){if($t.show){for(let t in e)$t[t]=e[t],t in un&&ms(Ut,t,e[t]);!1!==t&&kn("setSelect")}}function qt(e,t,n){zt(e,{min:t,max:n})}function Yt(e,t,n,o){null!=t.focus&&function(e){if(e!=Qt){let t=null==e,n=1!=Le.alpha;_.forEach(((r,o)=>{if(1==a||o>0){let a=t||0==o||o==e;r._focus=t?null:a,n&&function(e,t){_[e].alpha=t,Ee.show&&Pe[e]&&(Pe[e].style.opacity=t);V&&W[e]&&(W[e].style.opacity=t)}(o,a?1:Le.alpha)}})),Qt=e,n&&Rt()}}(e),null!=t.show&&_.forEach(((n,r)=>{r>0&&(e==r||null==e)&&(n.show=t.show,function(e,t){let n=_[e],r=V?W[e]:null;n.show?r&&hs(r,Hl):(r&&ds(r,Hl),Pe.length>1&&gs(Pe[e],-10,-10,oe,ie))}(r,t.show),2==a?(qt(n.facets[0].scale,null,null),qt(n.facets[1].scale,null,null)):qt(n.scale,null,null),Rt())})),!1!==n&&kn("setSeries",e,t),o&&Nn("setSeries",r,e,t)}let Wt,Kt,Qt;r.setSelect=Bt,r.setSeries=Yt,r.addBand=function(e,t){e.fill=tc(e.fill||null),e.dir=Rs(e.dir,-1),t=null==t?S.length:t,S.splice(t,0,e)},r.setBand=function(e,t){Cc(S[e],t)},r.delBand=function(e){null==e?S.length=0:S.splice(e,1)};const Zt={focus:!0};function Gt(e,t,n){let r=x[t];n&&(e=e/cs-(1==r.ori?se:le));let a=oe;1==r.ori&&(a=ie,e=a-e),-1==r.dir&&(e=a-e);let o=r._min,i=o+(r._max-o)*(e/a),l=r.distr;return 3==l?Ws(10,i):4==l?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return js.sinh(e)*t}(i,r.asinh):i}function Jt(e,t){ms(Ut,Yl,$t.left=e),ms(Ut,$l,$t.width=t)}function Xt(e,t){ms(Ut,Bl,$t.top=e),ms(Ut,Ul,$t.height=t)}V&&Oe&&te(es,U,(e=>{Ee._lock||(Me(e),null!=Qt&&Yt(null,Zt,!0,Sn.setSeries))})),r.valToIdx=e=>Es(e,t[0]),r.posToIdx=function(e,n){return Es(Gt(e,C,n),t[0],$e,Ue)},r.posToVal=Gt,r.valToPos=(e,t,n)=>0==x[t].ori?i(e,x[t],n?fe:oe,n?me:0):l(e,x[t],n?ve:ie,n?pe:0),r.setCursor=(e,t,n)=>{Mt=e.left,Tt=e.top,an(null,t,n)};let en=0==M.ori?Jt:Xt,tn=1==M.ori?Jt:Xt;function nn(e,t){null!=e&&(e.idxs?e.idxs.forEach(((e,t)=>{j[t]=e})):void 0!==e.idx&&j.fill(e.idx),H.idx=j[0]);for(let n=0;n<_.length;n++)(n>0||1==a&&!Q)&&rn(n,j[n]);V&&H.live&&function(){if(V&&H.live)for(let e=2==a?1:0;e<_.length;e++){if(0==e&&Q)continue;let t=H.values[e],n=0;for(let r in t)K[e][n++].firstChild.nodeValue=t[r]}}(),ke=!1,!1!==t&&kn("setLegend")}function rn(e,n){var a;let o,i=_[e],l=0==e&&2==T?tt:t[e];Q?o=null!==(a=i.values(r,e,n))&&void 0!==a?a:Z:(o=i.value(r,null==n?null:l[n],e,n),o=null==o?Z:{_:o}),H.values[e]=o}function an(e,n,o){let i;Nt=Mt,At=Tt,[Mt,Tt]=Ee.move(r,Mt,Tt),Ee.left=Mt,Ee.top=Tt,Ee.show&&(wt&&gs(wt,Us(Mt),0,oe,ie),kt&&gs(kt,0,Us(Tt),oe,ie));let l=$e>Ue;Wt=Js;let s=0==M.ori?oe:ie,c=1==M.ori?oe:ie;if(Mt<0||0==Ve||l){i=Ee.idx=null;for(let e=0;e<_.length;e++)e>0&&Pe.length>1&&gs(Pe[e],-10,-10,oe,ie);Oe&&Yt(null,Zt,!0,null==e&&Sn.setSeries),H.live&&(j.fill(i),ke=!0)}else{let e,n,o;1==a&&(e=0==M.ori?Mt:Tt,n=Gt(e,C),i=Ee.idx=Es(n,t[0],$e,Ue),o=L(t[0][i],M,s,0));for(let l=2==a?1:0;l<_.length;l++){let e=_[l],u=j[l],d=null==u?null:1==a?t[l][u]:t[l][1][u],h=Ee.dataIdx(r,l,i,n),m=null==h?null:1==a?t[l][h]:t[l][1][h];ke=ke||m!=d||h!=u,j[l]=h;let p=h==i?o:L(1==a?t[0][h]:t[l][0][h],M,s,0);if(l>0&&e.show){let t,n,o=null==m?-10:O(m,1==a?x[e.scale]:x[e.facets[1].scale],c,0);if(Oe&&null!=m){let t=1==M.ori?Mt:Tt,n=Vs(Le.dist(r,l,h,o,t));if(n<Wt){let r=Le.bias;if(0!=r){let a=Gt(t,e.scale),o=a>=0?1:-1;o==(m>=0?1:-1)&&(1==o?1==r?m>=a:m<=a:1==r?m<=a:m>=a)&&(Wt=n,Kt=l)}else Wt=n,Kt=l}}if(0==M.ori?(t=p,n=o):(t=o,n=p),ke&&Pe.length>1){_s(Pe[l],Ee.points.fill(r,l),Ee.points.stroke(r,l));let e,a,o,i,s=!0,c=Ee.points.bbox;if(null!=c){s=!1;let t=c(r,l);o=t.left,i=t.top,e=t.width,a=t.height}else o=t,i=n,e=a=Ee.points.size(r,l);ws(Pe[l],e,a,s),Ie[l]=o,Re[l]=i,gs(Pe[l],cc(o,1),cc(i,1),oe,ie)}}}}if($t.show&&Ft)if(null!=e){let[t,n]=Sn.scales,[r,a]=Sn.match,[o,i]=e.cursor.sync.scales,l=e.cursor.drag;if(Ht=l._x,Vt=l._y,Ht||Vt){let l,u,d,h,m,{left:p,top:f,width:v,height:g}=e.select,y=e.scales[t].ori,_=e.posToVal,b=null!=t&&r(t,o),w=null!=n&&a(n,i);b&&Ht?(0==y?(l=p,u=v):(l=f,u=g),d=x[t],h=L(_(l,o),d,s,0),m=L(_(l+u,o),d,s,0),en(qs(h,m),Vs(m-h))):en(0,s),w&&Vt?(1==y?(l=p,u=v):(l=f,u=g),d=x[n],h=O(_(l,i),d,c,0),m=O(_(l+u,i),d,c,0),tn(qs(h,m),Vs(m-h))):tn(0,c)}else dn()}else{let e=Vs(Nt-xt),t=Vs(At-St);if(1==M.ori){let n=e;e=t,t=n}Ht=jt.x&&e>=jt.dist,Vt=jt.y&&t>=jt.dist;let n,r,a=jt.uni;null!=a?Ht&&Vt&&(Ht=e>=a,Vt=t>=a,Ht||Vt||(t>e?Vt=!0:Ht=!0)):jt.x&&jt.y&&(Ht||Vt)&&(Ht=Vt=!0),Ht&&(0==M.ori?(n=Ct,r=Mt):(n=Et,r=Tt),en(qs(n,r),Vs(r-n)),Vt||tn(0,c)),Vt&&(1==M.ori?(n=Ct,r=Mt):(n=Et,r=Tt),tn(qs(n,r),Vs(r-n)),Ht||en(0,s)),Ht||Vt||(en(0,0),tn(0,0))}if(jt._x=Ht,jt._y=Vt,null==e){if(o){if(null!=Cn){let[e,t]=Sn.scales;Sn.values[0]=null!=e?Gt(0==M.ori?Mt:Tt,e):null,Sn.values[1]=null!=t?Gt(1==M.ori?Mt:Tt,t):null}Nn(Zl,r,Mt,Tt,oe,ie,i)}if(Oe){let e=o&&Sn.setSeries,t=Le.prox;null==Qt?Wt<=t&&Yt(Kt,Zt,!0,e):Wt>t?Yt(null,Zt,!0,e):Kt!=Qt&&Yt(Kt,Zt,!0,e)}}ke&&(H.idx=i,nn()),!1!==n&&kn("setCursor")}r.setLegend=nn;let on=null;function ln(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]?on=null:(on=f.getBoundingClientRect(),kn("syncRect",on))}function sn(e,t,n,r,a,o,i){Ee._lock||Ft&&null!=e&&0==e.movementX&&0==e.movementY||(cn(e,t,n,r,a,o,i,!1,null!=e),null!=e?an(null,!0,!0):an(t,!0,!1))}function cn(e,t,n,a,o,i,l,c,u){if(null==on&&ln(!1),Me(e),null!=e)n=e.clientX-on.left,a=e.clientY-on.top;else{if(n<0||a<0)return Mt=-10,void(Tt=-10);let[e,r]=Sn.scales,l=t.cursor.sync,[c,u]=l.values,[d,h]=l.scales,[m,p]=Sn.match,f=t.axes[0].side%2==1,v=0==M.ori?oe:ie,g=1==M.ori?oe:ie,y=f?i:o,_=f?o:i,b=f?a:n,w=f?n:a;if(n=null!=d?m(e,d)?s(c,x[e],v,0):-10:v*(b/y),a=null!=h?p(r,h)?s(u,x[r],g,0):-10:g*(w/_),1==M.ori){let e=n;n=a,a=e}}u&&((n<=1||n>=oe-1)&&(n=sc(n,oe)),(a<=1||a>=ie-1)&&(a=sc(a,ie))),c?(xt=n,St=a,[Ct,Et]=Ee.move(r,n,a)):(Mt=n,Tt=a)}Object.defineProperty(r,"rect",{get:()=>(null==on&&ln(!1),on)});const un={width:0,height:0,left:0,top:0};function dn(){Bt(un,!1)}let hn,mn,pn,fn;function vn(e,t,n,a,o,i,l){Ft=!0,Ht=Vt=jt._x=jt._y=!1,cn(e,t,n,a,o,i,0,!0,!1),null!=e&&(te(Jl,is,gn,!1),Nn(Gl,r,Ct,Et,oe,ie,null));let{left:s,top:c,width:u,height:d}=$t;hn=s,mn=c,pn=u,fn=d,dn()}function gn(e,t,n,a,o,i,l){Ft=jt._x=jt._y=!1,cn(e,t,n,a,o,i,0,!1,!0);let{left:s,top:c,width:u,height:d}=$t,h=u>0||d>0,m=hn!=s||mn!=c||pn!=u||fn!=d;if(h&&m&&Bt($t),jt.setScale&&h&&m){let e=s,t=u,n=c,r=d;if(1==M.ori&&(e=c,t=d,n=s,r=u),Ht&&qt(C,Gt(e,C),Gt(e+t,C)),Vt)for(let a in x){let e=x[a];a!=C&&null==e.from&&e.min!=Js&&qt(a,Gt(n+r,a),Gt(n,a))}dn()}else Ee.lock&&(Ee._lock=!Ee._lock,Ee._lock||an(null,!0,!1));null!=e&&(ne(Jl,is),Nn(Jl,r,Mt,Tt,oe,ie,null))}function yn(e,t,n,a,o,i,l){Ee._lock||(Me(e),at(),dn(),null!=e&&Nn(ts,r,Mt,Tt,oe,ie,null))}function _n(){k.forEach(Id),xe(r.width,r.height,!0)}Ss(rs,ls,_n);const bn={};bn.mousedown=vn,bn.mousemove=sn,bn.mouseup=gn,bn.dblclick=yn,bn.setSeries=(e,t,n,a)=>{-1!=(n=(0,Sn.match[2])(r,t,n))&&Yt(n,a,!0,!1)},Ee.show&&(te(Gl,f,vn),te(Zl,f,sn),te(Xl,f,(e=>{Me(e),ln(!1)})),te(es,f,(function(e,t,n,r,a,o,i){if(Ee._lock)return;Me(e);let l=Ft;if(Ft){let e,t,n=!0,r=!0,a=10;0==M.ori?(e=Ht,t=Vt):(e=Vt,t=Ht),e&&t&&(n=Mt<=a||Mt>=oe-a,r=Tt<=a||Tt>=ie-a),e&&n&&(Mt=Mt<Ct?0:oe),t&&r&&(Tt=Tt<Et?0:ie),an(null,!0,!0),Ft=!1}Mt=-10,Tt=-10,an(null,!0,!0),l&&(Ft=l)})),te(ts,f,yn),_d.add(r),r.syncRect=ln);const wn=r.hooks=e.hooks||{};function kn(e,t,n){Ot?Pt.push([e,t,n]):e in wn&&wn[e].forEach((e=>{e.call(null,r,t,n)}))}(e.plugins||[]).forEach((e=>{for(let t in e.hooks)wn[t]=(wn[t]||[]).concat(e.hooks[t])}));const xn=(e,t,n)=>n,Sn=Cc({key:null,setSeries:!1,filters:{pub:oc,sub:oc},scales:[C,_[1]?_[1].scale:null],match:[ic,ic,xn],values:[null,null]},Ee.sync);2==Sn.match.length&&Sn.match.push(xn),Ee.sync=Sn;const Cn=Sn.key,En=Yu(Cn);function Nn(e,t,n,r,a,o,i){Sn.filters.pub(e,t,n,r,a,o,i)&&En.pub(e,t,n,r,a,o,i)}function An(){kn("init",e,t),rt(t||e.data,!1),P[C]?zt(C,P[C]):at(),we=$t.show&&($t.width>0||$t.height>0),be=ke=!0,xe(e.width,e.height)}return En.sub(r),r.pub=function(e,t,n,r,a,o,i){Sn.filters.sub(e,t,n,r,a,o,i)&&bn[e](null,t,n,r,a,o,i)},r.destroy=function(){var e;En.unsub(r),_d.delete(r),ee.clear(),Cs(rs,ls,_n),u.remove(),null===(e=U)||void 0===e||e.remove(),kn("destroy")},_.forEach(De),k.forEach((function(e,t){if(e._show=e.show,e.show){let n=e.side%2,a=x[e.scale];null==a&&(e.scale=n?_[1].scale:C,a=x[e.scale]);let o=a.time;e.size=tc(e.size),e.space=tc(e.space),e.rotate=tc(e.rotate),yc(e.incrs)&&e.incrs.forEach((e=>{!hc.has(e)&&hc.set(e,mc(e))})),e.incrs=tc(e.incrs||(2==a.distr?$c:o?1==y?tu:au:Uc)),e.splits=tc(e.splits||(o&&1==a.distr?D:3==a.distr?Nu:4==a.distr?Au:Eu)),e.stroke=tc(e.stroke),e.grid.stroke=tc(e.grid.stroke),e.ticks.stroke=tc(e.ticks.stroke),e.border.stroke=tc(e.border.stroke);let i=e.values;e.values=yc(i)&&!yc(i[0])?tc(i):o?yc(i)?su(I,lu(i,R)):bc(i)?function(e,t){let n=Dc(t);return(t,r,a,o,i)=>r.map((t=>n(e(t))))}(I,i):i||z:i||Cu,e.filter=tc(e.filter||(a.distr>=3&&10==a.log?Iu:3==a.distr&&2==a.log?Ru:rc)),e.font=Pd(e.font),e.labelFont=Pd(e.labelFont),e._size=e.size(r,null,t,0),e._space=e._rotate=e._incrs=e._found=e._splits=e._values=null,e._size>0&&(ze[t]=!0,e._el=fs("u-axis",m))}})),n?n instanceof HTMLElement?(n.appendChild(u),An()):n(r,An):An(),r}Rd.assign=Cc,Rd.fmtNum=Fs,Rd.rangeNum=Is,Rd.rangeLog=As,Rd.rangeAsinh=Ms,Rd.orient=Ku,Rd.pxRatio=cs,Rd.join=function(e,t){if(function(e){let t=e[0][0],n=t.length;for(let r=1;r<e.length;r++){let a=e[r][0];if(a.length!=n)return!1;if(a!=t)for(let e=0;e<n;e++)if(a[e]!=t[e])return!1}return!0}(e)){let t=e[0].slice();for(let n=1;n<e.length;n++)t.push(...e[n].slice(1));return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;const n=e.length;if(n<=1)return!0;let r=0,a=n-1;for(;r<=a&&null==e[r];)r++;for(;a>=r&&null==e[a];)a--;if(a<=r)return!0;const o=Ys(1,$s((a-r+1)/t));for(let i=e[r],l=r+o;l<=a;l+=o){const t=e[l];if(null!=t){if(t<=i)return!1;i=t}}return!0}(t[0])||(t=function(e){let t=e[0],n=t.length,r=Array(n);for(let o=0;o<r.length;o++)r[o]=o;r.sort(((e,n)=>t[e]-t[n]));let a=[];for(let o=0;o<e.length;o++){let t=e[o],i=Array(n);for(let e=0;e<n;e++)i[e]=t[r[e]];a.push(i)}return a}(t)),t}let n=new Set;for(let i=0;i<e.length;i++){let t=e[i][0],r=t.length;for(let e=0;e<r;e++)n.add(t[e])}let r=[Array.from(n).sort(((e,t)=>e-t))],a=r[0].length,o=new Map;for(let i=0;i<a;i++)o.set(r[0][i],i);for(let i=0;i<e.length;i++){let n=e[i],l=n[0];for(let e=1;e<n.length;e++){let s=n[e],c=Array(a).fill(void 0),u=t?t[i][e]:1,d=[];for(let e=0;e<s.length;e++){let t=s[e],n=o.get(l[e]);null===t?0!=u&&(c[n]=t,2==u&&d.push(n)):c[n]=t}Ec(c,d,a),r.push(c)}}return r},Rd.fmtDate=Dc,Rd.tzDate=function(e,t){let n;return"UTC"==t||"Etc/UTC"==t?n=new Date(+e+6e4*e.getTimezoneOffset()):t==zc?n=e:(n=new Date(e.toLocaleString("en-US",{timeZone:t})),n.setMilliseconds(e.getMilliseconds())),n},Rd.sync=Yu;{Rd.addGap=function(e,t,n){let r=e[e.length-1];r&&r[0]==t?r[1]=n:e.push([t,n])},Rd.clipGaps=Ju;let e=Rd.paths={points:hd};e.linear=vd,e.stepped=function(e){const t=Rs(e.align,1),n=Rs(e.ascDesc,!1),r=Rs(e.alignGaps,0),a=Rs(e.extend,!1);return(e,o,i,l)=>Ku(e,o,((s,c,u,d,h,m,p,f,v,g,y)=>{let _=s.pxRound,{left:b,width:w}=e.bbox,k=e=>_(m(e,d,g,f)),x=e=>_(p(e,h,y,v)),S=0==d.ori?ad:od;const C={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:Wu},E=C.stroke,N=d.dir*(0==d.ori?1:-1);i=Ns(u,i,l,1),l=Ns(u,i,l,-1);let A=x(u[1==N?i:l]),M=k(c[1==N?i:l]),T=M,L=M;a&&-1==t&&(L=b,S(E,L,A)),S(E,M,A);for(let e=1==N?i:l;e>=i&&e<=l;e+=N){let n=u[e];if(null==n)continue;let r=k(c[e]),a=x(n);1==t?S(E,r,A):S(E,T,a),S(E,r,a),A=a,T=r}let O=T;a&&1==t&&(O=b+w,S(E,O,A));let[P,I]=Qu(e,o);if(null!=s.fill||0!=P){let t=C.fill=new Path2D(E),n=x(s.fillTo(e,o,s.min,s.max,P));S(t,O,n),S(t,L,n)}if(!s.spanGaps){let a=[];a.push(...Xu(c,u,i,l,N,k,r));let h=s.width*cs/2,m=n||1==t?h:-h,p=n||-1==t?-h:h;a.forEach((e=>{e[0]+=m,e[1]+=p})),C.gaps=a=s.gaps(e,o,i,l,a),C.clip=Ju(a,d.ori,f,v,g,y)}return 0!=I&&(C.band=2==I?[Gu(e,o,i,l,E,-1),Gu(e,o,i,l,E,1)]:Gu(e,o,i,l,E,I)),C}))},e.bars=function(e){const t=Rs((e=e||fc).size,[.6,Js,1]),n=e.align||0,r=e.gap||0;let a=e.radius;a=null==a?[0,0]:"number"==typeof a?[a,0]:a;const o=tc(a),i=1-t[0],l=Rs(t[1],Js),s=Rs(t[2],1),c=Rs(e.disp,fc),u=Rs(e.each,(e=>{})),{fill:d,stroke:h}=c;return(e,t,a,m)=>Ku(e,t,((p,f,v,g,y,_,b,w,k,x,S)=>{let C,E,N=p.pxRound,A=n,M=r*cs,T=l*cs,L=s*cs;0==g.ori?[C,E]=o(e,t):[E,C]=o(e,t);const O=g.dir*(0==g.ori?1:-1);let P,I,R,D=0==g.ori?id:ld,z=0==g.ori?u:(e,t,n,r,a,o,i)=>{u(e,t,n,a,r,i,o)},F=Rs(e.bands,vc).find((e=>e.series[0]==t)),j=null!=F?F.dir:0,H=p.fillTo(e,t,p.min,p.max,j),V=N(b(H,y,S,k)),$=x,U=N(p.width*cs),B=!1,q=null,Y=null,W=null,K=null;null==d||0!=U&&null==h||(B=!0,q=d.values(e,t,a,m),Y=new Map,new Set(q).forEach((e=>{null!=e&&Y.set(e,new Path2D)})),U>0&&(W=h.values(e,t,a,m),K=new Map,new Set(W).forEach((e=>{null!=e&&K.set(e,new Path2D)}))));let{x0:Q,size:Z}=c;if(null!=Q&&null!=Z){A=1,f=Q.values(e,t,a,m),2==Q.unit&&(f=f.map((t=>e.posToVal(w+t*x,g.key,!0))));let n=Z.values(e,t,a,m);I=2==Z.unit?n[0]*x:_(n[0],g,x,w)-_(0,g,x,w),$=gd(f,v,_,g,x,w,$),R=$-I+M}else $=gd(f,v,_,g,x,w,$),R=$*i+M,I=$-R;R<1&&(R=0),U>=I/2&&(U=0),R<5&&(N=nc);let G=R>0;I=N(ec($-R-(G?U:0),L,T)),P=(0==A?I/2:A==O?0:I)-A*O*((0==A?M/2:0)+(G?U/2:0));const J={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:0},X=B?null:new Path2D;let ee=null;if(null!=F)ee=e.data[F.series[1]];else{let{y0:n,y1:r}=c;null!=n&&null!=r&&(v=r.values(e,t,a,m),ee=n.values(e,t,a,m))}let te=C*I,ne=E*I;for(let n=1==O?a:m;n>=a&&n<=m;n+=O){let r=v[n];if(null==r)continue;if(null!=ee){var re;let e=null!==(re=ee[n])&&void 0!==re?re:0;if(r-e==0)continue;V=b(e,y,S,k)}let a=_(2!=g.distr||null!=c?f[n]:n,g,x,w),o=b(Rs(r,H),y,S,k),i=N(a-P),l=N(Ys(o,V)),s=N(qs(o,V)),u=l-s;if(null!=r){let a=r<0?ne:te,o=r<0?te:ne;B?(U>0&&null!=W[n]&&D(K.get(W[n]),i,s+$s(U/2),I,Ys(0,u-U),a,o),null!=q[n]&&D(Y.get(q[n]),i,s+$s(U/2),I,Ys(0,u-U),a,o)):D(X,i,s+$s(U/2),I,Ys(0,u-U),a,o),z(e,t,n,i-U/2,s,I+U,u)}}if(U>0)J.stroke=B?K:X;else if(!B){var ae;J._fill=0==p.width?p._fill:null!==(ae=p._stroke)&&void 0!==ae?ae:p._fill,J.width=0}return J.fill=B?Y:X,J}))},e.spline=function(e){return function(e,t){const n=Rs(null===t||void 0===t?void 0:t.alignGaps,0);return(t,r,a,o)=>Ku(t,r,((i,l,s,c,u,d,h,m,p,f,v)=>{let g,y,_,b=i.pxRound,w=e=>b(d(e,c,f,m)),k=e=>b(h(e,u,v,p));0==c.ori?(g=nd,_=ad,y=ud):(g=rd,_=od,y=dd);const x=c.dir*(0==c.ori?1:-1);a=Ns(s,a,o,1),o=Ns(s,a,o,-1);let S=w(l[1==x?a:o]),C=S,E=[],N=[];for(let e=1==x?a:o;e>=a&&e<=o;e+=x)if(null!=s[e]){let t=w(l[e]);E.push(C=t),N.push(k(s[e]))}const A={stroke:e(E,N,g,_,y,b),fill:null,clip:null,band:null,gaps:null,flags:Wu},M=A.stroke;let[T,L]=Qu(t,r);if(null!=i.fill||0!=T){let e=A.fill=new Path2D(M),n=k(i.fillTo(t,r,i.min,i.max,T));_(e,C,n),_(e,S,n)}if(!i.spanGaps){let e=[];e.push(...Xu(l,s,a,o,x,w,n)),A.gaps=e=i.gaps(t,r,a,o,e),A.clip=Ju(e,c.ori,m,p,f,v)}return 0!=L&&(A.band=2==L?[Gu(t,r,a,o,M,-1),Gu(t,r,a,o,M,1)]:Gu(t,r,a,o,M,L)),A}))}(yd,e)}}const Dd=e=>{let t=e.length,n=-1/0;for(;t--;){const r=e[t];Number.isFinite(r)&&r>n&&(n=r)}return Number.isFinite(n)?n:null},zd=e=>{let t=e.length,n=1/0;for(;t--;){const r=e[t];Number.isFinite(r)&&r<n&&(n=r)}return Number.isFinite(n)?n:null},Fd=e=>{let t=e.length;const n=[];for(;t--;){const r=e[t];Number.isFinite(r)&&n.push(r)}return n.sort(),n[n.length>>1]},jd=e=>{let t=e.length;for(;t--;){const n=e[t];if(Number.isFinite(n))return n}},Hd=(e,t,n)=>{if(void 0===e||null===e)return"";n=n||0,t=t||0;const r=Math.abs(n-t);if(isNaN(r)||0==r)return Math.abs(e)>=1e3?e.toLocaleString("en-US"):e.toString();let a=3+Math.floor(1+Math.log10(Math.max(Math.abs(t),Math.abs(n)))-Math.log10(r));return(isNaN(a)||a>20)&&(a=20),e.toLocaleString("en-US",{minimumSignificantDigits:1,maximumSignificantDigits:a})},Vd=e=>{const t=(null===e||void 0===e?void 0:e.metric)||{},n=Object.keys(t).filter((e=>"__name__"!=e)).map((e=>"".concat(e,"=").concat(JSON.stringify(t[e]))));let r=t.__name__||"";return n.length>0&&(r+="{"+n.join(",")+"}"),r},$d=[[31536e3,"{YYYY}",null,null,null,null,null,null,1],[2419200,"{MMM}","\n{YYYY}",null,null,null,null,null,1],[86400,"{MM}-{DD}","\n{YYYY}",null,null,null,null,null,1],[3600,"{HH}:{mm}","\n{YYYY}-{MM}-{DD}",null,"\n{MM}-{DD}",null,null,null,1],[60,"{HH}:{mm}","\n{YYYY}-{MM}-{DD}",null,"\n{MM}-{DD}",null,null,null,1],[1,"{HH}:{mm}:{ss}","\n{YYYY}-{MM}-{DD}",null,"\n{MM}-{DD} {HH}:{mm}",null,null,null,1],[.001,":{ss}.{fff}","\n{YYYY}-{MM}-{DD} {HH}:{mm}",null,"\n{MM}-{DD} {HH}:{mm}",null,"\n{HH}:{mm}",null,1]],Ud=(e,t)=>Array.from(new Set(e.map((e=>e.scale)))).map((e=>{const n="10px Arial",r=vt("color-text"),a={scale:e,show:!0,size:qd,stroke:r,font:n,values:(e,n)=>function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const r=t[0],a=t[t.length-1];return n?t.map((e=>"".concat(Hd(e,r,a)," ").concat(n))):t.map((e=>Hd(e,r,a)))}(e,n,t)};return e?Number(e)%2||"y"===e?a:{...a,side:1}:{space:80,values:$d,stroke:r,font:n}})),Bd=(e,t)=>{if(null==e||null==t)return[-1,1];const n=.02*(Math.abs(t-e)||Math.abs(e)||1);return[e-n,t+n]},qd=(e,t,n,r)=>{var a;const o=e.axes[n];if(r>1)return o._size||60;let i=6+((null===o||void 0===o||null===(a=o.ticks)||void 0===a?void 0:a.size)||0)+(o.gap||0);const l=(null!==t&&void 0!==t?t:[]).reduce(((e,t)=>(null===t||void 0===t?void 0:t.length)>e.length?t:e),"");return""!=l&&(i+=((e,t)=>{const n=document.createElement("span");n.innerText=e,n.style.cssText="position: absolute; z-index: -1; pointer-events: none; opacity: 0; font: ".concat(t),document.body.appendChild(n);const r=n.offsetWidth;return n.remove(),r})(l,"10px Arial")),Math.ceil(i)},Yd=["#e54040","#32a9dc","#2ee329","#7126a1","#e38f0f","#3d811a","#ffea00","#2d2d2d","#da42a6","#a44e0c"],Wd=e=>{if(7!=e.length)return"0, 0, 0";const t=parseInt(e.slice(1,3),16),n=parseInt(e.slice(3,5),16),r=parseInt(e.slice(5,7),16);return"".concat(t,", ").concat(n,", ").concat(r)},Kd={[dt.yhatUpper]:"#7126a1",[dt.yhatLower]:"#7126a1",[dt.yhat]:"#da42a6",[dt.anomaly]:"#da4242",[dt.anomalyScore]:"#7126a1",[dt.actual]:"#203ea9",[dt.training]:"rgba(".concat(Wd("#203ea9"),", 0.2)")},Qd=e=>{const t=16777215;let n=1,r=0,a=1;if(e.length>0)for(let i=0;i<e.length;i++)e[i].charCodeAt(0)>r&&(r=e[i].charCodeAt(0)),a=parseInt(String(t/r)),n=(n+e[i].charCodeAt(0)*a*49979693)%t;let o=(n*e.length%t).toString(16);return o=o.padEnd(6,o),"#".concat(o)},Zd=((e,t,n)=>{const r=[];for(let a=0;a<n;a++){const o=a/(n-1),i=e[0]+(t[0]-e[0])*o,l=e[1]+(t[1]-e[1])*o,s=e[2]+(t[2]-e[2])*o;r.push([i,l,s].map((e=>Math.round(e))).join(", "))}return r.map((e=>"rgb(".concat(e,")")))})([246,226,219],[127,39,4],16),Gd=()=>(e,t)=>{const n=Math.round(devicePixelRatio);Rd.orient(e,t,((r,a,o,i,l,s,c,u,d,h,m,p,f,v)=>{const[g,y,_]=e.data[t],b=g.length,w=((e,t)=>{const n=e.data[t][2],r=Zd;let a=1/0,o=-1/0;for(let c=0;c<n.length;c++)n[c]>0&&(a=Math.min(a,n[c]),o=Math.max(o,n[c]));const i=o-a,l=r.length,s=Array(n.length);for(let c=0;c<n.length;c++)s[c]=0===n[c]?-1:Math.min(l-1,Math.floor(l*(n[c]-a)/i));return s})(e,t),k=null!==Zd&&void 0!==Zd?Zd:[...Array.from(new Set(w))],x=k.map((()=>new Path2D)),S=b-y.lastIndexOf(y[0]),C=b/S,E=y[1]-y[0],N=g[S]-g[0],A=s(N,i,h,u)-s(0,i,h,u)-n,M=c(E,l,m,d)-c(0,l,m,d)+n,T=y.slice(0,S).map((e=>Math.round(c(e,l,m,d)-M/2))),L=Array.from({length:C},((e,t)=>Math.round(s(g[t*S],i,h,u)-A)));for(let e=0;e<b;e++)if(_[e]>0&&g[e]>=(i.min||-1/0)&&g[e]<=(i.max||1/0)&&y[e]>=(l.min||-1/0)&&y[e]<=(l.max||1/0)){const t=L[~~(e/S)],n=T[e%S];v(x[w[e]],t,n,A,M)}e.ctx.save(),e.ctx.rect(e.bbox.left,e.bbox.top,e.bbox.width,e.bbox.height),e.ctx.clip(),x.forEach(((t,n)=>{e.ctx.fillStyle=k[n],e.ctx.fill(t)})),e.ctx.restore()}))},Jd=e=>{const t=(e.metric.vmrange||e.metric.le||"").split("...");return Sl(t[t.length-1])},Xd=(e,t)=>Jd(e)-Jd(t),eh=(e,t)=>{if(!t)return e;const n=(e=>{var t;if(!e.every((e=>e.metric.le)))return e;const n=e.sort(((e,t)=>parseFloat(e.metric.le)-parseFloat(t.metric.le))),r=(null===(t=e[0])||void 0===t?void 0:t.group)||1;let a={metric:{le:""},values:[],group:r};const o=[];for(const l of n){const e=[a.metric.le,l.metric.le].filter((e=>e)).join("..."),t=[];for(const[n,r]of l.values){var i;const e=+r-+((null===(i=a.values.find((e=>e[0]===n)))||void 0===i?void 0:i[1])||0);t.push([n,"".concat(e)])}o.push({metric:{vmrange:e},values:t,group:r}),a=l}return o})(e.sort(Xd)),r={};n.forEach((e=>e.values.forEach((e=>{let[t,n]=e;r[t]=(r[t]||0)+ +n}))));return n.map((e=>{const t=e.values.map((e=>{let[t,n]=e;const a=r[t];return[t,"".concat(Math.round(+n/a*100))]}));return{...e,values:t}})).filter((e=>!e.values.every((e=>"0"===e[1]))))},th=e=>{const t=["__name__","for"];return Object.entries(e).filter((e=>{let[n]=e;return!t.includes(n)})).map((e=>{let[t,n]=e;return"".concat(t,": ").concat(n)})).join(",")},nh=(e,t,n,r)=>{const a={},o=r?0:Math.min(e.length,Yd.length);for(let i=0;i<o;i++){const t=xl(e[i],n[e[i].group-1]);a[t]=Yd[i]}return(o,i)=>{const l=r?(e=>{const t=(null===e||void 0===e?void 0:e.__name__)||"",n=new RegExp("(".concat(Object.values(dt).join("|"),")$")),r=t.match(n),a=r&&r[0];return{value:/(?:^|[^a-zA-Z0-9_])y(?:$|[^a-zA-Z0-9_])/.test(t)?dt.actual:a,group:th(e)}})(e[i].metric):null,s=r?(null===l||void 0===l?void 0:l.group)||"":xl(o,n[o.group-1]);return{label:s,dash:lh(l),width:sh(l),stroke:uh({metricInfo:l,label:s,isAnomalyUI:r,colorState:a}),points:ch(l),spanGaps:!1,forecast:null===l||void 0===l?void 0:l.value,forecastGroup:null===l||void 0===l?void 0:l.group,freeFormFields:o.metric,show:!oh(s,t),scale:"1",...rh(o)}}},rh=e=>{const t=e.values.map((e=>Sl(e[1]))),{min:n,max:r,median:a,last:o}={min:zd(t),max:Dd(t),median:Fd(t),last:jd(t)};return{median:a,statsFormatted:{min:Hd(n,n,r),max:Hd(r,n,r),median:Hd(a,n,r),last:Hd(o,n,r)}}},ah=(e,t)=>({group:t,label:e.label||"",color:e.stroke,checked:e.show||!1,freeFormFields:e.freeFormFields,statsFormatted:e.statsFormatted,median:e.median}),oh=(e,t)=>t.includes("".concat(e)),ih=e=>{for(let t=e.series.length-1;t>=0;t--)e.delSeries(t)},lh=e=>{const t=(null===e||void 0===e?void 0:e.value)===dt.yhatLower,n=(null===e||void 0===e?void 0:e.value)===dt.yhatUpper,r=(null===e||void 0===e?void 0:e.value)===dt.yhat;return t||n?[10,5]:r?[10,2]:[]},sh=e=>{const t=(null===e||void 0===e?void 0:e.value)===dt.yhatLower,n=(null===e||void 0===e?void 0:e.value)===dt.yhatUpper,r=(null===e||void 0===e?void 0:e.value)===dt.yhat,a=(null===e||void 0===e?void 0:e.value)===dt.anomaly;return n||t?.7:r?1:a?0:1.4},ch=e=>(null===e||void 0===e?void 0:e.value)===dt.anomaly?{size:8,width:4,space:0}:{size:4.2,width:1.4},uh=e=>{let{metricInfo:t,label:n,isAnomalyUI:r,colorState:a}=e;const o=a[n]||Qd(n),i=(null===t||void 0===t?void 0:t.value)===dt.anomaly;return r&&i?Kd[dt.anomaly]:!r||i||null!==t&&void 0!==t&&t.value?null!==t&&void 0!==t&&t.value?null!==t&&void 0!==t&&t.value?Kd[null===t||void 0===t?void 0:t.value]:o:a[n]||Qd(n):Kd[dt.actual]},dh=e=>{let{width:t=400,height:n=500}=e;return{width:t,height:n,series:[],tzDate:e=>o()(Jt(en(e))).local().toDate(),legend:{show:!1},cursor:{drag:{x:!0,y:!1},focus:{prox:30},points:{size:5.6,width:1.4},bind:{click:()=>null,dblclick:()=>null}}}},hh=e=>{ih(e),(e=>{Object.keys(e.hooks).forEach((t=>{e.hooks[t]=[]}))})(e),e.setData([])},mh=e=>{let{min:t,max:n}=e;return[t,n]},ph=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;return a.limits.enable?a.limits.range[r]:Bd(t,n)},fh=(e,t)=>{const n={x:{range:()=>mh(t)}},r=Object.keys(e.limits.range);return(r.length?r:["1"]).forEach((t=>{n[t]={range:function(n){return ph(n,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,t,e)}}})),n},vh=e=>t=>{const n=t.posToVal(t.select.left,"x"),r=t.posToVal(t.select.left+t.select.width,"x");e({min:n,max:r})};function gh(e){const t=Wd(Kd[e]);return"rgba(".concat(t,", 0.05)")}const yh=e=>(e=>e instanceof MouseEvent)(e)?e.clientX:e.touches[0].clientX,_h=e=>{let{dragSpeed:t=.85,setPanning:n,setPlotScale:a}=e;const o=(0,r.useRef)({leftStart:0,xUnitsPerPx:0,scXMin:0,scXMax:0}),i=e=>{e.preventDefault();const n=yh(e),{leftStart:r,xUnitsPerPx:i,scXMin:l,scXMax:s}=o.current,c=i*((n-r)*t);a({min:l-c,max:s-c})},l=()=>{n(!1),document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",l),document.removeEventListener("touchmove",i),document.removeEventListener("touchend",l)};return e=>{let{e:t,u:r}=e;t.preventDefault(),n(!0),o.current={leftStart:yh(t),xUnitsPerPx:r.posToVal(1,"x")-r.posToVal(0,"x"),scXMin:r.scales.x.min||0,scXMax:r.scales.x.max||0},document.addEventListener("mousemove",i),document.addEventListener("mouseup",l),document.addEventListener("touchmove",i),document.addEventListener("touchend",l)}},bh=e=>{const[t,n]=(0,r.useState)(!1),a=_h({dragSpeed:.9,setPanning:n,setPlotScale:e});return{onReadyChart:t=>{const n=e=>{const n=e instanceof MouseEvent&&(e=>{const{ctrlKey:t,metaKey:n,button:r}=e;return 0===r&&(t||n)})(e),r=window.TouchEvent&&e instanceof TouchEvent&&e.touches.length>1;(n||r)&&a({u:t,e:e})};t.over.addEventListener("mousedown",n),t.over.addEventListener("touchstart",n),t.over.addEventListener("wheel",(n=>{if(!n.ctrlKey&&!n.metaKey)return;n.preventDefault();const{width:r}=t.over.getBoundingClientRect(),a=t.cursor.left&&t.cursor.left>0?t.cursor.left:0,o=t.posToVal(a,"x"),i=(t.scales.x.max||0)-(t.scales.x.min||0),l=n.deltaY<0?.9*i:i/.9,s=o-a/r*l,c=s+l;t.batch((()=>e({min:s,max:c})))}))},isPanning:t}},wh=e=>{const t=e[0].clientX-e[1].clientX,n=e[0].clientY-e[1].clientY;return Math.sqrt(t*t+n*n)},kh=e=>{let{uPlotInst:t,xRange:n,setPlotScale:a}=e;const[o,i]=(0,r.useState)(0),l=(0,r.useCallback)((e=>{const{target:r,ctrlKey:o,metaKey:i,key:l}=e,s=r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement;if(!t||s)return;const c="+"===l||"="===l;if(("-"===l||c)&&!(o||i)){e.preventDefault();const t=(n.max-n.min)/10*(c?1:-1);a({min:n.min+t,max:n.max-t})}}),[t,n]),s=(0,r.useCallback)((e=>{if(!t||2!==e.touches.length)return;e.preventDefault();const r=wh(e.touches),i=o-r,l=t.scales.x.max||n.max,s=t.scales.x.min||n.min,c=(l-s)/50*(i>0?-1:1);t.batch((()=>a({min:s+c,max:l-c})))}),[t,o,n]);return Sr("keydown",l),Sr("touchmove",s),Sr("touchstart",(e=>{2===e.touches.length&&(e.preventDefault(),i(wh(e.touches)))})),null},xh=e=>{let{period:t,setPeriod:n}=e;const[a,i]=(0,r.useState)({min:t.start,max:t.end});return(0,r.useEffect)((()=>{i({min:t.start,max:t.end})}),[t]),{xRange:a,setPlotScale:e=>{let{min:t,max:r}=e;const a=1e3*(r-t);a<Ft||a>jt||n({from:o()(1e3*t).toDate(),to:o()(1e3*r).toDate()})}}},Sh=e=>{let{u:t,metrics:n,series:a,unit:i,isAnomalyView:l}=e;const[s,c]=(0,r.useState)(!1),[u,d]=(0,r.useState)({seriesIdx:-1,dataIdx:-1}),[h,m]=(0,r.useState)([]),p=(0,r.useCallback)((()=>{const{seriesIdx:e,dataIdx:r}=u,s=n[e-1],c=a[e],d=new Set(n.map((e=>e.group))),h=(null===s||void 0===s?void 0:s.group)||0,m=ot()(t,["data",e,r],0),p=ot()(t,["scales","1","min"],0),f=ot()(t,["scales","1","max"],1),v=ot()(t,["data",0,r],0),g={top:t?t.valToPos(m||0,(null===c||void 0===c?void 0:c.scale)||"1"):0,left:t?t.valToPos(v,"x"):0};return{unit:i,point:g,u:t,id:"".concat(e,"_").concat(r),title:d.size>1&&!l?"Query ".concat(h):"",dates:[v?o()(1e3*v).tz().format(Pt):"-"],value:Hd(m,p,f),info:Vd(s),statsFormatted:null===c||void 0===c?void 0:c.statsFormatted,marker:"".concat(null===c||void 0===c?void 0:c.stroke)}}),[t,u,n,a,i,l]),f=(0,r.useCallback)((()=>{if(!s)return;const e=p();h.find((t=>t.id===e.id))||m((t=>[...t,e]))}),[p,h,s]);return(0,r.useEffect)((()=>{c(-1!==u.dataIdx&&-1!==u.seriesIdx)}),[u]),Sr("click",f),{showTooltip:s,stickyTooltips:h,handleUnStick:e=>{m((t=>t.filter((t=>t.id!==e))))},getTooltipProps:p,seriesFocus:(e,t)=>{const n=null!==t&&void 0!==t?t:-1;d((e=>({...e,seriesIdx:n})))},setCursor:e=>{var t;const n=null!==(t=e.cursor.idx)&&void 0!==t?t:-1;d((e=>({...e,dataIdx:n})))},resetTooltips:()=>{m([]),d({seriesIdx:-1,dataIdx:-1})}}},Ch=e=>{let{u:t,id:n,title:a,dates:o,value:i,point:l,unit:s="",info:c,statsFormatted:u,isSticky:d,marker:h,onClose:m}=e;const p=(0,r.useRef)(null),[f,v]=(0,r.useState)({top:-999,left:-999}),[g,y]=(0,r.useState)(!1),[_,b]=(0,r.useState)(!1),w=(0,r.useCallback)((e=>{if(!g)return;const{clientX:t,clientY:n}=e;v({top:n,left:t})}),[g]);return(0,r.useEffect)((()=>{if(!p.current||!t)return;const{top:e,left:n}=l,r=parseFloat(t.over.style.left),a=parseFloat(t.over.style.top),{width:o,height:i}=t.over.getBoundingClientRect(),{width:s,height:c}=p.current.getBoundingClientRect(),u={top:e+a+10-(e+c>=i?c+20:0),left:n+r+10-(n+s>=o?s+20:0)};u.left<0&&(u.left=20),u.top<0&&(u.top=20),v(u)}),[t,i,l,p]),Sr("mousemove",w),Sr("mouseup",(()=>{y(!1)})),t?r.default.createPortal(Et("div",{className:wr()({"vm-chart-tooltip":!0,"vm-chart-tooltip_sticky":d,"vm-chart-tooltip_moved":_}),ref:p,style:f,children:[Et("div",{className:"vm-chart-tooltip-header",children:[a&&Et("div",{className:"vm-chart-tooltip-header__title",children:a}),Et("div",{className:"vm-chart-tooltip-header__date",children:o.map(((e,t)=>Et("span",{children:e},t)))}),d&&Et(St.FK,{children:[Et(ea,{className:"vm-chart-tooltip-header__drag",variant:"text",size:"small",startIcon:Et(rr,{}),onMouseDown:e=>{b(!0),y(!0);const{clientX:t,clientY:n}=e;v({top:n,left:t})},ariaLabel:"drag the tooltip"}),Et(ea,{className:"vm-chart-tooltip-header__close",variant:"text",size:"small",startIcon:Et(Ln,{}),onClick:()=>{m&&m(n)},ariaLabel:"close the tooltip"})]})]}),Et("div",{className:"vm-chart-tooltip-data",children:[h&&Et("span",{className:"vm-chart-tooltip-data__marker",style:{background:h}}),Et("p",{className:"vm-chart-tooltip-data__value",children:[Et("b",{children:i}),s]})]}),u&&Et("table",{className:"vm-chart-tooltip-stats",children:st.map(((e,t)=>Et("div",{className:"vm-chart-tooltip-stats-row",children:[Et("span",{className:"vm-chart-tooltip-stats-row__key",children:[e,":"]}),Et("span",{className:"vm-chart-tooltip-stats-row__value",children:u[e]})]},t)))}),c&&Et("p",{className:"vm-chart-tooltip__info",children:c})]}),t.root):null},Eh=e=>{let{showTooltip:t,tooltipProps:n,stickyTooltips:a,handleUnStick:o}=e;return Et(St.FK,{children:[t&&n&&Et(Ch,{...n}),a.map((e=>(0,r.createElement)(Ch,{...e,isSticky:!0,key:e.id,onClose:o})))]})},Nh=e=>{let{data:t,series:n,metrics:a=[],period:o,yaxis:i,unit:l,setPeriod:s,layoutSize:c,height:u,isAnomalyView:d,spanGaps:h=!1}=e;const{isDarkTheme:m}=At(),p=(0,r.useRef)(null),[f,v]=(0,r.useState)(),{xRange:g,setPlotScale:y}=xh({period:o,setPeriod:s}),{onReadyChart:_,isPanning:b}=bh(y);kh({uPlotInst:f,xRange:g,setPlotScale:y});const{showTooltip:w,stickyTooltips:k,handleUnStick:x,getTooltipProps:S,seriesFocus:C,setCursor:E,resetTooltips:N}=Sh({u:f,metrics:a,series:n,unit:l,isAnomalyView:d}),A={...dh({width:c.width,height:u}),series:n,axes:Ud([{},{scale:"1"}],l),scales:fh(i,g),hooks:{ready:[_],setSeries:[C],setCursor:[E],setSelect:[vh(y)],destroy:[hh]},bands:[]};return(0,r.useEffect)((()=>{if(N(),!p.current)return;f&&f.destroy();const e=new Rd(A,t,p.current);return v(e),e.destroy}),[p,m]),(0,r.useEffect)((()=>{f&&(f.setData(t),f.redraw())}),[t]),(0,r.useEffect)((()=>{f&&(ih(f),function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t.forEach((t=>{t.label&&(t.spanGaps=n),e.addSeries(t)}))}(f,n,h),((e,t)=>{if(e.delBand(),t.length<2)return;const n=t.map(((e,t)=>({...e,index:t}))),r=n.filter((e=>e.forecast===dt.yhatUpper)),a=n.filter((e=>e.forecast===dt.yhatLower)),o=r.map((e=>{const t=a.find((t=>t.forecastGroup===e.forecastGroup));return t?{series:[e.index,t.index],fill:gh(dt.yhatUpper)}:null})).filter((e=>null!==e));o.length&&o.forEach((t=>{e.addBand(t)}))})(f,n),f.redraw())}),[n,h]),(0,r.useEffect)((()=>{f&&(Object.keys(i.limits.range).forEach((e=>{f.scales[e]&&(f.scales[e].range=function(t){return ph(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,e,i)})})),f.redraw())}),[i]),(0,r.useEffect)((()=>{f&&(f.scales.x.range=()=>mh(g),f.redraw())}),[g]),(0,r.useEffect)((()=>{f&&(f.setSize({width:c.width||400,height:u||500}),f.redraw())}),[u,c]),Et("div",{className:wr()({"vm-line-chart":!0,"vm-line-chart_panning":b}),style:{minWidth:"".concat(c.width||400,"px"),minHeight:"".concat(u||500,"px")},children:[Et("div",{className:"vm-line-chart__u-plot",ref:p}),Et(Eh,{showTooltip:w,tooltipProps:S(),stickyTooltips:k,handleUnStick:x})]})},Ah=e=>{let{legend:t,onChange:n,isHeatmap:a,isAnomalyView:o}=e;const i=hl(),l=(0,r.useMemo)((()=>{const e=(e=>{const t=Object.keys(e.freeFormFields).filter((e=>"__name__"!==e));return t.map((t=>{const n="".concat(t,"=").concat(JSON.stringify(e.freeFormFields[t]));return{id:"".concat(e.label,".").concat(n),freeField:n,key:t}}))})(t);return a?e.filter((e=>"vmrange"!==e.key)):e}),[t,a]),s=t.statsFormatted,c=Object.values(s).some((e=>e)),u=e=>t=>{t.stopPropagation(),(async e=>{await i(e,"".concat(e," has been copied"))})(e)};return Et("div",{className:wr()({"vm-legend-item":!0,"vm-legend-row":!0,"vm-legend-item_hide":!t.checked&&!a,"vm-legend-item_static":a}),onClick:(e=>t=>{n&&n(e,t.ctrlKey||t.metaKey)})(t),children:[!o&&!a&&Et("div",{className:"vm-legend-item__marker",style:{backgroundColor:t.color}}),Et("div",{className:"vm-legend-item-info",children:Et("span",{className:"vm-legend-item-info__label",children:[t.freeFormFields.__name__,!!l.length&&Et(St.FK,{children:"{"}),l.map(((e,t)=>Et("span",{className:"vm-legend-item-info__free-fields",onClick:u(e.freeField),title:"copy to clipboard",children:[e.freeField,t+1<l.length&&","]},e.key))),!!l.length&&Et(St.FK,{children:"}"})]})}),!a&&c&&Et("div",{className:"vm-legend-item-stats",children:st.map(((e,t)=>Et("div",{className:"vm-legend-item-stats-row",children:[Et("span",{className:"vm-legend-item-stats-row__key",children:[e,":"]}),Et("span",{className:"vm-legend-item-stats-row__value",children:s[e]})]},t)))})]})},Mh=e=>{let{labels:t,query:n,isAnomalyView:a,onChange:o}=e;const i=(0,r.useMemo)((()=>Array.from(new Set(t.map((e=>e.group))))),[t]),l=i.length>1;return Et(St.FK,{children:Et("div",{className:"vm-legend",children:i.map((e=>Et("div",{className:"vm-legend-group",children:Et(mo,{defaultExpanded:!0,title:Et("div",{className:"vm-legend-group-title",children:[l&&Et("span",{className:"vm-legend-group-title__count",children:["Query ",e,": "]}),Et("span",{className:"vm-legend-group-title__query",children:n[e-1]})]}),children:Et("div",{children:t.filter((t=>t.group===e)).sort(((e,t)=>(t.median||0)-(e.median||0))).map((e=>Et(Ah,{legend:e,isAnomalyView:a,onChange:o},e.label)))})})},e)))})})},Th=e=>{var t;let{min:n,max:a,legendValue:o,series:i}=e;const[l,s]=(0,r.useState)(0),[c,u]=(0,r.useState)(""),[d,h]=(0,r.useState)(""),[m,p]=(0,r.useState)(""),f=(0,r.useMemo)((()=>parseFloat(String((null===o||void 0===o?void 0:o.value)||0).replace("%",""))),[o]);return(0,r.useEffect)((()=>{s(f?(f-n)/(a-n)*100:0),u(f?"".concat(f,"%"):""),h("".concat(n,"%")),p("".concat(a,"%"))}),[f,n,a]),Et("div",{className:"vm-legend-heatmap__wrapper",children:[Et("div",{className:"vm-legend-heatmap",children:[Et("div",{className:"vm-legend-heatmap-gradient",style:{background:"linear-gradient(to right, ".concat(Zd.join(", "),")")},children:!!f&&Et("div",{className:"vm-legend-heatmap-gradient__value",style:{left:"".concat(l,"%")},children:Et("span",{children:c})})}),Et("div",{className:"vm-legend-heatmap__value",children:d}),Et("div",{className:"vm-legend-heatmap__value",children:m})]}),i[1]&&Et(Ah,{legend:i[1],isHeatmap:!0},null===(t=i[1])||void 0===t?void 0:t.label)]})},Lh=e=>{let{u:t,metrics:n,unit:a}=e;const[i,l]=(0,r.useState)({left:0,top:0}),[s,c]=(0,r.useState)([]),u=(0,r.useCallback)((()=>{var e;const{left:r,top:l}=i,s=ot()(t,["data",1,0],[])||[],c=t?t.posToVal(r,"x"):0,u=t?t.posToVal(l,"y"):0,d=s.findIndex(((e,t)=>c>=e&&c<s[t+1]))||-1,h=s[d+1],m=n[Math.round(u)]||{values:[]},[p=0,f=""]=m.values.find((e=>e[0]===h))||[],v=s[d],g=o()(1e3*v).tz().format(Pt),y=o()(1e3*p).tz().format(Pt),_=(null===m||void 0===m||null===(e=m.metric)||void 0===e?void 0:e.vmrange)||"";return{unit:a,point:i,u:t,id:"".concat(_,"_").concat(g),dates:[g,y],value:"".concat(f,"%"),info:_,show:+f>0}}),[t,i,n,a]),d=(0,r.useCallback)((()=>{const e=u();e.show&&(s.find((t=>t.id===e.id))||c((t=>[...t,e])))}),[u,s]);return Sr("click",d),{stickyTooltips:s,handleUnStick:e=>{c((t=>t.filter((t=>t.id!==e))))},getTooltipProps:u,setCursor:e=>{const t=e.cursor.left||0,n=e.cursor.top||0;l({left:t,top:n})},resetTooltips:()=>{c([]),l({left:0,top:0})}}},Oh=e=>{let{data:t,metrics:n=[],period:a,unit:o,setPeriod:i,layoutSize:l,height:s,onChangeLegend:c}=e;const{isDarkTheme:u}=At(),d=(0,r.useRef)(null),[h,m]=(0,r.useState)(),{xRange:p,setPlotScale:f}=xh({period:a,setPeriod:i}),{onReadyChart:v,isPanning:g}=bh(f);kh({uPlotInst:h,xRange:p,setPlotScale:f});const{stickyTooltips:y,handleUnStick:_,getTooltipProps:b,setCursor:w,resetTooltips:k}=Lh({u:h,metrics:n,unit:o}),x=(0,r.useMemo)((()=>b()),[b]),S={...dh({width:l.width,height:s}),mode:2,series:[{},{paths:Gd(),facets:[{scale:"x",auto:!0,sorted:1},{scale:"y",auto:!0}]}],axes:(()=>{const e=Ud([{}],o);return[...e,{scale:"y",stroke:e[0].stroke,font:e[0].font,size:qd,splits:n.map(((e,t)=>t)),values:n.map((e=>e.metric.vmrange))}]})(),scales:{x:{time:!0},y:{log:2,time:!1,range:(e,t,n)=>[t-1,n+1]}},hooks:{ready:[v],setCursor:[w],setSelect:[vh(f)],destroy:[hh]}};return(0,r.useEffect)((()=>{k();const e=null===t[0]&&Array.isArray(t[1]);if(!d.current||!e)return;const n=new Rd(S,t,d.current);return m(n),n.destroy}),[d,t,u]),(0,r.useEffect)((()=>{h&&(h.setSize({width:l.width||400,height:s||500}),h.redraw())}),[s,l]),(0,r.useEffect)((()=>{c(x)}),[x]),Et("div",{className:wr()({"vm-line-chart":!0,"vm-line-chart_panning":g}),style:{minWidth:"".concat(l.width||400,"px"),minHeight:"".concat(s||500,"px")},children:[Et("div",{className:"vm-line-chart__u-plot",ref:d}),Et(Eh,{showTooltip:!!x.show,tooltipProps:x,stickyTooltips:y,handleUnStick:_})]})},Ph=()=>{const[e,t]=(0,r.useState)(null),[n,a]=(0,r.useState)({width:0,height:0}),o=(0,r.useCallback)((()=>{a({width:(null===e||void 0===e?void 0:e.offsetWidth)||0,height:(null===e||void 0===e?void 0:e.offsetHeight)||0})}),[null===e||void 0===e?void 0:e.offsetHeight,null===e||void 0===e?void 0:e.offsetWidth]);return Sr("resize",o),(0,r.useEffect)(o,[null===e||void 0===e?void 0:e.offsetHeight,null===e||void 0===e?void 0:e.offsetWidth]),[t,n]},Ih={[dt.yhat]:"yhat",[dt.yhatLower]:"yhat_upper - yhat_lower",[dt.yhatUpper]:"yhat_upper - yhat_lower",[dt.anomaly]:"anomalies",[dt.training]:"training data",[dt.actual]:"y"},Rh=e=>{let{series:t}=e;const n=(0,r.useMemo)((()=>{const e=t.reduce(((e,t)=>{const n=Object.prototype.hasOwnProperty.call(t,"forecast"),r=t.forecast!==dt.yhatUpper,a=!e.find((e=>e.forecast===t.forecast));return n&&a&&r&&e.push(t),e}),[]),n={...e[0],forecast:dt.training,color:Kd[dt.training]};return e.splice(1,0,n),e.map((e=>({...e,color:"string"===typeof e.stroke?e.stroke:Kd[e.forecast||dt.actual]})))}),[t]);return Et(St.FK,{children:Et("div",{className:"vm-legend-anomaly",children:n.filter((e=>e.forecast!==dt.training)).map(((e,t)=>{var n;return Et("div",{className:"vm-legend-anomaly-item",children:[Et("svg",{children:e.forecast===dt.anomaly?Et("circle",{cx:"15",cy:"7",r:"4",fill:e.color,stroke:e.color,strokeWidth:"1.4"}):Et("line",{x1:"0",y1:"7",x2:"30",y2:"7",stroke:e.color,strokeWidth:e.width||1,strokeDasharray:null===(n=e.dash)||void 0===n?void 0:n.join(",")})}),Et("div",{className:"vm-legend-anomaly-item__title",children:Ih[e.forecast||dt.actual]})]},"".concat(t,"_").concat(e.forecast))}))})})},Dh=e=>{let{data:t=[],period:n,customStep:a,query:o,yaxis:i,unit:l,showLegend:s=!0,setYaxisLimits:c,setPeriod:u,alias:d=[],fullWidth:h=!0,height:m,isHistogram:p,isAnomalyView:f,spanGaps:v}=e;const{isMobile:g}=Ur(),{timezone:y}=pn(),_=(0,r.useMemo)((()=>a||n.step||"1s"),[n.step,a]),b=(0,r.useMemo)((()=>eh(t,p)),[p,t]),[w,k]=(0,r.useState)([[]]),[x,S]=(0,r.useState)([]),[C,E]=(0,r.useState)([]),[N,A]=(0,r.useState)([]),[M,T]=(0,r.useState)(null),L=(0,r.useMemo)((()=>nh(b,N,d,f)),[b,N,d,f]),O=e=>{const t=((e,t)=>{const n={},r=Object.values(e).flat(),a=zd(r)||0,o=Dd(r)||1;return n[1]=t?Bd(a,o):[a,o],n})(e,!p);c(t)},P=e=>{if(!f)return e;const t=function(e,t){const n=e.reduce(((e,n)=>{const r=t.map((e=>"".concat(e,": ").concat(n[e]||"-"))).join("|");return(e[r]=e[r]||[]).push(n),e}),{});return Object.entries(n).map((e=>{let[t,n]=e;return{keys:t.split("|"),values:n}}))}(e,["group","label"]);return t.map((e=>{const t=e.values[0];return{...t,freeFormFields:{...t.freeFormFields,__name__:""}}}))};(0,r.useEffect)((()=>{const e=[],t={},r=[],a=[{}];null===b||void 0===b||b.forEach(((n,o)=>{const i=L(n,o);a.push(i),r.push(ah(i,n.group));const l=t[n.group]||[];for(const t of n.values)e.push(t[0]),l.push(Sl(t[1]));t[n.group]=l}));const o=((e,t,n)=>{const r=Kt(t)||1,a=Array.from(new Set(e)).sort(((e,t)=>e-t));let o=n.start;const i=Bt(n.end+r);let l=0;const s=[];for(;o<=i;){for(;l<a.length&&a[l]<=o;)o=a[l],l++,s.push(o);o=Bt(o+r),(l>=a.length||a[l]>o)&&s.push(o)}for(;s.length<2;)s.push(o),o=Bt(o+r);return s})(e,_,n),i=b.map((e=>{const t=[],n=e.values,r=n.length;let a=0;for(const u of o){for(;a<r&&n[a][0]<u;)a++;let e=null;a<r&&n[a][0]==u&&(e=Sl(n[a][1]),Number.isFinite(e)||(e=null)),t.push(e)}const i=t.filter((e=>null!==e)),l=Math.abs((e=>{let t=e[0],n=1;for(let r=1;r<e.length;r++){const a=e[r];Number.isFinite(a)&&(t=t*(n-1)/n+a/n,n++)}return t})(i)),s=Bd(zd(i),Dd(i)),c=Math.abs(s[1]-s[0]);return l>1e10*c&&!f?t.map((()=>l)):t}));i.unshift(o),O(t);const l=p?(e=>{const t=e.slice(1,e.length),n=[],r=[];t.forEach(((e,n)=>{e.forEach(((e,a)=>{const o=a*t.length+n;r[o]=e}))})),e[0].forEach((e=>{const r=new Array(t.length).fill(e);n.push(...r)}));const a=new Array(n.length).fill(0).map(((e,n)=>n%t.length));return[null,[n,a,r]]})(i):i;k(l),S(a);const s=P(r);E(s),f&&A(s.map((e=>e.label||"")).slice(1))}),[b,y,p]),(0,r.useEffect)((()=>{const e=[],t=[{}];null===b||void 0===b||b.forEach(((n,r)=>{const a=L(n,r);t.push(a),e.push(ah(a,n.group))})),S(t),E(P(e))}),[N]);const[I,R]=Ph();return Et("div",{className:wr()({"vm-graph-view":!0,"vm-graph-view_full-width":h,"vm-graph-view_full-width_mobile":h&&g}),ref:I,children:[!p&&Et(Nh,{data:w,series:x,metrics:b,period:n,yaxis:i,unit:l,setPeriod:u,layoutSize:R,height:m,isAnomalyView:f,spanGaps:v}),p&&Et(Oh,{data:w,metrics:b,period:n,unit:l,setPeriod:u,layoutSize:R,height:m,onChangeLegend:T}),f&&s&&Et(Rh,{series:x}),!p&&s&&Et(Mh,{labels:C,query:o,isAnomalyView:f,onChange:(e,t)=>{A((e=>{let{hideSeries:t,legend:n,metaKey:r,series:a,isAnomalyView:o}=e;const{label:i}=n,l=oh(i,t),s=a.map((e=>e.label||""));return o?s.filter((e=>e!==i)):r?l?t.filter((e=>e!==i)):[...t,i]:t.length?l?[...s.filter((e=>e!==i))]:[]:[...s.filter((e=>e!==i))]})({hideSeries:N,legend:e,metaKey:t,series:x,isAnomalyView:f}))}}),p&&s&&Et(Th,{series:x,min:i.limits.range[1][0]||0,max:i.limits.range[1][1]||0,legendValue:M})]})},zh=e=>{let{yaxis:t,setYaxisLimits:n,toggleEnableLimits:a}=e;const{isMobile:o}=Ur(),i=(0,r.useMemo)((()=>Object.keys(t.limits.range)),[t.limits.range]),l=(0,r.useCallback)(Lo()(((e,r,a)=>{const o=t.limits.range;o[r][a]=+e,o[r][0]===o[r][1]||o[r][0]>o[r][1]||n(o)}),500),[t.limits.range]),s=(e,t)=>n=>{l(n,e,t)};return Et("div",{className:wr()({"vm-axes-limits":!0,"vm-axes-limits_mobile":o}),children:[Et(sl,{value:t.limits.enable,onChange:a,label:"Fix the limits for y-axis",fullWidth:o}),Et("div",{className:"vm-axes-limits-list",children:i.map((e=>Et("div",{className:"vm-axes-limits-list__inputs",children:[Et(ja,{label:"Min ".concat(e),type:"number",disabled:!t.limits.enable,value:t.limits.range[e][0],onChange:s(e,0)}),Et(ja,{label:"Max ".concat(e),type:"number",disabled:!t.limits.enable,value:t.limits.range[e][1],onChange:s(e,1)})]},e)))})]})},Fh=e=>{let{spanGaps:t,onChange:n}=e;const{isMobile:r}=Ur();return Et("div",{children:Et(sl,{value:t,onChange:n,label:"Connect null values",fullWidth:r})})},jh="Graph settings",Hh=e=>{let{yaxis:t,setYaxisLimits:n,toggleEnableLimits:a,spanGaps:o}=e;const i=(0,r.useRef)(null),l=(0,r.useRef)(null),{value:s,toggle:c,setFalse:u}=na(!1);return Et("div",{className:"vm-graph-settings",children:[Et(da,{title:jh,children:Et("div",{ref:l,children:Et(ea,{variant:"text",startIcon:Et(Tn,{}),onClick:c,ariaLabel:"settings"})})}),Et(ta,{open:s,buttonRef:l,placement:"bottom-right",onClose:u,title:jh,children:Et("div",{className:"vm-graph-settings-popper",ref:i,children:Et("div",{className:"vm-graph-settings-popper__body",children:[Et(zh,{yaxis:t,setYaxisLimits:n,toggleEnableLimits:a}),Et(Fh,{spanGaps:o.value,onChange:o.onChange})]})})})]})},Vh=e=>{let{isHistogram:t,graphData:n,controlsRef:a,isAnomalyView:o}=e;const{isMobile:i}=Ur(),{customStep:l,yaxis:s,spanGaps:c}=jr(),{period:u}=pn(),{query:d}=Sn(),h=fn(),m=Hr(),p=e=>{m({type:"SET_YAXIS_LIMITS",payload:e})},f=Et("div",{className:"vm-custom-panel-body-header__graph-controls",children:[Et(va,{}),Et(Hh,{yaxis:s,setYaxisLimits:p,toggleEnableLimits:()=>{m({type:"TOGGLE_ENABLE_YAXIS_LIMITS"})},spanGaps:{value:c,onChange:e=>{m({type:"SET_SPAN_GAPS",payload:e})}}})]});return Et(St.FK,{children:[a.current&&(0,r.createPortal)(f,a.current),Et(Dh,{data:n,period:u,customStep:l,query:d,yaxis:s,setYaxisLimits:p,setPeriod:e=>{let{from:t,to:n}=e;h({type:"SET_PERIOD",payload:{from:t,to:n}})},height:i?.5*window.innerHeight:500,isHistogram:t,isAnomalyView:o,spanGaps:c})]})},$h=e=>{let{data:t}=e;const n=hl(),a=(0,r.useMemo)((()=>JSON.stringify(t,null,2)),[t]);return Et("div",{className:"vm-json-view",children:[Et("div",{className:"vm-json-view__copy",children:Et(ea,{variant:"outlined",onClick:async()=>{await n(a,"Formatted JSON has been copied")},children:"Copy JSON"})}),Et("pre",{className:"vm-json-view__code",children:Et("code",{children:a})})]})},Uh=e=>{const t={};return e.forEach((e=>Object.entries(e.metric).forEach((e=>t[e[0]]?t[e[0]].options.add(e[1]):t[e[0]]={options:new Set([e[1]])})))),Object.entries(t).map((e=>({key:e[0],variations:e[1].options.size}))).sort(((e,t)=>e.variations-t.variations))},Bh=(e,t)=>(0,r.useMemo)((()=>{const n=Uh(e);return t?n.filter((e=>t.includes(e.key))):n}),[e,t]),qh=e=>{let{data:t,displayColumns:n}=e;const a=hl(),{isMobile:o}=Ur(),{tableCompact:i}=Ir(),l=(0,r.useRef)(null),[s,c]=(0,r.useState)(""),[u,d]=(0,r.useState)("asc"),h=i?Bh([{group:0,metric:{Data:"Data"}}],["Data"]):Bh(t,n),m=e=>{const{__name__:t,...n}=e;return t||Object.keys(n).length?t?"".concat(t," ").concat(JSON.stringify(n)):"".concat(JSON.stringify(n)):""},p=new Set(null===t||void 0===t?void 0:t.map((e=>e.group))).size>1,f=(0,r.useMemo)((()=>{const e=null===t||void 0===t?void 0:t.map((e=>({metadata:h.map((t=>i?xl(e,"",p):e.metric[t.key]||"-")),value:e.value?e.value[1]:"-",values:e.values?e.values.map((e=>{let[t,n]=e;return"".concat(n," @").concat(t)})):[],copyValue:m(e.metric)}))),n="Value"===s,r=h.findIndex((e=>e.key===s));return n||-1!==r?e.sort(((e,t)=>{const a=n?Number(e.value):e.metadata[r],o=n?Number(t.value):t.metadata[r];return("asc"===u?a<o:a>o)?-1:1})):e}),[h,t,s,u,i]),v=(0,r.useMemo)((()=>f.some((e=>e.copyValue))),[f]),g=e=>()=>{(e=>{d((t=>"asc"===t&&s===e?"desc":"asc")),c(e)})(e)};return f.length?Et("div",{className:wr()({"vm-table-view":!0,"vm-table-view_mobile":o}),children:Et("table",{className:"vm-table",ref:l,children:[Et("thead",{className:"vm-table-header",children:Et("tr",{className:"vm-table__row vm-table__row_header",children:[h.map(((e,t)=>Et("td",{className:"vm-table-cell vm-table-cell_header vm-table-cell_sort",onClick:g(e.key),children:Et("div",{className:"vm-table-cell__content",children:[e.key,Et("div",{className:wr()({"vm-table__sort-icon":!0,"vm-table__sort-icon_active":s===e.key,"vm-table__sort-icon_desc":"desc"===u&&s===e.key}),children:Et(jn,{})})]})},t))),Et("td",{className:"vm-table-cell vm-table-cell_header vm-table-cell_right vm-table-cell_sort",onClick:g("Value"),children:Et("div",{className:"vm-table-cell__content",children:[Et("div",{className:wr()({"vm-table__sort-icon":!0,"vm-table__sort-icon_active":"Value"===s,"vm-table__sort-icon_desc":"desc"===u}),children:Et(jn,{})}),"Value"]})}),v&&Et("td",{className:"vm-table-cell vm-table-cell_header"})]})}),Et("tbody",{className:"vm-table-body",children:f.map(((e,t)=>{return Et("tr",{className:"vm-table__row",children:[e.metadata.map(((e,n)=>Et("td",{className:wr()({"vm-table-cell vm-table-cell_no-wrap":!0,"vm-table-cell_gray":f[t-1]&&f[t-1].metadata[n]===e}),children:e},n))),Et("td",{className:"vm-table-cell vm-table-cell_right vm-table-cell_no-wrap",children:e.values.length?e.values.map((e=>Et("p",{children:e},e))):e.value}),v&&Et("td",{className:"vm-table-cell vm-table-cell_right",children:e.copyValue&&Et("div",{className:"vm-table-cell__content",children:Et(da,{title:"Copy row",children:Et(ea,{variant:"text",color:"gray",size:"small",startIcon:Et(nr,{}),onClick:(n=e.copyValue,async()=>{await a(n,"Row has been copied")}),ariaLabel:"copy row"})})})})]},t);var n}))})]})}):Et(qr,{variant:"warning",children:"No data to show"})},Yh=e=>{let{checked:t=!1,disabled:n=!1,label:r,color:a="secondary",onChange:o}=e;return Et("div",{className:wr()({"vm-checkbox":!0,"vm-checkbox_disabled":n,"vm-checkbox_active":t,["vm-checkbox_".concat(a,"_active")]:t,["vm-checkbox_".concat(a)]:a}),onClick:()=>{n||o(!t)},children:[Et("div",{className:"vm-checkbox-track",children:Et("div",{className:"vm-checkbox-track__thumb",children:Et(Jn,{})})}),r&&Et("span",{className:"vm-checkbox__label",children:r})]})},Wh="Table settings",Kh=e=>{let{columns:t,defaultColumns:n=[],tableCompact:a,onChangeColumns:o,toggleTableCompact:i}=e;const{isMobile:l}=Ur(),s=(0,r.useRef)(null),{value:c,toggle:u,setFalse:d}=na(!1),h=(0,r.useMemo)((()=>!t.length),[t]),m=e=>()=>{(e=>{o(n.includes(e)?n.filter((t=>t!==e)):[...n,e])})(e)};return(0,r.useEffect)((()=>{dl(t,n)||o(t)}),[t]),Et("div",{className:"vm-table-settings",children:[Et(da,{title:Wh,children:Et("div",{ref:s,children:Et(ea,{variant:"text",startIcon:Et(Tn,{}),onClick:u,disabled:h,ariaLabel:"table settings"})})}),Et(ta,{open:c,onClose:d,placement:"bottom-right",buttonRef:s,title:Wh,children:Et("div",{className:wr()({"vm-table-settings-popper":!0,"vm-table-settings-popper_mobile":l}),children:[Et("div",{className:"vm-table-settings-popper-list vm-table-settings-popper-list_first",children:Et(sl,{label:"Compact view",value:a,onChange:i})}),Et("div",{className:"vm-table-settings-popper-list",children:[Et("div",{className:"vm-table-settings-popper-list-header",children:[Et("h3",{className:"vm-table-settings-popper-list-header__title",children:"Display columns"}),Et(da,{title:"Reset to default",children:Et(ea,{color:"primary",variant:"text",size:"small",onClick:()=>{d(),o(t)},startIcon:Et(On,{}),ariaLabel:"reset columns"})})]}),t.map((e=>Et("div",{className:"vm-table-settings-popper-list__item",children:Et(Yh,{checked:n.includes(e),onChange:m(e),label:e,disabled:a})},e)))]})]})})]})},Qh=e=>{let{liveData:t,controlsRef:n}=e;const{tableCompact:a}=Ir(),o=Rr(),[i,l]=(0,r.useState)(),s=(0,r.useMemo)((()=>Uh(t||[]).map((e=>e.key))),[t]),c=Et(Kh,{columns:s,defaultColumns:i,onChangeColumns:l,tableCompact:a,toggleTableCompact:()=>{o({type:"TOGGLE_TABLE_COMPACT"})}});return Et(St.FK,{children:[n.current&&(0,r.createPortal)(c,n.current),Et(qh,{data:t,displayColumns:i})]})},Zh=e=>{let{graphData:t,liveData:n,isHistogram:r,displayType:a,controlsRef:o}=e;return a===ht.code&&n?Et($h,{data:n}):a===ht.table&&n?Et(Qh,{liveData:n,controlsRef:o}):a===ht.chart&&t?Et(Vh,{graphData:t,isHistogram:r,controlsRef:o}):null},Gh=[Et(St.FK,{children:[Et("p",{children:"Filename - specify the name for your report file."}),Et("p",{children:["Default format: ",Et("code",{children:["vmui_report_$",Rt,".json"]}),"."]}),Et("p",{children:"This name will be used when saving your report on your device."})]}),Et(St.FK,{children:[Et("p",{children:"Comment (optional) - add a comment to your report."}),Et("p",{children:"This can be any additional information that will be useful when reviewing the report later."})]}),Et(St.FK,{children:[Et("p",{children:"Query trace - enable this option to include a query trace in your report."}),Et("p",{children:"This will assist in analyzing and diagnosing the query processing."})]}),Et(St.FK,{children:[Et("p",{children:"Generate Report - click this button to generate and save your report. "}),Et("p",{children:["After creation, the report can be downloaded and examined on the ",Et(Ie,{to:Ye.queryAnalyzer,target:"_blank",rel:"noreferrer",className:"vm-link vm-link_underlined",children:qe[Ye.queryAnalyzer].title})," page."]})]})],Jh=()=>"vmui_report_".concat(o()().utc().format(Rt)),Xh=e=>{let{fetchUrl:t}=e;const{query:n}=Sn(),[a,o]=(0,r.useState)(Jh()),[i,l]=(0,r.useState)(""),[s,c]=(0,r.useState)(!0),[u,d]=(0,r.useState)(),[h,m]=(0,r.useState)(!1),p=(0,r.useRef)(null),f=(0,r.useRef)(null),v=(0,r.useRef)(null),g=(0,r.useRef)(null),y=[p,f,v,g],[_,b]=(0,r.useState)(0),{value:w,toggle:k,setFalse:x}=na(!1),{value:S,toggle:C,setFalse:E}=na(!1),N=(0,r.useMemo)((()=>{if(t)return t.map(((e,t)=>{const n=new URL(e);return s?n.searchParams.set("trace","1"):n.searchParams.delete("trace"),{id:t,url:n}}))}),[t,s]),A=(0,r.useCallback)((e=>{const t=JSON.stringify(e,null,2),n=new Blob([t],{type:"application/json"}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r,o.download="".concat(a||Jh(),".json"),document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(r),x()}),[a]),M=(0,r.useCallback)((async()=>{if(N){d(""),m(!0);try{const e=[];for await(const{url:t,id:n}of N){const r=await fetch(t),a=await r.json();if(r.ok)a.vmui={id:n,comment:i,params:rt().parse(new URL(t).search.replace(/^\?/,""))},e.push(a);else{const e=a.errorType?"".concat(a.errorType,"\r\n"):"";d("".concat(e).concat((null===a||void 0===a?void 0:a.error)||(null===a||void 0===a?void 0:a.message)||"unknown error"))}}e.length&&A(e)}catch(Ap){Ap instanceof Error&&"AbortError"!==Ap.name&&d("".concat(Ap.name,": ").concat(Ap.message))}finally{m(!1)}}else d(mt.validQuery)}),[N,i,A,n]),T=e=>()=>{b((t=>t+e))};return(0,r.useEffect)((()=>{d(""),o(Jh()),l("")}),[w]),(0,r.useEffect)((()=>{b(0)}),[S]),Et(St.FK,{children:[Et(da,{title:"Export query",children:Et(ea,{variant:"text",startIcon:Et(_r,{}),onClick:k,ariaLabel:"export query"})}),w&&Et(ua,{title:"Export query",onClose:x,isOpen:w,children:Et("div",{className:"vm-download-report",children:[Et("div",{className:"vm-download-report-settings",children:[Et("div",{ref:p,children:Et(ja,{label:"Filename",value:a,onChange:o})}),Et("div",{ref:f,children:Et(ja,{type:"textarea",label:"Comment",value:i,onChange:l})}),Et("div",{ref:v,children:Et(Yh,{checked:s,onChange:c,label:"Include query trace"})})]}),u&&Et(qr,{variant:"error",children:u}),Et("div",{className:"vm-download-report__buttons",children:[Et(ea,{variant:"text",onClick:C,children:"Help"}),Et("div",{ref:g,children:Et(ea,{onClick:M,disabled:h,children:h?"Loading data...":"Generate Report"})})]}),Et(ta,{open:S,buttonRef:y[_],placement:"top-left",variant:"dark",onClose:E,children:Et("div",{className:"vm-download-report-helper",children:[Et("div",{className:"vm-download-report-helper__description",children:Gh[_]}),Et("div",{className:"vm-download-report-helper__buttons",children:[0!==_&&Et(ea,{onClick:T(-1),size:"small",color:"white",children:"Prev"}),Et(ea,{onClick:_===y.length-1?E:T(1),size:"small",color:"white",variant:"text",children:_===y.length-1?"Close":"Next"})]})]})})]})})]})},em=()=>{Al();const{isMobile:e}=Ur(),{displayType:t}=Ir(),{query:n}=Sn(),{customStep:a}=jr(),o=Hr(),[i,l]=(0,r.useState)([]),[s,c]=(0,r.useState)(!n[0]),[u,d]=(0,r.useState)(!1),h=(0,r.useRef)(null),{fetchUrl:m,isLoading:p,liveData:f,graphData:v,error:g,queryErrors:y,setQueryErrors:_,queryStats:b,warning:w,traces:k,isHistogram:x}=Nl({visible:!0,customStep:a,hideQuery:i,showAllSeries:u}),S=!(null!==f&&void 0!==f&&f.length)&&t!==ht.chart,C=!s&&g;return(0,r.useEffect)((()=>{o({type:"SET_IS_HISTOGRAM",payload:x})}),[v]),Et("div",{className:wr()({"vm-custom-panel":!0,"vm-custom-panel_mobile":e}),children:[Et(bl,{queryErrors:s?[]:y,setQueryErrors:_,setHideError:c,stats:b,onHideQuery:e=>{l(e)},onRunQuery:()=>{c(!1)}}),Et(Fl,{traces:k,displayType:t}),p&&Et(yl,{}),C&&Et(qr,{variant:"error",children:g}),S&&Et(qr,{variant:"info",children:Et(Ol,{})}),w&&Et(jl,{warning:w,query:n,onChange:d}),Et("div",{className:wr()({"vm-custom-panel-body":!0,"vm-custom-panel-body_mobile":e,"vm-block":!0,"vm-block_mobile":e}),children:[Et("div",{className:"vm-custom-panel-body-header",ref:h,children:[Et("div",{className:"vm-custom-panel-body-header__tabs",children:Et(Ar,{})}),(v||f)&&Et(Xh,{fetchUrl:m})]}),Et(Zh,{graphData:v,liveData:f,isHistogram:x,displayType:t,controlsRef:h})]})]})},tm=e=>{let{title:t,description:n,unit:a,expr:o,showLegend:i,filename:l,alias:s}=e;const{isMobile:c}=Ur(),{period:u}=pn(),{customStep:d}=jr(),h=fn(),m=(0,r.useRef)(null),[p,f]=(0,r.useState)(!1),[v,g]=(0,r.useState)(!1),[y,_]=(0,r.useState)({limits:{enable:!1,range:{1:[0,0]}}}),b=(0,r.useMemo)((()=>Array.isArray(o)&&o.every((e=>e))),[o]),{isLoading:w,graphData:k,error:x,warning:S}=Nl({predefinedQuery:b?o:[],display:ht.chart,visible:p,customStep:d}),C=e=>{const t={...y};t.limits.range=e,_(t)};if((0,r.useEffect)((()=>{const e=new IntersectionObserver((e=>{e.forEach((e=>f(e.isIntersecting)))}),{threshold:.1});return m.current&&e.observe(m.current),()=>{m.current&&e.unobserve(m.current)}}),[m]),!b)return Et(qr,{variant:"error",children:[Et("code",{children:'"expr"'})," not found. Check the configuration file ",Et("b",{children:l}),"."]});const E=()=>Et("div",{className:"vm-predefined-panel-header__description vm-default-styles",children:[n&&Et(St.FK,{children:[Et("div",{children:[Et("span",{children:"Description:"}),Et("div",{dangerouslySetInnerHTML:{__html:Xi(n)}})]}),Et("hr",{})]}),Et("div",{children:[Et("span",{children:"Queries:"}),Et("div",{children:o.map(((e,t)=>Et("div",{children:e},"".concat(t,"_").concat(e))))})]})]});return Et("div",{className:"vm-predefined-panel",ref:m,children:[Et("div",{className:"vm-predefined-panel-header",children:[Et(da,{title:Et(E,{}),children:Et("div",{className:"vm-predefined-panel-header__info",children:Et(Pn,{})})}),Et("h3",{className:"vm-predefined-panel-header__title",children:t||""}),Et(Hh,{yaxis:y,setYaxisLimits:C,toggleEnableLimits:()=>{const e={...y};e.limits.enable=!e.limits.enable,_(e)},spanGaps:{value:v,onChange:g}})]}),Et("div",{className:"vm-predefined-panel-body",children:[w&&Et(yl,{}),x&&Et(qr,{variant:"error",children:x}),S&&Et(qr,{variant:"warning",children:S}),k&&Et(Dh,{data:k,period:u,customStep:d,query:o,yaxis:y,unit:a,alias:s,showLegend:i,setYaxisLimits:C,setPeriod:e=>{let{from:t,to:n}=e;h({type:"SET_PERIOD",payload:{from:t,to:n}})},fullWidth:!1,height:c?.5*window.innerHeight:500,spanGaps:v})]})]})},nm=e=>{let{index:t,title:n,panels:a,filename:o}=e;const i=Cr(),l=(0,r.useMemo)((()=>i.width/12),[i]),[s,c]=(0,r.useState)(!t),[u,d]=(0,r.useState)([]);(0,r.useEffect)((()=>{d(a&&a.map((e=>e.width||12)))}),[a]);const[h,m]=(0,r.useState)({start:0,target:0,enable:!1}),p=(0,r.useCallback)((e=>{if(!h.enable)return;const{start:t}=h,n=Math.ceil((t-e.clientX)/l);if(Math.abs(n)>=12)return;const r=u.map(((e,t)=>e-(t===h.target?n:0)));d(r)}),[h,l]),f=(0,r.useCallback)((()=>{m({...h,enable:!1})}),[h]),v=e=>t=>{((e,t)=>{m({start:e.clientX,target:t,enable:!0})})(t,e)};Sr("mousemove",p),Sr("mouseup",f);return Et("div",{className:"vm-predefined-dashboard",children:Et(mo,{defaultExpanded:s,onChange:e=>c(e),title:Et((()=>Et("div",{className:wr()({"vm-predefined-dashboard-header":!0,"vm-predefined-dashboard-header_open":s}),children:[(n||o)&&Et("span",{className:"vm-predefined-dashboard-header__title",children:n||"".concat(t+1,". ").concat(o)}),a&&Et("span",{className:"vm-predefined-dashboard-header__count",children:["(",a.length," panels)"]})]})),{}),children:Et("div",{className:"vm-predefined-dashboard-panels",children:Array.isArray(a)&&a.length?a.map(((e,t)=>Et("div",{className:"vm-predefined-dashboard-panels-panel vm-block vm-block_empty-padding",style:{gridColumn:"span ".concat(u[t])},children:[Et(tm,{title:e.title,description:e.description,unit:e.unit,expr:e.expr,alias:e.alias,filename:o,showLegend:e.showLegend}),Et("button",{className:"vm-predefined-dashboard-panels-panel__resizer",onMouseDown:v(t),"aria-label":"resize the panel"})]},t))):Et("div",{className:"vm-predefined-dashboard-panels-panel__alert",children:Et(qr,{variant:"error",children:[Et("code",{children:'"panels"'})," not found. Check the configuration file ",Et("b",{children:o}),"."]})})})})})};function rm(e){return function(e,t){return Object.fromEntries(Object.entries(e).filter(t))}(e,(e=>!!e[1]||"number"===typeof e[1]))}const am=()=>{(()=>{const{duration:e,relativeTime:t,period:{date:n}}=pn(),{customStep:a}=jr(),{setSearchParamsFromKeys:o}=ro(),i=()=>{const r=rm({"g0.range_input":e,"g0.end_input":n,"g0.step_input":a,"g0.relative_time":t});o(r)};(0,r.useEffect)(i,[e,t,n,a]),(0,r.useEffect)(i,[])})();const{isMobile:e}=Ur(),{dashboardsSettings:t,dashboardsLoading:n,dashboardsError:a}=Zr(),[o,i]=(0,r.useState)(0),l=(0,r.useMemo)((()=>t.map(((e,t)=>({label:e.title||"",value:t})))),[t]),s=(0,r.useMemo)((()=>t[o]||{}),[t,o]),c=(0,r.useMemo)((()=>null===s||void 0===s?void 0:s.rows),[s]),u=(0,r.useMemo)((()=>s.title||s.filename||""),[s]),d=(0,r.useMemo)((()=>Array.isArray(c)&&!!c.length),[c]),h=e=>()=>{(e=>{i(e)})(e)};return Et("div",{className:"vm-predefined-panels",children:[n&&Et(yl,{}),!t.length&&a&&Et(qr,{variant:"error",children:a}),!t.length&&Et(qr,{variant:"info",children:"Dashboards not found"}),l.length>1&&Et("div",{className:wr()({"vm-predefined-panels-tabs":!0,"vm-predefined-panels-tabs_mobile":e}),children:l.map((e=>Et("div",{className:wr()({"vm-predefined-panels-tabs__tab":!0,"vm-predefined-panels-tabs__tab_active":e.value==o}),onClick:h(e.value),children:e.label},e.value)))}),Et("div",{className:"vm-predefined-panels__dashboards",children:[d&&c.map(((e,t)=>Et(nm,{index:t,filename:u,title:e.title,panels:e.panels},"".concat(o,"_").concat(t)))),!!t.length&&!d&&Et(qr,{variant:"error",children:[Et("code",{children:'"rows"'})," not found. Check the configuration file ",Et("b",{children:u}),"."]})]})]})},om=(e,t)=>{const n=t.match?"&match[]="+encodeURIComponent(t.match):"",r=t.focusLabel?"&focusLabel="+encodeURIComponent(t.focusLabel):"";return"".concat(e,"/api/v1/status/tsdb?topN=").concat(t.topN,"&date=").concat(t.date).concat(n).concat(r)};class im{constructor(){this.tsdbStatus=void 0,this.tabsNames=void 0,this.isPrometheus=void 0,this.tsdbStatus=this.defaultTSDBStatus,this.tabsNames=["table","graph"],this.isPrometheus=!1,this.getDefaultState=this.getDefaultState.bind(this)}set tsdbStatusData(e){this.isPrometheus=!(null===e||void 0===e||!e.headStats),this.tsdbStatus=e}get tsdbStatusData(){return this.tsdbStatus}get defaultTSDBStatus(){return{totalSeries:0,totalSeriesPrev:0,totalSeriesByAll:0,totalLabelValuePairs:0,seriesCountByMetricName:[],seriesCountByLabelName:[],seriesCountByFocusLabelValue:[],seriesCountByLabelValuePair:[],labelValueCountByLabelName:[]}}get isPrometheusData(){return this.isPrometheus}keys(e,t){const n=e&&/__name__=".+"/.test(e),r=e&&/{.+=".+"}/g.test(e),a=e&&/__name__=".+", .+!=""/g.test(e);let o=[];return o=t||a?o.concat("seriesCountByFocusLabelValue"):n?o.concat("labelValueCountByLabelName"):r?o.concat("seriesCountByMetricName","seriesCountByLabelName"):o.concat("seriesCountByMetricName","seriesCountByLabelName","seriesCountByLabelValuePair","labelValueCountByLabelName"),o}getDefaultState(e,t){return this.keys(e,t).reduce(((e,t)=>({...e,tabs:{...e.tabs,[t]:this.tabsNames},containerRefs:{...e.containerRefs,[t]:(0,r.useRef)(null)}})),{tabs:{},containerRefs:{}})}sectionsTitles(e){return{seriesCountByMetricName:"Metric names with the highest number of series",seriesCountByLabelName:"Labels with the highest number of series",seriesCountByFocusLabelValue:'Values for "'.concat(e,'" label with the highest number of series'),seriesCountByLabelValuePair:"Label=value pairs with the highest number of series",labelValueCountByLabelName:"Labels with the highest number of unique values"}}get sectionsTips(){return{seriesCountByMetricName:"\n <p>\n This table returns a list of metrics with the highest cardinality.\n The cardinality of a metric is the number of time series associated with that metric,\n where each time series is defined as a unique combination of key-value label pairs.\n </p>\n <p>\n When looking to reduce the number of active series in your data source,\n you can start by inspecting individual metrics with high cardinality\n (i.e. that have lots of active time series associated with them),\n since that single metric contributes a large fraction of the series that make up your total series count.\n </p>",seriesCountByLabelName:"\n <p>\n This table returns a list of the labels with the highest number of series.\n </p>\n <p>\n Use this table to identify labels that are storing dimensions with high cardinality\n (many different label values).\n </p>\n <p>\n It is recommended to choose labels such that they have a finite set of values,\n since every unique combination of key-value label pairs creates a new time series\n and therefore can dramatically increase the number of time series in your system.\n </p>",seriesCountByFocusLabelValue:"\n <p>\n This table returns a list of unique label values per selected label.\n </p>\n <p>\n Use this table to identify label values that are storing per each selected series.\n </p>",labelValueCountByLabelName:"\n <p>\n This table returns a list of labels with the highest number of the unique values.\n </p>\n ",seriesCountByLabelValuePair:"\n <p>\n This table returns a list of the label values pairs with the highest number of series.\n </p>\n <p>\n Use this table to identify unique label values pairs. This helps to identify same labels \n is applied to count timeseries in your system, since every unique combination of key-value label pairs \n creates a new time series and therefore can dramatically increase the number of time series in your system\n </p>"}}get tablesHeaders(){return{seriesCountByMetricName:lm,seriesCountByLabelName:sm,seriesCountByFocusLabelValue:cm,seriesCountByLabelValuePair:um,labelValueCountByLabelName:dm}}totalSeries(e){return"labelValueCountByLabelName"===e?-1:arguments.length>1&&void 0!==arguments[1]&&arguments[1]?this.tsdbStatus.totalSeriesPrev:this.tsdbStatus.totalSeries}}const lm=[{id:"name",label:"Metric name"},{id:"value",label:"Number of series"},{id:"percentage",label:"Share in total",info:"Shows the share of a metric to the total number of series"},{id:"action",label:""}],sm=[{id:"name",label:"Label name"},{id:"value",label:"Number of series"},{id:"percentage",label:"Share in total",info:"Shows the share of the label to the total number of series"},{id:"action",label:""}],cm=[{id:"name",label:"Label value"},{id:"value",label:"Number of series"},{id:"percentage",label:"Share in total"},{disablePadding:!1,id:"action",label:"",numeric:!1}],um=[{id:"name",label:"Label=value pair"},{id:"value",label:"Number of series"},{id:"percentage",label:"Share in total",info:"Shows the share of the label value pair to the total number of series"},{id:"action",label:""}],dm=[{id:"name",label:"Label name"},{id:"value",label:"Number of unique values"},{id:"action",label:""}],hm=()=>{const e=new im,[t]=je(),n=t.get("match"),a=t.get("focusLabel"),i=+(t.get("topN")||10),l=t.get("date")||o()().tz().format(Lt),s=Va(l),c=(0,r.useRef)(),{serverUrl:u}=At(),[d,h]=(0,r.useState)(!1),[m,p]=(0,r.useState)(),[f,v]=(0,r.useState)(e.defaultTSDBStatus),[g,y]=(0,r.useState)(!1),_=async e=>{const t=await fetch(e);if(t.ok)return await t.json();throw new Error("Request failed with status ".concat(t.status))},b=async t=>{if(!u)return;p(""),h(!0),v(e.defaultTSDBStatus);const r={...t,date:t.date,topN:0,match:"",focusLabel:""},a={...t,date:o()(t.date).subtract(1,"day").format(Lt)},i=[om(u,t),om(u,a)];s!==l&&(t.match||t.focusLabel)&&i.push(om(u,r));try{var d,m,g,y,b,w,k,x,S,C;const[e,t,r]=await Promise.all(i.map(_)),a={...t.data},{data:o}=r||c.current||e;c.current={data:o};const l={...e.data,totalSeries:(null===(d=e.data)||void 0===d?void 0:d.totalSeries)||(null===(m=e.data)||void 0===m||null===(g=m.headStats)||void 0===g?void 0:g.numSeries)||0,totalLabelValuePairs:(null===(y=e.data)||void 0===y?void 0:y.totalLabelValuePairs)||(null===(b=e.data)||void 0===b||null===(w=b.headStats)||void 0===w?void 0:w.numLabelValuePairs)||0,seriesCountByLabelName:(null===(k=e.data)||void 0===k?void 0:k.seriesCountByLabelName)||[],seriesCountByFocusLabelValue:(null===(x=e.data)||void 0===x?void 0:x.seriesCountByFocusLabelValue)||[],totalSeriesByAll:(null===o||void 0===o?void 0:o.totalSeries)||(null===o||void 0===o||null===(S=o.headStats)||void 0===S?void 0:S.numSeries)||f.totalSeriesByAll||0,totalSeriesPrev:(null===a||void 0===a?void 0:a.totalSeries)||(null===a||void 0===a||null===(C=a.headStats)||void 0===C?void 0:C.numSeries)||0},s=null===n||void 0===n?void 0:n.replace(/[{}"]/g,"");l.seriesCountByLabelValuePair=l.seriesCountByLabelValuePair.filter((e=>e.name!==s)),((e,t)=>{Object.keys(e).forEach((n=>{const r=n,a=e[r],o=t[r];Array.isArray(a)&&Array.isArray(o)&&a.forEach((e=>{var t;const n=null===(t=o.find((t=>t.name===e.name)))||void 0===t?void 0:t.value;e.diff=n?e.value-n:0,e.valuePrev=n||0}))}))})(l,a),v(l),h(!1)}catch(Ap){h(!1),Ap instanceof Error&&p("".concat(Ap.name,": ").concat(Ap.message))}};return(0,r.useEffect)((()=>{b({topN:i,match:n,date:l,focusLabel:a})}),[u,n,a,i,l]),(0,r.useEffect)((()=>{m&&(v(e.defaultTSDBStatus),h(!1))}),[m]),(0,r.useEffect)((()=>{const e=Ge(u);y(!!e)}),[u]),e.tsdbStatusData=f,{isLoading:d,appConfigurator:e,error:m,isCluster:g}},mm={seriesCountByMetricName:e=>{let{query:t}=e;return pm("__name__",t)},seriesCountByLabelName:e=>{let{query:t}=e;return"{".concat(t,'!=""}')},seriesCountByFocusLabelValue:e=>{let{query:t,focusLabel:n}=e;return pm(n,t)},seriesCountByLabelValuePair:e=>{let{query:t}=e;const n=t.split("="),r=n[0],a=n.slice(1).join("=");return pm(r,a)},labelValueCountByLabelName:e=>{let{query:t,match:n}=e;return""===n?"{".concat(t,'!=""}'):"".concat(n.replace("}",""),", ").concat(t,'!=""}')}},pm=(e,t)=>e?"{"+e+"="+JSON.stringify(t)+"}":"",fm=e=>{var t;let{totalSeries:n=0,totalSeriesPrev:r=0,totalSeriesAll:a=0,seriesCountByMetricName:o=[],isPrometheus:i}=e;const{isMobile:l}=Ur(),[s]=je(),c=s.get("match"),u=s.get("focusLabel"),d=/__name__/.test(c||""),h=(null===(t=o[0])||void 0===t?void 0:t.value)/a*100,m=n-r,p=Math.abs(m)/r*100,f=[{title:"Total series",value:n.toLocaleString("en-US"),dynamic:n&&r&&!i?"".concat(p.toFixed(2),"%"):"",display:!u,info:'The total number of active time series. \n A time series is uniquely identified by its name plus a set of its labels. \n For example, temperature{city="NY",country="US"} and temperature{city="SF",country="US"} \n are two distinct series, since they differ by the city label.'},{title:"Percentage from total",value:isNaN(h)?"-":"".concat(h.toFixed(2),"%"),display:d,info:"The share of these series in the total number of time series."}].filter((e=>e.display));return f.length?Et("div",{className:wr()({"vm-cardinality-totals":!0,"vm-cardinality-totals_mobile":l}),children:f.map((e=>{let{title:t,value:n,info:a,dynamic:o}=e;return Et("div",{className:"vm-cardinality-totals-card",children:[Et("h4",{className:"vm-cardinality-totals-card__title",children:[t,a&&Et(da,{title:Et("p",{className:"vm-cardinality-totals-card__tooltip",children:a}),children:Et("div",{className:"vm-cardinality-totals-card__info-icon",children:Et(Pn,{})})})]}),Et("span",{className:"vm-cardinality-totals-card__value",children:n}),!!o&&Et(da,{title:"in relation to the previous day: ".concat(r.toLocaleString("en-US")),children:Et("span",{className:wr()({"vm-dynamic-number":!0,"vm-dynamic-number_positive vm-dynamic-number_down":m<0,"vm-dynamic-number_negative vm-dynamic-number_up":m>0}),children:o})})]},t)}))}):null},vm=(e,t)=>{const[n]=je(),a=n.get(t)?n.get(t):e,[o,i]=(0,r.useState)(a);return(0,r.useEffect)((()=>{a!==o&&i(a)}),[a]),[o,i]},gm=e=>{let{isPrometheus:t,isCluster:n,...a}=e;const{isMobile:o}=Ur(),[i]=je(),{setSearchParamsFromKeys:l}=ro(),s=i.get("tips")||"",[c,u]=vm("","match"),[d,h]=vm("","focusLabel"),[m,p]=vm(10,"topN"),f=(0,r.useMemo)((()=>m<0?"Number must be bigger than zero":""),[m]),v=()=>{l({match:c,topN:m,focusLabel:d})};return(0,r.useEffect)((()=>{const e=i.get("match"),t=+(i.get("topN")||10),n=i.get("focusLabel");e!==c&&u(e||""),t!==m&&p(t),n!==d&&h(n||"")}),[i]),Et("div",{className:wr()({"vm-cardinality-configurator":!0,"vm-cardinality-configurator_mobile":o,"vm-block":!0,"vm-block_mobile":o}),children:[Et("div",{className:"vm-cardinality-configurator-controls",children:[Et("div",{className:"vm-cardinality-configurator-controls__query",children:Et(ja,{label:"Time series selector",type:"string",value:c,onChange:u,onEnter:v})}),Et("div",{className:"vm-cardinality-configurator-controls__item",children:Et(ja,{label:"Focus label",type:"text",value:d||"",onChange:h,onEnter:v,endIcon:Et(da,{title:Et("div",{children:Et("p",{children:"To identify values with the highest number of series for the selected label."})}),children:Et(lr,{})})})}),Et("div",{className:"vm-cardinality-configurator-controls__item vm-cardinality-configurator-controls__item_limit",children:Et(ja,{label:"Limit entries",type:"number",value:t?10:m,error:f,disabled:t,helperText:t?"not available for Prometheus":"",onChange:e=>{const t=+e;p(isNaN(t)?0:t)},onEnter:v})})]}),Et("div",{className:"vm-cardinality-configurator-bottom",children:[Et(fm,{isPrometheus:t,isCluster:n,...a}),n&&Et("div",{className:"vm-cardinality-configurator-bottom-helpful",children:Et(Ml,{href:"https://docs.victoriametrics.com/Single-server-VictoriaMetrics.html#cardinality-explorer-statistic-inaccuracy",withIcon:!0,children:[Et(or,{}),"Statistic inaccuracy explanation"]})}),Et("div",{className:"vm-cardinality-configurator-bottom-helpful",children:Et(Ml,{href:"https://docs.victoriametrics.com/#cardinality-explorer",withIcon:!0,children:[Et(or,{}),"Documentation"]})}),Et("div",{className:"vm-cardinality-configurator-bottom__execute",children:[Et(da,{title:s?"Hide tips":"Show tips",children:Et(ea,{variant:"text",color:s?"warning":"gray",startIcon:Et(dr,{}),onClick:()=>{const e=i.get("tips")||"";l({tips:e?"":"true"})},ariaLabel:"visibility tips"})}),Et(ea,{variant:"text",startIcon:Et(On,{}),onClick:()=>{l({match:"",focusLabel:""})},children:"Reset"}),Et(ea,{startIcon:Et(Bn,{}),onClick:v,children:"Execute Query"})]})]})]})};function ym(e){const{order:t,orderBy:n,onRequestSort:r,headerCells:a}=e;return Et("thead",{className:"vm-table-header vm-cardinality-panel-table__header",children:Et("tr",{className:"vm-table__row vm-table__row_header",children:a.map((e=>{return Et("th",{className:wr()({"vm-table-cell vm-table-cell_header":!0,"vm-table-cell_sort":"action"!==e.id&&"percentage"!==e.id,"vm-table-cell_right":"action"===e.id}),onClick:(a=e.id,e=>{r(e,a)}),children:Et("div",{className:"vm-table-cell__content",children:[e.info?Et(da,{title:e.info,children:[Et("div",{className:"vm-metrics-content-header__tip-icon",children:Et(Pn,{})}),e.label]}):Et(St.FK,{children:e.label}),"action"!==e.id&&"percentage"!==e.id&&Et("div",{className:wr()({"vm-table__sort-icon":!0,"vm-table__sort-icon_active":n===e.id,"vm-table__sort-icon_desc":"desc"===t&&n===e.id}),children:Et(jn,{})})]})},e.id);var a}))})})}const _m=["date","timestamp","time"];function bm(e,t,n){const r=e[n],a=t[n],i=_m.includes("".concat(n))?o()("".concat(r)).unix():r,l=_m.includes("".concat(n))?o()("".concat(a)).unix():a;return l<i?-1:l>i?1:0}function wm(e,t){return"desc"===e?(e,n)=>bm(e,n,t):(e,n)=>-bm(e,n,t)}function km(e,t){const n=e.map(((e,t)=>[e,t]));return n.sort(((e,n)=>{const r=t(e[0],n[0]);return 0!==r?r:e[1]-n[1]})),n.map((e=>e[0]))}const xm=e=>{let{rows:t,headerCells:n,defaultSortColumn:a,tableCells:o}=e;const[i,l]=(0,r.useState)("desc"),[s,c]=(0,r.useState)(a),u=km(t,wm(i,s));return Et("table",{className:"vm-table vm-cardinality-panel-table",children:[Et(ym,{order:i,orderBy:s,onRequestSort:(e,t)=>{l(s===t&&"asc"===i?"desc":"asc"),c(t)},rowCount:t.length,headerCells:n}),Et("tbody",{className:"vm-table-header",children:u.map((e=>Et("tr",{className:"vm-table__row",children:o(e)},e.name)))})]})},Sm=e=>{let{row:t,totalSeries:n,totalSeriesPrev:r,onActionClick:a}=e;const o=n>0?t.value/n*100:-1,i=r>0?t.valuePrev/r*100:-1,l=[o,i].some((e=>-1===e)),s=o-i,c=l?"":"".concat(s.toFixed(2),"%"),u=()=>{a(t.name)};return Et(St.FK,{children:[Et("td",{className:"vm-table-cell",children:Et("span",{className:"vm-link vm-link_colored",onClick:u,children:t.name})},t.name),Et("td",{className:"vm-table-cell",children:[t.value,!!t.diff&&Et(da,{title:"in relation to the previous day: ".concat(t.valuePrev),children:Et("span",{className:wr()({"vm-dynamic-number":!0,"vm-dynamic-number_positive":t.diff<0,"vm-dynamic-number_negative":t.diff>0}),children:["\xa0",t.diff>0?"+":"",t.diff]})})]},t.value),o>0&&Et("td",{className:"vm-table-cell",children:Et("div",{className:"vm-cardinality-panel-table__progress",children:[Et(Pl,{value:o}),c&&Et(da,{title:"in relation to the previous day",children:Et("span",{className:wr()({"vm-dynamic-number":!0,"vm-dynamic-number_positive vm-dynamic-number_down":s<0,"vm-dynamic-number_negative vm-dynamic-number_up":s>0}),children:c})})]})},t.progressValue),Et("td",{className:"vm-table-cell vm-table-cell_right",children:Et("div",{className:"vm-table-cell__content",children:Et(da,{title:"Filter by ".concat(t.name),children:Et(ea,{variant:"text",size:"small",onClick:u,children:Et(qn,{})})})})},"action")]})},Cm=e=>{let{data:t}=e;const[n,a]=(0,r.useState)([]),[o,i]=(0,r.useState)([0,0]);return(0,r.useEffect)((()=>{const e=t.sort(((e,t)=>t.value-e.value)),n=(e=>{const t=e.map((e=>e.value)),n=Math.ceil(t[0]||1),r=n/9;return new Array(11).fill(n+r).map(((e,t)=>Math.round(e-r*t)))})(e);i(n),a(e.map((e=>({...e,percentage:e.value/n[0]*100}))))}),[t]),Et("div",{className:"vm-simple-bar-chart",children:[Et("div",{className:"vm-simple-bar-chart-y-axis",children:o.map((e=>Et("div",{className:"vm-simple-bar-chart-y-axis__tick",children:e},e)))}),Et("div",{className:"vm-simple-bar-chart-data",children:n.map((e=>{let{name:t,value:n,percentage:r}=e;return Et(da,{title:"".concat(t,": ").concat(n),placement:"top-center",children:Et("div",{className:"vm-simple-bar-chart-data-item",style:{maxHeight:"".concat(r||0,"%")}})},"".concat(t,"_").concat(n))}))})]})},Em=e=>{let{rows:t,tabs:n=[],chartContainer:a,totalSeries:o,totalSeriesPrev:i,onActionClick:l,sectionTitle:s,tip:c,tableHeaderCells:u,isPrometheus:d}=e;const{isMobile:h}=Ur(),[m,p]=(0,r.useState)("table"),f=d&&!t.length,v=(0,r.useMemo)((()=>n.map(((e,t)=>({value:e,label:e,icon:Et(0===t?Wn:Yn,{})})))),[n]);return Et("div",{className:wr()({"vm-metrics-content":!0,"vm-metrics-content_mobile":h,"vm-block":!0,"vm-block_mobile":h}),children:[Et("div",{className:"vm-metrics-content-header vm-section-header",children:[Et("h5",{className:wr()({"vm-metrics-content-header__title":!0,"vm-section-header__title":!0,"vm-section-header__title_mobile":h}),children:[!h&&c&&Et(da,{title:Et("p",{dangerouslySetInnerHTML:{__html:c},className:"vm-metrics-content-header__tip"}),children:Et("div",{className:"vm-metrics-content-header__tip-icon",children:Et(Pn,{})})}),s]}),Et("div",{className:"vm-section-header__tabs",children:Et(Er,{activeItem:m,items:v,onChange:p})})]}),f&&Et("div",{className:"vm-metrics-content-prom-data",children:[Et("div",{className:"vm-metrics-content-prom-data__icon",children:Et(Pn,{})}),Et("h3",{className:"vm-metrics-content-prom-data__title",children:"Prometheus Data Limitation"}),Et("p",{className:"vm-metrics-content-prom-data__text",children:["Due to missing data from your Prometheus source, some tables may appear empty.",Et("br",{}),"This does not indicate an issue with your system or our tool."]})]}),!f&&"table"===m&&Et("div",{ref:a,className:wr()({"vm-metrics-content__table":!0,"vm-metrics-content__table_mobile":h}),children:Et(xm,{rows:t,headerCells:u,defaultSortColumn:"value",tableCells:e=>Et(Sm,{row:e,totalSeries:o,totalSeriesPrev:i,onActionClick:l})})}),!f&&"graph"===m&&Et("div",{className:"vm-metrics-content__chart",children:Et(Cm,{data:t.map((e=>{let{name:t,value:n}=e;return{name:t,value:n}}))})})]})},Nm=e=>{let{title:t,children:n}=e;return Et("div",{className:"vm-cardinality-tip",children:[Et("div",{className:"vm-cardinality-tip-header",children:[Et("div",{className:"vm-cardinality-tip-header__tip-icon",children:Et(dr,{})}),Et("h4",{className:"vm-cardinality-tip-header__title",children:t||"Tips"})]}),Et("p",{className:"vm-cardinality-tip__description",children:n})]})},Am=()=>Et(Nm,{title:"Metrics with a high number of series",children:Et("ul",{children:[Et("li",{children:["Identify and eliminate labels with frequently changed values to reduce their\xa0",Et(Ml,{href:"https://docs.victoriametrics.com/FAQ.html#what-is-high-cardinality",children:"cardinality"}),"\xa0and\xa0",Et(Ml,{href:"https://docs.victoriametrics.com/FAQ.html#what-is-high-churn-rate",children:"high churn rate"})]}),Et("li",{children:["Find unused time series and\xa0",Et(Ml,{href:"https://docs.victoriametrics.com/relabeling.html",children:"drop entire metrics"})]}),Et("li",{children:["Aggregate time series before they got ingested into the database via\xa0",Et(Ml,{href:"https://docs.victoriametrics.com/stream-aggregation.html",children:"streaming aggregation"})]})]})}),Mm=()=>Et(Nm,{title:"Labels with a high number of unique values",children:Et("ul",{children:[Et("li",{children:"Decrease the number of unique label values to reduce cardinality"}),Et("li",{children:["Drop the label entirely via\xa0",Et(Ml,{href:"https://docs.victoriametrics.com/relabeling.html",children:"relabeling"})]}),Et("li",{children:"For volatile label values (such as URL path, user session, etc.) consider printing them to the log file instead of adding to time series"})]})}),Tm=()=>Et(Nm,{title:"Dashboard of a single metric",children:[Et("p",{children:"This dashboard helps to understand the cardinality of a single metric."}),Et("p",{children:"Each time series is a unique combination of key-value label pairs. Therefore a label key with many values can create a lot of time series for a particular metric. If you\u2019re trying to decrease the cardinality of a metric, start by looking at the labels with the highest number of values."}),Et("p",{children:"Use the series selector at the top of the page to apply additional filters."})]}),Lm=()=>Et(Nm,{title:"Dashboard of a label",children:[Et("p",{children:"This dashboard helps you understand the count of time series per label."}),Et("p",{children:"Use the selector at the top of the page to pick a label name you\u2019d like to inspect. For the selected label name, you\u2019ll see the label values that have the highest number of series associated with them. So if you\u2019ve chosen `instance` as your label name, you may see that `657` time series have value \u201chost-1\u201d attached to them and `580` time series have value `host-2` attached to them."}),Et("p",{children:"This can be helpful in allowing you to determine where the bulk of your time series are coming from. If the label \u201cinstance=host-1\u201d was applied to 657 series and the label \u201cinstance=host-2\u201d was only applied to 580 series, you\u2019d know, for example, that host-01 was responsible for sending the majority of the time series."})]}),Om=()=>{const{isMobile:e}=Ur(),[t]=je(),{setSearchParamsFromKeys:n}=ro(),r=t.get("tips")||"",a=t.get("match")||"",o=t.get("focusLabel")||"",{isLoading:i,appConfigurator:l,error:s,isCluster:c}=hm(),{tsdbStatusData:u,getDefaultState:d,tablesHeaders:h,sectionsTips:m}=l,p=d(a,o);return Et("div",{className:wr()({"vm-cardinality-panel":!0,"vm-cardinality-panel_mobile":e}),children:[i&&Et(yl,{message:"Please wait while cardinality stats is calculated. \n This may take some time if the db contains big number of time series."}),Et(gm,{isPrometheus:l.isPrometheusData,totalSeries:u.totalSeries,totalSeriesPrev:u.totalSeriesPrev,totalSeriesAll:u.totalSeriesByAll,totalLabelValuePairs:u.totalLabelValuePairs,seriesCountByMetricName:u.seriesCountByMetricName,isCluster:c}),r&&Et("div",{className:"vm-cardinality-panel-tips",children:[!a&&!o&&Et(Am,{}),a&&!o&&Et(Tm,{}),!a&&!o&&Et(Mm,{}),o&&Et(Lm,{})]}),s&&Et(qr,{variant:"error",children:s}),l.keys(a,o).map((e=>{return Et(Em,{sectionTitle:l.sectionsTitles(o)[e],tip:m[e],rows:u[e],onActionClick:(t=e,e=>{const r={match:mm[t]({query:e,focusLabel:o,match:a})};"labelValueCountByLabelName"!==t&&"seriesCountByLabelName"!=t||(r.focusLabel=e),"seriesCountByFocusLabelValue"==t&&(r.focusLabel=""),n(r)}),tabs:p.tabs[e],chartContainer:p.containerRefs[e],totalSeriesPrev:l.totalSeries(e,!0),totalSeries:l.totalSeries(e),tableHeaderCells:h[e],isPrometheus:l.isPrometheusData},e);var t}))]})},Pm=e=>(["topByAvgDuration","topByCount","topBySumDuration"].forEach((t=>{const n=e[t];Array.isArray(n)&&n.forEach((e=>{const t=Xt(1e3*e.timeRangeSeconds);e.url=((e,t)=>{var n;const{query:r,timeRangeSeconds:a}=e,o=["g0.expr=".concat(encodeURIComponent(r))],i=null===(n=nn.find((e=>e.duration===t)))||void 0===n?void 0:n.id;return i&&o.push("g0.relative_time=".concat(i)),a&&o.push("g0.range_input=".concat(t)),"".concat(Ye.home,"?").concat(o.join("&"))})(e,t),e.timeRange=t}))})),e),Im=e=>{let{topN:t,maxLifetime:n}=e;const{serverUrl:a}=At(),{setSearchParamsFromKeys:o}=ro(),[i,l]=(0,r.useState)(null),[s,c]=(0,r.useState)(!1),[u,d]=(0,r.useState)(),h=(0,r.useMemo)((()=>((e,t,n)=>"".concat(e,"/api/v1/status/top_queries?topN=").concat(t||"","&maxLifetime=").concat(n||""))(a,t,n)),[a,t,n]);return{data:i,error:u,loading:s,fetch:async()=>{c(!0),o({topN:t,maxLifetime:n});try{const e=await fetch(h),t=await e.json();l(e.ok?Pm(t):null),d(String(t.error||""))}catch(Ap){Ap instanceof Error&&"AbortError"!==Ap.name&&d("".concat(Ap.name,": ").concat(Ap.message))}c(!1)}}},Rm=e=>{let{rows:t,columns:n,defaultOrderBy:a}=e;const o=hl(),[i,l]=(0,r.useState)(a||"count"),[s,c]=(0,r.useState)("desc"),u=(0,r.useMemo)((()=>km(t,wm(s,i))),[t,i,s]),d=e=>()=>{var t;t=e,c((e=>"asc"===e&&i===t?"desc":"asc")),l(t)},h=e=>{let{query:t}=e;return async()=>{await o(t,"Query has been copied")}};return Et("table",{className:"vm-table",children:[Et("thead",{className:"vm-table-header",children:Et("tr",{className:"vm-table__row vm-table__row_header",children:[n.map((e=>Et("th",{className:"vm-table-cell vm-table-cell_header vm-table-cell_sort",onClick:d(e.sortBy||e.key),children:Et("div",{className:"vm-table-cell__content",children:[e.title||e.key,Et("div",{className:wr()({"vm-table__sort-icon":!0,"vm-table__sort-icon_active":i===e.key,"vm-table__sort-icon_desc":"desc"===s&&i===e.key}),children:Et(jn,{})})]})},e.key))),Et("th",{className:"vm-table-cell vm-table-cell_header"})," "]})}),Et("tbody",{className:"vm-table-body",children:u.map(((e,t)=>Et("tr",{className:"vm-table__row",children:[n.map((t=>Et("td",{className:"vm-table-cell",children:e[t.key]||"-"},t.key))),Et("td",{className:"vm-table-cell vm-table-cell_no-padding",children:Et("div",{className:"vm-top-queries-panels__table-actions",children:[e.url&&Et(da,{title:"Execute query",children:Et(Ie,{to:e.url,target:"_blank",rel:"noreferrer","aria-disabled":!0,children:Et(ea,{variant:"text",size:"small",startIcon:Et(qn,{}),ariaLabel:"execute query"})})}),Et(da,{title:"Copy query",children:Et(ea,{variant:"text",size:"small",startIcon:Et(nr,{}),onClick:h(e),ariaLabel:"copy query"})})]})})]},t)))})]})},Dm=["table","JSON"].map(((e,t)=>({value:String(t),label:e,icon:Et(0===t?Wn:Kn,{})}))),zm=e=>{let{rows:t,title:n,columns:a,defaultOrderBy:o}=e;const{isMobile:i}=Ur(),[l,s]=(0,r.useState)(0);return Et("div",{className:wr()({"vm-top-queries-panel":!0,"vm-block":!0,"vm-block_mobile":i}),children:[Et("div",{className:wr()({"vm-top-queries-panel-header":!0,"vm-section-header":!0,"vm-top-queries-panel-header_mobile":i}),children:[Et("h5",{className:wr()({"vm-section-header__title":!0,"vm-section-header__title_mobile":i}),children:n}),Et("div",{className:"vm-section-header__tabs",children:Et(Er,{activeItem:String(l),items:Dm,onChange:e=>{s(+e)}})})]}),Et("div",{className:wr()({"vm-top-queries-panel__table":!0,"vm-top-queries-panel__table_mobile":i}),children:[0===l&&Et(Rm,{rows:t,columns:a,defaultOrderBy:o}),1===l&&Et($h,{data:t})]})]})},Fm=()=>{const{isMobile:e}=Ur(),[t,n]=vm(10,"topN"),[a,i]=vm("10m","maxLifetime"),{data:l,error:s,loading:c,fetch:u}=Im({topN:t,maxLifetime:a}),d=(0,r.useMemo)((()=>{const e=a.trim().split(" ").reduce(((e,t)=>{const n=Wt(t);return n?{...e,...n}:{...e}}),{});return!!o().duration(e).asMilliseconds()}),[a]),h=(0,r.useMemo)((()=>!!t&&t<1),[t]),m=(0,r.useMemo)((()=>h?"Number must be bigger than zero":""),[h]),p=(0,r.useMemo)((()=>d?"":"Invalid duration value"),[d]),f=e=>{if(!l)return e;const t=l[e];return"number"===typeof t?Hd(t,t,t):t||e},v=e=>{"Enter"===e.key&&u()};return(0,r.useEffect)((()=>{l&&(t||n(+l.topN),a||i(l.maxLifetime))}),[l]),(0,r.useEffect)((()=>(u(),window.addEventListener("popstate",u),()=>{window.removeEventListener("popstate",u)})),[]),Et("div",{className:wr()({"vm-top-queries":!0,"vm-top-queries_mobile":e}),children:[c&&Et(yl,{containerStyles:{height:"500px"}}),Et("div",{className:wr()({"vm-top-queries-controls":!0,"vm-block":!0,"vm-block_mobile":e}),children:[Et("div",{className:"vm-top-queries-controls-fields",children:[Et("div",{className:"vm-top-queries-controls-fields__item",children:Et(ja,{label:"Max lifetime",value:a,error:p,helperText:"For example ".concat("30ms, 15s, 3d4h, 1y2w"),onChange:e=>{i(e)},onKeyDown:v})}),Et("div",{className:"vm-top-queries-controls-fields__item",children:Et(ja,{label:"Number of returned queries",type:"number",value:t||"",error:m,onChange:e=>{n(+e)},onKeyDown:v})})]}),Et("div",{className:wr()({"vm-top-queries-controls-bottom":!0,"vm-top-queries-controls-bottom_mobile":e}),children:[Et("div",{className:"vm-top-queries-controls-bottom__info",children:["VictoriaMetrics tracks the last\xa0",Et(da,{title:"search.queryStats.lastQueriesCount",children:Et("b",{children:f("search.queryStats.lastQueriesCount")})}),"\xa0queries with durations at least\xa0",Et(da,{title:"search.queryStats.minQueryDuration",children:Et("b",{children:f("search.queryStats.minQueryDuration")})})]}),Et("div",{className:"vm-top-queries-controls-bottom__button",children:Et(ea,{startIcon:Et(Bn,{}),onClick:u,children:"Execute"})})]})]}),s&&Et(qr,{variant:"error",children:s}),l&&Et(St.FK,{children:Et("div",{className:"vm-top-queries-panels",children:[Et(zm,{rows:l.topBySumDuration,title:"Queries with most summary time to execute",columns:[{key:"query"},{key:"sumDurationSeconds",title:"sum duration, sec"},{key:"timeRange",sortBy:"timeRangeSeconds",title:"query time interval"},{key:"count"}],defaultOrderBy:"sumDurationSeconds"}),Et(zm,{rows:l.topByAvgDuration,title:"Most heavy queries",columns:[{key:"query"},{key:"avgDurationSeconds",title:"avg duration, sec"},{key:"timeRange",sortBy:"timeRangeSeconds",title:"query time interval"},{key:"count"}],defaultOrderBy:"avgDurationSeconds"}),Et(zm,{rows:l.topByCount,title:"Most frequently executed queries",columns:[{key:"query"},{key:"timeRange",sortBy:"timeRangeSeconds",title:"query time interval"},{key:"count"}]})]})})]})},jm={"color-primary":"#589DF6","color-secondary":"#316eca","color-error":"#e5534b","color-warning":"#c69026","color-info":"#539bf5","color-success":"#57ab5a","color-background-body":"#22272e","color-background-block":"#2d333b","color-background-tooltip":"rgba(22, 22, 22, 0.8)","color-text":"#cdd9e5","color-text-secondary":"#768390","color-text-disabled":"#636e7b","box-shadow":"rgba(0, 0, 0, 0.16) 1px 2px 6px","box-shadow-popper":"rgba(0, 0, 0, 0.2) 0px 2px 8px 0px","border-divider":"1px solid rgba(99, 110, 123, 0.5)","color-hover-black":"rgba(0, 0, 0, 0.12)","color-log-hits-bar":"rgba(255, 255, 255, 0.18)"},Hm={"color-primary":"#3F51B5","color-secondary":"#E91E63","color-error":"#FD080E","color-warning":"#FF8308","color-info":"#03A9F4","color-success":"#4CAF50","color-background-body":"#FEFEFF","color-background-block":"#FFFFFF","color-background-tooltip":"rgba(80,80,80,0.9)","color-text":"#110f0f","color-text-secondary":"#706F6F","color-text-disabled":"#A09F9F","box-shadow":"rgba(0, 0, 0, 0.08) 1px 2px 6px","box-shadow-popper":"rgba(0, 0, 0, 0.1) 0px 2px 8px 0px","border-divider":"1px solid rgba(0, 0, 0, 0.15)","color-hover-black":"rgba(0, 0, 0, 0.06)","color-log-hits-bar":"rgba(0, 0, 0, 0.18)"},Vm=()=>{const[e,t]=(0,r.useState)(yt()),n=e=>{t(e.matches)};return(0,r.useEffect)((()=>{const e=window.matchMedia("(prefers-color-scheme: dark)");return e.addEventListener("change",n),()=>e.removeEventListener("change",n)}),[]),e},$m=["primary","secondary","error","warning","info","success"],Um=e=>{let{onLoaded:t}=e;const n=Ke(),{palette:a={}}=We(),{theme:o}=At(),i=Vm(),l=Mt(),s=Cr(),[c,u]=(0,r.useState)({[pt.dark]:jm,[pt.light]:Hm,[pt.system]:yt()?jm:Hm}),d=()=>{const{innerWidth:e,innerHeight:t}=window,{clientWidth:n,clientHeight:r}=document.documentElement;gt("scrollbar-width","".concat(e-n,"px")),gt("scrollbar-height","".concat(t-r,"px")),gt("vh","".concat(.01*t,"px"))},h=()=>{$m.forEach(((e,n)=>{const r=(e=>{let t=e.replace("#","").trim();if(3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),6!==t.length)throw new Error("Invalid HEX color.");return(299*parseInt(t.slice(0,2),16)+587*parseInt(t.slice(2,4),16)+114*parseInt(t.slice(4,6),16))/1e3>=128?"#000000":"#FFFFFF"})(vt("color-".concat(e)));gt("".concat(e,"-text"),r),n===$m.length-1&&(l({type:"SET_DARK_THEME"}),t(!0))}))},m=()=>{const e=Xe("THEME")||pt.system,t=c[e];Object.entries(t).forEach((e=>{let[t,n]=e;gt(t,n)})),h(),n&&($m.forEach((e=>{const t=a[e];t&>("color-".concat(e),t)})),h())};return(0,r.useEffect)((()=>{d(),m()}),[c]),(0,r.useEffect)(d,[s]),(0,r.useEffect)((()=>{const e=yt()?jm:Hm;c[pt.system]!==e?u((t=>({...t,[pt.system]:e}))):m()}),[o,i]),(0,r.useEffect)((()=>{n&&l({type:"SET_THEME",payload:pt.light})}),[]),null},Bm=()=>{const[e,t]=(0,r.useState)([]),[n,a]=(0,r.useState)(!1),o=(0,r.useRef)(document.body),i=e=>{e.preventDefault(),e.stopPropagation(),"dragenter"===e.type||"dragover"===e.type?a(!0):"dragleave"===e.type&&a(!1)};return Sr("dragenter",i,o),Sr("dragleave",i,o),Sr("dragover",i,o),Sr("drop",(e=>{var n;e.preventDefault(),e.stopPropagation(),a(!1),null!==e&&void 0!==e&&null!==(n=e.dataTransfer)&&void 0!==n&&n.files&&e.dataTransfer.files[0]&&(e=>{const n=Array.from(e||[]);t(n)})(e.dataTransfer.files)}),o),Sr("paste",(e=>{var n;const r=null===(n=e.clipboardData)||void 0===n?void 0:n.items;if(!r)return;const a=Array.from(r).filter((e=>"application/json"===e.type)).map((e=>e.getAsFile())).filter((e=>null!==e));t(a)}),o),{files:e,dragging:n}},qm=e=>{let{onOpenModal:t,onChange:n}=e;return Et("div",{className:"vm-upload-json-buttons",children:[Et(ea,{variant:"outlined",onClick:t,children:"Paste JSON"}),Et(ea,{children:["Upload Files",Et("input",{id:"json",type:"file",accept:"application/json",multiple:!0,title:" ",onChange:n})]})]})},Ym=()=>{const[e,t]=(0,r.useState)([]),[n,a]=(0,r.useState)([]),o=(0,r.useMemo)((()=>!!e.length),[e]),{value:i,setTrue:l,setFalse:s}=na(!1),c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";a((n=>[{filename:t,text:": ".concat(e.message)},...n]))},u=(e,n)=>{try{const r=JSON.parse(e),a=r.trace||r;if(!a.duration_msec)return void c(new Error(mt.traceNotFound),n);const o=new kl(a,n);t((e=>[o,...e]))}catch(Ap){Ap instanceof Error&&c(Ap,n)}},d=e=>{e.map((e=>{const t=new FileReader,n=(null===e||void 0===e?void 0:e.name)||"";t.onload=e=>{var t;const r=String(null===(t=e.target)||void 0===t?void 0:t.result);u(r,n)},t.readAsText(e)}))},h=e=>{a([]);const t=Array.from(e.target.files||[]);d(t),e.target.value=""},m=e=>()=>{(e=>{a((t=>t.filter(((t,n)=>n!==e))))})(e)},{files:p,dragging:f}=Bm();return(0,r.useEffect)((()=>{d(p)}),[p]),Et("div",{className:"vm-trace-page",children:[Et("div",{className:"vm-trace-page-header",children:[Et("div",{className:"vm-trace-page-header-errors",children:n.map(((e,t)=>Et("div",{className:"vm-trace-page-header-errors-item",children:[Et(qr,{variant:"error",children:[Et("b",{className:"vm-trace-page-header-errors-item__filename",children:e.filename}),Et("span",{children:e.text})]}),Et(ea,{className:"vm-trace-page-header-errors-item__close",startIcon:Et(Ln,{}),variant:"text",color:"error",onClick:m(t)})]},"".concat(e,"_").concat(t))))}),Et("div",{children:o&&Et(qm,{onOpenModal:l,onChange:h})})]}),o&&Et("div",{children:Et(zl,{jsonEditor:!0,traces:e,onDeleteClick:n=>{const r=e.filter((e=>e.idValue!==n.idValue));t([...r])}})}),!o&&Et("div",{className:"vm-trace-page-preview",children:[Et("p",{className:"vm-trace-page-preview__text",children:["Please, upload file with JSON response content.","\n","The file must contain tracing information in JSON format.","\n","In order to use tracing please refer to the doc:\xa0",Et("a",{className:"vm-link vm-link_colored",href:"https://docs.victoriametrics.com/#query-tracing",target:"_blank",rel:"help noreferrer",children:"https://docs.victoriametrics.com/#query-tracing"}),"\n","Tracing graph will be displayed after file upload.","\n","Attach files by dragging & dropping, selecting or pasting them."]}),Et(qm,{onOpenModal:l,onChange:h})]}),i&&Et(ua,{title:"Paste JSON",onClose:s,children:Et(Dl,{editable:!0,displayTitle:!0,defaultTile:"JSON ".concat(e.length+1),onClose:s,onUpload:u})}),f&&Et("div",{className:"vm-trace-page__dropzone"})]})},Wm=e=>{const{serverUrl:t}=At(),{period:n}=pn(),[a,o]=(0,r.useState)([]),[i,l]=(0,r.useState)(!1),[s,c]=(0,r.useState)(),u=(0,r.useMemo)((()=>((e,t,n)=>{const r="{job=".concat(JSON.stringify(n),"}");return"".concat(e,"/api/v1/label/instance/values?match[]=").concat(encodeURIComponent(r),"&start=").concat(t.start,"&end=").concat(t.end)})(t,n,e)),[t,n,e]);return(0,r.useEffect)((()=>{if(!e)return;(async()=>{l(!0);try{const e=await fetch(u),t=await e.json(),n=t.data||[];o(n.sort(((e,t)=>e.localeCompare(t)))),e.ok?c(void 0):c("".concat(t.errorType,"\r\n").concat(null===t||void 0===t?void 0:t.error))}catch(Ap){Ap instanceof Error&&c("".concat(Ap.name,": ").concat(Ap.message))}l(!1)})().catch(console.error)}),[u]),{instances:a,isLoading:i,error:s}},Km=(e,t)=>{const{serverUrl:n}=At(),{period:a}=pn(),[o,i]=(0,r.useState)([]),[l,s]=(0,r.useState)(!1),[c,u]=(0,r.useState)(),d=(0,r.useMemo)((()=>((e,t,n,r)=>{const a=Object.entries({job:n,instance:r}).filter((e=>e[1])).map((e=>{let[t,n]=e;return"".concat(t,"=").concat(JSON.stringify(n))})).join(","),o="{".concat(a,"}");return"".concat(e,"/api/v1/label/__name__/values?match[]=").concat(encodeURIComponent(o),"&start=").concat(t.start,"&end=").concat(t.end)})(n,a,e,t)),[n,a,e,t]);return(0,r.useEffect)((()=>{if(!e)return;(async()=>{s(!0);try{const e=await fetch(d),t=await e.json(),n=t.data||[];i(n.sort(((e,t)=>e.localeCompare(t)))),e.ok?u(void 0):u("".concat(t.errorType,"\r\n").concat(null===t||void 0===t?void 0:t.error))}catch(Ap){Ap instanceof Error&&u("".concat(Ap.name,": ").concat(Ap.message))}s(!1)})().catch(console.error)}),[d]),{names:o,isLoading:l,error:c}},Qm=e=>{let{name:t,job:n,instance:a,rateEnabled:o,isBucket:i,height:l}=e;const{isMobile:s}=Ur(),{customStep:c,yaxis:u}=jr(),{period:d}=pn(),h=Hr(),m=fn(),p=Qt(d.end-d.start),f=Kt(c),v=Xt(10*f*1e3),[g,y]=(0,r.useState)(!1),[_,b]=(0,r.useState)(!1),w=g&&c===p?v:c,k=(0,r.useMemo)((()=>{const e=Object.entries({job:n,instance:a}).filter((e=>e[1])).map((e=>{let[t,n]=e;return"".concat(t,"=").concat(JSON.stringify(n))}));e.push("__name__=".concat(JSON.stringify(t))),"node_cpu_seconds_total"==t&&e.push('mode!="idle"');const r="{".concat(e.join(","),"}");if(i)return"sum(rate(".concat(r,")) by (vmrange, le)");const l=o?"rollup_rate(".concat(r,")"):"rollup(".concat(r,")");return"\nwith (q = ".concat(l,') (\n alias(min(label_match(q, "rollup", "min")), "min"),\n alias(max(label_match(q, "rollup", "max")), "max"),\n alias(avg(label_match(q, "rollup", "avg")), "avg"),\n)')}),[t,n,a,o,i]),{isLoading:x,graphData:S,error:C,queryErrors:E,warning:N,isHistogram:A}=Nl({predefinedQuery:[k],visible:!0,customStep:w,showAllSeries:_});return(0,r.useEffect)((()=>{y(A)}),[A]),Et("div",{className:wr()({"vm-explore-metrics-graph":!0,"vm-explore-metrics-graph_mobile":s}),children:[x&&Et(yl,{}),C&&Et(qr,{variant:"error",children:C}),E[0]&&Et(qr,{variant:"error",children:E[0]}),N&&Et(jl,{warning:N,query:[k],onChange:b}),S&&d&&Et(Dh,{data:S,period:d,customStep:w,query:[k],yaxis:u,setYaxisLimits:e=>{h({type:"SET_YAXIS_LIMITS",payload:e})},setPeriod:e=>{let{from:t,to:n}=e;m({type:"SET_PERIOD",payload:{from:t,to:n}})},showLegend:!1,height:l,isHistogram:A})]})},Zm=e=>{let{name:t,index:n,length:r,isBucket:a,rateEnabled:o,onChangeRate:i,onRemoveItem:l,onChangeOrder:s}=e;const{isMobile:c}=Ur(),{value:u,setTrue:d,setFalse:h}=na(!1),m=()=>{l(t)},p=()=>{s(t,n,n+1)},f=()=>{s(t,n,n-1)};return Et("div",c?{className:"vm-explore-metrics-item-header vm-explore-metrics-item-header_mobile",children:[Et("div",{className:"vm-explore-metrics-item-header__name",children:t}),Et(ea,{variant:"text",size:"small",startIcon:Et(cr,{}),onClick:d,ariaLabel:"open panel settings"}),u&&Et(ua,{title:t,onClose:h,children:Et("div",{className:"vm-explore-metrics-item-header-modal",children:[Et("div",{className:"vm-explore-metrics-item-header-modal-order",children:[Et(ea,{startIcon:Et(Gn,{}),variant:"outlined",onClick:f,disabled:0===n,ariaLabel:"move graph up"}),Et("p",{children:["position:",Et("span",{className:"vm-explore-metrics-item-header-modal-order__index",children:["#",n+1]})]}),Et(ea,{endIcon:Et(Zn,{}),variant:"outlined",onClick:p,disabled:n===r-1,ariaLabel:"move graph down"})]}),!a&&Et("div",{className:"vm-explore-metrics-item-header-modal__rate",children:[Et(sl,{label:Et("span",{children:["enable ",Et("code",{children:"rate()"})]}),value:o,onChange:i,fullWidth:!0}),Et("p",{children:"calculates the average per-second speed of metrics change"})]}),Et(ea,{startIcon:Et(Ln,{}),color:"error",variant:"outlined",onClick:m,fullWidth:!0,children:"Remove graph"})]})})]}:{className:"vm-explore-metrics-item-header",children:[Et("div",{className:"vm-explore-metrics-item-header-order",children:[Et(da,{title:"move graph up",children:Et(ea,{className:"vm-explore-metrics-item-header-order__up",startIcon:Et(Fn,{}),variant:"text",color:"gray",size:"small",onClick:f,ariaLabel:"move graph up"})}),Et("div",{className:"vm-explore-metrics-item-header__index",children:["#",n+1]}),Et(da,{title:"move graph down",children:Et(ea,{className:"vm-explore-metrics-item-header-order__down",startIcon:Et(Fn,{}),variant:"text",color:"gray",size:"small",onClick:p,ariaLabel:"move graph down"})})]}),Et("div",{className:"vm-explore-metrics-item-header__name",children:t}),!a&&Et("div",{className:"vm-explore-metrics-item-header__rate",children:Et(da,{title:"calculates the average per-second speed of metric's change",children:Et(sl,{label:Et("span",{children:["enable ",Et("code",{children:"rate()"})]}),value:o,onChange:i})})}),Et("div",{className:"vm-explore-metrics-item-header__close",children:Et(da,{title:"close graph",children:Et(ea,{startIcon:Et(Ln,{}),variant:"text",color:"gray",size:"small",onClick:m,ariaLabel:"close graph"})})})]})},Gm=e=>{let{name:t,job:n,instance:a,index:o,length:i,size:l,onRemoveItem:s,onChangeOrder:c}=e;const u=(0,r.useMemo)((()=>/_sum?|_total?|_count?/.test(t)),[t]),d=(0,r.useMemo)((()=>/_bucket?/.test(t)),[t]),[h,m]=(0,r.useState)(u),p=Cr(),f=(0,r.useMemo)(l.height,[l,p]);return(0,r.useEffect)((()=>{m(u)}),[n]),Et("div",{className:"vm-explore-metrics-item vm-block vm-block_empty-padding",children:[Et(Zm,{name:t,index:o,length:i,isBucket:d,rateEnabled:h,size:l.id,onChangeRate:m,onRemoveItem:s,onChangeOrder:c}),Et(Qm,{name:t,job:n,instance:a,rateEnabled:h,isBucket:d,height:f},"".concat(t,"_").concat(n,"_").concat(a,"_").concat(h))]})},Jm=e=>{let{values:t,onRemoveItem:n}=e;const{isMobile:r}=Ur();return r?Et("span",{className:"vm-select-input-content__counter",children:["selected ",t.length]}):Et(St.FK,{children:t.map((e=>{return Et("div",{className:"vm-select-input-content__selected",children:[Et("span",{children:e}),Et("div",{onClick:(t=e,e=>{n(t),e.stopPropagation()}),children:Et(Ln,{})})]},e);var t}))})},Xm=e=>{let{value:t,list:n,label:a,placeholder:o,noOptionsText:i,clearable:l=!1,searchable:s=!1,autofocus:c,disabled:u,onChange:d}=e;const{isDarkTheme:h}=At(),{isMobile:m}=Ur(),[p,f]=(0,r.useState)(""),v=(0,r.useRef)(null),[g,y]=(0,r.useState)(null),[_,b]=(0,r.useState)(!1),w=(0,r.useRef)(null),k=Array.isArray(t),x=Array.isArray(t)?t:void 0,S=m&&k&&!(null===x||void 0===x||!x.length),C=(0,r.useMemo)((()=>_?p:Array.isArray(t)?"":t),[t,p,_,k]),E=(0,r.useMemo)((()=>_?p||"(.+)":""),[p,_]),N=()=>{w.current&&w.current.blur()},A=()=>{b(!1),N()},M=e=>{f(""),d(e),k||A(),k&&w.current&&w.current.focus()};return(0,r.useEffect)((()=>{f(""),_&&w.current&&w.current.focus(),_||N()}),[_,w]),(0,r.useEffect)((()=>{c&&w.current&&!m&&w.current.focus()}),[c,w]),Sr("keyup",(e=>{w.current!==e.target&&b(!1)})),Xr(v,A,g),Et("div",{className:wr()({"vm-select":!0,"vm-select_dark":h,"vm-select_disabled":u}),children:[Et("div",{className:"vm-select-input",onClick:e=>{e.target instanceof HTMLInputElement||u||b((e=>!e))},ref:v,children:[Et("div",{className:"vm-select-input-content",children:[!(null===x||void 0===x||!x.length)&&Et(Jm,{values:x,onRemoveItem:M}),!S&&Et("input",{value:C,type:"text",placeholder:o,onInput:e=>{f(e.target.value)},onFocus:()=>{u||b(!0)},onBlur:()=>{n.includes(p)&&d(p)},ref:w,readOnly:m||!s})]}),a&&Et("span",{className:"vm-text-field__label",children:a}),l&&t&&Et("div",{className:"vm-select-input__icon",onClick:(e=>t=>{M(e),t.stopPropagation()})(""),children:Et(Ln,{})}),Et("div",{className:wr()({"vm-select-input__icon":!0,"vm-select-input__icon_open":_}),children:Et(jn,{})})]}),Et(Mo,{label:a,value:E,options:n.map((e=>({value:e}))),anchor:v,selected:x,minLength:1,fullWidth:!0,noOptionsText:i,onSelect:M,onOpenAutocomplete:b,onChangeWrapperRef:y})]})},ep=lt.map((e=>e.id)),tp=e=>{let{jobs:t,instances:n,names:a,job:o,instance:i,size:l,selectedMetrics:s,onChangeJob:c,onChangeInstance:u,onToggleMetric:d,onChangeSize:h}=e;const m=(0,r.useMemo)((()=>o?"":"No instances. Please select job"),[o]),p=(0,r.useMemo)((()=>o?"":"No metric names. Please select job"),[o]),{isMobile:f}=Ur(),{value:v,toggle:g,setFalse:y}=na("false"!==Xe("EXPLORE_METRICS_TIPS"));return(0,r.useEffect)((()=>{Je("EXPLORE_METRICS_TIPS","".concat(v))}),[v]),Et(St.FK,{children:[Et("div",{className:wr()({"vm-explore-metrics-header":!0,"vm-explore-metrics-header_mobile":f,"vm-block":!0,"vm-block_mobile":f}),children:[Et("div",{className:"vm-explore-metrics-header__job",children:Et(Xm,{value:o,list:t,label:"Job",placeholder:"Please select job",onChange:c,autofocus:!o&&!!t.length&&!f,searchable:!0})}),Et("div",{className:"vm-explore-metrics-header__instance",children:Et(Xm,{value:i,list:n,label:"Instance",placeholder:"Please select instance",onChange:u,noOptionsText:m,clearable:!0,searchable:!0})}),Et("div",{className:"vm-explore-metrics-header__size",children:[Et(Xm,{label:"Size graphs",value:l,list:ep,onChange:h}),Et(da,{title:"".concat(v?"Hide":"Show"," tip"),children:Et(ea,{variant:"text",color:v?"warning":"gray",startIcon:Et(dr,{}),onClick:g,ariaLabel:"visibility tips"})})]}),Et("div",{className:"vm-explore-metrics-header-metrics",children:Et(Xm,{label:"Metrics",value:s,list:a,placeholder:"Search metric name",onChange:d,noOptionsText:p,clearable:!0,searchable:!0})})]}),v&&Et(qr,{variant:"warning",children:Et("div",{className:"vm-explore-metrics-header-description",children:[Et("p",{children:["Please note: this page is solely designed for exploring Prometheus metrics. Prometheus metrics always contain ",Et("code",{children:"job"})," and ",Et("code",{children:"instance"})," labels (see ",Et("a",{className:"vm-link vm-link_colored",href:"https://prometheus.io/docs/concepts/jobs_instances/",children:"these docs"}),"), and this page relies on them as filters. ",Et("br",{}),"Please use this page for Prometheus metrics only, in accordance with their naming conventions."]}),Et(ea,{variant:"text",size:"small",startIcon:Et(Ln,{}),onClick:y,ariaLabel:"close tips"})]})})]})},np=ct("job",""),rp=ct("instance",""),ap=ct("metrics",""),op=ct("size",""),ip=lt.find((e=>op?e.id===op:e.isDefault))||lt[0],lp=()=>{const[e,t]=(0,r.useState)(np),[n,a]=(0,r.useState)(rp),[o,i]=(0,r.useState)(ap?ap.split("&"):[]),[l,s]=(0,r.useState)(ip);(e=>{let{job:t,instance:n,metrics:a,size:o}=e;const{duration:i,relativeTime:l,period:{date:s}}=pn(),{customStep:c}=jr(),{setSearchParamsFromKeys:u}=ro(),d=()=>{const e=rm({"g0.range_input":i,"g0.end_input":s,"g0.step_input":c,"g0.relative_time":l,size:o,job:t,instance:n,metrics:a});u(e)};(0,r.useEffect)(d,[i,l,s,c,t,n,a,o]),(0,r.useEffect)(d,[])})({job:e,instance:n,metrics:o.join("&"),size:l.id});const{jobs:c,isLoading:u,error:d}=(()=>{const{serverUrl:e}=At(),{period:t}=pn(),[n,a]=(0,r.useState)([]),[o,i]=(0,r.useState)(!1),[l,s]=(0,r.useState)(),c=(0,r.useMemo)((()=>((e,t)=>"".concat(e,"/api/v1/label/job/values?start=").concat(t.start,"&end=").concat(t.end))(e,t)),[e,t]);return(0,r.useEffect)((()=>{(async()=>{i(!0);try{const e=await fetch(c),t=await e.json(),n=t.data||[];a(n.sort(((e,t)=>e.localeCompare(t)))),e.ok?s(void 0):s("".concat(t.errorType,"\r\n").concat(null===t||void 0===t?void 0:t.error))}catch(Ap){Ap instanceof Error&&s("".concat(Ap.name,": ").concat(Ap.message))}i(!1)})().catch(console.error)}),[c]),{jobs:n,isLoading:o,error:l}})(),{instances:h,isLoading:m,error:p}=Wm(e),{names:f,isLoading:v,error:g}=Km(e,n),y=(0,r.useMemo)((()=>u||m||v),[u,m,v]),_=(0,r.useMemo)((()=>d||p||g),[d,p,g]),b=e=>{i(e?t=>t.includes(e)?t.filter((t=>t!==e)):[...t,e]:[])},w=(e,t,n)=>{const r=n>o.length-1;n<0||r||i((e=>{const r=[...e],[a]=r.splice(t,1);return r.splice(n,0,a),r}))};return(0,r.useEffect)((()=>{n&&h.length&&!h.includes(n)&&a("")}),[h,n]),Et("div",{className:"vm-explore-metrics",children:[Et(tp,{jobs:c,instances:h,names:f,job:e,size:l.id,instance:n,selectedMetrics:o,onChangeJob:t,onChangeSize:e=>{const t=lt.find((t=>t.id===e));t&&s(t)},onChangeInstance:a,onToggleMetric:b}),y&&Et(yl,{}),_&&Et(qr,{variant:"error",children:_}),!e&&Et(qr,{variant:"info",children:"Please select job to see list of metric names."}),e&&!o.length&&Et(qr,{variant:"info",children:"Please select metric names to see the graphs."}),Et("div",{className:"vm-explore-metrics-body",children:o.map(((t,r)=>Et(Gm,{name:t,job:e,instance:n,index:r,length:o.length,size:l,onRemoveItem:b,onChangeOrder:w},t)))})]})},sp=()=>{const t=hl();return Et("div",{className:"vm-preview-icons",children:Object.entries(e).map((e=>{let[n,r]=e;return Et("div",{className:"vm-preview-icons-item",onClick:(a=n,async()=>{await t("<".concat(a,"/>"),"<".concat(a,"/> has been copied"))}),children:[Et("div",{className:"vm-preview-icons-item__svg",children:r()}),Et("div",{className:"vm-preview-icons-item__name",children:"<".concat(n,"/>")})]},n);var a}))})};var cp=function(e){return e.copy="Copy",e.copied="Copied",e}(cp||{});const up=e=>{let{code:t}=e;const[n,a]=(0,r.useState)(cp.copy);return(0,r.useEffect)((()=>{let e=null;return n===cp.copied&&(e=setTimeout((()=>a(cp.copy)),1e3)),()=>{e&&clearTimeout(e)}}),[n]),Et("code",{className:"vm-code-example",children:[t,Et("div",{className:"vm-code-example__copy",children:Et(da,{title:n,children:Et(ea,{size:"small",variant:"text",onClick:()=>{navigator.clipboard.writeText(t),a(cp.copied)},startIcon:Et(nr,{}),ariaLabel:"close"})})})]})},dp=()=>Et("a",{className:"vm-link vm-link_colored",href:"https://docs.victoriametrics.com/MetricsQL.html",target:"_blank",rel:"help noreferrer",children:"MetricsQL"}),hp=()=>Et("a",{className:"vm-link vm-link_colored",href:"https://grafana.com/grafana/dashboards/1860-node-exporter-full/",target:"_blank",rel:"help noreferrer",children:"Node Exporter Full"}),mp=()=>Et("section",{className:"vm-with-template-tutorial",children:[Et("h2",{className:"vm-with-template-tutorial__title",children:["Tutorial for WITH expressions in ",Et(dp,{})]}),Et("div",{className:"vm-with-template-tutorial-section",children:[Et("p",{className:"vm-with-template-tutorial-section__text",children:["Let's look at the following real query from ",Et(hp,{})," dashboard:"]}),Et(up,{code:'(\n (\n node_memory_MemTotal_bytes{instance=~"$node:$port", job=~"$job"}\n -\n node_memory_MemFree_bytes{instance=~"$node:$port", job=~"$job"}\n )\n /\n node_memory_MemTotal_bytes{instance=~"$node:$port", job=~"$job"}\n) * 100'}),Et("p",{className:"vm-with-template-tutorial-section__text",children:"It is clear the query calculates the percentage of used memory for the given $node, $port and $job. Isn't it? :)"})]}),Et("div",{className:"vm-with-template-tutorial-section",children:[Et("p",{className:"vm-with-template-tutorial-section__text",children:"What's wrong with this query? Copy-pasted label filters for distinct timeseries which makes it easy to mistype these filters during modification. Let's simplify the query with WITH expressions:"}),Et(up,{code:'WITH (\n commonFilters = {instance=~"$node:$port",job=~"$job"}\n)\n(\n node_memory_MemTotal_bytes{commonFilters}\n -\n node_memory_MemFree_bytes{commonFilters}\n)\n /\nnode_memory_MemTotal_bytes{commonFilters} * 100'})]}),Et("div",{className:"vm-with-template-tutorial-section",children:[Et("p",{className:"vm-with-template-tutorial-section__text",children:["Now label filters are located in a single place instead of three distinct places. The query mentions node_memory_MemTotal_bytes metric twice and ","{commonFilters}"," three times. WITH expressions may improve this:"]}),Et(up,{code:'WITH (\n my_resource_utilization(free, limit, filters) = (limit{filters} - free{filters}) / limit{filters} * 100\n)\nmy_resource_utilization(\n node_memory_MemFree_bytes,\n node_memory_MemTotal_bytes,\n {instance=~"$node:$port",job=~"$job"},\n)'}),Et("p",{className:"vm-with-template-tutorial-section__text",children:"Now the template function my_resource_utilization() may be used for monitoring arbitrary resources - memory, CPU, network, storage, you name it."})]}),Et("div",{className:"vm-with-template-tutorial-section",children:[Et("p",{className:"vm-with-template-tutorial-section__text",children:["Let's take another nice query from ",Et(hp,{})," dashboard:"]}),Et(up,{code:'(\n (\n (\n count(\n count(node_cpu_seconds_total{instance=~"$node:$port",job=~"$job"}) by (cpu)\n )\n )\n -\n avg(\n sum by (mode) (rate(node_cpu_seconds_total{mode=\'idle\',instance=~"$node:$port",job=~"$job"}[5m]))\n )\n )\n *\n 100\n)\n /\ncount(\n count(node_cpu_seconds_total{instance=~"$node:$port",job=~"$job"}) by (cpu)\n)'}),Et("p",{className:"vm-with-template-tutorial-section__text",children:"Do you understand what does this mess do? Is it manageable? :) WITH expressions are happy to help in a few iterations."})]}),Et("div",{className:"vm-with-template-tutorial-section",children:[Et("p",{className:"vm-with-template-tutorial-section__text",children:"1. Extract common filters used in multiple places into a commonFilters variable:"}),Et(up,{code:'WITH (\n commonFilters = {instance=~"$node:$port",job=~"$job"}\n)\n(\n (\n (\n count(\n count(node_cpu_seconds_total{commonFilters}) by (cpu)\n )\n )\n -\n avg(\n sum by (mode) (rate(node_cpu_seconds_total{mode=\'idle\',commonFilters}[5m]))\n )\n )\n *\n 100\n)\n /\ncount(\n count(node_cpu_seconds_total{commonFilters}) by (cpu)\n)'})]}),Et("div",{className:"vm-with-template-tutorial-section",children:[Et("p",{className:"vm-with-template-tutorial-section__text",children:'2. Extract "count(count(...) by (cpu))" into cpuCount variable:'}),Et(up,{code:'WITH (\n commonFilters = {instance=~"$node:$port",job=~"$job"},\n cpuCount = count(count(node_cpu_seconds_total{commonFilters}) by (cpu))\n)\n(\n (\n cpuCount\n -\n avg(\n sum by (mode) (rate(node_cpu_seconds_total{mode=\'idle\',commonFilters}[5m]))\n )\n )\n *\n 100\n) / cpuCount'})]}),Et("div",{className:"vm-with-template-tutorial-section",children:[Et("p",{className:"vm-with-template-tutorial-section__text",children:"3. Extract rate(...) part into cpuIdle variable, since it is clear now that this part calculates the number of idle CPUs:"}),Et(up,{code:'WITH (\n commonFilters = {instance=~"$node:$port",job=~"$job"},\n cpuCount = count(count(node_cpu_seconds_total{commonFilters}) by (cpu)),\n cpuIdle = sum(rate(node_cpu_seconds_total{mode=\'idle\',commonFilters}[5m]))\n)\n((cpuCount - cpuIdle) * 100) / cpuCount'})]}),Et("div",{className:"vm-with-template-tutorial-section",children:[Et("p",{className:"vm-with-template-tutorial-section__text",children:["4. Put node_cpu_seconds_total","{commonFilters}"," into its own varialbe with the name cpuSeconds:"]}),Et(up,{code:'WITH (\n cpuSeconds = node_cpu_seconds_total{instance=~"$node:$port",job=~"$job"},\n cpuCount = count(count(cpuSeconds) by (cpu)),\n cpuIdle = sum(rate(cpuSeconds{mode=\'idle\'}[5m]))\n)\n((cpuCount - cpuIdle) * 100) / cpuCount'}),Et("p",{className:"vm-with-template-tutorial-section__text",children:"Now the query became more clear comparing to the initial query."})]}),Et("div",{className:"vm-with-template-tutorial-section",children:[Et("p",{className:"vm-with-template-tutorial-section__text",children:"WITH expressions may be nested and may be put anywhere. Try expanding the following query:"}),Et(up,{code:"WITH (\n f(a, b) = WITH (\n f1(x) = b-x,\n f2(x) = x+x\n ) f1(a)*f2(b)\n) f(foo, with(x=bar) x)"})]})]}),pp=()=>{const{serverUrl:e}=At(),[t,n]=je(),[a,o]=(0,r.useState)(""),[i,l]=(0,r.useState)(!1),[s,c]=(0,r.useState)();return{data:a,error:s,loading:i,expand:async r=>{t.set("expr",r),n(t);const a=((e,t)=>"".concat(e,"/expand-with-exprs?query=").concat(encodeURIComponent(t),"&format=json"))(e,r);l(!0);try{const e=await fetch(a),t=await e.json();o((null===t||void 0===t?void 0:t.expr)||""),c(String(t.error||""))}catch(Ap){Ap instanceof Error&&"AbortError"!==Ap.name&&c("".concat(Ap.name,": ").concat(Ap.message))}l(!1)}}},fp=()=>{const[e]=je(),{data:t,loading:n,error:a,expand:o}=pp(),[i,l]=(0,r.useState)(e.get("expr")||""),s=()=>{o(i)};return(0,r.useEffect)((()=>{i&&o(i)}),[]),Et("section",{className:"vm-with-template",children:[n&&Et(yl,{}),Et("div",{className:"vm-with-template-body vm-block",children:[Et("div",{className:"vm-with-template-body__expr",children:Et(ja,{type:"textarea",label:"MetricsQL query with optional WITH expressions",value:i,error:a,autofocus:!0,onEnter:s,onChange:e=>{l(e)}})}),Et("div",{className:"vm-with-template-body__result",children:Et(ja,{type:"textarea",label:"MetricsQL query after expanding WITH expressions and applying other optimizations",value:t,disabled:!0})}),Et("div",{className:"vm-with-template-body-top",children:Et(ea,{variant:"contained",onClick:s,startIcon:Et(Bn,{}),children:"Expand"})})]}),Et("div",{className:"vm-block",children:Et(mp,{})})]})},vp=()=>{const{serverUrl:e}=At(),[t,n]=(0,r.useState)(null),[a,o]=(0,r.useState)(!1),[i,l]=(0,r.useState)();return{data:t,error:i,loading:a,fetchData:async(t,r)=>{const a=((e,t,n)=>{const r=["format=json","relabel_configs=".concat(encodeURIComponent(t)),"metric=".concat(encodeURIComponent(n))];return"".concat(e,"/metric-relabel-debug?").concat(r.join("&"))})(e,t,r);o(!0);try{const e=await fetch(a),t=await e.json();n(t.error?null:t),l(String(t.error||""))}catch(Ap){Ap instanceof Error&&"AbortError"!==Ap.name&&l("".concat(Ap.name,": ").concat(Ap.message))}o(!1)}}},gp={config:'- if: \'{bar_label=~"b.*"}\'\n source_labels: [foo_label, bar_label]\n separator: "_"\n target_label: foobar\n- action: labeldrop\n regex: "foo_.*"\n- target_label: job\n replacement: "my-application-2"',labels:'{__name__="my_metric", bar_label="bar", foo_label="foo", job="my-application", instance="192.168.0.1"}'},yp=()=>{const[e,t]=je(),{data:n,loading:a,error:o,fetchData:i}=vp(),[l,s]=vm("","config"),[c,u]=vm("","labels"),d=(0,r.useCallback)((()=>{i(l,c),e.set("config",l),e.set("labels",c),t(e)}),[l,c]);return(0,r.useEffect)((()=>{const t=e.get("config")||"",n=e.get("labels")||"";(n||t)&&(i(t,n),s(t),u(n))}),[]),Et("section",{className:"vm-relabeling",children:[a&&Et(yl,{}),Et("div",{className:"vm-relabeling-header vm-block",children:[Et("div",{className:"vm-relabeling-header-configs",children:Et(ja,{type:"textarea",label:"Relabel configs",value:l,autofocus:!0,onChange:e=>{s(e||"")},onEnter:d})}),Et("div",{className:"vm-relabeling-header__labels",children:Et(ja,{type:"textarea",label:"Labels",value:c,onChange:e=>{u(e||"")},onEnter:d})}),Et("div",{className:"vm-relabeling-header-bottom",children:[Et("a",{className:"vm-link vm-link_with-icon",target:"_blank",href:"https://docs.victoriametrics.com/relabeling.html",rel:"help noreferrer",children:[Et(Pn,{}),"Relabeling cookbook"]}),Et("a",{className:"vm-link vm-link_with-icon",target:"_blank",href:"https://docs.victoriametrics.com/vmagent.html#relabeling",rel:"help noreferrer",children:[Et(or,{}),"Documentation"]}),Et(ea,{variant:"text",onClick:()=>{const{config:n,labels:r}=gp;s(n),u(r),i(n,r),e.set("config",n),e.set("labels",r),t(e)},children:"Try example"}),Et(ea,{variant:"contained",onClick:d,startIcon:Et(Bn,{}),children:"Submit"})]})]}),o&&Et(qr,{variant:"error",children:o}),n&&Et("div",{className:"vm-relabeling-steps vm-block",children:[n.originalLabels&&Et("div",{className:"vm-relabeling-steps-item",children:Et("div",{className:"vm-relabeling-steps-item__row",children:[Et("span",{children:"Original labels:"}),Et("code",{dangerouslySetInnerHTML:{__html:n.originalLabels}})]})}),n.steps.map(((e,t)=>Et("div",{className:"vm-relabeling-steps-item",children:[Et("div",{className:"vm-relabeling-steps-item__row",children:[Et("span",{children:"Step:"}),t+1]}),Et("div",{className:"vm-relabeling-steps-item__row",children:[Et("span",{children:"Relabeling Rule:"}),Et("code",{children:Et("pre",{children:e.rule})})]}),Et("div",{className:"vm-relabeling-steps-item__row",children:[Et("span",{children:"Input Labels:"}),Et("code",{children:Et("pre",{dangerouslySetInnerHTML:{__html:e.inLabels}})})]}),Et("div",{className:"vm-relabeling-steps-item__row",children:[Et("span",{children:"Output labels:"}),Et("code",{children:Et("pre",{dangerouslySetInnerHTML:{__html:e.outLabels}})})]})]},t))),n.resultingLabels&&Et("div",{className:"vm-relabeling-steps-item",children:Et("div",{className:"vm-relabeling-steps-item__row",children:[Et("span",{children:"Resulting labels:"}),Et("code",{dangerouslySetInnerHTML:{__html:n.resultingLabels}})]})})]})]})},_p=e=>{let{rows:t,columns:n,defaultOrderBy:a,copyToClipboard:o,paginationOffset:i}=e;const[l,s]=(0,r.useState)(a),[c,u]=(0,r.useState)("desc"),[d,h]=(0,r.useState)(null),m=(0,r.useMemo)((()=>{const{startIndex:e,endIndex:n}=i;return km(t,wm(c,l)).slice(e,n)}),[t,l,c,i]),p=(e,t)=>async()=>{if(d!==t)try{await navigator.clipboard.writeText(String(e)),h(t)}catch(Ap){console.error(Ap)}};return(0,r.useEffect)((()=>{if(null===d)return;const e=setTimeout((()=>h(null)),2e3);return()=>clearTimeout(e)}),[d]),Et("table",{className:"vm-table",children:[Et("thead",{className:"vm-table-header",children:Et("tr",{className:"vm-table__row vm-table__row_header",children:[n.map((e=>{return Et("th",{className:"vm-table-cell vm-table-cell_header vm-table-cell_sort",onClick:(t=e.key,()=>{u((e=>"asc"===e&&l===t?"desc":"asc")),s(t)}),children:Et("div",{className:"vm-table-cell__content",children:[Et("div",{children:String(e.title||e.key)}),Et("div",{className:wr()({"vm-table__sort-icon":!0,"vm-table__sort-icon_active":l===e.key,"vm-table__sort-icon_desc":"desc"===c&&l===e.key}),children:Et(jn,{})})]})},String(e.key));var t})),o&&Et("th",{className:"vm-table-cell vm-table-cell_header"})]})}),Et("tbody",{className:"vm-table-body",children:m.map(((e,t)=>Et("tr",{className:"vm-table__row",children:[n.map((t=>Et("td",{className:wr()({"vm-table-cell":!0,["".concat(t.className)]:t.className}),children:e[t.key]||"-"},String(t.key)))),o&&Et("td",{className:"vm-table-cell vm-table-cell_right",children:e[o]&&Et("div",{className:"vm-table-cell__content",children:Et(da,{title:d===t?"Copied":"Copy row",children:Et(ea,{variant:"text",color:d===t?"success":"gray",size:"small",startIcon:Et(d===t?Jn:nr,{}),onClick:p(e[o],t),ariaLabel:"copy row"})})})})]},t)))})]})},bp=()=>{const{isMobile:e}=Ur(),{timezone:t}=pn(),{data:n,lastUpdated:a,isLoading:i,error:l,fetchData:s}=(()=>{const{serverUrl:e}=At(),[t,n]=(0,r.useState)([]),[a,i]=(0,r.useState)(o()().format(Pt)),[l,s]=(0,r.useState)(!1),[c,u]=(0,r.useState)(),d=(0,r.useMemo)((()=>"".concat(e,"/api/v1/status/active_queries")),[e]),h=async()=>{s(!0);try{const e=await fetch(d),t=await e.json();n(t.data),i(o()().format("HH:mm:ss:SSS")),e.ok?u(void 0):u("".concat(t.errorType,"\r\n").concat(null===t||void 0===t?void 0:t.error))}catch(Ap){Ap instanceof Error&&u("".concat(Ap.name,": ").concat(Ap.message))}s(!1)};return(0,r.useEffect)((()=>{h().catch(console.error)}),[d]),{data:t,lastUpdated:a,isLoading:l,error:c,fetchData:h}})(),c=(0,r.useMemo)((()=>n.map((e=>{const t=o()(e.start).tz().format(Ot),n=o()(e.end).tz().format(Ot);return{duration:e.duration,remote_addr:e.remote_addr,query:e.query,args:"".concat(t," to ").concat(n,", step=").concat(Yt(e.step)),data:JSON.stringify(e,null,2)}}))),[n,t]),u=(0,r.useMemo)((()=>{if(null===c||void 0===c||!c.length)return[];const e=Object.keys(c[0]),t={remote_addr:"client address"},n=["data"];return e.filter((e=>!n.includes(e))).map((e=>({key:e,title:t[e]||e})))}),[c]);return Et("div",{className:"vm-active-queries",children:[i&&Et(yl,{}),Et("div",{className:"vm-active-queries-header",children:[!c.length&&!l&&Et(qr,{variant:"info",children:"There are currently no active queries running"}),l&&Et(qr,{variant:"error",children:l}),Et("div",{className:"vm-active-queries-header-controls",children:[Et(ea,{variant:"contained",onClick:async()=>{s().catch(console.error)},startIcon:Et(zn,{}),children:"Update"}),Et("div",{className:"vm-active-queries-header__update-msg",children:["Last updated: ",a]})]})]}),!!c.length&&Et("div",{className:wr()({"vm-block":!0,"vm-block_mobile":e}),children:Et(_p,{rows:c,columns:u,defaultOrderBy:"duration",copyToClipboard:"data",paginationOffset:{startIndex:0,endIndex:1/0}})})]})},wp=e=>{let{onClose:t,onUpload:n}=e;const{isMobile:a}=Ur(),[o,i]=(0,r.useState)(""),[l,s]=(0,r.useState)(""),c=(0,r.useMemo)((()=>{try{return JSON.parse(o),""}catch(Ap){return Ap instanceof Error?Ap.message:"Unknown error"}}),[o]),u=()=>{s(c),c||(n(o),t())};return Et("div",{className:wr()({"vm-json-form vm-json-form_one-field":!0,"vm-json-form_mobile vm-json-form_one-field_mobile":a}),children:[Et(ja,{value:o,label:"JSON",type:"textarea",error:l,autofocus:!0,onChange:e=>{s(""),i(e)},onEnter:u}),Et("div",{className:"vm-json-form-footer",children:Et("div",{className:"vm-json-form-footer__controls vm-json-form-footer__controls_right",children:[Et(ea,{variant:"outlined",color:"error",onClick:t,children:"Cancel"}),Et(ea,{variant:"contained",onClick:u,children:"apply"})]})})]})},kp=e=>{let{data:t,period:n}=e;const{isMobile:a}=Ur(),{tableCompact:o}=Ir(),i=Rr(),[l,s]=(0,r.useState)([]),[c,u]=(0,r.useState)(),[d,h]=(0,r.useState)(),[m,p]=(0,r.useState)(!1),[f,v]=(0,r.useState)([]),[g,y]=(0,r.useState)(),_=(0,r.useMemo)((()=>Uh(d||[]).map((e=>e.key))),[d]),b=(0,r.useMemo)((()=>{const e=t.some((e=>"matrix"===e.data.resultType));return t.some((e=>"vector"===e.data.resultType))&&e?Nr:e?Nr.filter((e=>"chart"===e.value)):Nr.filter((e=>"chart"!==e.value))}),[t]),[w,k]=(0,r.useState)(b[0].value),{yaxis:x,spanGaps:S}=jr(),C=Hr(),E=e=>{C({type:"SET_YAXIS_LIMITS",payload:e})};return(0,r.useEffect)((()=>{const e="chart"===w?"matrix":"vector",n=t.filter((t=>t.data.resultType===e&&t.trace)).map((e=>{var t,n;return e.trace?new kl(e.trace,(null===e||void 0===e||null===(t=e.vmui)||void 0===t||null===(n=t.params)||void 0===n?void 0:n.query)||"Query"):null}));s(n.filter(Boolean))}),[t,w]),(0,r.useEffect)((()=>{const e=[],n=[],r=[];t.forEach(((t,a)=>{const o=t.data.result.map((e=>{var n,r,o;return{...e,group:Number(null!==(n=null===(r=t.vmui)||void 0===r||null===(o=r.params)||void 0===o?void 0:o.id)&&void 0!==n?n:a)+1}}));var i,l;"matrix"===t.data.resultType?(n.push(...o),e.push((null===(i=t.vmui)||void 0===i||null===(l=i.params)||void 0===l?void 0:l.query)||"Query")):r.push(...o)})),v(e),u(n),h(r)}),[t]),(0,r.useEffect)((()=>{p(!!c&&Cl(c))}),[c]),Et("div",{className:wr()({"vm-query-analyzer-view":!0,"vm-query-analyzer-view_mobile":a}),children:[!!l.length&&Et(zl,{traces:l,onDeleteClick:e=>{s((t=>t.filter((t=>t.idValue!==e.idValue))))}}),Et("div",{className:wr()({"vm-block":!0,"vm-block_mobile":a}),children:[Et("div",{className:"vm-custom-panel-body-header",children:[Et("div",{className:"vm-custom-panel-body-header__tabs",children:Et(Er,{activeItem:w,items:b,onChange:e=>{k(e)}})}),Et("div",{className:"vm-custom-panel-body-header__graph-controls",children:["chart"===w&&Et(va,{}),"chart"===w&&Et(Hh,{yaxis:x,setYaxisLimits:E,toggleEnableLimits:()=>{C({type:"TOGGLE_ENABLE_YAXIS_LIMITS"})},spanGaps:{value:S,onChange:e=>{C({type:"SET_SPAN_GAPS",payload:e})}}}),"table"===w&&Et(Kh,{columns:_,defaultColumns:g,onChangeColumns:y,tableCompact:o,toggleTableCompact:()=>{i({type:"TOGGLE_TABLE_COMPACT"})}})]})]}),c&&n&&"chart"===w&&Et(Dh,{data:c,period:n,customStep:n.step||"1s",query:f,yaxis:x,setYaxisLimits:E,setPeriod:()=>null,height:a?.5*window.innerHeight:500,isHistogram:m,spanGaps:S}),d&&"code"===w&&Et($h,{data:d}),d&&"table"===w&&Et(qh,{data:d,displayColumns:g})]})]})},xp=e=>{var t,n;let{data:a,period:i}=e;const l=(0,r.useMemo)((()=>a.filter((e=>e.stats&&"matrix"===e.data.resultType))),[a]),s=(0,r.useMemo)((()=>{var e,t;return null===(e=a.find((e=>{var t;return null===e||void 0===e||null===(t=e.vmui)||void 0===t?void 0:t.comment})))||void 0===e||null===(t=e.vmui)||void 0===t?void 0:t.comment}),[a]),c=(0,r.useMemo)((()=>{if(!i)return"";const e=o()(1e3*i.start).tz().format(Ot),t=o()(1e3*i.end).tz().format(Ot);return"".concat(e," - ").concat(t)}),[i]),{value:u,setTrue:d,setFalse:h}=na(!1);return Et(St.FK,{children:[Et("div",{className:"vm-query-analyzer-info-header",children:[Et(ea,{startIcon:Et(Pn,{}),variant:"outlined",color:"warning",onClick:d,children:"Show report info"}),i&&Et(St.FK,{children:[Et("div",{className:"vm-query-analyzer-info-header__period",children:[Et(ar,{})," step: ",i.step]}),Et("div",{className:"vm-query-analyzer-info-header__period",children:[Et(Hn,{})," ",c]})]})]}),u&&Et(ua,{title:"Report info",onClose:h,children:Et("div",{className:"vm-query-analyzer-info",children:[s&&Et("div",{className:"vm-query-analyzer-info-item vm-query-analyzer-info-item_comment",children:[Et("div",{className:"vm-query-analyzer-info-item__title",children:"Comment:"}),Et("div",{className:"vm-query-analyzer-info-item__text",children:s})]}),l.map(((e,t)=>{var n;return Et("div",{className:"vm-query-analyzer-info-item",children:[Et("div",{className:"vm-query-analyzer-info-item__title",children:l.length>1?"Query ".concat(t+1,":"):"Stats:"}),Et("div",{className:"vm-query-analyzer-info-item__text",children:[Object.entries(e.stats||{}).map((e=>{let[t,n]=e;return Et("div",{children:[t,": ",null!==n&&void 0!==n?n:"-"]},t)})),"isPartial: ",String(null!==(n=e.isPartial)&&void 0!==n?n:"-")]})]},t)})),Et("div",{className:"vm-query-analyzer-info-type",children:null!==(t=l[0])&&void 0!==t&&null!==(n=t.vmui)&&void 0!==n&&n.params?"The report was created using vmui":"The report was created manually"})]})})]})},Sp=()=>{const[e,t]=(0,r.useState)([]),[n,a]=(0,r.useState)(""),o=(0,r.useMemo)((()=>!!e.length),[e]),{value:i,setTrue:l,setFalse:s}=na(!1),c=(0,r.useMemo)((()=>{var t,n;if(!e)return;const r=null===(t=e[0])||void 0===t||null===(n=t.vmui)||void 0===n?void 0:n.params,a={start:+((null===r||void 0===r?void 0:r.start)||0),end:+((null===r||void 0===r?void 0:r.end)||0),step:null===r||void 0===r?void 0:r.step,date:""};if(!r){const t=e.filter((e=>"matrix"===e.data.resultType)).map((e=>e.data.result)).flat().map((e=>{var t;return e.values?null===(t=e.values)||void 0===t?void 0:t.map((e=>e[0])):[0]})).flat(),n=Array.from(new Set(t.filter(Boolean))).sort(((e,t)=>e-t));a.start=n[0],a.end=n[n.length-1],a.step=qt((e=>{const t=e.slice(1).map(((t,n)=>t-e[n])),n={};t.forEach((e=>{const t=e.toString();n[t]=(n[t]||0)+1}));let r=0,a=0;for(const o in n)n[o]>a&&(a=n[o],r=Number(o));return r})(n))}return a.date=Gt(en(a.end)),a}),[e]),u=e=>{try{const n=JSON.parse(e),r=Array.isArray(n)?n:[n];(e=>e.every((e=>{if("object"===typeof e&&null!==e){const t=e.data;if("object"===typeof t&&null!==t){const e=t.result,n=t.resultType;return Array.isArray(e)&&"string"===typeof n}}return!1})))(r)?t(r):a("Invalid structure - JSON does not match the expected format")}catch(Ap){Ap instanceof Error&&a("".concat(Ap.name,": ").concat(Ap.message))}},d=e=>{e.map((e=>{const t=new FileReader;t.onload=e=>{var t;const n=String(null===(t=e.target)||void 0===t?void 0:t.result);u(n)},t.readAsText(e)}))},h=e=>{a("");const t=Array.from(e.target.files||[]);d(t),e.target.value=""},{files:m,dragging:p}=Bm();return(0,r.useEffect)((()=>{d(m)}),[m]),Et("div",{className:"vm-trace-page",children:[o&&Et("div",{className:"vm-trace-page-header",children:[Et("div",{className:"vm-trace-page-header-errors",children:Et(xp,{data:e,period:c})}),Et("div",{children:Et(qm,{onOpenModal:l,onChange:h})})]}),n&&Et("div",{className:"vm-trace-page-header-errors-item vm-trace-page-header-errors-item_margin-bottom",children:[Et(qr,{variant:"error",children:n}),Et(ea,{className:"vm-trace-page-header-errors-item__close",startIcon:Et(Ln,{}),variant:"text",color:"error",onClick:()=>{a("")}})]}),o&&Et(kp,{data:e,period:c}),!o&&Et("div",{className:"vm-trace-page-preview",children:[Et("p",{className:"vm-trace-page-preview__text",children:["Please, upload file with JSON response content.","\n","The file must contain query information in JSON format.","\n","Graph will be displayed after file upload.","\n","Attach files by dragging & dropping, selecting or pasting them."]}),Et(qm,{onOpenModal:l,onChange:h})]}),i&&Et(ua,{title:"Paste JSON",onClose:s,children:Et(wp,{onClose:s,onUpload:u})}),p&&Et("div",{className:"vm-trace-page__dropzone"})]})},Cp=()=>{const[e,t]=(0,r.useState)(!1);return Et(St.FK,{children:Et(Le,{children:Et(Gr,{children:Et(St.FK,{children:[Et(Um,{onLoaded:t}),e&&Et(ke,{children:Et(be,{path:"/",element:Et(No,{}),children:[Et(be,{path:Ye.home,element:Et(em,{})}),Et(be,{path:Ye.metrics,element:Et(lp,{})}),Et(be,{path:Ye.cardinality,element:Et(Om,{})}),Et(be,{path:Ye.topQueries,element:Et(Fm,{})}),Et(be,{path:Ye.trace,element:Et(Ym,{})}),Et(be,{path:Ye.queryAnalyzer,element:Et(Sp,{})}),Et(be,{path:Ye.dashboards,element:Et(am,{})}),Et(be,{path:Ye.withTemplate,element:Et(fp,{})}),Et(be,{path:Ye.relabel,element:Et(yp,{})}),Et(be,{path:Ye.activeQueries,element:Et(bp,{})}),Et(be,{path:Ye.icons,element:Et(sp,{})})]})})]})})})})},Ep=e=>{e&&n.e(685).then(n.bind(n,685)).then((t=>{let{getCLS:n,getFID:r,getFCP:a,getLCP:o,getTTFB:i}=t;n(e),r(e),a(e),o(e),i(e)}))},Np=document.getElementById("root");Np&&(0,r.render)(Et(Cp,{}),Np),Ep()})()})(); |