@kong-ui-public/analytics-chart 10.28.0 → 10.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vitals-chart.es.js +2814 -2796
- package/dist/vitals-chart.umd.js +8 -8
- package/package.json +3 -3
package/dist/vitals-chart.umd.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
(function(Kt,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("vue"),require("@kong/icons"),require("@kong-ui-public/i18n"),require("@kong-ui-public/analytics-metric-provider")):typeof define=="function"&&define.amd?define(["exports","vue","@kong/icons","@kong-ui-public/i18n","@kong-ui-public/analytics-metric-provider"],p):(Kt=typeof globalThis<"u"?globalThis:Kt||self,p(Kt["kong-ui-publicvitals-chart"]={},Kt.Vue,Kt.KongIcons,Kt["kong-ui-public-i18n"],Kt["kong-ui-public-analytics-metric-provider"]))})(this,(function(Kt,p,Ss,Kf,Qi){"use strict";var gt=(n=>(n.FIFTEEN_MIN="15m",n.ONE_HOUR="1h",n.SIX_HOUR="6h",n.TWELVE_HOUR="12h",n.ONE_DAY="24h",n.SEVEN_DAY="7d",n.THIRTY_DAY="30d",n.NINETY_DAY="90d",n.ONE_HUNDRED_EIGHTY_DAY="180d",n.ONE_YEAR="365d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.CURRENT_YEAR="current_year",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n.PREVIOUS_YEAR="previous_year",n))(gt||{});const Fb=["in","not_in","selector"],zb=["empty","not_empty"],Ub=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],Ji=n=>n.filter(t=>t!=="time"),Xf=["api","api_package","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],Zf=Ji(Xf),Hb=["active_services","error_rate","request_count","request_per_minute","response_latency_average"],Qf=[...Xf,"ai_gateway","ai_gateway_consumer","ai_gateway_data_plane_node","application","bot_info_action","bot_info_detection_reason","bot_info_ban_type","cache_status","consumer","consumer_group","country_code","oidc_credential","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm","portal_api","principal"],Jf=Ji(Qf),Wb=[...Hb,"cache_hit_rate","response_latency_p99","response_latency_p95","response_latency_p50","upstream_latency_p99","upstream_latency_p95","upstream_latency_p50","upstream_latency_average","kong_latency_p99","kong_latency_p95","kong_latency_p50","kong_latency_average","kong_internal_latency_p99","kong_internal_latency_p95","kong_internal_latency_p50","kong_internal_latency_average","response_size_p99","response_size_p95","response_size_p50","response_size_average","response_size_sum","request_size_p99","request_size_p95","request_size_p50","request_size_average","request_size_sum"],Vb=["control_plane","control_plane_group","ai_gateway","gateway_service","consumer","ai_gateway_consumer","ai_gateway_consumer_group","application","oidc_credential","route","ai_provider","ai_response_model","ai_request_model","llm_cache_status","llm_embeddings_provider","llm_embeddings_model","time","realm","status_code","status_code_grouped","ai_plugin","principal","cache_status","ai_gateway_mcp_server","ai_gateway_model","ai_gateway_agent","ai_gateway_data_plane_node"],th=Ji(Vb);Ji(["a2a_context_id","a2a_error","a2a_method","a2a_task_id","api","api_package","api_product","api_product_version","application","auth_type","bot_info_action","bot_info_detection_reason","bot_info_ja4_fingerprint","bot_info_ban_type","bot_info_header_names","cache_status","client_ip","consumer","ai_gateway_consumer","consumer_group","ai_gateway_consumer_group","control_plane","control_plane_group","ai_gateway","country_code","data_plane_node","data_plane_node_version","ai_gateway_data_plane_node","gateway_service","header_host","header_user_agent","http_method","mcp_error","mcp_method","mcp_session_id","mcp_tool_name","oidc_credential","portal","principal","realm","request_id","request_uri","response_header_content_type","response_source","route","service_port","service_protocol","sse","status_code_grouped","time","trace_id","upstream_uri","upstream_status_code_grouped","websocket"]),Ji(["ai_count","latencies_response_ms","latencies_upstream_ms","latencies_kong_gateway_ms","latencies_kong_internal_ms","request_body_size","response_body_size","response_header_content_length","status_code","upstream_status_code"]);const $b=["platform","platform_usage"],Yb=n=>$b.includes(n),qb=[...Qf,"a2a_context_id","a2a_error","a2a_method","a2a_task_id","ai_gateway_agent","ai_gateway_mcp_server","mcp_error","mcp_method","mcp_session_id","mcp_tool_name"],eh=Ji(qb);[...Wb];const jb=["control_plane","data_plane_group","managed_cache","network","provider","provider_region","time"],nh=Ji(jb);new Set(Zf),new Set(Jf),new Set(th),new Set(eh),new Set(nh);const ih=[{code:"AF",name:"Afghanistan"},{code:"AX",name:"Aland Islands"},{code:"AL",name:"Albania"},{code:"DZ",name:"Algeria"},{code:"AS",name:"American Samoa"},{code:"AD",name:"Andorra"},{code:"AO",name:"Angola"},{code:"AI",name:"Anguilla"},{code:"AQ",name:"Antarctica"},{code:"AG",name:"Antigua and Barbuda"},{code:"AR",name:"Argentina"},{code:"AM",name:"Armenia"},{code:"AW",name:"Aruba"},{code:"AU",name:"Australia"},{code:"AT",name:"Austria"},{code:"AZ",name:"Azerbaijan"},{code:"BS",name:"Bahamas"},{code:"BH",name:"Bahrain"},{code:"BD",name:"Bangladesh"},{code:"BB",name:"Barbados"},{code:"BY",name:"Belarus"},{code:"BE",name:"Belgium"},{code:"BZ",name:"Belize"},{code:"BJ",name:"Benin"},{code:"BM",name:"Bermuda"},{code:"BT",name:"Bhutan"},{code:"BO",name:"Bolivia"},{code:"BA",name:"Bosnia and Herzegovina"},{code:"BW",name:"Botswana"},{code:"BV",name:"Bouvet Island"},{code:"BR",name:"Brazil"},{code:"IO",name:"British Indian Ocean Territory"},{code:"BN",name:"Brunei Darussalam"},{code:"BG",name:"Bulgaria"},{code:"BF",name:"Burkina Faso"},{code:"BI",name:"Burundi"},{code:"KH",name:"Cambodia"},{code:"CM",name:"Cameroon"},{code:"CA",name:"Canada"},{code:"CV",name:"Cape Verde"},{code:"KY",name:"Cayman Islands"},{code:"CF",name:"Central African Republic"},{code:"TD",name:"Chad"},{code:"CL",name:"Chile"},{code:"CN",name:"China"},{code:"CX",name:"Christmas Island"},{code:"CC",name:"Cocos (Keeling) Islands"},{code:"CO",name:"Colombia"},{code:"KM",name:"Comoros"},{code:"CG",name:"Congo"},{code:"CD",name:"Democratic Republic of the Congo"},{code:"CK",name:"Cook Islands"},{code:"CR",name:"Costa Rica"},{code:"CI",name:"Cote d'Ivoire"},{code:"HR",name:"Croatia"},{code:"CU",name:"Cuba"},{code:"CY",name:"Cyprus"},{code:"CZ",name:"Czech Republic"},{code:"DK",name:"Denmark"},{code:"DJ",name:"Djibouti"},{code:"DM",name:"Dominica"},{code:"DO",name:"Dominican Republic"},{code:"EC",name:"Ecuador"},{code:"EG",name:"Egypt"},{code:"SV",name:"El Salvador"},{code:"GQ",name:"Equatorial Guinea"},{code:"ER",name:"Eritrea"},{code:"EE",name:"Estonia"},{code:"ET",name:"Ethiopia"},{code:"FK",name:"Falkland Islands (Malvinas)"},{code:"FO",name:"Faroe Islands"},{code:"FJ",name:"Fiji"},{code:"FI",name:"Finland"},{code:"FR",name:"France"},{code:"GF",name:"French Guiana"},{code:"PF",name:"French Polynesia"},{code:"TF",name:"French Southern Territories"},{code:"GA",name:"Gabon"},{code:"GM",name:"Gambia"},{code:"GE",name:"Georgia"},{code:"DE",name:"Germany"},{code:"GH",name:"Ghana"},{code:"GI",name:"Gibraltar"},{code:"GR",name:"Greece"},{code:"GL",name:"Greenland"},{code:"GD",name:"Grenada"},{code:"GP",name:"Guadeloupe"},{code:"GU",name:"Guam"},{code:"GT",name:"Guatemala"},{code:"GG",name:"Guernsey"},{code:"GN",name:"Guinea"},{code:"GW",name:"Guinea-Bissau"},{code:"GY",name:"Guyana"},{code:"HT",name:"Haiti"},{code:"HM",name:"Heard Island and McDonald Islands"},{code:"VA",name:"The Vatican"},{code:"HN",name:"Honduras"},{code:"HK",name:"Hong Kong"},{code:"HU",name:"Hungary"},{code:"IS",name:"Iceland"},{code:"IN",name:"India"},{code:"ID",name:"Indonesia"},{code:"IR",name:"Iran"},{code:"IQ",name:"Iraq"},{code:"IE",name:"Ireland"},{code:"IM",name:"Isle of Man"},{code:"IL",name:"Israel"},{code:"IT",name:"Italy"},{code:"JM",name:"Jamaica"},{code:"JP",name:"Japan"},{code:"JE",name:"Jersey"},{code:"JO",name:"Jordan"},{code:"KZ",name:"Kazakhstan"},{code:"KE",name:"Kenya"},{code:"KI",name:"Kiribati"},{code:"KP",name:"North Korea"},{code:"KR",name:"South Korea"},{code:"KW",name:"Kuwait"},{code:"KG",name:"Kyrgyzstan"},{code:"LA",name:"Laos"},{code:"LV",name:"Latvia"},{code:"LB",name:"Lebanon"},{code:"LS",name:"Lesotho"},{code:"LR",name:"Liberia"},{code:"LY",name:"Libya"},{code:"LI",name:"Liechtenstein"},{code:"LT",name:"Lithuania"},{code:"LU",name:"Luxembourg"},{code:"MO",name:"Macao"},{code:"MK",name:"Macedonia"},{code:"MG",name:"Madagascar"},{code:"MW",name:"Malawi"},{code:"MY",name:"Malaysia"},{code:"MV",name:"Maldives"},{code:"ML",name:"Mali"},{code:"MT",name:"Malta"},{code:"MH",name:"Marshall Islands"},{code:"MQ",name:"Martinique"},{code:"MR",name:"Mauritania"},{code:"MU",name:"Mauritius"},{code:"YT",name:"Mayotte"},{code:"MX",name:"Mexico"},{code:"FM",name:"Micronesia, "},{code:"MD",name:"Moldova,"},{code:"MC",name:"Monaco"},{code:"MN",name:"Mongolia"},{code:"ME",name:"Montenegro"},{code:"MS",name:"Montserrat"},{code:"MA",name:"Morocco"},{code:"MZ",name:"Mozambique"},{code:"MM",name:"Myanmar"},{code:"NA",name:"Namibia"},{code:"NR",name:"Nauru"},{code:"NP",name:"Nepal"},{code:"NL",name:"Netherlands"},{code:"NC",name:"New Caledonia"},{code:"NZ",name:"New Zealand"},{code:"NI",name:"Nicaragua"},{code:"NE",name:"Niger"},{code:"NG",name:"Nigeria"},{code:"NU",name:"Niue"},{code:"NF",name:"Norfolk Island"},{code:"MP",name:"Northern Mariana Islands"},{code:"NO",name:"Norway"},{code:"OM",name:"Oman"},{code:"PK",name:"Pakistan"},{code:"PW",name:"Palau"},{code:"PA",name:"Panama"},{code:"PG",name:"Papua New Guinea"},{code:"PY",name:"Paraguay"},{code:"PE",name:"Peru"},{code:"PH",name:"Philippines"},{code:"PN",name:"Pitcairn"},{code:"PL",name:"Poland"},{code:"PT",name:"Portugal"},{code:"PR",name:"Puerto Rico"},{code:"QA",name:"Qatar"},{code:"RE",name:"Reunion"},{code:"RO",name:"Romania"},{code:"RU",name:"Russia"},{code:"RW",name:"Rwanda"},{code:"BL",name:"Saint Barthelemy"},{code:"SH",name:"Saint Helena"},{code:"KN",name:"Saint Kitts and Nevis"},{code:"LC",name:"Saint Lucia"},{code:"MF",name:"Saint Martin"},{code:"PM",name:"Saint Pierre and Miquelon"},{code:"VC",name:"Saint Vincent and the Grenadines"},{code:"WS",name:"Samoa"},{code:"SM",name:"San Marino"},{code:"ST",name:"Sao Tome and Principe"},{code:"SA",name:"Saudi Arabia"},{code:"SN",name:"Senegal"},{code:"RS",name:"Serbia"},{code:"SC",name:"Seychelles"},{code:"SL",name:"Sierra Leone"},{code:"SG",name:"Singapore"},{code:"SX",name:"Sint Maarten"},{code:"SK",name:"Slovakia"},{code:"SI",name:"Slovenia"},{code:"SB",name:"Solomon Islands"},{code:"SO",name:"Somalia"},{code:"ZA",name:"South Africa"},{code:"GS",name:"South Georgia and the South Sandwich Islands"},{code:"SS",name:"South Sudan"},{code:"ES",name:"Spain"},{code:"LK",name:"Sri Lanka"},{code:"SD",name:"Sudan"},{code:"SR",name:"Suriname"},{code:"SJ",name:"Svalbard and Jan Mayen"},{code:"SZ",name:"Swaziland"},{code:"SE",name:"Sweden"},{code:"CH",name:"Switzerland"},{code:"SY",name:"Syria"},{code:"TW",name:"Taiwan"},{code:"TJ",name:"Tajikistan"},{code:"TZ",name:"Tanzania"},{code:"TH",name:"Thailand"},{code:"TL",name:"Timor-Leste"},{code:"TG",name:"Togo"},{code:"TK",name:"Tokelau"},{code:"TO",name:"Tonga"},{code:"TT",name:"Trinidad and Tobago"},{code:"TN",name:"Tunisia"},{code:"TR",name:"Turkey"},{code:"TM",name:"Turkmenistan"},{code:"TC",name:"Turks and Caicos Islands"},{code:"TV",name:"Tuvalu"},{code:"UG",name:"Uganda"},{code:"UA",name:"Ukraine"},{code:"AE",name:"United Arab Emirates"},{code:"GB",name:"United Kingdom"},{code:"US",name:"United States"},{code:"UM",name:"United States Minor Outlying Islands"},{code:"UY",name:"Uruguay"},{code:"UZ",name:"Uzbekistan"},{code:"VU",name:"Vanuatu"},{code:"VE",name:"Venezuela"},{code:"VN",name:"Vietnam"},{code:"VG",name:"British Virgin Islands"},{code:"VI",name:"U.S. Virgin Islands"},{code:"WF",name:"Wallis and Futuna"},{code:"EH",name:"Western Sahara"},{code:"YE",name:"Yemen"},{code:"ZM",name:"Zambia"},{code:"ZW",name:"Zimbabwe"}];ih.map(n=>n.code);const Gb=n=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",...n?{enum:n}:{}},operator:{type:"string",enum:Fb},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",...n?{enum:n}:{}},operator:{type:"string",enum:zb}},required:["field","operator"],additionalProperties:!1}]}}),Kb=["control_plane","gateway_service","realm","route","plugin","plugin_name","plugin_scope","data_plane_node_version","env","team","region","hostname"];Gb([...new Set([...Jf,...Zf,...th,...eh,...Kb,...nh])]);const Xb={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Zb=(n,t,e)=>{let i;const r=Xb[n];return typeof r=="string"?i=r:t===1?i=r.one:i=r.other.replace("{{count}}",t.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function yc(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const Qb={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Jb={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},tx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ex={date:yc({formats:Qb,defaultWidth:"full"}),time:yc({formats:Jb,defaultWidth:"full"}),dateTime:yc({formats:tx,defaultWidth:"full"})},nx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ix=(n,t,e,i)=>nx[n];function Ts(n){return(t,e)=>{const i=e?.context?String(e.context):"standalone";let r;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,l=e?.width?String(e.width):a;r=n.formattingValues[l]||n.formattingValues[a]}else{const a=n.defaultWidth,l=e?.width?String(e.width):n.defaultWidth;r=n.values[l]||n.values[a]}const s=n.argumentCallback?n.argumentCallback(t):t;return r[s]}}const rx={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},sx={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ox={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ax={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},lx={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},cx={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ux=(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},dx={ordinalNumber:ux,era:Ts({values:rx,defaultWidth:"wide"}),quarter:Ts({values:sx,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Ts({values:ox,defaultWidth:"wide"}),day:Ts({values:ax,defaultWidth:"wide"}),dayPeriod:Ts({values:lx,defaultWidth:"wide",formattingValues:cx,defaultFormattingWidth:"wide"})};function Ms(n){return(t,e={})=>{const i=e.width,r=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],s=t.match(r);if(!s)return null;const a=s[0],l=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],u=Array.isArray(l)?hx(l,g=>g.test(a)):fx(l,g=>g.test(a));let d;d=n.valueCallback?n.valueCallback(u):u,d=e.valueCallback?e.valueCallback(d):d;const h=t.slice(a.length);return{value:d,rest:h}}}function fx(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function hx(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function px(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const r=i[0],s=t.match(n.parsePattern);if(!s)return null;let a=n.valueCallback?n.valueCallback(s[0]):s[0];a=e.valueCallback?e.valueCallback(a):a;const l=t.slice(r.length);return{value:a,rest:l}}}const gx=/^(\d+)(th|st|nd|rd)?/i,mx=/\d+/i,yx={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},_x={any:[/^b/i,/^(a|c)/i]},bx={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},xx={any:[/1/i,/2/i,/3/i,/4/i]},wx={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},vx={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Sx={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Tx={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Mx={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},kx={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Dx={ordinalNumber:px({matchPattern:gx,parsePattern:mx,valueCallback:n=>parseInt(n,10)}),era:Ms({matchPatterns:yx,defaultMatchWidth:"wide",parsePatterns:_x,defaultParseWidth:"any"}),quarter:Ms({matchPatterns:bx,defaultMatchWidth:"wide",parsePatterns:xx,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Ms({matchPatterns:wx,defaultMatchWidth:"wide",parsePatterns:vx,defaultParseWidth:"any"}),day:Ms({matchPatterns:Sx,defaultMatchWidth:"wide",parsePatterns:Tx,defaultParseWidth:"any"}),dayPeriod:Ms({matchPatterns:Mx,defaultMatchWidth:"any",parsePatterns:kx,defaultParseWidth:"any"})},Cx={code:"en-US",formatDistance:Zb,formatLong:ex,formatRelative:ix,localize:dx,match:Dx,options:{weekStartsOn:0,firstWeekContainsDate:1}};let Ox={};function ks(){return Ox}const rh=6048e5,Ax=864e5,Rx=60,Ex=3600,sh=Symbol.for("constructDateFrom");function Sn(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&sh in n?n[sh](t):n instanceof Date?new n.constructor(t):new Date(t)}function ze(n,t){return Sn(t||n,n)}function oh(n){const t=ze(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function Px(n,...t){const e=Sn.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Rr(n,t){const e=ze(n,t?.in);return e.setHours(0,0,0,0),e}function Ix(n,t,e){const[i,r]=Px(e?.in,n,t),s=Rr(i),a=Rr(r),l=+s-oh(s),u=+a-oh(a);return Math.round((l-u)/Ax)}function Lx(n,t){const e=ze(n,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function Nx(n,t){const e=ze(n,t?.in);return Ix(e,Lx(e))+1}function Jn(n,t){const e=ks(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=ze(n,t?.in),s=r.getDay(),a=(s<i?7:0)+s-i;return r.setDate(r.getDate()-a),r.setHours(0,0,0,0),r}function Qo(n,t){return Jn(n,{...t,weekStartsOn:1})}function ah(n,t){const e=ze(n,t?.in),i=e.getFullYear(),r=Sn(e,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=Qo(r),a=Sn(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=Qo(a);return e.getTime()>=s.getTime()?i+1:e.getTime()>=l.getTime()?i:i-1}function Bx(n,t){const e=ah(n,t),i=Sn(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Qo(i)}function Fx(n,t){const e=ze(n,t?.in),i=+Qo(e)-+Bx(e);return Math.round(i/rh)+1}function lh(n,t){const e=ze(n,t?.in),i=e.getFullYear(),r=ks(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=Sn(t?.in||n,0);a.setFullYear(i+1,0,s),a.setHours(0,0,0,0);const l=Jn(a,t),u=Sn(t?.in||n,0);u.setFullYear(i,0,s),u.setHours(0,0,0,0);const d=Jn(u,t);return+e>=+l?i+1:+e>=+d?i:i-1}function zx(n,t){const e=ks(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??e.firstWeekContainsDate??e.locale?.options?.firstWeekContainsDate??1,r=lh(n,t),s=Sn(t?.in||n,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),Jn(s,t)}function Ux(n,t){const e=ze(n,t?.in),i=+Jn(e,t)-+zx(e,t);return Math.round(i/rh)+1}function Xt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const wi={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Xt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Xt(e+1,2)},d(n,t){return Xt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Xt(n.getHours()%12||12,t.length)},H(n,t){return Xt(n.getHours(),t.length)},m(n,t){return Xt(n.getMinutes(),t.length)},s(n,t){return Xt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),r=Math.trunc(i*Math.pow(10,e-3));return Xt(r,t.length)}},Er={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ch={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),r=i>0?i:1-i;return e.ordinalNumber(r,{unit:"year"})}return wi.y(n,t)},Y:function(n,t,e,i){const r=lh(n,i),s=r>0?r:1-r;if(t==="YY"){const a=s%100;return Xt(a,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):Xt(s,t.length)},R:function(n,t){const e=ah(n);return Xt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Xt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Xt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Xt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return wi.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Xt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const r=Ux(n,i);return t==="wo"?e.ordinalNumber(r,{unit:"week"}):Xt(r,t.length)},I:function(n,t,e){const i=Fx(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Xt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):wi.d(n,t)},D:function(n,t,e){const i=Nx(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Xt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const r=n.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Xt(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});case"eee":return e.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(r,{width:"short",context:"formatting"});default:return e.day(r,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const r=n.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Xt(s,t.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(r,{width:"narrow",context:"standalone"});case"cccccc":return e.day(r,{width:"short",context:"standalone"});default:return e.day(r,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),r=i===0?7:i;switch(t){case"i":return String(r);case"ii":return Xt(r,t.length);case"io":return e.ordinalNumber(r,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const i=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let r;switch(i===12?r=Er.noon:i===0?r=Er.midnight:r=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let r;switch(i>=17?r=Er.evening:i>=12?r=Er.afternoon:i>=4?r=Er.morning:r=Er.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return wi.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):wi.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Xt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Xt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):wi.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):wi.s(n,t)},S:function(n,t){return wi.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return dh(i);case"XXXX":case"XX":return tr(i);default:return tr(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return dh(i);case"xxxx":case"xx":return tr(i);default:return tr(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+uh(i,":");default:return"GMT"+tr(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+uh(i,":");default:return"GMT"+tr(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Xt(i,t.length)},T:function(n,t,e){return Xt(+n,t.length)}};function uh(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Math.trunc(i/60),s=i%60;return s===0?e+String(r):e+String(r)+t+Xt(s,2)}function dh(n,t){return n%60===0?(n>0?"-":"+")+Xt(Math.abs(n)/60,2):tr(n,t)}function tr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Xt(Math.trunc(i/60),2),s=Xt(i%60,2);return e+r+t+s}const fh=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},hh=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},Hx=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],r=e[2];if(!r)return fh(n,t);let s;switch(i){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",fh(i,t)).replace("{{time}}",hh(r,t))},Wx={p:hh,P:Hx},Vx=/^D+$/,$x=/^Y+$/,Yx=["D","DD","YY","YYYY"];function qx(n){return Vx.test(n)}function jx(n){return $x.test(n)}function Gx(n,t,e){const i=Kx(n,t,e);if(console.warn(i),Yx.includes(n))throw new RangeError(i)}function Kx(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function Xx(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Zx(n){return!(!Xx(n)&&typeof n!="number"||isNaN(+ze(n)))}const Qx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Jx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,tw=/^'([^]*?)'?$/,ew=/''/g,nw=/[a-zA-Z]/;function iw(n,t,e){const i=ks(),r=e?.locale??i.locale??Cx,s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,l=ze(n,e?.in);if(!Zx(l))throw new RangeError("Invalid time value");let u=t.match(Jx).map(h=>{const g=h[0];if(g==="p"||g==="P"){const y=Wx[g];return y(h,r.formatLong)}return h}).join("").match(Qx).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const g=h[0];if(g==="'")return{isToken:!1,value:rw(h)};if(ch[g])return{isToken:!0,value:h};if(g.match(nw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:h}});r.localize.preprocessor&&(u=r.localize.preprocessor(l,u));const d={firstWeekContainsDate:s,weekStartsOn:a,locale:r};return u.map(h=>{if(!h.isToken)return h.value;const g=h.value;(!e?.useAdditionalWeekYearTokens&&jx(g)||!e?.useAdditionalDayOfYearTokens&&qx(g))&&Gx(g,t,String(n));const y=ch[g[0]];return y(l,g,r.localize,d)}).join("")}function rw(n){const t=n.match(tw);return t?t[1].replace(ew,"'"):n}function Jo(n,t,e){const i=ze(n,e?.in);return isNaN(t)?Sn(n,NaN):(i.setDate(i.getDate()+t),i)}function ph(n,t,e){const i=ze(n,e?.in);if(isNaN(t))return Sn(n,NaN);if(!t)return i;const r=i.getDate(),s=Sn(n,i.getTime());s.setMonth(i.getMonth()+t+1,0);const a=s.getDate();return r>=a?s:(i.setFullYear(s.getFullYear(),s.getMonth(),r),i)}function sw(n,t,e){return ph(n,t*3,e)}function Pr(n,t){const e=ze(n,t?.in),i=e.getMonth(),r=i-i%3;return e.setMonth(r,1),e.setHours(0,0,0,0),e}function Ir(n,t){const e=ze(n,t?.in);return e.setDate(1),e.setHours(0,0,0,0),e}function ow(n,t){const e=ze(n,t?.in),i=e.getFullYear(),r=e.getMonth(),s=Sn(e,0);return s.setFullYear(i,r+1,0),s.setHours(0,0,0,0),s.getDate()}function aw(){return Object.assign({},ks())}function gh(n){return Math.trunc(n*Ex)}function lw(n){const t=n/Rx;return Math.trunc(t)}function mh(n,t,e){return ph(n,-1,e)}function yh(n,t,e){return sw(n,-1,e)}function _h(n,t,e){const i=aw(),r=dw(n,e.timeZone,e.locale??i.locale);return"formatToParts"in r?cw(r,t):uw(r,t)}function cw(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function uw(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function dw(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function fw(n,t){const e=yw(t);return"formatToParts"in e?pw(e,n):gw(e,n)}const hw={year:0,month:1,day:2,hour:3,minute:4,second:5};function pw(n,t){try{const e=n.formatToParts(t),i=[];for(let r=0;r<e.length;r++){const s=hw[e[r].type];s!==void 0&&(i[s]=parseInt(e[r].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function gw(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const _c={},bh=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),mw=bh==="06/25/2014, 00:00:00"||bh==="06/25/2014 00:00:00";function yw(n){return _c[n]||(_c[n]=mw?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),_c[n]}function bc(n,t,e,i,r,s,a){const l=new Date(0);return l.setUTCFullYear(n,t,e),l.setUTCHours(i,r,s,a),l}const xh=36e5,_w=6e4,xc={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Ds(n,t,e){if(!n)return 0;let i=xc.timezoneZ.exec(n);if(i)return 0;let r,s;if(i=xc.timezoneHH.exec(n),i)return r=parseInt(i[1],10),wh(r)?-(r*xh):NaN;if(i=xc.timezoneHHMM.exec(n),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return wh(r,a)?(s=Math.abs(r)*xh+a*_w,i[1]==="+"?-s:s):NaN}if(ww(n)){t=new Date(t||Date.now());const a=e?t:bw(t),l=wc(a,n);return-(e?l:xw(t,l,n))}return NaN}function bw(n){return bc(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function wc(n,t){const e=fw(n,t),i=bc(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let r=n.getTime();const s=r%1e3;return r-=s>=0?s:1e3+s,i-r}function xw(n,t,e){let i=n.getTime()-t;const r=wc(new Date(i),e);if(t===r)return t;i-=r-t;const s=wc(new Date(i),e);return r===s?r:Math.max(r,s)}function wh(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const vh={};function ww(n){if(vh[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),vh[n]=!0,!0}catch{return!1}}const vw=60*1e3,Sw={X:function(n,t,e){const i=vc(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return Sh(i);case"XXXX":case"XX":return Lr(i);default:return Lr(i,":")}},x:function(n,t,e){const i=vc(e.timeZone,n);switch(t){case"x":return Sh(i);case"xxxx":case"xx":return Lr(i);default:return Lr(i,":")}},O:function(n,t,e){const i=vc(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Tw(i,":");default:return"GMT"+Lr(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return _h("short",n,e);default:return _h("long",n,e)}}};function vc(n,t){const e=n?Ds(n,t,!0)/vw:t?.getTimezoneOffset()??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function ta(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Lr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=ta(Math.floor(i/60),2),s=ta(Math.floor(i%60),2);return e+r+t+s}function Sh(n,t){return n%60===0?(n>0?"-":"+")+ta(Math.abs(n)/60,2):Lr(n,t)}function Tw(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Math.floor(i/60),s=i%60;return s===0?e+String(r):e+String(r)+t+ta(s,2)}function Th(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const Mh=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Sc=36e5,kh=6e4,Mw=2,Ke={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Mh};function ea(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?Mw:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=kw(n),{year:r,restDateString:s}=Dw(i.date,e),a=Cw(s,r);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const l=a.getTime();let u=0,d;if(i.time&&(u=Ow(i.time),u===null||isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(d=Ds(i.timeZone||t.timeZone,new Date(l+u)),isNaN(d))return new Date(NaN)}else d=Th(new Date(l+u)),d=Th(new Date(l+u+d));return new Date(l+u+d)}else return new Date(NaN)}function kw(n){const t={};let e=Ke.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=Ke.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const r=Ke.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function Dw(n,t){if(n){const e=Ke.YYY[t],i=Ke.YYYYY[t];let r=Ke.YYYY.exec(n)||i.exec(n);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:n.slice(s.length)}}if(r=Ke.YY.exec(n)||e.exec(n),r){const s=r[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}}return{year:null}}function Cw(n,t){if(t===null)return null;let e,i,r;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let s=Ke.MM.exec(n);if(s)return e=new Date(0),i=parseInt(s[1],10)-1,Oh(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(s=Ke.DDD.exec(n),s){e=new Date(0);const a=parseInt(s[1],10);return Ew(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(s=Ke.MMDD.exec(n),s){e=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return Oh(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(s=Ke.Www.exec(n),s)return r=parseInt(s[1],10)-1,Ah(r)?Dh(t,r):new Date(NaN);if(s=Ke.WwwD.exec(n),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return Ah(r,a)?Dh(t,r,a):new Date(NaN)}return null}function Ow(n){let t,e,i=Ke.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Tc(t)?t%24*Sc:NaN;if(i=Ke.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Tc(t,e)?t%24*Sc+e*kh:NaN;if(i=Ke.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return Tc(t,e,r)?t%24*Sc+e*kh+r*1e3:NaN}return null}function Dh(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const r=i.getUTCDay()||7,s=t*7+e+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const Aw=[31,28,31,30,31,30,31,31,30,31,30,31],Rw=[31,29,31,30,31,30,31,31,30,31,30,31];function Ch(n){return n%400===0||n%4===0&&n%100!==0}function Oh(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=Ch(n);if(i&&e>Rw[t]||!i&&e>Aw[t])return!1}return!0}function Ew(n,t){if(t<1)return!1;const e=Ch(n);return!(e&&t>366||!e&&t>365)}function Ah(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Tc(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const Pw=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Iw(n,t,e={}){t=String(t);const i=t.match(Pw);if(i){const r=ea(e.originalDate||n,e);t=i.reduce(function(s,a){if(a[0]==="'")return s;const l=s.indexOf(a),u=s[l-1]==="'",d=s.replace(a,"'"+Sw[a[0]](r,a,e)+"'");return u?d.substring(0,l-1)+d.substring(l+1):d},t)}return iw(n,t,e)}function Rh(n,t,e){n=ea(n,e);const i=Ds(t,n,!0),r=new Date(n.getTime()-i),s=new Date(0);return s.setFullYear(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),s.setHours(r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()),s}function Eh(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Iw(Rh(n,t,{timeZone:i.timeZone}),e,i)}function Lw(n,t,e){if(typeof n=="string"&&!n.match(Mh))return ea(n,{...e,timeZone:t});n=ea(n,e);const i=bc(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),r=Ds(t,new Date(i));return new Date(i+r)}function Nw(n,t){return-Ds(n,t)}function Ph(n,t={}){const e=t?.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;let i="MMM dd, yyy hh:mm a";switch(t.format){case"short":i="MMM dd, yyyy";break;case"default":i="MMM dd, yyyy hh:mm a";break;case"full":i="MMM dd, yyyy hh:mm:ss.SSS a";break}return t.includeTZ&&(i+=" (z)"),Eh(n,e,i)}function Bw(n,t={}){if(!n)return n;const e=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let i="MMM dd, yyy hh:mm a";t.short&&(i="MMM dd, yyy"),t.includeTZ&&(i+=" (z)");const r=new Date(n);return Eh(r,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const Fw={secondly:1e3,tenSecondly:10*1e3,thirtySecondly:30*1e3,minutely:60*1e3,fiveMinutely:300*1e3,tenMinutely:600*1e3,thirtyMinutely:1800*1e3,hourly:3600*1e3,twoHourly:7200*1e3,twelveHourly:720*60*1e3,daily:3600*24*1e3,weekly:3600*24*7*1e3,trend:0};function na(n){return n&&Ub.find(t=>n<=Fw[t])||null}var ia=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ra={exports:{}};ra.exports;var Ih;function zw(){return Ih||(Ih=1,(function(n,t){var e=200,i="__lodash_hash_undefined__",r=9007199254740991,s="[object Arguments]",a="[object Array]",l="[object Boolean]",u="[object Date]",d="[object Error]",h="[object Function]",g="[object GeneratorFunction]",y="[object Map]",_="[object Number]",x="[object Object]",v="[object Promise]",M="[object RegExp]",C="[object Set]",R="[object String]",F="[object Symbol]",I="[object WeakMap]",L="[object ArrayBuffer]",N="[object DataView]",B="[object Float32Array]",T="[object Float64Array]",S="[object Int8Array]",O="[object Int16Array]",U="[object Int32Array]",$="[object Uint8Array]",it="[object Uint8ClampedArray]",at="[object Uint16Array]",ot="[object Uint32Array]",q=/[\\^$.*+?()[\]{}|]/g,J=/\w*$/,rt=/^\[object .+?Constructor\]$/,tt=/^(?:0|[1-9]\d*)$/,G={};G[s]=G[a]=G[L]=G[N]=G[l]=G[u]=G[B]=G[T]=G[S]=G[O]=G[U]=G[y]=G[_]=G[x]=G[M]=G[C]=G[R]=G[F]=G[$]=G[it]=G[at]=G[ot]=!0,G[d]=G[h]=G[I]=!1;var P=typeof ia=="object"&&ia&&ia.Object===Object&&ia,W=typeof self=="object"&&self&&self.Object===Object&&self,j=P||W||Function("return this")(),pt=t&&!t.nodeType&&t,lt=pt&&!0&&n&&!n.nodeType&&n,et=lt&<.exports===pt;function ht(D,V){return D.set(V[0],V[1]),D}function ft(D,V){return D.add(V),D}function ct(D,V){for(var Q=-1,yt=D?D.length:0;++Q<yt&&V(D[Q],Q,D)!==!1;);return D}function mt(D,V){for(var Q=-1,yt=V.length,Te=D.length;++Q<yt;)D[Te+Q]=V[Q];return D}function ut(D,V,Q,yt){for(var Te=-1,qe=D?D.length:0;++Te<qe;)Q=V(Q,D[Te],Te,D);return Q}function Lt(D,V){for(var Q=-1,yt=Array(D);++Q<D;)yt[Q]=V(Q);return yt}function zt(D,V){return D?.[V]}function vt(D){var V=!1;if(D!=null&&typeof D.toString!="function")try{V=!!(D+"")}catch{}return V}function Ct(D){var V=-1,Q=Array(D.size);return D.forEach(function(yt,Te){Q[++V]=[Te,yt]}),Q}function Dt(D,V){return function(Q){return D(V(Q))}}function ve(D){var V=-1,Q=Array(D.size);return D.forEach(function(yt){Q[++V]=yt}),Q}var bt=Array.prototype,qt=Function.prototype,Oe=Object.prototype,Ae=j["__core-js_shared__"],oe=(function(){var D=/[^.]+$/.exec(Ae&&Ae.keys&&Ae.keys.IE_PROTO||"");return D?"Symbol(src)_1."+D:""})(),ln=qt.toString,Vt=Oe.hasOwnProperty,Le=Oe.toString,ie=RegExp("^"+ln.call(Vt).replace(q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Se=et?j.Buffer:void 0,Re=j.Symbol,gn=j.Uint8Array,zi=Dt(Object.getPrototypeOf,Object),Dn=Object.create,Ye=Oe.propertyIsEnumerable,In=bt.splice,ci=Object.getOwnPropertySymbols,vo=Se?Se.isBuffer:void 0,So=Dt(Object.keys,Object),br=Gn(j,"DataView"),ui=Gn(j,"Map"),To=Gn(j,"Promise"),Mo=Gn(j,"Set"),ko=Gn(j,"WeakMap"),Ui=Gn(Object,"create"),hl=fi(br),dd=fi(ui),fd=fi(To),hd=fi(Mo),pd=fi(ko),Do=Re?Re.prototype:void 0,pl=Do?Do.valueOf:void 0;function di(D){var V=-1,Q=D?D.length:0;for(this.clear();++V<Q;){var yt=D[V];this.set(yt[0],yt[1])}}function gd(){this.__data__=Ui?Ui(null):{}}function Co(D){return this.has(D)&&delete this.__data__[D]}function md(D){var V=this.__data__;if(Ui){var Q=V[D];return Q===i?void 0:Q}return Vt.call(V,D)?V[D]:void 0}function Oo(D){var V=this.__data__;return Ui?V[D]!==void 0:Vt.call(V,D)}function yd(D,V){var Q=this.__data__;return Q[D]=Ui&&V===void 0?i:V,this}di.prototype.clear=gd,di.prototype.delete=Co,di.prototype.get=md,di.prototype.has=Oo,di.prototype.set=yd;function Ln(D){var V=-1,Q=D?D.length:0;for(this.clear();++V<Q;){var yt=D[V];this.set(yt[0],yt[1])}}function _d(){this.__data__=[]}function bd(D){var V=this.__data__,Q=xr(V,D);if(Q<0)return!1;var yt=V.length-1;return Q==yt?V.pop():In.call(V,Q,1),!0}function xd(D){var V=this.__data__,Q=xr(V,D);return Q<0?void 0:V[Q][1]}function gl(D){return xr(this.__data__,D)>-1}function wd(D,V){var Q=this.__data__,yt=xr(Q,D);return yt<0?Q.push([D,V]):Q[yt][1]=V,this}Ln.prototype.clear=_d,Ln.prototype.delete=bd,Ln.prototype.get=xd,Ln.prototype.has=gl,Ln.prototype.set=wd;function Hi(D){var V=-1,Q=D?D.length:0;for(this.clear();++V<Q;){var yt=D[V];this.set(yt[0],yt[1])}}function ml(){this.__data__={hash:new di,map:new(ui||Ln),string:new di}}function vd(D){return wr(this,D).delete(D)}function Sd(D){return wr(this,D).get(D)}function Td(D){return wr(this,D).has(D)}function Md(D,V){return wr(this,D).set(D,V),this}Hi.prototype.clear=ml,Hi.prototype.delete=vd,Hi.prototype.get=Sd,Hi.prototype.has=Td,Hi.prototype.set=Md;function Wi(D){this.__data__=new Ln(D)}function kd(){this.__data__=new Ln}function es(D){return this.__data__.delete(D)}function Dd(D){return this.__data__.get(D)}function ns(D){return this.__data__.has(D)}function Cd(D,V){var Q=this.__data__;if(Q instanceof Ln){var yt=Q.__data__;if(!ui||yt.length<e-1)return yt.push([D,V]),this;Q=this.__data__=new Hi(yt)}return Q.set(D,V),this}Wi.prototype.clear=kd,Wi.prototype.delete=es,Wi.prototype.get=Dd,Wi.prototype.has=ns,Wi.prototype.set=Cd;function Od(D,V){var Q=Io(D)||Al(D)?Lt(D.length,String):[],yt=Q.length,Te=!!yt;for(var qe in D)Vt.call(D,qe)&&!(Te&&(qe=="length"||kl(qe,yt)))&&Q.push(qe);return Q}function yl(D,V,Q){var yt=D[V];(!(Vt.call(D,V)&&Ol(yt,Q))||Q===void 0&&!(V in D))&&(D[V]=Q)}function xr(D,V){for(var Q=D.length;Q--;)if(Ol(D[Q][0],V))return Q;return-1}function _l(D,V){return D&&Ro(V,Lo(V),D)}function is(D,V,Q,yt,Te,qe,Nn){var Ne;if(yt&&(Ne=qe?yt(D,Te,qe,Nn):yt(D)),Ne!==void 0)return Ne;if(!ls(D))return D;var El=Io(D);if(El){if(Ne=Tl(D),!V)return Sl(D,Ne)}else{var ce=cn(D),cs=ce==h||ce==g;if(Ud(D))return xl(D,V);if(ce==x||ce==s||cs&&!qe){if(vt(D))return qe?D:{};if(Ne=Ml(cs?{}:D),!V)return Eo(D,_l(Ne,D))}else{if(!G[ce])return qe?D:{};Ne=Bd(D,ce,is,V)}}Nn||(Nn=new Wi);var Kn=Nn.get(D);if(Kn)return Kn;if(Nn.set(D,Ne),!El)var No=Q?Nd(D):Lo(D);return ct(No||D,function(vr,Be){No&&(Be=vr,vr=D[Be]),yl(Ne,Be,is(vr,V,Q,yt,Be,D,Nn))}),Ne}function Ad(D){return ls(D)?Dn(D):{}}function Rd(D,V,Q){var yt=V(D);return Io(D)?yt:mt(yt,Q(D))}function Ed(D){return Le.call(D)}function Pd(D){if(!ls(D)||Cl(D))return!1;var V=as(D)||vt(D)?ie:rt;return V.test(fi(D))}function bl(D){if(!Po(D))return So(D);var V=[];for(var Q in Object(D))Vt.call(D,Q)&&Q!="constructor"&&V.push(Q);return V}function xl(D,V){if(V)return D.slice();var Q=new D.constructor(D.length);return D.copy(Q),Q}function rs(D){var V=new D.constructor(D.byteLength);return new gn(V).set(new gn(D)),V}function Ao(D,V){var Q=V?rs(D.buffer):D.buffer;return new D.constructor(Q,D.byteOffset,D.byteLength)}function Id(D,V,Q){var yt=V?Q(Ct(D),!0):Ct(D);return ut(yt,ht,new D.constructor)}function wl(D){var V=new D.constructor(D.source,J.exec(D));return V.lastIndex=D.lastIndex,V}function ss(D,V,Q){var yt=V?Q(ve(D),!0):ve(D);return ut(yt,ft,new D.constructor)}function vl(D){return pl?Object(pl.call(D)):{}}function Ld(D,V){var Q=V?rs(D.buffer):D.buffer;return new D.constructor(Q,D.byteOffset,D.length)}function Sl(D,V){var Q=-1,yt=D.length;for(V||(V=Array(yt));++Q<yt;)V[Q]=D[Q];return V}function Ro(D,V,Q,yt){Q||(Q={});for(var Te=-1,qe=V.length;++Te<qe;){var Nn=V[Te],Ne=void 0;yl(Q,Nn,Ne===void 0?D[Nn]:Ne)}return Q}function Eo(D,V){return Ro(D,os(D),V)}function Nd(D){return Rd(D,Lo,os)}function wr(D,V){var Q=D.__data__;return Dl(V)?Q[typeof V=="string"?"string":"hash"]:Q.map}function Gn(D,V){var Q=zt(D,V);return Pd(Q)?Q:void 0}var os=ci?Dt(ci,Object):Vd,cn=Ed;(br&&cn(new br(new ArrayBuffer(1)))!=N||ui&&cn(new ui)!=y||To&&cn(To.resolve())!=v||Mo&&cn(new Mo)!=C||ko&&cn(new ko)!=I)&&(cn=function(D){var V=Le.call(D),Q=V==x?D.constructor:void 0,yt=Q?fi(Q):void 0;if(yt)switch(yt){case hl:return N;case dd:return y;case fd:return v;case hd:return C;case pd:return I}return V});function Tl(D){var V=D.length,Q=D.constructor(V);return V&&typeof D[0]=="string"&&Vt.call(D,"index")&&(Q.index=D.index,Q.input=D.input),Q}function Ml(D){return typeof D.constructor=="function"&&!Po(D)?Ad(zi(D)):{}}function Bd(D,V,Q,yt){var Te=D.constructor;switch(V){case L:return rs(D);case l:case u:return new Te(+D);case N:return Ao(D,yt);case B:case T:case S:case O:case U:case $:case it:case at:case ot:return Ld(D,yt);case y:return Id(D,yt,Q);case _:case R:return new Te(D);case M:return wl(D);case C:return ss(D,yt,Q);case F:return vl(D)}}function kl(D,V){return V=V??r,!!V&&(typeof D=="number"||tt.test(D))&&D>-1&&D%1==0&&D<V}function Dl(D){var V=typeof D;return V=="string"||V=="number"||V=="symbol"||V=="boolean"?D!=="__proto__":D===null}function Cl(D){return!!oe&&oe in D}function Po(D){var V=D&&D.constructor,Q=typeof V=="function"&&V.prototype||Oe;return D===Q}function fi(D){if(D!=null){try{return ln.call(D)}catch{}try{return D+""}catch{}}return""}function Fd(D){return is(D,!0,!0)}function Ol(D,V){return D===V||D!==D&&V!==V}function Al(D){return zd(D)&&Vt.call(D,"callee")&&(!Ye.call(D,"callee")||Le.call(D)==s)}var Io=Array.isArray;function Rl(D){return D!=null&&Hd(D.length)&&!as(D)}function zd(D){return Wd(D)&&Rl(D)}var Ud=vo||ee;function as(D){var V=ls(D)?Le.call(D):"";return V==h||V==g}function Hd(D){return typeof D=="number"&&D>-1&&D%1==0&&D<=r}function ls(D){var V=typeof D;return!!D&&(V=="object"||V=="function")}function Wd(D){return!!D&&typeof D=="object"}function Lo(D){return Rl(D)?Od(D):bl(D)}function Vd(){return[]}function ee(){return!1}n.exports=Fd})(ra,ra.exports)),ra.exports}zw();const Tn=(n,t)=>new Date(n.getTime()-Nw(t,n));class De{timeframeText;key;display;timeframeLength;allowedTiers;defaultResponseGranularity;dataGranularity;isRelative;fineGrainedDefaultGranularity;_startCustom;_endCustom;_allowedGranularitiesOverride;constructor(t){this.display=t.display,this.timeframeText=t.timeframeText,this.key=t.key,this.timeframeLength=t.timeframeLength,this.allowedTiers=t.allowedTiers,this.defaultResponseGranularity=t.defaultResponseGranularity,this.dataGranularity=t.dataGranularity,this.isRelative=t.isRelative,this._startCustom=t.startCustom,this._endCustom=t.endCustom,this._allowedGranularitiesOverride=t.allowedGranularitiesOverride,this.fineGrainedDefaultGranularity=t.fineGrainedDefaultGranularity}rawEnd(t){return this._endCustom||new Date}rawStart(t){return this._startCustom||new Date(this.rawEnd().getTime()-this.timeframeLengthMs())}timeframeLengthMs(){return this.timeframeLength()*1e3}maximumTimeframeLength(){return this.timeframeLength()}allowedGranularities(t){if(this._allowedGranularitiesOverride&&t)return new Set(this._allowedGranularitiesOverride);const e=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&e.add("minutely"),i>=2&&i<=168&&e.add("hourly"),i>=48&&e.add("daily"),i>=672&&e.add("weekly"),e}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const e=Lw(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Rh(e,t)}}class Uw extends De{rawStart(t){let e=Jn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Tn(e,t)),e}maximumTimeframeLength(){return 3600*24*7}}class Hw extends De{rawStart(t){let e=Ir(this.tzAdjustedDate(t));return t&&(e=Tn(e,t)),e}maximumTimeframeLength(){return 3600*24*31}}class Ww extends De{rawStart(t){let e=Pr(this.tzAdjustedDate(t));return t&&(e=Tn(e,t)),e}maximumTimeframeLength(){return 3600*24*92}}class Vw extends De{rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=Tn(e,t)),e}maximumTimeframeLength(){return 3600*24*366}}class $w extends De{rawEnd(t){let e=Jn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Tn(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=Jn(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=Tn(i,t)),i}}class Yw extends De{rawEnd(t){let e=Pr(this.tzAdjustedDate(t));return t&&(e=Tn(e,t)),e}rawStart(t){let e=Pr(yh(this.tzAdjustedDate(t)));return t&&(e=Tn(e,t)),e}}class qw extends De{rawEnd(t){let e=Ir(this.tzAdjustedDate(t));return t&&(e=Tn(e,t)),e}rawStart(t){let e=Ir(mh(this.tzAdjustedDate(t)));return t&&(e=Tn(e,t)),e}}class jw extends De{rawEnd(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=Tn(e,t)),e}rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(e=Tn(e,t)),e}}gt.FIFTEEN_MIN,new De({key:gt.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>900,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"thirtySecondly",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely"]}),gt.ONE_HOUR,new De({key:gt.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>3600*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"minutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely"]}),gt.SIX_HOUR,new De({key:gt.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>3600*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"fiveMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),gt.TWELVE_HOUR,new De({key:gt.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>3600*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"tenMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),gt.ONE_DAY,new De({key:gt.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>3600*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"thirtyMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),gt.SEVEN_DAY,new De({key:gt.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>3600*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),gt.THIRTY_DAY,new De({key:gt.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>3600*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twelveHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),gt.NINETY_DAY,new De({key:gt.NINETY_DAY,display:"Last 90 days",timeframeText:"90 days",timeframeLength:()=>3600*24*90,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),gt.ONE_HUNDRED_EIGHTY_DAY,new De({key:gt.ONE_HUNDRED_EIGHTY_DAY,display:"Last 180 days",timeframeText:"180 days",timeframeLength:()=>3600*24*180,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),gt.ONE_YEAR,new De({key:gt.ONE_YEAR,display:"Last 365 days",timeframeText:"365 days",timeframeLength:()=>3600*24*365,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),gt.CURRENT_WEEK,new Uw({key:gt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=Jn(new Date,{weekStartsOn:1});return(Rr(Jo(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),gt.CURRENT_MONTH,new Hw({key:gt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=Ir(new Date);return(Rr(Jo(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),gt.CURRENT_QUARTER,new Ww({key:gt.CURRENT_QUARTER,display:"This quarter",timeframeText:"Quarter",timeframeLength:()=>{const n=Pr(new Date);return(Rr(Jo(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),gt.CURRENT_YEAR,new Vw({key:gt.CURRENT_YEAR,display:"This year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1);return(Rr(Jo(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),gt.PREVIOUS_WEEK,new $w({key:gt.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>3600*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),gt.PREVIOUS_MONTH,new qw({key:gt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=Ir(new Date),e=Ir(mh(new Date));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=Lh(t,e)),3600*24*ow(new Date().setMonth(new Date().getMonth()-1))+gh(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),gt.PREVIOUS_QUARTER,new Yw({key:gt.PREVIOUS_QUARTER,display:"Previous quarter",timeframeText:"Quarter",timeframeLength:()=>{const n=Pr(new Date),t=Pr(yh(new Date));return(n.getTime()-t.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),gt.PREVIOUS_YEAR,new jw({key:gt.PREVIOUS_YEAR,display:"Previous year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1),t=new Date(new Date().getFullYear()-1,0,1);let e=0;return n.getTimezoneOffset()!==t.getTimezoneOffset()&&(e=Lh(n,t)),3600*24*(365+(t.getFullYear()%4===0?1:0))+gh(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Lh(n,t){return lw(n.getTimezoneOffset()-t.getTimezoneOffset())}gt.FIFTEEN_MIN,gt.ONE_HOUR,gt.SIX_HOUR,gt.TWELVE_HOUR,gt.ONE_DAY,gt.SEVEN_DAY,gt.FIFTEEN_MIN,gt.ONE_HOUR,gt.SIX_HOUR,gt.TWELVE_HOUR,gt.ONE_DAY,gt.SEVEN_DAY,gt.THIRTY_DAY,gt.NINETY_DAY,gt.ONE_HUNDRED_EIGHTY_DAY,gt.ONE_YEAR,gt.CURRENT_WEEK,gt.CURRENT_MONTH,gt.CURRENT_QUARTER,gt.CURRENT_YEAR,gt.PREVIOUS_WEEK,gt.PREVIOUS_MONTH,gt.PREVIOUS_QUARTER,gt.PREVIOUS_YEAR;const Gw=new Map(ih.map(n=>[n.code,{code:n.code,name:n.name}])),Mc=n=>Gw.get(n)?.name||n,Nh=1e3,Kw=1e4,Bh=1e6,Fh=1e9,zh=1e12,sa=(n,t)=>{if(t.separator===!1||n<1e3)return n.toString();const e=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(n).toString().split("").reverse().forEach((r,s)=>{s&&s%3===0&&i.push(e),i.push(r)}),i.reverse().join("")},Cs=(n,t,e)=>{const i=n/t,r=e.round?"round":"floor";if(e.decimal===!1)return Math[r](i).toString();let s;e.precision?s=i:s=i<10?Math[r](i*10)/10:Math[r](i);let a=s.toString();return typeof e.decimal=="string"&&(a=a.replace(".",e.decimal)),a};function oa(n,t={}){let e;const i=n<0;i&&(n=Math.abs(n)),t.precision&&(n=parseFloat(n.toPrecision(t.precision)));const r=t.min10k?Kw:Nh;return n<r||t.precision&&t.precision>Math.log10(n)?e=sa(Cs(n,1,t),t):n<Bh?e=`${Cs(n,Nh,t)}k`:n<Fh?e=`${Cs(n,Bh,t)}m`:n<zh?e=`${sa(Cs(n,Fh,t),t)}b`:e=`${sa(Cs(n,zh,t),t)}t`,i&&(e=`-${e}`),t.capital&&(e=e.toUpperCase()),t.prefix&&(e=`${t.prefix}${e}`),t.suffix&&(e=`${e}${t.suffix}`),e}oa.addCommas=sa;const Xw=typeof document<"u"&&document.documentElement?.lang||"en-US",aa=new Intl.NumberFormat(Xw);function er({i18n:n}){const t=(i,r)=>{if(isNaN(i))return"0 B";const s=r?Math.pow(2,50):1e15,a=r?Math.pow(2,40):1e12,l=r?Math.pow(2,30):1e9,u=r?Math.pow(2,20):1e6,d=r?Math.pow(2,10):1e3;let h;return i>=s?h=n.formatNumber(Number.parseFloat((i/s).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):i>=a?h=n.formatNumber(Number.parseFloat((i/a).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):i>=l?h=n.formatNumber(Number.parseFloat((i/l).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):i>=u?h=n.formatNumber(Number.parseFloat((i/u).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):i>=d?h=n.formatNumber(Number.parseFloat((i/d).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):h=n.formatNumber(Number.parseFloat(i.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),h.replace(/([a-zA-Z]*)$/," $1")},e=(i,r="USD")=>isNaN(i)?r==="USD"?"$0.00":`${i}`:i>=.01||r!=="USD"?n.formatNumber(i,{style:"currency",currency:r}):i<1e-4?"< $0.0001":`$${Number.parseFloat(i.toPrecision(4))}`;return{formatUnit:(i,r,{isBytes1024:s=!1,currency:a="USD",approximate:l=!1,translateUnit:u=d=>d}={})=>{const d=u(r,i);switch(r){case"bytes":return t(i,s);case"usd":return e(i,a);default:return isNaN(i)?`${i}`:l?`${oa(i,{capital:!0})} ${d}`:i>=.01?`${aa.format(Number.parseFloat(i.toFixed(2)))} ${d}`:`${Number.parseFloat(i.toPrecision(4))} ${d}`}},formatBytes:t,formatCost:e,formatRange:(i,r,s,{isBytes1024:a=!1,currency:l="USD",approximate:u=!1,translateUnit:d=h=>h}={})=>{const h=d(s,r);switch(s){case"bytes":return`${t(i,a)} - ${t(r,a)}`;case"usd":return`${e(i,l)} - ${e(r,l)}`;default:if(isNaN(i)||isNaN(r))return`${i} - ${r}`;if(u)return`${oa(i,{capital:!0})} - ${oa(r,{capital:!0})} ${h}`}const g=i>=.01?`${aa.format(Number.parseFloat(i.toFixed(2)))}`:`${Number.parseFloat(i.toPrecision(4))}`,y=r>=.01?`${aa.format(Number.parseFloat(r.toFixed(2)))}`:`${Number.parseFloat(r.toPrecision(4))}`;return`${g} - ${y} ${h}`}}}const Uh="#d60027",Hh="#ffe5e5",Zw="#f1f0ff",Qw="#e0e4ea",Wh="#6c7489",Jw="#afb7c5",Vh="#0d0e14",tv="#d60027",ev="#ad000e",kc="#6c7489",$h="#52596e",nv="#007d60",iv="#995c00",rv="#ffc400",sv="'Inter', Roboto, Helvetica, sans-serif",Os="16px",ov="20px",av="#bee2ff",lv="#8fc1ff",cv="#5f9aff",uv="#306fff",dv="#b5ffee",fv="#00fabe",hv="#00d6a4",pv="#00a17b",gv="#007d60",mv="#005944",yv="#b5ffee",_v="#00fabe",bv="#b5ffee",xv="#00a17b",wv="#fff296",vv="#ffe04b",Sv="#ffc400",Tv="#b37600",Mv="#995c00",kv="#804400",Dv="#fff296",Cv="#ffe04b",Ov="#ffc2b3",Av="#ff9877",Rv="#ff723c",Ev="#f75008",Pv="#d13500",Iv="#a31f00",Lv="#ffc2b3",Nv="#ff9877",Bv="#ff723c",Fv="#f75008",zv="#d13500",Uv="#a31f00",Hv="#ffc2b3",Wv="#ff9877",Vv="#ff723c",$v="#f75008",Yv="#d13500",qv="#a31f00",jv="#ffc2b3",Gv="#ff9877",Kv="#ff723c",Xv="#f75008",Zv="#d13500",Qv="#a31f00",Jv="#ffc2b3",t1="#ff9877",e1="#ff723c",n1="#f75008",i1="#d13500",r1="#ffabab",s1="#ff7272",o1="#ff3954",a1="#f50045",l1="#d60027",c1="#ad000e",u1="#ffabab",d1="#ff7272",f1="#ff3954",h1="#f50045",p1="#d60027",g1="#eefaff",m1="#ecfffb",y1="#fffce0",_1="#fff1ef",b1="#ffe5e5",x1="#5f9aff",w1="#00d6a4",v1="#ffc400",S1="#ff723c",T1="#ff3954",Yh=6048e5,M1=864e5,As=6e4,Nr=36e5,k1=1e3,qh=Symbol.for("constructDateFrom");function he(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&qh in n?n[qh](t):n instanceof Date?new n.constructor(t):new Date(t)}function At(n,t){return he(t||n,n)}function la(n,t,e){const i=At(n,e?.in);return isNaN(t)?he(e?.in||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function Dc(n,t,e){const i=At(n,e?.in);if(isNaN(t))return he(n,NaN);if(!t)return i;const r=i.getDate(),s=he(n,i.getTime());s.setMonth(i.getMonth()+t+1,0);const a=s.getDate();return r>=a?s:(i.setFullYear(s.getFullYear(),s.getMonth(),r),i)}function Cc(n,t,e){return he(n,+At(n)+t)}function D1(n,t,e){return Cc(n,t*Nr)}let C1={};function nr(){return C1}function Wn(n,t){const e=nr(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=At(n,t?.in),s=r.getDay(),a=(s<i?7:0)+s-i;return r.setDate(r.getDate()-a),r.setHours(0,0,0,0),r}function Br(n,t){return Wn(n,{...t,weekStartsOn:1})}function jh(n,t){const e=At(n,t?.in),i=e.getFullYear(),r=he(e,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=Br(r),a=he(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=Br(a);return e.getTime()>=s.getTime()?i+1:e.getTime()>=l.getTime()?i:i-1}function ca(n){const t=At(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function ir(n,...t){const e=he.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Oc(n,t){const e=At(n,t?.in);return e.setHours(0,0,0,0),e}function Gh(n,t,e){const[i,r]=ir(e?.in,n,t),s=Oc(i),a=Oc(r),l=+s-ca(s),u=+a-ca(a);return Math.round((l-u)/M1)}function O1(n,t){const e=jh(n,t),i=he(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Br(i)}function A1(n,t,e){const i=At(n,e?.in);return i.setTime(i.getTime()+t*As),i}function R1(n,t,e){return Dc(n,t*3,e)}function E1(n,t,e){return Cc(n,t*1e3)}function P1(n,t,e){return la(n,t*7,e)}function I1(n,t,e){return Dc(n,t*12,e)}function Rs(n,t){const e=+At(n)-+At(t);return e<0?-1:e>0?1:e}function L1(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Ac(n){return!(!L1(n)&&typeof n!="number"||isNaN(+At(n)))}function N1(n,t,e){const[i,r]=ir(e?.in,n,t),s=i.getFullYear()-r.getFullYear(),a=i.getMonth()-r.getMonth();return s*12+a}function B1(n,t,e){const[i,r]=ir(e?.in,n,t);return i.getFullYear()-r.getFullYear()}function Kh(n,t,e){const[i,r]=ir(e?.in,n,t),s=Xh(i,r),a=Math.abs(Gh(i,r));i.setDate(i.getDate()-s*a);const l=+(Xh(i,r)===-s),u=s*(a-l);return u===0?0:u}function Xh(n,t){const e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function Es(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function F1(n,t,e){const[i,r]=ir(e?.in,n,t),s=(+i-+r)/Nr;return Es(e?.roundingMethod)(s)}function Rc(n,t){return+At(n)-+At(t)}function z1(n,t,e){const i=Rc(n,t)/As;return Es(e?.roundingMethod)(i)}function Zh(n,t){const e=At(n,t?.in);return e.setHours(23,59,59,999),e}function Qh(n,t){const e=At(n,t?.in),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function U1(n,t){const e=At(n,t?.in);return+Zh(e,t)==+Qh(e,t)}function Jh(n,t,e){const[i,r,s]=ir(e?.in,n,n,t),a=Rs(r,s),l=Math.abs(N1(r,s));if(l<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-a*l);let u=Rs(r,s)===-a;U1(i)&&l===1&&Rs(i,s)===1&&(u=!1);const d=a*(l-+u);return d===0?0:d}function H1(n,t,e){const i=Jh(n,t,e)/3;return Es(e?.roundingMethod)(i)}function W1(n,t,e){const i=Rc(n,t)/1e3;return Es(e?.roundingMethod)(i)}function V1(n,t,e){const i=Kh(n,t,e)/7;return Es(e?.roundingMethod)(i)}function $1(n,t,e){const[i,r]=ir(e?.in,n,t),s=Rs(i,r),a=Math.abs(B1(i,r));i.setFullYear(1584),r.setFullYear(1584);const l=Rs(i,r)===-s,u=s*(a-+l);return u===0?0:u}function Y1(n,t){const e=At(n,t?.in),i=e.getMonth(),r=i-i%3;return e.setMonth(r,1),e.setHours(0,0,0,0),e}function q1(n,t){const e=At(n,t?.in);return e.setDate(1),e.setHours(0,0,0,0),e}function j1(n,t){const e=At(n,t?.in),i=e.getFullYear();return e.setFullYear(i+1,0,0),e.setHours(23,59,59,999),e}function tp(n,t){const e=At(n,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function G1(n,t){const e=At(n,t?.in);return e.setMinutes(59,59,999),e}function K1(n,t){const e=nr(),i=e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=At(n,t?.in),s=r.getDay(),a=(s<i?-7:0)+6-(s-i);return r.setDate(r.getDate()+a),r.setHours(23,59,59,999),r}function X1(n,t){const e=At(n,t?.in);return e.setSeconds(59,999),e}function Z1(n,t){const e=At(n,t?.in),i=e.getMonth(),r=i-i%3+3;return e.setMonth(r,0),e.setHours(23,59,59,999),e}function Q1(n,t){const e=At(n,t?.in);return e.setMilliseconds(999),e}const J1={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},tS=(n,t,e)=>{let i;const r=J1[n];return typeof r=="string"?i=r:t===1?i=r.one:i=r.other.replace("{{count}}",t.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Ec(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const eS={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},nS={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},iS={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},rS={date:Ec({formats:eS,defaultWidth:"full"}),time:Ec({formats:nS,defaultWidth:"full"}),dateTime:Ec({formats:iS,defaultWidth:"full"})},sS={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},oS=(n,t,e,i)=>sS[n];function Ps(n){return(t,e)=>{const i=e?.context?String(e.context):"standalone";let r;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,l=e?.width?String(e.width):a;r=n.formattingValues[l]||n.formattingValues[a]}else{const a=n.defaultWidth,l=e?.width?String(e.width):n.defaultWidth;r=n.values[l]||n.values[a]}const s=n.argumentCallback?n.argumentCallback(t):t;return r[s]}}const aS={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},lS={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},cS={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},uS={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},dS={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},fS={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},hS={ordinalNumber:(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:Ps({values:aS,defaultWidth:"wide"}),quarter:Ps({values:lS,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Ps({values:cS,defaultWidth:"wide"}),day:Ps({values:uS,defaultWidth:"wide"}),dayPeriod:Ps({values:dS,defaultWidth:"wide",formattingValues:fS,defaultFormattingWidth:"wide"})};function Is(n){return(t,e={})=>{const i=e.width,r=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],s=t.match(r);if(!s)return null;const a=s[0],l=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],u=Array.isArray(l)?gS(l,g=>g.test(a)):pS(l,g=>g.test(a));let d;d=n.valueCallback?n.valueCallback(u):u,d=e.valueCallback?e.valueCallback(d):d;const h=t.slice(a.length);return{value:d,rest:h}}}function pS(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function gS(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function mS(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const r=i[0],s=t.match(n.parsePattern);if(!s)return null;let a=n.valueCallback?n.valueCallback(s[0]):s[0];a=e.valueCallback?e.valueCallback(a):a;const l=t.slice(r.length);return{value:a,rest:l}}}const yS=/^(\d+)(th|st|nd|rd)?/i,_S=/\d+/i,bS={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},xS={any:[/^b/i,/^(a|c)/i]},wS={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},vS={any:[/1/i,/2/i,/3/i,/4/i]},SS={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},TS={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},MS={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},kS={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},DS={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},CS={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},OS={ordinalNumber:mS({matchPattern:yS,parsePattern:_S,valueCallback:n=>parseInt(n,10)}),era:Is({matchPatterns:bS,defaultMatchWidth:"wide",parsePatterns:xS,defaultParseWidth:"any"}),quarter:Is({matchPatterns:wS,defaultMatchWidth:"wide",parsePatterns:vS,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Is({matchPatterns:SS,defaultMatchWidth:"wide",parsePatterns:TS,defaultParseWidth:"any"}),day:Is({matchPatterns:MS,defaultMatchWidth:"wide",parsePatterns:kS,defaultParseWidth:"any"}),dayPeriod:Is({matchPatterns:DS,defaultMatchWidth:"any",parsePatterns:CS,defaultParseWidth:"any"})},ep={code:"en-US",formatDistance:tS,formatLong:rS,formatRelative:oS,localize:hS,match:OS,options:{weekStartsOn:0,firstWeekContainsDate:1}};function AS(n,t){const e=At(n,t?.in);return Gh(e,tp(e))+1}function np(n,t){const e=At(n,t?.in),i=+Br(e)-+O1(e);return Math.round(i/Yh)+1}function Pc(n,t){const e=At(n,t?.in),i=e.getFullYear(),r=nr(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=he(t?.in||n,0);a.setFullYear(i+1,0,s),a.setHours(0,0,0,0);const l=Wn(a,t),u=he(t?.in||n,0);u.setFullYear(i,0,s),u.setHours(0,0,0,0);const d=Wn(u,t);return+e>=+l?i+1:+e>=+d?i:i-1}function RS(n,t){const e=nr(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??e.firstWeekContainsDate??e.locale?.options?.firstWeekContainsDate??1,r=Pc(n,t),s=he(t?.in||n,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),Wn(s,t)}function ip(n,t){const e=At(n,t?.in),i=+Wn(e,t)-+RS(e,t);return Math.round(i/Yh)+1}function Zt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const vi={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Zt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Zt(e+1,2)},d(n,t){return Zt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Zt(n.getHours()%12||12,t.length)},H(n,t){return Zt(n.getHours(),t.length)},m(n,t){return Zt(n.getMinutes(),t.length)},s(n,t){return Zt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),r=Math.trunc(i*Math.pow(10,e-3));return Zt(r,t.length)}},Fr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},rp={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),r=i>0?i:1-i;return e.ordinalNumber(r,{unit:"year"})}return vi.y(n,t)},Y:function(n,t,e,i){const r=Pc(n,i),s=r>0?r:1-r;if(t==="YY"){const a=s%100;return Zt(a,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):Zt(s,t.length)},R:function(n,t){const e=jh(n);return Zt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Zt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Zt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Zt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return vi.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Zt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const r=ip(n,i);return t==="wo"?e.ordinalNumber(r,{unit:"week"}):Zt(r,t.length)},I:function(n,t,e){const i=np(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Zt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):vi.d(n,t)},D:function(n,t,e){const i=AS(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Zt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const r=n.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Zt(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});case"eee":return e.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(r,{width:"short",context:"formatting"});default:return e.day(r,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const r=n.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Zt(s,t.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(r,{width:"narrow",context:"standalone"});case"cccccc":return e.day(r,{width:"short",context:"standalone"});default:return e.day(r,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),r=i===0?7:i;switch(t){case"i":return String(r);case"ii":return Zt(r,t.length);case"io":return e.ordinalNumber(r,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const r=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let r;switch(i===12?r=Fr.noon:i===0?r=Fr.midnight:r=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let r;switch(i>=17?r=Fr.evening:i>=12?r=Fr.afternoon:i>=4?r=Fr.morning:r=Fr.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return vi.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):vi.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Zt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Zt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):vi.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):vi.s(n,t)},S:function(n,t){return vi.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return op(i);case"XXXX":case"XX":return rr(i);default:return rr(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return op(i);case"xxxx":case"xx":return rr(i);default:return rr(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+sp(i,":");default:return"GMT"+rr(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+sp(i,":");default:return"GMT"+rr(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Zt(i,t.length)},T:function(n,t,e){return Zt(+n,t.length)}};function sp(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Math.trunc(i/60),s=i%60;return s===0?e+String(r):e+String(r)+t+Zt(s,2)}function op(n,t){return n%60===0?(n>0?"-":"+")+Zt(Math.abs(n)/60,2):rr(n,t)}function rr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Zt(Math.trunc(i/60),2),s=Zt(i%60,2);return e+r+t+s}const ap=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},lp=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},Ic={p:lp,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],r=e[2];if(!r)return ap(n,t);let s;switch(i){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",ap(i,t)).replace("{{time}}",lp(r,t))}},ES=/^D+$/,PS=/^Y+$/,IS=["D","DD","YY","YYYY"];function cp(n){return ES.test(n)}function up(n){return PS.test(n)}function Lc(n,t,e){const i=LS(n,t,e);if(console.warn(i),IS.includes(n))throw new RangeError(i)}function LS(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const NS=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,BS=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,FS=/^'([^]*?)'?$/,zS=/''/g,US=/[a-zA-Z]/;function ua(n,t,e){const i=nr(),r=e?.locale??i.locale??ep,s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,l=At(n,e?.in);if(!Ac(l))throw new RangeError("Invalid time value");let u=t.match(BS).map(h=>{const g=h[0];if(g==="p"||g==="P"){const y=Ic[g];return y(h,r.formatLong)}return h}).join("").match(NS).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const g=h[0];if(g==="'")return{isToken:!1,value:HS(h)};if(rp[g])return{isToken:!0,value:h};if(g.match(US))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:h}});r.localize.preprocessor&&(u=r.localize.preprocessor(l,u));const d={firstWeekContainsDate:s,weekStartsOn:a,locale:r};return u.map(h=>{if(!h.isToken)return h.value;const g=h.value;(!e?.useAdditionalWeekYearTokens&&up(g)||!e?.useAdditionalDayOfYearTokens&&cp(g))&&Lc(g,t,String(n));const y=rp[g[0]];return y(l,g,r.localize,d)}).join("")}function HS(n){const t=n.match(FS);return t?t[1].replace(zS,"'"):n}function dp(){return Object.assign({},nr())}function WS(n,t){const e=At(n,t?.in).getDay();return e===0?7:e}function VS(n,t){const e=$S(t)?new t(0):he(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function $S(n){return typeof n=="function"&&n.prototype?.constructor===n}const YS=10;class fp{subPriority=0;validate(t,e){return!0}}class qS extends fp{constructor(t,e,i,r,s){super(),this.value=t,this.validateValue=e,this.setValue=i,this.priority=r,s&&(this.subPriority=s)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,i){return this.setValue(t,e,this.value,i)}}class jS extends fp{priority=YS;subPriority=-1;constructor(t,e){super(),this.context=t||(i=>he(e,i))}set(t,e){return e.timestampIsSet?t:he(t,VS(t,this.context))}}class Wt{run(t,e,i,r){const s=this.parse(t,e,i,r);return s?{setter:new qS(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(t,e,i){return!0}}class GS extends Wt{priority=140;parse(t,e,i){switch(e){case"G":case"GG":case"GGG":return i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"});case"GGGGG":return i.era(t,{width:"narrow"});default:return i.era(t,{width:"wide"})||i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"})}}set(t,e,i){return e.era=i,t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]}const me={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Vn={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function ye(n,t){return n&&{value:t(n.value),rest:n.rest}}function de(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function $n(n,t){const e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};const i=e[1]==="+"?1:-1,r=e[2]?parseInt(e[2],10):0,s=e[3]?parseInt(e[3],10):0,a=e[5]?parseInt(e[5],10):0;return{value:i*(r*Nr+s*As+a*k1),rest:t.slice(e[0].length)}}function hp(n){return de(me.anyDigitsSigned,n)}function pe(n,t){switch(n){case 1:return de(me.singleDigit,t);case 2:return de(me.twoDigits,t);case 3:return de(me.threeDigits,t);case 4:return de(me.fourDigits,t);default:return de(new RegExp("^\\d{1,"+n+"}"),t)}}function da(n,t){switch(n){case 1:return de(me.singleDigitSigned,t);case 2:return de(me.twoDigitsSigned,t);case 3:return de(me.threeDigitsSigned,t);case 4:return de(me.fourDigitsSigned,t);default:return de(new RegExp("^-?\\d{1,"+n+"}"),t)}}function Nc(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function pp(n,t){const e=t>0,i=e?t:1-t;let r;if(i<=50)r=n||100;else{const s=i+50,a=Math.trunc(s/100)*100,l=n>=s%100;r=n+a-(l?100:0)}return e?r:1-r}function gp(n){return n%400===0||n%4===0&&n%100!==0}class KS extends Wt{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,i){const r=s=>({year:s,isTwoDigitYear:e==="yy"});switch(e){case"y":return ye(pe(4,t),r);case"yo":return ye(i.ordinalNumber(t,{unit:"year"}),r);default:return ye(pe(e.length,t),r)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,i){const r=t.getFullYear();if(i.isTwoDigitYear){const a=pp(i.year,r);return t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}const s=!("era"in e)||e.era===1?i.year:1-i.year;return t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}}class XS extends Wt{priority=130;parse(t,e,i){const r=s=>({year:s,isTwoDigitYear:e==="YY"});switch(e){case"Y":return ye(pe(4,t),r);case"Yo":return ye(i.ordinalNumber(t,{unit:"year"}),r);default:return ye(pe(e.length,t),r)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,i,r){const s=Pc(t,r);if(i.isTwoDigitYear){const l=pp(i.year,s);return t.setFullYear(l,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),Wn(t,r)}const a=!("era"in e)||e.era===1?i.year:1-i.year;return t.setFullYear(a,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),Wn(t,r)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class ZS extends Wt{priority=130;parse(t,e){return da(e==="R"?4:e.length,t)}set(t,e,i){const r=he(t,0);return r.setFullYear(i,0,4),r.setHours(0,0,0,0),Br(r)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class QS extends Wt{priority=130;parse(t,e){return da(e==="u"?4:e.length,t)}set(t,e,i){return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class JS extends Wt{priority=120;parse(t,e,i){switch(e){case"Q":case"QQ":return pe(e.length,t);case"Qo":return i.ordinalNumber(t,{unit:"quarter"});case"QQQ":return i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return i.quarter(t,{width:"narrow",context:"formatting"});default:return i.quarter(t,{width:"wide",context:"formatting"})||i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=1&&e<=4}set(t,e,i){return t.setMonth((i-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class tT extends Wt{priority=120;parse(t,e,i){switch(e){case"q":case"qq":return pe(e.length,t);case"qo":return i.ordinalNumber(t,{unit:"quarter"});case"qqq":return i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return i.quarter(t,{width:"narrow",context:"standalone"});default:return i.quarter(t,{width:"wide",context:"standalone"})||i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=1&&e<=4}set(t,e,i){return t.setMonth((i-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class eT extends Wt{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,i){const r=s=>s-1;switch(e){case"M":return ye(de(me.month,t),r);case"MM":return ye(pe(2,t),r);case"Mo":return ye(i.ordinalNumber(t,{unit:"month"}),r);case"MMM":return i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return i.month(t,{width:"narrow",context:"formatting"});default:return i.month(t,{width:"wide",context:"formatting"})||i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=11}set(t,e,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}}class nT extends Wt{priority=110;parse(t,e,i){const r=s=>s-1;switch(e){case"L":return ye(de(me.month,t),r);case"LL":return ye(pe(2,t),r);case"Lo":return ye(i.ordinalNumber(t,{unit:"month"}),r);case"LLL":return i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return i.month(t,{width:"narrow",context:"standalone"});default:return i.month(t,{width:"wide",context:"standalone"})||i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=11}set(t,e,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function iT(n,t,e){const i=At(n,e?.in),r=ip(i,e)-t;return i.setDate(i.getDate()-r*7),At(i,e?.in)}class rT extends Wt{priority=100;parse(t,e,i){switch(e){case"w":return de(me.week,t);case"wo":return i.ordinalNumber(t,{unit:"week"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,i,r){return Wn(iT(t,i,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function sT(n,t,e){const i=At(n,e?.in),r=np(i,e)-t;return i.setDate(i.getDate()-r*7),i}class oT extends Wt{priority=100;parse(t,e,i){switch(e){case"I":return de(me.week,t);case"Io":return i.ordinalNumber(t,{unit:"week"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,i){return Br(sT(t,i))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const aT=[31,28,31,30,31,30,31,31,30,31,30,31],lT=[31,29,31,30,31,30,31,31,30,31,30,31];class cT extends Wt{priority=90;subPriority=1;parse(t,e,i){switch(e){case"d":return de(me.date,t);case"do":return i.ordinalNumber(t,{unit:"date"});default:return pe(e.length,t)}}validate(t,e){const i=t.getFullYear(),r=gp(i),s=t.getMonth();return r?e>=1&&e<=lT[s]:e>=1&&e<=aT[s]}set(t,e,i){return t.setDate(i),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class uT extends Wt{priority=90;subpriority=1;parse(t,e,i){switch(e){case"D":case"DD":return de(me.dayOfYear,t);case"Do":return i.ordinalNumber(t,{unit:"date"});default:return pe(e.length,t)}}validate(t,e){const i=t.getFullYear();return gp(i)?e>=1&&e<=366:e>=1&&e<=365}set(t,e,i){return t.setMonth(0,i),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function Bc(n,t,e){const i=nr(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,s=At(n,e?.in),a=s.getDay(),u=(t%7+7)%7,d=7-r,h=t<0||t>6?t-(a+d)%7:(u+d)%7-(a+d)%7;return la(s,h,e)}class dT extends Wt{priority=90;parse(t,e,i){switch(e){case"E":case"EE":case"EEE":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return i.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,i,r){return t=Bc(t,i,r),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class fT extends Wt{priority=90;parse(t,e,i,r){const s=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(e){case"e":case"ee":return ye(pe(e.length,t),s);case"eo":return ye(i.ordinalNumber(t,{unit:"day"}),s);case"eee":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"eeeee":return i.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,i,r){return t=Bc(t,i,r),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class hT extends Wt{priority=90;parse(t,e,i,r){const s=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(e){case"c":case"cc":return ye(pe(e.length,t),s);case"co":return ye(i.ordinalNumber(t,{unit:"day"}),s);case"ccc":return i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});case"ccccc":return i.day(t,{width:"narrow",context:"standalone"});case"cccccc":return i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});default:return i.day(t,{width:"wide",context:"standalone"})||i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=6}set(t,e,i,r){return t=Bc(t,i,r),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function pT(n,t,e){const i=At(n,e?.in),r=WS(i,e),s=t-r;return la(i,s,e)}class gT extends Wt{priority=90;parse(t,e,i){const r=s=>s===0?7:s;switch(e){case"i":case"ii":return pe(e.length,t);case"io":return i.ordinalNumber(t,{unit:"day"});case"iii":return ye(i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),r);case"iiiii":return ye(i.day(t,{width:"narrow",context:"formatting"}),r);case"iiiiii":return ye(i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),r);default:return ye(i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),r)}}validate(t,e){return e>=1&&e<=7}set(t,e,i){return t=pT(t,i),t.setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class mT extends Wt{priority=80;parse(t,e,i){switch(e){case"a":case"aa":case"aaa":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,i){return t.setHours(Nc(i),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class yT extends Wt{priority=80;parse(t,e,i){switch(e){case"b":case"bb":case"bbb":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,i){return t.setHours(Nc(i),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class _T extends Wt{priority=80;parse(t,e,i){switch(e){case"B":case"BB":case"BBB":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,i){return t.setHours(Nc(i),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class bT extends Wt{priority=70;parse(t,e,i){switch(e){case"h":return de(me.hour12h,t);case"ho":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,i){const r=t.getHours()>=12;return r&&i<12?t.setHours(i+12,0,0,0):!r&&i===12?t.setHours(0,0,0,0):t.setHours(i,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]}class xT extends Wt{priority=70;parse(t,e,i){switch(e){case"H":return de(me.hour23h,t);case"Ho":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,i){return t.setHours(i,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]}class wT extends Wt{priority=70;parse(t,e,i){switch(e){case"K":return de(me.hour11h,t);case"Ko":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,i){return t.getHours()>=12&&i<12?t.setHours(i+12,0,0,0):t.setHours(i,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]}class vT extends Wt{priority=70;parse(t,e,i){switch(e){case"k":return de(me.hour24h,t);case"ko":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,i){const r=i<=24?i%24:i;return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]}class ST extends Wt{priority=60;parse(t,e,i){switch(e){case"m":return de(me.minute,t);case"mo":return i.ordinalNumber(t,{unit:"minute"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,i){return t.setMinutes(i,0,0),t}incompatibleTokens=["t","T"]}class TT extends Wt{priority=50;parse(t,e,i){switch(e){case"s":return de(me.second,t);case"so":return i.ordinalNumber(t,{unit:"second"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,i){return t.setSeconds(i,0),t}incompatibleTokens=["t","T"]}class MT extends Wt{priority=30;parse(t,e){const i=r=>Math.trunc(r*Math.pow(10,-e.length+3));return ye(pe(e.length,t),i)}set(t,e,i){return t.setMilliseconds(i),t}incompatibleTokens=["t","T"]}class kT extends Wt{priority=10;parse(t,e){switch(e){case"X":return $n(Vn.basicOptionalMinutes,t);case"XX":return $n(Vn.basic,t);case"XXXX":return $n(Vn.basicOptionalSeconds,t);case"XXXXX":return $n(Vn.extendedOptionalSeconds,t);default:return $n(Vn.extended,t)}}set(t,e,i){return e.timestampIsSet?t:he(t,t.getTime()-ca(t)-i)}incompatibleTokens=["t","T","x"]}class DT extends Wt{priority=10;parse(t,e){switch(e){case"x":return $n(Vn.basicOptionalMinutes,t);case"xx":return $n(Vn.basic,t);case"xxxx":return $n(Vn.basicOptionalSeconds,t);case"xxxxx":return $n(Vn.extendedOptionalSeconds,t);default:return $n(Vn.extended,t)}}set(t,e,i){return e.timestampIsSet?t:he(t,t.getTime()-ca(t)-i)}incompatibleTokens=["t","T","X"]}class CT extends Wt{priority=40;parse(t){return hp(t)}set(t,e,i){return[he(t,i*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class OT extends Wt{priority=20;parse(t){return hp(t)}set(t,e,i){return[he(t,i),{timestampIsSet:!0}]}incompatibleTokens="*"}const AT={G:new GS,y:new KS,Y:new XS,R:new ZS,u:new QS,Q:new JS,q:new tT,M:new eT,L:new nT,w:new rT,I:new oT,d:new cT,D:new uT,E:new dT,e:new fT,c:new hT,i:new gT,a:new mT,b:new yT,B:new _T,h:new bT,H:new xT,K:new wT,k:new vT,m:new ST,s:new TT,S:new MT,X:new kT,x:new DT,t:new CT,T:new OT},RT=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ET=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,PT=/^'([^]*?)'?$/,IT=/''/g,LT=/\S/,NT=/[a-zA-Z]/;function BT(n,t,e,i){const r=()=>he(i?.in||e,NaN),s=dp(),a=i?.locale??s.locale??ep,l=i?.firstWeekContainsDate??i?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,u=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0;if(!t)return n?r():At(e,i?.in);const d={firstWeekContainsDate:l,weekStartsOn:u,locale:a},h=[new jS(i?.in,e)],g=t.match(ET).map(M=>{const C=M[0];if(C in Ic){const R=Ic[C];return R(M,a.formatLong)}return M}).join("").match(RT),y=[];for(let M of g){!i?.useAdditionalWeekYearTokens&&up(M)&&Lc(M,t,n),!i?.useAdditionalDayOfYearTokens&&cp(M)&&Lc(M,t,n);const C=M[0],R=AT[C];if(R){const{incompatibleTokens:F}=R;if(Array.isArray(F)){const L=y.find(N=>F.includes(N.token)||N.token===C);if(L)throw new RangeError(`The format string mustn't contain \`${L.fullToken}\` and \`${M}\` at the same time`)}else if(R.incompatibleTokens==="*"&&y.length>0)throw new RangeError(`The format string mustn't contain \`${M}\` and any other token at the same time`);y.push({token:C,fullToken:M});const I=R.run(n,M,a.match,d);if(!I)return r();h.push(I.setter),n=I.rest}else{if(C.match(NT))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");if(M==="''"?M="'":C==="'"&&(M=FT(M)),n.indexOf(M)===0)n=n.slice(M.length);else return r()}}if(n.length>0&<.test(n))return r();const _=h.map(M=>M.priority).sort((M,C)=>C-M).filter((M,C,R)=>R.indexOf(M)===C).map(M=>h.filter(C=>C.priority===M).sort((C,R)=>R.subPriority-C.subPriority)).map(M=>M[0]);let x=At(e,i?.in);if(isNaN(+x))return r();const v={};for(const M of _){if(!M.validate(x,d))return r();const C=M.set(x,v,d);Array.isArray(C)?(x=C[0],Object.assign(v,C[1])):x=C}return x}function FT(n){return n.match(PT)[1].replace(IT,"'")}function zT(n,t){const e=At(n,t?.in);return e.setMinutes(0,0,0),e}function UT(n,t){const e=At(n,t?.in);return e.setSeconds(0,0),e}function HT(n,t){const e=At(n,t?.in);return e.setMilliseconds(0),e}function mp(n){const t=n/Nr;return Math.trunc(t)}function yp(n,t){const e=()=>he(t?.in,NaN),i=t?.additionalDigits??2,r=YT(n);let s;if(r.date){const d=qT(r.date,i);s=jT(d.restDateString,d.year)}if(!s||isNaN(+s))return e();const a=+s;let l=0,u;if(r.time&&(l=GT(r.time),isNaN(l)))return e();if(r.timezone){if(u=KT(r.timezone),isNaN(u))return e()}else{const d=new Date(a+l),h=At(0,t?.in);return h.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),h.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),h}return At(a+l+u,t?.in)}const fa={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},WT=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,VT=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,$T=/^([+-])(\d{2})(?::?(\d{2}))?$/;function YT(n){const t={},e=n.split(fa.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],fa.timeZoneDelimiter.test(t.date)&&(t.date=n.split(fa.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const r=fa.timezone.exec(i);r?(t.time=i.replace(r[1],""),t.timezone=r[1]):t.time=i}return t}function qT(n,t){const e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};const r=i[1]?parseInt(i[1]):null,s=i[2]?parseInt(i[2]):null;return{year:s===null?r:s*100,restDateString:n.slice((i[1]||i[2]).length)}}function jT(n,t){if(t===null)return new Date(NaN);const e=n.match(WT);if(!e)return new Date(NaN);const i=!!e[4],r=Ls(e[1]),s=Ls(e[2])-1,a=Ls(e[3]),l=Ls(e[4]),u=Ls(e[5])-1;if(i)return tM(t,l,u)?XT(t,l,u):new Date(NaN);{const d=new Date(0);return!QT(t,s,a)||!JT(t,r)?new Date(NaN):(d.setUTCFullYear(t,s,Math.max(r,a)),d)}}function Ls(n){return n?parseInt(n):1}function GT(n){const t=n.match(VT);if(!t)return NaN;const e=Fc(t[1]),i=Fc(t[2]),r=Fc(t[3]);return eM(e,i,r)?e*Nr+i*As+r*1e3:NaN}function Fc(n){return n&&parseFloat(n.replace(",","."))||0}function KT(n){if(n==="Z")return 0;const t=n.match($T);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return nM(i,r)?e*(i*Nr+r*As):NaN}function XT(n,t,e){const i=new Date(0);i.setUTCFullYear(n,0,4);const r=i.getUTCDay()||7,s=(t-1)*7+e+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const ZT=[31,null,31,30,31,30,31,31,30,31,30,31];function _p(n){return n%400===0||n%4===0&&n%100!==0}function QT(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(ZT[t]||(_p(n)?29:28))}function JT(n,t){return t>=1&&t<=(_p(n)?366:365)}function tM(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function eM(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function nM(n,t){return t>=0&&t<=59}const iM={noDataAvailableTitle:"No data in the current time frame",noDataAvailableDescription:"Once there is traffic, it will display here",limitedResultsShown:"Grouped value limit exceeded, showing the top {maxReturned}",entityNoName:"no-name",debug:"debug",total:"Total",jumpToExplore:"Open in explorer",more_actions:"More actions",emptyEntityInfo:"Requests that do not have a value for the selected group",scatter:{median:"Median",percentile:"p{value}",outlier:"Outlier (> {label})",outlierTooltip:"{series} (outlier > {label})"},chartUnits:{ms:"ms",bytes:"Byte{plural}",count:"request{plural}","count/minute":"rpm",requests:"request{plural}","token count":"token{plural}","tokens/minute":"tpm","%":"%","ops/minute":"ops/minute"},csvExport:{dataError:"Error loading data",noDataRange:"No data in selected range",noDataRetry:"Please adjust the time period and try again",timeRangeSelected:"selected",exportPreview:"Export preview",exportAsCsv:"Export as CSV",exportTimeRange:"Time range",exportDescription:"Exports a CSV of the data represented in the chart.",maximumRecordAmount:"The number of groups is limited to {value}",previewRows:"Previewing {rowsMax} of {rowsTotal} row{plural}",downloadButton:"Export",cancelButton:"Cancel",UtcOffset:"UTC offset",Timestamp:"Timestamp"},query_errors:{forbidden:{message:"Data request forbidden",details:"To access this data, either filter for an entity you have access to or request analytics viewer access from your administrator."},time_range_exceeded:{message:"Time range exceeded",details:"The time range for this report is outside of your organization's data retention period"},timeout:{message:"Data request timed out",details:"We're sorry, the request timed out. Please consider using a shorter time period or try again later."},canceled:{message:"Request canceled"},other:{message:"Bad request"}},legend:{datapointValueDisplay:"{value} {unit}"},chartLabels:{ai_count:"LLM request count",latencies_response_ms:"Response latency",latencies_upstream_ms:"Upstream latency",latencies_kong_gateway_ms:"Kong latency",latencies_kong_internal_ms:"Kong internal latency",request_body_size:"Request size",response_body_size:"Response size",response_header_content_length:"Content length",ai:{cost:"Cost",costCaching:"Caching cost",promptTokens:"Prompt tokens",completionTokens:"Completion tokens",totalTokens:"Total tokens",llmLatency:"LLM latency",fetchLatency:"Fetch latency",embeddingsLatency:"Embeddings latency"},mcp:{latency:"MCP latency",response_body_size:"MCP response size"},a2a:{latency:"A2A latency",response_body_size:"A2A response size"},ai_gateway:"AI gateway",ai_gateway_agent:"AI gateway agent",ai_gateway_consumer:"AI gateway consumer",ai_gateway_data_plane_node:"AI gateway data plane node",ai_gateway_mcp_server:"AI gateway MCP server",ai_gateway_model:"AI gateway model",ai_plugin:"AI plugin",ai_provider:"Provider",ai_request_model:"Request model",ai_response_model:"Response model",error_rate:"Error rate",request_count:"Request count",request_per_minute:"Requests per minute",requests_per_minute:"Requests per minute",response_latency_average:"Response latency (avg)",response_latency_p99:"Response latency (p99)",response_latency_p95:"Response latency (p95)",response_latency_p50:"Response latency (p50)",kong_latency_average:"Kong latency (avg)",kong_latency_p99:"Kong latency (p99)",kong_latency_p95:"Kong latency (p95)",kong_latency_p50:"Kong latency (p50)",kong_internal_latency_average:"Kong internal latency (avg)",kong_internal_latency_p99:"Kong internal latency (p99)",kong_internal_latency_p95:"Kong internal latency (p95)",kong_internal_latency_p50:"Kong internal latency (p50)",llm_cache_status:"Cache status",llm_embeddings_model:"Embeddings model",llm_embeddings_provider:"Embeddings provider",upstream_latency_average:"Upstream latency (avg)",upstream_latency_p99:"Upstream latency (p99)",upstream_latency_p95:"Upstream latency (p95)",upstream_latency_p50:"Upstream latency (p50)",response_size_p99:"Response size (p99)",response_size_p95:"Response size (p95)",response_size_p50:"Response size (p50)",response_size_average:"Response size (avg)",response_size_sum:"Response size (sum)",response_source:"Response source",request_size_p99:"Request size (p99)",request_size_p95:"Request size (p95)",request_size_p50:"Request size (p50)",request_size_average:"Request size (avg)",request_size_sum:"Request size (sum)",control_plane:"Control plane",control_plane_group:"Control plane group",consumer:"Consumer",oidc_credential:"OIDC credential",country_code:"Country",country:"Country",data_plane_node:"Data plane node",data_plane_node_version:"Data plane node version",api_package:"API package",api_product:"API product",api_product_version:"API product version",portal:"Portal",realm:"Realm",runtime_group:"Runtime group",gateway_service:"Gateway service",route:"Route",application:"Application",status_code:"Status code",status_code_grouped:"Status code (grouped)",total_tokens_per_minute:"Total tokens per minute",upstream_status_code:"Upstream status code",upstream_status_code_grouped:"Upstream status code group",time:"Time",Service:"Service",ServiceVersion:"Service version",Route:"Route",Application:"Application",RuntimeGroup:"Runtime group",GatewayService:"Gateway service",StatusCode:"Status code",CodeClass:"Status code (grouped)",Time:"Time",API_PRODUCT:"Api product",API_PRODUCT_VERSION:"Api product version",RUNTIME_GROUP:"Runtime group",GATEWAY_SERVICE:"Gateway service",ROUTE:"Route",APPLICATION:"Application",STATUS_CODE:"Status code",STATUS_CODE_GROUPED:"Status code (grouped)",TIME:"Time",ORGANIZATION:"Organization",TotalRequests:"Request count",RequestsPerMinute:"Requests per minute",LatencyP99:"Response latency (p99)",LatencyP95:"Response latency (p95)",LatencyP50:"Response latency (p50)",LatencyAverage:"Response latency (avg)",UpstreamLatencyP99:"Upstream latency (p99)",UpstreamLatencyP95:"Upstream latency (p95)",UpstreamLatencyP50:"Upstream latency (p50)",UpstreamLatencyAverage:"Upstream latency (avg)",KongLatencyP99:"Kong latency (p99)",KongLatencyP95:"Kong latency (p95)",KongLatencyP50:"Kong latency (p50)",KongLatencyAverage:"Kong latency (avg)",ResponseSizeP99:"Response size (p99)",ResponseSizeP95:"Response size (p95)",ResponseSizeP50:"Response size (p50)",RequestSizeP99:"Request size (p99)",RequestSizeP95:"Request size (p95)",RequestSizeP50:"Request size (p50)",SuccessfulRequests:"Successful requests",SUCCESS:"Successful requests",FailedRequests:"Failed requests",FAILURE:"Failed requests","5XX":"5xx","4XX":"4xx","3XX":"3xx","2XX":"2xx","1XX":"1xx",REQUEST_COUNT:"Request count",REQUEST_PER_MINUTE:"Requests per minute",RESPONSE_LATENCY_P99:"Response latency",RESPONSE_LATENCY_P95:"Response latency",RESPONSE_LATENCY_P50:"Response latency",RESPONSE_SIZE_P99:"Response size (p99)",RESPONSE_SIZE_P95:"Response size (p95)",RESPONSE_SIZE_P50:"Response size (p50)",REQUEST_SIZE_P99:"Request size (p99)",REQUEST_SIZE_P95:"Request size (p95)",REQUEST_SIZE_P50:"Request size (p50)",CONTROL_PLANE:"Control plane",____OTHER____:"Others",ai_request_count:"Request count",total_tokens:"Total token count",prompt_tokens:"Prompt token count",completion_tokens:"Completion token count",cost:"Costs",llm_cache_embeddings_latency_average:"Embeddings latency (avg)",llm_cache_fetch_latency_average:"Fetch latency (avg)",llm_latency_average:"Llm latency (avg)","threshold-warning":"Warning threshold: {value}","threshold-error":"Error threshold: {value}","thatreshold-neutral":"Alert threshold: {value}",api:"API",vulnerability_count:"Vulnerability count",a2a_latency_average:"A2A latency (avg)",a2a_response_size_sum:"A2A response size (sum)",a2a_context_id:"A2A context ID",a2a_error:"A2A error",a2a_method:"A2A method",a2a_task_id:"A2A task ID",mcp_error:"MCP error",mcp_method:"MCP method",mcp_latency_average:"MCP latency (avg)",mcp_latency_p99:"MCP latency (p99)",mcp_latency_p95:"MCP latency (p95)",mcp_latency_p50:"MCP latency (p50)",mcp_response_size_sum:"MCP response size (sum)",mcp_session_id:"MCP session ID",mcp_tool_name:"MCP tool name",mcp_response_body_size_sum:"MCP response size (sum)",control_plane_count:"Control plane count",service_count:"Gateway service count","record_bytes:sum":"Record size (sum)","record_count:sum":"Record count (sum)","request_count:sum":"Request count (sum)",route_count:"Route count",consumer_count:"Consumer count",plugin_count:"Plugin count",node_count:"Data plane node count",principal:"Principal",virtual_cluster_id:"Virtual cluster",backend_cluster_id:"Backend cluster",listener_id:"Listener",principal_name:"Principal name",principal_type:"Principal type",request_type:"Request type",topic_name:"Topic name",partition_index:"Partition index",api_key:"API key",data_plane_group:"Data plane group",managed_cache:"Managed cache",network:"Network",provider:"Provider",provider_region:"Provider region",region:"Region",cache_eviction_rate:"Cache eviction rate",cache_expiration_rate:"Cache expiration rate",cache_items_average:"Cache items (avg)",cache_memory_utilization_max:"Cache memory utilization (max)",cache_status:"Cache status",cache_hit_rate:"Cache hit rate",time_to_first_token_average:"Time to first token (avg)",time_to_first_token_p99:"Time to first token (p99)",time_to_first_token_p95:"Time to first token (p95)",time_to_first_token_p50:"Time to first token (p50)",time_per_token_average:"Time per token (avg)",time_per_token_p99:"Time per token (p99)",time_per_token_p95:"Time per token (p95)",time_per_token_p50:"Time per token (p50)"},metricAxisTitles:{cache_hit_rate:"Cache hit rate {unit}",error_rate:"Error rate in {unit}",request_count:"Request count",request_per_minute:"Requests per minute",requests_per_minute:"Requests per minute",latency_in:"Latency in {unit}",size_in:"Size in {unit}",response_latency_average:"Response latency (avg) in {unit}",response_latency_p99:"Response latency (p99) in {unit}",response_latency_p95:"Response latency (p95) in {unit}",response_latency_p50:"Response latency (p50) in {unit}",upstream_latency_p99:"Upstream latency (p99) in {unit}",upstream_latency_p95:"Upstream latency (p95) in {unit}",upstream_latency_p50:"Upstream latency (p50) in {unit}",kong_latency_p99:"Kong latency (p99) in {unit}",kong_latency_p95:"Kong latency (p95) in {unit}",kong_latency_p50:"Kong latency (p50) in {unit}",kong_internal_latency_average:"Kong internal latency (avg) in {unit}",kong_internal_latency_p99:"Kong internal latency (p99) in {unit}",kong_internal_latency_p95:"Kong internal latency (p95) in {unit}",kong_internal_latency_p50:"Kong internal latency (p50) in {unit}",response_size_p99:"Response size (p99) in {unit}",response_size_p95:"Response size (p95) in {unit}",response_size_p50:"Response size (p50) in {unit}",request_size_p99:"Request size (p99) in {unit}",request_size_p95:"Request size (p95) in {unit}",request_size_p50:"Request size (p50) in {unit}",request_size_sum:"Request size (sum) in {unit}",REQUEST_COUNT:"Request count",REQUEST_PER_MINUTE:"Requests per minute",RESPONSE_LATENCY_P99:"Response latency (p99) in {unit}",RESPONSE_LATENCY_P95:"Response latency (p95) in {unit}",RESPONSE_LATENCY_P50:"Response latency (p50) in {unit}",RESPONSE_SIZE_P99:"Response size (p99) in {unit}",RESPONSE_SIZE_P95:"Response size (p95) in {unit}",RESPONSE_SIZE_P50:"Response size (p50) in {unit}",REQUEST_SIZE_P99:"Request size (p99) in {unit}",REQUEST_SIZE_P95:"Request size (p95) in {unit}",REQUEST_SIZE_P50:"Request size (p50) in {unit}",TotalRequests:"Request count",RequestsPerMinute:"Requests per minute",LatencyP99:"Response latency (p99) in {unit}",LatencyP95:"Response latency (p95) in {unit}",LatencyP50:"Response latency (p50) in {unit}",LatencyAverage:"Response latency (avg) in {unit}",UpstreamLatencyP99:"Upstream latency (p99) in {unit}",UpstreamLatencyP95:"Upstream latency (p95) in {unit}",UpstreamLatencyP50:"Upstream latency (p50) in {unit}",UpstreamLatencyAverage:"Upstream latency (avg) in {unit}",KongLatencyP99:"Kong latency (p99) in {unit}",KongLatencyP95:"Kong latency (p95) in {unit}",KongLatencyP50:"Kong latency (p50) in {unit}",KongLatencyAverage:"Kong latency (avg) in {unit}",ResponseSizeP99:"Response size (p99) in {unit}",ResponseSizeP95:"Response size (p95) in {unit}",ResponseSizeP50:"Response size (p50) in {unit}",RequestSizeP99:"Request size (p99) in {unit}",RequestSizeP95:"Request size (p95) in {unit}",RequestSizeP50:"Request size (p50) in {unit}",ai_request_count:"Request count",total_tokens:"Total token count",prompt_tokens:"Prompt token count",completion_tokens:"Completion token count",cost:"Costs",llm_cache_embeddings_latency_average:"Embeddings latency (avg)",llm_cache_fetch_latency_average:"Fetch latency (avg)",llm_latency_average:"Llm latency (avg)",api:"API",a2a_latency_average:"A2A latency (avg) in {unit}",a2a_response_size_sum:"A2A response size (sum) in {unit}",a2a_context_id:"A2A context ID",a2a_error:"A2A error",a2a_method:"A2A method",a2a_task_id:"A2A task ID",mcp_latency_average:"MCP latency (avg)",mcp_latency_p99:"MCP latency (p99)",mcp_latency_p95:"MCP latency (p95)",mcp_latency_p50:"MCP latency (p50)",mcp_response_size_sum:"MCP response size (sum) in {unit}",mcp_response_body_size_sum:"MCP response body size (sum) in {unit}",control_plane_count:"Control plane count",service_count:"Gateway service count",route_count:"Route count",consumer_count:"Consumer count",plugin_count:"Plugin count",node_count:"Data plane node count",cache_eviction_rate:"Cache eviction rate in {unit}",cache_expiration_rate:"Cache expiration rate in {unit}",cache_items_average:"Cache items (avg)",cache_memory_utilization_max:"Cache memory utilization (max) in {unit}",cached_tokens:"Cached tokens",time_to_first_token_average:"Time to first token (avg)",time_to_first_token_p99:"Time to first token (p99)",time_to_first_token_p95:"Time to first token (p95)",time_to_first_token_p50:"Time to first token (p50)",time_per_token_average:"Time per token (avg)",time_per_token_p99:"Time per token (p99)",time_per_token_p95:"Time per token (p95)",time_per_token_p50:"Time per token (p50)",total_tokens_per_minute:"Total tokens per minute"},granularityAxisTitles:{tenSecondly:"@timestamp per 10 seconds",thirtySecondly:"@timestamp per 30 seconds",minutely:"@timestamp per minute",fiveMinutely:"@timestamp per 5 minutes",tenMinutely:"@timestamp per 10 minutes",thirtyMinutely:"@timestamp per 30 minutes",hourly:"@timestamp per hour",twoHourly:"@timestamp per 2 hours",twelveHourly:"@timestamp per 12 hours",daily:"@timestamp per day",weekly:"@timestamp per week"},timestampAxisTitles:{platform:"@timestamp created at"},topNTable:{nameLabel:"Name",defaultEmptyStateTitle:"No data to display",defaultErrorStateTitle:"Something went wrong",errors:{meta:"Error: response must contain 'meta'",display:"Error: 'display' response incorrectly formatted (must have at least one key)",metricNames:"Error: 'metricNames' response incorrectly formatted (must have at least one entry)"}},singleValue:{valueError:"Invalid configuration",trend:{not_available:"Not available"}},new_timerange_label:"Time range",sparkline_no_data:"No data",zoom_action_items:{zoom:"Zoom in",view_requests:"View requests",cancel:"Cancel",explore:"Explore"},zoom_time_range:{from:"From",to:"To"}};function rM(){const n=Kf.createI18n("en-us",iM);return{i18n:n,i18nT:Kf.i18nTComponent(n)}}function Ns(n){return n+.5|0}const Si=(n,t,e)=>Math.max(Math.min(n,e),t);function Bs(n){return Si(Ns(n*2.55),0,255)}function Ti(n){return Si(Ns(n*255),0,255)}function ti(n){return Si(Ns(n/2.55)/100,0,1)}function bp(n){return Si(Ns(n*100),0,100)}const Mn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},zc=[..."0123456789ABCDEF"],sM=n=>zc[n&15],oM=n=>zc[(n&240)>>4]+zc[n&15],ha=n=>(n&240)>>4===(n&15),aM=n=>ha(n.r)&&ha(n.g)&&ha(n.b)&&ha(n.a);function lM(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&Mn[n[1]]*17,g:255&Mn[n[2]]*17,b:255&Mn[n[3]]*17,a:t===5?Mn[n[4]]*17:255}:(t===7||t===9)&&(e={r:Mn[n[1]]<<4|Mn[n[2]],g:Mn[n[3]]<<4|Mn[n[4]],b:Mn[n[5]]<<4|Mn[n[6]],a:t===9?Mn[n[7]]<<4|Mn[n[8]]:255})),e}const cM=(n,t)=>n<255?t(n):"";function uM(n){var t=aM(n)?sM:oM;return n?"#"+t(n.r)+t(n.g)+t(n.b)+cM(n.a,t):void 0}const dM=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function xp(n,t,e){const i=t*Math.min(e,1-e),r=(s,a=(s+n/30)%12)=>e-i*Math.max(Math.min(a-3,9-a,1),-1);return[r(0),r(8),r(4)]}function fM(n,t,e){const i=(r,s=(r+n/60)%6)=>e-e*t*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function hM(n,t,e){const i=xp(n,1,.5);let r;for(t+e>1&&(r=1/(t+e),t*=r,e*=r),r=0;r<3;r++)i[r]*=1-t-e,i[r]+=t;return i}function pM(n,t,e,i,r){return n===r?(t-e)/i+(t<e?6:0):t===r?(e-n)/i+2:(n-t)/i+4}function Uc(n){const e=n.r/255,i=n.g/255,r=n.b/255,s=Math.max(e,i,r),a=Math.min(e,i,r),l=(s+a)/2;let u,d,h;return s!==a&&(h=s-a,d=l>.5?h/(2-s-a):h/(s+a),u=pM(e,i,r,h,s),u=u*60+.5),[u|0,d||0,l]}function Hc(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(Ti)}function Wc(n,t,e){return Hc(xp,n,t,e)}function gM(n,t,e){return Hc(hM,n,t,e)}function mM(n,t,e){return Hc(fM,n,t,e)}function wp(n){return(n%360+360)%360}function yM(n){const t=dM.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?Bs(+t[5]):Ti(+t[5]));const r=wp(+t[2]),s=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=gM(r,s,a):t[1]==="hsv"?i=mM(r,s,a):i=Wc(r,s,a),{r:i[0],g:i[1],b:i[2],a:e}}function _M(n,t){var e=Uc(n);e[0]=wp(e[0]+t),e=Wc(e),n.r=e[0],n.g=e[1],n.b=e[2]}function bM(n){if(!n)return;const t=Uc(n),e=t[0],i=bp(t[1]),r=bp(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${r}%, ${ti(n.a)})`:`hsl(${e}, ${i}%, ${r}%)`}const vp={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Sp={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function xM(){const n={},t=Object.keys(Sp),e=Object.keys(vp);let i,r,s,a,l;for(i=0;i<t.length;i++){for(a=l=t[i],r=0;r<e.length;r++)s=e[r],l=l.replace(s,vp[s]);s=parseInt(Sp[a],16),n[l]=[s>>16&255,s>>8&255,s&255]}return n}let pa;function wM(n){pa||(pa=xM(),pa.transparent=[0,0,0,0]);const t=pa[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const vM=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function SM(n){const t=vM.exec(n);let e=255,i,r,s;if(t){if(t[7]!==i){const a=+t[7];e=t[8]?Bs(a):Si(a*255,0,255)}return i=+t[1],r=+t[3],s=+t[5],i=255&(t[2]?Bs(i):Si(i,0,255)),r=255&(t[4]?Bs(r):Si(r,0,255)),s=255&(t[6]?Bs(s):Si(s,0,255)),{r:i,g:r,b:s,a:e}}}function TM(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${ti(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const Vc=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,zr=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function MM(n,t,e){const i=zr(ti(n.r)),r=zr(ti(n.g)),s=zr(ti(n.b));return{r:Ti(Vc(i+e*(zr(ti(t.r))-i))),g:Ti(Vc(r+e*(zr(ti(t.g))-r))),b:Ti(Vc(s+e*(zr(ti(t.b))-s))),a:n.a+e*(t.a-n.a)}}function ga(n,t,e){if(n){let i=Uc(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=Wc(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Tp(n,t){return n&&Object.assign(t||{},n)}function Mp(n){var t={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(t={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(t.a=Ti(n[3]))):(t=Tp(n,{r:0,g:0,b:0,a:1}),t.a=Ti(t.a)),t}function kM(n){return n.charAt(0)==="r"?SM(n):yM(n)}class Fs{constructor(t){if(t instanceof Fs)return t;const e=typeof t;let i;e==="object"?i=Mp(t):e==="string"&&(i=lM(t)||wM(t)||kM(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Tp(this._rgb);return t&&(t.a=ti(t.a)),t}set rgb(t){this._rgb=Mp(t)}rgbString(){return this._valid?TM(this._rgb):void 0}hexString(){return this._valid?uM(this._rgb):void 0}hslString(){return this._valid?bM(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,r=t.rgb;let s;const a=e===s?.5:e,l=2*a-1,u=i.a-r.a,d=((l*u===-1?l:(l+u)/(1+l*u))+1)/2;s=1-d,i.r=255&d*i.r+s*r.r+.5,i.g=255&d*i.g+s*r.g+.5,i.b=255&d*i.b+s*r.b+.5,i.a=a*i.a+(1-a)*r.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=MM(this._rgb,t._rgb,e)),this}clone(){return new Fs(this.rgb)}alpha(t){return this._rgb.a=Ti(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Ns(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return ga(this._rgb,2,t),this}darken(t){return ga(this._rgb,2,-t),this}saturate(t){return ga(this._rgb,1,t),this}desaturate(t){return ga(this._rgb,1,-t),this}rotate(t){return _M(this._rgb,t),this}}function ei(){}const DM=(()=>{let n=0;return()=>n++})();function xt(n){return n==null}function Yt(n){if(Array.isArray&&Array.isArray(n))return!0;const t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Pt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function ae(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function pn(n,t){return ae(n)?n:t}function Mt(n,t){return typeof n>"u"?t:n}const CM=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,kp=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function Qt(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function Jt(n,t,e,i){let r,s,a;if(Yt(n))for(s=n.length,r=0;r<s;r++)t.call(e,n[r],r);else if(Pt(n))for(a=Object.keys(n),s=a.length,r=0;r<s;r++)t.call(e,n[a[r]],a[r])}function ma(n,t){let e,i,r,s;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(r=n[e],s=t[e],r.datasetIndex!==s.datasetIndex||r.index!==s.index)return!1;return!0}function ya(n){if(Yt(n))return n.map(ya);if(Pt(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let r=0;for(;r<i;++r)t[e[r]]=ya(n[e[r]]);return t}return n}function Dp(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function OM(n,t,e,i){if(!Dp(n))return;const r=t[n],s=e[n];Pt(r)&&Pt(s)?zs(r,s,i):t[n]=ya(s)}function zs(n,t,e){const i=Yt(t)?t:[t],r=i.length;if(!Pt(n))return n;e=e||{};const s=e.merger||OM;let a;for(let l=0;l<r;++l){if(a=i[l],!Pt(a))continue;const u=Object.keys(a);for(let d=0,h=u.length;d<h;++d)s(u[d],n,a,e)}return n}function Us(n,t){return zs(n,t,{merger:AM})}function AM(n,t,e){if(!Dp(n))return;const i=t[n],r=e[n];Pt(i)&&Pt(r)?Us(i,r):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=ya(r))}const Cp={"":n=>n,x:n=>n.x,y:n=>n.y};function RM(n){const t=n.split("."),e=[];let i="";for(const r of t)i+=r,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function EM(n){const t=RM(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function Mi(n,t){return(Cp[t]||(Cp[t]=EM(t)))(n)}function $c(n){return n.charAt(0).toUpperCase()+n.slice(1)}const en=n=>typeof n<"u",nn=n=>typeof n=="function",Op=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function PM(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Rt=Math.PI,te=2*Rt,IM=te+Rt,_a=Number.POSITIVE_INFINITY,Yc=Rt/180,re=Rt/2,kn=Rt/4,ba=Rt*2/3,ki=Math.log10,Yn=Math.sign;function Hs(n,t,e){return Math.abs(n-t)<e}function Ap(n){const t=Math.round(n);n=Hs(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(ki(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function LM(n){const t=[],e=Math.sqrt(n);let i;for(i=1;i<e;i++)n%i===0&&(t.push(i),t.push(n/i));return e===(e|0)&&t.push(e),t.sort((r,s)=>r-s).pop(),t}function NM(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function Di(n){return!NM(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function BM(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function Rp(n,t,e){let i,r,s;for(i=0,r=n.length;i<r;i++)s=n[i][e],isNaN(s)||(t.min=Math.min(t.min,s),t.max=Math.max(t.max,s))}function xe(n){return n*(Rt/180)}function xa(n){return n*(180/Rt)}function Ep(n){if(!ae(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function wa(n,t){const e=t.x-n.x,i=t.y-n.y,r=Math.sqrt(e*e+i*i);let s=Math.atan2(i,e);return s<-.5*Rt&&(s+=te),{angle:s,distance:r}}function Ur(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function FM(n,t){return(n-t+IM)%te-Rt}function Ue(n){return(n%te+te)%te}function Ws(n,t,e,i){const r=Ue(n),s=Ue(t),a=Ue(e),l=Ue(s-r),u=Ue(a-r),d=Ue(r-s),h=Ue(r-a);return r===s||r===a||i&&s===a||l>u&&d<h}function Ce(n,t,e){return Math.max(t,Math.min(e,n))}function zM(n){return Ce(n,-32768,32767)}function ni(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function qc(n,t,e){e=e||(a=>n[a]<t);let i=n.length-1,r=0,s;for(;i-r>1;)s=r+i>>1,e(s)?r=s:i=s;return{lo:r,hi:i}}const ii=(n,t,e,i)=>qc(n,e,i?r=>{const s=n[r][t];return s<e||s===e&&n[r+1][t]===e}:r=>n[r][t]<e),UM=(n,t,e)=>qc(n,e,i=>n[i][t]>=e);function HM(n,t,e){let i=0,r=n.length;for(;i<r&&n[i]<t;)i++;for(;r>i&&n[r-1]>e;)r--;return i>0||r<n.length?n.slice(i,r):n}const Pp=["push","pop","shift","splice","unshift"];function WM(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Pp.forEach(e=>{const i="_onData"+$c(e),r=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...s){const a=r.apply(this,s);return n._chartjs.listeners.forEach(l=>{typeof l[i]=="function"&&l[i](...s)}),a}})})}function Ip(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,r=i.indexOf(t);r!==-1&&i.splice(r,1),!(i.length>0)&&(Pp.forEach(s=>{delete n[s]}),delete n._chartjs)}function Lp(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const Np=(function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame})();function Bp(n,t){let e=[],i=!1;return function(...r){e=r,i||(i=!0,Np.call(window,()=>{i=!1,n.apply(t,e)}))}}function VM(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const jc=n=>n==="start"?"left":n==="end"?"right":"center",He=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,$M=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function Fp(n,t,e){const i=t.length;let r=0,s=i;if(n._sorted){const{iScale:a,vScale:l,_parsed:u}=n,d=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null,h=a.axis,{min:g,max:y,minDefined:_,maxDefined:x}=a.getUserBounds();if(_){if(r=Math.min(ii(u,h,g).lo,e?i:ii(t,h,a.getPixelForValue(g)).lo),d){const v=u.slice(0,r+1).reverse().findIndex(M=>!xt(M[l.axis]));r-=Math.max(0,v)}r=Ce(r,0,i-1)}if(x){let v=Math.max(ii(u,a.axis,y,!0).hi+1,e?0:ii(t,h,a.getPixelForValue(y),!0).hi+1);if(d){const M=u.slice(v-1).findIndex(C=>!xt(C[l.axis]));v+=Math.max(0,M)}s=Ce(v,r,i)-r}else s=i-r}return{start:r,count:s}}function zp(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,r={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=r,!0;const s=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,r),s}const va=n=>n===0||n===1,Up=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*te/e)),Hp=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*te/e)+1,Vs={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*re)+1,easeOutSine:n=>Math.sin(n*re),easeInOutSine:n=>-.5*(Math.cos(Rt*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>va(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>va(n)?n:Up(n,.075,.3),easeOutElastic:n=>va(n)?n:Hp(n,.075,.3),easeInOutElastic(n){return va(n)?n:n<.5?.5*Up(n*2,.1125,.45):.5+.5*Hp(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let t=1.70158;return(n/=.5)<1?.5*(n*n*(((t*=1.525)+1)*n-t)):.5*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},easeInBounce:n=>1-Vs.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?Vs.easeInBounce(n*2)*.5:Vs.easeOutBounce(n*2-1)*.5+.5};function Gc(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Sa(n){return Gc(n)?n:new Fs(n)}function Kc(n){return Gc(n)?n:new Fs(n).saturate(.5).darken(.1).hexString()}const YM=["x","y","borderWidth","radius","tension"],qM=["color","borderColor","backgroundColor"];function jM(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),n.set("animations",{colors:{type:"color",properties:qM},numbers:{type:"number",properties:YM}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function GM(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Wp=new Map;function KM(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Wp.get(e);return i||(i=new Intl.NumberFormat(n,t),Wp.set(e,i)),i}function $s(n,t,e){return KM(t,e).format(n)}const Vp={values(n){return Yt(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let r,s=n;if(e.length>1){const d=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(d<1e-4||d>1e15)&&(r="scientific"),s=XM(n,e)}const a=ki(Math.abs(s)),l=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),u={notation:r,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(u,this.options.ticks.format),$s(n,i,u)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(ki(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?Vp.numeric.call(this,n,t,e):""}};function XM(n,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&n!==Math.floor(n)&&(e=n-Math.floor(n)),e}var Ta={formatters:Vp};function ZM(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ta.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const sr=Object.create(null),Xc=Object.create(null);function Ys(n,t){if(!t)return n;const e=t.split(".");for(let i=0,r=e.length;i<r;++i){const s=e[i];n=n[s]||(n[s]=Object.create(null))}return n}function Zc(n,t,e){return typeof t=="string"?zs(Ys(n,t),e):zs(Ys(n,""),t)}class QM{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,r)=>Kc(r.backgroundColor),this.hoverBorderColor=(i,r)=>Kc(r.borderColor),this.hoverColor=(i,r)=>Kc(r.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Zc(this,t,e)}get(t){return Ys(this,t)}describe(t,e){return Zc(Xc,t,e)}override(t,e){return Zc(sr,t,e)}route(t,e,i,r){const s=Ys(this,t),a=Ys(this,i),l="_"+e;Object.defineProperties(s,{[l]:{value:s[e],writable:!0},[e]:{enumerable:!0,get(){const u=this[l],d=a[r];return Pt(u)?Object.assign({},d,u):Mt(u,d)},set(u){this[l]=u}}})}apply(t){t.forEach(e=>e(this))}}var se=new QM({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[jM,GM,ZM]);function JM(n){return!n||xt(n.size)||xt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Ma(n,t,e,i,r){let s=t[r];return s||(s=t[r]=n.measureText(r).width,e.push(r)),s>i&&(i=s),i}function tk(n,t,e,i){i=i||{};let r=i.data=i.data||{},s=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(r=i.data={},s=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let a=0;const l=e.length;let u,d,h,g,y;for(u=0;u<l;u++)if(g=e[u],g!=null&&!Yt(g))a=Ma(n,r,s,a,g);else if(Yt(g))for(d=0,h=g.length;d<h;d++)y=g[d],y!=null&&!Yt(y)&&(a=Ma(n,r,s,a,y));n.restore();const _=s.length/2;if(_>e.length){for(u=0;u<_;u++)delete r[s[u]];s.splice(0,_)}return a}function or(n,t,e){const i=n.currentDevicePixelRatio,r=e!==0?Math.max(e/2,.5):0;return Math.round((t-r)*i)/i+r}function $p(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function Qc(n,t,e,i){Yp(n,t,e,i,null)}function Yp(n,t,e,i,r){let s,a,l,u,d,h,g,y;const _=t.pointStyle,x=t.rotation,v=t.radius;let M=(x||0)*Yc;if(_&&typeof _=="object"&&(s=_.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(M),n.drawImage(_,-_.width/2,-_.height/2,_.width,_.height),n.restore();return}if(!(isNaN(v)||v<=0)){switch(n.beginPath(),_){default:r?n.ellipse(e,i,r/2,v,0,0,te):n.arc(e,i,v,0,te),n.closePath();break;case"triangle":h=r?r/2:v,n.moveTo(e+Math.sin(M)*h,i-Math.cos(M)*v),M+=ba,n.lineTo(e+Math.sin(M)*h,i-Math.cos(M)*v),M+=ba,n.lineTo(e+Math.sin(M)*h,i-Math.cos(M)*v),n.closePath();break;case"rectRounded":d=v*.516,u=v-d,a=Math.cos(M+kn)*u,g=Math.cos(M+kn)*(r?r/2-d:u),l=Math.sin(M+kn)*u,y=Math.sin(M+kn)*(r?r/2-d:u),n.arc(e-g,i-l,d,M-Rt,M-re),n.arc(e+y,i-a,d,M-re,M),n.arc(e+g,i+l,d,M,M+re),n.arc(e-y,i+a,d,M+re,M+Rt),n.closePath();break;case"rect":if(!x){u=Math.SQRT1_2*v,h=r?r/2:u,n.rect(e-h,i-u,2*h,2*u);break}M+=kn;case"rectRot":g=Math.cos(M)*(r?r/2:v),a=Math.cos(M)*v,l=Math.sin(M)*v,y=Math.sin(M)*(r?r/2:v),n.moveTo(e-g,i-l),n.lineTo(e+y,i-a),n.lineTo(e+g,i+l),n.lineTo(e-y,i+a),n.closePath();break;case"crossRot":M+=kn;case"cross":g=Math.cos(M)*(r?r/2:v),a=Math.cos(M)*v,l=Math.sin(M)*v,y=Math.sin(M)*(r?r/2:v),n.moveTo(e-g,i-l),n.lineTo(e+g,i+l),n.moveTo(e+y,i-a),n.lineTo(e-y,i+a);break;case"star":g=Math.cos(M)*(r?r/2:v),a=Math.cos(M)*v,l=Math.sin(M)*v,y=Math.sin(M)*(r?r/2:v),n.moveTo(e-g,i-l),n.lineTo(e+g,i+l),n.moveTo(e+y,i-a),n.lineTo(e-y,i+a),M+=kn,g=Math.cos(M)*(r?r/2:v),a=Math.cos(M)*v,l=Math.sin(M)*v,y=Math.sin(M)*(r?r/2:v),n.moveTo(e-g,i-l),n.lineTo(e+g,i+l),n.moveTo(e+y,i-a),n.lineTo(e-y,i+a);break;case"line":a=r?r/2:Math.cos(M)*v,l=Math.sin(M)*v,n.moveTo(e-a,i-l),n.lineTo(e+a,i+l);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(M)*(r?r/2:v),i+Math.sin(M)*v);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function ri(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.x<t.right+e&&n.y>t.top-e&&n.y<t.bottom+e}function qs(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function js(n){n.restore()}function ek(n,t,e,i,r){if(!t)return n.lineTo(e.x,e.y);if(r==="middle"){const s=(t.x+e.x)/2;n.lineTo(s,t.y),n.lineTo(s,e.y)}else r==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function nk(n,t,e,i){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function ik(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),xt(t.rotation)||n.rotate(t.rotation),t.color&&(n.fillStyle=t.color),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline)}function rk(n,t,e,i,r){if(r.strikethrough||r.underline){const s=n.measureText(i),a=t-s.actualBoundingBoxLeft,l=t+s.actualBoundingBoxRight,u=e-s.actualBoundingBoxAscent,d=e+s.actualBoundingBoxDescent,h=r.strikethrough?(u+d)/2:d;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=r.decorationWidth||2,n.moveTo(a,h),n.lineTo(l,h),n.stroke()}}function sk(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function ar(n,t,e,i,r,s={}){const a=Yt(t)?t:[t],l=s.strokeWidth>0&&s.strokeColor!=="";let u,d;for(n.save(),n.font=r.string,ik(n,s),u=0;u<a.length;++u)d=a[u],s.backdrop&&sk(n,s.backdrop),l&&(s.strokeColor&&(n.strokeStyle=s.strokeColor),xt(s.strokeWidth)||(n.lineWidth=s.strokeWidth),n.strokeText(d,e,i,s.maxWidth)),n.fillText(d,e,i,s.maxWidth),rk(n,e,i,d,s),i+=Number(r.lineHeight);n.restore()}function Hr(n,t){const{x:e,y:i,w:r,h:s,radius:a}=t;n.arc(e+a.topLeft,i+a.topLeft,a.topLeft,1.5*Rt,Rt,!0),n.lineTo(e,i+s-a.bottomLeft),n.arc(e+a.bottomLeft,i+s-a.bottomLeft,a.bottomLeft,Rt,re,!0),n.lineTo(e+r-a.bottomRight,i+s),n.arc(e+r-a.bottomRight,i+s-a.bottomRight,a.bottomRight,re,0,!0),n.lineTo(e+r,i+a.topRight),n.arc(e+r-a.topRight,i+a.topRight,a.topRight,0,-re,!0),n.lineTo(e+a.topLeft,i)}const ok=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,ak=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function lk(n,t){const e=(""+n).match(ok);if(!e||e[1]==="normal")return t*1.2;switch(n=+e[2],e[3]){case"px":return n;case"%":n/=100;break}return t*n}const ck=n=>+n||0;function Jc(n,t){const e={},i=Pt(t),r=i?Object.keys(t):t,s=Pt(n)?i?a=>Mt(n[a],n[t[a]]):a=>n[a]:()=>n;for(const a of r)e[a]=ck(s(a));return e}function qp(n){return Jc(n,{top:"y",right:"x",bottom:"y",left:"x"})}function Ci(n){return Jc(n,["topLeft","topRight","bottomLeft","bottomRight"])}function we(n){const t=qp(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function le(n,t){n=n||{},t=t||se.font;let e=Mt(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=Mt(n.style,t.style);i&&!(""+i).match(ak)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:Mt(n.family,t.family),lineHeight:lk(Mt(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:Mt(n.weight,t.weight),string:""};return r.string=JM(r),r}function Gs(n,t,e,i){let r,s,a;for(r=0,s=n.length;r<s;++r)if(a=n[r],a!==void 0&&a!==void 0)return a}function uk(n,t,e){const{min:i,max:r}=n,s=kp(t,(r-i)/2),a=(l,u)=>e&&l===0?0:l+u;return{min:a(i,-Math.abs(s)),max:a(r,s)}}function Oi(n,t){return Object.assign(Object.create(n),t)}function tu(n,t=[""],e,i,r=()=>n[0]){const s=e||n;typeof i>"u"&&(i=Zp("_fallback",n));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:s,_fallback:i,_getTarget:r,override:l=>tu([l,...n],t,s,i)};return new Proxy(a,{deleteProperty(l,u){return delete l[u],delete l._keys,delete n[0][u],!0},get(l,u){return Gp(l,u,()=>_k(u,t,n,l))},getOwnPropertyDescriptor(l,u){return Reflect.getOwnPropertyDescriptor(l._scopes[0],u)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(l,u){return Qp(l).includes(u)},ownKeys(l){return Qp(l)},set(l,u,d){const h=l._storage||(l._storage=r());return l[u]=h[u]=d,delete l._keys,!0}})}function Wr(n,t,e,i){const r={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:jp(n,i),setContext:s=>Wr(n,s,e,i),override:s=>Wr(n.override(s),t,e,i)};return new Proxy(r,{deleteProperty(s,a){return delete s[a],delete n[a],!0},get(s,a,l){return Gp(s,a,()=>fk(s,a,l))},getOwnPropertyDescriptor(s,a){return s._descriptors.allKeys?Reflect.has(n,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,a)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(s,a){return Reflect.has(n,a)},ownKeys(){return Reflect.ownKeys(n)},set(s,a,l){return n[a]=l,delete s[a],!0}})}function jp(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:r=t.allKeys}=n;return{allKeys:r,scriptable:e,indexable:i,isScriptable:nn(e)?e:()=>e,isIndexable:nn(i)?i:()=>i}}const dk=(n,t)=>n?n+$c(t):t,eu=(n,t)=>Pt(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Gp(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];const i=e();return n[t]=i,i}function fk(n,t,e){const{_proxy:i,_context:r,_subProxy:s,_descriptors:a}=n;let l=i[t];return nn(l)&&a.isScriptable(t)&&(l=hk(t,l,n,e)),Yt(l)&&l.length&&(l=pk(t,l,n,a.isIndexable)),eu(t,l)&&(l=Wr(l,r,s&&s[t],a)),l}function hk(n,t,e,i){const{_proxy:r,_context:s,_subProxy:a,_stack:l}=e;if(l.has(n))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+n);l.add(n);let u=t(s,a||i);return l.delete(n),eu(n,u)&&(u=nu(r._scopes,r,n,u)),u}function pk(n,t,e,i){const{_proxy:r,_context:s,_subProxy:a,_descriptors:l}=e;if(typeof s.index<"u"&&i(n))return t[s.index%t.length];if(Pt(t[0])){const u=t,d=r._scopes.filter(h=>h!==u);t=[];for(const h of u){const g=nu(d,r,n,h);t.push(Wr(g,s,a&&a[n],l))}}return t}function Kp(n,t,e){return nn(n)?n(t,e):n}const gk=(n,t)=>n===!0?t:typeof n=="string"?Mi(t,n):void 0;function mk(n,t,e,i,r){for(const s of t){const a=gk(e,s);if(a){n.add(a);const l=Kp(a._fallback,e,r);if(typeof l<"u"&&l!==e&&l!==i)return l}else if(a===!1&&typeof i<"u"&&e!==i)return null}return!1}function nu(n,t,e,i){const r=t._rootScopes,s=Kp(t._fallback,e,i),a=[...n,...r],l=new Set;l.add(i);let u=Xp(l,a,e,s||e,i);return u===null||typeof s<"u"&&s!==e&&(u=Xp(l,a,s,u,i),u===null)?!1:tu(Array.from(l),[""],r,s,()=>yk(t,e,i))}function Xp(n,t,e,i,r){for(;e;)e=mk(n,t,e,i,r);return e}function yk(n,t,e){const i=n._getTarget();t in i||(i[t]={});const r=i[t];return Yt(r)&&Pt(e)?e:r||{}}function _k(n,t,e,i){let r;for(const s of t)if(r=Zp(dk(s,n),e),typeof r<"u")return eu(n,r)?nu(e,i,n,r):r}function Zp(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function Qp(n){let t=n._keys;return t||(t=n._keys=bk(n._scopes)),t}function bk(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(r=>!r.startsWith("_")))t.add(i);return Array.from(t)}function Jp(n,t,e,i){const{iScale:r}=n,{key:s="r"}=this._parsing,a=new Array(i);let l,u,d,h;for(l=0,u=i;l<u;++l)d=l+e,h=t[d],a[l]={r:r.parse(Mi(h,s),d)};return a}const xk=Number.EPSILON||1e-14,Vr=(n,t)=>t<n.length&&!n[t].skip&&n[t],tg=n=>n==="x"?"y":"x";function wk(n,t,e,i){const r=n.skip?t:n,s=t,a=e.skip?t:e,l=Ur(s,r),u=Ur(a,s);let d=l/(l+u),h=u/(l+u);d=isNaN(d)?0:d,h=isNaN(h)?0:h;const g=i*d,y=i*h;return{previous:{x:s.x-g*(a.x-r.x),y:s.y-g*(a.y-r.y)},next:{x:s.x+y*(a.x-r.x),y:s.y+y*(a.y-r.y)}}}function vk(n,t,e){const i=n.length;let r,s,a,l,u,d=Vr(n,0);for(let h=0;h<i-1;++h)if(u=d,d=Vr(n,h+1),!(!u||!d)){if(Hs(t[h],0,xk)){e[h]=e[h+1]=0;continue}r=e[h]/t[h],s=e[h+1]/t[h],l=Math.pow(r,2)+Math.pow(s,2),!(l<=9)&&(a=3/Math.sqrt(l),e[h]=r*a*t[h],e[h+1]=s*a*t[h])}}function Sk(n,t,e="x"){const i=tg(e),r=n.length;let s,a,l,u=Vr(n,0);for(let d=0;d<r;++d){if(a=l,l=u,u=Vr(n,d+1),!l)continue;const h=l[e],g=l[i];a&&(s=(h-a[e])/3,l[`cp1${e}`]=h-s,l[`cp1${i}`]=g-s*t[d]),u&&(s=(u[e]-h)/3,l[`cp2${e}`]=h+s,l[`cp2${i}`]=g+s*t[d])}}function Tk(n,t="x"){const e=tg(t),i=n.length,r=Array(i).fill(0),s=Array(i);let a,l,u,d=Vr(n,0);for(a=0;a<i;++a)if(l=u,u=d,d=Vr(n,a+1),!!u){if(d){const h=d[t]-u[t];r[a]=h!==0?(d[e]-u[e])/h:0}s[a]=l?d?Yn(r[a-1])!==Yn(r[a])?0:(r[a-1]+r[a])/2:r[a-1]:r[a]}vk(n,r,s),Sk(n,s,t)}function ka(n,t,e){return Math.max(Math.min(n,e),t)}function Mk(n,t){let e,i,r,s,a,l=ri(n[0],t);for(e=0,i=n.length;e<i;++e)a=s,s=l,l=e<i-1&&ri(n[e+1],t),s&&(r=n[e],a&&(r.cp1x=ka(r.cp1x,t.left,t.right),r.cp1y=ka(r.cp1y,t.top,t.bottom)),l&&(r.cp2x=ka(r.cp2x,t.left,t.right),r.cp2y=ka(r.cp2y,t.top,t.bottom)))}function kk(n,t,e,i,r){let s,a,l,u;if(t.spanGaps&&(n=n.filter(d=>!d.skip)),t.cubicInterpolationMode==="monotone")Tk(n,r);else{let d=i?n[n.length-1]:n[0];for(s=0,a=n.length;s<a;++s)l=n[s],u=wk(d,l,n[Math.min(s+1,a-(i?0:1))%a],t.tension),l.cp1x=u.previous.x,l.cp1y=u.previous.y,l.cp2x=u.next.x,l.cp2y=u.next.y,d=l}t.capBezierPoints&&Mk(n,e)}function iu(){return typeof window<"u"&&typeof document<"u"}function ru(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Da(n,t,e){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=n,i}const Ca=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function Dk(n,t){return Ca(n).getPropertyValue(t)}const Ck=["top","right","bottom","left"];function lr(n,t,e){const i={};e=e?"-"+e:"";for(let r=0;r<4;r++){const s=Ck[r];i[s]=parseFloat(n[t+"-"+s+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Ok=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function Ak(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:r,offsetY:s}=i;let a=!1,l,u;if(Ok(r,s,n.target))l=r,u=s;else{const d=t.getBoundingClientRect();l=i.clientX-d.left,u=i.clientY-d.top,a=!0}return{x:l,y:u,box:a}}function Ai(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,r=Ca(e),s=r.boxSizing==="border-box",a=lr(r,"padding"),l=lr(r,"border","width"),{x:u,y:d,box:h}=Ak(n,e),g=a.left+(h&&l.left),y=a.top+(h&&l.top);let{width:_,height:x}=t;return s&&(_-=a.width+l.width,x-=a.height+l.height),{x:Math.round((u-g)/_*e.width/i),y:Math.round((d-y)/x*e.height/i)}}function Rk(n,t,e){let i,r;if(t===void 0||e===void 0){const s=n&&ru(n);if(!s)t=n.clientWidth,e=n.clientHeight;else{const a=s.getBoundingClientRect(),l=Ca(s),u=lr(l,"border","width"),d=lr(l,"padding");t=a.width-d.width-u.width,e=a.height-d.height-u.height,i=Da(l.maxWidth,s,"clientWidth"),r=Da(l.maxHeight,s,"clientHeight")}}return{width:t,height:e,maxWidth:i||_a,maxHeight:r||_a}}const Ri=n=>Math.round(n*10)/10;function Ek(n,t,e,i){const r=Ca(n),s=lr(r,"margin"),a=Da(r.maxWidth,n,"clientWidth")||_a,l=Da(r.maxHeight,n,"clientHeight")||_a,u=Rk(n,t,e);let{width:d,height:h}=u;if(r.boxSizing==="content-box"){const y=lr(r,"border","width"),_=lr(r,"padding");d-=_.width+y.width,h-=_.height+y.height}return d=Math.max(0,d-s.width),h=Math.max(0,i?d/i:h-s.height),d=Ri(Math.min(d,a,u.maxWidth)),h=Ri(Math.min(h,l,u.maxHeight)),d&&!h&&(h=Ri(d/2)),(t!==void 0||e!==void 0)&&i&&u.height&&h>u.height&&(h=u.height,d=Ri(Math.floor(h*i))),{width:d,height:h}}function eg(n,t,e){const i=t||1,r=Ri(n.height*i),s=Ri(n.width*i);n.height=Ri(n.height),n.width=Ri(n.width);const a=n.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${n.height}px`,a.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||a.height!==r||a.width!==s?(n.currentDevicePixelRatio=i,a.height=r,a.width=s,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Pk=(function(){let n=!1;try{const t={get passive(){return n=!0,!1}};iu()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n})();function ng(n,t){const e=Dk(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function cr(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function Ik(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:i==="middle"?e<.5?n.y:t.y:i==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function Lk(n,t,e,i){const r={x:n.cp2x,y:n.cp2y},s={x:t.cp1x,y:t.cp1y},a=cr(n,r,e),l=cr(r,s,e),u=cr(s,t,e),d=cr(a,l,e),h=cr(l,u,e);return cr(d,h,e)}const Nk=function(n,t){return{x(e){return n+n+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},Bk=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function $r(n,t,e){return n?Nk(t,e):Bk()}function ig(n,t){let e,i;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=i)}function rg(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function sg(n){return n==="angle"?{between:Ws,compare:FM,normalize:Ue}:{between:ni,compare:(t,e)=>t-e,normalize:t=>t}}function og({start:n,end:t,count:e,loop:i,style:r}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:r}}function Fk(n,t,e){const{property:i,start:r,end:s}=e,{between:a,normalize:l}=sg(i),u=t.length;let{start:d,end:h,loop:g}=n,y,_;if(g){for(d+=u,h+=u,y=0,_=u;y<_&&a(l(t[d%u][i]),r,s);++y)d--,h--;d%=u,h%=u}return h<d&&(h+=u),{start:d,end:h,loop:g,style:n.style}}function ag(n,t,e){if(!e)return[n];const{property:i,start:r,end:s}=e,a=t.length,{compare:l,between:u,normalize:d}=sg(i),{start:h,end:g,loop:y,style:_}=Fk(n,t,e),x=[];let v=!1,M=null,C,R,F;const I=()=>u(r,F,C)&&l(r,F)!==0,L=()=>l(s,C)===0||u(s,F,C),N=()=>v||I(),B=()=>!v||L();for(let T=h,S=h;T<=g;++T)R=t[T%a],!R.skip&&(C=d(R[i]),C!==F&&(v=u(C,r,s),M===null&&N()&&(M=l(C,r)===0?T:S),M!==null&&B()&&(x.push(og({start:M,end:T,loop:y,count:a,style:_})),M=null),S=T,F=C));return M!==null&&x.push(og({start:M,end:g,loop:y,count:a,style:_})),x}function lg(n,t){const e=[],i=n.segments;for(let r=0;r<i.length;r++){const s=ag(i[r],n.points,t);s.length&&e.push(...s)}return e}function zk(n,t,e,i){let r=0,s=t-1;if(e&&!i)for(;r<t&&!n[r].skip;)r++;for(;r<t&&n[r].skip;)r++;for(r%=t,e&&(s+=r);s>r&&n[s%t].skip;)s--;return s%=t,{start:r,end:s}}function Uk(n,t,e,i){const r=n.length,s=[];let a=t,l=n[t],u;for(u=t+1;u<=e;++u){const d=n[u%r];d.skip||d.stop?l.skip||(i=!1,s.push({start:t%r,end:(u-1)%r,loop:i}),t=a=d.stop?u:null):(a=u,l.skip&&(t=u)),l=d}return a!==null&&s.push({start:t%r,end:a%r,loop:i}),s}function Hk(n,t){const e=n.points,i=n.options.spanGaps,r=e.length;if(!r)return[];const s=!!n._loop,{start:a,end:l}=zk(e,r,s,i);if(i===!0)return cg(n,[{start:a,end:l,loop:s}],e,t);const u=l<a?l+r:l,d=!!n._fullLoop&&a===0&&l===r-1;return cg(n,Uk(e,a,u,d),e,t)}function cg(n,t,e,i){return!i||!i.setContext||!e?t:Wk(n,t,e,i)}function Wk(n,t,e,i){const r=n._chart.getContext(),s=ug(n.options),{_datasetIndex:a,options:{spanGaps:l}}=n,u=e.length,d=[];let h=s,g=t[0].start,y=g;function _(x,v,M,C){const R=l?-1:1;if(x!==v){for(x+=u;e[x%u].skip;)x-=R;for(;e[v%u].skip;)v+=R;x%u!==v%u&&(d.push({start:x%u,end:v%u,loop:M,style:C}),h=C,g=v%u)}}for(const x of t){g=l?g:x.start;let v=e[g%u],M;for(y=g+1;y<=x.end;y++){const C=e[y%u];M=ug(i.setContext(Oi(r,{type:"segment",p0:v,p1:C,p0DataIndex:(y-1)%u,p1DataIndex:y%u,datasetIndex:a}))),Vk(M,h)&&_(g,y-1,x.loop,h),v=C,h=M}g<y-1&&_(g,y-1,x.loop,h)}return d}function ug(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function Vk(n,t){if(!t)return!1;const e=[],i=function(r,s){return Gc(s)?(e.includes(s)||e.push(s),e.indexOf(s)):s};return JSON.stringify(n,i)!==JSON.stringify(t,i)}function Oa(n,t,e){return n.options.clip?n[e]:t[e]}function $k(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:Oa(e,t,"left"),right:Oa(e,t,"right"),top:Oa(i,t,"top"),bottom:Oa(i,t,"bottom")}:t}function dg(n,t){const e=t._clip;if(e.disabled)return!1;const i=$k(t,n.chartArea);return{left:e.left===!1?0:i.left-(e.left===!0?0:e.left),right:e.right===!1?n.width:i.right+(e.right===!0?0:e.right),top:e.top===!1?0:i.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?n.height:i.bottom+(e.bottom===!0?0:e.bottom)}}class Yk{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,r){const s=e.listeners[r],a=e.duration;s.forEach(l=>l({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(i-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=Np.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,r)=>{if(!i.running||!i.items.length)return;const s=i.items;let a=s.length-1,l=!1,u;for(;a>=0;--a)u=s[a],u._active?(u._total>i.duration&&(i.duration=u._total),u.tick(t),l=!0):(s[a]=s[s.length-1],s.pop());l&&(r.draw(),this._notify(r,i,t,"progress")),s.length||(i.running=!1,this._notify(r,i,t,"complete"),i.initial=!1),e+=s.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,r)=>Math.max(i,r._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let r=i.length-1;for(;r>=0;--r)i[r].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var si=new Yk;const fg="transparent",qk={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=Sa(n||fg),r=i.valid&&Sa(t||fg);return r&&r.valid?r.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class jk{constructor(t,e,i,r){const s=e[i];r=Gs([t.to,r,s,t.from]);const a=Gs([t.from,s,r]);this._active=!0,this._fn=t.fn||qk[t.type||typeof a],this._easing=Vs[t.easing]||Vs.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=a,this._to=r,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const r=this._target[this._prop],s=i-this._start,a=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=Gs([t.to,e,r,t.from]),this._from=Gs([t.from,r,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,r=this._prop,s=this._from,a=this._loop,l=this._to;let u;if(this._active=s!==l&&(a||e<i),!this._active){this._target[r]=l,this._notify(!0);return}if(e<0){this._target[r]=s;return}u=e/i%2,u=a&&u>1?2-u:u,u=this._easing(Math.min(1,Math.max(0,u))),this._target[r]=this._fn(s,l,u)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let r=0;r<i.length;r++)i[r][e]()}}class su{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!Pt(t))return;const e=Object.keys(se.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{const s=t[r];if(!Pt(s))return;const a={};for(const l of e)a[l]=s[l];(Yt(s.properties)&&s.properties||[r]).forEach(l=>{(l===r||!i.has(l))&&i.set(l,a)})})}_animateOptions(t,e){const i=e.options,r=Kk(t,i);if(!r)return[];const s=this._createAnimations(r,i);return i.$shared&&Gk(t.options.$animations,i).then(()=>{t.options=i},()=>{}),s}_createAnimations(t,e){const i=this._properties,r=[],s=t.$animations||(t.$animations={}),a=Object.keys(e),l=Date.now();let u;for(u=a.length-1;u>=0;--u){const d=a[u];if(d.charAt(0)==="$")continue;if(d==="options"){r.push(...this._animateOptions(t,e));continue}const h=e[d];let g=s[d];const y=i.get(d);if(g)if(y&&g.active()){g.update(y,h,l);continue}else g.cancel();if(!y||!y.duration){t[d]=h;continue}s[d]=g=new jk(y,t,d,h),r.push(g)}return r}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return si.add(this._chart,i),!0}}function Gk(n,t){const e=[],i=Object.keys(t);for(let r=0;r<i.length;r++){const s=n[i[r]];s&&s.active()&&e.push(s.wait())}return Promise.all(e)}function Kk(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function hg(n,t){const e=n&&n.options||{},i=e.reverse,r=e.min===void 0?t:0,s=e.max===void 0?t:0;return{start:i?s:r,end:i?r:s}}function Xk(n,t,e){if(e===!1)return!1;const i=hg(n,e),r=hg(t,e);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}function Zk(n){let t,e,i,r;return Pt(n)?(t=n.top,e=n.right,i=n.bottom,r=n.left):t=e=i=r=n,{top:t,right:e,bottom:i,left:r,disabled:n===!1}}function pg(n,t){const e=[],i=n._getSortedDatasetMetas(t);let r,s;for(r=0,s=i.length;r<s;++r)e.push(i[r].index);return e}function gg(n,t,e,i={}){const r=n.keys,s=i.mode==="single";let a,l,u,d;if(t===null)return;let h=!1;for(a=0,l=r.length;a<l;++a){if(u=+r[a],u===e){if(h=!0,i.all)continue;break}d=n.values[u],ae(d)&&(s||t===0||Yn(t)===Yn(d))&&(t+=d)}return!h&&!i.all?0:t}function Qk(n,t){const{iScale:e,vScale:i}=t,r=e.axis==="x"?"x":"y",s=i.axis==="x"?"x":"y",a=Object.keys(n),l=new Array(a.length);let u,d,h;for(u=0,d=a.length;u<d;++u)h=a[u],l[u]={[r]:h,[s]:n[h]};return l}function ou(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function Jk(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function tD(n){const{min:t,max:e,minDefined:i,maxDefined:r}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:r?e:Number.POSITIVE_INFINITY}}function eD(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function mg(n,t,e,i){for(const r of t.getMatchingVisibleMetas(i).reverse()){const s=n[r.index];if(e&&s>0||!e&&s<0)return r.index}return null}function yg(n,t){const{chart:e,_cachedMeta:i}=n,r=e._stacks||(e._stacks={}),{iScale:s,vScale:a,index:l}=i,u=s.axis,d=a.axis,h=Jk(s,a,i),g=t.length;let y;for(let _=0;_<g;++_){const x=t[_],{[u]:v,[d]:M}=x,C=x._stacks||(x._stacks={});y=C[d]=eD(r,h,v),y[l]=M,y._top=mg(y,a,!0,i.type),y._bottom=mg(y,a,!1,i.type);const R=y._visualValues||(y._visualValues={});R[l]=M}}function au(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function nD(n,t){return Oi(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function iD(n,t,e){return Oi(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Ks(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const r of t){const s=r._stacks;if(!s||s[i]===void 0||s[i][e]===void 0)return;delete s[i][e],s[i]._visualValues!==void 0&&s[i]._visualValues[e]!==void 0&&delete s[i]._visualValues[e]}}}const lu=n=>n==="reset"||n==="none",_g=(n,t)=>t?n:Object.assign({},n),rD=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:pg(e,!0),values:null};class Ei{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=ou(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Ks(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),r=(g,y,_,x)=>g==="x"?y:g==="r"?x:_,s=e.xAxisID=Mt(i.xAxisID,au(t,"x")),a=e.yAxisID=Mt(i.yAxisID,au(t,"y")),l=e.rAxisID=Mt(i.rAxisID,au(t,"r")),u=e.indexAxis,d=e.iAxisID=r(u,s,a,l),h=e.vAxisID=r(u,a,s,l);e.xScale=this.getScaleForId(s),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(l),e.iScale=this.getScaleForId(d),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Ip(this._data,this),t._stacked&&Ks(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(Pt(e)){const r=this._cachedMeta;this._data=Qk(e,r)}else if(i!==e){if(i){Ip(i,this);const r=this._cachedMeta;Ks(r),r._parsed=[]}e&&Object.isExtensible(e)&&WM(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let r=!1;this._dataCheck();const s=e._stacked;e._stacked=ou(e.vScale,e),e.stack!==i.stack&&(r=!0,Ks(e),e.stack=i.stack),this._resyncElements(t),(r||s!==e._stacked)&&(yg(this,e._parsed),e._stacked=ou(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:r}=this,{iScale:s,_stacked:a}=i,l=s.axis;let u=t===0&&e===r.length?!0:i._sorted,d=t>0&&i._parsed[t-1],h,g,y;if(this._parsing===!1)i._parsed=r,i._sorted=!0,y=r;else{Yt(r[t])?y=this.parseArrayData(i,r,t,e):Pt(r[t])?y=this.parseObjectData(i,r,t,e):y=this.parsePrimitiveData(i,r,t,e);const _=()=>g[l]===null||d&&g[l]<d[l];for(h=0;h<e;++h)i._parsed[h+t]=g=y[h],u&&(_()&&(u=!1),d=g);i._sorted=u}a&&yg(this,y)}parsePrimitiveData(t,e,i,r){const{iScale:s,vScale:a}=t,l=s.axis,u=a.axis,d=s.getLabels(),h=s===a,g=new Array(r);let y,_,x;for(y=0,_=r;y<_;++y)x=y+i,g[y]={[l]:h||s.parse(d[x],x),[u]:a.parse(e[x],x)};return g}parseArrayData(t,e,i,r){const{xScale:s,yScale:a}=t,l=new Array(r);let u,d,h,g;for(u=0,d=r;u<d;++u)h=u+i,g=e[h],l[u]={x:s.parse(g[0],h),y:a.parse(g[1],h)};return l}parseObjectData(t,e,i,r){const{xScale:s,yScale:a}=t,{xAxisKey:l="x",yAxisKey:u="y"}=this._parsing,d=new Array(r);let h,g,y,_;for(h=0,g=r;h<g;++h)y=h+i,_=e[y],d[h]={x:s.parse(Mi(_,l),y),y:a.parse(Mi(_,u),y)};return d}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const r=this.chart,s=this._cachedMeta,a=e[t.axis],l={keys:pg(r,!0),values:e._stacks[t.axis]._visualValues};return gg(l,a,s.index,{mode:i})}updateRangeFromParsed(t,e,i,r){const s=i[e.axis];let a=s===null?NaN:s;const l=r&&i._stacks[e.axis];r&&l&&(r.values=l,a=gg(r,s,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const i=this._cachedMeta,r=i._parsed,s=i._sorted&&t===i.iScale,a=r.length,l=this._getOtherScale(t),u=rD(e,i,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:g}=tD(l);let y,_;function x(){_=r[y];const v=_[l.axis];return!ae(_[t.axis])||h>v||g<v}for(y=0;y<a&&!(!x()&&(this.updateRangeFromParsed(d,t,_,u),s));++y);if(s){for(y=a-1;y>=0;--y)if(!x()){this.updateRangeFromParsed(d,t,_,u);break}}return d}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let r,s,a;for(r=0,s=e.length;r<s;++r)a=e[r][t.axis],ae(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,r=e.vScale,s=this.getParsed(t);return{label:i?""+i.getLabelForValue(s[i.axis]):"",value:r?""+r.getLabelForValue(s[r.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=Zk(Mt(this.options.clip,Xk(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,r=i.data||[],s=e.chartArea,a=[],l=this._drawStart||0,u=this._drawCount||r.length-l,d=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,s,l,u),h=l;h<l+u;++h){const g=r[h];g.hidden||(g.active&&d?a.push(g):g.draw(t,s))}for(h=0;h<a.length;++h)a[h].draw(t,s)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const r=this.getDataset();let s;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];s=a.$context||(a.$context=iD(this.getContext(),t,a)),s.parsed=this.getParsed(t),s.raw=r.data[t],s.index=s.dataIndex=t}else s=this.$context||(this.$context=nD(this.chart.getContext(),this.index)),s.dataset=r,s.index=s.datasetIndex=this.index;return s.active=!!e,s.mode=i,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const r=e==="active",s=this._cachedDataOpts,a=t+"-"+e,l=s[a],u=this.enableOptionSharing&&en(i);if(l)return _g(l,u);const d=this.chart.config,h=d.datasetElementScopeKeys(this._type,t),g=r?[`${t}Hover`,"hover",t,""]:[t,""],y=d.getOptionScopes(this.getDataset(),h),_=Object.keys(se.elements[t]),x=()=>this.getContext(i,r,e),v=d.resolveNamedOptions(y,_,x,g);return v.$shared&&(v.$shared=u,s[a]=Object.freeze(_g(v,u))),v}_resolveAnimations(t,e,i){const r=this.chart,s=this._cachedDataOpts,a=`animation-${e}`,l=s[a];if(l)return l;let u;if(r.options.animation!==!1){const h=this.chart.config,g=h.datasetAnimationScopeKeys(this._type,e),y=h.getOptionScopes(this.getDataset(),g);u=h.createResolver(y,this.getContext(t,i,e))}const d=new su(r,u&&u.animations);return u&&u._cacheable&&(s[a]=Object.freeze(d)),d}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||lu(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),r=this._sharedOptions,s=this.getSharedOptions(i),a=this.includeOptions(e,s)||s!==r;return this.updateSharedOptions(s,e,i),{sharedOptions:s,includeOptions:a}}updateElement(t,e,i,r){lu(r)?Object.assign(t,i):this._resolveAnimations(e,r).update(t,i)}updateSharedOptions(t,e,i){t&&!lu(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,r){t.active=r;const s=this.getStyle(e,r);this._resolveAnimations(e,i,r).update(t,{options:!r&&this.getSharedOptions(s)||s})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[l,u,d]of this._syncList)this[l](u,d);this._syncList=[];const r=i.length,s=e.length,a=Math.min(s,r);a&&this.parse(0,a),s>r?this._insertElements(r,s-r,t):s<r&&this._removeElements(s,r-s)}_insertElements(t,e,i=!0){const r=this._cachedMeta,s=r.data,a=t+e;let l;const u=d=>{for(d.length+=e,l=d.length-1;l>=a;l--)d[l]=d[l-e]};for(u(s),l=t;l<a;++l)s[l]=new this.dataElementType;this._parsing&&u(r._parsed),this.parse(t,e),i&&this.updateElements(s,t,e,"reset")}updateElements(t,e,i,r){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const r=i._parsed.splice(t,e);i._stacked&&Ks(i,r)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,r]=t;this[e](i,r)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function sD(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let r=0,s=e.length;r<s;r++)i=i.concat(e[r].controller.getAllParsedValues(n));n._cache.$bar=Lp(i.sort((r,s)=>r-s))}return n._cache.$bar}function oD(n){const t=n.iScale,e=sD(t,n.type);let i=t._length,r,s,a,l;const u=()=>{a===32767||a===-32768||(en(l)&&(i=Math.min(i,Math.abs(a-l)||i)),l=a)};for(r=0,s=e.length;r<s;++r)a=t.getPixelForValue(e[r]),u();for(l=void 0,r=0,s=t.ticks.length;r<s;++r)a=t.getPixelForTick(r),u();return i}function aD(n,t,e,i){const r=e.barThickness;let s,a;return xt(r)?(s=t.min*e.categoryPercentage,a=e.barPercentage):(s=r*i,a=1),{chunk:s/i,ratio:a,start:t.pixels[n]-s/2}}function lD(n,t,e,i){const r=t.pixels,s=r[n];let a=n>0?r[n-1]:null,l=n<r.length-1?r[n+1]:null;const u=e.categoryPercentage;a===null&&(a=s-(l===null?t.end-t.start:l-s)),l===null&&(l=s+s-a);const d=s-(s-Math.min(a,l))/2*u;return{chunk:Math.abs(l-a)/2*u/i,ratio:e.barPercentage,start:d}}function cD(n,t,e,i){const r=e.parse(n[0],i),s=e.parse(n[1],i),a=Math.min(r,s),l=Math.max(r,s);let u=a,d=l;Math.abs(a)>Math.abs(l)&&(u=l,d=a),t[e.axis]=d,t._custom={barStart:u,barEnd:d,start:r,end:s,min:a,max:l}}function bg(n,t,e,i){return Yt(n)?cD(n,t,e,i):t[e.axis]=e.parse(n,i),t}function xg(n,t,e,i){const r=n.iScale,s=n.vScale,a=r.getLabels(),l=r===s,u=[];let d,h,g,y;for(d=e,h=e+i;d<h;++d)y=t[d],g={},g[r.axis]=l||r.parse(a[d],d),u.push(bg(y,g,s,d));return u}function cu(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function uD(n,t,e){return n!==0?Yn(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function dD(n){let t,e,i,r,s;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(r="end",s="start"):(r="start",s="end"),{start:e,end:i,reverse:t,top:r,bottom:s}}function fD(n,t,e,i){let r=t.borderSkipped;const s={};if(!r){n.borderSkipped=s;return}if(r===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:l,reverse:u,top:d,bottom:h}=dD(n);r==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?r=d:(e._bottom||0)===i?r=h:(s[wg(h,a,l,u)]=!0,r=d)),s[wg(r,a,l,u)]=!0,n.borderSkipped=s}function wg(n,t,e,i){return i?(n=hD(n,t,e),n=vg(n,e,t)):n=vg(n,t,e),n}function hD(n,t,e){return n===t?e:n===e?t:n}function vg(n,t,e){return n==="start"?t:n==="end"?e:n}function pD(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class Sg extends Ei{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,i,r){return xg(t,e,i,r)}parseArrayData(t,e,i,r){return xg(t,e,i,r)}parseObjectData(t,e,i,r){const{iScale:s,vScale:a}=t,{xAxisKey:l="x",yAxisKey:u="y"}=this._parsing,d=s.axis==="x"?l:u,h=a.axis==="x"?l:u,g=[];let y,_,x,v;for(y=i,_=i+r;y<_;++y)v=e[y],x={},x[s.axis]=s.parse(Mi(v,d),y),g.push(bg(Mi(v,h),x,a,y));return g}updateRangeFromParsed(t,e,i,r){super.updateRangeFromParsed(t,e,i,r);const s=i._custom;s&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:r}=e,s=this.getParsed(t),a=s._custom,l=cu(a)?"["+a.start+", "+a.end+"]":""+r.getLabelForValue(s[r.axis]);return{label:""+i.getLabelForValue(s[i.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,r){const s=r==="reset",{index:a,_cachedMeta:{vScale:l}}=this,u=l.getBasePixel(),d=l.isHorizontal(),h=this._getRuler(),{sharedOptions:g,includeOptions:y}=this._getSharedOptions(e,r);for(let _=e;_<e+i;_++){const x=this.getParsed(_),v=s||xt(x[l.axis])?{base:u,head:u}:this._calculateBarValuePixels(_),M=this._calculateBarIndexPixels(_,h),C=(x._stacks||{})[l.axis],R={horizontal:d,base:v.base,enableBorderRadius:!C||cu(x._custom)||a===C._top||a===C._bottom,x:d?v.head:M.center,y:d?M.center:v.head,height:d?M.size:Math.abs(v.size),width:d?Math.abs(v.size):M.size};y&&(R.options=g||this.resolveDataElementOptions(_,t[_].active?"active":r));const F=R.options||t[_].options;fD(R,F,C,a),pD(R,F,h.ratio),this.updateElement(t[_],_,R,r)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,r=i.getMatchingVisibleMetas(this._type).filter(h=>h.controller.options.grouped),s=i.options.stacked,a=[],l=this._cachedMeta.controller.getParsed(e),u=l&&l[i.axis],d=h=>{const g=h._parsed.find(_=>_[i.axis]===u),y=g&&g[h.vScale.axis];if(xt(y)||isNaN(y))return!0};for(const h of r)if(!(e!==void 0&&d(h))&&((s===!1||a.indexOf(h.stack)===-1||s===void 0&&h.stack===void 0)&&a.push(h.stack),h.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[Mt(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){const r=this._getStacks(t,i),s=e!==void 0?r.indexOf(e):-1;return s===-1?r.length-1:s}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,r=[];let s,a;for(s=0,a=e.data.length;s<a;++s)r.push(i.getPixelForValue(this.getParsed(s)[i.axis],s));const l=t.barThickness;return{min:l||oD(e),pixels:r,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:l?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:r},options:{base:s,minBarLength:a}}=this,l=s||0,u=this.getParsed(t),d=u._custom,h=cu(d);let g=u[e.axis],y=0,_=i?this.applyStack(e,u,i):g,x,v;_!==g&&(y=_-g,_=g),h&&(g=d.barStart,_=d.barEnd-d.barStart,g!==0&&Yn(g)!==Yn(d.barEnd)&&(y=0),y+=g);const M=!xt(s)&&!h?s:y;let C=e.getPixelForValue(M);if(this.chart.getDataVisibility(t)?x=e.getPixelForValue(y+_):x=C,v=x-C,Math.abs(v)<a){v=uD(v,e,l)*a,g===l&&(C-=v/2);const R=e.getPixelForDecimal(0),F=e.getPixelForDecimal(1),I=Math.min(R,F),L=Math.max(R,F);C=Math.max(Math.min(C,L),I),x=C+v,i&&!h&&(u._stacks[e.axis]._visualValues[r]=e.getValueForPixel(x)-e.getValueForPixel(C))}if(C===e.getPixelForValue(l)){const R=Yn(v)*e.getLineWidthForValue(l)/2;C+=R,v-=R}return{size:v,base:C,head:x,center:x+v/2}}_calculateBarIndexPixels(t,e){const i=e.scale,r=this.options,s=r.skipNull,a=Mt(r.maxBarThickness,1/0);let l,u;const d=this._getAxisCount();if(e.grouped){const h=s?this._getStackCount(t):e.stackCount,g=r.barThickness==="flex"?lD(t,e,r,h*d):aD(t,e,r,h*d),y=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,_=this._getAxis().indexOf(Mt(y,this.getFirstScaleIdForIndexAxis())),x=this._getStackIndex(this.index,this._cachedMeta.stack,s?t:void 0)+_;l=g.start+g.chunk*x+g.chunk/2,u=Math.min(a,g.chunk*g.ratio)}else l=i.getPixelForValue(this.getParsed(t)[i.axis],t),u=Math.min(a,e.min*e.ratio);return{base:l-u/2,head:l+u/2,center:l,size:u}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,r=i.length;let s=0;for(;s<r;++s)this.getParsed(s)[e.axis]!==null&&!i[s].hidden&&i[s].draw(this._ctx)}}class gD extends Ei{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,r){const s=super.parsePrimitiveData(t,e,i,r);for(let a=0;a<s.length;a++)s[a]._custom=this.resolveDataElementOptions(a+i).radius;return s}parseArrayData(t,e,i,r){const s=super.parseArrayData(t,e,i,r);for(let a=0;a<s.length;a++){const l=e[i+a];s[a]._custom=Mt(l[2],this.resolveDataElementOptions(a+i).radius)}return s}parseObjectData(t,e,i,r){const s=super.parseObjectData(t,e,i,r);for(let a=0;a<s.length;a++){const l=e[i+a];s[a]._custom=Mt(l&&l.r&&+l.r,this.resolveDataElementOptions(a+i).radius)}return s}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:s}=e,a=this.getParsed(t),l=r.getLabelForValue(a.x),u=s.getLabelForValue(a.y),d=a._custom;return{label:i[t]||"",value:"("+l+", "+u+(d?", "+d:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,r){const s=r==="reset",{iScale:a,vScale:l}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,r),h=a.axis,g=l.axis;for(let y=e;y<e+i;y++){const _=t[y],x=!s&&this.getParsed(y),v={},M=v[h]=s?a.getPixelForDecimal(.5):a.getPixelForValue(x[h]),C=v[g]=s?l.getBasePixel():l.getPixelForValue(x[g]);v.skip=isNaN(M)||isNaN(C),d&&(v.options=u||this.resolveDataElementOptions(y,_.active?"active":r),s&&(v.options.radius=0)),this.updateElement(_,y,v,r)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let r=super.resolveDataElementOptions(t,e);r.$shared&&(r=Object.assign({},r,{$shared:!1}));const s=r.radius;return e!=="active"&&(r.radius=0),r.radius+=Mt(i&&i._custom,s),r}}function mD(n,t,e){let i=1,r=1,s=0,a=0;if(t<te){const l=n,u=l+t,d=Math.cos(l),h=Math.sin(l),g=Math.cos(u),y=Math.sin(u),_=(F,I,L)=>Ws(F,l,u,!0)?1:Math.max(I,I*e,L,L*e),x=(F,I,L)=>Ws(F,l,u,!0)?-1:Math.min(I,I*e,L,L*e),v=_(0,d,g),M=_(re,h,y),C=x(Rt,d,g),R=x(Rt+re,h,y);i=(v-C)/2,r=(M-R)/2,s=-(v+C)/2,a=-(M+R)/2}return{ratioX:i,ratioY:r,offsetX:s,offsetY:a}}class Xs extends Ei{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data,{labels:{pointStyle:i,textAlign:r,color:s,useBorderRadius:a,borderRadius:l}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((u,d)=>{const g=t.getDatasetMeta(0).controller.getStyle(d);return{text:u,fillStyle:g.backgroundColor,fontColor:s,hidden:!t.getDataVisibility(d),lineDash:g.borderDash,lineDashOffset:g.borderDashOffset,lineJoin:g.borderJoinStyle,lineWidth:g.borderWidth,strokeStyle:g.borderColor,textAlign:r,pointStyle:i,borderRadius:a&&(l||g.borderRadius),index:d}}):[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=i;else{let s=u=>+i[u];if(Pt(i[t])){const{key:u="value"}=this._parsing;s=d=>+Mi(i[d],u)}let a,l;for(a=t,l=t+e;a<l;++a)r._parsed[a]=s(a)}}_getRotation(){return xe(this.options.rotation-90)}_getCircumference(){return xe(this.options.circumference)}_getRotationExtents(){let t=te,e=-te;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const r=this.chart.getDatasetMeta(i).controller,s=r._getRotation(),a=r._getCircumference();t=Math.min(t,s),e=Math.max(e,s+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,r=this._cachedMeta,s=r.data,a=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,l=Math.max((Math.min(i.width,i.height)-a)/2,0),u=Math.min(CM(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:h,rotation:g}=this._getRotationExtents(),{ratioX:y,ratioY:_,offsetX:x,offsetY:v}=mD(g,h,u),M=(i.width-a)/y,C=(i.height-a)/_,R=Math.max(Math.min(M,C)/2,0),F=kp(this.options.radius,R),I=Math.max(F*u,0),L=(F-I)/this._getVisibleDatasetWeightTotal();this.offsetX=x*F,this.offsetY=v*F,r.total=this.calculateTotal(),this.outerRadius=F-L*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-L*d,0),this.updateElements(s,0,s.length,t)}_circumference(t,e){const i=this.options,r=this._cachedMeta,s=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||r._parsed[t]===null||r.data[t].hidden?0:this.calculateCircumference(r._parsed[t]*s/te)}updateElements(t,e,i,r){const s=r==="reset",a=this.chart,l=a.chartArea,d=a.options.animation,h=(l.left+l.right)/2,g=(l.top+l.bottom)/2,y=s&&d.animateScale,_=y?0:this.innerRadius,x=y?0:this.outerRadius,{sharedOptions:v,includeOptions:M}=this._getSharedOptions(e,r);let C=this._getRotation(),R;for(R=0;R<e;++R)C+=this._circumference(R,s);for(R=e;R<e+i;++R){const F=this._circumference(R,s),I=t[R],L={x:h+this.offsetX,y:g+this.offsetY,startAngle:C,endAngle:C+F,circumference:F,outerRadius:x,innerRadius:_};M&&(L.options=v||this.resolveDataElementOptions(R,I.active?"active":r)),C+=F,this.updateElement(I,R,L,r)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,r;for(r=0;r<e.length;r++){const s=t._parsed[r];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(r)&&!e[r].hidden&&(i+=Math.abs(s))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?te*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=$s(e._parsed[t],i.options.locale);return{label:r[t]||"",value:s}}getMaxBorderWidth(t){let e=0;const i=this.chart;let r,s,a,l,u;if(!t){for(r=0,s=i.data.datasets.length;r<s;++r)if(i.isDatasetVisible(r)){a=i.getDatasetMeta(r),t=a.data,l=a.controller;break}}if(!t)return 0;for(r=0,s=t.length;r<s;++r)u=l.resolveDataElementOptions(r),u.borderAlign!=="inner"&&(e=Math.max(e,u.borderWidth||0,u.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,r=t.length;i<r;++i){const s=this.resolveDataElementOptions(i);e=Math.max(e,s.offset||0,s.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(Mt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class Tg extends Ei{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:r=[],_dataset:s}=e,a=this.chart._animationsDisabled;let{start:l,count:u}=Fp(e,r,a);this._drawStart=l,this._drawCount=u,zp(e)&&(l=0,u=r.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!s._decimated,i.points=r;const d=this.resolveDatasetElementOptions(t);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:d},t),this.updateElements(r,l,u,t)}updateElements(t,e,i,r){const s=r==="reset",{iScale:a,vScale:l,_stacked:u,_dataset:d}=this._cachedMeta,{sharedOptions:h,includeOptions:g}=this._getSharedOptions(e,r),y=a.axis,_=l.axis,{spanGaps:x,segment:v}=this.options,M=Di(x)?x:Number.POSITIVE_INFINITY,C=this.chart._animationsDisabled||s||r==="none",R=e+i,F=t.length;let I=e>0&&this.getParsed(e-1);for(let L=0;L<F;++L){const N=t[L],B=C?N:{};if(L<e||L>=R){B.skip=!0;continue}const T=this.getParsed(L),S=xt(T[_]),O=B[y]=a.getPixelForValue(T[y],L),U=B[_]=s||S?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,T,u):T[_],L);B.skip=isNaN(O)||isNaN(U)||S,B.stop=L>0&&Math.abs(T[y]-I[y])>M,v&&(B.parsed=T,B.raw=d.data[L]),g&&(B.options=h||this.resolveDataElementOptions(L,N.active?"active":r)),C||this.updateElement(N,L,B,r),I=T}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,r=t.data||[];if(!r.length)return i;const s=r[0].size(this.resolveDataElementOptions(0)),a=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(i,s,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class Mg extends Ei{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return e.labels.map((s,a)=>{const u=t.getDatasetMeta(0).controller.getStyle(a);return{text:s,fillStyle:u.backgroundColor,strokeStyle:u.borderColor,fontColor:r,lineWidth:u.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=$s(e._parsed[t].r,i.options.locale);return{label:r[t]||"",value:s}}parseObjectData(t,e,i,r){return Jp.bind(this)(t,e,i,r)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,r)=>{const s=this.getParsed(r).r;!isNaN(s)&&this.chart.getDataVisibility(r)&&(s<e.min&&(e.min=s),s>e.max&&(e.max=s))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,r=Math.min(e.right-e.left,e.bottom-e.top),s=Math.max(r/2,0),a=Math.max(i.cutoutPercentage?s/100*i.cutoutPercentage:1,0),l=(s-a)/t.getVisibleDatasetCount();this.outerRadius=s-l*this.index,this.innerRadius=this.outerRadius-l}updateElements(t,e,i,r){const s=r==="reset",a=this.chart,u=a.options.animation,d=this._cachedMeta.rScale,h=d.xCenter,g=d.yCenter,y=d.getIndexAngle(0)-.5*Rt;let _=y,x;const v=360/this.countVisibleElements();for(x=0;x<e;++x)_+=this._computeAngle(x,r,v);for(x=e;x<e+i;x++){const M=t[x];let C=_,R=_+this._computeAngle(x,r,v),F=a.getDataVisibility(x)?d.getDistanceFromCenterForValue(this.getParsed(x).r):0;_=R,s&&(u.animateScale&&(F=0),u.animateRotate&&(C=R=y));const I={x:h,y:g,innerRadius:0,outerRadius:F,startAngle:C,endAngle:R,options:this.resolveDataElementOptions(x,M.active?"active":r)};this.updateElement(M,x,I,r)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,r)=>{!isNaN(this.getParsed(r).r)&&this.chart.getDataVisibility(r)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?xe(this.resolveDataElementOptions(t,e).angle||i):0}}class yD extends Xs{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class _D extends Ei{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,r){return Jp.bind(this)(t,e,i,r)}update(t){const e=this._cachedMeta,i=e.dataset,r=e.data||[],s=e.iScale.getLabels();if(i.points=r,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const l={_loop:!0,_fullLoop:s.length===r.length,options:a};this.updateElement(i,void 0,l,t)}this.updateElements(r,0,r.length,t)}updateElements(t,e,i,r){const s=this._cachedMeta.rScale,a=r==="reset";for(let l=e;l<e+i;l++){const u=t[l],d=this.resolveDataElementOptions(l,u.active?"active":r),h=s.getPointPositionForValue(l,this.getParsed(l).r),g=a?s.xCenter:h.x,y=a?s.yCenter:h.y,_={x:g,y,angle:h.angle,skip:isNaN(g)||isNaN(y),options:d};this.updateElement(u,l,_,r)}}}class kg extends Ei{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:s}=e,a=this.getParsed(t),l=r.getLabelForValue(a.x),u=s.getLabelForValue(a.y);return{label:i[t]||"",value:"("+l+", "+u+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,r=this.chart._animationsDisabled;let{start:s,count:a}=Fp(e,i,r);if(this._drawStart=s,this._drawCount=a,zp(e)&&(s=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:l,_dataset:u}=e;l._chart=this.chart,l._datasetIndex=this.index,l._decimated=!!u._decimated,l.points=i;const d=this.resolveDatasetElementOptions(t);d.segment=this.options.segment,this.updateElement(l,void 0,{animated:!r,options:d},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,s,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,r){const s=r==="reset",{iScale:a,vScale:l,_stacked:u,_dataset:d}=this._cachedMeta,h=this.resolveDataElementOptions(e,r),g=this.getSharedOptions(h),y=this.includeOptions(r,g),_=a.axis,x=l.axis,{spanGaps:v,segment:M}=this.options,C=Di(v)?v:Number.POSITIVE_INFINITY,R=this.chart._animationsDisabled||s||r==="none";let F=e>0&&this.getParsed(e-1);for(let I=e;I<e+i;++I){const L=t[I],N=this.getParsed(I),B=R?L:{},T=xt(N[x]),S=B[_]=a.getPixelForValue(N[_],I),O=B[x]=s||T?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,N,u):N[x],I);B.skip=isNaN(S)||isNaN(O)||T,B.stop=I>0&&Math.abs(N[_]-F[_])>C,M&&(B.parsed=N,B.raw=d.data[I]),y&&(B.options=g||this.resolveDataElementOptions(I,L.active?"active":r)),R||this.updateElement(L,I,B,r),F=N}this.updateSharedOptions(g,r,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let l=0;for(let u=e.length-1;u>=0;--u)l=Math.max(l,e[u].size(this.resolveDataElementOptions(u))/2);return l>0&&l}const i=t.dataset,r=i.options&&i.options.borderWidth||0;if(!e.length)return r;const s=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(r,s,a)/2}}var bD=Object.freeze({__proto__:null,BarController:Sg,BubbleController:gD,DoughnutController:Xs,LineController:Tg,PieController:yD,PolarAreaController:Mg,RadarController:_D,ScatterController:kg});function ur(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class uu{static override(t){Object.assign(uu.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return ur()}parse(){return ur()}format(){return ur()}add(){return ur()}diff(){return ur()}startOf(){return ur()}endOf(){return ur()}}var Dg={_date:uu};function xD(n,t,e,i){const{controller:r,data:s,_sorted:a}=n,l=r._cachedMeta.iScale,u=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(l&&t===l.axis&&t!=="r"&&a&&s.length){const d=l._reversePixels?UM:ii;if(i){if(r._sharedOptions){const h=s[0],g=typeof h.getRange=="function"&&h.getRange(t);if(g){const y=d(s,t,e-g),_=d(s,t,e+g);return{lo:y.lo,hi:_.hi}}}}else{const h=d(s,t,e);if(u){const{vScale:g}=r._cachedMeta,{_parsed:y}=n,_=y.slice(0,h.lo+1).reverse().findIndex(v=>!xt(v[g.axis]));h.lo-=Math.max(0,_);const x=y.slice(h.hi).findIndex(v=>!xt(v[g.axis]));h.hi+=Math.max(0,x)}return h}}return{lo:0,hi:s.length-1}}function Zs(n,t,e,i,r){const s=n.getSortedVisibleDatasetMetas(),a=e[t];for(let l=0,u=s.length;l<u;++l){const{index:d,data:h}=s[l],{lo:g,hi:y}=xD(s[l],t,a,r);for(let _=g;_<=y;++_){const x=h[_];x.skip||i(x,d,_)}}}function wD(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,r){const s=t?Math.abs(i.x-r.x):0,a=e?Math.abs(i.y-r.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(a,2))}}function du(n,t,e,i,r){const s=[];return!r&&!n.isPointInArea(t)||Zs(n,e,t,function(l,u,d){!r&&!ri(l,n.chartArea,0)||l.inRange(t.x,t.y,i)&&s.push({element:l,datasetIndex:u,index:d})},!0),s}function vD(n,t,e,i){let r=[];function s(a,l,u){const{startAngle:d,endAngle:h}=a.getProps(["startAngle","endAngle"],i),{angle:g}=wa(a,{x:t.x,y:t.y});Ws(g,d,h)&&r.push({element:a,datasetIndex:l,index:u})}return Zs(n,e,t,s),r}function SD(n,t,e,i,r,s){let a=[];const l=wD(e);let u=Number.POSITIVE_INFINITY;function d(h,g,y){const _=h.inRange(t.x,t.y,r);if(i&&!_)return;const x=h.getCenterPoint(r);if(!(!!s||n.isPointInArea(x))&&!_)return;const M=l(t,x);M<u?(a=[{element:h,datasetIndex:g,index:y}],u=M):M===u&&a.push({element:h,datasetIndex:g,index:y})}return Zs(n,e,t,d),a}function fu(n,t,e,i,r,s){return!s&&!n.isPointInArea(t)?[]:e==="r"&&!i?vD(n,t,e,r):SD(n,t,e,i,r,s)}function Cg(n,t,e,i,r){const s=[],a=e==="x"?"inXRange":"inYRange";let l=!1;return Zs(n,e,t,(u,d,h)=>{u[a]&&u[a](t[e],r)&&(s.push({element:u,datasetIndex:d,index:h}),l=l||u.inRange(t.x,t.y,r))}),i&&!l?[]:s}var hu={evaluateInteractionItems:Zs,modes:{index(n,t,e,i){const r=Ai(t,n),s=e.axis||"x",a=e.includeInvisible||!1,l=e.intersect?du(n,r,s,i,a):fu(n,r,s,!1,i,a),u=[];return l.length?(n.getSortedVisibleDatasetMetas().forEach(d=>{const h=l[0].index,g=d.data[h];g&&!g.skip&&u.push({element:g,datasetIndex:d.index,index:h})}),u):[]},dataset(n,t,e,i){const r=Ai(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;let l=e.intersect?du(n,r,s,i,a):fu(n,r,s,!1,i,a);if(l.length>0){const u=l[0].datasetIndex,d=n.getDatasetMeta(u).data;l=[];for(let h=0;h<d.length;++h)l.push({element:d[h],datasetIndex:u,index:h})}return l},point(n,t,e,i){const r=Ai(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;return du(n,r,s,i,a)},nearest(n,t,e,i){const r=Ai(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;return fu(n,r,s,e.intersect,i,a)},x(n,t,e,i){const r=Ai(t,n);return Cg(n,r,"x",e.intersect,i)},y(n,t,e,i){const r=Ai(t,n);return Cg(n,r,"y",e.intersect,i)}}};const Og=["left","top","right","bottom"];function Qs(n,t){return n.filter(e=>e.pos===t)}function Ag(n,t){return n.filter(e=>Og.indexOf(e.pos)===-1&&e.box.axis===t)}function Js(n,t){return n.sort((e,i)=>{const r=t?i:e,s=t?e:i;return r.weight===s.weight?r.index-s.index:r.weight-s.weight})}function TD(n){const t=[];let e,i,r,s,a,l;for(e=0,i=(n||[]).length;e<i;++e)r=n[e],{position:s,options:{stack:a,stackWeight:l=1}}=r,t.push({index:e,box:r,pos:s,horizontal:r.isHorizontal(),weight:r.weight,stack:a&&s+a,stackWeight:l});return t}function MD(n){const t={};for(const e of n){const{stack:i,pos:r,stackWeight:s}=e;if(!i||!Og.includes(r))continue;const a=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=s}return t}function kD(n,t){const e=MD(n),{vBoxMaxWidth:i,hBoxMaxHeight:r}=t;let s,a,l;for(s=0,a=n.length;s<a;++s){l=n[s];const{fullSize:u}=l.box,d=e[l.stack],h=d&&l.stackWeight/d.weight;l.horizontal?(l.width=h?h*i:u&&t.availableWidth,l.height=r):(l.width=i,l.height=h?h*r:u&&t.availableHeight)}return e}function DD(n){const t=TD(n),e=Js(t.filter(d=>d.box.fullSize),!0),i=Js(Qs(t,"left"),!0),r=Js(Qs(t,"right")),s=Js(Qs(t,"top"),!0),a=Js(Qs(t,"bottom")),l=Ag(t,"x"),u=Ag(t,"y");return{fullSize:e,leftAndTop:i.concat(s),rightAndBottom:r.concat(u).concat(a).concat(l),chartArea:Qs(t,"chartArea"),vertical:i.concat(r).concat(u),horizontal:s.concat(a).concat(l)}}function Rg(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Eg(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function CD(n,t,e,i){const{pos:r,box:s}=e,a=n.maxPadding;if(!Pt(r)){e.size&&(n[r]-=e.size);const g=i[e.stack]||{size:0,count:1};g.size=Math.max(g.size,e.horizontal?s.height:s.width),e.size=g.size/g.count,n[r]+=e.size}s.getPadding&&Eg(a,s.getPadding());const l=Math.max(0,t.outerWidth-Rg(a,n,"left","right")),u=Math.max(0,t.outerHeight-Rg(a,n,"top","bottom")),d=l!==n.w,h=u!==n.h;return n.w=l,n.h=u,e.horizontal?{same:d,other:h}:{same:h,other:d}}function OD(n){const t=n.maxPadding;function e(i){const r=Math.max(t[i]-n[i],0);return n[i]+=r,r}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function AD(n,t){const e=t.maxPadding;function i(r){const s={left:0,top:0,right:0,bottom:0};return r.forEach(a=>{s[a]=Math.max(t[a],e[a])}),s}return i(n?["left","right"]:["top","bottom"])}function to(n,t,e,i){const r=[];let s,a,l,u,d,h;for(s=0,a=n.length,d=0;s<a;++s){l=n[s],u=l.box,u.update(l.width||t.w,l.height||t.h,AD(l.horizontal,t));const{same:g,other:y}=CD(t,e,l,i);d|=g&&r.length,h=h||y,u.fullSize||r.push(l)}return d&&to(r,t,e,i)||h}function Aa(n,t,e,i,r){n.top=e,n.left=t,n.right=t+i,n.bottom=e+r,n.width=i,n.height=r}function Pg(n,t,e,i){const r=e.padding;let{x:s,y:a}=t;for(const l of n){const u=l.box,d=i[l.stack]||{placed:0,weight:1},h=l.stackWeight/d.weight||1;if(l.horizontal){const g=t.w*h,y=d.size||u.height;en(d.start)&&(a=d.start),u.fullSize?Aa(u,r.left,a,e.outerWidth-r.right-r.left,y):Aa(u,t.left+d.placed,a,g,y),d.start=a,d.placed+=g,a=u.bottom}else{const g=t.h*h,y=d.size||u.width;en(d.start)&&(s=d.start),u.fullSize?Aa(u,s,r.top,y,e.outerHeight-r.bottom-r.top):Aa(u,s,t.top+d.placed,y,g),d.start=s,d.placed+=g,s=u.right}}t.x=s,t.y=a}var We={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const r=we(n.options.layout.padding),s=Math.max(t-r.width,0),a=Math.max(e-r.height,0),l=DD(n.boxes),u=l.vertical,d=l.horizontal;Jt(n.boxes,v=>{typeof v.beforeLayout=="function"&&v.beforeLayout()});const h=u.reduce((v,M)=>M.box.options&&M.box.options.display===!1?v:v+1,0)||1,g=Object.freeze({outerWidth:t,outerHeight:e,padding:r,availableWidth:s,availableHeight:a,vBoxMaxWidth:s/2/h,hBoxMaxHeight:a/2}),y=Object.assign({},r);Eg(y,we(i));const _=Object.assign({maxPadding:y,w:s,h:a,x:r.left,y:r.top},r),x=kD(u.concat(d),g);to(l.fullSize,_,g,x),to(u,_,g,x),to(d,_,g,x)&&to(u,_,g,x),OD(_),Pg(l.leftAndTop,_,g,x),_.x+=_.w,_.y+=_.h,Pg(l.rightAndBottom,_,g,x),n.chartArea={left:_.left,top:_.top,right:_.left+_.w,bottom:_.top+_.h,height:_.h,width:_.w},Jt(l.chartArea,v=>{const M=v.box;Object.assign(M,n.chartArea),M.update(_.w,_.h,{left:0,top:0,right:0,bottom:0})})}};class Ig{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,r){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,r?Math.floor(e/r):i)}}isAttached(t){return!0}updateConfig(t){}}class RD extends Ig{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ra="$chartjs",ED={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Lg=n=>n===null||n==="";function PD(n,t){const e=n.style,i=n.getAttribute("height"),r=n.getAttribute("width");if(n[Ra]={initial:{height:i,width:r,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Lg(r)){const s=ng(n,"width");s!==void 0&&(n.width=s)}if(Lg(i))if(n.style.height==="")n.height=n.width/(t||2);else{const s=ng(n,"height");s!==void 0&&(n.height=s)}return n}const Ng=Pk?{passive:!0}:!1;function ID(n,t,e){n&&n.addEventListener(t,e,Ng)}function LD(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,Ng)}function ND(n,t){const e=ED[n.type]||n.type,{x:i,y:r}=Ai(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:r!==void 0?r:null}}function Ea(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function BD(n,t,e){const i=n.canvas,r=new MutationObserver(s=>{let a=!1;for(const l of s)a=a||Ea(l.addedNodes,i),a=a&&!Ea(l.removedNodes,i);a&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}function FD(n,t,e){const i=n.canvas,r=new MutationObserver(s=>{let a=!1;for(const l of s)a=a||Ea(l.removedNodes,i),a=a&&!Ea(l.addedNodes,i);a&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}const eo=new Map;let Bg=0;function Fg(){const n=window.devicePixelRatio;n!==Bg&&(Bg=n,eo.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function zD(n,t){eo.size||window.addEventListener("resize",Fg),eo.set(n,t)}function UD(n){eo.delete(n),eo.size||window.removeEventListener("resize",Fg)}function HD(n,t,e){const i=n.canvas,r=i&&ru(i);if(!r)return;const s=Bp((l,u)=>{const d=r.clientWidth;e(l,u),d<r.clientWidth&&e()},window),a=new ResizeObserver(l=>{const u=l[0],d=u.contentRect.width,h=u.contentRect.height;d===0&&h===0||s(d,h)});return a.observe(r),zD(n,s),a}function pu(n,t,e){e&&e.disconnect(),t==="resize"&&UD(n)}function WD(n,t,e){const i=n.canvas,r=Bp(s=>{n.ctx!==null&&e(ND(s,n))},n);return ID(i,t,r),r}class VD extends Ig{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(PD(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Ra])return!1;const i=e[Ra].initial;["height","width"].forEach(s=>{const a=i[s];xt(a)?e.removeAttribute(s):e.setAttribute(s,a)});const r=i.style||{};return Object.keys(r).forEach(s=>{e.style[s]=r[s]}),e.width=e.width,delete e[Ra],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const r=t.$proxies||(t.$proxies={}),a={attach:BD,detach:FD,resize:HD}[e]||WD;r[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),r=i[e];if(!r)return;({attach:pu,detach:pu,resize:pu}[e]||LD)(t,e,r),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,r){return Ek(t,e,i,r)}isAttached(t){const e=t&&ru(t);return!!(e&&e.isConnected)}}function $D(n){return!iu()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?RD:VD}class Ve{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Di(this.x)&&Di(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const r={};return t.forEach(s=>{r[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),r}}function YD(n,t){const e=n.options.ticks,i=qD(n),r=Math.min(e.maxTicksLimit||i,i),s=e.major.enabled?GD(t):[],a=s.length,l=s[0],u=s[a-1],d=[];if(a>r)return KD(t,d,s,a/r),d;const h=jD(s,t,r);if(a>0){let g,y;const _=a>1?Math.round((u-l)/(a-1)):null;for(Pa(t,d,h,xt(_)?0:l-_,l),g=0,y=a-1;g<y;g++)Pa(t,d,h,s[g],s[g+1]);return Pa(t,d,h,u,xt(_)?t.length:u+_),d}return Pa(t,d,h),d}function qD(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),r=n._maxLength/e;return Math.floor(Math.min(i,r))}function jD(n,t,e){const i=XD(n),r=t.length/e;if(!i)return Math.max(r,1);const s=LM(i);for(let a=0,l=s.length-1;a<l;a++){const u=s[a];if(u>r)return u}return Math.max(r,1)}function GD(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function KD(n,t,e,i){let r=0,s=e[0],a;for(i=Math.ceil(i),a=0;a<n.length;a++)a===s&&(t.push(n[a]),r++,s=e[r*i])}function Pa(n,t,e,i,r){const s=Mt(i,0),a=Math.min(Mt(r,n.length),n.length);let l=0,u,d,h;for(e=Math.ceil(e),r&&(u=r-i,e=u/Math.floor(u/e)),h=s;h<0;)l++,h=Math.round(s+l*e);for(d=Math.max(s,0);d<a;d++)d===h&&(t.push(n[d]),l++,h=Math.round(s+l*e))}function XD(n){const t=n.length;let e,i;if(t<2)return!1;for(i=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==i)return!1;return i}const ZD=n=>n==="left"?"right":n==="right"?"left":n,zg=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,Ug=(n,t)=>Math.min(t||n,n);function Hg(n,t){const e=[],i=n.length/t,r=n.length;let s=0;for(;s<r;s+=i)e.push(n[Math.floor(s)]);return e}function QD(n,t,e){const i=n.ticks.length,r=Math.min(t,i-1),s=n._startPixel,a=n._endPixel,l=1e-6;let u=n.getPixelForTick(r),d;if(!(e&&(i===1?d=Math.max(u-s,a-u):t===0?d=(n.getPixelForTick(1)-u)/2:d=(u-n.getPixelForTick(r-1))/2,u+=r<t?d:-d,u<s-l||u>a+l)))return u}function JD(n,t){Jt(n,e=>{const i=e.gc,r=i.length/2;let s;if(r>t){for(s=0;s<r;++s)delete e.data[i[s]];i.splice(0,r)}})}function no(n){return n.drawTicks?n.tickLength:0}function Wg(n,t){if(!n.display)return 0;const e=le(n.font,t),i=we(n.padding);return(Yt(n.text)?n.text.length:1)*e.lineHeight+i.height}function tC(n,t){return Oi(n,{scale:t,type:"scale"})}function eC(n,t,e){return Oi(n,{tick:e,index:t,type:"tick"})}function nC(n,t,e){let i=jc(n);return(e&&t!=="right"||!e&&t==="right")&&(i=ZD(i)),i}function iC(n,t,e,i){const{top:r,left:s,bottom:a,right:l,chart:u}=n,{chartArea:d,scales:h}=u;let g=0,y,_,x;const v=a-r,M=l-s;if(n.isHorizontal()){if(_=He(i,s,l),Pt(e)){const C=Object.keys(e)[0],R=e[C];x=h[C].getPixelForValue(R)+v-t}else e==="center"?x=(d.bottom+d.top)/2+v-t:x=zg(n,e,t);y=l-s}else{if(Pt(e)){const C=Object.keys(e)[0],R=e[C];_=h[C].getPixelForValue(R)-M+t}else e==="center"?_=(d.left+d.right)/2-M+t:_=zg(n,e,t);x=He(i,a,r),g=e==="left"?-re:re}return{titleX:_,titleY:x,maxWidth:y,rotation:g}}class dr extends Ve{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:r}=this;return t=pn(t,Number.POSITIVE_INFINITY),e=pn(e,Number.NEGATIVE_INFINITY),i=pn(i,Number.POSITIVE_INFINITY),r=pn(r,Number.NEGATIVE_INFINITY),{min:pn(t,i),max:pn(e,r),minDefined:ae(t),maxDefined:ae(e)}}getMinMax(t){let{min:e,max:i,minDefined:r,maxDefined:s}=this.getUserBounds(),a;if(r&&s)return{min:e,max:i};const l=this.getMatchingVisibleMetas();for(let u=0,d=l.length;u<d;++u)a=l[u].controller.getMinMax(this,t),r||(e=Math.min(e,a.min)),s||(i=Math.max(i,a.max));return e=s&&e>i?i:e,i=r&&e>i?e:i,{min:pn(e,pn(i,e)),max:pn(i,pn(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Qt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:r,grace:s,ticks:a}=this.options,l=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=uk(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const u=l<this.ticks.length;this._convertTicksToLabels(u?Hg(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=YD(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),u&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Qt(this.options.afterUpdate,[this])}beforeSetDimensions(){Qt(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){Qt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Qt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Qt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,r,s;for(i=0,r=t.length;i<r;i++)s=t[i],s.label=Qt(e.callback,[s.value,i,t],this)}afterTickToLabelConversion(){Qt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Qt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=Ug(this.ticks.length,t.ticks.maxTicksLimit),r=e.minRotation||0,s=e.maxRotation;let a=r,l,u,d;if(!this._isVisible()||!e.display||r>=s||i<=1||!this.isHorizontal()){this.labelRotation=r;return}const h=this._getLabelSizes(),g=h.widest.width,y=h.highest.height,_=Ce(this.chart.width-g,0,this.maxWidth);l=t.offset?this.maxWidth/i:_/(i-1),g+6>l&&(l=_/(i-(t.offset?.5:1)),u=this.maxHeight-no(t.grid)-e.padding-Wg(t.title,this.chart.options.font),d=Math.sqrt(g*g+y*y),a=xa(Math.min(Math.asin(Ce((h.highest.height+6)/l,-1,1)),Math.asin(Ce(u/d,-1,1))-Math.asin(Ce(y/d,-1,1)))),a=Math.max(r,Math.min(s,a))),this.labelRotation=a}afterCalculateLabelRotation(){Qt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Qt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:r,grid:s}}=this,a=this._isVisible(),l=this.isHorizontal();if(a){const u=Wg(r,e.options.font);if(l?(t.width=this.maxWidth,t.height=no(s)+u):(t.height=this.maxHeight,t.width=no(s)+u),i.display&&this.ticks.length){const{first:d,last:h,widest:g,highest:y}=this._getLabelSizes(),_=i.padding*2,x=xe(this.labelRotation),v=Math.cos(x),M=Math.sin(x);if(l){const C=i.mirror?0:M*g.width+v*y.height;t.height=Math.min(this.maxHeight,t.height+C+_)}else{const C=i.mirror?0:v*g.width+M*y.height;t.width=Math.min(this.maxWidth,t.width+C+_)}this._calculatePadding(d,h,M,v)}}this._handleMargins(),l?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,r){const{ticks:{align:s,padding:a},position:l}=this.options,u=this.labelRotation!==0,d=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,g=this.right-this.getPixelForTick(this.ticks.length-1);let y=0,_=0;u?d?(y=r*t.width,_=i*e.height):(y=i*t.height,_=r*e.width):s==="start"?_=e.width:s==="end"?y=t.width:s!=="inner"&&(y=t.width/2,_=e.width/2),this.paddingLeft=Math.max((y-h+a)*this.width/(this.width-h),0),this.paddingRight=Math.max((_-g+a)*this.width/(this.width-g),0)}else{let h=e.height/2,g=t.height/2;s==="start"?(h=0,g=t.height):s==="end"&&(h=e.height,g=0),this.paddingTop=h+a,this.paddingBottom=g+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Qt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)xt(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=Hg(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:r,_longestTextCache:s}=this,a=[],l=[],u=Math.floor(e/Ug(e,i));let d=0,h=0,g,y,_,x,v,M,C,R,F,I,L;for(g=0;g<e;g+=u){if(x=t[g].label,v=this._resolveTickFontOptions(g),r.font=M=v.string,C=s[M]=s[M]||{data:{},gc:[]},R=v.lineHeight,F=I=0,!xt(x)&&!Yt(x))F=Ma(r,C.data,C.gc,F,x),I=R;else if(Yt(x))for(y=0,_=x.length;y<_;++y)L=x[y],!xt(L)&&!Yt(L)&&(F=Ma(r,C.data,C.gc,F,L),I+=R);a.push(F),l.push(I),d=Math.max(F,d),h=Math.max(I,h)}JD(s,e);const N=a.indexOf(d),B=l.indexOf(h),T=S=>({width:a[S]||0,height:l[S]||0});return{first:T(0),last:T(e-1),widest:T(N),highest:T(B),widths:a,heights:l}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return zM(this._alignToPixels?or(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=eC(this.getContext(),t,i))}return this.$context||(this.$context=tC(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=xe(this.labelRotation),i=Math.abs(Math.cos(e)),r=Math.abs(Math.sin(e)),s=this._getLabelSizes(),a=t.autoSkipPadding||0,l=s?s.widest.width+a:0,u=s?s.highest.height+a:0;return this.isHorizontal()?u*i>l*r?l/i:u/r:u*r<l*i?u/i:l/r}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,r=this.options,{grid:s,position:a,border:l}=r,u=s.offset,d=this.isHorizontal(),g=this.ticks.length+(u?1:0),y=no(s),_=[],x=l.setContext(this.getContext()),v=x.display?x.width:0,M=v/2,C=function(q){return or(i,q,v)};let R,F,I,L,N,B,T,S,O,U,$,it;if(a==="top")R=C(this.bottom),B=this.bottom-y,S=R-M,U=C(t.top)+M,it=t.bottom;else if(a==="bottom")R=C(this.top),U=t.top,it=C(t.bottom)-M,B=R+M,S=this.top+y;else if(a==="left")R=C(this.right),N=this.right-y,T=R-M,O=C(t.left)+M,$=t.right;else if(a==="right")R=C(this.left),O=t.left,$=C(t.right)-M,N=R+M,T=this.left+y;else if(e==="x"){if(a==="center")R=C((t.top+t.bottom)/2+.5);else if(Pt(a)){const q=Object.keys(a)[0],J=a[q];R=C(this.chart.scales[q].getPixelForValue(J))}U=t.top,it=t.bottom,B=R+M,S=B+y}else if(e==="y"){if(a==="center")R=C((t.left+t.right)/2);else if(Pt(a)){const q=Object.keys(a)[0],J=a[q];R=C(this.chart.scales[q].getPixelForValue(J))}N=R-M,T=N-y,O=t.left,$=t.right}const at=Mt(r.ticks.maxTicksLimit,g),ot=Math.max(1,Math.ceil(g/at));for(F=0;F<g;F+=ot){const q=this.getContext(F),J=s.setContext(q),rt=l.setContext(q),tt=J.lineWidth,G=J.color,P=rt.dash||[],W=rt.dashOffset,j=J.tickWidth,pt=J.tickColor,lt=J.tickBorderDash||[],et=J.tickBorderDashOffset;I=QD(this,F,u),I!==void 0&&(L=or(i,I,tt),d?N=T=O=$=L:B=S=U=it=L,_.push({tx1:N,ty1:B,tx2:T,ty2:S,x1:O,y1:U,x2:$,y2:it,width:tt,color:G,borderDash:P,borderDashOffset:W,tickWidth:j,tickColor:pt,tickBorderDash:lt,tickBorderDashOffset:et}))}return this._ticksLength=g,this._borderValue=R,_}_computeLabelItems(t){const e=this.axis,i=this.options,{position:r,ticks:s}=i,a=this.isHorizontal(),l=this.ticks,{align:u,crossAlign:d,padding:h,mirror:g}=s,y=no(i.grid),_=y+h,x=g?-h:_,v=-xe(this.labelRotation),M=[];let C,R,F,I,L,N,B,T,S,O,U,$,it="middle";if(r==="top")N=this.bottom-x,B=this._getXAxisLabelAlignment();else if(r==="bottom")N=this.top+x,B=this._getXAxisLabelAlignment();else if(r==="left"){const ot=this._getYAxisLabelAlignment(y);B=ot.textAlign,L=ot.x}else if(r==="right"){const ot=this._getYAxisLabelAlignment(y);B=ot.textAlign,L=ot.x}else if(e==="x"){if(r==="center")N=(t.top+t.bottom)/2+_;else if(Pt(r)){const ot=Object.keys(r)[0],q=r[ot];N=this.chart.scales[ot].getPixelForValue(q)+_}B=this._getXAxisLabelAlignment()}else if(e==="y"){if(r==="center")L=(t.left+t.right)/2-_;else if(Pt(r)){const ot=Object.keys(r)[0],q=r[ot];L=this.chart.scales[ot].getPixelForValue(q)}B=this._getYAxisLabelAlignment(y).textAlign}e==="y"&&(u==="start"?it="top":u==="end"&&(it="bottom"));const at=this._getLabelSizes();for(C=0,R=l.length;C<R;++C){F=l[C],I=F.label;const ot=s.setContext(this.getContext(C));T=this.getPixelForTick(C)+s.labelOffset,S=this._resolveTickFontOptions(C),O=S.lineHeight,U=Yt(I)?I.length:1;const q=U/2,J=ot.color,rt=ot.textStrokeColor,tt=ot.textStrokeWidth;let G=B;a?(L=T,B==="inner"&&(C===R-1?G=this.options.reverse?"left":"right":C===0?G=this.options.reverse?"right":"left":G="center"),r==="top"?d==="near"||v!==0?$=-U*O+O/2:d==="center"?$=-at.highest.height/2-q*O+O:$=-at.highest.height+O/2:d==="near"||v!==0?$=O/2:d==="center"?$=at.highest.height/2-q*O:$=at.highest.height-U*O,g&&($*=-1),v!==0&&!ot.showLabelBackdrop&&(L+=O/2*Math.sin(v))):(N=T,$=(1-U)*O/2);let P;if(ot.showLabelBackdrop){const W=we(ot.backdropPadding),j=at.heights[C],pt=at.widths[C];let lt=$-W.top,et=0-W.left;switch(it){case"middle":lt-=j/2;break;case"bottom":lt-=j;break}switch(B){case"center":et-=pt/2;break;case"right":et-=pt;break;case"inner":C===R-1?et-=pt:C>0&&(et-=pt/2);break}P={left:et,top:lt,width:pt+W.width,height:j+W.height,color:ot.backdropColor}}M.push({label:I,font:S,textOffset:$,options:{rotation:v,color:J,strokeColor:rt,strokeWidth:tt,textAlign:G,textBaseline:it,translation:[L,N],backdrop:P}})}return M}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-xe(this.labelRotation))return t==="top"?"left":"right";let r="center";return e.align==="start"?r="left":e.align==="end"?r="right":e.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:r,padding:s}}=this.options,a=this._getLabelSizes(),l=t+s,u=a.widest.width;let d,h;return e==="left"?r?(h=this.right+s,i==="near"?d="left":i==="center"?(d="center",h+=u/2):(d="right",h+=u)):(h=this.right-l,i==="near"?d="right":i==="center"?(d="center",h-=u/2):(d="left",h=this.left)):e==="right"?r?(h=this.left+s,i==="near"?d="right":i==="center"?(d="center",h-=u/2):(d="left",h-=u)):(h=this.left+l,i==="near"?d="left":i==="center"?(d="center",h+=u/2):(d="right",h=this.right)):d="right",{textAlign:d,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:r,width:s,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,r,s,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const r=this.ticks.findIndex(s=>s.value===t);return r>=0?e.setContext(this.getContext(r)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,a;const l=(u,d,h)=>{!h.width||!h.color||(i.save(),i.lineWidth=h.width,i.strokeStyle=h.color,i.setLineDash(h.borderDash||[]),i.lineDashOffset=h.borderDashOffset,i.beginPath(),i.moveTo(u.x,u.y),i.lineTo(d.x,d.y),i.stroke(),i.restore())};if(e.display)for(s=0,a=r.length;s<a;++s){const u=r[s];e.drawOnChartArea&&l({x:u.x1,y:u.y1},{x:u.x2,y:u.y2},u),e.drawTicks&&l({x:u.tx1,y:u.ty1},{x:u.tx2,y:u.ty2},{color:u.tickColor,width:u.tickWidth,borderDash:u.tickBorderDash,borderDashOffset:u.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:r}}=this,s=i.setContext(this.getContext()),a=i.display?s.width:0;if(!a)return;const l=r.setContext(this.getContext(0)).lineWidth,u=this._borderValue;let d,h,g,y;this.isHorizontal()?(d=or(t,this.left,a)-a/2,h=or(t,this.right,l)+l/2,g=y=u):(g=or(t,this.top,a)-a/2,y=or(t,this.bottom,l)+l/2,d=h=u),e.save(),e.lineWidth=s.width,e.strokeStyle=s.color,e.beginPath(),e.moveTo(d,g),e.lineTo(h,y),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,r=this._computeLabelArea();r&&qs(i,r);const s=this.getLabelItems(t);for(const a of s){const l=a.options,u=a.font,d=a.label,h=a.textOffset;ar(i,d,0,h,u,l)}r&&js(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:r}}=this;if(!i.display)return;const s=le(i.font),a=we(i.padding),l=i.align;let u=s.lineHeight/2;e==="bottom"||e==="center"||Pt(e)?(u+=a.bottom,Yt(i.text)&&(u+=s.lineHeight*(i.text.length-1))):u+=a.top;const{titleX:d,titleY:h,maxWidth:g,rotation:y}=iC(this,u,e,l);ar(t,i.text,0,0,s,{color:i.color,maxWidth:g,rotation:y,textAlign:nC(l,e,r),textBaseline:"middle",translation:[d,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=Mt(t.grid&&t.grid.z,-1),r=Mt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==dr.prototype.draw?[{z:e,draw:s=>{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:e,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",r=[];let s,a;for(s=0,a=e.length;s<a;++s){const l=e[s];l[i]===this.id&&(!t||l.type===t)&&r.push(l)}return r}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return le(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ia{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;oC(e)&&(i=this.register(e));const r=this.items,s=t.id,a=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+t);return s in r||(r[s]=t,rC(t,a,i),this.override&&se.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,r=this.scope;i in e&&delete e[i],r&&i in se[r]&&(delete se[r][i],this.override&&delete sr[i])}}function rC(n,t,e){const i=zs(Object.create(null),[e?se.get(e):{},se.get(t),n.defaults]);se.set(t,i),n.defaultRoutes&&sC(t,n.defaultRoutes),n.descriptors&&se.describe(t,n.descriptors)}function sC(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),r=i.pop(),s=[n].concat(i).join("."),a=t[e].split("."),l=a.pop(),u=a.join(".");se.route(s,r,u,l)})}function oC(n){return"id"in n&&"defaults"in n}class aC{constructor(){this.controllers=new Ia(Ei,"datasets",!0),this.elements=new Ia(Ve,"elements"),this.plugins=new Ia(Object,"plugins"),this.scales=new Ia(dr,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(r=>{const s=i||this._getRegistryForType(r);i||s.isForType(r)||s===this.plugins&&r.id?this._exec(t,s,r):Jt(r,a=>{const l=i||this._getRegistryForType(a);this._exec(t,l,a)})})}_exec(t,e,i){const r=$c(t);Qt(i["before"+r],[],i),e[t](i),Qt(i["after"+r],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const r=e.get(t);if(r===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return r}}var qn=new aC;class lC{constructor(){this._init=void 0}notify(t,e,i,r){if(e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const s=r?this._descriptors(t).filter(r):this._descriptors(t),a=this._notify(s,t,e,i);return e==="afterDestroy"&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),a}_notify(t,e,i,r){r=r||{};for(const s of t){const a=s.plugin,l=a[i],u=[e,r,s.options];if(Qt(l,u,a)===!1&&r.cancelable)return!1}return!0}invalidate(){xt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,r=Mt(i.options&&i.options.plugins,{}),s=cC(i);return r===!1&&!e?[]:dC(t,s,r,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,r=(s,a)=>s.filter(l=>!a.some(u=>l.plugin.id===u.plugin.id));this._notify(r(e,i),t,"stop"),this._notify(r(i,e),t,"start")}}function cC(n){const t={},e=[],i=Object.keys(qn.plugins.items);for(let s=0;s<i.length;s++)e.push(qn.getPlugin(i[s]));const r=n.plugins||[];for(let s=0;s<r.length;s++){const a=r[s];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function uC(n,t){return!t&&n===!1?null:n===!0?{}:n}function dC(n,{plugins:t,localIds:e},i,r){const s=[],a=n.getContext();for(const l of t){const u=l.id,d=uC(i[u],r);d!==null&&s.push({plugin:l,options:fC(n.config,{plugin:l,local:e[u]},d,a)})}return s}function fC(n,{plugin:t,local:e},i,r){const s=n.pluginScopeKeys(t),a=n.getOptionScopes(i,s);return e&&t.defaults&&a.push(t.defaults),n.createResolver(a,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function gu(n,t){const e=se.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function hC(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function pC(n,t){return n===t?"_index_":"_value_"}function Vg(n){if(n==="x"||n==="y"||n==="r")return n}function gC(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function mu(n,...t){if(Vg(n))return n;for(const e of t){const i=e.axis||gC(e.position)||n.length>1&&Vg(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function $g(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function mC(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(e.length)return $g(n,"x",e[0])||$g(n,"y",e[0])}return{}}function yC(n,t){const e=sr[n.type]||{scales:{}},i=t.scales||{},r=gu(n.type,t),s=Object.create(null);return Object.keys(i).forEach(a=>{const l=i[a];if(!Pt(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const u=mu(a,l,mC(a,n),se.scales[l.type]),d=pC(u,r),h=e.scales||{};s[a]=Us(Object.create(null),[{axis:u},l,h[u],h[d]])}),n.data.datasets.forEach(a=>{const l=a.type||n.type,u=a.indexAxis||gu(l,t),h=(sr[l]||{}).scales||{};Object.keys(h).forEach(g=>{const y=hC(g,u),_=a[y+"AxisID"]||y;s[_]=s[_]||Object.create(null),Us(s[_],[{axis:y},i[_],h[g]])})}),Object.keys(s).forEach(a=>{const l=s[a];Us(l,[se.scales[l.type],se.scale])}),s}function Yg(n){const t=n.options||(n.options={});t.plugins=Mt(t.plugins,{}),t.scales=yC(n,t)}function qg(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function _C(n){return n=n||{},n.data=qg(n.data),Yg(n),n}const jg=new Map,Gg=new Set;function La(n,t){let e=jg.get(n);return e||(e=t(),jg.set(n,e),Gg.add(e)),e}const io=(n,t,e)=>{const i=Mi(t,e);i!==void 0&&n.add(i)};class bC{constructor(t){this._config=_C(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=qg(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Yg(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return La(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return La(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return La(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return La(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let r=i.get(t);return(!r||e)&&(r=new Map,i.set(t,r)),r}getOptionScopes(t,e,i){const{options:r,type:s}=this,a=this._cachedScopes(t,i),l=a.get(e);if(l)return l;const u=new Set;e.forEach(h=>{t&&(u.add(t),h.forEach(g=>io(u,t,g))),h.forEach(g=>io(u,r,g)),h.forEach(g=>io(u,sr[s]||{},g)),h.forEach(g=>io(u,se,g)),h.forEach(g=>io(u,Xc,g))});const d=Array.from(u);return d.length===0&&d.push(Object.create(null)),Gg.has(e)&&a.set(e,d),d}chartOptionScopes(){const{options:t,type:e}=this;return[t,sr[e]||{},se.datasets[e]||{},{type:e},se,Xc]}resolveNamedOptions(t,e,i,r=[""]){const s={$shared:!0},{resolver:a,subPrefixes:l}=Kg(this._resolverCache,t,r);let u=a;if(wC(a,e)){s.$shared=!1,i=nn(i)?i():i;const d=this.createResolver(t,i,l);u=Wr(a,i,d)}for(const d of e)s[d]=u[d];return s}createResolver(t,e,i=[""],r){const{resolver:s}=Kg(this._resolverCache,t,i);return Pt(e)?Wr(s,e,void 0,r):s}}function Kg(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const r=e.join();let s=i.get(r);return s||(s={resolver:tu(t,e),subPrefixes:e.filter(l=>!l.toLowerCase().includes("hover"))},i.set(r,s)),s}const xC=n=>Pt(n)&&Object.getOwnPropertyNames(n).some(t=>nn(n[t]));function wC(n,t){const{isScriptable:e,isIndexable:i}=jp(n);for(const r of t){const s=e(r),a=i(r),l=(a||s)&&n[r];if(s&&(nn(l)||xC(l))||a&&Yt(l))return!0}return!1}var vC="4.5.1";const SC=["top","bottom","left","right","chartArea"];function Xg(n,t){return n==="top"||n==="bottom"||SC.indexOf(n)===-1&&t==="x"}function Zg(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function Qg(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),Qt(e&&e.onComplete,[n],t)}function TC(n){const t=n.chart,e=t.options.animation;Qt(e&&e.onProgress,[n],t)}function Jg(n){return iu()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Na={},tm=n=>{const t=Jg(n);return Object.values(Na).filter(e=>e.canvas===t).pop()};function MC(n,t,e){const i=Object.keys(n);for(const r of i){const s=+r;if(s>=t){const a=n[r];delete n[r],(e>0||s>t)&&(n[s+e]=a)}}}function kC(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}let rn=class{static defaults=se;static instances=Na;static overrides=sr;static registry=qn;static version=vC;static getChart=tm;static register(...t){qn.add(...t),em()}static unregister(...t){qn.remove(...t),em()}constructor(t,e){const i=this.config=new bC(e),r=Jg(t),s=tm(r);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||$D(r)),this.platform.updateConfig(i);const l=this.platform.acquireContext(r,a.aspectRatio),u=l&&l.canvas,d=u&&u.height,h=u&&u.width;if(this.id=DM(),this.ctx=l,this.canvas=u,this.width=h,this.height=d,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new lC,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=VM(g=>this.update(g),a.resizeDelay||0),this._dataChanges=[],Na[this.id]=this,!l||!u){console.error("Failed to create chart: can't acquire context from the given item");return}si.listen(this,"complete",Qg),si.listen(this,"progress",TC),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:r,_aspectRatio:s}=this;return xt(t)?e&&s?s:r?i/r:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return qn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():eg(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return $p(this.canvas,this.ctx),this}stop(){return si.stop(this),this}resize(t,e){si.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,r=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,t,e,s),l=i.devicePixelRatio||this.platform.getDevicePixelRatio(),u=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,eg(this,l,!0)&&(this.notifyPlugins("resize",{size:a}),Qt(i.onResize,[this,a],this),this.attached&&this._doResize(u)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};Jt(e,(i,r)=>{i.id=r})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,r=Object.keys(i).reduce((a,l)=>(a[l]=!1,a),{});let s=[];e&&(s=s.concat(Object.keys(e).map(a=>{const l=e[a],u=mu(a,l),d=u==="r",h=u==="x";return{options:l,dposition:d?"chartArea":h?"bottom":"left",dtype:d?"radialLinear":h?"category":"linear"}}))),Jt(s,a=>{const l=a.options,u=l.id,d=mu(u,l),h=Mt(l.type,a.dtype);(l.position===void 0||Xg(l.position,d)!==Xg(a.dposition))&&(l.position=a.dposition),r[u]=!0;let g=null;if(u in i&&i[u].type===h)g=i[u];else{const y=qn.getScale(h);g=new y({id:u,type:h,ctx:this.ctx,chart:this}),i[g.id]=g}g.init(l,t)}),Jt(r,(a,l)=>{a||delete i[l]}),Jt(i,a=>{We.configure(this,a,a.options),We.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((r,s)=>r.index-s.index),i>e){for(let r=e;r<i;++r)this._destroyDatasetMeta(r);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Zg("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,r)=>{e.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,r;for(this._removeUnreferencedMetasets(),i=0,r=e.length;i<r;i++){const s=e[i];let a=this.getDatasetMeta(i);const l=s.type||this.config.type;if(a.type&&a.type!==l&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=l,a.indexAxis=s.indexAxis||gu(l,this.options),a.order=s.order||0,a.index=i,a.label=""+s.label,a.visible=this.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else{const u=qn.getController(l),{datasetElementType:d,dataElementType:h}=se.datasets[l];Object.assign(u,{dataElementType:qn.getElement(h),datasetElementType:d&&qn.getElement(d)}),a.controller=new u(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){Jt(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let d=0,h=this.data.datasets.length;d<h;d++){const{controller:g}=this.getDatasetMeta(d),y=!r&&s.indexOf(g)===-1;g.buildOrUpdateElements(y),a=Math.max(+g.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),r||Jt(s,d=>{d.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Zg("z","_idx"));const{_active:l,_lastEvent:u}=this;u?this._eventHandler(u,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Jt(this.scales,t=>{We.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Op(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:r,count:s}of e){const a=i==="_removeElements"?-s:s;MC(t,r,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=s=>new Set(t.filter(a=>a[0]===s).map((a,l)=>l+","+a.splice(1).join(","))),r=i(0);for(let s=1;s<e;s++)if(!Op(r,i(s)))return;return Array.from(r).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;We.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],Jt(this.boxes,r=>{i&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,s)=>{r._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,nn(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),r={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(i.controller._update(e),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(si.has(this)?this.attached&&!si.running(this)&&si.start(this):(this.draw(),Qg({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:r}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,r)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let r,s;for(r=0,s=e.length;r<s;++r){const a=e[r];(!t||a.visible)&&i.push(a)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i={meta:t,index:t.index,cancelable:!0},r=dg(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(r&&qs(e,r),t.controller.draw(),r&&js(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return ri(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,r){const s=hu.modes[e];return typeof s=="function"?s(this,t,i,r):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let r=i.filter(s=>s&&s._dataset===e).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(r)),r}getContext(){return this.$context||(this.$context=Oi(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const r=i?"show":"hide",s=this.getDatasetMeta(t),a=s.controller._resolveAnimations(void 0,r);en(e)?(s.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(s,{visible:i}),this.update(l=>l.datasetIndex===t?r:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),si.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),$p(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Na[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(s,a)=>{e.addEventListener(this,s,a),t[s]=a},r=(s,a,l)=>{s.offsetX=a,s.offsetY=l,this._eventHandler(s)};Jt(this.options.events,s=>i(s,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(u,d)=>{e.addEventListener(this,u,d),t[u]=d},r=(u,d)=>{t[u]&&(e.removeEventListener(this,u,d),delete t[u])},s=(u,d)=>{this.canvas&&this.resize(u,d)};let a;const l=()=>{r("attach",l),this.attached=!0,this.resize(),i("resize",s),i("detach",a)};a=()=>{this.attached=!1,r("resize",s),this._stop(),this._resize(0,0),i("attach",l)},e.isAttached(this.canvas)?l():a()}unbindEvents(){Jt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Jt(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const r=i?"set":"remove";let s,a,l,u;for(e==="dataset"&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+r+"DatasetHoverStyle"]()),l=0,u=t.length;l<u;++l){a=t[l];const d=a&&this.getDatasetMeta(a.datasetIndex).controller;d&&d[r+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:s,index:a})=>{const l=this.getDatasetMeta(s);if(!l)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:l.data[a],index:a}});!ma(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const r=this.options.hover,s=(u,d)=>u.filter(h=>!d.some(g=>h.datasetIndex===g.datasetIndex&&h.index===g.index)),a=s(e,t),l=i?t:s(t,e);a.length&&this.updateHoverStyle(a,r.mode,!1),l.length&&r.mode&&this.updateHoverStyle(l,r.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},r=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,r)===!1)return;const s=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,r),(s||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:r=[],options:s}=this,a=e,l=this._getActiveElements(t,r,i,a),u=PM(t),d=kC(t,this._lastEvent,i,u);i&&(this._lastEvent=null,Qt(s.onHover,[t,l,this],this),u&&Qt(s.onClick,[t,l,this],this));const h=!ma(l,r);return(h||e)&&(this._active=l,this._updateHoverStyles(l,r,e)),this._lastEvent=d,h}_getActiveElements(t,e,i,r){if(t.type==="mouseout")return[];if(!i)return e;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,r)}};function em(){return Jt(rn.instances,n=>n._plugins.invalidate())}function DC(n,t,e){const{startAngle:i,x:r,y:s,outerRadius:a,innerRadius:l,options:u}=t,{borderWidth:d,borderJoinStyle:h}=u,g=Math.min(d/a,Ue(i-e));if(n.beginPath(),n.arc(r,s,a-d/2,i+g/2,e-g/2),l>0){const y=Math.min(d/l,Ue(i-e));n.arc(r,s,l+d/2,e-y/2,i+y/2,!0)}else{const y=Math.min(d/2,a*Ue(i-e));if(h==="round")n.arc(r,s,y,e-Rt/2,i+Rt/2,!0);else if(h==="bevel"){const _=2*y*y,x=-_*Math.cos(e+Rt/2)+r,v=-_*Math.sin(e+Rt/2)+s,M=_*Math.cos(i+Rt/2)+r,C=_*Math.sin(i+Rt/2)+s;n.lineTo(x,v),n.lineTo(M,C)}}n.closePath(),n.moveTo(0,0),n.rect(0,0,n.canvas.width,n.canvas.height),n.clip("evenodd")}function CC(n,t,e){const{startAngle:i,pixelMargin:r,x:s,y:a,outerRadius:l,innerRadius:u}=t;let d=r/l;n.beginPath(),n.arc(s,a,l,i-d,e+d),u>r?(d=r/u,n.arc(s,a,u,e+d,i-d,!0)):n.arc(s,a,r,e+re,i-re),n.closePath(),n.clip()}function OC(n){return Jc(n,["outerStart","outerEnd","innerStart","innerEnd"])}function AC(n,t,e,i){const r=OC(n.options.borderRadius),s=(e-t)/2,a=Math.min(s,i*t/2),l=u=>{const d=(e-Math.min(s,u))*i/2;return Ce(u,0,Math.min(s,d))};return{outerStart:l(r.outerStart),outerEnd:l(r.outerEnd),innerStart:Ce(r.innerStart,0,a),innerEnd:Ce(r.innerEnd,0,a)}}function Yr(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function Ba(n,t,e,i,r,s){const{x:a,y:l,startAngle:u,pixelMargin:d,innerRadius:h}=t,g=Math.max(t.outerRadius+i+e-d,0),y=h>0?h+i+e+d:0;let _=0;const x=r-u;if(i){const ot=h>0?h-i:0,q=g>0?g-i:0,J=(ot+q)/2,rt=J!==0?x*J/(J+i):x;_=(x-rt)/2}const v=Math.max(.001,x*g-e/Rt)/g,M=(x-v)/2,C=u+M+_,R=r-M-_,{outerStart:F,outerEnd:I,innerStart:L,innerEnd:N}=AC(t,y,g,R-C),B=g-F,T=g-I,S=C+F/B,O=R-I/T,U=y+L,$=y+N,it=C+L/U,at=R-N/$;if(n.beginPath(),s){const ot=(S+O)/2;if(n.arc(a,l,g,S,ot),n.arc(a,l,g,ot,O),I>0){const tt=Yr(T,O,a,l);n.arc(tt.x,tt.y,I,O,R+re)}const q=Yr($,R,a,l);if(n.lineTo(q.x,q.y),N>0){const tt=Yr($,at,a,l);n.arc(tt.x,tt.y,N,R+re,at+Math.PI)}const J=(R-N/y+(C+L/y))/2;if(n.arc(a,l,y,R-N/y,J,!0),n.arc(a,l,y,J,C+L/y,!0),L>0){const tt=Yr(U,it,a,l);n.arc(tt.x,tt.y,L,it+Math.PI,C-re)}const rt=Yr(B,C,a,l);if(n.lineTo(rt.x,rt.y),F>0){const tt=Yr(B,S,a,l);n.arc(tt.x,tt.y,F,C-re,S)}}else{n.moveTo(a,l);const ot=Math.cos(S)*g+a,q=Math.sin(S)*g+l;n.lineTo(ot,q);const J=Math.cos(O)*g+a,rt=Math.sin(O)*g+l;n.lineTo(J,rt)}n.closePath()}function RC(n,t,e,i,r){const{fullCircles:s,startAngle:a,circumference:l}=t;let u=t.endAngle;if(s){Ba(n,t,e,i,u,r);for(let d=0;d<s;++d)n.fill();isNaN(l)||(u=a+(l%te||te))}return Ba(n,t,e,i,u,r),n.fill(),u}function EC(n,t,e,i,r){const{fullCircles:s,startAngle:a,circumference:l,options:u}=t,{borderWidth:d,borderJoinStyle:h,borderDash:g,borderDashOffset:y,borderRadius:_}=u,x=u.borderAlign==="inner";if(!d)return;n.setLineDash(g||[]),n.lineDashOffset=y,x?(n.lineWidth=d*2,n.lineJoin=h||"round"):(n.lineWidth=d,n.lineJoin=h||"bevel");let v=t.endAngle;if(s){Ba(n,t,e,i,v,r);for(let M=0;M<s;++M)n.stroke();isNaN(l)||(v=a+(l%te||te))}x&&CC(n,t,v),u.selfJoin&&v-a>=Rt&&_===0&&h!=="miter"&&DC(n,t,v),s||(Ba(n,t,e,i,v,r),n.stroke())}class PC extends Ve{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const r=this.getProps(["x","y"],i),{angle:s,distance:a}=wa(r,{x:t,y:e}),{startAngle:l,endAngle:u,innerRadius:d,outerRadius:h,circumference:g}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),y=(this.options.spacing+this.options.borderWidth)/2,_=Mt(g,u-l),x=Ws(s,l,u)&&l!==u,v=_>=te||x,M=ni(a,d+y,h+y);return v&&M}getCenterPoint(t){const{x:e,y:i,startAngle:r,endAngle:s,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:u,spacing:d}=this.options,h=(r+s)/2,g=(a+l+d+u)/2;return{x:e+Math.cos(h)*g,y:i+Math.sin(h)*g}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,r=(e.offset||0)/4,s=(e.spacing||0)/2,a=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=i>te?Math.floor(i/te):0,i===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const l=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(l)*r,Math.sin(l)*r);const u=1-Math.sin(Math.min(Rt,i||0)),d=r*u;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,RC(t,this,d,s,a),EC(t,this,d,s,a),t.restore()}}function nm(n,t,e=t){n.lineCap=Mt(e.borderCapStyle,t.borderCapStyle),n.setLineDash(Mt(e.borderDash,t.borderDash)),n.lineDashOffset=Mt(e.borderDashOffset,t.borderDashOffset),n.lineJoin=Mt(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=Mt(e.borderWidth,t.borderWidth),n.strokeStyle=Mt(e.borderColor,t.borderColor)}function IC(n,t,e){n.lineTo(e.x,e.y)}function LC(n){return n.stepped?ek:n.tension||n.cubicInterpolationMode==="monotone"?nk:IC}function im(n,t,e={}){const i=n.length,{start:r=0,end:s=i-1}=e,{start:a,end:l}=t,u=Math.max(r,a),d=Math.min(s,l),h=r<a&&s<a||r>l&&s>l;return{count:i,start:u,loop:t.loop,ilen:d<u&&!h?i+d-u:d-u}}function NC(n,t,e,i){const{points:r,options:s}=t,{count:a,start:l,loop:u,ilen:d}=im(r,e,i),h=LC(s);let{move:g=!0,reverse:y}=i||{},_,x,v;for(_=0;_<=d;++_)x=r[(l+(y?d-_:_))%a],!x.skip&&(g?(n.moveTo(x.x,x.y),g=!1):h(n,v,x,y,s.stepped),v=x);return u&&(x=r[(l+(y?d:0))%a],h(n,v,x,y,s.stepped)),!!u}function BC(n,t,e,i){const r=t.points,{count:s,start:a,ilen:l}=im(r,e,i),{move:u=!0,reverse:d}=i||{};let h=0,g=0,y,_,x,v,M,C;const R=I=>(a+(d?l-I:I))%s,F=()=>{v!==M&&(n.lineTo(h,M),n.lineTo(h,v),n.lineTo(h,C))};for(u&&(_=r[R(0)],n.moveTo(_.x,_.y)),y=0;y<=l;++y){if(_=r[R(y)],_.skip)continue;const I=_.x,L=_.y,N=I|0;N===x?(L<v?v=L:L>M&&(M=L),h=(g*h+I)/++g):(F(),n.lineTo(I,L),x=N,g=0,v=M=L),C=L}F()}function yu(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?BC:NC}function FC(n){return n.stepped?Ik:n.tension||n.cubicInterpolationMode==="monotone"?Lk:cr}function zC(n,t,e,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,e,i)&&r.closePath()),nm(n,t.options),n.stroke(r)}function UC(n,t,e,i){const{segments:r,options:s}=t,a=yu(t);for(const l of r)nm(n,s,l.style),n.beginPath(),a(n,t,l,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const HC=typeof Path2D=="function";function WC(n,t,e,i){HC&&!t.options.segment?zC(n,t,e,i):UC(n,t,e,i)}class Fa extends Ve{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const r=i.spanGaps?this._loop:this._fullLoop;kk(this._points,i,t,r,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Hk(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,r=t[e],s=this.points,a=lg(this,{property:e,start:r,end:r});if(!a.length)return;const l=[],u=FC(i);let d,h;for(d=0,h=a.length;d<h;++d){const{start:g,end:y}=a[d],_=s[g],x=s[y];if(_===x){l.push(_);continue}const v=Math.abs((r-_[e])/(x[e]-_[e])),M=u(_,x,v,i.stepped);M[e]=t[e],l.push(M)}return l.length===1?l[0]:l}pathSegment(t,e,i){return yu(this)(t,this,e,i)}path(t,e,i){const r=this.segments,s=yu(this);let a=this._loop;e=e||0,i=i||this.points.length-e;for(const l of r)a&=s(t,this,l,{start:e,end:e+i-1});return!!a}draw(t,e,i,r){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),WC(t,this,i,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function rm(n,t,e,i){const r=n.options,{[e]:s}=n.getProps([e],i);return Math.abs(t-s)<r.radius+r.hitRadius}class VC extends Ve{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const r=this.options,{x:s,y:a}=this.getProps(["x","y"],i);return Math.pow(t-s,2)+Math.pow(e-a,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(t,e){return rm(this,t,"x",e)}inYRange(t,e){return rm(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const i=e&&t.borderWidth||0;return(e+i)*2}draw(t,e){const i=this.options;this.skip||i.radius<.1||!ri(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Qc(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function sm(n,t){const{x:e,y:i,base:r,width:s,height:a}=n.getProps(["x","y","base","width","height"],t);let l,u,d,h,g;return n.horizontal?(g=a/2,l=Math.min(e,r),u=Math.max(e,r),d=i-g,h=i+g):(g=s/2,l=e-g,u=e+g,d=Math.min(i,r),h=Math.max(i,r)),{left:l,top:d,right:u,bottom:h}}function Pi(n,t,e,i){return n?0:Ce(t,e,i)}function $C(n,t,e){const i=n.options.borderWidth,r=n.borderSkipped,s=qp(i);return{t:Pi(r.top,s.top,0,e),r:Pi(r.right,s.right,0,t),b:Pi(r.bottom,s.bottom,0,e),l:Pi(r.left,s.left,0,t)}}function YC(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),r=n.options.borderRadius,s=Ci(r),a=Math.min(t,e),l=n.borderSkipped,u=i||Pt(r);return{topLeft:Pi(!u||l.top||l.left,s.topLeft,0,a),topRight:Pi(!u||l.top||l.right,s.topRight,0,a),bottomLeft:Pi(!u||l.bottom||l.left,s.bottomLeft,0,a),bottomRight:Pi(!u||l.bottom||l.right,s.bottomRight,0,a)}}function qC(n){const t=sm(n),e=t.right-t.left,i=t.bottom-t.top,r=$C(n,e/2,i/2),s=YC(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:s},inner:{x:t.left+r.l,y:t.top+r.t,w:e-r.l-r.r,h:i-r.t-r.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,s.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(r.b,r.r))}}}}function _u(n,t,e,i){const r=t===null,s=e===null,l=n&&!(r&&s)&&sm(n,i);return l&&(r||ni(t,l.left,l.right))&&(s||ni(e,l.top,l.bottom))}function jC(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function GC(n,t){n.rect(t.x,t.y,t.w,t.h)}function bu(n,t,e={}){const i=n.x!==e.x?-t:0,r=n.y!==e.y?-t:0,s=(n.x+n.w!==e.x+e.w?t:0)-i,a=(n.y+n.h!==e.y+e.h?t:0)-r;return{x:n.x+i,y:n.y+r,w:n.w+s,h:n.h+a,radius:n.radius}}class KC extends Ve{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:r}}=this,{inner:s,outer:a}=qC(this),l=jC(a.radius)?Hr:GC;t.save(),(a.w!==s.w||a.h!==s.h)&&(t.beginPath(),l(t,bu(a,e,s)),t.clip(),l(t,bu(s,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),l(t,bu(s,e)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,e,i){return _u(this,t,e,i)}inXRange(t,e){return _u(this,t,null,e)}inYRange(t,e){return _u(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:r,horizontal:s}=this.getProps(["x","y","base","horizontal"],t);return{x:s?(e+r)/2:e,y:s?i:(i+r)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}var XC=Object.freeze({__proto__:null,ArcElement:PC,BarElement:KC,LineElement:Fa,PointElement:VC});const xu=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],om=xu.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function am(n){return xu[n%xu.length]}function lm(n){return om[n%om.length]}function ZC(n,t){return n.borderColor=am(t),n.backgroundColor=lm(t),++t}function QC(n,t){return n.backgroundColor=n.data.map(()=>am(t++)),t}function JC(n,t){return n.backgroundColor=n.data.map(()=>lm(t++)),t}function tO(n){let t=0;return(e,i)=>{const r=n.getDatasetMeta(i).controller;r instanceof Xs?t=QC(e,t):r instanceof Mg?t=JC(e,t):r&&(t=ZC(e,t))}}function cm(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function eO(n){return n&&(n.borderColor||n.backgroundColor)}function nO(){return se.borderColor!=="rgba(0,0,0,0.1)"||se.backgroundColor!=="rgba(0,0,0,0.1)"}var iO={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:r}=n.config,{elements:s}=r,a=cm(i)||eO(r)||s&&cm(s)||nO();if(!e.forceOverride&&a)return;const l=tO(n);i.forEach(l)}};function rO(n,t,e,i,r){const s=r.samples||i;if(s>=e)return n.slice(t,t+e);const a=[],l=(e-2)/(s-2);let u=0;const d=t+e-1;let h=t,g,y,_,x,v;for(a[u++]=n[h],g=0;g<s-2;g++){let M=0,C=0,R;const F=Math.floor((g+1)*l)+1+t,I=Math.min(Math.floor((g+2)*l)+1,e)+t,L=I-F;for(R=F;R<I;R++)M+=n[R].x,C+=n[R].y;M/=L,C/=L;const N=Math.floor(g*l)+1+t,B=Math.min(Math.floor((g+1)*l)+1,e)+t,{x:T,y:S}=n[h];for(_=x=-1,R=N;R<B;R++)x=.5*Math.abs((T-M)*(n[R].y-S)-(T-n[R].x)*(C-S)),x>_&&(_=x,y=n[R],v=R);a[u++]=y,h=v}return a[u++]=n[d],a}function sO(n,t,e,i){let r=0,s=0,a,l,u,d,h,g,y,_,x,v;const M=[],C=t+e-1,R=n[t].x,I=n[C].x-R;for(a=t;a<t+e;++a){l=n[a],u=(l.x-R)/I*i,d=l.y;const L=u|0;if(L===h)d<x?(x=d,g=a):d>v&&(v=d,y=a),r=(s*r+l.x)/++s;else{const N=a-1;if(!xt(g)&&!xt(y)){const B=Math.min(g,y),T=Math.max(g,y);B!==_&&B!==N&&M.push({...n[B],x:r}),T!==_&&T!==N&&M.push({...n[T],x:r})}a>0&&N!==_&&M.push(n[N]),M.push(l),h=L,s=0,x=v=d,g=y=_=a}}return M}function um(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function dm(n){n.data.datasets.forEach(t=>{um(t)})}function oO(n,t){const e=t.length;let i=0,r;const{iScale:s}=n,{min:a,max:l,minDefined:u,maxDefined:d}=s.getUserBounds();return u&&(i=Ce(ii(t,s.axis,a).lo,0,e-1)),d?r=Ce(ii(t,s.axis,l).hi+1,i,e)-i:r=e-i,{start:i,count:r}}var aO={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){dm(n);return}const i=n.width;n.data.datasets.forEach((r,s)=>{const{_data:a,indexAxis:l}=r,u=n.getDatasetMeta(s),d=a||r.data;if(Gs([l,n.options.indexAxis])==="y"||!u.controller.supportsDecimation)return;const h=n.scales[u.xAxisID];if(h.type!=="linear"&&h.type!=="time"||n.options.parsing)return;let{start:g,count:y}=oO(u,d);const _=e.threshold||4*i;if(y<=_){um(r);return}xt(a)&&(r._data=d,delete r.data,Object.defineProperty(r,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(v){this._data=v}}));let x;switch(e.algorithm){case"lttb":x=rO(d,g,y,i,e);break;case"min-max":x=sO(d,g,y,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}r._decimated=x})},destroy(n){dm(n)}};function lO(n,t,e){const i=n.segments,r=n.points,s=t.points,a=[];for(const l of i){let{start:u,end:d}=l;d=za(u,d,r);const h=wu(e,r[u],r[d],l.loop);if(!t.segments){a.push({source:l,target:h,start:r[u],end:r[d]});continue}const g=lg(t,h);for(const y of g){const _=wu(e,s[y.start],s[y.end],y.loop),x=ag(l,r,_);for(const v of x)a.push({source:v,target:y,start:{[e]:fm(h,_,"start",Math.max)},end:{[e]:fm(h,_,"end",Math.min)}})}}return a}function wu(n,t,e,i){if(i)return;let r=t[n],s=e[n];return n==="angle"&&(r=Ue(r),s=Ue(s)),{property:n,start:r,end:s}}function cO(n,t){const{x:e=null,y:i=null}=n||{},r=t.points,s=[];return t.segments.forEach(({start:a,end:l})=>{l=za(a,l,r);const u=r[a],d=r[l];i!==null?(s.push({x:u.x,y:i}),s.push({x:d.x,y:i})):e!==null&&(s.push({x:e,y:u.y}),s.push({x:e,y:d.y}))}),s}function za(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function fm(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function hm(n,t){let e=[],i=!1;return Yt(n)?(i=!0,e=n):e=cO(n,t),e.length?new Fa({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function pm(n){return n&&n.fill!==!1}function uO(n,t,e){let r=n[t].fill;const s=[t];let a;if(!e)return r;for(;r!==!1&&s.indexOf(r)===-1;){if(!ae(r))return r;if(a=n[r],!a)return!1;if(a.visible)return r;s.push(r),r=a.fill}return!1}function dO(n,t,e){const i=gO(n);if(Pt(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return ae(r)&&Math.floor(r)===r?fO(i[0],t,r,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function fO(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function hO(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:Pt(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function pO(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:Pt(n)?i=n.value:i=t.getBaseValue(),i}function gO(n){const t=n.options,e=t.fill;let i=Mt(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function mO(n){const{scale:t,index:e,line:i}=n,r=[],s=i.segments,a=i.points,l=yO(t,e);l.push(hm({x:null,y:t.bottom},i));for(let u=0;u<s.length;u++){const d=s[u];for(let h=d.start;h<=d.end;h++)_O(r,a[h],l)}return new Fa({points:r,options:{}})}function yO(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let r=0;r<i.length;r++){const s=i[r];if(s.index===t)break;s.hidden||e.unshift(s.dataset)}return e}function _O(n,t,e){const i=[];for(let r=0;r<e.length;r++){const s=e[r],{first:a,last:l,point:u}=bO(s,t,"x");if(!(!u||a&&l)){if(a)i.unshift(u);else if(n.push(u),!l)break}}n.push(...i)}function bO(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const r=i[e],s=n.segments,a=n.points;let l=!1,u=!1;for(let d=0;d<s.length;d++){const h=s[d],g=a[h.start][e],y=a[h.end][e];if(ni(r,g,y)){l=r===g,u=r===y;break}}return{first:l,last:u,point:i}}class gm{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:r,y:s,radius:a}=this;return e=e||{start:0,end:te},t.arc(r,s,a,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:r}=this,s=t.angle;return{x:e+Math.cos(s)*r,y:i+Math.sin(s)*r,angle:s}}}function xO(n){const{chart:t,fill:e,line:i}=n;if(ae(e))return wO(t,e);if(e==="stack")return mO(n);if(e==="shape")return!0;const r=vO(n);return r instanceof gm?r:hm(r,i)}function wO(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function vO(n){return(n.scale||{}).getPointPositionForValue?TO(n):SO(n)}function SO(n){const{scale:t={},fill:e}=n,i=hO(e,t);if(ae(i)){const r=t.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function TO(n){const{scale:t,fill:e}=n,i=t.options,r=t.getLabels().length,s=i.reverse?t.max:t.min,a=pO(e,t,s),l=[];if(i.grid.circular){const u=t.getPointPositionForValue(0,s);return new gm({x:u.x,y:u.y,radius:t.getDistanceFromCenterForValue(a)})}for(let u=0;u<r;++u)l.push(t.getPointPositionForValue(u,a));return l}function vu(n,t,e){const i=xO(t),{chart:r,index:s,line:a,scale:l,axis:u}=t,d=a.options,h=d.fill,g=d.backgroundColor,{above:y=g,below:_=g}=h||{},x=r.getDatasetMeta(s),v=dg(r,x);i&&a.points.length&&(qs(n,e),MO(n,{line:a,target:i,above:y,below:_,area:e,scale:l,axis:u,clip:v}),js(n))}function MO(n,t){const{line:e,target:i,above:r,below:s,area:a,scale:l,clip:u}=t,d=e._loop?"angle":t.axis;n.save();let h=s;s!==r&&(d==="x"?(mm(n,i,a.top),Su(n,{line:e,target:i,color:r,scale:l,property:d,clip:u}),n.restore(),n.save(),mm(n,i,a.bottom)):d==="y"&&(ym(n,i,a.left),Su(n,{line:e,target:i,color:s,scale:l,property:d,clip:u}),n.restore(),n.save(),ym(n,i,a.right),h=r)),Su(n,{line:e,target:i,color:h,scale:l,property:d,clip:u}),n.restore()}function mm(n,t,e){const{segments:i,points:r}=t;let s=!0,a=!1;n.beginPath();for(const l of i){const{start:u,end:d}=l,h=r[u],g=r[za(u,d,r)];s?(n.moveTo(h.x,h.y),s=!1):(n.lineTo(h.x,e),n.lineTo(h.x,h.y)),a=!!t.pathSegment(n,l,{move:a}),a?n.closePath():n.lineTo(g.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function ym(n,t,e){const{segments:i,points:r}=t;let s=!0,a=!1;n.beginPath();for(const l of i){const{start:u,end:d}=l,h=r[u],g=r[za(u,d,r)];s?(n.moveTo(h.x,h.y),s=!1):(n.lineTo(e,h.y),n.lineTo(h.x,h.y)),a=!!t.pathSegment(n,l,{move:a}),a?n.closePath():n.lineTo(e,g.y)}n.lineTo(e,t.first().y),n.closePath(),n.clip()}function Su(n,t){const{line:e,target:i,property:r,color:s,scale:a,clip:l}=t,u=lO(e,i,r);for(const{source:d,target:h,start:g,end:y}of u){const{style:{backgroundColor:_=s}={}}=d,x=i!==!0;n.save(),n.fillStyle=_,kO(n,a,l,x&&wu(r,g,y)),n.beginPath();const v=!!e.pathSegment(n,d);let M;if(x){v?n.closePath():_m(n,i,y,r);const C=!!i.pathSegment(n,h,{move:v,reverse:!0});M=v&&C,M||_m(n,i,g,r)}n.closePath(),n.fill(M?"evenodd":"nonzero"),n.restore()}}function kO(n,t,e,i){const r=t.chart.chartArea,{property:s,start:a,end:l}=i||{};if(s==="x"||s==="y"){let u,d,h,g;s==="x"?(u=a,d=r.top,h=l,g=r.bottom):(u=r.left,d=a,h=r.right,g=l),n.beginPath(),e&&(u=Math.max(u,e.left),h=Math.min(h,e.right),d=Math.max(d,e.top),g=Math.min(g,e.bottom)),n.rect(u,d,h-u,g-d),n.clip()}}function _m(n,t,e,i){const r=t.interpolate(e,i);r&&n.lineTo(r.x,r.y)}var DO={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,r=[];let s,a,l,u;for(a=0;a<i;++a)s=n.getDatasetMeta(a),l=s.dataset,u=null,l&&l.options&&l instanceof Fa&&(u={visible:n.isDatasetVisible(a),index:a,fill:dO(l,a,i),chart:n,axis:s.controller.options.indexAxis,scale:s.vScale,line:l}),s.$filler=u,r.push(u);for(a=0;a<i;++a)u=r[a],!(!u||u.fill===!1)&&(u.fill=uO(r,a,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",r=n.getSortedVisibleDatasetMetas(),s=n.chartArea;for(let a=r.length-1;a>=0;--a){const l=r[a].$filler;l&&(l.line.updateControlPoints(s,l.axis),i&&l.fill&&vu(n.ctx,l,s))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let r=i.length-1;r>=0;--r){const s=i[r].$filler;pm(s)&&vu(n.ctx,s,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!pm(i)||e.drawTime!=="beforeDatasetDraw"||vu(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const bm=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},CO=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class xm extends Ve{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=Qt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,r)=>t.sort(i,r,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,r=le(i.font),s=r.size,a=this._computeTitleHeight(),{boxWidth:l,itemHeight:u}=bm(i,s);let d,h;e.font=r.string,this.isHorizontal()?(d=this.maxWidth,h=this._fitRows(a,s,l,u)+10):(h=this.maxHeight,d=this._fitCols(a,r,l,u)+10),this.width=Math.min(d,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,r){const{ctx:s,maxWidth:a,options:{labels:{padding:l}}}=this,u=this.legendHitBoxes=[],d=this.lineWidths=[0],h=r+l;let g=t;s.textAlign="left",s.textBaseline="middle";let y=-1,_=-h;return this.legendItems.forEach((x,v)=>{const M=i+e/2+s.measureText(x.text).width;(v===0||d[d.length-1]+M+2*l>a)&&(g+=h,d[d.length-(v>0?0:1)]=0,_+=h,y++),u[v]={left:0,top:_,row:y,width:M,height:r},d[d.length-1]+=M+l}),g}_fitCols(t,e,i,r){const{ctx:s,maxHeight:a,options:{labels:{padding:l}}}=this,u=this.legendHitBoxes=[],d=this.columnSizes=[],h=a-t;let g=l,y=0,_=0,x=0,v=0;return this.legendItems.forEach((M,C)=>{const{itemWidth:R,itemHeight:F}=OO(i,e,s,M,r);C>0&&_+F+2*l>h&&(g+=y+l,d.push({width:y,height:_}),x+=y+l,v++,y=_=0),u[C]={left:x,top:_,col:v,width:R,height:F},y=Math.max(y,R),_+=F+l}),g+=y,d.push({width:y,height:_}),g}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:r},rtl:s}}=this,a=$r(s,this.left,this.width);if(this.isHorizontal()){let l=0,u=He(i,this.left+r,this.right-this.lineWidths[l]);for(const d of e)l!==d.row&&(l=d.row,u=He(i,this.left+r,this.right-this.lineWidths[l])),d.top+=this.top+t+r,d.left=a.leftForLtr(a.x(u),d.width),u+=d.width+r}else{let l=0,u=He(i,this.top+t+r,this.bottom-this.columnSizes[l].height);for(const d of e)d.col!==l&&(l=d.col,u=He(i,this.top+t+r,this.bottom-this.columnSizes[l].height)),d.top=u,d.left+=this.left+r,d.left=a.leftForLtr(a.x(d.left),d.width),u+=d.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;qs(t,this),this._draw(),js(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:r}=this,{align:s,labels:a}=t,l=se.color,u=$r(t.rtl,this.left,this.width),d=le(a.font),{padding:h}=a,g=d.size,y=g/2;let _;this.drawTitle(),r.textAlign=u.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=d.string;const{boxWidth:x,boxHeight:v,itemHeight:M}=bm(a,g),C=function(N,B,T){if(isNaN(x)||x<=0||isNaN(v)||v<0)return;r.save();const S=Mt(T.lineWidth,1);if(r.fillStyle=Mt(T.fillStyle,l),r.lineCap=Mt(T.lineCap,"butt"),r.lineDashOffset=Mt(T.lineDashOffset,0),r.lineJoin=Mt(T.lineJoin,"miter"),r.lineWidth=S,r.strokeStyle=Mt(T.strokeStyle,l),r.setLineDash(Mt(T.lineDash,[])),a.usePointStyle){const O={radius:v*Math.SQRT2/2,pointStyle:T.pointStyle,rotation:T.rotation,borderWidth:S},U=u.xPlus(N,x/2),$=B+y;Yp(r,O,U,$,a.pointStyleWidth&&x)}else{const O=B+Math.max((g-v)/2,0),U=u.leftForLtr(N,x),$=Ci(T.borderRadius);r.beginPath(),Object.values($).some(it=>it!==0)?Hr(r,{x:U,y:O,w:x,h:v,radius:$}):r.rect(U,O,x,v),r.fill(),S!==0&&r.stroke()}r.restore()},R=function(N,B,T){ar(r,T.text,N,B+M/2,d,{strikethrough:T.hidden,textAlign:u.textAlign(T.textAlign)})},F=this.isHorizontal(),I=this._computeTitleHeight();F?_={x:He(s,this.left+h,this.right-i[0]),y:this.top+h+I,line:0}:_={x:this.left+h,y:He(s,this.top+I+h,this.bottom-e[0].height),line:0},ig(this.ctx,t.textDirection);const L=M+h;this.legendItems.forEach((N,B)=>{r.strokeStyle=N.fontColor,r.fillStyle=N.fontColor;const T=r.measureText(N.text).width,S=u.textAlign(N.textAlign||(N.textAlign=a.textAlign)),O=x+y+T;let U=_.x,$=_.y;u.setWidth(this.width),F?B>0&&U+O+h>this.right&&($=_.y+=L,_.line++,U=_.x=He(s,this.left+h,this.right-i[_.line])):B>0&&$+L>this.bottom&&(U=_.x=U+e[_.line].width+h,_.line++,$=_.y=He(s,this.top+I+h,this.bottom-e[_.line].height));const it=u.x(U);if(C(it,$,N),U=$M(S,U+x+y,F?U+O:this.right,t.rtl),R(u.x(U),$,N),F)_.x+=O+h;else if(typeof N.text!="string"){const at=d.lineHeight;_.y+=wm(N,at)+h}else _.y+=L}),rg(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=le(e.font),r=we(e.padding);if(!e.display)return;const s=$r(t.rtl,this.left,this.width),a=this.ctx,l=e.position,u=i.size/2,d=r.top+u;let h,g=this.left,y=this.width;if(this.isHorizontal())y=Math.max(...this.lineWidths),h=this.top+d,g=He(t.align,g,this.right-y);else{const x=this.columnSizes.reduce((v,M)=>Math.max(v,M.height),0);h=d+He(t.align,this.top,this.bottom-x-t.labels.padding-this._computeTitleHeight())}const _=He(l,g,g+y);a.textAlign=s.textAlign(jc(l)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,ar(a,e.text,_,h,i)}_computeTitleHeight(){const t=this.options.title,e=le(t.font),i=we(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,r,s;if(ni(t,this.left,this.right)&&ni(e,this.top,this.bottom)){for(s=this.legendHitBoxes,i=0;i<s.length;++i)if(r=s[i],ni(t,r.left,r.left+r.width)&&ni(e,r.top,r.top+r.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!EO(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,s=CO(r,i);r&&!s&&Qt(e.onLeave,[t,r,this],this),this._hoveredItem=i,i&&!s&&Qt(e.onHover,[t,i,this],this)}else i&&Qt(e.onClick,[t,i,this],this)}}function OO(n,t,e,i,r){const s=AO(i,n,t,e),a=RO(r,i,t.lineHeight);return{itemWidth:s,itemHeight:a}}function AO(n,t,e,i){let r=n.text;return r&&typeof r!="string"&&(r=r.reduce((s,a)=>s.length>a.length?s:a)),t+e.size/2+i.measureText(r).width}function RO(n,t,e){let i=n;return typeof t.text!="string"&&(i=wm(t,e)),i}function wm(n,t){const e=n.text?n.text.length:0;return t*e}function EO(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var PO={id:"legend",_element:xm,start(n,t,e){const i=n.legend=new xm({ctx:n.ctx,options:e,chart:n});We.configure(n,i,e),We.addBox(n,i)},stop(n){We.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;We.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,r=e.chart;r.isDatasetVisible(i)?(r.hide(i),t.hidden=!0):(r.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:r,color:s,useBorderRadius:a,borderRadius:l}}=n.legend.options;return n._getSortedDatasetMetas().map(u=>{const d=u.controller.getStyle(e?0:void 0),h=we(d.borderWidth);return{text:t[u.index].label,fillStyle:d.backgroundColor,fontColor:s,hidden:!u.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:d.borderColor,pointStyle:i||d.pointStyle,rotation:d.rotation,textAlign:r||d.textAlign,borderRadius:a&&(l||d.borderRadius),datasetIndex:u.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class Tu extends Ve{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const r=Yt(i.text)?i.text.length:1;this._padding=we(i.padding);const s=r*le(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:r,right:s,options:a}=this,l=a.align;let u=0,d,h,g;return this.isHorizontal()?(h=He(l,i,s),g=e+t,d=s-i):(a.position==="left"?(h=i+t,g=He(l,r,e),u=Rt*-.5):(h=s-t,g=He(l,e,r),u=Rt*.5),d=r-e),{titleX:h,titleY:g,maxWidth:d,rotation:u}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=le(e.font),s=i.lineHeight/2+this._padding.top,{titleX:a,titleY:l,maxWidth:u,rotation:d}=this._drawArgs(s);ar(t,e.text,0,0,i,{color:e.color,maxWidth:u,rotation:d,textAlign:jc(e.align),textBaseline:"middle",translation:[a,l]})}}function IO(n,t){const e=new Tu({ctx:n.ctx,options:t,chart:n});We.configure(n,e,t),We.addBox(n,e),n.titleBlock=e}var LO={id:"title",_element:Tu,start(n,t,e){IO(n,e)},stop(n){const t=n.titleBlock;We.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;We.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Ua=new WeakMap;var NO={id:"subtitle",start(n,t,e){const i=new Tu({ctx:n.ctx,options:e,chart:n});We.configure(n,i,e),We.addBox(n,i),Ua.set(n,i)},stop(n){We.removeBox(n,Ua.get(n)),Ua.delete(n)},beforeUpdate(n,t,e){const i=Ua.get(n);We.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const ro={average(n){if(!n.length)return!1;let t,e,i=new Set,r=0,s=0;for(t=0,e=n.length;t<e;++t){const l=n[t].element;if(l&&l.hasValue()){const u=l.tooltipPosition();i.add(u.x),r+=u.y,++s}}return s===0||i.size===0?!1:{x:[...i].reduce((l,u)=>l+u)/i.size,y:r/s}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,r=Number.POSITIVE_INFINITY,s,a,l;for(s=0,a=n.length;s<a;++s){const u=n[s].element;if(u&&u.hasValue()){const d=u.getCenterPoint(),h=Ur(t,d);h<r&&(r=h,l=u)}}if(l){const u=l.tooltipPosition();e=u.x,i=u.y}return{x:e,y:i}}};function jn(n,t){return t&&(Yt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function oi(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
|
1
|
+
(function(Kt,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("vue"),require("@kong/icons"),require("@kong-ui-public/i18n"),require("@kong-ui-public/analytics-metric-provider")):typeof define=="function"&&define.amd?define(["exports","vue","@kong/icons","@kong-ui-public/i18n","@kong-ui-public/analytics-metric-provider"],p):(Kt=typeof globalThis<"u"?globalThis:Kt||self,p(Kt["kong-ui-publicvitals-chart"]={},Kt.Vue,Kt.KongIcons,Kt["kong-ui-public-i18n"],Kt["kong-ui-public-analytics-metric-provider"]))})(this,(function(Kt,p,Ss,Kf,Qi){"use strict";var gt=(n=>(n.FIFTEEN_MIN="15m",n.ONE_HOUR="1h",n.SIX_HOUR="6h",n.TWELVE_HOUR="12h",n.ONE_DAY="24h",n.SEVEN_DAY="7d",n.THIRTY_DAY="30d",n.NINETY_DAY="90d",n.ONE_HUNDRED_EIGHTY_DAY="180d",n.ONE_YEAR="365d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.CURRENT_YEAR="current_year",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n.PREVIOUS_YEAR="previous_year",n))(gt||{});const zb=["in","not_in","selector"],Ub=["empty","not_empty"],Hb=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],Ji=n=>n.filter(t=>t!=="time"),Xf=["api","api_package","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],Zf=Ji(Xf),Wb=["active_services","error_rate","request_count","request_per_minute","response_latency_average"],Qf=[...Xf,"ai_gateway","ai_gateway_consumer","ai_gateway_data_plane_node","application","bot_info_action","bot_info_detection_reason","bot_info_ban_type","cache_status","consumer","consumer_group","country_code","oidc_credential","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm","portal_api","principal"],Jf=Ji(Qf),Vb=[...Wb,"cache_hit_rate","response_latency_p99","response_latency_p95","response_latency_p50","upstream_latency_p99","upstream_latency_p95","upstream_latency_p50","upstream_latency_average","kong_latency_p99","kong_latency_p95","kong_latency_p50","kong_latency_average","kong_internal_latency_p99","kong_internal_latency_p95","kong_internal_latency_p50","kong_internal_latency_average","response_size_p99","response_size_p95","response_size_p50","response_size_average","response_size_sum","request_size_p99","request_size_p95","request_size_p50","request_size_average","request_size_sum"],$b=["control_plane","control_plane_group","ai_gateway","gateway_service","consumer","ai_gateway_consumer","ai_gateway_consumer_group","application","oidc_credential","route","ai_provider","ai_response_model","ai_request_model","llm_cache_status","llm_embeddings_provider","llm_embeddings_model","time","realm","status_code","status_code_grouped","ai_plugin","principal","cache_status","ai_gateway_mcp_server","ai_gateway_model","ai_gateway_agent","ai_gateway_data_plane_node"],th=Ji($b),Yb=["a2a_context_id","a2a_error","a2a_method","a2a_task_id","api","api_package","api_product","api_product_version","application","auth_type","bot_info_action","bot_info_detection_reason","bot_info_ja4_fingerprint","bot_info_ban_type","bot_info_header_names","cache_status","client_ip","consumer","ai_gateway_consumer","consumer_group","ai_gateway_consumer_group","control_plane","control_plane_group","ai_gateway","country_code","data_plane_node","data_plane_node_version","ai_gateway_data_plane_node","gateway_service","header_host","header_user_agent","http_method","mcp_error","mcp_method","mcp_session_id","mcp_tool_name","oidc_credential","portal","principal","realm","request_id","request_uri","response_header_content_type","response_source","route","service_port","service_protocol","sse","status_code_grouped","time","trace_id","upstream_uri","upstream_status_code_grouped","websocket"],qb=Ji(Yb),jb=["auth_type","cache_status","client_ip","data_plane_node_version","header_host","header_user_agent","http_method","oidc_credential","request_id","request_uri","response_header_content_type","response_source","service_port","service_protocol","trace_id","upstream_uri"],Gb=jb,Kb=["ai_count","latencies_response_ms","latencies_upstream_ms","latencies_kong_gateway_ms","latencies_kong_internal_ms","request_body_size","response_body_size","response_header_content_length","status_code","upstream_status_code"],Xb=Ji(Kb),Zb=["platform","platform_usage"],Qb=n=>Zb.includes(n),Jb=[...Qf,"a2a_context_id","a2a_error","a2a_method","a2a_task_id","ai_gateway_agent","ai_gateway_mcp_server","mcp_error","mcp_method","mcp_session_id","mcp_tool_name"],eh=Ji(Jb);[...Vb];const tx=["control_plane","data_plane_group","managed_cache","network","provider","provider_region","time"],nh=Ji(tx);new Set(Zf),new Set(Jf),new Set(th),new Set(eh),new Set(nh);const ih=[{code:"AF",name:"Afghanistan"},{code:"AX",name:"Aland Islands"},{code:"AL",name:"Albania"},{code:"DZ",name:"Algeria"},{code:"AS",name:"American Samoa"},{code:"AD",name:"Andorra"},{code:"AO",name:"Angola"},{code:"AI",name:"Anguilla"},{code:"AQ",name:"Antarctica"},{code:"AG",name:"Antigua and Barbuda"},{code:"AR",name:"Argentina"},{code:"AM",name:"Armenia"},{code:"AW",name:"Aruba"},{code:"AU",name:"Australia"},{code:"AT",name:"Austria"},{code:"AZ",name:"Azerbaijan"},{code:"BS",name:"Bahamas"},{code:"BH",name:"Bahrain"},{code:"BD",name:"Bangladesh"},{code:"BB",name:"Barbados"},{code:"BY",name:"Belarus"},{code:"BE",name:"Belgium"},{code:"BZ",name:"Belize"},{code:"BJ",name:"Benin"},{code:"BM",name:"Bermuda"},{code:"BT",name:"Bhutan"},{code:"BO",name:"Bolivia"},{code:"BA",name:"Bosnia and Herzegovina"},{code:"BW",name:"Botswana"},{code:"BV",name:"Bouvet Island"},{code:"BR",name:"Brazil"},{code:"IO",name:"British Indian Ocean Territory"},{code:"BN",name:"Brunei Darussalam"},{code:"BG",name:"Bulgaria"},{code:"BF",name:"Burkina Faso"},{code:"BI",name:"Burundi"},{code:"KH",name:"Cambodia"},{code:"CM",name:"Cameroon"},{code:"CA",name:"Canada"},{code:"CV",name:"Cape Verde"},{code:"KY",name:"Cayman Islands"},{code:"CF",name:"Central African Republic"},{code:"TD",name:"Chad"},{code:"CL",name:"Chile"},{code:"CN",name:"China"},{code:"CX",name:"Christmas Island"},{code:"CC",name:"Cocos (Keeling) Islands"},{code:"CO",name:"Colombia"},{code:"KM",name:"Comoros"},{code:"CG",name:"Congo"},{code:"CD",name:"Democratic Republic of the Congo"},{code:"CK",name:"Cook Islands"},{code:"CR",name:"Costa Rica"},{code:"CI",name:"Cote d'Ivoire"},{code:"HR",name:"Croatia"},{code:"CU",name:"Cuba"},{code:"CY",name:"Cyprus"},{code:"CZ",name:"Czech Republic"},{code:"DK",name:"Denmark"},{code:"DJ",name:"Djibouti"},{code:"DM",name:"Dominica"},{code:"DO",name:"Dominican Republic"},{code:"EC",name:"Ecuador"},{code:"EG",name:"Egypt"},{code:"SV",name:"El Salvador"},{code:"GQ",name:"Equatorial Guinea"},{code:"ER",name:"Eritrea"},{code:"EE",name:"Estonia"},{code:"ET",name:"Ethiopia"},{code:"FK",name:"Falkland Islands (Malvinas)"},{code:"FO",name:"Faroe Islands"},{code:"FJ",name:"Fiji"},{code:"FI",name:"Finland"},{code:"FR",name:"France"},{code:"GF",name:"French Guiana"},{code:"PF",name:"French Polynesia"},{code:"TF",name:"French Southern Territories"},{code:"GA",name:"Gabon"},{code:"GM",name:"Gambia"},{code:"GE",name:"Georgia"},{code:"DE",name:"Germany"},{code:"GH",name:"Ghana"},{code:"GI",name:"Gibraltar"},{code:"GR",name:"Greece"},{code:"GL",name:"Greenland"},{code:"GD",name:"Grenada"},{code:"GP",name:"Guadeloupe"},{code:"GU",name:"Guam"},{code:"GT",name:"Guatemala"},{code:"GG",name:"Guernsey"},{code:"GN",name:"Guinea"},{code:"GW",name:"Guinea-Bissau"},{code:"GY",name:"Guyana"},{code:"HT",name:"Haiti"},{code:"HM",name:"Heard Island and McDonald Islands"},{code:"VA",name:"The Vatican"},{code:"HN",name:"Honduras"},{code:"HK",name:"Hong Kong"},{code:"HU",name:"Hungary"},{code:"IS",name:"Iceland"},{code:"IN",name:"India"},{code:"ID",name:"Indonesia"},{code:"IR",name:"Iran"},{code:"IQ",name:"Iraq"},{code:"IE",name:"Ireland"},{code:"IM",name:"Isle of Man"},{code:"IL",name:"Israel"},{code:"IT",name:"Italy"},{code:"JM",name:"Jamaica"},{code:"JP",name:"Japan"},{code:"JE",name:"Jersey"},{code:"JO",name:"Jordan"},{code:"KZ",name:"Kazakhstan"},{code:"KE",name:"Kenya"},{code:"KI",name:"Kiribati"},{code:"KP",name:"North Korea"},{code:"KR",name:"South Korea"},{code:"KW",name:"Kuwait"},{code:"KG",name:"Kyrgyzstan"},{code:"LA",name:"Laos"},{code:"LV",name:"Latvia"},{code:"LB",name:"Lebanon"},{code:"LS",name:"Lesotho"},{code:"LR",name:"Liberia"},{code:"LY",name:"Libya"},{code:"LI",name:"Liechtenstein"},{code:"LT",name:"Lithuania"},{code:"LU",name:"Luxembourg"},{code:"MO",name:"Macao"},{code:"MK",name:"Macedonia"},{code:"MG",name:"Madagascar"},{code:"MW",name:"Malawi"},{code:"MY",name:"Malaysia"},{code:"MV",name:"Maldives"},{code:"ML",name:"Mali"},{code:"MT",name:"Malta"},{code:"MH",name:"Marshall Islands"},{code:"MQ",name:"Martinique"},{code:"MR",name:"Mauritania"},{code:"MU",name:"Mauritius"},{code:"YT",name:"Mayotte"},{code:"MX",name:"Mexico"},{code:"FM",name:"Micronesia, "},{code:"MD",name:"Moldova,"},{code:"MC",name:"Monaco"},{code:"MN",name:"Mongolia"},{code:"ME",name:"Montenegro"},{code:"MS",name:"Montserrat"},{code:"MA",name:"Morocco"},{code:"MZ",name:"Mozambique"},{code:"MM",name:"Myanmar"},{code:"NA",name:"Namibia"},{code:"NR",name:"Nauru"},{code:"NP",name:"Nepal"},{code:"NL",name:"Netherlands"},{code:"NC",name:"New Caledonia"},{code:"NZ",name:"New Zealand"},{code:"NI",name:"Nicaragua"},{code:"NE",name:"Niger"},{code:"NG",name:"Nigeria"},{code:"NU",name:"Niue"},{code:"NF",name:"Norfolk Island"},{code:"MP",name:"Northern Mariana Islands"},{code:"NO",name:"Norway"},{code:"OM",name:"Oman"},{code:"PK",name:"Pakistan"},{code:"PW",name:"Palau"},{code:"PA",name:"Panama"},{code:"PG",name:"Papua New Guinea"},{code:"PY",name:"Paraguay"},{code:"PE",name:"Peru"},{code:"PH",name:"Philippines"},{code:"PN",name:"Pitcairn"},{code:"PL",name:"Poland"},{code:"PT",name:"Portugal"},{code:"PR",name:"Puerto Rico"},{code:"QA",name:"Qatar"},{code:"RE",name:"Reunion"},{code:"RO",name:"Romania"},{code:"RU",name:"Russia"},{code:"RW",name:"Rwanda"},{code:"BL",name:"Saint Barthelemy"},{code:"SH",name:"Saint Helena"},{code:"KN",name:"Saint Kitts and Nevis"},{code:"LC",name:"Saint Lucia"},{code:"MF",name:"Saint Martin"},{code:"PM",name:"Saint Pierre and Miquelon"},{code:"VC",name:"Saint Vincent and the Grenadines"},{code:"WS",name:"Samoa"},{code:"SM",name:"San Marino"},{code:"ST",name:"Sao Tome and Principe"},{code:"SA",name:"Saudi Arabia"},{code:"SN",name:"Senegal"},{code:"RS",name:"Serbia"},{code:"SC",name:"Seychelles"},{code:"SL",name:"Sierra Leone"},{code:"SG",name:"Singapore"},{code:"SX",name:"Sint Maarten"},{code:"SK",name:"Slovakia"},{code:"SI",name:"Slovenia"},{code:"SB",name:"Solomon Islands"},{code:"SO",name:"Somalia"},{code:"ZA",name:"South Africa"},{code:"GS",name:"South Georgia and the South Sandwich Islands"},{code:"SS",name:"South Sudan"},{code:"ES",name:"Spain"},{code:"LK",name:"Sri Lanka"},{code:"SD",name:"Sudan"},{code:"SR",name:"Suriname"},{code:"SJ",name:"Svalbard and Jan Mayen"},{code:"SZ",name:"Swaziland"},{code:"SE",name:"Sweden"},{code:"CH",name:"Switzerland"},{code:"SY",name:"Syria"},{code:"TW",name:"Taiwan"},{code:"TJ",name:"Tajikistan"},{code:"TZ",name:"Tanzania"},{code:"TH",name:"Thailand"},{code:"TL",name:"Timor-Leste"},{code:"TG",name:"Togo"},{code:"TK",name:"Tokelau"},{code:"TO",name:"Tonga"},{code:"TT",name:"Trinidad and Tobago"},{code:"TN",name:"Tunisia"},{code:"TR",name:"Turkey"},{code:"TM",name:"Turkmenistan"},{code:"TC",name:"Turks and Caicos Islands"},{code:"TV",name:"Tuvalu"},{code:"UG",name:"Uganda"},{code:"UA",name:"Ukraine"},{code:"AE",name:"United Arab Emirates"},{code:"GB",name:"United Kingdom"},{code:"US",name:"United States"},{code:"UM",name:"United States Minor Outlying Islands"},{code:"UY",name:"Uruguay"},{code:"UZ",name:"Uzbekistan"},{code:"VU",name:"Vanuatu"},{code:"VE",name:"Venezuela"},{code:"VN",name:"Vietnam"},{code:"VG",name:"British Virgin Islands"},{code:"VI",name:"U.S. Virgin Islands"},{code:"WF",name:"Wallis and Futuna"},{code:"EH",name:"Western Sahara"},{code:"YE",name:"Yemen"},{code:"ZM",name:"Zambia"},{code:"ZW",name:"Zimbabwe"}];ih.map(n=>n.code);const rh=n=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",...n?{enum:n}:{}},operator:{type:"string",enum:zb},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",...n?{enum:n}:{}},operator:{type:"string",enum:Ub}},required:["field","operator"],additionalProperties:!1}]}}),ex=["control_plane","gateway_service","realm","route","plugin","plugin_name","plugin_scope","data_plane_node_version","env","team","region","hostname"];rh(Array.from(new Set([...qb,...Gb,...Xb]))),rh([...new Set([...Jf,...Zf,...th,...eh,...ex,...nh])]);const nx={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},ix=(n,t,e)=>{let i;const r=nx[n];return typeof r=="string"?i=r:t===1?i=r.one:i=r.other.replace("{{count}}",t.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function yc(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const rx={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},sx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ox={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ax={date:yc({formats:rx,defaultWidth:"full"}),time:yc({formats:sx,defaultWidth:"full"}),dateTime:yc({formats:ox,defaultWidth:"full"})},lx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},cx=(n,t,e,i)=>lx[n];function Ts(n){return(t,e)=>{const i=e?.context?String(e.context):"standalone";let r;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,l=e?.width?String(e.width):a;r=n.formattingValues[l]||n.formattingValues[a]}else{const a=n.defaultWidth,l=e?.width?String(e.width):n.defaultWidth;r=n.values[l]||n.values[a]}const s=n.argumentCallback?n.argumentCallback(t):t;return r[s]}}const ux={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},dx={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},fx={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},hx={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},px={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},gx={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},mx=(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},yx={ordinalNumber:mx,era:Ts({values:ux,defaultWidth:"wide"}),quarter:Ts({values:dx,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Ts({values:fx,defaultWidth:"wide"}),day:Ts({values:hx,defaultWidth:"wide"}),dayPeriod:Ts({values:px,defaultWidth:"wide",formattingValues:gx,defaultFormattingWidth:"wide"})};function Ms(n){return(t,e={})=>{const i=e.width,r=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],s=t.match(r);if(!s)return null;const a=s[0],l=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],u=Array.isArray(l)?bx(l,g=>g.test(a)):_x(l,g=>g.test(a));let d;d=n.valueCallback?n.valueCallback(u):u,d=e.valueCallback?e.valueCallback(d):d;const h=t.slice(a.length);return{value:d,rest:h}}}function _x(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function bx(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function xx(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const r=i[0],s=t.match(n.parsePattern);if(!s)return null;let a=n.valueCallback?n.valueCallback(s[0]):s[0];a=e.valueCallback?e.valueCallback(a):a;const l=t.slice(r.length);return{value:a,rest:l}}}const wx=/^(\d+)(th|st|nd|rd)?/i,vx=/\d+/i,Sx={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Tx={any:[/^b/i,/^(a|c)/i]},Mx={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},kx={any:[/1/i,/2/i,/3/i,/4/i]},Dx={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Cx={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Ox={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Ax={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Rx={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ex={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Px={ordinalNumber:xx({matchPattern:wx,parsePattern:vx,valueCallback:n=>parseInt(n,10)}),era:Ms({matchPatterns:Sx,defaultMatchWidth:"wide",parsePatterns:Tx,defaultParseWidth:"any"}),quarter:Ms({matchPatterns:Mx,defaultMatchWidth:"wide",parsePatterns:kx,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Ms({matchPatterns:Dx,defaultMatchWidth:"wide",parsePatterns:Cx,defaultParseWidth:"any"}),day:Ms({matchPatterns:Ox,defaultMatchWidth:"wide",parsePatterns:Ax,defaultParseWidth:"any"}),dayPeriod:Ms({matchPatterns:Rx,defaultMatchWidth:"any",parsePatterns:Ex,defaultParseWidth:"any"})},Ix={code:"en-US",formatDistance:ix,formatLong:ax,formatRelative:cx,localize:yx,match:Px,options:{weekStartsOn:0,firstWeekContainsDate:1}};let Lx={};function ks(){return Lx}const sh=6048e5,Nx=864e5,Bx=60,Fx=3600,oh=Symbol.for("constructDateFrom");function Sn(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&oh in n?n[oh](t):n instanceof Date?new n.constructor(t):new Date(t)}function ze(n,t){return Sn(t||n,n)}function ah(n){const t=ze(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function zx(n,...t){const e=Sn.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Rr(n,t){const e=ze(n,t?.in);return e.setHours(0,0,0,0),e}function Ux(n,t,e){const[i,r]=zx(e?.in,n,t),s=Rr(i),a=Rr(r),l=+s-ah(s),u=+a-ah(a);return Math.round((l-u)/Nx)}function Hx(n,t){const e=ze(n,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function Wx(n,t){const e=ze(n,t?.in);return Ux(e,Hx(e))+1}function Jn(n,t){const e=ks(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=ze(n,t?.in),s=r.getDay(),a=(s<i?7:0)+s-i;return r.setDate(r.getDate()-a),r.setHours(0,0,0,0),r}function Qo(n,t){return Jn(n,{...t,weekStartsOn:1})}function lh(n,t){const e=ze(n,t?.in),i=e.getFullYear(),r=Sn(e,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=Qo(r),a=Sn(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=Qo(a);return e.getTime()>=s.getTime()?i+1:e.getTime()>=l.getTime()?i:i-1}function Vx(n,t){const e=lh(n,t),i=Sn(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Qo(i)}function $x(n,t){const e=ze(n,t?.in),i=+Qo(e)-+Vx(e);return Math.round(i/sh)+1}function ch(n,t){const e=ze(n,t?.in),i=e.getFullYear(),r=ks(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=Sn(t?.in||n,0);a.setFullYear(i+1,0,s),a.setHours(0,0,0,0);const l=Jn(a,t),u=Sn(t?.in||n,0);u.setFullYear(i,0,s),u.setHours(0,0,0,0);const d=Jn(u,t);return+e>=+l?i+1:+e>=+d?i:i-1}function Yx(n,t){const e=ks(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??e.firstWeekContainsDate??e.locale?.options?.firstWeekContainsDate??1,r=ch(n,t),s=Sn(t?.in||n,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),Jn(s,t)}function qx(n,t){const e=ze(n,t?.in),i=+Jn(e,t)-+Yx(e,t);return Math.round(i/sh)+1}function Xt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const wi={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Xt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Xt(e+1,2)},d(n,t){return Xt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Xt(n.getHours()%12||12,t.length)},H(n,t){return Xt(n.getHours(),t.length)},m(n,t){return Xt(n.getMinutes(),t.length)},s(n,t){return Xt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),r=Math.trunc(i*Math.pow(10,e-3));return Xt(r,t.length)}},Er={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},uh={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),r=i>0?i:1-i;return e.ordinalNumber(r,{unit:"year"})}return wi.y(n,t)},Y:function(n,t,e,i){const r=ch(n,i),s=r>0?r:1-r;if(t==="YY"){const a=s%100;return Xt(a,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):Xt(s,t.length)},R:function(n,t){const e=lh(n);return Xt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Xt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Xt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Xt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return wi.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Xt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const r=qx(n,i);return t==="wo"?e.ordinalNumber(r,{unit:"week"}):Xt(r,t.length)},I:function(n,t,e){const i=$x(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Xt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):wi.d(n,t)},D:function(n,t,e){const i=Wx(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Xt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const r=n.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Xt(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});case"eee":return e.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(r,{width:"short",context:"formatting"});default:return e.day(r,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const r=n.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Xt(s,t.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(r,{width:"narrow",context:"standalone"});case"cccccc":return e.day(r,{width:"short",context:"standalone"});default:return e.day(r,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),r=i===0?7:i;switch(t){case"i":return String(r);case"ii":return Xt(r,t.length);case"io":return e.ordinalNumber(r,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const i=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let r;switch(i===12?r=Er.noon:i===0?r=Er.midnight:r=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let r;switch(i>=17?r=Er.evening:i>=12?r=Er.afternoon:i>=4?r=Er.morning:r=Er.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return wi.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):wi.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Xt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Xt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):wi.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):wi.s(n,t)},S:function(n,t){return wi.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return fh(i);case"XXXX":case"XX":return tr(i);default:return tr(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return fh(i);case"xxxx":case"xx":return tr(i);default:return tr(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+dh(i,":");default:return"GMT"+tr(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+dh(i,":");default:return"GMT"+tr(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Xt(i,t.length)},T:function(n,t,e){return Xt(+n,t.length)}};function dh(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Math.trunc(i/60),s=i%60;return s===0?e+String(r):e+String(r)+t+Xt(s,2)}function fh(n,t){return n%60===0?(n>0?"-":"+")+Xt(Math.abs(n)/60,2):tr(n,t)}function tr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Xt(Math.trunc(i/60),2),s=Xt(i%60,2);return e+r+t+s}const hh=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},ph=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},jx=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],r=e[2];if(!r)return hh(n,t);let s;switch(i){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",hh(i,t)).replace("{{time}}",ph(r,t))},Gx={p:ph,P:jx},Kx=/^D+$/,Xx=/^Y+$/,Zx=["D","DD","YY","YYYY"];function Qx(n){return Kx.test(n)}function Jx(n){return Xx.test(n)}function tw(n,t,e){const i=ew(n,t,e);if(console.warn(i),Zx.includes(n))throw new RangeError(i)}function ew(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function nw(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function iw(n){return!(!nw(n)&&typeof n!="number"||isNaN(+ze(n)))}const rw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,sw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ow=/^'([^]*?)'?$/,aw=/''/g,lw=/[a-zA-Z]/;function cw(n,t,e){const i=ks(),r=e?.locale??i.locale??Ix,s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,l=ze(n,e?.in);if(!iw(l))throw new RangeError("Invalid time value");let u=t.match(sw).map(h=>{const g=h[0];if(g==="p"||g==="P"){const y=Gx[g];return y(h,r.formatLong)}return h}).join("").match(rw).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const g=h[0];if(g==="'")return{isToken:!1,value:uw(h)};if(uh[g])return{isToken:!0,value:h};if(g.match(lw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:h}});r.localize.preprocessor&&(u=r.localize.preprocessor(l,u));const d={firstWeekContainsDate:s,weekStartsOn:a,locale:r};return u.map(h=>{if(!h.isToken)return h.value;const g=h.value;(!e?.useAdditionalWeekYearTokens&&Jx(g)||!e?.useAdditionalDayOfYearTokens&&Qx(g))&&tw(g,t,String(n));const y=uh[g[0]];return y(l,g,r.localize,d)}).join("")}function uw(n){const t=n.match(ow);return t?t[1].replace(aw,"'"):n}function Jo(n,t,e){const i=ze(n,e?.in);return isNaN(t)?Sn(n,NaN):(i.setDate(i.getDate()+t),i)}function gh(n,t,e){const i=ze(n,e?.in);if(isNaN(t))return Sn(n,NaN);if(!t)return i;const r=i.getDate(),s=Sn(n,i.getTime());s.setMonth(i.getMonth()+t+1,0);const a=s.getDate();return r>=a?s:(i.setFullYear(s.getFullYear(),s.getMonth(),r),i)}function dw(n,t,e){return gh(n,t*3,e)}function Pr(n,t){const e=ze(n,t?.in),i=e.getMonth(),r=i-i%3;return e.setMonth(r,1),e.setHours(0,0,0,0),e}function Ir(n,t){const e=ze(n,t?.in);return e.setDate(1),e.setHours(0,0,0,0),e}function fw(n,t){const e=ze(n,t?.in),i=e.getFullYear(),r=e.getMonth(),s=Sn(e,0);return s.setFullYear(i,r+1,0),s.setHours(0,0,0,0),s.getDate()}function hw(){return Object.assign({},ks())}function mh(n){return Math.trunc(n*Fx)}function pw(n){const t=n/Bx;return Math.trunc(t)}function yh(n,t,e){return gh(n,-1,e)}function _h(n,t,e){return dw(n,-1,e)}function bh(n,t,e){const i=hw(),r=yw(n,e.timeZone,e.locale??i.locale);return"formatToParts"in r?gw(r,t):mw(r,t)}function gw(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function mw(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function yw(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function _w(n,t){const e=Sw(t);return"formatToParts"in e?xw(e,n):ww(e,n)}const bw={year:0,month:1,day:2,hour:3,minute:4,second:5};function xw(n,t){try{const e=n.formatToParts(t),i=[];for(let r=0;r<e.length;r++){const s=bw[e[r].type];s!==void 0&&(i[s]=parseInt(e[r].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function ww(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const _c={},xh=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),vw=xh==="06/25/2014, 00:00:00"||xh==="06/25/2014 00:00:00";function Sw(n){return _c[n]||(_c[n]=vw?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),_c[n]}function bc(n,t,e,i,r,s,a){const l=new Date(0);return l.setUTCFullYear(n,t,e),l.setUTCHours(i,r,s,a),l}const wh=36e5,Tw=6e4,xc={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Ds(n,t,e){if(!n)return 0;let i=xc.timezoneZ.exec(n);if(i)return 0;let r,s;if(i=xc.timezoneHH.exec(n),i)return r=parseInt(i[1],10),vh(r)?-(r*wh):NaN;if(i=xc.timezoneHHMM.exec(n),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return vh(r,a)?(s=Math.abs(r)*wh+a*Tw,i[1]==="+"?-s:s):NaN}if(Dw(n)){t=new Date(t||Date.now());const a=e?t:Mw(t),l=wc(a,n);return-(e?l:kw(t,l,n))}return NaN}function Mw(n){return bc(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function wc(n,t){const e=_w(n,t),i=bc(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let r=n.getTime();const s=r%1e3;return r-=s>=0?s:1e3+s,i-r}function kw(n,t,e){let i=n.getTime()-t;const r=wc(new Date(i),e);if(t===r)return t;i-=r-t;const s=wc(new Date(i),e);return r===s?r:Math.max(r,s)}function vh(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const Sh={};function Dw(n){if(Sh[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Sh[n]=!0,!0}catch{return!1}}const Cw=60*1e3,Ow={X:function(n,t,e){const i=vc(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return Th(i);case"XXXX":case"XX":return Lr(i);default:return Lr(i,":")}},x:function(n,t,e){const i=vc(e.timeZone,n);switch(t){case"x":return Th(i);case"xxxx":case"xx":return Lr(i);default:return Lr(i,":")}},O:function(n,t,e){const i=vc(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Aw(i,":");default:return"GMT"+Lr(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return bh("short",n,e);default:return bh("long",n,e)}}};function vc(n,t){const e=n?Ds(n,t,!0)/Cw:t?.getTimezoneOffset()??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function ta(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Lr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=ta(Math.floor(i/60),2),s=ta(Math.floor(i%60),2);return e+r+t+s}function Th(n,t){return n%60===0?(n>0?"-":"+")+ta(Math.abs(n)/60,2):Lr(n,t)}function Aw(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Math.floor(i/60),s=i%60;return s===0?e+String(r):e+String(r)+t+ta(s,2)}function Mh(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const kh=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Sc=36e5,Dh=6e4,Rw=2,Ke={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:kh};function ea(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?Rw:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=Ew(n),{year:r,restDateString:s}=Pw(i.date,e),a=Iw(s,r);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const l=a.getTime();let u=0,d;if(i.time&&(u=Lw(i.time),u===null||isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(d=Ds(i.timeZone||t.timeZone,new Date(l+u)),isNaN(d))return new Date(NaN)}else d=Mh(new Date(l+u)),d=Mh(new Date(l+u+d));return new Date(l+u+d)}else return new Date(NaN)}function Ew(n){const t={};let e=Ke.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=Ke.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const r=Ke.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function Pw(n,t){if(n){const e=Ke.YYY[t],i=Ke.YYYYY[t];let r=Ke.YYYY.exec(n)||i.exec(n);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:n.slice(s.length)}}if(r=Ke.YY.exec(n)||e.exec(n),r){const s=r[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}}return{year:null}}function Iw(n,t){if(t===null)return null;let e,i,r;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let s=Ke.MM.exec(n);if(s)return e=new Date(0),i=parseInt(s[1],10)-1,Ah(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(s=Ke.DDD.exec(n),s){e=new Date(0);const a=parseInt(s[1],10);return Fw(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(s=Ke.MMDD.exec(n),s){e=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return Ah(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(s=Ke.Www.exec(n),s)return r=parseInt(s[1],10)-1,Rh(r)?Ch(t,r):new Date(NaN);if(s=Ke.WwwD.exec(n),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return Rh(r,a)?Ch(t,r,a):new Date(NaN)}return null}function Lw(n){let t,e,i=Ke.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Tc(t)?t%24*Sc:NaN;if(i=Ke.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Tc(t,e)?t%24*Sc+e*Dh:NaN;if(i=Ke.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return Tc(t,e,r)?t%24*Sc+e*Dh+r*1e3:NaN}return null}function Ch(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const r=i.getUTCDay()||7,s=t*7+e+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const Nw=[31,28,31,30,31,30,31,31,30,31,30,31],Bw=[31,29,31,30,31,30,31,31,30,31,30,31];function Oh(n){return n%400===0||n%4===0&&n%100!==0}function Ah(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=Oh(n);if(i&&e>Bw[t]||!i&&e>Nw[t])return!1}return!0}function Fw(n,t){if(t<1)return!1;const e=Oh(n);return!(e&&t>366||!e&&t>365)}function Rh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Tc(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const zw=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Uw(n,t,e={}){t=String(t);const i=t.match(zw);if(i){const r=ea(e.originalDate||n,e);t=i.reduce(function(s,a){if(a[0]==="'")return s;const l=s.indexOf(a),u=s[l-1]==="'",d=s.replace(a,"'"+Ow[a[0]](r,a,e)+"'");return u?d.substring(0,l-1)+d.substring(l+1):d},t)}return cw(n,t,e)}function Eh(n,t,e){n=ea(n,e);const i=Ds(t,n,!0),r=new Date(n.getTime()-i),s=new Date(0);return s.setFullYear(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),s.setHours(r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()),s}function Ph(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Uw(Eh(n,t,{timeZone:i.timeZone}),e,i)}function Hw(n,t,e){if(typeof n=="string"&&!n.match(kh))return ea(n,{...e,timeZone:t});n=ea(n,e);const i=bc(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),r=Ds(t,new Date(i));return new Date(i+r)}function Ww(n,t){return-Ds(n,t)}function Ih(n,t={}){const e=t?.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;let i="MMM dd, yyy hh:mm a";switch(t.format){case"short":i="MMM dd, yyyy";break;case"default":i="MMM dd, yyyy hh:mm a";break;case"full":i="MMM dd, yyyy hh:mm:ss.SSS a";break}return t.includeTZ&&(i+=" (z)"),Ph(n,e,i)}function Vw(n,t={}){if(!n)return n;const e=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let i="MMM dd, yyy hh:mm a";t.short&&(i="MMM dd, yyy"),t.includeTZ&&(i+=" (z)");const r=new Date(n);return Ph(r,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const $w={secondly:1e3,tenSecondly:10*1e3,thirtySecondly:30*1e3,minutely:60*1e3,fiveMinutely:300*1e3,tenMinutely:600*1e3,thirtyMinutely:1800*1e3,hourly:3600*1e3,twoHourly:7200*1e3,twelveHourly:720*60*1e3,daily:3600*24*1e3,weekly:3600*24*7*1e3,trend:0};function na(n){return n&&Hb.find(t=>n<=$w[t])||null}var ia=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ra={exports:{}};ra.exports;var Lh;function Yw(){return Lh||(Lh=1,(function(n,t){var e=200,i="__lodash_hash_undefined__",r=9007199254740991,s="[object Arguments]",a="[object Array]",l="[object Boolean]",u="[object Date]",d="[object Error]",h="[object Function]",g="[object GeneratorFunction]",y="[object Map]",_="[object Number]",x="[object Object]",v="[object Promise]",M="[object RegExp]",C="[object Set]",R="[object String]",F="[object Symbol]",I="[object WeakMap]",L="[object ArrayBuffer]",N="[object DataView]",B="[object Float32Array]",T="[object Float64Array]",S="[object Int8Array]",O="[object Int16Array]",U="[object Int32Array]",$="[object Uint8Array]",it="[object Uint8ClampedArray]",at="[object Uint16Array]",ot="[object Uint32Array]",q=/[\\^$.*+?()[\]{}|]/g,J=/\w*$/,rt=/^\[object .+?Constructor\]$/,tt=/^(?:0|[1-9]\d*)$/,G={};G[s]=G[a]=G[L]=G[N]=G[l]=G[u]=G[B]=G[T]=G[S]=G[O]=G[U]=G[y]=G[_]=G[x]=G[M]=G[C]=G[R]=G[F]=G[$]=G[it]=G[at]=G[ot]=!0,G[d]=G[h]=G[I]=!1;var P=typeof ia=="object"&&ia&&ia.Object===Object&&ia,W=typeof self=="object"&&self&&self.Object===Object&&self,j=P||W||Function("return this")(),pt=t&&!t.nodeType&&t,lt=pt&&!0&&n&&!n.nodeType&&n,et=lt&<.exports===pt;function ht(D,V){return D.set(V[0],V[1]),D}function ft(D,V){return D.add(V),D}function ct(D,V){for(var Q=-1,yt=D?D.length:0;++Q<yt&&V(D[Q],Q,D)!==!1;);return D}function mt(D,V){for(var Q=-1,yt=V.length,Te=D.length;++Q<yt;)D[Te+Q]=V[Q];return D}function ut(D,V,Q,yt){for(var Te=-1,qe=D?D.length:0;++Te<qe;)Q=V(Q,D[Te],Te,D);return Q}function Lt(D,V){for(var Q=-1,yt=Array(D);++Q<D;)yt[Q]=V(Q);return yt}function zt(D,V){return D?.[V]}function vt(D){var V=!1;if(D!=null&&typeof D.toString!="function")try{V=!!(D+"")}catch{}return V}function Ct(D){var V=-1,Q=Array(D.size);return D.forEach(function(yt,Te){Q[++V]=[Te,yt]}),Q}function Dt(D,V){return function(Q){return D(V(Q))}}function ve(D){var V=-1,Q=Array(D.size);return D.forEach(function(yt){Q[++V]=yt}),Q}var bt=Array.prototype,qt=Function.prototype,Oe=Object.prototype,Ae=j["__core-js_shared__"],oe=(function(){var D=/[^.]+$/.exec(Ae&&Ae.keys&&Ae.keys.IE_PROTO||"");return D?"Symbol(src)_1."+D:""})(),ln=qt.toString,Vt=Oe.hasOwnProperty,Le=Oe.toString,ie=RegExp("^"+ln.call(Vt).replace(q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Se=et?j.Buffer:void 0,Re=j.Symbol,gn=j.Uint8Array,zi=Dt(Object.getPrototypeOf,Object),Dn=Object.create,Ye=Oe.propertyIsEnumerable,In=bt.splice,ci=Object.getOwnPropertySymbols,vo=Se?Se.isBuffer:void 0,So=Dt(Object.keys,Object),br=Gn(j,"DataView"),ui=Gn(j,"Map"),To=Gn(j,"Promise"),Mo=Gn(j,"Set"),ko=Gn(j,"WeakMap"),Ui=Gn(Object,"create"),hl=fi(br),dd=fi(ui),fd=fi(To),hd=fi(Mo),pd=fi(ko),Do=Re?Re.prototype:void 0,pl=Do?Do.valueOf:void 0;function di(D){var V=-1,Q=D?D.length:0;for(this.clear();++V<Q;){var yt=D[V];this.set(yt[0],yt[1])}}function gd(){this.__data__=Ui?Ui(null):{}}function Co(D){return this.has(D)&&delete this.__data__[D]}function md(D){var V=this.__data__;if(Ui){var Q=V[D];return Q===i?void 0:Q}return Vt.call(V,D)?V[D]:void 0}function Oo(D){var V=this.__data__;return Ui?V[D]!==void 0:Vt.call(V,D)}function yd(D,V){var Q=this.__data__;return Q[D]=Ui&&V===void 0?i:V,this}di.prototype.clear=gd,di.prototype.delete=Co,di.prototype.get=md,di.prototype.has=Oo,di.prototype.set=yd;function Ln(D){var V=-1,Q=D?D.length:0;for(this.clear();++V<Q;){var yt=D[V];this.set(yt[0],yt[1])}}function _d(){this.__data__=[]}function bd(D){var V=this.__data__,Q=xr(V,D);if(Q<0)return!1;var yt=V.length-1;return Q==yt?V.pop():In.call(V,Q,1),!0}function xd(D){var V=this.__data__,Q=xr(V,D);return Q<0?void 0:V[Q][1]}function gl(D){return xr(this.__data__,D)>-1}function wd(D,V){var Q=this.__data__,yt=xr(Q,D);return yt<0?Q.push([D,V]):Q[yt][1]=V,this}Ln.prototype.clear=_d,Ln.prototype.delete=bd,Ln.prototype.get=xd,Ln.prototype.has=gl,Ln.prototype.set=wd;function Hi(D){var V=-1,Q=D?D.length:0;for(this.clear();++V<Q;){var yt=D[V];this.set(yt[0],yt[1])}}function ml(){this.__data__={hash:new di,map:new(ui||Ln),string:new di}}function vd(D){return wr(this,D).delete(D)}function Sd(D){return wr(this,D).get(D)}function Td(D){return wr(this,D).has(D)}function Md(D,V){return wr(this,D).set(D,V),this}Hi.prototype.clear=ml,Hi.prototype.delete=vd,Hi.prototype.get=Sd,Hi.prototype.has=Td,Hi.prototype.set=Md;function Wi(D){this.__data__=new Ln(D)}function kd(){this.__data__=new Ln}function es(D){return this.__data__.delete(D)}function Dd(D){return this.__data__.get(D)}function ns(D){return this.__data__.has(D)}function Cd(D,V){var Q=this.__data__;if(Q instanceof Ln){var yt=Q.__data__;if(!ui||yt.length<e-1)return yt.push([D,V]),this;Q=this.__data__=new Hi(yt)}return Q.set(D,V),this}Wi.prototype.clear=kd,Wi.prototype.delete=es,Wi.prototype.get=Dd,Wi.prototype.has=ns,Wi.prototype.set=Cd;function Od(D,V){var Q=Io(D)||Al(D)?Lt(D.length,String):[],yt=Q.length,Te=!!yt;for(var qe in D)Vt.call(D,qe)&&!(Te&&(qe=="length"||kl(qe,yt)))&&Q.push(qe);return Q}function yl(D,V,Q){var yt=D[V];(!(Vt.call(D,V)&&Ol(yt,Q))||Q===void 0&&!(V in D))&&(D[V]=Q)}function xr(D,V){for(var Q=D.length;Q--;)if(Ol(D[Q][0],V))return Q;return-1}function _l(D,V){return D&&Ro(V,Lo(V),D)}function is(D,V,Q,yt,Te,qe,Nn){var Ne;if(yt&&(Ne=qe?yt(D,Te,qe,Nn):yt(D)),Ne!==void 0)return Ne;if(!ls(D))return D;var El=Io(D);if(El){if(Ne=Tl(D),!V)return Sl(D,Ne)}else{var ce=cn(D),cs=ce==h||ce==g;if(Ud(D))return xl(D,V);if(ce==x||ce==s||cs&&!qe){if(vt(D))return qe?D:{};if(Ne=Ml(cs?{}:D),!V)return Eo(D,_l(Ne,D))}else{if(!G[ce])return qe?D:{};Ne=Bd(D,ce,is,V)}}Nn||(Nn=new Wi);var Kn=Nn.get(D);if(Kn)return Kn;if(Nn.set(D,Ne),!El)var No=Q?Nd(D):Lo(D);return ct(No||D,function(vr,Be){No&&(Be=vr,vr=D[Be]),yl(Ne,Be,is(vr,V,Q,yt,Be,D,Nn))}),Ne}function Ad(D){return ls(D)?Dn(D):{}}function Rd(D,V,Q){var yt=V(D);return Io(D)?yt:mt(yt,Q(D))}function Ed(D){return Le.call(D)}function Pd(D){if(!ls(D)||Cl(D))return!1;var V=as(D)||vt(D)?ie:rt;return V.test(fi(D))}function bl(D){if(!Po(D))return So(D);var V=[];for(var Q in Object(D))Vt.call(D,Q)&&Q!="constructor"&&V.push(Q);return V}function xl(D,V){if(V)return D.slice();var Q=new D.constructor(D.length);return D.copy(Q),Q}function rs(D){var V=new D.constructor(D.byteLength);return new gn(V).set(new gn(D)),V}function Ao(D,V){var Q=V?rs(D.buffer):D.buffer;return new D.constructor(Q,D.byteOffset,D.byteLength)}function Id(D,V,Q){var yt=V?Q(Ct(D),!0):Ct(D);return ut(yt,ht,new D.constructor)}function wl(D){var V=new D.constructor(D.source,J.exec(D));return V.lastIndex=D.lastIndex,V}function ss(D,V,Q){var yt=V?Q(ve(D),!0):ve(D);return ut(yt,ft,new D.constructor)}function vl(D){return pl?Object(pl.call(D)):{}}function Ld(D,V){var Q=V?rs(D.buffer):D.buffer;return new D.constructor(Q,D.byteOffset,D.length)}function Sl(D,V){var Q=-1,yt=D.length;for(V||(V=Array(yt));++Q<yt;)V[Q]=D[Q];return V}function Ro(D,V,Q,yt){Q||(Q={});for(var Te=-1,qe=V.length;++Te<qe;){var Nn=V[Te],Ne=void 0;yl(Q,Nn,Ne===void 0?D[Nn]:Ne)}return Q}function Eo(D,V){return Ro(D,os(D),V)}function Nd(D){return Rd(D,Lo,os)}function wr(D,V){var Q=D.__data__;return Dl(V)?Q[typeof V=="string"?"string":"hash"]:Q.map}function Gn(D,V){var Q=zt(D,V);return Pd(Q)?Q:void 0}var os=ci?Dt(ci,Object):Vd,cn=Ed;(br&&cn(new br(new ArrayBuffer(1)))!=N||ui&&cn(new ui)!=y||To&&cn(To.resolve())!=v||Mo&&cn(new Mo)!=C||ko&&cn(new ko)!=I)&&(cn=function(D){var V=Le.call(D),Q=V==x?D.constructor:void 0,yt=Q?fi(Q):void 0;if(yt)switch(yt){case hl:return N;case dd:return y;case fd:return v;case hd:return C;case pd:return I}return V});function Tl(D){var V=D.length,Q=D.constructor(V);return V&&typeof D[0]=="string"&&Vt.call(D,"index")&&(Q.index=D.index,Q.input=D.input),Q}function Ml(D){return typeof D.constructor=="function"&&!Po(D)?Ad(zi(D)):{}}function Bd(D,V,Q,yt){var Te=D.constructor;switch(V){case L:return rs(D);case l:case u:return new Te(+D);case N:return Ao(D,yt);case B:case T:case S:case O:case U:case $:case it:case at:case ot:return Ld(D,yt);case y:return Id(D,yt,Q);case _:case R:return new Te(D);case M:return wl(D);case C:return ss(D,yt,Q);case F:return vl(D)}}function kl(D,V){return V=V??r,!!V&&(typeof D=="number"||tt.test(D))&&D>-1&&D%1==0&&D<V}function Dl(D){var V=typeof D;return V=="string"||V=="number"||V=="symbol"||V=="boolean"?D!=="__proto__":D===null}function Cl(D){return!!oe&&oe in D}function Po(D){var V=D&&D.constructor,Q=typeof V=="function"&&V.prototype||Oe;return D===Q}function fi(D){if(D!=null){try{return ln.call(D)}catch{}try{return D+""}catch{}}return""}function Fd(D){return is(D,!0,!0)}function Ol(D,V){return D===V||D!==D&&V!==V}function Al(D){return zd(D)&&Vt.call(D,"callee")&&(!Ye.call(D,"callee")||Le.call(D)==s)}var Io=Array.isArray;function Rl(D){return D!=null&&Hd(D.length)&&!as(D)}function zd(D){return Wd(D)&&Rl(D)}var Ud=vo||ee;function as(D){var V=ls(D)?Le.call(D):"";return V==h||V==g}function Hd(D){return typeof D=="number"&&D>-1&&D%1==0&&D<=r}function ls(D){var V=typeof D;return!!D&&(V=="object"||V=="function")}function Wd(D){return!!D&&typeof D=="object"}function Lo(D){return Rl(D)?Od(D):bl(D)}function Vd(){return[]}function ee(){return!1}n.exports=Fd})(ra,ra.exports)),ra.exports}Yw();const Tn=(n,t)=>new Date(n.getTime()-Ww(t,n));class De{timeframeText;key;display;timeframeLength;allowedTiers;defaultResponseGranularity;dataGranularity;isRelative;fineGrainedDefaultGranularity;_startCustom;_endCustom;_allowedGranularitiesOverride;constructor(t){this.display=t.display,this.timeframeText=t.timeframeText,this.key=t.key,this.timeframeLength=t.timeframeLength,this.allowedTiers=t.allowedTiers,this.defaultResponseGranularity=t.defaultResponseGranularity,this.dataGranularity=t.dataGranularity,this.isRelative=t.isRelative,this._startCustom=t.startCustom,this._endCustom=t.endCustom,this._allowedGranularitiesOverride=t.allowedGranularitiesOverride,this.fineGrainedDefaultGranularity=t.fineGrainedDefaultGranularity}rawEnd(t){return this._endCustom||new Date}rawStart(t){return this._startCustom||new Date(this.rawEnd().getTime()-this.timeframeLengthMs())}timeframeLengthMs(){return this.timeframeLength()*1e3}maximumTimeframeLength(){return this.timeframeLength()}allowedGranularities(t){if(this._allowedGranularitiesOverride&&t)return new Set(this._allowedGranularitiesOverride);const e=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&e.add("minutely"),i>=2&&i<=168&&e.add("hourly"),i>=48&&e.add("daily"),i>=672&&e.add("weekly"),e}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const e=Hw(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Eh(e,t)}}class qw extends De{rawStart(t){let e=Jn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Tn(e,t)),e}maximumTimeframeLength(){return 3600*24*7}}class jw extends De{rawStart(t){let e=Ir(this.tzAdjustedDate(t));return t&&(e=Tn(e,t)),e}maximumTimeframeLength(){return 3600*24*31}}class Gw extends De{rawStart(t){let e=Pr(this.tzAdjustedDate(t));return t&&(e=Tn(e,t)),e}maximumTimeframeLength(){return 3600*24*92}}class Kw extends De{rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=Tn(e,t)),e}maximumTimeframeLength(){return 3600*24*366}}class Xw extends De{rawEnd(t){let e=Jn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Tn(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=Jn(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=Tn(i,t)),i}}class Zw extends De{rawEnd(t){let e=Pr(this.tzAdjustedDate(t));return t&&(e=Tn(e,t)),e}rawStart(t){let e=Pr(_h(this.tzAdjustedDate(t)));return t&&(e=Tn(e,t)),e}}class Qw extends De{rawEnd(t){let e=Ir(this.tzAdjustedDate(t));return t&&(e=Tn(e,t)),e}rawStart(t){let e=Ir(yh(this.tzAdjustedDate(t)));return t&&(e=Tn(e,t)),e}}class Jw extends De{rawEnd(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=Tn(e,t)),e}rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(e=Tn(e,t)),e}}gt.FIFTEEN_MIN,new De({key:gt.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>900,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"thirtySecondly",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely"]}),gt.ONE_HOUR,new De({key:gt.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>3600*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"minutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely"]}),gt.SIX_HOUR,new De({key:gt.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>3600*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"fiveMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),gt.TWELVE_HOUR,new De({key:gt.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>3600*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"tenMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),gt.ONE_DAY,new De({key:gt.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>3600*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"thirtyMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),gt.SEVEN_DAY,new De({key:gt.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>3600*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),gt.THIRTY_DAY,new De({key:gt.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>3600*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twelveHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),gt.NINETY_DAY,new De({key:gt.NINETY_DAY,display:"Last 90 days",timeframeText:"90 days",timeframeLength:()=>3600*24*90,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),gt.ONE_HUNDRED_EIGHTY_DAY,new De({key:gt.ONE_HUNDRED_EIGHTY_DAY,display:"Last 180 days",timeframeText:"180 days",timeframeLength:()=>3600*24*180,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),gt.ONE_YEAR,new De({key:gt.ONE_YEAR,display:"Last 365 days",timeframeText:"365 days",timeframeLength:()=>3600*24*365,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),gt.CURRENT_WEEK,new qw({key:gt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=Jn(new Date,{weekStartsOn:1});return(Rr(Jo(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),gt.CURRENT_MONTH,new jw({key:gt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=Ir(new Date);return(Rr(Jo(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),gt.CURRENT_QUARTER,new Gw({key:gt.CURRENT_QUARTER,display:"This quarter",timeframeText:"Quarter",timeframeLength:()=>{const n=Pr(new Date);return(Rr(Jo(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),gt.CURRENT_YEAR,new Kw({key:gt.CURRENT_YEAR,display:"This year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1);return(Rr(Jo(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),gt.PREVIOUS_WEEK,new Xw({key:gt.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>3600*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),gt.PREVIOUS_MONTH,new Qw({key:gt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=Ir(new Date),e=Ir(yh(new Date));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=Nh(t,e)),3600*24*fw(new Date().setMonth(new Date().getMonth()-1))+mh(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),gt.PREVIOUS_QUARTER,new Zw({key:gt.PREVIOUS_QUARTER,display:"Previous quarter",timeframeText:"Quarter",timeframeLength:()=>{const n=Pr(new Date),t=Pr(_h(new Date));return(n.getTime()-t.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),gt.PREVIOUS_YEAR,new Jw({key:gt.PREVIOUS_YEAR,display:"Previous year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1),t=new Date(new Date().getFullYear()-1,0,1);let e=0;return n.getTimezoneOffset()!==t.getTimezoneOffset()&&(e=Nh(n,t)),3600*24*(365+(t.getFullYear()%4===0?1:0))+mh(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Nh(n,t){return pw(n.getTimezoneOffset()-t.getTimezoneOffset())}gt.FIFTEEN_MIN,gt.ONE_HOUR,gt.SIX_HOUR,gt.TWELVE_HOUR,gt.ONE_DAY,gt.SEVEN_DAY,gt.FIFTEEN_MIN,gt.ONE_HOUR,gt.SIX_HOUR,gt.TWELVE_HOUR,gt.ONE_DAY,gt.SEVEN_DAY,gt.THIRTY_DAY,gt.NINETY_DAY,gt.ONE_HUNDRED_EIGHTY_DAY,gt.ONE_YEAR,gt.CURRENT_WEEK,gt.CURRENT_MONTH,gt.CURRENT_QUARTER,gt.CURRENT_YEAR,gt.PREVIOUS_WEEK,gt.PREVIOUS_MONTH,gt.PREVIOUS_QUARTER,gt.PREVIOUS_YEAR;const tv=new Map(ih.map(n=>[n.code,{code:n.code,name:n.name}])),Mc=n=>tv.get(n)?.name||n,Bh=1e3,ev=1e4,Fh=1e6,zh=1e9,Uh=1e12,sa=(n,t)=>{if(t.separator===!1||n<1e3)return n.toString();const e=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(n).toString().split("").reverse().forEach((r,s)=>{s&&s%3===0&&i.push(e),i.push(r)}),i.reverse().join("")},Cs=(n,t,e)=>{const i=n/t,r=e.round?"round":"floor";if(e.decimal===!1)return Math[r](i).toString();let s;e.precision?s=i:s=i<10?Math[r](i*10)/10:Math[r](i);let a=s.toString();return typeof e.decimal=="string"&&(a=a.replace(".",e.decimal)),a};function oa(n,t={}){let e;const i=n<0;i&&(n=Math.abs(n)),t.precision&&(n=parseFloat(n.toPrecision(t.precision)));const r=t.min10k?ev:Bh;return n<r||t.precision&&t.precision>Math.log10(n)?e=sa(Cs(n,1,t),t):n<Fh?e=`${Cs(n,Bh,t)}k`:n<zh?e=`${Cs(n,Fh,t)}m`:n<Uh?e=`${sa(Cs(n,zh,t),t)}b`:e=`${sa(Cs(n,Uh,t),t)}t`,i&&(e=`-${e}`),t.capital&&(e=e.toUpperCase()),t.prefix&&(e=`${t.prefix}${e}`),t.suffix&&(e=`${e}${t.suffix}`),e}oa.addCommas=sa;const nv=typeof document<"u"&&document.documentElement?.lang||"en-US",aa=new Intl.NumberFormat(nv);function er({i18n:n}){const t=(i,r)=>{if(isNaN(i))return"0 B";const s=r?Math.pow(2,50):1e15,a=r?Math.pow(2,40):1e12,l=r?Math.pow(2,30):1e9,u=r?Math.pow(2,20):1e6,d=r?Math.pow(2,10):1e3;let h;return i>=s?h=n.formatNumber(Number.parseFloat((i/s).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):i>=a?h=n.formatNumber(Number.parseFloat((i/a).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):i>=l?h=n.formatNumber(Number.parseFloat((i/l).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):i>=u?h=n.formatNumber(Number.parseFloat((i/u).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):i>=d?h=n.formatNumber(Number.parseFloat((i/d).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):h=n.formatNumber(Number.parseFloat(i.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),h.replace(/([a-zA-Z]*)$/," $1")},e=(i,r="USD")=>isNaN(i)?r==="USD"?"$0.00":`${i}`:i>=.01||r!=="USD"?n.formatNumber(i,{style:"currency",currency:r}):i<1e-4?"< $0.0001":`$${Number.parseFloat(i.toPrecision(4))}`;return{formatUnit:(i,r,{isBytes1024:s=!1,currency:a="USD",approximate:l=!1,translateUnit:u=d=>d}={})=>{const d=u(r,i);switch(r){case"bytes":return t(i,s);case"usd":return e(i,a);default:return isNaN(i)?`${i}`:l?`${oa(i,{capital:!0})} ${d}`:i>=.01?`${aa.format(Number.parseFloat(i.toFixed(2)))} ${d}`:`${Number.parseFloat(i.toPrecision(4))} ${d}`}},formatBytes:t,formatCost:e,formatRange:(i,r,s,{isBytes1024:a=!1,currency:l="USD",approximate:u=!1,translateUnit:d=h=>h}={})=>{const h=d(s,r);switch(s){case"bytes":return`${t(i,a)} - ${t(r,a)}`;case"usd":return`${e(i,l)} - ${e(r,l)}`;default:if(isNaN(i)||isNaN(r))return`${i} - ${r}`;if(u)return`${oa(i,{capital:!0})} - ${oa(r,{capital:!0})} ${h}`}const g=i>=.01?`${aa.format(Number.parseFloat(i.toFixed(2)))}`:`${Number.parseFloat(i.toPrecision(4))}`,y=r>=.01?`${aa.format(Number.parseFloat(r.toFixed(2)))}`:`${Number.parseFloat(r.toPrecision(4))}`;return`${g} - ${y} ${h}`}}}const Hh="#d60027",Wh="#ffe5e5",iv="#f1f0ff",rv="#e0e4ea",Vh="#6c7489",sv="#afb7c5",$h="#0d0e14",ov="#d60027",av="#ad000e",kc="#6c7489",Yh="#52596e",lv="#007d60",cv="#995c00",uv="#ffc400",dv="'Inter', Roboto, Helvetica, sans-serif",Os="16px",fv="20px",hv="#bee2ff",pv="#8fc1ff",gv="#5f9aff",mv="#306fff",yv="#b5ffee",_v="#00fabe",bv="#00d6a4",xv="#00a17b",wv="#007d60",vv="#005944",Sv="#b5ffee",Tv="#00fabe",Mv="#b5ffee",kv="#00a17b",Dv="#fff296",Cv="#ffe04b",Ov="#ffc400",Av="#b37600",Rv="#995c00",Ev="#804400",Pv="#fff296",Iv="#ffe04b",Lv="#ffc2b3",Nv="#ff9877",Bv="#ff723c",Fv="#f75008",zv="#d13500",Uv="#a31f00",Hv="#ffc2b3",Wv="#ff9877",Vv="#ff723c",$v="#f75008",Yv="#d13500",qv="#a31f00",jv="#ffc2b3",Gv="#ff9877",Kv="#ff723c",Xv="#f75008",Zv="#d13500",Qv="#a31f00",Jv="#ffc2b3",t1="#ff9877",e1="#ff723c",n1="#f75008",i1="#d13500",r1="#a31f00",s1="#ffc2b3",o1="#ff9877",a1="#ff723c",l1="#f75008",c1="#d13500",u1="#ffabab",d1="#ff7272",f1="#ff3954",h1="#f50045",p1="#d60027",g1="#ad000e",m1="#ffabab",y1="#ff7272",_1="#ff3954",b1="#f50045",x1="#d60027",w1="#eefaff",v1="#ecfffb",S1="#fffce0",T1="#fff1ef",M1="#ffe5e5",k1="#5f9aff",D1="#00d6a4",C1="#ffc400",O1="#ff723c",A1="#ff3954",qh=6048e5,R1=864e5,As=6e4,Nr=36e5,E1=1e3,jh=Symbol.for("constructDateFrom");function he(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&jh in n?n[jh](t):n instanceof Date?new n.constructor(t):new Date(t)}function At(n,t){return he(t||n,n)}function la(n,t,e){const i=At(n,e?.in);return isNaN(t)?he(e?.in||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function Dc(n,t,e){const i=At(n,e?.in);if(isNaN(t))return he(n,NaN);if(!t)return i;const r=i.getDate(),s=he(n,i.getTime());s.setMonth(i.getMonth()+t+1,0);const a=s.getDate();return r>=a?s:(i.setFullYear(s.getFullYear(),s.getMonth(),r),i)}function Cc(n,t,e){return he(n,+At(n)+t)}function P1(n,t,e){return Cc(n,t*Nr)}let I1={};function nr(){return I1}function Wn(n,t){const e=nr(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=At(n,t?.in),s=r.getDay(),a=(s<i?7:0)+s-i;return r.setDate(r.getDate()-a),r.setHours(0,0,0,0),r}function Br(n,t){return Wn(n,{...t,weekStartsOn:1})}function Gh(n,t){const e=At(n,t?.in),i=e.getFullYear(),r=he(e,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=Br(r),a=he(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=Br(a);return e.getTime()>=s.getTime()?i+1:e.getTime()>=l.getTime()?i:i-1}function ca(n){const t=At(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function ir(n,...t){const e=he.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Oc(n,t){const e=At(n,t?.in);return e.setHours(0,0,0,0),e}function Kh(n,t,e){const[i,r]=ir(e?.in,n,t),s=Oc(i),a=Oc(r),l=+s-ca(s),u=+a-ca(a);return Math.round((l-u)/R1)}function L1(n,t){const e=Gh(n,t),i=he(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Br(i)}function N1(n,t,e){const i=At(n,e?.in);return i.setTime(i.getTime()+t*As),i}function B1(n,t,e){return Dc(n,t*3,e)}function F1(n,t,e){return Cc(n,t*1e3)}function z1(n,t,e){return la(n,t*7,e)}function U1(n,t,e){return Dc(n,t*12,e)}function Rs(n,t){const e=+At(n)-+At(t);return e<0?-1:e>0?1:e}function H1(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Ac(n){return!(!H1(n)&&typeof n!="number"||isNaN(+At(n)))}function W1(n,t,e){const[i,r]=ir(e?.in,n,t),s=i.getFullYear()-r.getFullYear(),a=i.getMonth()-r.getMonth();return s*12+a}function V1(n,t,e){const[i,r]=ir(e?.in,n,t);return i.getFullYear()-r.getFullYear()}function Xh(n,t,e){const[i,r]=ir(e?.in,n,t),s=Zh(i,r),a=Math.abs(Kh(i,r));i.setDate(i.getDate()-s*a);const l=+(Zh(i,r)===-s),u=s*(a-l);return u===0?0:u}function Zh(n,t){const e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function Es(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function $1(n,t,e){const[i,r]=ir(e?.in,n,t),s=(+i-+r)/Nr;return Es(e?.roundingMethod)(s)}function Rc(n,t){return+At(n)-+At(t)}function Y1(n,t,e){const i=Rc(n,t)/As;return Es(e?.roundingMethod)(i)}function Qh(n,t){const e=At(n,t?.in);return e.setHours(23,59,59,999),e}function Jh(n,t){const e=At(n,t?.in),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function q1(n,t){const e=At(n,t?.in);return+Qh(e,t)==+Jh(e,t)}function tp(n,t,e){const[i,r,s]=ir(e?.in,n,n,t),a=Rs(r,s),l=Math.abs(W1(r,s));if(l<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-a*l);let u=Rs(r,s)===-a;q1(i)&&l===1&&Rs(i,s)===1&&(u=!1);const d=a*(l-+u);return d===0?0:d}function j1(n,t,e){const i=tp(n,t,e)/3;return Es(e?.roundingMethod)(i)}function G1(n,t,e){const i=Rc(n,t)/1e3;return Es(e?.roundingMethod)(i)}function K1(n,t,e){const i=Xh(n,t,e)/7;return Es(e?.roundingMethod)(i)}function X1(n,t,e){const[i,r]=ir(e?.in,n,t),s=Rs(i,r),a=Math.abs(V1(i,r));i.setFullYear(1584),r.setFullYear(1584);const l=Rs(i,r)===-s,u=s*(a-+l);return u===0?0:u}function Z1(n,t){const e=At(n,t?.in),i=e.getMonth(),r=i-i%3;return e.setMonth(r,1),e.setHours(0,0,0,0),e}function Q1(n,t){const e=At(n,t?.in);return e.setDate(1),e.setHours(0,0,0,0),e}function J1(n,t){const e=At(n,t?.in),i=e.getFullYear();return e.setFullYear(i+1,0,0),e.setHours(23,59,59,999),e}function ep(n,t){const e=At(n,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function tS(n,t){const e=At(n,t?.in);return e.setMinutes(59,59,999),e}function eS(n,t){const e=nr(),i=e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=At(n,t?.in),s=r.getDay(),a=(s<i?-7:0)+6-(s-i);return r.setDate(r.getDate()+a),r.setHours(23,59,59,999),r}function nS(n,t){const e=At(n,t?.in);return e.setSeconds(59,999),e}function iS(n,t){const e=At(n,t?.in),i=e.getMonth(),r=i-i%3+3;return e.setMonth(r,0),e.setHours(23,59,59,999),e}function rS(n,t){const e=At(n,t?.in);return e.setMilliseconds(999),e}const sS={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},oS=(n,t,e)=>{let i;const r=sS[n];return typeof r=="string"?i=r:t===1?i=r.one:i=r.other.replace("{{count}}",t.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Ec(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const aS={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},lS={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},cS={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},uS={date:Ec({formats:aS,defaultWidth:"full"}),time:Ec({formats:lS,defaultWidth:"full"}),dateTime:Ec({formats:cS,defaultWidth:"full"})},dS={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},fS=(n,t,e,i)=>dS[n];function Ps(n){return(t,e)=>{const i=e?.context?String(e.context):"standalone";let r;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,l=e?.width?String(e.width):a;r=n.formattingValues[l]||n.formattingValues[a]}else{const a=n.defaultWidth,l=e?.width?String(e.width):n.defaultWidth;r=n.values[l]||n.values[a]}const s=n.argumentCallback?n.argumentCallback(t):t;return r[s]}}const hS={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},pS={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},gS={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},mS={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},yS={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},_S={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},bS={ordinalNumber:(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:Ps({values:hS,defaultWidth:"wide"}),quarter:Ps({values:pS,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Ps({values:gS,defaultWidth:"wide"}),day:Ps({values:mS,defaultWidth:"wide"}),dayPeriod:Ps({values:yS,defaultWidth:"wide",formattingValues:_S,defaultFormattingWidth:"wide"})};function Is(n){return(t,e={})=>{const i=e.width,r=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],s=t.match(r);if(!s)return null;const a=s[0],l=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],u=Array.isArray(l)?wS(l,g=>g.test(a)):xS(l,g=>g.test(a));let d;d=n.valueCallback?n.valueCallback(u):u,d=e.valueCallback?e.valueCallback(d):d;const h=t.slice(a.length);return{value:d,rest:h}}}function xS(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function wS(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function vS(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const r=i[0],s=t.match(n.parsePattern);if(!s)return null;let a=n.valueCallback?n.valueCallback(s[0]):s[0];a=e.valueCallback?e.valueCallback(a):a;const l=t.slice(r.length);return{value:a,rest:l}}}const SS=/^(\d+)(th|st|nd|rd)?/i,TS=/\d+/i,MS={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},kS={any:[/^b/i,/^(a|c)/i]},DS={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},CS={any:[/1/i,/2/i,/3/i,/4/i]},OS={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},AS={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},RS={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},ES={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},PS={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},IS={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},LS={ordinalNumber:vS({matchPattern:SS,parsePattern:TS,valueCallback:n=>parseInt(n,10)}),era:Is({matchPatterns:MS,defaultMatchWidth:"wide",parsePatterns:kS,defaultParseWidth:"any"}),quarter:Is({matchPatterns:DS,defaultMatchWidth:"wide",parsePatterns:CS,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Is({matchPatterns:OS,defaultMatchWidth:"wide",parsePatterns:AS,defaultParseWidth:"any"}),day:Is({matchPatterns:RS,defaultMatchWidth:"wide",parsePatterns:ES,defaultParseWidth:"any"}),dayPeriod:Is({matchPatterns:PS,defaultMatchWidth:"any",parsePatterns:IS,defaultParseWidth:"any"})},np={code:"en-US",formatDistance:oS,formatLong:uS,formatRelative:fS,localize:bS,match:LS,options:{weekStartsOn:0,firstWeekContainsDate:1}};function NS(n,t){const e=At(n,t?.in);return Kh(e,ep(e))+1}function ip(n,t){const e=At(n,t?.in),i=+Br(e)-+L1(e);return Math.round(i/qh)+1}function Pc(n,t){const e=At(n,t?.in),i=e.getFullYear(),r=nr(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=he(t?.in||n,0);a.setFullYear(i+1,0,s),a.setHours(0,0,0,0);const l=Wn(a,t),u=he(t?.in||n,0);u.setFullYear(i,0,s),u.setHours(0,0,0,0);const d=Wn(u,t);return+e>=+l?i+1:+e>=+d?i:i-1}function BS(n,t){const e=nr(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??e.firstWeekContainsDate??e.locale?.options?.firstWeekContainsDate??1,r=Pc(n,t),s=he(t?.in||n,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),Wn(s,t)}function rp(n,t){const e=At(n,t?.in),i=+Wn(e,t)-+BS(e,t);return Math.round(i/qh)+1}function Zt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const vi={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Zt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Zt(e+1,2)},d(n,t){return Zt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Zt(n.getHours()%12||12,t.length)},H(n,t){return Zt(n.getHours(),t.length)},m(n,t){return Zt(n.getMinutes(),t.length)},s(n,t){return Zt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),r=Math.trunc(i*Math.pow(10,e-3));return Zt(r,t.length)}},Fr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},sp={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),r=i>0?i:1-i;return e.ordinalNumber(r,{unit:"year"})}return vi.y(n,t)},Y:function(n,t,e,i){const r=Pc(n,i),s=r>0?r:1-r;if(t==="YY"){const a=s%100;return Zt(a,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):Zt(s,t.length)},R:function(n,t){const e=Gh(n);return Zt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Zt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Zt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Zt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return vi.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Zt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const r=rp(n,i);return t==="wo"?e.ordinalNumber(r,{unit:"week"}):Zt(r,t.length)},I:function(n,t,e){const i=ip(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Zt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):vi.d(n,t)},D:function(n,t,e){const i=NS(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Zt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const r=n.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Zt(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});case"eee":return e.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(r,{width:"short",context:"formatting"});default:return e.day(r,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const r=n.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Zt(s,t.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(r,{width:"narrow",context:"standalone"});case"cccccc":return e.day(r,{width:"short",context:"standalone"});default:return e.day(r,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),r=i===0?7:i;switch(t){case"i":return String(r);case"ii":return Zt(r,t.length);case"io":return e.ordinalNumber(r,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const r=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let r;switch(i===12?r=Fr.noon:i===0?r=Fr.midnight:r=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let r;switch(i>=17?r=Fr.evening:i>=12?r=Fr.afternoon:i>=4?r=Fr.morning:r=Fr.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return vi.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):vi.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Zt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Zt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):vi.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):vi.s(n,t)},S:function(n,t){return vi.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return ap(i);case"XXXX":case"XX":return rr(i);default:return rr(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return ap(i);case"xxxx":case"xx":return rr(i);default:return rr(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+op(i,":");default:return"GMT"+rr(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+op(i,":");default:return"GMT"+rr(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Zt(i,t.length)},T:function(n,t,e){return Zt(+n,t.length)}};function op(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Math.trunc(i/60),s=i%60;return s===0?e+String(r):e+String(r)+t+Zt(s,2)}function ap(n,t){return n%60===0?(n>0?"-":"+")+Zt(Math.abs(n)/60,2):rr(n,t)}function rr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Zt(Math.trunc(i/60),2),s=Zt(i%60,2);return e+r+t+s}const lp=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},cp=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},Ic={p:cp,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],r=e[2];if(!r)return lp(n,t);let s;switch(i){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",lp(i,t)).replace("{{time}}",cp(r,t))}},FS=/^D+$/,zS=/^Y+$/,US=["D","DD","YY","YYYY"];function up(n){return FS.test(n)}function dp(n){return zS.test(n)}function Lc(n,t,e){const i=HS(n,t,e);if(console.warn(i),US.includes(n))throw new RangeError(i)}function HS(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const WS=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,VS=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,$S=/^'([^]*?)'?$/,YS=/''/g,qS=/[a-zA-Z]/;function ua(n,t,e){const i=nr(),r=e?.locale??i.locale??np,s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,l=At(n,e?.in);if(!Ac(l))throw new RangeError("Invalid time value");let u=t.match(VS).map(h=>{const g=h[0];if(g==="p"||g==="P"){const y=Ic[g];return y(h,r.formatLong)}return h}).join("").match(WS).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const g=h[0];if(g==="'")return{isToken:!1,value:jS(h)};if(sp[g])return{isToken:!0,value:h};if(g.match(qS))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:h}});r.localize.preprocessor&&(u=r.localize.preprocessor(l,u));const d={firstWeekContainsDate:s,weekStartsOn:a,locale:r};return u.map(h=>{if(!h.isToken)return h.value;const g=h.value;(!e?.useAdditionalWeekYearTokens&&dp(g)||!e?.useAdditionalDayOfYearTokens&&up(g))&&Lc(g,t,String(n));const y=sp[g[0]];return y(l,g,r.localize,d)}).join("")}function jS(n){const t=n.match($S);return t?t[1].replace(YS,"'"):n}function fp(){return Object.assign({},nr())}function GS(n,t){const e=At(n,t?.in).getDay();return e===0?7:e}function KS(n,t){const e=XS(t)?new t(0):he(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function XS(n){return typeof n=="function"&&n.prototype?.constructor===n}const ZS=10;class hp{subPriority=0;validate(t,e){return!0}}class QS extends hp{constructor(t,e,i,r,s){super(),this.value=t,this.validateValue=e,this.setValue=i,this.priority=r,s&&(this.subPriority=s)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,i){return this.setValue(t,e,this.value,i)}}class JS extends hp{priority=ZS;subPriority=-1;constructor(t,e){super(),this.context=t||(i=>he(e,i))}set(t,e){return e.timestampIsSet?t:he(t,KS(t,this.context))}}class Wt{run(t,e,i,r){const s=this.parse(t,e,i,r);return s?{setter:new QS(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(t,e,i){return!0}}class tT extends Wt{priority=140;parse(t,e,i){switch(e){case"G":case"GG":case"GGG":return i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"});case"GGGGG":return i.era(t,{width:"narrow"});default:return i.era(t,{width:"wide"})||i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"})}}set(t,e,i){return e.era=i,t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]}const me={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Vn={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function ye(n,t){return n&&{value:t(n.value),rest:n.rest}}function de(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function $n(n,t){const e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};const i=e[1]==="+"?1:-1,r=e[2]?parseInt(e[2],10):0,s=e[3]?parseInt(e[3],10):0,a=e[5]?parseInt(e[5],10):0;return{value:i*(r*Nr+s*As+a*E1),rest:t.slice(e[0].length)}}function pp(n){return de(me.anyDigitsSigned,n)}function pe(n,t){switch(n){case 1:return de(me.singleDigit,t);case 2:return de(me.twoDigits,t);case 3:return de(me.threeDigits,t);case 4:return de(me.fourDigits,t);default:return de(new RegExp("^\\d{1,"+n+"}"),t)}}function da(n,t){switch(n){case 1:return de(me.singleDigitSigned,t);case 2:return de(me.twoDigitsSigned,t);case 3:return de(me.threeDigitsSigned,t);case 4:return de(me.fourDigitsSigned,t);default:return de(new RegExp("^-?\\d{1,"+n+"}"),t)}}function Nc(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function gp(n,t){const e=t>0,i=e?t:1-t;let r;if(i<=50)r=n||100;else{const s=i+50,a=Math.trunc(s/100)*100,l=n>=s%100;r=n+a-(l?100:0)}return e?r:1-r}function mp(n){return n%400===0||n%4===0&&n%100!==0}class eT extends Wt{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,i){const r=s=>({year:s,isTwoDigitYear:e==="yy"});switch(e){case"y":return ye(pe(4,t),r);case"yo":return ye(i.ordinalNumber(t,{unit:"year"}),r);default:return ye(pe(e.length,t),r)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,i){const r=t.getFullYear();if(i.isTwoDigitYear){const a=gp(i.year,r);return t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}const s=!("era"in e)||e.era===1?i.year:1-i.year;return t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}}class nT extends Wt{priority=130;parse(t,e,i){const r=s=>({year:s,isTwoDigitYear:e==="YY"});switch(e){case"Y":return ye(pe(4,t),r);case"Yo":return ye(i.ordinalNumber(t,{unit:"year"}),r);default:return ye(pe(e.length,t),r)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,i,r){const s=Pc(t,r);if(i.isTwoDigitYear){const l=gp(i.year,s);return t.setFullYear(l,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),Wn(t,r)}const a=!("era"in e)||e.era===1?i.year:1-i.year;return t.setFullYear(a,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),Wn(t,r)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class iT extends Wt{priority=130;parse(t,e){return da(e==="R"?4:e.length,t)}set(t,e,i){const r=he(t,0);return r.setFullYear(i,0,4),r.setHours(0,0,0,0),Br(r)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class rT extends Wt{priority=130;parse(t,e){return da(e==="u"?4:e.length,t)}set(t,e,i){return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class sT extends Wt{priority=120;parse(t,e,i){switch(e){case"Q":case"QQ":return pe(e.length,t);case"Qo":return i.ordinalNumber(t,{unit:"quarter"});case"QQQ":return i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return i.quarter(t,{width:"narrow",context:"formatting"});default:return i.quarter(t,{width:"wide",context:"formatting"})||i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=1&&e<=4}set(t,e,i){return t.setMonth((i-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class oT extends Wt{priority=120;parse(t,e,i){switch(e){case"q":case"qq":return pe(e.length,t);case"qo":return i.ordinalNumber(t,{unit:"quarter"});case"qqq":return i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return i.quarter(t,{width:"narrow",context:"standalone"});default:return i.quarter(t,{width:"wide",context:"standalone"})||i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=1&&e<=4}set(t,e,i){return t.setMonth((i-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class aT extends Wt{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,i){const r=s=>s-1;switch(e){case"M":return ye(de(me.month,t),r);case"MM":return ye(pe(2,t),r);case"Mo":return ye(i.ordinalNumber(t,{unit:"month"}),r);case"MMM":return i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return i.month(t,{width:"narrow",context:"formatting"});default:return i.month(t,{width:"wide",context:"formatting"})||i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=11}set(t,e,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}}class lT extends Wt{priority=110;parse(t,e,i){const r=s=>s-1;switch(e){case"L":return ye(de(me.month,t),r);case"LL":return ye(pe(2,t),r);case"Lo":return ye(i.ordinalNumber(t,{unit:"month"}),r);case"LLL":return i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return i.month(t,{width:"narrow",context:"standalone"});default:return i.month(t,{width:"wide",context:"standalone"})||i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=11}set(t,e,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function cT(n,t,e){const i=At(n,e?.in),r=rp(i,e)-t;return i.setDate(i.getDate()-r*7),At(i,e?.in)}class uT extends Wt{priority=100;parse(t,e,i){switch(e){case"w":return de(me.week,t);case"wo":return i.ordinalNumber(t,{unit:"week"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,i,r){return Wn(cT(t,i,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function dT(n,t,e){const i=At(n,e?.in),r=ip(i,e)-t;return i.setDate(i.getDate()-r*7),i}class fT extends Wt{priority=100;parse(t,e,i){switch(e){case"I":return de(me.week,t);case"Io":return i.ordinalNumber(t,{unit:"week"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,i){return Br(dT(t,i))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const hT=[31,28,31,30,31,30,31,31,30,31,30,31],pT=[31,29,31,30,31,30,31,31,30,31,30,31];class gT extends Wt{priority=90;subPriority=1;parse(t,e,i){switch(e){case"d":return de(me.date,t);case"do":return i.ordinalNumber(t,{unit:"date"});default:return pe(e.length,t)}}validate(t,e){const i=t.getFullYear(),r=mp(i),s=t.getMonth();return r?e>=1&&e<=pT[s]:e>=1&&e<=hT[s]}set(t,e,i){return t.setDate(i),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class mT extends Wt{priority=90;subpriority=1;parse(t,e,i){switch(e){case"D":case"DD":return de(me.dayOfYear,t);case"Do":return i.ordinalNumber(t,{unit:"date"});default:return pe(e.length,t)}}validate(t,e){const i=t.getFullYear();return mp(i)?e>=1&&e<=366:e>=1&&e<=365}set(t,e,i){return t.setMonth(0,i),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function Bc(n,t,e){const i=nr(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,s=At(n,e?.in),a=s.getDay(),u=(t%7+7)%7,d=7-r,h=t<0||t>6?t-(a+d)%7:(u+d)%7-(a+d)%7;return la(s,h,e)}class yT extends Wt{priority=90;parse(t,e,i){switch(e){case"E":case"EE":case"EEE":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return i.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,i,r){return t=Bc(t,i,r),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class _T extends Wt{priority=90;parse(t,e,i,r){const s=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(e){case"e":case"ee":return ye(pe(e.length,t),s);case"eo":return ye(i.ordinalNumber(t,{unit:"day"}),s);case"eee":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"eeeee":return i.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,i,r){return t=Bc(t,i,r),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class bT extends Wt{priority=90;parse(t,e,i,r){const s=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(e){case"c":case"cc":return ye(pe(e.length,t),s);case"co":return ye(i.ordinalNumber(t,{unit:"day"}),s);case"ccc":return i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});case"ccccc":return i.day(t,{width:"narrow",context:"standalone"});case"cccccc":return i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});default:return i.day(t,{width:"wide",context:"standalone"})||i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=6}set(t,e,i,r){return t=Bc(t,i,r),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function xT(n,t,e){const i=At(n,e?.in),r=GS(i,e),s=t-r;return la(i,s,e)}class wT extends Wt{priority=90;parse(t,e,i){const r=s=>s===0?7:s;switch(e){case"i":case"ii":return pe(e.length,t);case"io":return i.ordinalNumber(t,{unit:"day"});case"iii":return ye(i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),r);case"iiiii":return ye(i.day(t,{width:"narrow",context:"formatting"}),r);case"iiiiii":return ye(i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),r);default:return ye(i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),r)}}validate(t,e){return e>=1&&e<=7}set(t,e,i){return t=xT(t,i),t.setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class vT extends Wt{priority=80;parse(t,e,i){switch(e){case"a":case"aa":case"aaa":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,i){return t.setHours(Nc(i),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class ST extends Wt{priority=80;parse(t,e,i){switch(e){case"b":case"bb":case"bbb":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,i){return t.setHours(Nc(i),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class TT extends Wt{priority=80;parse(t,e,i){switch(e){case"B":case"BB":case"BBB":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,i){return t.setHours(Nc(i),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class MT extends Wt{priority=70;parse(t,e,i){switch(e){case"h":return de(me.hour12h,t);case"ho":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,i){const r=t.getHours()>=12;return r&&i<12?t.setHours(i+12,0,0,0):!r&&i===12?t.setHours(0,0,0,0):t.setHours(i,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]}class kT extends Wt{priority=70;parse(t,e,i){switch(e){case"H":return de(me.hour23h,t);case"Ho":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,i){return t.setHours(i,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]}class DT extends Wt{priority=70;parse(t,e,i){switch(e){case"K":return de(me.hour11h,t);case"Ko":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,i){return t.getHours()>=12&&i<12?t.setHours(i+12,0,0,0):t.setHours(i,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]}class CT extends Wt{priority=70;parse(t,e,i){switch(e){case"k":return de(me.hour24h,t);case"ko":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,i){const r=i<=24?i%24:i;return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]}class OT extends Wt{priority=60;parse(t,e,i){switch(e){case"m":return de(me.minute,t);case"mo":return i.ordinalNumber(t,{unit:"minute"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,i){return t.setMinutes(i,0,0),t}incompatibleTokens=["t","T"]}class AT extends Wt{priority=50;parse(t,e,i){switch(e){case"s":return de(me.second,t);case"so":return i.ordinalNumber(t,{unit:"second"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,i){return t.setSeconds(i,0),t}incompatibleTokens=["t","T"]}class RT extends Wt{priority=30;parse(t,e){const i=r=>Math.trunc(r*Math.pow(10,-e.length+3));return ye(pe(e.length,t),i)}set(t,e,i){return t.setMilliseconds(i),t}incompatibleTokens=["t","T"]}class ET extends Wt{priority=10;parse(t,e){switch(e){case"X":return $n(Vn.basicOptionalMinutes,t);case"XX":return $n(Vn.basic,t);case"XXXX":return $n(Vn.basicOptionalSeconds,t);case"XXXXX":return $n(Vn.extendedOptionalSeconds,t);default:return $n(Vn.extended,t)}}set(t,e,i){return e.timestampIsSet?t:he(t,t.getTime()-ca(t)-i)}incompatibleTokens=["t","T","x"]}class PT extends Wt{priority=10;parse(t,e){switch(e){case"x":return $n(Vn.basicOptionalMinutes,t);case"xx":return $n(Vn.basic,t);case"xxxx":return $n(Vn.basicOptionalSeconds,t);case"xxxxx":return $n(Vn.extendedOptionalSeconds,t);default:return $n(Vn.extended,t)}}set(t,e,i){return e.timestampIsSet?t:he(t,t.getTime()-ca(t)-i)}incompatibleTokens=["t","T","X"]}class IT extends Wt{priority=40;parse(t){return pp(t)}set(t,e,i){return[he(t,i*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class LT extends Wt{priority=20;parse(t){return pp(t)}set(t,e,i){return[he(t,i),{timestampIsSet:!0}]}incompatibleTokens="*"}const NT={G:new tT,y:new eT,Y:new nT,R:new iT,u:new rT,Q:new sT,q:new oT,M:new aT,L:new lT,w:new uT,I:new fT,d:new gT,D:new mT,E:new yT,e:new _T,c:new bT,i:new wT,a:new vT,b:new ST,B:new TT,h:new MT,H:new kT,K:new DT,k:new CT,m:new OT,s:new AT,S:new RT,X:new ET,x:new PT,t:new IT,T:new LT},BT=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,FT=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,zT=/^'([^]*?)'?$/,UT=/''/g,HT=/\S/,WT=/[a-zA-Z]/;function VT(n,t,e,i){const r=()=>he(i?.in||e,NaN),s=fp(),a=i?.locale??s.locale??np,l=i?.firstWeekContainsDate??i?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,u=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0;if(!t)return n?r():At(e,i?.in);const d={firstWeekContainsDate:l,weekStartsOn:u,locale:a},h=[new JS(i?.in,e)],g=t.match(FT).map(M=>{const C=M[0];if(C in Ic){const R=Ic[C];return R(M,a.formatLong)}return M}).join("").match(BT),y=[];for(let M of g){!i?.useAdditionalWeekYearTokens&&dp(M)&&Lc(M,t,n),!i?.useAdditionalDayOfYearTokens&&up(M)&&Lc(M,t,n);const C=M[0],R=NT[C];if(R){const{incompatibleTokens:F}=R;if(Array.isArray(F)){const L=y.find(N=>F.includes(N.token)||N.token===C);if(L)throw new RangeError(`The format string mustn't contain \`${L.fullToken}\` and \`${M}\` at the same time`)}else if(R.incompatibleTokens==="*"&&y.length>0)throw new RangeError(`The format string mustn't contain \`${M}\` and any other token at the same time`);y.push({token:C,fullToken:M});const I=R.run(n,M,a.match,d);if(!I)return r();h.push(I.setter),n=I.rest}else{if(C.match(WT))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");if(M==="''"?M="'":C==="'"&&(M=$T(M)),n.indexOf(M)===0)n=n.slice(M.length);else return r()}}if(n.length>0&&HT.test(n))return r();const _=h.map(M=>M.priority).sort((M,C)=>C-M).filter((M,C,R)=>R.indexOf(M)===C).map(M=>h.filter(C=>C.priority===M).sort((C,R)=>R.subPriority-C.subPriority)).map(M=>M[0]);let x=At(e,i?.in);if(isNaN(+x))return r();const v={};for(const M of _){if(!M.validate(x,d))return r();const C=M.set(x,v,d);Array.isArray(C)?(x=C[0],Object.assign(v,C[1])):x=C}return x}function $T(n){return n.match(zT)[1].replace(UT,"'")}function YT(n,t){const e=At(n,t?.in);return e.setMinutes(0,0,0),e}function qT(n,t){const e=At(n,t?.in);return e.setSeconds(0,0),e}function jT(n,t){const e=At(n,t?.in);return e.setMilliseconds(0),e}function yp(n){const t=n/Nr;return Math.trunc(t)}function _p(n,t){const e=()=>he(t?.in,NaN),i=t?.additionalDigits??2,r=ZT(n);let s;if(r.date){const d=QT(r.date,i);s=JT(d.restDateString,d.year)}if(!s||isNaN(+s))return e();const a=+s;let l=0,u;if(r.time&&(l=tM(r.time),isNaN(l)))return e();if(r.timezone){if(u=eM(r.timezone),isNaN(u))return e()}else{const d=new Date(a+l),h=At(0,t?.in);return h.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),h.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),h}return At(a+l+u,t?.in)}const fa={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},GT=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,KT=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,XT=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ZT(n){const t={},e=n.split(fa.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],fa.timeZoneDelimiter.test(t.date)&&(t.date=n.split(fa.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const r=fa.timezone.exec(i);r?(t.time=i.replace(r[1],""),t.timezone=r[1]):t.time=i}return t}function QT(n,t){const e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};const r=i[1]?parseInt(i[1]):null,s=i[2]?parseInt(i[2]):null;return{year:s===null?r:s*100,restDateString:n.slice((i[1]||i[2]).length)}}function JT(n,t){if(t===null)return new Date(NaN);const e=n.match(GT);if(!e)return new Date(NaN);const i=!!e[4],r=Ls(e[1]),s=Ls(e[2])-1,a=Ls(e[3]),l=Ls(e[4]),u=Ls(e[5])-1;if(i)return oM(t,l,u)?nM(t,l,u):new Date(NaN);{const d=new Date(0);return!rM(t,s,a)||!sM(t,r)?new Date(NaN):(d.setUTCFullYear(t,s,Math.max(r,a)),d)}}function Ls(n){return n?parseInt(n):1}function tM(n){const t=n.match(KT);if(!t)return NaN;const e=Fc(t[1]),i=Fc(t[2]),r=Fc(t[3]);return aM(e,i,r)?e*Nr+i*As+r*1e3:NaN}function Fc(n){return n&&parseFloat(n.replace(",","."))||0}function eM(n){if(n==="Z")return 0;const t=n.match(XT);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return lM(i,r)?e*(i*Nr+r*As):NaN}function nM(n,t,e){const i=new Date(0);i.setUTCFullYear(n,0,4);const r=i.getUTCDay()||7,s=(t-1)*7+e+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const iM=[31,null,31,30,31,30,31,31,30,31,30,31];function bp(n){return n%400===0||n%4===0&&n%100!==0}function rM(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(iM[t]||(bp(n)?29:28))}function sM(n,t){return t>=1&&t<=(bp(n)?366:365)}function oM(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function aM(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function lM(n,t){return t>=0&&t<=59}const cM={noDataAvailableTitle:"No data in the current time frame",noDataAvailableDescription:"Once there is traffic, it will display here",limitedResultsShown:"Grouped value limit exceeded, showing the top {maxReturned}",entityNoName:"no-name",debug:"debug",total:"Total",jumpToExplore:"Open in explorer",more_actions:"More actions",emptyEntityInfo:"Requests that do not have a value for the selected group",scatter:{median:"Median",percentile:"p{value}",outlier:"Outlier (> {label})",outlierTooltip:"{series} (outlier > {label})"},chartUnits:{ms:"ms",bytes:"Byte{plural}",count:"request{plural}","count/minute":"rpm",requests:"request{plural}","token count":"token{plural}","tokens/minute":"tpm","%":"%","ops/minute":"ops/minute"},csvExport:{dataError:"Error loading data",noDataRange:"No data in selected range",noDataRetry:"Please adjust the time period and try again",timeRangeSelected:"selected",exportPreview:"Export preview",exportAsCsv:"Export as CSV",exportTimeRange:"Time range",exportDescription:"Exports a CSV of the data represented in the chart.",maximumRecordAmount:"The number of groups is limited to {value}",previewRows:"Previewing {rowsMax} of {rowsTotal} row{plural}",downloadButton:"Export",cancelButton:"Cancel",UtcOffset:"UTC offset",Timestamp:"Timestamp"},query_errors:{forbidden:{message:"Data request forbidden",details:"To access this data, either filter for an entity you have access to or request analytics viewer access from your administrator."},time_range_exceeded:{message:"Time range exceeded",details:"The time range for this report is outside of your organization's data retention period"},timeout:{message:"Data request timed out",details:"We're sorry, the request timed out. Please consider using a shorter time period or try again later."},canceled:{message:"Request canceled"},other:{message:"Bad request"}},legend:{datapointValueDisplay:"{value} {unit}"},chartLabels:{ai_count:"LLM request count",latencies_response_ms:"Response latency",latencies_upstream_ms:"Upstream latency",latencies_kong_gateway_ms:"Kong latency",latencies_kong_internal_ms:"Kong internal latency",request_body_size:"Request size",response_body_size:"Response size",response_header_content_length:"Content length",ai:{cost:"Cost",costCaching:"Caching cost",promptTokens:"Prompt tokens",completionTokens:"Completion tokens",totalTokens:"Total tokens",llmLatency:"LLM latency",fetchLatency:"Fetch latency",embeddingsLatency:"Embeddings latency"},mcp:{latency:"MCP latency",response_body_size:"MCP response size"},a2a:{latency:"A2A latency",response_body_size:"A2A response size"},ai_gateway:"AI gateway",ai_gateway_agent:"AI gateway agent",ai_gateway_consumer:"AI gateway consumer",ai_gateway_data_plane_node:"AI gateway data plane node",ai_gateway_mcp_server:"AI gateway MCP server",ai_gateway_model:"AI gateway model",ai_plugin:"AI plugin",ai_provider:"Provider",ai_request_model:"Request model",ai_response_model:"Response model",error_rate:"Error rate",request_count:"Request count",request_per_minute:"Requests per minute",requests_per_minute:"Requests per minute",response_latency_average:"Response latency (avg)",response_latency_p99:"Response latency (p99)",response_latency_p95:"Response latency (p95)",response_latency_p50:"Response latency (p50)",kong_latency_average:"Kong latency (avg)",kong_latency_p99:"Kong latency (p99)",kong_latency_p95:"Kong latency (p95)",kong_latency_p50:"Kong latency (p50)",kong_internal_latency_average:"Kong internal latency (avg)",kong_internal_latency_p99:"Kong internal latency (p99)",kong_internal_latency_p95:"Kong internal latency (p95)",kong_internal_latency_p50:"Kong internal latency (p50)",llm_cache_status:"Cache status",llm_embeddings_model:"Embeddings model",llm_embeddings_provider:"Embeddings provider",upstream_latency_average:"Upstream latency (avg)",upstream_latency_p99:"Upstream latency (p99)",upstream_latency_p95:"Upstream latency (p95)",upstream_latency_p50:"Upstream latency (p50)",response_size_p99:"Response size (p99)",response_size_p95:"Response size (p95)",response_size_p50:"Response size (p50)",response_size_average:"Response size (avg)",response_size_sum:"Response size (sum)",response_source:"Response source",request_size_p99:"Request size (p99)",request_size_p95:"Request size (p95)",request_size_p50:"Request size (p50)",request_size_average:"Request size (avg)",request_size_sum:"Request size (sum)",control_plane:"Control plane",control_plane_group:"Control plane group",consumer:"Consumer",oidc_credential:"OIDC credential",country_code:"Country",country:"Country",data_plane_node:"Data plane node",data_plane_node_version:"Data plane node version",api_package:"API package",api_product:"API product",api_product_version:"API product version",portal:"Portal",realm:"Realm",runtime_group:"Runtime group",gateway_service:"Gateway service",route:"Route",application:"Application",status_code:"Status code",status_code_grouped:"Status code (grouped)",total_tokens_per_minute:"Total tokens per minute",upstream_status_code:"Upstream status code",upstream_status_code_grouped:"Upstream status code group",time:"Time",Service:"Service",ServiceVersion:"Service version",Route:"Route",Application:"Application",RuntimeGroup:"Runtime group",GatewayService:"Gateway service",StatusCode:"Status code",CodeClass:"Status code (grouped)",Time:"Time",API_PRODUCT:"Api product",API_PRODUCT_VERSION:"Api product version",RUNTIME_GROUP:"Runtime group",GATEWAY_SERVICE:"Gateway service",ROUTE:"Route",APPLICATION:"Application",STATUS_CODE:"Status code",STATUS_CODE_GROUPED:"Status code (grouped)",TIME:"Time",ORGANIZATION:"Organization",TotalRequests:"Request count",RequestsPerMinute:"Requests per minute",LatencyP99:"Response latency (p99)",LatencyP95:"Response latency (p95)",LatencyP50:"Response latency (p50)",LatencyAverage:"Response latency (avg)",UpstreamLatencyP99:"Upstream latency (p99)",UpstreamLatencyP95:"Upstream latency (p95)",UpstreamLatencyP50:"Upstream latency (p50)",UpstreamLatencyAverage:"Upstream latency (avg)",KongLatencyP99:"Kong latency (p99)",KongLatencyP95:"Kong latency (p95)",KongLatencyP50:"Kong latency (p50)",KongLatencyAverage:"Kong latency (avg)",ResponseSizeP99:"Response size (p99)",ResponseSizeP95:"Response size (p95)",ResponseSizeP50:"Response size (p50)",RequestSizeP99:"Request size (p99)",RequestSizeP95:"Request size (p95)",RequestSizeP50:"Request size (p50)",SuccessfulRequests:"Successful requests",SUCCESS:"Successful requests",FailedRequests:"Failed requests",FAILURE:"Failed requests","5XX":"5xx","4XX":"4xx","3XX":"3xx","2XX":"2xx","1XX":"1xx",REQUEST_COUNT:"Request count",REQUEST_PER_MINUTE:"Requests per minute",RESPONSE_LATENCY_P99:"Response latency",RESPONSE_LATENCY_P95:"Response latency",RESPONSE_LATENCY_P50:"Response latency",RESPONSE_SIZE_P99:"Response size (p99)",RESPONSE_SIZE_P95:"Response size (p95)",RESPONSE_SIZE_P50:"Response size (p50)",REQUEST_SIZE_P99:"Request size (p99)",REQUEST_SIZE_P95:"Request size (p95)",REQUEST_SIZE_P50:"Request size (p50)",CONTROL_PLANE:"Control plane",____OTHER____:"Others",ai_request_count:"Request count",total_tokens:"Total token count",prompt_tokens:"Prompt token count",completion_tokens:"Completion token count",cost:"Costs",llm_cache_embeddings_latency_average:"Embeddings latency (avg)",llm_cache_fetch_latency_average:"Fetch latency (avg)",llm_latency_average:"Llm latency (avg)","threshold-warning":"Warning threshold: {value}","threshold-error":"Error threshold: {value}","thatreshold-neutral":"Alert threshold: {value}",api:"API",vulnerability_count:"Vulnerability count",a2a_latency_average:"A2A latency (avg)",a2a_response_size_sum:"A2A response size (sum)",a2a_context_id:"A2A context ID",a2a_error:"A2A error",a2a_method:"A2A method",a2a_task_id:"A2A task ID",mcp_error:"MCP error",mcp_method:"MCP method",mcp_latency_average:"MCP latency (avg)",mcp_latency_p99:"MCP latency (p99)",mcp_latency_p95:"MCP latency (p95)",mcp_latency_p50:"MCP latency (p50)",mcp_response_size_sum:"MCP response size (sum)",mcp_session_id:"MCP session ID",mcp_tool_name:"MCP tool name",mcp_response_body_size_sum:"MCP response size (sum)",control_plane_count:"Control plane count",service_count:"Gateway service count","record_bytes:sum":"Record size (sum)","record_count:sum":"Record count (sum)","request_count:sum":"Request count (sum)",route_count:"Route count",consumer_count:"Consumer count",plugin_count:"Plugin count",node_count:"Data plane node count",principal:"Principal",virtual_cluster_id:"Virtual cluster",backend_cluster_id:"Backend cluster",listener_id:"Listener",principal_name:"Principal name",principal_type:"Principal type",request_type:"Request type",topic_name:"Topic name",partition_index:"Partition index",api_key:"API key",data_plane_group:"Data plane group",managed_cache:"Managed cache",network:"Network",provider:"Provider",provider_region:"Provider region",region:"Region",cache_eviction_rate:"Cache eviction rate",cache_expiration_rate:"Cache expiration rate",cache_items_average:"Cache items (avg)",cache_memory_utilization_max:"Cache memory utilization (max)",cache_status:"Cache status",cache_hit_rate:"Cache hit rate",time_to_first_token_average:"Time to first token (avg)",time_to_first_token_p99:"Time to first token (p99)",time_to_first_token_p95:"Time to first token (p95)",time_to_first_token_p50:"Time to first token (p50)",time_per_token_average:"Time per token (avg)",time_per_token_p99:"Time per token (p99)",time_per_token_p95:"Time per token (p95)",time_per_token_p50:"Time per token (p50)"},metricAxisTitles:{cache_hit_rate:"Cache hit rate {unit}",error_rate:"Error rate in {unit}",request_count:"Request count",request_per_minute:"Requests per minute",requests_per_minute:"Requests per minute",latency_in:"Latency in {unit}",size_in:"Size in {unit}",response_latency_average:"Response latency (avg) in {unit}",response_latency_p99:"Response latency (p99) in {unit}",response_latency_p95:"Response latency (p95) in {unit}",response_latency_p50:"Response latency (p50) in {unit}",upstream_latency_p99:"Upstream latency (p99) in {unit}",upstream_latency_p95:"Upstream latency (p95) in {unit}",upstream_latency_p50:"Upstream latency (p50) in {unit}",kong_latency_p99:"Kong latency (p99) in {unit}",kong_latency_p95:"Kong latency (p95) in {unit}",kong_latency_p50:"Kong latency (p50) in {unit}",kong_internal_latency_average:"Kong internal latency (avg) in {unit}",kong_internal_latency_p99:"Kong internal latency (p99) in {unit}",kong_internal_latency_p95:"Kong internal latency (p95) in {unit}",kong_internal_latency_p50:"Kong internal latency (p50) in {unit}",response_size_p99:"Response size (p99) in {unit}",response_size_p95:"Response size (p95) in {unit}",response_size_p50:"Response size (p50) in {unit}",request_size_p99:"Request size (p99) in {unit}",request_size_p95:"Request size (p95) in {unit}",request_size_p50:"Request size (p50) in {unit}",request_size_sum:"Request size (sum) in {unit}",REQUEST_COUNT:"Request count",REQUEST_PER_MINUTE:"Requests per minute",RESPONSE_LATENCY_P99:"Response latency (p99) in {unit}",RESPONSE_LATENCY_P95:"Response latency (p95) in {unit}",RESPONSE_LATENCY_P50:"Response latency (p50) in {unit}",RESPONSE_SIZE_P99:"Response size (p99) in {unit}",RESPONSE_SIZE_P95:"Response size (p95) in {unit}",RESPONSE_SIZE_P50:"Response size (p50) in {unit}",REQUEST_SIZE_P99:"Request size (p99) in {unit}",REQUEST_SIZE_P95:"Request size (p95) in {unit}",REQUEST_SIZE_P50:"Request size (p50) in {unit}",TotalRequests:"Request count",RequestsPerMinute:"Requests per minute",LatencyP99:"Response latency (p99) in {unit}",LatencyP95:"Response latency (p95) in {unit}",LatencyP50:"Response latency (p50) in {unit}",LatencyAverage:"Response latency (avg) in {unit}",UpstreamLatencyP99:"Upstream latency (p99) in {unit}",UpstreamLatencyP95:"Upstream latency (p95) in {unit}",UpstreamLatencyP50:"Upstream latency (p50) in {unit}",UpstreamLatencyAverage:"Upstream latency (avg) in {unit}",KongLatencyP99:"Kong latency (p99) in {unit}",KongLatencyP95:"Kong latency (p95) in {unit}",KongLatencyP50:"Kong latency (p50) in {unit}",KongLatencyAverage:"Kong latency (avg) in {unit}",ResponseSizeP99:"Response size (p99) in {unit}",ResponseSizeP95:"Response size (p95) in {unit}",ResponseSizeP50:"Response size (p50) in {unit}",RequestSizeP99:"Request size (p99) in {unit}",RequestSizeP95:"Request size (p95) in {unit}",RequestSizeP50:"Request size (p50) in {unit}",ai_request_count:"Request count",total_tokens:"Total token count",prompt_tokens:"Prompt token count",completion_tokens:"Completion token count",cost:"Costs",llm_cache_embeddings_latency_average:"Embeddings latency (avg)",llm_cache_fetch_latency_average:"Fetch latency (avg)",llm_latency_average:"Llm latency (avg)",api:"API",a2a_latency_average:"A2A latency (avg) in {unit}",a2a_response_size_sum:"A2A response size (sum) in {unit}",a2a_context_id:"A2A context ID",a2a_error:"A2A error",a2a_method:"A2A method",a2a_task_id:"A2A task ID",mcp_latency_average:"MCP latency (avg)",mcp_latency_p99:"MCP latency (p99)",mcp_latency_p95:"MCP latency (p95)",mcp_latency_p50:"MCP latency (p50)",mcp_response_size_sum:"MCP response size (sum) in {unit}",mcp_response_body_size_sum:"MCP response body size (sum) in {unit}",control_plane_count:"Control plane count",service_count:"Gateway service count",route_count:"Route count",consumer_count:"Consumer count",plugin_count:"Plugin count",node_count:"Data plane node count",cache_eviction_rate:"Cache eviction rate in {unit}",cache_expiration_rate:"Cache expiration rate in {unit}",cache_items_average:"Cache items (avg)",cache_memory_utilization_max:"Cache memory utilization (max) in {unit}",cached_tokens:"Cached tokens",time_to_first_token_average:"Time to first token (avg)",time_to_first_token_p99:"Time to first token (p99)",time_to_first_token_p95:"Time to first token (p95)",time_to_first_token_p50:"Time to first token (p50)",time_per_token_average:"Time per token (avg)",time_per_token_p99:"Time per token (p99)",time_per_token_p95:"Time per token (p95)",time_per_token_p50:"Time per token (p50)",total_tokens_per_minute:"Total tokens per minute"},granularityAxisTitles:{tenSecondly:"@timestamp per 10 seconds",thirtySecondly:"@timestamp per 30 seconds",minutely:"@timestamp per minute",fiveMinutely:"@timestamp per 5 minutes",tenMinutely:"@timestamp per 10 minutes",thirtyMinutely:"@timestamp per 30 minutes",hourly:"@timestamp per hour",twoHourly:"@timestamp per 2 hours",twelveHourly:"@timestamp per 12 hours",daily:"@timestamp per day",weekly:"@timestamp per week"},timestampAxisTitles:{platform:"@timestamp created at"},topNTable:{nameLabel:"Name",defaultEmptyStateTitle:"No data to display",defaultErrorStateTitle:"Something went wrong",errors:{meta:"Error: response must contain 'meta'",display:"Error: 'display' response incorrectly formatted (must have at least one key)",metricNames:"Error: 'metricNames' response incorrectly formatted (must have at least one entry)"}},singleValue:{valueError:"Invalid configuration",trend:{not_available:"Not available"}},new_timerange_label:"Time range",sparkline_no_data:"No data",zoom_action_items:{zoom:"Zoom in",view_requests:"View requests",cancel:"Cancel",explore:"Explore"},zoom_time_range:{from:"From",to:"To"}};function uM(){const n=Kf.createI18n("en-us",cM);return{i18n:n,i18nT:Kf.i18nTComponent(n)}}function Ns(n){return n+.5|0}const Si=(n,t,e)=>Math.max(Math.min(n,e),t);function Bs(n){return Si(Ns(n*2.55),0,255)}function Ti(n){return Si(Ns(n*255),0,255)}function ti(n){return Si(Ns(n/2.55)/100,0,1)}function xp(n){return Si(Ns(n*100),0,100)}const Mn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},zc=[..."0123456789ABCDEF"],dM=n=>zc[n&15],fM=n=>zc[(n&240)>>4]+zc[n&15],ha=n=>(n&240)>>4===(n&15),hM=n=>ha(n.r)&&ha(n.g)&&ha(n.b)&&ha(n.a);function pM(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&Mn[n[1]]*17,g:255&Mn[n[2]]*17,b:255&Mn[n[3]]*17,a:t===5?Mn[n[4]]*17:255}:(t===7||t===9)&&(e={r:Mn[n[1]]<<4|Mn[n[2]],g:Mn[n[3]]<<4|Mn[n[4]],b:Mn[n[5]]<<4|Mn[n[6]],a:t===9?Mn[n[7]]<<4|Mn[n[8]]:255})),e}const gM=(n,t)=>n<255?t(n):"";function mM(n){var t=hM(n)?dM:fM;return n?"#"+t(n.r)+t(n.g)+t(n.b)+gM(n.a,t):void 0}const yM=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function wp(n,t,e){const i=t*Math.min(e,1-e),r=(s,a=(s+n/30)%12)=>e-i*Math.max(Math.min(a-3,9-a,1),-1);return[r(0),r(8),r(4)]}function _M(n,t,e){const i=(r,s=(r+n/60)%6)=>e-e*t*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function bM(n,t,e){const i=wp(n,1,.5);let r;for(t+e>1&&(r=1/(t+e),t*=r,e*=r),r=0;r<3;r++)i[r]*=1-t-e,i[r]+=t;return i}function xM(n,t,e,i,r){return n===r?(t-e)/i+(t<e?6:0):t===r?(e-n)/i+2:(n-t)/i+4}function Uc(n){const e=n.r/255,i=n.g/255,r=n.b/255,s=Math.max(e,i,r),a=Math.min(e,i,r),l=(s+a)/2;let u,d,h;return s!==a&&(h=s-a,d=l>.5?h/(2-s-a):h/(s+a),u=xM(e,i,r,h,s),u=u*60+.5),[u|0,d||0,l]}function Hc(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(Ti)}function Wc(n,t,e){return Hc(wp,n,t,e)}function wM(n,t,e){return Hc(bM,n,t,e)}function vM(n,t,e){return Hc(_M,n,t,e)}function vp(n){return(n%360+360)%360}function SM(n){const t=yM.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?Bs(+t[5]):Ti(+t[5]));const r=vp(+t[2]),s=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=wM(r,s,a):t[1]==="hsv"?i=vM(r,s,a):i=Wc(r,s,a),{r:i[0],g:i[1],b:i[2],a:e}}function TM(n,t){var e=Uc(n);e[0]=vp(e[0]+t),e=Wc(e),n.r=e[0],n.g=e[1],n.b=e[2]}function MM(n){if(!n)return;const t=Uc(n),e=t[0],i=xp(t[1]),r=xp(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${r}%, ${ti(n.a)})`:`hsl(${e}, ${i}%, ${r}%)`}const Sp={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Tp={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function kM(){const n={},t=Object.keys(Tp),e=Object.keys(Sp);let i,r,s,a,l;for(i=0;i<t.length;i++){for(a=l=t[i],r=0;r<e.length;r++)s=e[r],l=l.replace(s,Sp[s]);s=parseInt(Tp[a],16),n[l]=[s>>16&255,s>>8&255,s&255]}return n}let pa;function DM(n){pa||(pa=kM(),pa.transparent=[0,0,0,0]);const t=pa[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const CM=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function OM(n){const t=CM.exec(n);let e=255,i,r,s;if(t){if(t[7]!==i){const a=+t[7];e=t[8]?Bs(a):Si(a*255,0,255)}return i=+t[1],r=+t[3],s=+t[5],i=255&(t[2]?Bs(i):Si(i,0,255)),r=255&(t[4]?Bs(r):Si(r,0,255)),s=255&(t[6]?Bs(s):Si(s,0,255)),{r:i,g:r,b:s,a:e}}}function AM(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${ti(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const Vc=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,zr=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function RM(n,t,e){const i=zr(ti(n.r)),r=zr(ti(n.g)),s=zr(ti(n.b));return{r:Ti(Vc(i+e*(zr(ti(t.r))-i))),g:Ti(Vc(r+e*(zr(ti(t.g))-r))),b:Ti(Vc(s+e*(zr(ti(t.b))-s))),a:n.a+e*(t.a-n.a)}}function ga(n,t,e){if(n){let i=Uc(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=Wc(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Mp(n,t){return n&&Object.assign(t||{},n)}function kp(n){var t={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(t={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(t.a=Ti(n[3]))):(t=Mp(n,{r:0,g:0,b:0,a:1}),t.a=Ti(t.a)),t}function EM(n){return n.charAt(0)==="r"?OM(n):SM(n)}class Fs{constructor(t){if(t instanceof Fs)return t;const e=typeof t;let i;e==="object"?i=kp(t):e==="string"&&(i=pM(t)||DM(t)||EM(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Mp(this._rgb);return t&&(t.a=ti(t.a)),t}set rgb(t){this._rgb=kp(t)}rgbString(){return this._valid?AM(this._rgb):void 0}hexString(){return this._valid?mM(this._rgb):void 0}hslString(){return this._valid?MM(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,r=t.rgb;let s;const a=e===s?.5:e,l=2*a-1,u=i.a-r.a,d=((l*u===-1?l:(l+u)/(1+l*u))+1)/2;s=1-d,i.r=255&d*i.r+s*r.r+.5,i.g=255&d*i.g+s*r.g+.5,i.b=255&d*i.b+s*r.b+.5,i.a=a*i.a+(1-a)*r.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=RM(this._rgb,t._rgb,e)),this}clone(){return new Fs(this.rgb)}alpha(t){return this._rgb.a=Ti(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Ns(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return ga(this._rgb,2,t),this}darken(t){return ga(this._rgb,2,-t),this}saturate(t){return ga(this._rgb,1,t),this}desaturate(t){return ga(this._rgb,1,-t),this}rotate(t){return TM(this._rgb,t),this}}function ei(){}const PM=(()=>{let n=0;return()=>n++})();function xt(n){return n==null}function Yt(n){if(Array.isArray&&Array.isArray(n))return!0;const t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Pt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function ae(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function pn(n,t){return ae(n)?n:t}function Mt(n,t){return typeof n>"u"?t:n}const IM=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,Dp=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function Qt(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function Jt(n,t,e,i){let r,s,a;if(Yt(n))for(s=n.length,r=0;r<s;r++)t.call(e,n[r],r);else if(Pt(n))for(a=Object.keys(n),s=a.length,r=0;r<s;r++)t.call(e,n[a[r]],a[r])}function ma(n,t){let e,i,r,s;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(r=n[e],s=t[e],r.datasetIndex!==s.datasetIndex||r.index!==s.index)return!1;return!0}function ya(n){if(Yt(n))return n.map(ya);if(Pt(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let r=0;for(;r<i;++r)t[e[r]]=ya(n[e[r]]);return t}return n}function Cp(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function LM(n,t,e,i){if(!Cp(n))return;const r=t[n],s=e[n];Pt(r)&&Pt(s)?zs(r,s,i):t[n]=ya(s)}function zs(n,t,e){const i=Yt(t)?t:[t],r=i.length;if(!Pt(n))return n;e=e||{};const s=e.merger||LM;let a;for(let l=0;l<r;++l){if(a=i[l],!Pt(a))continue;const u=Object.keys(a);for(let d=0,h=u.length;d<h;++d)s(u[d],n,a,e)}return n}function Us(n,t){return zs(n,t,{merger:NM})}function NM(n,t,e){if(!Cp(n))return;const i=t[n],r=e[n];Pt(i)&&Pt(r)?Us(i,r):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=ya(r))}const Op={"":n=>n,x:n=>n.x,y:n=>n.y};function BM(n){const t=n.split("."),e=[];let i="";for(const r of t)i+=r,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function FM(n){const t=BM(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function Mi(n,t){return(Op[t]||(Op[t]=FM(t)))(n)}function $c(n){return n.charAt(0).toUpperCase()+n.slice(1)}const en=n=>typeof n<"u",nn=n=>typeof n=="function",Ap=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function zM(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Rt=Math.PI,te=2*Rt,UM=te+Rt,_a=Number.POSITIVE_INFINITY,Yc=Rt/180,re=Rt/2,kn=Rt/4,ba=Rt*2/3,ki=Math.log10,Yn=Math.sign;function Hs(n,t,e){return Math.abs(n-t)<e}function Rp(n){const t=Math.round(n);n=Hs(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(ki(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function HM(n){const t=[],e=Math.sqrt(n);let i;for(i=1;i<e;i++)n%i===0&&(t.push(i),t.push(n/i));return e===(e|0)&&t.push(e),t.sort((r,s)=>r-s).pop(),t}function WM(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function Di(n){return!WM(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function VM(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function Ep(n,t,e){let i,r,s;for(i=0,r=n.length;i<r;i++)s=n[i][e],isNaN(s)||(t.min=Math.min(t.min,s),t.max=Math.max(t.max,s))}function xe(n){return n*(Rt/180)}function xa(n){return n*(180/Rt)}function Pp(n){if(!ae(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function wa(n,t){const e=t.x-n.x,i=t.y-n.y,r=Math.sqrt(e*e+i*i);let s=Math.atan2(i,e);return s<-.5*Rt&&(s+=te),{angle:s,distance:r}}function Ur(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function $M(n,t){return(n-t+UM)%te-Rt}function Ue(n){return(n%te+te)%te}function Ws(n,t,e,i){const r=Ue(n),s=Ue(t),a=Ue(e),l=Ue(s-r),u=Ue(a-r),d=Ue(r-s),h=Ue(r-a);return r===s||r===a||i&&s===a||l>u&&d<h}function Ce(n,t,e){return Math.max(t,Math.min(e,n))}function YM(n){return Ce(n,-32768,32767)}function ni(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function qc(n,t,e){e=e||(a=>n[a]<t);let i=n.length-1,r=0,s;for(;i-r>1;)s=r+i>>1,e(s)?r=s:i=s;return{lo:r,hi:i}}const ii=(n,t,e,i)=>qc(n,e,i?r=>{const s=n[r][t];return s<e||s===e&&n[r+1][t]===e}:r=>n[r][t]<e),qM=(n,t,e)=>qc(n,e,i=>n[i][t]>=e);function jM(n,t,e){let i=0,r=n.length;for(;i<r&&n[i]<t;)i++;for(;r>i&&n[r-1]>e;)r--;return i>0||r<n.length?n.slice(i,r):n}const Ip=["push","pop","shift","splice","unshift"];function GM(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Ip.forEach(e=>{const i="_onData"+$c(e),r=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...s){const a=r.apply(this,s);return n._chartjs.listeners.forEach(l=>{typeof l[i]=="function"&&l[i](...s)}),a}})})}function Lp(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,r=i.indexOf(t);r!==-1&&i.splice(r,1),!(i.length>0)&&(Ip.forEach(s=>{delete n[s]}),delete n._chartjs)}function Np(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const Bp=(function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame})();function Fp(n,t){let e=[],i=!1;return function(...r){e=r,i||(i=!0,Bp.call(window,()=>{i=!1,n.apply(t,e)}))}}function KM(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const jc=n=>n==="start"?"left":n==="end"?"right":"center",He=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,XM=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function zp(n,t,e){const i=t.length;let r=0,s=i;if(n._sorted){const{iScale:a,vScale:l,_parsed:u}=n,d=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null,h=a.axis,{min:g,max:y,minDefined:_,maxDefined:x}=a.getUserBounds();if(_){if(r=Math.min(ii(u,h,g).lo,e?i:ii(t,h,a.getPixelForValue(g)).lo),d){const v=u.slice(0,r+1).reverse().findIndex(M=>!xt(M[l.axis]));r-=Math.max(0,v)}r=Ce(r,0,i-1)}if(x){let v=Math.max(ii(u,a.axis,y,!0).hi+1,e?0:ii(t,h,a.getPixelForValue(y),!0).hi+1);if(d){const M=u.slice(v-1).findIndex(C=>!xt(C[l.axis]));v+=Math.max(0,M)}s=Ce(v,r,i)-r}else s=i-r}return{start:r,count:s}}function Up(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,r={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=r,!0;const s=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,r),s}const va=n=>n===0||n===1,Hp=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*te/e)),Wp=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*te/e)+1,Vs={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*re)+1,easeOutSine:n=>Math.sin(n*re),easeInOutSine:n=>-.5*(Math.cos(Rt*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>va(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>va(n)?n:Hp(n,.075,.3),easeOutElastic:n=>va(n)?n:Wp(n,.075,.3),easeInOutElastic(n){return va(n)?n:n<.5?.5*Hp(n*2,.1125,.45):.5+.5*Wp(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let t=1.70158;return(n/=.5)<1?.5*(n*n*(((t*=1.525)+1)*n-t)):.5*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},easeInBounce:n=>1-Vs.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?Vs.easeInBounce(n*2)*.5:Vs.easeOutBounce(n*2-1)*.5+.5};function Gc(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Sa(n){return Gc(n)?n:new Fs(n)}function Kc(n){return Gc(n)?n:new Fs(n).saturate(.5).darken(.1).hexString()}const ZM=["x","y","borderWidth","radius","tension"],QM=["color","borderColor","backgroundColor"];function JM(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),n.set("animations",{colors:{type:"color",properties:QM},numbers:{type:"number",properties:ZM}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function tk(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Vp=new Map;function ek(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Vp.get(e);return i||(i=new Intl.NumberFormat(n,t),Vp.set(e,i)),i}function $s(n,t,e){return ek(t,e).format(n)}const $p={values(n){return Yt(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let r,s=n;if(e.length>1){const d=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(d<1e-4||d>1e15)&&(r="scientific"),s=nk(n,e)}const a=ki(Math.abs(s)),l=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),u={notation:r,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(u,this.options.ticks.format),$s(n,i,u)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(ki(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?$p.numeric.call(this,n,t,e):""}};function nk(n,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&n!==Math.floor(n)&&(e=n-Math.floor(n)),e}var Ta={formatters:$p};function ik(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ta.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const sr=Object.create(null),Xc=Object.create(null);function Ys(n,t){if(!t)return n;const e=t.split(".");for(let i=0,r=e.length;i<r;++i){const s=e[i];n=n[s]||(n[s]=Object.create(null))}return n}function Zc(n,t,e){return typeof t=="string"?zs(Ys(n,t),e):zs(Ys(n,""),t)}class rk{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,r)=>Kc(r.backgroundColor),this.hoverBorderColor=(i,r)=>Kc(r.borderColor),this.hoverColor=(i,r)=>Kc(r.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Zc(this,t,e)}get(t){return Ys(this,t)}describe(t,e){return Zc(Xc,t,e)}override(t,e){return Zc(sr,t,e)}route(t,e,i,r){const s=Ys(this,t),a=Ys(this,i),l="_"+e;Object.defineProperties(s,{[l]:{value:s[e],writable:!0},[e]:{enumerable:!0,get(){const u=this[l],d=a[r];return Pt(u)?Object.assign({},d,u):Mt(u,d)},set(u){this[l]=u}}})}apply(t){t.forEach(e=>e(this))}}var se=new rk({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[JM,tk,ik]);function sk(n){return!n||xt(n.size)||xt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Ma(n,t,e,i,r){let s=t[r];return s||(s=t[r]=n.measureText(r).width,e.push(r)),s>i&&(i=s),i}function ok(n,t,e,i){i=i||{};let r=i.data=i.data||{},s=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(r=i.data={},s=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let a=0;const l=e.length;let u,d,h,g,y;for(u=0;u<l;u++)if(g=e[u],g!=null&&!Yt(g))a=Ma(n,r,s,a,g);else if(Yt(g))for(d=0,h=g.length;d<h;d++)y=g[d],y!=null&&!Yt(y)&&(a=Ma(n,r,s,a,y));n.restore();const _=s.length/2;if(_>e.length){for(u=0;u<_;u++)delete r[s[u]];s.splice(0,_)}return a}function or(n,t,e){const i=n.currentDevicePixelRatio,r=e!==0?Math.max(e/2,.5):0;return Math.round((t-r)*i)/i+r}function Yp(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function Qc(n,t,e,i){qp(n,t,e,i,null)}function qp(n,t,e,i,r){let s,a,l,u,d,h,g,y;const _=t.pointStyle,x=t.rotation,v=t.radius;let M=(x||0)*Yc;if(_&&typeof _=="object"&&(s=_.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(M),n.drawImage(_,-_.width/2,-_.height/2,_.width,_.height),n.restore();return}if(!(isNaN(v)||v<=0)){switch(n.beginPath(),_){default:r?n.ellipse(e,i,r/2,v,0,0,te):n.arc(e,i,v,0,te),n.closePath();break;case"triangle":h=r?r/2:v,n.moveTo(e+Math.sin(M)*h,i-Math.cos(M)*v),M+=ba,n.lineTo(e+Math.sin(M)*h,i-Math.cos(M)*v),M+=ba,n.lineTo(e+Math.sin(M)*h,i-Math.cos(M)*v),n.closePath();break;case"rectRounded":d=v*.516,u=v-d,a=Math.cos(M+kn)*u,g=Math.cos(M+kn)*(r?r/2-d:u),l=Math.sin(M+kn)*u,y=Math.sin(M+kn)*(r?r/2-d:u),n.arc(e-g,i-l,d,M-Rt,M-re),n.arc(e+y,i-a,d,M-re,M),n.arc(e+g,i+l,d,M,M+re),n.arc(e-y,i+a,d,M+re,M+Rt),n.closePath();break;case"rect":if(!x){u=Math.SQRT1_2*v,h=r?r/2:u,n.rect(e-h,i-u,2*h,2*u);break}M+=kn;case"rectRot":g=Math.cos(M)*(r?r/2:v),a=Math.cos(M)*v,l=Math.sin(M)*v,y=Math.sin(M)*(r?r/2:v),n.moveTo(e-g,i-l),n.lineTo(e+y,i-a),n.lineTo(e+g,i+l),n.lineTo(e-y,i+a),n.closePath();break;case"crossRot":M+=kn;case"cross":g=Math.cos(M)*(r?r/2:v),a=Math.cos(M)*v,l=Math.sin(M)*v,y=Math.sin(M)*(r?r/2:v),n.moveTo(e-g,i-l),n.lineTo(e+g,i+l),n.moveTo(e+y,i-a),n.lineTo(e-y,i+a);break;case"star":g=Math.cos(M)*(r?r/2:v),a=Math.cos(M)*v,l=Math.sin(M)*v,y=Math.sin(M)*(r?r/2:v),n.moveTo(e-g,i-l),n.lineTo(e+g,i+l),n.moveTo(e+y,i-a),n.lineTo(e-y,i+a),M+=kn,g=Math.cos(M)*(r?r/2:v),a=Math.cos(M)*v,l=Math.sin(M)*v,y=Math.sin(M)*(r?r/2:v),n.moveTo(e-g,i-l),n.lineTo(e+g,i+l),n.moveTo(e+y,i-a),n.lineTo(e-y,i+a);break;case"line":a=r?r/2:Math.cos(M)*v,l=Math.sin(M)*v,n.moveTo(e-a,i-l),n.lineTo(e+a,i+l);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(M)*(r?r/2:v),i+Math.sin(M)*v);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function ri(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.x<t.right+e&&n.y>t.top-e&&n.y<t.bottom+e}function qs(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function js(n){n.restore()}function ak(n,t,e,i,r){if(!t)return n.lineTo(e.x,e.y);if(r==="middle"){const s=(t.x+e.x)/2;n.lineTo(s,t.y),n.lineTo(s,e.y)}else r==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function lk(n,t,e,i){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function ck(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),xt(t.rotation)||n.rotate(t.rotation),t.color&&(n.fillStyle=t.color),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline)}function uk(n,t,e,i,r){if(r.strikethrough||r.underline){const s=n.measureText(i),a=t-s.actualBoundingBoxLeft,l=t+s.actualBoundingBoxRight,u=e-s.actualBoundingBoxAscent,d=e+s.actualBoundingBoxDescent,h=r.strikethrough?(u+d)/2:d;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=r.decorationWidth||2,n.moveTo(a,h),n.lineTo(l,h),n.stroke()}}function dk(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function ar(n,t,e,i,r,s={}){const a=Yt(t)?t:[t],l=s.strokeWidth>0&&s.strokeColor!=="";let u,d;for(n.save(),n.font=r.string,ck(n,s),u=0;u<a.length;++u)d=a[u],s.backdrop&&dk(n,s.backdrop),l&&(s.strokeColor&&(n.strokeStyle=s.strokeColor),xt(s.strokeWidth)||(n.lineWidth=s.strokeWidth),n.strokeText(d,e,i,s.maxWidth)),n.fillText(d,e,i,s.maxWidth),uk(n,e,i,d,s),i+=Number(r.lineHeight);n.restore()}function Hr(n,t){const{x:e,y:i,w:r,h:s,radius:a}=t;n.arc(e+a.topLeft,i+a.topLeft,a.topLeft,1.5*Rt,Rt,!0),n.lineTo(e,i+s-a.bottomLeft),n.arc(e+a.bottomLeft,i+s-a.bottomLeft,a.bottomLeft,Rt,re,!0),n.lineTo(e+r-a.bottomRight,i+s),n.arc(e+r-a.bottomRight,i+s-a.bottomRight,a.bottomRight,re,0,!0),n.lineTo(e+r,i+a.topRight),n.arc(e+r-a.topRight,i+a.topRight,a.topRight,0,-re,!0),n.lineTo(e+a.topLeft,i)}const fk=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,hk=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function pk(n,t){const e=(""+n).match(fk);if(!e||e[1]==="normal")return t*1.2;switch(n=+e[2],e[3]){case"px":return n;case"%":n/=100;break}return t*n}const gk=n=>+n||0;function Jc(n,t){const e={},i=Pt(t),r=i?Object.keys(t):t,s=Pt(n)?i?a=>Mt(n[a],n[t[a]]):a=>n[a]:()=>n;for(const a of r)e[a]=gk(s(a));return e}function jp(n){return Jc(n,{top:"y",right:"x",bottom:"y",left:"x"})}function Ci(n){return Jc(n,["topLeft","topRight","bottomLeft","bottomRight"])}function we(n){const t=jp(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function le(n,t){n=n||{},t=t||se.font;let e=Mt(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=Mt(n.style,t.style);i&&!(""+i).match(hk)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:Mt(n.family,t.family),lineHeight:pk(Mt(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:Mt(n.weight,t.weight),string:""};return r.string=sk(r),r}function Gs(n,t,e,i){let r,s,a;for(r=0,s=n.length;r<s;++r)if(a=n[r],a!==void 0&&a!==void 0)return a}function mk(n,t,e){const{min:i,max:r}=n,s=Dp(t,(r-i)/2),a=(l,u)=>e&&l===0?0:l+u;return{min:a(i,-Math.abs(s)),max:a(r,s)}}function Oi(n,t){return Object.assign(Object.create(n),t)}function tu(n,t=[""],e,i,r=()=>n[0]){const s=e||n;typeof i>"u"&&(i=Qp("_fallback",n));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:s,_fallback:i,_getTarget:r,override:l=>tu([l,...n],t,s,i)};return new Proxy(a,{deleteProperty(l,u){return delete l[u],delete l._keys,delete n[0][u],!0},get(l,u){return Kp(l,u,()=>Tk(u,t,n,l))},getOwnPropertyDescriptor(l,u){return Reflect.getOwnPropertyDescriptor(l._scopes[0],u)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(l,u){return Jp(l).includes(u)},ownKeys(l){return Jp(l)},set(l,u,d){const h=l._storage||(l._storage=r());return l[u]=h[u]=d,delete l._keys,!0}})}function Wr(n,t,e,i){const r={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Gp(n,i),setContext:s=>Wr(n,s,e,i),override:s=>Wr(n.override(s),t,e,i)};return new Proxy(r,{deleteProperty(s,a){return delete s[a],delete n[a],!0},get(s,a,l){return Kp(s,a,()=>_k(s,a,l))},getOwnPropertyDescriptor(s,a){return s._descriptors.allKeys?Reflect.has(n,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,a)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(s,a){return Reflect.has(n,a)},ownKeys(){return Reflect.ownKeys(n)},set(s,a,l){return n[a]=l,delete s[a],!0}})}function Gp(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:r=t.allKeys}=n;return{allKeys:r,scriptable:e,indexable:i,isScriptable:nn(e)?e:()=>e,isIndexable:nn(i)?i:()=>i}}const yk=(n,t)=>n?n+$c(t):t,eu=(n,t)=>Pt(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Kp(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];const i=e();return n[t]=i,i}function _k(n,t,e){const{_proxy:i,_context:r,_subProxy:s,_descriptors:a}=n;let l=i[t];return nn(l)&&a.isScriptable(t)&&(l=bk(t,l,n,e)),Yt(l)&&l.length&&(l=xk(t,l,n,a.isIndexable)),eu(t,l)&&(l=Wr(l,r,s&&s[t],a)),l}function bk(n,t,e,i){const{_proxy:r,_context:s,_subProxy:a,_stack:l}=e;if(l.has(n))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+n);l.add(n);let u=t(s,a||i);return l.delete(n),eu(n,u)&&(u=nu(r._scopes,r,n,u)),u}function xk(n,t,e,i){const{_proxy:r,_context:s,_subProxy:a,_descriptors:l}=e;if(typeof s.index<"u"&&i(n))return t[s.index%t.length];if(Pt(t[0])){const u=t,d=r._scopes.filter(h=>h!==u);t=[];for(const h of u){const g=nu(d,r,n,h);t.push(Wr(g,s,a&&a[n],l))}}return t}function Xp(n,t,e){return nn(n)?n(t,e):n}const wk=(n,t)=>n===!0?t:typeof n=="string"?Mi(t,n):void 0;function vk(n,t,e,i,r){for(const s of t){const a=wk(e,s);if(a){n.add(a);const l=Xp(a._fallback,e,r);if(typeof l<"u"&&l!==e&&l!==i)return l}else if(a===!1&&typeof i<"u"&&e!==i)return null}return!1}function nu(n,t,e,i){const r=t._rootScopes,s=Xp(t._fallback,e,i),a=[...n,...r],l=new Set;l.add(i);let u=Zp(l,a,e,s||e,i);return u===null||typeof s<"u"&&s!==e&&(u=Zp(l,a,s,u,i),u===null)?!1:tu(Array.from(l),[""],r,s,()=>Sk(t,e,i))}function Zp(n,t,e,i,r){for(;e;)e=vk(n,t,e,i,r);return e}function Sk(n,t,e){const i=n._getTarget();t in i||(i[t]={});const r=i[t];return Yt(r)&&Pt(e)?e:r||{}}function Tk(n,t,e,i){let r;for(const s of t)if(r=Qp(yk(s,n),e),typeof r<"u")return eu(n,r)?nu(e,i,n,r):r}function Qp(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function Jp(n){let t=n._keys;return t||(t=n._keys=Mk(n._scopes)),t}function Mk(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(r=>!r.startsWith("_")))t.add(i);return Array.from(t)}function tg(n,t,e,i){const{iScale:r}=n,{key:s="r"}=this._parsing,a=new Array(i);let l,u,d,h;for(l=0,u=i;l<u;++l)d=l+e,h=t[d],a[l]={r:r.parse(Mi(h,s),d)};return a}const kk=Number.EPSILON||1e-14,Vr=(n,t)=>t<n.length&&!n[t].skip&&n[t],eg=n=>n==="x"?"y":"x";function Dk(n,t,e,i){const r=n.skip?t:n,s=t,a=e.skip?t:e,l=Ur(s,r),u=Ur(a,s);let d=l/(l+u),h=u/(l+u);d=isNaN(d)?0:d,h=isNaN(h)?0:h;const g=i*d,y=i*h;return{previous:{x:s.x-g*(a.x-r.x),y:s.y-g*(a.y-r.y)},next:{x:s.x+y*(a.x-r.x),y:s.y+y*(a.y-r.y)}}}function Ck(n,t,e){const i=n.length;let r,s,a,l,u,d=Vr(n,0);for(let h=0;h<i-1;++h)if(u=d,d=Vr(n,h+1),!(!u||!d)){if(Hs(t[h],0,kk)){e[h]=e[h+1]=0;continue}r=e[h]/t[h],s=e[h+1]/t[h],l=Math.pow(r,2)+Math.pow(s,2),!(l<=9)&&(a=3/Math.sqrt(l),e[h]=r*a*t[h],e[h+1]=s*a*t[h])}}function Ok(n,t,e="x"){const i=eg(e),r=n.length;let s,a,l,u=Vr(n,0);for(let d=0;d<r;++d){if(a=l,l=u,u=Vr(n,d+1),!l)continue;const h=l[e],g=l[i];a&&(s=(h-a[e])/3,l[`cp1${e}`]=h-s,l[`cp1${i}`]=g-s*t[d]),u&&(s=(u[e]-h)/3,l[`cp2${e}`]=h+s,l[`cp2${i}`]=g+s*t[d])}}function Ak(n,t="x"){const e=eg(t),i=n.length,r=Array(i).fill(0),s=Array(i);let a,l,u,d=Vr(n,0);for(a=0;a<i;++a)if(l=u,u=d,d=Vr(n,a+1),!!u){if(d){const h=d[t]-u[t];r[a]=h!==0?(d[e]-u[e])/h:0}s[a]=l?d?Yn(r[a-1])!==Yn(r[a])?0:(r[a-1]+r[a])/2:r[a-1]:r[a]}Ck(n,r,s),Ok(n,s,t)}function ka(n,t,e){return Math.max(Math.min(n,e),t)}function Rk(n,t){let e,i,r,s,a,l=ri(n[0],t);for(e=0,i=n.length;e<i;++e)a=s,s=l,l=e<i-1&&ri(n[e+1],t),s&&(r=n[e],a&&(r.cp1x=ka(r.cp1x,t.left,t.right),r.cp1y=ka(r.cp1y,t.top,t.bottom)),l&&(r.cp2x=ka(r.cp2x,t.left,t.right),r.cp2y=ka(r.cp2y,t.top,t.bottom)))}function Ek(n,t,e,i,r){let s,a,l,u;if(t.spanGaps&&(n=n.filter(d=>!d.skip)),t.cubicInterpolationMode==="monotone")Ak(n,r);else{let d=i?n[n.length-1]:n[0];for(s=0,a=n.length;s<a;++s)l=n[s],u=Dk(d,l,n[Math.min(s+1,a-(i?0:1))%a],t.tension),l.cp1x=u.previous.x,l.cp1y=u.previous.y,l.cp2x=u.next.x,l.cp2y=u.next.y,d=l}t.capBezierPoints&&Rk(n,e)}function iu(){return typeof window<"u"&&typeof document<"u"}function ru(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Da(n,t,e){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=n,i}const Ca=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function Pk(n,t){return Ca(n).getPropertyValue(t)}const Ik=["top","right","bottom","left"];function lr(n,t,e){const i={};e=e?"-"+e:"";for(let r=0;r<4;r++){const s=Ik[r];i[s]=parseFloat(n[t+"-"+s+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Lk=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function Nk(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:r,offsetY:s}=i;let a=!1,l,u;if(Lk(r,s,n.target))l=r,u=s;else{const d=t.getBoundingClientRect();l=i.clientX-d.left,u=i.clientY-d.top,a=!0}return{x:l,y:u,box:a}}function Ai(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,r=Ca(e),s=r.boxSizing==="border-box",a=lr(r,"padding"),l=lr(r,"border","width"),{x:u,y:d,box:h}=Nk(n,e),g=a.left+(h&&l.left),y=a.top+(h&&l.top);let{width:_,height:x}=t;return s&&(_-=a.width+l.width,x-=a.height+l.height),{x:Math.round((u-g)/_*e.width/i),y:Math.round((d-y)/x*e.height/i)}}function Bk(n,t,e){let i,r;if(t===void 0||e===void 0){const s=n&&ru(n);if(!s)t=n.clientWidth,e=n.clientHeight;else{const a=s.getBoundingClientRect(),l=Ca(s),u=lr(l,"border","width"),d=lr(l,"padding");t=a.width-d.width-u.width,e=a.height-d.height-u.height,i=Da(l.maxWidth,s,"clientWidth"),r=Da(l.maxHeight,s,"clientHeight")}}return{width:t,height:e,maxWidth:i||_a,maxHeight:r||_a}}const Ri=n=>Math.round(n*10)/10;function Fk(n,t,e,i){const r=Ca(n),s=lr(r,"margin"),a=Da(r.maxWidth,n,"clientWidth")||_a,l=Da(r.maxHeight,n,"clientHeight")||_a,u=Bk(n,t,e);let{width:d,height:h}=u;if(r.boxSizing==="content-box"){const y=lr(r,"border","width"),_=lr(r,"padding");d-=_.width+y.width,h-=_.height+y.height}return d=Math.max(0,d-s.width),h=Math.max(0,i?d/i:h-s.height),d=Ri(Math.min(d,a,u.maxWidth)),h=Ri(Math.min(h,l,u.maxHeight)),d&&!h&&(h=Ri(d/2)),(t!==void 0||e!==void 0)&&i&&u.height&&h>u.height&&(h=u.height,d=Ri(Math.floor(h*i))),{width:d,height:h}}function ng(n,t,e){const i=t||1,r=Ri(n.height*i),s=Ri(n.width*i);n.height=Ri(n.height),n.width=Ri(n.width);const a=n.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${n.height}px`,a.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||a.height!==r||a.width!==s?(n.currentDevicePixelRatio=i,a.height=r,a.width=s,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const zk=(function(){let n=!1;try{const t={get passive(){return n=!0,!1}};iu()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n})();function ig(n,t){const e=Pk(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function cr(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function Uk(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:i==="middle"?e<.5?n.y:t.y:i==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function Hk(n,t,e,i){const r={x:n.cp2x,y:n.cp2y},s={x:t.cp1x,y:t.cp1y},a=cr(n,r,e),l=cr(r,s,e),u=cr(s,t,e),d=cr(a,l,e),h=cr(l,u,e);return cr(d,h,e)}const Wk=function(n,t){return{x(e){return n+n+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},Vk=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function $r(n,t,e){return n?Wk(t,e):Vk()}function rg(n,t){let e,i;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=i)}function sg(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function og(n){return n==="angle"?{between:Ws,compare:$M,normalize:Ue}:{between:ni,compare:(t,e)=>t-e,normalize:t=>t}}function ag({start:n,end:t,count:e,loop:i,style:r}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:r}}function $k(n,t,e){const{property:i,start:r,end:s}=e,{between:a,normalize:l}=og(i),u=t.length;let{start:d,end:h,loop:g}=n,y,_;if(g){for(d+=u,h+=u,y=0,_=u;y<_&&a(l(t[d%u][i]),r,s);++y)d--,h--;d%=u,h%=u}return h<d&&(h+=u),{start:d,end:h,loop:g,style:n.style}}function lg(n,t,e){if(!e)return[n];const{property:i,start:r,end:s}=e,a=t.length,{compare:l,between:u,normalize:d}=og(i),{start:h,end:g,loop:y,style:_}=$k(n,t,e),x=[];let v=!1,M=null,C,R,F;const I=()=>u(r,F,C)&&l(r,F)!==0,L=()=>l(s,C)===0||u(s,F,C),N=()=>v||I(),B=()=>!v||L();for(let T=h,S=h;T<=g;++T)R=t[T%a],!R.skip&&(C=d(R[i]),C!==F&&(v=u(C,r,s),M===null&&N()&&(M=l(C,r)===0?T:S),M!==null&&B()&&(x.push(ag({start:M,end:T,loop:y,count:a,style:_})),M=null),S=T,F=C));return M!==null&&x.push(ag({start:M,end:g,loop:y,count:a,style:_})),x}function cg(n,t){const e=[],i=n.segments;for(let r=0;r<i.length;r++){const s=lg(i[r],n.points,t);s.length&&e.push(...s)}return e}function Yk(n,t,e,i){let r=0,s=t-1;if(e&&!i)for(;r<t&&!n[r].skip;)r++;for(;r<t&&n[r].skip;)r++;for(r%=t,e&&(s+=r);s>r&&n[s%t].skip;)s--;return s%=t,{start:r,end:s}}function qk(n,t,e,i){const r=n.length,s=[];let a=t,l=n[t],u;for(u=t+1;u<=e;++u){const d=n[u%r];d.skip||d.stop?l.skip||(i=!1,s.push({start:t%r,end:(u-1)%r,loop:i}),t=a=d.stop?u:null):(a=u,l.skip&&(t=u)),l=d}return a!==null&&s.push({start:t%r,end:a%r,loop:i}),s}function jk(n,t){const e=n.points,i=n.options.spanGaps,r=e.length;if(!r)return[];const s=!!n._loop,{start:a,end:l}=Yk(e,r,s,i);if(i===!0)return ug(n,[{start:a,end:l,loop:s}],e,t);const u=l<a?l+r:l,d=!!n._fullLoop&&a===0&&l===r-1;return ug(n,qk(e,a,u,d),e,t)}function ug(n,t,e,i){return!i||!i.setContext||!e?t:Gk(n,t,e,i)}function Gk(n,t,e,i){const r=n._chart.getContext(),s=dg(n.options),{_datasetIndex:a,options:{spanGaps:l}}=n,u=e.length,d=[];let h=s,g=t[0].start,y=g;function _(x,v,M,C){const R=l?-1:1;if(x!==v){for(x+=u;e[x%u].skip;)x-=R;for(;e[v%u].skip;)v+=R;x%u!==v%u&&(d.push({start:x%u,end:v%u,loop:M,style:C}),h=C,g=v%u)}}for(const x of t){g=l?g:x.start;let v=e[g%u],M;for(y=g+1;y<=x.end;y++){const C=e[y%u];M=dg(i.setContext(Oi(r,{type:"segment",p0:v,p1:C,p0DataIndex:(y-1)%u,p1DataIndex:y%u,datasetIndex:a}))),Kk(M,h)&&_(g,y-1,x.loop,h),v=C,h=M}g<y-1&&_(g,y-1,x.loop,h)}return d}function dg(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function Kk(n,t){if(!t)return!1;const e=[],i=function(r,s){return Gc(s)?(e.includes(s)||e.push(s),e.indexOf(s)):s};return JSON.stringify(n,i)!==JSON.stringify(t,i)}function Oa(n,t,e){return n.options.clip?n[e]:t[e]}function Xk(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:Oa(e,t,"left"),right:Oa(e,t,"right"),top:Oa(i,t,"top"),bottom:Oa(i,t,"bottom")}:t}function fg(n,t){const e=t._clip;if(e.disabled)return!1;const i=Xk(t,n.chartArea);return{left:e.left===!1?0:i.left-(e.left===!0?0:e.left),right:e.right===!1?n.width:i.right+(e.right===!0?0:e.right),top:e.top===!1?0:i.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?n.height:i.bottom+(e.bottom===!0?0:e.bottom)}}class Zk{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,r){const s=e.listeners[r],a=e.duration;s.forEach(l=>l({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(i-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=Bp.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,r)=>{if(!i.running||!i.items.length)return;const s=i.items;let a=s.length-1,l=!1,u;for(;a>=0;--a)u=s[a],u._active?(u._total>i.duration&&(i.duration=u._total),u.tick(t),l=!0):(s[a]=s[s.length-1],s.pop());l&&(r.draw(),this._notify(r,i,t,"progress")),s.length||(i.running=!1,this._notify(r,i,t,"complete"),i.initial=!1),e+=s.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,r)=>Math.max(i,r._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let r=i.length-1;for(;r>=0;--r)i[r].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var si=new Zk;const hg="transparent",Qk={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=Sa(n||hg),r=i.valid&&Sa(t||hg);return r&&r.valid?r.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class Jk{constructor(t,e,i,r){const s=e[i];r=Gs([t.to,r,s,t.from]);const a=Gs([t.from,s,r]);this._active=!0,this._fn=t.fn||Qk[t.type||typeof a],this._easing=Vs[t.easing]||Vs.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=a,this._to=r,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const r=this._target[this._prop],s=i-this._start,a=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=Gs([t.to,e,r,t.from]),this._from=Gs([t.from,r,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,r=this._prop,s=this._from,a=this._loop,l=this._to;let u;if(this._active=s!==l&&(a||e<i),!this._active){this._target[r]=l,this._notify(!0);return}if(e<0){this._target[r]=s;return}u=e/i%2,u=a&&u>1?2-u:u,u=this._easing(Math.min(1,Math.max(0,u))),this._target[r]=this._fn(s,l,u)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let r=0;r<i.length;r++)i[r][e]()}}class su{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!Pt(t))return;const e=Object.keys(se.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{const s=t[r];if(!Pt(s))return;const a={};for(const l of e)a[l]=s[l];(Yt(s.properties)&&s.properties||[r]).forEach(l=>{(l===r||!i.has(l))&&i.set(l,a)})})}_animateOptions(t,e){const i=e.options,r=eD(t,i);if(!r)return[];const s=this._createAnimations(r,i);return i.$shared&&tD(t.options.$animations,i).then(()=>{t.options=i},()=>{}),s}_createAnimations(t,e){const i=this._properties,r=[],s=t.$animations||(t.$animations={}),a=Object.keys(e),l=Date.now();let u;for(u=a.length-1;u>=0;--u){const d=a[u];if(d.charAt(0)==="$")continue;if(d==="options"){r.push(...this._animateOptions(t,e));continue}const h=e[d];let g=s[d];const y=i.get(d);if(g)if(y&&g.active()){g.update(y,h,l);continue}else g.cancel();if(!y||!y.duration){t[d]=h;continue}s[d]=g=new Jk(y,t,d,h),r.push(g)}return r}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return si.add(this._chart,i),!0}}function tD(n,t){const e=[],i=Object.keys(t);for(let r=0;r<i.length;r++){const s=n[i[r]];s&&s.active()&&e.push(s.wait())}return Promise.all(e)}function eD(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function pg(n,t){const e=n&&n.options||{},i=e.reverse,r=e.min===void 0?t:0,s=e.max===void 0?t:0;return{start:i?s:r,end:i?r:s}}function nD(n,t,e){if(e===!1)return!1;const i=pg(n,e),r=pg(t,e);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}function iD(n){let t,e,i,r;return Pt(n)?(t=n.top,e=n.right,i=n.bottom,r=n.left):t=e=i=r=n,{top:t,right:e,bottom:i,left:r,disabled:n===!1}}function gg(n,t){const e=[],i=n._getSortedDatasetMetas(t);let r,s;for(r=0,s=i.length;r<s;++r)e.push(i[r].index);return e}function mg(n,t,e,i={}){const r=n.keys,s=i.mode==="single";let a,l,u,d;if(t===null)return;let h=!1;for(a=0,l=r.length;a<l;++a){if(u=+r[a],u===e){if(h=!0,i.all)continue;break}d=n.values[u],ae(d)&&(s||t===0||Yn(t)===Yn(d))&&(t+=d)}return!h&&!i.all?0:t}function rD(n,t){const{iScale:e,vScale:i}=t,r=e.axis==="x"?"x":"y",s=i.axis==="x"?"x":"y",a=Object.keys(n),l=new Array(a.length);let u,d,h;for(u=0,d=a.length;u<d;++u)h=a[u],l[u]={[r]:h,[s]:n[h]};return l}function ou(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function sD(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function oD(n){const{min:t,max:e,minDefined:i,maxDefined:r}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:r?e:Number.POSITIVE_INFINITY}}function aD(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function yg(n,t,e,i){for(const r of t.getMatchingVisibleMetas(i).reverse()){const s=n[r.index];if(e&&s>0||!e&&s<0)return r.index}return null}function _g(n,t){const{chart:e,_cachedMeta:i}=n,r=e._stacks||(e._stacks={}),{iScale:s,vScale:a,index:l}=i,u=s.axis,d=a.axis,h=sD(s,a,i),g=t.length;let y;for(let _=0;_<g;++_){const x=t[_],{[u]:v,[d]:M}=x,C=x._stacks||(x._stacks={});y=C[d]=aD(r,h,v),y[l]=M,y._top=yg(y,a,!0,i.type),y._bottom=yg(y,a,!1,i.type);const R=y._visualValues||(y._visualValues={});R[l]=M}}function au(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function lD(n,t){return Oi(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function cD(n,t,e){return Oi(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Ks(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const r of t){const s=r._stacks;if(!s||s[i]===void 0||s[i][e]===void 0)return;delete s[i][e],s[i]._visualValues!==void 0&&s[i]._visualValues[e]!==void 0&&delete s[i]._visualValues[e]}}}const lu=n=>n==="reset"||n==="none",bg=(n,t)=>t?n:Object.assign({},n),uD=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:gg(e,!0),values:null};class Ei{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=ou(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Ks(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),r=(g,y,_,x)=>g==="x"?y:g==="r"?x:_,s=e.xAxisID=Mt(i.xAxisID,au(t,"x")),a=e.yAxisID=Mt(i.yAxisID,au(t,"y")),l=e.rAxisID=Mt(i.rAxisID,au(t,"r")),u=e.indexAxis,d=e.iAxisID=r(u,s,a,l),h=e.vAxisID=r(u,a,s,l);e.xScale=this.getScaleForId(s),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(l),e.iScale=this.getScaleForId(d),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Lp(this._data,this),t._stacked&&Ks(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(Pt(e)){const r=this._cachedMeta;this._data=rD(e,r)}else if(i!==e){if(i){Lp(i,this);const r=this._cachedMeta;Ks(r),r._parsed=[]}e&&Object.isExtensible(e)&&GM(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let r=!1;this._dataCheck();const s=e._stacked;e._stacked=ou(e.vScale,e),e.stack!==i.stack&&(r=!0,Ks(e),e.stack=i.stack),this._resyncElements(t),(r||s!==e._stacked)&&(_g(this,e._parsed),e._stacked=ou(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:r}=this,{iScale:s,_stacked:a}=i,l=s.axis;let u=t===0&&e===r.length?!0:i._sorted,d=t>0&&i._parsed[t-1],h,g,y;if(this._parsing===!1)i._parsed=r,i._sorted=!0,y=r;else{Yt(r[t])?y=this.parseArrayData(i,r,t,e):Pt(r[t])?y=this.parseObjectData(i,r,t,e):y=this.parsePrimitiveData(i,r,t,e);const _=()=>g[l]===null||d&&g[l]<d[l];for(h=0;h<e;++h)i._parsed[h+t]=g=y[h],u&&(_()&&(u=!1),d=g);i._sorted=u}a&&_g(this,y)}parsePrimitiveData(t,e,i,r){const{iScale:s,vScale:a}=t,l=s.axis,u=a.axis,d=s.getLabels(),h=s===a,g=new Array(r);let y,_,x;for(y=0,_=r;y<_;++y)x=y+i,g[y]={[l]:h||s.parse(d[x],x),[u]:a.parse(e[x],x)};return g}parseArrayData(t,e,i,r){const{xScale:s,yScale:a}=t,l=new Array(r);let u,d,h,g;for(u=0,d=r;u<d;++u)h=u+i,g=e[h],l[u]={x:s.parse(g[0],h),y:a.parse(g[1],h)};return l}parseObjectData(t,e,i,r){const{xScale:s,yScale:a}=t,{xAxisKey:l="x",yAxisKey:u="y"}=this._parsing,d=new Array(r);let h,g,y,_;for(h=0,g=r;h<g;++h)y=h+i,_=e[y],d[h]={x:s.parse(Mi(_,l),y),y:a.parse(Mi(_,u),y)};return d}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const r=this.chart,s=this._cachedMeta,a=e[t.axis],l={keys:gg(r,!0),values:e._stacks[t.axis]._visualValues};return mg(l,a,s.index,{mode:i})}updateRangeFromParsed(t,e,i,r){const s=i[e.axis];let a=s===null?NaN:s;const l=r&&i._stacks[e.axis];r&&l&&(r.values=l,a=mg(r,s,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const i=this._cachedMeta,r=i._parsed,s=i._sorted&&t===i.iScale,a=r.length,l=this._getOtherScale(t),u=uD(e,i,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:g}=oD(l);let y,_;function x(){_=r[y];const v=_[l.axis];return!ae(_[t.axis])||h>v||g<v}for(y=0;y<a&&!(!x()&&(this.updateRangeFromParsed(d,t,_,u),s));++y);if(s){for(y=a-1;y>=0;--y)if(!x()){this.updateRangeFromParsed(d,t,_,u);break}}return d}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let r,s,a;for(r=0,s=e.length;r<s;++r)a=e[r][t.axis],ae(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,r=e.vScale,s=this.getParsed(t);return{label:i?""+i.getLabelForValue(s[i.axis]):"",value:r?""+r.getLabelForValue(s[r.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=iD(Mt(this.options.clip,nD(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,r=i.data||[],s=e.chartArea,a=[],l=this._drawStart||0,u=this._drawCount||r.length-l,d=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,s,l,u),h=l;h<l+u;++h){const g=r[h];g.hidden||(g.active&&d?a.push(g):g.draw(t,s))}for(h=0;h<a.length;++h)a[h].draw(t,s)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const r=this.getDataset();let s;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];s=a.$context||(a.$context=cD(this.getContext(),t,a)),s.parsed=this.getParsed(t),s.raw=r.data[t],s.index=s.dataIndex=t}else s=this.$context||(this.$context=lD(this.chart.getContext(),this.index)),s.dataset=r,s.index=s.datasetIndex=this.index;return s.active=!!e,s.mode=i,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const r=e==="active",s=this._cachedDataOpts,a=t+"-"+e,l=s[a],u=this.enableOptionSharing&&en(i);if(l)return bg(l,u);const d=this.chart.config,h=d.datasetElementScopeKeys(this._type,t),g=r?[`${t}Hover`,"hover",t,""]:[t,""],y=d.getOptionScopes(this.getDataset(),h),_=Object.keys(se.elements[t]),x=()=>this.getContext(i,r,e),v=d.resolveNamedOptions(y,_,x,g);return v.$shared&&(v.$shared=u,s[a]=Object.freeze(bg(v,u))),v}_resolveAnimations(t,e,i){const r=this.chart,s=this._cachedDataOpts,a=`animation-${e}`,l=s[a];if(l)return l;let u;if(r.options.animation!==!1){const h=this.chart.config,g=h.datasetAnimationScopeKeys(this._type,e),y=h.getOptionScopes(this.getDataset(),g);u=h.createResolver(y,this.getContext(t,i,e))}const d=new su(r,u&&u.animations);return u&&u._cacheable&&(s[a]=Object.freeze(d)),d}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||lu(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),r=this._sharedOptions,s=this.getSharedOptions(i),a=this.includeOptions(e,s)||s!==r;return this.updateSharedOptions(s,e,i),{sharedOptions:s,includeOptions:a}}updateElement(t,e,i,r){lu(r)?Object.assign(t,i):this._resolveAnimations(e,r).update(t,i)}updateSharedOptions(t,e,i){t&&!lu(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,r){t.active=r;const s=this.getStyle(e,r);this._resolveAnimations(e,i,r).update(t,{options:!r&&this.getSharedOptions(s)||s})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[l,u,d]of this._syncList)this[l](u,d);this._syncList=[];const r=i.length,s=e.length,a=Math.min(s,r);a&&this.parse(0,a),s>r?this._insertElements(r,s-r,t):s<r&&this._removeElements(s,r-s)}_insertElements(t,e,i=!0){const r=this._cachedMeta,s=r.data,a=t+e;let l;const u=d=>{for(d.length+=e,l=d.length-1;l>=a;l--)d[l]=d[l-e]};for(u(s),l=t;l<a;++l)s[l]=new this.dataElementType;this._parsing&&u(r._parsed),this.parse(t,e),i&&this.updateElements(s,t,e,"reset")}updateElements(t,e,i,r){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const r=i._parsed.splice(t,e);i._stacked&&Ks(i,r)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,r]=t;this[e](i,r)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function dD(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let r=0,s=e.length;r<s;r++)i=i.concat(e[r].controller.getAllParsedValues(n));n._cache.$bar=Np(i.sort((r,s)=>r-s))}return n._cache.$bar}function fD(n){const t=n.iScale,e=dD(t,n.type);let i=t._length,r,s,a,l;const u=()=>{a===32767||a===-32768||(en(l)&&(i=Math.min(i,Math.abs(a-l)||i)),l=a)};for(r=0,s=e.length;r<s;++r)a=t.getPixelForValue(e[r]),u();for(l=void 0,r=0,s=t.ticks.length;r<s;++r)a=t.getPixelForTick(r),u();return i}function hD(n,t,e,i){const r=e.barThickness;let s,a;return xt(r)?(s=t.min*e.categoryPercentage,a=e.barPercentage):(s=r*i,a=1),{chunk:s/i,ratio:a,start:t.pixels[n]-s/2}}function pD(n,t,e,i){const r=t.pixels,s=r[n];let a=n>0?r[n-1]:null,l=n<r.length-1?r[n+1]:null;const u=e.categoryPercentage;a===null&&(a=s-(l===null?t.end-t.start:l-s)),l===null&&(l=s+s-a);const d=s-(s-Math.min(a,l))/2*u;return{chunk:Math.abs(l-a)/2*u/i,ratio:e.barPercentage,start:d}}function gD(n,t,e,i){const r=e.parse(n[0],i),s=e.parse(n[1],i),a=Math.min(r,s),l=Math.max(r,s);let u=a,d=l;Math.abs(a)>Math.abs(l)&&(u=l,d=a),t[e.axis]=d,t._custom={barStart:u,barEnd:d,start:r,end:s,min:a,max:l}}function xg(n,t,e,i){return Yt(n)?gD(n,t,e,i):t[e.axis]=e.parse(n,i),t}function wg(n,t,e,i){const r=n.iScale,s=n.vScale,a=r.getLabels(),l=r===s,u=[];let d,h,g,y;for(d=e,h=e+i;d<h;++d)y=t[d],g={},g[r.axis]=l||r.parse(a[d],d),u.push(xg(y,g,s,d));return u}function cu(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function mD(n,t,e){return n!==0?Yn(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function yD(n){let t,e,i,r,s;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(r="end",s="start"):(r="start",s="end"),{start:e,end:i,reverse:t,top:r,bottom:s}}function _D(n,t,e,i){let r=t.borderSkipped;const s={};if(!r){n.borderSkipped=s;return}if(r===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:l,reverse:u,top:d,bottom:h}=yD(n);r==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?r=d:(e._bottom||0)===i?r=h:(s[vg(h,a,l,u)]=!0,r=d)),s[vg(r,a,l,u)]=!0,n.borderSkipped=s}function vg(n,t,e,i){return i?(n=bD(n,t,e),n=Sg(n,e,t)):n=Sg(n,t,e),n}function bD(n,t,e){return n===t?e:n===e?t:n}function Sg(n,t,e){return n==="start"?t:n==="end"?e:n}function xD(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class Tg extends Ei{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,i,r){return wg(t,e,i,r)}parseArrayData(t,e,i,r){return wg(t,e,i,r)}parseObjectData(t,e,i,r){const{iScale:s,vScale:a}=t,{xAxisKey:l="x",yAxisKey:u="y"}=this._parsing,d=s.axis==="x"?l:u,h=a.axis==="x"?l:u,g=[];let y,_,x,v;for(y=i,_=i+r;y<_;++y)v=e[y],x={},x[s.axis]=s.parse(Mi(v,d),y),g.push(xg(Mi(v,h),x,a,y));return g}updateRangeFromParsed(t,e,i,r){super.updateRangeFromParsed(t,e,i,r);const s=i._custom;s&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:r}=e,s=this.getParsed(t),a=s._custom,l=cu(a)?"["+a.start+", "+a.end+"]":""+r.getLabelForValue(s[r.axis]);return{label:""+i.getLabelForValue(s[i.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,r){const s=r==="reset",{index:a,_cachedMeta:{vScale:l}}=this,u=l.getBasePixel(),d=l.isHorizontal(),h=this._getRuler(),{sharedOptions:g,includeOptions:y}=this._getSharedOptions(e,r);for(let _=e;_<e+i;_++){const x=this.getParsed(_),v=s||xt(x[l.axis])?{base:u,head:u}:this._calculateBarValuePixels(_),M=this._calculateBarIndexPixels(_,h),C=(x._stacks||{})[l.axis],R={horizontal:d,base:v.base,enableBorderRadius:!C||cu(x._custom)||a===C._top||a===C._bottom,x:d?v.head:M.center,y:d?M.center:v.head,height:d?M.size:Math.abs(v.size),width:d?Math.abs(v.size):M.size};y&&(R.options=g||this.resolveDataElementOptions(_,t[_].active?"active":r));const F=R.options||t[_].options;_D(R,F,C,a),xD(R,F,h.ratio),this.updateElement(t[_],_,R,r)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,r=i.getMatchingVisibleMetas(this._type).filter(h=>h.controller.options.grouped),s=i.options.stacked,a=[],l=this._cachedMeta.controller.getParsed(e),u=l&&l[i.axis],d=h=>{const g=h._parsed.find(_=>_[i.axis]===u),y=g&&g[h.vScale.axis];if(xt(y)||isNaN(y))return!0};for(const h of r)if(!(e!==void 0&&d(h))&&((s===!1||a.indexOf(h.stack)===-1||s===void 0&&h.stack===void 0)&&a.push(h.stack),h.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[Mt(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){const r=this._getStacks(t,i),s=e!==void 0?r.indexOf(e):-1;return s===-1?r.length-1:s}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,r=[];let s,a;for(s=0,a=e.data.length;s<a;++s)r.push(i.getPixelForValue(this.getParsed(s)[i.axis],s));const l=t.barThickness;return{min:l||fD(e),pixels:r,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:l?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:r},options:{base:s,minBarLength:a}}=this,l=s||0,u=this.getParsed(t),d=u._custom,h=cu(d);let g=u[e.axis],y=0,_=i?this.applyStack(e,u,i):g,x,v;_!==g&&(y=_-g,_=g),h&&(g=d.barStart,_=d.barEnd-d.barStart,g!==0&&Yn(g)!==Yn(d.barEnd)&&(y=0),y+=g);const M=!xt(s)&&!h?s:y;let C=e.getPixelForValue(M);if(this.chart.getDataVisibility(t)?x=e.getPixelForValue(y+_):x=C,v=x-C,Math.abs(v)<a){v=mD(v,e,l)*a,g===l&&(C-=v/2);const R=e.getPixelForDecimal(0),F=e.getPixelForDecimal(1),I=Math.min(R,F),L=Math.max(R,F);C=Math.max(Math.min(C,L),I),x=C+v,i&&!h&&(u._stacks[e.axis]._visualValues[r]=e.getValueForPixel(x)-e.getValueForPixel(C))}if(C===e.getPixelForValue(l)){const R=Yn(v)*e.getLineWidthForValue(l)/2;C+=R,v-=R}return{size:v,base:C,head:x,center:x+v/2}}_calculateBarIndexPixels(t,e){const i=e.scale,r=this.options,s=r.skipNull,a=Mt(r.maxBarThickness,1/0);let l,u;const d=this._getAxisCount();if(e.grouped){const h=s?this._getStackCount(t):e.stackCount,g=r.barThickness==="flex"?pD(t,e,r,h*d):hD(t,e,r,h*d),y=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,_=this._getAxis().indexOf(Mt(y,this.getFirstScaleIdForIndexAxis())),x=this._getStackIndex(this.index,this._cachedMeta.stack,s?t:void 0)+_;l=g.start+g.chunk*x+g.chunk/2,u=Math.min(a,g.chunk*g.ratio)}else l=i.getPixelForValue(this.getParsed(t)[i.axis],t),u=Math.min(a,e.min*e.ratio);return{base:l-u/2,head:l+u/2,center:l,size:u}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,r=i.length;let s=0;for(;s<r;++s)this.getParsed(s)[e.axis]!==null&&!i[s].hidden&&i[s].draw(this._ctx)}}class wD extends Ei{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,r){const s=super.parsePrimitiveData(t,e,i,r);for(let a=0;a<s.length;a++)s[a]._custom=this.resolveDataElementOptions(a+i).radius;return s}parseArrayData(t,e,i,r){const s=super.parseArrayData(t,e,i,r);for(let a=0;a<s.length;a++){const l=e[i+a];s[a]._custom=Mt(l[2],this.resolveDataElementOptions(a+i).radius)}return s}parseObjectData(t,e,i,r){const s=super.parseObjectData(t,e,i,r);for(let a=0;a<s.length;a++){const l=e[i+a];s[a]._custom=Mt(l&&l.r&&+l.r,this.resolveDataElementOptions(a+i).radius)}return s}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:s}=e,a=this.getParsed(t),l=r.getLabelForValue(a.x),u=s.getLabelForValue(a.y),d=a._custom;return{label:i[t]||"",value:"("+l+", "+u+(d?", "+d:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,r){const s=r==="reset",{iScale:a,vScale:l}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,r),h=a.axis,g=l.axis;for(let y=e;y<e+i;y++){const _=t[y],x=!s&&this.getParsed(y),v={},M=v[h]=s?a.getPixelForDecimal(.5):a.getPixelForValue(x[h]),C=v[g]=s?l.getBasePixel():l.getPixelForValue(x[g]);v.skip=isNaN(M)||isNaN(C),d&&(v.options=u||this.resolveDataElementOptions(y,_.active?"active":r),s&&(v.options.radius=0)),this.updateElement(_,y,v,r)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let r=super.resolveDataElementOptions(t,e);r.$shared&&(r=Object.assign({},r,{$shared:!1}));const s=r.radius;return e!=="active"&&(r.radius=0),r.radius+=Mt(i&&i._custom,s),r}}function vD(n,t,e){let i=1,r=1,s=0,a=0;if(t<te){const l=n,u=l+t,d=Math.cos(l),h=Math.sin(l),g=Math.cos(u),y=Math.sin(u),_=(F,I,L)=>Ws(F,l,u,!0)?1:Math.max(I,I*e,L,L*e),x=(F,I,L)=>Ws(F,l,u,!0)?-1:Math.min(I,I*e,L,L*e),v=_(0,d,g),M=_(re,h,y),C=x(Rt,d,g),R=x(Rt+re,h,y);i=(v-C)/2,r=(M-R)/2,s=-(v+C)/2,a=-(M+R)/2}return{ratioX:i,ratioY:r,offsetX:s,offsetY:a}}class Xs extends Ei{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data,{labels:{pointStyle:i,textAlign:r,color:s,useBorderRadius:a,borderRadius:l}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((u,d)=>{const g=t.getDatasetMeta(0).controller.getStyle(d);return{text:u,fillStyle:g.backgroundColor,fontColor:s,hidden:!t.getDataVisibility(d),lineDash:g.borderDash,lineDashOffset:g.borderDashOffset,lineJoin:g.borderJoinStyle,lineWidth:g.borderWidth,strokeStyle:g.borderColor,textAlign:r,pointStyle:i,borderRadius:a&&(l||g.borderRadius),index:d}}):[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=i;else{let s=u=>+i[u];if(Pt(i[t])){const{key:u="value"}=this._parsing;s=d=>+Mi(i[d],u)}let a,l;for(a=t,l=t+e;a<l;++a)r._parsed[a]=s(a)}}_getRotation(){return xe(this.options.rotation-90)}_getCircumference(){return xe(this.options.circumference)}_getRotationExtents(){let t=te,e=-te;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const r=this.chart.getDatasetMeta(i).controller,s=r._getRotation(),a=r._getCircumference();t=Math.min(t,s),e=Math.max(e,s+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,r=this._cachedMeta,s=r.data,a=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,l=Math.max((Math.min(i.width,i.height)-a)/2,0),u=Math.min(IM(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:h,rotation:g}=this._getRotationExtents(),{ratioX:y,ratioY:_,offsetX:x,offsetY:v}=vD(g,h,u),M=(i.width-a)/y,C=(i.height-a)/_,R=Math.max(Math.min(M,C)/2,0),F=Dp(this.options.radius,R),I=Math.max(F*u,0),L=(F-I)/this._getVisibleDatasetWeightTotal();this.offsetX=x*F,this.offsetY=v*F,r.total=this.calculateTotal(),this.outerRadius=F-L*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-L*d,0),this.updateElements(s,0,s.length,t)}_circumference(t,e){const i=this.options,r=this._cachedMeta,s=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||r._parsed[t]===null||r.data[t].hidden?0:this.calculateCircumference(r._parsed[t]*s/te)}updateElements(t,e,i,r){const s=r==="reset",a=this.chart,l=a.chartArea,d=a.options.animation,h=(l.left+l.right)/2,g=(l.top+l.bottom)/2,y=s&&d.animateScale,_=y?0:this.innerRadius,x=y?0:this.outerRadius,{sharedOptions:v,includeOptions:M}=this._getSharedOptions(e,r);let C=this._getRotation(),R;for(R=0;R<e;++R)C+=this._circumference(R,s);for(R=e;R<e+i;++R){const F=this._circumference(R,s),I=t[R],L={x:h+this.offsetX,y:g+this.offsetY,startAngle:C,endAngle:C+F,circumference:F,outerRadius:x,innerRadius:_};M&&(L.options=v||this.resolveDataElementOptions(R,I.active?"active":r)),C+=F,this.updateElement(I,R,L,r)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,r;for(r=0;r<e.length;r++){const s=t._parsed[r];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(r)&&!e[r].hidden&&(i+=Math.abs(s))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?te*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=$s(e._parsed[t],i.options.locale);return{label:r[t]||"",value:s}}getMaxBorderWidth(t){let e=0;const i=this.chart;let r,s,a,l,u;if(!t){for(r=0,s=i.data.datasets.length;r<s;++r)if(i.isDatasetVisible(r)){a=i.getDatasetMeta(r),t=a.data,l=a.controller;break}}if(!t)return 0;for(r=0,s=t.length;r<s;++r)u=l.resolveDataElementOptions(r),u.borderAlign!=="inner"&&(e=Math.max(e,u.borderWidth||0,u.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,r=t.length;i<r;++i){const s=this.resolveDataElementOptions(i);e=Math.max(e,s.offset||0,s.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(Mt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class Mg extends Ei{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:r=[],_dataset:s}=e,a=this.chart._animationsDisabled;let{start:l,count:u}=zp(e,r,a);this._drawStart=l,this._drawCount=u,Up(e)&&(l=0,u=r.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!s._decimated,i.points=r;const d=this.resolveDatasetElementOptions(t);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:d},t),this.updateElements(r,l,u,t)}updateElements(t,e,i,r){const s=r==="reset",{iScale:a,vScale:l,_stacked:u,_dataset:d}=this._cachedMeta,{sharedOptions:h,includeOptions:g}=this._getSharedOptions(e,r),y=a.axis,_=l.axis,{spanGaps:x,segment:v}=this.options,M=Di(x)?x:Number.POSITIVE_INFINITY,C=this.chart._animationsDisabled||s||r==="none",R=e+i,F=t.length;let I=e>0&&this.getParsed(e-1);for(let L=0;L<F;++L){const N=t[L],B=C?N:{};if(L<e||L>=R){B.skip=!0;continue}const T=this.getParsed(L),S=xt(T[_]),O=B[y]=a.getPixelForValue(T[y],L),U=B[_]=s||S?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,T,u):T[_],L);B.skip=isNaN(O)||isNaN(U)||S,B.stop=L>0&&Math.abs(T[y]-I[y])>M,v&&(B.parsed=T,B.raw=d.data[L]),g&&(B.options=h||this.resolveDataElementOptions(L,N.active?"active":r)),C||this.updateElement(N,L,B,r),I=T}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,r=t.data||[];if(!r.length)return i;const s=r[0].size(this.resolveDataElementOptions(0)),a=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(i,s,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class kg extends Ei{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return e.labels.map((s,a)=>{const u=t.getDatasetMeta(0).controller.getStyle(a);return{text:s,fillStyle:u.backgroundColor,strokeStyle:u.borderColor,fontColor:r,lineWidth:u.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=$s(e._parsed[t].r,i.options.locale);return{label:r[t]||"",value:s}}parseObjectData(t,e,i,r){return tg.bind(this)(t,e,i,r)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,r)=>{const s=this.getParsed(r).r;!isNaN(s)&&this.chart.getDataVisibility(r)&&(s<e.min&&(e.min=s),s>e.max&&(e.max=s))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,r=Math.min(e.right-e.left,e.bottom-e.top),s=Math.max(r/2,0),a=Math.max(i.cutoutPercentage?s/100*i.cutoutPercentage:1,0),l=(s-a)/t.getVisibleDatasetCount();this.outerRadius=s-l*this.index,this.innerRadius=this.outerRadius-l}updateElements(t,e,i,r){const s=r==="reset",a=this.chart,u=a.options.animation,d=this._cachedMeta.rScale,h=d.xCenter,g=d.yCenter,y=d.getIndexAngle(0)-.5*Rt;let _=y,x;const v=360/this.countVisibleElements();for(x=0;x<e;++x)_+=this._computeAngle(x,r,v);for(x=e;x<e+i;x++){const M=t[x];let C=_,R=_+this._computeAngle(x,r,v),F=a.getDataVisibility(x)?d.getDistanceFromCenterForValue(this.getParsed(x).r):0;_=R,s&&(u.animateScale&&(F=0),u.animateRotate&&(C=R=y));const I={x:h,y:g,innerRadius:0,outerRadius:F,startAngle:C,endAngle:R,options:this.resolveDataElementOptions(x,M.active?"active":r)};this.updateElement(M,x,I,r)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,r)=>{!isNaN(this.getParsed(r).r)&&this.chart.getDataVisibility(r)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?xe(this.resolveDataElementOptions(t,e).angle||i):0}}class SD extends Xs{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class TD extends Ei{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,r){return tg.bind(this)(t,e,i,r)}update(t){const e=this._cachedMeta,i=e.dataset,r=e.data||[],s=e.iScale.getLabels();if(i.points=r,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const l={_loop:!0,_fullLoop:s.length===r.length,options:a};this.updateElement(i,void 0,l,t)}this.updateElements(r,0,r.length,t)}updateElements(t,e,i,r){const s=this._cachedMeta.rScale,a=r==="reset";for(let l=e;l<e+i;l++){const u=t[l],d=this.resolveDataElementOptions(l,u.active?"active":r),h=s.getPointPositionForValue(l,this.getParsed(l).r),g=a?s.xCenter:h.x,y=a?s.yCenter:h.y,_={x:g,y,angle:h.angle,skip:isNaN(g)||isNaN(y),options:d};this.updateElement(u,l,_,r)}}}class Dg extends Ei{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:s}=e,a=this.getParsed(t),l=r.getLabelForValue(a.x),u=s.getLabelForValue(a.y);return{label:i[t]||"",value:"("+l+", "+u+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,r=this.chart._animationsDisabled;let{start:s,count:a}=zp(e,i,r);if(this._drawStart=s,this._drawCount=a,Up(e)&&(s=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:l,_dataset:u}=e;l._chart=this.chart,l._datasetIndex=this.index,l._decimated=!!u._decimated,l.points=i;const d=this.resolveDatasetElementOptions(t);d.segment=this.options.segment,this.updateElement(l,void 0,{animated:!r,options:d},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,s,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,r){const s=r==="reset",{iScale:a,vScale:l,_stacked:u,_dataset:d}=this._cachedMeta,h=this.resolveDataElementOptions(e,r),g=this.getSharedOptions(h),y=this.includeOptions(r,g),_=a.axis,x=l.axis,{spanGaps:v,segment:M}=this.options,C=Di(v)?v:Number.POSITIVE_INFINITY,R=this.chart._animationsDisabled||s||r==="none";let F=e>0&&this.getParsed(e-1);for(let I=e;I<e+i;++I){const L=t[I],N=this.getParsed(I),B=R?L:{},T=xt(N[x]),S=B[_]=a.getPixelForValue(N[_],I),O=B[x]=s||T?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,N,u):N[x],I);B.skip=isNaN(S)||isNaN(O)||T,B.stop=I>0&&Math.abs(N[_]-F[_])>C,M&&(B.parsed=N,B.raw=d.data[I]),y&&(B.options=g||this.resolveDataElementOptions(I,L.active?"active":r)),R||this.updateElement(L,I,B,r),F=N}this.updateSharedOptions(g,r,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let l=0;for(let u=e.length-1;u>=0;--u)l=Math.max(l,e[u].size(this.resolveDataElementOptions(u))/2);return l>0&&l}const i=t.dataset,r=i.options&&i.options.borderWidth||0;if(!e.length)return r;const s=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(r,s,a)/2}}var MD=Object.freeze({__proto__:null,BarController:Tg,BubbleController:wD,DoughnutController:Xs,LineController:Mg,PieController:SD,PolarAreaController:kg,RadarController:TD,ScatterController:Dg});function ur(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class uu{static override(t){Object.assign(uu.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return ur()}parse(){return ur()}format(){return ur()}add(){return ur()}diff(){return ur()}startOf(){return ur()}endOf(){return ur()}}var Cg={_date:uu};function kD(n,t,e,i){const{controller:r,data:s,_sorted:a}=n,l=r._cachedMeta.iScale,u=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(l&&t===l.axis&&t!=="r"&&a&&s.length){const d=l._reversePixels?qM:ii;if(i){if(r._sharedOptions){const h=s[0],g=typeof h.getRange=="function"&&h.getRange(t);if(g){const y=d(s,t,e-g),_=d(s,t,e+g);return{lo:y.lo,hi:_.hi}}}}else{const h=d(s,t,e);if(u){const{vScale:g}=r._cachedMeta,{_parsed:y}=n,_=y.slice(0,h.lo+1).reverse().findIndex(v=>!xt(v[g.axis]));h.lo-=Math.max(0,_);const x=y.slice(h.hi).findIndex(v=>!xt(v[g.axis]));h.hi+=Math.max(0,x)}return h}}return{lo:0,hi:s.length-1}}function Zs(n,t,e,i,r){const s=n.getSortedVisibleDatasetMetas(),a=e[t];for(let l=0,u=s.length;l<u;++l){const{index:d,data:h}=s[l],{lo:g,hi:y}=kD(s[l],t,a,r);for(let _=g;_<=y;++_){const x=h[_];x.skip||i(x,d,_)}}}function DD(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,r){const s=t?Math.abs(i.x-r.x):0,a=e?Math.abs(i.y-r.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(a,2))}}function du(n,t,e,i,r){const s=[];return!r&&!n.isPointInArea(t)||Zs(n,e,t,function(l,u,d){!r&&!ri(l,n.chartArea,0)||l.inRange(t.x,t.y,i)&&s.push({element:l,datasetIndex:u,index:d})},!0),s}function CD(n,t,e,i){let r=[];function s(a,l,u){const{startAngle:d,endAngle:h}=a.getProps(["startAngle","endAngle"],i),{angle:g}=wa(a,{x:t.x,y:t.y});Ws(g,d,h)&&r.push({element:a,datasetIndex:l,index:u})}return Zs(n,e,t,s),r}function OD(n,t,e,i,r,s){let a=[];const l=DD(e);let u=Number.POSITIVE_INFINITY;function d(h,g,y){const _=h.inRange(t.x,t.y,r);if(i&&!_)return;const x=h.getCenterPoint(r);if(!(!!s||n.isPointInArea(x))&&!_)return;const M=l(t,x);M<u?(a=[{element:h,datasetIndex:g,index:y}],u=M):M===u&&a.push({element:h,datasetIndex:g,index:y})}return Zs(n,e,t,d),a}function fu(n,t,e,i,r,s){return!s&&!n.isPointInArea(t)?[]:e==="r"&&!i?CD(n,t,e,r):OD(n,t,e,i,r,s)}function Og(n,t,e,i,r){const s=[],a=e==="x"?"inXRange":"inYRange";let l=!1;return Zs(n,e,t,(u,d,h)=>{u[a]&&u[a](t[e],r)&&(s.push({element:u,datasetIndex:d,index:h}),l=l||u.inRange(t.x,t.y,r))}),i&&!l?[]:s}var hu={evaluateInteractionItems:Zs,modes:{index(n,t,e,i){const r=Ai(t,n),s=e.axis||"x",a=e.includeInvisible||!1,l=e.intersect?du(n,r,s,i,a):fu(n,r,s,!1,i,a),u=[];return l.length?(n.getSortedVisibleDatasetMetas().forEach(d=>{const h=l[0].index,g=d.data[h];g&&!g.skip&&u.push({element:g,datasetIndex:d.index,index:h})}),u):[]},dataset(n,t,e,i){const r=Ai(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;let l=e.intersect?du(n,r,s,i,a):fu(n,r,s,!1,i,a);if(l.length>0){const u=l[0].datasetIndex,d=n.getDatasetMeta(u).data;l=[];for(let h=0;h<d.length;++h)l.push({element:d[h],datasetIndex:u,index:h})}return l},point(n,t,e,i){const r=Ai(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;return du(n,r,s,i,a)},nearest(n,t,e,i){const r=Ai(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;return fu(n,r,s,e.intersect,i,a)},x(n,t,e,i){const r=Ai(t,n);return Og(n,r,"x",e.intersect,i)},y(n,t,e,i){const r=Ai(t,n);return Og(n,r,"y",e.intersect,i)}}};const Ag=["left","top","right","bottom"];function Qs(n,t){return n.filter(e=>e.pos===t)}function Rg(n,t){return n.filter(e=>Ag.indexOf(e.pos)===-1&&e.box.axis===t)}function Js(n,t){return n.sort((e,i)=>{const r=t?i:e,s=t?e:i;return r.weight===s.weight?r.index-s.index:r.weight-s.weight})}function AD(n){const t=[];let e,i,r,s,a,l;for(e=0,i=(n||[]).length;e<i;++e)r=n[e],{position:s,options:{stack:a,stackWeight:l=1}}=r,t.push({index:e,box:r,pos:s,horizontal:r.isHorizontal(),weight:r.weight,stack:a&&s+a,stackWeight:l});return t}function RD(n){const t={};for(const e of n){const{stack:i,pos:r,stackWeight:s}=e;if(!i||!Ag.includes(r))continue;const a=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=s}return t}function ED(n,t){const e=RD(n),{vBoxMaxWidth:i,hBoxMaxHeight:r}=t;let s,a,l;for(s=0,a=n.length;s<a;++s){l=n[s];const{fullSize:u}=l.box,d=e[l.stack],h=d&&l.stackWeight/d.weight;l.horizontal?(l.width=h?h*i:u&&t.availableWidth,l.height=r):(l.width=i,l.height=h?h*r:u&&t.availableHeight)}return e}function PD(n){const t=AD(n),e=Js(t.filter(d=>d.box.fullSize),!0),i=Js(Qs(t,"left"),!0),r=Js(Qs(t,"right")),s=Js(Qs(t,"top"),!0),a=Js(Qs(t,"bottom")),l=Rg(t,"x"),u=Rg(t,"y");return{fullSize:e,leftAndTop:i.concat(s),rightAndBottom:r.concat(u).concat(a).concat(l),chartArea:Qs(t,"chartArea"),vertical:i.concat(r).concat(u),horizontal:s.concat(a).concat(l)}}function Eg(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Pg(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function ID(n,t,e,i){const{pos:r,box:s}=e,a=n.maxPadding;if(!Pt(r)){e.size&&(n[r]-=e.size);const g=i[e.stack]||{size:0,count:1};g.size=Math.max(g.size,e.horizontal?s.height:s.width),e.size=g.size/g.count,n[r]+=e.size}s.getPadding&&Pg(a,s.getPadding());const l=Math.max(0,t.outerWidth-Eg(a,n,"left","right")),u=Math.max(0,t.outerHeight-Eg(a,n,"top","bottom")),d=l!==n.w,h=u!==n.h;return n.w=l,n.h=u,e.horizontal?{same:d,other:h}:{same:h,other:d}}function LD(n){const t=n.maxPadding;function e(i){const r=Math.max(t[i]-n[i],0);return n[i]+=r,r}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function ND(n,t){const e=t.maxPadding;function i(r){const s={left:0,top:0,right:0,bottom:0};return r.forEach(a=>{s[a]=Math.max(t[a],e[a])}),s}return i(n?["left","right"]:["top","bottom"])}function to(n,t,e,i){const r=[];let s,a,l,u,d,h;for(s=0,a=n.length,d=0;s<a;++s){l=n[s],u=l.box,u.update(l.width||t.w,l.height||t.h,ND(l.horizontal,t));const{same:g,other:y}=ID(t,e,l,i);d|=g&&r.length,h=h||y,u.fullSize||r.push(l)}return d&&to(r,t,e,i)||h}function Aa(n,t,e,i,r){n.top=e,n.left=t,n.right=t+i,n.bottom=e+r,n.width=i,n.height=r}function Ig(n,t,e,i){const r=e.padding;let{x:s,y:a}=t;for(const l of n){const u=l.box,d=i[l.stack]||{placed:0,weight:1},h=l.stackWeight/d.weight||1;if(l.horizontal){const g=t.w*h,y=d.size||u.height;en(d.start)&&(a=d.start),u.fullSize?Aa(u,r.left,a,e.outerWidth-r.right-r.left,y):Aa(u,t.left+d.placed,a,g,y),d.start=a,d.placed+=g,a=u.bottom}else{const g=t.h*h,y=d.size||u.width;en(d.start)&&(s=d.start),u.fullSize?Aa(u,s,r.top,y,e.outerHeight-r.bottom-r.top):Aa(u,s,t.top+d.placed,y,g),d.start=s,d.placed+=g,s=u.right}}t.x=s,t.y=a}var We={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const r=we(n.options.layout.padding),s=Math.max(t-r.width,0),a=Math.max(e-r.height,0),l=PD(n.boxes),u=l.vertical,d=l.horizontal;Jt(n.boxes,v=>{typeof v.beforeLayout=="function"&&v.beforeLayout()});const h=u.reduce((v,M)=>M.box.options&&M.box.options.display===!1?v:v+1,0)||1,g=Object.freeze({outerWidth:t,outerHeight:e,padding:r,availableWidth:s,availableHeight:a,vBoxMaxWidth:s/2/h,hBoxMaxHeight:a/2}),y=Object.assign({},r);Pg(y,we(i));const _=Object.assign({maxPadding:y,w:s,h:a,x:r.left,y:r.top},r),x=ED(u.concat(d),g);to(l.fullSize,_,g,x),to(u,_,g,x),to(d,_,g,x)&&to(u,_,g,x),LD(_),Ig(l.leftAndTop,_,g,x),_.x+=_.w,_.y+=_.h,Ig(l.rightAndBottom,_,g,x),n.chartArea={left:_.left,top:_.top,right:_.left+_.w,bottom:_.top+_.h,height:_.h,width:_.w},Jt(l.chartArea,v=>{const M=v.box;Object.assign(M,n.chartArea),M.update(_.w,_.h,{left:0,top:0,right:0,bottom:0})})}};class Lg{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,r){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,r?Math.floor(e/r):i)}}isAttached(t){return!0}updateConfig(t){}}class BD extends Lg{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ra="$chartjs",FD={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ng=n=>n===null||n==="";function zD(n,t){const e=n.style,i=n.getAttribute("height"),r=n.getAttribute("width");if(n[Ra]={initial:{height:i,width:r,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Ng(r)){const s=ig(n,"width");s!==void 0&&(n.width=s)}if(Ng(i))if(n.style.height==="")n.height=n.width/(t||2);else{const s=ig(n,"height");s!==void 0&&(n.height=s)}return n}const Bg=zk?{passive:!0}:!1;function UD(n,t,e){n&&n.addEventListener(t,e,Bg)}function HD(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,Bg)}function WD(n,t){const e=FD[n.type]||n.type,{x:i,y:r}=Ai(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:r!==void 0?r:null}}function Ea(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function VD(n,t,e){const i=n.canvas,r=new MutationObserver(s=>{let a=!1;for(const l of s)a=a||Ea(l.addedNodes,i),a=a&&!Ea(l.removedNodes,i);a&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}function $D(n,t,e){const i=n.canvas,r=new MutationObserver(s=>{let a=!1;for(const l of s)a=a||Ea(l.removedNodes,i),a=a&&!Ea(l.addedNodes,i);a&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}const eo=new Map;let Fg=0;function zg(){const n=window.devicePixelRatio;n!==Fg&&(Fg=n,eo.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function YD(n,t){eo.size||window.addEventListener("resize",zg),eo.set(n,t)}function qD(n){eo.delete(n),eo.size||window.removeEventListener("resize",zg)}function jD(n,t,e){const i=n.canvas,r=i&&ru(i);if(!r)return;const s=Fp((l,u)=>{const d=r.clientWidth;e(l,u),d<r.clientWidth&&e()},window),a=new ResizeObserver(l=>{const u=l[0],d=u.contentRect.width,h=u.contentRect.height;d===0&&h===0||s(d,h)});return a.observe(r),YD(n,s),a}function pu(n,t,e){e&&e.disconnect(),t==="resize"&&qD(n)}function GD(n,t,e){const i=n.canvas,r=Fp(s=>{n.ctx!==null&&e(WD(s,n))},n);return UD(i,t,r),r}class KD extends Lg{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(zD(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Ra])return!1;const i=e[Ra].initial;["height","width"].forEach(s=>{const a=i[s];xt(a)?e.removeAttribute(s):e.setAttribute(s,a)});const r=i.style||{};return Object.keys(r).forEach(s=>{e.style[s]=r[s]}),e.width=e.width,delete e[Ra],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const r=t.$proxies||(t.$proxies={}),a={attach:VD,detach:$D,resize:jD}[e]||GD;r[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),r=i[e];if(!r)return;({attach:pu,detach:pu,resize:pu}[e]||HD)(t,e,r),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,r){return Fk(t,e,i,r)}isAttached(t){const e=t&&ru(t);return!!(e&&e.isConnected)}}function XD(n){return!iu()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?BD:KD}class Ve{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Di(this.x)&&Di(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const r={};return t.forEach(s=>{r[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),r}}function ZD(n,t){const e=n.options.ticks,i=QD(n),r=Math.min(e.maxTicksLimit||i,i),s=e.major.enabled?tC(t):[],a=s.length,l=s[0],u=s[a-1],d=[];if(a>r)return eC(t,d,s,a/r),d;const h=JD(s,t,r);if(a>0){let g,y;const _=a>1?Math.round((u-l)/(a-1)):null;for(Pa(t,d,h,xt(_)?0:l-_,l),g=0,y=a-1;g<y;g++)Pa(t,d,h,s[g],s[g+1]);return Pa(t,d,h,u,xt(_)?t.length:u+_),d}return Pa(t,d,h),d}function QD(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),r=n._maxLength/e;return Math.floor(Math.min(i,r))}function JD(n,t,e){const i=nC(n),r=t.length/e;if(!i)return Math.max(r,1);const s=HM(i);for(let a=0,l=s.length-1;a<l;a++){const u=s[a];if(u>r)return u}return Math.max(r,1)}function tC(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function eC(n,t,e,i){let r=0,s=e[0],a;for(i=Math.ceil(i),a=0;a<n.length;a++)a===s&&(t.push(n[a]),r++,s=e[r*i])}function Pa(n,t,e,i,r){const s=Mt(i,0),a=Math.min(Mt(r,n.length),n.length);let l=0,u,d,h;for(e=Math.ceil(e),r&&(u=r-i,e=u/Math.floor(u/e)),h=s;h<0;)l++,h=Math.round(s+l*e);for(d=Math.max(s,0);d<a;d++)d===h&&(t.push(n[d]),l++,h=Math.round(s+l*e))}function nC(n){const t=n.length;let e,i;if(t<2)return!1;for(i=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==i)return!1;return i}const iC=n=>n==="left"?"right":n==="right"?"left":n,Ug=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,Hg=(n,t)=>Math.min(t||n,n);function Wg(n,t){const e=[],i=n.length/t,r=n.length;let s=0;for(;s<r;s+=i)e.push(n[Math.floor(s)]);return e}function rC(n,t,e){const i=n.ticks.length,r=Math.min(t,i-1),s=n._startPixel,a=n._endPixel,l=1e-6;let u=n.getPixelForTick(r),d;if(!(e&&(i===1?d=Math.max(u-s,a-u):t===0?d=(n.getPixelForTick(1)-u)/2:d=(u-n.getPixelForTick(r-1))/2,u+=r<t?d:-d,u<s-l||u>a+l)))return u}function sC(n,t){Jt(n,e=>{const i=e.gc,r=i.length/2;let s;if(r>t){for(s=0;s<r;++s)delete e.data[i[s]];i.splice(0,r)}})}function no(n){return n.drawTicks?n.tickLength:0}function Vg(n,t){if(!n.display)return 0;const e=le(n.font,t),i=we(n.padding);return(Yt(n.text)?n.text.length:1)*e.lineHeight+i.height}function oC(n,t){return Oi(n,{scale:t,type:"scale"})}function aC(n,t,e){return Oi(n,{tick:e,index:t,type:"tick"})}function lC(n,t,e){let i=jc(n);return(e&&t!=="right"||!e&&t==="right")&&(i=iC(i)),i}function cC(n,t,e,i){const{top:r,left:s,bottom:a,right:l,chart:u}=n,{chartArea:d,scales:h}=u;let g=0,y,_,x;const v=a-r,M=l-s;if(n.isHorizontal()){if(_=He(i,s,l),Pt(e)){const C=Object.keys(e)[0],R=e[C];x=h[C].getPixelForValue(R)+v-t}else e==="center"?x=(d.bottom+d.top)/2+v-t:x=Ug(n,e,t);y=l-s}else{if(Pt(e)){const C=Object.keys(e)[0],R=e[C];_=h[C].getPixelForValue(R)-M+t}else e==="center"?_=(d.left+d.right)/2-M+t:_=Ug(n,e,t);x=He(i,a,r),g=e==="left"?-re:re}return{titleX:_,titleY:x,maxWidth:y,rotation:g}}class dr extends Ve{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:r}=this;return t=pn(t,Number.POSITIVE_INFINITY),e=pn(e,Number.NEGATIVE_INFINITY),i=pn(i,Number.POSITIVE_INFINITY),r=pn(r,Number.NEGATIVE_INFINITY),{min:pn(t,i),max:pn(e,r),minDefined:ae(t),maxDefined:ae(e)}}getMinMax(t){let{min:e,max:i,minDefined:r,maxDefined:s}=this.getUserBounds(),a;if(r&&s)return{min:e,max:i};const l=this.getMatchingVisibleMetas();for(let u=0,d=l.length;u<d;++u)a=l[u].controller.getMinMax(this,t),r||(e=Math.min(e,a.min)),s||(i=Math.max(i,a.max));return e=s&&e>i?i:e,i=r&&e>i?e:i,{min:pn(e,pn(i,e)),max:pn(i,pn(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Qt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:r,grace:s,ticks:a}=this.options,l=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=mk(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const u=l<this.ticks.length;this._convertTicksToLabels(u?Wg(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=ZD(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),u&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Qt(this.options.afterUpdate,[this])}beforeSetDimensions(){Qt(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){Qt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Qt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Qt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,r,s;for(i=0,r=t.length;i<r;i++)s=t[i],s.label=Qt(e.callback,[s.value,i,t],this)}afterTickToLabelConversion(){Qt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Qt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=Hg(this.ticks.length,t.ticks.maxTicksLimit),r=e.minRotation||0,s=e.maxRotation;let a=r,l,u,d;if(!this._isVisible()||!e.display||r>=s||i<=1||!this.isHorizontal()){this.labelRotation=r;return}const h=this._getLabelSizes(),g=h.widest.width,y=h.highest.height,_=Ce(this.chart.width-g,0,this.maxWidth);l=t.offset?this.maxWidth/i:_/(i-1),g+6>l&&(l=_/(i-(t.offset?.5:1)),u=this.maxHeight-no(t.grid)-e.padding-Vg(t.title,this.chart.options.font),d=Math.sqrt(g*g+y*y),a=xa(Math.min(Math.asin(Ce((h.highest.height+6)/l,-1,1)),Math.asin(Ce(u/d,-1,1))-Math.asin(Ce(y/d,-1,1)))),a=Math.max(r,Math.min(s,a))),this.labelRotation=a}afterCalculateLabelRotation(){Qt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Qt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:r,grid:s}}=this,a=this._isVisible(),l=this.isHorizontal();if(a){const u=Vg(r,e.options.font);if(l?(t.width=this.maxWidth,t.height=no(s)+u):(t.height=this.maxHeight,t.width=no(s)+u),i.display&&this.ticks.length){const{first:d,last:h,widest:g,highest:y}=this._getLabelSizes(),_=i.padding*2,x=xe(this.labelRotation),v=Math.cos(x),M=Math.sin(x);if(l){const C=i.mirror?0:M*g.width+v*y.height;t.height=Math.min(this.maxHeight,t.height+C+_)}else{const C=i.mirror?0:v*g.width+M*y.height;t.width=Math.min(this.maxWidth,t.width+C+_)}this._calculatePadding(d,h,M,v)}}this._handleMargins(),l?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,r){const{ticks:{align:s,padding:a},position:l}=this.options,u=this.labelRotation!==0,d=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,g=this.right-this.getPixelForTick(this.ticks.length-1);let y=0,_=0;u?d?(y=r*t.width,_=i*e.height):(y=i*t.height,_=r*e.width):s==="start"?_=e.width:s==="end"?y=t.width:s!=="inner"&&(y=t.width/2,_=e.width/2),this.paddingLeft=Math.max((y-h+a)*this.width/(this.width-h),0),this.paddingRight=Math.max((_-g+a)*this.width/(this.width-g),0)}else{let h=e.height/2,g=t.height/2;s==="start"?(h=0,g=t.height):s==="end"&&(h=e.height,g=0),this.paddingTop=h+a,this.paddingBottom=g+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Qt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)xt(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=Wg(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:r,_longestTextCache:s}=this,a=[],l=[],u=Math.floor(e/Hg(e,i));let d=0,h=0,g,y,_,x,v,M,C,R,F,I,L;for(g=0;g<e;g+=u){if(x=t[g].label,v=this._resolveTickFontOptions(g),r.font=M=v.string,C=s[M]=s[M]||{data:{},gc:[]},R=v.lineHeight,F=I=0,!xt(x)&&!Yt(x))F=Ma(r,C.data,C.gc,F,x),I=R;else if(Yt(x))for(y=0,_=x.length;y<_;++y)L=x[y],!xt(L)&&!Yt(L)&&(F=Ma(r,C.data,C.gc,F,L),I+=R);a.push(F),l.push(I),d=Math.max(F,d),h=Math.max(I,h)}sC(s,e);const N=a.indexOf(d),B=l.indexOf(h),T=S=>({width:a[S]||0,height:l[S]||0});return{first:T(0),last:T(e-1),widest:T(N),highest:T(B),widths:a,heights:l}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return YM(this._alignToPixels?or(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=aC(this.getContext(),t,i))}return this.$context||(this.$context=oC(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=xe(this.labelRotation),i=Math.abs(Math.cos(e)),r=Math.abs(Math.sin(e)),s=this._getLabelSizes(),a=t.autoSkipPadding||0,l=s?s.widest.width+a:0,u=s?s.highest.height+a:0;return this.isHorizontal()?u*i>l*r?l/i:u/r:u*r<l*i?u/i:l/r}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,r=this.options,{grid:s,position:a,border:l}=r,u=s.offset,d=this.isHorizontal(),g=this.ticks.length+(u?1:0),y=no(s),_=[],x=l.setContext(this.getContext()),v=x.display?x.width:0,M=v/2,C=function(q){return or(i,q,v)};let R,F,I,L,N,B,T,S,O,U,$,it;if(a==="top")R=C(this.bottom),B=this.bottom-y,S=R-M,U=C(t.top)+M,it=t.bottom;else if(a==="bottom")R=C(this.top),U=t.top,it=C(t.bottom)-M,B=R+M,S=this.top+y;else if(a==="left")R=C(this.right),N=this.right-y,T=R-M,O=C(t.left)+M,$=t.right;else if(a==="right")R=C(this.left),O=t.left,$=C(t.right)-M,N=R+M,T=this.left+y;else if(e==="x"){if(a==="center")R=C((t.top+t.bottom)/2+.5);else if(Pt(a)){const q=Object.keys(a)[0],J=a[q];R=C(this.chart.scales[q].getPixelForValue(J))}U=t.top,it=t.bottom,B=R+M,S=B+y}else if(e==="y"){if(a==="center")R=C((t.left+t.right)/2);else if(Pt(a)){const q=Object.keys(a)[0],J=a[q];R=C(this.chart.scales[q].getPixelForValue(J))}N=R-M,T=N-y,O=t.left,$=t.right}const at=Mt(r.ticks.maxTicksLimit,g),ot=Math.max(1,Math.ceil(g/at));for(F=0;F<g;F+=ot){const q=this.getContext(F),J=s.setContext(q),rt=l.setContext(q),tt=J.lineWidth,G=J.color,P=rt.dash||[],W=rt.dashOffset,j=J.tickWidth,pt=J.tickColor,lt=J.tickBorderDash||[],et=J.tickBorderDashOffset;I=rC(this,F,u),I!==void 0&&(L=or(i,I,tt),d?N=T=O=$=L:B=S=U=it=L,_.push({tx1:N,ty1:B,tx2:T,ty2:S,x1:O,y1:U,x2:$,y2:it,width:tt,color:G,borderDash:P,borderDashOffset:W,tickWidth:j,tickColor:pt,tickBorderDash:lt,tickBorderDashOffset:et}))}return this._ticksLength=g,this._borderValue=R,_}_computeLabelItems(t){const e=this.axis,i=this.options,{position:r,ticks:s}=i,a=this.isHorizontal(),l=this.ticks,{align:u,crossAlign:d,padding:h,mirror:g}=s,y=no(i.grid),_=y+h,x=g?-h:_,v=-xe(this.labelRotation),M=[];let C,R,F,I,L,N,B,T,S,O,U,$,it="middle";if(r==="top")N=this.bottom-x,B=this._getXAxisLabelAlignment();else if(r==="bottom")N=this.top+x,B=this._getXAxisLabelAlignment();else if(r==="left"){const ot=this._getYAxisLabelAlignment(y);B=ot.textAlign,L=ot.x}else if(r==="right"){const ot=this._getYAxisLabelAlignment(y);B=ot.textAlign,L=ot.x}else if(e==="x"){if(r==="center")N=(t.top+t.bottom)/2+_;else if(Pt(r)){const ot=Object.keys(r)[0],q=r[ot];N=this.chart.scales[ot].getPixelForValue(q)+_}B=this._getXAxisLabelAlignment()}else if(e==="y"){if(r==="center")L=(t.left+t.right)/2-_;else if(Pt(r)){const ot=Object.keys(r)[0],q=r[ot];L=this.chart.scales[ot].getPixelForValue(q)}B=this._getYAxisLabelAlignment(y).textAlign}e==="y"&&(u==="start"?it="top":u==="end"&&(it="bottom"));const at=this._getLabelSizes();for(C=0,R=l.length;C<R;++C){F=l[C],I=F.label;const ot=s.setContext(this.getContext(C));T=this.getPixelForTick(C)+s.labelOffset,S=this._resolveTickFontOptions(C),O=S.lineHeight,U=Yt(I)?I.length:1;const q=U/2,J=ot.color,rt=ot.textStrokeColor,tt=ot.textStrokeWidth;let G=B;a?(L=T,B==="inner"&&(C===R-1?G=this.options.reverse?"left":"right":C===0?G=this.options.reverse?"right":"left":G="center"),r==="top"?d==="near"||v!==0?$=-U*O+O/2:d==="center"?$=-at.highest.height/2-q*O+O:$=-at.highest.height+O/2:d==="near"||v!==0?$=O/2:d==="center"?$=at.highest.height/2-q*O:$=at.highest.height-U*O,g&&($*=-1),v!==0&&!ot.showLabelBackdrop&&(L+=O/2*Math.sin(v))):(N=T,$=(1-U)*O/2);let P;if(ot.showLabelBackdrop){const W=we(ot.backdropPadding),j=at.heights[C],pt=at.widths[C];let lt=$-W.top,et=0-W.left;switch(it){case"middle":lt-=j/2;break;case"bottom":lt-=j;break}switch(B){case"center":et-=pt/2;break;case"right":et-=pt;break;case"inner":C===R-1?et-=pt:C>0&&(et-=pt/2);break}P={left:et,top:lt,width:pt+W.width,height:j+W.height,color:ot.backdropColor}}M.push({label:I,font:S,textOffset:$,options:{rotation:v,color:J,strokeColor:rt,strokeWidth:tt,textAlign:G,textBaseline:it,translation:[L,N],backdrop:P}})}return M}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-xe(this.labelRotation))return t==="top"?"left":"right";let r="center";return e.align==="start"?r="left":e.align==="end"?r="right":e.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:r,padding:s}}=this.options,a=this._getLabelSizes(),l=t+s,u=a.widest.width;let d,h;return e==="left"?r?(h=this.right+s,i==="near"?d="left":i==="center"?(d="center",h+=u/2):(d="right",h+=u)):(h=this.right-l,i==="near"?d="right":i==="center"?(d="center",h-=u/2):(d="left",h=this.left)):e==="right"?r?(h=this.left+s,i==="near"?d="right":i==="center"?(d="center",h-=u/2):(d="left",h-=u)):(h=this.left+l,i==="near"?d="left":i==="center"?(d="center",h+=u/2):(d="right",h=this.right)):d="right",{textAlign:d,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:r,width:s,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,r,s,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const r=this.ticks.findIndex(s=>s.value===t);return r>=0?e.setContext(this.getContext(r)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,a;const l=(u,d,h)=>{!h.width||!h.color||(i.save(),i.lineWidth=h.width,i.strokeStyle=h.color,i.setLineDash(h.borderDash||[]),i.lineDashOffset=h.borderDashOffset,i.beginPath(),i.moveTo(u.x,u.y),i.lineTo(d.x,d.y),i.stroke(),i.restore())};if(e.display)for(s=0,a=r.length;s<a;++s){const u=r[s];e.drawOnChartArea&&l({x:u.x1,y:u.y1},{x:u.x2,y:u.y2},u),e.drawTicks&&l({x:u.tx1,y:u.ty1},{x:u.tx2,y:u.ty2},{color:u.tickColor,width:u.tickWidth,borderDash:u.tickBorderDash,borderDashOffset:u.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:r}}=this,s=i.setContext(this.getContext()),a=i.display?s.width:0;if(!a)return;const l=r.setContext(this.getContext(0)).lineWidth,u=this._borderValue;let d,h,g,y;this.isHorizontal()?(d=or(t,this.left,a)-a/2,h=or(t,this.right,l)+l/2,g=y=u):(g=or(t,this.top,a)-a/2,y=or(t,this.bottom,l)+l/2,d=h=u),e.save(),e.lineWidth=s.width,e.strokeStyle=s.color,e.beginPath(),e.moveTo(d,g),e.lineTo(h,y),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,r=this._computeLabelArea();r&&qs(i,r);const s=this.getLabelItems(t);for(const a of s){const l=a.options,u=a.font,d=a.label,h=a.textOffset;ar(i,d,0,h,u,l)}r&&js(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:r}}=this;if(!i.display)return;const s=le(i.font),a=we(i.padding),l=i.align;let u=s.lineHeight/2;e==="bottom"||e==="center"||Pt(e)?(u+=a.bottom,Yt(i.text)&&(u+=s.lineHeight*(i.text.length-1))):u+=a.top;const{titleX:d,titleY:h,maxWidth:g,rotation:y}=cC(this,u,e,l);ar(t,i.text,0,0,s,{color:i.color,maxWidth:g,rotation:y,textAlign:lC(l,e,r),textBaseline:"middle",translation:[d,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=Mt(t.grid&&t.grid.z,-1),r=Mt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==dr.prototype.draw?[{z:e,draw:s=>{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:e,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",r=[];let s,a;for(s=0,a=e.length;s<a;++s){const l=e[s];l[i]===this.id&&(!t||l.type===t)&&r.push(l)}return r}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return le(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ia{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;fC(e)&&(i=this.register(e));const r=this.items,s=t.id,a=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+t);return s in r||(r[s]=t,uC(t,a,i),this.override&&se.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,r=this.scope;i in e&&delete e[i],r&&i in se[r]&&(delete se[r][i],this.override&&delete sr[i])}}function uC(n,t,e){const i=zs(Object.create(null),[e?se.get(e):{},se.get(t),n.defaults]);se.set(t,i),n.defaultRoutes&&dC(t,n.defaultRoutes),n.descriptors&&se.describe(t,n.descriptors)}function dC(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),r=i.pop(),s=[n].concat(i).join("."),a=t[e].split("."),l=a.pop(),u=a.join(".");se.route(s,r,u,l)})}function fC(n){return"id"in n&&"defaults"in n}class hC{constructor(){this.controllers=new Ia(Ei,"datasets",!0),this.elements=new Ia(Ve,"elements"),this.plugins=new Ia(Object,"plugins"),this.scales=new Ia(dr,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(r=>{const s=i||this._getRegistryForType(r);i||s.isForType(r)||s===this.plugins&&r.id?this._exec(t,s,r):Jt(r,a=>{const l=i||this._getRegistryForType(a);this._exec(t,l,a)})})}_exec(t,e,i){const r=$c(t);Qt(i["before"+r],[],i),e[t](i),Qt(i["after"+r],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const r=e.get(t);if(r===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return r}}var qn=new hC;class pC{constructor(){this._init=void 0}notify(t,e,i,r){if(e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const s=r?this._descriptors(t).filter(r):this._descriptors(t),a=this._notify(s,t,e,i);return e==="afterDestroy"&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),a}_notify(t,e,i,r){r=r||{};for(const s of t){const a=s.plugin,l=a[i],u=[e,r,s.options];if(Qt(l,u,a)===!1&&r.cancelable)return!1}return!0}invalidate(){xt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,r=Mt(i.options&&i.options.plugins,{}),s=gC(i);return r===!1&&!e?[]:yC(t,s,r,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,r=(s,a)=>s.filter(l=>!a.some(u=>l.plugin.id===u.plugin.id));this._notify(r(e,i),t,"stop"),this._notify(r(i,e),t,"start")}}function gC(n){const t={},e=[],i=Object.keys(qn.plugins.items);for(let s=0;s<i.length;s++)e.push(qn.getPlugin(i[s]));const r=n.plugins||[];for(let s=0;s<r.length;s++){const a=r[s];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function mC(n,t){return!t&&n===!1?null:n===!0?{}:n}function yC(n,{plugins:t,localIds:e},i,r){const s=[],a=n.getContext();for(const l of t){const u=l.id,d=mC(i[u],r);d!==null&&s.push({plugin:l,options:_C(n.config,{plugin:l,local:e[u]},d,a)})}return s}function _C(n,{plugin:t,local:e},i,r){const s=n.pluginScopeKeys(t),a=n.getOptionScopes(i,s);return e&&t.defaults&&a.push(t.defaults),n.createResolver(a,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function gu(n,t){const e=se.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function bC(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function xC(n,t){return n===t?"_index_":"_value_"}function $g(n){if(n==="x"||n==="y"||n==="r")return n}function wC(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function mu(n,...t){if($g(n))return n;for(const e of t){const i=e.axis||wC(e.position)||n.length>1&&$g(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Yg(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function vC(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(e.length)return Yg(n,"x",e[0])||Yg(n,"y",e[0])}return{}}function SC(n,t){const e=sr[n.type]||{scales:{}},i=t.scales||{},r=gu(n.type,t),s=Object.create(null);return Object.keys(i).forEach(a=>{const l=i[a];if(!Pt(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const u=mu(a,l,vC(a,n),se.scales[l.type]),d=xC(u,r),h=e.scales||{};s[a]=Us(Object.create(null),[{axis:u},l,h[u],h[d]])}),n.data.datasets.forEach(a=>{const l=a.type||n.type,u=a.indexAxis||gu(l,t),h=(sr[l]||{}).scales||{};Object.keys(h).forEach(g=>{const y=bC(g,u),_=a[y+"AxisID"]||y;s[_]=s[_]||Object.create(null),Us(s[_],[{axis:y},i[_],h[g]])})}),Object.keys(s).forEach(a=>{const l=s[a];Us(l,[se.scales[l.type],se.scale])}),s}function qg(n){const t=n.options||(n.options={});t.plugins=Mt(t.plugins,{}),t.scales=SC(n,t)}function jg(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function TC(n){return n=n||{},n.data=jg(n.data),qg(n),n}const Gg=new Map,Kg=new Set;function La(n,t){let e=Gg.get(n);return e||(e=t(),Gg.set(n,e),Kg.add(e)),e}const io=(n,t,e)=>{const i=Mi(t,e);i!==void 0&&n.add(i)};class MC{constructor(t){this._config=TC(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=jg(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),qg(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return La(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return La(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return La(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return La(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let r=i.get(t);return(!r||e)&&(r=new Map,i.set(t,r)),r}getOptionScopes(t,e,i){const{options:r,type:s}=this,a=this._cachedScopes(t,i),l=a.get(e);if(l)return l;const u=new Set;e.forEach(h=>{t&&(u.add(t),h.forEach(g=>io(u,t,g))),h.forEach(g=>io(u,r,g)),h.forEach(g=>io(u,sr[s]||{},g)),h.forEach(g=>io(u,se,g)),h.forEach(g=>io(u,Xc,g))});const d=Array.from(u);return d.length===0&&d.push(Object.create(null)),Kg.has(e)&&a.set(e,d),d}chartOptionScopes(){const{options:t,type:e}=this;return[t,sr[e]||{},se.datasets[e]||{},{type:e},se,Xc]}resolveNamedOptions(t,e,i,r=[""]){const s={$shared:!0},{resolver:a,subPrefixes:l}=Xg(this._resolverCache,t,r);let u=a;if(DC(a,e)){s.$shared=!1,i=nn(i)?i():i;const d=this.createResolver(t,i,l);u=Wr(a,i,d)}for(const d of e)s[d]=u[d];return s}createResolver(t,e,i=[""],r){const{resolver:s}=Xg(this._resolverCache,t,i);return Pt(e)?Wr(s,e,void 0,r):s}}function Xg(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const r=e.join();let s=i.get(r);return s||(s={resolver:tu(t,e),subPrefixes:e.filter(l=>!l.toLowerCase().includes("hover"))},i.set(r,s)),s}const kC=n=>Pt(n)&&Object.getOwnPropertyNames(n).some(t=>nn(n[t]));function DC(n,t){const{isScriptable:e,isIndexable:i}=Gp(n);for(const r of t){const s=e(r),a=i(r),l=(a||s)&&n[r];if(s&&(nn(l)||kC(l))||a&&Yt(l))return!0}return!1}var CC="4.5.1";const OC=["top","bottom","left","right","chartArea"];function Zg(n,t){return n==="top"||n==="bottom"||OC.indexOf(n)===-1&&t==="x"}function Qg(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function Jg(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),Qt(e&&e.onComplete,[n],t)}function AC(n){const t=n.chart,e=t.options.animation;Qt(e&&e.onProgress,[n],t)}function tm(n){return iu()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Na={},em=n=>{const t=tm(n);return Object.values(Na).filter(e=>e.canvas===t).pop()};function RC(n,t,e){const i=Object.keys(n);for(const r of i){const s=+r;if(s>=t){const a=n[r];delete n[r],(e>0||s>t)&&(n[s+e]=a)}}}function EC(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}let rn=class{static defaults=se;static instances=Na;static overrides=sr;static registry=qn;static version=CC;static getChart=em;static register(...t){qn.add(...t),nm()}static unregister(...t){qn.remove(...t),nm()}constructor(t,e){const i=this.config=new MC(e),r=tm(t),s=em(r);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||XD(r)),this.platform.updateConfig(i);const l=this.platform.acquireContext(r,a.aspectRatio),u=l&&l.canvas,d=u&&u.height,h=u&&u.width;if(this.id=PM(),this.ctx=l,this.canvas=u,this.width=h,this.height=d,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new pC,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=KM(g=>this.update(g),a.resizeDelay||0),this._dataChanges=[],Na[this.id]=this,!l||!u){console.error("Failed to create chart: can't acquire context from the given item");return}si.listen(this,"complete",Jg),si.listen(this,"progress",AC),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:r,_aspectRatio:s}=this;return xt(t)?e&&s?s:r?i/r:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return qn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ng(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Yp(this.canvas,this.ctx),this}stop(){return si.stop(this),this}resize(t,e){si.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,r=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,t,e,s),l=i.devicePixelRatio||this.platform.getDevicePixelRatio(),u=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,ng(this,l,!0)&&(this.notifyPlugins("resize",{size:a}),Qt(i.onResize,[this,a],this),this.attached&&this._doResize(u)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};Jt(e,(i,r)=>{i.id=r})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,r=Object.keys(i).reduce((a,l)=>(a[l]=!1,a),{});let s=[];e&&(s=s.concat(Object.keys(e).map(a=>{const l=e[a],u=mu(a,l),d=u==="r",h=u==="x";return{options:l,dposition:d?"chartArea":h?"bottom":"left",dtype:d?"radialLinear":h?"category":"linear"}}))),Jt(s,a=>{const l=a.options,u=l.id,d=mu(u,l),h=Mt(l.type,a.dtype);(l.position===void 0||Zg(l.position,d)!==Zg(a.dposition))&&(l.position=a.dposition),r[u]=!0;let g=null;if(u in i&&i[u].type===h)g=i[u];else{const y=qn.getScale(h);g=new y({id:u,type:h,ctx:this.ctx,chart:this}),i[g.id]=g}g.init(l,t)}),Jt(r,(a,l)=>{a||delete i[l]}),Jt(i,a=>{We.configure(this,a,a.options),We.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((r,s)=>r.index-s.index),i>e){for(let r=e;r<i;++r)this._destroyDatasetMeta(r);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Qg("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,r)=>{e.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,r;for(this._removeUnreferencedMetasets(),i=0,r=e.length;i<r;i++){const s=e[i];let a=this.getDatasetMeta(i);const l=s.type||this.config.type;if(a.type&&a.type!==l&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=l,a.indexAxis=s.indexAxis||gu(l,this.options),a.order=s.order||0,a.index=i,a.label=""+s.label,a.visible=this.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else{const u=qn.getController(l),{datasetElementType:d,dataElementType:h}=se.datasets[l];Object.assign(u,{dataElementType:qn.getElement(h),datasetElementType:d&&qn.getElement(d)}),a.controller=new u(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){Jt(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let d=0,h=this.data.datasets.length;d<h;d++){const{controller:g}=this.getDatasetMeta(d),y=!r&&s.indexOf(g)===-1;g.buildOrUpdateElements(y),a=Math.max(+g.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),r||Jt(s,d=>{d.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Qg("z","_idx"));const{_active:l,_lastEvent:u}=this;u?this._eventHandler(u,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Jt(this.scales,t=>{We.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Ap(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:r,count:s}of e){const a=i==="_removeElements"?-s:s;RC(t,r,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=s=>new Set(t.filter(a=>a[0]===s).map((a,l)=>l+","+a.splice(1).join(","))),r=i(0);for(let s=1;s<e;s++)if(!Ap(r,i(s)))return;return Array.from(r).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;We.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],Jt(this.boxes,r=>{i&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,s)=>{r._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,nn(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),r={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(i.controller._update(e),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(si.has(this)?this.attached&&!si.running(this)&&si.start(this):(this.draw(),Jg({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:r}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,r)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let r,s;for(r=0,s=e.length;r<s;++r){const a=e[r];(!t||a.visible)&&i.push(a)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i={meta:t,index:t.index,cancelable:!0},r=fg(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(r&&qs(e,r),t.controller.draw(),r&&js(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return ri(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,r){const s=hu.modes[e];return typeof s=="function"?s(this,t,i,r):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let r=i.filter(s=>s&&s._dataset===e).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(r)),r}getContext(){return this.$context||(this.$context=Oi(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const r=i?"show":"hide",s=this.getDatasetMeta(t),a=s.controller._resolveAnimations(void 0,r);en(e)?(s.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(s,{visible:i}),this.update(l=>l.datasetIndex===t?r:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),si.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Yp(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Na[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(s,a)=>{e.addEventListener(this,s,a),t[s]=a},r=(s,a,l)=>{s.offsetX=a,s.offsetY=l,this._eventHandler(s)};Jt(this.options.events,s=>i(s,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(u,d)=>{e.addEventListener(this,u,d),t[u]=d},r=(u,d)=>{t[u]&&(e.removeEventListener(this,u,d),delete t[u])},s=(u,d)=>{this.canvas&&this.resize(u,d)};let a;const l=()=>{r("attach",l),this.attached=!0,this.resize(),i("resize",s),i("detach",a)};a=()=>{this.attached=!1,r("resize",s),this._stop(),this._resize(0,0),i("attach",l)},e.isAttached(this.canvas)?l():a()}unbindEvents(){Jt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Jt(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const r=i?"set":"remove";let s,a,l,u;for(e==="dataset"&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+r+"DatasetHoverStyle"]()),l=0,u=t.length;l<u;++l){a=t[l];const d=a&&this.getDatasetMeta(a.datasetIndex).controller;d&&d[r+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:s,index:a})=>{const l=this.getDatasetMeta(s);if(!l)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:l.data[a],index:a}});!ma(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const r=this.options.hover,s=(u,d)=>u.filter(h=>!d.some(g=>h.datasetIndex===g.datasetIndex&&h.index===g.index)),a=s(e,t),l=i?t:s(t,e);a.length&&this.updateHoverStyle(a,r.mode,!1),l.length&&r.mode&&this.updateHoverStyle(l,r.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},r=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,r)===!1)return;const s=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,r),(s||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:r=[],options:s}=this,a=e,l=this._getActiveElements(t,r,i,a),u=zM(t),d=EC(t,this._lastEvent,i,u);i&&(this._lastEvent=null,Qt(s.onHover,[t,l,this],this),u&&Qt(s.onClick,[t,l,this],this));const h=!ma(l,r);return(h||e)&&(this._active=l,this._updateHoverStyles(l,r,e)),this._lastEvent=d,h}_getActiveElements(t,e,i,r){if(t.type==="mouseout")return[];if(!i)return e;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,r)}};function nm(){return Jt(rn.instances,n=>n._plugins.invalidate())}function PC(n,t,e){const{startAngle:i,x:r,y:s,outerRadius:a,innerRadius:l,options:u}=t,{borderWidth:d,borderJoinStyle:h}=u,g=Math.min(d/a,Ue(i-e));if(n.beginPath(),n.arc(r,s,a-d/2,i+g/2,e-g/2),l>0){const y=Math.min(d/l,Ue(i-e));n.arc(r,s,l+d/2,e-y/2,i+y/2,!0)}else{const y=Math.min(d/2,a*Ue(i-e));if(h==="round")n.arc(r,s,y,e-Rt/2,i+Rt/2,!0);else if(h==="bevel"){const _=2*y*y,x=-_*Math.cos(e+Rt/2)+r,v=-_*Math.sin(e+Rt/2)+s,M=_*Math.cos(i+Rt/2)+r,C=_*Math.sin(i+Rt/2)+s;n.lineTo(x,v),n.lineTo(M,C)}}n.closePath(),n.moveTo(0,0),n.rect(0,0,n.canvas.width,n.canvas.height),n.clip("evenodd")}function IC(n,t,e){const{startAngle:i,pixelMargin:r,x:s,y:a,outerRadius:l,innerRadius:u}=t;let d=r/l;n.beginPath(),n.arc(s,a,l,i-d,e+d),u>r?(d=r/u,n.arc(s,a,u,e+d,i-d,!0)):n.arc(s,a,r,e+re,i-re),n.closePath(),n.clip()}function LC(n){return Jc(n,["outerStart","outerEnd","innerStart","innerEnd"])}function NC(n,t,e,i){const r=LC(n.options.borderRadius),s=(e-t)/2,a=Math.min(s,i*t/2),l=u=>{const d=(e-Math.min(s,u))*i/2;return Ce(u,0,Math.min(s,d))};return{outerStart:l(r.outerStart),outerEnd:l(r.outerEnd),innerStart:Ce(r.innerStart,0,a),innerEnd:Ce(r.innerEnd,0,a)}}function Yr(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function Ba(n,t,e,i,r,s){const{x:a,y:l,startAngle:u,pixelMargin:d,innerRadius:h}=t,g=Math.max(t.outerRadius+i+e-d,0),y=h>0?h+i+e+d:0;let _=0;const x=r-u;if(i){const ot=h>0?h-i:0,q=g>0?g-i:0,J=(ot+q)/2,rt=J!==0?x*J/(J+i):x;_=(x-rt)/2}const v=Math.max(.001,x*g-e/Rt)/g,M=(x-v)/2,C=u+M+_,R=r-M-_,{outerStart:F,outerEnd:I,innerStart:L,innerEnd:N}=NC(t,y,g,R-C),B=g-F,T=g-I,S=C+F/B,O=R-I/T,U=y+L,$=y+N,it=C+L/U,at=R-N/$;if(n.beginPath(),s){const ot=(S+O)/2;if(n.arc(a,l,g,S,ot),n.arc(a,l,g,ot,O),I>0){const tt=Yr(T,O,a,l);n.arc(tt.x,tt.y,I,O,R+re)}const q=Yr($,R,a,l);if(n.lineTo(q.x,q.y),N>0){const tt=Yr($,at,a,l);n.arc(tt.x,tt.y,N,R+re,at+Math.PI)}const J=(R-N/y+(C+L/y))/2;if(n.arc(a,l,y,R-N/y,J,!0),n.arc(a,l,y,J,C+L/y,!0),L>0){const tt=Yr(U,it,a,l);n.arc(tt.x,tt.y,L,it+Math.PI,C-re)}const rt=Yr(B,C,a,l);if(n.lineTo(rt.x,rt.y),F>0){const tt=Yr(B,S,a,l);n.arc(tt.x,tt.y,F,C-re,S)}}else{n.moveTo(a,l);const ot=Math.cos(S)*g+a,q=Math.sin(S)*g+l;n.lineTo(ot,q);const J=Math.cos(O)*g+a,rt=Math.sin(O)*g+l;n.lineTo(J,rt)}n.closePath()}function BC(n,t,e,i,r){const{fullCircles:s,startAngle:a,circumference:l}=t;let u=t.endAngle;if(s){Ba(n,t,e,i,u,r);for(let d=0;d<s;++d)n.fill();isNaN(l)||(u=a+(l%te||te))}return Ba(n,t,e,i,u,r),n.fill(),u}function FC(n,t,e,i,r){const{fullCircles:s,startAngle:a,circumference:l,options:u}=t,{borderWidth:d,borderJoinStyle:h,borderDash:g,borderDashOffset:y,borderRadius:_}=u,x=u.borderAlign==="inner";if(!d)return;n.setLineDash(g||[]),n.lineDashOffset=y,x?(n.lineWidth=d*2,n.lineJoin=h||"round"):(n.lineWidth=d,n.lineJoin=h||"bevel");let v=t.endAngle;if(s){Ba(n,t,e,i,v,r);for(let M=0;M<s;++M)n.stroke();isNaN(l)||(v=a+(l%te||te))}x&&IC(n,t,v),u.selfJoin&&v-a>=Rt&&_===0&&h!=="miter"&&PC(n,t,v),s||(Ba(n,t,e,i,v,r),n.stroke())}class zC extends Ve{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const r=this.getProps(["x","y"],i),{angle:s,distance:a}=wa(r,{x:t,y:e}),{startAngle:l,endAngle:u,innerRadius:d,outerRadius:h,circumference:g}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),y=(this.options.spacing+this.options.borderWidth)/2,_=Mt(g,u-l),x=Ws(s,l,u)&&l!==u,v=_>=te||x,M=ni(a,d+y,h+y);return v&&M}getCenterPoint(t){const{x:e,y:i,startAngle:r,endAngle:s,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:u,spacing:d}=this.options,h=(r+s)/2,g=(a+l+d+u)/2;return{x:e+Math.cos(h)*g,y:i+Math.sin(h)*g}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,r=(e.offset||0)/4,s=(e.spacing||0)/2,a=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=i>te?Math.floor(i/te):0,i===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const l=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(l)*r,Math.sin(l)*r);const u=1-Math.sin(Math.min(Rt,i||0)),d=r*u;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,BC(t,this,d,s,a),FC(t,this,d,s,a),t.restore()}}function im(n,t,e=t){n.lineCap=Mt(e.borderCapStyle,t.borderCapStyle),n.setLineDash(Mt(e.borderDash,t.borderDash)),n.lineDashOffset=Mt(e.borderDashOffset,t.borderDashOffset),n.lineJoin=Mt(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=Mt(e.borderWidth,t.borderWidth),n.strokeStyle=Mt(e.borderColor,t.borderColor)}function UC(n,t,e){n.lineTo(e.x,e.y)}function HC(n){return n.stepped?ak:n.tension||n.cubicInterpolationMode==="monotone"?lk:UC}function rm(n,t,e={}){const i=n.length,{start:r=0,end:s=i-1}=e,{start:a,end:l}=t,u=Math.max(r,a),d=Math.min(s,l),h=r<a&&s<a||r>l&&s>l;return{count:i,start:u,loop:t.loop,ilen:d<u&&!h?i+d-u:d-u}}function WC(n,t,e,i){const{points:r,options:s}=t,{count:a,start:l,loop:u,ilen:d}=rm(r,e,i),h=HC(s);let{move:g=!0,reverse:y}=i||{},_,x,v;for(_=0;_<=d;++_)x=r[(l+(y?d-_:_))%a],!x.skip&&(g?(n.moveTo(x.x,x.y),g=!1):h(n,v,x,y,s.stepped),v=x);return u&&(x=r[(l+(y?d:0))%a],h(n,v,x,y,s.stepped)),!!u}function VC(n,t,e,i){const r=t.points,{count:s,start:a,ilen:l}=rm(r,e,i),{move:u=!0,reverse:d}=i||{};let h=0,g=0,y,_,x,v,M,C;const R=I=>(a+(d?l-I:I))%s,F=()=>{v!==M&&(n.lineTo(h,M),n.lineTo(h,v),n.lineTo(h,C))};for(u&&(_=r[R(0)],n.moveTo(_.x,_.y)),y=0;y<=l;++y){if(_=r[R(y)],_.skip)continue;const I=_.x,L=_.y,N=I|0;N===x?(L<v?v=L:L>M&&(M=L),h=(g*h+I)/++g):(F(),n.lineTo(I,L),x=N,g=0,v=M=L),C=L}F()}function yu(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?VC:WC}function $C(n){return n.stepped?Uk:n.tension||n.cubicInterpolationMode==="monotone"?Hk:cr}function YC(n,t,e,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,e,i)&&r.closePath()),im(n,t.options),n.stroke(r)}function qC(n,t,e,i){const{segments:r,options:s}=t,a=yu(t);for(const l of r)im(n,s,l.style),n.beginPath(),a(n,t,l,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const jC=typeof Path2D=="function";function GC(n,t,e,i){jC&&!t.options.segment?YC(n,t,e,i):qC(n,t,e,i)}class Fa extends Ve{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const r=i.spanGaps?this._loop:this._fullLoop;Ek(this._points,i,t,r,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=jk(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,r=t[e],s=this.points,a=cg(this,{property:e,start:r,end:r});if(!a.length)return;const l=[],u=$C(i);let d,h;for(d=0,h=a.length;d<h;++d){const{start:g,end:y}=a[d],_=s[g],x=s[y];if(_===x){l.push(_);continue}const v=Math.abs((r-_[e])/(x[e]-_[e])),M=u(_,x,v,i.stepped);M[e]=t[e],l.push(M)}return l.length===1?l[0]:l}pathSegment(t,e,i){return yu(this)(t,this,e,i)}path(t,e,i){const r=this.segments,s=yu(this);let a=this._loop;e=e||0,i=i||this.points.length-e;for(const l of r)a&=s(t,this,l,{start:e,end:e+i-1});return!!a}draw(t,e,i,r){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),GC(t,this,i,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function sm(n,t,e,i){const r=n.options,{[e]:s}=n.getProps([e],i);return Math.abs(t-s)<r.radius+r.hitRadius}class KC extends Ve{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const r=this.options,{x:s,y:a}=this.getProps(["x","y"],i);return Math.pow(t-s,2)+Math.pow(e-a,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(t,e){return sm(this,t,"x",e)}inYRange(t,e){return sm(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const i=e&&t.borderWidth||0;return(e+i)*2}draw(t,e){const i=this.options;this.skip||i.radius<.1||!ri(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Qc(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function om(n,t){const{x:e,y:i,base:r,width:s,height:a}=n.getProps(["x","y","base","width","height"],t);let l,u,d,h,g;return n.horizontal?(g=a/2,l=Math.min(e,r),u=Math.max(e,r),d=i-g,h=i+g):(g=s/2,l=e-g,u=e+g,d=Math.min(i,r),h=Math.max(i,r)),{left:l,top:d,right:u,bottom:h}}function Pi(n,t,e,i){return n?0:Ce(t,e,i)}function XC(n,t,e){const i=n.options.borderWidth,r=n.borderSkipped,s=jp(i);return{t:Pi(r.top,s.top,0,e),r:Pi(r.right,s.right,0,t),b:Pi(r.bottom,s.bottom,0,e),l:Pi(r.left,s.left,0,t)}}function ZC(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),r=n.options.borderRadius,s=Ci(r),a=Math.min(t,e),l=n.borderSkipped,u=i||Pt(r);return{topLeft:Pi(!u||l.top||l.left,s.topLeft,0,a),topRight:Pi(!u||l.top||l.right,s.topRight,0,a),bottomLeft:Pi(!u||l.bottom||l.left,s.bottomLeft,0,a),bottomRight:Pi(!u||l.bottom||l.right,s.bottomRight,0,a)}}function QC(n){const t=om(n),e=t.right-t.left,i=t.bottom-t.top,r=XC(n,e/2,i/2),s=ZC(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:s},inner:{x:t.left+r.l,y:t.top+r.t,w:e-r.l-r.r,h:i-r.t-r.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,s.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(r.b,r.r))}}}}function _u(n,t,e,i){const r=t===null,s=e===null,l=n&&!(r&&s)&&om(n,i);return l&&(r||ni(t,l.left,l.right))&&(s||ni(e,l.top,l.bottom))}function JC(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function tO(n,t){n.rect(t.x,t.y,t.w,t.h)}function bu(n,t,e={}){const i=n.x!==e.x?-t:0,r=n.y!==e.y?-t:0,s=(n.x+n.w!==e.x+e.w?t:0)-i,a=(n.y+n.h!==e.y+e.h?t:0)-r;return{x:n.x+i,y:n.y+r,w:n.w+s,h:n.h+a,radius:n.radius}}class eO extends Ve{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:r}}=this,{inner:s,outer:a}=QC(this),l=JC(a.radius)?Hr:tO;t.save(),(a.w!==s.w||a.h!==s.h)&&(t.beginPath(),l(t,bu(a,e,s)),t.clip(),l(t,bu(s,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),l(t,bu(s,e)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,e,i){return _u(this,t,e,i)}inXRange(t,e){return _u(this,t,null,e)}inYRange(t,e){return _u(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:r,horizontal:s}=this.getProps(["x","y","base","horizontal"],t);return{x:s?(e+r)/2:e,y:s?i:(i+r)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}var nO=Object.freeze({__proto__:null,ArcElement:zC,BarElement:eO,LineElement:Fa,PointElement:KC});const xu=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],am=xu.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function lm(n){return xu[n%xu.length]}function cm(n){return am[n%am.length]}function iO(n,t){return n.borderColor=lm(t),n.backgroundColor=cm(t),++t}function rO(n,t){return n.backgroundColor=n.data.map(()=>lm(t++)),t}function sO(n,t){return n.backgroundColor=n.data.map(()=>cm(t++)),t}function oO(n){let t=0;return(e,i)=>{const r=n.getDatasetMeta(i).controller;r instanceof Xs?t=rO(e,t):r instanceof kg?t=sO(e,t):r&&(t=iO(e,t))}}function um(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function aO(n){return n&&(n.borderColor||n.backgroundColor)}function lO(){return se.borderColor!=="rgba(0,0,0,0.1)"||se.backgroundColor!=="rgba(0,0,0,0.1)"}var cO={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:r}=n.config,{elements:s}=r,a=um(i)||aO(r)||s&&um(s)||lO();if(!e.forceOverride&&a)return;const l=oO(n);i.forEach(l)}};function uO(n,t,e,i,r){const s=r.samples||i;if(s>=e)return n.slice(t,t+e);const a=[],l=(e-2)/(s-2);let u=0;const d=t+e-1;let h=t,g,y,_,x,v;for(a[u++]=n[h],g=0;g<s-2;g++){let M=0,C=0,R;const F=Math.floor((g+1)*l)+1+t,I=Math.min(Math.floor((g+2)*l)+1,e)+t,L=I-F;for(R=F;R<I;R++)M+=n[R].x,C+=n[R].y;M/=L,C/=L;const N=Math.floor(g*l)+1+t,B=Math.min(Math.floor((g+1)*l)+1,e)+t,{x:T,y:S}=n[h];for(_=x=-1,R=N;R<B;R++)x=.5*Math.abs((T-M)*(n[R].y-S)-(T-n[R].x)*(C-S)),x>_&&(_=x,y=n[R],v=R);a[u++]=y,h=v}return a[u++]=n[d],a}function dO(n,t,e,i){let r=0,s=0,a,l,u,d,h,g,y,_,x,v;const M=[],C=t+e-1,R=n[t].x,I=n[C].x-R;for(a=t;a<t+e;++a){l=n[a],u=(l.x-R)/I*i,d=l.y;const L=u|0;if(L===h)d<x?(x=d,g=a):d>v&&(v=d,y=a),r=(s*r+l.x)/++s;else{const N=a-1;if(!xt(g)&&!xt(y)){const B=Math.min(g,y),T=Math.max(g,y);B!==_&&B!==N&&M.push({...n[B],x:r}),T!==_&&T!==N&&M.push({...n[T],x:r})}a>0&&N!==_&&M.push(n[N]),M.push(l),h=L,s=0,x=v=d,g=y=_=a}}return M}function dm(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function fm(n){n.data.datasets.forEach(t=>{dm(t)})}function fO(n,t){const e=t.length;let i=0,r;const{iScale:s}=n,{min:a,max:l,minDefined:u,maxDefined:d}=s.getUserBounds();return u&&(i=Ce(ii(t,s.axis,a).lo,0,e-1)),d?r=Ce(ii(t,s.axis,l).hi+1,i,e)-i:r=e-i,{start:i,count:r}}var hO={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){fm(n);return}const i=n.width;n.data.datasets.forEach((r,s)=>{const{_data:a,indexAxis:l}=r,u=n.getDatasetMeta(s),d=a||r.data;if(Gs([l,n.options.indexAxis])==="y"||!u.controller.supportsDecimation)return;const h=n.scales[u.xAxisID];if(h.type!=="linear"&&h.type!=="time"||n.options.parsing)return;let{start:g,count:y}=fO(u,d);const _=e.threshold||4*i;if(y<=_){dm(r);return}xt(a)&&(r._data=d,delete r.data,Object.defineProperty(r,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(v){this._data=v}}));let x;switch(e.algorithm){case"lttb":x=uO(d,g,y,i,e);break;case"min-max":x=dO(d,g,y,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}r._decimated=x})},destroy(n){fm(n)}};function pO(n,t,e){const i=n.segments,r=n.points,s=t.points,a=[];for(const l of i){let{start:u,end:d}=l;d=za(u,d,r);const h=wu(e,r[u],r[d],l.loop);if(!t.segments){a.push({source:l,target:h,start:r[u],end:r[d]});continue}const g=cg(t,h);for(const y of g){const _=wu(e,s[y.start],s[y.end],y.loop),x=lg(l,r,_);for(const v of x)a.push({source:v,target:y,start:{[e]:hm(h,_,"start",Math.max)},end:{[e]:hm(h,_,"end",Math.min)}})}}return a}function wu(n,t,e,i){if(i)return;let r=t[n],s=e[n];return n==="angle"&&(r=Ue(r),s=Ue(s)),{property:n,start:r,end:s}}function gO(n,t){const{x:e=null,y:i=null}=n||{},r=t.points,s=[];return t.segments.forEach(({start:a,end:l})=>{l=za(a,l,r);const u=r[a],d=r[l];i!==null?(s.push({x:u.x,y:i}),s.push({x:d.x,y:i})):e!==null&&(s.push({x:e,y:u.y}),s.push({x:e,y:d.y}))}),s}function za(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function hm(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function pm(n,t){let e=[],i=!1;return Yt(n)?(i=!0,e=n):e=gO(n,t),e.length?new Fa({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function gm(n){return n&&n.fill!==!1}function mO(n,t,e){let r=n[t].fill;const s=[t];let a;if(!e)return r;for(;r!==!1&&s.indexOf(r)===-1;){if(!ae(r))return r;if(a=n[r],!a)return!1;if(a.visible)return r;s.push(r),r=a.fill}return!1}function yO(n,t,e){const i=wO(n);if(Pt(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return ae(r)&&Math.floor(r)===r?_O(i[0],t,r,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function _O(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function bO(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:Pt(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function xO(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:Pt(n)?i=n.value:i=t.getBaseValue(),i}function wO(n){const t=n.options,e=t.fill;let i=Mt(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function vO(n){const{scale:t,index:e,line:i}=n,r=[],s=i.segments,a=i.points,l=SO(t,e);l.push(pm({x:null,y:t.bottom},i));for(let u=0;u<s.length;u++){const d=s[u];for(let h=d.start;h<=d.end;h++)TO(r,a[h],l)}return new Fa({points:r,options:{}})}function SO(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let r=0;r<i.length;r++){const s=i[r];if(s.index===t)break;s.hidden||e.unshift(s.dataset)}return e}function TO(n,t,e){const i=[];for(let r=0;r<e.length;r++){const s=e[r],{first:a,last:l,point:u}=MO(s,t,"x");if(!(!u||a&&l)){if(a)i.unshift(u);else if(n.push(u),!l)break}}n.push(...i)}function MO(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const r=i[e],s=n.segments,a=n.points;let l=!1,u=!1;for(let d=0;d<s.length;d++){const h=s[d],g=a[h.start][e],y=a[h.end][e];if(ni(r,g,y)){l=r===g,u=r===y;break}}return{first:l,last:u,point:i}}class mm{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:r,y:s,radius:a}=this;return e=e||{start:0,end:te},t.arc(r,s,a,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:r}=this,s=t.angle;return{x:e+Math.cos(s)*r,y:i+Math.sin(s)*r,angle:s}}}function kO(n){const{chart:t,fill:e,line:i}=n;if(ae(e))return DO(t,e);if(e==="stack")return vO(n);if(e==="shape")return!0;const r=CO(n);return r instanceof mm?r:pm(r,i)}function DO(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function CO(n){return(n.scale||{}).getPointPositionForValue?AO(n):OO(n)}function OO(n){const{scale:t={},fill:e}=n,i=bO(e,t);if(ae(i)){const r=t.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function AO(n){const{scale:t,fill:e}=n,i=t.options,r=t.getLabels().length,s=i.reverse?t.max:t.min,a=xO(e,t,s),l=[];if(i.grid.circular){const u=t.getPointPositionForValue(0,s);return new mm({x:u.x,y:u.y,radius:t.getDistanceFromCenterForValue(a)})}for(let u=0;u<r;++u)l.push(t.getPointPositionForValue(u,a));return l}function vu(n,t,e){const i=kO(t),{chart:r,index:s,line:a,scale:l,axis:u}=t,d=a.options,h=d.fill,g=d.backgroundColor,{above:y=g,below:_=g}=h||{},x=r.getDatasetMeta(s),v=fg(r,x);i&&a.points.length&&(qs(n,e),RO(n,{line:a,target:i,above:y,below:_,area:e,scale:l,axis:u,clip:v}),js(n))}function RO(n,t){const{line:e,target:i,above:r,below:s,area:a,scale:l,clip:u}=t,d=e._loop?"angle":t.axis;n.save();let h=s;s!==r&&(d==="x"?(ym(n,i,a.top),Su(n,{line:e,target:i,color:r,scale:l,property:d,clip:u}),n.restore(),n.save(),ym(n,i,a.bottom)):d==="y"&&(_m(n,i,a.left),Su(n,{line:e,target:i,color:s,scale:l,property:d,clip:u}),n.restore(),n.save(),_m(n,i,a.right),h=r)),Su(n,{line:e,target:i,color:h,scale:l,property:d,clip:u}),n.restore()}function ym(n,t,e){const{segments:i,points:r}=t;let s=!0,a=!1;n.beginPath();for(const l of i){const{start:u,end:d}=l,h=r[u],g=r[za(u,d,r)];s?(n.moveTo(h.x,h.y),s=!1):(n.lineTo(h.x,e),n.lineTo(h.x,h.y)),a=!!t.pathSegment(n,l,{move:a}),a?n.closePath():n.lineTo(g.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function _m(n,t,e){const{segments:i,points:r}=t;let s=!0,a=!1;n.beginPath();for(const l of i){const{start:u,end:d}=l,h=r[u],g=r[za(u,d,r)];s?(n.moveTo(h.x,h.y),s=!1):(n.lineTo(e,h.y),n.lineTo(h.x,h.y)),a=!!t.pathSegment(n,l,{move:a}),a?n.closePath():n.lineTo(e,g.y)}n.lineTo(e,t.first().y),n.closePath(),n.clip()}function Su(n,t){const{line:e,target:i,property:r,color:s,scale:a,clip:l}=t,u=pO(e,i,r);for(const{source:d,target:h,start:g,end:y}of u){const{style:{backgroundColor:_=s}={}}=d,x=i!==!0;n.save(),n.fillStyle=_,EO(n,a,l,x&&wu(r,g,y)),n.beginPath();const v=!!e.pathSegment(n,d);let M;if(x){v?n.closePath():bm(n,i,y,r);const C=!!i.pathSegment(n,h,{move:v,reverse:!0});M=v&&C,M||bm(n,i,g,r)}n.closePath(),n.fill(M?"evenodd":"nonzero"),n.restore()}}function EO(n,t,e,i){const r=t.chart.chartArea,{property:s,start:a,end:l}=i||{};if(s==="x"||s==="y"){let u,d,h,g;s==="x"?(u=a,d=r.top,h=l,g=r.bottom):(u=r.left,d=a,h=r.right,g=l),n.beginPath(),e&&(u=Math.max(u,e.left),h=Math.min(h,e.right),d=Math.max(d,e.top),g=Math.min(g,e.bottom)),n.rect(u,d,h-u,g-d),n.clip()}}function bm(n,t,e,i){const r=t.interpolate(e,i);r&&n.lineTo(r.x,r.y)}var PO={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,r=[];let s,a,l,u;for(a=0;a<i;++a)s=n.getDatasetMeta(a),l=s.dataset,u=null,l&&l.options&&l instanceof Fa&&(u={visible:n.isDatasetVisible(a),index:a,fill:yO(l,a,i),chart:n,axis:s.controller.options.indexAxis,scale:s.vScale,line:l}),s.$filler=u,r.push(u);for(a=0;a<i;++a)u=r[a],!(!u||u.fill===!1)&&(u.fill=mO(r,a,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",r=n.getSortedVisibleDatasetMetas(),s=n.chartArea;for(let a=r.length-1;a>=0;--a){const l=r[a].$filler;l&&(l.line.updateControlPoints(s,l.axis),i&&l.fill&&vu(n.ctx,l,s))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let r=i.length-1;r>=0;--r){const s=i[r].$filler;gm(s)&&vu(n.ctx,s,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!gm(i)||e.drawTime!=="beforeDatasetDraw"||vu(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const xm=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},IO=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class wm extends Ve{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=Qt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,r)=>t.sort(i,r,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,r=le(i.font),s=r.size,a=this._computeTitleHeight(),{boxWidth:l,itemHeight:u}=xm(i,s);let d,h;e.font=r.string,this.isHorizontal()?(d=this.maxWidth,h=this._fitRows(a,s,l,u)+10):(h=this.maxHeight,d=this._fitCols(a,r,l,u)+10),this.width=Math.min(d,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,r){const{ctx:s,maxWidth:a,options:{labels:{padding:l}}}=this,u=this.legendHitBoxes=[],d=this.lineWidths=[0],h=r+l;let g=t;s.textAlign="left",s.textBaseline="middle";let y=-1,_=-h;return this.legendItems.forEach((x,v)=>{const M=i+e/2+s.measureText(x.text).width;(v===0||d[d.length-1]+M+2*l>a)&&(g+=h,d[d.length-(v>0?0:1)]=0,_+=h,y++),u[v]={left:0,top:_,row:y,width:M,height:r},d[d.length-1]+=M+l}),g}_fitCols(t,e,i,r){const{ctx:s,maxHeight:a,options:{labels:{padding:l}}}=this,u=this.legendHitBoxes=[],d=this.columnSizes=[],h=a-t;let g=l,y=0,_=0,x=0,v=0;return this.legendItems.forEach((M,C)=>{const{itemWidth:R,itemHeight:F}=LO(i,e,s,M,r);C>0&&_+F+2*l>h&&(g+=y+l,d.push({width:y,height:_}),x+=y+l,v++,y=_=0),u[C]={left:x,top:_,col:v,width:R,height:F},y=Math.max(y,R),_+=F+l}),g+=y,d.push({width:y,height:_}),g}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:r},rtl:s}}=this,a=$r(s,this.left,this.width);if(this.isHorizontal()){let l=0,u=He(i,this.left+r,this.right-this.lineWidths[l]);for(const d of e)l!==d.row&&(l=d.row,u=He(i,this.left+r,this.right-this.lineWidths[l])),d.top+=this.top+t+r,d.left=a.leftForLtr(a.x(u),d.width),u+=d.width+r}else{let l=0,u=He(i,this.top+t+r,this.bottom-this.columnSizes[l].height);for(const d of e)d.col!==l&&(l=d.col,u=He(i,this.top+t+r,this.bottom-this.columnSizes[l].height)),d.top=u,d.left+=this.left+r,d.left=a.leftForLtr(a.x(d.left),d.width),u+=d.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;qs(t,this),this._draw(),js(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:r}=this,{align:s,labels:a}=t,l=se.color,u=$r(t.rtl,this.left,this.width),d=le(a.font),{padding:h}=a,g=d.size,y=g/2;let _;this.drawTitle(),r.textAlign=u.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=d.string;const{boxWidth:x,boxHeight:v,itemHeight:M}=xm(a,g),C=function(N,B,T){if(isNaN(x)||x<=0||isNaN(v)||v<0)return;r.save();const S=Mt(T.lineWidth,1);if(r.fillStyle=Mt(T.fillStyle,l),r.lineCap=Mt(T.lineCap,"butt"),r.lineDashOffset=Mt(T.lineDashOffset,0),r.lineJoin=Mt(T.lineJoin,"miter"),r.lineWidth=S,r.strokeStyle=Mt(T.strokeStyle,l),r.setLineDash(Mt(T.lineDash,[])),a.usePointStyle){const O={radius:v*Math.SQRT2/2,pointStyle:T.pointStyle,rotation:T.rotation,borderWidth:S},U=u.xPlus(N,x/2),$=B+y;qp(r,O,U,$,a.pointStyleWidth&&x)}else{const O=B+Math.max((g-v)/2,0),U=u.leftForLtr(N,x),$=Ci(T.borderRadius);r.beginPath(),Object.values($).some(it=>it!==0)?Hr(r,{x:U,y:O,w:x,h:v,radius:$}):r.rect(U,O,x,v),r.fill(),S!==0&&r.stroke()}r.restore()},R=function(N,B,T){ar(r,T.text,N,B+M/2,d,{strikethrough:T.hidden,textAlign:u.textAlign(T.textAlign)})},F=this.isHorizontal(),I=this._computeTitleHeight();F?_={x:He(s,this.left+h,this.right-i[0]),y:this.top+h+I,line:0}:_={x:this.left+h,y:He(s,this.top+I+h,this.bottom-e[0].height),line:0},rg(this.ctx,t.textDirection);const L=M+h;this.legendItems.forEach((N,B)=>{r.strokeStyle=N.fontColor,r.fillStyle=N.fontColor;const T=r.measureText(N.text).width,S=u.textAlign(N.textAlign||(N.textAlign=a.textAlign)),O=x+y+T;let U=_.x,$=_.y;u.setWidth(this.width),F?B>0&&U+O+h>this.right&&($=_.y+=L,_.line++,U=_.x=He(s,this.left+h,this.right-i[_.line])):B>0&&$+L>this.bottom&&(U=_.x=U+e[_.line].width+h,_.line++,$=_.y=He(s,this.top+I+h,this.bottom-e[_.line].height));const it=u.x(U);if(C(it,$,N),U=XM(S,U+x+y,F?U+O:this.right,t.rtl),R(u.x(U),$,N),F)_.x+=O+h;else if(typeof N.text!="string"){const at=d.lineHeight;_.y+=vm(N,at)+h}else _.y+=L}),sg(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=le(e.font),r=we(e.padding);if(!e.display)return;const s=$r(t.rtl,this.left,this.width),a=this.ctx,l=e.position,u=i.size/2,d=r.top+u;let h,g=this.left,y=this.width;if(this.isHorizontal())y=Math.max(...this.lineWidths),h=this.top+d,g=He(t.align,g,this.right-y);else{const x=this.columnSizes.reduce((v,M)=>Math.max(v,M.height),0);h=d+He(t.align,this.top,this.bottom-x-t.labels.padding-this._computeTitleHeight())}const _=He(l,g,g+y);a.textAlign=s.textAlign(jc(l)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,ar(a,e.text,_,h,i)}_computeTitleHeight(){const t=this.options.title,e=le(t.font),i=we(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,r,s;if(ni(t,this.left,this.right)&&ni(e,this.top,this.bottom)){for(s=this.legendHitBoxes,i=0;i<s.length;++i)if(r=s[i],ni(t,r.left,r.left+r.width)&&ni(e,r.top,r.top+r.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!FO(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,s=IO(r,i);r&&!s&&Qt(e.onLeave,[t,r,this],this),this._hoveredItem=i,i&&!s&&Qt(e.onHover,[t,i,this],this)}else i&&Qt(e.onClick,[t,i,this],this)}}function LO(n,t,e,i,r){const s=NO(i,n,t,e),a=BO(r,i,t.lineHeight);return{itemWidth:s,itemHeight:a}}function NO(n,t,e,i){let r=n.text;return r&&typeof r!="string"&&(r=r.reduce((s,a)=>s.length>a.length?s:a)),t+e.size/2+i.measureText(r).width}function BO(n,t,e){let i=n;return typeof t.text!="string"&&(i=vm(t,e)),i}function vm(n,t){const e=n.text?n.text.length:0;return t*e}function FO(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var zO={id:"legend",_element:wm,start(n,t,e){const i=n.legend=new wm({ctx:n.ctx,options:e,chart:n});We.configure(n,i,e),We.addBox(n,i)},stop(n){We.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;We.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,r=e.chart;r.isDatasetVisible(i)?(r.hide(i),t.hidden=!0):(r.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:r,color:s,useBorderRadius:a,borderRadius:l}}=n.legend.options;return n._getSortedDatasetMetas().map(u=>{const d=u.controller.getStyle(e?0:void 0),h=we(d.borderWidth);return{text:t[u.index].label,fillStyle:d.backgroundColor,fontColor:s,hidden:!u.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:d.borderColor,pointStyle:i||d.pointStyle,rotation:d.rotation,textAlign:r||d.textAlign,borderRadius:a&&(l||d.borderRadius),datasetIndex:u.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class Tu extends Ve{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const r=Yt(i.text)?i.text.length:1;this._padding=we(i.padding);const s=r*le(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:r,right:s,options:a}=this,l=a.align;let u=0,d,h,g;return this.isHorizontal()?(h=He(l,i,s),g=e+t,d=s-i):(a.position==="left"?(h=i+t,g=He(l,r,e),u=Rt*-.5):(h=s-t,g=He(l,e,r),u=Rt*.5),d=r-e),{titleX:h,titleY:g,maxWidth:d,rotation:u}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=le(e.font),s=i.lineHeight/2+this._padding.top,{titleX:a,titleY:l,maxWidth:u,rotation:d}=this._drawArgs(s);ar(t,e.text,0,0,i,{color:e.color,maxWidth:u,rotation:d,textAlign:jc(e.align),textBaseline:"middle",translation:[a,l]})}}function UO(n,t){const e=new Tu({ctx:n.ctx,options:t,chart:n});We.configure(n,e,t),We.addBox(n,e),n.titleBlock=e}var HO={id:"title",_element:Tu,start(n,t,e){UO(n,e)},stop(n){const t=n.titleBlock;We.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;We.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Ua=new WeakMap;var WO={id:"subtitle",start(n,t,e){const i=new Tu({ctx:n.ctx,options:e,chart:n});We.configure(n,i,e),We.addBox(n,i),Ua.set(n,i)},stop(n){We.removeBox(n,Ua.get(n)),Ua.delete(n)},beforeUpdate(n,t,e){const i=Ua.get(n);We.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const ro={average(n){if(!n.length)return!1;let t,e,i=new Set,r=0,s=0;for(t=0,e=n.length;t<e;++t){const l=n[t].element;if(l&&l.hasValue()){const u=l.tooltipPosition();i.add(u.x),r+=u.y,++s}}return s===0||i.size===0?!1:{x:[...i].reduce((l,u)=>l+u)/i.size,y:r/s}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,r=Number.POSITIVE_INFINITY,s,a,l;for(s=0,a=n.length;s<a;++s){const u=n[s].element;if(u&&u.hasValue()){const d=u.getCenterPoint(),h=Ur(t,d);h<r&&(r=h,l=u)}}if(l){const u=l.tooltipPosition();e=u.x,i=u.y}return{x:e,y:i}}};function jn(n,t){return t&&(Yt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function oi(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
|
2
2
|
`)>-1?n.split(`
|
|
3
|
-
`):n}function BO(n,t){const{element:e,datasetIndex:i,index:r}=t,s=n.getDatasetMeta(i).controller,{label:a,value:l}=s.getLabelAndValue(r);return{chart:n,label:a,parsed:s.getParsed(r),raw:n.data.datasets[i].data[r],formattedValue:l,dataset:s.getDataset(),dataIndex:r,datasetIndex:i,element:e}}function vm(n,t){const e=n.chart.ctx,{body:i,footer:r,title:s}=n,{boxWidth:a,boxHeight:l}=t,u=le(t.bodyFont),d=le(t.titleFont),h=le(t.footerFont),g=s.length,y=r.length,_=i.length,x=we(t.padding);let v=x.height,M=0,C=i.reduce((I,L)=>I+L.before.length+L.lines.length+L.after.length,0);if(C+=n.beforeBody.length+n.afterBody.length,g&&(v+=g*d.lineHeight+(g-1)*t.titleSpacing+t.titleMarginBottom),C){const I=t.displayColors?Math.max(l,u.lineHeight):u.lineHeight;v+=_*I+(C-_)*u.lineHeight+(C-1)*t.bodySpacing}y&&(v+=t.footerMarginTop+y*h.lineHeight+(y-1)*t.footerSpacing);let R=0;const F=function(I){M=Math.max(M,e.measureText(I).width+R)};return e.save(),e.font=d.string,Jt(n.title,F),e.font=u.string,Jt(n.beforeBody.concat(n.afterBody),F),R=t.displayColors?a+2+t.boxPadding:0,Jt(i,I=>{Jt(I.before,F),Jt(I.lines,F),Jt(I.after,F)}),R=0,e.font=h.string,Jt(n.footer,F),e.restore(),M+=x.width,{width:M,height:v}}function FO(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function zO(n,t,e,i){const{x:r,width:s}=i,a=e.caretSize+e.caretPadding;if(n==="left"&&r+s+a>t.width||n==="right"&&r-s-a<0)return!0}function UO(n,t,e,i){const{x:r,width:s}=e,{width:a,chartArea:{left:l,right:u}}=n;let d="center";return i==="center"?d=r<=(l+u)/2?"left":"right":r<=s/2?d="left":r>=a-s/2&&(d="right"),zO(d,n,t,e)&&(d="center"),d}function Sm(n,t,e){const i=e.yAlign||t.yAlign||FO(n,e);return{xAlign:e.xAlign||t.xAlign||UO(n,t,e,i),yAlign:i}}function HO(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function WO(n,t,e){let{y:i,height:r}=n;return t==="top"?i+=e:t==="bottom"?i-=r+e:i-=r/2,i}function Tm(n,t,e,i){const{caretSize:r,caretPadding:s,cornerRadius:a}=n,{xAlign:l,yAlign:u}=e,d=r+s,{topLeft:h,topRight:g,bottomLeft:y,bottomRight:_}=Ci(a);let x=HO(t,l);const v=WO(t,u,d);return u==="center"?l==="left"?x+=d:l==="right"&&(x-=d):l==="left"?x-=Math.max(h,y)+r:l==="right"&&(x+=Math.max(g,_)+r),{x:Ce(x,0,i.width-t.width),y:Ce(v,0,i.height-t.height)}}function Ha(n,t,e){const i=we(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Mm(n){return jn([],oi(n))}function VO(n,t,e){return Oi(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function km(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Dm={beforeTitle:ei,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:ei,beforeBody:ei,beforeLabel:ei,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return xt(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:ei,afterBody:ei,beforeFooter:ei,footer:ei,afterFooter:ei};function sn(n,t,e,i){const r=n[t].call(e,i);return typeof r>"u"?Dm[t].call(e,i):r}class Cm extends Ve{static positioners=ro;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),r=i.enabled&&e.options.animation&&i.animations,s=new su(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=VO(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,r=sn(i,"beforeTitle",this,t),s=sn(i,"title",this,t),a=sn(i,"afterTitle",this,t);let l=[];return l=jn(l,oi(r)),l=jn(l,oi(s)),l=jn(l,oi(a)),l}getBeforeBody(t,e){return Mm(sn(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,r=[];return Jt(t,s=>{const a={before:[],lines:[],after:[]},l=km(i,s);jn(a.before,oi(sn(l,"beforeLabel",this,s))),jn(a.lines,sn(l,"label",this,s)),jn(a.after,oi(sn(l,"afterLabel",this,s))),r.push(a)}),r}getAfterBody(t,e){return Mm(sn(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,r=sn(i,"beforeFooter",this,t),s=sn(i,"footer",this,t),a=sn(i,"afterFooter",this,t);let l=[];return l=jn(l,oi(r)),l=jn(l,oi(s)),l=jn(l,oi(a)),l}_createItems(t){const e=this._active,i=this.chart.data,r=[],s=[],a=[];let l=[],u,d;for(u=0,d=e.length;u<d;++u)l.push(BO(this.chart,e[u]));return t.filter&&(l=l.filter((h,g,y)=>t.filter(h,g,y,i))),t.itemSort&&(l=l.sort((h,g)=>t.itemSort(h,g,i))),Jt(l,h=>{const g=km(t.callbacks,h);r.push(sn(g,"labelColor",this,h)),s.push(sn(g,"labelPointStyle",this,h)),a.push(sn(g,"labelTextColor",this,h))}),this.labelColors=r,this.labelPointStyles=s,this.labelTextColors=a,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),r=this._active;let s,a=[];if(!r.length)this.opacity!==0&&(s={opacity:0});else{const l=ro[i.position].call(this,r,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const u=this._size=vm(this,i),d=Object.assign({},l,u),h=Sm(this.chart,i,d),g=Tm(i,d,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,s={opacity:1,x:g.x,y:g.y,width:u.width,height:u.height,caretX:l.x,caretY:l.y}}this._tooltipItems=a,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,r){const s=this.getCaretPosition(t,i,r);e.lineTo(s.x1,s.y1),e.lineTo(s.x2,s.y2),e.lineTo(s.x3,s.y3)}getCaretPosition(t,e,i){const{xAlign:r,yAlign:s}=this,{caretSize:a,cornerRadius:l}=i,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:g}=Ci(l),{x:y,y:_}=t,{width:x,height:v}=e;let M,C,R,F,I,L;return s==="center"?(I=_+v/2,r==="left"?(M=y,C=M-a,F=I+a,L=I-a):(M=y+x,C=M+a,F=I-a,L=I+a),R=M):(r==="left"?C=y+Math.max(u,h)+a:r==="right"?C=y+x-Math.max(d,g)-a:C=this.caretX,s==="top"?(F=_,I=F-a,M=C-a,R=C+a):(F=_+v,I=F+a,M=C+a,R=C-a),L=F),{x1:M,x2:C,x3:R,y1:F,y2:I,y3:L}}drawTitle(t,e,i){const r=this.title,s=r.length;let a,l,u;if(s){const d=$r(i.rtl,this.x,this.width);for(t.x=Ha(this,i.titleAlign,i),e.textAlign=d.textAlign(i.titleAlign),e.textBaseline="middle",a=le(i.titleFont),l=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,u=0;u<s;++u)e.fillText(r[u],d.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+l,u+1===s&&(t.y+=i.titleMarginBottom-l)}}_drawColorBox(t,e,i,r,s){const a=this.labelColors[i],l=this.labelPointStyles[i],{boxHeight:u,boxWidth:d}=s,h=le(s.bodyFont),g=Ha(this,"left",s),y=r.x(g),_=u<h.lineHeight?(h.lineHeight-u)/2:0,x=e.y+_;if(s.usePointStyle){const v={radius:Math.min(d,u)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},M=r.leftForLtr(y,d)+d/2,C=x+u/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,Qc(t,v,M,C),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Qc(t,v,M,C)}else{t.lineWidth=Pt(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const v=r.leftForLtr(y,d),M=r.leftForLtr(r.xPlus(y,1),d-2),C=Ci(a.borderRadius);Object.values(C).some(R=>R!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,Hr(t,{x:v,y:x,w:d,h:u,radius:C}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Hr(t,{x:M,y:x+1,w:d-2,h:u-2,radius:C}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(v,x,d,u),t.strokeRect(v,x,d,u),t.fillStyle=a.backgroundColor,t.fillRect(M,x+1,d-2,u-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:r}=this,{bodySpacing:s,bodyAlign:a,displayColors:l,boxHeight:u,boxWidth:d,boxPadding:h}=i,g=le(i.bodyFont);let y=g.lineHeight,_=0;const x=$r(i.rtl,this.x,this.width),v=function(T){e.fillText(T,x.x(t.x+_),t.y+y/2),t.y+=y+s},M=x.textAlign(a);let C,R,F,I,L,N,B;for(e.textAlign=a,e.textBaseline="middle",e.font=g.string,t.x=Ha(this,M,i),e.fillStyle=i.bodyColor,Jt(this.beforeBody,v),_=l&&M!=="right"?a==="center"?d/2+h:d+2+h:0,I=0,N=r.length;I<N;++I){for(C=r[I],R=this.labelTextColors[I],e.fillStyle=R,Jt(C.before,v),F=C.lines,l&&F.length&&(this._drawColorBox(e,t,I,x,i),y=Math.max(g.lineHeight,u)),L=0,B=F.length;L<B;++L)v(F[L]),y=g.lineHeight;Jt(C.after,v)}_=0,y=g.lineHeight,Jt(this.afterBody,v),t.y-=s}drawFooter(t,e,i){const r=this.footer,s=r.length;let a,l;if(s){const u=$r(i.rtl,this.x,this.width);for(t.x=Ha(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=u.textAlign(i.footerAlign),e.textBaseline="middle",a=le(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,l=0;l<s;++l)e.fillText(r[l],u.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,e,i,r){const{xAlign:s,yAlign:a}=this,{x:l,y:u}=t,{width:d,height:h}=i,{topLeft:g,topRight:y,bottomLeft:_,bottomRight:x}=Ci(r.cornerRadius);e.fillStyle=r.backgroundColor,e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.beginPath(),e.moveTo(l+g,u),a==="top"&&this.drawCaret(t,e,i,r),e.lineTo(l+d-y,u),e.quadraticCurveTo(l+d,u,l+d,u+y),a==="center"&&s==="right"&&this.drawCaret(t,e,i,r),e.lineTo(l+d,u+h-x),e.quadraticCurveTo(l+d,u+h,l+d-x,u+h),a==="bottom"&&this.drawCaret(t,e,i,r),e.lineTo(l+_,u+h),e.quadraticCurveTo(l,u+h,l,u+h-_),a==="center"&&s==="left"&&this.drawCaret(t,e,i,r),e.lineTo(l,u+g),e.quadraticCurveTo(l,u,l+g,u),e.closePath(),e.fill(),r.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,r=i&&i.x,s=i&&i.y;if(r||s){const a=ro[t.position].call(this,this._active,this._eventPosition);if(!a)return;const l=this._size=vm(this,t),u=Object.assign({},a,this._size),d=Sm(e,t,u),h=Tm(t,u,d,e);(r._to!==h.x||s._to!==h.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=l.width,this.height=l.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const r={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=we(e.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&l&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,r,e),ig(t,e.textDirection),s.y+=a.top,this.drawTitle(s,t,e),this.drawBody(s,t,e),this.drawFooter(s,t,e),rg(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,r=t.map(({datasetIndex:l,index:u})=>{const d=this.chart.getDatasetMeta(l);if(!d)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:d.data[u],index:u}}),s=!ma(i,r),a=this._positionChanged(r,e);(s||a)&&(this._active=r,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,s=this._active||[],a=this._getActiveElements(t,s,e,i),l=this._positionChanged(a,t),u=e||!ma(a,s)||l;return u&&(this._active=a,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),u}_getActiveElements(t,e,i,r){const s=this.options;if(t.type==="mouseout")return[];if(!r)return e.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:i,caretY:r,options:s}=this,a=ro[s.position].call(this,t,e);return a!==!1&&(i!==a.x||r!==a.y)}}var $e={id:"tooltip",_element:Cm,positioners:ro,afterInit(n,t,e){e&&(n.tooltip=new Cm({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Dm},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},$O=Object.freeze({__proto__:null,Colors:iO,Decimation:aO,Filler:DO,Legend:PO,SubTitle:NO,Title:LO,Tooltip:$e});const YO=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function qO(n,t,e,i){const r=n.indexOf(t);if(r===-1)return YO(n,t,e,i);const s=n.lastIndexOf(t);return r!==s?e:r}const jO=(n,t)=>n===null?null:Ce(Math.round(n),0,t);function Om(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class GO extends dr{static id="category";static defaults={ticks:{callback:Om}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:r,label:s}of e)i[r]===s&&i.splice(r,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(xt(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:qO(i,t,Mt(e,t),this._addedLabels),jO(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(r=this.getLabels().length-1)),this.min=i,this.max=r}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,r=[];let s=this.getLabels();s=t===0&&e===s.length-1?s:s.slice(t,e+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=t;a<=e;a++)r.push({value:a});return r}getLabelForValue(t){return Om.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function KO(n,t){const e=[],{bounds:r,step:s,min:a,max:l,precision:u,count:d,maxTicks:h,maxDigits:g,includeBounds:y}=n,_=s||1,x=h-1,{min:v,max:M}=t,C=!xt(a),R=!xt(l),F=!xt(d),I=(M-v)/(g+1);let L=Ap((M-v)/x/_)*_,N,B,T,S;if(L<1e-14&&!C&&!R)return[{value:v},{value:M}];S=Math.ceil(M/L)-Math.floor(v/L),S>x&&(L=Ap(S*L/x/_)*_),xt(u)||(N=Math.pow(10,u),L=Math.ceil(L*N)/N),r==="ticks"?(B=Math.floor(v/L)*L,T=Math.ceil(M/L)*L):(B=v,T=M),C&&R&&s&&BM((l-a)/s,L/1e3)?(S=Math.round(Math.min((l-a)/L,h)),L=(l-a)/S,B=a,T=l):F?(B=C?a:B,T=R?l:T,S=d-1,L=(T-B)/S):(S=(T-B)/L,Hs(S,Math.round(S),L/1e3)?S=Math.round(S):S=Math.ceil(S));const O=Math.max(Ep(L),Ep(B));N=Math.pow(10,xt(u)?O:u),B=Math.round(B*N)/N,T=Math.round(T*N)/N;let U=0;for(C&&(y&&B!==a?(e.push({value:a}),B<a&&U++,Hs(Math.round((B+U*L)*N)/N,a,Am(a,I,n))&&U++):B<a&&U++);U<S;++U){const $=Math.round((B+U*L)*N)/N;if(R&&$>l)break;e.push({value:$})}return R&&y&&T!==l?e.length&&Hs(e[e.length-1].value,l,Am(l,I,n))?e[e.length-1].value=l:e.push({value:l}):(!R||T===l)&&e.push({value:T}),e}function Am(n,t,{horizontal:e,minRotation:i}){const r=xe(i),s=(e?Math.sin(r):Math.cos(r))||.001,a=.75*t*(""+n).length;return Math.min(t/s,a)}class Wa extends dr{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return xt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:r,max:s}=this;const a=u=>r=e?r:u,l=u=>s=i?s:u;if(t){const u=Yn(r),d=Yn(s);u<0&&d<0?l(0):u>0&&d>0&&a(0)}if(r===s){let u=s===0?1:Math.abs(s*.05);l(s+u),t||a(r-u)}this.min=r,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,r;return i?(r=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),e=e||11),e&&(r=Math.min(e,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const r={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},s=this._range||this,a=KO(r,s);return t.bounds==="ticks"&&Rp(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const r=(i-e)/Math.max(t.length-1,1)/2;e-=r,i+=r}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return $s(t,this.chart.options.locale,this.options.ticks.format)}}class XO extends Wa{static id="linear";static defaults={ticks:{callback:Ta.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ae(t)?t:0,this.max=ae(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=xe(this.options.ticks.minRotation),r=(t?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,s.lineHeight/r))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const so=n=>Math.floor(ki(n)),fr=(n,t)=>Math.pow(10,so(n)+t);function Rm(n){return n/Math.pow(10,so(n))===1}function Em(n,t,e){const i=Math.pow(10,e),r=Math.floor(n/i);return Math.ceil(t/i)-r}function ZO(n,t){const e=t-n;let i=so(e);for(;Em(n,t,i)>10;)i++;for(;Em(n,t,i)<10;)i--;return Math.min(i,so(n))}function QO(n,{min:t,max:e}){t=pn(n.min,t);const i=[],r=so(t);let s=ZO(t,e),a=s<0?Math.pow(10,Math.abs(s)):1;const l=Math.pow(10,s),u=r>s?Math.pow(10,r):0,d=Math.round((t-u)*a)/a,h=Math.floor((t-u)/l/10)*l*10;let g=Math.floor((d-h)/Math.pow(10,s)),y=pn(n.min,Math.round((u+h+g*Math.pow(10,s))*a)/a);for(;y<e;)i.push({value:y,major:Rm(y),significand:g}),g>=10?g=g<15?15:20:g++,g>=20&&(s++,g=2,a=s>=0?1:a),y=Math.round((u+h+g*Math.pow(10,s))*a)/a;const _=pn(n.max,y);return i.push({value:_,major:Rm(_),significand:g}),i}class JO extends dr{static id="logarithmic";static defaults={ticks:{callback:Ta.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Wa.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return ae(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ae(t)?Math.max(0,t):null,this.max=ae(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ae(this._userMin)&&(this.min=t===fr(this.min,0)?fr(this.min,-1):fr(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,r=this.max;const s=l=>i=t?i:l,a=l=>r=e?r:l;i===r&&(i<=0?(s(1),a(10)):(s(fr(i,-1)),a(fr(r,1)))),i<=0&&s(fr(r,-1)),r<=0&&a(fr(i,1)),this.min=i,this.max=r}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=QO(e,this);return t.bounds==="ticks"&&Rp(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":$s(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=ki(t),this._valueRange=ki(this.max)-ki(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(ki(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function Mu(n){const t=n.ticks;if(t.display&&n.display){const e=we(t.backdropPadding);return Mt(t.font&&t.font.size,se.font.size)+e.height}return 0}function tA(n,t,e){return e=Yt(e)?e:[e],{w:tk(n,t.string,e),h:e.length*t.lineHeight}}function Pm(n,t,e,i,r){return n===i||n===r?{start:t-e/2,end:t+e/2}:n<i||n>r?{start:t-e,end:t}:{start:t,end:t+e}}function eA(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],r=[],s=n._pointLabels.length,a=n.options.pointLabels,l=a.centerPointLabels?Rt/s:0;for(let u=0;u<s;u++){const d=a.setContext(n.getPointLabelContext(u));r[u]=d.padding;const h=n.getPointPosition(u,n.drawingArea+r[u],l),g=le(d.font),y=tA(n.ctx,g,n._pointLabels[u]);i[u]=y;const _=Ue(n.getIndexAngle(u)+l),x=Math.round(xa(_)),v=Pm(x,h.x,y.w,0,180),M=Pm(x,h.y,y.h,90,270);nA(e,t,_,v,M)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=sA(n,i,r)}function nA(n,t,e,i,r){const s=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let l=0,u=0;i.start<t.l?(l=(t.l-i.start)/s,n.l=Math.min(n.l,t.l-l)):i.end>t.r&&(l=(i.end-t.r)/s,n.r=Math.max(n.r,t.r+l)),r.start<t.t?(u=(t.t-r.start)/a,n.t=Math.min(n.t,t.t-u)):r.end>t.b&&(u=(r.end-t.b)/a,n.b=Math.max(n.b,t.b+u))}function iA(n,t,e){const i=n.drawingArea,{extra:r,additionalAngle:s,padding:a,size:l}=e,u=n.getPointPosition(t,i+r+a,s),d=Math.round(xa(Ue(u.angle+re))),h=lA(u.y,l.h,d),g=oA(d),y=aA(u.x,l.w,g);return{visible:!0,x:u.x,y:h,textAlign:g,left:y,top:h,right:y+l.w,bottom:h+l.h}}function rA(n,t){if(!t)return!0;const{left:e,top:i,right:r,bottom:s}=n;return!(ri({x:e,y:i},t)||ri({x:e,y:s},t)||ri({x:r,y:i},t)||ri({x:r,y:s},t))}function sA(n,t,e){const i=[],r=n._pointLabels.length,s=n.options,{centerPointLabels:a,display:l}=s.pointLabels,u={extra:Mu(s)/2,additionalAngle:a?Rt/r:0};let d;for(let h=0;h<r;h++){u.padding=e[h],u.size=t[h];const g=iA(n,h,u);i.push(g),l==="auto"&&(g.visible=rA(g,d),g.visible&&(d=g))}return i}function oA(n){return n===0||n===180?"center":n<180?"left":"right"}function aA(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function lA(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function cA(n,t,e){const{left:i,top:r,right:s,bottom:a}=e,{backdropColor:l}=t;if(!xt(l)){const u=Ci(t.borderRadius),d=we(t.backdropPadding);n.fillStyle=l;const h=i-d.left,g=r-d.top,y=s-i+d.width,_=a-r+d.height;Object.values(u).some(x=>x!==0)?(n.beginPath(),Hr(n,{x:h,y:g,w:y,h:_,radius:u}),n.fill()):n.fillRect(h,g,y,_)}}function uA(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let r=t-1;r>=0;r--){const s=n._pointLabelItems[r];if(!s.visible)continue;const a=i.setContext(n.getPointLabelContext(r));cA(e,a,s);const l=le(a.font),{x:u,y:d,textAlign:h}=s;ar(e,n._pointLabels[r],u,d+l.lineHeight/2,l,{color:a.color,textAlign:h,textBaseline:"middle"})}}function Im(n,t,e,i){const{ctx:r}=n;if(e)r.arc(n.xCenter,n.yCenter,t,0,te);else{let s=n.getPointPosition(0,t);r.moveTo(s.x,s.y);for(let a=1;a<i;a++)s=n.getPointPosition(a,t),r.lineTo(s.x,s.y)}}function dA(n,t,e,i,r){const s=n.ctx,a=t.circular,{color:l,lineWidth:u}=t;!a&&!i||!l||!u||e<0||(s.save(),s.strokeStyle=l,s.lineWidth=u,s.setLineDash(r.dash||[]),s.lineDashOffset=r.dashOffset,s.beginPath(),Im(n,e,a,i),s.closePath(),s.stroke(),s.restore())}function fA(n,t,e){return Oi(n,{label:e,index:t,type:"pointLabel"})}class hA extends Wa{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ta.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=we(Mu(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=ae(t)&&!isNaN(t)?t:0,this.max=ae(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Mu(this.options))}generateTickLabels(t){Wa.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const r=Qt(this.options.pointLabels.callback,[e,i],this);return r||r===0?r:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?eA(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,r){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,r))}getIndexAngle(t){const e=te/(this._pointLabels.length||1),i=this.options.startAngle||0;return Ue(t*e+xe(i))}getDistanceFromCenterForValue(t){if(xt(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(xt(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return fA(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const r=this.getIndexAngle(t)-re+i;return{x:Math.cos(r)*e+this.xCenter,y:Math.sin(r)*e+this.yCenter,angle:r}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:r,bottom:s}=this._pointLabelItems[t];return{left:e,top:i,right:r,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Im(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:r,border:s}=e,a=this._pointLabels.length;let l,u,d;if(e.pointLabels.display&&uA(this,a),r.display&&this.ticks.forEach((h,g)=>{if(g!==0||g===0&&this.min<0){u=this.getDistanceFromCenterForValue(h.value);const y=this.getContext(g),_=r.setContext(y),x=s.setContext(y);dA(this,_,u,a,x)}}),i.display){for(t.save(),l=a-1;l>=0;l--){const h=i.setContext(this.getPointLabelContext(l)),{color:g,lineWidth:y}=h;!y||!g||(t.lineWidth=y,t.strokeStyle=g,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,u=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),d=this.getPointPosition(l,u),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(d.x,d.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const r=this.getIndexAngle(0);let s,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(r),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((l,u)=>{if(u===0&&this.min>=0&&!e.reverse)return;const d=i.setContext(this.getContext(u)),h=le(d.font);if(s=this.getDistanceFromCenterForValue(this.ticks[u].value),d.showLabelBackdrop){t.font=h.string,a=t.measureText(l.label).width,t.fillStyle=d.backdropColor;const g=we(d.backdropPadding);t.fillRect(-a/2-g.left,-s-h.size/2-g.top,a+g.width,h.size+g.height)}ar(t,l.label,0,-s,h,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),t.restore()}drawTitle(){}}const Va={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},on=Object.keys(Va);function Lm(n,t){return n-t}function Nm(n,t){if(xt(t))return null;const e=n._adapter,{parser:i,round:r,isoWeekday:s}=n._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),ae(a)||(a=typeof i=="string"?e.parse(a,i):e.parse(a)),a===null?null:(r&&(a=r==="week"&&(Di(s)||s===!0)?e.startOf(a,"isoWeek",s):e.startOf(a,r)),+a)}function Bm(n,t,e,i){const r=on.length;for(let s=on.indexOf(n);s<r-1;++s){const a=Va[on[s]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(l*a.size))<=i)return on[s]}return on[r-1]}function pA(n,t,e,i,r){for(let s=on.length-1;s>=on.indexOf(e);s--){const a=on[s];if(Va[a].common&&n._adapter.diff(r,i,a)>=t-1)return a}return on[e?on.indexOf(e):0]}function gA(n){for(let t=on.indexOf(n)+1,e=on.length;t<e;++t)if(Va[on[t]].common)return on[t]}function Fm(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:r}=qc(e,t),s=e[i]>=t?e[i]:e[r];n[s]=!0}}function mA(n,t,e,i){const r=n._adapter,s=+r.startOf(t[0].value,i),a=t[t.length-1].value;let l,u;for(l=s;l<=a;l=+r.add(l,1,i))u=e[l],u>=0&&(t[u].major=!0);return t}function zm(n,t,e){const i=[],r={},s=t.length;let a,l;for(a=0;a<s;++a)l=t[a],r[l]=a,i.push({value:l,major:!1});return s===0||!e?i:mA(n,i,r,e)}class ku extends dr{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),r=this._adapter=new Dg._date(t.adapters.date);r.init(e),Us(i.displayFormats,r.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:Nm(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:r,max:s,minDefined:a,maxDefined:l}=this.getUserBounds();function u(d){!a&&!isNaN(d.min)&&(r=Math.min(r,d.min)),!l&&!isNaN(d.max)&&(s=Math.max(s,d.max))}(!a||!l)&&(u(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&u(this.getMinMax(!1))),r=ae(r)&&!isNaN(r)?r:+e.startOf(Date.now(),i),s=ae(s)&&!isNaN(s)?s:+e.endOf(Date.now(),i)+1,this.min=Math.min(r,s-1),this.max=Math.max(r+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,r=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const s=this.min,a=this.max,l=HM(r,s,a);return this._unit=e.unit||(i.autoSkip?Bm(e.minUnit,this.min,this.max,this._getLabelCapacity(s)):pA(this,l.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:gA(this._unit),this.initOffsets(r),t.reverse&&l.reverse(),zm(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,r,s;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?e=1-r:e=(this.getDecimalForValue(t[1])-r)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?i=s:i=(s-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=Ce(e,0,a),i=Ce(i,0,a),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,r=this.options,s=r.time,a=s.unit||Bm(s.minUnit,e,i,this._getLabelCapacity(e)),l=Mt(r.ticks.stepSize,1),u=a==="week"?s.isoWeekday:!1,d=Di(u)||u===!0,h={};let g=e,y,_;if(d&&(g=+t.startOf(g,"isoWeek",u)),g=+t.startOf(g,d?"day":a),t.diff(i,e,a)>1e5*l)throw new Error(e+" and "+i+" are too far apart with stepSize of "+l+" "+a);const x=r.ticks.source==="data"&&this.getDataTimestamps();for(y=g,_=0;y<i;y=+t.add(y,l,a),_++)Fm(h,y,x);return(y===i||r.bounds==="ticks"||_===1)&&Fm(h,y,x),Object.keys(h).sort(Lm).map(v=>+v)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const r=this.options.time.displayFormats,s=this._unit,a=e||r[s];return this._adapter.format(t,a)}_tickFormatFunction(t,e,i,r){const s=this.options,a=s.ticks.callback;if(a)return Qt(a,[t,e,i],this);const l=s.time.displayFormats,u=this._unit,d=this._majorUnit,h=u&&l[u],g=d&&l[d],y=i[e],_=d&&g&&y&&y.major;return this._adapter.format(t,r||(_?g:h))}generateTickLabels(t){let e,i,r;for(e=0,i=t.length;e<i;++e)r=t[e],r.label=this._tickFormatFunction(r.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,r=xe(this.isHorizontal()?e.maxRotation:e.minRotation),s=Math.cos(r),a=Math.sin(r),l=this._resolveTickFontOptions(0).size;return{w:i*s+l*a,h:i*a+l*s}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,r=i[e.unit]||i.millisecond,s=this._tickFormatFunction(t,0,zm(this,[t],this._majorUnit),r),a=this._getLabelSize(s),l=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return l>0?l:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(e=0,i=r.length;e<i;++e)t=t.concat(r[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const r=this.getLabels();for(e=0,i=r.length;e<i;++e)t.push(Nm(this,r[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Lp(t.sort(Lm))}}function $a(n,t,e){let i=0,r=n.length-1,s,a,l,u;e?(t>=n[i].pos&&t<=n[r].pos&&({lo:i,hi:r}=ii(n,"pos",t)),{pos:s,time:l}=n[i],{pos:a,time:u}=n[r]):(t>=n[i].time&&t<=n[r].time&&({lo:i,hi:r}=ii(n,"time",t)),{time:s,pos:l}=n[i],{time:a,pos:u}=n[r]);const d=a-s;return d?l+(u-l)*(t-s)/d:l}class yA extends ku{static id="timeseries";static defaults=ku.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=$a(e,this.min),this._tableRange=$a(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,r=[],s=[];let a,l,u,d,h;for(a=0,l=t.length;a<l;++a)d=t[a],d>=e&&d<=i&&r.push(d);if(r.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(a=0,l=r.length;a<l;++a)h=r[a+1],u=r[a-1],d=r[a],Math.round((h+u)/2)!==d&&s.push({time:d,pos:a/(l-1)});return s}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((r,s)=>r-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return($a(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return $a(this._table,i*this._tableRange+this._minPos,!0)}}var _A=Object.freeze({__proto__:null,CategoryScale:GO,LinearScale:XO,LogarithmicScale:JO,RadialLinearScale:hA,TimeScale:ku,TimeSeriesScale:yA});const bA=[bD,XC,$O,_A];function xA(n){const e=`barChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:u=>({label:u.dataset.label,value:u.label})}};$e.positioners[e]=function(u,d){if(!u.length||n.tooltipState.interactionMode==="interactive"||d.x===null||d.y===null)return!1;const h=this.chart.canvas.getBoundingClientRect(),g=n.tooltipState.width||this.width,y=h.width/2,_=Ka(d,g,y),x=d.y,v=d.x<y?"left":"center";return{x:_-n.tooltipState.offsetX,y:x-n.tooltipState.offsetY,xAlign:v}},hu.modes.customInteractionMode=function(u,d){const h=Ai(d,u),g=[];return hu.evaluateInteractionItems(u,u.options.indexAxis||"x",h,(y,_,x)=>{u.options.indexAxis==="y"&&y.inYRange(h.y,!0)&&u.data.datasets[_].data[x]&&g.push({element:y,datasetIndex:_,index:x}),u.options.indexAxis==="x"&&h.x!==null&&y.inXRange(h.x,!0)&&u.data.datasets[_].data[x]&&g.push({element:y,datasetIndex:_,index:x})}),g};const r=n.numLabels.value>25?Jm:ty,s=({chart:u,index:d})=>{const h=u.data;return{size:r,style:h?.isLabelEmpty?.[d]?"italic":"normal"}},a=(u,d,h)=>u.chart.options.indexAxis===u.axis?(d=u.getLabelForValue(h),d&&d.length>Xa?d.slice(0,Xa)+"...":d):u.getLabelForValue(Number(d)),l=p.computed(()=>({indexAxis:n.indexAxis,skipNull:!0,scales:{x:{stacked:n.stacked.value,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{maxRotation:90,autoSkip:!1,font:s,callback:function(u,d){return a(this,u,d)}},title:{display:n.indexAxis==="y"?!xt(n.metricAxesTitle?.value):!xt(n.dimensionAxesTitle?.value),text:n.indexAxis==="y"?n.metricAxesTitle?.value:n.dimensionAxesTitle?.value,padding:{top:3,bottom:0,left:0,right:0},font:{weight:"bold"}}},y:{stacked:n.stacked.value,beginAtZero:!0,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{padding:0,font:s,callback:function(u,d){return a(this,u,d)}},title:{display:n.indexAxis==="x"?!xt(n.metricAxesTitle?.value):!xt(n.dimensionAxesTitle?.value),text:n.indexAxis==="x"?n.metricAxesTitle?.value:n.dimensionAxesTitle?.value,padding:{bottom:3,top:0,left:0,right:0},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:u=>{Xm(n.tooltipState,u)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1,layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return p.getCurrentInstance()&&p.onUnmounted(()=>{$e.positioners[e]&&delete $e.positioners[e]}),l}rn.register(...bA);const wA=(n,t)=>{const e=t.datasets.map(r=>r.label),i=n.datasets.map(r=>r.label);return n.datasets.length===t.datasets.length&&e.every((r,s)=>r===i[s])};function vA(n,t,e,i,r){const s=p.shallowRef(null),a=(l,u)=>{if(t.value)return new rn(t.value,{type:n,data:l,plugins:i,options:u})};return p.onMounted(()=>{s.value=a(e.value,r.value)}),p.onBeforeUnmount(()=>{xt(s.value)||s.value.destroy()}),p.watch(e,(l,u)=>{if(wA(u,l)&&!xt(s.value)){for(const[d,h]of l.datasets.entries())Object.assign(s.value.data.datasets[d],h);s.value.data.labels=l.labels,s.value.update()}else xt(s.value)||s.value.destroy(),s.value=a(l,r.value)}),p.watch(t,()=>{xt(s.value)||s.value.destroy(),s.value=a(e.value,r.value)}),p.watch(r,(l,u)=>{(l.indexAxis!==u.indexAxis||JSON.stringify(l.scales.x.title)!==JSON.stringify(u.scales.x.title)||JSON.stringify(l.scales.y.title)!==JSON.stringify(u.scales.y.title))&&(xt(s.value)||s.value.destroy(),s.value=a(e.value,l))}),s}const Um=1e3,SA=1e4,Hm=1e6,Wm=1e9,Vm=1e12,oo=(n,t)=>{if(t.separator===!1||n<1e3)return n.toString();const e=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(n).toString().split("").reverse().forEach((s,a)=>{a&&a%3===0&&i.push(e),i.push(s)}),i.reverse().join("")},qr=(n,t,e)=>{const i=n/t,r=e.round?"round":"floor";if(e.decimal===!1)return Math[r](i).toString();let s;e.precision?s=i:s=i<10?Math[r](i*10)/10:Math[r](i);let a=s.toString();return typeof e.decimal=="string"&&(a=a.replace(".",e.decimal)),a};function ao(n,t={}){let e;const i=n<0;i&&(n=Math.abs(n)),t.precision&&(n=parseFloat(n.toPrecision(t.precision)));const r=t.min10k?SA:Um;return n<r||t.precision&&t.precision>Math.log10(n)?e=oo(qr(n,1,t),t):n<Hm?e=`${qr(n,Um,t)}k`:n<Wm?e=`${qr(n,Hm,t)}m`:n<Vm?e=`${oo(qr(n,Wm,t),t)}b`:e=`${oo(qr(n,Vm,t),t)}t`,i&&(e=`-${e}`),t.capital&&(e=e.toUpperCase()),t.prefix&&(e=`${t.prefix}${e}`),t.suffix&&(e=`${e}${t.suffix}`),e}ao.addCommas=oo;function TA(n,t,e){const{i18n:i}=kt.useI18n(),{formatBytes:r}=er({i18n:i}),{translateUnit:s}=kt.useTranslatedUnits();return{legendValues:p.computed(()=>n.value.datasets.reduce((l,u)=>{const d=u.total?u.total:u.data.reduce((g,y)=>g+(typeof y=="number"?Number(y)||0:Number(y&&y.y)||0),0);let h;if(e.value==="bytes")h=r(d);else{const g=s(e.value,d);h=i&&i.t("legend.datapointValueDisplay",{value:ao(d,{capital:!0}),unit:g})||`${ao(d,{capital:!0})} ${e.value}`}return{...l,[u.label]:{raw:d,formatted:h,isThreshold:u.isThreshold}}},{}))}}function MA(n){return p.computed(()=>{if(!n.value?.meta)return"";const e=n.value.meta.start,i=n.value.meta.end;return e&&i?`${Ph(new Date(e))} - ${Ph(new Date(i),{includeTZ:!0})}`:""})}function kA(n){const e=`donutChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:s=>({label:s.dataset.label,value:s.label})}};$e.positioners[e]=function(s,a){if(!s.length||a.x===null||a.y===null)return!1;const l=this.chart.canvas.getBoundingClientRect(),u=n.tooltipState.width||this.width,d=l.width/2,h=Ka(a,u,d),g=a.y,y=a.x<d?"left":"center";return{x:h-n.tooltipState.offsetX,y:g,xAlign:y}};const r=p.computed(()=>({cutout:"65%",responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:s=>{Xm(n.tooltipState,s)}}},layout:{padding:{left:0,right:0,top:5,bottom:0}}}));return p.onUnmounted(()=>{$e.positioners[e]&&delete $e.positioners[e]}),{options:r}}function DA(n){const t=p.computed(()=>({type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:u=>{const d=new Date(u);return _y({tickValue:d,granularity:n.granularity.value,dayBoundaryCrossed:a.value})}},title:{display:!xt(n.dimensionAxesTitle?.value),text:n.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}},border:{display:!1},stacked:n.stacked.value})),e=p.computed(()=>({title:{display:!xt(n.metricAxesTitle?.value),text:n.metricAxesTitle?.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:n.stacked.value})),r=`lineChartTooltipPosition-${n.tooltipState.chartID}`,s={enabled:!1,position:r};$e.positioners[r]=function(u,d){if(!u.length||n.tooltipState.interactionMode==="interactive"||d.x===null||d.y===null)return!1;const h=this.chart.canvas.getBoundingClientRect(),g=n.tooltipState.width||this.width,y=n.tooltipState.height||this.height,_=h.width/2,x=h.height/2,v=Ka(d,g,_);let M=Zm(d,y,x);const C=d.y<x?"top":"bottom",R=d.x<_?"left":"center";return y>h.height&&(M=0),{x:v,y:M,xAlign:R,yAlign:C}};const a=p.computed(()=>{const u=Number(n.timeRangeMs.value),d=new Date,h=new Date(d.getTime()-u);return mp(u)>24||h.getDate()!==d.getDate()}),l=p.computed(()=>({hover:{mode:"index",intersect:!1},elements:{point:{radius:n.pointsWithoutHover?.value?3:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:e.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...s,external:u=>{Du(n.tooltipState,u,n.granularity.value)}},thresholdPlugin:{threshold:n.threshold?.value}},interaction:{mode:"index",intersect:!1},layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return p.onUnmounted(()=>{$e.positioners[r]&&delete $e.positioners[r]}),{options:l}}function CA(n){const t=p.computed(()=>{const l=Number(n.timeRangeMs.value),u=new Date,d=new Date(u.getTime()-l);return mp(l)>24||d.getDate()!==u.getDate()}),e=p.computed(()=>({type:"time",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:l=>_y({tickValue:new Date(l),granularity:n.granularity.value,dayBoundaryCrossed:t.value})},title:{display:!xt(n.dimensionAxesTitle?.value),text:n.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}},border:{display:!1}})),i=p.computed(()=>({title:{display:!xt(n.metricAxesTitle?.value),text:n.metricAxesTitle?.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1}})),s=`scatterChartTooltipPosition-${n.tooltipState.chartID}`;$e.positioners[s]=function(l,u){if(!l.length||n.tooltipState.interactionMode==="interactive"||u.x===null||u.y===null)return!1;const d=this.chart.canvas.getBoundingClientRect(),h=n.tooltipState.width||this.width,g=n.tooltipState.height||this.height,y=d.width/2,_=d.height/2,x=Ka(u,h,y);let v=Zm(u,g,_);const M=u.y<_?"top":"bottom",C=u.x<y?"left":"center";return g>d.height&&(v=0),{x,y:v,xAlign:C,yAlign:M}};const a=p.computed(()=>({hover:{mode:"nearest",intersect:!1},interaction:{mode:"nearest",intersect:!1},animation:{duration:250,easing:"linear"},scales:{x:e.value,y:i.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{enabled:!1,position:s,external:l=>{Du(n.tooltipState,l,n.granularity.value)}},outlierBandPlugin:{value:n.outlierValue?.value,color:n.themeColors.value.outlierBand}},layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return p.onUnmounted(()=>{$e.positioners[s]&&delete $e.positioners[s]}),{options:a}}function OA(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:r,pivotRecords:s,rowLabels:a,colorPalette:l}=n,{i18n:u}=kt.useI18n();return t?i.map(h=>({label:u&&u.te(`chartLabels.${h}`)&&u.t(`chartLabels.${h}`)||h,backgroundColor:Ou(i.indexOf(h),ai),data:a.map((g,y)=>e?s[`${g.id},${h}`]||0:s[`${y},${h}`]||null)})):Array.from(r).flatMap((h,g)=>{if(!h)return[];const y=Au(g,h.name,h.id==="empty",l);return{label:u&&u.te(`chartLabels.${h.name}`)&&u.t(`chartLabels.${h.name}`)||h.name,backgroundColor:y,data:a.map(_=>s[`${_.id},${h.id}`]||null),isSegmentEmpty:h.id==="empty"}})}function AA(n,t){const{i18n:e}=kt.useI18n();return p.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const r=t.value.data,{display:s,metric_names:a}=t.value.meta,l=s&&Object.keys(s),u=a&&a.length>1,d=s&&l&&l.length>0,h=d&&l.length>1;if(!r.length||!a)return{datasets:[],labels:[]};const g=d&&l||a,y=g[0],_=g.length>1?g[1]:g[0],x=Object.fromEntries(u?r.flatMap(S=>a.map((O,U)=>{const $=S.event[y],it=d?`${$},${O}`:`${U},${O}`,at=S.event[O];return[it,at]})):r.map(S=>{const O=d?`${S.event[y]},${S.event[_]}`:`${y},${_}`,U=S.event[a[0]];return[O,U]})),v=Object.keys(x).reduce((S,O)=>{const[U]=O.split(","),$=x[O];return S[U]?S[U]+=$:S[U]=$,S},{}),M=Object.entries(v).sort(([,S],[,O])=>Number(O)-Number(S)).map(([S])=>S),C=s[y],R=s[_];let F=d&&C&&Object.entries(C).map(([S,O])=>({id:S,name:O.name}))||a.map(S=>({id:S,name:S})),I=d&&R&&Object.entries(R).map(([S,O])=>({id:S,name:O.name}))||a.map(S=>({id:S,name:S}));if(d&&y==="country_code"&&(F=F.map(S=>({...S,name:Mc(S.id)||S.name}))),d&&_==="country_code"&&(I=I.map(S=>({...S,name:Mc(S.id)||S.name}))),y!=="status_code"&&y!=="status_code_grouped"&&(F.sort((S,O)=>M.indexOf(S.id)-M.indexOf(O.id)),I.sort((S,O)=>M.indexOf(S.id)-M.indexOf(O.id))),!F||!I)return{labels:[],datasets:[]};const L=OA({isMultiMetric:u,hasDimensions:d,metricNames:a,dimensionFieldNames:g,barSegmentLabels:I,pivotRecords:x,rowLabels:F,colorPalette:n.colorPalette||ai}),N=d?F.map(S=>e&&e.te(`chartLabels.${S.name}`)&&e.t(`chartLabels.${S.name}`)||S.name):a.map(S=>e&&e.te(`chartLabels.${S}`)&&e.t(`chartLabels.${S}`)||S),B=F.map(S=>S.id==="empty");return{labels:N,datasets:L,isLabelEmpty:B,isMultiDimension:h}}}catch(r){return console.error(r),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const RA=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,r)=>i+r*e),EA=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return yp(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},PA=(n,t,e,i,r)=>{const a=Math.max(t-6e4,Math.max(...(r||[]).map(d=>new Date(d.timestamp).valueOf()))),l=Math.floor((n-i)/e)*e+i,u=Math.floor((a-i)/e)*e+i+e;return RA(l,u,e)};function IA(n,t){const{i18n:e}=kt.useI18n();return p.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const r=t.value.data,{display:s,metric_names:a,start:l,end:u}=t.value.meta,d=new Date(l).getTime(),h=new Date(u).getTime();if(!a)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const g=s&&Object.keys(s)||a,y=g&&g[0],_=s[y];let x=s&&_&&Object.keys(_).map(N=>({id:N,name:_[N].name}))||a.map(N=>({id:N,name:N}));y==="country_code"&&(x=x.map(N=>({...N,name:Mc(N.id)||N.name})));const v=t.value.meta.granularity_ms;if(typeof v!="number"||isNaN(v)||!isFinite(v)||v===0)return console.error("Invalid step value:",v),{datasets:[],labels:[]};if(!r.length)return{datasets:[],labels:[]};const M=EA(d),C=PA(d,h,v,M,r),R=new Set,F=r?.length?r.reduce((N,B)=>{const T=new Date(B.timestamp).valueOf(),S=B.event;for(const O of a)R.add(O),T in N||(N[T]={}),O in N[T]||(N[T][O]={});for(const O of a)x.forEach(U=>{S[y]===U.id||O===U.id?(N[T][O]||(N[T][O]={}),N[T][O][U.id]=Math.round(Number(S[O])*1e3)/1e3):g.length||(N[T][O]||(N[T][O]={}),N[T][O][U.id]=Math.round(Number(S[U.id])*1e3)/1e3)});return N},{}):{},L=[...a.length===1?a.flatMap(N=>x.map(B=>[N,B.id,B.name,B.id==="empty"])):x.map(N=>[N.name,N.id,N.name,N.id==="empty"])].map(([N,B,T,S],O)=>{const U=C.map(ot=>ot in F&&N in F[ot]?{x:ot,y:F[ot][N][B]||0}:{x:ot,y:0});let{colorPalette:$,fill:it}=n;xt($)&&($=ai);const at=Au(O,T,S,$);return{rawDimension:T,rawMetric:N,label:e&&e.te(`chartLabels.${T}`)&&e.t(`chartLabels.${T}`)||T,borderColor:at,backgroundColor:at,data:U,total:U.reduce((ot,{y:q})=>ot+Number(q),0),...xR,fill:it,borderWidth:it?vR:wR,isSegmentEmpty:S}});return y==="status_code"||y==="status_code_grouped"?L.sort((N,B)=>(N.label??"")<(B.label??"")?-1:1):L.sort((N,B)=>Number(N.total)<Number(B.total)?-1:1),{datasets:L}}}catch(r){return console.error(r),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const LA=2,NA=.6,BA=1.5,$m=50,FA=[6,4],zA=[2,3],UA=n=>n?Math.random()*n:0;function HA(n,t){const{i18n:e}=kt.useI18n(),i=(r,s)=>s||(r===$m?e.t("scatter.median"):e.t("scatter.percentile",{value:r}));return p.computed(()=>{try{const r=t.value;if(!r?.points?.length)return{datasets:[]};const{metric:s,dimension:a,display:l,start:u,end:d}=r,h=n.scatter||{},g=h.jitterMs??0,y=h.pointRadius??LA,_=h.pointOpacity??NA,x=new Map,v=[];r.points.forEach(q=>{const J=q.group??s,rt=x.get(J)||[];rt.push({x:q.timestamp+UA(g),y:q.value}),x.set(J,rt),v.push(q.value)});const M=h.percentileLines||[],C=[...M.map(q=>q.percentile),...h.outlierPercentile!==void 0?[h.outlierPercentile]:[]],R=C.length?dE(v,C):new Map,F=h.outlierPercentile!==void 0?R.get(h.outlierPercentile):void 0,I=F!==void 0&&Number.isFinite(F),L=I?i(h.outlierPercentile):"",N=xt(n.colorPalette)?ai:n.colorPalette,B=n.themeColors?.value??Qa(),T=[],S=[],O=(q,J)=>{if(!I)return q;const rt=[];for(const tt of q){if(tt.y<=F){rt.push(tt);continue}S.push({...tt,tooltipLabel:e.t("scatter.outlierTooltip",{series:J,label:L})})}return rt};if(Array.from(x.entries()).forEach(([q,J],rt)=>{const tt=a&&l?.[q]?.name||q,G=q==="empty",P=Au(rt,tt,G,N),W=e.te(`chartLabels.${tt}`)&&e.t(`chartLabels.${tt}`)||tt,j=O(J,W);T.push({type:"scatter",rawDimension:tt,rawMetric:s,label:W,borderColor:P,backgroundColor:Yu(P,_),data:j,pointRadius:y,pointHoverRadius:y+2,pointBorderWidth:0,showLine:!1,isSegmentEmpty:G})}),I&&S.length){const q=B.outlier;T.push({type:"scatter",rawDimension:"outlier",rawMetric:s,label:e.t("scatter.outlier",{label:L}),borderColor:q,backgroundColor:q,data:S,pointRadius:y,pointHoverRadius:y+2,pointBorderWidth:0,showLine:!1})}const U=Array.from(x.values()).flat().map(q=>q.x),$=new Date(u).valueOf(),it=new Date(d).valueOf(),at=Number.isFinite($)?$:Math.min(...U),ot=Number.isFinite(it)?it:Math.max(...U);return M.forEach(q=>{const J=R.get(q.percentile);if(J===void 0||!Number.isFinite(J))return;const rt=q.percentile===$m,tt=q.color||(rt?B.medianLine:B.outlier);T.push({type:"line",rawDimension:`percentile-${q.percentile}`,rawMetric:s,label:i(q.percentile,q.label),data:[{x:at,y:J},{x:ot,y:J}],borderColor:tt,backgroundColor:tt,borderDash:q.borderDash||(rt?FA:zA),borderWidth:BA,pointRadius:0,pointHitRadius:0,fill:!1,total:J})}),{datasets:T,...I?{outlierValue:F}:{}}}catch(r){return console.warn(r),{datasets:[]}}})}const WA=(n,t)=>{p.watch([n,t],(e,i,r)=>{const[s,a]=e;!a||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(a,s),r(()=>{window._AnalyticsChartDataInternal?.delete(a)}))},{immediate:!0})};function VA(){const{i18n:n}=kt.useI18n();return{translateUnit:(e,i)=>{const r=i===1,s=`chartUnits.${e}`;return ho(e)?"":n.te(s)?n.t(s,{plural:r?"":"s"}):e}}}const $A="analytics-query-provider",Ym=2;function YA(){const n=p.inject($A);return{evaluateFeatureFlag:(e,i)=>n?n.evaluateFeatureFlagFn(e,i):i}}function qm(n,t){return p.getCurrentScope()?(p.onScopeDispose(n,t),!0):!1}const jm=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const qA=n=>n!=null,jA=Object.prototype.toString,GA=n=>jA.call(n)==="[object Object]";function Ya(n){return Array.isArray(n)?n:[n]}function KA(n){return p.getCurrentInstance()}function XA(n,t={}){if(!p.isRef(n))return p.toRefs(n);const e=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)e[i]=p.customRef(()=>({get(){return n.value[i]},set(r){var s;if(!((s=p.toValue(t.replaceRef))!==null&&s!==void 0)||s)if(Array.isArray(n.value)){const a=[...n.value];a[i]=r,n.value=a}else{const a={...n.value,[i]:r};Object.setPrototypeOf(a,Object.getPrototypeOf(n.value)),n.value=a}else n.value[i]=r}}));return e}function ZA(n,t=!0,e){KA()?p.onMounted(n,e):t?n():p.nextTick(n)}function QA(n,t,e){return p.watch(n,t,{...e,immediate:!0})}const qa=jm?window:void 0;function jr(n){var t;const e=p.toValue(n);return(t=e?.$el)!==null&&t!==void 0?t:e}function lo(...n){const t=(i,r,s,a)=>(i.addEventListener(r,s,a),()=>i.removeEventListener(r,s,a)),e=p.computed(()=>{const i=Ya(p.toValue(n[0])).filter(r=>r!=null);return i.every(r=>typeof r!="string")?i:void 0});return QA(()=>{var i,r;return[(i=(r=e.value)===null||r===void 0?void 0:r.map(s=>jr(s)))!==null&&i!==void 0?i:[qa].filter(s=>s!=null),Ya(p.toValue(e.value?n[1]:n[0])),Ya(p.unref(e.value?n[2]:n[1])),p.toValue(e.value?n[3]:n[2])]},([i,r,s,a],l,u)=>{if(!i?.length||!r?.length||!s?.length)return;const d=GA(a)?{...a}:a,h=i.flatMap(g=>r.flatMap(y=>s.map(_=>t(g,y,_,d))));u(()=>{h.forEach(g=>g())})},{flush:"post"})}function JA(){const n=p.shallowRef(!1),t=p.getCurrentInstance();return t&&p.onMounted(()=>{n.value=!0},t),n}function Gm(n){const t=JA();return p.computed(()=>(t.value,!!n()))}function tR(n,t,e={}){const{window:i=qa,...r}=e;let s;const a=Gm(()=>i&&"MutationObserver"in i),l=()=>{s&&(s.disconnect(),s=void 0)},u=p.watch(p.computed(()=>{const g=Ya(p.toValue(n)).map(jr).filter(qA);return new Set(g)}),g=>{l(),a.value&&g.size&&(s=new MutationObserver(t),g.forEach(y=>s.observe(y,r)))},{immediate:!0,flush:"post"}),d=()=>s?.takeRecords(),h=()=>{u(),l()};return qm(h),{isSupported:a,stop:h,takeRecords:d}}const ja={speed:2,margin:30,direction:"both"};function eR(n){n.scrollLeft>n.scrollWidth-n.clientWidth&&(n.scrollLeft=Math.max(0,n.scrollWidth-n.clientWidth)),n.scrollTop>n.scrollHeight-n.clientHeight&&(n.scrollTop=Math.max(0,n.scrollHeight-n.clientHeight))}function nR(n,t={}){var e,i,r,s;const{pointerTypes:a,preventDefault:l,stopPropagation:u,exact:d,onMove:h,onEnd:g,onStart:y,initialValue:_,axis:x="both",draggingElement:v=qa,containerElement:M,handle:C=n,buttons:R=[0],restrictInView:F,autoScroll:I=!1}=t,L=p.ref((e=p.toValue(_))!==null&&e!==void 0?e:{x:0,y:0}),N=p.ref(),B=P=>a?a.includes(P.pointerType):!0,T=P=>{p.toValue(l)&&P.preventDefault(),p.toValue(u)&&P.stopPropagation()},S=p.toValue(I),O=typeof S=="object"?{speed:(i=p.toValue(S.speed))!==null&&i!==void 0?i:ja.speed,margin:(r=p.toValue(S.margin))!==null&&r!==void 0?r:ja.margin,direction:(s=S.direction)!==null&&s!==void 0?s:ja.direction}:ja,U=P=>typeof P=="number"?[P,P]:[P.x,P.y],$=(P,W,j)=>{const{clientWidth:pt,clientHeight:lt,scrollLeft:et,scrollTop:ht,scrollWidth:ft,scrollHeight:ct}=P,[mt,ut]=U(O.margin),[Lt,zt]=U(O.speed);let vt=0,Ct=0;(O.direction==="x"||O.direction==="both")&&(j.x<mt&&et>0?vt=-Lt:j.x+W.width>pt-mt&&et<ft-pt&&(vt=Lt)),(O.direction==="y"||O.direction==="both")&&(j.y<ut&&ht>0?Ct=-zt:j.y+W.height>lt-ut&&ht<ct-lt&&(Ct=zt)),(vt||Ct)&&P.scrollBy({left:vt,top:Ct,behavior:"auto"})};let it=null;const at=()=>{const P=p.toValue(M);P&&!it&&(it=setInterval(()=>{const W=p.toValue(n).getBoundingClientRect(),{x:j,y:pt}=L.value,lt={x:j-P.scrollLeft,y:pt-P.scrollTop};lt.x>=0&<.y>=0&&($(P,W,lt),lt.x+=P.scrollLeft,lt.y+=P.scrollTop,L.value=lt)},1e3/60))},ot=()=>{it&&(clearInterval(it),it=null)},q=(P,W,j,pt)=>{const[lt,et]=typeof j=="number"?[j,j]:[j.x,j.y],{clientWidth:ht,clientHeight:ft}=W;return P.x<lt||P.x+pt.width>ht-lt||P.y<et||P.y+pt.height>ft-et},J=()=>{if(p.toValue(t.disabled)||!N.value)return;const P=p.toValue(M);if(!P)return;const W=p.toValue(n).getBoundingClientRect(),{x:j,y:pt}=L.value,lt={x:j-P.scrollLeft,y:pt-P.scrollTop};q(lt,P,O.margin,W)?at():ot()};p.toValue(I)&&p.watch(L,J);const rt=P=>{var W;if(!p.toValue(R).includes(P.button)||p.toValue(t.disabled)||!B(P)||p.toValue(d)&&P.target!==p.toValue(n))return;const j=p.toValue(M),pt=j==null||(W=j.getBoundingClientRect)===null||W===void 0?void 0:W.call(j),lt=p.toValue(n).getBoundingClientRect(),et={x:P.clientX-(j?lt.left-pt.left+(I?0:j.scrollLeft):lt.left),y:P.clientY-(j?lt.top-pt.top+(I?0:j.scrollTop):lt.top)};y?.(et,P)!==!1&&(N.value=et,T(P))},tt=P=>{if(p.toValue(t.disabled)||!B(P)||!N.value)return;const W=p.toValue(M);W instanceof HTMLElement&&eR(W);const j=p.toValue(n).getBoundingClientRect();let{x:pt,y:lt}=L.value;if((x==="x"||x==="both")&&(pt=P.clientX-N.value.x,W&&(pt=Math.min(Math.max(0,pt),W.scrollWidth-j.width))),(x==="y"||x==="both")&&(lt=P.clientY-N.value.y,W&&(lt=Math.min(Math.max(0,lt),W.scrollHeight-j.height))),p.toValue(I)&&W&&(it===null&&$(W,j,{x:pt,y:lt}),pt+=W.scrollLeft,lt+=W.scrollTop),W&&(F||I)){if(x!=="y"){const et=pt-W.scrollLeft;et<0?pt=W.scrollLeft:et>W.clientWidth-j.width&&(pt=W.clientWidth-j.width+W.scrollLeft)}if(x!=="x"){const et=lt-W.scrollTop;et<0?lt=W.scrollTop:et>W.clientHeight-j.height&&(lt=W.clientHeight-j.height+W.scrollTop)}}L.value={x:pt,y:lt},h?.(L.value,P),T(P)},G=P=>{p.toValue(t.disabled)||!B(P)||N.value&&(N.value=void 0,I&&ot(),g?.(L.value,P),T(P))};if(jm){const P=()=>{var W;return{capture:(W=t.capture)!==null&&W!==void 0?W:!0,passive:!p.toValue(l)}};lo(C,"pointerdown",rt,P),lo(v,"pointermove",tt,P),lo(v,["pointerup","pointercancel"],G,P)}return{...XA(L),position:L,isDragging:p.computed(()=>!!N.value),style:p.computed(()=>`
|
|
3
|
+
`):n}function VO(n,t){const{element:e,datasetIndex:i,index:r}=t,s=n.getDatasetMeta(i).controller,{label:a,value:l}=s.getLabelAndValue(r);return{chart:n,label:a,parsed:s.getParsed(r),raw:n.data.datasets[i].data[r],formattedValue:l,dataset:s.getDataset(),dataIndex:r,datasetIndex:i,element:e}}function Sm(n,t){const e=n.chart.ctx,{body:i,footer:r,title:s}=n,{boxWidth:a,boxHeight:l}=t,u=le(t.bodyFont),d=le(t.titleFont),h=le(t.footerFont),g=s.length,y=r.length,_=i.length,x=we(t.padding);let v=x.height,M=0,C=i.reduce((I,L)=>I+L.before.length+L.lines.length+L.after.length,0);if(C+=n.beforeBody.length+n.afterBody.length,g&&(v+=g*d.lineHeight+(g-1)*t.titleSpacing+t.titleMarginBottom),C){const I=t.displayColors?Math.max(l,u.lineHeight):u.lineHeight;v+=_*I+(C-_)*u.lineHeight+(C-1)*t.bodySpacing}y&&(v+=t.footerMarginTop+y*h.lineHeight+(y-1)*t.footerSpacing);let R=0;const F=function(I){M=Math.max(M,e.measureText(I).width+R)};return e.save(),e.font=d.string,Jt(n.title,F),e.font=u.string,Jt(n.beforeBody.concat(n.afterBody),F),R=t.displayColors?a+2+t.boxPadding:0,Jt(i,I=>{Jt(I.before,F),Jt(I.lines,F),Jt(I.after,F)}),R=0,e.font=h.string,Jt(n.footer,F),e.restore(),M+=x.width,{width:M,height:v}}function $O(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function YO(n,t,e,i){const{x:r,width:s}=i,a=e.caretSize+e.caretPadding;if(n==="left"&&r+s+a>t.width||n==="right"&&r-s-a<0)return!0}function qO(n,t,e,i){const{x:r,width:s}=e,{width:a,chartArea:{left:l,right:u}}=n;let d="center";return i==="center"?d=r<=(l+u)/2?"left":"right":r<=s/2?d="left":r>=a-s/2&&(d="right"),YO(d,n,t,e)&&(d="center"),d}function Tm(n,t,e){const i=e.yAlign||t.yAlign||$O(n,e);return{xAlign:e.xAlign||t.xAlign||qO(n,t,e,i),yAlign:i}}function jO(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function GO(n,t,e){let{y:i,height:r}=n;return t==="top"?i+=e:t==="bottom"?i-=r+e:i-=r/2,i}function Mm(n,t,e,i){const{caretSize:r,caretPadding:s,cornerRadius:a}=n,{xAlign:l,yAlign:u}=e,d=r+s,{topLeft:h,topRight:g,bottomLeft:y,bottomRight:_}=Ci(a);let x=jO(t,l);const v=GO(t,u,d);return u==="center"?l==="left"?x+=d:l==="right"&&(x-=d):l==="left"?x-=Math.max(h,y)+r:l==="right"&&(x+=Math.max(g,_)+r),{x:Ce(x,0,i.width-t.width),y:Ce(v,0,i.height-t.height)}}function Ha(n,t,e){const i=we(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function km(n){return jn([],oi(n))}function KO(n,t,e){return Oi(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Dm(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Cm={beforeTitle:ei,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:ei,beforeBody:ei,beforeLabel:ei,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return xt(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:ei,afterBody:ei,beforeFooter:ei,footer:ei,afterFooter:ei};function sn(n,t,e,i){const r=n[t].call(e,i);return typeof r>"u"?Cm[t].call(e,i):r}class Om extends Ve{static positioners=ro;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),r=i.enabled&&e.options.animation&&i.animations,s=new su(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=KO(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,r=sn(i,"beforeTitle",this,t),s=sn(i,"title",this,t),a=sn(i,"afterTitle",this,t);let l=[];return l=jn(l,oi(r)),l=jn(l,oi(s)),l=jn(l,oi(a)),l}getBeforeBody(t,e){return km(sn(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,r=[];return Jt(t,s=>{const a={before:[],lines:[],after:[]},l=Dm(i,s);jn(a.before,oi(sn(l,"beforeLabel",this,s))),jn(a.lines,sn(l,"label",this,s)),jn(a.after,oi(sn(l,"afterLabel",this,s))),r.push(a)}),r}getAfterBody(t,e){return km(sn(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,r=sn(i,"beforeFooter",this,t),s=sn(i,"footer",this,t),a=sn(i,"afterFooter",this,t);let l=[];return l=jn(l,oi(r)),l=jn(l,oi(s)),l=jn(l,oi(a)),l}_createItems(t){const e=this._active,i=this.chart.data,r=[],s=[],a=[];let l=[],u,d;for(u=0,d=e.length;u<d;++u)l.push(VO(this.chart,e[u]));return t.filter&&(l=l.filter((h,g,y)=>t.filter(h,g,y,i))),t.itemSort&&(l=l.sort((h,g)=>t.itemSort(h,g,i))),Jt(l,h=>{const g=Dm(t.callbacks,h);r.push(sn(g,"labelColor",this,h)),s.push(sn(g,"labelPointStyle",this,h)),a.push(sn(g,"labelTextColor",this,h))}),this.labelColors=r,this.labelPointStyles=s,this.labelTextColors=a,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),r=this._active;let s,a=[];if(!r.length)this.opacity!==0&&(s={opacity:0});else{const l=ro[i.position].call(this,r,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const u=this._size=Sm(this,i),d=Object.assign({},l,u),h=Tm(this.chart,i,d),g=Mm(i,d,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,s={opacity:1,x:g.x,y:g.y,width:u.width,height:u.height,caretX:l.x,caretY:l.y}}this._tooltipItems=a,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,r){const s=this.getCaretPosition(t,i,r);e.lineTo(s.x1,s.y1),e.lineTo(s.x2,s.y2),e.lineTo(s.x3,s.y3)}getCaretPosition(t,e,i){const{xAlign:r,yAlign:s}=this,{caretSize:a,cornerRadius:l}=i,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:g}=Ci(l),{x:y,y:_}=t,{width:x,height:v}=e;let M,C,R,F,I,L;return s==="center"?(I=_+v/2,r==="left"?(M=y,C=M-a,F=I+a,L=I-a):(M=y+x,C=M+a,F=I-a,L=I+a),R=M):(r==="left"?C=y+Math.max(u,h)+a:r==="right"?C=y+x-Math.max(d,g)-a:C=this.caretX,s==="top"?(F=_,I=F-a,M=C-a,R=C+a):(F=_+v,I=F+a,M=C+a,R=C-a),L=F),{x1:M,x2:C,x3:R,y1:F,y2:I,y3:L}}drawTitle(t,e,i){const r=this.title,s=r.length;let a,l,u;if(s){const d=$r(i.rtl,this.x,this.width);for(t.x=Ha(this,i.titleAlign,i),e.textAlign=d.textAlign(i.titleAlign),e.textBaseline="middle",a=le(i.titleFont),l=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,u=0;u<s;++u)e.fillText(r[u],d.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+l,u+1===s&&(t.y+=i.titleMarginBottom-l)}}_drawColorBox(t,e,i,r,s){const a=this.labelColors[i],l=this.labelPointStyles[i],{boxHeight:u,boxWidth:d}=s,h=le(s.bodyFont),g=Ha(this,"left",s),y=r.x(g),_=u<h.lineHeight?(h.lineHeight-u)/2:0,x=e.y+_;if(s.usePointStyle){const v={radius:Math.min(d,u)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},M=r.leftForLtr(y,d)+d/2,C=x+u/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,Qc(t,v,M,C),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Qc(t,v,M,C)}else{t.lineWidth=Pt(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const v=r.leftForLtr(y,d),M=r.leftForLtr(r.xPlus(y,1),d-2),C=Ci(a.borderRadius);Object.values(C).some(R=>R!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,Hr(t,{x:v,y:x,w:d,h:u,radius:C}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Hr(t,{x:M,y:x+1,w:d-2,h:u-2,radius:C}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(v,x,d,u),t.strokeRect(v,x,d,u),t.fillStyle=a.backgroundColor,t.fillRect(M,x+1,d-2,u-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:r}=this,{bodySpacing:s,bodyAlign:a,displayColors:l,boxHeight:u,boxWidth:d,boxPadding:h}=i,g=le(i.bodyFont);let y=g.lineHeight,_=0;const x=$r(i.rtl,this.x,this.width),v=function(T){e.fillText(T,x.x(t.x+_),t.y+y/2),t.y+=y+s},M=x.textAlign(a);let C,R,F,I,L,N,B;for(e.textAlign=a,e.textBaseline="middle",e.font=g.string,t.x=Ha(this,M,i),e.fillStyle=i.bodyColor,Jt(this.beforeBody,v),_=l&&M!=="right"?a==="center"?d/2+h:d+2+h:0,I=0,N=r.length;I<N;++I){for(C=r[I],R=this.labelTextColors[I],e.fillStyle=R,Jt(C.before,v),F=C.lines,l&&F.length&&(this._drawColorBox(e,t,I,x,i),y=Math.max(g.lineHeight,u)),L=0,B=F.length;L<B;++L)v(F[L]),y=g.lineHeight;Jt(C.after,v)}_=0,y=g.lineHeight,Jt(this.afterBody,v),t.y-=s}drawFooter(t,e,i){const r=this.footer,s=r.length;let a,l;if(s){const u=$r(i.rtl,this.x,this.width);for(t.x=Ha(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=u.textAlign(i.footerAlign),e.textBaseline="middle",a=le(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,l=0;l<s;++l)e.fillText(r[l],u.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,e,i,r){const{xAlign:s,yAlign:a}=this,{x:l,y:u}=t,{width:d,height:h}=i,{topLeft:g,topRight:y,bottomLeft:_,bottomRight:x}=Ci(r.cornerRadius);e.fillStyle=r.backgroundColor,e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.beginPath(),e.moveTo(l+g,u),a==="top"&&this.drawCaret(t,e,i,r),e.lineTo(l+d-y,u),e.quadraticCurveTo(l+d,u,l+d,u+y),a==="center"&&s==="right"&&this.drawCaret(t,e,i,r),e.lineTo(l+d,u+h-x),e.quadraticCurveTo(l+d,u+h,l+d-x,u+h),a==="bottom"&&this.drawCaret(t,e,i,r),e.lineTo(l+_,u+h),e.quadraticCurveTo(l,u+h,l,u+h-_),a==="center"&&s==="left"&&this.drawCaret(t,e,i,r),e.lineTo(l,u+g),e.quadraticCurveTo(l,u,l+g,u),e.closePath(),e.fill(),r.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,r=i&&i.x,s=i&&i.y;if(r||s){const a=ro[t.position].call(this,this._active,this._eventPosition);if(!a)return;const l=this._size=Sm(this,t),u=Object.assign({},a,this._size),d=Tm(e,t,u),h=Mm(t,u,d,e);(r._to!==h.x||s._to!==h.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=l.width,this.height=l.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const r={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=we(e.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&l&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,r,e),rg(t,e.textDirection),s.y+=a.top,this.drawTitle(s,t,e),this.drawBody(s,t,e),this.drawFooter(s,t,e),sg(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,r=t.map(({datasetIndex:l,index:u})=>{const d=this.chart.getDatasetMeta(l);if(!d)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:d.data[u],index:u}}),s=!ma(i,r),a=this._positionChanged(r,e);(s||a)&&(this._active=r,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,s=this._active||[],a=this._getActiveElements(t,s,e,i),l=this._positionChanged(a,t),u=e||!ma(a,s)||l;return u&&(this._active=a,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),u}_getActiveElements(t,e,i,r){const s=this.options;if(t.type==="mouseout")return[];if(!r)return e.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:i,caretY:r,options:s}=this,a=ro[s.position].call(this,t,e);return a!==!1&&(i!==a.x||r!==a.y)}}var $e={id:"tooltip",_element:Om,positioners:ro,afterInit(n,t,e){e&&(n.tooltip=new Om({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Cm},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},XO=Object.freeze({__proto__:null,Colors:cO,Decimation:hO,Filler:PO,Legend:zO,SubTitle:WO,Title:HO,Tooltip:$e});const ZO=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function QO(n,t,e,i){const r=n.indexOf(t);if(r===-1)return ZO(n,t,e,i);const s=n.lastIndexOf(t);return r!==s?e:r}const JO=(n,t)=>n===null?null:Ce(Math.round(n),0,t);function Am(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class tA extends dr{static id="category";static defaults={ticks:{callback:Am}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:r,label:s}of e)i[r]===s&&i.splice(r,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(xt(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:QO(i,t,Mt(e,t),this._addedLabels),JO(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(r=this.getLabels().length-1)),this.min=i,this.max=r}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,r=[];let s=this.getLabels();s=t===0&&e===s.length-1?s:s.slice(t,e+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=t;a<=e;a++)r.push({value:a});return r}getLabelForValue(t){return Am.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function eA(n,t){const e=[],{bounds:r,step:s,min:a,max:l,precision:u,count:d,maxTicks:h,maxDigits:g,includeBounds:y}=n,_=s||1,x=h-1,{min:v,max:M}=t,C=!xt(a),R=!xt(l),F=!xt(d),I=(M-v)/(g+1);let L=Rp((M-v)/x/_)*_,N,B,T,S;if(L<1e-14&&!C&&!R)return[{value:v},{value:M}];S=Math.ceil(M/L)-Math.floor(v/L),S>x&&(L=Rp(S*L/x/_)*_),xt(u)||(N=Math.pow(10,u),L=Math.ceil(L*N)/N),r==="ticks"?(B=Math.floor(v/L)*L,T=Math.ceil(M/L)*L):(B=v,T=M),C&&R&&s&&VM((l-a)/s,L/1e3)?(S=Math.round(Math.min((l-a)/L,h)),L=(l-a)/S,B=a,T=l):F?(B=C?a:B,T=R?l:T,S=d-1,L=(T-B)/S):(S=(T-B)/L,Hs(S,Math.round(S),L/1e3)?S=Math.round(S):S=Math.ceil(S));const O=Math.max(Pp(L),Pp(B));N=Math.pow(10,xt(u)?O:u),B=Math.round(B*N)/N,T=Math.round(T*N)/N;let U=0;for(C&&(y&&B!==a?(e.push({value:a}),B<a&&U++,Hs(Math.round((B+U*L)*N)/N,a,Rm(a,I,n))&&U++):B<a&&U++);U<S;++U){const $=Math.round((B+U*L)*N)/N;if(R&&$>l)break;e.push({value:$})}return R&&y&&T!==l?e.length&&Hs(e[e.length-1].value,l,Rm(l,I,n))?e[e.length-1].value=l:e.push({value:l}):(!R||T===l)&&e.push({value:T}),e}function Rm(n,t,{horizontal:e,minRotation:i}){const r=xe(i),s=(e?Math.sin(r):Math.cos(r))||.001,a=.75*t*(""+n).length;return Math.min(t/s,a)}class Wa extends dr{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return xt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:r,max:s}=this;const a=u=>r=e?r:u,l=u=>s=i?s:u;if(t){const u=Yn(r),d=Yn(s);u<0&&d<0?l(0):u>0&&d>0&&a(0)}if(r===s){let u=s===0?1:Math.abs(s*.05);l(s+u),t||a(r-u)}this.min=r,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,r;return i?(r=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),e=e||11),e&&(r=Math.min(e,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const r={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},s=this._range||this,a=eA(r,s);return t.bounds==="ticks"&&Ep(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const r=(i-e)/Math.max(t.length-1,1)/2;e-=r,i+=r}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return $s(t,this.chart.options.locale,this.options.ticks.format)}}class nA extends Wa{static id="linear";static defaults={ticks:{callback:Ta.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ae(t)?t:0,this.max=ae(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=xe(this.options.ticks.minRotation),r=(t?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,s.lineHeight/r))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const so=n=>Math.floor(ki(n)),fr=(n,t)=>Math.pow(10,so(n)+t);function Em(n){return n/Math.pow(10,so(n))===1}function Pm(n,t,e){const i=Math.pow(10,e),r=Math.floor(n/i);return Math.ceil(t/i)-r}function iA(n,t){const e=t-n;let i=so(e);for(;Pm(n,t,i)>10;)i++;for(;Pm(n,t,i)<10;)i--;return Math.min(i,so(n))}function rA(n,{min:t,max:e}){t=pn(n.min,t);const i=[],r=so(t);let s=iA(t,e),a=s<0?Math.pow(10,Math.abs(s)):1;const l=Math.pow(10,s),u=r>s?Math.pow(10,r):0,d=Math.round((t-u)*a)/a,h=Math.floor((t-u)/l/10)*l*10;let g=Math.floor((d-h)/Math.pow(10,s)),y=pn(n.min,Math.round((u+h+g*Math.pow(10,s))*a)/a);for(;y<e;)i.push({value:y,major:Em(y),significand:g}),g>=10?g=g<15?15:20:g++,g>=20&&(s++,g=2,a=s>=0?1:a),y=Math.round((u+h+g*Math.pow(10,s))*a)/a;const _=pn(n.max,y);return i.push({value:_,major:Em(_),significand:g}),i}class sA extends dr{static id="logarithmic";static defaults={ticks:{callback:Ta.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Wa.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return ae(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ae(t)?Math.max(0,t):null,this.max=ae(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ae(this._userMin)&&(this.min=t===fr(this.min,0)?fr(this.min,-1):fr(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,r=this.max;const s=l=>i=t?i:l,a=l=>r=e?r:l;i===r&&(i<=0?(s(1),a(10)):(s(fr(i,-1)),a(fr(r,1)))),i<=0&&s(fr(r,-1)),r<=0&&a(fr(i,1)),this.min=i,this.max=r}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=rA(e,this);return t.bounds==="ticks"&&Ep(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":$s(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=ki(t),this._valueRange=ki(this.max)-ki(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(ki(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function Mu(n){const t=n.ticks;if(t.display&&n.display){const e=we(t.backdropPadding);return Mt(t.font&&t.font.size,se.font.size)+e.height}return 0}function oA(n,t,e){return e=Yt(e)?e:[e],{w:ok(n,t.string,e),h:e.length*t.lineHeight}}function Im(n,t,e,i,r){return n===i||n===r?{start:t-e/2,end:t+e/2}:n<i||n>r?{start:t-e,end:t}:{start:t,end:t+e}}function aA(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],r=[],s=n._pointLabels.length,a=n.options.pointLabels,l=a.centerPointLabels?Rt/s:0;for(let u=0;u<s;u++){const d=a.setContext(n.getPointLabelContext(u));r[u]=d.padding;const h=n.getPointPosition(u,n.drawingArea+r[u],l),g=le(d.font),y=oA(n.ctx,g,n._pointLabels[u]);i[u]=y;const _=Ue(n.getIndexAngle(u)+l),x=Math.round(xa(_)),v=Im(x,h.x,y.w,0,180),M=Im(x,h.y,y.h,90,270);lA(e,t,_,v,M)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=dA(n,i,r)}function lA(n,t,e,i,r){const s=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let l=0,u=0;i.start<t.l?(l=(t.l-i.start)/s,n.l=Math.min(n.l,t.l-l)):i.end>t.r&&(l=(i.end-t.r)/s,n.r=Math.max(n.r,t.r+l)),r.start<t.t?(u=(t.t-r.start)/a,n.t=Math.min(n.t,t.t-u)):r.end>t.b&&(u=(r.end-t.b)/a,n.b=Math.max(n.b,t.b+u))}function cA(n,t,e){const i=n.drawingArea,{extra:r,additionalAngle:s,padding:a,size:l}=e,u=n.getPointPosition(t,i+r+a,s),d=Math.round(xa(Ue(u.angle+re))),h=pA(u.y,l.h,d),g=fA(d),y=hA(u.x,l.w,g);return{visible:!0,x:u.x,y:h,textAlign:g,left:y,top:h,right:y+l.w,bottom:h+l.h}}function uA(n,t){if(!t)return!0;const{left:e,top:i,right:r,bottom:s}=n;return!(ri({x:e,y:i},t)||ri({x:e,y:s},t)||ri({x:r,y:i},t)||ri({x:r,y:s},t))}function dA(n,t,e){const i=[],r=n._pointLabels.length,s=n.options,{centerPointLabels:a,display:l}=s.pointLabels,u={extra:Mu(s)/2,additionalAngle:a?Rt/r:0};let d;for(let h=0;h<r;h++){u.padding=e[h],u.size=t[h];const g=cA(n,h,u);i.push(g),l==="auto"&&(g.visible=uA(g,d),g.visible&&(d=g))}return i}function fA(n){return n===0||n===180?"center":n<180?"left":"right"}function hA(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function pA(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function gA(n,t,e){const{left:i,top:r,right:s,bottom:a}=e,{backdropColor:l}=t;if(!xt(l)){const u=Ci(t.borderRadius),d=we(t.backdropPadding);n.fillStyle=l;const h=i-d.left,g=r-d.top,y=s-i+d.width,_=a-r+d.height;Object.values(u).some(x=>x!==0)?(n.beginPath(),Hr(n,{x:h,y:g,w:y,h:_,radius:u}),n.fill()):n.fillRect(h,g,y,_)}}function mA(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let r=t-1;r>=0;r--){const s=n._pointLabelItems[r];if(!s.visible)continue;const a=i.setContext(n.getPointLabelContext(r));gA(e,a,s);const l=le(a.font),{x:u,y:d,textAlign:h}=s;ar(e,n._pointLabels[r],u,d+l.lineHeight/2,l,{color:a.color,textAlign:h,textBaseline:"middle"})}}function Lm(n,t,e,i){const{ctx:r}=n;if(e)r.arc(n.xCenter,n.yCenter,t,0,te);else{let s=n.getPointPosition(0,t);r.moveTo(s.x,s.y);for(let a=1;a<i;a++)s=n.getPointPosition(a,t),r.lineTo(s.x,s.y)}}function yA(n,t,e,i,r){const s=n.ctx,a=t.circular,{color:l,lineWidth:u}=t;!a&&!i||!l||!u||e<0||(s.save(),s.strokeStyle=l,s.lineWidth=u,s.setLineDash(r.dash||[]),s.lineDashOffset=r.dashOffset,s.beginPath(),Lm(n,e,a,i),s.closePath(),s.stroke(),s.restore())}function _A(n,t,e){return Oi(n,{label:e,index:t,type:"pointLabel"})}class bA extends Wa{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ta.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=we(Mu(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=ae(t)&&!isNaN(t)?t:0,this.max=ae(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Mu(this.options))}generateTickLabels(t){Wa.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const r=Qt(this.options.pointLabels.callback,[e,i],this);return r||r===0?r:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?aA(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,r){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,r))}getIndexAngle(t){const e=te/(this._pointLabels.length||1),i=this.options.startAngle||0;return Ue(t*e+xe(i))}getDistanceFromCenterForValue(t){if(xt(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(xt(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return _A(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const r=this.getIndexAngle(t)-re+i;return{x:Math.cos(r)*e+this.xCenter,y:Math.sin(r)*e+this.yCenter,angle:r}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:r,bottom:s}=this._pointLabelItems[t];return{left:e,top:i,right:r,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Lm(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:r,border:s}=e,a=this._pointLabels.length;let l,u,d;if(e.pointLabels.display&&mA(this,a),r.display&&this.ticks.forEach((h,g)=>{if(g!==0||g===0&&this.min<0){u=this.getDistanceFromCenterForValue(h.value);const y=this.getContext(g),_=r.setContext(y),x=s.setContext(y);yA(this,_,u,a,x)}}),i.display){for(t.save(),l=a-1;l>=0;l--){const h=i.setContext(this.getPointLabelContext(l)),{color:g,lineWidth:y}=h;!y||!g||(t.lineWidth=y,t.strokeStyle=g,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,u=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),d=this.getPointPosition(l,u),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(d.x,d.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const r=this.getIndexAngle(0);let s,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(r),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((l,u)=>{if(u===0&&this.min>=0&&!e.reverse)return;const d=i.setContext(this.getContext(u)),h=le(d.font);if(s=this.getDistanceFromCenterForValue(this.ticks[u].value),d.showLabelBackdrop){t.font=h.string,a=t.measureText(l.label).width,t.fillStyle=d.backdropColor;const g=we(d.backdropPadding);t.fillRect(-a/2-g.left,-s-h.size/2-g.top,a+g.width,h.size+g.height)}ar(t,l.label,0,-s,h,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),t.restore()}drawTitle(){}}const Va={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},on=Object.keys(Va);function Nm(n,t){return n-t}function Bm(n,t){if(xt(t))return null;const e=n._adapter,{parser:i,round:r,isoWeekday:s}=n._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),ae(a)||(a=typeof i=="string"?e.parse(a,i):e.parse(a)),a===null?null:(r&&(a=r==="week"&&(Di(s)||s===!0)?e.startOf(a,"isoWeek",s):e.startOf(a,r)),+a)}function Fm(n,t,e,i){const r=on.length;for(let s=on.indexOf(n);s<r-1;++s){const a=Va[on[s]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(l*a.size))<=i)return on[s]}return on[r-1]}function xA(n,t,e,i,r){for(let s=on.length-1;s>=on.indexOf(e);s--){const a=on[s];if(Va[a].common&&n._adapter.diff(r,i,a)>=t-1)return a}return on[e?on.indexOf(e):0]}function wA(n){for(let t=on.indexOf(n)+1,e=on.length;t<e;++t)if(Va[on[t]].common)return on[t]}function zm(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:r}=qc(e,t),s=e[i]>=t?e[i]:e[r];n[s]=!0}}function vA(n,t,e,i){const r=n._adapter,s=+r.startOf(t[0].value,i),a=t[t.length-1].value;let l,u;for(l=s;l<=a;l=+r.add(l,1,i))u=e[l],u>=0&&(t[u].major=!0);return t}function Um(n,t,e){const i=[],r={},s=t.length;let a,l;for(a=0;a<s;++a)l=t[a],r[l]=a,i.push({value:l,major:!1});return s===0||!e?i:vA(n,i,r,e)}class ku extends dr{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),r=this._adapter=new Cg._date(t.adapters.date);r.init(e),Us(i.displayFormats,r.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:Bm(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:r,max:s,minDefined:a,maxDefined:l}=this.getUserBounds();function u(d){!a&&!isNaN(d.min)&&(r=Math.min(r,d.min)),!l&&!isNaN(d.max)&&(s=Math.max(s,d.max))}(!a||!l)&&(u(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&u(this.getMinMax(!1))),r=ae(r)&&!isNaN(r)?r:+e.startOf(Date.now(),i),s=ae(s)&&!isNaN(s)?s:+e.endOf(Date.now(),i)+1,this.min=Math.min(r,s-1),this.max=Math.max(r+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,r=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const s=this.min,a=this.max,l=jM(r,s,a);return this._unit=e.unit||(i.autoSkip?Fm(e.minUnit,this.min,this.max,this._getLabelCapacity(s)):xA(this,l.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:wA(this._unit),this.initOffsets(r),t.reverse&&l.reverse(),Um(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,r,s;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?e=1-r:e=(this.getDecimalForValue(t[1])-r)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?i=s:i=(s-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=Ce(e,0,a),i=Ce(i,0,a),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,r=this.options,s=r.time,a=s.unit||Fm(s.minUnit,e,i,this._getLabelCapacity(e)),l=Mt(r.ticks.stepSize,1),u=a==="week"?s.isoWeekday:!1,d=Di(u)||u===!0,h={};let g=e,y,_;if(d&&(g=+t.startOf(g,"isoWeek",u)),g=+t.startOf(g,d?"day":a),t.diff(i,e,a)>1e5*l)throw new Error(e+" and "+i+" are too far apart with stepSize of "+l+" "+a);const x=r.ticks.source==="data"&&this.getDataTimestamps();for(y=g,_=0;y<i;y=+t.add(y,l,a),_++)zm(h,y,x);return(y===i||r.bounds==="ticks"||_===1)&&zm(h,y,x),Object.keys(h).sort(Nm).map(v=>+v)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const r=this.options.time.displayFormats,s=this._unit,a=e||r[s];return this._adapter.format(t,a)}_tickFormatFunction(t,e,i,r){const s=this.options,a=s.ticks.callback;if(a)return Qt(a,[t,e,i],this);const l=s.time.displayFormats,u=this._unit,d=this._majorUnit,h=u&&l[u],g=d&&l[d],y=i[e],_=d&&g&&y&&y.major;return this._adapter.format(t,r||(_?g:h))}generateTickLabels(t){let e,i,r;for(e=0,i=t.length;e<i;++e)r=t[e],r.label=this._tickFormatFunction(r.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,r=xe(this.isHorizontal()?e.maxRotation:e.minRotation),s=Math.cos(r),a=Math.sin(r),l=this._resolveTickFontOptions(0).size;return{w:i*s+l*a,h:i*a+l*s}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,r=i[e.unit]||i.millisecond,s=this._tickFormatFunction(t,0,Um(this,[t],this._majorUnit),r),a=this._getLabelSize(s),l=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return l>0?l:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(e=0,i=r.length;e<i;++e)t=t.concat(r[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const r=this.getLabels();for(e=0,i=r.length;e<i;++e)t.push(Bm(this,r[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Np(t.sort(Nm))}}function $a(n,t,e){let i=0,r=n.length-1,s,a,l,u;e?(t>=n[i].pos&&t<=n[r].pos&&({lo:i,hi:r}=ii(n,"pos",t)),{pos:s,time:l}=n[i],{pos:a,time:u}=n[r]):(t>=n[i].time&&t<=n[r].time&&({lo:i,hi:r}=ii(n,"time",t)),{time:s,pos:l}=n[i],{time:a,pos:u}=n[r]);const d=a-s;return d?l+(u-l)*(t-s)/d:l}class SA extends ku{static id="timeseries";static defaults=ku.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=$a(e,this.min),this._tableRange=$a(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,r=[],s=[];let a,l,u,d,h;for(a=0,l=t.length;a<l;++a)d=t[a],d>=e&&d<=i&&r.push(d);if(r.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(a=0,l=r.length;a<l;++a)h=r[a+1],u=r[a-1],d=r[a],Math.round((h+u)/2)!==d&&s.push({time:d,pos:a/(l-1)});return s}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((r,s)=>r-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return($a(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return $a(this._table,i*this._tableRange+this._minPos,!0)}}var TA=Object.freeze({__proto__:null,CategoryScale:tA,LinearScale:nA,LogarithmicScale:sA,RadialLinearScale:bA,TimeScale:ku,TimeSeriesScale:SA});const MA=[MD,nO,XO,TA];function kA(n){const e=`barChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:u=>({label:u.dataset.label,value:u.label})}};$e.positioners[e]=function(u,d){if(!u.length||n.tooltipState.interactionMode==="interactive"||d.x===null||d.y===null)return!1;const h=this.chart.canvas.getBoundingClientRect(),g=n.tooltipState.width||this.width,y=h.width/2,_=Ka(d,g,y),x=d.y,v=d.x<y?"left":"center";return{x:_-n.tooltipState.offsetX,y:x-n.tooltipState.offsetY,xAlign:v}},hu.modes.customInteractionMode=function(u,d){const h=Ai(d,u),g=[];return hu.evaluateInteractionItems(u,u.options.indexAxis||"x",h,(y,_,x)=>{u.options.indexAxis==="y"&&y.inYRange(h.y,!0)&&u.data.datasets[_].data[x]&&g.push({element:y,datasetIndex:_,index:x}),u.options.indexAxis==="x"&&h.x!==null&&y.inXRange(h.x,!0)&&u.data.datasets[_].data[x]&&g.push({element:y,datasetIndex:_,index:x})}),g};const r=n.numLabels.value>25?ty:ey,s=({chart:u,index:d})=>{const h=u.data;return{size:r,style:h?.isLabelEmpty?.[d]?"italic":"normal"}},a=(u,d,h)=>u.chart.options.indexAxis===u.axis?(d=u.getLabelForValue(h),d&&d.length>Xa?d.slice(0,Xa)+"...":d):u.getLabelForValue(Number(d)),l=p.computed(()=>({indexAxis:n.indexAxis,skipNull:!0,scales:{x:{stacked:n.stacked.value,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{maxRotation:90,autoSkip:!1,font:s,callback:function(u,d){return a(this,u,d)}},title:{display:n.indexAxis==="y"?!xt(n.metricAxesTitle?.value):!xt(n.dimensionAxesTitle?.value),text:n.indexAxis==="y"?n.metricAxesTitle?.value:n.dimensionAxesTitle?.value,padding:{top:3,bottom:0,left:0,right:0},font:{weight:"bold"}}},y:{stacked:n.stacked.value,beginAtZero:!0,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{padding:0,font:s,callback:function(u,d){return a(this,u,d)}},title:{display:n.indexAxis==="x"?!xt(n.metricAxesTitle?.value):!xt(n.dimensionAxesTitle?.value),text:n.indexAxis==="x"?n.metricAxesTitle?.value:n.dimensionAxesTitle?.value,padding:{bottom:3,top:0,left:0,right:0},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:u=>{Zm(n.tooltipState,u)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1,layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return p.getCurrentInstance()&&p.onUnmounted(()=>{$e.positioners[e]&&delete $e.positioners[e]}),l}rn.register(...MA);const DA=(n,t)=>{const e=t.datasets.map(r=>r.label),i=n.datasets.map(r=>r.label);return n.datasets.length===t.datasets.length&&e.every((r,s)=>r===i[s])};function CA(n,t,e,i,r){const s=p.shallowRef(null),a=(l,u)=>{if(t.value)return new rn(t.value,{type:n,data:l,plugins:i,options:u})};return p.onMounted(()=>{s.value=a(e.value,r.value)}),p.onBeforeUnmount(()=>{xt(s.value)||s.value.destroy()}),p.watch(e,(l,u)=>{if(DA(u,l)&&!xt(s.value)){for(const[d,h]of l.datasets.entries())Object.assign(s.value.data.datasets[d],h);s.value.data.labels=l.labels,s.value.update()}else xt(s.value)||s.value.destroy(),s.value=a(l,r.value)}),p.watch(t,()=>{xt(s.value)||s.value.destroy(),s.value=a(e.value,r.value)}),p.watch(r,(l,u)=>{(l.indexAxis!==u.indexAxis||JSON.stringify(l.scales.x.title)!==JSON.stringify(u.scales.x.title)||JSON.stringify(l.scales.y.title)!==JSON.stringify(u.scales.y.title))&&(xt(s.value)||s.value.destroy(),s.value=a(e.value,l))}),s}const Hm=1e3,OA=1e4,Wm=1e6,Vm=1e9,$m=1e12,oo=(n,t)=>{if(t.separator===!1||n<1e3)return n.toString();const e=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(n).toString().split("").reverse().forEach((s,a)=>{a&&a%3===0&&i.push(e),i.push(s)}),i.reverse().join("")},qr=(n,t,e)=>{const i=n/t,r=e.round?"round":"floor";if(e.decimal===!1)return Math[r](i).toString();let s;e.precision?s=i:s=i<10?Math[r](i*10)/10:Math[r](i);let a=s.toString();return typeof e.decimal=="string"&&(a=a.replace(".",e.decimal)),a};function ao(n,t={}){let e;const i=n<0;i&&(n=Math.abs(n)),t.precision&&(n=parseFloat(n.toPrecision(t.precision)));const r=t.min10k?OA:Hm;return n<r||t.precision&&t.precision>Math.log10(n)?e=oo(qr(n,1,t),t):n<Wm?e=`${qr(n,Hm,t)}k`:n<Vm?e=`${qr(n,Wm,t)}m`:n<$m?e=`${oo(qr(n,Vm,t),t)}b`:e=`${oo(qr(n,$m,t),t)}t`,i&&(e=`-${e}`),t.capital&&(e=e.toUpperCase()),t.prefix&&(e=`${t.prefix}${e}`),t.suffix&&(e=`${e}${t.suffix}`),e}ao.addCommas=oo;function AA(n,t,e){const{i18n:i}=kt.useI18n(),{formatBytes:r}=er({i18n:i}),{translateUnit:s}=kt.useTranslatedUnits();return{legendValues:p.computed(()=>n.value.datasets.reduce((l,u)=>{const d=u.total?u.total:u.data.reduce((g,y)=>g+(typeof y=="number"?Number(y)||0:Number(y&&y.y)||0),0);let h;if(e.value==="bytes")h=r(d);else{const g=s(e.value,d);h=i&&i.t("legend.datapointValueDisplay",{value:ao(d,{capital:!0}),unit:g})||`${ao(d,{capital:!0})} ${e.value}`}return{...l,[u.label]:{raw:d,formatted:h,isThreshold:u.isThreshold}}},{}))}}function RA(n){return p.computed(()=>{if(!n.value?.meta)return"";const e=n.value.meta.start,i=n.value.meta.end;return e&&i?`${Ih(new Date(e))} - ${Ih(new Date(i),{includeTZ:!0})}`:""})}function EA(n){const e=`donutChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:s=>({label:s.dataset.label,value:s.label})}};$e.positioners[e]=function(s,a){if(!s.length||a.x===null||a.y===null)return!1;const l=this.chart.canvas.getBoundingClientRect(),u=n.tooltipState.width||this.width,d=l.width/2,h=Ka(a,u,d),g=a.y,y=a.x<d?"left":"center";return{x:h-n.tooltipState.offsetX,y:g,xAlign:y}};const r=p.computed(()=>({cutout:"65%",responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:s=>{Zm(n.tooltipState,s)}}},layout:{padding:{left:0,right:0,top:5,bottom:0}}}));return p.onUnmounted(()=>{$e.positioners[e]&&delete $e.positioners[e]}),{options:r}}function PA(n){const t=p.computed(()=>({type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:u=>{const d=new Date(u);return by({tickValue:d,granularity:n.granularity.value,dayBoundaryCrossed:a.value})}},title:{display:!xt(n.dimensionAxesTitle?.value),text:n.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}},border:{display:!1},stacked:n.stacked.value})),e=p.computed(()=>({title:{display:!xt(n.metricAxesTitle?.value),text:n.metricAxesTitle?.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:n.stacked.value})),r=`lineChartTooltipPosition-${n.tooltipState.chartID}`,s={enabled:!1,position:r};$e.positioners[r]=function(u,d){if(!u.length||n.tooltipState.interactionMode==="interactive"||d.x===null||d.y===null)return!1;const h=this.chart.canvas.getBoundingClientRect(),g=n.tooltipState.width||this.width,y=n.tooltipState.height||this.height,_=h.width/2,x=h.height/2,v=Ka(d,g,_);let M=Qm(d,y,x);const C=d.y<x?"top":"bottom",R=d.x<_?"left":"center";return y>h.height&&(M=0),{x:v,y:M,xAlign:R,yAlign:C}};const a=p.computed(()=>{const u=Number(n.timeRangeMs.value),d=new Date,h=new Date(d.getTime()-u);return yp(u)>24||h.getDate()!==d.getDate()}),l=p.computed(()=>({hover:{mode:"index",intersect:!1},elements:{point:{radius:n.pointsWithoutHover?.value?3:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:e.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...s,external:u=>{Du(n.tooltipState,u,n.granularity.value)}},thresholdPlugin:{threshold:n.threshold?.value}},interaction:{mode:"index",intersect:!1},layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return p.onUnmounted(()=>{$e.positioners[r]&&delete $e.positioners[r]}),{options:l}}function IA(n){const t=p.computed(()=>{const l=Number(n.timeRangeMs.value),u=new Date,d=new Date(u.getTime()-l);return yp(l)>24||d.getDate()!==u.getDate()}),e=p.computed(()=>({type:"time",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:l=>by({tickValue:new Date(l),granularity:n.granularity.value,dayBoundaryCrossed:t.value})},title:{display:!xt(n.dimensionAxesTitle?.value),text:n.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}},border:{display:!1}})),i=p.computed(()=>({title:{display:!xt(n.metricAxesTitle?.value),text:n.metricAxesTitle?.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1}})),s=`scatterChartTooltipPosition-${n.tooltipState.chartID}`;$e.positioners[s]=function(l,u){if(!l.length||n.tooltipState.interactionMode==="interactive"||u.x===null||u.y===null)return!1;const d=this.chart.canvas.getBoundingClientRect(),h=n.tooltipState.width||this.width,g=n.tooltipState.height||this.height,y=d.width/2,_=d.height/2,x=Ka(u,h,y);let v=Qm(u,g,_);const M=u.y<_?"top":"bottom",C=u.x<y?"left":"center";return g>d.height&&(v=0),{x,y:v,xAlign:C,yAlign:M}};const a=p.computed(()=>({hover:{mode:"nearest",intersect:!1},interaction:{mode:"nearest",intersect:!1},animation:{duration:250,easing:"linear"},scales:{x:e.value,y:i.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{enabled:!1,position:s,external:l=>{Du(n.tooltipState,l,n.granularity.value)}},outlierBandPlugin:{value:n.outlierValue?.value,color:n.themeColors.value.outlierBand}},layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return p.onUnmounted(()=>{$e.positioners[s]&&delete $e.positioners[s]}),{options:a}}function LA(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:r,pivotRecords:s,rowLabels:a,colorPalette:l}=n,{i18n:u}=kt.useI18n();return t?i.map(h=>({label:u&&u.te(`chartLabels.${h}`)&&u.t(`chartLabels.${h}`)||h,backgroundColor:Ou(i.indexOf(h),ai),data:a.map((g,y)=>e?s[`${g.id},${h}`]||0:s[`${y},${h}`]||null)})):Array.from(r).flatMap((h,g)=>{if(!h)return[];const y=Au(g,h.name,h.id==="empty",l);return{label:u&&u.te(`chartLabels.${h.name}`)&&u.t(`chartLabels.${h.name}`)||h.name,backgroundColor:y,data:a.map(_=>s[`${_.id},${h.id}`]||null),isSegmentEmpty:h.id==="empty"}})}function NA(n,t){const{i18n:e}=kt.useI18n();return p.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const r=t.value.data,{display:s,metric_names:a}=t.value.meta,l=s&&Object.keys(s),u=a&&a.length>1,d=s&&l&&l.length>0,h=d&&l.length>1;if(!r.length||!a)return{datasets:[],labels:[]};const g=d&&l||a,y=g[0],_=g.length>1?g[1]:g[0],x=Object.fromEntries(u?r.flatMap(S=>a.map((O,U)=>{const $=S.event[y],it=d?`${$},${O}`:`${U},${O}`,at=S.event[O];return[it,at]})):r.map(S=>{const O=d?`${S.event[y]},${S.event[_]}`:`${y},${_}`,U=S.event[a[0]];return[O,U]})),v=Object.keys(x).reduce((S,O)=>{const[U]=O.split(","),$=x[O];return S[U]?S[U]+=$:S[U]=$,S},{}),M=Object.entries(v).sort(([,S],[,O])=>Number(O)-Number(S)).map(([S])=>S),C=s[y],R=s[_];let F=d&&C&&Object.entries(C).map(([S,O])=>({id:S,name:O.name}))||a.map(S=>({id:S,name:S})),I=d&&R&&Object.entries(R).map(([S,O])=>({id:S,name:O.name}))||a.map(S=>({id:S,name:S}));if(d&&y==="country_code"&&(F=F.map(S=>({...S,name:Mc(S.id)||S.name}))),d&&_==="country_code"&&(I=I.map(S=>({...S,name:Mc(S.id)||S.name}))),y!=="status_code"&&y!=="status_code_grouped"&&(F.sort((S,O)=>M.indexOf(S.id)-M.indexOf(O.id)),I.sort((S,O)=>M.indexOf(S.id)-M.indexOf(O.id))),!F||!I)return{labels:[],datasets:[]};const L=LA({isMultiMetric:u,hasDimensions:d,metricNames:a,dimensionFieldNames:g,barSegmentLabels:I,pivotRecords:x,rowLabels:F,colorPalette:n.colorPalette||ai}),N=d?F.map(S=>e&&e.te(`chartLabels.${S.name}`)&&e.t(`chartLabels.${S.name}`)||S.name):a.map(S=>e&&e.te(`chartLabels.${S}`)&&e.t(`chartLabels.${S}`)||S),B=F.map(S=>S.id==="empty");return{labels:N,datasets:L,isLabelEmpty:B,isMultiDimension:h}}}catch(r){return console.error(r),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const BA=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,r)=>i+r*e),FA=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return _p(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},zA=(n,t,e,i,r)=>{const a=Math.max(t-6e4,Math.max(...(r||[]).map(d=>new Date(d.timestamp).valueOf()))),l=Math.floor((n-i)/e)*e+i,u=Math.floor((a-i)/e)*e+i+e;return BA(l,u,e)};function UA(n,t){const{i18n:e}=kt.useI18n();return p.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const r=t.value.data,{display:s,metric_names:a,start:l,end:u}=t.value.meta,d=new Date(l).getTime(),h=new Date(u).getTime();if(!a)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const g=s&&Object.keys(s)||a,y=g&&g[0],_=s[y];let x=s&&_&&Object.keys(_).map(N=>({id:N,name:_[N].name}))||a.map(N=>({id:N,name:N}));y==="country_code"&&(x=x.map(N=>({...N,name:Mc(N.id)||N.name})));const v=t.value.meta.granularity_ms;if(typeof v!="number"||isNaN(v)||!isFinite(v)||v===0)return console.error("Invalid step value:",v),{datasets:[],labels:[]};if(!r.length)return{datasets:[],labels:[]};const M=FA(d),C=zA(d,h,v,M,r),R=new Set,F=r?.length?r.reduce((N,B)=>{const T=new Date(B.timestamp).valueOf(),S=B.event;for(const O of a)R.add(O),T in N||(N[T]={}),O in N[T]||(N[T][O]={});for(const O of a)x.forEach(U=>{S[y]===U.id||O===U.id?(N[T][O]||(N[T][O]={}),N[T][O][U.id]=Math.round(Number(S[O])*1e3)/1e3):g.length||(N[T][O]||(N[T][O]={}),N[T][O][U.id]=Math.round(Number(S[U.id])*1e3)/1e3)});return N},{}):{},L=[...a.length===1?a.flatMap(N=>x.map(B=>[N,B.id,B.name,B.id==="empty"])):x.map(N=>[N.name,N.id,N.name,N.id==="empty"])].map(([N,B,T,S],O)=>{const U=C.map(ot=>ot in F&&N in F[ot]?{x:ot,y:F[ot][N][B]||0}:{x:ot,y:0});let{colorPalette:$,fill:it}=n;xt($)&&($=ai);const at=Au(O,T,S,$);return{rawDimension:T,rawMetric:N,label:e&&e.te(`chartLabels.${T}`)&&e.t(`chartLabels.${T}`)||T,borderColor:at,backgroundColor:at,data:U,total:U.reduce((ot,{y:q})=>ot+Number(q),0),...kR,fill:it,borderWidth:it?CR:DR,isSegmentEmpty:S}});return y==="status_code"||y==="status_code_grouped"?L.sort((N,B)=>(N.label??"")<(B.label??"")?-1:1):L.sort((N,B)=>Number(N.total)<Number(B.total)?-1:1),{datasets:L}}}catch(r){return console.error(r),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const HA=2,WA=.6,VA=1.5,Ym=50,$A=[6,4],YA=[2,3],qA=n=>n?Math.random()*n:0;function jA(n,t){const{i18n:e}=kt.useI18n(),i=(r,s)=>s||(r===Ym?e.t("scatter.median"):e.t("scatter.percentile",{value:r}));return p.computed(()=>{try{const r=t.value;if(!r?.points?.length)return{datasets:[]};const{metric:s,dimension:a,display:l,start:u,end:d}=r,h=n.scatter||{},g=h.jitterMs??0,y=h.pointRadius??HA,_=h.pointOpacity??WA,x=new Map,v=[];r.points.forEach(q=>{const J=q.group??s,rt=x.get(J)||[];rt.push({x:q.timestamp+qA(g),y:q.value}),x.set(J,rt),v.push(q.value)});const M=h.percentileLines||[],C=[...M.map(q=>q.percentile),...h.outlierPercentile!==void 0?[h.outlierPercentile]:[]],R=C.length?yE(v,C):new Map,F=h.outlierPercentile!==void 0?R.get(h.outlierPercentile):void 0,I=F!==void 0&&Number.isFinite(F),L=I?i(h.outlierPercentile):"",N=xt(n.colorPalette)?ai:n.colorPalette,B=n.themeColors?.value??Qa(),T=[],S=[],O=(q,J)=>{if(!I)return q;const rt=[];for(const tt of q){if(tt.y<=F){rt.push(tt);continue}S.push({...tt,tooltipLabel:e.t("scatter.outlierTooltip",{series:J,label:L})})}return rt};if(Array.from(x.entries()).forEach(([q,J],rt)=>{const tt=a&&l?.[q]?.name||q,G=q==="empty",P=Au(rt,tt,G,N),W=e.te(`chartLabels.${tt}`)&&e.t(`chartLabels.${tt}`)||tt,j=O(J,W);T.push({type:"scatter",rawDimension:tt,rawMetric:s,label:W,borderColor:P,backgroundColor:Yu(P,_),data:j,pointRadius:y,pointHoverRadius:y+2,pointBorderWidth:0,showLine:!1,isSegmentEmpty:G})}),I&&S.length){const q=B.outlier;T.push({type:"scatter",rawDimension:"outlier",rawMetric:s,label:e.t("scatter.outlier",{label:L}),borderColor:q,backgroundColor:q,data:S,pointRadius:y,pointHoverRadius:y+2,pointBorderWidth:0,showLine:!1})}const U=Array.from(x.values()).flat().map(q=>q.x),$=new Date(u).valueOf(),it=new Date(d).valueOf(),at=Number.isFinite($)?$:Math.min(...U),ot=Number.isFinite(it)?it:Math.max(...U);return M.forEach(q=>{const J=R.get(q.percentile);if(J===void 0||!Number.isFinite(J))return;const rt=q.percentile===Ym,tt=q.color||(rt?B.medianLine:B.outlier);T.push({type:"line",rawDimension:`percentile-${q.percentile}`,rawMetric:s,label:i(q.percentile,q.label),data:[{x:at,y:J},{x:ot,y:J}],borderColor:tt,backgroundColor:tt,borderDash:q.borderDash||(rt?$A:YA),borderWidth:VA,pointRadius:0,pointHitRadius:0,fill:!1,total:J})}),{datasets:T,...I?{outlierValue:F}:{}}}catch(r){return console.warn(r),{datasets:[]}}})}const GA=(n,t)=>{p.watch([n,t],(e,i,r)=>{const[s,a]=e;!a||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(a,s),r(()=>{window._AnalyticsChartDataInternal?.delete(a)}))},{immediate:!0})};function KA(){const{i18n:n}=kt.useI18n();return{translateUnit:(e,i)=>{const r=i===1,s=`chartUnits.${e}`;return ho(e)?"":n.te(s)?n.t(s,{plural:r?"":"s"}):e}}}const XA="analytics-query-provider",qm=2;function ZA(){const n=p.inject(XA);return{evaluateFeatureFlag:(e,i)=>n?n.evaluateFeatureFlagFn(e,i):i}}function jm(n,t){return p.getCurrentScope()?(p.onScopeDispose(n,t),!0):!1}const Gm=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const QA=n=>n!=null,JA=Object.prototype.toString,tR=n=>JA.call(n)==="[object Object]";function Ya(n){return Array.isArray(n)?n:[n]}function eR(n){return p.getCurrentInstance()}function nR(n,t={}){if(!p.isRef(n))return p.toRefs(n);const e=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)e[i]=p.customRef(()=>({get(){return n.value[i]},set(r){var s;if(!((s=p.toValue(t.replaceRef))!==null&&s!==void 0)||s)if(Array.isArray(n.value)){const a=[...n.value];a[i]=r,n.value=a}else{const a={...n.value,[i]:r};Object.setPrototypeOf(a,Object.getPrototypeOf(n.value)),n.value=a}else n.value[i]=r}}));return e}function iR(n,t=!0,e){eR()?p.onMounted(n,e):t?n():p.nextTick(n)}function rR(n,t,e){return p.watch(n,t,{...e,immediate:!0})}const qa=Gm?window:void 0;function jr(n){var t;const e=p.toValue(n);return(t=e?.$el)!==null&&t!==void 0?t:e}function lo(...n){const t=(i,r,s,a)=>(i.addEventListener(r,s,a),()=>i.removeEventListener(r,s,a)),e=p.computed(()=>{const i=Ya(p.toValue(n[0])).filter(r=>r!=null);return i.every(r=>typeof r!="string")?i:void 0});return rR(()=>{var i,r;return[(i=(r=e.value)===null||r===void 0?void 0:r.map(s=>jr(s)))!==null&&i!==void 0?i:[qa].filter(s=>s!=null),Ya(p.toValue(e.value?n[1]:n[0])),Ya(p.unref(e.value?n[2]:n[1])),p.toValue(e.value?n[3]:n[2])]},([i,r,s,a],l,u)=>{if(!i?.length||!r?.length||!s?.length)return;const d=tR(a)?{...a}:a,h=i.flatMap(g=>r.flatMap(y=>s.map(_=>t(g,y,_,d))));u(()=>{h.forEach(g=>g())})},{flush:"post"})}function sR(){const n=p.shallowRef(!1),t=p.getCurrentInstance();return t&&p.onMounted(()=>{n.value=!0},t),n}function Km(n){const t=sR();return p.computed(()=>(t.value,!!n()))}function oR(n,t,e={}){const{window:i=qa,...r}=e;let s;const a=Km(()=>i&&"MutationObserver"in i),l=()=>{s&&(s.disconnect(),s=void 0)},u=p.watch(p.computed(()=>{const g=Ya(p.toValue(n)).map(jr).filter(QA);return new Set(g)}),g=>{l(),a.value&&g.size&&(s=new MutationObserver(t),g.forEach(y=>s.observe(y,r)))},{immediate:!0,flush:"post"}),d=()=>s?.takeRecords(),h=()=>{u(),l()};return jm(h),{isSupported:a,stop:h,takeRecords:d}}const ja={speed:2,margin:30,direction:"both"};function aR(n){n.scrollLeft>n.scrollWidth-n.clientWidth&&(n.scrollLeft=Math.max(0,n.scrollWidth-n.clientWidth)),n.scrollTop>n.scrollHeight-n.clientHeight&&(n.scrollTop=Math.max(0,n.scrollHeight-n.clientHeight))}function lR(n,t={}){var e,i,r,s;const{pointerTypes:a,preventDefault:l,stopPropagation:u,exact:d,onMove:h,onEnd:g,onStart:y,initialValue:_,axis:x="both",draggingElement:v=qa,containerElement:M,handle:C=n,buttons:R=[0],restrictInView:F,autoScroll:I=!1}=t,L=p.ref((e=p.toValue(_))!==null&&e!==void 0?e:{x:0,y:0}),N=p.ref(),B=P=>a?a.includes(P.pointerType):!0,T=P=>{p.toValue(l)&&P.preventDefault(),p.toValue(u)&&P.stopPropagation()},S=p.toValue(I),O=typeof S=="object"?{speed:(i=p.toValue(S.speed))!==null&&i!==void 0?i:ja.speed,margin:(r=p.toValue(S.margin))!==null&&r!==void 0?r:ja.margin,direction:(s=S.direction)!==null&&s!==void 0?s:ja.direction}:ja,U=P=>typeof P=="number"?[P,P]:[P.x,P.y],$=(P,W,j)=>{const{clientWidth:pt,clientHeight:lt,scrollLeft:et,scrollTop:ht,scrollWidth:ft,scrollHeight:ct}=P,[mt,ut]=U(O.margin),[Lt,zt]=U(O.speed);let vt=0,Ct=0;(O.direction==="x"||O.direction==="both")&&(j.x<mt&&et>0?vt=-Lt:j.x+W.width>pt-mt&&et<ft-pt&&(vt=Lt)),(O.direction==="y"||O.direction==="both")&&(j.y<ut&&ht>0?Ct=-zt:j.y+W.height>lt-ut&&ht<ct-lt&&(Ct=zt)),(vt||Ct)&&P.scrollBy({left:vt,top:Ct,behavior:"auto"})};let it=null;const at=()=>{const P=p.toValue(M);P&&!it&&(it=setInterval(()=>{const W=p.toValue(n).getBoundingClientRect(),{x:j,y:pt}=L.value,lt={x:j-P.scrollLeft,y:pt-P.scrollTop};lt.x>=0&<.y>=0&&($(P,W,lt),lt.x+=P.scrollLeft,lt.y+=P.scrollTop,L.value=lt)},1e3/60))},ot=()=>{it&&(clearInterval(it),it=null)},q=(P,W,j,pt)=>{const[lt,et]=typeof j=="number"?[j,j]:[j.x,j.y],{clientWidth:ht,clientHeight:ft}=W;return P.x<lt||P.x+pt.width>ht-lt||P.y<et||P.y+pt.height>ft-et},J=()=>{if(p.toValue(t.disabled)||!N.value)return;const P=p.toValue(M);if(!P)return;const W=p.toValue(n).getBoundingClientRect(),{x:j,y:pt}=L.value,lt={x:j-P.scrollLeft,y:pt-P.scrollTop};q(lt,P,O.margin,W)?at():ot()};p.toValue(I)&&p.watch(L,J);const rt=P=>{var W;if(!p.toValue(R).includes(P.button)||p.toValue(t.disabled)||!B(P)||p.toValue(d)&&P.target!==p.toValue(n))return;const j=p.toValue(M),pt=j==null||(W=j.getBoundingClientRect)===null||W===void 0?void 0:W.call(j),lt=p.toValue(n).getBoundingClientRect(),et={x:P.clientX-(j?lt.left-pt.left+(I?0:j.scrollLeft):lt.left),y:P.clientY-(j?lt.top-pt.top+(I?0:j.scrollTop):lt.top)};y?.(et,P)!==!1&&(N.value=et,T(P))},tt=P=>{if(p.toValue(t.disabled)||!B(P)||!N.value)return;const W=p.toValue(M);W instanceof HTMLElement&&aR(W);const j=p.toValue(n).getBoundingClientRect();let{x:pt,y:lt}=L.value;if((x==="x"||x==="both")&&(pt=P.clientX-N.value.x,W&&(pt=Math.min(Math.max(0,pt),W.scrollWidth-j.width))),(x==="y"||x==="both")&&(lt=P.clientY-N.value.y,W&&(lt=Math.min(Math.max(0,lt),W.scrollHeight-j.height))),p.toValue(I)&&W&&(it===null&&$(W,j,{x:pt,y:lt}),pt+=W.scrollLeft,lt+=W.scrollTop),W&&(F||I)){if(x!=="y"){const et=pt-W.scrollLeft;et<0?pt=W.scrollLeft:et>W.clientWidth-j.width&&(pt=W.clientWidth-j.width+W.scrollLeft)}if(x!=="x"){const et=lt-W.scrollTop;et<0?lt=W.scrollTop:et>W.clientHeight-j.height&&(lt=W.clientHeight-j.height+W.scrollTop)}}L.value={x:pt,y:lt},h?.(L.value,P),T(P)},G=P=>{p.toValue(t.disabled)||!B(P)||N.value&&(N.value=void 0,I&&ot(),g?.(L.value,P),T(P))};if(Gm){const P=()=>{var W;return{capture:(W=t.capture)!==null&&W!==void 0?W:!0,passive:!p.toValue(l)}};lo(C,"pointerdown",rt,P),lo(v,"pointermove",tt,P),lo(v,["pointerup","pointercancel"],G,P)}return{...nR(L),position:L,isDragging:p.computed(()=>!!N.value),style:p.computed(()=>`
|
|
4
4
|
left: ${L.value.x}px;
|
|
5
5
|
top: ${L.value.y}px;
|
|
6
6
|
${I?"text-wrap: nowrap;":""}
|
|
7
|
-
`)}}function iR(n,t,e={}){const{window:i=qa,...r}=e;let s;const a=Gm(()=>i&&"ResizeObserver"in i),l=()=>{s&&(s.disconnect(),s=void 0)},u=p.watch(p.computed(()=>{const h=p.toValue(n);return Array.isArray(h)?h.map(g=>jr(g)):[jr(h)]}),h=>{if(l(),a.value&&i){s=new ResizeObserver(t);for(const g of h)g&&s.observe(g,r)}},{immediate:!0,flush:"post"}),d=()=>{l(),u()};return qm(d),{isSupported:a,stop:d}}function rR(n,t={}){const{reset:e=!0,windowResize:i=!0,windowScroll:r=!0,immediate:s=!0,updateTiming:a="sync"}=t,l=p.shallowRef(0),u=p.shallowRef(0),d=p.shallowRef(0),h=p.shallowRef(0),g=p.shallowRef(0),y=p.shallowRef(0),_=p.shallowRef(0),x=p.shallowRef(0);function v(){const C=jr(n);if(!C){e&&(l.value=0,u.value=0,d.value=0,h.value=0,g.value=0,y.value=0,_.value=0,x.value=0);return}const R=C.getBoundingClientRect();l.value=R.height,u.value=R.bottom,d.value=R.left,h.value=R.right,g.value=R.top,y.value=R.width,_.value=R.x,x.value=R.y}function M(){a==="sync"?v():a==="next-frame"&&requestAnimationFrame(()=>v())}return iR(n,M),p.watch(()=>jr(n),C=>!C&&M()),tR(n,M,{attributeFilter:["style","class"]}),r&&lo("scroll",M,{capture:!0,passive:!0}),i&&lo("resize",M,{passive:!0}),ZA(()=>{s&&M()}),{height:l,bottom:u,left:d,right:h,top:g,width:y,x:_,y:x,update:M}}function sR(n,t){const{top:e,left:i}=rR(n),r=p.computed(()=>n.value?`${parseFloat(t.left)+i.value}px`:t.left),s=p.computed(()=>n.value?`${parseFloat(t.top)+e.value}px`:t.top);return{tooltipAbsoluteLeft:r,tooltipAbsoluteTop:s}}const oR=({bucketCount:n,minStamp:t,maxStamp:e,timestamps:i})=>{const r=[...i].filter(u=>u>=t&&u<=e).sort((u,d)=>u-d),s=[];if(e-t<n-2)return[];const a=(e-t)/n;let l=0;for(let u=0;u<n;u++){const d=t+u*a,h=t+(u+1)*a;let g=0;for(;l<r.length&&r[l]>=d&&r[l]<=h;)g++,l++;s.push([Math.ceil(d),g])}return s},Km=()=>({minCounts:{},maxCounts:{},minStamps:{},maxStamps:{},renderPoints:{}}),co=p.ref({}),aR=n=>(co.value[n]||(co.value[n]=Km()),co.value[n]),lR=(n,t)=>{const e=co.value[t];if(!e)return;const i=e.minCounts[n]!==void 0||e.maxCounts[n]!==void 0||e.minStamps[n]!==void 0||e.maxStamps[n]!==void 0||e.renderPoints[n]!==void 0;e&&i&&(delete e.minCounts[n],delete e.maxCounts[n],delete e.minStamps[n],delete e.maxStamps[n],delete e.renderPoints[n],Object.keys(e.minCounts).length||Object.keys(e.maxCounts).length||Object.keys(e.minStamps).length||Object.keys(e.maxStamps).length||Object.keys(e.renderPoints).length||delete co.value[t])};function cR({chartKey:n,datasets:t,groupKey:e,minStamp:i=void 0,maxStamp:r=void 0,minCount:s=void 0,maxCount:a=void 0,renderPoints:l=void 0,type:u}){const h=e!==void 0&&n!==void 0?aR(e):Km(),g=n!==void 0?n:"static-chart-key",y=p.computed(()=>t.reduce((O,{timestamps:U})=>[...O,...U],[])),_=p.computed(()=>i||y.value.reduce((O,U)=>O===0?U:Math.min(O,U),0)),x=p.computed(()=>r||y.value.reduce((O,U)=>Math.max(O,U),0));p.watchEffect(()=>{h.minStamps[g]=_.value,h.maxStamps[g]=x.value,l!==void 0&&(h.renderPoints[g]=l)});const v=p.computed(()=>Object.values(h.minStamps).reduce((O,U)=>O===0?U:Math.min(O,U),0)),M=p.computed(()=>Object.values(h.maxStamps).reduce((O,U)=>Math.max(O,U),0)),C=p.computed(()=>{const O=Object.values(h.renderPoints);return O.length===0?24:O.reduce((U,$)=>Math.max(U,$),2)}),R=p.computed(()=>{const O=M.value-v.value;return Math.ceil(O/C.value)}),F=p.computed(()=>t.length>1),I=p.computed(()=>t.map(({timestamps:O,color:U,label:$})=>({data:oR({bucketCount:C.value,minStamp:v.value,maxStamp:M.value,timestamps:O}).map(([ot,q])=>({x:ot,y:q})),label:$,...(u==="sparkline_bar"||F.value)&&U&&{backgroundColor:U},...u!=="sparkline_bar"&&U&&{borderColor:U},...F.value&&u!=="sparkline_bar"&&{fill:!0}}))),L=p.computed(()=>{const O=I.value[0]?.data?.length??0,U=[];for(let $=0;$<O;$++){let it=0;for(let at=0;at<I.value.length;at++)it+=I.value[at].data[$].y;U.push(it)}return U}),N=p.computed(()=>{const O=L.value.reduce((U,$)=>Math.max(U,$),0);return Math.max(O,a??0)}),B=p.computed(()=>{const O=I.value.reduce((it,{data:at})=>[...it,...at.map(({y:ot})=>ot)],[]),U=O.length?O[0]:0,$=O.reduce((it,at)=>Math.min(it,at),U);return s===void 0?$:Math.min($,s)});p.watchEffect(()=>{h.maxCounts[g]=N.value,h.minCounts[g]=B.value});const T=p.computed(()=>{const O=Object.values(h.minCounts),U=O.length?O[0]:0;return O.reduce(($,it)=>Math.min($,it),U)}),S=p.computed(()=>Object.values(h.maxCounts).reduce((O,U)=>Math.max(O,U),0));return p.onUnmounted(()=>{n!==void 0&&e!==void 0&&lR(n,e)}),{syncedMinStamp:v,syncedMaxStamp:M,syncedRenderPoints:C,syncedChartDatasets:I,syncedGroupSizeMs:R,syncedMinCount:T,syncedMaxCount:S}}const kt={useBarChartOptions:xA,useChartJSCommon:vA,useChartLegendValues:TA,useChartSelectedRange:MA,useExploreResultToDatasets:AA,useExploreResultToTimeDataset:IA,useScatterDatasets:HA,useDonutChartOptions:kA,useLineChartOptions:DA,useScatterChartOptions:CA,useI18n:rM,useReportChartDataForSynthetics:WA,useTranslatedUnits:VA,useEvaluateFeatureFlag:YA,useTooltipAbsolutePosition:sR,useSparklineSync:cR},Ga=n=>["interactive","zoom-interactive"].includes(n),Du=(n,t,e,i)=>{const{tooltip:r}=t;if(r.opacity===0&&!Ga(n.interactionMode)){n.showTooltip=!1;return}const{i18n:s}=kt.useI18n(),{formatUnit:a}=er({i18n:s}),l=n.chartTooltipSortFn||((u,d)=>d.rawValue-u.rawValue);if(r.body&&!Ga(n.interactionMode)){const u=r.labelColors,d=t.chart.config?.options?.indexAxis==="y"?"x":"y",h=r.dataPoints[0].parsed.x??0;n.tooltipContext=i?.contextFormatter?i.contextFormatter(h,e):fo({tickValue:new Date(h),granularity:e}),n.tooltipSeries=r.dataPoints.map((g,y)=>{const _=g.parsed[d],x=a(_??0,n.units,{translateUnit:n.translateUnit}),v=g.raw?.tooltipLabel||g.dataset.label;return{backgroundColor:u[y].backgroundColor,borderColor:u[y].borderColor,label:v,value:x,rawValue:_,isSegmentEmpty:g.dataset.isSegmentEmpty}}).sort(l),n.left=`${r.x}px`,n.top=`${r.y}px`,n.showTooltip=!0}},Xm=(n,t)=>{const{tooltip:e}=t,{i18n:i}=kt.useI18n(),{formatUnit:r}=er({i18n:i});if(e.opacity===0&&!Ga(n.interactionMode)){n.showTooltip=!1;return}const s=n.chartTooltipSortFn||((a,l)=>l.rawValue-a.rawValue);if(e.body&&!Ga(n.interactionMode)){const a=e.labelColors,l=t.chart.config?.options?.indexAxis==="y"?"x":"y",u=["gauge","donut"].includes(n.chartType);u?n.tooltipContext=n.dimensionDisplay||e.dataPoints[0].label:e.chart.data.isMultiDimension?n.tooltipContext=e.dataPoints[0].label:n.tooltipContext=n.dimensionDisplay||"",n.tooltipSeries=e.dataPoints.map((d,h)=>{const g=u?d.parsed:d.parsed[l],y=r(g??0,n.units,{translateUnit:n.translateUnit});let _;return u?_=d.dataset.labels[d.dataIndex]:_=d.dataset.label,{backgroundColor:a[h].backgroundColor,borderColor:a[h].borderColor,label:_,value:y,rawValue:g,isSegmentEmpty:d.dataset.isSegmentEmpty}}).sort(s),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},uR=n=>n&&n.datasets&&n.datasets.length,dR=n=>uR(n)&&n.datasets.some(t=>t.data.length),fR=n=>n.datasets.some(t=>t.data[0]&&Ac(t.data[0].x)),hR=n=>!!dR(n)&&n.datasets.some(t=>t.data.length==1),pR=n=>fR(n)&&n.datasets.some(t=>t.data[0]&&(t.data[0].x??0).toString().length>=13),Ka=(n,t,e)=>{const r=Math.min(t/1150,1),s=.15,a=1.15,l=n.x??0;return l<e?l+t*s*(1-r):l-t*a*(1-r)},Zm=(n,t,e)=>{const s=n.y??0;return s<e?s+t*.15:s-t*.5};function Qm(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const Cu=(n,t,e)=>{const i=n.data;return n.options.plugins.legend.labels.generateLabels(n).filter(r=>!t?.[r.text]?.isThreshold).map(((r,s)=>({...r,value:t&&t[r.text],isSegmentEmpty:i.datasets[s].isSegmentEmpty}))).sort(e)},gR=2,Jm=10,ty=12,Xa=10,ai=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Ou=(n,t)=>(t||ai)[n%ai.length],mR="#6f7787",yR={100:{background:"#f0f5fd",text:"#10599e"},200:{background:"#e5f7f4",text:"#1b6955"},300:{background:"#fff1d5",text:"#a06027"},400:{background:"#fee3b6",text:"#944d19"},500:{background:"#fedada",text:"#852021"}},_R=n=>{const t=Math.floor(parseInt(n,10)/100)*100;return yR[t]?.background||"#fafafa"},bR=Jw,Au=(n,t,e,i)=>{let r;return e?r=bR:Array.isArray(i)?r=Ou(n,i):r=i[t],r||Ou(n)},Ru=n=>{switch(n){case"error":return tv;case"warning":return rv;case"neutral":return Wh;default:return Wh}},xR={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},wR=2,vR=0,Eu=new Map,ey=(n,t)=>{const{i18n:e}=kt.useI18n(),{formatBytes:i}=er({i18n:e});return t==="bytes"?i(n):t==="count/minute"?n.toFixed(2):aa.format(n)},SR=n=>{const e=document.createElement("canvas").getContext("2d"),i=le({});return e.font=i.string,e.measureText(n).width},TR=()=>{const n="label_height";if(!Eu.has(n)){const t=le({});Eu.set(n,t.lineHeight)}return Eu.get(n)},MR=(n,t)=>t.datasets.reduce((e,i,r)=>n.isDatasetVisible(r)?e+i.data.reduce((s,a)=>isNaN(a)?s:s+a,0):e,0),kR=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,DR=Qw,CR={100:av,101:lv,102:cv,103:uv,200:dv,201:fv,202:hv,203:pv,204:gv,205:mv,206:yv,207:_v,208:bv,226:xv,300:wv,301:vv,302:Sv,303:Tv,304:Mv,305:kv,307:Dv,308:Cv,400:Ov,401:Av,402:Rv,403:Ev,404:Pv,405:Iv,406:Lv,407:Nv,408:Bv,409:Fv,410:zv,411:Uv,412:Hv,413:Wv,414:Vv,415:$v,416:Yv,417:qv,418:jv,421:Gv,422:Kv,423:Xv,424:Zv,425:Qv,426:Jv,428:t1,429:e1,431:n1,451:i1,500:r1,501:s1,502:o1,503:a1,504:l1,505:c1,506:u1,507:d1,508:f1,510:h1,511:p1},OR={100:g1,200:m1,300:y1,400:_1,500:b1},AR={"1XX":x1,"2XX":w1,"3XX":v1,"4XX":S1,"5XX":T1},ny=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100;return CR[t]??OR[e]??DR},Pu={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=ny(`${t}`),n),{}),____OTHER____:Zw,...AR};function iy(n,t,e){const i=dp(),r=PR(n,e.timeZone,e.locale??i.locale);return"formatToParts"in r?RR(r,t):ER(r,t)}function RR(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function ER(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function PR(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function IR(n,t){const e=zR(t);return"formatToParts"in e?NR(e,n):BR(e,n)}const LR={year:0,month:1,day:2,hour:3,minute:4,second:5};function NR(n,t){try{const e=n.formatToParts(t),i=[];for(let r=0;r<e.length;r++){const s=LR[e[r].type];s!==void 0&&(i[s]=parseInt(e[r].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function BR(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const Iu={},ry=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),FR=ry==="06/25/2014, 00:00:00"||ry==="06/25/2014 00:00:00";function zR(n){return Iu[n]||(Iu[n]=FR?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Iu[n]}function sy(n,t,e,i,r,s,a){const l=new Date(0);return l.setUTCFullYear(n,t,e),l.setUTCHours(i,r,s,a),l}const oy=36e5,UR=6e4,Lu={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Nu(n,t,e){if(!n)return 0;let i=Lu.timezoneZ.exec(n);if(i)return 0;let r,s;if(i=Lu.timezoneHH.exec(n),i)return r=parseInt(i[1],10),ay(r)?-(r*oy):NaN;if(i=Lu.timezoneHHMM.exec(n),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return ay(r,a)?(s=Math.abs(r)*oy+a*UR,i[1]==="+"?-s:s):NaN}if(VR(n)){t=new Date(t||Date.now());const a=e?t:HR(t),l=Bu(a,n);return-(e?l:WR(t,l,n))}return NaN}function HR(n){return sy(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Bu(n,t){const e=IR(n,t),i=sy(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let r=n.getTime();const s=r%1e3;return r-=s>=0?s:1e3+s,i-r}function WR(n,t,e){let r=n.getTime()-t;const s=Bu(new Date(r),e);if(t===s)return t;r-=s-t;const a=Bu(new Date(r),e);return s===a?s:Math.max(s,a)}function ay(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const ly={};function VR(n){if(ly[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),ly[n]=!0,!0}catch{return!1}}const $R=60*1e3,YR={X:function(n,t,e){const i=Fu(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return cy(i);case"XXXX":case"XX":return Gr(i);default:return Gr(i,":")}},x:function(n,t,e){const i=Fu(e.timeZone,n);switch(t){case"x":return cy(i);case"xxxx":case"xx":return Gr(i);default:return Gr(i,":")}},O:function(n,t,e){const i=Fu(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+qR(i,":");default:return"GMT"+Gr(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return iy("short",n,e);default:return iy("long",n,e)}}};function Fu(n,t){const e=n?Nu(n,t,!0)/$R:t?.getTimezoneOffset()??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Za(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Gr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Za(Math.floor(i/60),2),s=Za(Math.floor(i%60),2);return e+r+t+s}function cy(n,t){return n%60===0?(n>0?"-":"+")+Za(Math.abs(n)/60,2):Gr(n,t)}function qR(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Math.floor(i/60),s=i%60;return s===0?e+String(r):e+String(r)+t+Za(s,2)}function uy(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const jR=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,zu=36e5,dy=6e4,GR=2,Xe={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:jR};function fy(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?GR:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=KR(n),{year:r,restDateString:s}=XR(i.date,e),a=ZR(s,r);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const l=a.getTime();let u=0,d;if(i.time&&(u=QR(i.time),u===null||isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(d=Nu(i.timeZone||t.timeZone,new Date(l+u)),isNaN(d))return new Date(NaN)}else d=uy(new Date(l+u)),d=uy(new Date(l+u+d));return new Date(l+u+d)}else return new Date(NaN)}function KR(n){const t={};let e=Xe.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=Xe.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const r=Xe.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function XR(n,t){if(n){const e=Xe.YYY[t],i=Xe.YYYYY[t];let r=Xe.YYYY.exec(n)||i.exec(n);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:n.slice(s.length)}}if(r=Xe.YY.exec(n)||e.exec(n),r){const s=r[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}}return{year:null}}function ZR(n,t){if(t===null)return null;let e,i,r;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let s=Xe.MM.exec(n);if(s)return e=new Date(0),i=parseInt(s[1],10)-1,gy(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(s=Xe.DDD.exec(n),s){e=new Date(0);const a=parseInt(s[1],10);return eE(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(s=Xe.MMDD.exec(n),s){e=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return gy(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(s=Xe.Www.exec(n),s)return r=parseInt(s[1],10)-1,my(r)?hy(t,r):new Date(NaN);if(s=Xe.WwwD.exec(n),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return my(r,a)?hy(t,r,a):new Date(NaN)}return null}function QR(n){let t,e,i=Xe.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Uu(t)?t%24*zu:NaN;if(i=Xe.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Uu(t,e)?t%24*zu+e*dy:NaN;if(i=Xe.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return Uu(t,e,r)?t%24*zu+e*dy+r*1e3:NaN}return null}function hy(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const r=i.getUTCDay()||7,s=t*7+e+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const JR=[31,28,31,30,31,30,31,31,30,31,30,31],tE=[31,29,31,30,31,30,31,31,30,31,30,31];function py(n){return n%400===0||n%4===0&&n%100!==0}function gy(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=py(n);if(i&&e>tE[t]||!i&&e>JR[t])return!1}return!0}function eE(n,t){if(t<1)return!1;const e=py(n);return!(e&&t>366||!e&&t>365)}function my(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Uu(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const nE=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Hu(n,t,e={}){t=String(t);const i=t.match(nE);if(i){const r=fy(e.originalDate||n,e);t=i.reduce(function(s,a){if(a[0]==="'")return s;const l=s.indexOf(a),u=s[l-1]==="'",d=s.replace(a,"'"+YR[a[0]](r,a,e)+"'");return u?d.substring(0,l-1)+d.substring(l+1):d},t)}return ua(n,t,e)}function iE(n,t,e){n=fy(n,e);const i=Nu(t,n,!0),r=new Date(n.getTime()-i),s=new Date(0);return s.setFullYear(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),s.setHours(r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()),s}function uo(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Hu(iE(n,t,{timeZone:i.timeZone}),e,i)}const rE=(n,t)=>`${uo(n,t,"yyyy")} W${uo(n,t,"II")}`,Wu="yyyy-MM-dd h:mm:ss a",Vu="h:mm:ss a",hr="yyyy-MM-dd h:mm a",Kr="h:mm a",sE="yyyy-MM-dd",$u="MMM dd, yyyy h:mm:ss a",Ii="MMM dd, yyyy h:mm a",oE={secondly:n=>n?Wu:Vu,tenSecondly:n=>n?Wu:Vu,thirtySecondly:n=>n?Wu:Vu,minutely:n=>n?hr:Kr,fiveMinutely:n=>n?hr:Kr,tenMinutely:n=>n?hr:Kr,thirtyMinutely:n=>n?hr:Kr,hourly:n=>n?hr:Kr,twoHourly:n=>n?hr:Kr,twelveHourly:()=>hr,daily:()=>sE},aE={secondly:()=>$u,tenSecondly:()=>$u,thirtySecondly:()=>$u,minutely:()=>Ii,fiveMinutely:()=>Ii,tenMinutely:()=>Ii,thirtyMinutely:()=>Ii,hourly:()=>Ii,twoHourly:()=>Ii,twelveHourly:()=>Ii,daily:()=>Ii};function yy({tickValue:n,granularity:t,timezone:e,dayBoundaryCrossed:i=!1,tickMap:r,tooltipMap:s,defaultFormat:a}){const l=e||Intl.DateTimeFormat().resolvedOptions().timeZone;if(t==="weekly")return rE(n,l);if(r&&r[t]){const u=r[t](i);return uo(n,l,u)}if(s&&s[t]){const u=s[t]();return uo(n,l,u)}return uo(n,l,a)}const _y=({tickValue:n,granularity:t,dayBoundaryCrossed:e,timezone:i})=>yy({tickValue:n,granularity:t,timezone:i,dayBoundaryCrossed:e,tickMap:oE,defaultFormat:"yyyy-MM-dd h:mm:ss a"}),fo=({tickValue:n,granularity:t,timezone:e})=>yy({tickValue:n,granularity:t,timezone:e,tooltipMap:aE,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),by=n=>n?.code==="ERR_CANCELED"||n?.name==="CanceledError"||n?.name==="AbortError",lE=n=>{const{i18n:t}=kt.useI18n();return by(n)?{type:"canceled",message:t.t("query_errors.canceled.message")}:n?.status===403?{status:n.status,type:"forbidden",message:t.t("query_errors.forbidden.message"),details:t.t("query_errors.forbidden.details")}:n?.status===408||n?.message?.includes("timeout")?{status:n.status,type:"timeout",message:t.t("query_errors.timeout.message"),details:t.t("query_errors.timeout.details")}:n?.response?.data?.message==="Range not allowed for this tier"?{status:n.status,type:"range_exceeded",message:t.t("query_errors.time_range_exceeded.message"),details:t.t("query_errors.time_range_exceeded.details")}:{status:n.status,type:"other",message:t.t("query_errors.other.message"),details:n.response?.data?.invalid_parameters?.map(e=>e.reason).join(", ")||n?.message}},ho=n=>n.toLocaleLowerCase().endsWith("count"),cE=n=>{const t=n.toLocaleLowerCase();return["sum","count","cost","tokens"].some(e=>t.endsWith(e))},uE=(n,t)=>{if(!n.length)return NaN;const i=Math.min(100,Math.max(0,t))/100*(n.length-1),r=Math.floor(i),s=Math.ceil(i);return r===s?n[r]:n[r]+(n[s]-n[r])*(i-r)},dE=(n,t)=>{const e=n.filter(i=>Number.isFinite(i)).sort((i,r)=>i-r);return new Map(t.map(i=>[i,uE(e,i)]))},xy=.7,Yu=(n,t)=>{const e=Sa(n.trim());return e.valid?e.alpha(t).rgbString():n},Qa=n=>{const t=n??(typeof document>"u"?null:document.documentElement);if(typeof window>"u"||!t)return{medianLine:Vh,outlier:Uh,outlierBand:Yu(Hh,xy)};const e=window.getComputedStyle(t),i=(r,s)=>e.getPropertyValue(r).trim()||s;return{medianLine:i("--kui-color-text",Vh),outlier:i("--kui-color-background-danger",Uh),outlierBand:Yu(i("--kui-color-background-danger-weakest",Hh),xy)}},fE="empty",wy=n=>{if(!n||!("meta"in n)||!("data"in n))return;const{display:t,metric_names:e,metric_units:i,start:r,end:s,truncated:a,limit:l,datasource:u}=n.meta;if(!e?.length){console.error("Cannot build scatter chart data from this explore result. Missing metric names.");return}const d=e[0],h=t&&Object.keys(t)[0]||void 0,g=n.data??[],y=[];for(const _ of g){const x=hE(_.timestamp,_.event[d],h?_.event[h]:void 0);x&&y.push(x)}return{points:y,metric:d,metricUnit:i?.[d],dimension:h,display:h?t?.[h]:void 0,start:r,end:s,truncated:a,limit:l,datasource:u}},hE=(n,t,e)=>{if(t==null||t==="")return;const i=new Date(n).valueOf(),r=Number(t);return!Number.isFinite(i)||!Number.isFinite(r)?void 0:e===void 0?{timestamp:i,value:r}:{timestamp:i,value:r,group:e!==null&&e!==""?String(e):fE}},pE=["hidden","single","full"];var pr=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(pr||{});const gE=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar","scatter"],mE=["gauge","top_n","single_value"],Ja=n=>n===null||typeof n!="object"||!("points"in n)?!1:Array.isArray(n.points);var Pe=(n=>(n.Hidden="hidden",n.Bottom="bottom",n))(Pe||{});const vy={modes:{point(n,t){return tl(n,t,{intersect:!0})},nearest(n,t,e){return bE(n,t,e)},x(n,t,e){return tl(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return tl(n,t,{intersect:e.intersect,axis:"y"})}}};function qu(n,t,e){return(vy.modes[e.mode]||vy.modes.nearest)(n,t,e)}function yE(n,t,e){return e!=="x"&&e!=="y"?n.inRange(t.x,t.y,"x",!0)||n.inRange(t.x,t.y,"y",!0):n.inRange(t.x,t.y,e,!0)}function _E(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function tl(n,t,e){return n.filter(i=>e.intersect?i.inRange(t.x,t.y):yE(i,t,e.axis))}function bE(n,t,e){let i=Number.POSITIVE_INFINITY;return tl(n,t,e).reduce((r,s)=>{const a=s.getCenterPoint(),l=_E(t,a,e.axis),u=Ur(t,l);return u<i?(r=[s],i=u):u===i&&r.push(s),r},[]).sort((r,s)=>r._index-s._index).slice(0,1)}function gr(n,t,e){const i=Math.cos(e),r=Math.sin(e),s=t.x,a=t.y;return{x:s+i*(n.x-s)-r*(n.y-a),y:a+r*(n.x-s)+i*(n.y-a)}}const xE=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,mr=.001,el=(n,t,e)=>Math.min(e,Math.max(t,n)),Sy=(n,t)=>n.value>=n.start-t&&n.value<=n.end+t;function wE(n,t,e){for(const i of Object.keys(n))n[i]=el(n[i],t,e);return n}function vE(n,t,e,i){return!n||!t||e<=0?!1:Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2)<=Math.pow(e+i,2)}function Ty(n,{x:t,y:e,x2:i,y2:r},s,{borderWidth:a,hitTolerance:l}){const u=(a+l)/2,d=n.x>=t-u-mr&&n.x<=i+u+mr,h=n.y>=e-u-mr&&n.y<=r+u+mr;return s==="x"?d:(s==="y"||d)&&h}function My(n,{rect:t,center:e},i,{rotation:r,borderWidth:s,hitTolerance:a}){const l=gr(n,e,xe(-r));return Ty(l,t,i,{borderWidth:s,hitTolerance:a})}function yr(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function SE(n,t,e,i=!0){const r=e.split(".");let s=0;for(const a of t.split(".")){const l=r[s++];if(parseInt(a,10)<parseInt(l,10))break;if(xE(l,a)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const ky=n=>typeof n=="string"&&n.endsWith("%"),Dy=n=>parseFloat(n)/100,Cy=n=>el(Dy(n),0,1),po=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),TE={box:n=>po(n.centerX,n.centerY),doughnutLabel:n=>po(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>po(n.centerX,n.centerY),line:n=>po(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>po(n.centerX,n.centerY)};function ju(n,t){return t==="start"?0:t==="end"?n:ky(t)?Cy(t)*n:n/2}function Li(n,t,e=!0){return typeof t=="number"?t:ky(t)?(e?Cy(t):Dy(t))*n:n}function ME(n,t){const{x:e,width:i}=n,r=t.textAlign;return r==="center"?e+i/2:r==="end"||r==="right"?e+i:e}function Oy(n,t,{borderWidth:e,position:i,xAdjust:r,yAdjust:s},a){const l=Pt(a),u=t.width+(l?a.width:0)+e,d=t.height+(l?a.height:0)+e,h=Gu(i),g=Py(n.x,u,r,h.x),y=Py(n.y,d,s,h.y);return{x:g,y,x2:g+u,y2:y+d,width:u,height:d,centerX:g+u/2,centerY:y+d/2}}function Gu(n,t="center"){return Pt(n)?{x:Mt(n.x,t),y:Mt(n.y,t)}:(n=Mt(n,t),{x:n,y:n})}const Ay=(n,t)=>n&&n.autoFit&&t<1;function Ry(n,t){const e=n.font,i=Yt(e)?e:[e];return Ay(n,t)?i.map(function(r){const s=le(r);return s.size=Math.floor(r.size*t),s.lineHeight=r.lineHeight,le(s)}):i.map(r=>le(r))}function Ey(n){return n&&(en(n.xValue)||en(n.yValue))}function Py(n,t,e=0,i){return n-ju(t,i)+e}function Xr(n,t,e){const i=e.init;if(i){if(i===!0)return Ly(t,e)}else return;return kE(n,t,e)}function Iy(n,t,e){let i=!1;return t.forEach(r=>{nn(n[r])?(i=!0,e[r]=n[r]):en(e[r])&&delete e[r]}),i}function Ly(n,t){const e=t.type||"line";return TE[e](n)}function kE(n,t,e){const i=Qt(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return Ly(t,e);if(Pt(i))return i}const Ku=new Map,DE=n=>isNaN(n)||n<=0,CE=n=>n.reduce(function(t,e){return t+=e.string,t},"");function nl(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function il(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate(xe(i)),n.translate(-t,-e))}function li(n,t){if(t&&t.borderWidth)return n.lineCap=t.borderCapStyle||"butt",n.setLineDash(t.borderDash),n.lineDashOffset=t.borderDashOffset,n.lineJoin=t.borderJoinStyle||"miter",n.lineWidth=t.borderWidth,n.strokeStyle=t.borderColor,!0}function Zr(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function rl(n,t){const e=t.content;if(nl(e))return{width:Li(e.width,t.width),height:Li(e.height,t.height)};const i=Ry(t),r=t.textStrokeWidth,s=Yt(e)?e:[e],a=s.join()+CE(i)+r+(n._measureText?"-spriting":"");return Ku.has(a)||Ku.set(a,EE(n,s,i,r)),Ku.get(a)}function Ny(n,t,e){const{x:i,y:r,width:s,height:a}=t;n.save(),Zr(n,e);const l=li(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),Hr(n,{x:i,y:r,w:s,h:a,radius:wE(Ci(e.borderRadius),0,Math.min(s,a)/2)}),n.closePath(),n.fill(),l&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function By(n,t,e,i){const r=e.content;if(nl(r)){n.save(),n.globalAlpha=LE(e.opacity,r.style.opacity),n.drawImage(r,t.x,t.y,t.width,t.height),n.restore();return}const s=Yt(r)?r:[r],a=Ry(e,i),l=e.color,u=Yt(l)?l:[l],d=ME(t,e),h=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,OE(n,e)&&PE(n,{x:d,y:h},s,a),IE(n,{x:d,y:h},s,{fonts:a,colors:u}),n.restore()}function OE(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function AE(n,t,e,i){const{radius:r,options:s}=t,a=s.pointStyle,l=s.rotation;let u=(l||0)*Yc;if(nl(a)){n.save(),n.translate(e,i),n.rotate(u),n.drawImage(a,-a.width/2,-a.height/2,a.width,a.height),n.restore();return}DE(r)||RE(n,{x:e,y:i,radius:r,rotation:l,style:a,rad:u})}function RE(n,{x:t,y:e,radius:i,rotation:r,style:s,rad:a}){let l,u,d,h;switch(n.beginPath(),s){default:n.arc(t,e,i,0,te),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(a)*i,e-Math.cos(a)*i),a+=ba,n.lineTo(t+Math.sin(a)*i,e-Math.cos(a)*i),a+=ba,n.lineTo(t+Math.sin(a)*i,e-Math.cos(a)*i),n.closePath();break;case"rectRounded":h=i*.516,d=i-h,l=Math.cos(a+kn)*d,u=Math.sin(a+kn)*d,n.arc(t-l,e-u,h,a-Rt,a-re),n.arc(t+u,e-l,h,a-re,a),n.arc(t+l,e+u,h,a,a+re),n.arc(t-u,e+l,h,a+re,a+Rt),n.closePath();break;case"rect":if(!r){d=Math.SQRT1_2*i,n.rect(t-d,e-d,2*d,2*d);break}a+=kn;case"rectRot":l=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-l,e-u),n.lineTo(t+u,e-l),n.lineTo(t+l,e+u),n.lineTo(t-u,e+l),n.closePath();break;case"crossRot":a+=kn;case"cross":l=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-l,e-u),n.lineTo(t+l,e+u),n.moveTo(t+u,e-l),n.lineTo(t-u,e+l);break;case"star":l=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-l,e-u),n.lineTo(t+l,e+u),n.moveTo(t+u,e-l),n.lineTo(t-u,e+l),a+=kn,l=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-l,e-u),n.lineTo(t+l,e+u),n.moveTo(t+u,e-l),n.lineTo(t-u,e+l);break;case"line":l=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-l,e-u),n.lineTo(t+l,e+u);break;case"dash":n.moveTo(t,e),n.lineTo(t+Math.cos(a)*i,e+Math.sin(a)*i);break}n.fill()}function EE(n,t,e,i){n.save();const r=t.length;let s=0,a=i;for(let l=0;l<r;l++){const u=e[Math.min(l,e.length-1)];n.font=u.string;const d=t[l];s=Math.max(s,n.measureText(d).width+i),a+=u.lineHeight}return n.restore(),{width:s,height:a}}function PE(n,{x:t,y:e},i,r){n.beginPath();let s=0;i.forEach(function(a,l){const u=r[Math.min(l,r.length-1)],d=u.lineHeight;n.font=u.string,n.strokeText(a,t,e+d/2+s),s+=d}),n.stroke()}function IE(n,{x:t,y:e},i,{fonts:r,colors:s}){let a=0;i.forEach(function(l,u){const d=s[Math.min(u,s.length-1)],h=r[Math.min(u,r.length-1)],g=h.lineHeight;n.beginPath(),n.font=h.string,n.fillStyle=d,n.fillText(l,t,e+g/2+a),a+=g,n.fill()})}function LE(n,t){const e=Di(n)?n:t;return Di(e)?el(e,0,1):1}const Fy=["left","bottom","top","right"];function NE(n,t){const{pointX:e,pointY:i,options:r}=t,s=r.callout,a=s&&s.display&&HE(t,s);if(!a||VE(t,s,a))return;if(n.save(),n.beginPath(),!li(n,s))return n.restore();const{separatorStart:u,separatorEnd:d}=BE(t,a),{sideStart:h,sideEnd:g}=zE(t,a,u);(s.margin>0||r.borderWidth===0)&&(n.moveTo(u.x,u.y),n.lineTo(d.x,d.y)),n.moveTo(h.x,h.y),n.lineTo(g.x,g.y);const y=gr({x:e,y:i},t.getCenterPoint(),xe(-t.rotation));n.lineTo(y.x,y.y),n.stroke(),n.restore()}function BE(n,t){const{x:e,y:i,x2:r,y2:s}=n,a=FE(n,t);let l,u;return t==="left"||t==="right"?(l={x:e+a,y:i},u={x:l.x,y:s}):(l={x:e,y:i+a},u={x:r,y:l.y}),{separatorStart:l,separatorEnd:u}}function FE(n,t){const{width:e,height:i,options:r}=n,s=r.callout.margin+r.borderWidth/2;return t==="right"?e+s:t==="bottom"?i+s:-s}function zE(n,t,e){const{y:i,width:r,height:s,options:a}=n,l=a.callout.start,u=UE(t,a.callout);let d,h;return t==="left"||t==="right"?(d={x:e.x,y:i+Li(s,l)},h={x:d.x+u,y:d.y}):(d={x:e.x+Li(r,l),y:e.y},h={x:d.x,y:d.y+u}),{sideStart:d,sideEnd:h}}function UE(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function HE(n,t){const e=t.position;return Fy.includes(e)?e:WE(n,t)}function WE(n,t){const{x:e,y:i,x2:r,y2:s,width:a,height:l,pointX:u,pointY:d,centerX:h,centerY:g,rotation:y}=n,_={x:h,y:g},x=t.start,v=Li(a,x),M=Li(l,x),C=[e,e+v,e+v,r],R=[i+M,s,i,s],F=[];for(let I=0;I<4;I++){const L=gr({x:C[I],y:R[I]},_,xe(y));F.push({position:Fy[I],distance:Ur(L,{x:u,y:d})})}return F.sort((I,L)=>I.distance-L.distance)[0].position}function VE(n,t,e){const{pointX:i,pointY:r}=n,s=t.margin;let a=i,l=r;return e==="left"?a+=s:e==="right"?a-=s:e==="top"?l+=s:e==="bottom"&&(l-=s),n.inRange(a,l)}const zy={xScaleID:{min:"xMin",max:"xMax",start:"left",end:"right",startProp:"x",endProp:"x2"},yScaleID:{min:"yMin",max:"yMax",start:"bottom",end:"top",startProp:"y",endProp:"y2"}};function Qr(n,t,e){return t=typeof t=="number"?t:n.parse(t),ae(t)?n.getPixelForValue(t):e}function _r(n,t,e){const i=t[e];if(i||e==="scaleID")return i;const r=e.charAt(0),s=Object.values(n).filter(a=>a.axis&&a.axis===r);return s.length?s[0].id:r}function Uy(n,t){if(n){const e=n.options.reverse,i=Qr(n,t.min,e?t.end:t.start),r=Qr(n,t.max,e?t.start:t.end);return{start:i,end:r}}}function Hy(n,t){const{chartArea:e,scales:i}=n,r=i[_r(i,t,"xScaleID")],s=i[_r(i,t,"yScaleID")];let a=e.width/2,l=e.height/2;return r&&(a=Qr(r,t.xValue,r.left+r.width/2)),s&&(l=Qr(s,t.yValue,s.top+s.height/2)),{x:a,y:l}}function Xu(n,t){const e=n.scales,i=e[_r(e,t,"xScaleID")],r=e[_r(e,t,"yScaleID")];if(!i&&!r)return{};let{left:s,right:a}=i||n.chartArea,{top:l,bottom:u}=r||n.chartArea;const d=$y(i,{min:t.xMin,max:t.xMax,start:s,end:a});s=d.start,a=d.end;const h=$y(r,{min:t.yMin,max:t.yMax,start:u,end:l});return l=h.start,u=h.end,{x:s,y:l,x2:a,y2:u,width:a-s,height:u-l,centerX:s+(a-s)/2,centerY:l+(u-l)/2}}function Wy(n,t){if(!Ey(t)){const e=Xu(n,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(e.width,e.height)/2,t.radius=i);const r=i*2,s=e.centerX+t.xAdjust,a=e.centerY+t.yAdjust;return{x:s-i,y:a-i,x2:s+i,y2:a+i,centerX:s,centerY:a,width:r,height:r,radius:i}}return YE(n,t)}function $E(n,t){const{scales:e,chartArea:i}=n,r=e[t.scaleID],s={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return r?qE(r,s,t):jE(e,s,t),s}function Vy(n,t){const e=Xu(n,t);return e.initProperties=Xr(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:XE(n,e,t),initProperties:e.initProperties}],e}function YE(n,t){const e=Hy(n,t),i=t.radius*2;return{x:e.x-t.radius+t.xAdjust,y:e.y-t.radius+t.yAdjust,x2:e.x+t.radius+t.xAdjust,y2:e.y+t.radius+t.yAdjust,centerX:e.x+t.xAdjust,centerY:e.y+t.yAdjust,radius:t.radius,width:i,height:i}}function $y(n,t){const e=Uy(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function qE(n,t,e){const i=Qr(n,e.value,NaN),r=Qr(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=r):(t.y=i,t.y2=r)}function jE(n,t,e){for(const i of Object.keys(zy)){const r=n[_r(n,e,i)];if(r){const{min:s,max:a,start:l,end:u,startProp:d,endProp:h}=zy[i],g=Uy(r,{min:e[s],max:e[a],start:r[l],end:r[u]});t[d]=g.start,t[h]=g.end}}}function GE({properties:n,options:t},e,i,r){const{x:s,x2:a,width:l}=n;return Yy({start:s,end:a,borderWidth:t.borderWidth},{position:i.x,padding:{start:r.left,end:r.right},adjust:t.label.xAdjust,size:e.width})}function KE({properties:n,options:t},e,i,r){const{y:s,y2:a,height:l}=n;return Yy({start:s,end:a,borderWidth:t.borderWidth},{position:i.y,padding:{start:r.top,end:r.bottom},adjust:t.label.yAdjust,size:e.height})}function Yy(n,t){const{start:e,end:i,borderWidth:r}=n,{position:s,padding:{start:a,end:l},adjust:u}=t,d=i-r-e-a-l-t.size;return e+r/2+u+ju(d,s)}function XE(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const r=Gu(i.position),s=we(i.padding),a=rl(n.ctx,i),l=GE({properties:t,options:e},a,r,s),u=KE({properties:t,options:e},a,r,s),d=a.width+s.width,h=a.height+s.height;return{x:l,y:u,x2:l+d,y2:u+h,width:d,height:h,centerX:l+d/2,centerY:u+h/2,rotation:i.rotation}}const Zu=["enter","leave"],Qu=Zu.concat("click");function ZE(n,t,e){t.listened=Iy(e,Qu,t.listeners),t.moveListened=!1,Zu.forEach(i=>{nn(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&nn(i.click)&&(t.listened=!0),t.moveListened||Zu.forEach(r=>{nn(i[r])&&(t.listened=!0,t.moveListened=!0)})})}function QE(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return JE(n,t,e);case"click":return tP(n,t,e)}}function JE(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=qu(n.visibleElements,t,e.interaction):i=[];const r=n.hovered;n.hovered=i;const s={state:n,event:t};let a=qy(s,"leave",r,i);return qy(s,"enter",i,r)||a}function qy({state:n,event:t},e,i,r){let s;for(const a of i)r.indexOf(a)<0&&(s=jy(a.options[e]||n.listeners[e],a,t)||s);return s}function tP(n,t,e){const i=n.listeners,r=qu(n.visibleElements,t,e.interaction);let s;for(const a of r)s=jy(a.options.click||i.click,a,t)||s;return s}function jy(n,t,e){return Qt(n,[t.$context,e])===!0}const sl=["afterDraw","beforeDraw"];function eP(n,t,e){const i=t.visibleElements;t.hooked=Iy(e,sl,t.hooks),t.hooked||i.forEach(r=>{t.hooked||sl.forEach(s=>{nn(r.options[s])&&(t.hooked=!0)})})}function Gy(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return Qt(i,[t.$context])}}function nP(n,t,e){const i=aP(n.scales,t,e);let r=Ky(t,i,"min","suggestedMin");r=Ky(t,i,"max","suggestedMax")||r,r&&nn(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function iP(n,t){for(const e of n)sP(e,t)}function Ky(n,t,e,i){if(ae(t[e])&&!rP(n.options,e,i)){const r=n[e]!==t[e];return n[e]=t[e],r}}function rP(n,t,e){return en(n[t])||en(n[e])}function sP(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=_r(t,n,e);i&&!t[i]&&oP(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function oP(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(en(n[e+i]))return!0;return!1}function aP(n,t,e){const i=t.axis,r=t.id,s=i+"ScaleID",a={min:Mt(t.min,Number.NEGATIVE_INFINITY),max:Mt(t.max,Number.POSITIVE_INFINITY)};for(const l of e)l.scaleID===r?Xy(l,t,["value","endValue"],a):_r(n,l,s)===r&&Xy(l,t,[i+"Min",i+"Max",i+"Value"],a);return a}function Xy(n,t,e,i){for(const r of e){const s=n[r];if(en(s)){const a=t.parse(s);i.min=Math.min(i.min,a),i.max=Math.max(i.max,a)}}}class Jr extends Ve{inRange(t,e,i,r){const{x:s,y:a}=gr({x:t,y:e},this.getCenterPoint(r),xe(-this.options.rotation));return Ty({x:s,y:a},this.getProps(["x","y","x2","y2"],r),i,this.options)}getCenterPoint(t){return yr(this,t)}draw(t){t.save(),il(t,this.getCenterPoint(),this.options.rotation),Ny(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Vy(t,e)}}Jr.id="boxAnnotation",Jr.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,hitTolerance:0,label:{backgroundColor:"transparent",borderWidth:0,callout:{display:!1},color:"black",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,hitTolerance:void 0,opacity:void 0,padding:6,position:"center",rotation:void 0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},Jr.defaultRoutes={borderColor:"color",backgroundColor:"color"},Jr.descriptors={label:{_fallback:!0}};class ol extends Ve{inRange(t,e,i,r){return My({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],r),center:this.getCenterPoint(r)},i,{rotation:this.rotation,borderWidth:0,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return yr(this,t)}draw(t){const e=this.options;!e.display||!e.content||(hP(t,this),t.save(),il(t,this.getCenterPoint(),this.rotation),By(t,this,e,this._fitRatio),t.restore())}resolveElementProperties(t,e){const i=lP(t,e);if(!i)return{};const{controllerMeta:r,point:s,radius:a}=uP(t,e,i);let l=rl(t.ctx,e);const u=dP(l,a);Ay(e,u)&&(l={width:l.width*u,height:l.height*u});const{position:d,xAdjust:h,yAdjust:g}=e,y=Oy(s,l,{borderWidth:0,position:d,xAdjust:h,yAdjust:g});return{initProperties:Xr(t,y,e),...y,...r,rotation:e.rotation,_fitRatio:u}}}ol.id="doughnutLabelAnnotation",ol.defaults={autoFit:!0,autoHide:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderColor:"transparent",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:0,color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,hitTolerance:0,init:void 0,opacity:void 0,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,spacing:1,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0},ol.defaultRoutes={};function lP(n,t){return n.getSortedVisibleDatasetMetas().reduce(function(e,i){const r=i.controller;return r instanceof Xs&&cP(n,t,i.data)&&(!e||r.innerRadius<e.controller.innerRadius)&&r.options.circumference>=90?i:e},void 0)}function cP(n,t,e){if(!t.autoHide)return!0;for(let i=0;i<e.length;i++)if(!e[i].hidden&&n.getDataVisibility(i))return!0}function uP({chartArea:n},t,e){const{left:i,top:r,right:s,bottom:a}=n,{innerRadius:l,offsetX:u,offsetY:d}=e.controller,h=(i+s)/2+u,g=(r+a)/2+d,y={left:Math.max(h-l,i),right:Math.min(h+l,s),top:Math.max(g-l,r),bottom:Math.min(g+l,a)},_={x:(y.left+y.right)/2,y:(y.top+y.bottom)/2},x=t.spacing+t.borderWidth/2,v=l-x,M=_.y>g,C=M?r+x:a-x,R=fP(C,h,g,v);return{controllerMeta:{_centerX:h,_centerY:g,_radius:v,_counterclockwise:M,...R},point:_,radius:Math.min(l,Math.min(y.right-y.left,y.bottom-y.top)/2)}}function dP({width:n,height:t},e){const i=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return e*2/i}function fP(n,t,e,i){const r=Math.pow(e-n,2),s=Math.pow(i,2),a=t*-2,l=Math.pow(t,2)+r-s,u=Math.pow(a,2)-4*l;if(u<=0)return{_startAngle:0,_endAngle:te};const d=(-a-Math.sqrt(u))/2,h=(-a+Math.sqrt(u))/2;return{_startAngle:wa({x:t,y:e},{x:d,y:n}).angle,_endAngle:wa({x:t,y:e},{x:h,y:n}).angle}}function hP(n,t){const{_centerX:e,_centerY:i,_radius:r,_startAngle:s,_endAngle:a,_counterclockwise:l,options:u}=t;n.save();const d=li(n,u);n.fillStyle=u.backgroundColor,n.beginPath(),n.arc(e,i,r,s,a,l),n.closePath(),n.fill(),d&&n.stroke(),n.restore()}class go extends Ve{inRange(t,e,i,r){return My({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],r),center:this.getCenterPoint(r)},i,{rotation:this.rotation,borderWidth:this.options.borderWidth,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return yr(this,t)}draw(t){const e=this.options,i=!en(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),il(t,this.getCenterPoint(),this.rotation),NE(t,this),Ny(t,this,e),By(t,pP(this),e),t.restore())}resolveElementProperties(t,e){let i;if(Ey(e))i=Hy(t,e);else{const{centerX:l,centerY:u}=Xu(t,e);i={x:l,y:u}}const r=we(e.padding),s=rl(t.ctx,e),a=Oy(i,s,e,r);return{initProperties:Xr(t,a,e),pointX:i.x,pointY:i.y,...a,rotation:e.rotation}}}go.id="labelAnnotation",go.defaults={adjustScaleRange:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:!1,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,hitTolerance:0,init:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},go.defaultRoutes={borderColor:"color"};function pP({x:n,y:t,width:e,height:i,options:r}){const s=r.borderWidth/2,a=we(r.padding);return{x:n+a.left+s,y:t+a.top+s,width:e-a.left-a.right-r.borderWidth,height:i-a.top-a.bottom-r.borderWidth}}const Ju=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),td=(n,t,e)=>Ju(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,Zy=(n,t,e)=>Ju(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,mo=n=>n*n,gP=(n,t,{x:e,y:i,x2:r,y2:s},a)=>a==="y"?{start:Math.min(i,s),end:Math.max(i,s),value:t}:{start:Math.min(e,r),end:Math.max(e,r),value:n},Qy=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,ed=(n,t,e,i)=>({x:Qy(n.x,t.x,e.x,i),y:Qy(n.y,t.y,e.y,i)}),Jy=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),t_=(n,t,e,i)=>-Math.atan2(Jy(n.x,t.x,e.x,i),Jy(n.y,t.y,e.y,i))+.5*Rt;class yo extends Ve{inRange(t,e,i,r){const s=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const a={mouseX:t,mouseY:e},{path:l,ctx:u}=this;if(l){li(u,this.options),u.lineWidth+=this.options.hitTolerance;const{chart:h}=this.$context,g=t*h.currentDevicePixelRatio,y=e*h.currentDevicePixelRatio,_=u.isPointInStroke(l,g,y)||nd(this,a,r);return u.restore(),_}const d=mo(s);return bP(this,a,d,r)||nd(this,a,r)}return mP(this,{mouseX:t,mouseY:e},i,{hitSize:s,useFinalPosition:r})}getCenterPoint(t){return yr(this,t)}draw(t){const{x:e,y:i,x2:r,y2:s,cp:a,options:l}=this;if(t.save(),!li(t,l))return t.restore();Zr(t,l);const u=Math.sqrt(Math.pow(r-e,2)+Math.pow(s-i,2));if(l.curve&&a)return DP(t,this,a,u),t.restore();const{startOpts:d,endOpts:h,startAdjust:g,endAdjust:y}=s_(this),_=Math.atan2(s-i,r-e);t.translate(e,i),t.rotate(_),t.beginPath(),t.moveTo(0+g,0),t.lineTo(u-y,0),t.shadowColor=l.borderShadowColor,t.stroke(),id(t,0,g,d),id(t,u,-y,h),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=$E(t,e),{x:r,y:s,x2:a,y2:l}=i,u=yP(i,t.chartArea),d=u?_P({x:r,y:s},{x:a,y:l},t.chartArea):{x:r,y:s,x2:a,y2:l,width:Math.abs(a-r),height:Math.abs(l-s)};if(d.centerX=(a+r)/2,d.centerY=(l+s)/2,d.initProperties=Xr(t,d,e),e.curve){const g={x:d.x,y:d.y},y={x:d.x2,y:d.y2};d.cp=kP(d,e,Ur(g,y))}const h=xP(t,d,e.label);return h._visible=u,d.elements=[{type:"label",optionScope:"label",properties:h,initProperties:d.initProperties}],d}}yo.id="lineAnnotation";const e_={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};yo.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},e_),fill:!1,length:12,start:Object.assign({},e_),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,hitTolerance:0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},go.defaults.callout),color:"#fff",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,hitTolerance:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},yo.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},yo.defaultRoutes={borderColor:"color"};function mP(n,{mouseX:t,mouseY:e},i,{hitSize:r,useFinalPosition:s}){const a=gP(t,e,n.getProps(["x","y","x2","y2"],s),i);return Sy(a,r)||nd(n,{mouseX:t,mouseY:e},s,i)}function yP({x:n,y:t,x2:e,y2:i},{top:r,right:s,bottom:a,left:l}){return!(n<l&&e<l||n>s&&e>s||t<r&&i<r||t>a&&i>a)}function n_({x:n,y:t},e,{top:i,right:r,bottom:s,left:a}){return n<a&&(t=Zy(a,{x:n,y:t},e),n=a),n>r&&(t=Zy(r,{x:n,y:t},e),n=r),t<i&&(n=td(i,{x:n,y:t},e),t=i),t>s&&(n=td(s,{x:n,y:t},e),t=s),{x:n,y:t}}function _P(n,t,e){const{x:i,y:r}=n_(n,t,e),{x:s,y:a}=n_(t,n,e);return{x:i,y:r,x2:s,y2:a,width:Math.abs(s-i),height:Math.abs(a-r)}}function bP(n,{mouseX:t,mouseY:e},i=mr,r){const{x:s,y:a,x2:l,y2:u}=n.getProps(["x","y","x2","y2"],r),d=l-s,h=u-a,g=mo(d)+mo(h),y=g===0?-1:((t-s)*d+(e-a)*h)/g;let _,x;return y<0?(_=s,x=a):y>1?(_=l,x=u):(_=s+y*d,x=a+y*h),mo(t-_)+mo(e-x)<=i}function nd(n,{mouseX:t,mouseY:e},i,r){const s=n.label;return s.options.display&&s.inRange(t,e,r,i)}function xP(n,t,e){const i=e.borderWidth,r=we(e.padding),s=rl(n.ctx,e),a=s.width+r.width+i,l=s.height+r.height+i;return vP(t,e,{width:a,height:l,padding:r},n.chartArea)}function wP(n){const{x:t,y:e,x2:i,y2:r}=n,s=Math.atan2(r-e,i-t);return s>Rt/2?s-Rt:s<Rt/-2?s+Rt:s}function vP(n,t,e,i){const{width:r,height:s,padding:a}=e,{xAdjust:l,yAdjust:u}=t,d={x:n.x,y:n.y},h={x:n.x2,y:n.y2},g=t.rotation==="auto"?wP(n):xe(t.rotation),y=SP(r,s,g),_=TP(n,t,{labelSize:y,padding:a},i),x=n.cp?ed(d,n.cp,h,_):Ju(d,h,_),v={size:y.w,min:i.left,max:i.right,padding:a.left},M={size:y.h,min:i.top,max:i.bottom,padding:a.top},C=r_(x.x,v)+l,R=r_(x.y,M)+u;return{x:C-r/2,y:R-s/2,x2:C+r/2,y2:R+s/2,centerX:C,centerY:R,pointX:x.x,pointY:x.y,width:r,height:s,rotation:xa(g)}}function SP(n,t,e){const i=Math.cos(e),r=Math.sin(e);return{w:Math.abs(n*i)+Math.abs(t*r),h:Math.abs(n*r)+Math.abs(t*i)}}function TP(n,t,e,i){let r;const s=MP(n,i);return t.position==="start"?r=i_({w:n.x2-n.x,h:n.y2-n.y},e,t,s):t.position==="end"?r=1-i_({w:n.x-n.x2,h:n.y-n.y2},e,t,s):r=ju(1,t.position),r}function i_(n,t,e,i){const{labelSize:r,padding:s}=t,a=n.w*i.dx,l=n.h*i.dy,u=a>0&&(r.w/2+s.left-i.x)/a,d=l>0&&(r.h/2+s.top-i.y)/l;return el(Math.max(u,d),0,.25)}function MP(n,t){const{x:e,x2:i,y:r,y2:s}=n,a=Math.min(r,s)-t.top,l=Math.min(e,i)-t.left,u=t.bottom-Math.max(r,s),d=t.right-Math.max(e,i);return{x:Math.min(l,d),y:Math.min(a,u),dx:l<=d?1:-1,dy:a<=u?1:-1}}function r_(n,t){const{size:e,min:i,max:r,padding:s}=t,a=e/2;return e>r-i?(r+i)/2:(i>=n-s-a&&(n=i+s+a),r<=n+s+a&&(n=r-s-a),n)}function s_(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:o_(n,e),endAdjust:o_(n,i)}}function o_(n,t){if(!t||!t.display)return 0;const{length:e,width:i}=t,r=n.options.borderWidth/2,s={x:e,y:i+r};return Math.abs(td(0,s,{x:0,y:r}))}function id(n,t,e,i){if(!i||!i.display)return;const{length:r,width:s,fill:a,backgroundColor:l,borderColor:u}=i,d=Math.abs(t-r)+e;n.beginPath(),Zr(n,i),li(n,i),n.moveTo(d,-s),n.lineTo(t+e,0),n.lineTo(d,s),a===!0?(n.fillStyle=l||u,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=i.borderShadowColor,n.stroke()}function kP(n,t,e){const{x:i,y:r,x2:s,y2:a,centerX:l,centerY:u}=n,d=Math.atan2(a-r,s-i),h=Gu(t.controlPoint,0),g={x:l+Li(e,h.x,!1),y:u+Li(e,h.y,!1)};return gr(g,{x:l,y:u},d)}function a_(n,{x:t,y:e},{angle:i,adjust:r},s){!s||!s.display||(n.save(),n.translate(t,e),n.rotate(i),id(n,0,-r,s),n.restore())}function DP(n,t,e,i){const{x:r,y:s,x2:a,y2:l,options:u}=t,{startOpts:d,endOpts:h,startAdjust:g,endAdjust:y}=s_(t),_={x:r,y:s},x={x:a,y:l},v=t_(_,e,x,0),M=t_(_,e,x,1)-Rt,C=ed(_,e,x,g/i),R=ed(_,e,x,1-y/i),F=new Path2D;n.beginPath(),F.moveTo(C.x,C.y),F.quadraticCurveTo(e.x,e.y,R.x,R.y),n.shadowColor=u.borderShadowColor,n.stroke(F),t.path=F,t.ctx=n,a_(n,C,{angle:v,adjust:g},d),a_(n,R,{angle:M,adjust:y},h)}class _o extends Ve{inRange(t,e,i,r){const s=this.options.rotation,a=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return CP({x:t,y:e},this.getProps(["width","height","centerX","centerY"],r),s,a);const{x:l,y:u,x2:d,y2:h}=this.getProps(["x","y","x2","y2"],r),g=i==="y"?{start:u,end:h}:{start:l,end:d},y=gr({x:t,y:e},this.getCenterPoint(r),xe(-s));return y[i]>=g.start-a-mr&&y[i]<=g.end+a+mr}getCenterPoint(t){return yr(this,t)}draw(t){const{width:e,height:i,centerX:r,centerY:s,options:a}=this;t.save(),il(t,this.getCenterPoint(),a.rotation),Zr(t,this.options),t.beginPath(),t.fillStyle=a.backgroundColor;const l=li(t,a);t.ellipse(r,s,i/2,e/2,Rt/2,0,2*Rt),t.fill(),l&&(t.shadowColor=a.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Vy(t,e)}}_o.id="ellipseAnnotation",_o.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},Jr.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},_o.defaultRoutes={borderColor:"color",backgroundColor:"color"},_o.descriptors={label:{_fallback:!0}};function CP(n,t,e,i){const{width:r,height:s,centerX:a,centerY:l}=t,u=r/2,d=s/2;if(u<=0||d<=0)return!1;const h=xe(e||0),g=Math.cos(h),y=Math.sin(h),_=Math.pow(g*(n.x-a)+y*(n.y-l),2),x=Math.pow(y*(n.x-a)-g*(n.y-l),2);return _/Math.pow(u+i,2)+x/Math.pow(d+i,2)<=1.0001}class al extends Ve{inRange(t,e,i,r){const{x:s,y:a,x2:l,y2:u,width:d}=this.getProps(["x","y","x2","y2","width"],r),h=(this.options.borderWidth+this.options.hitTolerance)/2;return i!=="x"&&i!=="y"?vE({x:t,y:e},this.getCenterPoint(r),d/2,h):Sy(i==="y"?{start:a,end:u,value:e}:{start:s,end:l,value:t},h)}getCenterPoint(t){return yr(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,Zr(t,e);const r=li(t,e);AE(t,this,this.centerX,this.centerY),r&&!nl(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=Wy(t,e);return i.initProperties=Xr(t,i,e),i}}al.id="pointAnnotation",al.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,pointStyle:"circle",radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},al.defaultRoutes={borderColor:"color",backgroundColor:"color"};class ll extends Ve{inRange(t,e,i,r){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&AP(this.elements,t,e,r);const s=gr({x:t,y:e},this.getCenterPoint(r),xe(-this.options.rotation)),a=this.elements.map(d=>i==="y"?d.bY:d.bX),l=Math.min(...a),u=Math.max(...a);return s[i]>=l&&s[i]<=u}getCenterPoint(t){return yr(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Zr(t,i);const r=li(t,i);let s=!0;for(const a of e)s?(t.moveTo(a.x,a.y),s=!1):t.lineTo(a.x,a.y);t.closePath(),t.fill(),r&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){const i=Wy(t,e),{sides:r,rotation:s}=e,a=[],l=2*Rt/r;let u=s*Yc;for(let d=0;d<r;d++,u+=l){const h=OP(i,e,u);h.initProperties=Xr(t,i,e),a.push(h)}return i.elements=a,i}}ll.id="polygonAnnotation",ll.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,point:{radius:0},radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,sides:3,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},ll.defaultRoutes={borderColor:"color",backgroundColor:"color"};function OP({centerX:n,centerY:t},{radius:e,borderWidth:i,hitTolerance:r},s){const a=(i+r)/2,l=Math.sin(s),u=Math.cos(s),d={x:n+l*e,y:t-u*e};return{type:"point",optionScope:"point",properties:{x:d.x,y:d.y,centerX:d.x,centerY:d.y,bX:n+l*(e+a),bY:t-u*(e+a)}}}function AP(n,t,e,i){let r=!1,s=n[n.length-1].getProps(["bX","bY"],i);for(const a of n){const l=a.getProps(["bX","bY"],i);l.bY>e!=s.bY>e&&t<(s.bX-l.bX)*(e-l.bY)/(s.bY-l.bY)+l.bX&&(r=!r),s=l}return r}const Ni={box:Jr,doughnutLabel:ol,ellipse:_o,label:go,line:yo,point:al,polygon:ll};Object.keys(Ni).forEach(n=>{se.describe(`elements.${Ni[n].id}`,{_fallback:"plugins.annotation.common"})});const RP={update:Object.assign},EP=Qu.concat(sl),l_=(n,t)=>Pt(t)?od(n,t):n,rd=n=>n==="color"||n==="font";function sd(n="line"){return Ni[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function PP(n,t,e,i){const r=LP(n,e.animations,i),s=t.annotations,a=FP(t.elements,s);for(let l=0;l<s.length;l++){const u=s[l],d=c_(a,l,u.type),h=u.setContext(BP(n,d,a,u)),g=d.resolveElementProperties(n,h);g.skip=IP(g),"elements"in g&&(NP(d,g.elements,h,r),delete g.elements),en(d.x)||Object.assign(d,g),Object.assign(d,g.initProperties),g.options=u_(h),r.update(d,g)}}function IP(n){return isNaN(n.x)||isNaN(n.y)}function LP(n,t,e){return e==="reset"||e==="none"||e==="resize"?RP:new su(n,t)}function NP(n,t,e,i){const r=n.elements||(n.elements=[]);r.length=t.length;for(let s=0;s<t.length;s++){const a=t[s],l=a.properties,u=c_(r,s,a.type,a.initProperties),d=e[a.optionScope].override(a);l.options=u_(d),i.update(u,l)}}function c_(n,t,e,i){const r=Ni[sd(e)];let s=n[t];return(!s||!(s instanceof r))&&(s=n[t]=new r,Object.assign(s,i)),s}function u_(n){const t=Ni[sd(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,od(n,t.defaults),od(n,t.defaultRoutes));for(const i of EP)e[i]=n[i];return e}function od(n,t){const e={};for(const i of Object.keys(t)){const r=t[i],s=n[i];rd(i)&&Yt(s)?e[i]=s.map(a=>l_(a,r)):e[i]=l_(s,r)}return e}function BP(n,t,e,i){return t.$context||(t.$context=Object.assign(Object.create(n.getContext()),{element:t,get elements(){return e.filter(r=>r&&r.options)},id:i.id,type:"annotation"}))}function FP(n,t){const e=t.length,i=n.length;if(i<e){const r=e-i;n.splice(i,0,...new Array(r))}else i>e&&n.splice(e,i-e);return n}var zP="3.1.0";const Bi=new Map,d_=n=>n.type!=="doughnutLabel",UP=Qu.concat(sl);var f_={id:"annotation",version:zP,beforeRegister(){SE("chart.js","4.0",rn.version)},afterRegister(){rn.register(Ni)},afterUnregister(){rn.unregister(Ni)},beforeInit(n){Bi.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=Bi.get(n),r=i.annotations=[];let s=e.annotations;Pt(s)?Object.keys(s).forEach(a=>{const l=s[a];Pt(l)&&(l.id=a,r.push(l))}):Yt(s)&&r.push(...s),iP(r.filter(d_),n.scales)},afterDataLimits(n,t){const e=Bi.get(n);nP(n,t.scale,e.annotations.filter(d_).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=Bi.get(n);ZE(n,i,e),PP(n,i,e,t.mode),i.visibleElements=i.elements.filter(r=>!r.skip&&r.options.display),eP(n,i,e)},beforeDatasetsDraw(n,t,e){bo(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){bo(n,"afterDatasetsDraw",e.clip)},beforeDatasetDraw(n,t,e){bo(n,t.index,e.clip)},beforeDraw(n,t,e){bo(n,"beforeDraw",e.clip)},afterDraw(n,t,e){bo(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const i=Bi.get(n);QE(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){Bi.delete(n)},getAnnotations(n){const t=Bi.get(n);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(n,t,e){return qu(n,t,e)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"},colors:{properties:["backgroundColor","borderColor"],type:"color"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:n=>!UP.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${Ni[sd(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:rd,_fallback:!0},_indexable:rd}},additionalOptionScopes:[""]};function bo(n,t,e){const{ctx:i,chartArea:r}=n,s=Bi.get(n);e&&qs(i,r);const a=HP(s.visibleElements,t).sort((l,u)=>l.element.options.z-u.element.options.z);for(const l of a)WP(i,r,s,l);e&&js(i)}function HP(n,t){const e=[];for(const i of n)if(i.options.drawTime===t&&e.push({element:i,main:!0}),i.elements&&i.elements.length)for(const r of i.elements)r.options.display&&r.options.drawTime===t&&e.push({element:r});return e}function WP(n,t,e,i){const r=i.element;i.main?(Gy(e,r,"beforeDraw"),r.draw(n,t),Gy(e,r,"afterDraw")):r.draw(n,t)}const VP={class:"zoom-timerange-container"},$P={class:"zoom-timerange-details"},YP={class:"label","data-testid":"zoom-timerange-from"},qP={class:"label","data-testid":"zoom-timerange-to"},jP=p.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{},granularity:{}},setup(n){const t=n,{i18n:e}=kt.useI18n(),i=p.ref(fo({tickValue:t.start,granularity:t.granularity})),r=p.ref(fo({tickValue:t.end,granularity:t.granularity})),s=(a,l)=>{Qm(()=>{i.value=fo({tickValue:a,granularity:t.granularity}),r.value=fo({tickValue:l,granularity:t.granularity})},100)()};return p.watch(()=>[t.start,t.end],([a,l])=>{s(a,l)},{immediate:!0}),(a,l)=>(p.openBlock(),p.createElementBlock("div",VP,[p.createElementVNode("div",$P,[p.createElementVNode("div",YP,p.toDisplayString(p.unref(e).t("zoom_time_range.from")),1),p.createElementVNode("div",null,p.toDisplayString(i.value),1),p.createElementVNode("div",qP,p.toDisplayString(p.unref(e).t("zoom_time_range.to")),1),p.createElementVNode("div",null,p.toDisplayString(r.value),1)])]))}}),an=(n,t)=>{const e=n.__vccOpts||n;for(const[i,r]of t)e[i]=r;return e},h_=an(jP,[["__scopeId","data-v-4fa681cf"]]),GP={class:"zoom-actions-container"},KP={class:"zoom-actions-heading"},XP={class:"zoom-action-select"},ZP=["data-testid"],QP=["aria-disabled","href"],JP=["onClick"],t2=an(p.defineComponent({__name:"ZoomActions",props:{zoomActionItems:{},newTimeRange:{},granularity:{}},emits:["onAction"],setup(n,{emit:t}){const e=n,i=t,r=s=>{s.action&&(s.action(e.newTimeRange),i("onAction"))};return(s,a)=>(p.openBlock(),p.createElementBlock("div",GP,[p.createElementVNode("div",KP,[p.createVNode(h_,{end:n.newTimeRange.end,granularity:n.granularity,start:n.newTimeRange.start},null,8,["end","granularity","start"]),p.createVNode(p.unref(Ss.CloseIcon),{class:"zoom-actions-close-icon",color:`var(--kui-color-text-neutral, ${p.unref(kc)})`,size:`var(--kui-icon-size-30, ${p.unref(Os)})`,onClick:a[0]||(a[0]=l=>s.$emit("onAction"))},null,8,["color","size"])]),a[2]||(a[2]=p.createElementVNode("div",{class:"zoom-actions-heading-divider"},null,-1)),p.createElementVNode("div",XP,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(n.zoomActionItems,l=>(p.openBlock(),p.createElementBlock("div",{key:l.key,class:p.normalizeClass(["zoom-action-item",{disabled:l.disabled}]),"data-testid":`zoom-action-item-${l.key}`},[l.href?(p.openBlock(),p.createElementBlock("a",{key:0,"aria-disabled":l.disabled,class:"zoom-action-link",href:l.href,onClick:a[1]||(a[1]=u=>s.$emit("onAction"))},p.toDisplayString(l.label),9,QP)):(p.openBlock(),p.createElementBlock("div",{key:1,onClick:u=>r(l)},p.toDisplayString(l.label),9,JP))],10,ZP))),128))])]))}}),[["__scopeId","data-v-79ba72f8"]]),e2={key:2},n2={class:"tooltip-title"},i2={class:"title"},r2={key:0,class:"subtitle"},s2={class:"context"},o2={class:"metric"},a2={class:"tooltip"},l2={key:0},c2={class:"display-value"},xo=an(p.defineComponent({__name:"ChartTooltip",props:{state:{},tooltipTitle:{default:""},absoluteLeft:{default:"0px"},absoluteTop:{default:"0px"},zoomTimeRange:{default:void 0},zoomActionItems:{default:void 0},granularity:{default:void 0}},emits:["dimensions","onAction"],setup(n,{emit:t}){const e=t,i=n,r=p.ref(null),{x:s,y:a,isDragging:l}=nR(r,{initialValue:{x:parseFloat(i.absoluteLeft),y:parseFloat(i.absoluteTop)}}),u=p.computed(()=>`${a.value}px`),d=p.computed(()=>`${s.value}px`),h=p.computed(()=>i.state.tooltipContext),g=p.computed(()=>i.state.metricDisplay),y=p.computed(()=>["interactive","zoom-interactive"].includes(i.state.interactionMode));return p.watch(()=>[i.absoluteLeft,i.absoluteTop],([_,x])=>{l.value||(s.value=parseFloat(_),a.value=parseFloat(x))}),p.watch(l,_=>{_?document.body.classList.add("no-select"):document.body.classList.remove("no-select")}),p.watch(r,_=>{if(_){const{width:x,height:v}=_.getBoundingClientRect();e("dimensions",{width:x,height:v})}}),(_,x)=>n.state.showTooltip?(p.openBlock(),p.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:r,class:p.normalizeClass(["tooltip-container",{locked:n.state.interactionMode==="interactive"}]),style:p.normalizeStyle({transform:y.value?`translate(${d.value}, ${u.value})`:`translate(${n.absoluteLeft}, ${n.absoluteTop})`,left:"0",top:"0",pointerEvents:y.value?"all":"none"})},[n.state.interactionMode==="selecting-chart-area"&&n.granularity&&n.zoomTimeRange&&n.zoomTimeRange.end&&n.zoomTimeRange.start?(p.openBlock(),p.createBlock(h_,{key:0,end:n.zoomTimeRange?.end,granularity:n.granularity,start:n.zoomTimeRange?.start},null,8,["end","granularity","start"])):n.state.interactionMode==="zoom-interactive"&&n.zoomTimeRange&&n.zoomActionItems&&n.granularity?(p.openBlock(),p.createBlock(t2,{key:1,granularity:n.granularity,"new-time-range":n.zoomTimeRange,"zoom-action-items":n.zoomActionItems,onOnAction:x[0]||(x[0]=v=>e("onAction"))},null,8,["granularity","new-time-range","zoom-action-items"])):(p.openBlock(),p.createElementBlock("div",e2,[p.createElementVNode("div",n2,[p.createElementVNode("div",i2,[p.createElementVNode("div",null,p.toDisplayString(n.tooltipTitle),1),y.value?(p.openBlock(),p.createBlock(p.unref(Ss.DragIcon),{key:0,class:"drag-icon",color:`var(--kui-color-text-neutral, ${p.unref(kc)})`,size:`var(--kui-icon-size-30, ${p.unref(Os)})`},null,8,["color","size"])):p.createCommentVNode("",!0)]),h.value||g.value?(p.openBlock(),p.createElementBlock("div",r2,[p.createElementVNode("div",s2,p.toDisplayString(h.value),1),p.createElementVNode("div",o2,p.toDisplayString(g.value),1)])):p.createCommentVNode("",!0)]),p.createElementVNode("ul",a2,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(n.state.tooltipSeries,({backgroundColor:v,borderColor:M,label:C,value:R,isSegmentEmpty:F},I)=>(p.openBlock(),p.createElementBlock(p.Fragment,{key:C+I},[n.state.tooltipSeries.length?(p.openBlock(),p.createElementBlock("li",l2,[p.createElementVNode("div",{class:"square-marker",style:p.normalizeStyle({background:String(v),borderColor:String(M)})},null,4),p.createElementVNode("span",{class:p.normalizeClass(["display-label",{empty:F}])},p.toDisplayString(C),3),p.createElementVNode("span",c2,p.toDisplayString(R),1)])):p.createCommentVNode("",!0)],64))),128))])]))],6)):p.createCommentVNode("",!0)}}),[["__scopeId","data-v-34c60646"]]),u2={key:0,class:"legend-container","data-testid":"legend"},d2=["onClick"],f2=["title"],h2={class:"label truncate-label"},p2={key:0,class:"sub-label"},g2={class:"tooltip-content"},cl=an(p.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){const t=n,{i18n:e}=kt.useI18n(),i=p.inject("showLegendValues",!1),r=p.inject("legendPosition",p.ref(Pe.Bottom)),s=(l=0,u)=>{if(t.chartInstance===null)return;const d=t.chartInstance instanceof rn?t.chartInstance:t.chartInstance.chart,h=a(l,u);!d.getDatasetMeta(l).dataset&&u!==void 0?d.toggleDataVisibility(u):h?d.hide(l,u):d.show(l,u),d.update()},a=(l=0,u)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const d=t.chartInstance instanceof rn?t.chartInstance:t.chartInstance.chart;return d.getDatasetMeta(l).dataset||u===void 0?d.isDatasetVisible(l):d.getDataVisibility(u)};return(l,u)=>{const d=p.resolveComponent("KTooltip");return p.unref(r)!==p.unref(Pe).Hidden?(p.openBlock(),p.createElementBlock("ul",u2,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(n.items,({fillStyle:h,strokeStyle:g,text:y,datasetIndex:_,index:x,value:v,isSegmentEmpty:M})=>(p.openBlock(),p.createElementBlock("li",{key:y,onClick:C=>s(_,x)},[p.createElementVNode("div",{class:"square-marker",style:p.normalizeStyle({background:h,"border-color":g})},null,4),p.createVNode(d,null,p.createSlots({default:p.withCtx(()=>[p.createElementVNode("div",{class:p.normalizeClass(["label-container",{"strike-through":!a(_,x)}]),title:v&&p.unref(i)?`${y}: ${v.formatted}`:y},[p.createElementVNode("div",h2,p.toDisplayString(y),1),v&&p.unref(i)?(p.openBlock(),p.createElementBlock("div",p2,p.toDisplayString(v.formatted),1)):p.createCommentVNode("",!0)],10,f2)]),_:2},[M?{name:"content",fn:p.withCtx(()=>[p.createElementVNode("div",g2,p.toDisplayString(p.unref(e).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],8,d2))),128))])):p.createCommentVNode("",!0)}}}),[["__scopeId","data-v-388cf4f5"]]),Ie=[];for(let n=0;n<256;++n)Ie.push((n+256).toString(16).slice(1));function m2(n,t=0){return(Ie[n[t+0]]+Ie[n[t+1]]+Ie[n[t+2]]+Ie[n[t+3]]+"-"+Ie[n[t+4]]+Ie[n[t+5]]+"-"+Ie[n[t+6]]+Ie[n[t+7]]+"-"+Ie[n[t+8]]+Ie[n[t+9]]+"-"+Ie[n[t+10]]+Ie[n[t+11]]+Ie[n[t+12]]+Ie[n[t+13]]+Ie[n[t+14]]+Ie[n[t+15]]).toLowerCase()}const y2=new Uint8Array(16);function _2(){return crypto.getRandomValues(y2)}function ad(n,t,e){return crypto.randomUUID?crypto.randomUUID():b2(n)}function b2(n,t,e){n=n||{};const i=n.random??n.rng?.()??_2();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,m2(i)}const p_=(n,t)=>{const e=n.ctx,i=n.scales.y,r=n.scales.x,s=t[t.length-1].element;e.save(),e.strokeStyle="rgba(100, 100, 100, 1)",e.lineWidth=3,n.options.indexAxis==="x"?e.strokeRect(s.x-s.width/2,s.y,s.width,i.bottom-s.y):e.strokeRect(r.left,s.y-s.height/2,s.x-r.left,s.height),e.restore()};class g_{id="highlightPlugin";_clickedElements;_previousHoverOption;_clicked=!1;_pause=!1;_suppressNextClick=!1;afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&p_(t,this._clickedElements)}afterEvent(t,{event:e}){if(e.type==="click"&&this._suppressNextClick){this._suppressNextClick=!1;return}if(e.type!=="click"||!e.native||this._pause)return;this._clicked=!this._clicked;const i=t.options.interaction?.mode||"index",r=t.getElementsAtEventForMode(e.native,i,{intersect:!1},!0);r.length&&this._clicked?(this._clickedElements=r,p_(t,this._clickedElements),this._previousHoverOption=t.options.hover,t.options.hover={mode:null}):(delete this._clickedElements,t.options.hover=this._previousHoverOption||t.options.hover,this._clicked=!1)}beforeDestroy(t){delete this._clickedElements,t.options.hover=this._previousHoverOption||t.options.hover,this._clicked=!1}pause(){this._pause=!0}get isPaused(){return this._pause}resume(t=!1){this._pause=!1,t&&(this._suppressNextClick=!0)}}const x2=["id"],w2=["id"],v2={class:"axis-tooltip-content"},S2="100%",T2="100%",M2=20,k2=20,m_=6,D2=0,C2=10,O2=10,A2=1,R2=an(p.defineComponent({__name:"StackedBarChart",props:{chartData:{},tooltipTitle:{default:""},legendValues:{default:void 0},metricUnit:{default:""},orientation:{default:"horizontal"},annotations:{type:Boolean,default:!0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},stacked:{type:Boolean,default:!0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},tooltipMetricDisplay:{default:""}},setup(n){const t=n,{i18n:e}=kt.useI18n(),{translateUnit:i}=kt.useTranslatedUnits(),r=crypto.randomUUID(),s=crypto.randomUUID(),a=new g_,l=p.useTemplateRef("chartContainer"),u=p.useTemplateRef("chartParent"),d=({chart:et},ht)=>{const ft=et.data,ct=ft.labels?.indexOf(ht);return ft.datasets.reduce((mt,ut,Lt)=>{if(et.isDatasetVisible(Lt)){const zt=ut.data[ct];return isNaN(zt)?mt:mt+zt}else return mt},0)},h=(et,ht,ft,ct)=>{const mt=ct==="horizontal";ht===null&&(ht=e.t("entityNoName"));const ut={type:"label",yValue:vt=>mt?ht:d(vt,ht),xValue:vt=>mt?d(vt,ht):ht},Lt={...ut,position:mt?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>mt?0:-Math.abs(TR()),content:vt=>ey(d(vt,ht),ft)},zt={...ut,content:vt=>kR(d(vt,ht),MR(vt.chart,et)),position:mt?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:vt=>mt?SR(ey(d(vt,ht),ft)):0,color:mR};return{[`${ht}-value`]:Lt,[`${ht}-percent`]:zt}},g=p.useTemplateRef("canvas"),y=p.useTemplateRef("axis"),_=ad(),x=ad(),v=p.ref([]),M=p.inject("legendPosition",Pe.Bottom),C=p.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),R=p.toRef(t,"metricUnit"),F=p.computed(()=>t.orientation==="horizontal"),I=p.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:p.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:p.toRef(t,"dimensionAxesTitle"),tooltipSeries:[],left:"",top:"",units:p.toRef(t,"metricUnit"),translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,interactionMode:"idle",chartType:F.value?"horizontal_bar":"vertical_bar",chartID:s,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:L,tooltipAbsoluteTop:N}=kt.useTooltipAbsolutePosition(u,I),B=p.ref(0),T=()=>t.annotations&&t.chartData.labels?.reduce((et,ht)=>Object.assign(et,h(t.chartData,ht,R.value,t.orientation)),{}),S={id:_,afterUpdate(et){B.value+=1,v.value=Cu(et,t.legendValues,t.chartLegendSortFn)}},O={id:x,afterUpdate(et){et.options.plugins.annotation.annotations=t.annotations?T():{}}},$=[S,{id:"axisHover",afterEvent(et,ht){if(C.show=!1,ht.event.type==="mousemove"){const ft=ht.event,ct=et.options.indexAxis,mt=et.scales,ut=et.scales[ct].getLabelForValue(Number(et.scales[ct].getValueForPixel(ft[ct]))),zt=et.scales[ct].getLabels().indexOf(ut),vt=t.chartData.isLabelEmpty?.[zt];if((Dt=>Dt==="x"?ft.y>mt.x.top:ft.x<mt.y.right)(ct)){I.interactionMode!=="interactive"&&(I.showTooltip=!1);const ve=et.canvas.getContext("2d").measureText(ut).width,bt=Math.abs(Math.round(ft.x-ve*.5)),qt=Math.round(ft.x+ve*.5),Oe=et.canvas.getBoundingClientRect(),Ae=40;C.left=ct==="x"?`${(bt>0?bt:qt)-C.offset+Oe.left}px`:`${ft.x-ve*.5-C.offset+Oe.left}px`,C.top=`${ft.y-Ae+Oe.top}px`,ut.length>Xa?(C.show=!0,C.text=ut):vt?(C.text=e.t("emptyEntityInfo"),C.show=!0):C.show=!1}else C.show=!1}}},a,...t.annotations?[O]:[]],it=p.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),at=p.ref(0),ot=p.ref(0),q=new ResizeObserver(Qm(et=>{at.value=et[0].contentRect.width,ot.value=et[0].contentRect.height},100)),J=p.computed(()=>{const et=t.chartData?.labels?.length;return g.value&&et&&!F.value?`${Math.max(et*(M2+m_),at.value)}px`:S2}),rt=p.computed(()=>{const et=t.chartData?.labels?.length;return g.value&&et&&F.value?`${Math.max(et*(k2+m_),ot.value)}px`:T2});kt.useReportChartDataForSynthetics(p.toRef(t,"chartData"),p.toRef(t,"syntheticsDataKey")),p.onMounted(()=>{t.annotations&&rn.register(f_),l.value&&(at.value=l.value.offsetWidth,ot.value=l.value.offsetHeight,q.observe(l.value))}),p.onUnmounted(()=>{l.value&&q.unobserve(l.value)});const tt=p.computed(()=>{const et=kt.useBarChartOptions({tooltipState:I,legendID:_,stacked:p.toRef(t,"stacked"),metricAxesTitle:p.toRef(t,"metricAxesTitle"),dimensionAxesTitle:p.toRef(t,"dimensionAxesTitle"),indexAxis:F.value?"y":"x",numLabels:it});return{...et.value,plugins:{...et.value.plugins,annotation:{annotations:T(),clip:!1}}}}),G=kt.useChartJSCommon("bar",g,p.toRef(t,"chartData"),$,tt);p.onBeforeUnmount(()=>{rn.unregister(f_)});const P={[Pe.Bottom]:"column"},W=p.computed(()=>{if(y.value&&G.value){const et=window.devicePixelRatio,ht=G.value,ft=ht.scales.y.width*et+A2,ct=(ht.scales.y.height+ht.scales.y.top+ht.scales.x.height)*et,mt=y.value.getContext("2d");return mt.scale(et,et),mt.canvas.width=ft,mt.canvas.height=ct,mt.canvas.style.width=`${ft/et}px`,mt.canvas.style.height=`${ct/et}px`,{scale:et,width:ft*et,height:ct*et,targetCtx:mt}}return null}),j=et=>{const ht=et.target;if(W.value&&G.value&&!F.value){const ft=W.value.scale,ct=W.value.targetCtx,mt=W.value.width,ut=W.value.height,Lt=G.value,zt=Lt.canvas;ct.fillStyle="white",ht.scrollLeft>=D2&&ht.scrollLeft<=C2?(ct.globalCompositeOperation="source-over",ct.clearRect(0,0,mt,ut),ct.drawImage(zt,0,0,mt,ut,0,0,mt,ut),ct.globalCompositeOperation="destination-over",ct.fillRect(0,0,mt,ut)):(ct.globalCompositeOperation="source-over",ct.fillRect(0,(Lt.scales.y.height+Lt.scales.y.top+O2)*ft,mt,Lt.scales.x.height*ft))}I.offsetY=ht.scrollTop,I.offsetX=ht.scrollLeft,C.offset=ht.scrollLeft},pt=({width:et,height:ht})=>{I.width=et,I.height=ht};p.watch(()=>t.orientation,()=>{if(y.value&&W.value){const et=W.value.width,ht=W.value.height;(y.value?.getContext("2d")).clearRect(0,0,et,ht)}I.showTooltip=!1,I.interactionMode="idle"}),p.watch(()=>t.annotations,et=>{G.value&&(et?G.value.options.plugins.annotation.annotations=T(t.chartData):delete G.value.options.plugins.annotation.annotations)});const lt=()=>{I.showTooltip&&(I.interactionMode!=="idle"?I.interactionMode="idle":I.interactionMode="interactive")};return(et,ht)=>(p.openBlock(),p.createElementBlock("div",{ref:"chartParent",class:p.normalizeClass(["chart-parent",P[p.unref(M)]])},[p.createElementVNode("canvas",{id:p.unref(r),ref:"axis",class:"axis"},null,8,x2),p.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:ht[0]||(ht[0]=ft=>lt()),onScroll:j},[p.createElementVNode("div",{class:"chart-body",style:p.normalizeStyle({width:J.value,height:rt.value})},[p.createElementVNode("canvas",{id:p.unref(s),ref:"canvas",class:"chart-canvas"},null,8,w2)],4)],544),(p.openBlock(),p.createBlock(p.Teleport,{to:"body"},[C.show?(p.openBlock(),p.createElementBlock("div",{key:0,class:"axis-tooltip",style:p.normalizeStyle({top:C.top,left:C.left}),width:"auto"},[p.createElementVNode("div",v2,p.toDisplayString(C.text),1)],4)):p.createCommentVNode("",!0),p.createVNode(xo,{"absolute-left":p.unref(L),"absolute-top":p.unref(N),"chart-parent-ref":u.value,state:I,"tooltip-title":n.tooltipTitle,onDimensions:pt},null,8,["absolute-left","absolute-top","chart-parent-ref","state","tooltip-title"])])),p.createVNode(cl,{id:p.unref(_),"chart-instance":p.unref(G),items:v.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-60e5a1a7"]]);const E2={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};Dg._date.override({_id:"date-fns",formats:function(){return E2},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=At(n):e==="string"&&(typeof t=="string"?n=BT(n,t,new Date,this.options):n=yp(n,this.options)),Ac(n)?n.getTime():null},format:function(n,t){return ua(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return Cc(n,t);case"second":return E1(n,t);case"minute":return A1(n,t);case"hour":return D1(n,t);case"day":return la(n,t);case"week":return P1(n,t);case"month":return Dc(n,t);case"quarter":return R1(n,t);case"year":return I1(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return Rc(n,t);case"second":return W1(n,t);case"minute":return z1(n,t);case"hour":return F1(n,t);case"day":return Kh(n,t);case"week":return V1(n,t);case"month":return Jh(n,t);case"quarter":return H1(n,t);case"year":return $1(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return HT(n);case"minute":return UT(n);case"hour":return zT(n);case"day":return Oc(n);case"week":return Wn(n);case"isoWeek":return Wn(n,{weekStartsOn:+e});case"month":return q1(n);case"quarter":return Y1(n);case"year":return tp(n);default:return n}},endOf:function(n,t){switch(t){case"second":return Q1(n);case"minute":return X1(n);case"hour":return G1(n);case"day":return Zh(n);case"week":return K1(n);case"month":return Qh(n);case"quarter":return Z1(n);case"year":return j1(n);default:return n}}});const y_={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},P2={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...y_,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},I2=p.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function ts(n){return p.isProxy(n)?p.toRaw(n):n}function L2(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return p.isProxy(t)?new Proxy(n,{}):n}function N2(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function __(n,t){n.labels=t}function b_(n,t,e){const i=[];n.datasets=t.map(r=>{const s=n.datasets.find(a=>a[e]===r[e]);return!s||!r.data||i.includes(s)?{...r}:(i.push(s),Object.assign(s,r),s)})}function B2(n,t){const e={labels:[],datasets:[]};return __(e,n.labels),b_(e,n.datasets,t),e}const F2=p.defineComponent({props:P2,setup(n,t){let{expose:e,slots:i}=t;const r=p.ref(null),s=p.shallowRef(null);e({chart:s});const a=()=>{if(!r.value)return;const{type:d,data:h,options:g,plugins:y,datasetIdKey:_}=n,x=B2(h,_),v=L2(x,h);s.value=new rn(r.value,{type:d,data:v,options:{...g},plugins:y})},l=()=>{const d=p.toRaw(s.value);d&&(n.destroyDelay>0?setTimeout(()=>{d.destroy(),s.value=null},n.destroyDelay):(d.destroy(),s.value=null))},u=d=>{d.update(n.updateMode)};return p.onMounted(a),p.onUnmounted(l),p.watch([()=>n.options,()=>n.data],(d,h)=>{let[g,y]=d,[_,x]=h;const v=p.toRaw(s.value);if(!v)return;let M=!1;if(g){const C=ts(g),R=ts(_);C&&C!==R&&(N2(v,C),M=!0)}if(y){const C=ts(y.labels),R=ts(x.labels),F=ts(y.datasets),I=ts(x.datasets);C!==R&&(__(v.config.data,C),M=!0),F&&F!==I&&(b_(v.config.data,F,n.datasetIdKey),M=!0)}M&&p.nextTick(()=>{u(v)})},{deep:!0}),()=>p.h("canvas",{role:"img","aria-label":n.ariaLabel,"aria-describedby":n.ariaDescribedby,ref:r},[p.h("p",{},[i.default?i.default():""])])}});function ul(n,t){return rn.register(t),p.defineComponent({props:y_,setup(e,i){let{expose:r}=i;const s=p.shallowRef(null),a=p.shallowRef(null);p.watch(()=>a.value?.chart??null,u=>{s.value=u},{flush:"sync"}),r({chart:s});const l=u=>{a.value=u};return()=>p.h(F2,I2({ref:l},{type:n,...e}))}})}const x_=ul("bar",Sg),w_=ul("doughnut",Xs),v_=ul("line",Tg),z2=ul("scatter",kg),U2={class:"chart-container"},H2={key:0,class:"chart-center-metric"},W2={class:"chart-center-total"},V2={key:0,class:"chart-center-unit"},$2=p.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},metricName:{default:""},legendPosition:{default:Pe.Bottom},legendValues:{default:void 0},syntheticsDataKey:{default:""},datasetColors:{default:()=>ai},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""},showCenterMetric:{type:Boolean,default:!0}},setup(n){const t=n,{translateUnit:e}=kt.useTranslatedUnits(),{i18n:i}=kt.useI18n(),r=crypto.randomUUID(),s=crypto.randomUUID(),a=p.ref([]),l=p.useTemplateRef("chartParent"),u=p.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:p.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:p.toRef(t,"tooltipDimensionDisplay"),tooltipSeries:[],left:"",top:"",units:p.toRef(t,"metricUnit"),translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartID:s,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:d,tooltipAbsoluteTop:h}=kt.useTooltipAbsolutePosition(l,u),g={id:r,afterUpdate(B){a.value=B.options.plugins.legend.labels.generateLabels(B).map(T=>({...T,value:t.legendValues&&t.legendValues[T.text],hidden:!1}))}},y=p.computed(()=>[g]),_=p.computed(()=>[t.chartData.datasets.reduce((T,S)=>(T.labels.push(S.label),T.backgroundColor.push(S.backgroundColor),T.hoverBorderColor.push(Sa(S.backgroundColor).saturate(.5).darken(.15).hexString()),T.data.push(S.data.reduce((O,U)=>O+U,0)),T),{labels:[],backgroundColor:[],borderColor:"#ffffff",borderWidth:1,hoverBorderColor:[],hoverBorderWidth:1,data:[],hoverOffset:10})]),{formatUnit:x}=er({i18n:i}),v=p.computed(()=>cE(t.metricName??"")),M=p.computed(()=>{const B=_.value[0]?.data.reduce((T,S)=>T+S,0)??0;return x(B,t.metricUnit,{approximate:!0,translateUnit:(T,S)=>e(T,S)}).trim()}),C=p.computed(()=>t.tooltipMetricDisplay||""),R=p.computed(()=>({...t.chartData,datasets:_.value}));kt.useReportChartDataForSynthetics(p.toRef(t,"chartData"),p.toRef(t,"syntheticsDataKey"));const{options:F}=kt.useDonutChartOptions({tooltipState:u,legendID:r}),I=p.ref(),L=B=>({[Pe.Bottom]:"column",[Pe.Hidden]:"hidden"})[B],N=({width:B,height:T})=>{u.width=B,u.height=T};return(B,T)=>(p.openBlock(),p.createElementBlock("div",{ref:"chartParent",class:p.normalizeClass(["chart-parent",L(n.legendPosition)]),"data-testid":"donut-chart-parent"},[p.createElementVNode("div",U2,[p.createVNode(p.unref(w_),{ref_key:"chartInstance",ref:I,"chart-id":p.unref(s),data:R.value,options:p.unref(F),plugins:y.value},null,8,["chart-id","data","options","plugins"]),n.showCenterMetric&&v.value?(p.openBlock(),p.createElementBlock("div",H2,[p.createElementVNode("span",W2,p.toDisplayString(M.value),1),C.value?(p.openBlock(),p.createElementBlock("span",V2,p.toDisplayString(C.value),1)):p.createCommentVNode("",!0)])):p.createCommentVNode("",!0),(p.openBlock(),p.createBlock(p.Teleport,{to:"body"},[p.createVNode(xo,{"absolute-left":p.unref(d),"absolute-top":p.unref(h),state:u,"tooltip-title":n.tooltipTitle,unit:n.metricUnit,onDimensions:N},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),p.createVNode(cl,{id:p.unref(r),"chart-instance":I.value,items:a.value,position:n.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),Y2=an($2,[["__scopeId","data-v-48b16272"]]);class q2{id="outlierBandPlugin";beforeDatasetsDraw(t,e,i){const r=i?.value;if(r===void 0||!Number.isFinite(r)||!i?.color)return;const s=t.scales.y;if(!s||!t.chartArea)return;const{top:a,bottom:l,left:u,right:d}=t.chartArea,h=Math.min(Math.max(s.getPixelForValue(r),a),l);if(h<=a)return;const g=t.ctx;g.save(),g.fillStyle=i.color,g.fillRect(u,a,d-u,h-a),g.restore()}}const j2={class:"chart-container"},G2=an(p.defineComponent({__name:"ScatterChart",props:{chartData:{default:void 0},tooltipTitle:{},metricUnit:{default:""},granularity:{},timeRangeMs:{default:void 0},legendValues:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:()=>0},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},tooltipMetricDisplay:{default:""},shadeOutlierRegion:{type:Boolean,default:!1}},setup(n){const t=n,e=p.inject("legendPosition",Pe.Bottom),i=p.inject("app:konnectColorMode",p.computed(()=>"light")),{translateUnit:r}=kt.useTranslatedUnits(),s=p.useTemplateRef("chartParent"),a=new q2,l=crypto.randomUUID(),u=crypto.randomUUID(),d=p.ref(Qa()),h=p.ref(),g=p.ref([]),y=p.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:p.toRef(t,"tooltipMetricDisplay"),tooltipSeries:[],left:"",top:"",units:p.toRef(t,"metricUnit"),translateUnit:r,offsetX:0,offsetY:0,width:0,height:0,chartType:"scatter",chartID:u,chartTooltipSortFn:t.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:_,tooltipAbsoluteTop:x}=kt.useTooltipAbsolutePosition(s,y);kt.useReportChartDataForSynthetics(p.toRef(t,"chartData"),p.toRef(t,"syntheticsDataKey")),p.onMounted(()=>{d.value=Qa(s.value)}),p.watch(i,()=>{d.value=Qa(s.value)});const v=p.computed(()=>{const N=t.legendValues;if(!N)return;const B={};for(const{label:T,total:S}of t.chartData?.datasets||[])S!==void 0&&T&&T in N&&(B[T]=N[T]);return B}),M={id:l,afterUpdate(N){g.value=Cu(N,v.value,t.chartLegendSortFn)}},C=p.computed(()=>t.shadeOutlierRegion?t.chartData?.outlierValue:void 0),R=p.computed(()=>[M,...C.value!==void 0?[a]:[]]),F=p.computed(()=>`scatter-${R.value.map(N=>N.id).join("-")}`),{options:I}=kt.useScatterChartOptions({tooltipState:y,legendID:l,granularity:p.toRef(t,"granularity"),timeRangeMs:p.toRef(t,"timeRangeMs"),metricAxesTitle:p.toRef(t,"metricAxesTitle"),dimensionAxesTitle:p.toRef(t,"dimensionAxesTitle"),outlierValue:C,themeColors:d}),L=N=>({[Pe.Bottom]:"column",[Pe.Hidden]:"hidden"})[N];return(N,B)=>(p.openBlock(),p.createElementBlock("div",{ref:"chartParent",class:p.normalizeClass(["chart-parent",L(p.unref(e))]),"data-testid":"scatter-chart-parent"},[p.createElementVNode("div",j2,[(p.openBlock(),p.createBlock(p.unref(z2),{key:F.value,ref_key:"chartInstance",ref:h,"chart-id":p.unref(u),class:"chart-canvas",data:n.chartData,"data-testid":"scatter-chart",options:p.unref(I),plugins:R.value},null,8,["chart-id","data","options","plugins"]))]),p.createVNode(xo,{"absolute-left":p.unref(_),"absolute-top":p.unref(x),"data-testid":"tooltip",granularity:n.granularity,state:y,"tooltip-title":n.tooltipTitle},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title"]),p.createVNode(cl,{id:p.unref(l),"chart-instance":h.value,"data-testid":"legend",items:g.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-2f7608cd"]]),ld=(n,t,e,i,r="#0275d8")=>{n.save(),n.beginPath(),n.moveTo(t,e),n.lineTo(t,i),n.lineWidth=1,n.strokeStyle=r,n.stroke(),n.restore()},Ze={},K2=()=>{Ze.x=void 0,Ze.chart=void 0,Ze.strategy=void 0,Ze.group=void 0},X2=10;class S_{id="verticalLinePlugin";_clickedSegment;_pause=!1;_useBrushingState=!1;_brushStrategy;_brushGroup;constructor({brushGroup:t=void 0,brushStrategy:e=void 0,enableBrushing:i=!1}={}){let r=!1;e==="group"&&(r=t!==void 0),this._useBrushingState=i&&r,this._brushStrategy=e,this._brushGroup=t}afterEvent(t,e){if(!this._useBrushingState)return;const{event:i}=e;(i.type==="mousemove"||i.type==="mouseout")&&requestAnimationFrame(r=>this.onMouseBrush(i.type,t,r))}_lastMouseBrushEvent=0;onMouseBrush(t,e,i){if(t==="mousemove"&&i-this._lastMouseBrushEvent<X2)return;const r=()=>{Ze.chart=e,Ze.strategy=this._brushStrategy,Ze.group=this._brushGroup;for(const s of Object.values(rn.instances))s!==e&&s.update("none")};t==="mousemove"?e.tooltip&&e.tooltip.getActiveElements()&&e.tooltip.getActiveElements().length&&(Ze.x=e.tooltip.dataPoints[0].element.x,r()):t==="mouseout"&&(Ze.x=void 0,r()),this._lastMouseBrushEvent=i}afterDatasetsDraw(t){if(this.isPaused)return;const e=t.tooltip&&t.tooltip.getActiveElements()&&t.tooltip.getActiveElements().length,i=t.ctx;if(this._clickedSegment){const{x:r}=this._clickedSegment.element;ld(i,r,t.scales.y.top,t.scales.y.bottom)}else if(this._useBrushingState)this.drawByBrush(t);else if(e){const{x:r}=t.tooltip.dataPoints[0].element;ld(i,r,t.scales.y.top,t.scales.y.bottom)}}drawByBrush(t){if(Ze.x===void 0)return;const e=Ze.chart===t?"#0275d8":"rgba(2, 117, 216, 0.3)";this._brushStrategy==="group"&&Ze.group===this._brushGroup&&ld(t.ctx,Ze.x,t.scales.y.top,t.scales.y.bottom,e)}pause(){this._pause=!0}resume(){this._pause=!1}get isPaused(){return this._pause}set clickedSegment(t){this._clickedSegment=t}get clickedSegment(){return this._clickedSegment}destroyClickedSegment(){delete this._clickedSegment}beforeDestroy(t){if(this._clickedSegment&&this.destroyClickedSegment(),this._useBrushingState&&Ze.chart===t){const e=Ze.x!==void 0;if(K2(),e)for(const i of Object.values(rn.instances))i!==t&&i.update("none")}}}const Z2=(n,t,e)=>{const i=n.ctx;i.save(),i.strokeStyle="rgba(95, 154, 255, 1)",i.lineWidth=2,i.beginPath(),i.moveTo(t,n.chartArea.top),i.lineTo(t,n.chartArea.bottom),i.moveTo(e,n.chartArea.top),i.lineTo(e,n.chartArea.bottom),i.stroke(),i.restore()},Q2=(n,t,e)=>{const i=n.ctx;i.save(),i.fillStyle="rgba(143, 193, 255, 0.3)",i.fillRect(t,n.chartArea.top,e-t,n.chartArea.bottom-n.chartArea.top),i.restore()},T_=(n,t)=>{const e=n.scales.x.getValueForPixel(t.startX),i=n.scales.x.getValueForPixel(t.endX);if(!(e===void 0||i===void 0))return{xStart:Math.min(e,i),xEnd:Math.max(e,i)}},M_=(n,t,e)=>{t.canvas.dispatchEvent(new CustomEvent(n,{detail:e}))};class J2{id="dragSelectPlugin";_isDragging=!1;_startX=0;_endX=0;_dragTimeout;_clearSelectionArea=!0;_chart=null;_dragSelectHandlers;get startX(){return this._startX}get endX(){return this._endX}beforeInit(t){this._chart=t;const e=t.canvas;let i=!1;const r=l=>{this._dragTimeout=window.setTimeout(()=>{const u=e.getBoundingClientRect();this._isDragging=!0,this._clearSelectionArea=!1,i=!0,this._startX=l.clientX-u.left,this._endX=this._startX},150)},s=l=>{const u=e.getBoundingClientRect();if(i&&this._isDragging){this._endX=l.clientX-u.left;const d=T_(t,this);d&&M_("dragSelectMove",t,d)}},a=l=>{const u=e.getBoundingClientRect();if(clearTimeout(this._dragTimeout),i&&this._isDragging){this._endX=l.clientX-u.left,i=!1,this._isDragging=!1;const d=T_(t,this);d?M_("dragSelect",t,d):this.clearSelectionArea()}};e.addEventListener("mousedown",r),e.addEventListener("mousemove",s),e.addEventListener("mouseup",a),this._dragSelectHandlers={onMouseDown:r,onMouseMove:s,onMouseUp:a}}beforeDestroy(t){const e=t.canvas;if(this._dragSelectHandlers){const{onMouseDown:i,onMouseMove:r,onMouseUp:s}=this._dragSelectHandlers;e.removeEventListener("mousedown",i),e.removeEventListener("mousemove",r),e.removeEventListener("mouseup",s)}this._isDragging=!1,this._dragTimeout&&clearTimeout(this._dragTimeout)}afterDatasetsDraw(t){(this._isDragging||!this._clearSelectionArea)&&(Q2(t,this._startX,this._endX),Z2(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const tI=20,eI="rgba(255, 171, 171, 0.4)",nI="rgba(255, 196, 0, 0.2)",k_=(n,t,e)=>{const i=t.y-n.y;if(i===0)return t.x;const r=(e-n.y)/i;return n.x+r*(t.x-n.x)},iI=(n,t)=>{const e=[];return n.data.datasets.forEach(i=>{if(!n.getDatasetMeta(n.data.datasets.indexOf(i)).visible)return;const s=i.data;s?.length&&t.filter(a=>a.highlightIntersections).forEach(a=>{const l=s.map(d=>({ts:d.x,aboveThreshold:d.y>=a.value}));let u=l[0].aboveThreshold?s[0].x:void 0;for(let d=1;d<l.length;d++)!l[d-1].aboveThreshold&&l[d].aboveThreshold?u=k_(s[d-1],s[d],a.value):l[d-1].aboveThreshold&&!l[d].aboveThreshold&&u!==void 0&&(e.push({start:u,end:k_(s[d-1],s[d],a.value),type:a.type}),u=void 0);u!==void 0&&e.push({start:u,end:l[l.length-1].ts,type:a.type})})}),e},rI=n=>{if(!n.length)return[];n.sort((e,i)=>e.type.localeCompare(i.type)||e.start-i.start);const t=[];for(const e of n){const i=t.findLast(({type:r})=>r===e.type);i&&e.start<=i.end?i.end=Math.max(i.end,e.end):t.push({...e})}return t};class sI{constructor(t){this.i18n=t}i18n;id="thresholdPlugin";_thresholds;_mouseMoveHandler;_syncThresholds(t){for(const e of Object.keys(t.threshold||{})){const i=t.threshold?.[e];i&&(this._thresholds={...this._thresholds,[e]:i.map(r=>({...r,hovered:!1}))})}if(this._thresholds)for(const e of Object.keys(this._thresholds))t.threshold?.[e]||delete this._thresholds[e]}get thresholds(){return this._thresholds}beforeUpdate(t,e,i){this._syncThresholds(i)}beforeInit(t,e,i){const r=t.canvas;this._syncThresholds(i);const s=a=>{if(t){const l=a.clientY,u=t.scales.y,d=r.getBoundingClientRect(),h=u.getValueForPixel(l-d.top);if(h)for(const g of Object.keys(this._thresholds||{})){const y=this._thresholds?.[g];y&&y.forEach(_=>{_.hovered=Math.abs(_.value-h)<tI})}}};r.addEventListener("mousemove",s),this._mouseMoveHandler=s}afterDatasetsDraw(t,e){const i=t.ctx;for(const r of Object.keys(this._thresholds||{})){const s=this._thresholds?.[r];if(s){s.forEach(u=>{const h=t.scales.y.getPixelForValue(u.value);i.save(),i.beginPath(),i.moveTo(t.chartArea.left,h),i.lineTo(t.chartArea.right,h),i.lineWidth=1,i.strokeStyle=Ru(u.type),i.setLineDash([5,5]),i.stroke(),i.restore();let g="";u.label?g=`${u.label}: ${u.value}`:u.type==="warning"?g=this.i18n.t("chartLabels.threshold-warning",{value:u.value}):u.type==="error"?g=this.i18n.t("chartLabels.threshold-error",{value:u.value}):g=this.i18n.t("chartLabels.thatreshold-neutral",{value:u.value}),u.hovered&&(i.save(),i.fillStyle=Ru(u.type),i.font=sv,i.fillText(g,t.chartArea.left,h-4),i.restore())});const a=iI(t,s);rI(a).forEach(u=>{const d=t.scales.x.getPixelForValue(u.start),h=t.scales.x.getPixelForValue(u.end);i.save(),i.fillStyle=u.type==="error"?eI:nI,i.fillRect(d,t.chartArea.top,h-d,t.chartArea.bottom-t.chartArea.top),i.restore(),i.save(),i.beginPath(),i.moveTo(d,t.chartArea.bottom),i.lineTo(h,t.chartArea.bottom),i.lineWidth=2,i.strokeStyle=Ru(u.type),i.stroke(),i.restore()})}}}beforeDestroy(t){this._mouseMoveHandler&&t.canvas.removeEventListener("mousemove",this._mouseMoveHandler)}}const oI=an(p.defineComponent({__name:"TimeSeriesChart",props:{chartData:{default:void 0},type:{default:"timeseries_line"},fill:{type:Boolean,default:!1},tooltipTitle:{},metricUnit:{default:""},timeRangeMs:{default:void 0},granularity:{},stacked:{type:Boolean,default:!0},legendValues:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},brush:{type:Boolean,default:!1},zoomActionItems:{default:void 0},tooltipMetricDisplay:{default:""},threshold:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=n,i=t,{i18n:r}=kt.useI18n(),s=new S_,a=new g_,l=new J2,u=new sI(r),{translateUnit:d}=kt.useTranslatedUnits(),h=p.ref(),g=crypto.randomUUID(),y=crypto.randomUUID(),_=p.ref([]),x=p.inject("legendPosition",Pe.Bottom),v=p.useTemplateRef("chartParent"),M=p.ref(void 0),C=p.ref(!1),R=p.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:p.toRef(e,"tooltipMetricDisplay"),tooltipSeries:[],left:"",top:"",units:p.toRef(e,"metricUnit"),translateUnit:d,offsetX:0,offsetY:0,width:0,height:0,chartType:e.type,chartID:y,chartTooltipSortFn:e.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:F,tooltipAbsoluteTop:I}=kt.useTooltipAbsolutePosition(v,R),L={id:g,afterUpdate(P){_.value=Cu(P,e.legendValues,e.chartLegendSortFn)}},N=p.computed(()=>[L,a,...e.brush?[l]:[],...e.type==="timeseries_line"?[s]:[],...e.threshold?[u]:[]]),B=p.computed(()=>`line-${N.value.map(P=>P.id).join("-")}`),T=p.computed(()=>`bar-${N.value.map(P=>P.id).join("-")}`),S=p.computed(()=>e.chartData&&hR(e.chartData)),{options:O}=kt.useLineChartOptions({tooltipState:R,timeRangeMs:p.toRef(e,"timeRangeMs"),granularity:p.toRef(e,"granularity"),legendID:g,stacked:p.toRef(e,"stacked"),metricAxesTitle:p.toRef(e,"metricAxesTitle"),dimensionAxesTitle:p.toRef(e,"dimensionAxesTitle"),pointsWithoutHover:S,threshold:p.toRef(e,"threshold")});kt.useReportChartDataForSynthetics(p.toRef(e,"chartData"),p.toRef(e,"syntheticsDataKey"));const U=P=>P?P.end.getTime()>P.start.getTime():!1,$=P=>({[Pe.Bottom]:"column",[Pe.Hidden]:"hidden"})[P],it=({width:P,height:W})=>{R.width=P,R.height=W},at=(P=!0)=>{R.interactionMode="idle",R.showTooltip=!1,l.clearSelectionArea(),a.isPaused&&a.resume(P),s.isPaused&&s.resume()},ot=()=>{R.interactionMode="interactive"},q=()=>{!h.value||!h.value.chart.tooltip?.dataPoints?.length||(R.interactionMode==="interactive"?s.clickedSegment=h.value.chart.tooltip.dataPoints[0]:s.destroyClickedSegment())},J=()=>{if(C.value){C.value=!1;return}R.interactionMode!=="idle"?at():ot(),q()};p.watch(()=>e.type,()=>{R.interactionMode="idle",R.showTooltip=!1,s.destroyClickedSegment()});const rt=P=>{P.preventDefault(),P.stopPropagation();const{xStart:W,xEnd:j}=P.detail,pt={start:new Date(W),end:new Date(j),type:"absolute"};if(!U(pt)){M.value=void 0,at(!1);return}M.value=pt,R.interactionMode="zoom-interactive",pt&&i("select-chart-range",pt)},tt=P=>{R.interactionMode="selecting-chart-area",C.value=!0,s.pause(),a.pause();const{xStart:W,xEnd:j}=P.detail;M.value={start:new Date(W),end:new Date(j),type:"absolute"}},G=P=>{if(!v.value||R.interactionMode==="idle")return;const W=P.target;W&&v.value.contains(W)||C.value||at(!1)};return p.watch(()=>h.value?.chart,()=>{h.value?.chart&&(h.value.chart.canvas.removeEventListener("dragSelect",rt),h.value.chart.canvas.removeEventListener("dragSelectMove",tt),h.value.chart.canvas.addEventListener("dragSelect",rt),h.value.chart.canvas.addEventListener("dragSelectMove",tt))}),p.onMounted(()=>{document.addEventListener("click",G,!0)}),p.onUnmounted(()=>{h.value?.chart&&(h.value.chart.canvas.removeEventListener("dragSelect",rt),h.value.chart.canvas.removeEventListener("dragSelectMove",tt)),document.removeEventListener("click",G,!0)}),(P,W)=>(p.openBlock(),p.createElementBlock("div",{ref:"chartParent",class:p.normalizeClass(["chart-parent",$(p.unref(x))]),"data-testid":"line-chart-parent"},[p.createElementVNode("div",{class:"chart-container",onClick:W[0]||(W[0]=j=>J())},[n.type==="timeseries_line"?(p.openBlock(),p.createBlock(p.unref(v_),{key:B.value,ref_key:"chartInstance",ref:h,"chart-id":p.unref(y),class:"chart-canvas",data:n.chartData,"data-testid":"time-series-line-chart",options:p.unref(O),plugins:N.value},null,8,["chart-id","data","options","plugins"])):n.type==="timeseries_bar"?(p.openBlock(),p.createBlock(p.unref(x_),{key:T.value,ref_key:"chartInstance",ref:h,"chart-id":p.unref(y),class:"chart-canvas",data:n.chartData,"data-testid":"time-series-bar-chart",options:p.unref(O),plugins:N.value},null,8,["chart-id","data","options","plugins"])):p.createCommentVNode("",!0)]),p.createVNode(xo,{"absolute-left":p.unref(F),"absolute-top":p.unref(I),"data-testid":"tooltip",granularity:n.granularity,state:R,"tooltip-title":n.tooltipTitle,"zoom-action-items":n.zoomActionItems,"zoom-time-range":M.value,onDimensions:it,onOnAction:W[1]||(W[1]=()=>at(!1))},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title","zoom-action-items","zoom-time-range"]),p.createVNode(cl,{id:p.unref(g),"chart-instance":h.value,"data-testid":"legend",items:_.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-399f4923"]]),aI={key:0,class:"chart-truncation-warning","data-testid":"truncation-warning"},lI={class:"tooltip-content"},cI={key:2,class:"analytics-chart-parent"},uI=7,dI=p.defineComponent({__name:"AnalyticsChart",props:{chartData:{},chartOptions:{},tooltipTitle:{default:""},emptyStateTitle:{default:""},emptyStateDescription:{default:""},legendPosition:{default:Pe.Bottom},syntheticsDataKey:{default:""},showLegendValues:{type:Boolean,default:!1},showAnnotations:{type:Boolean,default:!0},timeseriesZoom:{type:Boolean,default:!1},requestsLink:{default:void 0},exploreLink:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=t,i=n,{i18n:r}=kt.useI18n(),s=p.computed(()=>Ja(i.chartData)?void 0:i.chartData),a=p.computed(()=>{if(L.value)return Ja(i.chartData)?i.chartData:wy(i.chartData)}),l=p.computed(()=>{if(Ja(i.chartData)){const{start:P,end:W,metric:j,metricUnit:pt,truncated:lt,limit:et,datasource:ht}=i.chartData;return{start:P,end:W,metricNames:[j],metricUnits:{[j]:pt??""},truncated:lt,limit:et,datasource:ht}}const G=i.chartData?.meta;return{start:G?.start,end:G?.end,metricNames:G?.metric_names,metricUnits:G?.metric_units,truncated:G?.truncated,limit:G?.limit,datasource:G?.datasource}}),u=p.computed(()=>L.value?kt.useScatterDatasets({colorPalette:i.chartOptions.chartDatasetColors,scatter:i.chartOptions.scatter},a).value:s.value?F.value?kt.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Pu},s).value:kt.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Pu},s).value:{datasets:[]}),d=p.computed(()=>i.timeseriesZoom||!!i.exploreLink||!!i.requestsLink),h=p.computed(()=>{if(!i.chartData||s.value&&!s.value.meta)return 0;const{start:G,end:P}=l.value;if(G&&P)return new Date(P).getTime()-new Date(G).getTime()}),g=p.computed(()=>l.value.metricUnits?Object.values(l.value.metricUnits)[0]??"":""),y=p.computed(()=>l.value.metricUnits?Object.keys(l.value.metricUnits)[0]??"":""),_=p.computed(()=>i.showLegendValues&&i.legendPosition!==Pe.Hidden),{legendValues:x}=kt.useChartLegendValues(u,i.chartOptions.type,g),v=p.computed(()=>l.value.limit?.toString()||null),M=p.computed(()=>i.chartOptions.hideTruncationWarning?!1:l.value.truncated||!1),C=p.computed(()=>r.t("limitedResultsShown",{maxReturned:v.value})),R=p.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),F=p.computed(()=>["timeseries_bar","timeseries_line"].some(G=>G===i.chartOptions.type)),I=p.computed(()=>i.chartOptions.type==="donut"),L=p.computed(()=>i.chartOptions.type==="scatter"),N=p.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),B=p.computed(()=>{const{metricNames:G,metricUnits:P}=l.value;if(!G||!P)return;const W=G[0],j=P[W]||"";if(G.length>1){if(W.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${j}`,{plural:"s"})});if(W.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${j}`,{plural:"s"})})}if(W)return ho(j)&&r.te(`metricAxisTitles.${W}`)?r.t(`metricAxisTitles.${W}`)||void 0:r.te(`chartLabels.${W}`)?r.t(`chartLabels.${W}`):W}),T=p.computed(()=>{if(i.chartOptions?.metricAxesTitle)return i.chartOptions?.metricAxesTitle;const{metricNames:G,metricUnits:P}=l.value;if(!G||!P)return;const W=G[0],j=P[W]||"";if(G.length>1){if(W.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${j}`,{plural:"s"})});if(W.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${j}`,{plural:"s"})})}return r.te(`metricAxisTitles.${W}`)&&(ho(j)||r.te(`chartUnits.${j}`))?ho(j)?r.t(`metricAxisTitles.${W}`)||void 0:r.t(`metricAxisTitles.${W}`,{unit:r.t(`chartUnits.${j}`,{plural:"s"})})||void 0:W||void 0}),S=p.computed(()=>{if(i.chartOptions?.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const G=s.value?.meta,P=F.value?"Time":Object.keys(G?.display||G?.metric_names||{})[0];if(P)return r.te(`chartLabels.${P}`)?r.t(`chartLabels.${P}`):P}),O=p.computed(()=>L.value?q.value:na(Number(s.value?.meta?.granularity_ms))),U=p.computed(()=>{if(Yb(l.value.datasource))return r.t("timestampAxisTitles.platform");const G=O.value;if(G)return r.te(`granularityAxisTitles.${G}`)?r.t(`granularityAxisTitles.${G}`):G}),$=p.computed(()=>i.emptyStateTitle||r.t("noDataAvailableTitle")),it=p.computed(()=>i.emptyStateDescription||r.t("noDataAvailableDescription")),at=p.computed(()=>L.value?!!a.value?.points.length:F.value?pR(u.value):!!(s.value&&s.value.meta&&s.value.data.length)),ot=p.computed(()=>{const G=s.value;return G?G.meta.granularity_ms?na(G.meta.granularity_ms)||"hourly":na(new Date(G.data[1].timestamp).getTime()-new Date(G.data[0].timestamp).getTime())||"hourly":"hourly"}),q=p.computed(()=>na(Math.floor((h.value||0)/uI))||"hourly"),J=p.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(G,P)=>G.text===r.t("chartLabels.____OTHER____")?1:P.text===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(G.text,10))&&!isNaN(parseInt(P.text,10))?G.text<P.text?-1:1:G.value&&P.value?P.value.raw-G.value.raw:0),rt=p.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(G,P)=>G.label===r.t("chartLabels.____OTHER____")?1:P.label===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(G.label,10))&&!isNaN(parseInt(P.label,10))?G.label<P.label?-1:1:G.value&&P.value?P.rawValue-G.rawValue:0),tt=p.computed(()=>[...i.timeseriesZoom?[{label:r.t("zoom_action_items.zoom"),key:"zoom-in",action:G=>e("zoom-time-range",G)}]:[],...i.exploreLink?[{label:r.t("zoom_action_items.explore"),key:"explore",href:i.exploreLink.href}]:[],...i.requestsLink?[{label:r.t("zoom_action_items.view_requests"),key:"view-requests",href:i.requestsLink.href}]:[]]);return p.provide("showLegendValues",_),p.provide("legendPosition",p.toRef(i,"legendPosition")),(G,P)=>{const W=p.resolveComponent("KTooltip"),j=p.resolveComponent("KEmptyState");return p.openBlock(),p.createElementBlock("div",{class:p.normalizeClass(["analytics-chart-shell",{"show-values":_.value}])},[at.value&&M.value&&v.value?(p.openBlock(),p.createElementBlock("div",aI,[p.createVNode(W,{class:"tooltip","max-width":"500",placement:"right"},{content:p.withCtx(()=>[p.createElementVNode("div",lI,p.toDisplayString(C.value),1)]),default:p.withCtx(()=>[p.createVNode(p.unref(Ss.WarningIcon),{color:`var(--kui-color-text-warning, ${p.unref(iv)})`,size:`var(--kui-icon-size-40, ${p.unref(ov)})`},null,8,["color","size"])]),_:1})])):p.createCommentVNode("",!0),at.value?(p.openBlock(),p.createElementBlock("div",cI,[F.value?(p.openBlock(),p.createBlock(oI,{key:0,brush:d.value,"chart-data":u.value,"chart-legend-sort-fn":J.value,"chart-tooltip-sort-fn":rt.value,"dimension-axes-title":U.value,fill:n.chartOptions.stacked,granularity:ot.value,"legend-values":p.unref(x),"metric-axes-title":T.value,"metric-unit":g.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,threshold:n.chartOptions.threshold,"time-range-ms":h.value,"tooltip-metric-display":B.value,"tooltip-title":n.tooltipTitle,type:n.chartOptions.type,"zoom-action-items":tt.value,onSelectChartRange:P[0]||(P[0]=pt=>e("select-chart-range",pt)),onZoomTimeRange:P[1]||(P[1]=pt=>e("zoom-time-range",pt))},null,8,["brush","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","fill","granularity","legend-values","metric-axes-title","metric-unit","stacked","synthetics-data-key","threshold","time-range-ms","tooltip-metric-display","tooltip-title","type","zoom-action-items"])):R.value?(p.openBlock(),p.createBlock(R2,{key:1,annotations:n.showAnnotations,"chart-data":u.value,"chart-legend-sort-fn":J.value,"chart-tooltip-sort-fn":rt.value,"data-testid":"bar-chart-container","dimension-axes-title":S.value,"legend-values":p.unref(x),"metric-axes-title":T.value,"metric-unit":g.value,orientation:N.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"tooltip-metric-display":B.value,"tooltip-title":n.tooltipTitle},null,8,["annotations","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","legend-values","metric-axes-title","metric-unit","orientation","stacked","synthetics-data-key","tooltip-metric-display","tooltip-title"])):I.value?(p.openBlock(),p.createBlock(Y2,{key:2,"chart-data":u.value,"dataset-colors":n.chartOptions.chartDatasetColors||p.unref(Pu),"legend-position":n.legendPosition,"legend-values":p.unref(x),"metric-name":y.value,"metric-unit":g.value,"show-center-metric":n.chartOptions.showCenterMetric,"synthetics-data-key":n.syntheticsDataKey,"tooltip-dimension-display":S.value,"tooltip-metric-display":B.value,"tooltip-title":n.tooltipTitle},null,8,["chart-data","dataset-colors","legend-position","legend-values","metric-name","metric-unit","show-center-metric","synthetics-data-key","tooltip-dimension-display","tooltip-metric-display","tooltip-title"])):L.value?(p.openBlock(),p.createBlock(G2,{key:3,"chart-data":u.value,"chart-legend-sort-fn":n.chartOptions.chartLegendSortFn,"chart-tooltip-sort-fn":rt.value,"data-testid":"scatter-chart-container","dimension-axes-title":U.value,granularity:q.value,"legend-values":p.unref(x),"metric-axes-title":T.value,"metric-unit":g.value,"shade-outlier-region":n.chartOptions.scatter?.shadeOutlierRegion,"synthetics-data-key":n.syntheticsDataKey,"time-range-ms":h.value,"tooltip-metric-display":B.value,"tooltip-title":n.tooltipTitle},null,8,["chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","granularity","legend-values","metric-axes-title","metric-unit","shade-outlier-region","synthetics-data-key","time-range-ms","tooltip-metric-display","tooltip-title"])):p.createCommentVNode("",!0)])):(p.openBlock(),p.createBlock(j,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:p.withCtx(()=>[p.createTextVNode(p.toDisplayString($.value),1)]),default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(it.value),1)]),_:1}))],2)}}}),fI=an(dI,[["__scopeId","data-v-ed4ba20b"]]),hI={class:"chart-parent","data-testid":"gauge-chart-parent"},pI={class:"chart-totals-flex"},gI={key:1,class:"metric-small","data-testid":"gauge-chart-total"},mI=an(p.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:"hidden"},numerator:{type:Number,required:!1,default:0},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:ai},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=kt.useI18n(),i=p.ref(ad()),r=p.computed(()=>[t.chartData.datasets.reduce((_,x)=>(_.labels.push(x.label),_.borderColor.push(x.backgroundColor),_.backgroundColor.push(x.backgroundColor),_.data.push(x.data.reduce((v,M)=>v+M,0)),_),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),s=p.computed(()=>({...t.chartData,datasets:r.value}));kt.useReportChartDataForSynthetics(p.toRef(t,"chartData"),p.toRef(t,"syntheticsDataKey"));const a={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},l=p.computed(()=>ao(r?.value[0]?.data[t.numerator],{capital:!0})),u=p.computed(()=>ao(r?.value[0]?.data[0]+r?.value[0]?.data[1],{capital:!0})),d=p.computed(()=>`color: ${r?.value[0]?.backgroundColor[t.numerator]}`),h=p.computed(()=>["full","single"].includes(t.metricDisplay)),g=p.computed(()=>t.metricDisplay==="full");return(y,_)=>(p.openBlock(),p.createElementBlock("div",hI,[p.createElementVNode("div",pI,[h.value?(p.openBlock(),p.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:p.normalizeStyle(d.value)},p.toDisplayString(l.value),5)):p.createCommentVNode("",!0),g.value?(p.openBlock(),p.createElementBlock("div",gI,p.toDisplayString(p.unref(e).t("total"))+": "+p.toDisplayString(u.value),1)):p.createCommentVNode("",!0)]),p.createElementVNode("div",{class:"chart-container",style:p.normalizeStyle({height:n.height,width:n.width})},[p.createVNode(p.unref(w_),{"chart-id":i.value,data:s.value,options:a},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-c461b83f"]]),yI={key:1,class:"single-value-wrapper"},_I={class:"single-value-metric"},bI={class:"name-unit-alignment"},xI={class:"single-value","data-testid":"single-value-chart"},wI={key:0,class:"single-value-unit"},vI={class:"single-value-metric-name"},SI={key:0,class:"single-value-trend"},TI={key:0,class:"single-value-trend-range","data-testid":"single-value-trend-range"},cd="t1",ud="t2",MI=an(p.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:Ym},leftAlign:{type:Boolean,default:!1},showTrend:{type:Boolean,default:!1},increaseIsBad:{type:Boolean,default:!1},alignX:{type:String,default:"space-evenly"}},setup(n){const{i18n:t}=kt.useI18n(),{formatBytes:e,formatCost:i}=er({i18n:t}),r=n,s=p.computed(()=>`align-${r.leftAlign?"left":r.alignX}`),a=p.computed(()=>Qi.buildDeltaMapping(r.data,r.showTrend,{topLevelKey:cd,secondLevelKey:ud})),l=p.computed(()=>a.value?.previous?.[cd]?.[ud]),u=p.computed(()=>a.value?.current?.[cd]?.[ud]),d=p.computed(()=>r.data.data),h=p.computed(()=>r.data.meta?.metric_names?.[0]),g=p.computed(()=>t.te(`chartLabels.${h.value}`)?t.t(`chartLabels.${h.value}`):""),y=p.computed(()=>{const O=h.value?r.data.meta?.metric_units?.[h.value]:void 0;if(O){const U=`chartUnits.${O}`;return t.te(U)?t.t(U,{plural:""}):""}}),_=p.computed(()=>!!h.value&&(h.value.includes("_per_minute")||h.value.includes("_latency_")||h.value==="error_rate")),x=p.computed(()=>r.showTrend&&l.value!==void 0?l.value:null),v=p.computed(()=>{if(r.showTrend)return u.value??null;if(d.value.length<1||!h.value)return null;const O=d.value[0].event[h.value];return typeof O!="number"||isNaN(O)?null:O}),M=p.computed(()=>r.data?.data?.length===void 0||r.data?.data?.length===0||!r.showTrend&&v.value===null||r.showTrend&&x.value===null&&v.value===null),C=p.computed(()=>{const O=v.value;if(O===null)return"-";const U=h.value?r.data.meta?.metric_units?.[h.value]:void 0;if(U==="usd")return i(O);if(U==="bytes")return e(O);if(O>=1e9){const it=(O/1e9).toFixed(1);return it.endsWith(".0")?`${Math.floor(O/1e9)}B`:`${it}B`}if(O>=1e7){const it=(O/1e6).toFixed(1);return it.endsWith(".0")?`${Math.floor(O/1e6)}M`:`${it}M`}const $=r.decimalPoints&&typeof r.decimalPoints=="number"?r.decimalPoints:Ym;return O.toLocaleString("en-US",{maximumFractionDigits:$})}),R=p.computed(()=>r.showTrend&&r.data?.data?.length<2),F=p.computed(()=>Qi.calculateChange(v.value??0,x.value??0)||0),I=p.computed(()=>{if(!r.showTrend)return 0;if(r.data?.data?.length<2){if(l.value===void 0)return 0;if(u.value===void 0)return r.increaseIsBad?1:-1}return Qi.changePolarity(F.value,!0,r.increaseIsBad)}),L=p.computed(()=>Qi.defineIcon(I.value,r.increaseIsBad)),N=p.computed(()=>{if(r.showTrend&&r.data?.data?.length<2){if(l.value===void 0)return t.t("singleValue.trend.not_available");if(u.value===void 0)return Qi.metricChange(-1,!0,t.t("singleValue.trend.not_available"))}return Qi.metricChange(F.value,r.data?.data?.length===2,t.t("singleValue.trend.not_available"))}),B=Qi.useTrendRange(p.computed(()=>r.showTrend),void 0,p.computed(()=>r.data.meta)),T=O=>O>0?"positive":O<0?"negative":"neutral",S=O=>O>0?nv:O<0?ev:$h;return p.onMounted(()=>{!r.showTrend&&r.data?.data?.length>1?console.warn("SingleValue chart should only be used with a single data point. Data length:",r.data.data.length):r.showTrend&&r.data?.data?.length>2&&console.warn("SingleValue with trend expects 2 or fewer data points. Instead got:",r.data.data.length)}),(O,U)=>{const $=p.resolveComponent("KEmptyState");return p.openBlock(),p.createElementBlock("div",{class:p.normalizeClass(["chart-parent",s.value]),"data-testid":"single-value-parent"},[M.value?(p.openBlock(),p.createBlock($,{key:0,class:"single-value-error","data-testid":"single-value-error","icon-variant":"error",title:p.unref(t).t("singleValue.valueError")},null,8,["title"])):(p.openBlock(),p.createElementBlock("div",yI,[p.createElementVNode("div",_I,[p.createElementVNode("div",bI,[p.createElementVNode("span",xI,p.toDisplayString(C.value),1),_.value&&y.value?(p.openBlock(),p.createElementBlock("span",wI," "+p.toDisplayString(y.value),1)):p.createCommentVNode("",!0)]),p.createElementVNode("div",vI,p.toDisplayString(g.value),1)]),n.showTrend?(p.openBlock(),p.createElementBlock("div",SI,[p.createElementVNode("div",{class:p.normalizeClass(["trend-change",T(I.value)]),"data-testid":"single-value-trend"},[R.value||I.value!==0?(p.openBlock(),p.createBlock(p.resolveDynamicComponent(L.value),{key:0,color:S(I.value),size:`var(--kui-icon-size-30, ${p.unref(Os)})`},null,8,["color","size"])):(p.openBlock(),p.createBlock(p.unref(Ss.EqualIcon),{key:1,color:`var(--kui-color-text-neutral-strong, ${p.unref($h)})`,size:`var(--kui-icon-size-30, ${p.unref(Os)})`},null,8,["color","size"])),p.createElementVNode("div",null,p.toDisplayString(N.value),1)],2),p.unref(B)?(p.openBlock(),p.createElementBlock("div",TI,p.toDisplayString(p.unref(B)),1)):p.createCommentVNode("",!0)])):p.createCommentVNode("",!0)]))],2)}}}),[["__scopeId","data-v-58f32282"]]),kI={class:"simple-chart-shell"},DI={key:1,class:"analytics-chart-parent"},CI=an(p.defineComponent({__name:"SimpleChart",props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},emptyStateTitle:{type:String,required:!1,default:""},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=kt.useI18n(),i=p.computed(()=>{const d=kt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||ai},p.toRef(t,"chartData")).value;return t.chartOptions?.reverseDataset&&d?.datasets.reverse(),d}),r=p.computed(()=>t.chartData.meta?.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""),s=p.computed(()=>t.chartOptions.type==="gauge"),a=p.computed(()=>t.chartOptions.type==="single_value"),l=p.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),u=p.computed(()=>{const d=t.chartData&&t.chartData.meta&&t.chartData.data.length;if(a.value){const h=t.chartData.meta?.metric_names?.[0];return d&&t.chartData.data[0].event[h]!==null}return d});return(d,h)=>{const g=p.resolveComponent("KEmptyState");return p.openBlock(),p.createElementBlock("div",kI,[u.value?(p.openBlock(),p.createElementBlock("div",DI,[s.value?(p.openBlock(),p.createBlock(mI,{key:0,"chart-data":i.value,"dataset-colors":n.chartOptions.chartDatasetColors,"is-simple":"","metric-display":n.chartOptions.metricDisplay,"metric-unit":r.value,numerator:n.chartOptions.numerator,"synthetics-data-key":n.syntheticsDataKey,width:n.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","numerator","synthetics-data-key","width"])):p.createCommentVNode("",!0),a.value?(p.openBlock(),p.createBlock(MI,{key:1,"align-x":n.chartOptions.alignX,data:n.chartData,"decimal-points":n.chartOptions.decimalPoints,"increase-is-bad":n.chartOptions.increaseIsBad,"show-trend":n.chartOptions.showTrend},null,8,["align-x","data","decimal-points","increase-is-bad","show-trend"])):p.createCommentVNode("",!0)])):(p.openBlock(),p.createBlock(g,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(l.value),1)]),_:1}))])}}}),[["__scopeId","data-v-23ca8c84"]]),OI={class:"top-n-card-title","data-testid":"top-n-card-title"},AI={class:"top-n-card-description","data-testid":"top-n-card-description"},RI={key:3,class:"top-n-table","data-testid":"top-n-table"},EI={"data-testid":"top-n-table-header"},PI={class:"top-n-table-header-row"},II={class:"table-header-label"},LI=["data-testid"],NI=["data-testid"],BI=["data-testid"],FI=3,zI=an(p.defineComponent({__name:"TopNTable",props:{title:{default:""},description:{default:""},data:{},emptyStateTitle:{default:""},isLoading:{type:Boolean,default:!1},titleTag:{default:"h2"}},setup(n){const t=n,{i18n:e}=kt.useI18n(),{formatUnit:i}=er({i18n:e}),r=p.computed(()=>t.data.data),s=p.computed(()=>!!r.value?.length),a=p.computed(()=>t.data.meta?.display?Object.keys(t.data.meta.display).slice(0,FI):[]),l=p.computed(()=>a.value[0]||""),u=p.computed(()=>a.value.length>1),d=p.computed(()=>a.value[a.value.length-1]||""),h=p.computed(()=>l.value?t.data.meta.display[l.value]:{}),g=p.computed(()=>t.data.meta?.metric_names?.length?t.data.meta.metric_names:[]),y=p.computed(()=>g.value[0]),_=p.computed(()=>y.value?at(y.value):""),x=p.computed(()=>{const q=a.value.map(J=>({key:J,label:u.value?at(J):e.t("topNTable.nameLabel"),type:"dimension"}));return y.value&&q.push({key:"value",label:_.value,type:"metric"}),g.value.forEach((J,rt)=>{rt!==0&&q.push({key:J,label:at(J),type:"metric"})}),q}),v=p.computed(()=>x.value.filter(q=>q.type==="metric")),M=p.computed(()=>x.value.filter(q=>q.type==="dimension").slice(1)),C=q=>q.type==="dimension"&&q.key===d.value,R=q=>u.value&&q.type==="dimension"&&!C(q),F=q=>{const J=q.event;return String(J[l.value])},I=(q,J)=>{const rt=String(q.event[J]),tt=t.data.meta?.display?.[J]?.[rt];return{dimension:J,id:rt,name:tt?.name||"-",deleted:!!tt?.deleted}},L=q=>{const J=F(q),rt=h.value&&h.value[J];return rt?rt.name:"-"},N=q=>{const J=F(q),rt=h.value&&h.value[J];return rt?!!rt.deleted:!1},B=(q,J)=>{const rt=q.event[J];if(rt==null)return"–";const tt=typeof rt=="number"?rt:Number(rt);if(Number.isNaN(tt))return"–";const G=t.data.meta?.metric_units?.[J]||"count",P=["count","count/minute","token count"].includes(G);return i(tt,G,{approximate:P,isBytes1024:!0,translateUnit:W=>ot(W,tt)})},T=q=>y.value?B(q,y.value):"–",S=p.computed(()=>r.value?.length?r.value.map(q=>{const J=a.value.map(P=>I(q,P)),rt=J[0],tt=rt?.id||F(q),G={id:tt,rowKey:J.map(P=>`${P.dimension}:${P.id}`).join("|")||tt,name:rt?.name||L(q),deleted:N(q),dimensions:J,original:q};return y.value&&(G.value=T(q)),g.value.forEach((P,W)=>{W!==0&&(G[P]=B(q,P))}),G}):[]),O=p.computed(()=>{if(!s.value)return"";if(t.data.meta){if(a.value.some(q=>!Object.keys(t.data.meta.display[q]||{}).length))return e.t("topNTable.errors.display");if(!y.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.meta");return""}),U=(q,J)=>{const rt=q[J];return typeof rt=="string"?rt:rt==null?"–":String(rt)},$=(q,J)=>q.dimensions.find(rt=>rt.dimension===J)?.name||"–",it=(q,J)=>{const rt=q.dimensions.find(tt=>tt.dimension===J);return{id:rt?.id||"",name:rt?.name||"–",deleted:rt?.deleted||!1,dimension:J,dimensions:q.dimensions,isEmpty:rt?.id==="empty"}},at=q=>e.te(`chartLabels.${q}`)?e.t(`chartLabels.${q}`):q,ot=(q,J)=>{if(ho(q)||q==="count"||q==="requests")return"";const rt=J===1?"":"s";return e.te(`chartUnits.${q}`)?e.t(`chartUnits.${q}`,{plural:rt}):q};return(q,J)=>{const rt=p.resolveComponent("KEmptyState"),tt=p.resolveComponent("KSkeleton"),G=p.resolveComponent("KCard");return p.openBlock(),p.createBlock(G,{class:"kong-ui-public-top-n-table","title-tag":n.titleTag},p.createSlots({default:p.withCtx(()=>[O.value?(p.openBlock(),p.createBlock(rt,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(p.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(O.value),1)]),_:1})):n.isLoading?(p.openBlock(),p.createBlock(tt,{key:1,"table-columns":2,type:"table"})):s.value?(p.openBlock(),p.createElementBlock("div",RI,[p.createElementVNode("table",{class:p.normalizeClass(["top-n-table-table",{"top-n-table-table--multi-dimension":u.value}])},[p.createElementVNode("thead",EI,[p.createElementVNode("tr",PI,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(x.value,P=>(p.openBlock(),p.createElementBlock("th",{key:P.key,class:p.normalizeClass(["top-n-table-header-cell",{"top-n-table-header-cell-metric":P.type==="metric","top-n-table-header-cell-dimension-compact":R(P)}]),"data-testid":"top-n-table-header-column"},[p.createElementVNode("span",II,p.toDisplayString(P.label),1)],2))),128))])]),p.createElementVNode("tbody",null,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(S.value,P=>(p.openBlock(),p.createElementBlock("tr",{key:P.rowKey,class:"top-n-table-row"},[a.value.length?(p.openBlock(),p.createElementBlock("td",{key:0,class:p.normalizeClass(["top-n-table-cell top-n-table-cell--name",{"top-n-table-cell-dimension-compact":u.value}])},[p.createElementVNode("span",{"data-testid":`row-${P.id}`},[p.renderSlot(q.$slots,"name",{record:{id:P.id,name:P.name,deleted:P.deleted,dimension:l.value,dimensions:P.dimensions,isEmpty:P.id==="empty"}},()=>[p.createTextVNode(p.toDisplayString(P.name),1)],!0)],8,LI)],2)):p.createCommentVNode("",!0),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(M.value,W=>(p.openBlock(),p.createElementBlock("td",{key:W.key,class:p.normalizeClass(["top-n-table-cell top-n-table-cell--dimension",{"top-n-table-cell-dimension-compact":!C(W)}])},[p.renderSlot(q.$slots,"name",{record:it(P,W.key)},()=>[p.createTextVNode(p.toDisplayString($(P,W.key)),1)],!0)],2))),128)),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(v.value,W=>(p.openBlock(),p.createElementBlock("td",{key:W.key,class:"top-n-table-cell top-n-table-cell-metric"},[W.key==="value"?(p.openBlock(),p.createElementBlock("span",{key:0,"data-testid":`row-${P.id}`},p.toDisplayString(U(P,W.key)),9,NI)):(p.openBlock(),p.createElementBlock("span",{key:1,"data-testid":`row-${P.id}-${W.key}`},p.toDisplayString(U(P,W.key)),9,BI))]))),128))]))),128))])],2)])):(p.openBlock(),p.createBlock(rt,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(n.emptyStateTitle||p.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[n.title?{name:"title",fn:p.withCtx(()=>[p.createElementVNode("span",OI,p.toDisplayString(n.title),1)]),key:"0"}:void 0,n.description?{name:"actions",fn:p.withCtx(()=>[p.createElementVNode("div",AI,p.toDisplayString(n.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-0dc897d6"]]),UI={class:"container"},HI={key:0,class:"no-data","data-testid":"sparkline-empty"},WI=["title"],VI=an(p.defineComponent({__name:"SparklineChart",props:{chartKey:{default:()=>{}},datasets:{},disableTooltip:{type:Boolean,default:!1},enableBrushing:{type:Boolean,default:!1},groupKey:{default:()=>{}},maxCount:{default:()=>{}},maxStamp:{default:()=>{}},minCount:{default:()=>{}},minStamp:{default:()=>{}},pointRenderCount:{default:24},showLabel:{type:Boolean,default:!1},tooltipTitle:{default:()=>{}},type:{default:"sparkline_bar"}},setup(n){const t=crypto.randomUUID(),{i18n:e}=kt.useI18n(),{syncedGroupSizeMs:i,syncedMinStamp:r,syncedMaxStamp:s,syncedMinCount:a,syncedMaxCount:l,syncedRenderPoints:u,syncedChartDatasets:d}=kt.useSparklineSync({chartKey:n.chartKey,datasets:n.datasets,groupKey:n.groupKey,minStamp:n.minStamp,maxStamp:n.maxStamp,minCount:n.minCount,maxCount:n.maxCount,renderPoints:n.pointRenderCount,type:n.type}),h=p.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:"",tooltipSeries:[],left:"",top:"",units:"count",translateUnit:()=>"",offsetX:0,offsetY:0,width:0,height:0,chartType:n.type==="sparkline_bar"?"timeseries_bar":"timeseries_line",chartID:t,interactionMode:"idle"}),g=({width:B,height:T})=>{h.width=B,h.height=T},y=p.computed(()=>n.disableTooltip?[]:[new S_({enableBrushing:n.groupKey!==void 0&&n.chartKey!==void 0&&n.enableBrushing,brushStrategy:"group",brushGroup:n.groupKey})]),_=p.computed(()=>d.value.reduce((B,{data:T,label:S})=>({...B,[S]:T.reduce((O,{y:U})=>O+U,0)}),{})),x=p.computed(()=>d.value.map(({label:B})=>[_.value[B],`${B}: ${_.value[B]}`]).sort(([B],[T])=>T-B).map(([,B])=>B).join(", ")),v=p.computed(()=>Object.keys(_.value).map(B=>_.value[B]).reduce((B,T)=>B+T,0)),M=p.computed(()=>v.value>0),C=p.computed(()=>({labels:new Array(u.value).fill(""),datasets:d.value})),R=p.computed(()=>n.datasets.length>1),F=`SparklineTooltipPosition-${t}`,I=p.computed(()=>{const B=n.type==="sparkline_bar",T=B?r.value-1:r.value,S=B?s.value:s.value-i.value;return{maintainAspectRatio:!1,elements:{categoryPercentage:1,barPercentage:1,line:{tension:0,stepped:n.type==="sparkline_step",borderWidth:1},point:{radius:0,pointHitRadius:11,pointHoverRadius:0}},interaction:{intersect:!1,mode:"index"},layout:{padding:{left:B?0:2,right:B?0:2,top:2}},plugins:{legend:{display:!1},tooltip:{enabled:!1,position:F,external:O=>{Du(h,O,"minutely",{contextFormatter:U=>{const $=U+i.value;let it="";return i.value>1440*60*1e3?it=ua(new Date($),"MMM dd, yyy hh:mm a"):it=ua(new Date($),"hh:mm a"),`${Bw(U)} - ${it}`}})}}},scales:{x:{min:T,max:S,type:"timeseries",offset:!1,grid:{display:!1},display:!1,stacked:R.value},y:{min:Math.max(a.value-1,0),max:l.value,grid:{display:!1},display:!1,stacked:R.value}}}}),L=p.ref("0"),N=p.ref("0");return p.onMounted(()=>{$e.positioners[F]=function(B,T){if(!B.length||h.interactionMode==="interactive"||T.x===null)return!1;const S=10,O=this.chart.canvas.getBoundingClientRect(),U=h.width||this.width,$=h.height||this.height,it=O.top-$>0,at=it?O.top-$-S:O.top+O.height+S,ot=O.left>U/2-T.x,q=Math.max(S,window.innerWidth-S-U),J=Math.min(q,ot?Math.floor(O.left-U/2)+T.x:0+S);return L.value=`${at}px`,N.value=`${J}px`,{x:J,y:at,xAlign:"center",yAlign:it?"top":"bottom"}}}),p.onUnmounted(()=>{$e.positioners[F]&&delete $e.positioners[F]}),(B,T)=>(p.openBlock(),p.createElementBlock("div",UI,[M.value?n.type==="sparkline_bar"?(p.openBlock(),p.createBlock(p.unref(x_),{key:1,"chart-id":p.unref(t),data:C.value,"data-testid":"sparkline-bar",options:I.value,plugins:y.value},null,8,["chart-id","data","options","plugins"])):n.type==="sparkline_line"||n.type==="sparkline_step"?(p.openBlock(),p.createBlock(p.unref(v_),{key:2,"chart-id":p.unref(t),data:C.value,"data-testid":n.type==="sparkline_line"?"sparkline-line":"sparkline-step",options:I.value,plugins:y.value},null,8,["chart-id","data","data-testid","options","plugins"])):p.createCommentVNode("",!0):(p.openBlock(),p.createElementBlock("div",HI,[p.renderSlot(B.$slots,"empty",{},()=>[p.createTextVNode(p.toDisplayString(p.unref(e).t("sparkline_no_data")),1)],!0)])),n.disableTooltip?p.createCommentVNode("",!0):(p.openBlock(),p.createBlock(xo,{key:3,"absolute-left":N.value,"absolute-top":L.value,class:"tooltip","data-testid":"sparkline-tooltip",state:h,"tooltip-title":n.tooltipTitle,onDimensions:g},null,8,["absolute-left","absolute-top","state","tooltip-title"])),M.value&&n.showLabel?(p.openBlock(),p.createElementBlock("div",{key:4,class:"label",title:B.$slots.label?"":x.value},[p.renderSlot(B.$slots,"label",{total:v.value,totalByDataset:_.value},()=>[p.createTextVNode(p.toDisplayString(x.value),1)],!0)],8,WI)):p.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-ae8259b6"]]);var Fi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},wo={exports:{}};var $I=wo.exports,D_;function YI(){return D_||(D_=1,(function(n,t){(function(){var e,i="4.18.1",r=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",l="Invalid `variable` option passed into `_.template`",u="Invalid `imports` option passed into `_.template`",d="__lodash_hash_undefined__",h=500,g="__lodash_placeholder__",y=1,_=2,x=4,v=1,M=2,C=1,R=2,F=4,I=8,L=16,N=32,B=64,T=128,S=256,O=512,U=30,$="...",it=800,at=16,ot=1,q=2,J=3,rt=1/0,tt=9007199254740991,G=17976931348623157e292,P=NaN,W=4294967295,j=W-1,pt=W>>>1,lt=[["ary",T],["bind",C],["bindKey",R],["curry",I],["curryRight",L],["flip",O],["partial",N],["partialRight",B],["rearg",S]],et="[object Arguments]",ht="[object Array]",ft="[object AsyncFunction]",ct="[object Boolean]",mt="[object Date]",ut="[object DOMException]",Lt="[object Error]",zt="[object Function]",vt="[object GeneratorFunction]",Ct="[object Map]",Dt="[object Number]",ve="[object Null]",bt="[object Object]",qt="[object Promise]",Oe="[object Proxy]",Ae="[object RegExp]",oe="[object Set]",ln="[object String]",Vt="[object Symbol]",Le="[object Undefined]",ie="[object WeakMap]",Se="[object WeakSet]",Re="[object ArrayBuffer]",gn="[object DataView]",zi="[object Float32Array]",Dn="[object Float64Array]",Ye="[object Int8Array]",In="[object Int16Array]",ci="[object Int32Array]",vo="[object Uint8Array]",So="[object Uint8ClampedArray]",br="[object Uint16Array]",ui="[object Uint32Array]",To=/\b__p \+= '';/g,Mo=/\b(__p \+=) '' \+/g,ko=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ui=/&(?:amp|lt|gt|quot|#39);/g,hl=/[&<>"']/g,dd=RegExp(Ui.source),fd=RegExp(hl.source),hd=/<%-([\s\S]+?)%>/g,pd=/<%([\s\S]+?)%>/g,Do=/<%=([\s\S]+?)%>/g,pl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,di=/^\w*$/,gd=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Co=/[\\^$.*+?()[\]{}|]/g,md=RegExp(Co.source),Oo=/^\s+/,yd=/\s/,Ln=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,_d=/\{\n\/\* \[wrapped with (.+)\] \*/,bd=/,? & /,xd=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,gl=/[()=,{}\[\]\/\s]/,wd=/\\(\\)?/g,Hi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ml=/\w*$/,vd=/^[-+]0x[0-9a-f]+$/i,Sd=/^0b[01]+$/i,Td=/^\[object .+?Constructor\]$/,Md=/^0o[0-7]+$/i,Wi=/^(?:0|[1-9]\d*)$/,kd=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,es=/($^)/,Dd=/['\n\r\u2028\u2029\\]/g,ns="\\ud800-\\udfff",Cd="\\u0300-\\u036f",Od="\\ufe20-\\ufe2f",yl="\\u20d0-\\u20ff",xr=Cd+Od+yl,_l="\\u2700-\\u27bf",is="a-z\\xdf-\\xf6\\xf8-\\xff",Ad="\\xac\\xb1\\xd7\\xf7",Rd="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ed="\\u2000-\\u206f",Pd=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",bl="A-Z\\xc0-\\xd6\\xd8-\\xde",xl="\\ufe0e\\ufe0f",rs=Ad+Rd+Ed+Pd,Ao="['’]",Id="["+ns+"]",wl="["+rs+"]",ss="["+xr+"]",vl="\\d+",Ld="["+_l+"]",Sl="["+is+"]",Ro="[^"+ns+rs+vl+_l+is+bl+"]",Eo="\\ud83c[\\udffb-\\udfff]",Nd="(?:"+ss+"|"+Eo+")",wr="[^"+ns+"]",Gn="(?:\\ud83c[\\udde6-\\uddff]){2}",os="[\\ud800-\\udbff][\\udc00-\\udfff]",cn="["+bl+"]",Tl="\\u200d",Ml="(?:"+Sl+"|"+Ro+")",Bd="(?:"+cn+"|"+Ro+")",kl="(?:"+Ao+"(?:d|ll|m|re|s|t|ve))?",Dl="(?:"+Ao+"(?:D|LL|M|RE|S|T|VE))?",Cl=Nd+"?",Po="["+xl+"]?",fi="(?:"+Tl+"(?:"+[wr,Gn,os].join("|")+")"+Po+Cl+")*",Fd="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ol="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Al=Po+Cl+fi,Io="(?:"+[Ld,Gn,os].join("|")+")"+Al,Rl="(?:"+[wr+ss+"?",ss,Gn,os,Id].join("|")+")",zd=RegExp(Ao,"g"),Ud=RegExp(ss,"g"),as=RegExp(Eo+"(?="+Eo+")|"+Rl+Al,"g"),Hd=RegExp([cn+"?"+Sl+"+"+kl+"(?="+[wl,cn,"$"].join("|")+")",Bd+"+"+Dl+"(?="+[wl,cn+Ml,"$"].join("|")+")",cn+"?"+Ml+"+"+kl,cn+"+"+Dl,Ol,Fd,vl,Io].join("|"),"g"),ls=RegExp("["+Tl+ns+xr+xl+"]"),Wd=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Lo=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Vd=-1,ee={};ee[zi]=ee[Dn]=ee[Ye]=ee[In]=ee[ci]=ee[vo]=ee[So]=ee[br]=ee[ui]=!0,ee[et]=ee[ht]=ee[Re]=ee[ct]=ee[gn]=ee[mt]=ee[Lt]=ee[zt]=ee[Ct]=ee[Dt]=ee[bt]=ee[Ae]=ee[oe]=ee[ln]=ee[ie]=!1;var D={};D[et]=D[ht]=D[Re]=D[gn]=D[ct]=D[mt]=D[zi]=D[Dn]=D[Ye]=D[In]=D[ci]=D[Ct]=D[Dt]=D[bt]=D[Ae]=D[oe]=D[ln]=D[Vt]=D[vo]=D[So]=D[br]=D[ui]=!0,D[Lt]=D[zt]=D[ie]=!1;var V={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Q={"&":"&","<":"<",">":">",'"':""","'":"'"},yt={"&":"&","<":"<",">":">",""":'"',"'":"'"},Te={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},qe=parseFloat,Nn=parseInt,Ne=typeof Fi=="object"&&Fi&&Fi.Object===Object&&Fi,El=typeof self=="object"&&self&&self.Object===Object&&self,ce=Ne||El||Function("return this")(),cs=t&&!t.nodeType&&t,Kn=cs&&!0&&n&&!n.nodeType&&n,No=Kn&&Kn.exports===cs,vr=No&&Ne.process,Be=(function(){try{var z=Kn&&Kn.require&&Kn.require("util").types;return z||vr&&vr.binding&&vr.binding("util")}catch{}})(),E_=Be&&Be.isArrayBuffer,P_=Be&&Be.isDate,I_=Be&&Be.isMap,L_=Be&&Be.isRegExp,N_=Be&&Be.isSet,B_=Be&&Be.isTypedArray;function mn(z,K,Y){switch(Y.length){case 0:return z.call(K);case 1:return z.call(K,Y[0]);case 2:return z.call(K,Y[0],Y[1]);case 3:return z.call(K,Y[0],Y[1],Y[2])}return z.apply(K,Y)}function sL(z,K,Y,dt){for(var Ot=-1,$t=z==null?0:z.length;++Ot<$t;){var Me=z[Ot];K(dt,Me,Y(Me),z)}return dt}function yn(z,K){for(var Y=-1,dt=z==null?0:z.length;++Y<dt&&K(z[Y],Y,z)!==!1;);return z}function oL(z,K){for(var Y=z==null?0:z.length;Y--&&K(z[Y],Y,z)!==!1;);return z}function F_(z,K){for(var Y=-1,dt=z==null?0:z.length;++Y<dt;)if(!K(z[Y],Y,z))return!1;return!0}function Vi(z,K){for(var Y=-1,dt=z==null?0:z.length,Ot=0,$t=[];++Y<dt;){var Me=z[Y];K(Me,Y,z)&&($t[Ot++]=Me)}return $t}function Pl(z,K){var Y=z==null?0:z.length;return!!Y&&us(z,K,0)>-1}function $d(z,K,Y){for(var dt=-1,Ot=z==null?0:z.length;++dt<Ot;)if(Y(K,z[dt]))return!0;return!1}function ue(z,K){for(var Y=-1,dt=z==null?0:z.length,Ot=Array(dt);++Y<dt;)Ot[Y]=K(z[Y],Y,z);return Ot}function $i(z,K){for(var Y=-1,dt=K.length,Ot=z.length;++Y<dt;)z[Ot+Y]=K[Y];return z}function Yd(z,K,Y,dt){var Ot=-1,$t=z==null?0:z.length;for(dt&&$t&&(Y=z[++Ot]);++Ot<$t;)Y=K(Y,z[Ot],Ot,z);return Y}function aL(z,K,Y,dt){var Ot=z==null?0:z.length;for(dt&&Ot&&(Y=z[--Ot]);Ot--;)Y=K(Y,z[Ot],Ot,z);return Y}function qd(z,K){for(var Y=-1,dt=z==null?0:z.length;++Y<dt;)if(K(z[Y],Y,z))return!0;return!1}var lL=jd("length");function cL(z){return z.split("")}function uL(z){return z.match(xd)||[]}function z_(z,K,Y){var dt;return Y(z,function(Ot,$t,Me){if(K(Ot,$t,Me))return dt=$t,!1}),dt}function Il(z,K,Y,dt){for(var Ot=z.length,$t=Y+(dt?1:-1);dt?$t--:++$t<Ot;)if(K(z[$t],$t,z))return $t;return-1}function us(z,K,Y){return K===K?vL(z,K,Y):Il(z,U_,Y)}function dL(z,K,Y,dt){for(var Ot=Y-1,$t=z.length;++Ot<$t;)if(dt(z[Ot],K))return Ot;return-1}function U_(z){return z!==z}function H_(z,K){var Y=z==null?0:z.length;return Y?Kd(z,K)/Y:P}function jd(z){return function(K){return K==null?e:K[z]}}function Gd(z){return function(K){return z==null?e:z[K]}}function W_(z,K,Y,dt,Ot){return Ot(z,function($t,Me,ne){Y=dt?(dt=!1,$t):K(Y,$t,Me,ne)}),Y}function fL(z,K){var Y=z.length;for(z.sort(K);Y--;)z[Y]=z[Y].value;return z}function Kd(z,K){for(var Y,dt=-1,Ot=z.length;++dt<Ot;){var $t=K(z[dt]);$t!==e&&(Y=Y===e?$t:Y+$t)}return Y}function Xd(z,K){for(var Y=-1,dt=Array(z);++Y<z;)dt[Y]=K(Y);return dt}function hL(z,K){return ue(K,function(Y){return[Y,z[Y]]})}function V_(z){return z&&z.slice(0,j_(z)+1).replace(Oo,"")}function _n(z){return function(K){return z(K)}}function Zd(z,K){return ue(K,function(Y){return z[Y]})}function Bo(z,K){return z.has(K)}function $_(z,K){for(var Y=-1,dt=z.length;++Y<dt&&us(K,z[Y],0)>-1;);return Y}function Y_(z,K){for(var Y=z.length;Y--&&us(K,z[Y],0)>-1;);return Y}function pL(z,K){for(var Y=z.length,dt=0;Y--;)z[Y]===K&&++dt;return dt}var gL=Gd(V),mL=Gd(Q);function yL(z){return"\\"+Te[z]}function _L(z,K){return z==null?e:z[K]}function ds(z){return ls.test(z)}function bL(z){return Wd.test(z)}function xL(z){for(var K,Y=[];!(K=z.next()).done;)Y.push(K.value);return Y}function Qd(z){var K=-1,Y=Array(z.size);return z.forEach(function(dt,Ot){Y[++K]=[Ot,dt]}),Y}function q_(z,K){return function(Y){return z(K(Y))}}function Yi(z,K){for(var Y=-1,dt=z.length,Ot=0,$t=[];++Y<dt;){var Me=z[Y];(Me===K||Me===g)&&(z[Y]=g,$t[Ot++]=Y)}return $t}function Ll(z){var K=-1,Y=Array(z.size);return z.forEach(function(dt){Y[++K]=dt}),Y}function wL(z){var K=-1,Y=Array(z.size);return z.forEach(function(dt){Y[++K]=[dt,dt]}),Y}function vL(z,K,Y){for(var dt=Y-1,Ot=z.length;++dt<Ot;)if(z[dt]===K)return dt;return-1}function SL(z,K,Y){for(var dt=Y+1;dt--;)if(z[dt]===K)return dt;return dt}function fs(z){return ds(z)?ML(z):lL(z)}function Bn(z){return ds(z)?kL(z):cL(z)}function j_(z){for(var K=z.length;K--&&yd.test(z.charAt(K)););return K}var TL=Gd(yt);function ML(z){for(var K=as.lastIndex=0;as.test(z);)++K;return K}function kL(z){return z.match(as)||[]}function DL(z){return z.match(Hd)||[]}var CL=(function z(K){K=K==null?ce:hs.defaults(ce.Object(),K,hs.pick(ce,Lo));var Y=K.Array,dt=K.Date,Ot=K.Error,$t=K.Function,Me=K.Math,ne=K.Object,Jd=K.RegExp,OL=K.String,Cn=K.TypeError,Nl=Y.prototype,AL=$t.prototype,ps=ne.prototype,Bl=K["__core-js_shared__"],Fl=AL.toString,jt=ps.hasOwnProperty,RL=0,G_=(function(){var o=/[^.]+$/.exec(Bl&&Bl.keys&&Bl.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),zl=ps.toString,EL=Fl.call(ne),PL=ce._,IL=Jd("^"+Fl.call(jt).replace(Co,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ul=No?K.Buffer:e,qi=K.Symbol,Hl=K.Uint8Array,K_=Ul?Ul.allocUnsafe:e,Wl=q_(ne.getPrototypeOf,ne),X_=ne.create,Z_=ps.propertyIsEnumerable,Vl=Nl.splice,Q_=qi?qi.isConcatSpreadable:e,Fo=qi?qi.iterator:e,Sr=qi?qi.toStringTag:e,$l=(function(){try{var o=Cr(ne,"defineProperty");return o({},"",{}),o}catch{}})(),LL=K.clearTimeout!==ce.clearTimeout&&K.clearTimeout,NL=dt&&dt.now!==ce.Date.now&&dt.now,BL=K.setTimeout!==ce.setTimeout&&K.setTimeout,Yl=Me.ceil,ql=Me.floor,tf=ne.getOwnPropertySymbols,FL=Ul?Ul.isBuffer:e,J_=K.isFinite,zL=Nl.join,UL=q_(ne.keys,ne),ke=Me.max,je=Me.min,HL=dt.now,WL=K.parseInt,t0=Me.random,VL=Nl.reverse,ef=Cr(K,"DataView"),zo=Cr(K,"Map"),nf=Cr(K,"Promise"),gs=Cr(K,"Set"),Uo=Cr(K,"WeakMap"),Ho=Cr(ne,"create"),jl=Uo&&new Uo,ms={},$L=Or(ef),YL=Or(zo),qL=Or(nf),jL=Or(gs),GL=Or(Uo),Gl=qi?qi.prototype:e,Wo=Gl?Gl.valueOf:e,e0=Gl?Gl.toString:e;function w(o){if(ge(o)&&!Et(o)&&!(o instanceof Ut)){if(o instanceof On)return o;if(jt.call(o,"__wrapped__"))return nb(o)}return new On(o)}var ys=(function(){function o(){}return function(c){if(!fe(c))return{};if(X_)return X_(c);o.prototype=c;var f=new o;return o.prototype=e,f}})();function Kl(){}function On(o,c){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=e}w.templateSettings={escape:hd,evaluate:pd,interpolate:Do,variable:"",imports:{_:w}},w.prototype=Kl.prototype,w.prototype.constructor=w,On.prototype=ys(Kl.prototype),On.prototype.constructor=On;function Ut(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=W,this.__views__=[]}function KL(){var o=new Ut(this.__wrapped__);return o.__actions__=un(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=un(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=un(this.__views__),o}function XL(){if(this.__filtered__){var o=new Ut(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function ZL(){var o=this.__wrapped__.value(),c=this.__dir__,f=Et(o),m=c<0,b=f?o.length:0,k=cB(0,b,this.__views__),A=k.start,E=k.end,H=E-A,X=m?E:A-1,Z=this.__iteratees__,nt=Z.length,st=0,_t=je(H,this.__takeCount__);if(!f||!m&&b==H&&_t==H)return M0(o,this.__actions__);var Tt=[];t:for(;H--&&st<_t;){X+=c;for(var Nt=-1,wt=o[X];++Nt<nt;){var Ft=Z[Nt],Ht=Ft.iteratee,wn=Ft.type,tn=Ht(wt);if(wn==q)wt=tn;else if(!tn){if(wn==ot)continue t;break t}}Tt[st++]=wt}return Tt}Ut.prototype=ys(Kl.prototype),Ut.prototype.constructor=Ut;function Tr(o){var c=-1,f=o==null?0:o.length;for(this.clear();++c<f;){var m=o[c];this.set(m[0],m[1])}}function QL(){this.__data__=Ho?Ho(null):{},this.size=0}function JL(o){var c=this.has(o)&&delete this.__data__[o];return this.size-=c?1:0,c}function tN(o){var c=this.__data__;if(Ho){var f=c[o];return f===d?e:f}return jt.call(c,o)?c[o]:e}function eN(o){var c=this.__data__;return Ho?c[o]!==e:jt.call(c,o)}function nN(o,c){var f=this.__data__;return this.size+=this.has(o)?0:1,f[o]=Ho&&c===e?d:c,this}Tr.prototype.clear=QL,Tr.prototype.delete=JL,Tr.prototype.get=tN,Tr.prototype.has=eN,Tr.prototype.set=nN;function hi(o){var c=-1,f=o==null?0:o.length;for(this.clear();++c<f;){var m=o[c];this.set(m[0],m[1])}}function iN(){this.__data__=[],this.size=0}function rN(o){var c=this.__data__,f=Xl(c,o);if(f<0)return!1;var m=c.length-1;return f==m?c.pop():Vl.call(c,f,1),--this.size,!0}function sN(o){var c=this.__data__,f=Xl(c,o);return f<0?e:c[f][1]}function oN(o){return Xl(this.__data__,o)>-1}function aN(o,c){var f=this.__data__,m=Xl(f,o);return m<0?(++this.size,f.push([o,c])):f[m][1]=c,this}hi.prototype.clear=iN,hi.prototype.delete=rN,hi.prototype.get=sN,hi.prototype.has=oN,hi.prototype.set=aN;function pi(o){var c=-1,f=o==null?0:o.length;for(this.clear();++c<f;){var m=o[c];this.set(m[0],m[1])}}function lN(){this.size=0,this.__data__={hash:new Tr,map:new(zo||hi),string:new Tr}}function cN(o){var c=lc(this,o).delete(o);return this.size-=c?1:0,c}function uN(o){return lc(this,o).get(o)}function dN(o){return lc(this,o).has(o)}function fN(o,c){var f=lc(this,o),m=f.size;return f.set(o,c),this.size+=f.size==m?0:1,this}pi.prototype.clear=lN,pi.prototype.delete=cN,pi.prototype.get=uN,pi.prototype.has=dN,pi.prototype.set=fN;function Mr(o){var c=-1,f=o==null?0:o.length;for(this.__data__=new pi;++c<f;)this.add(o[c])}function hN(o){return this.__data__.set(o,d),this}function pN(o){return this.__data__.has(o)}Mr.prototype.add=Mr.prototype.push=hN,Mr.prototype.has=pN;function Fn(o){var c=this.__data__=new hi(o);this.size=c.size}function gN(){this.__data__=new hi,this.size=0}function mN(o){var c=this.__data__,f=c.delete(o);return this.size=c.size,f}function yN(o){return this.__data__.get(o)}function _N(o){return this.__data__.has(o)}function bN(o,c){var f=this.__data__;if(f instanceof hi){var m=f.__data__;if(!zo||m.length<r-1)return m.push([o,c]),this.size=++f.size,this;f=this.__data__=new pi(m)}return f.set(o,c),this.size=f.size,this}Fn.prototype.clear=gN,Fn.prototype.delete=mN,Fn.prototype.get=yN,Fn.prototype.has=_N,Fn.prototype.set=bN;function n0(o,c){var f=Et(o),m=!f&&Ar(o),b=!f&&!m&&Zi(o),k=!f&&!m&&!b&&ws(o),A=f||m||b||k,E=A?Xd(o.length,OL):[],H=E.length;for(var X in o)(c||jt.call(o,X))&&!(A&&(X=="length"||b&&(X=="offset"||X=="parent")||k&&(X=="buffer"||X=="byteLength"||X=="byteOffset")||yi(X,H)))&&E.push(X);return E}function i0(o){var c=o.length;return c?o[pf(0,c-1)]:e}function xN(o,c){return cc(un(o),kr(c,0,o.length))}function wN(o){return cc(un(o))}function rf(o,c,f){(f!==e&&!Un(o[c],f)||f===e&&!(c in o))&&Xn(o,c,f)}function Vo(o,c,f){var m=o[c];(!(jt.call(o,c)&&Un(m,f))||f===e&&!(c in o))&&Xn(o,c,f)}function Xl(o,c){for(var f=o.length;f--;)if(Un(o[f][0],c))return f;return-1}function vN(o,c,f,m){return ji(o,function(b,k,A){c(m,b,f(b),A)}),m}function r0(o,c){return o&&Qn(c,Ee(c),o)}function SN(o,c){return o&&Qn(c,fn(c),o)}function Xn(o,c,f){c=="__proto__"&&$l?$l(o,c,{configurable:!0,enumerable:!0,value:f,writable:!0}):o[c]=f}function sf(o,c){for(var f=-1,m=c.length,b=Y(m),k=o==null;++f<m;)b[f]=k?e:Uf(o,c[f]);return b}function kr(o,c,f){return o===o&&(f!==e&&(o=o<=f?o:f),c!==e&&(o=o>=c?o:c)),o}function An(o,c,f,m,b,k){var A,E=c&y,H=c&_,X=c&x;if(f&&(A=b?f(o,m,b,k):f(o)),A!==e)return A;if(!fe(o))return o;var Z=Et(o);if(Z){if(A=dB(o),!E)return un(o,A)}else{var nt=Ge(o),st=nt==zt||nt==vt;if(Zi(o))return C0(o,E);if(nt==bt||nt==et||st&&!b){if(A=H||st?{}:j0(o),!E)return H?tB(o,SN(A,o)):JN(o,r0(A,o))}else{if(!D[nt])return b?o:{};A=fB(o,nt,E)}}k||(k=new Fn);var _t=k.get(o);if(_t)return _t;k.set(o,A),vb(o)?o.forEach(function(wt){A.add(An(wt,c,f,wt,o,k))}):xb(o)&&o.forEach(function(wt,Ft){A.set(Ft,An(wt,c,f,Ft,o,k))});var Tt=X?H?Mf:Tf:H?fn:Ee,Nt=Z?e:Tt(o);return yn(Nt||o,function(wt,Ft){Nt&&(Ft=wt,wt=o[Ft]),Vo(A,Ft,An(wt,c,f,Ft,o,k))}),A}function TN(o){var c=Ee(o);return function(f){return s0(f,o,c)}}function s0(o,c,f){var m=f.length;if(o==null)return!m;for(o=ne(o);m--;){var b=f[m],k=c[b],A=o[b];if(A===e&&!(b in o)||!k(A))return!1}return!0}function o0(o,c,f){if(typeof o!="function")throw new Cn(a);return Xo(function(){o.apply(e,f)},c)}function $o(o,c,f,m){var b=-1,k=Pl,A=!0,E=o.length,H=[],X=c.length;if(!E)return H;f&&(c=ue(c,_n(f))),m?(k=$d,A=!1):c.length>=r&&(k=Bo,A=!1,c=new Mr(c));t:for(;++b<E;){var Z=o[b],nt=f==null?Z:f(Z);if(Z=m||Z!==0?Z:0,A&&nt===nt){for(var st=X;st--;)if(c[st]===nt)continue t;H.push(Z)}else k(c,nt,m)||H.push(Z)}return H}var ji=P0(Zn),a0=P0(af,!0);function MN(o,c){var f=!0;return ji(o,function(m,b,k){return f=!!c(m,b,k),f}),f}function Zl(o,c,f){for(var m=-1,b=o.length;++m<b;){var k=o[m],A=c(k);if(A!=null&&(E===e?A===A&&!xn(A):f(A,E)))var E=A,H=k}return H}function kN(o,c,f,m){var b=o.length;for(f=It(f),f<0&&(f=-f>b?0:b+f),m=m===e||m>b?b:It(m),m<0&&(m+=b),m=f>m?0:Tb(m);f<m;)o[f++]=c;return o}function l0(o,c){var f=[];return ji(o,function(m,b,k){c(m,b,k)&&f.push(m)}),f}function Fe(o,c,f,m,b){var k=-1,A=o.length;for(f||(f=pB),b||(b=[]);++k<A;){var E=o[k];c>0&&f(E)?c>1?Fe(E,c-1,f,m,b):$i(b,E):m||(b[b.length]=E)}return b}var of=I0(),c0=I0(!0);function Zn(o,c){return o&&of(o,c,Ee)}function af(o,c){return o&&c0(o,c,Ee)}function Ql(o,c){return Vi(c,function(f){return _i(o[f])})}function Dr(o,c){c=Ki(c,o);for(var f=0,m=c.length;o!=null&&f<m;)o=o[zn(c[f++])];return f&&f==m?o:e}function u0(o,c,f){var m=c(o);return Et(o)?m:$i(m,f(o))}function Qe(o){return o==null?o===e?Le:ve:Sr&&Sr in ne(o)?lB(o):wB(o)}function lf(o,c){return o>c}function DN(o,c){return o!=null&&jt.call(o,c)}function CN(o,c){return o!=null&&c in ne(o)}function ON(o,c,f){return o>=je(c,f)&&o<ke(c,f)}function cf(o,c,f){for(var m=f?$d:Pl,b=o[0].length,k=o.length,A=k,E=Y(k),H=1/0,X=[];A--;){var Z=o[A];A&&c&&(Z=ue(Z,_n(c))),H=je(Z.length,H),E[A]=!f&&(c||b>=120&&Z.length>=120)?new Mr(A&&Z):e}Z=o[0];var nt=-1,st=E[0];t:for(;++nt<b&&X.length<H;){var _t=Z[nt],Tt=c?c(_t):_t;if(_t=f||_t!==0?_t:0,!(st?Bo(st,Tt):m(X,Tt,f))){for(A=k;--A;){var Nt=E[A];if(!(Nt?Bo(Nt,Tt):m(o[A],Tt,f)))continue t}st&&st.push(Tt),X.push(_t)}}return X}function AN(o,c,f,m){return Zn(o,function(b,k,A){c(m,f(b),k,A)}),m}function Yo(o,c,f){c=Ki(c,o),o=Z0(o,c);var m=o==null?o:o[zn(En(c))];return m==null?e:mn(m,o,f)}function d0(o){return ge(o)&&Qe(o)==et}function RN(o){return ge(o)&&Qe(o)==Re}function EN(o){return ge(o)&&Qe(o)==mt}function qo(o,c,f,m,b){return o===c?!0:o==null||c==null||!ge(o)&&!ge(c)?o!==o&&c!==c:PN(o,c,f,m,qo,b)}function PN(o,c,f,m,b,k){var A=Et(o),E=Et(c),H=A?ht:Ge(o),X=E?ht:Ge(c);H=H==et?bt:H,X=X==et?bt:X;var Z=H==bt,nt=X==bt,st=H==X;if(st&&Zi(o)){if(!Zi(c))return!1;A=!0,Z=!1}if(st&&!Z)return k||(k=new Fn),A||ws(o)?$0(o,c,f,m,b,k):oB(o,c,H,f,m,b,k);if(!(f&v)){var _t=Z&&jt.call(o,"__wrapped__"),Tt=nt&&jt.call(c,"__wrapped__");if(_t||Tt){var Nt=_t?o.value():o,wt=Tt?c.value():c;return k||(k=new Fn),b(Nt,wt,f,m,k)}}return st?(k||(k=new Fn),aB(o,c,f,m,b,k)):!1}function IN(o){return ge(o)&&Ge(o)==Ct}function uf(o,c,f,m){var b=f.length,k=b,A=!m;if(o==null)return!k;for(o=ne(o);b--;){var E=f[b];if(A&&E[2]?E[1]!==o[E[0]]:!(E[0]in o))return!1}for(;++b<k;){E=f[b];var H=E[0],X=o[H],Z=E[1];if(A&&E[2]){if(X===e&&!(H in o))return!1}else{var nt=new Fn;if(m)var st=m(X,Z,H,o,c,nt);if(!(st===e?qo(Z,X,v|M,m,nt):st))return!1}}return!0}function f0(o){if(!fe(o)||mB(o))return!1;var c=_i(o)?IL:Td;return c.test(Or(o))}function LN(o){return ge(o)&&Qe(o)==Ae}function NN(o){return ge(o)&&Ge(o)==oe}function BN(o){return ge(o)&&gc(o.length)&&!!ee[Qe(o)]}function h0(o){return typeof o=="function"?o:o==null?hn:typeof o=="object"?Et(o)?m0(o[0],o[1]):g0(o):Nb(o)}function df(o){if(!Ko(o))return UL(o);var c=[];for(var f in ne(o))jt.call(o,f)&&f!="constructor"&&c.push(f);return c}function FN(o){if(!fe(o))return xB(o);var c=Ko(o),f=[];for(var m in o)m=="constructor"&&(c||!jt.call(o,m))||f.push(m);return f}function ff(o,c){return o<c}function p0(o,c){var f=-1,m=dn(o)?Y(o.length):[];return ji(o,function(b,k,A){m[++f]=c(b,k,A)}),m}function g0(o){var c=Df(o);return c.length==1&&c[0][2]?K0(c[0][0],c[0][1]):function(f){return f===o||uf(f,o,c)}}function m0(o,c){return Of(o)&&G0(c)?K0(zn(o),c):function(f){var m=Uf(f,o);return m===e&&m===c?Hf(f,o):qo(c,m,v|M)}}function Jl(o,c,f,m,b){o!==c&&of(c,function(k,A){if(b||(b=new Fn),fe(k))zN(o,c,A,f,Jl,m,b);else{var E=m?m(Rf(o,A),k,A+"",o,c,b):e;E===e&&(E=k),rf(o,A,E)}},fn)}function zN(o,c,f,m,b,k,A){var E=Rf(o,f),H=Rf(c,f),X=A.get(H);if(X){rf(o,f,X);return}var Z=k?k(E,H,f+"",o,c,A):e,nt=Z===e;if(nt){var st=Et(H),_t=!st&&Zi(H),Tt=!st&&!_t&&ws(H);Z=H,st||_t||Tt?Et(E)?Z=E:_e(E)?Z=un(E):_t?(nt=!1,Z=C0(H,!0)):Tt?(nt=!1,Z=O0(H,!0)):Z=[]:Zo(H)||Ar(H)?(Z=E,Ar(E)?Z=Mb(E):(!fe(E)||_i(E))&&(Z=j0(H))):nt=!1}nt&&(A.set(H,Z),b(Z,H,m,k,A),A.delete(H)),rf(o,f,Z)}function y0(o,c){var f=o.length;if(f)return c+=c<0?f:0,yi(c,f)?o[c]:e}function _0(o,c,f){c.length?c=ue(c,function(k){return Et(k)?function(A){return Dr(A,k.length===1?k[0]:k)}:k}):c=[hn];var m=-1;c=ue(c,_n(St()));var b=p0(o,function(k,A,E){var H=ue(c,function(X){return X(k)});return{criteria:H,index:++m,value:k}});return fL(b,function(k,A){return QN(k,A,f)})}function UN(o,c){return b0(o,c,function(f,m){return Hf(o,m)})}function b0(o,c,f){for(var m=-1,b=c.length,k={};++m<b;){var A=c[m],E=Dr(o,A);f(E,A)&&jo(k,Ki(A,o),E)}return k}function HN(o){return function(c){return Dr(c,o)}}function hf(o,c,f,m){var b=m?dL:us,k=-1,A=c.length,E=o;for(o===c&&(c=un(c)),f&&(E=ue(o,_n(f)));++k<A;)for(var H=0,X=c[k],Z=f?f(X):X;(H=b(E,Z,H,m))>-1;)E!==o&&Vl.call(E,H,1),Vl.call(o,H,1);return o}function x0(o,c){for(var f=o?c.length:0,m=f-1;f--;){var b=c[f];if(f==m||b!==k){var k=b;yi(b)?Vl.call(o,b,1):yf(o,b)}}return o}function pf(o,c){return o+ql(t0()*(c-o+1))}function WN(o,c,f,m){for(var b=-1,k=ke(Yl((c-o)/(f||1)),0),A=Y(k);k--;)A[m?k:++b]=o,o+=f;return A}function gf(o,c){var f="";if(!o||c<1||c>tt)return f;do c%2&&(f+=o),c=ql(c/2),c&&(o+=o);while(c);return f}function Bt(o,c){return Ef(X0(o,c,hn),o+"")}function VN(o){return i0(vs(o))}function $N(o,c){var f=vs(o);return cc(f,kr(c,0,f.length))}function jo(o,c,f,m){if(!fe(o))return o;c=Ki(c,o);for(var b=-1,k=c.length,A=k-1,E=o;E!=null&&++b<k;){var H=zn(c[b]),X=f;if(H==="__proto__"||H==="constructor"||H==="prototype")return o;if(b!=A){var Z=E[H];X=m?m(Z,H,E):e,X===e&&(X=fe(Z)?Z:yi(c[b+1])?[]:{})}Vo(E,H,X),E=E[H]}return o}var w0=jl?function(o,c){return jl.set(o,c),o}:hn,YN=$l?function(o,c){return $l(o,"toString",{configurable:!0,enumerable:!1,value:Vf(c),writable:!0})}:hn;function qN(o){return cc(vs(o))}function Rn(o,c,f){var m=-1,b=o.length;c<0&&(c=-c>b?0:b+c),f=f>b?b:f,f<0&&(f+=b),b=c>f?0:f-c>>>0,c>>>=0;for(var k=Y(b);++m<b;)k[m]=o[m+c];return k}function jN(o,c){var f;return ji(o,function(m,b,k){return f=c(m,b,k),!f}),!!f}function tc(o,c,f){var m=0,b=o==null?m:o.length;if(typeof c=="number"&&c===c&&b<=pt){for(;m<b;){var k=m+b>>>1,A=o[k];A!==null&&!xn(A)&&(f?A<=c:A<c)?m=k+1:b=k}return b}return mf(o,c,hn,f)}function mf(o,c,f,m){var b=0,k=o==null?0:o.length;if(k===0)return 0;c=f(c);for(var A=c!==c,E=c===null,H=xn(c),X=c===e;b<k;){var Z=ql((b+k)/2),nt=f(o[Z]),st=nt!==e,_t=nt===null,Tt=nt===nt,Nt=xn(nt);if(A)var wt=m||Tt;else X?wt=Tt&&(m||st):E?wt=Tt&&st&&(m||!_t):H?wt=Tt&&st&&!_t&&(m||!Nt):_t||Nt?wt=!1:wt=m?nt<=c:nt<c;wt?b=Z+1:k=Z}return je(k,j)}function v0(o,c){for(var f=-1,m=o.length,b=0,k=[];++f<m;){var A=o[f],E=c?c(A):A;if(!f||!Un(E,H)){var H=E;k[b++]=A===0?0:A}}return k}function S0(o){return typeof o=="number"?o:xn(o)?P:+o}function bn(o){if(typeof o=="string")return o;if(Et(o))return ue(o,bn)+"";if(xn(o))return e0?e0.call(o):"";var c=o+"";return c=="0"&&1/o==-rt?"-0":c}function Gi(o,c,f){var m=-1,b=Pl,k=o.length,A=!0,E=[],H=E;if(f)A=!1,b=$d;else if(k>=r){var X=c?null:rB(o);if(X)return Ll(X);A=!1,b=Bo,H=new Mr}else H=c?[]:E;t:for(;++m<k;){var Z=o[m],nt=c?c(Z):Z;if(Z=f||Z!==0?Z:0,A&&nt===nt){for(var st=H.length;st--;)if(H[st]===nt)continue t;c&&H.push(nt),E.push(Z)}else b(H,nt,f)||(H!==E&&H.push(nt),E.push(Z))}return E}function yf(o,c){c=Ki(c,o);var f=-1,m=c.length;if(!m)return!0;for(;++f<m;){var b=zn(c[f]);if(b==="__proto__"&&!jt.call(o,"__proto__")||(b==="constructor"||b==="prototype")&&f<m-1)return!1}var k=Z0(o,c);return k==null||delete k[zn(En(c))]}function T0(o,c,f,m){return jo(o,c,f(Dr(o,c)),m)}function ec(o,c,f,m){for(var b=o.length,k=m?b:-1;(m?k--:++k<b)&&c(o[k],k,o););return f?Rn(o,m?0:k,m?k+1:b):Rn(o,m?k+1:0,m?b:k)}function M0(o,c){var f=o;return f instanceof Ut&&(f=f.value()),Yd(c,function(m,b){return b.func.apply(b.thisArg,$i([m],b.args))},f)}function _f(o,c,f){var m=o.length;if(m<2)return m?Gi(o[0]):[];for(var b=-1,k=Y(m);++b<m;)for(var A=o[b],E=-1;++E<m;)E!=b&&(k[b]=$o(k[b]||A,o[E],c,f));return Gi(Fe(k,1),c,f)}function k0(o,c,f){for(var m=-1,b=o.length,k=c.length,A={};++m<b;){var E=m<k?c[m]:e;f(A,o[m],E)}return A}function bf(o){return _e(o)?o:[]}function xf(o){return typeof o=="function"?o:hn}function Ki(o,c){return Et(o)?o:Of(o,c)?[o]:eb(Gt(o))}var GN=Bt;function Xi(o,c,f){var m=o.length;return f=f===e?m:f,!c&&f>=m?o:Rn(o,c,f)}var D0=LL||function(o){return ce.clearTimeout(o)};function C0(o,c){if(c)return o.slice();var f=o.length,m=K_?K_(f):new o.constructor(f);return o.copy(m),m}function wf(o){var c=new o.constructor(o.byteLength);return new Hl(c).set(new Hl(o)),c}function KN(o,c){var f=c?wf(o.buffer):o.buffer;return new o.constructor(f,o.byteOffset,o.byteLength)}function XN(o){var c=new o.constructor(o.source,ml.exec(o));return c.lastIndex=o.lastIndex,c}function ZN(o){return Wo?ne(Wo.call(o)):{}}function O0(o,c){var f=c?wf(o.buffer):o.buffer;return new o.constructor(f,o.byteOffset,o.length)}function A0(o,c){if(o!==c){var f=o!==e,m=o===null,b=o===o,k=xn(o),A=c!==e,E=c===null,H=c===c,X=xn(c);if(!E&&!X&&!k&&o>c||k&&A&&H&&!E&&!X||m&&A&&H||!f&&H||!b)return 1;if(!m&&!k&&!X&&o<c||X&&f&&b&&!m&&!k||E&&f&&b||!A&&b||!H)return-1}return 0}function QN(o,c,f){for(var m=-1,b=o.criteria,k=c.criteria,A=b.length,E=f.length;++m<A;){var H=A0(b[m],k[m]);if(H){if(m>=E)return H;var X=f[m];return H*(X=="desc"?-1:1)}}return o.index-c.index}function R0(o,c,f,m){for(var b=-1,k=o.length,A=f.length,E=-1,H=c.length,X=ke(k-A,0),Z=Y(H+X),nt=!m;++E<H;)Z[E]=c[E];for(;++b<A;)(nt||b<k)&&(Z[f[b]]=o[b]);for(;X--;)Z[E++]=o[b++];return Z}function E0(o,c,f,m){for(var b=-1,k=o.length,A=-1,E=f.length,H=-1,X=c.length,Z=ke(k-E,0),nt=Y(Z+X),st=!m;++b<Z;)nt[b]=o[b];for(var _t=b;++H<X;)nt[_t+H]=c[H];for(;++A<E;)(st||b<k)&&(nt[_t+f[A]]=o[b++]);return nt}function un(o,c){var f=-1,m=o.length;for(c||(c=Y(m));++f<m;)c[f]=o[f];return c}function Qn(o,c,f,m){var b=!f;f||(f={});for(var k=-1,A=c.length;++k<A;){var E=c[k],H=m?m(f[E],o[E],E,f,o):e;H===e&&(H=o[E]),b?Xn(f,E,H):Vo(f,E,H)}return f}function JN(o,c){return Qn(o,Cf(o),c)}function tB(o,c){return Qn(o,Y0(o),c)}function nc(o,c){return function(f,m){var b=Et(f)?sL:vN,k=c?c():{};return b(f,o,St(m,2),k)}}function _s(o){return Bt(function(c,f){var m=-1,b=f.length,k=b>1?f[b-1]:e,A=b>2?f[2]:e;for(k=o.length>3&&typeof k=="function"?(b--,k):e,A&&Je(f[0],f[1],A)&&(k=b<3?e:k,b=1),c=ne(c);++m<b;){var E=f[m];E&&o(c,E,m,k)}return c})}function P0(o,c){return function(f,m){if(f==null)return f;if(!dn(f))return o(f,m);for(var b=f.length,k=c?b:-1,A=ne(f);(c?k--:++k<b)&&m(A[k],k,A)!==!1;);return f}}function I0(o){return function(c,f,m){for(var b=-1,k=ne(c),A=m(c),E=A.length;E--;){var H=A[o?E:++b];if(f(k[H],H,k)===!1)break}return c}}function eB(o,c,f){var m=c&C,b=Go(o);function k(){var A=this&&this!==ce&&this instanceof k?b:o;return A.apply(m?f:this,arguments)}return k}function L0(o){return function(c){c=Gt(c);var f=ds(c)?Bn(c):e,m=f?f[0]:c.charAt(0),b=f?Xi(f,1).join(""):c.slice(1);return m[o]()+b}}function bs(o){return function(c){return Yd(Ib(Pb(c).replace(zd,"")),o,"")}}function Go(o){return function(){var c=arguments;switch(c.length){case 0:return new o;case 1:return new o(c[0]);case 2:return new o(c[0],c[1]);case 3:return new o(c[0],c[1],c[2]);case 4:return new o(c[0],c[1],c[2],c[3]);case 5:return new o(c[0],c[1],c[2],c[3],c[4]);case 6:return new o(c[0],c[1],c[2],c[3],c[4],c[5]);case 7:return new o(c[0],c[1],c[2],c[3],c[4],c[5],c[6])}var f=ys(o.prototype),m=o.apply(f,c);return fe(m)?m:f}}function nB(o,c,f){var m=Go(o);function b(){for(var k=arguments.length,A=Y(k),E=k,H=xs(b);E--;)A[E]=arguments[E];var X=k<3&&A[0]!==H&&A[k-1]!==H?[]:Yi(A,H);if(k-=X.length,k<f)return U0(o,c,ic,b.placeholder,e,A,X,e,e,f-k);var Z=this&&this!==ce&&this instanceof b?m:o;return mn(Z,this,A)}return b}function N0(o){return function(c,f,m){var b=ne(c);if(!dn(c)){var k=St(f,3);c=Ee(c),f=function(E){return k(b[E],E,b)}}var A=o(c,f,m);return A>-1?b[k?c[A]:A]:e}}function B0(o){return mi(function(c){var f=c.length,m=f,b=On.prototype.thru;for(o&&c.reverse();m--;){var k=c[m];if(typeof k!="function")throw new Cn(a);if(b&&!A&&ac(k)=="wrapper")var A=new On([],!0)}for(m=A?m:f;++m<f;){k=c[m];var E=ac(k),H=E=="wrapper"?kf(k):e;H&&Af(H[0])&&H[1]==(T|I|N|S)&&!H[4].length&&H[9]==1?A=A[ac(H[0])].apply(A,H[3]):A=k.length==1&&Af(k)?A[E]():A.thru(k)}return function(){var X=arguments,Z=X[0];if(A&&X.length==1&&Et(Z))return A.plant(Z).value();for(var nt=0,st=f?c[nt].apply(this,X):Z;++nt<f;)st=c[nt].call(this,st);return st}})}function ic(o,c,f,m,b,k,A,E,H,X){var Z=c&T,nt=c&C,st=c&R,_t=c&(I|L),Tt=c&O,Nt=st?e:Go(o);function wt(){for(var Ft=arguments.length,Ht=Y(Ft),wn=Ft;wn--;)Ht[wn]=arguments[wn];if(_t)var tn=xs(wt),vn=pL(Ht,tn);if(m&&(Ht=R0(Ht,m,b,_t)),k&&(Ht=E0(Ht,k,A,_t)),Ft-=vn,_t&&Ft<X){var be=Yi(Ht,tn);return U0(o,c,ic,wt.placeholder,f,Ht,be,E,H,X-Ft)}var Hn=nt?f:this,xi=st?Hn[o]:o;return Ft=Ht.length,E?Ht=vB(Ht,E):Tt&&Ft>1&&Ht.reverse(),Z&&H<Ft&&(Ht.length=H),this&&this!==ce&&this instanceof wt&&(xi=Nt||Go(xi)),xi.apply(Hn,Ht)}return wt}function F0(o,c){return function(f,m){return AN(f,o,c(m),{})}}function rc(o,c){return function(f,m){var b;if(f===e&&m===e)return c;if(f!==e&&(b=f),m!==e){if(b===e)return m;typeof f=="string"||typeof m=="string"?(f=bn(f),m=bn(m)):(f=S0(f),m=S0(m)),b=o(f,m)}return b}}function vf(o){return mi(function(c){return c=ue(c,_n(St())),Bt(function(f){var m=this;return o(c,function(b){return mn(b,m,f)})})})}function sc(o,c){c=c===e?" ":bn(c);var f=c.length;if(f<2)return f?gf(c,o):c;var m=gf(c,Yl(o/fs(c)));return ds(c)?Xi(Bn(m),0,o).join(""):m.slice(0,o)}function iB(o,c,f,m){var b=c&C,k=Go(o);function A(){for(var E=-1,H=arguments.length,X=-1,Z=m.length,nt=Y(Z+H),st=this&&this!==ce&&this instanceof A?k:o;++X<Z;)nt[X]=m[X];for(;H--;)nt[X++]=arguments[++E];return mn(st,b?f:this,nt)}return A}function z0(o){return function(c,f,m){return m&&typeof m!="number"&&Je(c,f,m)&&(f=m=e),c=bi(c),f===e?(f=c,c=0):f=bi(f),m=m===e?c<f?1:-1:bi(m),WN(c,f,m,o)}}function oc(o){return function(c,f){return typeof c=="string"&&typeof f=="string"||(c=Pn(c),f=Pn(f)),o(c,f)}}function U0(o,c,f,m,b,k,A,E,H,X){var Z=c&I,nt=Z?A:e,st=Z?e:A,_t=Z?k:e,Tt=Z?e:k;c|=Z?N:B,c&=~(Z?B:N),c&F||(c&=-4);var Nt=[o,c,b,_t,nt,Tt,st,E,H,X],wt=f.apply(e,Nt);return Af(o)&&Q0(wt,Nt),wt.placeholder=m,J0(wt,o,c)}function Sf(o){var c=Me[o];return function(f,m){if(f=Pn(f),m=m==null?0:je(It(m),292),m&&J_(f)){var b=(Gt(f)+"e").split("e"),k=c(b[0]+"e"+(+b[1]+m));return b=(Gt(k)+"e").split("e"),+(b[0]+"e"+(+b[1]-m))}return c(f)}}var rB=gs&&1/Ll(new gs([,-0]))[1]==rt?function(o){return new gs(o)}:qf;function H0(o){return function(c){var f=Ge(c);return f==Ct?Qd(c):f==oe?wL(c):hL(c,o(c))}}function gi(o,c,f,m,b,k,A,E){var H=c&R;if(!H&&typeof o!="function")throw new Cn(a);var X=m?m.length:0;if(X||(c&=-97,m=b=e),A=A===e?A:ke(It(A),0),E=E===e?E:It(E),X-=b?b.length:0,c&B){var Z=m,nt=b;m=b=e}var st=H?e:kf(o),_t=[o,c,f,m,b,Z,nt,k,A,E];if(st&&bB(_t,st),o=_t[0],c=_t[1],f=_t[2],m=_t[3],b=_t[4],E=_t[9]=_t[9]===e?H?0:o.length:ke(_t[9]-X,0),!E&&c&(I|L)&&(c&=-25),!c||c==C)var Tt=eB(o,c,f);else c==I||c==L?Tt=nB(o,c,E):(c==N||c==(C|N))&&!b.length?Tt=iB(o,c,f,m):Tt=ic.apply(e,_t);var Nt=st?w0:Q0;return J0(Nt(Tt,_t),o,c)}function W0(o,c,f,m){return o===e||Un(o,ps[f])&&!jt.call(m,f)?c:o}function V0(o,c,f,m,b,k){return fe(o)&&fe(c)&&(k.set(c,o),Jl(o,c,e,V0,k),k.delete(c)),o}function sB(o){return Zo(o)?e:o}function $0(o,c,f,m,b,k){var A=f&v,E=o.length,H=c.length;if(E!=H&&!(A&&H>E))return!1;var X=k.get(o),Z=k.get(c);if(X&&Z)return X==c&&Z==o;var nt=-1,st=!0,_t=f&M?new Mr:e;for(k.set(o,c),k.set(c,o);++nt<E;){var Tt=o[nt],Nt=c[nt];if(m)var wt=A?m(Nt,Tt,nt,c,o,k):m(Tt,Nt,nt,o,c,k);if(wt!==e){if(wt)continue;st=!1;break}if(_t){if(!qd(c,function(Ft,Ht){if(!Bo(_t,Ht)&&(Tt===Ft||b(Tt,Ft,f,m,k)))return _t.push(Ht)})){st=!1;break}}else if(!(Tt===Nt||b(Tt,Nt,f,m,k))){st=!1;break}}return k.delete(o),k.delete(c),st}function oB(o,c,f,m,b,k,A){switch(f){case gn:if(o.byteLength!=c.byteLength||o.byteOffset!=c.byteOffset)return!1;o=o.buffer,c=c.buffer;case Re:return!(o.byteLength!=c.byteLength||!k(new Hl(o),new Hl(c)));case ct:case mt:case Dt:return Un(+o,+c);case Lt:return o.name==c.name&&o.message==c.message;case Ae:case ln:return o==c+"";case Ct:var E=Qd;case oe:var H=m&v;if(E||(E=Ll),o.size!=c.size&&!H)return!1;var X=A.get(o);if(X)return X==c;m|=M,A.set(o,c);var Z=$0(E(o),E(c),m,b,k,A);return A.delete(o),Z;case Vt:if(Wo)return Wo.call(o)==Wo.call(c)}return!1}function aB(o,c,f,m,b,k){var A=f&v,E=Tf(o),H=E.length,X=Tf(c),Z=X.length;if(H!=Z&&!A)return!1;for(var nt=H;nt--;){var st=E[nt];if(!(A?st in c:jt.call(c,st)))return!1}var _t=k.get(o),Tt=k.get(c);if(_t&&Tt)return _t==c&&Tt==o;var Nt=!0;k.set(o,c),k.set(c,o);for(var wt=A;++nt<H;){st=E[nt];var Ft=o[st],Ht=c[st];if(m)var wn=A?m(Ht,Ft,st,c,o,k):m(Ft,Ht,st,o,c,k);if(!(wn===e?Ft===Ht||b(Ft,Ht,f,m,k):wn)){Nt=!1;break}wt||(wt=st=="constructor")}if(Nt&&!wt){var tn=o.constructor,vn=c.constructor;tn!=vn&&"constructor"in o&&"constructor"in c&&!(typeof tn=="function"&&tn instanceof tn&&typeof vn=="function"&&vn instanceof vn)&&(Nt=!1)}return k.delete(o),k.delete(c),Nt}function mi(o){return Ef(X0(o,e,sb),o+"")}function Tf(o){return u0(o,Ee,Cf)}function Mf(o){return u0(o,fn,Y0)}var kf=jl?function(o){return jl.get(o)}:qf;function ac(o){for(var c=o.name+"",f=ms[c],m=jt.call(ms,c)?f.length:0;m--;){var b=f[m],k=b.func;if(k==null||k==o)return b.name}return c}function xs(o){var c=jt.call(w,"placeholder")?w:o;return c.placeholder}function St(){var o=w.iteratee||$f;return o=o===$f?h0:o,arguments.length?o(arguments[0],arguments[1]):o}function lc(o,c){var f=o.__data__;return gB(c)?f[typeof c=="string"?"string":"hash"]:f.map}function Df(o){for(var c=Ee(o),f=c.length;f--;){var m=c[f],b=o[m];c[f]=[m,b,G0(b)]}return c}function Cr(o,c){var f=_L(o,c);return f0(f)?f:e}function lB(o){var c=jt.call(o,Sr),f=o[Sr];try{o[Sr]=e;var m=!0}catch{}var b=zl.call(o);return m&&(c?o[Sr]=f:delete o[Sr]),b}var Cf=tf?function(o){return o==null?[]:(o=ne(o),Vi(tf(o),function(c){return Z_.call(o,c)}))}:jf,Y0=tf?function(o){for(var c=[];o;)$i(c,Cf(o)),o=Wl(o);return c}:jf,Ge=Qe;(ef&&Ge(new ef(new ArrayBuffer(1)))!=gn||zo&&Ge(new zo)!=Ct||nf&&Ge(nf.resolve())!=qt||gs&&Ge(new gs)!=oe||Uo&&Ge(new Uo)!=ie)&&(Ge=function(o){var c=Qe(o),f=c==bt?o.constructor:e,m=f?Or(f):"";if(m)switch(m){case $L:return gn;case YL:return Ct;case qL:return qt;case jL:return oe;case GL:return ie}return c});function cB(o,c,f){for(var m=-1,b=f.length;++m<b;){var k=f[m],A=k.size;switch(k.type){case"drop":o+=A;break;case"dropRight":c-=A;break;case"take":c=je(c,o+A);break;case"takeRight":o=ke(o,c-A);break}}return{start:o,end:c}}function uB(o){var c=o.match(_d);return c?c[1].split(bd):[]}function q0(o,c,f){c=Ki(c,o);for(var m=-1,b=c.length,k=!1;++m<b;){var A=zn(c[m]);if(!(k=o!=null&&f(o,A)))break;o=o[A]}return k||++m!=b?k:(b=o==null?0:o.length,!!b&&gc(b)&&yi(A,b)&&(Et(o)||Ar(o)))}function dB(o){var c=o.length,f=new o.constructor(c);return c&&typeof o[0]=="string"&&jt.call(o,"index")&&(f.index=o.index,f.input=o.input),f}function j0(o){return typeof o.constructor=="function"&&!Ko(o)?ys(Wl(o)):{}}function fB(o,c,f){var m=o.constructor;switch(c){case Re:return wf(o);case ct:case mt:return new m(+o);case gn:return KN(o,f);case zi:case Dn:case Ye:case In:case ci:case vo:case So:case br:case ui:return O0(o,f);case Ct:return new m;case Dt:case ln:return new m(o);case Ae:return XN(o);case oe:return new m;case Vt:return ZN(o)}}function hB(o,c){var f=c.length;if(!f)return o;var m=f-1;return c[m]=(f>1?"& ":"")+c[m],c=c.join(f>2?", ":" "),o.replace(Ln,`{
|
|
7
|
+
`)}}function cR(n,t,e={}){const{window:i=qa,...r}=e;let s;const a=Km(()=>i&&"ResizeObserver"in i),l=()=>{s&&(s.disconnect(),s=void 0)},u=p.watch(p.computed(()=>{const h=p.toValue(n);return Array.isArray(h)?h.map(g=>jr(g)):[jr(h)]}),h=>{if(l(),a.value&&i){s=new ResizeObserver(t);for(const g of h)g&&s.observe(g,r)}},{immediate:!0,flush:"post"}),d=()=>{l(),u()};return jm(d),{isSupported:a,stop:d}}function uR(n,t={}){const{reset:e=!0,windowResize:i=!0,windowScroll:r=!0,immediate:s=!0,updateTiming:a="sync"}=t,l=p.shallowRef(0),u=p.shallowRef(0),d=p.shallowRef(0),h=p.shallowRef(0),g=p.shallowRef(0),y=p.shallowRef(0),_=p.shallowRef(0),x=p.shallowRef(0);function v(){const C=jr(n);if(!C){e&&(l.value=0,u.value=0,d.value=0,h.value=0,g.value=0,y.value=0,_.value=0,x.value=0);return}const R=C.getBoundingClientRect();l.value=R.height,u.value=R.bottom,d.value=R.left,h.value=R.right,g.value=R.top,y.value=R.width,_.value=R.x,x.value=R.y}function M(){a==="sync"?v():a==="next-frame"&&requestAnimationFrame(()=>v())}return cR(n,M),p.watch(()=>jr(n),C=>!C&&M()),oR(n,M,{attributeFilter:["style","class"]}),r&&lo("scroll",M,{capture:!0,passive:!0}),i&&lo("resize",M,{passive:!0}),iR(()=>{s&&M()}),{height:l,bottom:u,left:d,right:h,top:g,width:y,x:_,y:x,update:M}}function dR(n,t){const{top:e,left:i}=uR(n),r=p.computed(()=>n.value?`${parseFloat(t.left)+i.value}px`:t.left),s=p.computed(()=>n.value?`${parseFloat(t.top)+e.value}px`:t.top);return{tooltipAbsoluteLeft:r,tooltipAbsoluteTop:s}}const fR=({bucketCount:n,minStamp:t,maxStamp:e,timestamps:i})=>{const r=[...i].filter(u=>u>=t&&u<=e).sort((u,d)=>u-d),s=[];if(e-t<n-2)return[];const a=(e-t)/n;let l=0;for(let u=0;u<n;u++){const d=t+u*a,h=t+(u+1)*a;let g=0;for(;l<r.length&&r[l]>=d&&r[l]<=h;)g++,l++;s.push([Math.ceil(d),g])}return s},Xm=()=>({minCounts:{},maxCounts:{},minStamps:{},maxStamps:{},renderPoints:{}}),co=p.ref({}),hR=n=>(co.value[n]||(co.value[n]=Xm()),co.value[n]),pR=(n,t)=>{const e=co.value[t];if(!e)return;const i=e.minCounts[n]!==void 0||e.maxCounts[n]!==void 0||e.minStamps[n]!==void 0||e.maxStamps[n]!==void 0||e.renderPoints[n]!==void 0;e&&i&&(delete e.minCounts[n],delete e.maxCounts[n],delete e.minStamps[n],delete e.maxStamps[n],delete e.renderPoints[n],Object.keys(e.minCounts).length||Object.keys(e.maxCounts).length||Object.keys(e.minStamps).length||Object.keys(e.maxStamps).length||Object.keys(e.renderPoints).length||delete co.value[t])};function gR({chartKey:n,datasets:t,groupKey:e,minStamp:i=void 0,maxStamp:r=void 0,minCount:s=void 0,maxCount:a=void 0,renderPoints:l=void 0,type:u}){const h=e!==void 0&&n!==void 0?hR(e):Xm(),g=n!==void 0?n:"static-chart-key",y=p.computed(()=>t.reduce((O,{timestamps:U})=>[...O,...U],[])),_=p.computed(()=>i||y.value.reduce((O,U)=>O===0?U:Math.min(O,U),0)),x=p.computed(()=>r||y.value.reduce((O,U)=>Math.max(O,U),0));p.watchEffect(()=>{h.minStamps[g]=_.value,h.maxStamps[g]=x.value,l!==void 0&&(h.renderPoints[g]=l)});const v=p.computed(()=>Object.values(h.minStamps).reduce((O,U)=>O===0?U:Math.min(O,U),0)),M=p.computed(()=>Object.values(h.maxStamps).reduce((O,U)=>Math.max(O,U),0)),C=p.computed(()=>{const O=Object.values(h.renderPoints);return O.length===0?24:O.reduce((U,$)=>Math.max(U,$),2)}),R=p.computed(()=>{const O=M.value-v.value;return Math.ceil(O/C.value)}),F=p.computed(()=>t.length>1),I=p.computed(()=>t.map(({timestamps:O,color:U,label:$})=>({data:fR({bucketCount:C.value,minStamp:v.value,maxStamp:M.value,timestamps:O}).map(([ot,q])=>({x:ot,y:q})),label:$,...(u==="sparkline_bar"||F.value)&&U&&{backgroundColor:U},...u!=="sparkline_bar"&&U&&{borderColor:U},...F.value&&u!=="sparkline_bar"&&{fill:!0}}))),L=p.computed(()=>{const O=I.value[0]?.data?.length??0,U=[];for(let $=0;$<O;$++){let it=0;for(let at=0;at<I.value.length;at++)it+=I.value[at].data[$].y;U.push(it)}return U}),N=p.computed(()=>{const O=L.value.reduce((U,$)=>Math.max(U,$),0);return Math.max(O,a??0)}),B=p.computed(()=>{const O=I.value.reduce((it,{data:at})=>[...it,...at.map(({y:ot})=>ot)],[]),U=O.length?O[0]:0,$=O.reduce((it,at)=>Math.min(it,at),U);return s===void 0?$:Math.min($,s)});p.watchEffect(()=>{h.maxCounts[g]=N.value,h.minCounts[g]=B.value});const T=p.computed(()=>{const O=Object.values(h.minCounts),U=O.length?O[0]:0;return O.reduce(($,it)=>Math.min($,it),U)}),S=p.computed(()=>Object.values(h.maxCounts).reduce((O,U)=>Math.max(O,U),0));return p.onUnmounted(()=>{n!==void 0&&e!==void 0&&pR(n,e)}),{syncedMinStamp:v,syncedMaxStamp:M,syncedRenderPoints:C,syncedChartDatasets:I,syncedGroupSizeMs:R,syncedMinCount:T,syncedMaxCount:S}}const kt={useBarChartOptions:kA,useChartJSCommon:CA,useChartLegendValues:AA,useChartSelectedRange:RA,useExploreResultToDatasets:NA,useExploreResultToTimeDataset:UA,useScatterDatasets:jA,useDonutChartOptions:EA,useLineChartOptions:PA,useScatterChartOptions:IA,useI18n:uM,useReportChartDataForSynthetics:GA,useTranslatedUnits:KA,useEvaluateFeatureFlag:ZA,useTooltipAbsolutePosition:dR,useSparklineSync:gR},Ga=n=>["interactive","zoom-interactive"].includes(n),Du=(n,t,e,i)=>{const{tooltip:r}=t;if(r.opacity===0&&!Ga(n.interactionMode)){n.showTooltip=!1;return}const{i18n:s}=kt.useI18n(),{formatUnit:a}=er({i18n:s}),l=n.chartTooltipSortFn||((u,d)=>d.rawValue-u.rawValue);if(r.body&&!Ga(n.interactionMode)){const u=r.labelColors,d=t.chart.config?.options?.indexAxis==="y"?"x":"y",h=r.dataPoints[0].parsed.x??0;n.tooltipContext=i?.contextFormatter?i.contextFormatter(h,e):fo({tickValue:new Date(h),granularity:e}),n.tooltipSeries=r.dataPoints.map((g,y)=>{const _=g.parsed[d],x=a(_??0,n.units,{translateUnit:n.translateUnit}),v=g.raw?.tooltipLabel||g.dataset.label;return{backgroundColor:u[y].backgroundColor,borderColor:u[y].borderColor,label:v,value:x,rawValue:_,isSegmentEmpty:g.dataset.isSegmentEmpty}}).sort(l),n.left=`${r.x}px`,n.top=`${r.y}px`,n.showTooltip=!0}},Zm=(n,t)=>{const{tooltip:e}=t,{i18n:i}=kt.useI18n(),{formatUnit:r}=er({i18n:i});if(e.opacity===0&&!Ga(n.interactionMode)){n.showTooltip=!1;return}const s=n.chartTooltipSortFn||((a,l)=>l.rawValue-a.rawValue);if(e.body&&!Ga(n.interactionMode)){const a=e.labelColors,l=t.chart.config?.options?.indexAxis==="y"?"x":"y",u=["gauge","donut"].includes(n.chartType);u?n.tooltipContext=n.dimensionDisplay||e.dataPoints[0].label:e.chart.data.isMultiDimension?n.tooltipContext=e.dataPoints[0].label:n.tooltipContext=n.dimensionDisplay||"",n.tooltipSeries=e.dataPoints.map((d,h)=>{const g=u?d.parsed:d.parsed[l],y=r(g??0,n.units,{translateUnit:n.translateUnit});let _;return u?_=d.dataset.labels[d.dataIndex]:_=d.dataset.label,{backgroundColor:a[h].backgroundColor,borderColor:a[h].borderColor,label:_,value:y,rawValue:g,isSegmentEmpty:d.dataset.isSegmentEmpty}}).sort(s),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},mR=n=>n&&n.datasets&&n.datasets.length,yR=n=>mR(n)&&n.datasets.some(t=>t.data.length),_R=n=>n.datasets.some(t=>t.data[0]&&Ac(t.data[0].x)),bR=n=>!!yR(n)&&n.datasets.some(t=>t.data.length==1),xR=n=>_R(n)&&n.datasets.some(t=>t.data[0]&&(t.data[0].x??0).toString().length>=13),Ka=(n,t,e)=>{const r=Math.min(t/1150,1),s=.15,a=1.15,l=n.x??0;return l<e?l+t*s*(1-r):l-t*a*(1-r)},Qm=(n,t,e)=>{const s=n.y??0;return s<e?s+t*.15:s-t*.5};function Jm(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const Cu=(n,t,e)=>{const i=n.data;return n.options.plugins.legend.labels.generateLabels(n).filter(r=>!t?.[r.text]?.isThreshold).map(((r,s)=>({...r,value:t&&t[r.text],isSegmentEmpty:i.datasets[s].isSegmentEmpty}))).sort(e)},wR=2,ty=10,ey=12,Xa=10,ai=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Ou=(n,t)=>(t||ai)[n%ai.length],vR="#6f7787",SR={100:{background:"#f0f5fd",text:"#10599e"},200:{background:"#e5f7f4",text:"#1b6955"},300:{background:"#fff1d5",text:"#a06027"},400:{background:"#fee3b6",text:"#944d19"},500:{background:"#fedada",text:"#852021"}},TR=n=>{const t=Math.floor(parseInt(n,10)/100)*100;return SR[t]?.background||"#fafafa"},MR=sv,Au=(n,t,e,i)=>{let r;return e?r=MR:Array.isArray(i)?r=Ou(n,i):r=i[t],r||Ou(n)},Ru=n=>{switch(n){case"error":return ov;case"warning":return uv;case"neutral":return Vh;default:return Vh}},kR={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},DR=2,CR=0,Eu=new Map,ny=(n,t)=>{const{i18n:e}=kt.useI18n(),{formatBytes:i}=er({i18n:e});return t==="bytes"?i(n):t==="count/minute"?n.toFixed(2):aa.format(n)},OR=n=>{const e=document.createElement("canvas").getContext("2d"),i=le({});return e.font=i.string,e.measureText(n).width},AR=()=>{const n="label_height";if(!Eu.has(n)){const t=le({});Eu.set(n,t.lineHeight)}return Eu.get(n)},RR=(n,t)=>t.datasets.reduce((e,i,r)=>n.isDatasetVisible(r)?e+i.data.reduce((s,a)=>isNaN(a)?s:s+a,0):e,0),ER=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,PR=rv,IR={100:hv,101:pv,102:gv,103:mv,200:yv,201:_v,202:bv,203:xv,204:wv,205:vv,206:Sv,207:Tv,208:Mv,226:kv,300:Dv,301:Cv,302:Ov,303:Av,304:Rv,305:Ev,307:Pv,308:Iv,400:Lv,401:Nv,402:Bv,403:Fv,404:zv,405:Uv,406:Hv,407:Wv,408:Vv,409:$v,410:Yv,411:qv,412:jv,413:Gv,414:Kv,415:Xv,416:Zv,417:Qv,418:Jv,421:t1,422:e1,423:n1,424:i1,425:r1,426:s1,428:o1,429:a1,431:l1,451:c1,500:u1,501:d1,502:f1,503:h1,504:p1,505:g1,506:m1,507:y1,508:_1,510:b1,511:x1},LR={100:w1,200:v1,300:S1,400:T1,500:M1},NR={"1XX":k1,"2XX":D1,"3XX":C1,"4XX":O1,"5XX":A1},iy=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100;return IR[t]??LR[e]??PR},Pu={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=iy(`${t}`),n),{}),____OTHER____:iv,...NR};function ry(n,t,e){const i=fp(),r=zR(n,e.timeZone,e.locale??i.locale);return"formatToParts"in r?BR(r,t):FR(r,t)}function BR(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function FR(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function zR(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function UR(n,t){const e=YR(t);return"formatToParts"in e?WR(e,n):VR(e,n)}const HR={year:0,month:1,day:2,hour:3,minute:4,second:5};function WR(n,t){try{const e=n.formatToParts(t),i=[];for(let r=0;r<e.length;r++){const s=HR[e[r].type];s!==void 0&&(i[s]=parseInt(e[r].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function VR(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const Iu={},sy=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),$R=sy==="06/25/2014, 00:00:00"||sy==="06/25/2014 00:00:00";function YR(n){return Iu[n]||(Iu[n]=$R?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Iu[n]}function oy(n,t,e,i,r,s,a){const l=new Date(0);return l.setUTCFullYear(n,t,e),l.setUTCHours(i,r,s,a),l}const ay=36e5,qR=6e4,Lu={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Nu(n,t,e){if(!n)return 0;let i=Lu.timezoneZ.exec(n);if(i)return 0;let r,s;if(i=Lu.timezoneHH.exec(n),i)return r=parseInt(i[1],10),ly(r)?-(r*ay):NaN;if(i=Lu.timezoneHHMM.exec(n),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return ly(r,a)?(s=Math.abs(r)*ay+a*qR,i[1]==="+"?-s:s):NaN}if(KR(n)){t=new Date(t||Date.now());const a=e?t:jR(t),l=Bu(a,n);return-(e?l:GR(t,l,n))}return NaN}function jR(n){return oy(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Bu(n,t){const e=UR(n,t),i=oy(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let r=n.getTime();const s=r%1e3;return r-=s>=0?s:1e3+s,i-r}function GR(n,t,e){let r=n.getTime()-t;const s=Bu(new Date(r),e);if(t===s)return t;r-=s-t;const a=Bu(new Date(r),e);return s===a?s:Math.max(s,a)}function ly(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const cy={};function KR(n){if(cy[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),cy[n]=!0,!0}catch{return!1}}const XR=60*1e3,ZR={X:function(n,t,e){const i=Fu(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return uy(i);case"XXXX":case"XX":return Gr(i);default:return Gr(i,":")}},x:function(n,t,e){const i=Fu(e.timeZone,n);switch(t){case"x":return uy(i);case"xxxx":case"xx":return Gr(i);default:return Gr(i,":")}},O:function(n,t,e){const i=Fu(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+QR(i,":");default:return"GMT"+Gr(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return ry("short",n,e);default:return ry("long",n,e)}}};function Fu(n,t){const e=n?Nu(n,t,!0)/XR:t?.getTimezoneOffset()??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Za(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Gr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Za(Math.floor(i/60),2),s=Za(Math.floor(i%60),2);return e+r+t+s}function uy(n,t){return n%60===0?(n>0?"-":"+")+Za(Math.abs(n)/60,2):Gr(n,t)}function QR(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Math.floor(i/60),s=i%60;return s===0?e+String(r):e+String(r)+t+Za(s,2)}function dy(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const JR=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,zu=36e5,fy=6e4,tE=2,Xe={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:JR};function hy(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?tE:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=eE(n),{year:r,restDateString:s}=nE(i.date,e),a=iE(s,r);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const l=a.getTime();let u=0,d;if(i.time&&(u=rE(i.time),u===null||isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(d=Nu(i.timeZone||t.timeZone,new Date(l+u)),isNaN(d))return new Date(NaN)}else d=dy(new Date(l+u)),d=dy(new Date(l+u+d));return new Date(l+u+d)}else return new Date(NaN)}function eE(n){const t={};let e=Xe.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=Xe.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const r=Xe.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function nE(n,t){if(n){const e=Xe.YYY[t],i=Xe.YYYYY[t];let r=Xe.YYYY.exec(n)||i.exec(n);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:n.slice(s.length)}}if(r=Xe.YY.exec(n)||e.exec(n),r){const s=r[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}}return{year:null}}function iE(n,t){if(t===null)return null;let e,i,r;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let s=Xe.MM.exec(n);if(s)return e=new Date(0),i=parseInt(s[1],10)-1,my(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(s=Xe.DDD.exec(n),s){e=new Date(0);const a=parseInt(s[1],10);return aE(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(s=Xe.MMDD.exec(n),s){e=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return my(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(s=Xe.Www.exec(n),s)return r=parseInt(s[1],10)-1,yy(r)?py(t,r):new Date(NaN);if(s=Xe.WwwD.exec(n),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return yy(r,a)?py(t,r,a):new Date(NaN)}return null}function rE(n){let t,e,i=Xe.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Uu(t)?t%24*zu:NaN;if(i=Xe.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Uu(t,e)?t%24*zu+e*fy:NaN;if(i=Xe.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return Uu(t,e,r)?t%24*zu+e*fy+r*1e3:NaN}return null}function py(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const r=i.getUTCDay()||7,s=t*7+e+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const sE=[31,28,31,30,31,30,31,31,30,31,30,31],oE=[31,29,31,30,31,30,31,31,30,31,30,31];function gy(n){return n%400===0||n%4===0&&n%100!==0}function my(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=gy(n);if(i&&e>oE[t]||!i&&e>sE[t])return!1}return!0}function aE(n,t){if(t<1)return!1;const e=gy(n);return!(e&&t>366||!e&&t>365)}function yy(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Uu(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const lE=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Hu(n,t,e={}){t=String(t);const i=t.match(lE);if(i){const r=hy(e.originalDate||n,e);t=i.reduce(function(s,a){if(a[0]==="'")return s;const l=s.indexOf(a),u=s[l-1]==="'",d=s.replace(a,"'"+ZR[a[0]](r,a,e)+"'");return u?d.substring(0,l-1)+d.substring(l+1):d},t)}return ua(n,t,e)}function cE(n,t,e){n=hy(n,e);const i=Nu(t,n,!0),r=new Date(n.getTime()-i),s=new Date(0);return s.setFullYear(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),s.setHours(r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()),s}function uo(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Hu(cE(n,t,{timeZone:i.timeZone}),e,i)}const uE=(n,t)=>`${uo(n,t,"yyyy")} W${uo(n,t,"II")}`,Wu="yyyy-MM-dd h:mm:ss a",Vu="h:mm:ss a",hr="yyyy-MM-dd h:mm a",Kr="h:mm a",dE="yyyy-MM-dd",$u="MMM dd, yyyy h:mm:ss a",Ii="MMM dd, yyyy h:mm a",fE={secondly:n=>n?Wu:Vu,tenSecondly:n=>n?Wu:Vu,thirtySecondly:n=>n?Wu:Vu,minutely:n=>n?hr:Kr,fiveMinutely:n=>n?hr:Kr,tenMinutely:n=>n?hr:Kr,thirtyMinutely:n=>n?hr:Kr,hourly:n=>n?hr:Kr,twoHourly:n=>n?hr:Kr,twelveHourly:()=>hr,daily:()=>dE},hE={secondly:()=>$u,tenSecondly:()=>$u,thirtySecondly:()=>$u,minutely:()=>Ii,fiveMinutely:()=>Ii,tenMinutely:()=>Ii,thirtyMinutely:()=>Ii,hourly:()=>Ii,twoHourly:()=>Ii,twelveHourly:()=>Ii,daily:()=>Ii};function _y({tickValue:n,granularity:t,timezone:e,dayBoundaryCrossed:i=!1,tickMap:r,tooltipMap:s,defaultFormat:a}){const l=e||Intl.DateTimeFormat().resolvedOptions().timeZone;if(t==="weekly")return uE(n,l);if(r&&r[t]){const u=r[t](i);return uo(n,l,u)}if(s&&s[t]){const u=s[t]();return uo(n,l,u)}return uo(n,l,a)}const by=({tickValue:n,granularity:t,dayBoundaryCrossed:e,timezone:i})=>_y({tickValue:n,granularity:t,timezone:i,dayBoundaryCrossed:e,tickMap:fE,defaultFormat:"yyyy-MM-dd h:mm:ss a"}),fo=({tickValue:n,granularity:t,timezone:e})=>_y({tickValue:n,granularity:t,timezone:e,tooltipMap:hE,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),xy=n=>n?.code==="ERR_CANCELED"||n?.name==="CanceledError"||n?.name==="AbortError",pE=n=>{const{i18n:t}=kt.useI18n();return xy(n)?{type:"canceled",message:t.t("query_errors.canceled.message")}:n?.status===403?{status:n.status,type:"forbidden",message:t.t("query_errors.forbidden.message"),details:t.t("query_errors.forbidden.details")}:n?.status===408||n?.message?.includes("timeout")?{status:n.status,type:"timeout",message:t.t("query_errors.timeout.message"),details:t.t("query_errors.timeout.details")}:n?.response?.data?.message==="Range not allowed for this tier"?{status:n.status,type:"range_exceeded",message:t.t("query_errors.time_range_exceeded.message"),details:t.t("query_errors.time_range_exceeded.details")}:{status:n.status,type:"other",message:t.t("query_errors.other.message"),details:n.response?.data?.invalid_parameters?.map(e=>e.reason).join(", ")||n?.message}},ho=n=>n.toLocaleLowerCase().endsWith("count"),gE=n=>{const t=n.toLocaleLowerCase();return["sum","count","cost","tokens"].some(e=>t.endsWith(e))},mE=(n,t)=>{if(!n.length)return NaN;const i=Math.min(100,Math.max(0,t))/100*(n.length-1),r=Math.floor(i),s=Math.ceil(i);return r===s?n[r]:n[r]+(n[s]-n[r])*(i-r)},yE=(n,t)=>{const e=n.filter(i=>Number.isFinite(i)).sort((i,r)=>i-r);return new Map(t.map(i=>[i,mE(e,i)]))},wy=.7,Yu=(n,t)=>{const e=Sa(n.trim());return e.valid?e.alpha(t).rgbString():n},Qa=n=>{const t=n??(typeof document>"u"?null:document.documentElement);if(typeof window>"u"||!t)return{medianLine:$h,outlier:Hh,outlierBand:Yu(Wh,wy)};const e=window.getComputedStyle(t),i=(r,s)=>e.getPropertyValue(r).trim()||s;return{medianLine:i("--kui-color-text",$h),outlier:i("--kui-color-background-danger",Hh),outlierBand:Yu(i("--kui-color-background-danger-weakest",Wh),wy)}},_E="empty",vy=n=>{if(!n||!("meta"in n)||!("data"in n))return;const{display:t,metric_names:e,metric_units:i,start:r,end:s,truncated:a,limit:l,datasource:u}=n.meta;if(!e?.length){console.error("Cannot build scatter chart data from this explore result. Missing metric names.");return}const d=e[0],h=t&&Object.keys(t)[0]||void 0,g=n.data??[],y=[];for(const _ of g){const x=bE(_.timestamp,_.event[d],h?_.event[h]:void 0);x&&y.push(x)}return{points:y,metric:d,metricUnit:i?.[d],dimension:h,display:h?t?.[h]:void 0,start:r,end:s,truncated:a,limit:l,datasource:u}},bE=(n,t,e)=>{if(t==null||t==="")return;const i=new Date(n).valueOf(),r=Number(t);return!Number.isFinite(i)||!Number.isFinite(r)?void 0:e===void 0?{timestamp:i,value:r}:{timestamp:i,value:r,group:e!==null&&e!==""?String(e):_E}},xE=["hidden","single","full"];var pr=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(pr||{});const wE=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar","scatter"],vE=["gauge","top_n","single_value"],Ja=n=>n===null||typeof n!="object"||!("points"in n)?!1:Array.isArray(n.points);var Pe=(n=>(n.Hidden="hidden",n.Bottom="bottom",n))(Pe||{});const Sy={modes:{point(n,t){return tl(n,t,{intersect:!0})},nearest(n,t,e){return ME(n,t,e)},x(n,t,e){return tl(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return tl(n,t,{intersect:e.intersect,axis:"y"})}}};function qu(n,t,e){return(Sy.modes[e.mode]||Sy.modes.nearest)(n,t,e)}function SE(n,t,e){return e!=="x"&&e!=="y"?n.inRange(t.x,t.y,"x",!0)||n.inRange(t.x,t.y,"y",!0):n.inRange(t.x,t.y,e,!0)}function TE(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function tl(n,t,e){return n.filter(i=>e.intersect?i.inRange(t.x,t.y):SE(i,t,e.axis))}function ME(n,t,e){let i=Number.POSITIVE_INFINITY;return tl(n,t,e).reduce((r,s)=>{const a=s.getCenterPoint(),l=TE(t,a,e.axis),u=Ur(t,l);return u<i?(r=[s],i=u):u===i&&r.push(s),r},[]).sort((r,s)=>r._index-s._index).slice(0,1)}function gr(n,t,e){const i=Math.cos(e),r=Math.sin(e),s=t.x,a=t.y;return{x:s+i*(n.x-s)-r*(n.y-a),y:a+r*(n.x-s)+i*(n.y-a)}}const kE=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,mr=.001,el=(n,t,e)=>Math.min(e,Math.max(t,n)),Ty=(n,t)=>n.value>=n.start-t&&n.value<=n.end+t;function DE(n,t,e){for(const i of Object.keys(n))n[i]=el(n[i],t,e);return n}function CE(n,t,e,i){return!n||!t||e<=0?!1:Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2)<=Math.pow(e+i,2)}function My(n,{x:t,y:e,x2:i,y2:r},s,{borderWidth:a,hitTolerance:l}){const u=(a+l)/2,d=n.x>=t-u-mr&&n.x<=i+u+mr,h=n.y>=e-u-mr&&n.y<=r+u+mr;return s==="x"?d:(s==="y"||d)&&h}function ky(n,{rect:t,center:e},i,{rotation:r,borderWidth:s,hitTolerance:a}){const l=gr(n,e,xe(-r));return My(l,t,i,{borderWidth:s,hitTolerance:a})}function yr(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function OE(n,t,e,i=!0){const r=e.split(".");let s=0;for(const a of t.split(".")){const l=r[s++];if(parseInt(a,10)<parseInt(l,10))break;if(kE(l,a)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const Dy=n=>typeof n=="string"&&n.endsWith("%"),Cy=n=>parseFloat(n)/100,Oy=n=>el(Cy(n),0,1),po=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),AE={box:n=>po(n.centerX,n.centerY),doughnutLabel:n=>po(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>po(n.centerX,n.centerY),line:n=>po(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>po(n.centerX,n.centerY)};function ju(n,t){return t==="start"?0:t==="end"?n:Dy(t)?Oy(t)*n:n/2}function Li(n,t,e=!0){return typeof t=="number"?t:Dy(t)?(e?Oy(t):Cy(t))*n:n}function RE(n,t){const{x:e,width:i}=n,r=t.textAlign;return r==="center"?e+i/2:r==="end"||r==="right"?e+i:e}function Ay(n,t,{borderWidth:e,position:i,xAdjust:r,yAdjust:s},a){const l=Pt(a),u=t.width+(l?a.width:0)+e,d=t.height+(l?a.height:0)+e,h=Gu(i),g=Iy(n.x,u,r,h.x),y=Iy(n.y,d,s,h.y);return{x:g,y,x2:g+u,y2:y+d,width:u,height:d,centerX:g+u/2,centerY:y+d/2}}function Gu(n,t="center"){return Pt(n)?{x:Mt(n.x,t),y:Mt(n.y,t)}:(n=Mt(n,t),{x:n,y:n})}const Ry=(n,t)=>n&&n.autoFit&&t<1;function Ey(n,t){const e=n.font,i=Yt(e)?e:[e];return Ry(n,t)?i.map(function(r){const s=le(r);return s.size=Math.floor(r.size*t),s.lineHeight=r.lineHeight,le(s)}):i.map(r=>le(r))}function Py(n){return n&&(en(n.xValue)||en(n.yValue))}function Iy(n,t,e=0,i){return n-ju(t,i)+e}function Xr(n,t,e){const i=e.init;if(i){if(i===!0)return Ny(t,e)}else return;return EE(n,t,e)}function Ly(n,t,e){let i=!1;return t.forEach(r=>{nn(n[r])?(i=!0,e[r]=n[r]):en(e[r])&&delete e[r]}),i}function Ny(n,t){const e=t.type||"line";return AE[e](n)}function EE(n,t,e){const i=Qt(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return Ny(t,e);if(Pt(i))return i}const Ku=new Map,PE=n=>isNaN(n)||n<=0,IE=n=>n.reduce(function(t,e){return t+=e.string,t},"");function nl(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function il(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate(xe(i)),n.translate(-t,-e))}function li(n,t){if(t&&t.borderWidth)return n.lineCap=t.borderCapStyle||"butt",n.setLineDash(t.borderDash),n.lineDashOffset=t.borderDashOffset,n.lineJoin=t.borderJoinStyle||"miter",n.lineWidth=t.borderWidth,n.strokeStyle=t.borderColor,!0}function Zr(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function rl(n,t){const e=t.content;if(nl(e))return{width:Li(e.width,t.width),height:Li(e.height,t.height)};const i=Ey(t),r=t.textStrokeWidth,s=Yt(e)?e:[e],a=s.join()+IE(i)+r+(n._measureText?"-spriting":"");return Ku.has(a)||Ku.set(a,FE(n,s,i,r)),Ku.get(a)}function By(n,t,e){const{x:i,y:r,width:s,height:a}=t;n.save(),Zr(n,e);const l=li(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),Hr(n,{x:i,y:r,w:s,h:a,radius:DE(Ci(e.borderRadius),0,Math.min(s,a)/2)}),n.closePath(),n.fill(),l&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function Fy(n,t,e,i){const r=e.content;if(nl(r)){n.save(),n.globalAlpha=HE(e.opacity,r.style.opacity),n.drawImage(r,t.x,t.y,t.width,t.height),n.restore();return}const s=Yt(r)?r:[r],a=Ey(e,i),l=e.color,u=Yt(l)?l:[l],d=RE(t,e),h=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,LE(n,e)&&zE(n,{x:d,y:h},s,a),UE(n,{x:d,y:h},s,{fonts:a,colors:u}),n.restore()}function LE(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function NE(n,t,e,i){const{radius:r,options:s}=t,a=s.pointStyle,l=s.rotation;let u=(l||0)*Yc;if(nl(a)){n.save(),n.translate(e,i),n.rotate(u),n.drawImage(a,-a.width/2,-a.height/2,a.width,a.height),n.restore();return}PE(r)||BE(n,{x:e,y:i,radius:r,rotation:l,style:a,rad:u})}function BE(n,{x:t,y:e,radius:i,rotation:r,style:s,rad:a}){let l,u,d,h;switch(n.beginPath(),s){default:n.arc(t,e,i,0,te),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(a)*i,e-Math.cos(a)*i),a+=ba,n.lineTo(t+Math.sin(a)*i,e-Math.cos(a)*i),a+=ba,n.lineTo(t+Math.sin(a)*i,e-Math.cos(a)*i),n.closePath();break;case"rectRounded":h=i*.516,d=i-h,l=Math.cos(a+kn)*d,u=Math.sin(a+kn)*d,n.arc(t-l,e-u,h,a-Rt,a-re),n.arc(t+u,e-l,h,a-re,a),n.arc(t+l,e+u,h,a,a+re),n.arc(t-u,e+l,h,a+re,a+Rt),n.closePath();break;case"rect":if(!r){d=Math.SQRT1_2*i,n.rect(t-d,e-d,2*d,2*d);break}a+=kn;case"rectRot":l=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-l,e-u),n.lineTo(t+u,e-l),n.lineTo(t+l,e+u),n.lineTo(t-u,e+l),n.closePath();break;case"crossRot":a+=kn;case"cross":l=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-l,e-u),n.lineTo(t+l,e+u),n.moveTo(t+u,e-l),n.lineTo(t-u,e+l);break;case"star":l=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-l,e-u),n.lineTo(t+l,e+u),n.moveTo(t+u,e-l),n.lineTo(t-u,e+l),a+=kn,l=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-l,e-u),n.lineTo(t+l,e+u),n.moveTo(t+u,e-l),n.lineTo(t-u,e+l);break;case"line":l=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-l,e-u),n.lineTo(t+l,e+u);break;case"dash":n.moveTo(t,e),n.lineTo(t+Math.cos(a)*i,e+Math.sin(a)*i);break}n.fill()}function FE(n,t,e,i){n.save();const r=t.length;let s=0,a=i;for(let l=0;l<r;l++){const u=e[Math.min(l,e.length-1)];n.font=u.string;const d=t[l];s=Math.max(s,n.measureText(d).width+i),a+=u.lineHeight}return n.restore(),{width:s,height:a}}function zE(n,{x:t,y:e},i,r){n.beginPath();let s=0;i.forEach(function(a,l){const u=r[Math.min(l,r.length-1)],d=u.lineHeight;n.font=u.string,n.strokeText(a,t,e+d/2+s),s+=d}),n.stroke()}function UE(n,{x:t,y:e},i,{fonts:r,colors:s}){let a=0;i.forEach(function(l,u){const d=s[Math.min(u,s.length-1)],h=r[Math.min(u,r.length-1)],g=h.lineHeight;n.beginPath(),n.font=h.string,n.fillStyle=d,n.fillText(l,t,e+g/2+a),a+=g,n.fill()})}function HE(n,t){const e=Di(n)?n:t;return Di(e)?el(e,0,1):1}const zy=["left","bottom","top","right"];function WE(n,t){const{pointX:e,pointY:i,options:r}=t,s=r.callout,a=s&&s.display&&jE(t,s);if(!a||KE(t,s,a))return;if(n.save(),n.beginPath(),!li(n,s))return n.restore();const{separatorStart:u,separatorEnd:d}=VE(t,a),{sideStart:h,sideEnd:g}=YE(t,a,u);(s.margin>0||r.borderWidth===0)&&(n.moveTo(u.x,u.y),n.lineTo(d.x,d.y)),n.moveTo(h.x,h.y),n.lineTo(g.x,g.y);const y=gr({x:e,y:i},t.getCenterPoint(),xe(-t.rotation));n.lineTo(y.x,y.y),n.stroke(),n.restore()}function VE(n,t){const{x:e,y:i,x2:r,y2:s}=n,a=$E(n,t);let l,u;return t==="left"||t==="right"?(l={x:e+a,y:i},u={x:l.x,y:s}):(l={x:e,y:i+a},u={x:r,y:l.y}),{separatorStart:l,separatorEnd:u}}function $E(n,t){const{width:e,height:i,options:r}=n,s=r.callout.margin+r.borderWidth/2;return t==="right"?e+s:t==="bottom"?i+s:-s}function YE(n,t,e){const{y:i,width:r,height:s,options:a}=n,l=a.callout.start,u=qE(t,a.callout);let d,h;return t==="left"||t==="right"?(d={x:e.x,y:i+Li(s,l)},h={x:d.x+u,y:d.y}):(d={x:e.x+Li(r,l),y:e.y},h={x:d.x,y:d.y+u}),{sideStart:d,sideEnd:h}}function qE(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function jE(n,t){const e=t.position;return zy.includes(e)?e:GE(n,t)}function GE(n,t){const{x:e,y:i,x2:r,y2:s,width:a,height:l,pointX:u,pointY:d,centerX:h,centerY:g,rotation:y}=n,_={x:h,y:g},x=t.start,v=Li(a,x),M=Li(l,x),C=[e,e+v,e+v,r],R=[i+M,s,i,s],F=[];for(let I=0;I<4;I++){const L=gr({x:C[I],y:R[I]},_,xe(y));F.push({position:zy[I],distance:Ur(L,{x:u,y:d})})}return F.sort((I,L)=>I.distance-L.distance)[0].position}function KE(n,t,e){const{pointX:i,pointY:r}=n,s=t.margin;let a=i,l=r;return e==="left"?a+=s:e==="right"?a-=s:e==="top"?l+=s:e==="bottom"&&(l-=s),n.inRange(a,l)}const Uy={xScaleID:{min:"xMin",max:"xMax",start:"left",end:"right",startProp:"x",endProp:"x2"},yScaleID:{min:"yMin",max:"yMax",start:"bottom",end:"top",startProp:"y",endProp:"y2"}};function Qr(n,t,e){return t=typeof t=="number"?t:n.parse(t),ae(t)?n.getPixelForValue(t):e}function _r(n,t,e){const i=t[e];if(i||e==="scaleID")return i;const r=e.charAt(0),s=Object.values(n).filter(a=>a.axis&&a.axis===r);return s.length?s[0].id:r}function Hy(n,t){if(n){const e=n.options.reverse,i=Qr(n,t.min,e?t.end:t.start),r=Qr(n,t.max,e?t.start:t.end);return{start:i,end:r}}}function Wy(n,t){const{chartArea:e,scales:i}=n,r=i[_r(i,t,"xScaleID")],s=i[_r(i,t,"yScaleID")];let a=e.width/2,l=e.height/2;return r&&(a=Qr(r,t.xValue,r.left+r.width/2)),s&&(l=Qr(s,t.yValue,s.top+s.height/2)),{x:a,y:l}}function Xu(n,t){const e=n.scales,i=e[_r(e,t,"xScaleID")],r=e[_r(e,t,"yScaleID")];if(!i&&!r)return{};let{left:s,right:a}=i||n.chartArea,{top:l,bottom:u}=r||n.chartArea;const d=Yy(i,{min:t.xMin,max:t.xMax,start:s,end:a});s=d.start,a=d.end;const h=Yy(r,{min:t.yMin,max:t.yMax,start:u,end:l});return l=h.start,u=h.end,{x:s,y:l,x2:a,y2:u,width:a-s,height:u-l,centerX:s+(a-s)/2,centerY:l+(u-l)/2}}function Vy(n,t){if(!Py(t)){const e=Xu(n,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(e.width,e.height)/2,t.radius=i);const r=i*2,s=e.centerX+t.xAdjust,a=e.centerY+t.yAdjust;return{x:s-i,y:a-i,x2:s+i,y2:a+i,centerX:s,centerY:a,width:r,height:r,radius:i}}return ZE(n,t)}function XE(n,t){const{scales:e,chartArea:i}=n,r=e[t.scaleID],s={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return r?QE(r,s,t):JE(e,s,t),s}function $y(n,t){const e=Xu(n,t);return e.initProperties=Xr(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:nP(n,e,t),initProperties:e.initProperties}],e}function ZE(n,t){const e=Wy(n,t),i=t.radius*2;return{x:e.x-t.radius+t.xAdjust,y:e.y-t.radius+t.yAdjust,x2:e.x+t.radius+t.xAdjust,y2:e.y+t.radius+t.yAdjust,centerX:e.x+t.xAdjust,centerY:e.y+t.yAdjust,radius:t.radius,width:i,height:i}}function Yy(n,t){const e=Hy(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function QE(n,t,e){const i=Qr(n,e.value,NaN),r=Qr(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=r):(t.y=i,t.y2=r)}function JE(n,t,e){for(const i of Object.keys(Uy)){const r=n[_r(n,e,i)];if(r){const{min:s,max:a,start:l,end:u,startProp:d,endProp:h}=Uy[i],g=Hy(r,{min:e[s],max:e[a],start:r[l],end:r[u]});t[d]=g.start,t[h]=g.end}}}function tP({properties:n,options:t},e,i,r){const{x:s,x2:a,width:l}=n;return qy({start:s,end:a,borderWidth:t.borderWidth},{position:i.x,padding:{start:r.left,end:r.right},adjust:t.label.xAdjust,size:e.width})}function eP({properties:n,options:t},e,i,r){const{y:s,y2:a,height:l}=n;return qy({start:s,end:a,borderWidth:t.borderWidth},{position:i.y,padding:{start:r.top,end:r.bottom},adjust:t.label.yAdjust,size:e.height})}function qy(n,t){const{start:e,end:i,borderWidth:r}=n,{position:s,padding:{start:a,end:l},adjust:u}=t,d=i-r-e-a-l-t.size;return e+r/2+u+ju(d,s)}function nP(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const r=Gu(i.position),s=we(i.padding),a=rl(n.ctx,i),l=tP({properties:t,options:e},a,r,s),u=eP({properties:t,options:e},a,r,s),d=a.width+s.width,h=a.height+s.height;return{x:l,y:u,x2:l+d,y2:u+h,width:d,height:h,centerX:l+d/2,centerY:u+h/2,rotation:i.rotation}}const Zu=["enter","leave"],Qu=Zu.concat("click");function iP(n,t,e){t.listened=Ly(e,Qu,t.listeners),t.moveListened=!1,Zu.forEach(i=>{nn(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&nn(i.click)&&(t.listened=!0),t.moveListened||Zu.forEach(r=>{nn(i[r])&&(t.listened=!0,t.moveListened=!0)})})}function rP(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return sP(n,t,e);case"click":return oP(n,t,e)}}function sP(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=qu(n.visibleElements,t,e.interaction):i=[];const r=n.hovered;n.hovered=i;const s={state:n,event:t};let a=jy(s,"leave",r,i);return jy(s,"enter",i,r)||a}function jy({state:n,event:t},e,i,r){let s;for(const a of i)r.indexOf(a)<0&&(s=Gy(a.options[e]||n.listeners[e],a,t)||s);return s}function oP(n,t,e){const i=n.listeners,r=qu(n.visibleElements,t,e.interaction);let s;for(const a of r)s=Gy(a.options.click||i.click,a,t)||s;return s}function Gy(n,t,e){return Qt(n,[t.$context,e])===!0}const sl=["afterDraw","beforeDraw"];function aP(n,t,e){const i=t.visibleElements;t.hooked=Ly(e,sl,t.hooks),t.hooked||i.forEach(r=>{t.hooked||sl.forEach(s=>{nn(r.options[s])&&(t.hooked=!0)})})}function Ky(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return Qt(i,[t.$context])}}function lP(n,t,e){const i=hP(n.scales,t,e);let r=Xy(t,i,"min","suggestedMin");r=Xy(t,i,"max","suggestedMax")||r,r&&nn(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function cP(n,t){for(const e of n)dP(e,t)}function Xy(n,t,e,i){if(ae(t[e])&&!uP(n.options,e,i)){const r=n[e]!==t[e];return n[e]=t[e],r}}function uP(n,t,e){return en(n[t])||en(n[e])}function dP(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=_r(t,n,e);i&&!t[i]&&fP(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function fP(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(en(n[e+i]))return!0;return!1}function hP(n,t,e){const i=t.axis,r=t.id,s=i+"ScaleID",a={min:Mt(t.min,Number.NEGATIVE_INFINITY),max:Mt(t.max,Number.POSITIVE_INFINITY)};for(const l of e)l.scaleID===r?Zy(l,t,["value","endValue"],a):_r(n,l,s)===r&&Zy(l,t,[i+"Min",i+"Max",i+"Value"],a);return a}function Zy(n,t,e,i){for(const r of e){const s=n[r];if(en(s)){const a=t.parse(s);i.min=Math.min(i.min,a),i.max=Math.max(i.max,a)}}}class Jr extends Ve{inRange(t,e,i,r){const{x:s,y:a}=gr({x:t,y:e},this.getCenterPoint(r),xe(-this.options.rotation));return My({x:s,y:a},this.getProps(["x","y","x2","y2"],r),i,this.options)}getCenterPoint(t){return yr(this,t)}draw(t){t.save(),il(t,this.getCenterPoint(),this.options.rotation),By(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return $y(t,e)}}Jr.id="boxAnnotation",Jr.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,hitTolerance:0,label:{backgroundColor:"transparent",borderWidth:0,callout:{display:!1},color:"black",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,hitTolerance:void 0,opacity:void 0,padding:6,position:"center",rotation:void 0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},Jr.defaultRoutes={borderColor:"color",backgroundColor:"color"},Jr.descriptors={label:{_fallback:!0}};class ol extends Ve{inRange(t,e,i,r){return ky({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],r),center:this.getCenterPoint(r)},i,{rotation:this.rotation,borderWidth:0,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return yr(this,t)}draw(t){const e=this.options;!e.display||!e.content||(bP(t,this),t.save(),il(t,this.getCenterPoint(),this.rotation),Fy(t,this,e,this._fitRatio),t.restore())}resolveElementProperties(t,e){const i=pP(t,e);if(!i)return{};const{controllerMeta:r,point:s,radius:a}=mP(t,e,i);let l=rl(t.ctx,e);const u=yP(l,a);Ry(e,u)&&(l={width:l.width*u,height:l.height*u});const{position:d,xAdjust:h,yAdjust:g}=e,y=Ay(s,l,{borderWidth:0,position:d,xAdjust:h,yAdjust:g});return{initProperties:Xr(t,y,e),...y,...r,rotation:e.rotation,_fitRatio:u}}}ol.id="doughnutLabelAnnotation",ol.defaults={autoFit:!0,autoHide:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderColor:"transparent",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:0,color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,hitTolerance:0,init:void 0,opacity:void 0,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,spacing:1,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0},ol.defaultRoutes={};function pP(n,t){return n.getSortedVisibleDatasetMetas().reduce(function(e,i){const r=i.controller;return r instanceof Xs&&gP(n,t,i.data)&&(!e||r.innerRadius<e.controller.innerRadius)&&r.options.circumference>=90?i:e},void 0)}function gP(n,t,e){if(!t.autoHide)return!0;for(let i=0;i<e.length;i++)if(!e[i].hidden&&n.getDataVisibility(i))return!0}function mP({chartArea:n},t,e){const{left:i,top:r,right:s,bottom:a}=n,{innerRadius:l,offsetX:u,offsetY:d}=e.controller,h=(i+s)/2+u,g=(r+a)/2+d,y={left:Math.max(h-l,i),right:Math.min(h+l,s),top:Math.max(g-l,r),bottom:Math.min(g+l,a)},_={x:(y.left+y.right)/2,y:(y.top+y.bottom)/2},x=t.spacing+t.borderWidth/2,v=l-x,M=_.y>g,C=M?r+x:a-x,R=_P(C,h,g,v);return{controllerMeta:{_centerX:h,_centerY:g,_radius:v,_counterclockwise:M,...R},point:_,radius:Math.min(l,Math.min(y.right-y.left,y.bottom-y.top)/2)}}function yP({width:n,height:t},e){const i=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return e*2/i}function _P(n,t,e,i){const r=Math.pow(e-n,2),s=Math.pow(i,2),a=t*-2,l=Math.pow(t,2)+r-s,u=Math.pow(a,2)-4*l;if(u<=0)return{_startAngle:0,_endAngle:te};const d=(-a-Math.sqrt(u))/2,h=(-a+Math.sqrt(u))/2;return{_startAngle:wa({x:t,y:e},{x:d,y:n}).angle,_endAngle:wa({x:t,y:e},{x:h,y:n}).angle}}function bP(n,t){const{_centerX:e,_centerY:i,_radius:r,_startAngle:s,_endAngle:a,_counterclockwise:l,options:u}=t;n.save();const d=li(n,u);n.fillStyle=u.backgroundColor,n.beginPath(),n.arc(e,i,r,s,a,l),n.closePath(),n.fill(),d&&n.stroke(),n.restore()}class go extends Ve{inRange(t,e,i,r){return ky({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],r),center:this.getCenterPoint(r)},i,{rotation:this.rotation,borderWidth:this.options.borderWidth,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return yr(this,t)}draw(t){const e=this.options,i=!en(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),il(t,this.getCenterPoint(),this.rotation),WE(t,this),By(t,this,e),Fy(t,xP(this),e),t.restore())}resolveElementProperties(t,e){let i;if(Py(e))i=Wy(t,e);else{const{centerX:l,centerY:u}=Xu(t,e);i={x:l,y:u}}const r=we(e.padding),s=rl(t.ctx,e),a=Ay(i,s,e,r);return{initProperties:Xr(t,a,e),pointX:i.x,pointY:i.y,...a,rotation:e.rotation}}}go.id="labelAnnotation",go.defaults={adjustScaleRange:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:!1,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,hitTolerance:0,init:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},go.defaultRoutes={borderColor:"color"};function xP({x:n,y:t,width:e,height:i,options:r}){const s=r.borderWidth/2,a=we(r.padding);return{x:n+a.left+s,y:t+a.top+s,width:e-a.left-a.right-r.borderWidth,height:i-a.top-a.bottom-r.borderWidth}}const Ju=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),td=(n,t,e)=>Ju(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,Qy=(n,t,e)=>Ju(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,mo=n=>n*n,wP=(n,t,{x:e,y:i,x2:r,y2:s},a)=>a==="y"?{start:Math.min(i,s),end:Math.max(i,s),value:t}:{start:Math.min(e,r),end:Math.max(e,r),value:n},Jy=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,ed=(n,t,e,i)=>({x:Jy(n.x,t.x,e.x,i),y:Jy(n.y,t.y,e.y,i)}),t_=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),e_=(n,t,e,i)=>-Math.atan2(t_(n.x,t.x,e.x,i),t_(n.y,t.y,e.y,i))+.5*Rt;class yo extends Ve{inRange(t,e,i,r){const s=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const a={mouseX:t,mouseY:e},{path:l,ctx:u}=this;if(l){li(u,this.options),u.lineWidth+=this.options.hitTolerance;const{chart:h}=this.$context,g=t*h.currentDevicePixelRatio,y=e*h.currentDevicePixelRatio,_=u.isPointInStroke(l,g,y)||nd(this,a,r);return u.restore(),_}const d=mo(s);return MP(this,a,d,r)||nd(this,a,r)}return vP(this,{mouseX:t,mouseY:e},i,{hitSize:s,useFinalPosition:r})}getCenterPoint(t){return yr(this,t)}draw(t){const{x:e,y:i,x2:r,y2:s,cp:a,options:l}=this;if(t.save(),!li(t,l))return t.restore();Zr(t,l);const u=Math.sqrt(Math.pow(r-e,2)+Math.pow(s-i,2));if(l.curve&&a)return PP(t,this,a,u),t.restore();const{startOpts:d,endOpts:h,startAdjust:g,endAdjust:y}=o_(this),_=Math.atan2(s-i,r-e);t.translate(e,i),t.rotate(_),t.beginPath(),t.moveTo(0+g,0),t.lineTo(u-y,0),t.shadowColor=l.borderShadowColor,t.stroke(),id(t,0,g,d),id(t,u,-y,h),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=XE(t,e),{x:r,y:s,x2:a,y2:l}=i,u=SP(i,t.chartArea),d=u?TP({x:r,y:s},{x:a,y:l},t.chartArea):{x:r,y:s,x2:a,y2:l,width:Math.abs(a-r),height:Math.abs(l-s)};if(d.centerX=(a+r)/2,d.centerY=(l+s)/2,d.initProperties=Xr(t,d,e),e.curve){const g={x:d.x,y:d.y},y={x:d.x2,y:d.y2};d.cp=EP(d,e,Ur(g,y))}const h=kP(t,d,e.label);return h._visible=u,d.elements=[{type:"label",optionScope:"label",properties:h,initProperties:d.initProperties}],d}}yo.id="lineAnnotation";const n_={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};yo.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},n_),fill:!1,length:12,start:Object.assign({},n_),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,hitTolerance:0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},go.defaults.callout),color:"#fff",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,hitTolerance:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},yo.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},yo.defaultRoutes={borderColor:"color"};function vP(n,{mouseX:t,mouseY:e},i,{hitSize:r,useFinalPosition:s}){const a=wP(t,e,n.getProps(["x","y","x2","y2"],s),i);return Ty(a,r)||nd(n,{mouseX:t,mouseY:e},s,i)}function SP({x:n,y:t,x2:e,y2:i},{top:r,right:s,bottom:a,left:l}){return!(n<l&&e<l||n>s&&e>s||t<r&&i<r||t>a&&i>a)}function i_({x:n,y:t},e,{top:i,right:r,bottom:s,left:a}){return n<a&&(t=Qy(a,{x:n,y:t},e),n=a),n>r&&(t=Qy(r,{x:n,y:t},e),n=r),t<i&&(n=td(i,{x:n,y:t},e),t=i),t>s&&(n=td(s,{x:n,y:t},e),t=s),{x:n,y:t}}function TP(n,t,e){const{x:i,y:r}=i_(n,t,e),{x:s,y:a}=i_(t,n,e);return{x:i,y:r,x2:s,y2:a,width:Math.abs(s-i),height:Math.abs(a-r)}}function MP(n,{mouseX:t,mouseY:e},i=mr,r){const{x:s,y:a,x2:l,y2:u}=n.getProps(["x","y","x2","y2"],r),d=l-s,h=u-a,g=mo(d)+mo(h),y=g===0?-1:((t-s)*d+(e-a)*h)/g;let _,x;return y<0?(_=s,x=a):y>1?(_=l,x=u):(_=s+y*d,x=a+y*h),mo(t-_)+mo(e-x)<=i}function nd(n,{mouseX:t,mouseY:e},i,r){const s=n.label;return s.options.display&&s.inRange(t,e,r,i)}function kP(n,t,e){const i=e.borderWidth,r=we(e.padding),s=rl(n.ctx,e),a=s.width+r.width+i,l=s.height+r.height+i;return CP(t,e,{width:a,height:l,padding:r},n.chartArea)}function DP(n){const{x:t,y:e,x2:i,y2:r}=n,s=Math.atan2(r-e,i-t);return s>Rt/2?s-Rt:s<Rt/-2?s+Rt:s}function CP(n,t,e,i){const{width:r,height:s,padding:a}=e,{xAdjust:l,yAdjust:u}=t,d={x:n.x,y:n.y},h={x:n.x2,y:n.y2},g=t.rotation==="auto"?DP(n):xe(t.rotation),y=OP(r,s,g),_=AP(n,t,{labelSize:y,padding:a},i),x=n.cp?ed(d,n.cp,h,_):Ju(d,h,_),v={size:y.w,min:i.left,max:i.right,padding:a.left},M={size:y.h,min:i.top,max:i.bottom,padding:a.top},C=s_(x.x,v)+l,R=s_(x.y,M)+u;return{x:C-r/2,y:R-s/2,x2:C+r/2,y2:R+s/2,centerX:C,centerY:R,pointX:x.x,pointY:x.y,width:r,height:s,rotation:xa(g)}}function OP(n,t,e){const i=Math.cos(e),r=Math.sin(e);return{w:Math.abs(n*i)+Math.abs(t*r),h:Math.abs(n*r)+Math.abs(t*i)}}function AP(n,t,e,i){let r;const s=RP(n,i);return t.position==="start"?r=r_({w:n.x2-n.x,h:n.y2-n.y},e,t,s):t.position==="end"?r=1-r_({w:n.x-n.x2,h:n.y-n.y2},e,t,s):r=ju(1,t.position),r}function r_(n,t,e,i){const{labelSize:r,padding:s}=t,a=n.w*i.dx,l=n.h*i.dy,u=a>0&&(r.w/2+s.left-i.x)/a,d=l>0&&(r.h/2+s.top-i.y)/l;return el(Math.max(u,d),0,.25)}function RP(n,t){const{x:e,x2:i,y:r,y2:s}=n,a=Math.min(r,s)-t.top,l=Math.min(e,i)-t.left,u=t.bottom-Math.max(r,s),d=t.right-Math.max(e,i);return{x:Math.min(l,d),y:Math.min(a,u),dx:l<=d?1:-1,dy:a<=u?1:-1}}function s_(n,t){const{size:e,min:i,max:r,padding:s}=t,a=e/2;return e>r-i?(r+i)/2:(i>=n-s-a&&(n=i+s+a),r<=n+s+a&&(n=r-s-a),n)}function o_(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:a_(n,e),endAdjust:a_(n,i)}}function a_(n,t){if(!t||!t.display)return 0;const{length:e,width:i}=t,r=n.options.borderWidth/2,s={x:e,y:i+r};return Math.abs(td(0,s,{x:0,y:r}))}function id(n,t,e,i){if(!i||!i.display)return;const{length:r,width:s,fill:a,backgroundColor:l,borderColor:u}=i,d=Math.abs(t-r)+e;n.beginPath(),Zr(n,i),li(n,i),n.moveTo(d,-s),n.lineTo(t+e,0),n.lineTo(d,s),a===!0?(n.fillStyle=l||u,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=i.borderShadowColor,n.stroke()}function EP(n,t,e){const{x:i,y:r,x2:s,y2:a,centerX:l,centerY:u}=n,d=Math.atan2(a-r,s-i),h=Gu(t.controlPoint,0),g={x:l+Li(e,h.x,!1),y:u+Li(e,h.y,!1)};return gr(g,{x:l,y:u},d)}function l_(n,{x:t,y:e},{angle:i,adjust:r},s){!s||!s.display||(n.save(),n.translate(t,e),n.rotate(i),id(n,0,-r,s),n.restore())}function PP(n,t,e,i){const{x:r,y:s,x2:a,y2:l,options:u}=t,{startOpts:d,endOpts:h,startAdjust:g,endAdjust:y}=o_(t),_={x:r,y:s},x={x:a,y:l},v=e_(_,e,x,0),M=e_(_,e,x,1)-Rt,C=ed(_,e,x,g/i),R=ed(_,e,x,1-y/i),F=new Path2D;n.beginPath(),F.moveTo(C.x,C.y),F.quadraticCurveTo(e.x,e.y,R.x,R.y),n.shadowColor=u.borderShadowColor,n.stroke(F),t.path=F,t.ctx=n,l_(n,C,{angle:v,adjust:g},d),l_(n,R,{angle:M,adjust:y},h)}class _o extends Ve{inRange(t,e,i,r){const s=this.options.rotation,a=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return IP({x:t,y:e},this.getProps(["width","height","centerX","centerY"],r),s,a);const{x:l,y:u,x2:d,y2:h}=this.getProps(["x","y","x2","y2"],r),g=i==="y"?{start:u,end:h}:{start:l,end:d},y=gr({x:t,y:e},this.getCenterPoint(r),xe(-s));return y[i]>=g.start-a-mr&&y[i]<=g.end+a+mr}getCenterPoint(t){return yr(this,t)}draw(t){const{width:e,height:i,centerX:r,centerY:s,options:a}=this;t.save(),il(t,this.getCenterPoint(),a.rotation),Zr(t,this.options),t.beginPath(),t.fillStyle=a.backgroundColor;const l=li(t,a);t.ellipse(r,s,i/2,e/2,Rt/2,0,2*Rt),t.fill(),l&&(t.shadowColor=a.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return $y(t,e)}}_o.id="ellipseAnnotation",_o.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},Jr.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},_o.defaultRoutes={borderColor:"color",backgroundColor:"color"},_o.descriptors={label:{_fallback:!0}};function IP(n,t,e,i){const{width:r,height:s,centerX:a,centerY:l}=t,u=r/2,d=s/2;if(u<=0||d<=0)return!1;const h=xe(e||0),g=Math.cos(h),y=Math.sin(h),_=Math.pow(g*(n.x-a)+y*(n.y-l),2),x=Math.pow(y*(n.x-a)-g*(n.y-l),2);return _/Math.pow(u+i,2)+x/Math.pow(d+i,2)<=1.0001}class al extends Ve{inRange(t,e,i,r){const{x:s,y:a,x2:l,y2:u,width:d}=this.getProps(["x","y","x2","y2","width"],r),h=(this.options.borderWidth+this.options.hitTolerance)/2;return i!=="x"&&i!=="y"?CE({x:t,y:e},this.getCenterPoint(r),d/2,h):Ty(i==="y"?{start:a,end:u,value:e}:{start:s,end:l,value:t},h)}getCenterPoint(t){return yr(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,Zr(t,e);const r=li(t,e);NE(t,this,this.centerX,this.centerY),r&&!nl(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=Vy(t,e);return i.initProperties=Xr(t,i,e),i}}al.id="pointAnnotation",al.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,pointStyle:"circle",radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},al.defaultRoutes={borderColor:"color",backgroundColor:"color"};class ll extends Ve{inRange(t,e,i,r){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&NP(this.elements,t,e,r);const s=gr({x:t,y:e},this.getCenterPoint(r),xe(-this.options.rotation)),a=this.elements.map(d=>i==="y"?d.bY:d.bX),l=Math.min(...a),u=Math.max(...a);return s[i]>=l&&s[i]<=u}getCenterPoint(t){return yr(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Zr(t,i);const r=li(t,i);let s=!0;for(const a of e)s?(t.moveTo(a.x,a.y),s=!1):t.lineTo(a.x,a.y);t.closePath(),t.fill(),r&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){const i=Vy(t,e),{sides:r,rotation:s}=e,a=[],l=2*Rt/r;let u=s*Yc;for(let d=0;d<r;d++,u+=l){const h=LP(i,e,u);h.initProperties=Xr(t,i,e),a.push(h)}return i.elements=a,i}}ll.id="polygonAnnotation",ll.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,point:{radius:0},radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,sides:3,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},ll.defaultRoutes={borderColor:"color",backgroundColor:"color"};function LP({centerX:n,centerY:t},{radius:e,borderWidth:i,hitTolerance:r},s){const a=(i+r)/2,l=Math.sin(s),u=Math.cos(s),d={x:n+l*e,y:t-u*e};return{type:"point",optionScope:"point",properties:{x:d.x,y:d.y,centerX:d.x,centerY:d.y,bX:n+l*(e+a),bY:t-u*(e+a)}}}function NP(n,t,e,i){let r=!1,s=n[n.length-1].getProps(["bX","bY"],i);for(const a of n){const l=a.getProps(["bX","bY"],i);l.bY>e!=s.bY>e&&t<(s.bX-l.bX)*(e-l.bY)/(s.bY-l.bY)+l.bX&&(r=!r),s=l}return r}const Ni={box:Jr,doughnutLabel:ol,ellipse:_o,label:go,line:yo,point:al,polygon:ll};Object.keys(Ni).forEach(n=>{se.describe(`elements.${Ni[n].id}`,{_fallback:"plugins.annotation.common"})});const BP={update:Object.assign},FP=Qu.concat(sl),c_=(n,t)=>Pt(t)?od(n,t):n,rd=n=>n==="color"||n==="font";function sd(n="line"){return Ni[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function zP(n,t,e,i){const r=HP(n,e.animations,i),s=t.annotations,a=$P(t.elements,s);for(let l=0;l<s.length;l++){const u=s[l],d=u_(a,l,u.type),h=u.setContext(VP(n,d,a,u)),g=d.resolveElementProperties(n,h);g.skip=UP(g),"elements"in g&&(WP(d,g.elements,h,r),delete g.elements),en(d.x)||Object.assign(d,g),Object.assign(d,g.initProperties),g.options=d_(h),r.update(d,g)}}function UP(n){return isNaN(n.x)||isNaN(n.y)}function HP(n,t,e){return e==="reset"||e==="none"||e==="resize"?BP:new su(n,t)}function WP(n,t,e,i){const r=n.elements||(n.elements=[]);r.length=t.length;for(let s=0;s<t.length;s++){const a=t[s],l=a.properties,u=u_(r,s,a.type,a.initProperties),d=e[a.optionScope].override(a);l.options=d_(d),i.update(u,l)}}function u_(n,t,e,i){const r=Ni[sd(e)];let s=n[t];return(!s||!(s instanceof r))&&(s=n[t]=new r,Object.assign(s,i)),s}function d_(n){const t=Ni[sd(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,od(n,t.defaults),od(n,t.defaultRoutes));for(const i of FP)e[i]=n[i];return e}function od(n,t){const e={};for(const i of Object.keys(t)){const r=t[i],s=n[i];rd(i)&&Yt(s)?e[i]=s.map(a=>c_(a,r)):e[i]=c_(s,r)}return e}function VP(n,t,e,i){return t.$context||(t.$context=Object.assign(Object.create(n.getContext()),{element:t,get elements(){return e.filter(r=>r&&r.options)},id:i.id,type:"annotation"}))}function $P(n,t){const e=t.length,i=n.length;if(i<e){const r=e-i;n.splice(i,0,...new Array(r))}else i>e&&n.splice(e,i-e);return n}var YP="3.1.0";const Bi=new Map,f_=n=>n.type!=="doughnutLabel",qP=Qu.concat(sl);var h_={id:"annotation",version:YP,beforeRegister(){OE("chart.js","4.0",rn.version)},afterRegister(){rn.register(Ni)},afterUnregister(){rn.unregister(Ni)},beforeInit(n){Bi.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=Bi.get(n),r=i.annotations=[];let s=e.annotations;Pt(s)?Object.keys(s).forEach(a=>{const l=s[a];Pt(l)&&(l.id=a,r.push(l))}):Yt(s)&&r.push(...s),cP(r.filter(f_),n.scales)},afterDataLimits(n,t){const e=Bi.get(n);lP(n,t.scale,e.annotations.filter(f_).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=Bi.get(n);iP(n,i,e),zP(n,i,e,t.mode),i.visibleElements=i.elements.filter(r=>!r.skip&&r.options.display),aP(n,i,e)},beforeDatasetsDraw(n,t,e){bo(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){bo(n,"afterDatasetsDraw",e.clip)},beforeDatasetDraw(n,t,e){bo(n,t.index,e.clip)},beforeDraw(n,t,e){bo(n,"beforeDraw",e.clip)},afterDraw(n,t,e){bo(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const i=Bi.get(n);rP(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){Bi.delete(n)},getAnnotations(n){const t=Bi.get(n);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(n,t,e){return qu(n,t,e)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"},colors:{properties:["backgroundColor","borderColor"],type:"color"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:n=>!qP.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${Ni[sd(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:rd,_fallback:!0},_indexable:rd}},additionalOptionScopes:[""]};function bo(n,t,e){const{ctx:i,chartArea:r}=n,s=Bi.get(n);e&&qs(i,r);const a=jP(s.visibleElements,t).sort((l,u)=>l.element.options.z-u.element.options.z);for(const l of a)GP(i,r,s,l);e&&js(i)}function jP(n,t){const e=[];for(const i of n)if(i.options.drawTime===t&&e.push({element:i,main:!0}),i.elements&&i.elements.length)for(const r of i.elements)r.options.display&&r.options.drawTime===t&&e.push({element:r});return e}function GP(n,t,e,i){const r=i.element;i.main?(Ky(e,r,"beforeDraw"),r.draw(n,t),Ky(e,r,"afterDraw")):r.draw(n,t)}const KP={class:"zoom-timerange-container"},XP={class:"zoom-timerange-details"},ZP={class:"label","data-testid":"zoom-timerange-from"},QP={class:"label","data-testid":"zoom-timerange-to"},JP=p.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{},granularity:{}},setup(n){const t=n,{i18n:e}=kt.useI18n(),i=p.ref(fo({tickValue:t.start,granularity:t.granularity})),r=p.ref(fo({tickValue:t.end,granularity:t.granularity})),s=(a,l)=>{Jm(()=>{i.value=fo({tickValue:a,granularity:t.granularity}),r.value=fo({tickValue:l,granularity:t.granularity})},100)()};return p.watch(()=>[t.start,t.end],([a,l])=>{s(a,l)},{immediate:!0}),(a,l)=>(p.openBlock(),p.createElementBlock("div",KP,[p.createElementVNode("div",XP,[p.createElementVNode("div",ZP,p.toDisplayString(p.unref(e).t("zoom_time_range.from")),1),p.createElementVNode("div",null,p.toDisplayString(i.value),1),p.createElementVNode("div",QP,p.toDisplayString(p.unref(e).t("zoom_time_range.to")),1),p.createElementVNode("div",null,p.toDisplayString(r.value),1)])]))}}),an=(n,t)=>{const e=n.__vccOpts||n;for(const[i,r]of t)e[i]=r;return e},p_=an(JP,[["__scopeId","data-v-4fa681cf"]]),t2={class:"zoom-actions-container"},e2={class:"zoom-actions-heading"},n2={class:"zoom-action-select"},i2=["data-testid"],r2=["aria-disabled","href"],s2=["onClick"],o2=an(p.defineComponent({__name:"ZoomActions",props:{zoomActionItems:{},newTimeRange:{},granularity:{}},emits:["onAction"],setup(n,{emit:t}){const e=n,i=t,r=s=>{s.action&&(s.action(e.newTimeRange),i("onAction"))};return(s,a)=>(p.openBlock(),p.createElementBlock("div",t2,[p.createElementVNode("div",e2,[p.createVNode(p_,{end:n.newTimeRange.end,granularity:n.granularity,start:n.newTimeRange.start},null,8,["end","granularity","start"]),p.createVNode(p.unref(Ss.CloseIcon),{class:"zoom-actions-close-icon",color:`var(--kui-color-text-neutral, ${p.unref(kc)})`,size:`var(--kui-icon-size-30, ${p.unref(Os)})`,onClick:a[0]||(a[0]=l=>s.$emit("onAction"))},null,8,["color","size"])]),a[2]||(a[2]=p.createElementVNode("div",{class:"zoom-actions-heading-divider"},null,-1)),p.createElementVNode("div",n2,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(n.zoomActionItems,l=>(p.openBlock(),p.createElementBlock("div",{key:l.key,class:p.normalizeClass(["zoom-action-item",{disabled:l.disabled}]),"data-testid":`zoom-action-item-${l.key}`},[l.href?(p.openBlock(),p.createElementBlock("a",{key:0,"aria-disabled":l.disabled,class:"zoom-action-link",href:l.href,onClick:a[1]||(a[1]=u=>s.$emit("onAction"))},p.toDisplayString(l.label),9,r2)):(p.openBlock(),p.createElementBlock("div",{key:1,onClick:u=>r(l)},p.toDisplayString(l.label),9,s2))],10,i2))),128))])]))}}),[["__scopeId","data-v-79ba72f8"]]),a2={key:2},l2={class:"tooltip-title"},c2={class:"title"},u2={key:0,class:"subtitle"},d2={class:"context"},f2={class:"metric"},h2={class:"tooltip"},p2={key:0},g2={class:"display-value"},xo=an(p.defineComponent({__name:"ChartTooltip",props:{state:{},tooltipTitle:{default:""},absoluteLeft:{default:"0px"},absoluteTop:{default:"0px"},zoomTimeRange:{default:void 0},zoomActionItems:{default:void 0},granularity:{default:void 0}},emits:["dimensions","onAction"],setup(n,{emit:t}){const e=t,i=n,r=p.ref(null),{x:s,y:a,isDragging:l}=lR(r,{initialValue:{x:parseFloat(i.absoluteLeft),y:parseFloat(i.absoluteTop)}}),u=p.computed(()=>`${a.value}px`),d=p.computed(()=>`${s.value}px`),h=p.computed(()=>i.state.tooltipContext),g=p.computed(()=>i.state.metricDisplay),y=p.computed(()=>["interactive","zoom-interactive"].includes(i.state.interactionMode));return p.watch(()=>[i.absoluteLeft,i.absoluteTop],([_,x])=>{l.value||(s.value=parseFloat(_),a.value=parseFloat(x))}),p.watch(l,_=>{_?document.body.classList.add("no-select"):document.body.classList.remove("no-select")}),p.watch(r,_=>{if(_){const{width:x,height:v}=_.getBoundingClientRect();e("dimensions",{width:x,height:v})}}),(_,x)=>n.state.showTooltip?(p.openBlock(),p.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:r,class:p.normalizeClass(["tooltip-container",{locked:n.state.interactionMode==="interactive"}]),style:p.normalizeStyle({transform:y.value?`translate(${d.value}, ${u.value})`:`translate(${n.absoluteLeft}, ${n.absoluteTop})`,left:"0",top:"0",pointerEvents:y.value?"all":"none"})},[n.state.interactionMode==="selecting-chart-area"&&n.granularity&&n.zoomTimeRange&&n.zoomTimeRange.end&&n.zoomTimeRange.start?(p.openBlock(),p.createBlock(p_,{key:0,end:n.zoomTimeRange?.end,granularity:n.granularity,start:n.zoomTimeRange?.start},null,8,["end","granularity","start"])):n.state.interactionMode==="zoom-interactive"&&n.zoomTimeRange&&n.zoomActionItems&&n.granularity?(p.openBlock(),p.createBlock(o2,{key:1,granularity:n.granularity,"new-time-range":n.zoomTimeRange,"zoom-action-items":n.zoomActionItems,onOnAction:x[0]||(x[0]=v=>e("onAction"))},null,8,["granularity","new-time-range","zoom-action-items"])):(p.openBlock(),p.createElementBlock("div",a2,[p.createElementVNode("div",l2,[p.createElementVNode("div",c2,[p.createElementVNode("div",null,p.toDisplayString(n.tooltipTitle),1),y.value?(p.openBlock(),p.createBlock(p.unref(Ss.DragIcon),{key:0,class:"drag-icon",color:`var(--kui-color-text-neutral, ${p.unref(kc)})`,size:`var(--kui-icon-size-30, ${p.unref(Os)})`},null,8,["color","size"])):p.createCommentVNode("",!0)]),h.value||g.value?(p.openBlock(),p.createElementBlock("div",u2,[p.createElementVNode("div",d2,p.toDisplayString(h.value),1),p.createElementVNode("div",f2,p.toDisplayString(g.value),1)])):p.createCommentVNode("",!0)]),p.createElementVNode("ul",h2,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(n.state.tooltipSeries,({backgroundColor:v,borderColor:M,label:C,value:R,isSegmentEmpty:F},I)=>(p.openBlock(),p.createElementBlock(p.Fragment,{key:C+I},[n.state.tooltipSeries.length?(p.openBlock(),p.createElementBlock("li",p2,[p.createElementVNode("div",{class:"square-marker",style:p.normalizeStyle({background:String(v),borderColor:String(M)})},null,4),p.createElementVNode("span",{class:p.normalizeClass(["display-label",{empty:F}])},p.toDisplayString(C),3),p.createElementVNode("span",g2,p.toDisplayString(R),1)])):p.createCommentVNode("",!0)],64))),128))])]))],6)):p.createCommentVNode("",!0)}}),[["__scopeId","data-v-34c60646"]]),m2={key:0,class:"legend-container","data-testid":"legend"},y2=["onClick"],_2=["title"],b2={class:"label truncate-label"},x2={key:0,class:"sub-label"},w2={class:"tooltip-content"},cl=an(p.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){const t=n,{i18n:e}=kt.useI18n(),i=p.inject("showLegendValues",!1),r=p.inject("legendPosition",p.ref(Pe.Bottom)),s=(l=0,u)=>{if(t.chartInstance===null)return;const d=t.chartInstance instanceof rn?t.chartInstance:t.chartInstance.chart,h=a(l,u);!d.getDatasetMeta(l).dataset&&u!==void 0?d.toggleDataVisibility(u):h?d.hide(l,u):d.show(l,u),d.update()},a=(l=0,u)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const d=t.chartInstance instanceof rn?t.chartInstance:t.chartInstance.chart;return d.getDatasetMeta(l).dataset||u===void 0?d.isDatasetVisible(l):d.getDataVisibility(u)};return(l,u)=>{const d=p.resolveComponent("KTooltip");return p.unref(r)!==p.unref(Pe).Hidden?(p.openBlock(),p.createElementBlock("ul",m2,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(n.items,({fillStyle:h,strokeStyle:g,text:y,datasetIndex:_,index:x,value:v,isSegmentEmpty:M})=>(p.openBlock(),p.createElementBlock("li",{key:y,onClick:C=>s(_,x)},[p.createElementVNode("div",{class:"square-marker",style:p.normalizeStyle({background:h,"border-color":g})},null,4),p.createVNode(d,null,p.createSlots({default:p.withCtx(()=>[p.createElementVNode("div",{class:p.normalizeClass(["label-container",{"strike-through":!a(_,x)}]),title:v&&p.unref(i)?`${y}: ${v.formatted}`:y},[p.createElementVNode("div",b2,p.toDisplayString(y),1),v&&p.unref(i)?(p.openBlock(),p.createElementBlock("div",x2,p.toDisplayString(v.formatted),1)):p.createCommentVNode("",!0)],10,_2)]),_:2},[M?{name:"content",fn:p.withCtx(()=>[p.createElementVNode("div",w2,p.toDisplayString(p.unref(e).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],8,y2))),128))])):p.createCommentVNode("",!0)}}}),[["__scopeId","data-v-388cf4f5"]]),Ie=[];for(let n=0;n<256;++n)Ie.push((n+256).toString(16).slice(1));function v2(n,t=0){return(Ie[n[t+0]]+Ie[n[t+1]]+Ie[n[t+2]]+Ie[n[t+3]]+"-"+Ie[n[t+4]]+Ie[n[t+5]]+"-"+Ie[n[t+6]]+Ie[n[t+7]]+"-"+Ie[n[t+8]]+Ie[n[t+9]]+"-"+Ie[n[t+10]]+Ie[n[t+11]]+Ie[n[t+12]]+Ie[n[t+13]]+Ie[n[t+14]]+Ie[n[t+15]]).toLowerCase()}const S2=new Uint8Array(16);function T2(){return crypto.getRandomValues(S2)}function ad(n,t,e){return crypto.randomUUID?crypto.randomUUID():M2(n)}function M2(n,t,e){n=n||{};const i=n.random??n.rng?.()??T2();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,v2(i)}const g_=(n,t)=>{const e=n.ctx,i=n.scales.y,r=n.scales.x,s=t[t.length-1].element;e.save(),e.strokeStyle="rgba(100, 100, 100, 1)",e.lineWidth=3,n.options.indexAxis==="x"?e.strokeRect(s.x-s.width/2,s.y,s.width,i.bottom-s.y):e.strokeRect(r.left,s.y-s.height/2,s.x-r.left,s.height),e.restore()};class m_{id="highlightPlugin";_clickedElements;_previousHoverOption;_clicked=!1;_pause=!1;_suppressNextClick=!1;afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&g_(t,this._clickedElements)}afterEvent(t,{event:e}){if(e.type==="click"&&this._suppressNextClick){this._suppressNextClick=!1;return}if(e.type!=="click"||!e.native||this._pause)return;this._clicked=!this._clicked;const i=t.options.interaction?.mode||"index",r=t.getElementsAtEventForMode(e.native,i,{intersect:!1},!0);r.length&&this._clicked?(this._clickedElements=r,g_(t,this._clickedElements),this._previousHoverOption=t.options.hover,t.options.hover={mode:null}):(delete this._clickedElements,t.options.hover=this._previousHoverOption||t.options.hover,this._clicked=!1)}beforeDestroy(t){delete this._clickedElements,t.options.hover=this._previousHoverOption||t.options.hover,this._clicked=!1}pause(){this._pause=!0}get isPaused(){return this._pause}resume(t=!1){this._pause=!1,t&&(this._suppressNextClick=!0)}}const k2=["id"],D2=["id"],C2={class:"axis-tooltip-content"},O2="100%",A2="100%",R2=20,E2=20,y_=6,P2=0,I2=10,L2=10,N2=1,B2=an(p.defineComponent({__name:"StackedBarChart",props:{chartData:{},tooltipTitle:{default:""},legendValues:{default:void 0},metricUnit:{default:""},orientation:{default:"horizontal"},annotations:{type:Boolean,default:!0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},stacked:{type:Boolean,default:!0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},tooltipMetricDisplay:{default:""}},setup(n){const t=n,{i18n:e}=kt.useI18n(),{translateUnit:i}=kt.useTranslatedUnits(),r=crypto.randomUUID(),s=crypto.randomUUID(),a=new m_,l=p.useTemplateRef("chartContainer"),u=p.useTemplateRef("chartParent"),d=({chart:et},ht)=>{const ft=et.data,ct=ft.labels?.indexOf(ht);return ft.datasets.reduce((mt,ut,Lt)=>{if(et.isDatasetVisible(Lt)){const zt=ut.data[ct];return isNaN(zt)?mt:mt+zt}else return mt},0)},h=(et,ht,ft,ct)=>{const mt=ct==="horizontal";ht===null&&(ht=e.t("entityNoName"));const ut={type:"label",yValue:vt=>mt?ht:d(vt,ht),xValue:vt=>mt?d(vt,ht):ht},Lt={...ut,position:mt?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>mt?0:-Math.abs(AR()),content:vt=>ny(d(vt,ht),ft)},zt={...ut,content:vt=>ER(d(vt,ht),RR(vt.chart,et)),position:mt?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:vt=>mt?OR(ny(d(vt,ht),ft)):0,color:vR};return{[`${ht}-value`]:Lt,[`${ht}-percent`]:zt}},g=p.useTemplateRef("canvas"),y=p.useTemplateRef("axis"),_=ad(),x=ad(),v=p.ref([]),M=p.inject("legendPosition",Pe.Bottom),C=p.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),R=p.toRef(t,"metricUnit"),F=p.computed(()=>t.orientation==="horizontal"),I=p.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:p.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:p.toRef(t,"dimensionAxesTitle"),tooltipSeries:[],left:"",top:"",units:p.toRef(t,"metricUnit"),translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,interactionMode:"idle",chartType:F.value?"horizontal_bar":"vertical_bar",chartID:s,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:L,tooltipAbsoluteTop:N}=kt.useTooltipAbsolutePosition(u,I),B=p.ref(0),T=()=>t.annotations&&t.chartData.labels?.reduce((et,ht)=>Object.assign(et,h(t.chartData,ht,R.value,t.orientation)),{}),S={id:_,afterUpdate(et){B.value+=1,v.value=Cu(et,t.legendValues,t.chartLegendSortFn)}},O={id:x,afterUpdate(et){et.options.plugins.annotation.annotations=t.annotations?T():{}}},$=[S,{id:"axisHover",afterEvent(et,ht){if(C.show=!1,ht.event.type==="mousemove"){const ft=ht.event,ct=et.options.indexAxis,mt=et.scales,ut=et.scales[ct].getLabelForValue(Number(et.scales[ct].getValueForPixel(ft[ct]))),zt=et.scales[ct].getLabels().indexOf(ut),vt=t.chartData.isLabelEmpty?.[zt];if((Dt=>Dt==="x"?ft.y>mt.x.top:ft.x<mt.y.right)(ct)){I.interactionMode!=="interactive"&&(I.showTooltip=!1);const ve=et.canvas.getContext("2d").measureText(ut).width,bt=Math.abs(Math.round(ft.x-ve*.5)),qt=Math.round(ft.x+ve*.5),Oe=et.canvas.getBoundingClientRect(),Ae=40;C.left=ct==="x"?`${(bt>0?bt:qt)-C.offset+Oe.left}px`:`${ft.x-ve*.5-C.offset+Oe.left}px`,C.top=`${ft.y-Ae+Oe.top}px`,ut.length>Xa?(C.show=!0,C.text=ut):vt?(C.text=e.t("emptyEntityInfo"),C.show=!0):C.show=!1}else C.show=!1}}},a,...t.annotations?[O]:[]],it=p.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),at=p.ref(0),ot=p.ref(0),q=new ResizeObserver(Jm(et=>{at.value=et[0].contentRect.width,ot.value=et[0].contentRect.height},100)),J=p.computed(()=>{const et=t.chartData?.labels?.length;return g.value&&et&&!F.value?`${Math.max(et*(R2+y_),at.value)}px`:O2}),rt=p.computed(()=>{const et=t.chartData?.labels?.length;return g.value&&et&&F.value?`${Math.max(et*(E2+y_),ot.value)}px`:A2});kt.useReportChartDataForSynthetics(p.toRef(t,"chartData"),p.toRef(t,"syntheticsDataKey")),p.onMounted(()=>{t.annotations&&rn.register(h_),l.value&&(at.value=l.value.offsetWidth,ot.value=l.value.offsetHeight,q.observe(l.value))}),p.onUnmounted(()=>{l.value&&q.unobserve(l.value)});const tt=p.computed(()=>{const et=kt.useBarChartOptions({tooltipState:I,legendID:_,stacked:p.toRef(t,"stacked"),metricAxesTitle:p.toRef(t,"metricAxesTitle"),dimensionAxesTitle:p.toRef(t,"dimensionAxesTitle"),indexAxis:F.value?"y":"x",numLabels:it});return{...et.value,plugins:{...et.value.plugins,annotation:{annotations:T(),clip:!1}}}}),G=kt.useChartJSCommon("bar",g,p.toRef(t,"chartData"),$,tt);p.onBeforeUnmount(()=>{rn.unregister(h_)});const P={[Pe.Bottom]:"column"},W=p.computed(()=>{if(y.value&&G.value){const et=window.devicePixelRatio,ht=G.value,ft=ht.scales.y.width*et+N2,ct=(ht.scales.y.height+ht.scales.y.top+ht.scales.x.height)*et,mt=y.value.getContext("2d");return mt.scale(et,et),mt.canvas.width=ft,mt.canvas.height=ct,mt.canvas.style.width=`${ft/et}px`,mt.canvas.style.height=`${ct/et}px`,{scale:et,width:ft*et,height:ct*et,targetCtx:mt}}return null}),j=et=>{const ht=et.target;if(W.value&&G.value&&!F.value){const ft=W.value.scale,ct=W.value.targetCtx,mt=W.value.width,ut=W.value.height,Lt=G.value,zt=Lt.canvas;ct.fillStyle="white",ht.scrollLeft>=P2&&ht.scrollLeft<=I2?(ct.globalCompositeOperation="source-over",ct.clearRect(0,0,mt,ut),ct.drawImage(zt,0,0,mt,ut,0,0,mt,ut),ct.globalCompositeOperation="destination-over",ct.fillRect(0,0,mt,ut)):(ct.globalCompositeOperation="source-over",ct.fillRect(0,(Lt.scales.y.height+Lt.scales.y.top+L2)*ft,mt,Lt.scales.x.height*ft))}I.offsetY=ht.scrollTop,I.offsetX=ht.scrollLeft,C.offset=ht.scrollLeft},pt=({width:et,height:ht})=>{I.width=et,I.height=ht};p.watch(()=>t.orientation,()=>{if(y.value&&W.value){const et=W.value.width,ht=W.value.height;(y.value?.getContext("2d")).clearRect(0,0,et,ht)}I.showTooltip=!1,I.interactionMode="idle"}),p.watch(()=>t.annotations,et=>{G.value&&(et?G.value.options.plugins.annotation.annotations=T(t.chartData):delete G.value.options.plugins.annotation.annotations)});const lt=()=>{I.showTooltip&&(I.interactionMode!=="idle"?I.interactionMode="idle":I.interactionMode="interactive")};return(et,ht)=>(p.openBlock(),p.createElementBlock("div",{ref:"chartParent",class:p.normalizeClass(["chart-parent",P[p.unref(M)]])},[p.createElementVNode("canvas",{id:p.unref(r),ref:"axis",class:"axis"},null,8,k2),p.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:ht[0]||(ht[0]=ft=>lt()),onScroll:j},[p.createElementVNode("div",{class:"chart-body",style:p.normalizeStyle({width:J.value,height:rt.value})},[p.createElementVNode("canvas",{id:p.unref(s),ref:"canvas",class:"chart-canvas"},null,8,D2)],4)],544),(p.openBlock(),p.createBlock(p.Teleport,{to:"body"},[C.show?(p.openBlock(),p.createElementBlock("div",{key:0,class:"axis-tooltip",style:p.normalizeStyle({top:C.top,left:C.left}),width:"auto"},[p.createElementVNode("div",C2,p.toDisplayString(C.text),1)],4)):p.createCommentVNode("",!0),p.createVNode(xo,{"absolute-left":p.unref(L),"absolute-top":p.unref(N),"chart-parent-ref":u.value,state:I,"tooltip-title":n.tooltipTitle,onDimensions:pt},null,8,["absolute-left","absolute-top","chart-parent-ref","state","tooltip-title"])])),p.createVNode(cl,{id:p.unref(_),"chart-instance":p.unref(G),items:v.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-60e5a1a7"]]);const F2={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};Cg._date.override({_id:"date-fns",formats:function(){return F2},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=At(n):e==="string"&&(typeof t=="string"?n=VT(n,t,new Date,this.options):n=_p(n,this.options)),Ac(n)?n.getTime():null},format:function(n,t){return ua(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return Cc(n,t);case"second":return F1(n,t);case"minute":return N1(n,t);case"hour":return P1(n,t);case"day":return la(n,t);case"week":return z1(n,t);case"month":return Dc(n,t);case"quarter":return B1(n,t);case"year":return U1(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return Rc(n,t);case"second":return G1(n,t);case"minute":return Y1(n,t);case"hour":return $1(n,t);case"day":return Xh(n,t);case"week":return K1(n,t);case"month":return tp(n,t);case"quarter":return j1(n,t);case"year":return X1(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return jT(n);case"minute":return qT(n);case"hour":return YT(n);case"day":return Oc(n);case"week":return Wn(n);case"isoWeek":return Wn(n,{weekStartsOn:+e});case"month":return Q1(n);case"quarter":return Z1(n);case"year":return ep(n);default:return n}},endOf:function(n,t){switch(t){case"second":return rS(n);case"minute":return nS(n);case"hour":return tS(n);case"day":return Qh(n);case"week":return eS(n);case"month":return Jh(n);case"quarter":return iS(n);case"year":return J1(n);default:return n}}});const __={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},z2={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...__,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},U2=p.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function ts(n){return p.isProxy(n)?p.toRaw(n):n}function H2(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return p.isProxy(t)?new Proxy(n,{}):n}function W2(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function b_(n,t){n.labels=t}function x_(n,t,e){const i=[];n.datasets=t.map(r=>{const s=n.datasets.find(a=>a[e]===r[e]);return!s||!r.data||i.includes(s)?{...r}:(i.push(s),Object.assign(s,r),s)})}function V2(n,t){const e={labels:[],datasets:[]};return b_(e,n.labels),x_(e,n.datasets,t),e}const $2=p.defineComponent({props:z2,setup(n,t){let{expose:e,slots:i}=t;const r=p.ref(null),s=p.shallowRef(null);e({chart:s});const a=()=>{if(!r.value)return;const{type:d,data:h,options:g,plugins:y,datasetIdKey:_}=n,x=V2(h,_),v=H2(x,h);s.value=new rn(r.value,{type:d,data:v,options:{...g},plugins:y})},l=()=>{const d=p.toRaw(s.value);d&&(n.destroyDelay>0?setTimeout(()=>{d.destroy(),s.value=null},n.destroyDelay):(d.destroy(),s.value=null))},u=d=>{d.update(n.updateMode)};return p.onMounted(a),p.onUnmounted(l),p.watch([()=>n.options,()=>n.data],(d,h)=>{let[g,y]=d,[_,x]=h;const v=p.toRaw(s.value);if(!v)return;let M=!1;if(g){const C=ts(g),R=ts(_);C&&C!==R&&(W2(v,C),M=!0)}if(y){const C=ts(y.labels),R=ts(x.labels),F=ts(y.datasets),I=ts(x.datasets);C!==R&&(b_(v.config.data,C),M=!0),F&&F!==I&&(x_(v.config.data,F,n.datasetIdKey),M=!0)}M&&p.nextTick(()=>{u(v)})},{deep:!0}),()=>p.h("canvas",{role:"img","aria-label":n.ariaLabel,"aria-describedby":n.ariaDescribedby,ref:r},[p.h("p",{},[i.default?i.default():""])])}});function ul(n,t){return rn.register(t),p.defineComponent({props:__,setup(e,i){let{expose:r}=i;const s=p.shallowRef(null),a=p.shallowRef(null);p.watch(()=>a.value?.chart??null,u=>{s.value=u},{flush:"sync"}),r({chart:s});const l=u=>{a.value=u};return()=>p.h($2,U2({ref:l},{type:n,...e}))}})}const w_=ul("bar",Tg),v_=ul("doughnut",Xs),S_=ul("line",Mg),Y2=ul("scatter",Dg),q2={class:"chart-container"},j2={key:0,class:"chart-center-metric"},G2={class:"chart-center-total"},K2={key:0,class:"chart-center-unit"},X2=p.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},metricName:{default:""},legendPosition:{default:Pe.Bottom},legendValues:{default:void 0},syntheticsDataKey:{default:""},datasetColors:{default:()=>ai},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""},showCenterMetric:{type:Boolean,default:!0}},setup(n){const t=n,{translateUnit:e}=kt.useTranslatedUnits(),{i18n:i}=kt.useI18n(),r=crypto.randomUUID(),s=crypto.randomUUID(),a=p.ref([]),l=p.useTemplateRef("chartParent"),u=p.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:p.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:p.toRef(t,"tooltipDimensionDisplay"),tooltipSeries:[],left:"",top:"",units:p.toRef(t,"metricUnit"),translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartID:s,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:d,tooltipAbsoluteTop:h}=kt.useTooltipAbsolutePosition(l,u),g={id:r,afterUpdate(B){a.value=B.options.plugins.legend.labels.generateLabels(B).map(T=>({...T,value:t.legendValues&&t.legendValues[T.text],hidden:!1}))}},y=p.computed(()=>[g]),_=p.computed(()=>[t.chartData.datasets.reduce((T,S)=>(T.labels.push(S.label),T.backgroundColor.push(S.backgroundColor),T.hoverBorderColor.push(Sa(S.backgroundColor).saturate(.5).darken(.15).hexString()),T.data.push(S.data.reduce((O,U)=>O+U,0)),T),{labels:[],backgroundColor:[],borderColor:"#ffffff",borderWidth:1,hoverBorderColor:[],hoverBorderWidth:1,data:[],hoverOffset:10})]),{formatUnit:x}=er({i18n:i}),v=p.computed(()=>gE(t.metricName??"")),M=p.computed(()=>{const B=_.value[0]?.data.reduce((T,S)=>T+S,0)??0;return x(B,t.metricUnit,{approximate:!0,translateUnit:(T,S)=>e(T,S)}).trim()}),C=p.computed(()=>t.tooltipMetricDisplay||""),R=p.computed(()=>({...t.chartData,datasets:_.value}));kt.useReportChartDataForSynthetics(p.toRef(t,"chartData"),p.toRef(t,"syntheticsDataKey"));const{options:F}=kt.useDonutChartOptions({tooltipState:u,legendID:r}),I=p.ref(),L=B=>({[Pe.Bottom]:"column",[Pe.Hidden]:"hidden"})[B],N=({width:B,height:T})=>{u.width=B,u.height=T};return(B,T)=>(p.openBlock(),p.createElementBlock("div",{ref:"chartParent",class:p.normalizeClass(["chart-parent",L(n.legendPosition)]),"data-testid":"donut-chart-parent"},[p.createElementVNode("div",q2,[p.createVNode(p.unref(v_),{ref_key:"chartInstance",ref:I,"chart-id":p.unref(s),data:R.value,options:p.unref(F),plugins:y.value},null,8,["chart-id","data","options","plugins"]),n.showCenterMetric&&v.value?(p.openBlock(),p.createElementBlock("div",j2,[p.createElementVNode("span",G2,p.toDisplayString(M.value),1),C.value?(p.openBlock(),p.createElementBlock("span",K2,p.toDisplayString(C.value),1)):p.createCommentVNode("",!0)])):p.createCommentVNode("",!0),(p.openBlock(),p.createBlock(p.Teleport,{to:"body"},[p.createVNode(xo,{"absolute-left":p.unref(d),"absolute-top":p.unref(h),state:u,"tooltip-title":n.tooltipTitle,unit:n.metricUnit,onDimensions:N},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),p.createVNode(cl,{id:p.unref(r),"chart-instance":I.value,items:a.value,position:n.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),Z2=an(X2,[["__scopeId","data-v-48b16272"]]);class Q2{id="outlierBandPlugin";beforeDatasetsDraw(t,e,i){const r=i?.value;if(r===void 0||!Number.isFinite(r)||!i?.color)return;const s=t.scales.y;if(!s||!t.chartArea)return;const{top:a,bottom:l,left:u,right:d}=t.chartArea,h=Math.min(Math.max(s.getPixelForValue(r),a),l);if(h<=a)return;const g=t.ctx;g.save(),g.fillStyle=i.color,g.fillRect(u,a,d-u,h-a),g.restore()}}const J2={class:"chart-container"},tI=an(p.defineComponent({__name:"ScatterChart",props:{chartData:{default:void 0},tooltipTitle:{},metricUnit:{default:""},granularity:{},timeRangeMs:{default:void 0},legendValues:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:()=>0},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},tooltipMetricDisplay:{default:""},shadeOutlierRegion:{type:Boolean,default:!1}},setup(n){const t=n,e=p.inject("legendPosition",Pe.Bottom),i=p.inject("app:konnectColorMode",p.computed(()=>"light")),{translateUnit:r}=kt.useTranslatedUnits(),s=p.useTemplateRef("chartParent"),a=new Q2,l=crypto.randomUUID(),u=crypto.randomUUID(),d=p.ref(Qa()),h=p.ref(),g=p.ref([]),y=p.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:p.toRef(t,"tooltipMetricDisplay"),tooltipSeries:[],left:"",top:"",units:p.toRef(t,"metricUnit"),translateUnit:r,offsetX:0,offsetY:0,width:0,height:0,chartType:"scatter",chartID:u,chartTooltipSortFn:t.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:_,tooltipAbsoluteTop:x}=kt.useTooltipAbsolutePosition(s,y);kt.useReportChartDataForSynthetics(p.toRef(t,"chartData"),p.toRef(t,"syntheticsDataKey")),p.onMounted(()=>{d.value=Qa(s.value)}),p.watch(i,()=>{d.value=Qa(s.value)});const v=p.computed(()=>{const N=t.legendValues;if(!N)return;const B={};for(const{label:T,total:S}of t.chartData?.datasets||[])S!==void 0&&T&&T in N&&(B[T]=N[T]);return B}),M={id:l,afterUpdate(N){g.value=Cu(N,v.value,t.chartLegendSortFn)}},C=p.computed(()=>t.shadeOutlierRegion?t.chartData?.outlierValue:void 0),R=p.computed(()=>[M,...C.value!==void 0?[a]:[]]),F=p.computed(()=>`scatter-${R.value.map(N=>N.id).join("-")}`),{options:I}=kt.useScatterChartOptions({tooltipState:y,legendID:l,granularity:p.toRef(t,"granularity"),timeRangeMs:p.toRef(t,"timeRangeMs"),metricAxesTitle:p.toRef(t,"metricAxesTitle"),dimensionAxesTitle:p.toRef(t,"dimensionAxesTitle"),outlierValue:C,themeColors:d}),L=N=>({[Pe.Bottom]:"column",[Pe.Hidden]:"hidden"})[N];return(N,B)=>(p.openBlock(),p.createElementBlock("div",{ref:"chartParent",class:p.normalizeClass(["chart-parent",L(p.unref(e))]),"data-testid":"scatter-chart-parent"},[p.createElementVNode("div",J2,[(p.openBlock(),p.createBlock(p.unref(Y2),{key:F.value,ref_key:"chartInstance",ref:h,"chart-id":p.unref(u),class:"chart-canvas",data:n.chartData,"data-testid":"scatter-chart",options:p.unref(I),plugins:R.value},null,8,["chart-id","data","options","plugins"]))]),p.createVNode(xo,{"absolute-left":p.unref(_),"absolute-top":p.unref(x),"data-testid":"tooltip",granularity:n.granularity,state:y,"tooltip-title":n.tooltipTitle},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title"]),p.createVNode(cl,{id:p.unref(l),"chart-instance":h.value,"data-testid":"legend",items:g.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-2f7608cd"]]),ld=(n,t,e,i,r="#0275d8")=>{n.save(),n.beginPath(),n.moveTo(t,e),n.lineTo(t,i),n.lineWidth=1,n.strokeStyle=r,n.stroke(),n.restore()},Ze={},eI=()=>{Ze.x=void 0,Ze.chart=void 0,Ze.strategy=void 0,Ze.group=void 0},nI=10;class T_{id="verticalLinePlugin";_clickedSegment;_pause=!1;_useBrushingState=!1;_brushStrategy;_brushGroup;constructor({brushGroup:t=void 0,brushStrategy:e=void 0,enableBrushing:i=!1}={}){let r=!1;e==="group"&&(r=t!==void 0),this._useBrushingState=i&&r,this._brushStrategy=e,this._brushGroup=t}afterEvent(t,e){if(!this._useBrushingState)return;const{event:i}=e;(i.type==="mousemove"||i.type==="mouseout")&&requestAnimationFrame(r=>this.onMouseBrush(i.type,t,r))}_lastMouseBrushEvent=0;onMouseBrush(t,e,i){if(t==="mousemove"&&i-this._lastMouseBrushEvent<nI)return;const r=()=>{Ze.chart=e,Ze.strategy=this._brushStrategy,Ze.group=this._brushGroup;for(const s of Object.values(rn.instances))s!==e&&s.update("none")};t==="mousemove"?e.tooltip&&e.tooltip.getActiveElements()&&e.tooltip.getActiveElements().length&&(Ze.x=e.tooltip.dataPoints[0].element.x,r()):t==="mouseout"&&(Ze.x=void 0,r()),this._lastMouseBrushEvent=i}afterDatasetsDraw(t){if(this.isPaused)return;const e=t.tooltip&&t.tooltip.getActiveElements()&&t.tooltip.getActiveElements().length,i=t.ctx;if(this._clickedSegment){const{x:r}=this._clickedSegment.element;ld(i,r,t.scales.y.top,t.scales.y.bottom)}else if(this._useBrushingState)this.drawByBrush(t);else if(e){const{x:r}=t.tooltip.dataPoints[0].element;ld(i,r,t.scales.y.top,t.scales.y.bottom)}}drawByBrush(t){if(Ze.x===void 0)return;const e=Ze.chart===t?"#0275d8":"rgba(2, 117, 216, 0.3)";this._brushStrategy==="group"&&Ze.group===this._brushGroup&&ld(t.ctx,Ze.x,t.scales.y.top,t.scales.y.bottom,e)}pause(){this._pause=!0}resume(){this._pause=!1}get isPaused(){return this._pause}set clickedSegment(t){this._clickedSegment=t}get clickedSegment(){return this._clickedSegment}destroyClickedSegment(){delete this._clickedSegment}beforeDestroy(t){if(this._clickedSegment&&this.destroyClickedSegment(),this._useBrushingState&&Ze.chart===t){const e=Ze.x!==void 0;if(eI(),e)for(const i of Object.values(rn.instances))i!==t&&i.update("none")}}}const iI=(n,t,e)=>{const i=n.ctx;i.save(),i.strokeStyle="rgba(95, 154, 255, 1)",i.lineWidth=2,i.beginPath(),i.moveTo(t,n.chartArea.top),i.lineTo(t,n.chartArea.bottom),i.moveTo(e,n.chartArea.top),i.lineTo(e,n.chartArea.bottom),i.stroke(),i.restore()},rI=(n,t,e)=>{const i=n.ctx;i.save(),i.fillStyle="rgba(143, 193, 255, 0.3)",i.fillRect(t,n.chartArea.top,e-t,n.chartArea.bottom-n.chartArea.top),i.restore()},M_=(n,t)=>{const e=n.scales.x.getValueForPixel(t.startX),i=n.scales.x.getValueForPixel(t.endX);if(!(e===void 0||i===void 0))return{xStart:Math.min(e,i),xEnd:Math.max(e,i)}},k_=(n,t,e)=>{t.canvas.dispatchEvent(new CustomEvent(n,{detail:e}))};class sI{id="dragSelectPlugin";_isDragging=!1;_startX=0;_endX=0;_dragTimeout;_clearSelectionArea=!0;_chart=null;_dragSelectHandlers;get startX(){return this._startX}get endX(){return this._endX}beforeInit(t){this._chart=t;const e=t.canvas;let i=!1;const r=l=>{this._dragTimeout=window.setTimeout(()=>{const u=e.getBoundingClientRect();this._isDragging=!0,this._clearSelectionArea=!1,i=!0,this._startX=l.clientX-u.left,this._endX=this._startX},150)},s=l=>{const u=e.getBoundingClientRect();if(i&&this._isDragging){this._endX=l.clientX-u.left;const d=M_(t,this);d&&k_("dragSelectMove",t,d)}},a=l=>{const u=e.getBoundingClientRect();if(clearTimeout(this._dragTimeout),i&&this._isDragging){this._endX=l.clientX-u.left,i=!1,this._isDragging=!1;const d=M_(t,this);d?k_("dragSelect",t,d):this.clearSelectionArea()}};e.addEventListener("mousedown",r),e.addEventListener("mousemove",s),e.addEventListener("mouseup",a),this._dragSelectHandlers={onMouseDown:r,onMouseMove:s,onMouseUp:a}}beforeDestroy(t){const e=t.canvas;if(this._dragSelectHandlers){const{onMouseDown:i,onMouseMove:r,onMouseUp:s}=this._dragSelectHandlers;e.removeEventListener("mousedown",i),e.removeEventListener("mousemove",r),e.removeEventListener("mouseup",s)}this._isDragging=!1,this._dragTimeout&&clearTimeout(this._dragTimeout)}afterDatasetsDraw(t){(this._isDragging||!this._clearSelectionArea)&&(rI(t,this._startX,this._endX),iI(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const oI=20,aI="rgba(255, 171, 171, 0.4)",lI="rgba(255, 196, 0, 0.2)",D_=(n,t,e)=>{const i=t.y-n.y;if(i===0)return t.x;const r=(e-n.y)/i;return n.x+r*(t.x-n.x)},cI=(n,t)=>{const e=[];return n.data.datasets.forEach(i=>{if(!n.getDatasetMeta(n.data.datasets.indexOf(i)).visible)return;const s=i.data;s?.length&&t.filter(a=>a.highlightIntersections).forEach(a=>{const l=s.map(d=>({ts:d.x,aboveThreshold:d.y>=a.value}));let u=l[0].aboveThreshold?s[0].x:void 0;for(let d=1;d<l.length;d++)!l[d-1].aboveThreshold&&l[d].aboveThreshold?u=D_(s[d-1],s[d],a.value):l[d-1].aboveThreshold&&!l[d].aboveThreshold&&u!==void 0&&(e.push({start:u,end:D_(s[d-1],s[d],a.value),type:a.type}),u=void 0);u!==void 0&&e.push({start:u,end:l[l.length-1].ts,type:a.type})})}),e},uI=n=>{if(!n.length)return[];n.sort((e,i)=>e.type.localeCompare(i.type)||e.start-i.start);const t=[];for(const e of n){const i=t.findLast(({type:r})=>r===e.type);i&&e.start<=i.end?i.end=Math.max(i.end,e.end):t.push({...e})}return t};class dI{constructor(t){this.i18n=t}i18n;id="thresholdPlugin";_thresholds;_mouseMoveHandler;_syncThresholds(t){for(const e of Object.keys(t.threshold||{})){const i=t.threshold?.[e];i&&(this._thresholds={...this._thresholds,[e]:i.map(r=>({...r,hovered:!1}))})}if(this._thresholds)for(const e of Object.keys(this._thresholds))t.threshold?.[e]||delete this._thresholds[e]}get thresholds(){return this._thresholds}beforeUpdate(t,e,i){this._syncThresholds(i)}beforeInit(t,e,i){const r=t.canvas;this._syncThresholds(i);const s=a=>{if(t){const l=a.clientY,u=t.scales.y,d=r.getBoundingClientRect(),h=u.getValueForPixel(l-d.top);if(h)for(const g of Object.keys(this._thresholds||{})){const y=this._thresholds?.[g];y&&y.forEach(_=>{_.hovered=Math.abs(_.value-h)<oI})}}};r.addEventListener("mousemove",s),this._mouseMoveHandler=s}afterDatasetsDraw(t,e){const i=t.ctx;for(const r of Object.keys(this._thresholds||{})){const s=this._thresholds?.[r];if(s){s.forEach(u=>{const h=t.scales.y.getPixelForValue(u.value);i.save(),i.beginPath(),i.moveTo(t.chartArea.left,h),i.lineTo(t.chartArea.right,h),i.lineWidth=1,i.strokeStyle=Ru(u.type),i.setLineDash([5,5]),i.stroke(),i.restore();let g="";u.label?g=`${u.label}: ${u.value}`:u.type==="warning"?g=this.i18n.t("chartLabels.threshold-warning",{value:u.value}):u.type==="error"?g=this.i18n.t("chartLabels.threshold-error",{value:u.value}):g=this.i18n.t("chartLabels.thatreshold-neutral",{value:u.value}),u.hovered&&(i.save(),i.fillStyle=Ru(u.type),i.font=dv,i.fillText(g,t.chartArea.left,h-4),i.restore())});const a=cI(t,s);uI(a).forEach(u=>{const d=t.scales.x.getPixelForValue(u.start),h=t.scales.x.getPixelForValue(u.end);i.save(),i.fillStyle=u.type==="error"?aI:lI,i.fillRect(d,t.chartArea.top,h-d,t.chartArea.bottom-t.chartArea.top),i.restore(),i.save(),i.beginPath(),i.moveTo(d,t.chartArea.bottom),i.lineTo(h,t.chartArea.bottom),i.lineWidth=2,i.strokeStyle=Ru(u.type),i.stroke(),i.restore()})}}}beforeDestroy(t){this._mouseMoveHandler&&t.canvas.removeEventListener("mousemove",this._mouseMoveHandler)}}const fI=an(p.defineComponent({__name:"TimeSeriesChart",props:{chartData:{default:void 0},type:{default:"timeseries_line"},fill:{type:Boolean,default:!1},tooltipTitle:{},metricUnit:{default:""},timeRangeMs:{default:void 0},granularity:{},stacked:{type:Boolean,default:!0},legendValues:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},brush:{type:Boolean,default:!1},zoomActionItems:{default:void 0},tooltipMetricDisplay:{default:""},threshold:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=n,i=t,{i18n:r}=kt.useI18n(),s=new T_,a=new m_,l=new sI,u=new dI(r),{translateUnit:d}=kt.useTranslatedUnits(),h=p.ref(),g=crypto.randomUUID(),y=crypto.randomUUID(),_=p.ref([]),x=p.inject("legendPosition",Pe.Bottom),v=p.useTemplateRef("chartParent"),M=p.ref(void 0),C=p.ref(!1),R=p.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:p.toRef(e,"tooltipMetricDisplay"),tooltipSeries:[],left:"",top:"",units:p.toRef(e,"metricUnit"),translateUnit:d,offsetX:0,offsetY:0,width:0,height:0,chartType:e.type,chartID:y,chartTooltipSortFn:e.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:F,tooltipAbsoluteTop:I}=kt.useTooltipAbsolutePosition(v,R),L={id:g,afterUpdate(P){_.value=Cu(P,e.legendValues,e.chartLegendSortFn)}},N=p.computed(()=>[L,a,...e.brush?[l]:[],...e.type==="timeseries_line"?[s]:[],...e.threshold?[u]:[]]),B=p.computed(()=>`line-${N.value.map(P=>P.id).join("-")}`),T=p.computed(()=>`bar-${N.value.map(P=>P.id).join("-")}`),S=p.computed(()=>e.chartData&&bR(e.chartData)),{options:O}=kt.useLineChartOptions({tooltipState:R,timeRangeMs:p.toRef(e,"timeRangeMs"),granularity:p.toRef(e,"granularity"),legendID:g,stacked:p.toRef(e,"stacked"),metricAxesTitle:p.toRef(e,"metricAxesTitle"),dimensionAxesTitle:p.toRef(e,"dimensionAxesTitle"),pointsWithoutHover:S,threshold:p.toRef(e,"threshold")});kt.useReportChartDataForSynthetics(p.toRef(e,"chartData"),p.toRef(e,"syntheticsDataKey"));const U=P=>P?P.end.getTime()>P.start.getTime():!1,$=P=>({[Pe.Bottom]:"column",[Pe.Hidden]:"hidden"})[P],it=({width:P,height:W})=>{R.width=P,R.height=W},at=(P=!0)=>{R.interactionMode="idle",R.showTooltip=!1,l.clearSelectionArea(),a.isPaused&&a.resume(P),s.isPaused&&s.resume()},ot=()=>{R.interactionMode="interactive"},q=()=>{!h.value||!h.value.chart.tooltip?.dataPoints?.length||(R.interactionMode==="interactive"?s.clickedSegment=h.value.chart.tooltip.dataPoints[0]:s.destroyClickedSegment())},J=()=>{if(C.value){C.value=!1;return}R.interactionMode!=="idle"?at():ot(),q()};p.watch(()=>e.type,()=>{R.interactionMode="idle",R.showTooltip=!1,s.destroyClickedSegment()});const rt=P=>{P.preventDefault(),P.stopPropagation();const{xStart:W,xEnd:j}=P.detail,pt={start:new Date(W),end:new Date(j),type:"absolute"};if(!U(pt)){M.value=void 0,at(!1);return}M.value=pt,R.interactionMode="zoom-interactive",pt&&i("select-chart-range",pt)},tt=P=>{R.interactionMode="selecting-chart-area",C.value=!0,s.pause(),a.pause();const{xStart:W,xEnd:j}=P.detail;M.value={start:new Date(W),end:new Date(j),type:"absolute"}},G=P=>{if(!v.value||R.interactionMode==="idle")return;const W=P.target;W&&v.value.contains(W)||C.value||at(!1)};return p.watch(()=>h.value?.chart,()=>{h.value?.chart&&(h.value.chart.canvas.removeEventListener("dragSelect",rt),h.value.chart.canvas.removeEventListener("dragSelectMove",tt),h.value.chart.canvas.addEventListener("dragSelect",rt),h.value.chart.canvas.addEventListener("dragSelectMove",tt))}),p.onMounted(()=>{document.addEventListener("click",G,!0)}),p.onUnmounted(()=>{h.value?.chart&&(h.value.chart.canvas.removeEventListener("dragSelect",rt),h.value.chart.canvas.removeEventListener("dragSelectMove",tt)),document.removeEventListener("click",G,!0)}),(P,W)=>(p.openBlock(),p.createElementBlock("div",{ref:"chartParent",class:p.normalizeClass(["chart-parent",$(p.unref(x))]),"data-testid":"line-chart-parent"},[p.createElementVNode("div",{class:"chart-container",onClick:W[0]||(W[0]=j=>J())},[n.type==="timeseries_line"?(p.openBlock(),p.createBlock(p.unref(S_),{key:B.value,ref_key:"chartInstance",ref:h,"chart-id":p.unref(y),class:"chart-canvas",data:n.chartData,"data-testid":"time-series-line-chart",options:p.unref(O),plugins:N.value},null,8,["chart-id","data","options","plugins"])):n.type==="timeseries_bar"?(p.openBlock(),p.createBlock(p.unref(w_),{key:T.value,ref_key:"chartInstance",ref:h,"chart-id":p.unref(y),class:"chart-canvas",data:n.chartData,"data-testid":"time-series-bar-chart",options:p.unref(O),plugins:N.value},null,8,["chart-id","data","options","plugins"])):p.createCommentVNode("",!0)]),p.createVNode(xo,{"absolute-left":p.unref(F),"absolute-top":p.unref(I),"data-testid":"tooltip",granularity:n.granularity,state:R,"tooltip-title":n.tooltipTitle,"zoom-action-items":n.zoomActionItems,"zoom-time-range":M.value,onDimensions:it,onOnAction:W[1]||(W[1]=()=>at(!1))},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title","zoom-action-items","zoom-time-range"]),p.createVNode(cl,{id:p.unref(g),"chart-instance":h.value,"data-testid":"legend",items:_.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-399f4923"]]),hI={key:0,class:"chart-truncation-warning","data-testid":"truncation-warning"},pI={class:"tooltip-content"},gI={key:2,class:"analytics-chart-parent"},mI=7,yI=p.defineComponent({__name:"AnalyticsChart",props:{chartData:{},chartOptions:{},tooltipTitle:{default:""},emptyStateTitle:{default:""},emptyStateDescription:{default:""},legendPosition:{default:Pe.Bottom},syntheticsDataKey:{default:""},showLegendValues:{type:Boolean,default:!1},showAnnotations:{type:Boolean,default:!0},timeseriesZoom:{type:Boolean,default:!1},requestsLink:{default:void 0},exploreLink:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=t,i=n,{i18n:r}=kt.useI18n(),s=p.computed(()=>Ja(i.chartData)?void 0:i.chartData),a=p.computed(()=>{if(L.value)return Ja(i.chartData)?i.chartData:vy(i.chartData)}),l=p.computed(()=>{if(Ja(i.chartData)){const{start:P,end:W,metric:j,metricUnit:pt,truncated:lt,limit:et,datasource:ht}=i.chartData;return{start:P,end:W,metricNames:[j],metricUnits:{[j]:pt??""},truncated:lt,limit:et,datasource:ht}}const G=i.chartData?.meta;return{start:G?.start,end:G?.end,metricNames:G?.metric_names,metricUnits:G?.metric_units,truncated:G?.truncated,limit:G?.limit,datasource:G?.datasource}}),u=p.computed(()=>L.value?kt.useScatterDatasets({colorPalette:i.chartOptions.chartDatasetColors,scatter:i.chartOptions.scatter},a).value:s.value?F.value?kt.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Pu},s).value:kt.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Pu},s).value:{datasets:[]}),d=p.computed(()=>i.timeseriesZoom||!!i.exploreLink||!!i.requestsLink),h=p.computed(()=>{if(!i.chartData||s.value&&!s.value.meta)return 0;const{start:G,end:P}=l.value;if(G&&P)return new Date(P).getTime()-new Date(G).getTime()}),g=p.computed(()=>l.value.metricUnits?Object.values(l.value.metricUnits)[0]??"":""),y=p.computed(()=>l.value.metricUnits?Object.keys(l.value.metricUnits)[0]??"":""),_=p.computed(()=>i.showLegendValues&&i.legendPosition!==Pe.Hidden),{legendValues:x}=kt.useChartLegendValues(u,i.chartOptions.type,g),v=p.computed(()=>l.value.limit?.toString()||null),M=p.computed(()=>i.chartOptions.hideTruncationWarning?!1:l.value.truncated||!1),C=p.computed(()=>r.t("limitedResultsShown",{maxReturned:v.value})),R=p.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),F=p.computed(()=>["timeseries_bar","timeseries_line"].some(G=>G===i.chartOptions.type)),I=p.computed(()=>i.chartOptions.type==="donut"),L=p.computed(()=>i.chartOptions.type==="scatter"),N=p.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),B=p.computed(()=>{const{metricNames:G,metricUnits:P}=l.value;if(!G||!P)return;const W=G[0],j=P[W]||"";if(G.length>1){if(W.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${j}`,{plural:"s"})});if(W.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${j}`,{plural:"s"})})}if(W)return ho(j)&&r.te(`metricAxisTitles.${W}`)?r.t(`metricAxisTitles.${W}`)||void 0:r.te(`chartLabels.${W}`)?r.t(`chartLabels.${W}`):W}),T=p.computed(()=>{if(i.chartOptions?.metricAxesTitle)return i.chartOptions?.metricAxesTitle;const{metricNames:G,metricUnits:P}=l.value;if(!G||!P)return;const W=G[0],j=P[W]||"";if(G.length>1){if(W.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${j}`,{plural:"s"})});if(W.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${j}`,{plural:"s"})})}return r.te(`metricAxisTitles.${W}`)&&(ho(j)||r.te(`chartUnits.${j}`))?ho(j)?r.t(`metricAxisTitles.${W}`)||void 0:r.t(`metricAxisTitles.${W}`,{unit:r.t(`chartUnits.${j}`,{plural:"s"})})||void 0:W||void 0}),S=p.computed(()=>{if(i.chartOptions?.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const G=s.value?.meta,P=F.value?"Time":Object.keys(G?.display||G?.metric_names||{})[0];if(P)return r.te(`chartLabels.${P}`)?r.t(`chartLabels.${P}`):P}),O=p.computed(()=>L.value?q.value:na(Number(s.value?.meta?.granularity_ms))),U=p.computed(()=>{if(Qb(l.value.datasource))return r.t("timestampAxisTitles.platform");const G=O.value;if(G)return r.te(`granularityAxisTitles.${G}`)?r.t(`granularityAxisTitles.${G}`):G}),$=p.computed(()=>i.emptyStateTitle||r.t("noDataAvailableTitle")),it=p.computed(()=>i.emptyStateDescription||r.t("noDataAvailableDescription")),at=p.computed(()=>L.value?!!a.value?.points.length:F.value?xR(u.value):!!(s.value&&s.value.meta&&s.value.data.length)),ot=p.computed(()=>{const G=s.value;return G?G.meta.granularity_ms?na(G.meta.granularity_ms)||"hourly":na(new Date(G.data[1].timestamp).getTime()-new Date(G.data[0].timestamp).getTime())||"hourly":"hourly"}),q=p.computed(()=>na(Math.floor((h.value||0)/mI))||"hourly"),J=p.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(G,P)=>G.text===r.t("chartLabels.____OTHER____")?1:P.text===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(G.text,10))&&!isNaN(parseInt(P.text,10))?G.text<P.text?-1:1:G.value&&P.value?P.value.raw-G.value.raw:0),rt=p.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(G,P)=>G.label===r.t("chartLabels.____OTHER____")?1:P.label===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(G.label,10))&&!isNaN(parseInt(P.label,10))?G.label<P.label?-1:1:G.value&&P.value?P.rawValue-G.rawValue:0),tt=p.computed(()=>[...i.timeseriesZoom?[{label:r.t("zoom_action_items.zoom"),key:"zoom-in",action:G=>e("zoom-time-range",G)}]:[],...i.exploreLink?[{label:r.t("zoom_action_items.explore"),key:"explore",href:i.exploreLink.href}]:[],...i.requestsLink?[{label:r.t("zoom_action_items.view_requests"),key:"view-requests",href:i.requestsLink.href}]:[]]);return p.provide("showLegendValues",_),p.provide("legendPosition",p.toRef(i,"legendPosition")),(G,P)=>{const W=p.resolveComponent("KTooltip"),j=p.resolveComponent("KEmptyState");return p.openBlock(),p.createElementBlock("div",{class:p.normalizeClass(["analytics-chart-shell",{"show-values":_.value}])},[at.value&&M.value&&v.value?(p.openBlock(),p.createElementBlock("div",hI,[p.createVNode(W,{class:"tooltip","max-width":"500",placement:"right"},{content:p.withCtx(()=>[p.createElementVNode("div",pI,p.toDisplayString(C.value),1)]),default:p.withCtx(()=>[p.createVNode(p.unref(Ss.WarningIcon),{color:`var(--kui-color-text-warning, ${p.unref(cv)})`,size:`var(--kui-icon-size-40, ${p.unref(fv)})`},null,8,["color","size"])]),_:1})])):p.createCommentVNode("",!0),at.value?(p.openBlock(),p.createElementBlock("div",gI,[F.value?(p.openBlock(),p.createBlock(fI,{key:0,brush:d.value,"chart-data":u.value,"chart-legend-sort-fn":J.value,"chart-tooltip-sort-fn":rt.value,"dimension-axes-title":U.value,fill:n.chartOptions.stacked,granularity:ot.value,"legend-values":p.unref(x),"metric-axes-title":T.value,"metric-unit":g.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,threshold:n.chartOptions.threshold,"time-range-ms":h.value,"tooltip-metric-display":B.value,"tooltip-title":n.tooltipTitle,type:n.chartOptions.type,"zoom-action-items":tt.value,onSelectChartRange:P[0]||(P[0]=pt=>e("select-chart-range",pt)),onZoomTimeRange:P[1]||(P[1]=pt=>e("zoom-time-range",pt))},null,8,["brush","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","fill","granularity","legend-values","metric-axes-title","metric-unit","stacked","synthetics-data-key","threshold","time-range-ms","tooltip-metric-display","tooltip-title","type","zoom-action-items"])):R.value?(p.openBlock(),p.createBlock(B2,{key:1,annotations:n.showAnnotations,"chart-data":u.value,"chart-legend-sort-fn":J.value,"chart-tooltip-sort-fn":rt.value,"data-testid":"bar-chart-container","dimension-axes-title":S.value,"legend-values":p.unref(x),"metric-axes-title":T.value,"metric-unit":g.value,orientation:N.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"tooltip-metric-display":B.value,"tooltip-title":n.tooltipTitle},null,8,["annotations","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","legend-values","metric-axes-title","metric-unit","orientation","stacked","synthetics-data-key","tooltip-metric-display","tooltip-title"])):I.value?(p.openBlock(),p.createBlock(Z2,{key:2,"chart-data":u.value,"dataset-colors":n.chartOptions.chartDatasetColors||p.unref(Pu),"legend-position":n.legendPosition,"legend-values":p.unref(x),"metric-name":y.value,"metric-unit":g.value,"show-center-metric":n.chartOptions.showCenterMetric,"synthetics-data-key":n.syntheticsDataKey,"tooltip-dimension-display":S.value,"tooltip-metric-display":B.value,"tooltip-title":n.tooltipTitle},null,8,["chart-data","dataset-colors","legend-position","legend-values","metric-name","metric-unit","show-center-metric","synthetics-data-key","tooltip-dimension-display","tooltip-metric-display","tooltip-title"])):L.value?(p.openBlock(),p.createBlock(tI,{key:3,"chart-data":u.value,"chart-legend-sort-fn":n.chartOptions.chartLegendSortFn,"chart-tooltip-sort-fn":rt.value,"data-testid":"scatter-chart-container","dimension-axes-title":U.value,granularity:q.value,"legend-values":p.unref(x),"metric-axes-title":T.value,"metric-unit":g.value,"shade-outlier-region":n.chartOptions.scatter?.shadeOutlierRegion,"synthetics-data-key":n.syntheticsDataKey,"time-range-ms":h.value,"tooltip-metric-display":B.value,"tooltip-title":n.tooltipTitle},null,8,["chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","granularity","legend-values","metric-axes-title","metric-unit","shade-outlier-region","synthetics-data-key","time-range-ms","tooltip-metric-display","tooltip-title"])):p.createCommentVNode("",!0)])):(p.openBlock(),p.createBlock(j,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:p.withCtx(()=>[p.createTextVNode(p.toDisplayString($.value),1)]),default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(it.value),1)]),_:1}))],2)}}}),_I=an(yI,[["__scopeId","data-v-ed4ba20b"]]),bI={class:"chart-parent","data-testid":"gauge-chart-parent"},xI={class:"chart-totals-flex"},wI={key:1,class:"metric-small","data-testid":"gauge-chart-total"},vI=an(p.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:"hidden"},numerator:{type:Number,required:!1,default:0},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:ai},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=kt.useI18n(),i=p.ref(ad()),r=p.computed(()=>[t.chartData.datasets.reduce((_,x)=>(_.labels.push(x.label),_.borderColor.push(x.backgroundColor),_.backgroundColor.push(x.backgroundColor),_.data.push(x.data.reduce((v,M)=>v+M,0)),_),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),s=p.computed(()=>({...t.chartData,datasets:r.value}));kt.useReportChartDataForSynthetics(p.toRef(t,"chartData"),p.toRef(t,"syntheticsDataKey"));const a={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},l=p.computed(()=>ao(r?.value[0]?.data[t.numerator],{capital:!0})),u=p.computed(()=>ao(r?.value[0]?.data[0]+r?.value[0]?.data[1],{capital:!0})),d=p.computed(()=>`color: ${r?.value[0]?.backgroundColor[t.numerator]}`),h=p.computed(()=>["full","single"].includes(t.metricDisplay)),g=p.computed(()=>t.metricDisplay==="full");return(y,_)=>(p.openBlock(),p.createElementBlock("div",bI,[p.createElementVNode("div",xI,[h.value?(p.openBlock(),p.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:p.normalizeStyle(d.value)},p.toDisplayString(l.value),5)):p.createCommentVNode("",!0),g.value?(p.openBlock(),p.createElementBlock("div",wI,p.toDisplayString(p.unref(e).t("total"))+": "+p.toDisplayString(u.value),1)):p.createCommentVNode("",!0)]),p.createElementVNode("div",{class:"chart-container",style:p.normalizeStyle({height:n.height,width:n.width})},[p.createVNode(p.unref(v_),{"chart-id":i.value,data:s.value,options:a},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-c461b83f"]]),SI={key:1,class:"single-value-wrapper"},TI={class:"single-value-metric"},MI={class:"name-unit-alignment"},kI={class:"single-value","data-testid":"single-value-chart"},DI={key:0,class:"single-value-unit"},CI={class:"single-value-metric-name"},OI={key:0,class:"single-value-trend"},AI={key:0,class:"single-value-trend-range","data-testid":"single-value-trend-range"},cd="t1",ud="t2",RI=an(p.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:qm},leftAlign:{type:Boolean,default:!1},showTrend:{type:Boolean,default:!1},increaseIsBad:{type:Boolean,default:!1},alignX:{type:String,default:"space-evenly"}},setup(n){const{i18n:t}=kt.useI18n(),{formatBytes:e,formatCost:i}=er({i18n:t}),r=n,s=p.computed(()=>`align-${r.leftAlign?"left":r.alignX}`),a=p.computed(()=>Qi.buildDeltaMapping(r.data,r.showTrend,{topLevelKey:cd,secondLevelKey:ud})),l=p.computed(()=>a.value?.previous?.[cd]?.[ud]),u=p.computed(()=>a.value?.current?.[cd]?.[ud]),d=p.computed(()=>r.data.data),h=p.computed(()=>r.data.meta?.metric_names?.[0]),g=p.computed(()=>t.te(`chartLabels.${h.value}`)?t.t(`chartLabels.${h.value}`):""),y=p.computed(()=>{const O=h.value?r.data.meta?.metric_units?.[h.value]:void 0;if(O){const U=`chartUnits.${O}`;return t.te(U)?t.t(U,{plural:""}):""}}),_=p.computed(()=>!!h.value&&(h.value.includes("_per_minute")||h.value.includes("_latency_")||h.value==="error_rate")),x=p.computed(()=>r.showTrend&&l.value!==void 0?l.value:null),v=p.computed(()=>{if(r.showTrend)return u.value??null;if(d.value.length<1||!h.value)return null;const O=d.value[0].event[h.value];return typeof O!="number"||isNaN(O)?null:O}),M=p.computed(()=>r.data?.data?.length===void 0||r.data?.data?.length===0||!r.showTrend&&v.value===null||r.showTrend&&x.value===null&&v.value===null),C=p.computed(()=>{const O=v.value;if(O===null)return"-";const U=h.value?r.data.meta?.metric_units?.[h.value]:void 0;if(U==="usd")return i(O);if(U==="bytes")return e(O);if(O>=1e9){const it=(O/1e9).toFixed(1);return it.endsWith(".0")?`${Math.floor(O/1e9)}B`:`${it}B`}if(O>=1e7){const it=(O/1e6).toFixed(1);return it.endsWith(".0")?`${Math.floor(O/1e6)}M`:`${it}M`}const $=r.decimalPoints&&typeof r.decimalPoints=="number"?r.decimalPoints:qm;return O.toLocaleString("en-US",{maximumFractionDigits:$})}),R=p.computed(()=>r.showTrend&&r.data?.data?.length<2),F=p.computed(()=>Qi.calculateChange(v.value??0,x.value??0)||0),I=p.computed(()=>{if(!r.showTrend)return 0;if(r.data?.data?.length<2){if(l.value===void 0)return 0;if(u.value===void 0)return r.increaseIsBad?1:-1}return Qi.changePolarity(F.value,!0,r.increaseIsBad)}),L=p.computed(()=>Qi.defineIcon(I.value,r.increaseIsBad)),N=p.computed(()=>{if(r.showTrend&&r.data?.data?.length<2){if(l.value===void 0)return t.t("singleValue.trend.not_available");if(u.value===void 0)return Qi.metricChange(-1,!0,t.t("singleValue.trend.not_available"))}return Qi.metricChange(F.value,r.data?.data?.length===2,t.t("singleValue.trend.not_available"))}),B=Qi.useTrendRange(p.computed(()=>r.showTrend),void 0,p.computed(()=>r.data.meta)),T=O=>O>0?"positive":O<0?"negative":"neutral",S=O=>O>0?lv:O<0?av:Yh;return p.onMounted(()=>{!r.showTrend&&r.data?.data?.length>1?console.warn("SingleValue chart should only be used with a single data point. Data length:",r.data.data.length):r.showTrend&&r.data?.data?.length>2&&console.warn("SingleValue with trend expects 2 or fewer data points. Instead got:",r.data.data.length)}),(O,U)=>{const $=p.resolveComponent("KEmptyState");return p.openBlock(),p.createElementBlock("div",{class:p.normalizeClass(["chart-parent",s.value]),"data-testid":"single-value-parent"},[M.value?(p.openBlock(),p.createBlock($,{key:0,class:"single-value-error","data-testid":"single-value-error","icon-variant":"error",title:p.unref(t).t("singleValue.valueError")},null,8,["title"])):(p.openBlock(),p.createElementBlock("div",SI,[p.createElementVNode("div",TI,[p.createElementVNode("div",MI,[p.createElementVNode("span",kI,p.toDisplayString(C.value),1),_.value&&y.value?(p.openBlock(),p.createElementBlock("span",DI," "+p.toDisplayString(y.value),1)):p.createCommentVNode("",!0)]),p.createElementVNode("div",CI,p.toDisplayString(g.value),1)]),n.showTrend?(p.openBlock(),p.createElementBlock("div",OI,[p.createElementVNode("div",{class:p.normalizeClass(["trend-change",T(I.value)]),"data-testid":"single-value-trend"},[R.value||I.value!==0?(p.openBlock(),p.createBlock(p.resolveDynamicComponent(L.value),{key:0,color:S(I.value),size:`var(--kui-icon-size-30, ${p.unref(Os)})`},null,8,["color","size"])):(p.openBlock(),p.createBlock(p.unref(Ss.EqualIcon),{key:1,color:`var(--kui-color-text-neutral-strong, ${p.unref(Yh)})`,size:`var(--kui-icon-size-30, ${p.unref(Os)})`},null,8,["color","size"])),p.createElementVNode("div",null,p.toDisplayString(N.value),1)],2),p.unref(B)?(p.openBlock(),p.createElementBlock("div",AI,p.toDisplayString(p.unref(B)),1)):p.createCommentVNode("",!0)])):p.createCommentVNode("",!0)]))],2)}}}),[["__scopeId","data-v-58f32282"]]),EI={class:"simple-chart-shell"},PI={key:1,class:"analytics-chart-parent"},II=an(p.defineComponent({__name:"SimpleChart",props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},emptyStateTitle:{type:String,required:!1,default:""},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=kt.useI18n(),i=p.computed(()=>{const d=kt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||ai},p.toRef(t,"chartData")).value;return t.chartOptions?.reverseDataset&&d?.datasets.reverse(),d}),r=p.computed(()=>t.chartData.meta?.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""),s=p.computed(()=>t.chartOptions.type==="gauge"),a=p.computed(()=>t.chartOptions.type==="single_value"),l=p.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),u=p.computed(()=>{const d=t.chartData&&t.chartData.meta&&t.chartData.data.length;if(a.value){const h=t.chartData.meta?.metric_names?.[0];return d&&t.chartData.data[0].event[h]!==null}return d});return(d,h)=>{const g=p.resolveComponent("KEmptyState");return p.openBlock(),p.createElementBlock("div",EI,[u.value?(p.openBlock(),p.createElementBlock("div",PI,[s.value?(p.openBlock(),p.createBlock(vI,{key:0,"chart-data":i.value,"dataset-colors":n.chartOptions.chartDatasetColors,"is-simple":"","metric-display":n.chartOptions.metricDisplay,"metric-unit":r.value,numerator:n.chartOptions.numerator,"synthetics-data-key":n.syntheticsDataKey,width:n.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","numerator","synthetics-data-key","width"])):p.createCommentVNode("",!0),a.value?(p.openBlock(),p.createBlock(RI,{key:1,"align-x":n.chartOptions.alignX,data:n.chartData,"decimal-points":n.chartOptions.decimalPoints,"increase-is-bad":n.chartOptions.increaseIsBad,"show-trend":n.chartOptions.showTrend},null,8,["align-x","data","decimal-points","increase-is-bad","show-trend"])):p.createCommentVNode("",!0)])):(p.openBlock(),p.createBlock(g,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(l.value),1)]),_:1}))])}}}),[["__scopeId","data-v-23ca8c84"]]),LI={class:"top-n-card-title","data-testid":"top-n-card-title"},NI={class:"top-n-card-description","data-testid":"top-n-card-description"},BI={key:3,class:"top-n-table","data-testid":"top-n-table"},FI={"data-testid":"top-n-table-header"},zI={class:"top-n-table-header-row"},UI={class:"table-header-label"},HI=["data-testid"],WI=["data-testid"],VI=["data-testid"],$I=3,YI=an(p.defineComponent({__name:"TopNTable",props:{title:{default:""},description:{default:""},data:{},emptyStateTitle:{default:""},isLoading:{type:Boolean,default:!1},titleTag:{default:"h2"}},setup(n){const t=n,{i18n:e}=kt.useI18n(),{formatUnit:i}=er({i18n:e}),r=p.computed(()=>t.data.data),s=p.computed(()=>!!r.value?.length),a=p.computed(()=>t.data.meta?.display?Object.keys(t.data.meta.display).slice(0,$I):[]),l=p.computed(()=>a.value[0]||""),u=p.computed(()=>a.value.length>1),d=p.computed(()=>a.value[a.value.length-1]||""),h=p.computed(()=>l.value?t.data.meta.display[l.value]:{}),g=p.computed(()=>t.data.meta?.metric_names?.length?t.data.meta.metric_names:[]),y=p.computed(()=>g.value[0]),_=p.computed(()=>y.value?at(y.value):""),x=p.computed(()=>{const q=a.value.map(J=>({key:J,label:u.value?at(J):e.t("topNTable.nameLabel"),type:"dimension"}));return y.value&&q.push({key:"value",label:_.value,type:"metric"}),g.value.forEach((J,rt)=>{rt!==0&&q.push({key:J,label:at(J),type:"metric"})}),q}),v=p.computed(()=>x.value.filter(q=>q.type==="metric")),M=p.computed(()=>x.value.filter(q=>q.type==="dimension").slice(1)),C=q=>q.type==="dimension"&&q.key===d.value,R=q=>u.value&&q.type==="dimension"&&!C(q),F=q=>{const J=q.event;return String(J[l.value])},I=(q,J)=>{const rt=String(q.event[J]),tt=t.data.meta?.display?.[J]?.[rt];return{dimension:J,id:rt,name:tt?.name||"-",deleted:!!tt?.deleted}},L=q=>{const J=F(q),rt=h.value&&h.value[J];return rt?rt.name:"-"},N=q=>{const J=F(q),rt=h.value&&h.value[J];return rt?!!rt.deleted:!1},B=(q,J)=>{const rt=q.event[J];if(rt==null)return"–";const tt=typeof rt=="number"?rt:Number(rt);if(Number.isNaN(tt))return"–";const G=t.data.meta?.metric_units?.[J]||"count",P=["count","count/minute","token count"].includes(G);return i(tt,G,{approximate:P,isBytes1024:!0,translateUnit:W=>ot(W,tt)})},T=q=>y.value?B(q,y.value):"–",S=p.computed(()=>r.value?.length?r.value.map(q=>{const J=a.value.map(P=>I(q,P)),rt=J[0],tt=rt?.id||F(q),G={id:tt,rowKey:J.map(P=>`${P.dimension}:${P.id}`).join("|")||tt,name:rt?.name||L(q),deleted:N(q),dimensions:J,original:q};return y.value&&(G.value=T(q)),g.value.forEach((P,W)=>{W!==0&&(G[P]=B(q,P))}),G}):[]),O=p.computed(()=>{if(!s.value)return"";if(t.data.meta){if(a.value.some(q=>!Object.keys(t.data.meta.display[q]||{}).length))return e.t("topNTable.errors.display");if(!y.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.meta");return""}),U=(q,J)=>{const rt=q[J];return typeof rt=="string"?rt:rt==null?"–":String(rt)},$=(q,J)=>q.dimensions.find(rt=>rt.dimension===J)?.name||"–",it=(q,J)=>{const rt=q.dimensions.find(tt=>tt.dimension===J);return{id:rt?.id||"",name:rt?.name||"–",deleted:rt?.deleted||!1,dimension:J,dimensions:q.dimensions,isEmpty:rt?.id==="empty"}},at=q=>e.te(`chartLabels.${q}`)?e.t(`chartLabels.${q}`):q,ot=(q,J)=>{if(ho(q)||q==="count"||q==="requests")return"";const rt=J===1?"":"s";return e.te(`chartUnits.${q}`)?e.t(`chartUnits.${q}`,{plural:rt}):q};return(q,J)=>{const rt=p.resolveComponent("KEmptyState"),tt=p.resolveComponent("KSkeleton"),G=p.resolveComponent("KCard");return p.openBlock(),p.createBlock(G,{class:"kong-ui-public-top-n-table","title-tag":n.titleTag},p.createSlots({default:p.withCtx(()=>[O.value?(p.openBlock(),p.createBlock(rt,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(p.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(O.value),1)]),_:1})):n.isLoading?(p.openBlock(),p.createBlock(tt,{key:1,"table-columns":2,type:"table"})):s.value?(p.openBlock(),p.createElementBlock("div",BI,[p.createElementVNode("table",{class:p.normalizeClass(["top-n-table-table",{"top-n-table-table--multi-dimension":u.value}])},[p.createElementVNode("thead",FI,[p.createElementVNode("tr",zI,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(x.value,P=>(p.openBlock(),p.createElementBlock("th",{key:P.key,class:p.normalizeClass(["top-n-table-header-cell",{"top-n-table-header-cell-metric":P.type==="metric","top-n-table-header-cell-dimension-compact":R(P)}]),"data-testid":"top-n-table-header-column"},[p.createElementVNode("span",UI,p.toDisplayString(P.label),1)],2))),128))])]),p.createElementVNode("tbody",null,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(S.value,P=>(p.openBlock(),p.createElementBlock("tr",{key:P.rowKey,class:"top-n-table-row"},[a.value.length?(p.openBlock(),p.createElementBlock("td",{key:0,class:p.normalizeClass(["top-n-table-cell top-n-table-cell--name",{"top-n-table-cell-dimension-compact":u.value}])},[p.createElementVNode("span",{"data-testid":`row-${P.id}`},[p.renderSlot(q.$slots,"name",{record:{id:P.id,name:P.name,deleted:P.deleted,dimension:l.value,dimensions:P.dimensions,isEmpty:P.id==="empty"}},()=>[p.createTextVNode(p.toDisplayString(P.name),1)],!0)],8,HI)],2)):p.createCommentVNode("",!0),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(M.value,W=>(p.openBlock(),p.createElementBlock("td",{key:W.key,class:p.normalizeClass(["top-n-table-cell top-n-table-cell--dimension",{"top-n-table-cell-dimension-compact":!C(W)}])},[p.renderSlot(q.$slots,"name",{record:it(P,W.key)},()=>[p.createTextVNode(p.toDisplayString($(P,W.key)),1)],!0)],2))),128)),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(v.value,W=>(p.openBlock(),p.createElementBlock("td",{key:W.key,class:"top-n-table-cell top-n-table-cell-metric"},[W.key==="value"?(p.openBlock(),p.createElementBlock("span",{key:0,"data-testid":`row-${P.id}`},p.toDisplayString(U(P,W.key)),9,WI)):(p.openBlock(),p.createElementBlock("span",{key:1,"data-testid":`row-${P.id}-${W.key}`},p.toDisplayString(U(P,W.key)),9,VI))]))),128))]))),128))])],2)])):(p.openBlock(),p.createBlock(rt,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(n.emptyStateTitle||p.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[n.title?{name:"title",fn:p.withCtx(()=>[p.createElementVNode("span",LI,p.toDisplayString(n.title),1)]),key:"0"}:void 0,n.description?{name:"actions",fn:p.withCtx(()=>[p.createElementVNode("div",NI,p.toDisplayString(n.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-0dc897d6"]]),qI={class:"container"},jI={key:0,class:"no-data","data-testid":"sparkline-empty"},GI=["title"],KI=an(p.defineComponent({__name:"SparklineChart",props:{chartKey:{default:()=>{}},datasets:{},disableTooltip:{type:Boolean,default:!1},enableBrushing:{type:Boolean,default:!1},groupKey:{default:()=>{}},maxCount:{default:()=>{}},maxStamp:{default:()=>{}},minCount:{default:()=>{}},minStamp:{default:()=>{}},pointRenderCount:{default:24},showLabel:{type:Boolean,default:!1},tooltipTitle:{default:()=>{}},type:{default:"sparkline_bar"}},setup(n){const t=crypto.randomUUID(),{i18n:e}=kt.useI18n(),{syncedGroupSizeMs:i,syncedMinStamp:r,syncedMaxStamp:s,syncedMinCount:a,syncedMaxCount:l,syncedRenderPoints:u,syncedChartDatasets:d}=kt.useSparklineSync({chartKey:n.chartKey,datasets:n.datasets,groupKey:n.groupKey,minStamp:n.minStamp,maxStamp:n.maxStamp,minCount:n.minCount,maxCount:n.maxCount,renderPoints:n.pointRenderCount,type:n.type}),h=p.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:"",tooltipSeries:[],left:"",top:"",units:"count",translateUnit:()=>"",offsetX:0,offsetY:0,width:0,height:0,chartType:n.type==="sparkline_bar"?"timeseries_bar":"timeseries_line",chartID:t,interactionMode:"idle"}),g=({width:B,height:T})=>{h.width=B,h.height=T},y=p.computed(()=>n.disableTooltip?[]:[new T_({enableBrushing:n.groupKey!==void 0&&n.chartKey!==void 0&&n.enableBrushing,brushStrategy:"group",brushGroup:n.groupKey})]),_=p.computed(()=>d.value.reduce((B,{data:T,label:S})=>({...B,[S]:T.reduce((O,{y:U})=>O+U,0)}),{})),x=p.computed(()=>d.value.map(({label:B})=>[_.value[B],`${B}: ${_.value[B]}`]).sort(([B],[T])=>T-B).map(([,B])=>B).join(", ")),v=p.computed(()=>Object.keys(_.value).map(B=>_.value[B]).reduce((B,T)=>B+T,0)),M=p.computed(()=>v.value>0),C=p.computed(()=>({labels:new Array(u.value).fill(""),datasets:d.value})),R=p.computed(()=>n.datasets.length>1),F=`SparklineTooltipPosition-${t}`,I=p.computed(()=>{const B=n.type==="sparkline_bar",T=B?r.value-1:r.value,S=B?s.value:s.value-i.value;return{maintainAspectRatio:!1,elements:{categoryPercentage:1,barPercentage:1,line:{tension:0,stepped:n.type==="sparkline_step",borderWidth:1},point:{radius:0,pointHitRadius:11,pointHoverRadius:0}},interaction:{intersect:!1,mode:"index"},layout:{padding:{left:B?0:2,right:B?0:2,top:2}},plugins:{legend:{display:!1},tooltip:{enabled:!1,position:F,external:O=>{Du(h,O,"minutely",{contextFormatter:U=>{const $=U+i.value;let it="";return i.value>1440*60*1e3?it=ua(new Date($),"MMM dd, yyy hh:mm a"):it=ua(new Date($),"hh:mm a"),`${Vw(U)} - ${it}`}})}}},scales:{x:{min:T,max:S,type:"timeseries",offset:!1,grid:{display:!1},display:!1,stacked:R.value},y:{min:Math.max(a.value-1,0),max:l.value,grid:{display:!1},display:!1,stacked:R.value}}}}),L=p.ref("0"),N=p.ref("0");return p.onMounted(()=>{$e.positioners[F]=function(B,T){if(!B.length||h.interactionMode==="interactive"||T.x===null)return!1;const S=10,O=this.chart.canvas.getBoundingClientRect(),U=h.width||this.width,$=h.height||this.height,it=O.top-$>0,at=it?O.top-$-S:O.top+O.height+S,ot=O.left>U/2-T.x,q=Math.max(S,window.innerWidth-S-U),J=Math.min(q,ot?Math.floor(O.left-U/2)+T.x:0+S);return L.value=`${at}px`,N.value=`${J}px`,{x:J,y:at,xAlign:"center",yAlign:it?"top":"bottom"}}}),p.onUnmounted(()=>{$e.positioners[F]&&delete $e.positioners[F]}),(B,T)=>(p.openBlock(),p.createElementBlock("div",qI,[M.value?n.type==="sparkline_bar"?(p.openBlock(),p.createBlock(p.unref(w_),{key:1,"chart-id":p.unref(t),data:C.value,"data-testid":"sparkline-bar",options:I.value,plugins:y.value},null,8,["chart-id","data","options","plugins"])):n.type==="sparkline_line"||n.type==="sparkline_step"?(p.openBlock(),p.createBlock(p.unref(S_),{key:2,"chart-id":p.unref(t),data:C.value,"data-testid":n.type==="sparkline_line"?"sparkline-line":"sparkline-step",options:I.value,plugins:y.value},null,8,["chart-id","data","data-testid","options","plugins"])):p.createCommentVNode("",!0):(p.openBlock(),p.createElementBlock("div",jI,[p.renderSlot(B.$slots,"empty",{},()=>[p.createTextVNode(p.toDisplayString(p.unref(e).t("sparkline_no_data")),1)],!0)])),n.disableTooltip?p.createCommentVNode("",!0):(p.openBlock(),p.createBlock(xo,{key:3,"absolute-left":N.value,"absolute-top":L.value,class:"tooltip","data-testid":"sparkline-tooltip",state:h,"tooltip-title":n.tooltipTitle,onDimensions:g},null,8,["absolute-left","absolute-top","state","tooltip-title"])),M.value&&n.showLabel?(p.openBlock(),p.createElementBlock("div",{key:4,class:"label",title:B.$slots.label?"":x.value},[p.renderSlot(B.$slots,"label",{total:v.value,totalByDataset:_.value},()=>[p.createTextVNode(p.toDisplayString(x.value),1)],!0)],8,GI)):p.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-ae8259b6"]]);var Fi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},wo={exports:{}};var XI=wo.exports,C_;function ZI(){return C_||(C_=1,(function(n,t){(function(){var e,i="4.18.1",r=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",l="Invalid `variable` option passed into `_.template`",u="Invalid `imports` option passed into `_.template`",d="__lodash_hash_undefined__",h=500,g="__lodash_placeholder__",y=1,_=2,x=4,v=1,M=2,C=1,R=2,F=4,I=8,L=16,N=32,B=64,T=128,S=256,O=512,U=30,$="...",it=800,at=16,ot=1,q=2,J=3,rt=1/0,tt=9007199254740991,G=17976931348623157e292,P=NaN,W=4294967295,j=W-1,pt=W>>>1,lt=[["ary",T],["bind",C],["bindKey",R],["curry",I],["curryRight",L],["flip",O],["partial",N],["partialRight",B],["rearg",S]],et="[object Arguments]",ht="[object Array]",ft="[object AsyncFunction]",ct="[object Boolean]",mt="[object Date]",ut="[object DOMException]",Lt="[object Error]",zt="[object Function]",vt="[object GeneratorFunction]",Ct="[object Map]",Dt="[object Number]",ve="[object Null]",bt="[object Object]",qt="[object Promise]",Oe="[object Proxy]",Ae="[object RegExp]",oe="[object Set]",ln="[object String]",Vt="[object Symbol]",Le="[object Undefined]",ie="[object WeakMap]",Se="[object WeakSet]",Re="[object ArrayBuffer]",gn="[object DataView]",zi="[object Float32Array]",Dn="[object Float64Array]",Ye="[object Int8Array]",In="[object Int16Array]",ci="[object Int32Array]",vo="[object Uint8Array]",So="[object Uint8ClampedArray]",br="[object Uint16Array]",ui="[object Uint32Array]",To=/\b__p \+= '';/g,Mo=/\b(__p \+=) '' \+/g,ko=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ui=/&(?:amp|lt|gt|quot|#39);/g,hl=/[&<>"']/g,dd=RegExp(Ui.source),fd=RegExp(hl.source),hd=/<%-([\s\S]+?)%>/g,pd=/<%([\s\S]+?)%>/g,Do=/<%=([\s\S]+?)%>/g,pl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,di=/^\w*$/,gd=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Co=/[\\^$.*+?()[\]{}|]/g,md=RegExp(Co.source),Oo=/^\s+/,yd=/\s/,Ln=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,_d=/\{\n\/\* \[wrapped with (.+)\] \*/,bd=/,? & /,xd=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,gl=/[()=,{}\[\]\/\s]/,wd=/\\(\\)?/g,Hi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ml=/\w*$/,vd=/^[-+]0x[0-9a-f]+$/i,Sd=/^0b[01]+$/i,Td=/^\[object .+?Constructor\]$/,Md=/^0o[0-7]+$/i,Wi=/^(?:0|[1-9]\d*)$/,kd=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,es=/($^)/,Dd=/['\n\r\u2028\u2029\\]/g,ns="\\ud800-\\udfff",Cd="\\u0300-\\u036f",Od="\\ufe20-\\ufe2f",yl="\\u20d0-\\u20ff",xr=Cd+Od+yl,_l="\\u2700-\\u27bf",is="a-z\\xdf-\\xf6\\xf8-\\xff",Ad="\\xac\\xb1\\xd7\\xf7",Rd="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ed="\\u2000-\\u206f",Pd=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",bl="A-Z\\xc0-\\xd6\\xd8-\\xde",xl="\\ufe0e\\ufe0f",rs=Ad+Rd+Ed+Pd,Ao="['’]",Id="["+ns+"]",wl="["+rs+"]",ss="["+xr+"]",vl="\\d+",Ld="["+_l+"]",Sl="["+is+"]",Ro="[^"+ns+rs+vl+_l+is+bl+"]",Eo="\\ud83c[\\udffb-\\udfff]",Nd="(?:"+ss+"|"+Eo+")",wr="[^"+ns+"]",Gn="(?:\\ud83c[\\udde6-\\uddff]){2}",os="[\\ud800-\\udbff][\\udc00-\\udfff]",cn="["+bl+"]",Tl="\\u200d",Ml="(?:"+Sl+"|"+Ro+")",Bd="(?:"+cn+"|"+Ro+")",kl="(?:"+Ao+"(?:d|ll|m|re|s|t|ve))?",Dl="(?:"+Ao+"(?:D|LL|M|RE|S|T|VE))?",Cl=Nd+"?",Po="["+xl+"]?",fi="(?:"+Tl+"(?:"+[wr,Gn,os].join("|")+")"+Po+Cl+")*",Fd="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ol="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Al=Po+Cl+fi,Io="(?:"+[Ld,Gn,os].join("|")+")"+Al,Rl="(?:"+[wr+ss+"?",ss,Gn,os,Id].join("|")+")",zd=RegExp(Ao,"g"),Ud=RegExp(ss,"g"),as=RegExp(Eo+"(?="+Eo+")|"+Rl+Al,"g"),Hd=RegExp([cn+"?"+Sl+"+"+kl+"(?="+[wl,cn,"$"].join("|")+")",Bd+"+"+Dl+"(?="+[wl,cn+Ml,"$"].join("|")+")",cn+"?"+Ml+"+"+kl,cn+"+"+Dl,Ol,Fd,vl,Io].join("|"),"g"),ls=RegExp("["+Tl+ns+xr+xl+"]"),Wd=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Lo=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Vd=-1,ee={};ee[zi]=ee[Dn]=ee[Ye]=ee[In]=ee[ci]=ee[vo]=ee[So]=ee[br]=ee[ui]=!0,ee[et]=ee[ht]=ee[Re]=ee[ct]=ee[gn]=ee[mt]=ee[Lt]=ee[zt]=ee[Ct]=ee[Dt]=ee[bt]=ee[Ae]=ee[oe]=ee[ln]=ee[ie]=!1;var D={};D[et]=D[ht]=D[Re]=D[gn]=D[ct]=D[mt]=D[zi]=D[Dn]=D[Ye]=D[In]=D[ci]=D[Ct]=D[Dt]=D[bt]=D[Ae]=D[oe]=D[ln]=D[Vt]=D[vo]=D[So]=D[br]=D[ui]=!0,D[Lt]=D[zt]=D[ie]=!1;var V={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Q={"&":"&","<":"<",">":">",'"':""","'":"'"},yt={"&":"&","<":"<",">":">",""":'"',"'":"'"},Te={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},qe=parseFloat,Nn=parseInt,Ne=typeof Fi=="object"&&Fi&&Fi.Object===Object&&Fi,El=typeof self=="object"&&self&&self.Object===Object&&self,ce=Ne||El||Function("return this")(),cs=t&&!t.nodeType&&t,Kn=cs&&!0&&n&&!n.nodeType&&n,No=Kn&&Kn.exports===cs,vr=No&&Ne.process,Be=(function(){try{var z=Kn&&Kn.require&&Kn.require("util").types;return z||vr&&vr.binding&&vr.binding("util")}catch{}})(),P_=Be&&Be.isArrayBuffer,I_=Be&&Be.isDate,L_=Be&&Be.isMap,N_=Be&&Be.isRegExp,B_=Be&&Be.isSet,F_=Be&&Be.isTypedArray;function mn(z,K,Y){switch(Y.length){case 0:return z.call(K);case 1:return z.call(K,Y[0]);case 2:return z.call(K,Y[0],Y[1]);case 3:return z.call(K,Y[0],Y[1],Y[2])}return z.apply(K,Y)}function dL(z,K,Y,dt){for(var Ot=-1,$t=z==null?0:z.length;++Ot<$t;){var Me=z[Ot];K(dt,Me,Y(Me),z)}return dt}function yn(z,K){for(var Y=-1,dt=z==null?0:z.length;++Y<dt&&K(z[Y],Y,z)!==!1;);return z}function fL(z,K){for(var Y=z==null?0:z.length;Y--&&K(z[Y],Y,z)!==!1;);return z}function z_(z,K){for(var Y=-1,dt=z==null?0:z.length;++Y<dt;)if(!K(z[Y],Y,z))return!1;return!0}function Vi(z,K){for(var Y=-1,dt=z==null?0:z.length,Ot=0,$t=[];++Y<dt;){var Me=z[Y];K(Me,Y,z)&&($t[Ot++]=Me)}return $t}function Pl(z,K){var Y=z==null?0:z.length;return!!Y&&us(z,K,0)>-1}function $d(z,K,Y){for(var dt=-1,Ot=z==null?0:z.length;++dt<Ot;)if(Y(K,z[dt]))return!0;return!1}function ue(z,K){for(var Y=-1,dt=z==null?0:z.length,Ot=Array(dt);++Y<dt;)Ot[Y]=K(z[Y],Y,z);return Ot}function $i(z,K){for(var Y=-1,dt=K.length,Ot=z.length;++Y<dt;)z[Ot+Y]=K[Y];return z}function Yd(z,K,Y,dt){var Ot=-1,$t=z==null?0:z.length;for(dt&&$t&&(Y=z[++Ot]);++Ot<$t;)Y=K(Y,z[Ot],Ot,z);return Y}function hL(z,K,Y,dt){var Ot=z==null?0:z.length;for(dt&&Ot&&(Y=z[--Ot]);Ot--;)Y=K(Y,z[Ot],Ot,z);return Y}function qd(z,K){for(var Y=-1,dt=z==null?0:z.length;++Y<dt;)if(K(z[Y],Y,z))return!0;return!1}var pL=jd("length");function gL(z){return z.split("")}function mL(z){return z.match(xd)||[]}function U_(z,K,Y){var dt;return Y(z,function(Ot,$t,Me){if(K(Ot,$t,Me))return dt=$t,!1}),dt}function Il(z,K,Y,dt){for(var Ot=z.length,$t=Y+(dt?1:-1);dt?$t--:++$t<Ot;)if(K(z[$t],$t,z))return $t;return-1}function us(z,K,Y){return K===K?CL(z,K,Y):Il(z,H_,Y)}function yL(z,K,Y,dt){for(var Ot=Y-1,$t=z.length;++Ot<$t;)if(dt(z[Ot],K))return Ot;return-1}function H_(z){return z!==z}function W_(z,K){var Y=z==null?0:z.length;return Y?Kd(z,K)/Y:P}function jd(z){return function(K){return K==null?e:K[z]}}function Gd(z){return function(K){return z==null?e:z[K]}}function V_(z,K,Y,dt,Ot){return Ot(z,function($t,Me,ne){Y=dt?(dt=!1,$t):K(Y,$t,Me,ne)}),Y}function _L(z,K){var Y=z.length;for(z.sort(K);Y--;)z[Y]=z[Y].value;return z}function Kd(z,K){for(var Y,dt=-1,Ot=z.length;++dt<Ot;){var $t=K(z[dt]);$t!==e&&(Y=Y===e?$t:Y+$t)}return Y}function Xd(z,K){for(var Y=-1,dt=Array(z);++Y<z;)dt[Y]=K(Y);return dt}function bL(z,K){return ue(K,function(Y){return[Y,z[Y]]})}function $_(z){return z&&z.slice(0,G_(z)+1).replace(Oo,"")}function _n(z){return function(K){return z(K)}}function Zd(z,K){return ue(K,function(Y){return z[Y]})}function Bo(z,K){return z.has(K)}function Y_(z,K){for(var Y=-1,dt=z.length;++Y<dt&&us(K,z[Y],0)>-1;);return Y}function q_(z,K){for(var Y=z.length;Y--&&us(K,z[Y],0)>-1;);return Y}function xL(z,K){for(var Y=z.length,dt=0;Y--;)z[Y]===K&&++dt;return dt}var wL=Gd(V),vL=Gd(Q);function SL(z){return"\\"+Te[z]}function TL(z,K){return z==null?e:z[K]}function ds(z){return ls.test(z)}function ML(z){return Wd.test(z)}function kL(z){for(var K,Y=[];!(K=z.next()).done;)Y.push(K.value);return Y}function Qd(z){var K=-1,Y=Array(z.size);return z.forEach(function(dt,Ot){Y[++K]=[Ot,dt]}),Y}function j_(z,K){return function(Y){return z(K(Y))}}function Yi(z,K){for(var Y=-1,dt=z.length,Ot=0,$t=[];++Y<dt;){var Me=z[Y];(Me===K||Me===g)&&(z[Y]=g,$t[Ot++]=Y)}return $t}function Ll(z){var K=-1,Y=Array(z.size);return z.forEach(function(dt){Y[++K]=dt}),Y}function DL(z){var K=-1,Y=Array(z.size);return z.forEach(function(dt){Y[++K]=[dt,dt]}),Y}function CL(z,K,Y){for(var dt=Y-1,Ot=z.length;++dt<Ot;)if(z[dt]===K)return dt;return-1}function OL(z,K,Y){for(var dt=Y+1;dt--;)if(z[dt]===K)return dt;return dt}function fs(z){return ds(z)?RL(z):pL(z)}function Bn(z){return ds(z)?EL(z):gL(z)}function G_(z){for(var K=z.length;K--&&yd.test(z.charAt(K)););return K}var AL=Gd(yt);function RL(z){for(var K=as.lastIndex=0;as.test(z);)++K;return K}function EL(z){return z.match(as)||[]}function PL(z){return z.match(Hd)||[]}var IL=(function z(K){K=K==null?ce:hs.defaults(ce.Object(),K,hs.pick(ce,Lo));var Y=K.Array,dt=K.Date,Ot=K.Error,$t=K.Function,Me=K.Math,ne=K.Object,Jd=K.RegExp,LL=K.String,Cn=K.TypeError,Nl=Y.prototype,NL=$t.prototype,ps=ne.prototype,Bl=K["__core-js_shared__"],Fl=NL.toString,jt=ps.hasOwnProperty,BL=0,K_=(function(){var o=/[^.]+$/.exec(Bl&&Bl.keys&&Bl.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),zl=ps.toString,FL=Fl.call(ne),zL=ce._,UL=Jd("^"+Fl.call(jt).replace(Co,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ul=No?K.Buffer:e,qi=K.Symbol,Hl=K.Uint8Array,X_=Ul?Ul.allocUnsafe:e,Wl=j_(ne.getPrototypeOf,ne),Z_=ne.create,Q_=ps.propertyIsEnumerable,Vl=Nl.splice,J_=qi?qi.isConcatSpreadable:e,Fo=qi?qi.iterator:e,Sr=qi?qi.toStringTag:e,$l=(function(){try{var o=Cr(ne,"defineProperty");return o({},"",{}),o}catch{}})(),HL=K.clearTimeout!==ce.clearTimeout&&K.clearTimeout,WL=dt&&dt.now!==ce.Date.now&&dt.now,VL=K.setTimeout!==ce.setTimeout&&K.setTimeout,Yl=Me.ceil,ql=Me.floor,tf=ne.getOwnPropertySymbols,$L=Ul?Ul.isBuffer:e,t0=K.isFinite,YL=Nl.join,qL=j_(ne.keys,ne),ke=Me.max,je=Me.min,jL=dt.now,GL=K.parseInt,e0=Me.random,KL=Nl.reverse,ef=Cr(K,"DataView"),zo=Cr(K,"Map"),nf=Cr(K,"Promise"),gs=Cr(K,"Set"),Uo=Cr(K,"WeakMap"),Ho=Cr(ne,"create"),jl=Uo&&new Uo,ms={},XL=Or(ef),ZL=Or(zo),QL=Or(nf),JL=Or(gs),tN=Or(Uo),Gl=qi?qi.prototype:e,Wo=Gl?Gl.valueOf:e,n0=Gl?Gl.toString:e;function w(o){if(ge(o)&&!Et(o)&&!(o instanceof Ut)){if(o instanceof On)return o;if(jt.call(o,"__wrapped__"))return ib(o)}return new On(o)}var ys=(function(){function o(){}return function(c){if(!fe(c))return{};if(Z_)return Z_(c);o.prototype=c;var f=new o;return o.prototype=e,f}})();function Kl(){}function On(o,c){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=e}w.templateSettings={escape:hd,evaluate:pd,interpolate:Do,variable:"",imports:{_:w}},w.prototype=Kl.prototype,w.prototype.constructor=w,On.prototype=ys(Kl.prototype),On.prototype.constructor=On;function Ut(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=W,this.__views__=[]}function eN(){var o=new Ut(this.__wrapped__);return o.__actions__=un(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=un(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=un(this.__views__),o}function nN(){if(this.__filtered__){var o=new Ut(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function iN(){var o=this.__wrapped__.value(),c=this.__dir__,f=Et(o),m=c<0,b=f?o.length:0,k=gB(0,b,this.__views__),A=k.start,E=k.end,H=E-A,X=m?E:A-1,Z=this.__iteratees__,nt=Z.length,st=0,_t=je(H,this.__takeCount__);if(!f||!m&&b==H&&_t==H)return k0(o,this.__actions__);var Tt=[];t:for(;H--&&st<_t;){X+=c;for(var Nt=-1,wt=o[X];++Nt<nt;){var Ft=Z[Nt],Ht=Ft.iteratee,wn=Ft.type,tn=Ht(wt);if(wn==q)wt=tn;else if(!tn){if(wn==ot)continue t;break t}}Tt[st++]=wt}return Tt}Ut.prototype=ys(Kl.prototype),Ut.prototype.constructor=Ut;function Tr(o){var c=-1,f=o==null?0:o.length;for(this.clear();++c<f;){var m=o[c];this.set(m[0],m[1])}}function rN(){this.__data__=Ho?Ho(null):{},this.size=0}function sN(o){var c=this.has(o)&&delete this.__data__[o];return this.size-=c?1:0,c}function oN(o){var c=this.__data__;if(Ho){var f=c[o];return f===d?e:f}return jt.call(c,o)?c[o]:e}function aN(o){var c=this.__data__;return Ho?c[o]!==e:jt.call(c,o)}function lN(o,c){var f=this.__data__;return this.size+=this.has(o)?0:1,f[o]=Ho&&c===e?d:c,this}Tr.prototype.clear=rN,Tr.prototype.delete=sN,Tr.prototype.get=oN,Tr.prototype.has=aN,Tr.prototype.set=lN;function hi(o){var c=-1,f=o==null?0:o.length;for(this.clear();++c<f;){var m=o[c];this.set(m[0],m[1])}}function cN(){this.__data__=[],this.size=0}function uN(o){var c=this.__data__,f=Xl(c,o);if(f<0)return!1;var m=c.length-1;return f==m?c.pop():Vl.call(c,f,1),--this.size,!0}function dN(o){var c=this.__data__,f=Xl(c,o);return f<0?e:c[f][1]}function fN(o){return Xl(this.__data__,o)>-1}function hN(o,c){var f=this.__data__,m=Xl(f,o);return m<0?(++this.size,f.push([o,c])):f[m][1]=c,this}hi.prototype.clear=cN,hi.prototype.delete=uN,hi.prototype.get=dN,hi.prototype.has=fN,hi.prototype.set=hN;function pi(o){var c=-1,f=o==null?0:o.length;for(this.clear();++c<f;){var m=o[c];this.set(m[0],m[1])}}function pN(){this.size=0,this.__data__={hash:new Tr,map:new(zo||hi),string:new Tr}}function gN(o){var c=lc(this,o).delete(o);return this.size-=c?1:0,c}function mN(o){return lc(this,o).get(o)}function yN(o){return lc(this,o).has(o)}function _N(o,c){var f=lc(this,o),m=f.size;return f.set(o,c),this.size+=f.size==m?0:1,this}pi.prototype.clear=pN,pi.prototype.delete=gN,pi.prototype.get=mN,pi.prototype.has=yN,pi.prototype.set=_N;function Mr(o){var c=-1,f=o==null?0:o.length;for(this.__data__=new pi;++c<f;)this.add(o[c])}function bN(o){return this.__data__.set(o,d),this}function xN(o){return this.__data__.has(o)}Mr.prototype.add=Mr.prototype.push=bN,Mr.prototype.has=xN;function Fn(o){var c=this.__data__=new hi(o);this.size=c.size}function wN(){this.__data__=new hi,this.size=0}function vN(o){var c=this.__data__,f=c.delete(o);return this.size=c.size,f}function SN(o){return this.__data__.get(o)}function TN(o){return this.__data__.has(o)}function MN(o,c){var f=this.__data__;if(f instanceof hi){var m=f.__data__;if(!zo||m.length<r-1)return m.push([o,c]),this.size=++f.size,this;f=this.__data__=new pi(m)}return f.set(o,c),this.size=f.size,this}Fn.prototype.clear=wN,Fn.prototype.delete=vN,Fn.prototype.get=SN,Fn.prototype.has=TN,Fn.prototype.set=MN;function i0(o,c){var f=Et(o),m=!f&&Ar(o),b=!f&&!m&&Zi(o),k=!f&&!m&&!b&&ws(o),A=f||m||b||k,E=A?Xd(o.length,LL):[],H=E.length;for(var X in o)(c||jt.call(o,X))&&!(A&&(X=="length"||b&&(X=="offset"||X=="parent")||k&&(X=="buffer"||X=="byteLength"||X=="byteOffset")||yi(X,H)))&&E.push(X);return E}function r0(o){var c=o.length;return c?o[pf(0,c-1)]:e}function kN(o,c){return cc(un(o),kr(c,0,o.length))}function DN(o){return cc(un(o))}function rf(o,c,f){(f!==e&&!Un(o[c],f)||f===e&&!(c in o))&&Xn(o,c,f)}function Vo(o,c,f){var m=o[c];(!(jt.call(o,c)&&Un(m,f))||f===e&&!(c in o))&&Xn(o,c,f)}function Xl(o,c){for(var f=o.length;f--;)if(Un(o[f][0],c))return f;return-1}function CN(o,c,f,m){return ji(o,function(b,k,A){c(m,b,f(b),A)}),m}function s0(o,c){return o&&Qn(c,Ee(c),o)}function ON(o,c){return o&&Qn(c,fn(c),o)}function Xn(o,c,f){c=="__proto__"&&$l?$l(o,c,{configurable:!0,enumerable:!0,value:f,writable:!0}):o[c]=f}function sf(o,c){for(var f=-1,m=c.length,b=Y(m),k=o==null;++f<m;)b[f]=k?e:Uf(o,c[f]);return b}function kr(o,c,f){return o===o&&(f!==e&&(o=o<=f?o:f),c!==e&&(o=o>=c?o:c)),o}function An(o,c,f,m,b,k){var A,E=c&y,H=c&_,X=c&x;if(f&&(A=b?f(o,m,b,k):f(o)),A!==e)return A;if(!fe(o))return o;var Z=Et(o);if(Z){if(A=yB(o),!E)return un(o,A)}else{var nt=Ge(o),st=nt==zt||nt==vt;if(Zi(o))return O0(o,E);if(nt==bt||nt==et||st&&!b){if(A=H||st?{}:G0(o),!E)return H?oB(o,ON(A,o)):sB(o,s0(A,o))}else{if(!D[nt])return b?o:{};A=_B(o,nt,E)}}k||(k=new Fn);var _t=k.get(o);if(_t)return _t;k.set(o,A),Sb(o)?o.forEach(function(wt){A.add(An(wt,c,f,wt,o,k))}):wb(o)&&o.forEach(function(wt,Ft){A.set(Ft,An(wt,c,f,Ft,o,k))});var Tt=X?H?Mf:Tf:H?fn:Ee,Nt=Z?e:Tt(o);return yn(Nt||o,function(wt,Ft){Nt&&(Ft=wt,wt=o[Ft]),Vo(A,Ft,An(wt,c,f,Ft,o,k))}),A}function AN(o){var c=Ee(o);return function(f){return o0(f,o,c)}}function o0(o,c,f){var m=f.length;if(o==null)return!m;for(o=ne(o);m--;){var b=f[m],k=c[b],A=o[b];if(A===e&&!(b in o)||!k(A))return!1}return!0}function a0(o,c,f){if(typeof o!="function")throw new Cn(a);return Xo(function(){o.apply(e,f)},c)}function $o(o,c,f,m){var b=-1,k=Pl,A=!0,E=o.length,H=[],X=c.length;if(!E)return H;f&&(c=ue(c,_n(f))),m?(k=$d,A=!1):c.length>=r&&(k=Bo,A=!1,c=new Mr(c));t:for(;++b<E;){var Z=o[b],nt=f==null?Z:f(Z);if(Z=m||Z!==0?Z:0,A&&nt===nt){for(var st=X;st--;)if(c[st]===nt)continue t;H.push(Z)}else k(c,nt,m)||H.push(Z)}return H}var ji=I0(Zn),l0=I0(af,!0);function RN(o,c){var f=!0;return ji(o,function(m,b,k){return f=!!c(m,b,k),f}),f}function Zl(o,c,f){for(var m=-1,b=o.length;++m<b;){var k=o[m],A=c(k);if(A!=null&&(E===e?A===A&&!xn(A):f(A,E)))var E=A,H=k}return H}function EN(o,c,f,m){var b=o.length;for(f=It(f),f<0&&(f=-f>b?0:b+f),m=m===e||m>b?b:It(m),m<0&&(m+=b),m=f>m?0:Mb(m);f<m;)o[f++]=c;return o}function c0(o,c){var f=[];return ji(o,function(m,b,k){c(m,b,k)&&f.push(m)}),f}function Fe(o,c,f,m,b){var k=-1,A=o.length;for(f||(f=xB),b||(b=[]);++k<A;){var E=o[k];c>0&&f(E)?c>1?Fe(E,c-1,f,m,b):$i(b,E):m||(b[b.length]=E)}return b}var of=L0(),u0=L0(!0);function Zn(o,c){return o&&of(o,c,Ee)}function af(o,c){return o&&u0(o,c,Ee)}function Ql(o,c){return Vi(c,function(f){return _i(o[f])})}function Dr(o,c){c=Ki(c,o);for(var f=0,m=c.length;o!=null&&f<m;)o=o[zn(c[f++])];return f&&f==m?o:e}function d0(o,c,f){var m=c(o);return Et(o)?m:$i(m,f(o))}function Qe(o){return o==null?o===e?Le:ve:Sr&&Sr in ne(o)?pB(o):DB(o)}function lf(o,c){return o>c}function PN(o,c){return o!=null&&jt.call(o,c)}function IN(o,c){return o!=null&&c in ne(o)}function LN(o,c,f){return o>=je(c,f)&&o<ke(c,f)}function cf(o,c,f){for(var m=f?$d:Pl,b=o[0].length,k=o.length,A=k,E=Y(k),H=1/0,X=[];A--;){var Z=o[A];A&&c&&(Z=ue(Z,_n(c))),H=je(Z.length,H),E[A]=!f&&(c||b>=120&&Z.length>=120)?new Mr(A&&Z):e}Z=o[0];var nt=-1,st=E[0];t:for(;++nt<b&&X.length<H;){var _t=Z[nt],Tt=c?c(_t):_t;if(_t=f||_t!==0?_t:0,!(st?Bo(st,Tt):m(X,Tt,f))){for(A=k;--A;){var Nt=E[A];if(!(Nt?Bo(Nt,Tt):m(o[A],Tt,f)))continue t}st&&st.push(Tt),X.push(_t)}}return X}function NN(o,c,f,m){return Zn(o,function(b,k,A){c(m,f(b),k,A)}),m}function Yo(o,c,f){c=Ki(c,o),o=Q0(o,c);var m=o==null?o:o[zn(En(c))];return m==null?e:mn(m,o,f)}function f0(o){return ge(o)&&Qe(o)==et}function BN(o){return ge(o)&&Qe(o)==Re}function FN(o){return ge(o)&&Qe(o)==mt}function qo(o,c,f,m,b){return o===c?!0:o==null||c==null||!ge(o)&&!ge(c)?o!==o&&c!==c:zN(o,c,f,m,qo,b)}function zN(o,c,f,m,b,k){var A=Et(o),E=Et(c),H=A?ht:Ge(o),X=E?ht:Ge(c);H=H==et?bt:H,X=X==et?bt:X;var Z=H==bt,nt=X==bt,st=H==X;if(st&&Zi(o)){if(!Zi(c))return!1;A=!0,Z=!1}if(st&&!Z)return k||(k=new Fn),A||ws(o)?Y0(o,c,f,m,b,k):fB(o,c,H,f,m,b,k);if(!(f&v)){var _t=Z&&jt.call(o,"__wrapped__"),Tt=nt&&jt.call(c,"__wrapped__");if(_t||Tt){var Nt=_t?o.value():o,wt=Tt?c.value():c;return k||(k=new Fn),b(Nt,wt,f,m,k)}}return st?(k||(k=new Fn),hB(o,c,f,m,b,k)):!1}function UN(o){return ge(o)&&Ge(o)==Ct}function uf(o,c,f,m){var b=f.length,k=b,A=!m;if(o==null)return!k;for(o=ne(o);b--;){var E=f[b];if(A&&E[2]?E[1]!==o[E[0]]:!(E[0]in o))return!1}for(;++b<k;){E=f[b];var H=E[0],X=o[H],Z=E[1];if(A&&E[2]){if(X===e&&!(H in o))return!1}else{var nt=new Fn;if(m)var st=m(X,Z,H,o,c,nt);if(!(st===e?qo(Z,X,v|M,m,nt):st))return!1}}return!0}function h0(o){if(!fe(o)||vB(o))return!1;var c=_i(o)?UL:Td;return c.test(Or(o))}function HN(o){return ge(o)&&Qe(o)==Ae}function WN(o){return ge(o)&&Ge(o)==oe}function VN(o){return ge(o)&&gc(o.length)&&!!ee[Qe(o)]}function p0(o){return typeof o=="function"?o:o==null?hn:typeof o=="object"?Et(o)?y0(o[0],o[1]):m0(o):Bb(o)}function df(o){if(!Ko(o))return qL(o);var c=[];for(var f in ne(o))jt.call(o,f)&&f!="constructor"&&c.push(f);return c}function $N(o){if(!fe(o))return kB(o);var c=Ko(o),f=[];for(var m in o)m=="constructor"&&(c||!jt.call(o,m))||f.push(m);return f}function ff(o,c){return o<c}function g0(o,c){var f=-1,m=dn(o)?Y(o.length):[];return ji(o,function(b,k,A){m[++f]=c(b,k,A)}),m}function m0(o){var c=Df(o);return c.length==1&&c[0][2]?X0(c[0][0],c[0][1]):function(f){return f===o||uf(f,o,c)}}function y0(o,c){return Of(o)&&K0(c)?X0(zn(o),c):function(f){var m=Uf(f,o);return m===e&&m===c?Hf(f,o):qo(c,m,v|M)}}function Jl(o,c,f,m,b){o!==c&&of(c,function(k,A){if(b||(b=new Fn),fe(k))YN(o,c,A,f,Jl,m,b);else{var E=m?m(Rf(o,A),k,A+"",o,c,b):e;E===e&&(E=k),rf(o,A,E)}},fn)}function YN(o,c,f,m,b,k,A){var E=Rf(o,f),H=Rf(c,f),X=A.get(H);if(X){rf(o,f,X);return}var Z=k?k(E,H,f+"",o,c,A):e,nt=Z===e;if(nt){var st=Et(H),_t=!st&&Zi(H),Tt=!st&&!_t&&ws(H);Z=H,st||_t||Tt?Et(E)?Z=E:_e(E)?Z=un(E):_t?(nt=!1,Z=O0(H,!0)):Tt?(nt=!1,Z=A0(H,!0)):Z=[]:Zo(H)||Ar(H)?(Z=E,Ar(E)?Z=kb(E):(!fe(E)||_i(E))&&(Z=G0(H))):nt=!1}nt&&(A.set(H,Z),b(Z,H,m,k,A),A.delete(H)),rf(o,f,Z)}function _0(o,c){var f=o.length;if(f)return c+=c<0?f:0,yi(c,f)?o[c]:e}function b0(o,c,f){c.length?c=ue(c,function(k){return Et(k)?function(A){return Dr(A,k.length===1?k[0]:k)}:k}):c=[hn];var m=-1;c=ue(c,_n(St()));var b=g0(o,function(k,A,E){var H=ue(c,function(X){return X(k)});return{criteria:H,index:++m,value:k}});return _L(b,function(k,A){return rB(k,A,f)})}function qN(o,c){return x0(o,c,function(f,m){return Hf(o,m)})}function x0(o,c,f){for(var m=-1,b=c.length,k={};++m<b;){var A=c[m],E=Dr(o,A);f(E,A)&&jo(k,Ki(A,o),E)}return k}function jN(o){return function(c){return Dr(c,o)}}function hf(o,c,f,m){var b=m?yL:us,k=-1,A=c.length,E=o;for(o===c&&(c=un(c)),f&&(E=ue(o,_n(f)));++k<A;)for(var H=0,X=c[k],Z=f?f(X):X;(H=b(E,Z,H,m))>-1;)E!==o&&Vl.call(E,H,1),Vl.call(o,H,1);return o}function w0(o,c){for(var f=o?c.length:0,m=f-1;f--;){var b=c[f];if(f==m||b!==k){var k=b;yi(b)?Vl.call(o,b,1):yf(o,b)}}return o}function pf(o,c){return o+ql(e0()*(c-o+1))}function GN(o,c,f,m){for(var b=-1,k=ke(Yl((c-o)/(f||1)),0),A=Y(k);k--;)A[m?k:++b]=o,o+=f;return A}function gf(o,c){var f="";if(!o||c<1||c>tt)return f;do c%2&&(f+=o),c=ql(c/2),c&&(o+=o);while(c);return f}function Bt(o,c){return Ef(Z0(o,c,hn),o+"")}function KN(o){return r0(vs(o))}function XN(o,c){var f=vs(o);return cc(f,kr(c,0,f.length))}function jo(o,c,f,m){if(!fe(o))return o;c=Ki(c,o);for(var b=-1,k=c.length,A=k-1,E=o;E!=null&&++b<k;){var H=zn(c[b]),X=f;if(H==="__proto__"||H==="constructor"||H==="prototype")return o;if(b!=A){var Z=E[H];X=m?m(Z,H,E):e,X===e&&(X=fe(Z)?Z:yi(c[b+1])?[]:{})}Vo(E,H,X),E=E[H]}return o}var v0=jl?function(o,c){return jl.set(o,c),o}:hn,ZN=$l?function(o,c){return $l(o,"toString",{configurable:!0,enumerable:!1,value:Vf(c),writable:!0})}:hn;function QN(o){return cc(vs(o))}function Rn(o,c,f){var m=-1,b=o.length;c<0&&(c=-c>b?0:b+c),f=f>b?b:f,f<0&&(f+=b),b=c>f?0:f-c>>>0,c>>>=0;for(var k=Y(b);++m<b;)k[m]=o[m+c];return k}function JN(o,c){var f;return ji(o,function(m,b,k){return f=c(m,b,k),!f}),!!f}function tc(o,c,f){var m=0,b=o==null?m:o.length;if(typeof c=="number"&&c===c&&b<=pt){for(;m<b;){var k=m+b>>>1,A=o[k];A!==null&&!xn(A)&&(f?A<=c:A<c)?m=k+1:b=k}return b}return mf(o,c,hn,f)}function mf(o,c,f,m){var b=0,k=o==null?0:o.length;if(k===0)return 0;c=f(c);for(var A=c!==c,E=c===null,H=xn(c),X=c===e;b<k;){var Z=ql((b+k)/2),nt=f(o[Z]),st=nt!==e,_t=nt===null,Tt=nt===nt,Nt=xn(nt);if(A)var wt=m||Tt;else X?wt=Tt&&(m||st):E?wt=Tt&&st&&(m||!_t):H?wt=Tt&&st&&!_t&&(m||!Nt):_t||Nt?wt=!1:wt=m?nt<=c:nt<c;wt?b=Z+1:k=Z}return je(k,j)}function S0(o,c){for(var f=-1,m=o.length,b=0,k=[];++f<m;){var A=o[f],E=c?c(A):A;if(!f||!Un(E,H)){var H=E;k[b++]=A===0?0:A}}return k}function T0(o){return typeof o=="number"?o:xn(o)?P:+o}function bn(o){if(typeof o=="string")return o;if(Et(o))return ue(o,bn)+"";if(xn(o))return n0?n0.call(o):"";var c=o+"";return c=="0"&&1/o==-rt?"-0":c}function Gi(o,c,f){var m=-1,b=Pl,k=o.length,A=!0,E=[],H=E;if(f)A=!1,b=$d;else if(k>=r){var X=c?null:uB(o);if(X)return Ll(X);A=!1,b=Bo,H=new Mr}else H=c?[]:E;t:for(;++m<k;){var Z=o[m],nt=c?c(Z):Z;if(Z=f||Z!==0?Z:0,A&&nt===nt){for(var st=H.length;st--;)if(H[st]===nt)continue t;c&&H.push(nt),E.push(Z)}else b(H,nt,f)||(H!==E&&H.push(nt),E.push(Z))}return E}function yf(o,c){c=Ki(c,o);var f=-1,m=c.length;if(!m)return!0;for(;++f<m;){var b=zn(c[f]);if(b==="__proto__"&&!jt.call(o,"__proto__")||(b==="constructor"||b==="prototype")&&f<m-1)return!1}var k=Q0(o,c);return k==null||delete k[zn(En(c))]}function M0(o,c,f,m){return jo(o,c,f(Dr(o,c)),m)}function ec(o,c,f,m){for(var b=o.length,k=m?b:-1;(m?k--:++k<b)&&c(o[k],k,o););return f?Rn(o,m?0:k,m?k+1:b):Rn(o,m?k+1:0,m?b:k)}function k0(o,c){var f=o;return f instanceof Ut&&(f=f.value()),Yd(c,function(m,b){return b.func.apply(b.thisArg,$i([m],b.args))},f)}function _f(o,c,f){var m=o.length;if(m<2)return m?Gi(o[0]):[];for(var b=-1,k=Y(m);++b<m;)for(var A=o[b],E=-1;++E<m;)E!=b&&(k[b]=$o(k[b]||A,o[E],c,f));return Gi(Fe(k,1),c,f)}function D0(o,c,f){for(var m=-1,b=o.length,k=c.length,A={};++m<b;){var E=m<k?c[m]:e;f(A,o[m],E)}return A}function bf(o){return _e(o)?o:[]}function xf(o){return typeof o=="function"?o:hn}function Ki(o,c){return Et(o)?o:Of(o,c)?[o]:nb(Gt(o))}var tB=Bt;function Xi(o,c,f){var m=o.length;return f=f===e?m:f,!c&&f>=m?o:Rn(o,c,f)}var C0=HL||function(o){return ce.clearTimeout(o)};function O0(o,c){if(c)return o.slice();var f=o.length,m=X_?X_(f):new o.constructor(f);return o.copy(m),m}function wf(o){var c=new o.constructor(o.byteLength);return new Hl(c).set(new Hl(o)),c}function eB(o,c){var f=c?wf(o.buffer):o.buffer;return new o.constructor(f,o.byteOffset,o.byteLength)}function nB(o){var c=new o.constructor(o.source,ml.exec(o));return c.lastIndex=o.lastIndex,c}function iB(o){return Wo?ne(Wo.call(o)):{}}function A0(o,c){var f=c?wf(o.buffer):o.buffer;return new o.constructor(f,o.byteOffset,o.length)}function R0(o,c){if(o!==c){var f=o!==e,m=o===null,b=o===o,k=xn(o),A=c!==e,E=c===null,H=c===c,X=xn(c);if(!E&&!X&&!k&&o>c||k&&A&&H&&!E&&!X||m&&A&&H||!f&&H||!b)return 1;if(!m&&!k&&!X&&o<c||X&&f&&b&&!m&&!k||E&&f&&b||!A&&b||!H)return-1}return 0}function rB(o,c,f){for(var m=-1,b=o.criteria,k=c.criteria,A=b.length,E=f.length;++m<A;){var H=R0(b[m],k[m]);if(H){if(m>=E)return H;var X=f[m];return H*(X=="desc"?-1:1)}}return o.index-c.index}function E0(o,c,f,m){for(var b=-1,k=o.length,A=f.length,E=-1,H=c.length,X=ke(k-A,0),Z=Y(H+X),nt=!m;++E<H;)Z[E]=c[E];for(;++b<A;)(nt||b<k)&&(Z[f[b]]=o[b]);for(;X--;)Z[E++]=o[b++];return Z}function P0(o,c,f,m){for(var b=-1,k=o.length,A=-1,E=f.length,H=-1,X=c.length,Z=ke(k-E,0),nt=Y(Z+X),st=!m;++b<Z;)nt[b]=o[b];for(var _t=b;++H<X;)nt[_t+H]=c[H];for(;++A<E;)(st||b<k)&&(nt[_t+f[A]]=o[b++]);return nt}function un(o,c){var f=-1,m=o.length;for(c||(c=Y(m));++f<m;)c[f]=o[f];return c}function Qn(o,c,f,m){var b=!f;f||(f={});for(var k=-1,A=c.length;++k<A;){var E=c[k],H=m?m(f[E],o[E],E,f,o):e;H===e&&(H=o[E]),b?Xn(f,E,H):Vo(f,E,H)}return f}function sB(o,c){return Qn(o,Cf(o),c)}function oB(o,c){return Qn(o,q0(o),c)}function nc(o,c){return function(f,m){var b=Et(f)?dL:CN,k=c?c():{};return b(f,o,St(m,2),k)}}function _s(o){return Bt(function(c,f){var m=-1,b=f.length,k=b>1?f[b-1]:e,A=b>2?f[2]:e;for(k=o.length>3&&typeof k=="function"?(b--,k):e,A&&Je(f[0],f[1],A)&&(k=b<3?e:k,b=1),c=ne(c);++m<b;){var E=f[m];E&&o(c,E,m,k)}return c})}function I0(o,c){return function(f,m){if(f==null)return f;if(!dn(f))return o(f,m);for(var b=f.length,k=c?b:-1,A=ne(f);(c?k--:++k<b)&&m(A[k],k,A)!==!1;);return f}}function L0(o){return function(c,f,m){for(var b=-1,k=ne(c),A=m(c),E=A.length;E--;){var H=A[o?E:++b];if(f(k[H],H,k)===!1)break}return c}}function aB(o,c,f){var m=c&C,b=Go(o);function k(){var A=this&&this!==ce&&this instanceof k?b:o;return A.apply(m?f:this,arguments)}return k}function N0(o){return function(c){c=Gt(c);var f=ds(c)?Bn(c):e,m=f?f[0]:c.charAt(0),b=f?Xi(f,1).join(""):c.slice(1);return m[o]()+b}}function bs(o){return function(c){return Yd(Lb(Ib(c).replace(zd,"")),o,"")}}function Go(o){return function(){var c=arguments;switch(c.length){case 0:return new o;case 1:return new o(c[0]);case 2:return new o(c[0],c[1]);case 3:return new o(c[0],c[1],c[2]);case 4:return new o(c[0],c[1],c[2],c[3]);case 5:return new o(c[0],c[1],c[2],c[3],c[4]);case 6:return new o(c[0],c[1],c[2],c[3],c[4],c[5]);case 7:return new o(c[0],c[1],c[2],c[3],c[4],c[5],c[6])}var f=ys(o.prototype),m=o.apply(f,c);return fe(m)?m:f}}function lB(o,c,f){var m=Go(o);function b(){for(var k=arguments.length,A=Y(k),E=k,H=xs(b);E--;)A[E]=arguments[E];var X=k<3&&A[0]!==H&&A[k-1]!==H?[]:Yi(A,H);if(k-=X.length,k<f)return H0(o,c,ic,b.placeholder,e,A,X,e,e,f-k);var Z=this&&this!==ce&&this instanceof b?m:o;return mn(Z,this,A)}return b}function B0(o){return function(c,f,m){var b=ne(c);if(!dn(c)){var k=St(f,3);c=Ee(c),f=function(E){return k(b[E],E,b)}}var A=o(c,f,m);return A>-1?b[k?c[A]:A]:e}}function F0(o){return mi(function(c){var f=c.length,m=f,b=On.prototype.thru;for(o&&c.reverse();m--;){var k=c[m];if(typeof k!="function")throw new Cn(a);if(b&&!A&&ac(k)=="wrapper")var A=new On([],!0)}for(m=A?m:f;++m<f;){k=c[m];var E=ac(k),H=E=="wrapper"?kf(k):e;H&&Af(H[0])&&H[1]==(T|I|N|S)&&!H[4].length&&H[9]==1?A=A[ac(H[0])].apply(A,H[3]):A=k.length==1&&Af(k)?A[E]():A.thru(k)}return function(){var X=arguments,Z=X[0];if(A&&X.length==1&&Et(Z))return A.plant(Z).value();for(var nt=0,st=f?c[nt].apply(this,X):Z;++nt<f;)st=c[nt].call(this,st);return st}})}function ic(o,c,f,m,b,k,A,E,H,X){var Z=c&T,nt=c&C,st=c&R,_t=c&(I|L),Tt=c&O,Nt=st?e:Go(o);function wt(){for(var Ft=arguments.length,Ht=Y(Ft),wn=Ft;wn--;)Ht[wn]=arguments[wn];if(_t)var tn=xs(wt),vn=xL(Ht,tn);if(m&&(Ht=E0(Ht,m,b,_t)),k&&(Ht=P0(Ht,k,A,_t)),Ft-=vn,_t&&Ft<X){var be=Yi(Ht,tn);return H0(o,c,ic,wt.placeholder,f,Ht,be,E,H,X-Ft)}var Hn=nt?f:this,xi=st?Hn[o]:o;return Ft=Ht.length,E?Ht=CB(Ht,E):Tt&&Ft>1&&Ht.reverse(),Z&&H<Ft&&(Ht.length=H),this&&this!==ce&&this instanceof wt&&(xi=Nt||Go(xi)),xi.apply(Hn,Ht)}return wt}function z0(o,c){return function(f,m){return NN(f,o,c(m),{})}}function rc(o,c){return function(f,m){var b;if(f===e&&m===e)return c;if(f!==e&&(b=f),m!==e){if(b===e)return m;typeof f=="string"||typeof m=="string"?(f=bn(f),m=bn(m)):(f=T0(f),m=T0(m)),b=o(f,m)}return b}}function vf(o){return mi(function(c){return c=ue(c,_n(St())),Bt(function(f){var m=this;return o(c,function(b){return mn(b,m,f)})})})}function sc(o,c){c=c===e?" ":bn(c);var f=c.length;if(f<2)return f?gf(c,o):c;var m=gf(c,Yl(o/fs(c)));return ds(c)?Xi(Bn(m),0,o).join(""):m.slice(0,o)}function cB(o,c,f,m){var b=c&C,k=Go(o);function A(){for(var E=-1,H=arguments.length,X=-1,Z=m.length,nt=Y(Z+H),st=this&&this!==ce&&this instanceof A?k:o;++X<Z;)nt[X]=m[X];for(;H--;)nt[X++]=arguments[++E];return mn(st,b?f:this,nt)}return A}function U0(o){return function(c,f,m){return m&&typeof m!="number"&&Je(c,f,m)&&(f=m=e),c=bi(c),f===e?(f=c,c=0):f=bi(f),m=m===e?c<f?1:-1:bi(m),GN(c,f,m,o)}}function oc(o){return function(c,f){return typeof c=="string"&&typeof f=="string"||(c=Pn(c),f=Pn(f)),o(c,f)}}function H0(o,c,f,m,b,k,A,E,H,X){var Z=c&I,nt=Z?A:e,st=Z?e:A,_t=Z?k:e,Tt=Z?e:k;c|=Z?N:B,c&=~(Z?B:N),c&F||(c&=-4);var Nt=[o,c,b,_t,nt,Tt,st,E,H,X],wt=f.apply(e,Nt);return Af(o)&&J0(wt,Nt),wt.placeholder=m,tb(wt,o,c)}function Sf(o){var c=Me[o];return function(f,m){if(f=Pn(f),m=m==null?0:je(It(m),292),m&&t0(f)){var b=(Gt(f)+"e").split("e"),k=c(b[0]+"e"+(+b[1]+m));return b=(Gt(k)+"e").split("e"),+(b[0]+"e"+(+b[1]-m))}return c(f)}}var uB=gs&&1/Ll(new gs([,-0]))[1]==rt?function(o){return new gs(o)}:qf;function W0(o){return function(c){var f=Ge(c);return f==Ct?Qd(c):f==oe?DL(c):bL(c,o(c))}}function gi(o,c,f,m,b,k,A,E){var H=c&R;if(!H&&typeof o!="function")throw new Cn(a);var X=m?m.length:0;if(X||(c&=-97,m=b=e),A=A===e?A:ke(It(A),0),E=E===e?E:It(E),X-=b?b.length:0,c&B){var Z=m,nt=b;m=b=e}var st=H?e:kf(o),_t=[o,c,f,m,b,Z,nt,k,A,E];if(st&&MB(_t,st),o=_t[0],c=_t[1],f=_t[2],m=_t[3],b=_t[4],E=_t[9]=_t[9]===e?H?0:o.length:ke(_t[9]-X,0),!E&&c&(I|L)&&(c&=-25),!c||c==C)var Tt=aB(o,c,f);else c==I||c==L?Tt=lB(o,c,E):(c==N||c==(C|N))&&!b.length?Tt=cB(o,c,f,m):Tt=ic.apply(e,_t);var Nt=st?v0:J0;return tb(Nt(Tt,_t),o,c)}function V0(o,c,f,m){return o===e||Un(o,ps[f])&&!jt.call(m,f)?c:o}function $0(o,c,f,m,b,k){return fe(o)&&fe(c)&&(k.set(c,o),Jl(o,c,e,$0,k),k.delete(c)),o}function dB(o){return Zo(o)?e:o}function Y0(o,c,f,m,b,k){var A=f&v,E=o.length,H=c.length;if(E!=H&&!(A&&H>E))return!1;var X=k.get(o),Z=k.get(c);if(X&&Z)return X==c&&Z==o;var nt=-1,st=!0,_t=f&M?new Mr:e;for(k.set(o,c),k.set(c,o);++nt<E;){var Tt=o[nt],Nt=c[nt];if(m)var wt=A?m(Nt,Tt,nt,c,o,k):m(Tt,Nt,nt,o,c,k);if(wt!==e){if(wt)continue;st=!1;break}if(_t){if(!qd(c,function(Ft,Ht){if(!Bo(_t,Ht)&&(Tt===Ft||b(Tt,Ft,f,m,k)))return _t.push(Ht)})){st=!1;break}}else if(!(Tt===Nt||b(Tt,Nt,f,m,k))){st=!1;break}}return k.delete(o),k.delete(c),st}function fB(o,c,f,m,b,k,A){switch(f){case gn:if(o.byteLength!=c.byteLength||o.byteOffset!=c.byteOffset)return!1;o=o.buffer,c=c.buffer;case Re:return!(o.byteLength!=c.byteLength||!k(new Hl(o),new Hl(c)));case ct:case mt:case Dt:return Un(+o,+c);case Lt:return o.name==c.name&&o.message==c.message;case Ae:case ln:return o==c+"";case Ct:var E=Qd;case oe:var H=m&v;if(E||(E=Ll),o.size!=c.size&&!H)return!1;var X=A.get(o);if(X)return X==c;m|=M,A.set(o,c);var Z=Y0(E(o),E(c),m,b,k,A);return A.delete(o),Z;case Vt:if(Wo)return Wo.call(o)==Wo.call(c)}return!1}function hB(o,c,f,m,b,k){var A=f&v,E=Tf(o),H=E.length,X=Tf(c),Z=X.length;if(H!=Z&&!A)return!1;for(var nt=H;nt--;){var st=E[nt];if(!(A?st in c:jt.call(c,st)))return!1}var _t=k.get(o),Tt=k.get(c);if(_t&&Tt)return _t==c&&Tt==o;var Nt=!0;k.set(o,c),k.set(c,o);for(var wt=A;++nt<H;){st=E[nt];var Ft=o[st],Ht=c[st];if(m)var wn=A?m(Ht,Ft,st,c,o,k):m(Ft,Ht,st,o,c,k);if(!(wn===e?Ft===Ht||b(Ft,Ht,f,m,k):wn)){Nt=!1;break}wt||(wt=st=="constructor")}if(Nt&&!wt){var tn=o.constructor,vn=c.constructor;tn!=vn&&"constructor"in o&&"constructor"in c&&!(typeof tn=="function"&&tn instanceof tn&&typeof vn=="function"&&vn instanceof vn)&&(Nt=!1)}return k.delete(o),k.delete(c),Nt}function mi(o){return Ef(Z0(o,e,ob),o+"")}function Tf(o){return d0(o,Ee,Cf)}function Mf(o){return d0(o,fn,q0)}var kf=jl?function(o){return jl.get(o)}:qf;function ac(o){for(var c=o.name+"",f=ms[c],m=jt.call(ms,c)?f.length:0;m--;){var b=f[m],k=b.func;if(k==null||k==o)return b.name}return c}function xs(o){var c=jt.call(w,"placeholder")?w:o;return c.placeholder}function St(){var o=w.iteratee||$f;return o=o===$f?p0:o,arguments.length?o(arguments[0],arguments[1]):o}function lc(o,c){var f=o.__data__;return wB(c)?f[typeof c=="string"?"string":"hash"]:f.map}function Df(o){for(var c=Ee(o),f=c.length;f--;){var m=c[f],b=o[m];c[f]=[m,b,K0(b)]}return c}function Cr(o,c){var f=TL(o,c);return h0(f)?f:e}function pB(o){var c=jt.call(o,Sr),f=o[Sr];try{o[Sr]=e;var m=!0}catch{}var b=zl.call(o);return m&&(c?o[Sr]=f:delete o[Sr]),b}var Cf=tf?function(o){return o==null?[]:(o=ne(o),Vi(tf(o),function(c){return Q_.call(o,c)}))}:jf,q0=tf?function(o){for(var c=[];o;)$i(c,Cf(o)),o=Wl(o);return c}:jf,Ge=Qe;(ef&&Ge(new ef(new ArrayBuffer(1)))!=gn||zo&&Ge(new zo)!=Ct||nf&&Ge(nf.resolve())!=qt||gs&&Ge(new gs)!=oe||Uo&&Ge(new Uo)!=ie)&&(Ge=function(o){var c=Qe(o),f=c==bt?o.constructor:e,m=f?Or(f):"";if(m)switch(m){case XL:return gn;case ZL:return Ct;case QL:return qt;case JL:return oe;case tN:return ie}return c});function gB(o,c,f){for(var m=-1,b=f.length;++m<b;){var k=f[m],A=k.size;switch(k.type){case"drop":o+=A;break;case"dropRight":c-=A;break;case"take":c=je(c,o+A);break;case"takeRight":o=ke(o,c-A);break}}return{start:o,end:c}}function mB(o){var c=o.match(_d);return c?c[1].split(bd):[]}function j0(o,c,f){c=Ki(c,o);for(var m=-1,b=c.length,k=!1;++m<b;){var A=zn(c[m]);if(!(k=o!=null&&f(o,A)))break;o=o[A]}return k||++m!=b?k:(b=o==null?0:o.length,!!b&&gc(b)&&yi(A,b)&&(Et(o)||Ar(o)))}function yB(o){var c=o.length,f=new o.constructor(c);return c&&typeof o[0]=="string"&&jt.call(o,"index")&&(f.index=o.index,f.input=o.input),f}function G0(o){return typeof o.constructor=="function"&&!Ko(o)?ys(Wl(o)):{}}function _B(o,c,f){var m=o.constructor;switch(c){case Re:return wf(o);case ct:case mt:return new m(+o);case gn:return eB(o,f);case zi:case Dn:case Ye:case In:case ci:case vo:case So:case br:case ui:return A0(o,f);case Ct:return new m;case Dt:case ln:return new m(o);case Ae:return nB(o);case oe:return new m;case Vt:return iB(o)}}function bB(o,c){var f=c.length;if(!f)return o;var m=f-1;return c[m]=(f>1?"& ":"")+c[m],c=c.join(f>2?", ":" "),o.replace(Ln,`{
|
|
8
8
|
/* [wrapped with `+c+`] */
|
|
9
|
-
`)}function pB(o){return Et(o)||Ar(o)||!!(Q_&&o&&o[Q_])}function yi(o,c){var f=typeof o;return c=c??tt,!!c&&(f=="number"||f!="symbol"&&Wi.test(o))&&o>-1&&o%1==0&&o<c}function Je(o,c,f){if(!fe(f))return!1;var m=typeof c;return(m=="number"?dn(f)&&yi(c,f.length):m=="string"&&c in f)?Un(f[c],o):!1}function Of(o,c){if(Et(o))return!1;var f=typeof o;return f=="number"||f=="symbol"||f=="boolean"||o==null||xn(o)?!0:di.test(o)||!pl.test(o)||c!=null&&o in ne(c)}function gB(o){var c=typeof o;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?o!=="__proto__":o===null}function Af(o){var c=ac(o),f=w[c];if(typeof f!="function"||!(c in Ut.prototype))return!1;if(o===f)return!0;var m=kf(f);return!!m&&o===m[0]}function mB(o){return!!G_&&G_ in o}var yB=Bl?_i:Gf;function Ko(o){var c=o&&o.constructor,f=typeof c=="function"&&c.prototype||ps;return o===f}function G0(o){return o===o&&!fe(o)}function K0(o,c){return function(f){return f==null?!1:f[o]===c&&(c!==e||o in ne(f))}}function _B(o){var c=hc(o,function(m){return f.size===h&&f.clear(),m}),f=c.cache;return c}function bB(o,c){var f=o[1],m=c[1],b=f|m,k=b<(C|R|T),A=m==T&&f==I||m==T&&f==S&&o[7].length<=c[8]||m==(T|S)&&c[7].length<=c[8]&&f==I;if(!(k||A))return o;m&C&&(o[2]=c[2],b|=f&C?0:F);var E=c[3];if(E){var H=o[3];o[3]=H?R0(H,E,c[4]):E,o[4]=H?Yi(o[3],g):c[4]}return E=c[5],E&&(H=o[5],o[5]=H?E0(H,E,c[6]):E,o[6]=H?Yi(o[5],g):c[6]),E=c[7],E&&(o[7]=E),m&T&&(o[8]=o[8]==null?c[8]:je(o[8],c[8])),o[9]==null&&(o[9]=c[9]),o[0]=c[0],o[1]=b,o}function xB(o){var c=[];if(o!=null)for(var f in ne(o))c.push(f);return c}function wB(o){return zl.call(o)}function X0(o,c,f){return c=ke(c===e?o.length-1:c,0),function(){for(var m=arguments,b=-1,k=ke(m.length-c,0),A=Y(k);++b<k;)A[b]=m[c+b];b=-1;for(var E=Y(c+1);++b<c;)E[b]=m[b];return E[c]=f(A),mn(o,this,E)}}function Z0(o,c){return c.length<2?o:Dr(o,Rn(c,0,-1))}function vB(o,c){for(var f=o.length,m=je(c.length,f),b=un(o);m--;){var k=c[m];o[m]=yi(k,f)?b[k]:e}return o}function Rf(o,c){if(!(c==="constructor"&&typeof o[c]=="function")&&c!="__proto__")return o[c]}var Q0=tb(w0),Xo=BL||function(o,c){return ce.setTimeout(o,c)},Ef=tb(YN);function J0(o,c,f){var m=c+"";return Ef(o,hB(m,SB(uB(m),f)))}function tb(o){var c=0,f=0;return function(){var m=HL(),b=at-(m-f);if(f=m,b>0){if(++c>=it)return arguments[0]}else c=0;return o.apply(e,arguments)}}function cc(o,c){var f=-1,m=o.length,b=m-1;for(c=c===e?m:c;++f<c;){var k=pf(f,b),A=o[k];o[k]=o[f],o[f]=A}return o.length=c,o}var eb=_B(function(o){var c=[];return o.charCodeAt(0)===46&&c.push(""),o.replace(gd,function(f,m,b,k){c.push(b?k.replace(wd,"$1"):m||f)}),c});function zn(o){if(typeof o=="string"||xn(o))return o;var c=o+"";return c=="0"&&1/o==-rt?"-0":c}function Or(o){if(o!=null){try{return Fl.call(o)}catch{}try{return o+""}catch{}}return""}function SB(o,c){return yn(lt,function(f){var m="_."+f[0];c&f[1]&&!Pl(o,m)&&o.push(m)}),o.sort()}function nb(o){if(o instanceof Ut)return o.clone();var c=new On(o.__wrapped__,o.__chain__);return c.__actions__=un(o.__actions__),c.__index__=o.__index__,c.__values__=o.__values__,c}function TB(o,c,f){(f?Je(o,c,f):c===e)?c=1:c=ke(It(c),0);var m=o==null?0:o.length;if(!m||c<1)return[];for(var b=0,k=0,A=Y(Yl(m/c));b<m;)A[k++]=Rn(o,b,b+=c);return A}function MB(o){for(var c=-1,f=o==null?0:o.length,m=0,b=[];++c<f;){var k=o[c];k&&(b[m++]=k)}return b}function kB(){var o=arguments.length;if(!o)return[];for(var c=Y(o-1),f=arguments[0],m=o;m--;)c[m-1]=arguments[m];return $i(Et(f)?un(f):[f],Fe(c,1))}var DB=Bt(function(o,c){return _e(o)?$o(o,Fe(c,1,_e,!0)):[]}),CB=Bt(function(o,c){var f=En(c);return _e(f)&&(f=e),_e(o)?$o(o,Fe(c,1,_e,!0),St(f,2)):[]}),OB=Bt(function(o,c){var f=En(c);return _e(f)&&(f=e),_e(o)?$o(o,Fe(c,1,_e,!0),e,f):[]});function AB(o,c,f){var m=o==null?0:o.length;return m?(c=f||c===e?1:It(c),Rn(o,c<0?0:c,m)):[]}function RB(o,c,f){var m=o==null?0:o.length;return m?(c=f||c===e?1:It(c),c=m-c,Rn(o,0,c<0?0:c)):[]}function EB(o,c){return o&&o.length?ec(o,St(c,3),!0,!0):[]}function PB(o,c){return o&&o.length?ec(o,St(c,3),!0):[]}function IB(o,c,f,m){var b=o==null?0:o.length;return b?(f&&typeof f!="number"&&Je(o,c,f)&&(f=0,m=b),kN(o,c,f,m)):[]}function ib(o,c,f){var m=o==null?0:o.length;if(!m)return-1;var b=f==null?0:It(f);return b<0&&(b=ke(m+b,0)),Il(o,St(c,3),b)}function rb(o,c,f){var m=o==null?0:o.length;if(!m)return-1;var b=m-1;return f!==e&&(b=It(f),b=f<0?ke(m+b,0):je(b,m-1)),Il(o,St(c,3),b,!0)}function sb(o){var c=o==null?0:o.length;return c?Fe(o,1):[]}function LB(o){var c=o==null?0:o.length;return c?Fe(o,rt):[]}function NB(o,c){var f=o==null?0:o.length;return f?(c=c===e?1:It(c),Fe(o,c)):[]}function BB(o){for(var c=-1,f=o==null?0:o.length,m={};++c<f;){var b=o[c];Xn(m,b[0],b[1])}return m}function ob(o){return o&&o.length?o[0]:e}function FB(o,c,f){var m=o==null?0:o.length;if(!m)return-1;var b=f==null?0:It(f);return b<0&&(b=ke(m+b,0)),us(o,c,b)}function zB(o){var c=o==null?0:o.length;return c?Rn(o,0,-1):[]}var UB=Bt(function(o){var c=ue(o,bf);return c.length&&c[0]===o[0]?cf(c):[]}),HB=Bt(function(o){var c=En(o),f=ue(o,bf);return c===En(f)?c=e:f.pop(),f.length&&f[0]===o[0]?cf(f,St(c,2)):[]}),WB=Bt(function(o){var c=En(o),f=ue(o,bf);return c=typeof c=="function"?c:e,c&&f.pop(),f.length&&f[0]===o[0]?cf(f,e,c):[]});function VB(o,c){return o==null?"":zL.call(o,c)}function En(o){var c=o==null?0:o.length;return c?o[c-1]:e}function $B(o,c,f){var m=o==null?0:o.length;if(!m)return-1;var b=m;return f!==e&&(b=It(f),b=b<0?ke(m+b,0):je(b,m-1)),c===c?SL(o,c,b):Il(o,U_,b,!0)}function YB(o,c){return o&&o.length?y0(o,It(c)):e}var qB=Bt(ab);function ab(o,c){return o&&o.length&&c&&c.length?hf(o,c):o}function jB(o,c,f){return o&&o.length&&c&&c.length?hf(o,c,St(f,2)):o}function GB(o,c,f){return o&&o.length&&c&&c.length?hf(o,c,e,f):o}var KB=mi(function(o,c){var f=o==null?0:o.length,m=sf(o,c);return x0(o,ue(c,function(b){return yi(b,f)?+b:b}).sort(A0)),m});function XB(o,c){var f=[];if(!(o&&o.length))return f;var m=-1,b=[],k=o.length;for(c=St(c,3);++m<k;){var A=o[m];c(A,m,o)&&(f.push(A),b.push(m))}return x0(o,b),f}function Pf(o){return o==null?o:VL.call(o)}function ZB(o,c,f){var m=o==null?0:o.length;return m?(f&&typeof f!="number"&&Je(o,c,f)?(c=0,f=m):(c=c==null?0:It(c),f=f===e?m:It(f)),Rn(o,c,f)):[]}function QB(o,c){return tc(o,c)}function JB(o,c,f){return mf(o,c,St(f,2))}function tF(o,c){var f=o==null?0:o.length;if(f){var m=tc(o,c);if(m<f&&Un(o[m],c))return m}return-1}function eF(o,c){return tc(o,c,!0)}function nF(o,c,f){return mf(o,c,St(f,2),!0)}function iF(o,c){var f=o==null?0:o.length;if(f){var m=tc(o,c,!0)-1;if(Un(o[m],c))return m}return-1}function rF(o){return o&&o.length?v0(o):[]}function sF(o,c){return o&&o.length?v0(o,St(c,2)):[]}function oF(o){var c=o==null?0:o.length;return c?Rn(o,1,c):[]}function aF(o,c,f){return o&&o.length?(c=f||c===e?1:It(c),Rn(o,0,c<0?0:c)):[]}function lF(o,c,f){var m=o==null?0:o.length;return m?(c=f||c===e?1:It(c),c=m-c,Rn(o,c<0?0:c,m)):[]}function cF(o,c){return o&&o.length?ec(o,St(c,3),!1,!0):[]}function uF(o,c){return o&&o.length?ec(o,St(c,3)):[]}var dF=Bt(function(o){return Gi(Fe(o,1,_e,!0))}),fF=Bt(function(o){var c=En(o);return _e(c)&&(c=e),Gi(Fe(o,1,_e,!0),St(c,2))}),hF=Bt(function(o){var c=En(o);return c=typeof c=="function"?c:e,Gi(Fe(o,1,_e,!0),e,c)});function pF(o){return o&&o.length?Gi(o):[]}function gF(o,c){return o&&o.length?Gi(o,St(c,2)):[]}function mF(o,c){return c=typeof c=="function"?c:e,o&&o.length?Gi(o,e,c):[]}function If(o){if(!(o&&o.length))return[];var c=0;return o=Vi(o,function(f){if(_e(f))return c=ke(f.length,c),!0}),Xd(c,function(f){return ue(o,jd(f))})}function lb(o,c){if(!(o&&o.length))return[];var f=If(o);return c==null?f:ue(f,function(m){return mn(c,e,m)})}var yF=Bt(function(o,c){return _e(o)?$o(o,c):[]}),_F=Bt(function(o){return _f(Vi(o,_e))}),bF=Bt(function(o){var c=En(o);return _e(c)&&(c=e),_f(Vi(o,_e),St(c,2))}),xF=Bt(function(o){var c=En(o);return c=typeof c=="function"?c:e,_f(Vi(o,_e),e,c)}),wF=Bt(If);function vF(o,c){return k0(o||[],c||[],Vo)}function SF(o,c){return k0(o||[],c||[],jo)}var TF=Bt(function(o){var c=o.length,f=c>1?o[c-1]:e;return f=typeof f=="function"?(o.pop(),f):e,lb(o,f)});function cb(o){var c=w(o);return c.__chain__=!0,c}function MF(o,c){return c(o),o}function uc(o,c){return c(o)}var kF=mi(function(o){var c=o.length,f=c?o[0]:0,m=this.__wrapped__,b=function(k){return sf(k,o)};return c>1||this.__actions__.length||!(m instanceof Ut)||!yi(f)?this.thru(b):(m=m.slice(f,+f+(c?1:0)),m.__actions__.push({func:uc,args:[b],thisArg:e}),new On(m,this.__chain__).thru(function(k){return c&&!k.length&&k.push(e),k}))});function DF(){return cb(this)}function CF(){return new On(this.value(),this.__chain__)}function OF(){this.__values__===e&&(this.__values__=Sb(this.value()));var o=this.__index__>=this.__values__.length,c=o?e:this.__values__[this.__index__++];return{done:o,value:c}}function AF(){return this}function RF(o){for(var c,f=this;f instanceof Kl;){var m=nb(f);m.__index__=0,m.__values__=e,c?b.__wrapped__=m:c=m;var b=m;f=f.__wrapped__}return b.__wrapped__=o,c}function EF(){var o=this.__wrapped__;if(o instanceof Ut){var c=o;return this.__actions__.length&&(c=new Ut(this)),c=c.reverse(),c.__actions__.push({func:uc,args:[Pf],thisArg:e}),new On(c,this.__chain__)}return this.thru(Pf)}function PF(){return M0(this.__wrapped__,this.__actions__)}var IF=nc(function(o,c,f){jt.call(o,f)?++o[f]:Xn(o,f,1)});function LF(o,c,f){var m=Et(o)?F_:MN;return f&&Je(o,c,f)&&(c=e),m(o,St(c,3))}function NF(o,c){var f=Et(o)?Vi:l0;return f(o,St(c,3))}var BF=N0(ib),FF=N0(rb);function zF(o,c){return Fe(dc(o,c),1)}function UF(o,c){return Fe(dc(o,c),rt)}function HF(o,c,f){return f=f===e?1:It(f),Fe(dc(o,c),f)}function ub(o,c){var f=Et(o)?yn:ji;return f(o,St(c,3))}function db(o,c){var f=Et(o)?oL:a0;return f(o,St(c,3))}var WF=nc(function(o,c,f){jt.call(o,f)?o[f].push(c):Xn(o,f,[c])});function VF(o,c,f,m){o=dn(o)?o:vs(o),f=f&&!m?It(f):0;var b=o.length;return f<0&&(f=ke(b+f,0)),mc(o)?f<=b&&o.indexOf(c,f)>-1:!!b&&us(o,c,f)>-1}var $F=Bt(function(o,c,f){var m=-1,b=typeof c=="function",k=dn(o)?Y(o.length):[];return ji(o,function(A){k[++m]=b?mn(c,A,f):Yo(A,c,f)}),k}),YF=nc(function(o,c,f){Xn(o,f,c)});function dc(o,c){var f=Et(o)?ue:p0;return f(o,St(c,3))}function qF(o,c,f,m){return o==null?[]:(Et(c)||(c=c==null?[]:[c]),f=m?e:f,Et(f)||(f=f==null?[]:[f]),_0(o,c,f))}var jF=nc(function(o,c,f){o[f?0:1].push(c)},function(){return[[],[]]});function GF(o,c,f){var m=Et(o)?Yd:W_,b=arguments.length<3;return m(o,St(c,4),f,b,ji)}function KF(o,c,f){var m=Et(o)?aL:W_,b=arguments.length<3;return m(o,St(c,4),f,b,a0)}function XF(o,c){var f=Et(o)?Vi:l0;return f(o,pc(St(c,3)))}function ZF(o){var c=Et(o)?i0:VN;return c(o)}function QF(o,c,f){(f?Je(o,c,f):c===e)?c=1:c=It(c);var m=Et(o)?xN:$N;return m(o,c)}function JF(o){var c=Et(o)?wN:qN;return c(o)}function tz(o){if(o==null)return 0;if(dn(o))return mc(o)?fs(o):o.length;var c=Ge(o);return c==Ct||c==oe?o.size:df(o).length}function ez(o,c,f){var m=Et(o)?qd:jN;return f&&Je(o,c,f)&&(c=e),m(o,St(c,3))}var nz=Bt(function(o,c){if(o==null)return[];var f=c.length;return f>1&&Je(o,c[0],c[1])?c=[]:f>2&&Je(c[0],c[1],c[2])&&(c=[c[0]]),_0(o,Fe(c,1),[])}),fc=NL||function(){return ce.Date.now()};function iz(o,c){if(typeof c!="function")throw new Cn(a);return o=It(o),function(){if(--o<1)return c.apply(this,arguments)}}function fb(o,c,f){return c=f?e:c,c=o&&c==null?o.length:c,gi(o,T,e,e,e,e,c)}function hb(o,c){var f;if(typeof c!="function")throw new Cn(a);return o=It(o),function(){return--o>0&&(f=c.apply(this,arguments)),o<=1&&(c=e),f}}var Lf=Bt(function(o,c,f){var m=C;if(f.length){var b=Yi(f,xs(Lf));m|=N}return gi(o,m,c,f,b)}),pb=Bt(function(o,c,f){var m=C|R;if(f.length){var b=Yi(f,xs(pb));m|=N}return gi(c,m,o,f,b)});function gb(o,c,f){c=f?e:c;var m=gi(o,I,e,e,e,e,e,c);return m.placeholder=gb.placeholder,m}function mb(o,c,f){c=f?e:c;var m=gi(o,L,e,e,e,e,e,c);return m.placeholder=mb.placeholder,m}function yb(o,c,f){var m,b,k,A,E,H,X=0,Z=!1,nt=!1,st=!0;if(typeof o!="function")throw new Cn(a);c=Pn(c)||0,fe(f)&&(Z=!!f.leading,nt="maxWait"in f,k=nt?ke(Pn(f.maxWait)||0,c):k,st="trailing"in f?!!f.trailing:st);function _t(be){var Hn=m,xi=b;return m=b=e,X=be,A=o.apply(xi,Hn),A}function Tt(be){return X=be,E=Xo(Ft,c),Z?_t(be):A}function Nt(be){var Hn=be-H,xi=be-X,Bb=c-Hn;return nt?je(Bb,k-xi):Bb}function wt(be){var Hn=be-H,xi=be-X;return H===e||Hn>=c||Hn<0||nt&&xi>=k}function Ft(){var be=fc();if(wt(be))return Ht(be);E=Xo(Ft,Nt(be))}function Ht(be){return E=e,st&&m?_t(be):(m=b=e,A)}function wn(){E!==e&&D0(E),X=0,m=H=b=E=e}function tn(){return E===e?A:Ht(fc())}function vn(){var be=fc(),Hn=wt(be);if(m=arguments,b=this,H=be,Hn){if(E===e)return Tt(H);if(nt)return D0(E),E=Xo(Ft,c),_t(H)}return E===e&&(E=Xo(Ft,c)),A}return vn.cancel=wn,vn.flush=tn,vn}var rz=Bt(function(o,c){return o0(o,1,c)}),sz=Bt(function(o,c,f){return o0(o,Pn(c)||0,f)});function oz(o){return gi(o,O)}function hc(o,c){if(typeof o!="function"||c!=null&&typeof c!="function")throw new Cn(a);var f=function(){var m=arguments,b=c?c.apply(this,m):m[0],k=f.cache;if(k.has(b))return k.get(b);var A=o.apply(this,m);return f.cache=k.set(b,A)||k,A};return f.cache=new(hc.Cache||pi),f}hc.Cache=pi;function pc(o){if(typeof o!="function")throw new Cn(a);return function(){var c=arguments;switch(c.length){case 0:return!o.call(this);case 1:return!o.call(this,c[0]);case 2:return!o.call(this,c[0],c[1]);case 3:return!o.call(this,c[0],c[1],c[2])}return!o.apply(this,c)}}function az(o){return hb(2,o)}var lz=GN(function(o,c){c=c.length==1&&Et(c[0])?ue(c[0],_n(St())):ue(Fe(c,1),_n(St()));var f=c.length;return Bt(function(m){for(var b=-1,k=je(m.length,f);++b<k;)m[b]=c[b].call(this,m[b]);return mn(o,this,m)})}),Nf=Bt(function(o,c){var f=Yi(c,xs(Nf));return gi(o,N,e,c,f)}),_b=Bt(function(o,c){var f=Yi(c,xs(_b));return gi(o,B,e,c,f)}),cz=mi(function(o,c){return gi(o,S,e,e,e,c)});function uz(o,c){if(typeof o!="function")throw new Cn(a);return c=c===e?c:It(c),Bt(o,c)}function dz(o,c){if(typeof o!="function")throw new Cn(a);return c=c==null?0:ke(It(c),0),Bt(function(f){var m=f[c],b=Xi(f,0,c);return m&&$i(b,m),mn(o,this,b)})}function fz(o,c,f){var m=!0,b=!0;if(typeof o!="function")throw new Cn(a);return fe(f)&&(m="leading"in f?!!f.leading:m,b="trailing"in f?!!f.trailing:b),yb(o,c,{leading:m,maxWait:c,trailing:b})}function hz(o){return fb(o,1)}function pz(o,c){return Nf(xf(c),o)}function gz(){if(!arguments.length)return[];var o=arguments[0];return Et(o)?o:[o]}function mz(o){return An(o,x)}function yz(o,c){return c=typeof c=="function"?c:e,An(o,x,c)}function _z(o){return An(o,y|x)}function bz(o,c){return c=typeof c=="function"?c:e,An(o,y|x,c)}function xz(o,c){return c==null||s0(o,c,Ee(c))}function Un(o,c){return o===c||o!==o&&c!==c}var wz=oc(lf),vz=oc(function(o,c){return o>=c}),Ar=d0((function(){return arguments})())?d0:function(o){return ge(o)&&jt.call(o,"callee")&&!Z_.call(o,"callee")},Et=Y.isArray,Sz=E_?_n(E_):RN;function dn(o){return o!=null&&gc(o.length)&&!_i(o)}function _e(o){return ge(o)&&dn(o)}function Tz(o){return o===!0||o===!1||ge(o)&&Qe(o)==ct}var Zi=FL||Gf,Mz=P_?_n(P_):EN;function kz(o){return ge(o)&&o.nodeType===1&&!Zo(o)}function Dz(o){if(o==null)return!0;if(dn(o)&&(Et(o)||typeof o=="string"||typeof o.splice=="function"||Zi(o)||ws(o)||Ar(o)))return!o.length;var c=Ge(o);if(c==Ct||c==oe)return!o.size;if(Ko(o))return!df(o).length;for(var f in o)if(jt.call(o,f))return!1;return!0}function Cz(o,c){return qo(o,c)}function Oz(o,c,f){f=typeof f=="function"?f:e;var m=f?f(o,c):e;return m===e?qo(o,c,e,f):!!m}function Bf(o){if(!ge(o))return!1;var c=Qe(o);return c==Lt||c==ut||typeof o.message=="string"&&typeof o.name=="string"&&!Zo(o)}function Az(o){return typeof o=="number"&&J_(o)}function _i(o){if(!fe(o))return!1;var c=Qe(o);return c==zt||c==vt||c==ft||c==Oe}function bb(o){return typeof o=="number"&&o==It(o)}function gc(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=tt}function fe(o){var c=typeof o;return o!=null&&(c=="object"||c=="function")}function ge(o){return o!=null&&typeof o=="object"}var xb=I_?_n(I_):IN;function Rz(o,c){return o===c||uf(o,c,Df(c))}function Ez(o,c,f){return f=typeof f=="function"?f:e,uf(o,c,Df(c),f)}function Pz(o){return wb(o)&&o!=+o}function Iz(o){if(yB(o))throw new Ot(s);return f0(o)}function Lz(o){return o===null}function Nz(o){return o==null}function wb(o){return typeof o=="number"||ge(o)&&Qe(o)==Dt}function Zo(o){if(!ge(o)||Qe(o)!=bt)return!1;var c=Wl(o);if(c===null)return!0;var f=jt.call(c,"constructor")&&c.constructor;return typeof f=="function"&&f instanceof f&&Fl.call(f)==EL}var Ff=L_?_n(L_):LN;function Bz(o){return bb(o)&&o>=-tt&&o<=tt}var vb=N_?_n(N_):NN;function mc(o){return typeof o=="string"||!Et(o)&&ge(o)&&Qe(o)==ln}function xn(o){return typeof o=="symbol"||ge(o)&&Qe(o)==Vt}var ws=B_?_n(B_):BN;function Fz(o){return o===e}function zz(o){return ge(o)&&Ge(o)==ie}function Uz(o){return ge(o)&&Qe(o)==Se}var Hz=oc(ff),Wz=oc(function(o,c){return o<=c});function Sb(o){if(!o)return[];if(dn(o))return mc(o)?Bn(o):un(o);if(Fo&&o[Fo])return xL(o[Fo]());var c=Ge(o),f=c==Ct?Qd:c==oe?Ll:vs;return f(o)}function bi(o){if(!o)return o===0?o:0;if(o=Pn(o),o===rt||o===-rt){var c=o<0?-1:1;return c*G}return o===o?o:0}function It(o){var c=bi(o),f=c%1;return c===c?f?c-f:c:0}function Tb(o){return o?kr(It(o),0,W):0}function Pn(o){if(typeof o=="number")return o;if(xn(o))return P;if(fe(o)){var c=typeof o.valueOf=="function"?o.valueOf():o;o=fe(c)?c+"":c}if(typeof o!="string")return o===0?o:+o;o=V_(o);var f=Sd.test(o);return f||Md.test(o)?Nn(o.slice(2),f?2:8):vd.test(o)?P:+o}function Mb(o){return Qn(o,fn(o))}function Vz(o){return o?kr(It(o),-tt,tt):o===0?o:0}function Gt(o){return o==null?"":bn(o)}var $z=_s(function(o,c){if(Ko(c)||dn(c)){Qn(c,Ee(c),o);return}for(var f in c)jt.call(c,f)&&Vo(o,f,c[f])}),kb=_s(function(o,c){Qn(c,fn(c),o)}),Db=_s(function(o,c,f,m){Qn(c,fn(c),o,m)}),zf=_s(function(o,c,f,m){Qn(c,Ee(c),o,m)}),Yz=mi(sf);function qz(o,c){var f=ys(o);return c==null?f:r0(f,c)}var jz=Bt(function(o,c){o=ne(o);var f=-1,m=c.length,b=m>2?c[2]:e;for(b&&Je(c[0],c[1],b)&&(m=1);++f<m;)for(var k=c[f],A=fn(k),E=-1,H=A.length;++E<H;){var X=A[E],Z=o[X];(Z===e||Un(Z,ps[X])&&!jt.call(o,X))&&(o[X]=k[X])}return o}),Gz=Bt(function(o){return o.push(e,V0),mn(Cb,e,o)});function Kz(o,c){return z_(o,St(c,3),Zn)}function Xz(o,c){return z_(o,St(c,3),af)}function Zz(o,c){return o==null?o:of(o,St(c,3),fn)}function Qz(o,c){return o==null?o:c0(o,St(c,3),fn)}function Jz(o,c){return o&&Zn(o,St(c,3))}function tU(o,c){return o&&af(o,St(c,3))}function eU(o){return o==null?[]:Ql(o,Ee(o))}function nU(o){return o==null?[]:Ql(o,fn(o))}function Uf(o,c,f){var m=o==null?e:Dr(o,c);return m===e?f:m}function iU(o,c){return o!=null&&q0(o,c,DN)}function Hf(o,c){return o!=null&&q0(o,c,CN)}var rU=F0(function(o,c,f){c!=null&&typeof c.toString!="function"&&(c=zl.call(c)),o[c]=f},Vf(hn)),sU=F0(function(o,c,f){c!=null&&typeof c.toString!="function"&&(c=zl.call(c)),jt.call(o,c)?o[c].push(f):o[c]=[f]},St),oU=Bt(Yo);function Ee(o){return dn(o)?n0(o):df(o)}function fn(o){return dn(o)?n0(o,!0):FN(o)}function aU(o,c){var f={};return c=St(c,3),Zn(o,function(m,b,k){Xn(f,c(m,b,k),m)}),f}function lU(o,c){var f={};return c=St(c,3),Zn(o,function(m,b,k){Xn(f,b,c(m,b,k))}),f}var cU=_s(function(o,c,f){Jl(o,c,f)}),Cb=_s(function(o,c,f,m){Jl(o,c,f,m)}),uU=mi(function(o,c){var f={};if(o==null)return f;var m=!1;c=ue(c,function(k){return k=Ki(k,o),m||(m=k.length>1),k}),Qn(o,Mf(o),f),m&&(f=An(f,y|_|x,sB));for(var b=c.length;b--;)yf(f,c[b]);return f});function dU(o,c){return Ob(o,pc(St(c)))}var fU=mi(function(o,c){return o==null?{}:UN(o,c)});function Ob(o,c){if(o==null)return{};var f=ue(Mf(o),function(m){return[m]});return c=St(c),b0(o,f,function(m,b){return c(m,b[0])})}function hU(o,c,f){c=Ki(c,o);var m=-1,b=c.length;for(b||(b=1,o=e);++m<b;){var k=o==null?e:o[zn(c[m])];k===e&&(m=b,k=f),o=_i(k)?k.call(o):k}return o}function pU(o,c,f){return o==null?o:jo(o,c,f)}function gU(o,c,f,m){return m=typeof m=="function"?m:e,o==null?o:jo(o,c,f,m)}var Ab=H0(Ee),Rb=H0(fn);function mU(o,c,f){var m=Et(o),b=m||Zi(o)||ws(o);if(c=St(c,4),f==null){var k=o&&o.constructor;b?f=m?new k:[]:fe(o)?f=_i(k)?ys(Wl(o)):{}:f={}}return(b?yn:Zn)(o,function(A,E,H){return c(f,A,E,H)}),f}function yU(o,c){return o==null?!0:yf(o,c)}function _U(o,c,f){return o==null?o:T0(o,c,xf(f))}function bU(o,c,f,m){return m=typeof m=="function"?m:e,o==null?o:T0(o,c,xf(f),m)}function vs(o){return o==null?[]:Zd(o,Ee(o))}function xU(o){return o==null?[]:Zd(o,fn(o))}function wU(o,c,f){return f===e&&(f=c,c=e),f!==e&&(f=Pn(f),f=f===f?f:0),c!==e&&(c=Pn(c),c=c===c?c:0),kr(Pn(o),c,f)}function vU(o,c,f){return c=bi(c),f===e?(f=c,c=0):f=bi(f),o=Pn(o),ON(o,c,f)}function SU(o,c,f){if(f&&typeof f!="boolean"&&Je(o,c,f)&&(c=f=e),f===e&&(typeof c=="boolean"?(f=c,c=e):typeof o=="boolean"&&(f=o,o=e)),o===e&&c===e?(o=0,c=1):(o=bi(o),c===e?(c=o,o=0):c=bi(c)),o>c){var m=o;o=c,c=m}if(f||o%1||c%1){var b=t0();return je(o+b*(c-o+qe("1e-"+((b+"").length-1))),c)}return pf(o,c)}var TU=bs(function(o,c,f){return c=c.toLowerCase(),o+(f?Eb(c):c)});function Eb(o){return Wf(Gt(o).toLowerCase())}function Pb(o){return o=Gt(o),o&&o.replace(kd,gL).replace(Ud,"")}function MU(o,c,f){o=Gt(o),c=bn(c);var m=o.length;f=f===e?m:kr(It(f),0,m);var b=f;return f-=c.length,f>=0&&o.slice(f,b)==c}function kU(o){return o=Gt(o),o&&fd.test(o)?o.replace(hl,mL):o}function DU(o){return o=Gt(o),o&&md.test(o)?o.replace(Co,"\\$&"):o}var CU=bs(function(o,c,f){return o+(f?"-":"")+c.toLowerCase()}),OU=bs(function(o,c,f){return o+(f?" ":"")+c.toLowerCase()}),AU=L0("toLowerCase");function RU(o,c,f){o=Gt(o),c=It(c);var m=c?fs(o):0;if(!c||m>=c)return o;var b=(c-m)/2;return sc(ql(b),f)+o+sc(Yl(b),f)}function EU(o,c,f){o=Gt(o),c=It(c);var m=c?fs(o):0;return c&&m<c?o+sc(c-m,f):o}function PU(o,c,f){o=Gt(o),c=It(c);var m=c?fs(o):0;return c&&m<c?sc(c-m,f)+o:o}function IU(o,c,f){return f||c==null?c=0:c&&(c=+c),WL(Gt(o).replace(Oo,""),c||0)}function LU(o,c,f){return(f?Je(o,c,f):c===e)?c=1:c=It(c),gf(Gt(o),c)}function NU(){var o=arguments,c=Gt(o[0]);return o.length<3?c:c.replace(o[1],o[2])}var BU=bs(function(o,c,f){return o+(f?"_":"")+c.toLowerCase()});function FU(o,c,f){return f&&typeof f!="number"&&Je(o,c,f)&&(c=f=e),f=f===e?W:f>>>0,f?(o=Gt(o),o&&(typeof c=="string"||c!=null&&!Ff(c))&&(c=bn(c),!c&&ds(o))?Xi(Bn(o),0,f):o.split(c,f)):[]}var zU=bs(function(o,c,f){return o+(f?" ":"")+Wf(c)});function UU(o,c,f){return o=Gt(o),f=f==null?0:kr(It(f),0,o.length),c=bn(c),o.slice(f,f+c.length)==c}function HU(o,c,f){var m=w.templateSettings;f&&Je(o,c,f)&&(c=e),o=Gt(o),c=zf({},c,m,W0);var b=zf({},c.imports,m.imports,W0),k=Ee(b),A=Zd(b,k);yn(k,function(wt){if(gl.test(wt))throw new Ot(u)});var E,H,X=0,Z=c.interpolate||es,nt="__p += '",st=Jd((c.escape||es).source+"|"+Z.source+"|"+(Z===Do?Hi:es).source+"|"+(c.evaluate||es).source+"|$","g"),_t="//# sourceURL="+(jt.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Vd+"]")+`
|
|
10
|
-
`;o.replace(st,function(wt,Ft,Ht,wn,tn,vn){return Ht||(Ht=wn),nt+=o.slice(X,vn).replace(Dd,
|
|
9
|
+
`)}function xB(o){return Et(o)||Ar(o)||!!(J_&&o&&o[J_])}function yi(o,c){var f=typeof o;return c=c??tt,!!c&&(f=="number"||f!="symbol"&&Wi.test(o))&&o>-1&&o%1==0&&o<c}function Je(o,c,f){if(!fe(f))return!1;var m=typeof c;return(m=="number"?dn(f)&&yi(c,f.length):m=="string"&&c in f)?Un(f[c],o):!1}function Of(o,c){if(Et(o))return!1;var f=typeof o;return f=="number"||f=="symbol"||f=="boolean"||o==null||xn(o)?!0:di.test(o)||!pl.test(o)||c!=null&&o in ne(c)}function wB(o){var c=typeof o;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?o!=="__proto__":o===null}function Af(o){var c=ac(o),f=w[c];if(typeof f!="function"||!(c in Ut.prototype))return!1;if(o===f)return!0;var m=kf(f);return!!m&&o===m[0]}function vB(o){return!!K_&&K_ in o}var SB=Bl?_i:Gf;function Ko(o){var c=o&&o.constructor,f=typeof c=="function"&&c.prototype||ps;return o===f}function K0(o){return o===o&&!fe(o)}function X0(o,c){return function(f){return f==null?!1:f[o]===c&&(c!==e||o in ne(f))}}function TB(o){var c=hc(o,function(m){return f.size===h&&f.clear(),m}),f=c.cache;return c}function MB(o,c){var f=o[1],m=c[1],b=f|m,k=b<(C|R|T),A=m==T&&f==I||m==T&&f==S&&o[7].length<=c[8]||m==(T|S)&&c[7].length<=c[8]&&f==I;if(!(k||A))return o;m&C&&(o[2]=c[2],b|=f&C?0:F);var E=c[3];if(E){var H=o[3];o[3]=H?E0(H,E,c[4]):E,o[4]=H?Yi(o[3],g):c[4]}return E=c[5],E&&(H=o[5],o[5]=H?P0(H,E,c[6]):E,o[6]=H?Yi(o[5],g):c[6]),E=c[7],E&&(o[7]=E),m&T&&(o[8]=o[8]==null?c[8]:je(o[8],c[8])),o[9]==null&&(o[9]=c[9]),o[0]=c[0],o[1]=b,o}function kB(o){var c=[];if(o!=null)for(var f in ne(o))c.push(f);return c}function DB(o){return zl.call(o)}function Z0(o,c,f){return c=ke(c===e?o.length-1:c,0),function(){for(var m=arguments,b=-1,k=ke(m.length-c,0),A=Y(k);++b<k;)A[b]=m[c+b];b=-1;for(var E=Y(c+1);++b<c;)E[b]=m[b];return E[c]=f(A),mn(o,this,E)}}function Q0(o,c){return c.length<2?o:Dr(o,Rn(c,0,-1))}function CB(o,c){for(var f=o.length,m=je(c.length,f),b=un(o);m--;){var k=c[m];o[m]=yi(k,f)?b[k]:e}return o}function Rf(o,c){if(!(c==="constructor"&&typeof o[c]=="function")&&c!="__proto__")return o[c]}var J0=eb(v0),Xo=VL||function(o,c){return ce.setTimeout(o,c)},Ef=eb(ZN);function tb(o,c,f){var m=c+"";return Ef(o,bB(m,OB(mB(m),f)))}function eb(o){var c=0,f=0;return function(){var m=jL(),b=at-(m-f);if(f=m,b>0){if(++c>=it)return arguments[0]}else c=0;return o.apply(e,arguments)}}function cc(o,c){var f=-1,m=o.length,b=m-1;for(c=c===e?m:c;++f<c;){var k=pf(f,b),A=o[k];o[k]=o[f],o[f]=A}return o.length=c,o}var nb=TB(function(o){var c=[];return o.charCodeAt(0)===46&&c.push(""),o.replace(gd,function(f,m,b,k){c.push(b?k.replace(wd,"$1"):m||f)}),c});function zn(o){if(typeof o=="string"||xn(o))return o;var c=o+"";return c=="0"&&1/o==-rt?"-0":c}function Or(o){if(o!=null){try{return Fl.call(o)}catch{}try{return o+""}catch{}}return""}function OB(o,c){return yn(lt,function(f){var m="_."+f[0];c&f[1]&&!Pl(o,m)&&o.push(m)}),o.sort()}function ib(o){if(o instanceof Ut)return o.clone();var c=new On(o.__wrapped__,o.__chain__);return c.__actions__=un(o.__actions__),c.__index__=o.__index__,c.__values__=o.__values__,c}function AB(o,c,f){(f?Je(o,c,f):c===e)?c=1:c=ke(It(c),0);var m=o==null?0:o.length;if(!m||c<1)return[];for(var b=0,k=0,A=Y(Yl(m/c));b<m;)A[k++]=Rn(o,b,b+=c);return A}function RB(o){for(var c=-1,f=o==null?0:o.length,m=0,b=[];++c<f;){var k=o[c];k&&(b[m++]=k)}return b}function EB(){var o=arguments.length;if(!o)return[];for(var c=Y(o-1),f=arguments[0],m=o;m--;)c[m-1]=arguments[m];return $i(Et(f)?un(f):[f],Fe(c,1))}var PB=Bt(function(o,c){return _e(o)?$o(o,Fe(c,1,_e,!0)):[]}),IB=Bt(function(o,c){var f=En(c);return _e(f)&&(f=e),_e(o)?$o(o,Fe(c,1,_e,!0),St(f,2)):[]}),LB=Bt(function(o,c){var f=En(c);return _e(f)&&(f=e),_e(o)?$o(o,Fe(c,1,_e,!0),e,f):[]});function NB(o,c,f){var m=o==null?0:o.length;return m?(c=f||c===e?1:It(c),Rn(o,c<0?0:c,m)):[]}function BB(o,c,f){var m=o==null?0:o.length;return m?(c=f||c===e?1:It(c),c=m-c,Rn(o,0,c<0?0:c)):[]}function FB(o,c){return o&&o.length?ec(o,St(c,3),!0,!0):[]}function zB(o,c){return o&&o.length?ec(o,St(c,3),!0):[]}function UB(o,c,f,m){var b=o==null?0:o.length;return b?(f&&typeof f!="number"&&Je(o,c,f)&&(f=0,m=b),EN(o,c,f,m)):[]}function rb(o,c,f){var m=o==null?0:o.length;if(!m)return-1;var b=f==null?0:It(f);return b<0&&(b=ke(m+b,0)),Il(o,St(c,3),b)}function sb(o,c,f){var m=o==null?0:o.length;if(!m)return-1;var b=m-1;return f!==e&&(b=It(f),b=f<0?ke(m+b,0):je(b,m-1)),Il(o,St(c,3),b,!0)}function ob(o){var c=o==null?0:o.length;return c?Fe(o,1):[]}function HB(o){var c=o==null?0:o.length;return c?Fe(o,rt):[]}function WB(o,c){var f=o==null?0:o.length;return f?(c=c===e?1:It(c),Fe(o,c)):[]}function VB(o){for(var c=-1,f=o==null?0:o.length,m={};++c<f;){var b=o[c];Xn(m,b[0],b[1])}return m}function ab(o){return o&&o.length?o[0]:e}function $B(o,c,f){var m=o==null?0:o.length;if(!m)return-1;var b=f==null?0:It(f);return b<0&&(b=ke(m+b,0)),us(o,c,b)}function YB(o){var c=o==null?0:o.length;return c?Rn(o,0,-1):[]}var qB=Bt(function(o){var c=ue(o,bf);return c.length&&c[0]===o[0]?cf(c):[]}),jB=Bt(function(o){var c=En(o),f=ue(o,bf);return c===En(f)?c=e:f.pop(),f.length&&f[0]===o[0]?cf(f,St(c,2)):[]}),GB=Bt(function(o){var c=En(o),f=ue(o,bf);return c=typeof c=="function"?c:e,c&&f.pop(),f.length&&f[0]===o[0]?cf(f,e,c):[]});function KB(o,c){return o==null?"":YL.call(o,c)}function En(o){var c=o==null?0:o.length;return c?o[c-1]:e}function XB(o,c,f){var m=o==null?0:o.length;if(!m)return-1;var b=m;return f!==e&&(b=It(f),b=b<0?ke(m+b,0):je(b,m-1)),c===c?OL(o,c,b):Il(o,H_,b,!0)}function ZB(o,c){return o&&o.length?_0(o,It(c)):e}var QB=Bt(lb);function lb(o,c){return o&&o.length&&c&&c.length?hf(o,c):o}function JB(o,c,f){return o&&o.length&&c&&c.length?hf(o,c,St(f,2)):o}function tF(o,c,f){return o&&o.length&&c&&c.length?hf(o,c,e,f):o}var eF=mi(function(o,c){var f=o==null?0:o.length,m=sf(o,c);return w0(o,ue(c,function(b){return yi(b,f)?+b:b}).sort(R0)),m});function nF(o,c){var f=[];if(!(o&&o.length))return f;var m=-1,b=[],k=o.length;for(c=St(c,3);++m<k;){var A=o[m];c(A,m,o)&&(f.push(A),b.push(m))}return w0(o,b),f}function Pf(o){return o==null?o:KL.call(o)}function iF(o,c,f){var m=o==null?0:o.length;return m?(f&&typeof f!="number"&&Je(o,c,f)?(c=0,f=m):(c=c==null?0:It(c),f=f===e?m:It(f)),Rn(o,c,f)):[]}function rF(o,c){return tc(o,c)}function sF(o,c,f){return mf(o,c,St(f,2))}function oF(o,c){var f=o==null?0:o.length;if(f){var m=tc(o,c);if(m<f&&Un(o[m],c))return m}return-1}function aF(o,c){return tc(o,c,!0)}function lF(o,c,f){return mf(o,c,St(f,2),!0)}function cF(o,c){var f=o==null?0:o.length;if(f){var m=tc(o,c,!0)-1;if(Un(o[m],c))return m}return-1}function uF(o){return o&&o.length?S0(o):[]}function dF(o,c){return o&&o.length?S0(o,St(c,2)):[]}function fF(o){var c=o==null?0:o.length;return c?Rn(o,1,c):[]}function hF(o,c,f){return o&&o.length?(c=f||c===e?1:It(c),Rn(o,0,c<0?0:c)):[]}function pF(o,c,f){var m=o==null?0:o.length;return m?(c=f||c===e?1:It(c),c=m-c,Rn(o,c<0?0:c,m)):[]}function gF(o,c){return o&&o.length?ec(o,St(c,3),!1,!0):[]}function mF(o,c){return o&&o.length?ec(o,St(c,3)):[]}var yF=Bt(function(o){return Gi(Fe(o,1,_e,!0))}),_F=Bt(function(o){var c=En(o);return _e(c)&&(c=e),Gi(Fe(o,1,_e,!0),St(c,2))}),bF=Bt(function(o){var c=En(o);return c=typeof c=="function"?c:e,Gi(Fe(o,1,_e,!0),e,c)});function xF(o){return o&&o.length?Gi(o):[]}function wF(o,c){return o&&o.length?Gi(o,St(c,2)):[]}function vF(o,c){return c=typeof c=="function"?c:e,o&&o.length?Gi(o,e,c):[]}function If(o){if(!(o&&o.length))return[];var c=0;return o=Vi(o,function(f){if(_e(f))return c=ke(f.length,c),!0}),Xd(c,function(f){return ue(o,jd(f))})}function cb(o,c){if(!(o&&o.length))return[];var f=If(o);return c==null?f:ue(f,function(m){return mn(c,e,m)})}var SF=Bt(function(o,c){return _e(o)?$o(o,c):[]}),TF=Bt(function(o){return _f(Vi(o,_e))}),MF=Bt(function(o){var c=En(o);return _e(c)&&(c=e),_f(Vi(o,_e),St(c,2))}),kF=Bt(function(o){var c=En(o);return c=typeof c=="function"?c:e,_f(Vi(o,_e),e,c)}),DF=Bt(If);function CF(o,c){return D0(o||[],c||[],Vo)}function OF(o,c){return D0(o||[],c||[],jo)}var AF=Bt(function(o){var c=o.length,f=c>1?o[c-1]:e;return f=typeof f=="function"?(o.pop(),f):e,cb(o,f)});function ub(o){var c=w(o);return c.__chain__=!0,c}function RF(o,c){return c(o),o}function uc(o,c){return c(o)}var EF=mi(function(o){var c=o.length,f=c?o[0]:0,m=this.__wrapped__,b=function(k){return sf(k,o)};return c>1||this.__actions__.length||!(m instanceof Ut)||!yi(f)?this.thru(b):(m=m.slice(f,+f+(c?1:0)),m.__actions__.push({func:uc,args:[b],thisArg:e}),new On(m,this.__chain__).thru(function(k){return c&&!k.length&&k.push(e),k}))});function PF(){return ub(this)}function IF(){return new On(this.value(),this.__chain__)}function LF(){this.__values__===e&&(this.__values__=Tb(this.value()));var o=this.__index__>=this.__values__.length,c=o?e:this.__values__[this.__index__++];return{done:o,value:c}}function NF(){return this}function BF(o){for(var c,f=this;f instanceof Kl;){var m=ib(f);m.__index__=0,m.__values__=e,c?b.__wrapped__=m:c=m;var b=m;f=f.__wrapped__}return b.__wrapped__=o,c}function FF(){var o=this.__wrapped__;if(o instanceof Ut){var c=o;return this.__actions__.length&&(c=new Ut(this)),c=c.reverse(),c.__actions__.push({func:uc,args:[Pf],thisArg:e}),new On(c,this.__chain__)}return this.thru(Pf)}function zF(){return k0(this.__wrapped__,this.__actions__)}var UF=nc(function(o,c,f){jt.call(o,f)?++o[f]:Xn(o,f,1)});function HF(o,c,f){var m=Et(o)?z_:RN;return f&&Je(o,c,f)&&(c=e),m(o,St(c,3))}function WF(o,c){var f=Et(o)?Vi:c0;return f(o,St(c,3))}var VF=B0(rb),$F=B0(sb);function YF(o,c){return Fe(dc(o,c),1)}function qF(o,c){return Fe(dc(o,c),rt)}function jF(o,c,f){return f=f===e?1:It(f),Fe(dc(o,c),f)}function db(o,c){var f=Et(o)?yn:ji;return f(o,St(c,3))}function fb(o,c){var f=Et(o)?fL:l0;return f(o,St(c,3))}var GF=nc(function(o,c,f){jt.call(o,f)?o[f].push(c):Xn(o,f,[c])});function KF(o,c,f,m){o=dn(o)?o:vs(o),f=f&&!m?It(f):0;var b=o.length;return f<0&&(f=ke(b+f,0)),mc(o)?f<=b&&o.indexOf(c,f)>-1:!!b&&us(o,c,f)>-1}var XF=Bt(function(o,c,f){var m=-1,b=typeof c=="function",k=dn(o)?Y(o.length):[];return ji(o,function(A){k[++m]=b?mn(c,A,f):Yo(A,c,f)}),k}),ZF=nc(function(o,c,f){Xn(o,f,c)});function dc(o,c){var f=Et(o)?ue:g0;return f(o,St(c,3))}function QF(o,c,f,m){return o==null?[]:(Et(c)||(c=c==null?[]:[c]),f=m?e:f,Et(f)||(f=f==null?[]:[f]),b0(o,c,f))}var JF=nc(function(o,c,f){o[f?0:1].push(c)},function(){return[[],[]]});function tz(o,c,f){var m=Et(o)?Yd:V_,b=arguments.length<3;return m(o,St(c,4),f,b,ji)}function ez(o,c,f){var m=Et(o)?hL:V_,b=arguments.length<3;return m(o,St(c,4),f,b,l0)}function nz(o,c){var f=Et(o)?Vi:c0;return f(o,pc(St(c,3)))}function iz(o){var c=Et(o)?r0:KN;return c(o)}function rz(o,c,f){(f?Je(o,c,f):c===e)?c=1:c=It(c);var m=Et(o)?kN:XN;return m(o,c)}function sz(o){var c=Et(o)?DN:QN;return c(o)}function oz(o){if(o==null)return 0;if(dn(o))return mc(o)?fs(o):o.length;var c=Ge(o);return c==Ct||c==oe?o.size:df(o).length}function az(o,c,f){var m=Et(o)?qd:JN;return f&&Je(o,c,f)&&(c=e),m(o,St(c,3))}var lz=Bt(function(o,c){if(o==null)return[];var f=c.length;return f>1&&Je(o,c[0],c[1])?c=[]:f>2&&Je(c[0],c[1],c[2])&&(c=[c[0]]),b0(o,Fe(c,1),[])}),fc=WL||function(){return ce.Date.now()};function cz(o,c){if(typeof c!="function")throw new Cn(a);return o=It(o),function(){if(--o<1)return c.apply(this,arguments)}}function hb(o,c,f){return c=f?e:c,c=o&&c==null?o.length:c,gi(o,T,e,e,e,e,c)}function pb(o,c){var f;if(typeof c!="function")throw new Cn(a);return o=It(o),function(){return--o>0&&(f=c.apply(this,arguments)),o<=1&&(c=e),f}}var Lf=Bt(function(o,c,f){var m=C;if(f.length){var b=Yi(f,xs(Lf));m|=N}return gi(o,m,c,f,b)}),gb=Bt(function(o,c,f){var m=C|R;if(f.length){var b=Yi(f,xs(gb));m|=N}return gi(c,m,o,f,b)});function mb(o,c,f){c=f?e:c;var m=gi(o,I,e,e,e,e,e,c);return m.placeholder=mb.placeholder,m}function yb(o,c,f){c=f?e:c;var m=gi(o,L,e,e,e,e,e,c);return m.placeholder=yb.placeholder,m}function _b(o,c,f){var m,b,k,A,E,H,X=0,Z=!1,nt=!1,st=!0;if(typeof o!="function")throw new Cn(a);c=Pn(c)||0,fe(f)&&(Z=!!f.leading,nt="maxWait"in f,k=nt?ke(Pn(f.maxWait)||0,c):k,st="trailing"in f?!!f.trailing:st);function _t(be){var Hn=m,xi=b;return m=b=e,X=be,A=o.apply(xi,Hn),A}function Tt(be){return X=be,E=Xo(Ft,c),Z?_t(be):A}function Nt(be){var Hn=be-H,xi=be-X,Fb=c-Hn;return nt?je(Fb,k-xi):Fb}function wt(be){var Hn=be-H,xi=be-X;return H===e||Hn>=c||Hn<0||nt&&xi>=k}function Ft(){var be=fc();if(wt(be))return Ht(be);E=Xo(Ft,Nt(be))}function Ht(be){return E=e,st&&m?_t(be):(m=b=e,A)}function wn(){E!==e&&C0(E),X=0,m=H=b=E=e}function tn(){return E===e?A:Ht(fc())}function vn(){var be=fc(),Hn=wt(be);if(m=arguments,b=this,H=be,Hn){if(E===e)return Tt(H);if(nt)return C0(E),E=Xo(Ft,c),_t(H)}return E===e&&(E=Xo(Ft,c)),A}return vn.cancel=wn,vn.flush=tn,vn}var uz=Bt(function(o,c){return a0(o,1,c)}),dz=Bt(function(o,c,f){return a0(o,Pn(c)||0,f)});function fz(o){return gi(o,O)}function hc(o,c){if(typeof o!="function"||c!=null&&typeof c!="function")throw new Cn(a);var f=function(){var m=arguments,b=c?c.apply(this,m):m[0],k=f.cache;if(k.has(b))return k.get(b);var A=o.apply(this,m);return f.cache=k.set(b,A)||k,A};return f.cache=new(hc.Cache||pi),f}hc.Cache=pi;function pc(o){if(typeof o!="function")throw new Cn(a);return function(){var c=arguments;switch(c.length){case 0:return!o.call(this);case 1:return!o.call(this,c[0]);case 2:return!o.call(this,c[0],c[1]);case 3:return!o.call(this,c[0],c[1],c[2])}return!o.apply(this,c)}}function hz(o){return pb(2,o)}var pz=tB(function(o,c){c=c.length==1&&Et(c[0])?ue(c[0],_n(St())):ue(Fe(c,1),_n(St()));var f=c.length;return Bt(function(m){for(var b=-1,k=je(m.length,f);++b<k;)m[b]=c[b].call(this,m[b]);return mn(o,this,m)})}),Nf=Bt(function(o,c){var f=Yi(c,xs(Nf));return gi(o,N,e,c,f)}),bb=Bt(function(o,c){var f=Yi(c,xs(bb));return gi(o,B,e,c,f)}),gz=mi(function(o,c){return gi(o,S,e,e,e,c)});function mz(o,c){if(typeof o!="function")throw new Cn(a);return c=c===e?c:It(c),Bt(o,c)}function yz(o,c){if(typeof o!="function")throw new Cn(a);return c=c==null?0:ke(It(c),0),Bt(function(f){var m=f[c],b=Xi(f,0,c);return m&&$i(b,m),mn(o,this,b)})}function _z(o,c,f){var m=!0,b=!0;if(typeof o!="function")throw new Cn(a);return fe(f)&&(m="leading"in f?!!f.leading:m,b="trailing"in f?!!f.trailing:b),_b(o,c,{leading:m,maxWait:c,trailing:b})}function bz(o){return hb(o,1)}function xz(o,c){return Nf(xf(c),o)}function wz(){if(!arguments.length)return[];var o=arguments[0];return Et(o)?o:[o]}function vz(o){return An(o,x)}function Sz(o,c){return c=typeof c=="function"?c:e,An(o,x,c)}function Tz(o){return An(o,y|x)}function Mz(o,c){return c=typeof c=="function"?c:e,An(o,y|x,c)}function kz(o,c){return c==null||o0(o,c,Ee(c))}function Un(o,c){return o===c||o!==o&&c!==c}var Dz=oc(lf),Cz=oc(function(o,c){return o>=c}),Ar=f0((function(){return arguments})())?f0:function(o){return ge(o)&&jt.call(o,"callee")&&!Q_.call(o,"callee")},Et=Y.isArray,Oz=P_?_n(P_):BN;function dn(o){return o!=null&&gc(o.length)&&!_i(o)}function _e(o){return ge(o)&&dn(o)}function Az(o){return o===!0||o===!1||ge(o)&&Qe(o)==ct}var Zi=$L||Gf,Rz=I_?_n(I_):FN;function Ez(o){return ge(o)&&o.nodeType===1&&!Zo(o)}function Pz(o){if(o==null)return!0;if(dn(o)&&(Et(o)||typeof o=="string"||typeof o.splice=="function"||Zi(o)||ws(o)||Ar(o)))return!o.length;var c=Ge(o);if(c==Ct||c==oe)return!o.size;if(Ko(o))return!df(o).length;for(var f in o)if(jt.call(o,f))return!1;return!0}function Iz(o,c){return qo(o,c)}function Lz(o,c,f){f=typeof f=="function"?f:e;var m=f?f(o,c):e;return m===e?qo(o,c,e,f):!!m}function Bf(o){if(!ge(o))return!1;var c=Qe(o);return c==Lt||c==ut||typeof o.message=="string"&&typeof o.name=="string"&&!Zo(o)}function Nz(o){return typeof o=="number"&&t0(o)}function _i(o){if(!fe(o))return!1;var c=Qe(o);return c==zt||c==vt||c==ft||c==Oe}function xb(o){return typeof o=="number"&&o==It(o)}function gc(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=tt}function fe(o){var c=typeof o;return o!=null&&(c=="object"||c=="function")}function ge(o){return o!=null&&typeof o=="object"}var wb=L_?_n(L_):UN;function Bz(o,c){return o===c||uf(o,c,Df(c))}function Fz(o,c,f){return f=typeof f=="function"?f:e,uf(o,c,Df(c),f)}function zz(o){return vb(o)&&o!=+o}function Uz(o){if(SB(o))throw new Ot(s);return h0(o)}function Hz(o){return o===null}function Wz(o){return o==null}function vb(o){return typeof o=="number"||ge(o)&&Qe(o)==Dt}function Zo(o){if(!ge(o)||Qe(o)!=bt)return!1;var c=Wl(o);if(c===null)return!0;var f=jt.call(c,"constructor")&&c.constructor;return typeof f=="function"&&f instanceof f&&Fl.call(f)==FL}var Ff=N_?_n(N_):HN;function Vz(o){return xb(o)&&o>=-tt&&o<=tt}var Sb=B_?_n(B_):WN;function mc(o){return typeof o=="string"||!Et(o)&&ge(o)&&Qe(o)==ln}function xn(o){return typeof o=="symbol"||ge(o)&&Qe(o)==Vt}var ws=F_?_n(F_):VN;function $z(o){return o===e}function Yz(o){return ge(o)&&Ge(o)==ie}function qz(o){return ge(o)&&Qe(o)==Se}var jz=oc(ff),Gz=oc(function(o,c){return o<=c});function Tb(o){if(!o)return[];if(dn(o))return mc(o)?Bn(o):un(o);if(Fo&&o[Fo])return kL(o[Fo]());var c=Ge(o),f=c==Ct?Qd:c==oe?Ll:vs;return f(o)}function bi(o){if(!o)return o===0?o:0;if(o=Pn(o),o===rt||o===-rt){var c=o<0?-1:1;return c*G}return o===o?o:0}function It(o){var c=bi(o),f=c%1;return c===c?f?c-f:c:0}function Mb(o){return o?kr(It(o),0,W):0}function Pn(o){if(typeof o=="number")return o;if(xn(o))return P;if(fe(o)){var c=typeof o.valueOf=="function"?o.valueOf():o;o=fe(c)?c+"":c}if(typeof o!="string")return o===0?o:+o;o=$_(o);var f=Sd.test(o);return f||Md.test(o)?Nn(o.slice(2),f?2:8):vd.test(o)?P:+o}function kb(o){return Qn(o,fn(o))}function Kz(o){return o?kr(It(o),-tt,tt):o===0?o:0}function Gt(o){return o==null?"":bn(o)}var Xz=_s(function(o,c){if(Ko(c)||dn(c)){Qn(c,Ee(c),o);return}for(var f in c)jt.call(c,f)&&Vo(o,f,c[f])}),Db=_s(function(o,c){Qn(c,fn(c),o)}),Cb=_s(function(o,c,f,m){Qn(c,fn(c),o,m)}),zf=_s(function(o,c,f,m){Qn(c,Ee(c),o,m)}),Zz=mi(sf);function Qz(o,c){var f=ys(o);return c==null?f:s0(f,c)}var Jz=Bt(function(o,c){o=ne(o);var f=-1,m=c.length,b=m>2?c[2]:e;for(b&&Je(c[0],c[1],b)&&(m=1);++f<m;)for(var k=c[f],A=fn(k),E=-1,H=A.length;++E<H;){var X=A[E],Z=o[X];(Z===e||Un(Z,ps[X])&&!jt.call(o,X))&&(o[X]=k[X])}return o}),tU=Bt(function(o){return o.push(e,$0),mn(Ob,e,o)});function eU(o,c){return U_(o,St(c,3),Zn)}function nU(o,c){return U_(o,St(c,3),af)}function iU(o,c){return o==null?o:of(o,St(c,3),fn)}function rU(o,c){return o==null?o:u0(o,St(c,3),fn)}function sU(o,c){return o&&Zn(o,St(c,3))}function oU(o,c){return o&&af(o,St(c,3))}function aU(o){return o==null?[]:Ql(o,Ee(o))}function lU(o){return o==null?[]:Ql(o,fn(o))}function Uf(o,c,f){var m=o==null?e:Dr(o,c);return m===e?f:m}function cU(o,c){return o!=null&&j0(o,c,PN)}function Hf(o,c){return o!=null&&j0(o,c,IN)}var uU=z0(function(o,c,f){c!=null&&typeof c.toString!="function"&&(c=zl.call(c)),o[c]=f},Vf(hn)),dU=z0(function(o,c,f){c!=null&&typeof c.toString!="function"&&(c=zl.call(c)),jt.call(o,c)?o[c].push(f):o[c]=[f]},St),fU=Bt(Yo);function Ee(o){return dn(o)?i0(o):df(o)}function fn(o){return dn(o)?i0(o,!0):$N(o)}function hU(o,c){var f={};return c=St(c,3),Zn(o,function(m,b,k){Xn(f,c(m,b,k),m)}),f}function pU(o,c){var f={};return c=St(c,3),Zn(o,function(m,b,k){Xn(f,b,c(m,b,k))}),f}var gU=_s(function(o,c,f){Jl(o,c,f)}),Ob=_s(function(o,c,f,m){Jl(o,c,f,m)}),mU=mi(function(o,c){var f={};if(o==null)return f;var m=!1;c=ue(c,function(k){return k=Ki(k,o),m||(m=k.length>1),k}),Qn(o,Mf(o),f),m&&(f=An(f,y|_|x,dB));for(var b=c.length;b--;)yf(f,c[b]);return f});function yU(o,c){return Ab(o,pc(St(c)))}var _U=mi(function(o,c){return o==null?{}:qN(o,c)});function Ab(o,c){if(o==null)return{};var f=ue(Mf(o),function(m){return[m]});return c=St(c),x0(o,f,function(m,b){return c(m,b[0])})}function bU(o,c,f){c=Ki(c,o);var m=-1,b=c.length;for(b||(b=1,o=e);++m<b;){var k=o==null?e:o[zn(c[m])];k===e&&(m=b,k=f),o=_i(k)?k.call(o):k}return o}function xU(o,c,f){return o==null?o:jo(o,c,f)}function wU(o,c,f,m){return m=typeof m=="function"?m:e,o==null?o:jo(o,c,f,m)}var Rb=W0(Ee),Eb=W0(fn);function vU(o,c,f){var m=Et(o),b=m||Zi(o)||ws(o);if(c=St(c,4),f==null){var k=o&&o.constructor;b?f=m?new k:[]:fe(o)?f=_i(k)?ys(Wl(o)):{}:f={}}return(b?yn:Zn)(o,function(A,E,H){return c(f,A,E,H)}),f}function SU(o,c){return o==null?!0:yf(o,c)}function TU(o,c,f){return o==null?o:M0(o,c,xf(f))}function MU(o,c,f,m){return m=typeof m=="function"?m:e,o==null?o:M0(o,c,xf(f),m)}function vs(o){return o==null?[]:Zd(o,Ee(o))}function kU(o){return o==null?[]:Zd(o,fn(o))}function DU(o,c,f){return f===e&&(f=c,c=e),f!==e&&(f=Pn(f),f=f===f?f:0),c!==e&&(c=Pn(c),c=c===c?c:0),kr(Pn(o),c,f)}function CU(o,c,f){return c=bi(c),f===e?(f=c,c=0):f=bi(f),o=Pn(o),LN(o,c,f)}function OU(o,c,f){if(f&&typeof f!="boolean"&&Je(o,c,f)&&(c=f=e),f===e&&(typeof c=="boolean"?(f=c,c=e):typeof o=="boolean"&&(f=o,o=e)),o===e&&c===e?(o=0,c=1):(o=bi(o),c===e?(c=o,o=0):c=bi(c)),o>c){var m=o;o=c,c=m}if(f||o%1||c%1){var b=e0();return je(o+b*(c-o+qe("1e-"+((b+"").length-1))),c)}return pf(o,c)}var AU=bs(function(o,c,f){return c=c.toLowerCase(),o+(f?Pb(c):c)});function Pb(o){return Wf(Gt(o).toLowerCase())}function Ib(o){return o=Gt(o),o&&o.replace(kd,wL).replace(Ud,"")}function RU(o,c,f){o=Gt(o),c=bn(c);var m=o.length;f=f===e?m:kr(It(f),0,m);var b=f;return f-=c.length,f>=0&&o.slice(f,b)==c}function EU(o){return o=Gt(o),o&&fd.test(o)?o.replace(hl,vL):o}function PU(o){return o=Gt(o),o&&md.test(o)?o.replace(Co,"\\$&"):o}var IU=bs(function(o,c,f){return o+(f?"-":"")+c.toLowerCase()}),LU=bs(function(o,c,f){return o+(f?" ":"")+c.toLowerCase()}),NU=N0("toLowerCase");function BU(o,c,f){o=Gt(o),c=It(c);var m=c?fs(o):0;if(!c||m>=c)return o;var b=(c-m)/2;return sc(ql(b),f)+o+sc(Yl(b),f)}function FU(o,c,f){o=Gt(o),c=It(c);var m=c?fs(o):0;return c&&m<c?o+sc(c-m,f):o}function zU(o,c,f){o=Gt(o),c=It(c);var m=c?fs(o):0;return c&&m<c?sc(c-m,f)+o:o}function UU(o,c,f){return f||c==null?c=0:c&&(c=+c),GL(Gt(o).replace(Oo,""),c||0)}function HU(o,c,f){return(f?Je(o,c,f):c===e)?c=1:c=It(c),gf(Gt(o),c)}function WU(){var o=arguments,c=Gt(o[0]);return o.length<3?c:c.replace(o[1],o[2])}var VU=bs(function(o,c,f){return o+(f?"_":"")+c.toLowerCase()});function $U(o,c,f){return f&&typeof f!="number"&&Je(o,c,f)&&(c=f=e),f=f===e?W:f>>>0,f?(o=Gt(o),o&&(typeof c=="string"||c!=null&&!Ff(c))&&(c=bn(c),!c&&ds(o))?Xi(Bn(o),0,f):o.split(c,f)):[]}var YU=bs(function(o,c,f){return o+(f?" ":"")+Wf(c)});function qU(o,c,f){return o=Gt(o),f=f==null?0:kr(It(f),0,o.length),c=bn(c),o.slice(f,f+c.length)==c}function jU(o,c,f){var m=w.templateSettings;f&&Je(o,c,f)&&(c=e),o=Gt(o),c=zf({},c,m,V0);var b=zf({},c.imports,m.imports,V0),k=Ee(b),A=Zd(b,k);yn(k,function(wt){if(gl.test(wt))throw new Ot(u)});var E,H,X=0,Z=c.interpolate||es,nt="__p += '",st=Jd((c.escape||es).source+"|"+Z.source+"|"+(Z===Do?Hi:es).source+"|"+(c.evaluate||es).source+"|$","g"),_t="//# sourceURL="+(jt.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Vd+"]")+`
|
|
10
|
+
`;o.replace(st,function(wt,Ft,Ht,wn,tn,vn){return Ht||(Ht=wn),nt+=o.slice(X,vn).replace(Dd,SL),Ft&&(E=!0,nt+=`' +
|
|
11
11
|
__e(`+Ft+`) +
|
|
12
12
|
'`),tn&&(H=!0,nt+=`';
|
|
13
13
|
`+tn+`;
|
|
@@ -23,7 +23,7 @@ __p += '`),Ht&&(nt+=`' +
|
|
|
23
23
|
function print() { __p += __j.call(arguments, '') }
|
|
24
24
|
`:`;
|
|
25
25
|
`)+nt+`return __p
|
|
26
|
-
}`;var Nt=Lb(function(){return $t(k,_t+"return "+nt).apply(e,A)});if(Nt.source=nt,Bf(Nt))throw Nt;return Nt}function WU(o){return Gt(o).toLowerCase()}function VU(o){return Gt(o).toUpperCase()}function $U(o,c,f){if(o=Gt(o),o&&(f||c===e))return V_(o);if(!o||!(c=bn(c)))return o;var m=Bn(o),b=Bn(c),k=$_(m,b),A=Y_(m,b)+1;return Xi(m,k,A).join("")}function YU(o,c,f){if(o=Gt(o),o&&(f||c===e))return o.slice(0,j_(o)+1);if(!o||!(c=bn(c)))return o;var m=Bn(o),b=Y_(m,Bn(c))+1;return Xi(m,0,b).join("")}function qU(o,c,f){if(o=Gt(o),o&&(f||c===e))return o.replace(Oo,"");if(!o||!(c=bn(c)))return o;var m=Bn(o),b=$_(m,Bn(c));return Xi(m,b).join("")}function jU(o,c){var f=U,m=$;if(fe(c)){var b="separator"in c?c.separator:b;f="length"in c?It(c.length):f,m="omission"in c?bn(c.omission):m}o=Gt(o);var k=o.length;if(ds(o)){var A=Bn(o);k=A.length}if(f>=k)return o;var E=f-fs(m);if(E<1)return m;var H=A?Xi(A,0,E).join(""):o.slice(0,E);if(b===e)return H+m;if(A&&(E+=H.length-E),Ff(b)){if(o.slice(E).search(b)){var X,Z=H;for(b.global||(b=Jd(b.source,Gt(ml.exec(b))+"g")),b.lastIndex=0;X=b.exec(Z);)var nt=X.index;H=H.slice(0,nt===e?E:nt)}}else if(o.indexOf(bn(b),E)!=E){var st=H.lastIndexOf(b);st>-1&&(H=H.slice(0,st))}return H+m}function GU(o){return o=Gt(o),o&&dd.test(o)?o.replace(Ui,TL):o}var KU=bs(function(o,c,f){return o+(f?" ":"")+c.toUpperCase()}),Wf=L0("toUpperCase");function Ib(o,c,f){return o=Gt(o),c=f?e:c,c===e?bL(o)?DL(o):uL(o):o.match(c)||[]}var Lb=Bt(function(o,c){try{return mn(o,e,c)}catch(f){return Bf(f)?f:new Ot(f)}}),XU=mi(function(o,c){return yn(c,function(f){f=zn(f),Xn(o,f,Lf(o[f],o))}),o});function ZU(o){var c=o==null?0:o.length,f=St();return o=c?ue(o,function(m){if(typeof m[1]!="function")throw new Cn(a);return[f(m[0]),m[1]]}):[],Bt(function(m){for(var b=-1;++b<c;){var k=o[b];if(mn(k[0],this,m))return mn(k[1],this,m)}})}function QU(o){return TN(An(o,y))}function Vf(o){return function(){return o}}function JU(o,c){return o==null||o!==o?c:o}var tH=B0(),eH=B0(!0);function hn(o){return o}function $f(o){return h0(typeof o=="function"?o:An(o,y))}function nH(o){return g0(An(o,y))}function iH(o,c){return m0(o,An(c,y))}var rH=Bt(function(o,c){return function(f){return Yo(f,o,c)}}),sH=Bt(function(o,c){return function(f){return Yo(o,f,c)}});function Yf(o,c,f){var m=Ee(c),b=Ql(c,m);f==null&&!(fe(c)&&(b.length||!m.length))&&(f=c,c=o,o=this,b=Ql(c,Ee(c)));var k=!(fe(f)&&"chain"in f)||!!f.chain,A=_i(o);return yn(b,function(E){var H=c[E];o[E]=H,A&&(o.prototype[E]=function(){var X=this.__chain__;if(k||X){var Z=o(this.__wrapped__),nt=Z.__actions__=un(this.__actions__);return nt.push({func:H,args:arguments,thisArg:o}),Z.__chain__=X,Z}return H.apply(o,$i([this.value()],arguments))})}),o}function oH(){return ce._===this&&(ce._=PL),this}function qf(){}function aH(o){return o=It(o),Bt(function(c){return y0(c,o)})}var lH=vf(ue),cH=vf(F_),uH=vf(qd);function Nb(o){return Of(o)?jd(zn(o)):HN(o)}function dH(o){return function(c){return o==null?e:Dr(o,c)}}var fH=z0(),hH=z0(!0);function jf(){return[]}function Gf(){return!1}function pH(){return{}}function gH(){return""}function mH(){return!0}function yH(o,c){if(o=It(o),o<1||o>tt)return[];var f=W,m=je(o,W);c=St(c),o-=W;for(var b=Xd(m,c);++f<o;)c(f);return b}function _H(o){return Et(o)?ue(o,zn):xn(o)?[o]:un(eb(Gt(o)))}function bH(o){var c=++RL;return Gt(o)+c}var xH=rc(function(o,c){return o+c},0),wH=Sf("ceil"),vH=rc(function(o,c){return o/c},1),SH=Sf("floor");function TH(o){return o&&o.length?Zl(o,hn,lf):e}function MH(o,c){return o&&o.length?Zl(o,St(c,2),lf):e}function kH(o){return H_(o,hn)}function DH(o,c){return H_(o,St(c,2))}function CH(o){return o&&o.length?Zl(o,hn,ff):e}function OH(o,c){return o&&o.length?Zl(o,St(c,2),ff):e}var AH=rc(function(o,c){return o*c},1),RH=Sf("round"),EH=rc(function(o,c){return o-c},0);function PH(o){return o&&o.length?Kd(o,hn):0}function IH(o,c){return o&&o.length?Kd(o,St(c,2)):0}return w.after=iz,w.ary=fb,w.assign=$z,w.assignIn=kb,w.assignInWith=Db,w.assignWith=zf,w.at=Yz,w.before=hb,w.bind=Lf,w.bindAll=XU,w.bindKey=pb,w.castArray=gz,w.chain=cb,w.chunk=TB,w.compact=MB,w.concat=kB,w.cond=ZU,w.conforms=QU,w.constant=Vf,w.countBy=IF,w.create=qz,w.curry=gb,w.curryRight=mb,w.debounce=yb,w.defaults=jz,w.defaultsDeep=Gz,w.defer=rz,w.delay=sz,w.difference=DB,w.differenceBy=CB,w.differenceWith=OB,w.drop=AB,w.dropRight=RB,w.dropRightWhile=EB,w.dropWhile=PB,w.fill=IB,w.filter=NF,w.flatMap=zF,w.flatMapDeep=UF,w.flatMapDepth=HF,w.flatten=sb,w.flattenDeep=LB,w.flattenDepth=NB,w.flip=oz,w.flow=tH,w.flowRight=eH,w.fromPairs=BB,w.functions=eU,w.functionsIn=nU,w.groupBy=WF,w.initial=zB,w.intersection=UB,w.intersectionBy=HB,w.intersectionWith=WB,w.invert=rU,w.invertBy=sU,w.invokeMap=$F,w.iteratee=$f,w.keyBy=YF,w.keys=Ee,w.keysIn=fn,w.map=dc,w.mapKeys=aU,w.mapValues=lU,w.matches=nH,w.matchesProperty=iH,w.memoize=hc,w.merge=cU,w.mergeWith=Cb,w.method=rH,w.methodOf=sH,w.mixin=Yf,w.negate=pc,w.nthArg=aH,w.omit=uU,w.omitBy=dU,w.once=az,w.orderBy=qF,w.over=lH,w.overArgs=lz,w.overEvery=cH,w.overSome=uH,w.partial=Nf,w.partialRight=_b,w.partition=jF,w.pick=fU,w.pickBy=Ob,w.property=Nb,w.propertyOf=dH,w.pull=qB,w.pullAll=ab,w.pullAllBy=jB,w.pullAllWith=GB,w.pullAt=KB,w.range=fH,w.rangeRight=hH,w.rearg=cz,w.reject=XF,w.remove=XB,w.rest=uz,w.reverse=Pf,w.sampleSize=QF,w.set=pU,w.setWith=gU,w.shuffle=JF,w.slice=ZB,w.sortBy=nz,w.sortedUniq=rF,w.sortedUniqBy=sF,w.split=FU,w.spread=dz,w.tail=oF,w.take=aF,w.takeRight=lF,w.takeRightWhile=cF,w.takeWhile=uF,w.tap=MF,w.throttle=fz,w.thru=uc,w.toArray=Sb,w.toPairs=Ab,w.toPairsIn=Rb,w.toPath=_H,w.toPlainObject=Mb,w.transform=mU,w.unary=hz,w.union=dF,w.unionBy=fF,w.unionWith=hF,w.uniq=pF,w.uniqBy=gF,w.uniqWith=mF,w.unset=yU,w.unzip=If,w.unzipWith=lb,w.update=_U,w.updateWith=bU,w.values=vs,w.valuesIn=xU,w.without=yF,w.words=Ib,w.wrap=pz,w.xor=_F,w.xorBy=bF,w.xorWith=xF,w.zip=wF,w.zipObject=vF,w.zipObjectDeep=SF,w.zipWith=TF,w.entries=Ab,w.entriesIn=Rb,w.extend=kb,w.extendWith=Db,Yf(w,w),w.add=xH,w.attempt=Lb,w.camelCase=TU,w.capitalize=Eb,w.ceil=wH,w.clamp=wU,w.clone=mz,w.cloneDeep=_z,w.cloneDeepWith=bz,w.cloneWith=yz,w.conformsTo=xz,w.deburr=Pb,w.defaultTo=JU,w.divide=vH,w.endsWith=MU,w.eq=Un,w.escape=kU,w.escapeRegExp=DU,w.every=LF,w.find=BF,w.findIndex=ib,w.findKey=Kz,w.findLast=FF,w.findLastIndex=rb,w.findLastKey=Xz,w.floor=SH,w.forEach=ub,w.forEachRight=db,w.forIn=Zz,w.forInRight=Qz,w.forOwn=Jz,w.forOwnRight=tU,w.get=Uf,w.gt=wz,w.gte=vz,w.has=iU,w.hasIn=Hf,w.head=ob,w.identity=hn,w.includes=VF,w.indexOf=FB,w.inRange=vU,w.invoke=oU,w.isArguments=Ar,w.isArray=Et,w.isArrayBuffer=Sz,w.isArrayLike=dn,w.isArrayLikeObject=_e,w.isBoolean=Tz,w.isBuffer=Zi,w.isDate=Mz,w.isElement=kz,w.isEmpty=Dz,w.isEqual=Cz,w.isEqualWith=Oz,w.isError=Bf,w.isFinite=Az,w.isFunction=_i,w.isInteger=bb,w.isLength=gc,w.isMap=xb,w.isMatch=Rz,w.isMatchWith=Ez,w.isNaN=Pz,w.isNative=Iz,w.isNil=Nz,w.isNull=Lz,w.isNumber=wb,w.isObject=fe,w.isObjectLike=ge,w.isPlainObject=Zo,w.isRegExp=Ff,w.isSafeInteger=Bz,w.isSet=vb,w.isString=mc,w.isSymbol=xn,w.isTypedArray=ws,w.isUndefined=Fz,w.isWeakMap=zz,w.isWeakSet=Uz,w.join=VB,w.kebabCase=CU,w.last=En,w.lastIndexOf=$B,w.lowerCase=OU,w.lowerFirst=AU,w.lt=Hz,w.lte=Wz,w.max=TH,w.maxBy=MH,w.mean=kH,w.meanBy=DH,w.min=CH,w.minBy=OH,w.stubArray=jf,w.stubFalse=Gf,w.stubObject=pH,w.stubString=gH,w.stubTrue=mH,w.multiply=AH,w.nth=YB,w.noConflict=oH,w.noop=qf,w.now=fc,w.pad=RU,w.padEnd=EU,w.padStart=PU,w.parseInt=IU,w.random=SU,w.reduce=GF,w.reduceRight=KF,w.repeat=LU,w.replace=NU,w.result=hU,w.round=RH,w.runInContext=z,w.sample=ZF,w.size=tz,w.snakeCase=BU,w.some=ez,w.sortedIndex=QB,w.sortedIndexBy=JB,w.sortedIndexOf=tF,w.sortedLastIndex=eF,w.sortedLastIndexBy=nF,w.sortedLastIndexOf=iF,w.startCase=zU,w.startsWith=UU,w.subtract=EH,w.sum=PH,w.sumBy=IH,w.template=HU,w.times=yH,w.toFinite=bi,w.toInteger=It,w.toLength=Tb,w.toLower=WU,w.toNumber=Pn,w.toSafeInteger=Vz,w.toString=Gt,w.toUpper=VU,w.trim=$U,w.trimEnd=YU,w.trimStart=qU,w.truncate=jU,w.unescape=GU,w.uniqueId=bH,w.upperCase=KU,w.upperFirst=Wf,w.each=ub,w.eachRight=db,w.first=ob,Yf(w,(function(){var o={};return Zn(w,function(c,f){jt.call(w.prototype,f)||(o[f]=c)}),o})(),{chain:!1}),w.VERSION=i,yn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){w[o].placeholder=w}),yn(["drop","take"],function(o,c){Ut.prototype[o]=function(f){f=f===e?1:ke(It(f),0);var m=this.__filtered__&&!c?new Ut(this):this.clone();return m.__filtered__?m.__takeCount__=je(f,m.__takeCount__):m.__views__.push({size:je(f,W),type:o+(m.__dir__<0?"Right":"")}),m},Ut.prototype[o+"Right"]=function(f){return this.reverse()[o](f).reverse()}}),yn(["filter","map","takeWhile"],function(o,c){var f=c+1,m=f==ot||f==J;Ut.prototype[o]=function(b){var k=this.clone();return k.__iteratees__.push({iteratee:St(b,3),type:f}),k.__filtered__=k.__filtered__||m,k}}),yn(["head","last"],function(o,c){var f="take"+(c?"Right":"");Ut.prototype[o]=function(){return this[f](1).value()[0]}}),yn(["initial","tail"],function(o,c){var f="drop"+(c?"":"Right");Ut.prototype[o]=function(){return this.__filtered__?new Ut(this):this[f](1)}}),Ut.prototype.compact=function(){return this.filter(hn)},Ut.prototype.find=function(o){return this.filter(o).head()},Ut.prototype.findLast=function(o){return this.reverse().find(o)},Ut.prototype.invokeMap=Bt(function(o,c){return typeof o=="function"?new Ut(this):this.map(function(f){return Yo(f,o,c)})}),Ut.prototype.reject=function(o){return this.filter(pc(St(o)))},Ut.prototype.slice=function(o,c){o=It(o);var f=this;return f.__filtered__&&(o>0||c<0)?new Ut(f):(o<0?f=f.takeRight(-o):o&&(f=f.drop(o)),c!==e&&(c=It(c),f=c<0?f.dropRight(-c):f.take(c-o)),f)},Ut.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},Ut.prototype.toArray=function(){return this.take(W)},Zn(Ut.prototype,function(o,c){var f=/^(?:filter|find|map|reject)|While$/.test(c),m=/^(?:head|last)$/.test(c),b=w[m?"take"+(c=="last"?"Right":""):c],k=m||/^find/.test(c);b&&(w.prototype[c]=function(){var A=this.__wrapped__,E=m?[1]:arguments,H=A instanceof Ut,X=E[0],Z=H||Et(A),nt=function(Ft){var Ht=b.apply(w,$i([Ft],E));return m&&st?Ht[0]:Ht};Z&&f&&typeof X=="function"&&X.length!=1&&(H=Z=!1);var st=this.__chain__,_t=!!this.__actions__.length,Tt=k&&!st,Nt=H&&!_t;if(!k&&Z){A=Nt?A:new Ut(this);var wt=o.apply(A,E);return wt.__actions__.push({func:uc,args:[nt],thisArg:e}),new On(wt,st)}return Tt&&Nt?o.apply(this,E):(wt=this.thru(nt),Tt?m?wt.value()[0]:wt.value():wt)})}),yn(["pop","push","shift","sort","splice","unshift"],function(o){var c=Nl[o],f=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",m=/^(?:pop|shift)$/.test(o);w.prototype[o]=function(){var b=arguments;if(m&&!this.__chain__){var k=this.value();return c.apply(Et(k)?k:[],b)}return this[f](function(A){return c.apply(Et(A)?A:[],b)})}}),Zn(Ut.prototype,function(o,c){var f=w[c];if(f){var m=f.name+"";jt.call(ms,m)||(ms[m]=[]),ms[m].push({name:c,func:f})}}),ms[ic(e,R).name]=[{name:"wrapper",func:e}],Ut.prototype.clone=KL,Ut.prototype.reverse=XL,Ut.prototype.value=ZL,w.prototype.at=kF,w.prototype.chain=DF,w.prototype.commit=CF,w.prototype.next=OF,w.prototype.plant=RF,w.prototype.reverse=EF,w.prototype.toJSON=w.prototype.valueOf=w.prototype.value=PF,w.prototype.first=w.prototype.head,Fo&&(w.prototype[Fo]=AF),w}),hs=CL();Kn?((Kn.exports=hs)._=hs,cs._=hs):ce._=hs}).call($I)})(wo,wo.exports)),wo.exports}var C_=YI(),dl={exports:{}},qI=dl.exports,O_;function jI(){return O_||(O_=1,(function(n,t){(function(e,i){i()})(qI,function(){function e(d,h){return typeof h>"u"?h={autoBom:!1}:typeof h!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),h={autoBom:!h}),h.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(d.type)?new Blob(["\uFEFF",d],{type:d.type}):d}function i(d,h,g){var y=new XMLHttpRequest;y.open("GET",d),y.responseType="blob",y.onload=function(){u(y.response,h,g)},y.onerror=function(){console.error("could not download file")},y.send()}function r(d){var h=new XMLHttpRequest;h.open("HEAD",d,!1);try{h.send()}catch{}return 200<=h.status&&299>=h.status}function s(d){try{d.dispatchEvent(new MouseEvent("click"))}catch{var h=document.createEvent("MouseEvents");h.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),d.dispatchEvent(h)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Fi=="object"&&Fi.global===Fi?Fi:void 0,l=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),u=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!l?function(d,h,g){var y=a.URL||a.webkitURL,_=document.createElement("a");h=h||d.name||"download",_.download=h,_.rel="noopener",typeof d=="string"?(_.href=d,_.origin===location.origin?s(_):r(_.href)?i(d,h,g):s(_,_.target="_blank")):(_.href=y.createObjectURL(d),setTimeout(function(){y.revokeObjectURL(_.href)},4e4),setTimeout(function(){s(_)},0))}:"msSaveOrOpenBlob"in navigator?function(d,h,g){if(h=h||d.name||"download",typeof d!="string")navigator.msSaveOrOpenBlob(e(d,g),h);else if(r(d))i(d,h,g);else{var y=document.createElement("a");y.href=d,y.target="_blank",setTimeout(function(){s(y)})}}:function(d,h,g,y){if(y=y||open("","_blank"),y&&(y.document.title=y.document.body.innerText="downloading..."),typeof d=="string")return i(d,h,g);var _=d.type==="application/octet-stream",x=/constructor/i.test(a.HTMLElement)||a.safari,v=/CriOS\/[\d]+/.test(navigator.userAgent);if((v||_&&x||l)&&typeof FileReader<"u"){var M=new FileReader;M.onloadend=function(){var F=M.result;F=v?F:F.replace(/^data:[^;]*;/,"data:attachment/file;"),y?y.location.href=F:location=F,y=null},M.readAsDataURL(d)}else{var C=a.URL||a.webkitURL,R=C.createObjectURL(d);y?y.location=R:location.href=R,y=null,setTimeout(function(){C.revokeObjectURL(R)},4e4)}});a.saveAs=u.saveAs=u,n.exports=u})})(dl)),dl.exports}var GI=jI(),fl={exports:{}};var KI=fl.exports,A_;function XI(){return A_||(A_=1,(function(n,t){((e,i)=>{n.exports=i()})(KI,function e(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},r=!i.document&&!!i.postMessage,s=i.IS_PAPA_WORKER||!1,a={},l=0,u={};function d(T){return T.charCodeAt(0)===65279?T.slice(1):T}function h(T){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(S){var O=L(S);O.chunkSize=parseInt(O.chunkSize),S.step||S.chunk||(O.chunkSize=null),this._handle=new v(O),(this._handle.streamer=this)._config=O}).call(this,T),this.parseChunk=function(S,O){var U=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<U){let it=this._config.newline;it||($=this._config.quoteChar||'"',it=this._handle.guessLineEndings(S,$)),S=[...S.split(it).slice(U)].join(it)}this.isFirstChunk&&B(this._config.beforeFirstChunk)&&($=this._config.beforeFirstChunk(S))!==void 0&&(S=$),this.isFirstChunk=!1,this._halted=!1;var U=this._partialLine+S,$=(this._partialLine="",this._handle.parse(U,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(S=$.meta.cursor,U=(this._finished||(this._partialLine=U.substring(S-this._baseIndex),this._baseIndex=S),$&&$.data&&(this._rowCount+=$.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),s)i.postMessage({results:$,workerId:u.WORKER_ID,finished:U});else if(B(this._config.chunk)&&!O){if(this._config.chunk($,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=$=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat($.data),this._completeResults.errors=this._completeResults.errors.concat($.errors),this._completeResults.meta=$.meta),this._completed||!U||!B(this._config.complete)||$&&$.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),U||$&&$.meta.paused||this._nextChunk(),$}this._halted=!0},this._sendError=function(S){B(this._config.error)?this._config.error(S):s&&this._config.error&&i.postMessage({workerId:u.WORKER_ID,error:S,finished:!1})}}function g(T){var S;(T=T||{}).chunkSize||(T.chunkSize=u.RemoteChunkSize),h.call(this,T),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(O){this._input=O,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(S=new XMLHttpRequest,this._config.withCredentials&&(S.withCredentials=this._config.withCredentials),r||(S.onload=N(this._chunkLoaded,this),S.onerror=N(this._chunkError,this)),S.ontimeout=N(this._chunkTimeout,this),S.open(this._config.downloadRequestBody?"POST":"GET",this._input,!r),this._config.downloadTimeout&&!r&&(S.timeout=this._config.downloadTimeout),this._config.downloadRequestHeaders){var O,U=this._config.downloadRequestHeaders;for(O in U)S.setRequestHeader(O,U[O])}var $;this._config.chunkSize&&($=this._start+this._config.chunkSize-1,S.setRequestHeader("Range","bytes="+this._start+"-"+$));try{S.send(this._config.downloadRequestBody)}catch(it){this._chunkError(it.message)}r&&S.status===0&&this._chunkError()}},this._chunkLoaded=function(){S.readyState===4&&(S.status<200||400<=S.status?this._chunkError():(this._start+=this._config.chunkSize||S.responseText.length,this._finished=!this._config.chunkSize||this._start>=(O=>(O=O.getResponseHeader("Content-Range"))!==null?parseInt(O.substring(O.lastIndexOf("/")+1)):-1)(S),this.parseChunk(S.responseText)))},this._chunkError=function(O){O=S.statusText||O,this._sendError(new Error(O))},this._chunkTimeout=function(){this._chunkError("Request timed out after "+this._config.downloadTimeout+"ms")}}function y(T){(T=T||{}).chunkSize||(T.chunkSize=u.LocalChunkSize),h.call(this,T);var S,O,U=typeof FileReader<"u";this.stream=function($){this._input=$,O=$.slice||$.webkitSlice||$.mozSlice,U?((S=new FileReader).onload=N(this._chunkLoaded,this),S.onerror=N(this._chunkError,this)):S=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var $=this._input,it=(this._config.chunkSize&&(it=Math.min(this._start+this._config.chunkSize,this._input.size),$=O.call($,this._start,it)),S.readAsText($,this._config.encoding));U||this._chunkLoaded({target:{result:it}})},this._chunkLoaded=function($){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk($.target.result)},this._chunkError=function(){this._sendError(S.error)}}function _(T){var S;h.call(this,T=T||{}),this.stream=function(O){return S=O,this._nextChunk()},this._nextChunk=function(){var O,U;if(!this._finished)return O=this._config.chunkSize,S=O?(U=S.substring(0,O),S.substring(O)):(U=S,""),this._finished=!S,this.parseChunk(U)}}function x(T){h.call(this,T=T||{});var S=[],O=!0,U=!1;this.pause=function(){h.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){h.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function($){this._input=$,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){U&&S.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),S.length?this.parseChunk(S.shift()):O=!0},this._streamData=N(function($){try{S.push(typeof $=="string"?$:$.toString(this._config.encoding)),O&&(O=!1,this._checkIsFinished(),this.parseChunk(S.shift()))}catch(it){this._streamError(it)}},this),this._streamError=N(function($){this._streamCleanUp(),this._sendError($)},this),this._streamEnd=N(function(){this._streamCleanUp(),U=!0,this._streamData("")},this),this._streamCleanUp=N(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function v(T){var S,O,U,$,it=Math.pow(2,53),at=-it,ot=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,q=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,J=this,rt=0,tt=0,G=!1,P=!1,W=[],j={data:[],errors:[],meta:{}};function pt(ft){return T.skipEmptyLines==="greedy"?ft.join("").trim()==="":ft.length===1&&ft[0].length===0}function lt(){if(j&&U&&(ht("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+u.DefaultDelimiter+"'"),U=!1),T.skipEmptyLines&&(j.data=j.data.filter(function(ut){return!pt(ut)})),et()){let ut=function(Lt){W.push(Lt)};if(j)if(Array.isArray(j.data[0])){for(var ft=0;et()&&ft<j.data.length;ft++)j.data[ft].forEach(ut);j.data.splice(0,1)}else j.data.forEach(ut)}function ct(ut,Lt){for(var zt=T.header?{}:[],vt=0;vt<ut.length;vt++){var Ct=vt,Dt=ut[vt],Dt=((ve,bt)=>(qt=>(T.dynamicTypingFunction&&T.dynamicTyping[qt]===void 0&&(T.dynamicTyping[qt]=T.dynamicTypingFunction(qt)),(T.dynamicTyping[qt]||T.dynamicTyping)===!0))(ve)?bt==="true"||bt==="TRUE"||bt!=="false"&&bt!=="FALSE"&&((qt=>{if(ot.test(qt)&&(qt=parseFloat(qt),at<qt&&qt<it))return 1})(bt)?parseFloat(bt):q.test(bt)?new Date(bt):bt===""?null:bt):bt)(Ct=T.header?vt>=W.length?"__parsed_extra":W[vt]:Ct,Dt=T.transform?T.transform(Dt,Ct):Dt);Ct==="__parsed_extra"?(zt[Ct]=zt[Ct]||[],zt[Ct].push(Dt)):zt[Ct]=Dt}return T.header&&(vt>W.length?ht("FieldMismatch","TooManyFields","Too many fields: expected "+W.length+" fields but parsed "+vt,tt+Lt):vt<W.length&&ht("FieldMismatch","TooFewFields","Too few fields: expected "+W.length+" fields but parsed "+vt,tt+Lt)),zt}var mt;j&&(T.header||T.dynamicTyping||T.transform)&&(mt=1,!j.data.length||Array.isArray(j.data[0])?(j.data=j.data.map(ct),mt=j.data.length):j.data=ct(j.data,0),T.header&&j.meta&&(j.meta.fields=W),tt+=mt)}function et(){return T.header&&W.length===0}function ht(ft,ct,mt,ut){ft={type:ft,code:ct,message:mt},ut!==void 0&&(ft.row=ut),j.errors.push(ft)}B(T.step)&&($=T.step,T.step=function(ft){j=ft,et()?lt():(lt(),j.data.length!==0&&(rt+=ft.data.length,T.preview&&rt>T.preview?O.abort():(j.data=j.data[0],$(j,J))))}),this.parse=function(ft,ct,mt){var ut=T.quoteChar||'"',ut=(T.newline||(T.newline=this.guessLineEndings(ft,ut)),U=!1,T.delimiter?B(T.delimiter)&&(T.delimiter=T.delimiter(ft),j.meta.delimiter=T.delimiter):((ut=((Lt,zt,vt,Ct,Dt)=>{var ve,bt,qt,Oe;Dt=Dt||[","," ","|",";",u.RECORD_SEP,u.UNIT_SEP];for(var Ae=0;Ae<Dt.length;Ae++){for(var oe,ln=Dt[Ae],Vt=0,Le=0,ie=0,Se=(qt=void 0,new C({comments:Ct,delimiter:ln,newline:zt,preview:10}).parse(Lt)),Re=0;Re<Se.data.length;Re++)vt&&pt(Se.data[Re])?ie++:(oe=Se.data[Re].length,Le+=oe,qt===void 0?qt=oe:0<oe&&(Vt+=Math.abs(oe-qt),qt=oe));0<Se.data.length&&(Le/=Se.data.length-ie),1.99<Le&&(bt===void 0||Vt<bt||Vt===bt&&Oe<Le)&&(bt=Vt,ve=ln,Oe=Le)}return{successful:!!(T.delimiter=ve),bestDelimiter:ve}})(ft,T.newline,T.skipEmptyLines,T.comments,T.delimitersToGuess)).successful?T.delimiter=ut.bestDelimiter:(U=!0,T.delimiter=u.DefaultDelimiter),j.meta.delimiter=T.delimiter),L(T));return ut.header=et(),T.preview&&T.header&&ut.preview++,S=ft,O=new C(ut),j=O.parse(S,ct,mt),lt(),G?{meta:{paused:!0}}:j||{meta:{paused:!1}}},this.paused=function(){return G},this.pause=function(){G=!0,O.abort(),S=B(T.chunk)?"":S.substring(O.getCharIndex())},this.resume=function(){J.streamer._halted?(G=!1,J.streamer.parseChunk(S,!0)):setTimeout(J.resume,3)},this.aborted=function(){return P},this.abort=function(){P=!0,O.abort(),j.meta.aborted=!0,B(T.complete)&&T.complete(j),S=""},this.guessLineEndings=function(Lt,ut){Lt=Lt.substring(0,1048576);var ut=new RegExp(M(ut)+"([^]*?)"+M(ut),"gm"),mt=(Lt=Lt.replace(ut,"")).split("\r"),ut=Lt.split(`
|
|
26
|
+
}`;var Nt=Nb(function(){return $t(k,_t+"return "+nt).apply(e,A)});if(Nt.source=nt,Bf(Nt))throw Nt;return Nt}function GU(o){return Gt(o).toLowerCase()}function KU(o){return Gt(o).toUpperCase()}function XU(o,c,f){if(o=Gt(o),o&&(f||c===e))return $_(o);if(!o||!(c=bn(c)))return o;var m=Bn(o),b=Bn(c),k=Y_(m,b),A=q_(m,b)+1;return Xi(m,k,A).join("")}function ZU(o,c,f){if(o=Gt(o),o&&(f||c===e))return o.slice(0,G_(o)+1);if(!o||!(c=bn(c)))return o;var m=Bn(o),b=q_(m,Bn(c))+1;return Xi(m,0,b).join("")}function QU(o,c,f){if(o=Gt(o),o&&(f||c===e))return o.replace(Oo,"");if(!o||!(c=bn(c)))return o;var m=Bn(o),b=Y_(m,Bn(c));return Xi(m,b).join("")}function JU(o,c){var f=U,m=$;if(fe(c)){var b="separator"in c?c.separator:b;f="length"in c?It(c.length):f,m="omission"in c?bn(c.omission):m}o=Gt(o);var k=o.length;if(ds(o)){var A=Bn(o);k=A.length}if(f>=k)return o;var E=f-fs(m);if(E<1)return m;var H=A?Xi(A,0,E).join(""):o.slice(0,E);if(b===e)return H+m;if(A&&(E+=H.length-E),Ff(b)){if(o.slice(E).search(b)){var X,Z=H;for(b.global||(b=Jd(b.source,Gt(ml.exec(b))+"g")),b.lastIndex=0;X=b.exec(Z);)var nt=X.index;H=H.slice(0,nt===e?E:nt)}}else if(o.indexOf(bn(b),E)!=E){var st=H.lastIndexOf(b);st>-1&&(H=H.slice(0,st))}return H+m}function tH(o){return o=Gt(o),o&&dd.test(o)?o.replace(Ui,AL):o}var eH=bs(function(o,c,f){return o+(f?" ":"")+c.toUpperCase()}),Wf=N0("toUpperCase");function Lb(o,c,f){return o=Gt(o),c=f?e:c,c===e?ML(o)?PL(o):mL(o):o.match(c)||[]}var Nb=Bt(function(o,c){try{return mn(o,e,c)}catch(f){return Bf(f)?f:new Ot(f)}}),nH=mi(function(o,c){return yn(c,function(f){f=zn(f),Xn(o,f,Lf(o[f],o))}),o});function iH(o){var c=o==null?0:o.length,f=St();return o=c?ue(o,function(m){if(typeof m[1]!="function")throw new Cn(a);return[f(m[0]),m[1]]}):[],Bt(function(m){for(var b=-1;++b<c;){var k=o[b];if(mn(k[0],this,m))return mn(k[1],this,m)}})}function rH(o){return AN(An(o,y))}function Vf(o){return function(){return o}}function sH(o,c){return o==null||o!==o?c:o}var oH=F0(),aH=F0(!0);function hn(o){return o}function $f(o){return p0(typeof o=="function"?o:An(o,y))}function lH(o){return m0(An(o,y))}function cH(o,c){return y0(o,An(c,y))}var uH=Bt(function(o,c){return function(f){return Yo(f,o,c)}}),dH=Bt(function(o,c){return function(f){return Yo(o,f,c)}});function Yf(o,c,f){var m=Ee(c),b=Ql(c,m);f==null&&!(fe(c)&&(b.length||!m.length))&&(f=c,c=o,o=this,b=Ql(c,Ee(c)));var k=!(fe(f)&&"chain"in f)||!!f.chain,A=_i(o);return yn(b,function(E){var H=c[E];o[E]=H,A&&(o.prototype[E]=function(){var X=this.__chain__;if(k||X){var Z=o(this.__wrapped__),nt=Z.__actions__=un(this.__actions__);return nt.push({func:H,args:arguments,thisArg:o}),Z.__chain__=X,Z}return H.apply(o,$i([this.value()],arguments))})}),o}function fH(){return ce._===this&&(ce._=zL),this}function qf(){}function hH(o){return o=It(o),Bt(function(c){return _0(c,o)})}var pH=vf(ue),gH=vf(z_),mH=vf(qd);function Bb(o){return Of(o)?jd(zn(o)):jN(o)}function yH(o){return function(c){return o==null?e:Dr(o,c)}}var _H=U0(),bH=U0(!0);function jf(){return[]}function Gf(){return!1}function xH(){return{}}function wH(){return""}function vH(){return!0}function SH(o,c){if(o=It(o),o<1||o>tt)return[];var f=W,m=je(o,W);c=St(c),o-=W;for(var b=Xd(m,c);++f<o;)c(f);return b}function TH(o){return Et(o)?ue(o,zn):xn(o)?[o]:un(nb(Gt(o)))}function MH(o){var c=++BL;return Gt(o)+c}var kH=rc(function(o,c){return o+c},0),DH=Sf("ceil"),CH=rc(function(o,c){return o/c},1),OH=Sf("floor");function AH(o){return o&&o.length?Zl(o,hn,lf):e}function RH(o,c){return o&&o.length?Zl(o,St(c,2),lf):e}function EH(o){return W_(o,hn)}function PH(o,c){return W_(o,St(c,2))}function IH(o){return o&&o.length?Zl(o,hn,ff):e}function LH(o,c){return o&&o.length?Zl(o,St(c,2),ff):e}var NH=rc(function(o,c){return o*c},1),BH=Sf("round"),FH=rc(function(o,c){return o-c},0);function zH(o){return o&&o.length?Kd(o,hn):0}function UH(o,c){return o&&o.length?Kd(o,St(c,2)):0}return w.after=cz,w.ary=hb,w.assign=Xz,w.assignIn=Db,w.assignInWith=Cb,w.assignWith=zf,w.at=Zz,w.before=pb,w.bind=Lf,w.bindAll=nH,w.bindKey=gb,w.castArray=wz,w.chain=ub,w.chunk=AB,w.compact=RB,w.concat=EB,w.cond=iH,w.conforms=rH,w.constant=Vf,w.countBy=UF,w.create=Qz,w.curry=mb,w.curryRight=yb,w.debounce=_b,w.defaults=Jz,w.defaultsDeep=tU,w.defer=uz,w.delay=dz,w.difference=PB,w.differenceBy=IB,w.differenceWith=LB,w.drop=NB,w.dropRight=BB,w.dropRightWhile=FB,w.dropWhile=zB,w.fill=UB,w.filter=WF,w.flatMap=YF,w.flatMapDeep=qF,w.flatMapDepth=jF,w.flatten=ob,w.flattenDeep=HB,w.flattenDepth=WB,w.flip=fz,w.flow=oH,w.flowRight=aH,w.fromPairs=VB,w.functions=aU,w.functionsIn=lU,w.groupBy=GF,w.initial=YB,w.intersection=qB,w.intersectionBy=jB,w.intersectionWith=GB,w.invert=uU,w.invertBy=dU,w.invokeMap=XF,w.iteratee=$f,w.keyBy=ZF,w.keys=Ee,w.keysIn=fn,w.map=dc,w.mapKeys=hU,w.mapValues=pU,w.matches=lH,w.matchesProperty=cH,w.memoize=hc,w.merge=gU,w.mergeWith=Ob,w.method=uH,w.methodOf=dH,w.mixin=Yf,w.negate=pc,w.nthArg=hH,w.omit=mU,w.omitBy=yU,w.once=hz,w.orderBy=QF,w.over=pH,w.overArgs=pz,w.overEvery=gH,w.overSome=mH,w.partial=Nf,w.partialRight=bb,w.partition=JF,w.pick=_U,w.pickBy=Ab,w.property=Bb,w.propertyOf=yH,w.pull=QB,w.pullAll=lb,w.pullAllBy=JB,w.pullAllWith=tF,w.pullAt=eF,w.range=_H,w.rangeRight=bH,w.rearg=gz,w.reject=nz,w.remove=nF,w.rest=mz,w.reverse=Pf,w.sampleSize=rz,w.set=xU,w.setWith=wU,w.shuffle=sz,w.slice=iF,w.sortBy=lz,w.sortedUniq=uF,w.sortedUniqBy=dF,w.split=$U,w.spread=yz,w.tail=fF,w.take=hF,w.takeRight=pF,w.takeRightWhile=gF,w.takeWhile=mF,w.tap=RF,w.throttle=_z,w.thru=uc,w.toArray=Tb,w.toPairs=Rb,w.toPairsIn=Eb,w.toPath=TH,w.toPlainObject=kb,w.transform=vU,w.unary=bz,w.union=yF,w.unionBy=_F,w.unionWith=bF,w.uniq=xF,w.uniqBy=wF,w.uniqWith=vF,w.unset=SU,w.unzip=If,w.unzipWith=cb,w.update=TU,w.updateWith=MU,w.values=vs,w.valuesIn=kU,w.without=SF,w.words=Lb,w.wrap=xz,w.xor=TF,w.xorBy=MF,w.xorWith=kF,w.zip=DF,w.zipObject=CF,w.zipObjectDeep=OF,w.zipWith=AF,w.entries=Rb,w.entriesIn=Eb,w.extend=Db,w.extendWith=Cb,Yf(w,w),w.add=kH,w.attempt=Nb,w.camelCase=AU,w.capitalize=Pb,w.ceil=DH,w.clamp=DU,w.clone=vz,w.cloneDeep=Tz,w.cloneDeepWith=Mz,w.cloneWith=Sz,w.conformsTo=kz,w.deburr=Ib,w.defaultTo=sH,w.divide=CH,w.endsWith=RU,w.eq=Un,w.escape=EU,w.escapeRegExp=PU,w.every=HF,w.find=VF,w.findIndex=rb,w.findKey=eU,w.findLast=$F,w.findLastIndex=sb,w.findLastKey=nU,w.floor=OH,w.forEach=db,w.forEachRight=fb,w.forIn=iU,w.forInRight=rU,w.forOwn=sU,w.forOwnRight=oU,w.get=Uf,w.gt=Dz,w.gte=Cz,w.has=cU,w.hasIn=Hf,w.head=ab,w.identity=hn,w.includes=KF,w.indexOf=$B,w.inRange=CU,w.invoke=fU,w.isArguments=Ar,w.isArray=Et,w.isArrayBuffer=Oz,w.isArrayLike=dn,w.isArrayLikeObject=_e,w.isBoolean=Az,w.isBuffer=Zi,w.isDate=Rz,w.isElement=Ez,w.isEmpty=Pz,w.isEqual=Iz,w.isEqualWith=Lz,w.isError=Bf,w.isFinite=Nz,w.isFunction=_i,w.isInteger=xb,w.isLength=gc,w.isMap=wb,w.isMatch=Bz,w.isMatchWith=Fz,w.isNaN=zz,w.isNative=Uz,w.isNil=Wz,w.isNull=Hz,w.isNumber=vb,w.isObject=fe,w.isObjectLike=ge,w.isPlainObject=Zo,w.isRegExp=Ff,w.isSafeInteger=Vz,w.isSet=Sb,w.isString=mc,w.isSymbol=xn,w.isTypedArray=ws,w.isUndefined=$z,w.isWeakMap=Yz,w.isWeakSet=qz,w.join=KB,w.kebabCase=IU,w.last=En,w.lastIndexOf=XB,w.lowerCase=LU,w.lowerFirst=NU,w.lt=jz,w.lte=Gz,w.max=AH,w.maxBy=RH,w.mean=EH,w.meanBy=PH,w.min=IH,w.minBy=LH,w.stubArray=jf,w.stubFalse=Gf,w.stubObject=xH,w.stubString=wH,w.stubTrue=vH,w.multiply=NH,w.nth=ZB,w.noConflict=fH,w.noop=qf,w.now=fc,w.pad=BU,w.padEnd=FU,w.padStart=zU,w.parseInt=UU,w.random=OU,w.reduce=tz,w.reduceRight=ez,w.repeat=HU,w.replace=WU,w.result=bU,w.round=BH,w.runInContext=z,w.sample=iz,w.size=oz,w.snakeCase=VU,w.some=az,w.sortedIndex=rF,w.sortedIndexBy=sF,w.sortedIndexOf=oF,w.sortedLastIndex=aF,w.sortedLastIndexBy=lF,w.sortedLastIndexOf=cF,w.startCase=YU,w.startsWith=qU,w.subtract=FH,w.sum=zH,w.sumBy=UH,w.template=jU,w.times=SH,w.toFinite=bi,w.toInteger=It,w.toLength=Mb,w.toLower=GU,w.toNumber=Pn,w.toSafeInteger=Kz,w.toString=Gt,w.toUpper=KU,w.trim=XU,w.trimEnd=ZU,w.trimStart=QU,w.truncate=JU,w.unescape=tH,w.uniqueId=MH,w.upperCase=eH,w.upperFirst=Wf,w.each=db,w.eachRight=fb,w.first=ab,Yf(w,(function(){var o={};return Zn(w,function(c,f){jt.call(w.prototype,f)||(o[f]=c)}),o})(),{chain:!1}),w.VERSION=i,yn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){w[o].placeholder=w}),yn(["drop","take"],function(o,c){Ut.prototype[o]=function(f){f=f===e?1:ke(It(f),0);var m=this.__filtered__&&!c?new Ut(this):this.clone();return m.__filtered__?m.__takeCount__=je(f,m.__takeCount__):m.__views__.push({size:je(f,W),type:o+(m.__dir__<0?"Right":"")}),m},Ut.prototype[o+"Right"]=function(f){return this.reverse()[o](f).reverse()}}),yn(["filter","map","takeWhile"],function(o,c){var f=c+1,m=f==ot||f==J;Ut.prototype[o]=function(b){var k=this.clone();return k.__iteratees__.push({iteratee:St(b,3),type:f}),k.__filtered__=k.__filtered__||m,k}}),yn(["head","last"],function(o,c){var f="take"+(c?"Right":"");Ut.prototype[o]=function(){return this[f](1).value()[0]}}),yn(["initial","tail"],function(o,c){var f="drop"+(c?"":"Right");Ut.prototype[o]=function(){return this.__filtered__?new Ut(this):this[f](1)}}),Ut.prototype.compact=function(){return this.filter(hn)},Ut.prototype.find=function(o){return this.filter(o).head()},Ut.prototype.findLast=function(o){return this.reverse().find(o)},Ut.prototype.invokeMap=Bt(function(o,c){return typeof o=="function"?new Ut(this):this.map(function(f){return Yo(f,o,c)})}),Ut.prototype.reject=function(o){return this.filter(pc(St(o)))},Ut.prototype.slice=function(o,c){o=It(o);var f=this;return f.__filtered__&&(o>0||c<0)?new Ut(f):(o<0?f=f.takeRight(-o):o&&(f=f.drop(o)),c!==e&&(c=It(c),f=c<0?f.dropRight(-c):f.take(c-o)),f)},Ut.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},Ut.prototype.toArray=function(){return this.take(W)},Zn(Ut.prototype,function(o,c){var f=/^(?:filter|find|map|reject)|While$/.test(c),m=/^(?:head|last)$/.test(c),b=w[m?"take"+(c=="last"?"Right":""):c],k=m||/^find/.test(c);b&&(w.prototype[c]=function(){var A=this.__wrapped__,E=m?[1]:arguments,H=A instanceof Ut,X=E[0],Z=H||Et(A),nt=function(Ft){var Ht=b.apply(w,$i([Ft],E));return m&&st?Ht[0]:Ht};Z&&f&&typeof X=="function"&&X.length!=1&&(H=Z=!1);var st=this.__chain__,_t=!!this.__actions__.length,Tt=k&&!st,Nt=H&&!_t;if(!k&&Z){A=Nt?A:new Ut(this);var wt=o.apply(A,E);return wt.__actions__.push({func:uc,args:[nt],thisArg:e}),new On(wt,st)}return Tt&&Nt?o.apply(this,E):(wt=this.thru(nt),Tt?m?wt.value()[0]:wt.value():wt)})}),yn(["pop","push","shift","sort","splice","unshift"],function(o){var c=Nl[o],f=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",m=/^(?:pop|shift)$/.test(o);w.prototype[o]=function(){var b=arguments;if(m&&!this.__chain__){var k=this.value();return c.apply(Et(k)?k:[],b)}return this[f](function(A){return c.apply(Et(A)?A:[],b)})}}),Zn(Ut.prototype,function(o,c){var f=w[c];if(f){var m=f.name+"";jt.call(ms,m)||(ms[m]=[]),ms[m].push({name:c,func:f})}}),ms[ic(e,R).name]=[{name:"wrapper",func:e}],Ut.prototype.clone=eN,Ut.prototype.reverse=nN,Ut.prototype.value=iN,w.prototype.at=EF,w.prototype.chain=PF,w.prototype.commit=IF,w.prototype.next=LF,w.prototype.plant=BF,w.prototype.reverse=FF,w.prototype.toJSON=w.prototype.valueOf=w.prototype.value=zF,w.prototype.first=w.prototype.head,Fo&&(w.prototype[Fo]=NF),w}),hs=IL();Kn?((Kn.exports=hs)._=hs,cs._=hs):ce._=hs}).call(XI)})(wo,wo.exports)),wo.exports}var O_=ZI(),dl={exports:{}},QI=dl.exports,A_;function JI(){return A_||(A_=1,(function(n,t){(function(e,i){i()})(QI,function(){function e(d,h){return typeof h>"u"?h={autoBom:!1}:typeof h!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),h={autoBom:!h}),h.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(d.type)?new Blob(["\uFEFF",d],{type:d.type}):d}function i(d,h,g){var y=new XMLHttpRequest;y.open("GET",d),y.responseType="blob",y.onload=function(){u(y.response,h,g)},y.onerror=function(){console.error("could not download file")},y.send()}function r(d){var h=new XMLHttpRequest;h.open("HEAD",d,!1);try{h.send()}catch{}return 200<=h.status&&299>=h.status}function s(d){try{d.dispatchEvent(new MouseEvent("click"))}catch{var h=document.createEvent("MouseEvents");h.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),d.dispatchEvent(h)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Fi=="object"&&Fi.global===Fi?Fi:void 0,l=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),u=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!l?function(d,h,g){var y=a.URL||a.webkitURL,_=document.createElement("a");h=h||d.name||"download",_.download=h,_.rel="noopener",typeof d=="string"?(_.href=d,_.origin===location.origin?s(_):r(_.href)?i(d,h,g):s(_,_.target="_blank")):(_.href=y.createObjectURL(d),setTimeout(function(){y.revokeObjectURL(_.href)},4e4),setTimeout(function(){s(_)},0))}:"msSaveOrOpenBlob"in navigator?function(d,h,g){if(h=h||d.name||"download",typeof d!="string")navigator.msSaveOrOpenBlob(e(d,g),h);else if(r(d))i(d,h,g);else{var y=document.createElement("a");y.href=d,y.target="_blank",setTimeout(function(){s(y)})}}:function(d,h,g,y){if(y=y||open("","_blank"),y&&(y.document.title=y.document.body.innerText="downloading..."),typeof d=="string")return i(d,h,g);var _=d.type==="application/octet-stream",x=/constructor/i.test(a.HTMLElement)||a.safari,v=/CriOS\/[\d]+/.test(navigator.userAgent);if((v||_&&x||l)&&typeof FileReader<"u"){var M=new FileReader;M.onloadend=function(){var F=M.result;F=v?F:F.replace(/^data:[^;]*;/,"data:attachment/file;"),y?y.location.href=F:location=F,y=null},M.readAsDataURL(d)}else{var C=a.URL||a.webkitURL,R=C.createObjectURL(d);y?y.location=R:location.href=R,y=null,setTimeout(function(){C.revokeObjectURL(R)},4e4)}});a.saveAs=u.saveAs=u,n.exports=u})})(dl)),dl.exports}var tL=JI(),fl={exports:{}};var eL=fl.exports,R_;function nL(){return R_||(R_=1,(function(n,t){((e,i)=>{n.exports=i()})(eL,function e(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},r=!i.document&&!!i.postMessage,s=i.IS_PAPA_WORKER||!1,a={},l=0,u={};function d(T){return T.charCodeAt(0)===65279?T.slice(1):T}function h(T){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(S){var O=L(S);O.chunkSize=parseInt(O.chunkSize),S.step||S.chunk||(O.chunkSize=null),this._handle=new v(O),(this._handle.streamer=this)._config=O}).call(this,T),this.parseChunk=function(S,O){var U=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<U){let it=this._config.newline;it||($=this._config.quoteChar||'"',it=this._handle.guessLineEndings(S,$)),S=[...S.split(it).slice(U)].join(it)}this.isFirstChunk&&B(this._config.beforeFirstChunk)&&($=this._config.beforeFirstChunk(S))!==void 0&&(S=$),this.isFirstChunk=!1,this._halted=!1;var U=this._partialLine+S,$=(this._partialLine="",this._handle.parse(U,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(S=$.meta.cursor,U=(this._finished||(this._partialLine=U.substring(S-this._baseIndex),this._baseIndex=S),$&&$.data&&(this._rowCount+=$.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),s)i.postMessage({results:$,workerId:u.WORKER_ID,finished:U});else if(B(this._config.chunk)&&!O){if(this._config.chunk($,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=$=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat($.data),this._completeResults.errors=this._completeResults.errors.concat($.errors),this._completeResults.meta=$.meta),this._completed||!U||!B(this._config.complete)||$&&$.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),U||$&&$.meta.paused||this._nextChunk(),$}this._halted=!0},this._sendError=function(S){B(this._config.error)?this._config.error(S):s&&this._config.error&&i.postMessage({workerId:u.WORKER_ID,error:S,finished:!1})}}function g(T){var S;(T=T||{}).chunkSize||(T.chunkSize=u.RemoteChunkSize),h.call(this,T),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(O){this._input=O,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(S=new XMLHttpRequest,this._config.withCredentials&&(S.withCredentials=this._config.withCredentials),r||(S.onload=N(this._chunkLoaded,this),S.onerror=N(this._chunkError,this)),S.ontimeout=N(this._chunkTimeout,this),S.open(this._config.downloadRequestBody?"POST":"GET",this._input,!r),this._config.downloadTimeout&&!r&&(S.timeout=this._config.downloadTimeout),this._config.downloadRequestHeaders){var O,U=this._config.downloadRequestHeaders;for(O in U)S.setRequestHeader(O,U[O])}var $;this._config.chunkSize&&($=this._start+this._config.chunkSize-1,S.setRequestHeader("Range","bytes="+this._start+"-"+$));try{S.send(this._config.downloadRequestBody)}catch(it){this._chunkError(it.message)}r&&S.status===0&&this._chunkError()}},this._chunkLoaded=function(){S.readyState===4&&(S.status<200||400<=S.status?this._chunkError():(this._start+=this._config.chunkSize||S.responseText.length,this._finished=!this._config.chunkSize||this._start>=(O=>(O=O.getResponseHeader("Content-Range"))!==null?parseInt(O.substring(O.lastIndexOf("/")+1)):-1)(S),this.parseChunk(S.responseText)))},this._chunkError=function(O){O=S.statusText||O,this._sendError(new Error(O))},this._chunkTimeout=function(){this._chunkError("Request timed out after "+this._config.downloadTimeout+"ms")}}function y(T){(T=T||{}).chunkSize||(T.chunkSize=u.LocalChunkSize),h.call(this,T);var S,O,U=typeof FileReader<"u";this.stream=function($){this._input=$,O=$.slice||$.webkitSlice||$.mozSlice,U?((S=new FileReader).onload=N(this._chunkLoaded,this),S.onerror=N(this._chunkError,this)):S=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var $=this._input,it=(this._config.chunkSize&&(it=Math.min(this._start+this._config.chunkSize,this._input.size),$=O.call($,this._start,it)),S.readAsText($,this._config.encoding));U||this._chunkLoaded({target:{result:it}})},this._chunkLoaded=function($){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk($.target.result)},this._chunkError=function(){this._sendError(S.error)}}function _(T){var S;h.call(this,T=T||{}),this.stream=function(O){return S=O,this._nextChunk()},this._nextChunk=function(){var O,U;if(!this._finished)return O=this._config.chunkSize,S=O?(U=S.substring(0,O),S.substring(O)):(U=S,""),this._finished=!S,this.parseChunk(U)}}function x(T){h.call(this,T=T||{});var S=[],O=!0,U=!1;this.pause=function(){h.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){h.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function($){this._input=$,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){U&&S.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),S.length?this.parseChunk(S.shift()):O=!0},this._streamData=N(function($){try{S.push(typeof $=="string"?$:$.toString(this._config.encoding)),O&&(O=!1,this._checkIsFinished(),this.parseChunk(S.shift()))}catch(it){this._streamError(it)}},this),this._streamError=N(function($){this._streamCleanUp(),this._sendError($)},this),this._streamEnd=N(function(){this._streamCleanUp(),U=!0,this._streamData("")},this),this._streamCleanUp=N(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function v(T){var S,O,U,$,it=Math.pow(2,53),at=-it,ot=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,q=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,J=this,rt=0,tt=0,G=!1,P=!1,W=[],j={data:[],errors:[],meta:{}};function pt(ft){return T.skipEmptyLines==="greedy"?ft.join("").trim()==="":ft.length===1&&ft[0].length===0}function lt(){if(j&&U&&(ht("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+u.DefaultDelimiter+"'"),U=!1),T.skipEmptyLines&&(j.data=j.data.filter(function(ut){return!pt(ut)})),et()){let ut=function(Lt){W.push(Lt)};if(j)if(Array.isArray(j.data[0])){for(var ft=0;et()&&ft<j.data.length;ft++)j.data[ft].forEach(ut);j.data.splice(0,1)}else j.data.forEach(ut)}function ct(ut,Lt){for(var zt=T.header?{}:[],vt=0;vt<ut.length;vt++){var Ct=vt,Dt=ut[vt],Dt=((ve,bt)=>(qt=>(T.dynamicTypingFunction&&T.dynamicTyping[qt]===void 0&&(T.dynamicTyping[qt]=T.dynamicTypingFunction(qt)),(T.dynamicTyping[qt]||T.dynamicTyping)===!0))(ve)?bt==="true"||bt==="TRUE"||bt!=="false"&&bt!=="FALSE"&&((qt=>{if(ot.test(qt)&&(qt=parseFloat(qt),at<qt&&qt<it))return 1})(bt)?parseFloat(bt):q.test(bt)?new Date(bt):bt===""?null:bt):bt)(Ct=T.header?vt>=W.length?"__parsed_extra":W[vt]:Ct,Dt=T.transform?T.transform(Dt,Ct):Dt);Ct==="__parsed_extra"?(zt[Ct]=zt[Ct]||[],zt[Ct].push(Dt)):zt[Ct]=Dt}return T.header&&(vt>W.length?ht("FieldMismatch","TooManyFields","Too many fields: expected "+W.length+" fields but parsed "+vt,tt+Lt):vt<W.length&&ht("FieldMismatch","TooFewFields","Too few fields: expected "+W.length+" fields but parsed "+vt,tt+Lt)),zt}var mt;j&&(T.header||T.dynamicTyping||T.transform)&&(mt=1,!j.data.length||Array.isArray(j.data[0])?(j.data=j.data.map(ct),mt=j.data.length):j.data=ct(j.data,0),T.header&&j.meta&&(j.meta.fields=W),tt+=mt)}function et(){return T.header&&W.length===0}function ht(ft,ct,mt,ut){ft={type:ft,code:ct,message:mt},ut!==void 0&&(ft.row=ut),j.errors.push(ft)}B(T.step)&&($=T.step,T.step=function(ft){j=ft,et()?lt():(lt(),j.data.length!==0&&(rt+=ft.data.length,T.preview&&rt>T.preview?O.abort():(j.data=j.data[0],$(j,J))))}),this.parse=function(ft,ct,mt){var ut=T.quoteChar||'"',ut=(T.newline||(T.newline=this.guessLineEndings(ft,ut)),U=!1,T.delimiter?B(T.delimiter)&&(T.delimiter=T.delimiter(ft),j.meta.delimiter=T.delimiter):((ut=((Lt,zt,vt,Ct,Dt)=>{var ve,bt,qt,Oe;Dt=Dt||[","," ","|",";",u.RECORD_SEP,u.UNIT_SEP];for(var Ae=0;Ae<Dt.length;Ae++){for(var oe,ln=Dt[Ae],Vt=0,Le=0,ie=0,Se=(qt=void 0,new C({comments:Ct,delimiter:ln,newline:zt,preview:10}).parse(Lt)),Re=0;Re<Se.data.length;Re++)vt&&pt(Se.data[Re])?ie++:(oe=Se.data[Re].length,Le+=oe,qt===void 0?qt=oe:0<oe&&(Vt+=Math.abs(oe-qt),qt=oe));0<Se.data.length&&(Le/=Se.data.length-ie),1.99<Le&&(bt===void 0||Vt<bt||Vt===bt&&Oe<Le)&&(bt=Vt,ve=ln,Oe=Le)}return{successful:!!(T.delimiter=ve),bestDelimiter:ve}})(ft,T.newline,T.skipEmptyLines,T.comments,T.delimitersToGuess)).successful?T.delimiter=ut.bestDelimiter:(U=!0,T.delimiter=u.DefaultDelimiter),j.meta.delimiter=T.delimiter),L(T));return ut.header=et(),T.preview&&T.header&&ut.preview++,S=ft,O=new C(ut),j=O.parse(S,ct,mt),lt(),G?{meta:{paused:!0}}:j||{meta:{paused:!1}}},this.paused=function(){return G},this.pause=function(){G=!0,O.abort(),S=B(T.chunk)?"":S.substring(O.getCharIndex())},this.resume=function(){J.streamer._halted?(G=!1,J.streamer.parseChunk(S,!0)):setTimeout(J.resume,3)},this.aborted=function(){return P},this.abort=function(){P=!0,O.abort(),j.meta.aborted=!0,B(T.complete)&&T.complete(j),S=""},this.guessLineEndings=function(Lt,ut){Lt=Lt.substring(0,1048576);var ut=new RegExp(M(ut)+"([^]*?)"+M(ut),"gm"),mt=(Lt=Lt.replace(ut,"")).split("\r"),ut=Lt.split(`
|
|
27
27
|
`),Lt=1<ut.length&&ut[0].length<mt[0].length;if(mt.length===1||Lt)return`
|
|
28
28
|
`;for(var zt=0,vt=0;vt<mt.length;vt++)mt[vt][0]===`
|
|
29
29
|
`&&zt++;return zt>=mt.length/2?`\r
|
|
@@ -32,5 +32,5 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
32
32
|
`&&(O=`
|
|
33
33
|
`);var tt=0,G=!1;this.parse=function(P,W,j){if(typeof P!="string")throw new Error("Input must be a string");var pt=P.length,lt=S.length,et=O.length,ht=U.length,ft=B($),ct=[],mt=[],ut=[],Lt=tt=0;if(!P)return Vt();if(at||at!==!1&&P.indexOf(J)===-1){for(var zt=P.split(O),vt=0;vt<zt.length;vt++){if(ut=zt[vt],tt+=ut.length,vt!==zt.length-1)tt+=O.length;else if(j)return Vt();if(!U||ut.substring(0,ht)!==U){if(ft){if(ct=[],Oe(ut.split(S)),Le(),G)return Vt()}else Oe(ut.split(S));if(it&&it<=vt)return ct=ct.slice(0,it),Vt(!0)}}return Vt()}for(var Ct=P.indexOf(S,tt),Dt=P.indexOf(O,tt),ve=new RegExp(M(rt)+M(J),"g"),bt=P.indexOf(J,tt);;)if(P[tt]===J)for(bt=tt,tt++;;){if((bt=P.indexOf(J,bt+1))===-1)return j||mt.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:ct.length,index:tt}),oe();if(bt===pt-1)return oe(P.substring(tt,bt).replace(ve,J));if(J===rt&&P[bt+1]===rt)bt++;else if(J===rt||bt===0||P[bt-1]!==rt){Ct!==-1&&Ct<bt+1&&(Ct=P.indexOf(S,bt+1));var qt=Ae((Dt=Dt!==-1&&Dt<bt+1?P.indexOf(O,bt+1):Dt)===-1?Ct:Math.min(Ct,Dt));if(P.substr(bt+1+qt,lt)===S){ut.push(P.substring(tt,bt).replace(ve,J)),P[tt=bt+1+qt+lt]!==J&&(bt=P.indexOf(J,tt)),Ct=P.indexOf(S,tt),Dt=P.indexOf(O,tt);break}if(qt=Ae(Dt),P.substring(bt+1+qt,bt+1+qt+et)===O){if(ut.push(P.substring(tt,bt).replace(ve,J)),ln(bt+1+qt+et),Ct=P.indexOf(S,tt),bt=P.indexOf(J,tt),ft&&(Le(),G))return Vt();if(it&&ct.length>=it)return Vt(!0);break}mt.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:ct.length,index:tt}),bt++}}else if(U&&ut.length===0&&P.substring(tt,tt+ht)===U){if(Dt===-1)return Vt();tt=Dt+et,Dt=P.indexOf(O,tt),Ct=P.indexOf(S,tt)}else if(Ct!==-1&&(Ct<Dt||Dt===-1))ut.push(P.substring(tt,Ct)),tt=Ct+lt,Ct=P.indexOf(S,tt);else{if(Dt===-1)break;if(ut.push(P.substring(tt,Dt)),ln(Dt+et),ft&&(Le(),G))return Vt();if(it&&ct.length>=it)return Vt(!0)}return oe();function Oe(ie){ct.push(ie),Lt=tt}function Ae(ie){var Se=0;return Se=ie!==-1&&(ie=P.substring(bt+1,ie))&&ie.trim()===""?ie.length:Se}function oe(ie){return j||(ie===void 0&&(ie=P.substring(tt)),ut.push(ie),tt=pt,Oe(ut),ft&&Le()),Vt()}function ln(ie){tt=ie,Oe(ut),ut=[],Dt=P.indexOf(O,tt)}function Vt(ie){if(T.header&&!W&&ct.length&&!q){var Se=ct[0],Re=Object.create(null),gn=new Set(Se);let zi=!1;for(let Dn=0;Dn<Se.length;Dn++){let Ye=d(Se[Dn]);if(Re[Ye=B(T.transformHeader)?T.transformHeader(Ye,Dn):Ye]){let In,ci=Re[Ye];for(;In=Ye+"_"+ci,ci++,gn.has(In););gn.add(In),Se[Dn]=In,Re[Ye]++,zi=!0,(ot=ot===null?{}:ot)[In]=Ye}else Re[Ye]=1,Se[Dn]=Ye;gn.add(Ye)}zi&&console.warn("Duplicate headers found and renamed."),q=!0}return{data:ct,errors:mt,meta:{delimiter:S,linebreak:O,aborted:G,truncated:!!ie,cursor:Lt+(W||0),renamedHeaders:ot}}}function Le(){$(Vt()),ct=[],mt=[]}},this.abort=function(){G=!0},this.getCharIndex=function(){return tt}}function R(T){var S=T.data,O=a[S.workerId],U=!1;if(S.error)O.userError(S.error,S.file);else if(S.results&&S.results.data){var $={abort:function(){U=!0,F(S.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:I,resume:I};if(B(O.userStep)){for(var it=0;it<S.results.data.length&&(O.userStep({data:S.results.data[it],errors:S.results.errors,meta:S.results.meta},$),!U);it++);delete S.results}else B(O.userChunk)&&(O.userChunk(S.results,$,S.file),delete S.results)}S.finished&&!U&&F(S.workerId,S.results)}function F(T,S){var O=a[T];B(O.userComplete)&&O.userComplete(S),O.terminate(),delete a[T]}function I(){throw new Error("Not implemented.")}function L(T){if(typeof T!="object"||T===null)return T;var S,O=Array.isArray(T)?[]:{};for(S in T)O[S]=L(T[S]);return O}function N(T,S){return function(){T.apply(S,arguments)}}function B(T){return typeof T=="function"}return u.parse=function(T,S){var O=(S=S||{}).dynamicTyping||!1;if(B(O)&&(S.dynamicTypingFunction=O,O={}),S.dynamicTyping=O,S.transform=!!B(S.transform)&&S.transform,S.downloadTimeout!==void 0){var O=parseInt(S.downloadTimeout);if(isNaN(O))throw new Error("Config downloadTimeout value ("+S.downloadTimeout+") not parsable by parseInt(val).");S.downloadTimeout=O}if(!S.worker||!u.WORKERS_SUPPORTED)return O=null,u.NODE_STREAM_INPUT,typeof T=="string"?(T=d(T),O=new(S.download?g:_)(S)):T.readable===!0&&B(T.read)&&B(T.on)?O=new x(S):(i.File&&T instanceof File||T instanceof Object)&&(O=new y(S)),O.stream(T);(O=(()=>{var U;return!!u.WORKERS_SUPPORTED&&(U=(()=>{var $=i.URL||i.webkitURL||null,it=e.toString();return u.BLOB_URL||(u.BLOB_URL=$.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",it,")();"],{type:"text/javascript"})))})(),(U=new i.Worker(U)).onmessage=R,U.id=l++,a[U.id]=U)})()).userStep=S.step,O.userChunk=S.chunk,O.userComplete=S.complete,O.userError=S.error,S.step=B(S.step),S.chunk=B(S.chunk),S.complete=B(S.complete),S.error=B(S.error),delete S.worker,O.postMessage({input:T,config:S,workerId:O.id})},u.unparse=function(T,S){var O=!1,U=!0,$=",",it=`\r
|
|
34
34
|
`,at='"',ot=at+at,q=!1,J=null,rt=!1,tt=((()=>{if(typeof S=="object"){if(typeof S.delimiter!="string"||u.BAD_DELIMITERS.filter(function(W){return S.delimiter.indexOf(W)!==-1}).length||($=S.delimiter),typeof S.quotes!="boolean"&&typeof S.quotes!="function"&&!Array.isArray(S.quotes)||(O=S.quotes),typeof S.skipEmptyLines!="boolean"&&typeof S.skipEmptyLines!="string"||(q=S.skipEmptyLines),typeof S.newline=="string"&&(it=S.newline),typeof S.quoteChar=="string"&&(at=S.quoteChar,ot=at+at),typeof S.header=="boolean"&&(U=S.header),Array.isArray(S.columns)){if(S.columns.length===0)throw new Error("Option columns is empty");J=S.columns}S.escapeChar!==void 0&&(ot=S.escapeChar+at),S.escapeFormulae instanceof RegExp?rt=S.escapeFormulae:typeof S.escapeFormulae=="boolean"&&S.escapeFormulae&&(rt=/^[=+\-@\t\r].*$/)}})(),new RegExp(M(at),"g"));if(typeof T=="string"&&(T=JSON.parse(T)),Array.isArray(T)){if(!T.length||Array.isArray(T[0]))return G(null,T,q);if(typeof T[0]=="object")return G(J||Object.keys(T[0]),T,q)}else if(typeof T=="object")return typeof T.data=="string"&&(T.data=JSON.parse(T.data)),Array.isArray(T.data)&&(T.fields||(T.fields=T.meta&&T.meta.fields||J),T.fields||(T.fields=Array.isArray(T.data[0])?T.fields:typeof T.data[0]=="object"?Object.keys(T.data[0]):[]),Array.isArray(T.data[0])||typeof T.data[0]=="object"||(T.data=[T.data])),G(T.fields||[],T.data||[],q);throw new Error("Unable to serialize unrecognized input");function G(W,j,pt){var lt="",et=(typeof W=="string"&&(W=JSON.parse(W)),typeof j=="string"&&(j=JSON.parse(j)),Array.isArray(W)&&0<W.length),ht=!Array.isArray(j[0]);if(et&&U){for(var ft=0;ft<W.length;ft++)0<ft&&(lt+=$),lt+=P(W[ft],ft);0<j.length&&(lt+=it)}for(var ct=0;ct<j.length;ct++){var mt=(et?W:j[ct]).length,ut=!1,Lt=et?Object.keys(j[ct]).length===0:j[ct].length===0;if(pt&&!et&&(ut=pt==="greedy"?j[ct].join("").trim()==="":j[ct].length===1&&j[ct][0].length===0),pt==="greedy"&&et){for(var zt=[],vt=0;vt<mt;vt++){var Ct=ht?W[vt]:vt;zt.push(j[ct][Ct])}ut=zt.join("").trim()===""}if(!ut){for(var Dt=0;Dt<mt;Dt++){0<Dt&&!Lt&&(lt+=$);var ve=et&&ht?W[Dt]:Dt;lt+=P(j[ct][ve],Dt)}ct<j.length-1&&(!pt||0<mt&&!Lt)&&(lt+=it)}}return lt}function P(W,j){var pt,lt,et;return W==null?"":W.constructor===Date?isNaN(W.getTime())?"":W.toISOString():(et=!1,rt&&typeof W=="string"&&rt.test(W)&&(W="'"+W,et=!0),lt=(pt=W.toString()).replace(tt,ot),(et=et||O===!0||typeof O=="function"&&O(W,j)||Array.isArray(O)&&O[j]||((ht,ft)=>{for(var ct=0;ct<ft.length;ct++)if(-1<ht.indexOf(ft[ct]))return!0;return!1})(lt,u.BAD_DELIMITERS)||-1<lt.indexOf($)||-1<pt.indexOf(at)||lt.charAt(0)===" "||lt.charAt(lt.length-1)===" ")?at+lt+at:lt)}},u.RECORD_SEP="",u.UNIT_SEP="",u.BYTE_ORDER_MARK="\uFEFF",u.BAD_DELIMITERS=["\r",`
|
|
35
|
-
`,'"',u.BYTE_ORDER_MARK],u.WORKERS_SUPPORTED=!r&&!!i.Worker,u.NODE_STREAM_INPUT=1,u.LocalChunkSize=10485760,u.RemoteChunkSize=5242880,u.DefaultDelimiter=",",u.Parser=C,u.ParserHandle=v,u.NetworkStreamer=g,u.FileStreamer=y,u.StringStreamer=_,u.ReadableStreamStreamer=x,s&&(i.onmessage=function(T){T=T.data,u.WORKER_ID===void 0&&T&&(u.WORKER_ID=T.workerId),typeof T.input=="string"?i.postMessage({workerId:u.WORKER_ID,results:u.parse(T.input,T.config),finished:!0}):(i.File&&T.input instanceof File||T.input instanceof Object)&&(T=u.parse(T.input,T.config))&&i.postMessage({workerId:u.WORKER_ID,results:T,finished:!0})}),(g.prototype=Object.create(h.prototype)).constructor=g,(y.prototype=Object.create(h.prototype)).constructor=y,(_.prototype=Object.create(_.prototype)).constructor=_,(x.prototype=Object.create(h.prototype)).constructor=x,u})})(fl)),fl.exports}var
|
|
36
|
-
`+h),i.encoding==="utf-8"&&(h="\uFEFF"+h),e("export-finished",i.filename),!i.testing){const g=new Blob([h],{type:"text/csv;charset="+i.encoding});
|
|
35
|
+
`,'"',u.BYTE_ORDER_MARK],u.WORKERS_SUPPORTED=!r&&!!i.Worker,u.NODE_STREAM_INPUT=1,u.LocalChunkSize=10485760,u.RemoteChunkSize=5242880,u.DefaultDelimiter=",",u.Parser=C,u.ParserHandle=v,u.NetworkStreamer=g,u.FileStreamer=y,u.StringStreamer=_,u.ReadableStreamStreamer=x,s&&(i.onmessage=function(T){T=T.data,u.WORKER_ID===void 0&&T&&(u.WORKER_ID=T.workerId),typeof T.input=="string"?i.postMessage({workerId:u.WORKER_ID,results:u.parse(T.input,T.config),finished:!0}):(i.File&&T.input instanceof File||T.input instanceof Object)&&(T=u.parse(T.input,T.config))&&i.postMessage({workerId:u.WORKER_ID,results:T,finished:!0})}),(g.prototype=Object.create(h.prototype)).constructor=g,(y.prototype=Object.create(h.prototype)).constructor=y,(_.prototype=Object.create(_.prototype)).constructor=_,(x.prototype=Object.create(h.prototype)).constructor=x,u})})(fl)),fl.exports}var iL=nL();const rL=["id"],sL=p.defineComponent({__name:"VueJsonCsv",props:{data:{type:Array,required:!0},fields:{type:Array,required:!1,default:null},labels:{type:Object,required:!1,default:null},filename:{type:String,default:"report-data.csv"},delimiter:{type:String,default:",",required:!1},separatorExcel:{type:Boolean,default:!1},encoding:{type:String,default:"utf-8"},testing:{type:Boolean,required:!1,default:!1}},emits:["export-started","export-finished"],setup(n,{emit:t}){const e=t,i=n,r=p.computed(()=>`export_${new Date().getTime()}`),s=p.computed(()=>{const h=u();return h.length?h:null}),a=()=>{const h=i.labels;if(typeof i.fields!==pr.Object)throw new Error("Labels needs to be a object containing key / value pairs.");return typeof h===pr.Object?g=>O_.mapKeys(g,(y,_)=>h[_]||_):g=>g},l=()=>{const h=i.fields;if(typeof i.fields!==pr.Object&&!Array.isArray(h))throw new Error("Fields needs to be an array of strings.");return Array.isArray(h)?g=>O_.pick(g,h):g=>g},u=()=>{if(typeof i.fields===pr.Undefined&&typeof i.labels===pr.Undefined)return i.data;const h=a(),g=l();return i.data.map(y=>h(g(y)))},d=()=>{if(!s?.value){console.warn("No data to export");return}e("export-started",s.value);let h=iL.unparse(s.value,Object.assign({delimiter:i.delimiter,encoding:i.encoding}));if(i.separatorExcel&&(h="SEP="+i.delimiter+`\r
|
|
36
|
+
`+h),i.encoding==="utf-8"&&(h="\uFEFF"+h),e("export-finished",i.filename),!i.testing){const g=new Blob([h],{type:"text/csv;charset="+i.encoding});tL.saveAs(g,i.filename)}};return(h,g)=>(p.openBlock(),p.createElementBlock("div",{id:r.value,"data-testid":"export-csv",onClick:d},[p.renderSlot(h.$slots,"default",{},()=>[p.createTextVNode("Download "+p.toDisplayString(n.filename),1)])],8,rL))}}),oL=p.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(n){const t=n,e=p.computed(()=>Object.keys(t.headers));return(i,r)=>(p.openBlock(),p.createElementBlock("div",null,[p.createVNode(sL,{data:n.rows,fields:e.value,filename:n.filename,labels:n.headers},{default:p.withCtx(()=>[p.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),aL={class:"kong-ui-public-csv-export-modal"},lL={key:0,class:"selected-range"},cL={key:4,class:"text-muted",tag:"span"},E_=3,uL=p.defineComponent({__name:"CsvExportModal",props:{exportState:{},filename:{},modalDescription:{default:void 0}},emits:["closeModal"],setup(n,{emit:t}){const{i18n:e}=kt.useI18n(),i=n,r=t,s=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,a=p.ref(1),l=p.computed(()=>y.value.rows.length),u=p.computed(()=>i.exportState.status==="success"&&!!i.exportState.chartData?.data?.length),d=p.computed(()=>i.exportState.status!=="success"?"":kt.useChartSelectedRange(p.toRef(i.exportState,"chartData"))),h=p.computed(()=>i.exportState.status!=="success"?"":e.t("csvExport.previewRows",{rowsMax:Math.min(E_,l.value),rowsTotal:l.value,plural:l.value===1?"":"s"})),g=()=>{r("closeModal")},y=p.computed(()=>{if(i.exportState.status!=="success"||!u.value||!i.exportState.chartData?.meta.metric_names)return{headers:[],rows:[],csvHeaders:{}};const x=i.exportState.chartData,v=x.data.some(L=>L.timestamp!==x.data[0].timestamp),M=x.data.map(L=>{const N=new Date(L.timestamp);return{...Object.keys(L.event).reduce((T,S)=>{if(S in x.meta.display){const O=L.event[S],U=x.meta.display[S];T[S]=O&&U&&U[O].name||L.event[S]}else T[S]=L.event[S];return T},{}),...v?{timestamp:Hu(N,"yyyy-MM-dd HH:mm:ss"),tzOffset:Hu(N,"XXX")}:{}}});let C=[];v&&(C=[{label:e.t("csvExport.Timestamp"),key:"timestamp"},{label:e.t("csvExport.UtcOffset"),key:"tzOffset"}]);const R="display"in i.exportState.chartData.meta&&i.exportState.chartData.meta?.display?i.exportState.chartData.meta?.display:{},F=[...C,...Object.keys(R).map(L=>({label:e.t(`chartLabels.${L}`),key:L})),...i.exportState.chartData.meta.metric_names.map(L=>({label:e.t(`chartLabels.${L}`),key:L}))],I=F.reduce((L,N)=>(L[N.key]=N.label,L),{});return{headers:F,csvHeaders:I,rows:M}}),_=async()=>{if(i.exportState.status!=="success")return{total:0,data:[]};const{rows:x}=y.value;return{total:Number(x.length)||0,data:x.slice(0,E_)}};return p.watch(y,()=>{a.value++}),(x,v)=>{const M=p.resolveComponent("KSkeleton"),C=p.resolveComponent("KEmptyState"),R=p.resolveComponent("KTableData"),F=p.resolveComponent("KTooltip"),I=p.resolveComponent("KButton"),L=p.resolveComponent("KModal");return p.openBlock(),p.createElementBlock("div",aL,[p.createVNode(L,{class:"vitals-report","data-testid":"csv-export-modal","show-dismiss-icon":"",title:p.unref(e).t("csvExport.exportPreview"),visible:"",onCancel:g,onKeyup:p.withKeys(g,["esc"])},{default:p.withCtx(()=>[p.createElementVNode("div",null,[n.exportState.status==="success"&&u.value?(p.openBlock(),p.createElementBlock("div",lL,[p.createElementVNode("p",null,p.toDisplayString(n.modalDescription?n.modalDescription:p.unref(e).t("csvExport.exportDescription")),1),p.createElementVNode("p",null,p.toDisplayString(p.unref(e).t("csvExport.exportTimeRange"))+": "+p.toDisplayString(d.value),1)])):p.createCommentVNode("",!0),n.exportState.status==="loading"?(p.openBlock(),p.createBlock(M,{key:1,class:"chart-skeleton",type:"table"})):n.exportState.status==="success"?(p.openBlock(),p.createBlock(R,{key:2,class:"vitals-table",fetcher:_,"fetcher-cache-key":String(a.value),headers:y.value?.headers||[],"hide-pagination":"","row-hover":!1,sortable:!1},{"empty-state":p.withCtx(()=>[p.createVNode(C,{"action-button-visible":!1},{title:p.withCtx(()=>[p.createElementVNode("h5",null,p.toDisplayString(p.unref(e).t("csvExport.noDataRange")),1)]),default:p.withCtx(()=>[p.createElementVNode("p",null,p.toDisplayString(p.unref(e).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"])):n.exportState.status==="error"?(p.openBlock(),p.createBlock(C,{key:3,"action-button-visible":!1},{title:p.withCtx(()=>[p.createElementVNode("h5",null,p.toDisplayString(p.unref(e).t("csvExport.dataError")),1)]),_:1})):p.createCommentVNode("",!0),n.exportState.status==="success"&&u.value?(p.openBlock(),p.createElementBlock("div",cL,[p.createTextVNode(p.toDisplayString(h.value)+" ",1),p.createVNode(F,{class:"preview-tooltip",placement:"right",text:p.unref(e).t("csvExport.maximumRecordAmount",{value:p.unref(1e3)})},{default:p.withCtx(()=>[p.createVNode(p.unref(Ss.InfoIcon),{color:`var(--kui-color-text-neutral, ${p.unref(kc)})`,size:`var(--kui-icon-size-30, ${p.unref(Os)})`},null,8,["color","size"])]),_:1},8,["text"])])):p.createCommentVNode("",!0)])]),"footer-actions":p.withCtx(()=>[p.createVNode(I,{appearance:"tertiary",class:"cancel-btn",onClick:g},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(p.unref(e).t("csvExport.cancelButton")),1)]),_:1}),p.createVNode(oL,{class:"vitals-report-export-button",filename:s,headers:y.value.csvHeaders,rows:y.value.rows},{default:p.withCtx(()=>[p.createVNode(I,{appearance:"primary","data-testid":"csv-download-button",disabled:n.exportState.status!=="success"||!u.value},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(p.unref(e).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}});Kt.AnalyticsChart=_I,Kt.ChartLegendPosition=Pe,Kt.CsvExportModal=uL,Kt.DECIMAL_DISPLAY=wR,Kt.FONT_SIZE_REGULAR=ey,Kt.FONT_SIZE_SMALL=ty,Kt.MAX_LABEL_LENGTH=Xa,Kt.SimpleChart=II,Kt.SparklineChart=KI,Kt.TopNTable=YI,Kt.ValidType=pr,Kt.chartTypes=wE,Kt.exploreResultToScatterData=vy,Kt.handleQueryError=pE,Kt.isCancellationError=xy,Kt.isScatterChartData=Ja,Kt.lookupStatusCodeColor=iy,Kt.simpleChartMetricDisplay=xE,Kt.simpleChartTypes=vE,Kt.statusCodeBadgeBackgroundColor=TR,Object.defineProperty(Kt,Symbol.toStringTag,{value:"Module"})}));
|