@kong-ui-public/analytics-chart 10.35.0 → 10.36.0
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/style.css +1 -1
- package/dist/types/components/TopNTable.vue.d.ts +1 -1
- package/dist/types/components/TopNTable.vue.d.ts.map +1 -1
- package/dist/types/components/top-talkers/TopTalkersCell.vue.d.ts +8 -0
- package/dist/types/components/top-talkers/TopTalkersCell.vue.d.ts.map +1 -0
- package/dist/types/components/top-talkers/TopTalkersColumn.vue.d.ts +14 -0
- package/dist/types/components/top-talkers/TopTalkersColumn.vue.d.ts.map +1 -0
- package/dist/types/components/top-talkers/TopTalkersGrid.vue.d.ts +42 -0
- package/dist/types/components/top-talkers/TopTalkersGrid.vue.d.ts.map +1 -0
- package/dist/types/composables/index.d.ts +2 -0
- package/dist/types/composables/index.d.ts.map +1 -1
- package/dist/types/composables/useTopTalkersData.d.ts +10 -0
- package/dist/types/composables/useTopTalkersData.d.ts.map +1 -0
- package/dist/types/constants/index.d.ts +4 -0
- package/dist/types/constants/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +6 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/index.d.ts.map +1 -1
- package/dist/types/types/top-talkers.d.ts +35 -0
- package/dist/types/types/top-talkers.d.ts.map +1 -0
- package/dist/vitals-chart.es.js +8621 -8346
- package/dist/vitals-chart.umd.js +26 -26
- package/package.json +3 -3
package/dist/vitals-chart.umd.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
(function($t,h){typeof exports=="object"&&typeof module<"u"?h(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"],h):($t=typeof globalThis<"u"?globalThis:$t||self,h($t["kong-ui-publicvitals-chart"]={},$t.Vue,$t.KongIcons,$t["kong-ui-public-i18n"],$t["kong-ui-public-analytics-metric-provider"]))})(this,(function($t,h,fe,eh,tr){"use strict";var bt=(e=>(e.FIFTEEN_MIN="15m",e.ONE_HOUR="1h",e.SIX_HOUR="6h",e.TWELVE_HOUR="12h",e.ONE_DAY="24h",e.SEVEN_DAY="7d",e.THIRTY_DAY="30d",e.NINETY_DAY="90d",e.ONE_HUNDRED_EIGHTY_DAY="180d",e.ONE_YEAR="365d",e.CURRENT_WEEK="current_week",e.CURRENT_MONTH="current_month",e.CURRENT_QUARTER="current_quarter",e.CURRENT_YEAR="current_year",e.PREVIOUS_WEEK="previous_week",e.PREVIOUS_MONTH="previous_month",e.PREVIOUS_QUARTER="previous_quarter",e.PREVIOUS_YEAR="previous_year",e))(bt||{});const rx=["in","not_in","selector"],sx=["empty","not_empty"],ox=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],er=e=>e.filter(t=>t!=="time"),nh=["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"],ih=er(nh),ax=["active_services","error_rate","request_count","request_per_minute","response_latency_average"],rh=[...nh,"ai_gateway","ai_gateway_consumer","ai_gateway_consumer_group","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"],sh=er(rh),lx=[...ax,"share_of_requests","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"],cx=["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"],oh=er(cx),ux=["a2a_context_id","a2a_error","a2a_method","a2a_task_id","a2a_task_state","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"],dx=er(ux),fx=["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"],hx=fx,px=["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"],mx=er(px),gx=["platform","platform_usage"],yx=e=>gx.includes(e),_x=[...rh.filter(e=>e!=="consumer_group"),"a2a_context_id","a2a_error","a2a_method","a2a_task_id","a2a_task_state","ai_gateway_agent","ai_gateway_mcp_server","mcp_error","mcp_method","mcp_session_id","mcp_tool_name"],ah=er(_x);[...lx];const bx=["control_plane","data_plane_group","managed_cache","network","provider","provider_region","time"],lh=er(bx);new Set(ih),new Set(sh),new Set(oh),new Set(ah),new Set(lh);const ch=[{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"}];ch.map(e=>e.code);const uh=e=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",...e?{enum:e}:{}},operator:{type:"string",enum:rx},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",...e?{enum:e}:{}},operator:{type:"string",enum:sx}},required:["field","operator"],additionalProperties:!1}]}}),xx=["control_plane","gateway_service","realm","route","plugin","plugin_name","plugin_scope","data_plane_node_version","env","team","region","hostname"];uh(Array.from(new Set([...dx,...hx,...mx]))),uh([...new Set([...sh,...ih,...oh,...ah,...xx,...lh])]);const wx={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"}},vx=(e,t,n)=>{let i;const r=wx[e];return typeof r=="string"?i=r:t===1?i=r.one:i=r.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function xc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Sx={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Tx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Mx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},kx={date:xc({formats:Sx,defaultWidth:"full"}),time:xc({formats:Tx,defaultWidth:"full"}),dateTime:xc({formats:Mx,defaultWidth:"full"})},Dx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Cx=(e,t,n,i)=>Dx[e];function Ds(e){return(t,n)=>{const i=n?.context?String(n.context):"standalone";let r;if(i==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,l=n?.width?String(n.width):a;r=e.formattingValues[l]||e.formattingValues[a]}else{const a=e.defaultWidth,l=n?.width?String(n.width):e.defaultWidth;r=e.values[l]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return r[s]}}const Ax={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ox={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Rx={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"]},Ex={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"}},Ix={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"}},Lx=(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Nx={ordinalNumber:Lx,era:Ds({values:Ax,defaultWidth:"wide"}),quarter:Ds({values:Ox,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Ds({values:Rx,defaultWidth:"wide"}),day:Ds({values:Ex,defaultWidth:"wide"}),dayPeriod:Ds({values:Px,defaultWidth:"wide",formattingValues:Ix,defaultFormattingWidth:"wide"})};function Cs(e){return(t,n={})=>{const i=n.width,r=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],s=t.match(r);if(!s)return null;const a=s[0],l=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(l)?Fx(l,m=>m.test(a)):Bx(l,m=>m.test(a));let d;d=e.valueCallback?e.valueCallback(u):u,d=n.valueCallback?n.valueCallback(d):d;const f=t.slice(a.length);return{value:d,rest:f}}}function Bx(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Fx(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function zx(e){return(t,n={})=>{const i=t.match(e.matchPattern);if(!i)return null;const r=i[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const l=t.slice(r.length);return{value:a,rest:l}}}const Ux=/^(\d+)(th|st|nd|rd)?/i,Hx=/\d+/i,Wx={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]},Vx={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Yx={any:[/1/i,/2/i,/3/i,/4/i]},qx={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},jx={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]},Gx={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},Kx={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]},Xx={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},Zx={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}},Qx={ordinalNumber:zx({matchPattern:Ux,parsePattern:Hx,valueCallback:e=>parseInt(e,10)}),era:Cs({matchPatterns:Wx,defaultMatchWidth:"wide",parsePatterns:$x,defaultParseWidth:"any"}),quarter:Cs({matchPatterns:Vx,defaultMatchWidth:"wide",parsePatterns:Yx,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Cs({matchPatterns:qx,defaultMatchWidth:"wide",parsePatterns:jx,defaultParseWidth:"any"}),day:Cs({matchPatterns:Gx,defaultMatchWidth:"wide",parsePatterns:Kx,defaultParseWidth:"any"}),dayPeriod:Cs({matchPatterns:Xx,defaultMatchWidth:"any",parsePatterns:Zx,defaultParseWidth:"any"})},Jx={code:"en-US",formatDistance:vx,formatLong:kx,formatRelative:Cx,localize:Nx,match:Qx,options:{weekStartsOn:0,firstWeekContainsDate:1}};let tw={};function As(){return tw}const dh=6048e5,ew=864e5,nw=60,iw=3600,fh=Symbol.for("constructDateFrom");function Tn(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&fh in e?e[fh](t):e instanceof Date?new e.constructor(t):new Date(t)}function Ue(e,t){return Tn(t||e,e)}function hh(e){const t=Ue(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function rw(e,...t){const n=Tn.bind(null,t.find(i=>typeof i=="object"));return t.map(n)}function Ir(e,t){const n=Ue(e,t?.in);return n.setHours(0,0,0,0),n}function sw(e,t,n){const[i,r]=rw(n?.in,e,t),s=Ir(i),a=Ir(r),l=+s-hh(s),u=+a-hh(a);return Math.round((l-u)/ew)}function ow(e,t){const n=Ue(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function aw(e,t){const n=Ue(e,t?.in);return sw(n,ow(n))+1}function ei(e,t){const n=As(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=Ue(e,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 Jo(e,t){return ei(e,{...t,weekStartsOn:1})}function ph(e,t){const n=Ue(e,t?.in),i=n.getFullYear(),r=Tn(n,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=Jo(r),a=Tn(n,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=Jo(a);return n.getTime()>=s.getTime()?i+1:n.getTime()>=l.getTime()?i:i-1}function lw(e,t){const n=ph(e,t),i=Tn(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),Jo(i)}function cw(e,t){const n=Ue(e,t?.in),i=+Jo(n)-+lw(n);return Math.round(i/dh)+1}function mh(e,t){const n=Ue(e,t?.in),i=n.getFullYear(),r=As(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=Tn(t?.in||e,0);a.setFullYear(i+1,0,s),a.setHours(0,0,0,0);const l=ei(a,t),u=Tn(t?.in||e,0);u.setFullYear(i,0,s),u.setHours(0,0,0,0);const d=ei(u,t);return+n>=+l?i+1:+n>=+d?i:i-1}function uw(e,t){const n=As(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=mh(e,t),s=Tn(t?.in||e,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),ei(s,t)}function dw(e,t){const n=Ue(e,t?.in),i=+ei(n,t)-+uw(n,t);return Math.round(i/dh)+1}function Zt(e,t){const n=e<0?"-":"",i=Math.abs(e).toString().padStart(t,"0");return n+i}const Si={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return Zt(t==="yy"?i%100:i,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Zt(n+1,2)},d(e,t){return Zt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Zt(e.getHours()%12||12,t.length)},H(e,t){return Zt(e.getHours(),t.length)},m(e,t){return Zt(e.getMinutes(),t.length)},s(e,t){return Zt(e.getSeconds(),t.length)},S(e,t){const n=t.length,i=e.getMilliseconds(),r=Math.trunc(i*Math.pow(10,n-3));return Zt(r,t.length)}},Lr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},gh={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const i=e.getFullYear(),r=i>0?i:1-i;return n.ordinalNumber(r,{unit:"year"})}return Si.y(e,t)},Y:function(e,t,n,i){const r=mh(e,i),s=r>0?r:1-r;if(t==="YY"){const a=s%100;return Zt(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Zt(s,t.length)},R:function(e,t){const n=ph(e);return Zt(n,t.length)},u:function(e,t){const n=e.getFullYear();return Zt(n,t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Zt(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Zt(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return Si.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return Zt(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const r=dw(e,i);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):Zt(r,t.length)},I:function(e,t,n){const i=cw(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):Zt(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Si.d(e,t)},D:function(e,t,n){const i=aw(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):Zt(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const r=e.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Zt(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const r=e.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 n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),r=i===0?7:i;switch(t){case"i":return String(r);case"ii":return Zt(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let r;switch(i===12?r=Lr.noon:i===0?r=Lr.midnight:r=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let r;switch(i>=17?r=Lr.evening:i>=12?r=Lr.afternoon:i>=4?r=Lr.morning:r=Lr.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let i=e.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Si.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Si.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):Zt(i,t.length)},k:function(e,t,n){let i=e.getHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):Zt(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Si.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Si.s(e,t)},S:function(e,t){return Si.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return _h(i);case"XXXX":case"XX":return nr(i);default:return nr(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return _h(i);case"xxxx":case"xx":return nr(i);default:return nr(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+yh(i,":");default:return"GMT"+nr(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+yh(i,":");default:return"GMT"+nr(i,":")}},t:function(e,t,n){const i=Math.trunc(+e/1e3);return Zt(i,t.length)},T:function(e,t,n){return Zt(+e,t.length)}};function yh(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Math.trunc(i/60),s=i%60;return s===0?n+String(r):n+String(r)+t+Zt(s,2)}function _h(e,t){return e%60===0?(e>0?"-":"+")+Zt(Math.abs(e)/60,2):nr(e,t)}function nr(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Zt(Math.trunc(i/60),2),s=Zt(i%60,2);return n+r+t+s}const bh=(e,t)=>{switch(e){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"})}},xh=(e,t)=>{switch(e){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"})}},fw=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return bh(e,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}}",bh(i,t)).replace("{{time}}",xh(r,t))},hw={p:xh,P:fw},pw=/^D+$/,mw=/^Y+$/,gw=["D","DD","YY","YYYY"];function yw(e){return pw.test(e)}function _w(e){return mw.test(e)}function bw(e,t,n){const i=xw(e,t,n);if(console.warn(i),gw.includes(e))throw new RangeError(i)}function xw(e,t,n){const i=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function ww(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function vw(e){return!(!ww(e)&&typeof e!="number"||isNaN(+Ue(e)))}const Sw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Tw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Mw=/^'([^]*?)'?$/,kw=/''/g,Dw=/[a-zA-Z]/;function Cw(e,t,n){const i=As(),r=n?.locale??i.locale??Jx,s=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,l=Ue(e,n?.in);if(!vw(l))throw new RangeError("Invalid time value");let u=t.match(Tw).map(f=>{const m=f[0];if(m==="p"||m==="P"){const g=hw[m];return g(f,r.formatLong)}return f}).join("").match(Sw).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const m=f[0];if(m==="'")return{isToken:!1,value:Aw(f)};if(gh[m])return{isToken:!0,value:f};if(m.match(Dw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:f}});r.localize.preprocessor&&(u=r.localize.preprocessor(l,u));const d={firstWeekContainsDate:s,weekStartsOn:a,locale:r};return u.map(f=>{if(!f.isToken)return f.value;const m=f.value;(!n?.useAdditionalWeekYearTokens&&_w(m)||!n?.useAdditionalDayOfYearTokens&&yw(m))&&bw(m,t,String(e));const g=gh[m[0]];return g(l,m,r.localize,d)}).join("")}function Aw(e){const t=e.match(Mw);return t?t[1].replace(kw,"'"):e}function ta(e,t,n){const i=Ue(e,n?.in);return isNaN(t)?Tn(e,NaN):(i.setDate(i.getDate()+t),i)}function wh(e,t,n){const i=Ue(e,n?.in);if(isNaN(t))return Tn(e,NaN);if(!t)return i;const r=i.getDate(),s=Tn(e,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 Ow(e,t,n){return wh(e,t*3,n)}function Nr(e,t){const n=Ue(e,t?.in),i=n.getMonth(),r=i-i%3;return n.setMonth(r,1),n.setHours(0,0,0,0),n}function Br(e,t){const n=Ue(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function Rw(e,t){const n=Ue(e,t?.in),i=n.getFullYear(),r=n.getMonth(),s=Tn(n,0);return s.setFullYear(i,r+1,0),s.setHours(0,0,0,0),s.getDate()}function Ew(){return Object.assign({},As())}function vh(e){return Math.trunc(e*iw)}function Pw(e){const t=e/nw;return Math.trunc(t)}function Sh(e,t,n){return wh(e,-1,n)}function Th(e,t,n){return Ow(e,-1,n)}function Mh(e,t,n){const i=Ew(),r=Nw(e,n.timeZone,n.locale??i.locale);return"formatToParts"in r?Iw(r,t):Lw(r,t)}function Iw(e,t){const n=e.formatToParts(t);for(let i=n.length-1;i>=0;--i)if(n[i].type==="timeZoneName")return n[i].value}function Lw(e,t){const n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}function Nw(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function Bw(e,t){const n=Ww(t);return"formatToParts"in n?zw(n,e):Uw(n,e)}const Fw={year:0,month:1,day:2,hour:3,minute:4,second:5};function zw(e,t){try{const n=e.formatToParts(t),i=[];for(let r=0;r<n.length;r++){const s=Fw[n[r].type];s!==void 0&&(i[s]=parseInt(n[r].value,10))}return i}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function Uw(e,t){const n=e.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);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 wc={},kh=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")),Hw=kh==="06/25/2014, 00:00:00"||kh==="06/25/2014 00:00:00";function Ww(e){return wc[e]||(wc[e]=Hw?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),wc[e]}function vc(e,t,n,i,r,s,a){const l=new Date(0);return l.setUTCFullYear(e,t,n),l.setUTCHours(i,r,s,a),l}const Dh=36e5,$w=6e4,Sc={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Os(e,t,n){if(!e)return 0;let i=Sc.timezoneZ.exec(e);if(i)return 0;let r,s;if(i=Sc.timezoneHH.exec(e),i)return r=parseInt(i[1],10),Ch(r)?-(r*Dh):NaN;if(i=Sc.timezoneHHMM.exec(e),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return Ch(r,a)?(s=Math.abs(r)*Dh+a*$w,i[1]==="+"?-s:s):NaN}if(qw(e)){t=new Date(t||Date.now());const a=n?t:Vw(t),l=Tc(a,e);return-(n?l:Yw(t,l,e))}return NaN}function Vw(e){return vc(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function Tc(e,t){const n=Bw(e,t),i=vc(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let r=e.getTime();const s=r%1e3;return r-=s>=0?s:1e3+s,i-r}function Yw(e,t,n){let i=e.getTime()-t;const r=Tc(new Date(i),n);if(t===r)return t;i-=r-t;const s=Tc(new Date(i),n);return r===s?r:Math.max(r,s)}function Ch(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const Ah={};function qw(e){if(Ah[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Ah[e]=!0,!0}catch{return!1}}const jw=60*1e3,Gw={X:function(e,t,n){const i=Mc(n.timeZone,e);if(i===0)return"Z";switch(t){case"X":return Oh(i);case"XXXX":case"XX":return Fr(i);default:return Fr(i,":")}},x:function(e,t,n){const i=Mc(n.timeZone,e);switch(t){case"x":return Oh(i);case"xxxx":case"xx":return Fr(i);default:return Fr(i,":")}},O:function(e,t,n){const i=Mc(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+Kw(i,":");default:return"GMT"+Fr(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return Mh("short",e,n);default:return Mh("long",e,n)}}};function Mc(e,t){const n=e?Os(e,t,!0)/jw:t?.getTimezoneOffset()??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function ea(e,t){const n=e<0?"-":"";let i=Math.abs(e).toString();for(;i.length<t;)i="0"+i;return n+i}function Fr(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=ea(Math.floor(i/60),2),s=ea(Math.floor(i%60),2);return n+r+t+s}function Oh(e,t){return e%60===0?(e>0?"-":"+")+ea(Math.abs(e)/60,2):Fr(e,t)}function Kw(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Math.floor(i/60),s=i%60;return s===0?n+String(r):n+String(r)+t+ea(s,2)}function Rh(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const Eh=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,kc=36e5,Ph=6e4,Xw=2,Ze={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:Eh};function na(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const n=t.additionalDigits==null?Xw:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const i=Zw(e),{year:r,restDateString:s}=Qw(i.date,n),a=Jw(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=tv(i.time),u===null||isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(d=Os(i.timeZone||t.timeZone,new Date(l+u)),isNaN(d))return new Date(NaN)}else d=Rh(new Date(l+u)),d=Rh(new Date(l+u+d));return new Date(l+u+d)}else return new Date(NaN)}function Zw(e){const t={};let n=Ze.dateTimePattern.exec(e),i;if(n?(t.date=n[1],i=n[3]):(n=Ze.datePattern.exec(e),n?(t.date=n[1],i=n[2]):(t.date=null,i=e)),i){const r=Ze.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function Qw(e,t){if(e){const n=Ze.YYY[t],i=Ze.YYYYY[t];let r=Ze.YYYY.exec(e)||i.exec(e);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:e.slice(s.length)}}if(r=Ze.YY.exec(e)||n.exec(e),r){const s=r[1];return{year:parseInt(s,10)*100,restDateString:e.slice(s.length)}}}return{year:null}}function Jw(e,t){if(t===null)return null;let n,i,r;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let s=Ze.MM.exec(e);if(s)return n=new Date(0),i=parseInt(s[1],10)-1,Nh(t,i)?(n.setUTCFullYear(t,i),n):new Date(NaN);if(s=Ze.DDD.exec(e),s){n=new Date(0);const a=parseInt(s[1],10);return iv(t,a)?(n.setUTCFullYear(t,0,a),n):new Date(NaN)}if(s=Ze.MMDD.exec(e),s){n=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return Nh(t,i,a)?(n.setUTCFullYear(t,i,a),n):new Date(NaN)}if(s=Ze.Www.exec(e),s)return r=parseInt(s[1],10)-1,Bh(r)?Ih(t,r):new Date(NaN);if(s=Ze.WwwD.exec(e),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return Bh(r,a)?Ih(t,r,a):new Date(NaN)}return null}function tv(e){let t,n,i=Ze.HH.exec(e);if(i)return t=parseFloat(i[1].replace(",",".")),Dc(t)?t%24*kc:NaN;if(i=Ze.HHMM.exec(e),i)return t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),Dc(t,n)?t%24*kc+n*Ph:NaN;if(i=Ze.HHMMSS.exec(e),i){t=parseInt(i[1],10),n=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return Dc(t,n,r)?t%24*kc+n*Ph+r*1e3:NaN}return null}function Ih(e,t,n){t=t||0,n=n||0;const i=new Date(0);i.setUTCFullYear(e,0,4);const r=i.getUTCDay()||7,s=t*7+n+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const ev=[31,28,31,30,31,30,31,31,30,31,30,31],nv=[31,29,31,30,31,30,31,31,30,31,30,31];function Lh(e){return e%400===0||e%4===0&&e%100!==0}function Nh(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const i=Lh(e);if(i&&n>nv[t]||!i&&n>ev[t])return!1}return!0}function iv(e,t){if(t<1)return!1;const n=Lh(e);return!(n&&t>366||!n&&t>365)}function Bh(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function Dc(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const rv=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function sv(e,t,n={}){t=String(t);const i=t.match(rv);if(i){const r=na(n.originalDate||e,n);t=i.reduce(function(s,a){if(a[0]==="'")return s;const l=s.indexOf(a),u=s[l-1]==="'",d=s.replace(a,"'"+Gw[a[0]](r,a,n)+"'");return u?d.substring(0,l-1)+d.substring(l+1):d},t)}return Cw(e,t,n)}function Fh(e,t,n){e=na(e,n);const i=Os(t,e,!0),r=new Date(e.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 zh(e,t,n,i){return i={...i,timeZone:t,originalDate:e},sv(Fh(e,t,{timeZone:i.timeZone}),n,i)}function ov(e,t,n){if(typeof e=="string"&&!e.match(Eh))return na(e,{...n,timeZone:t});e=na(e,n);const i=vc(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),r=Os(t,new Date(i));return new Date(i+r)}function av(e,t){return-Os(e,t)}function Uh(e,t={}){const n=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)"),zh(e,n,i)}function lv(e,t={}){if(!e)return e;const n=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(e);return zh(r,n,i)}catch{return console.error("Invalid value passed to formatTime",e),"(invalid date)"}}const cv={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 ia(e){return e&&ox.find(t=>e<=cv[t])||null}var ra=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},sa={exports:{}};sa.exports;var Hh;function uv(){return Hh||(Hh=1,(function(e,t){var n=200,i="__lodash_hash_undefined__",r=9007199254740991,s="[object Arguments]",a="[object Array]",l="[object Boolean]",u="[object Date]",d="[object Error]",f="[object Function]",m="[object GeneratorFunction]",g="[object Map]",_="[object Number]",x="[object Object]",v="[object Promise]",S="[object RegExp]",C="[object Set]",O="[object String]",B="[object Symbol]",I="[object WeakMap]",N="[object ArrayBuffer]",W="[object DataView]",U="[object Float32Array]",D="[object Float64Array]",w="[object Int8Array]",A="[object Int16Array]",L="[object Int32Array]",$="[object Uint8Array]",q="[object Uint8ClampedArray]",st="[object Uint16Array]",ct="[object Uint32Array]",ht=/[\\^$.*+?()[\]{}|]/g,ut=/\w*$/,vt=/^\[object .+?Constructor\]$/,at=/^(?:0|[1-9]\d*)$/,dt={};dt[s]=dt[a]=dt[N]=dt[W]=dt[l]=dt[u]=dt[U]=dt[D]=dt[w]=dt[A]=dt[L]=dt[g]=dt[_]=dt[x]=dt[S]=dt[C]=dt[O]=dt[B]=dt[$]=dt[q]=dt[st]=dt[ct]=!0,dt[d]=dt[f]=dt[I]=!1;var V=typeof ra=="object"&&ra&&ra.Object===Object&&ra,P=typeof self=="object"&&self&&self.Object===Object&&self,H=V||P||Function("return this")(),nt=t&&!t.nodeType&&t,ot=nt&&!0&&e&&!e.nodeType&&e,X=ot&&ot.exports===nt;function tt(k,Y){return k.set(Y[0],Y[1]),k}function rt(k,Y){return k.add(Y),k}function pt(k,Y){for(var J=-1,xt=k?k.length:0;++J<xt&&Y(k[J],J,k)!==!1;);return k}function yt(k,Y){for(var J=-1,xt=Y.length,De=k.length;++J<xt;)k[De+J]=Y[J];return k}function mt(k,Y,J,xt){for(var De=-1,Ge=k?k.length:0;++De<Ge;)J=Y(J,k[De],De,k);return J}function Rt(k,Y){for(var J=-1,xt=Array(k);++J<k;)xt[J]=Y(J);return xt}function Ft(k,Y){return k?.[Y]}function G(k){var Y=!1;if(k!=null&&typeof k.toString!="function")try{Y=!!(k+"")}catch{}return Y}function it(k){var Y=-1,J=Array(k.size);return k.forEach(function(xt,De){J[++Y]=[De,xt]}),J}function lt(k,Y){return function(J){return k(Y(J))}}function Wt(k){var Y=-1,J=Array(k.size);return k.forEach(function(xt){J[++Y]=xt}),J}var _t=Array.prototype,Vt=Function.prototype,Te=Object.prototype,Me=H["__core-js_shared__"],ae=(function(){var k=/[^.]+$/.exec(Me&&Me.keys&&Me.keys.IE_PROTO||"");return k?"Symbol(src)_1."+k:""})(),cn=Vt.toString,qt=Te.hasOwnProperty,Ne=Te.toString,re=RegExp("^"+cn.call(qt).replace(ht,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ke=X?H.Buffer:void 0,Ee=H.Symbol,gn=H.Uint8Array,Hi=lt(Object.getPrototypeOf,Object),Cn=Object.create,je=Te.propertyIsEnumerable,Ln=_t.splice,di=Object.getOwnPropertySymbols,So=ke?ke.isBuffer:void 0,To=lt(Object.keys,Object),vr=Xn(H,"DataView"),fi=Xn(H,"Map"),Mo=Xn(H,"Promise"),ko=Xn(H,"Set"),Do=Xn(H,"WeakMap"),Wi=Xn(Object,"create"),gl=pi(vr),yd=pi(fi),_d=pi(Mo),bd=pi(ko),xd=pi(Do),Co=Ee?Ee.prototype:void 0,yl=Co?Co.valueOf:void 0;function hi(k){var Y=-1,J=k?k.length:0;for(this.clear();++Y<J;){var xt=k[Y];this.set(xt[0],xt[1])}}function wd(){this.__data__=Wi?Wi(null):{}}function Ao(k){return this.has(k)&&delete this.__data__[k]}function vd(k){var Y=this.__data__;if(Wi){var J=Y[k];return J===i?void 0:J}return qt.call(Y,k)?Y[k]:void 0}function Oo(k){var Y=this.__data__;return Wi?Y[k]!==void 0:qt.call(Y,k)}function Sd(k,Y){var J=this.__data__;return J[k]=Wi&&Y===void 0?i:Y,this}hi.prototype.clear=wd,hi.prototype.delete=Ao,hi.prototype.get=vd,hi.prototype.has=Oo,hi.prototype.set=Sd;function Nn(k){var Y=-1,J=k?k.length:0;for(this.clear();++Y<J;){var xt=k[Y];this.set(xt[0],xt[1])}}function Td(){this.__data__=[]}function Md(k){var Y=this.__data__,J=Sr(Y,k);if(J<0)return!1;var xt=Y.length-1;return J==xt?Y.pop():Ln.call(Y,J,1),!0}function kd(k){var Y=this.__data__,J=Sr(Y,k);return J<0?void 0:Y[J][1]}function _l(k){return Sr(this.__data__,k)>-1}function Dd(k,Y){var J=this.__data__,xt=Sr(J,k);return xt<0?J.push([k,Y]):J[xt][1]=Y,this}Nn.prototype.clear=Td,Nn.prototype.delete=Md,Nn.prototype.get=kd,Nn.prototype.has=_l,Nn.prototype.set=Dd;function $i(k){var Y=-1,J=k?k.length:0;for(this.clear();++Y<J;){var xt=k[Y];this.set(xt[0],xt[1])}}function bl(){this.__data__={hash:new hi,map:new(fi||Nn),string:new hi}}function Cd(k){return Tr(this,k).delete(k)}function Ad(k){return Tr(this,k).get(k)}function Od(k){return Tr(this,k).has(k)}function Rd(k,Y){return Tr(this,k).set(k,Y),this}$i.prototype.clear=bl,$i.prototype.delete=Cd,$i.prototype.get=Ad,$i.prototype.has=Od,$i.prototype.set=Rd;function Vi(k){this.__data__=new Nn(k)}function Ed(){this.__data__=new Nn}function ss(k){return this.__data__.delete(k)}function Pd(k){return this.__data__.get(k)}function os(k){return this.__data__.has(k)}function Id(k,Y){var J=this.__data__;if(J instanceof Nn){var xt=J.__data__;if(!fi||xt.length<n-1)return xt.push([k,Y]),this;J=this.__data__=new $i(xt)}return J.set(k,Y),this}Vi.prototype.clear=Ed,Vi.prototype.delete=ss,Vi.prototype.get=Pd,Vi.prototype.has=os,Vi.prototype.set=Id;function Ld(k,Y){var J=Lo(k)||Pl(k)?Rt(k.length,String):[],xt=J.length,De=!!xt;for(var Ge in k)qt.call(k,Ge)&&!(De&&(Ge=="length"||Al(Ge,xt)))&&J.push(Ge);return J}function xl(k,Y,J){var xt=k[Y];(!(qt.call(k,Y)&&El(xt,J))||J===void 0&&!(Y in k))&&(k[Y]=J)}function Sr(k,Y){for(var J=k.length;J--;)if(El(k[J][0],Y))return J;return-1}function wl(k,Y){return k&&Eo(Y,No(Y),k)}function as(k,Y,J,xt,De,Ge,Bn){var Be;if(xt&&(Be=Ge?xt(k,De,Ge,Bn):xt(k)),Be!==void 0)return Be;if(!fs(k))return k;var Ll=Lo(k);if(Ll){if(Be=Dl(k),!Y)return kl(k,Be)}else{var ue=un(k),hs=ue==f||ue==m;if(qd(k))return Sl(k,Y);if(ue==x||ue==s||hs&&!Ge){if(G(k))return Ge?k:{};if(Be=Cl(hs?{}:k),!Y)return Po(k,wl(Be,k))}else{if(!dt[ue])return Ge?k:{};Be=$d(k,ue,as,Y)}}Bn||(Bn=new Vi);var Zn=Bn.get(k);if(Zn)return Zn;if(Bn.set(k,Be),!Ll)var Bo=J?Wd(k):No(k);return pt(Bo||k,function(Mr,Fe){Bo&&(Fe=Mr,Mr=k[Fe]),xl(Be,Fe,as(Mr,Y,J,xt,Fe,k,Bn))}),Be}function Nd(k){return fs(k)?Cn(k):{}}function Bd(k,Y,J){var xt=Y(k);return Lo(k)?xt:yt(xt,J(k))}function Fd(k){return Ne.call(k)}function zd(k){if(!fs(k)||Rl(k))return!1;var Y=ds(k)||G(k)?re:vt;return Y.test(pi(k))}function vl(k){if(!Io(k))return To(k);var Y=[];for(var J in Object(k))qt.call(k,J)&&J!="constructor"&&Y.push(J);return Y}function Sl(k,Y){if(Y)return k.slice();var J=new k.constructor(k.length);return k.copy(J),J}function ls(k){var Y=new k.constructor(k.byteLength);return new gn(Y).set(new gn(k)),Y}function Ro(k,Y){var J=Y?ls(k.buffer):k.buffer;return new k.constructor(J,k.byteOffset,k.byteLength)}function Ud(k,Y,J){var xt=Y?J(it(k),!0):it(k);return mt(xt,tt,new k.constructor)}function Tl(k){var Y=new k.constructor(k.source,ut.exec(k));return Y.lastIndex=k.lastIndex,Y}function cs(k,Y,J){var xt=Y?J(Wt(k),!0):Wt(k);return mt(xt,rt,new k.constructor)}function Ml(k){return yl?Object(yl.call(k)):{}}function Hd(k,Y){var J=Y?ls(k.buffer):k.buffer;return new k.constructor(J,k.byteOffset,k.length)}function kl(k,Y){var J=-1,xt=k.length;for(Y||(Y=Array(xt));++J<xt;)Y[J]=k[J];return Y}function Eo(k,Y,J,xt){J||(J={});for(var De=-1,Ge=Y.length;++De<Ge;){var Bn=Y[De],Be=void 0;xl(J,Bn,Be===void 0?k[Bn]:Be)}return J}function Po(k,Y){return Eo(k,us(k),Y)}function Wd(k){return Bd(k,No,us)}function Tr(k,Y){var J=k.__data__;return Ol(Y)?J[typeof Y=="string"?"string":"hash"]:J.map}function Xn(k,Y){var J=Ft(k,Y);return zd(J)?J:void 0}var us=di?lt(di,Object):Kd,un=Fd;(vr&&un(new vr(new ArrayBuffer(1)))!=W||fi&&un(new fi)!=g||Mo&&un(Mo.resolve())!=v||ko&&un(new ko)!=C||Do&&un(new Do)!=I)&&(un=function(k){var Y=Ne.call(k),J=Y==x?k.constructor:void 0,xt=J?pi(J):void 0;if(xt)switch(xt){case gl:return W;case yd:return g;case _d:return v;case bd:return C;case xd:return I}return Y});function Dl(k){var Y=k.length,J=k.constructor(Y);return Y&&typeof k[0]=="string"&&qt.call(k,"index")&&(J.index=k.index,J.input=k.input),J}function Cl(k){return typeof k.constructor=="function"&&!Io(k)?Nd(Hi(k)):{}}function $d(k,Y,J,xt){var De=k.constructor;switch(Y){case N:return ls(k);case l:case u:return new De(+k);case W:return Ro(k,xt);case U:case D:case w:case A:case L:case $:case q:case st:case ct:return Hd(k,xt);case g:return Ud(k,xt,J);case _:case O:return new De(k);case S:return Tl(k);case C:return cs(k,xt,J);case B:return Ml(k)}}function Al(k,Y){return Y=Y??r,!!Y&&(typeof k=="number"||at.test(k))&&k>-1&&k%1==0&&k<Y}function Ol(k){var Y=typeof k;return Y=="string"||Y=="number"||Y=="symbol"||Y=="boolean"?k!=="__proto__":k===null}function Rl(k){return!!ae&&ae in k}function Io(k){var Y=k&&k.constructor,J=typeof Y=="function"&&Y.prototype||Te;return k===J}function pi(k){if(k!=null){try{return cn.call(k)}catch{}try{return k+""}catch{}}return""}function Vd(k){return as(k,!0,!0)}function El(k,Y){return k===Y||k!==k&&Y!==Y}function Pl(k){return Yd(k)&&qt.call(k,"callee")&&(!je.call(k,"callee")||Ne.call(k)==s)}var Lo=Array.isArray;function Il(k){return k!=null&&jd(k.length)&&!ds(k)}function Yd(k){return Gd(k)&&Il(k)}var qd=So||ne;function ds(k){var Y=fs(k)?Ne.call(k):"";return Y==f||Y==m}function jd(k){return typeof k=="number"&&k>-1&&k%1==0&&k<=r}function fs(k){var Y=typeof k;return!!k&&(Y=="object"||Y=="function")}function Gd(k){return!!k&&typeof k=="object"}function No(k){return Il(k)?Ld(k):vl(k)}function Kd(){return[]}function ne(){return!1}e.exports=Vd})(sa,sa.exports)),sa.exports}uv();const Mn=(e,t)=>new Date(e.getTime()-av(t,e));class Oe{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 n=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&n.add("minutely"),i>=2&&i<=168&&n.add("hourly"),i>=48&&n.add("daily"),i>=672&&n.add("weekly"),n}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 n=ov(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Fh(n,t)}}class dv extends Oe{rawStart(t){let n=ei(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=Mn(n,t)),n}maximumTimeframeLength(){return 3600*24*7}}class fv extends Oe{rawStart(t){let n=Br(this.tzAdjustedDate(t));return t&&(n=Mn(n,t)),n}maximumTimeframeLength(){return 3600*24*31}}class hv extends Oe{rawStart(t){let n=Nr(this.tzAdjustedDate(t));return t&&(n=Mn(n,t)),n}maximumTimeframeLength(){return 3600*24*92}}class pv extends Oe{rawStart(t){let n=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(n=Mn(n,t)),n}maximumTimeframeLength(){return 3600*24*366}}class mv extends Oe{rawEnd(t){let n=ei(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=Mn(n,t)),n}rawStart(t){const n=this.tzAdjustedDate(t);let i=ei(n.setDate(n.getDate()-7),{weekStartsOn:1});return t&&(i=Mn(i,t)),i}}class gv extends Oe{rawEnd(t){let n=Nr(this.tzAdjustedDate(t));return t&&(n=Mn(n,t)),n}rawStart(t){let n=Nr(Th(this.tzAdjustedDate(t)));return t&&(n=Mn(n,t)),n}}class yv extends Oe{rawEnd(t){let n=Br(this.tzAdjustedDate(t));return t&&(n=Mn(n,t)),n}rawStart(t){let n=Br(Sh(this.tzAdjustedDate(t)));return t&&(n=Mn(n,t)),n}}class _v extends Oe{rawEnd(t){let n=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(n=Mn(n,t)),n}rawStart(t){let n=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(n=Mn(n,t)),n}}bt.FIFTEEN_MIN,new Oe({key:bt.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"]}),bt.ONE_HOUR,new Oe({key:bt.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"]}),bt.SIX_HOUR,new Oe({key:bt.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"]}),bt.TWELVE_HOUR,new Oe({key:bt.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"]}),bt.ONE_DAY,new Oe({key:bt.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"]}),bt.SEVEN_DAY,new Oe({key:bt.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"]}),bt.THIRTY_DAY,new Oe({key:bt.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"]}),bt.NINETY_DAY,new Oe({key:bt.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"]}),bt.ONE_HUNDRED_EIGHTY_DAY,new Oe({key:bt.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"]}),bt.ONE_YEAR,new Oe({key:bt.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"]}),bt.CURRENT_WEEK,new dv({key:bt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const e=ei(new Date,{weekStartsOn:1});return(Ir(ta(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),bt.CURRENT_MONTH,new fv({key:bt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const e=Br(new Date);return(Ir(ta(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),bt.CURRENT_QUARTER,new hv({key:bt.CURRENT_QUARTER,display:"This quarter",timeframeText:"Quarter",timeframeLength:()=>{const e=Nr(new Date);return(Ir(ta(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),bt.CURRENT_YEAR,new pv({key:bt.CURRENT_YEAR,display:"This year",timeframeText:"Year",timeframeLength:()=>{const e=new Date(new Date().getFullYear(),0,1);return(Ir(ta(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),bt.PREVIOUS_WEEK,new mv({key:bt.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"]}),bt.PREVIOUS_MONTH,new yv({key:bt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=Br(new Date),n=Br(Sh(new Date));return t.getTimezoneOffset()!==n.getTimezoneOffset()&&(e=Wh(t,n)),3600*24*Rw(new Date().setMonth(new Date().getMonth()-1))+vh(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),bt.PREVIOUS_QUARTER,new gv({key:bt.PREVIOUS_QUARTER,display:"Previous quarter",timeframeText:"Quarter",timeframeLength:()=>{const e=Nr(new Date),t=Nr(Th(new Date));return(e.getTime()-t.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),bt.PREVIOUS_YEAR,new _v({key:bt.PREVIOUS_YEAR,display:"Previous year",timeframeText:"Year",timeframeLength:()=>{const e=new Date(new Date().getFullYear(),0,1),t=new Date(new Date().getFullYear()-1,0,1);let n=0;return e.getTimezoneOffset()!==t.getTimezoneOffset()&&(n=Wh(e,t)),3600*24*(365+(t.getFullYear()%4===0?1:0))+vh(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Wh(e,t){return Pw(e.getTimezoneOffset()-t.getTimezoneOffset())}bt.FIFTEEN_MIN,bt.ONE_HOUR,bt.SIX_HOUR,bt.TWELVE_HOUR,bt.ONE_DAY,bt.SEVEN_DAY,bt.FIFTEEN_MIN,bt.ONE_HOUR,bt.SIX_HOUR,bt.TWELVE_HOUR,bt.ONE_DAY,bt.SEVEN_DAY,bt.THIRTY_DAY,bt.NINETY_DAY,bt.ONE_HUNDRED_EIGHTY_DAY,bt.ONE_YEAR,bt.CURRENT_WEEK,bt.CURRENT_MONTH,bt.CURRENT_QUARTER,bt.CURRENT_YEAR,bt.PREVIOUS_WEEK,bt.PREVIOUS_MONTH,bt.PREVIOUS_QUARTER,bt.PREVIOUS_YEAR;const bv=new Map(ch.map(e=>[e.code,{code:e.code,name:e.name}])),Cc=e=>bv.get(e)?.name||e,$h=1e3,xv=1e4,Vh=1e6,Yh=1e9,qh=1e12,oa=(e,t)=>{if(t.separator===!1||e<1e3)return e.toString();const n=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(e).toString().split("").reverse().forEach((r,s)=>{s&&s%3===0&&i.push(n),i.push(r)}),i.reverse().join("")},Rs=(e,t,n)=>{const i=e/t,r=n.round?"round":"floor";if(n.decimal===!1)return Math[r](i).toString();let s;n.precision?s=i:s=i<10?Math[r](i*10)/10:Math[r](i);let a=s.toString();return typeof n.decimal=="string"&&(a=a.replace(".",n.decimal)),a};function aa(e,t={}){let n;const i=e<0;i&&(e=Math.abs(e)),t.precision&&(e=parseFloat(e.toPrecision(t.precision)));const r=t.min10k?xv:$h;return e<r||t.precision&&t.precision>Math.log10(e)?n=oa(Rs(e,1,t),t):e<Vh?n=`${Rs(e,$h,t)}k`:e<Yh?n=`${Rs(e,Vh,t)}m`:e<qh?n=`${oa(Rs(e,Yh,t),t)}b`:n=`${oa(Rs(e,qh,t),t)}t`,i&&(n=`-${n}`),t.capital&&(n=n.toUpperCase()),t.prefix&&(n=`${t.prefix}${n}`),t.suffix&&(n=`${n}${t.suffix}`),n}aa.addCommas=oa;const wv=typeof document<"u"&&document.documentElement?.lang||"en-US",la=new Intl.NumberFormat(wv);function ni({i18n:e}){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 f;return i>=s?f=e.formatNumber(Number.parseFloat((i/s).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):i>=a?f=e.formatNumber(Number.parseFloat((i/a).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):i>=l?f=e.formatNumber(Number.parseFloat((i/l).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):i>=u?f=e.formatNumber(Number.parseFloat((i/u).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):i>=d?f=e.formatNumber(Number.parseFloat((i/d).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):f=e.formatNumber(Number.parseFloat(i.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),f.replace(/([a-zA-Z]*)$/," $1")},n=(i,r="USD")=>isNaN(i)?r==="USD"?"$0.00":`${i}`:i>=.01||r!=="USD"?e.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 n(i,a);default:return isNaN(i)?`${i}`:l?`${aa(i,{capital:!0})} ${d}`:i>=.01?`${la.format(Number.parseFloat(i.toFixed(2)))} ${d}`:`${Number.parseFloat(i.toPrecision(4))} ${d}`}},formatBytes:t,formatCost:n,formatRange:(i,r,s,{isBytes1024:a=!1,currency:l="USD",approximate:u=!1,translateUnit:d=f=>f}={})=>{const f=d(s,r);switch(s){case"bytes":return`${t(i,a)} - ${t(r,a)}`;case"usd":return`${n(i,l)} - ${n(r,l)}`;default:if(isNaN(i)||isNaN(r))return`${i} - ${r}`;if(u)return`${aa(i,{capital:!0})} - ${aa(r,{capital:!0})} ${f}`}const m=i>=.01?`${la.format(Number.parseFloat(i.toFixed(2)))}`:`${Number.parseFloat(i.toPrecision(4))}`,g=r>=.01?`${la.format(Number.parseFloat(r.toFixed(2)))}`:`${Number.parseFloat(r.toPrecision(4))}`;return`${m} - ${g} ${f}`}}}const vv=e=>{const t=e.length;let n=5381;for(let i=0;i<t;i++)n=n*33^e.charCodeAt(i);return n>>>0},Sv="#0044f4",jh="#6c7489",Tv="#afb7c5",Mv="#d60027",kv="#ffc400",Dv="#bee2ff",Cv="#8fc1ff",Av="#5f9aff",Ov="#306fff",Rv="#b5ffee",Ev="#00fabe",Pv="#00d6a4",Iv="#00a17b",Lv="#007d60",Nv="#005944",Bv="#b5ffee",Fv="#00fabe",zv="#b5ffee",Uv="#00a17b",Hv="#fff296",Wv="#ffe04b",$v="#ffc400",Vv="#b37600",Yv="#995c00",qv="#804400",jv="#fff296",Gv="#ffe04b",Kv="#ffc2b3",Xv="#ff9877",Zv="#ff723c",Qv="#f75008",Jv="#d13500",t1="#a31f00",e1="#ffc2b3",n1="#ff9877",i1="#ff723c",r1="#f75008",s1="#d13500",o1="#a31f00",a1="#ffc2b3",l1="#ff9877",c1="#ff723c",u1="#f75008",d1="#d13500",f1="#a31f00",h1="#ffc2b3",p1="#ff9877",m1="#ff723c",g1="#f75008",y1="#d13500",_1="#a31f00",b1="#ffc2b3",x1="#ff9877",w1="#ff723c",v1="#f75008",S1="#d13500",T1="#ffabab",M1="#ff7272",k1="#ff3954",D1="#f50045",C1="#d60027",A1="#ad000e",O1="#ffabab",R1="#ff7272",E1="#ff3954",P1="#f50045",I1="#d60027",L1="#eefaff",N1="#ecfffb",B1="#fffce0",F1="#fff1ef",z1="#ffe5e5",U1="#5f9aff",H1="#00d6a4",W1="#ffc400",$1="#ff723c",V1="#ff3954",Y1={100:Dv,101:Cv,102:Av,103:Ov,200:Rv,201:Ev,202:Pv,203:Iv,204:Lv,205:Nv,206:Bv,207:Fv,208:zv,226:Uv,300:Hv,301:Wv,302:$v,303:Vv,304:Yv,305:qv,307:jv,308:Gv,400:Kv,401:Xv,402:Zv,403:Qv,404:Jv,405:t1,406:e1,407:n1,408:i1,409:r1,410:s1,411:o1,412:a1,413:l1,414:c1,415:u1,416:d1,417:f1,418:h1,421:p1,422:m1,423:g1,424:y1,425:_1,426:b1,428:x1,429:w1,431:v1,451:S1,500:T1,501:M1,502:k1,503:D1,504:C1,505:A1,506:O1,507:R1,508:E1,510:P1,511:I1},q1={100:L1,200:N1,300:B1,400:F1,500:z1},Gh={"1XX":U1,"2XX":H1,"3XX":W1,"4XX":$1,"5XX":V1},j1={error:Mv,warning:kv,empty:Tv,neutral:jh,____OTHER____:Sv},Kh=["#1693AE","#2EA697","#5CB56C","#AD47F1","#7287F1","#4DA8DF","#DA5024","#EC4D87","#D771D5","#6C931E","#AC8E26","#DB8743"],Xh=["#006B74","#187C62","#538732","#7201DE","#1E63D3","#1E83A3","#B2001F","#BA107B","#A739D0","#5E6400","#8B620C","#BB5420"],G1=e=>vv(e),Zh=({discriminator:e,theme:t="light",customPalette:n=void 0})=>{const i=Math.abs(Math.floor(e));return n?n[i%n.length]:t==="dark"?Xh[i%Xh.length]:Kh[i%Kh.length]},Es=({state:e})=>j1[e]??jh,K1=({statusCode:e})=>{const t=typeof e=="number"?e:Number.parseInt(e,10),n=`${t}`,i=`${Math.floor(t/100)*100}`;return Y1[n]??q1[i]??Es({state:"neutral"})},X1=({group:e})=>Gh[e]?Gh[e]:Es({state:"neutral"}),ca=({discriminator:e=void 0,state:t=void 0,dimension:n=void 0,dimensionValue:i=void 0,metric:r=void 0,theme:s="light",customPalette:a=void 0})=>{if(e!==void 0)return Zh({discriminator:e,theme:s,customPalette:a});if(t!==void 0)return Es({state:t});if(i&&["empty","____OTHER____"].includes(i))return Es({state:i});if(n!==void 0&&i!==void 0){if(n==="status_code")return K1({statusCode:i});if(n==="status_code_grouped")return X1({group:i})}return n||i||r?Zh({discriminator:G1(`${n??""}${i??""}${r??""}`),theme:s,customPalette:a}):Es({state:"neutral"})},Qh="#d60027",Jh="#ffe5e5",Z1="#f1f0ff",Q1="#e0e4ea",tp="#6c7489",J1="#afb7c5",ep="#0d0e14",tS="#d60027",eS="#ad000e",Ac="#6c7489",np="#52596e",nS="#007d60",iS="#995c00",rS="#ffc400",sS="'Inter', Roboto, Helvetica, sans-serif",ir="16px",oS="20px",aS="#bee2ff",lS="#8fc1ff",cS="#5f9aff",uS="#306fff",dS="#b5ffee",fS="#00fabe",hS="#00d6a4",pS="#00a17b",mS="#007d60",gS="#005944",yS="#b5ffee",_S="#00fabe",bS="#b5ffee",xS="#00a17b",wS="#fff296",vS="#ffe04b",SS="#ffc400",TS="#b37600",MS="#995c00",kS="#804400",DS="#fff296",CS="#ffe04b",AS="#ffc2b3",OS="#ff9877",RS="#ff723c",ES="#f75008",PS="#d13500",IS="#a31f00",LS="#ffc2b3",NS="#ff9877",BS="#ff723c",FS="#f75008",zS="#d13500",US="#a31f00",HS="#ffc2b3",WS="#ff9877",$S="#ff723c",VS="#f75008",YS="#d13500",qS="#a31f00",jS="#ffc2b3",GS="#ff9877",KS="#ff723c",XS="#f75008",ZS="#d13500",QS="#a31f00",JS="#ffc2b3",tT="#ff9877",eT="#ff723c",nT="#f75008",iT="#d13500",rT="#ffabab",sT="#ff7272",oT="#ff3954",aT="#f50045",lT="#d60027",cT="#ad000e",uT="#ffabab",dT="#ff7272",fT="#ff3954",hT="#f50045",pT="#d60027",mT="#eefaff",gT="#ecfffb",yT="#fffce0",_T="#fff1ef",bT="#ffe5e5",xT="#5f9aff",wT="#00d6a4",vT="#ffc400",ST="#ff723c",TT="#ff3954",ip=6048e5,MT=864e5,Ps=6e4,zr=36e5,kT=1e3,rp=Symbol.for("constructDateFrom");function me(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&rp in e?e[rp](t):e instanceof Date?new e.constructor(t):new Date(t)}function Ot(e,t){return me(t||e,e)}function ua(e,t,n){const i=Ot(e,n?.in);return isNaN(t)?me(n?.in||e,NaN):(t&&i.setDate(i.getDate()+t),i)}function Oc(e,t,n){const i=Ot(e,n?.in);if(isNaN(t))return me(e,NaN);if(!t)return i;const r=i.getDate(),s=me(e,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 Rc(e,t,n){return me(e,+Ot(e)+t)}function DT(e,t,n){return Rc(e,t*zr)}let CT={};function rr(){return CT}function $n(e,t){const n=rr(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=Ot(e,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 Ur(e,t){return $n(e,{...t,weekStartsOn:1})}function sp(e,t){const n=Ot(e,t?.in),i=n.getFullYear(),r=me(n,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=Ur(r),a=me(n,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=Ur(a);return n.getTime()>=s.getTime()?i+1:n.getTime()>=l.getTime()?i:i-1}function da(e){const t=Ot(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function sr(e,...t){const n=me.bind(null,t.find(i=>typeof i=="object"));return t.map(n)}function Ec(e,t){const n=Ot(e,t?.in);return n.setHours(0,0,0,0),n}function op(e,t,n){const[i,r]=sr(n?.in,e,t),s=Ec(i),a=Ec(r),l=+s-da(s),u=+a-da(a);return Math.round((l-u)/MT)}function AT(e,t){const n=sp(e,t),i=me(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),Ur(i)}function OT(e,t,n){const i=Ot(e,n?.in);return i.setTime(i.getTime()+t*Ps),i}function RT(e,t,n){return Oc(e,t*3,n)}function ET(e,t,n){return Rc(e,t*1e3)}function PT(e,t,n){return ua(e,t*7,n)}function IT(e,t,n){return Oc(e,t*12,n)}function Is(e,t){const n=+Ot(e)-+Ot(t);return n<0?-1:n>0?1:n}function LT(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Pc(e){return!(!LT(e)&&typeof e!="number"||isNaN(+Ot(e)))}function NT(e,t,n){const[i,r]=sr(n?.in,e,t),s=i.getFullYear()-r.getFullYear(),a=i.getMonth()-r.getMonth();return s*12+a}function BT(e,t,n){const[i,r]=sr(n?.in,e,t);return i.getFullYear()-r.getFullYear()}function ap(e,t,n){const[i,r]=sr(n?.in,e,t),s=lp(i,r),a=Math.abs(op(i,r));i.setDate(i.getDate()-s*a);const l=+(lp(i,r)===-s),u=s*(a-l);return u===0?0:u}function lp(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function Ls(e){return t=>{const i=(e?Math[e]:Math.trunc)(t);return i===0?0:i}}function FT(e,t,n){const[i,r]=sr(n?.in,e,t),s=(+i-+r)/zr;return Ls(n?.roundingMethod)(s)}function Ic(e,t){return+Ot(e)-+Ot(t)}function zT(e,t,n){const i=Ic(e,t)/Ps;return Ls(n?.roundingMethod)(i)}function cp(e,t){const n=Ot(e,t?.in);return n.setHours(23,59,59,999),n}function up(e,t){const n=Ot(e,t?.in),i=n.getMonth();return n.setFullYear(n.getFullYear(),i+1,0),n.setHours(23,59,59,999),n}function UT(e,t){const n=Ot(e,t?.in);return+cp(n,t)==+up(n,t)}function dp(e,t,n){const[i,r,s]=sr(n?.in,e,e,t),a=Is(r,s),l=Math.abs(NT(r,s));if(l<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-a*l);let u=Is(r,s)===-a;UT(i)&&l===1&&Is(i,s)===1&&(u=!1);const d=a*(l-+u);return d===0?0:d}function HT(e,t,n){const i=dp(e,t,n)/3;return Ls(n?.roundingMethod)(i)}function WT(e,t,n){const i=Ic(e,t)/1e3;return Ls(n?.roundingMethod)(i)}function $T(e,t,n){const i=ap(e,t,n)/7;return Ls(n?.roundingMethod)(i)}function VT(e,t,n){const[i,r]=sr(n?.in,e,t),s=Is(i,r),a=Math.abs(BT(i,r));i.setFullYear(1584),r.setFullYear(1584);const l=Is(i,r)===-s,u=s*(a-+l);return u===0?0:u}function YT(e,t){const n=Ot(e,t?.in),i=n.getMonth(),r=i-i%3;return n.setMonth(r,1),n.setHours(0,0,0,0),n}function qT(e,t){const n=Ot(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function jT(e,t){const n=Ot(e,t?.in),i=n.getFullYear();return n.setFullYear(i+1,0,0),n.setHours(23,59,59,999),n}function fp(e,t){const n=Ot(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function GT(e,t){const n=Ot(e,t?.in);return n.setMinutes(59,59,999),n}function KT(e,t){const n=rr(),i=n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=Ot(e,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 XT(e,t){const n=Ot(e,t?.in);return n.setSeconds(59,999),n}function ZT(e,t){const n=Ot(e,t?.in),i=n.getMonth(),r=i-i%3+3;return n.setMonth(r,0),n.setHours(23,59,59,999),n}function QT(e,t){const n=Ot(e,t?.in);return n.setMilliseconds(999),n}const JT={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"}},tM=(e,t,n)=>{let i;const r=JT[e];return typeof r=="string"?i=r:t===1?i=r.one:i=r.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function Lc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const eM={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},nM={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},iM={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},rM={date:Lc({formats:eM,defaultWidth:"full"}),time:Lc({formats:nM,defaultWidth:"full"}),dateTime:Lc({formats:iM,defaultWidth:"full"})},sM={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},oM=(e,t,n,i)=>sM[e];function Ns(e){return(t,n)=>{const i=n?.context?String(n.context):"standalone";let r;if(i==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,l=n?.width?String(n.width):a;r=e.formattingValues[l]||e.formattingValues[a]}else{const a=e.defaultWidth,l=n?.width?String(n.width):e.defaultWidth;r=e.values[l]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return r[s]}}const aM={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},lM={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},cM={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"]},uM={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"]},dM={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"}},fM={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"}},hM={ordinalNumber:(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Ns({values:aM,defaultWidth:"wide"}),quarter:Ns({values:lM,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Ns({values:cM,defaultWidth:"wide"}),day:Ns({values:uM,defaultWidth:"wide"}),dayPeriod:Ns({values:dM,defaultWidth:"wide",formattingValues:fM,defaultFormattingWidth:"wide"})};function Bs(e){return(t,n={})=>{const i=n.width,r=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],s=t.match(r);if(!s)return null;const a=s[0],l=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(l)?mM(l,m=>m.test(a)):pM(l,m=>m.test(a));let d;d=e.valueCallback?e.valueCallback(u):u,d=n.valueCallback?n.valueCallback(d):d;const f=t.slice(a.length);return{value:d,rest:f}}}function pM(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function mM(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function gM(e){return(t,n={})=>{const i=t.match(e.matchPattern);if(!i)return null;const r=i[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const l=t.slice(r.length);return{value:a,rest:l}}}const yM=/^(\d+)(th|st|nd|rd)?/i,_M=/\d+/i,bM={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},xM={any:[/^b/i,/^(a|c)/i]},wM={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},vM={any:[/1/i,/2/i,/3/i,/4/i]},SM={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},TM={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]},MM={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},kM={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]},DM={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},CM={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}},AM={ordinalNumber:gM({matchPattern:yM,parsePattern:_M,valueCallback:e=>parseInt(e,10)}),era:Bs({matchPatterns:bM,defaultMatchWidth:"wide",parsePatterns:xM,defaultParseWidth:"any"}),quarter:Bs({matchPatterns:wM,defaultMatchWidth:"wide",parsePatterns:vM,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Bs({matchPatterns:SM,defaultMatchWidth:"wide",parsePatterns:TM,defaultParseWidth:"any"}),day:Bs({matchPatterns:MM,defaultMatchWidth:"wide",parsePatterns:kM,defaultParseWidth:"any"}),dayPeriod:Bs({matchPatterns:DM,defaultMatchWidth:"any",parsePatterns:CM,defaultParseWidth:"any"})},hp={code:"en-US",formatDistance:tM,formatLong:rM,formatRelative:oM,localize:hM,match:AM,options:{weekStartsOn:0,firstWeekContainsDate:1}};function OM(e,t){const n=Ot(e,t?.in);return op(n,fp(n))+1}function pp(e,t){const n=Ot(e,t?.in),i=+Ur(n)-+AT(n);return Math.round(i/ip)+1}function Nc(e,t){const n=Ot(e,t?.in),i=n.getFullYear(),r=rr(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=me(t?.in||e,0);a.setFullYear(i+1,0,s),a.setHours(0,0,0,0);const l=$n(a,t),u=me(t?.in||e,0);u.setFullYear(i,0,s),u.setHours(0,0,0,0);const d=$n(u,t);return+n>=+l?i+1:+n>=+d?i:i-1}function RM(e,t){const n=rr(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=Nc(e,t),s=me(t?.in||e,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),$n(s,t)}function mp(e,t){const n=Ot(e,t?.in),i=+$n(n,t)-+RM(n,t);return Math.round(i/ip)+1}function Qt(e,t){const n=e<0?"-":"",i=Math.abs(e).toString().padStart(t,"0");return n+i}const Ti={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return Qt(t==="yy"?i%100:i,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Qt(n+1,2)},d(e,t){return Qt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Qt(e.getHours()%12||12,t.length)},H(e,t){return Qt(e.getHours(),t.length)},m(e,t){return Qt(e.getMinutes(),t.length)},s(e,t){return Qt(e.getSeconds(),t.length)},S(e,t){const n=t.length,i=e.getMilliseconds(),r=Math.trunc(i*Math.pow(10,n-3));return Qt(r,t.length)}},Hr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},gp={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const i=e.getFullYear(),r=i>0?i:1-i;return n.ordinalNumber(r,{unit:"year"})}return Ti.y(e,t)},Y:function(e,t,n,i){const r=Nc(e,i),s=r>0?r:1-r;if(t==="YY"){const a=s%100;return Qt(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Qt(s,t.length)},R:function(e,t){const n=sp(e);return Qt(n,t.length)},u:function(e,t){const n=e.getFullYear();return Qt(n,t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Qt(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Qt(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return Ti.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return Qt(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const r=mp(e,i);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):Qt(r,t.length)},I:function(e,t,n){const i=pp(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):Qt(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Ti.d(e,t)},D:function(e,t,n){const i=OM(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):Qt(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const r=e.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Qt(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const r=e.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Qt(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),r=i===0?7:i;switch(t){case"i":return String(r);case"ii":return Qt(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let r;switch(i===12?r=Hr.noon:i===0?r=Hr.midnight:r=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let r;switch(i>=17?r=Hr.evening:i>=12?r=Hr.afternoon:i>=4?r=Hr.morning:r=Hr.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let i=e.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Ti.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Ti.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):Qt(i,t.length)},k:function(e,t,n){let i=e.getHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):Qt(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ti.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Ti.s(e,t)},S:function(e,t){return Ti.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return _p(i);case"XXXX":case"XX":return or(i);default:return or(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return _p(i);case"xxxx":case"xx":return or(i);default:return or(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+yp(i,":");default:return"GMT"+or(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+yp(i,":");default:return"GMT"+or(i,":")}},t:function(e,t,n){const i=Math.trunc(+e/1e3);return Qt(i,t.length)},T:function(e,t,n){return Qt(+e,t.length)}};function yp(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Math.trunc(i/60),s=i%60;return s===0?n+String(r):n+String(r)+t+Qt(s,2)}function _p(e,t){return e%60===0?(e>0?"-":"+")+Qt(Math.abs(e)/60,2):or(e,t)}function or(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Qt(Math.trunc(i/60),2),s=Qt(i%60,2);return n+r+t+s}const bp=(e,t)=>{switch(e){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"})}},xp=(e,t)=>{switch(e){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"})}},Bc={p:xp,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return bp(e,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}}",bp(i,t)).replace("{{time}}",xp(r,t))}},EM=/^D+$/,PM=/^Y+$/,IM=["D","DD","YY","YYYY"];function wp(e){return EM.test(e)}function vp(e){return PM.test(e)}function Fc(e,t,n){const i=LM(e,t,n);if(console.warn(i),IM.includes(e))throw new RangeError(i)}function LM(e,t,n){const i=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const NM=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,BM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,FM=/^'([^]*?)'?$/,zM=/''/g,UM=/[a-zA-Z]/;function fa(e,t,n){const i=rr(),r=n?.locale??i.locale??hp,s=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,l=Ot(e,n?.in);if(!Pc(l))throw new RangeError("Invalid time value");let u=t.match(BM).map(f=>{const m=f[0];if(m==="p"||m==="P"){const g=Bc[m];return g(f,r.formatLong)}return f}).join("").match(NM).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const m=f[0];if(m==="'")return{isToken:!1,value:HM(f)};if(gp[m])return{isToken:!0,value:f};if(m.match(UM))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:f}});r.localize.preprocessor&&(u=r.localize.preprocessor(l,u));const d={firstWeekContainsDate:s,weekStartsOn:a,locale:r};return u.map(f=>{if(!f.isToken)return f.value;const m=f.value;(!n?.useAdditionalWeekYearTokens&&vp(m)||!n?.useAdditionalDayOfYearTokens&&wp(m))&&Fc(m,t,String(e));const g=gp[m[0]];return g(l,m,r.localize,d)}).join("")}function HM(e){const t=e.match(FM);return t?t[1].replace(zM,"'"):e}function Sp(){return Object.assign({},rr())}function WM(e,t){const n=Ot(e,t?.in).getDay();return n===0?7:n}function $M(e,t){const n=VM(t)?new t(0):me(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function VM(e){return typeof e=="function"&&e.prototype?.constructor===e}const YM=10;class Tp{subPriority=0;validate(t,n){return!0}}class qM extends Tp{constructor(t,n,i,r,s){super(),this.value=t,this.validateValue=n,this.setValue=i,this.priority=r,s&&(this.subPriority=s)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,i){return this.setValue(t,n,this.value,i)}}class jM extends Tp{priority=YM;subPriority=-1;constructor(t,n){super(),this.context=t||(i=>me(n,i))}set(t,n){return n.timestampIsSet?t:me(t,$M(t,this.context))}}class Yt{run(t,n,i,r){const s=this.parse(t,n,i,r);return s?{setter:new qM(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(t,n,i){return!0}}class GM extends Yt{priority=140;parse(t,n,i){switch(n){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,n,i){return n.era=i,t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]}const _e={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 be(e,t){return e&&{value:t(e.value),rest:e.rest}}function he(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function Yn(e,t){const n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};const i=n[1]==="+"?1:-1,r=n[2]?parseInt(n[2],10):0,s=n[3]?parseInt(n[3],10):0,a=n[5]?parseInt(n[5],10):0;return{value:i*(r*zr+s*Ps+a*kT),rest:t.slice(n[0].length)}}function Mp(e){return he(_e.anyDigitsSigned,e)}function ge(e,t){switch(e){case 1:return he(_e.singleDigit,t);case 2:return he(_e.twoDigits,t);case 3:return he(_e.threeDigits,t);case 4:return he(_e.fourDigits,t);default:return he(new RegExp("^\\d{1,"+e+"}"),t)}}function ha(e,t){switch(e){case 1:return he(_e.singleDigitSigned,t);case 2:return he(_e.twoDigitsSigned,t);case 3:return he(_e.threeDigitsSigned,t);case 4:return he(_e.fourDigitsSigned,t);default:return he(new RegExp("^-?\\d{1,"+e+"}"),t)}}function zc(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function kp(e,t){const n=t>0,i=n?t:1-t;let r;if(i<=50)r=e||100;else{const s=i+50,a=Math.trunc(s/100)*100,l=e>=s%100;r=e+a-(l?100:0)}return n?r:1-r}function Dp(e){return e%400===0||e%4===0&&e%100!==0}class KM extends Yt{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,n,i){const r=s=>({year:s,isTwoDigitYear:n==="yy"});switch(n){case"y":return be(ge(4,t),r);case"yo":return be(i.ordinalNumber(t,{unit:"year"}),r);default:return be(ge(n.length,t),r)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,i){const r=t.getFullYear();if(i.isTwoDigitYear){const a=kp(i.year,r);return t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}const s=!("era"in n)||n.era===1?i.year:1-i.year;return t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}}class XM extends Yt{priority=130;parse(t,n,i){const r=s=>({year:s,isTwoDigitYear:n==="YY"});switch(n){case"Y":return be(ge(4,t),r);case"Yo":return be(i.ordinalNumber(t,{unit:"year"}),r);default:return be(ge(n.length,t),r)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,i,r){const s=Nc(t,r);if(i.isTwoDigitYear){const l=kp(i.year,s);return t.setFullYear(l,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),$n(t,r)}const a=!("era"in n)||n.era===1?i.year:1-i.year;return t.setFullYear(a,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),$n(t,r)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class ZM extends Yt{priority=130;parse(t,n){return ha(n==="R"?4:n.length,t)}set(t,n,i){const r=me(t,0);return r.setFullYear(i,0,4),r.setHours(0,0,0,0),Ur(r)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class QM extends Yt{priority=130;parse(t,n){return ha(n==="u"?4:n.length,t)}set(t,n,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 JM extends Yt{priority=120;parse(t,n,i){switch(n){case"Q":case"QQ":return ge(n.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,n){return n>=1&&n<=4}set(t,n,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 tk extends Yt{priority=120;parse(t,n,i){switch(n){case"q":case"qq":return ge(n.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,n){return n>=1&&n<=4}set(t,n,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 ek extends Yt{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,n,i){const r=s=>s-1;switch(n){case"M":return be(he(_e.month,t),r);case"MM":return be(ge(2,t),r);case"Mo":return be(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,n){return n>=0&&n<=11}set(t,n,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}}class nk extends Yt{priority=110;parse(t,n,i){const r=s=>s-1;switch(n){case"L":return be(he(_e.month,t),r);case"LL":return be(ge(2,t),r);case"Lo":return be(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,n){return n>=0&&n<=11}set(t,n,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 ik(e,t,n){const i=Ot(e,n?.in),r=mp(i,n)-t;return i.setDate(i.getDate()-r*7),Ot(i,n?.in)}class rk extends Yt{priority=100;parse(t,n,i){switch(n){case"w":return he(_e.week,t);case"wo":return i.ordinalNumber(t,{unit:"week"});default:return ge(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,i,r){return $n(ik(t,i,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function sk(e,t,n){const i=Ot(e,n?.in),r=pp(i,n)-t;return i.setDate(i.getDate()-r*7),i}class ok extends Yt{priority=100;parse(t,n,i){switch(n){case"I":return he(_e.week,t);case"Io":return i.ordinalNumber(t,{unit:"week"});default:return ge(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,i){return Ur(sk(t,i))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const ak=[31,28,31,30,31,30,31,31,30,31,30,31],lk=[31,29,31,30,31,30,31,31,30,31,30,31];class ck extends Yt{priority=90;subPriority=1;parse(t,n,i){switch(n){case"d":return he(_e.date,t);case"do":return i.ordinalNumber(t,{unit:"date"});default:return ge(n.length,t)}}validate(t,n){const i=t.getFullYear(),r=Dp(i),s=t.getMonth();return r?n>=1&&n<=lk[s]:n>=1&&n<=ak[s]}set(t,n,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 uk extends Yt{priority=90;subpriority=1;parse(t,n,i){switch(n){case"D":case"DD":return he(_e.dayOfYear,t);case"Do":return i.ordinalNumber(t,{unit:"date"});default:return ge(n.length,t)}}validate(t,n){const i=t.getFullYear();return Dp(i)?n>=1&&n<=366:n>=1&&n<=365}set(t,n,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 Uc(e,t,n){const i=rr(),r=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,s=Ot(e,n?.in),a=s.getDay(),u=(t%7+7)%7,d=7-r,f=t<0||t>6?t-(a+d)%7:(u+d)%7-(a+d)%7;return ua(s,f,n)}class dk extends Yt{priority=90;parse(t,n,i){switch(n){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,n){return n>=0&&n<=6}set(t,n,i,r){return t=Uc(t,i,r),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class fk extends Yt{priority=90;parse(t,n,i,r){const s=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(n){case"e":case"ee":return be(ge(n.length,t),s);case"eo":return be(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,n){return n>=0&&n<=6}set(t,n,i,r){return t=Uc(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 hk extends Yt{priority=90;parse(t,n,i,r){const s=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(n){case"c":case"cc":return be(ge(n.length,t),s);case"co":return be(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,n){return n>=0&&n<=6}set(t,n,i,r){return t=Uc(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 pk(e,t,n){const i=Ot(e,n?.in),r=WM(i,n),s=t-r;return ua(i,s,n)}class mk extends Yt{priority=90;parse(t,n,i){const r=s=>s===0?7:s;switch(n){case"i":case"ii":return ge(n.length,t);case"io":return i.ordinalNumber(t,{unit:"day"});case"iii":return be(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 be(i.day(t,{width:"narrow",context:"formatting"}),r);case"iiiiii":return be(i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),r);default:return be(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,n){return n>=1&&n<=7}set(t,n,i){return t=pk(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 gk extends Yt{priority=80;parse(t,n,i){switch(n){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,n,i){return t.setHours(zc(i),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class yk extends Yt{priority=80;parse(t,n,i){switch(n){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,n,i){return t.setHours(zc(i),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class _k extends Yt{priority=80;parse(t,n,i){switch(n){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,n,i){return t.setHours(zc(i),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class bk extends Yt{priority=70;parse(t,n,i){switch(n){case"h":return he(_e.hour12h,t);case"ho":return i.ordinalNumber(t,{unit:"hour"});default:return ge(n.length,t)}}validate(t,n){return n>=1&&n<=12}set(t,n,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 xk extends Yt{priority=70;parse(t,n,i){switch(n){case"H":return he(_e.hour23h,t);case"Ho":return i.ordinalNumber(t,{unit:"hour"});default:return ge(n.length,t)}}validate(t,n){return n>=0&&n<=23}set(t,n,i){return t.setHours(i,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]}class wk extends Yt{priority=70;parse(t,n,i){switch(n){case"K":return he(_e.hour11h,t);case"Ko":return i.ordinalNumber(t,{unit:"hour"});default:return ge(n.length,t)}}validate(t,n){return n>=0&&n<=11}set(t,n,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 vk extends Yt{priority=70;parse(t,n,i){switch(n){case"k":return he(_e.hour24h,t);case"ko":return i.ordinalNumber(t,{unit:"hour"});default:return ge(n.length,t)}}validate(t,n){return n>=1&&n<=24}set(t,n,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 Sk extends Yt{priority=60;parse(t,n,i){switch(n){case"m":return he(_e.minute,t);case"mo":return i.ordinalNumber(t,{unit:"minute"});default:return ge(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,i){return t.setMinutes(i,0,0),t}incompatibleTokens=["t","T"]}class Tk extends Yt{priority=50;parse(t,n,i){switch(n){case"s":return he(_e.second,t);case"so":return i.ordinalNumber(t,{unit:"second"});default:return ge(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,i){return t.setSeconds(i,0),t}incompatibleTokens=["t","T"]}class Mk extends Yt{priority=30;parse(t,n){const i=r=>Math.trunc(r*Math.pow(10,-n.length+3));return be(ge(n.length,t),i)}set(t,n,i){return t.setMilliseconds(i),t}incompatibleTokens=["t","T"]}class kk extends Yt{priority=10;parse(t,n){switch(n){case"X":return Yn(Vn.basicOptionalMinutes,t);case"XX":return Yn(Vn.basic,t);case"XXXX":return Yn(Vn.basicOptionalSeconds,t);case"XXXXX":return Yn(Vn.extendedOptionalSeconds,t);default:return Yn(Vn.extended,t)}}set(t,n,i){return n.timestampIsSet?t:me(t,t.getTime()-da(t)-i)}incompatibleTokens=["t","T","x"]}class Dk extends Yt{priority=10;parse(t,n){switch(n){case"x":return Yn(Vn.basicOptionalMinutes,t);case"xx":return Yn(Vn.basic,t);case"xxxx":return Yn(Vn.basicOptionalSeconds,t);case"xxxxx":return Yn(Vn.extendedOptionalSeconds,t);default:return Yn(Vn.extended,t)}}set(t,n,i){return n.timestampIsSet?t:me(t,t.getTime()-da(t)-i)}incompatibleTokens=["t","T","X"]}class Ck extends Yt{priority=40;parse(t){return Mp(t)}set(t,n,i){return[me(t,i*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class Ak extends Yt{priority=20;parse(t){return Mp(t)}set(t,n,i){return[me(t,i),{timestampIsSet:!0}]}incompatibleTokens="*"}const Ok={G:new GM,y:new KM,Y:new XM,R:new ZM,u:new QM,Q:new JM,q:new tk,M:new ek,L:new nk,w:new rk,I:new ok,d:new ck,D:new uk,E:new dk,e:new fk,c:new hk,i:new mk,a:new gk,b:new yk,B:new _k,h:new bk,H:new xk,K:new wk,k:new vk,m:new Sk,s:new Tk,S:new Mk,X:new kk,x:new Dk,t:new Ck,T:new Ak},Rk=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ek=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Pk=/^'([^]*?)'?$/,Ik=/''/g,Lk=/\S/,Nk=/[a-zA-Z]/;function Bk(e,t,n,i){const r=()=>me(i?.in||n,NaN),s=Sp(),a=i?.locale??s.locale??hp,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 e?r():Ot(n,i?.in);const d={firstWeekContainsDate:l,weekStartsOn:u,locale:a},f=[new jM(i?.in,n)],m=t.match(Ek).map(S=>{const C=S[0];if(C in Bc){const O=Bc[C];return O(S,a.formatLong)}return S}).join("").match(Rk),g=[];for(let S of m){!i?.useAdditionalWeekYearTokens&&vp(S)&&Fc(S,t,e),!i?.useAdditionalDayOfYearTokens&&wp(S)&&Fc(S,t,e);const C=S[0],O=Ok[C];if(O){const{incompatibleTokens:B}=O;if(Array.isArray(B)){const N=g.find(W=>B.includes(W.token)||W.token===C);if(N)throw new RangeError(`The format string mustn't contain \`${N.fullToken}\` and \`${S}\` at the same time`)}else if(O.incompatibleTokens==="*"&&g.length>0)throw new RangeError(`The format string mustn't contain \`${S}\` and any other token at the same time`);g.push({token:C,fullToken:S});const I=O.run(e,S,a.match,d);if(!I)return r();f.push(I.setter),e=I.rest}else{if(C.match(Nk))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");if(S==="''"?S="'":C==="'"&&(S=Fk(S)),e.indexOf(S)===0)e=e.slice(S.length);else return r()}}if(e.length>0&&Lk.test(e))return r();const _=f.map(S=>S.priority).sort((S,C)=>C-S).filter((S,C,O)=>O.indexOf(S)===C).map(S=>f.filter(C=>C.priority===S).sort((C,O)=>O.subPriority-C.subPriority)).map(S=>S[0]);let x=Ot(n,i?.in);if(isNaN(+x))return r();const v={};for(const S of _){if(!S.validate(x,d))return r();const C=S.set(x,v,d);Array.isArray(C)?(x=C[0],Object.assign(v,C[1])):x=C}return x}function Fk(e){return e.match(Pk)[1].replace(Ik,"'")}function zk(e,t){const n=Ot(e,t?.in);return n.setMinutes(0,0,0),n}function Uk(e,t){const n=Ot(e,t?.in);return n.setSeconds(0,0),n}function Hk(e,t){const n=Ot(e,t?.in);return n.setMilliseconds(0),n}function Cp(e){const t=e/zr;return Math.trunc(t)}function Ap(e,t){const n=()=>me(t?.in,NaN),i=t?.additionalDigits??2,r=Yk(e);let s;if(r.date){const d=qk(r.date,i);s=jk(d.restDateString,d.year)}if(!s||isNaN(+s))return n();const a=+s;let l=0,u;if(r.time&&(l=Gk(r.time),isNaN(l)))return n();if(r.timezone){if(u=Kk(r.timezone),isNaN(u))return n()}else{const d=new Date(a+l),f=Ot(0,t?.in);return f.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),f.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),f}return Ot(a+l+u,t?.in)}const pa={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Wk=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,$k=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Vk=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Yk(e){const t={},n=e.split(pa.dateTimeDelimiter);let i;if(n.length>2)return t;if(/:/.test(n[0])?i=n[0]:(t.date=n[0],i=n[1],pa.timeZoneDelimiter.test(t.date)&&(t.date=e.split(pa.timeZoneDelimiter)[0],i=e.substr(t.date.length,e.length))),i){const r=pa.timezone.exec(i);r?(t.time=i.replace(r[1],""),t.timezone=r[1]):t.time=i}return t}function qk(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=e.match(n);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:e.slice((i[1]||i[2]).length)}}function jk(e,t){if(t===null)return new Date(NaN);const n=e.match(Wk);if(!n)return new Date(NaN);const i=!!n[4],r=Fs(n[1]),s=Fs(n[2])-1,a=Fs(n[3]),l=Fs(n[4]),u=Fs(n[5])-1;if(i)return tD(t,l,u)?Xk(t,l,u):new Date(NaN);{const d=new Date(0);return!Qk(t,s,a)||!Jk(t,r)?new Date(NaN):(d.setUTCFullYear(t,s,Math.max(r,a)),d)}}function Fs(e){return e?parseInt(e):1}function Gk(e){const t=e.match($k);if(!t)return NaN;const n=Hc(t[1]),i=Hc(t[2]),r=Hc(t[3]);return eD(n,i,r)?n*zr+i*Ps+r*1e3:NaN}function Hc(e){return e&&parseFloat(e.replace(",","."))||0}function Kk(e){if(e==="Z")return 0;const t=e.match(Vk);if(!t)return 0;const n=t[1]==="+"?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return nD(i,r)?n*(i*zr+r*Ps):NaN}function Xk(e,t,n){const i=new Date(0);i.setUTCFullYear(e,0,4);const r=i.getUTCDay()||7,s=(t-1)*7+n+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const Zk=[31,null,31,30,31,30,31,31,30,31,30,31];function Op(e){return e%400===0||e%4===0&&e%100!==0}function Qk(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(Zk[t]||(Op(e)?29:28))}function Jk(e,t){return t>=1&&t<=(Op(e)?366:365)}function tD(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function eD(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function nD(e,t){return t>=0&&t<=59}const Rp={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})"},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_consumer_group:"AI gateway consumer group",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",share_of_requests:"Share of requests",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",consumer_group:"Consumer group",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",cost_per_request_average:"Cost per request (avg)",share_of_cost:"Share of cost",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",active_agents:"Active agents",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",share_of_requests:"Share of requests",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",cost_per_request_average:"Cost per request (avg)",share_of_cost:"Share of cost",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",active_agents:"Active agents",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 iD(){const e=eh.createI18n("en-us",Rp);return{i18n:e,i18nT:eh.i18nTComponent(e)}}function zs(e){return e+.5|0}const Mi=(e,t,n)=>Math.max(Math.min(e,n),t);function Us(e){return Mi(zs(e*2.55),0,255)}function ki(e){return Mi(zs(e*255),0,255)}function ii(e){return Mi(zs(e/2.55)/100,0,1)}function Ep(e){return Mi(zs(e*100),0,100)}const kn={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},Wc=[..."0123456789ABCDEF"],rD=e=>Wc[e&15],sD=e=>Wc[(e&240)>>4]+Wc[e&15],ma=e=>(e&240)>>4===(e&15),oD=e=>ma(e.r)&&ma(e.g)&&ma(e.b)&&ma(e.a);function aD(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&kn[e[1]]*17,g:255&kn[e[2]]*17,b:255&kn[e[3]]*17,a:t===5?kn[e[4]]*17:255}:(t===7||t===9)&&(n={r:kn[e[1]]<<4|kn[e[2]],g:kn[e[3]]<<4|kn[e[4]],b:kn[e[5]]<<4|kn[e[6]],a:t===9?kn[e[7]]<<4|kn[e[8]]:255})),n}const lD=(e,t)=>e<255?t(e):"";function cD(e){var t=oD(e)?rD:sD;return e?"#"+t(e.r)+t(e.g)+t(e.b)+lD(e.a,t):void 0}const uD=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Pp(e,t,n){const i=t*Math.min(n,1-n),r=(s,a=(s+e/30)%12)=>n-i*Math.max(Math.min(a-3,9-a,1),-1);return[r(0),r(8),r(4)]}function dD(e,t,n){const i=(r,s=(r+e/60)%6)=>n-n*t*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function fD(e,t,n){const i=Pp(e,1,.5);let r;for(t+n>1&&(r=1/(t+n),t*=r,n*=r),r=0;r<3;r++)i[r]*=1-t-n,i[r]+=t;return i}function hD(e,t,n,i,r){return e===r?(t-n)/i+(t<n?6:0):t===r?(n-e)/i+2:(e-t)/i+4}function $c(e){const n=e.r/255,i=e.g/255,r=e.b/255,s=Math.max(n,i,r),a=Math.min(n,i,r),l=(s+a)/2;let u,d,f;return s!==a&&(f=s-a,d=l>.5?f/(2-s-a):f/(s+a),u=hD(n,i,r,f,s),u=u*60+.5),[u|0,d||0,l]}function Vc(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(ki)}function Yc(e,t,n){return Vc(Pp,e,t,n)}function pD(e,t,n){return Vc(fD,e,t,n)}function mD(e,t,n){return Vc(dD,e,t,n)}function Ip(e){return(e%360+360)%360}function gD(e){const t=uD.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?Us(+t[5]):ki(+t[5]));const r=Ip(+t[2]),s=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=pD(r,s,a):t[1]==="hsv"?i=mD(r,s,a):i=Yc(r,s,a),{r:i[0],g:i[1],b:i[2],a:n}}function yD(e,t){var n=$c(e);n[0]=Ip(n[0]+t),n=Yc(n),e.r=n[0],e.g=n[1],e.b=n[2]}function _D(e){if(!e)return;const t=$c(e),n=t[0],i=Ep(t[1]),r=Ep(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${r}%, ${ii(e.a)})`:`hsl(${n}, ${i}%, ${r}%)`}const Lp={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"},Np={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 bD(){const e={},t=Object.keys(Np),n=Object.keys(Lp);let i,r,s,a,l;for(i=0;i<t.length;i++){for(a=l=t[i],r=0;r<n.length;r++)s=n[r],l=l.replace(s,Lp[s]);s=parseInt(Np[a],16),e[l]=[s>>16&255,s>>8&255,s&255]}return e}let ga;function xD(e){ga||(ga=bD(),ga.transparent=[0,0,0,0]);const t=ga[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const wD=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function vD(e){const t=wD.exec(e);let n=255,i,r,s;if(t){if(t[7]!==i){const a=+t[7];n=t[8]?Us(a):Mi(a*255,0,255)}return i=+t[1],r=+t[3],s=+t[5],i=255&(t[2]?Us(i):Mi(i,0,255)),r=255&(t[4]?Us(r):Mi(r,0,255)),s=255&(t[6]?Us(s):Mi(s,0,255)),{r:i,g:r,b:s,a:n}}}function SD(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${ii(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const qc=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Wr=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function TD(e,t,n){const i=Wr(ii(e.r)),r=Wr(ii(e.g)),s=Wr(ii(e.b));return{r:ki(qc(i+n*(Wr(ii(t.r))-i))),g:ki(qc(r+n*(Wr(ii(t.g))-r))),b:ki(qc(s+n*(Wr(ii(t.b))-s))),a:e.a+n*(t.a-e.a)}}function ya(e,t,n){if(e){let i=$c(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=Yc(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function Bp(e,t){return e&&Object.assign(t||{},e)}function Fp(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=ki(e[3]))):(t=Bp(e,{r:0,g:0,b:0,a:1}),t.a=ki(t.a)),t}function MD(e){return e.charAt(0)==="r"?vD(e):gD(e)}class Hs{constructor(t){if(t instanceof Hs)return t;const n=typeof t;let i;n==="object"?i=Fp(t):n==="string"&&(i=aD(t)||xD(t)||MD(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Bp(this._rgb);return t&&(t.a=ii(t.a)),t}set rgb(t){this._rgb=Fp(t)}rgbString(){return this._valid?SD(this._rgb):void 0}hexString(){return this._valid?cD(this._rgb):void 0}hslString(){return this._valid?_D(this._rgb):void 0}mix(t,n){if(t){const i=this.rgb,r=t.rgb;let s;const a=n===s?.5:n,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,n){return t&&(this._rgb=TD(this._rgb,t._rgb,n)),this}clone(){return new Hs(this.rgb)}alpha(t){return this._rgb.a=ki(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=zs(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.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 ya(this._rgb,2,t),this}darken(t){return ya(this._rgb,2,-t),this}saturate(t){return ya(this._rgb,1,t),this}desaturate(t){return ya(this._rgb,1,-t),this}rotate(t){return yD(this._rgb,t),this}}function ri(){}const kD=(()=>{let e=0;return()=>e++})();function St(e){return e==null}function Gt(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function It(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function le(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function mn(e,t){return le(e)?e:t}function Ct(e,t){return typeof e>"u"?t:e}const DD=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,zp=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Jt(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function te(e,t,n,i){let r,s,a;if(Gt(e))for(s=e.length,r=0;r<s;r++)t.call(n,e[r],r);else if(It(e))for(a=Object.keys(e),s=a.length,r=0;r<s;r++)t.call(n,e[a[r]],a[r])}function _a(e,t){let n,i,r,s;if(!e||!t||e.length!==t.length)return!1;for(n=0,i=e.length;n<i;++n)if(r=e[n],s=t[n],r.datasetIndex!==s.datasetIndex||r.index!==s.index)return!1;return!0}function ba(e){if(Gt(e))return e.map(ba);if(It(e)){const t=Object.create(null),n=Object.keys(e),i=n.length;let r=0;for(;r<i;++r)t[n[r]]=ba(e[n[r]]);return t}return e}function Up(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function CD(e,t,n,i){if(!Up(e))return;const r=t[e],s=n[e];It(r)&&It(s)?Ws(r,s,i):t[e]=ba(s)}function Ws(e,t,n){const i=Gt(t)?t:[t],r=i.length;if(!It(e))return e;n=n||{};const s=n.merger||CD;let a;for(let l=0;l<r;++l){if(a=i[l],!It(a))continue;const u=Object.keys(a);for(let d=0,f=u.length;d<f;++d)s(u[d],e,a,n)}return e}function $s(e,t){return Ws(e,t,{merger:AD})}function AD(e,t,n){if(!Up(e))return;const i=t[e],r=n[e];It(i)&&It(r)?$s(i,r):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=ba(r))}const Hp={"":e=>e,x:e=>e.x,y:e=>e.y};function OD(e){const t=e.split("."),n=[];let i="";for(const r of t)i+=r,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function RD(e){const t=OD(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function Di(e,t){return(Hp[t]||(Hp[t]=RD(t)))(e)}function jc(e){return e.charAt(0).toUpperCase()+e.slice(1)}const rn=e=>typeof e<"u",sn=e=>typeof e=="function",Wp=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function ED(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Et=Math.PI,ee=2*Et,PD=ee+Et,xa=Number.POSITIVE_INFINITY,Gc=Et/180,se=Et/2,Dn=Et/4,wa=Et*2/3,Ci=Math.log10,qn=Math.sign;function Vs(e,t,n){return Math.abs(e-t)<n}function $p(e){const t=Math.round(e);e=Vs(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(Ci(e))),i=e/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function ID(e){const t=[],n=Math.sqrt(e);let i;for(i=1;i<n;i++)e%i===0&&(t.push(i),t.push(e/i));return n===(n|0)&&t.push(n),t.sort((r,s)=>r-s).pop(),t}function LD(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Ai(e){return!LD(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function ND(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function Vp(e,t,n){let i,r,s;for(i=0,r=e.length;i<r;i++)s=e[i][n],isNaN(s)||(t.min=Math.min(t.min,s),t.max=Math.max(t.max,s))}function ve(e){return e*(Et/180)}function va(e){return e*(180/Et)}function Yp(e){if(!le(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function Sa(e,t){const n=t.x-e.x,i=t.y-e.y,r=Math.sqrt(n*n+i*i);let s=Math.atan2(i,n);return s<-.5*Et&&(s+=ee),{angle:s,distance:r}}function $r(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function BD(e,t){return(e-t+PD)%ee-Et}function He(e){return(e%ee+ee)%ee}function Ys(e,t,n,i){const r=He(e),s=He(t),a=He(n),l=He(s-r),u=He(a-r),d=He(r-s),f=He(r-a);return r===s||r===a||i&&s===a||l>u&&d<f}function Re(e,t,n){return Math.max(t,Math.min(n,e))}function FD(e){return Re(e,-32768,32767)}function si(e,t,n,i=1e-6){return e>=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function Kc(e,t,n){n=n||(a=>e[a]<t);let i=e.length-1,r=0,s;for(;i-r>1;)s=r+i>>1,n(s)?r=s:i=s;return{lo:r,hi:i}}const oi=(e,t,n,i)=>Kc(e,n,i?r=>{const s=e[r][t];return s<n||s===n&&e[r+1][t]===n}:r=>e[r][t]<n),zD=(e,t,n)=>Kc(e,n,i=>e[i][t]>=n);function UD(e,t,n){let i=0,r=e.length;for(;i<r&&e[i]<t;)i++;for(;r>i&&e[r-1]>n;)r--;return i>0||r<e.length?e.slice(i,r):e}const qp=["push","pop","shift","splice","unshift"];function HD(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),qp.forEach(n=>{const i="_onData"+jc(n),r=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...s){const a=r.apply(this,s);return e._chartjs.listeners.forEach(l=>{typeof l[i]=="function"&&l[i](...s)}),a}})})}function jp(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,r=i.indexOf(t);r!==-1&&i.splice(r,1),!(i.length>0)&&(qp.forEach(s=>{delete e[s]}),delete e._chartjs)}function Gp(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const Kp=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function Xp(e,t){let n=[],i=!1;return function(...r){n=r,i||(i=!0,Kp.call(window,()=>{i=!1,e.apply(t,n)}))}}function WD(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const Xc=e=>e==="start"?"left":e==="end"?"right":"center",We=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,$D=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function Zp(e,t,n){const i=t.length;let r=0,s=i;if(e._sorted){const{iScale:a,vScale:l,_parsed:u}=e,d=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,f=a.axis,{min:m,max:g,minDefined:_,maxDefined:x}=a.getUserBounds();if(_){if(r=Math.min(oi(u,f,m).lo,n?i:oi(t,f,a.getPixelForValue(m)).lo),d){const v=u.slice(0,r+1).reverse().findIndex(S=>!St(S[l.axis]));r-=Math.max(0,v)}r=Re(r,0,i-1)}if(x){let v=Math.max(oi(u,a.axis,g,!0).hi+1,n?0:oi(t,f,a.getPixelForValue(g),!0).hi+1);if(d){const S=u.slice(v-1).findIndex(C=>!St(C[l.axis]));v+=Math.max(0,S)}s=Re(v,r,i)-r}else s=i-r}return{start:r,count:s}}function Qp(e){const{xScale:t,yScale:n,_scaleRanges:i}=e,r={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=r,!0;const s=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,r),s}const Ta=e=>e===0||e===1,Jp=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*ee/n)),tm=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*ee/n)+1,qs={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*se)+1,easeOutSine:e=>Math.sin(e*se),easeInOutSine:e=>-.5*(Math.cos(Et*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>Ta(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Ta(e)?e:Jp(e,.075,.3),easeOutElastic:e=>Ta(e)?e:tm(e,.075,.3),easeInOutElastic(e){return Ta(e)?e:e<.5?.5*Jp(e*2,.1125,.45):.5+.5*tm(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-qs.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?qs.easeInBounce(e*2)*.5:qs.easeOutBounce(e*2-1)*.5+.5};function Zc(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Ma(e){return Zc(e)?e:new Hs(e)}function Qc(e){return Zc(e)?e:new Hs(e).saturate(.5).darken(.1).hexString()}const VD=["x","y","borderWidth","radius","tension"],YD=["color","borderColor","backgroundColor"];function qD(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:YD},numbers:{type:"number",properties:VD}}),e.describe("animations",{_fallback:"animation"}),e.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 jD(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const em=new Map;function GD(e,t){t=t||{};const n=e+JSON.stringify(t);let i=em.get(n);return i||(i=new Intl.NumberFormat(e,t),em.set(n,i)),i}function js(e,t,n){return GD(t,n).format(e)}const nm={values(e){return Gt(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const i=this.chart.options.locale;let r,s=e;if(n.length>1){const d=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(d<1e-4||d>1e15)&&(r="scientific"),s=KD(e,n)}const a=Ci(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),js(e,i,u)},logarithmic(e,t,n){if(e===0)return"0";const i=n[t].significand||e/Math.pow(10,Math.floor(Ci(e)));return[1,2,3,5,10,15].includes(i)||t>.8*n.length?nm.numeric.call(this,e,t,n):""}};function KD(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var ka={formatters:nm};function XD(e){e.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,n)=>n.lineWidth,tickColor:(t,n)=>n.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:ka.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const ar=Object.create(null),Jc=Object.create(null);function Gs(e,t){if(!t)return e;const n=t.split(".");for(let i=0,r=n.length;i<r;++i){const s=n[i];e=e[s]||(e[s]=Object.create(null))}return e}function tu(e,t,n){return typeof t=="string"?Ws(Gs(e,t),n):Ws(Gs(e,""),t)}class ZD{constructor(t,n){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)=>Qc(r.backgroundColor),this.hoverBorderColor=(i,r)=>Qc(r.borderColor),this.hoverColor=(i,r)=>Qc(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(n)}set(t,n){return tu(this,t,n)}get(t){return Gs(this,t)}describe(t,n){return tu(Jc,t,n)}override(t,n){return tu(ar,t,n)}route(t,n,i,r){const s=Gs(this,t),a=Gs(this,i),l="_"+n;Object.defineProperties(s,{[l]:{value:s[n],writable:!0},[n]:{enumerable:!0,get(){const u=this[l],d=a[r];return It(u)?Object.assign({},d,u):Ct(u,d)},set(u){this[l]=u}}})}apply(t){t.forEach(n=>n(this))}}var oe=new ZD({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[qD,jD,XD]);function QD(e){return!e||St(e.size)||St(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Da(e,t,n,i,r){let s=t[r];return s||(s=t[r]=e.measureText(r).width,n.push(r)),s>i&&(i=s),i}function JD(e,t,n,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),e.save(),e.font=t;let a=0;const l=n.length;let u,d,f,m,g;for(u=0;u<l;u++)if(m=n[u],m!=null&&!Gt(m))a=Da(e,r,s,a,m);else if(Gt(m))for(d=0,f=m.length;d<f;d++)g=m[d],g!=null&&!Gt(g)&&(a=Da(e,r,s,a,g));e.restore();const _=s.length/2;if(_>n.length){for(u=0;u<_;u++)delete r[s[u]];s.splice(0,_)}return a}function lr(e,t,n){const i=e.currentDevicePixelRatio,r=n!==0?Math.max(n/2,.5):0;return Math.round((t-r)*i)/i+r}function im(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function eu(e,t,n,i){rm(e,t,n,i,null)}function rm(e,t,n,i,r){let s,a,l,u,d,f,m,g;const _=t.pointStyle,x=t.rotation,v=t.radius;let S=(x||0)*Gc;if(_&&typeof _=="object"&&(s=_.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){e.save(),e.translate(n,i),e.rotate(S),e.drawImage(_,-_.width/2,-_.height/2,_.width,_.height),e.restore();return}if(!(isNaN(v)||v<=0)){switch(e.beginPath(),_){default:r?e.ellipse(n,i,r/2,v,0,0,ee):e.arc(n,i,v,0,ee),e.closePath();break;case"triangle":f=r?r/2:v,e.moveTo(n+Math.sin(S)*f,i-Math.cos(S)*v),S+=wa,e.lineTo(n+Math.sin(S)*f,i-Math.cos(S)*v),S+=wa,e.lineTo(n+Math.sin(S)*f,i-Math.cos(S)*v),e.closePath();break;case"rectRounded":d=v*.516,u=v-d,a=Math.cos(S+Dn)*u,m=Math.cos(S+Dn)*(r?r/2-d:u),l=Math.sin(S+Dn)*u,g=Math.sin(S+Dn)*(r?r/2-d:u),e.arc(n-m,i-l,d,S-Et,S-se),e.arc(n+g,i-a,d,S-se,S),e.arc(n+m,i+l,d,S,S+se),e.arc(n-g,i+a,d,S+se,S+Et),e.closePath();break;case"rect":if(!x){u=Math.SQRT1_2*v,f=r?r/2:u,e.rect(n-f,i-u,2*f,2*u);break}S+=Dn;case"rectRot":m=Math.cos(S)*(r?r/2:v),a=Math.cos(S)*v,l=Math.sin(S)*v,g=Math.sin(S)*(r?r/2:v),e.moveTo(n-m,i-l),e.lineTo(n+g,i-a),e.lineTo(n+m,i+l),e.lineTo(n-g,i+a),e.closePath();break;case"crossRot":S+=Dn;case"cross":m=Math.cos(S)*(r?r/2:v),a=Math.cos(S)*v,l=Math.sin(S)*v,g=Math.sin(S)*(r?r/2:v),e.moveTo(n-m,i-l),e.lineTo(n+m,i+l),e.moveTo(n+g,i-a),e.lineTo(n-g,i+a);break;case"star":m=Math.cos(S)*(r?r/2:v),a=Math.cos(S)*v,l=Math.sin(S)*v,g=Math.sin(S)*(r?r/2:v),e.moveTo(n-m,i-l),e.lineTo(n+m,i+l),e.moveTo(n+g,i-a),e.lineTo(n-g,i+a),S+=Dn,m=Math.cos(S)*(r?r/2:v),a=Math.cos(S)*v,l=Math.sin(S)*v,g=Math.sin(S)*(r?r/2:v),e.moveTo(n-m,i-l),e.lineTo(n+m,i+l),e.moveTo(n+g,i-a),e.lineTo(n-g,i+a);break;case"line":a=r?r/2:Math.cos(S)*v,l=Math.sin(S)*v,e.moveTo(n-a,i-l),e.lineTo(n+a,i+l);break;case"dash":e.moveTo(n,i),e.lineTo(n+Math.cos(S)*(r?r/2:v),i+Math.sin(S)*v);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function ai(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function Ks(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Xs(e){e.restore()}function tC(e,t,n,i,r){if(!t)return e.lineTo(n.x,n.y);if(r==="middle"){const s=(t.x+n.x)/2;e.lineTo(s,t.y),e.lineTo(s,n.y)}else r==="after"!=!!i?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function eC(e,t,n,i){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?n.cp2x:n.cp1x,i?n.cp2y:n.cp1y,n.x,n.y)}function nC(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),St(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function iC(e,t,n,i,r){if(r.strikethrough||r.underline){const s=e.measureText(i),a=t-s.actualBoundingBoxLeft,l=t+s.actualBoundingBoxRight,u=n-s.actualBoundingBoxAscent,d=n+s.actualBoundingBoxDescent,f=r.strikethrough?(u+d)/2:d;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=r.decorationWidth||2,e.moveTo(a,f),e.lineTo(l,f),e.stroke()}}function rC(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function cr(e,t,n,i,r,s={}){const a=Gt(t)?t:[t],l=s.strokeWidth>0&&s.strokeColor!=="";let u,d;for(e.save(),e.font=r.string,nC(e,s),u=0;u<a.length;++u)d=a[u],s.backdrop&&rC(e,s.backdrop),l&&(s.strokeColor&&(e.strokeStyle=s.strokeColor),St(s.strokeWidth)||(e.lineWidth=s.strokeWidth),e.strokeText(d,n,i,s.maxWidth)),e.fillText(d,n,i,s.maxWidth),iC(e,n,i,d,s),i+=Number(r.lineHeight);e.restore()}function Vr(e,t){const{x:n,y:i,w:r,h:s,radius:a}=t;e.arc(n+a.topLeft,i+a.topLeft,a.topLeft,1.5*Et,Et,!0),e.lineTo(n,i+s-a.bottomLeft),e.arc(n+a.bottomLeft,i+s-a.bottomLeft,a.bottomLeft,Et,se,!0),e.lineTo(n+r-a.bottomRight,i+s),e.arc(n+r-a.bottomRight,i+s-a.bottomRight,a.bottomRight,se,0,!0),e.lineTo(n+r,i+a.topRight),e.arc(n+r-a.topRight,i+a.topRight,a.topRight,0,-se,!0),e.lineTo(n+a.topLeft,i)}const sC=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,oC=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function aC(e,t){const n=(""+e).match(sC);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const lC=e=>+e||0;function nu(e,t){const n={},i=It(t),r=i?Object.keys(t):t,s=It(e)?i?a=>Ct(e[a],e[t[a]]):a=>e[a]:()=>e;for(const a of r)n[a]=lC(s(a));return n}function sm(e){return nu(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Oi(e){return nu(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Se(e){const t=sm(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function ce(e,t){e=e||{},t=t||oe.font;let n=Ct(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=Ct(e.style,t.style);i&&!(""+i).match(oC)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:Ct(e.family,t.family),lineHeight:aC(Ct(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:Ct(e.weight,t.weight),string:""};return r.string=QD(r),r}function Zs(e,t,n,i){let r,s,a;for(r=0,s=e.length;r<s;++r)if(a=e[r],a!==void 0&&a!==void 0)return a}function cC(e,t,n){const{min:i,max:r}=e,s=zp(t,(r-i)/2),a=(l,u)=>n&&l===0?0:l+u;return{min:a(i,-Math.abs(s)),max:a(r,s)}}function Ri(e,t){return Object.assign(Object.create(e),t)}function iu(e,t=[""],n,i,r=()=>e[0]){const s=n||e;typeof i>"u"&&(i=um("_fallback",e));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:s,_fallback:i,_getTarget:r,override:l=>iu([l,...e],t,s,i)};return new Proxy(a,{deleteProperty(l,u){return delete l[u],delete l._keys,delete e[0][u],!0},get(l,u){return am(l,u,()=>yC(u,t,e,l))},getOwnPropertyDescriptor(l,u){return Reflect.getOwnPropertyDescriptor(l._scopes[0],u)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(l,u){return dm(l).includes(u)},ownKeys(l){return dm(l)},set(l,u,d){const f=l._storage||(l._storage=r());return l[u]=f[u]=d,delete l._keys,!0}})}function Yr(e,t,n,i){const r={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:om(e,i),setContext:s=>Yr(e,s,n,i),override:s=>Yr(e.override(s),t,n,i)};return new Proxy(r,{deleteProperty(s,a){return delete s[a],delete e[a],!0},get(s,a,l){return am(s,a,()=>dC(s,a,l))},getOwnPropertyDescriptor(s,a){return s._descriptors.allKeys?Reflect.has(e,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,a)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(s,a){return Reflect.has(e,a)},ownKeys(){return Reflect.ownKeys(e)},set(s,a,l){return e[a]=l,delete s[a],!0}})}function om(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:r=t.allKeys}=e;return{allKeys:r,scriptable:n,indexable:i,isScriptable:sn(n)?n:()=>n,isIndexable:sn(i)?i:()=>i}}const uC=(e,t)=>e?e+jc(t):t,ru=(e,t)=>It(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function am(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const i=n();return e[t]=i,i}function dC(e,t,n){const{_proxy:i,_context:r,_subProxy:s,_descriptors:a}=e;let l=i[t];return sn(l)&&a.isScriptable(t)&&(l=fC(t,l,e,n)),Gt(l)&&l.length&&(l=hC(t,l,e,a.isIndexable)),ru(t,l)&&(l=Yr(l,r,s&&s[t],a)),l}function fC(e,t,n,i){const{_proxy:r,_context:s,_subProxy:a,_stack:l}=n;if(l.has(e))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+e);l.add(e);let u=t(s,a||i);return l.delete(e),ru(e,u)&&(u=su(r._scopes,r,e,u)),u}function hC(e,t,n,i){const{_proxy:r,_context:s,_subProxy:a,_descriptors:l}=n;if(typeof s.index<"u"&&i(e))return t[s.index%t.length];if(It(t[0])){const u=t,d=r._scopes.filter(f=>f!==u);t=[];for(const f of u){const m=su(d,r,e,f);t.push(Yr(m,s,a&&a[e],l))}}return t}function lm(e,t,n){return sn(e)?e(t,n):e}const pC=(e,t)=>e===!0?t:typeof e=="string"?Di(t,e):void 0;function mC(e,t,n,i,r){for(const s of t){const a=pC(n,s);if(a){e.add(a);const l=lm(a._fallback,n,r);if(typeof l<"u"&&l!==n&&l!==i)return l}else if(a===!1&&typeof i<"u"&&n!==i)return null}return!1}function su(e,t,n,i){const r=t._rootScopes,s=lm(t._fallback,n,i),a=[...e,...r],l=new Set;l.add(i);let u=cm(l,a,n,s||n,i);return u===null||typeof s<"u"&&s!==n&&(u=cm(l,a,s,u,i),u===null)?!1:iu(Array.from(l),[""],r,s,()=>gC(t,n,i))}function cm(e,t,n,i,r){for(;n;)n=mC(e,t,n,i,r);return n}function gC(e,t,n){const i=e._getTarget();t in i||(i[t]={});const r=i[t];return Gt(r)&&It(n)?n:r||{}}function yC(e,t,n,i){let r;for(const s of t)if(r=um(uC(s,e),n),typeof r<"u")return ru(e,r)?su(n,i,e,r):r}function um(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function dm(e){let t=e._keys;return t||(t=e._keys=_C(e._scopes)),t}function _C(e){const t=new Set;for(const n of e)for(const i of Object.keys(n).filter(r=>!r.startsWith("_")))t.add(i);return Array.from(t)}function fm(e,t,n,i){const{iScale:r}=e,{key:s="r"}=this._parsing,a=new Array(i);let l,u,d,f;for(l=0,u=i;l<u;++l)d=l+n,f=t[d],a[l]={r:r.parse(Di(f,s),d)};return a}const bC=Number.EPSILON||1e-14,qr=(e,t)=>t<e.length&&!e[t].skip&&e[t],hm=e=>e==="x"?"y":"x";function xC(e,t,n,i){const r=e.skip?t:e,s=t,a=n.skip?t:n,l=$r(s,r),u=$r(a,s);let d=l/(l+u),f=u/(l+u);d=isNaN(d)?0:d,f=isNaN(f)?0:f;const m=i*d,g=i*f;return{previous:{x:s.x-m*(a.x-r.x),y:s.y-m*(a.y-r.y)},next:{x:s.x+g*(a.x-r.x),y:s.y+g*(a.y-r.y)}}}function wC(e,t,n){const i=e.length;let r,s,a,l,u,d=qr(e,0);for(let f=0;f<i-1;++f)if(u=d,d=qr(e,f+1),!(!u||!d)){if(Vs(t[f],0,bC)){n[f]=n[f+1]=0;continue}r=n[f]/t[f],s=n[f+1]/t[f],l=Math.pow(r,2)+Math.pow(s,2),!(l<=9)&&(a=3/Math.sqrt(l),n[f]=r*a*t[f],n[f+1]=s*a*t[f])}}function vC(e,t,n="x"){const i=hm(n),r=e.length;let s,a,l,u=qr(e,0);for(let d=0;d<r;++d){if(a=l,l=u,u=qr(e,d+1),!l)continue;const f=l[n],m=l[i];a&&(s=(f-a[n])/3,l[`cp1${n}`]=f-s,l[`cp1${i}`]=m-s*t[d]),u&&(s=(u[n]-f)/3,l[`cp2${n}`]=f+s,l[`cp2${i}`]=m+s*t[d])}}function SC(e,t="x"){const n=hm(t),i=e.length,r=Array(i).fill(0),s=Array(i);let a,l,u,d=qr(e,0);for(a=0;a<i;++a)if(l=u,u=d,d=qr(e,a+1),!!u){if(d){const f=d[t]-u[t];r[a]=f!==0?(d[n]-u[n])/f:0}s[a]=l?d?qn(r[a-1])!==qn(r[a])?0:(r[a-1]+r[a])/2:r[a-1]:r[a]}wC(e,r,s),vC(e,s,t)}function Ca(e,t,n){return Math.max(Math.min(e,n),t)}function TC(e,t){let n,i,r,s,a,l=ai(e[0],t);for(n=0,i=e.length;n<i;++n)a=s,s=l,l=n<i-1&&ai(e[n+1],t),s&&(r=e[n],a&&(r.cp1x=Ca(r.cp1x,t.left,t.right),r.cp1y=Ca(r.cp1y,t.top,t.bottom)),l&&(r.cp2x=Ca(r.cp2x,t.left,t.right),r.cp2y=Ca(r.cp2y,t.top,t.bottom)))}function MC(e,t,n,i,r){let s,a,l,u;if(t.spanGaps&&(e=e.filter(d=>!d.skip)),t.cubicInterpolationMode==="monotone")SC(e,r);else{let d=i?e[e.length-1]:e[0];for(s=0,a=e.length;s<a;++s)l=e[s],u=xC(d,l,e[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&&TC(e,n)}function ou(){return typeof window<"u"&&typeof document<"u"}function au(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Aa(e,t,n){let i;return typeof e=="string"?(i=parseInt(e,10),e.indexOf("%")!==-1&&(i=i/100*t.parentNode[n])):i=e,i}const Oa=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function kC(e,t){return Oa(e).getPropertyValue(t)}const DC=["top","right","bottom","left"];function ur(e,t,n){const i={};n=n?"-"+n:"";for(let r=0;r<4;r++){const s=DC[r];i[s]=parseFloat(e[t+"-"+s+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const CC=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function AC(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:r,offsetY:s}=i;let a=!1,l,u;if(CC(r,s,e.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 Ei(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,r=Oa(n),s=r.boxSizing==="border-box",a=ur(r,"padding"),l=ur(r,"border","width"),{x:u,y:d,box:f}=AC(e,n),m=a.left+(f&&l.left),g=a.top+(f&&l.top);let{width:_,height:x}=t;return s&&(_-=a.width+l.width,x-=a.height+l.height),{x:Math.round((u-m)/_*n.width/i),y:Math.round((d-g)/x*n.height/i)}}function OC(e,t,n){let i,r;if(t===void 0||n===void 0){const s=e&&au(e);if(!s)t=e.clientWidth,n=e.clientHeight;else{const a=s.getBoundingClientRect(),l=Oa(s),u=ur(l,"border","width"),d=ur(l,"padding");t=a.width-d.width-u.width,n=a.height-d.height-u.height,i=Aa(l.maxWidth,s,"clientWidth"),r=Aa(l.maxHeight,s,"clientHeight")}}return{width:t,height:n,maxWidth:i||xa,maxHeight:r||xa}}const Pi=e=>Math.round(e*10)/10;function RC(e,t,n,i){const r=Oa(e),s=ur(r,"margin"),a=Aa(r.maxWidth,e,"clientWidth")||xa,l=Aa(r.maxHeight,e,"clientHeight")||xa,u=OC(e,t,n);let{width:d,height:f}=u;if(r.boxSizing==="content-box"){const g=ur(r,"border","width"),_=ur(r,"padding");d-=_.width+g.width,f-=_.height+g.height}return d=Math.max(0,d-s.width),f=Math.max(0,i?d/i:f-s.height),d=Pi(Math.min(d,a,u.maxWidth)),f=Pi(Math.min(f,l,u.maxHeight)),d&&!f&&(f=Pi(d/2)),(t!==void 0||n!==void 0)&&i&&u.height&&f>u.height&&(f=u.height,d=Pi(Math.floor(f*i))),{width:d,height:f}}function pm(e,t,n){const i=t||1,r=Pi(e.height*i),s=Pi(e.width*i);e.height=Pi(e.height),e.width=Pi(e.width);const a=e.canvas;return a.style&&(n||!a.style.height&&!a.style.width)&&(a.style.height=`${e.height}px`,a.style.width=`${e.width}px`),e.currentDevicePixelRatio!==i||a.height!==r||a.width!==s?(e.currentDevicePixelRatio=i,a.height=r,a.width=s,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}const EC=(function(){let e=!1;try{const t={get passive(){return e=!0,!1}};ou()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();function mm(e,t){const n=kC(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function dr(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function PC(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:i==="middle"?n<.5?e.y:t.y:i==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function IC(e,t,n,i){const r={x:e.cp2x,y:e.cp2y},s={x:t.cp1x,y:t.cp1y},a=dr(e,r,n),l=dr(r,s,n),u=dr(s,t,n),d=dr(a,l,n),f=dr(l,u,n);return dr(d,f,n)}const LC=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,i){return n-i},leftForLtr(n,i){return n-i}}},NC=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function jr(e,t,n){return e?LC(t,n):NC()}function gm(e,t){let n,i;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)}function ym(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function _m(e){return e==="angle"?{between:Ys,compare:BD,normalize:He}:{between:si,compare:(t,n)=>t-n,normalize:t=>t}}function bm({start:e,end:t,count:n,loop:i,style:r}){return{start:e%n,end:t%n,loop:i&&(t-e+1)%n===0,style:r}}function BC(e,t,n){const{property:i,start:r,end:s}=n,{between:a,normalize:l}=_m(i),u=t.length;let{start:d,end:f,loop:m}=e,g,_;if(m){for(d+=u,f+=u,g=0,_=u;g<_&&a(l(t[d%u][i]),r,s);++g)d--,f--;d%=u,f%=u}return f<d&&(f+=u),{start:d,end:f,loop:m,style:e.style}}function xm(e,t,n){if(!n)return[e];const{property:i,start:r,end:s}=n,a=t.length,{compare:l,between:u,normalize:d}=_m(i),{start:f,end:m,loop:g,style:_}=BC(e,t,n),x=[];let v=!1,S=null,C,O,B;const I=()=>u(r,B,C)&&l(r,B)!==0,N=()=>l(s,C)===0||u(s,B,C),W=()=>v||I(),U=()=>!v||N();for(let D=f,w=f;D<=m;++D)O=t[D%a],!O.skip&&(C=d(O[i]),C!==B&&(v=u(C,r,s),S===null&&W()&&(S=l(C,r)===0?D:w),S!==null&&U()&&(x.push(bm({start:S,end:D,loop:g,count:a,style:_})),S=null),w=D,B=C));return S!==null&&x.push(bm({start:S,end:m,loop:g,count:a,style:_})),x}function wm(e,t){const n=[],i=e.segments;for(let r=0;r<i.length;r++){const s=xm(i[r],e.points,t);s.length&&n.push(...s)}return n}function FC(e,t,n,i){let r=0,s=t-1;if(n&&!i)for(;r<t&&!e[r].skip;)r++;for(;r<t&&e[r].skip;)r++;for(r%=t,n&&(s+=r);s>r&&e[s%t].skip;)s--;return s%=t,{start:r,end:s}}function zC(e,t,n,i){const r=e.length,s=[];let a=t,l=e[t],u;for(u=t+1;u<=n;++u){const d=e[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 UC(e,t){const n=e.points,i=e.options.spanGaps,r=n.length;if(!r)return[];const s=!!e._loop,{start:a,end:l}=FC(n,r,s,i);if(i===!0)return vm(e,[{start:a,end:l,loop:s}],n,t);const u=l<a?l+r:l,d=!!e._fullLoop&&a===0&&l===r-1;return vm(e,zC(n,a,u,d),n,t)}function vm(e,t,n,i){return!i||!i.setContext||!n?t:HC(e,t,n,i)}function HC(e,t,n,i){const r=e._chart.getContext(),s=Sm(e.options),{_datasetIndex:a,options:{spanGaps:l}}=e,u=n.length,d=[];let f=s,m=t[0].start,g=m;function _(x,v,S,C){const O=l?-1:1;if(x!==v){for(x+=u;n[x%u].skip;)x-=O;for(;n[v%u].skip;)v+=O;x%u!==v%u&&(d.push({start:x%u,end:v%u,loop:S,style:C}),f=C,m=v%u)}}for(const x of t){m=l?m:x.start;let v=n[m%u],S;for(g=m+1;g<=x.end;g++){const C=n[g%u];S=Sm(i.setContext(Ri(r,{type:"segment",p0:v,p1:C,p0DataIndex:(g-1)%u,p1DataIndex:g%u,datasetIndex:a}))),WC(S,f)&&_(m,g-1,x.loop,f),v=C,f=S}m<g-1&&_(m,g-1,x.loop,f)}return d}function Sm(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function WC(e,t){if(!t)return!1;const n=[],i=function(r,s){return Zc(s)?(n.includes(s)||n.push(s),n.indexOf(s)):s};return JSON.stringify(e,i)!==JSON.stringify(t,i)}function Ra(e,t,n){return e.options.clip?e[n]:t[n]}function $C(e,t){const{xScale:n,yScale:i}=e;return n&&i?{left:Ra(n,t,"left"),right:Ra(n,t,"right"),top:Ra(i,t,"top"),bottom:Ra(i,t,"bottom")}:t}function Tm(e,t){const n=t._clip;if(n.disabled)return!1;const i=$C(t,e.chartArea);return{left:n.left===!1?0:i.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:i.right+(n.right===!0?0:n.right),top:n.top===!1?0:i.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:i.bottom+(n.bottom===!0?0:n.bottom)}}class VC{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,i,r){const s=n.listeners[r],a=n.duration;s.forEach(l=>l({chart:t,initial:n.initial,numSteps:a,currentStep:Math.min(i-n.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=Kp.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=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),n+=s.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((i,r)=>Math.max(i,r._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const i=n.items;let r=i.length-1;for(;r>=0;--r)i[r].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var li=new VC;const Mm="transparent",YC={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=Ma(e||Mm),r=i.valid&&Ma(t||Mm);return r&&r.valid?r.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class qC{constructor(t,n,i,r){const s=n[i];r=Zs([t.to,r,s,t.from]);const a=Zs([t.from,s,r]);this._active=!0,this._fn=t.fn||YC[t.type||typeof a],this._easing=qs[t.easing]||qs.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=i,this._from=a,this._to=r,this._promises=void 0}active(){return this._active}update(t,n,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=Zs([t.to,n,r,t.from]),this._from=Zs([t.from,r,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=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||n<i),!this._active){this._target[r]=l,this._notify(!0);return}if(n<0){this._target[r]=s;return}u=n/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((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let r=0;r<i.length;r++)i[r][n]()}}class lu{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!It(t))return;const n=Object.keys(oe.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{const s=t[r];if(!It(s))return;const a={};for(const l of n)a[l]=s[l];(Gt(s.properties)&&s.properties||[r]).forEach(l=>{(l===r||!i.has(l))&&i.set(l,a)})})}_animateOptions(t,n){const i=n.options,r=GC(t,i);if(!r)return[];const s=this._createAnimations(r,i);return i.$shared&&jC(t.options.$animations,i).then(()=>{t.options=i},()=>{}),s}_createAnimations(t,n){const i=this._properties,r=[],s=t.$animations||(t.$animations={}),a=Object.keys(n),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,n));continue}const f=n[d];let m=s[d];const g=i.get(d);if(m)if(g&&m.active()){m.update(g,f,l);continue}else m.cancel();if(!g||!g.duration){t[d]=f;continue}s[d]=m=new qC(g,t,d,f),r.push(m)}return r}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return li.add(this._chart,i),!0}}function jC(e,t){const n=[],i=Object.keys(t);for(let r=0;r<i.length;r++){const s=e[i[r]];s&&s.active()&&n.push(s.wait())}return Promise.all(n)}function GC(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function km(e,t){const n=e&&e.options||{},i=n.reverse,r=n.min===void 0?t:0,s=n.max===void 0?t:0;return{start:i?s:r,end:i?r:s}}function KC(e,t,n){if(n===!1)return!1;const i=km(e,n),r=km(t,n);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}function XC(e){let t,n,i,r;return It(e)?(t=e.top,n=e.right,i=e.bottom,r=e.left):t=n=i=r=e,{top:t,right:n,bottom:i,left:r,disabled:e===!1}}function Dm(e,t){const n=[],i=e._getSortedDatasetMetas(t);let r,s;for(r=0,s=i.length;r<s;++r)n.push(i[r].index);return n}function Cm(e,t,n,i={}){const r=e.keys,s=i.mode==="single";let a,l,u,d;if(t===null)return;let f=!1;for(a=0,l=r.length;a<l;++a){if(u=+r[a],u===n){if(f=!0,i.all)continue;break}d=e.values[u],le(d)&&(s||t===0||qn(t)===qn(d))&&(t+=d)}return!f&&!i.all?0:t}function ZC(e,t){const{iScale:n,vScale:i}=t,r=n.axis==="x"?"x":"y",s=i.axis==="x"?"x":"y",a=Object.keys(e),l=new Array(a.length);let u,d,f;for(u=0,d=a.length;u<d;++u)f=a[u],l[u]={[r]:f,[s]:e[f]};return l}function cu(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function QC(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function JC(e){const{min:t,max:n,minDefined:i,maxDefined:r}=e.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:r?n:Number.POSITIVE_INFINITY}}function tA(e,t,n){const i=e[t]||(e[t]={});return i[n]||(i[n]={})}function Am(e,t,n,i){for(const r of t.getMatchingVisibleMetas(i).reverse()){const s=e[r.index];if(n&&s>0||!n&&s<0)return r.index}return null}function Om(e,t){const{chart:n,_cachedMeta:i}=e,r=n._stacks||(n._stacks={}),{iScale:s,vScale:a,index:l}=i,u=s.axis,d=a.axis,f=QC(s,a,i),m=t.length;let g;for(let _=0;_<m;++_){const x=t[_],{[u]:v,[d]:S}=x,C=x._stacks||(x._stacks={});g=C[d]=tA(r,f,v),g[l]=S,g._top=Am(g,a,!0,i.type),g._bottom=Am(g,a,!1,i.type);const O=g._visualValues||(g._visualValues={});O[l]=S}}function uu(e,t){const n=e.scales;return Object.keys(n).filter(i=>n[i].axis===t).shift()}function eA(e,t){return Ri(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function nA(e,t,n){return Ri(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Qs(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const r of t){const s=r._stacks;if(!s||s[i]===void 0||s[i][n]===void 0)return;delete s[i][n],s[i]._visualValues!==void 0&&s[i]._visualValues[n]!==void 0&&delete s[i]._visualValues[n]}}}const du=e=>e==="reset"||e==="none",Rm=(e,t)=>t?e:Object.assign({},e),iA=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Dm(n,!0),values:null};class Ii{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,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=cu(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&&Qs(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),r=(m,g,_,x)=>m==="x"?g:m==="r"?x:_,s=n.xAxisID=Ct(i.xAxisID,uu(t,"x")),a=n.yAxisID=Ct(i.yAxisID,uu(t,"y")),l=n.rAxisID=Ct(i.rAxisID,uu(t,"r")),u=n.indexAxis,d=n.iAxisID=r(u,s,a,l),f=n.vAxisID=r(u,a,s,l);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(a),n.rScale=this.getScaleForId(l),n.iScale=this.getScaleForId(d),n.vScale=this.getScaleForId(f)}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 n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&jp(this._data,this),t._stacked&&Qs(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(It(n)){const r=this._cachedMeta;this._data=ZC(n,r)}else if(i!==n){if(i){jp(i,this);const r=this._cachedMeta;Qs(r),r._parsed=[]}n&&Object.isExtensible(n)&&HD(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,i=this.getDataset();let r=!1;this._dataCheck();const s=n._stacked;n._stacked=cu(n.vScale,n),n.stack!==i.stack&&(r=!0,Qs(n),n.stack=i.stack),this._resyncElements(t),(r||s!==n._stacked)&&(Om(this,n._parsed),n._stacked=cu(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:i,_data:r}=this,{iScale:s,_stacked:a}=i,l=s.axis;let u=t===0&&n===r.length?!0:i._sorted,d=t>0&&i._parsed[t-1],f,m,g;if(this._parsing===!1)i._parsed=r,i._sorted=!0,g=r;else{Gt(r[t])?g=this.parseArrayData(i,r,t,n):It(r[t])?g=this.parseObjectData(i,r,t,n):g=this.parsePrimitiveData(i,r,t,n);const _=()=>m[l]===null||d&&m[l]<d[l];for(f=0;f<n;++f)i._parsed[f+t]=m=g[f],u&&(_()&&(u=!1),d=m);i._sorted=u}a&&Om(this,g)}parsePrimitiveData(t,n,i,r){const{iScale:s,vScale:a}=t,l=s.axis,u=a.axis,d=s.getLabels(),f=s===a,m=new Array(r);let g,_,x;for(g=0,_=r;g<_;++g)x=g+i,m[g]={[l]:f||s.parse(d[x],x),[u]:a.parse(n[x],x)};return m}parseArrayData(t,n,i,r){const{xScale:s,yScale:a}=t,l=new Array(r);let u,d,f,m;for(u=0,d=r;u<d;++u)f=u+i,m=n[f],l[u]={x:s.parse(m[0],f),y:a.parse(m[1],f)};return l}parseObjectData(t,n,i,r){const{xScale:s,yScale:a}=t,{xAxisKey:l="x",yAxisKey:u="y"}=this._parsing,d=new Array(r);let f,m,g,_;for(f=0,m=r;f<m;++f)g=f+i,_=n[g],d[f]={x:s.parse(Di(_,l),g),y:a.parse(Di(_,u),g)};return d}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,i){const r=this.chart,s=this._cachedMeta,a=n[t.axis],l={keys:Dm(r,!0),values:n._stacks[t.axis]._visualValues};return Cm(l,a,s.index,{mode:i})}updateRangeFromParsed(t,n,i,r){const s=i[n.axis];let a=s===null?NaN:s;const l=r&&i._stacks[n.axis];r&&l&&(r.values=l,a=Cm(r,s,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,n){const i=this._cachedMeta,r=i._parsed,s=i._sorted&&t===i.iScale,a=r.length,l=this._getOtherScale(t),u=iA(n,i,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:f,max:m}=JC(l);let g,_;function x(){_=r[g];const v=_[l.axis];return!le(_[t.axis])||f>v||m<v}for(g=0;g<a&&!(!x()&&(this.updateRangeFromParsed(d,t,_,u),s));++g);if(s){for(g=a-1;g>=0;--g)if(!x()){this.updateRangeFromParsed(d,t,_,u);break}}return d}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let r,s,a;for(r=0,s=n.length;r<s;++r)a=n[r][t.axis],le(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,i=n.iScale,r=n.vScale,s=this.getParsed(t);return{label:i?""+i.getLabelForValue(s[i.axis]):"",value:r?""+r.getLabelForValue(s[r.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=XC(Ct(this.options.clip,KC(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,i=this._cachedMeta,r=i.data||[],s=n.chartArea,a=[],l=this._drawStart||0,u=this._drawCount||r.length-l,d=this.options.drawActiveElementsOnTop;let f;for(i.dataset&&i.dataset.draw(t,s,l,u),f=l;f<l+u;++f){const m=r[f];m.hidden||(m.active&&d?a.push(m):m.draw(t,s))}for(f=0;f<a.length;++f)a[f].draw(t,s)}getStyle(t,n){const i=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,n,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=nA(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=eA(this.chart.getContext(),this.index)),s.dataset=r,s.index=s.datasetIndex=this.index;return s.active=!!n,s.mode=i,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",i){const r=n==="active",s=this._cachedDataOpts,a=t+"-"+n,l=s[a],u=this.enableOptionSharing&&rn(i);if(l)return Rm(l,u);const d=this.chart.config,f=d.datasetElementScopeKeys(this._type,t),m=r?[`${t}Hover`,"hover",t,""]:[t,""],g=d.getOptionScopes(this.getDataset(),f),_=Object.keys(oe.elements[t]),x=()=>this.getContext(i,r,n),v=d.resolveNamedOptions(g,_,x,m);return v.$shared&&(v.$shared=u,s[a]=Object.freeze(Rm(v,u))),v}_resolveAnimations(t,n,i){const r=this.chart,s=this._cachedDataOpts,a=`animation-${n}`,l=s[a];if(l)return l;let u;if(r.options.animation!==!1){const f=this.chart.config,m=f.datasetAnimationScopeKeys(this._type,n),g=f.getOptionScopes(this.getDataset(),m);u=f.createResolver(g,this.getContext(t,i,n))}const d=new lu(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,n){return!n||du(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),r=this._sharedOptions,s=this.getSharedOptions(i),a=this.includeOptions(n,s)||s!==r;return this.updateSharedOptions(s,n,i),{sharedOptions:s,includeOptions:a}}updateElement(t,n,i,r){du(r)?Object.assign(t,i):this._resolveAnimations(n,r).update(t,i)}updateSharedOptions(t,n,i){t&&!du(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,r){t.active=r;const s=this.getStyle(n,r);this._resolveAnimations(n,i,r).update(t,{options:!r&&this.getSharedOptions(s)||s})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,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 n=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=n.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,n,i=!0){const r=this._cachedMeta,s=r.data,a=t+n;let l;const u=d=>{for(d.length+=n,l=d.length-1;l>=a;l--)d[l]=d[l-n]};for(u(s),l=t;l<a;++l)s[l]=new this.dataElementType;this._parsing&&u(r._parsed),this.parse(t,n),i&&this.updateElements(s,t,n,"reset")}updateElements(t,n,i,r){}_removeElements(t,n){const i=this._cachedMeta;if(this._parsing){const r=i._parsed.splice(t,n);i._stacked&&Qs(i,r)}i.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,i,r]=t;this[n](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,n){n&&this._sync(["_removeElements",t,n]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function rA(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let i=[];for(let r=0,s=n.length;r<s;r++)i=i.concat(n[r].controller.getAllParsedValues(e));e._cache.$bar=Gp(i.sort((r,s)=>r-s))}return e._cache.$bar}function sA(e){const t=e.iScale,n=rA(t,e.type);let i=t._length,r,s,a,l;const u=()=>{a===32767||a===-32768||(rn(l)&&(i=Math.min(i,Math.abs(a-l)||i)),l=a)};for(r=0,s=n.length;r<s;++r)a=t.getPixelForValue(n[r]),u();for(l=void 0,r=0,s=t.ticks.length;r<s;++r)a=t.getPixelForTick(r),u();return i}function oA(e,t,n,i){const r=n.barThickness;let s,a;return St(r)?(s=t.min*n.categoryPercentage,a=n.barPercentage):(s=r*i,a=1),{chunk:s/i,ratio:a,start:t.pixels[e]-s/2}}function aA(e,t,n,i){const r=t.pixels,s=r[e];let a=e>0?r[e-1]:null,l=e<r.length-1?r[e+1]:null;const u=n.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:n.barPercentage,start:d}}function lA(e,t,n,i){const r=n.parse(e[0],i),s=n.parse(e[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[n.axis]=d,t._custom={barStart:u,barEnd:d,start:r,end:s,min:a,max:l}}function Em(e,t,n,i){return Gt(e)?lA(e,t,n,i):t[n.axis]=n.parse(e,i),t}function Pm(e,t,n,i){const r=e.iScale,s=e.vScale,a=r.getLabels(),l=r===s,u=[];let d,f,m,g;for(d=n,f=n+i;d<f;++d)g=t[d],m={},m[r.axis]=l||r.parse(a[d],d),u.push(Em(g,m,s,d));return u}function fu(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function cA(e,t,n){return e!==0?qn(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function uA(e){let t,n,i,r,s;return e.horizontal?(t=e.base>e.x,n="left",i="right"):(t=e.base<e.y,n="bottom",i="top"),t?(r="end",s="start"):(r="start",s="end"),{start:n,end:i,reverse:t,top:r,bottom:s}}function dA(e,t,n,i){let r=t.borderSkipped;const s={};if(!r){e.borderSkipped=s;return}if(r===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:l,reverse:u,top:d,bottom:f}=uA(e);r==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===i?r=d:(n._bottom||0)===i?r=f:(s[Im(f,a,l,u)]=!0,r=d)),s[Im(r,a,l,u)]=!0,e.borderSkipped=s}function Im(e,t,n,i){return i?(e=fA(e,t,n),e=Lm(e,n,t)):e=Lm(e,t,n),e}function fA(e,t,n){return e===t?n:e===n?t:e}function Lm(e,t,n){return e==="start"?t:e==="end"?n:e}function hA(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class Nm extends Ii{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,n,i,r){return Pm(t,n,i,r)}parseArrayData(t,n,i,r){return Pm(t,n,i,r)}parseObjectData(t,n,i,r){const{iScale:s,vScale:a}=t,{xAxisKey:l="x",yAxisKey:u="y"}=this._parsing,d=s.axis==="x"?l:u,f=a.axis==="x"?l:u,m=[];let g,_,x,v;for(g=i,_=i+r;g<_;++g)v=n[g],x={},x[s.axis]=s.parse(Di(v,d),g),m.push(Em(Di(v,f),x,a,g));return m}updateRangeFromParsed(t,n,i,r){super.updateRangeFromParsed(t,n,i,r);const s=i._custom;s&&n===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 n=this._cachedMeta,{iScale:i,vScale:r}=n,s=this.getParsed(t),a=s._custom,l=fu(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 n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,i,r){const s=r==="reset",{index:a,_cachedMeta:{vScale:l}}=this,u=l.getBasePixel(),d=l.isHorizontal(),f=this._getRuler(),{sharedOptions:m,includeOptions:g}=this._getSharedOptions(n,r);for(let _=n;_<n+i;_++){const x=this.getParsed(_),v=s||St(x[l.axis])?{base:u,head:u}:this._calculateBarValuePixels(_),S=this._calculateBarIndexPixels(_,f),C=(x._stacks||{})[l.axis],O={horizontal:d,base:v.base,enableBorderRadius:!C||fu(x._custom)||a===C._top||a===C._bottom,x:d?v.head:S.center,y:d?S.center:v.head,height:d?S.size:Math.abs(v.size),width:d?Math.abs(v.size):S.size};g&&(O.options=m||this.resolveDataElementOptions(_,t[_].active?"active":r));const B=O.options||t[_].options;dA(O,B,C,a),hA(O,B,f.ratio),this.updateElement(t[_],_,O,r)}}_getStacks(t,n){const{iScale:i}=this._cachedMeta,r=i.getMatchingVisibleMetas(this._type).filter(f=>f.controller.options.grouped),s=i.options.stacked,a=[],l=this._cachedMeta.controller.getParsed(n),u=l&&l[i.axis],d=f=>{const m=f._parsed.find(_=>_[i.axis]===u),g=m&&m[f.vScale.axis];if(St(g)||isNaN(g))return!0};for(const f of r)if(!(n!==void 0&&d(f))&&((s===!1||a.indexOf(f.stack)===-1||s===void 0&&f.stack===void 0)&&a.push(f.stack),f.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,n=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===n).shift()}_getAxis(){const t={},n=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[Ct(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,i){const r=this._getStacks(t,i),s=n!==void 0?r.indexOf(n):-1;return s===-1?r.length-1:s}_getRuler(){const t=this.options,n=this._cachedMeta,i=n.iScale,r=[];let s,a;for(s=0,a=n.data.length;s<a;++s)r.push(i.getPixelForValue(this.getParsed(s)[i.axis],s));const l=t.barThickness;return{min:l||sA(n),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:n,_stacked:i,index:r},options:{base:s,minBarLength:a}}=this,l=s||0,u=this.getParsed(t),d=u._custom,f=fu(d);let m=u[n.axis],g=0,_=i?this.applyStack(n,u,i):m,x,v;_!==m&&(g=_-m,_=m),f&&(m=d.barStart,_=d.barEnd-d.barStart,m!==0&&qn(m)!==qn(d.barEnd)&&(g=0),g+=m);const S=!St(s)&&!f?s:g;let C=n.getPixelForValue(S);if(this.chart.getDataVisibility(t)?x=n.getPixelForValue(g+_):x=C,v=x-C,Math.abs(v)<a){v=cA(v,n,l)*a,m===l&&(C-=v/2);const O=n.getPixelForDecimal(0),B=n.getPixelForDecimal(1),I=Math.min(O,B),N=Math.max(O,B);C=Math.max(Math.min(C,N),I),x=C+v,i&&!f&&(u._stacks[n.axis]._visualValues[r]=n.getValueForPixel(x)-n.getValueForPixel(C))}if(C===n.getPixelForValue(l)){const O=qn(v)*n.getLineWidthForValue(l)/2;C+=O,v-=O}return{size:v,base:C,head:x,center:x+v/2}}_calculateBarIndexPixels(t,n){const i=n.scale,r=this.options,s=r.skipNull,a=Ct(r.maxBarThickness,1/0);let l,u;const d=this._getAxisCount();if(n.grouped){const f=s?this._getStackCount(t):n.stackCount,m=r.barThickness==="flex"?aA(t,n,r,f*d):oA(t,n,r,f*d),g=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,_=this._getAxis().indexOf(Ct(g,this.getFirstScaleIdForIndexAxis())),x=this._getStackIndex(this.index,this._cachedMeta.stack,s?t:void 0)+_;l=m.start+m.chunk*x+m.chunk/2,u=Math.min(a,m.chunk*m.ratio)}else l=i.getPixelForValue(this.getParsed(t)[i.axis],t),u=Math.min(a,n.min*n.ratio);return{base:l-u/2,head:l+u/2,center:l,size:u}}draw(){const t=this._cachedMeta,n=t.vScale,i=t.data,r=i.length;let s=0;for(;s<r;++s)this.getParsed(s)[n.axis]!==null&&!i[s].hidden&&i[s].draw(this._ctx)}}class pA extends Ii{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,n,i,r){const s=super.parsePrimitiveData(t,n,i,r);for(let a=0;a<s.length;a++)s[a]._custom=this.resolveDataElementOptions(a+i).radius;return s}parseArrayData(t,n,i,r){const s=super.parseArrayData(t,n,i,r);for(let a=0;a<s.length;a++){const l=n[i+a];s[a]._custom=Ct(l[2],this.resolveDataElementOptions(a+i).radius)}return s}parseObjectData(t,n,i,r){const s=super.parseObjectData(t,n,i,r);for(let a=0;a<s.length;a++){const l=n[i+a];s[a]._custom=Ct(l&&l.r&&+l.r,this.resolveDataElementOptions(a+i).radius)}return s}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let i=t.length-1;i>=0;--i)n=Math.max(n,t[i].size(this.resolveDataElementOptions(i))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:s}=n,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 n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,i,r){const s=r==="reset",{iScale:a,vScale:l}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,r),f=a.axis,m=l.axis;for(let g=n;g<n+i;g++){const _=t[g],x=!s&&this.getParsed(g),v={},S=v[f]=s?a.getPixelForDecimal(.5):a.getPixelForValue(x[f]),C=v[m]=s?l.getBasePixel():l.getPixelForValue(x[m]);v.skip=isNaN(S)||isNaN(C),d&&(v.options=u||this.resolveDataElementOptions(g,_.active?"active":r),s&&(v.options.radius=0)),this.updateElement(_,g,v,r)}}resolveDataElementOptions(t,n){const i=this.getParsed(t);let r=super.resolveDataElementOptions(t,n);r.$shared&&(r=Object.assign({},r,{$shared:!1}));const s=r.radius;return n!=="active"&&(r.radius=0),r.radius+=Ct(i&&i._custom,s),r}}function mA(e,t,n){let i=1,r=1,s=0,a=0;if(t<ee){const l=e,u=l+t,d=Math.cos(l),f=Math.sin(l),m=Math.cos(u),g=Math.sin(u),_=(B,I,N)=>Ys(B,l,u,!0)?1:Math.max(I,I*n,N,N*n),x=(B,I,N)=>Ys(B,l,u,!0)?-1:Math.min(I,I*n,N,N*n),v=_(0,d,m),S=_(se,f,g),C=x(Et,d,m),O=x(Et+se,f,g);i=(v-C)/2,r=(S-O)/2,s=-(v+C)/2,a=-(S+O)/2}return{ratioX:i,ratioY:r,offsetX:s,offsetY:a}}class Js extends Ii{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 n=t.data,{labels:{pointStyle:i,textAlign:r,color:s,useBorderRadius:a,borderRadius:l}}=t.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((u,d)=>{const m=t.getDatasetMeta(0).controller.getStyle(d);return{text:u,fillStyle:m.backgroundColor,fontColor:s,hidden:!t.getDataVisibility(d),lineDash:m.borderDash,lineDashOffset:m.borderDashOffset,lineJoin:m.borderJoinStyle,lineWidth:m.borderWidth,strokeStyle:m.borderColor,textAlign:r,pointStyle:i,borderRadius:a&&(l||m.borderRadius),index:d}}):[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}};constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const i=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=i;else{let s=u=>+i[u];if(It(i[t])){const{key:u="value"}=this._parsing;s=d=>+Di(i[d],u)}let a,l;for(a=t,l=t+n;a<l;++a)r._parsed[a]=s(a)}}_getRotation(){return ve(this.options.rotation-90)}_getCircumference(){return ve(this.options.circumference)}_getRotationExtents(){let t=ee,n=-ee;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),n=Math.max(n,s+a)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:i}=n,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(DD(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:f,rotation:m}=this._getRotationExtents(),{ratioX:g,ratioY:_,offsetX:x,offsetY:v}=mA(m,f,u),S=(i.width-a)/g,C=(i.height-a)/_,O=Math.max(Math.min(S,C)/2,0),B=zp(this.options.radius,O),I=Math.max(B*u,0),N=(B-I)/this._getVisibleDatasetWeightTotal();this.offsetX=x*B,this.offsetY=v*B,r.total=this.calculateTotal(),this.outerRadius=B-N*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-N*d,0),this.updateElements(s,0,s.length,t)}_circumference(t,n){const i=this.options,r=this._cachedMeta,s=this._getCircumference();return n&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||r._parsed[t]===null||r.data[t].hidden?0:this.calculateCircumference(r._parsed[t]*s/ee)}updateElements(t,n,i,r){const s=r==="reset",a=this.chart,l=a.chartArea,d=a.options.animation,f=(l.left+l.right)/2,m=(l.top+l.bottom)/2,g=s&&d.animateScale,_=g?0:this.innerRadius,x=g?0:this.outerRadius,{sharedOptions:v,includeOptions:S}=this._getSharedOptions(n,r);let C=this._getRotation(),O;for(O=0;O<n;++O)C+=this._circumference(O,s);for(O=n;O<n+i;++O){const B=this._circumference(O,s),I=t[O],N={x:f+this.offsetX,y:m+this.offsetY,startAngle:C,endAngle:C+B,circumference:B,outerRadius:x,innerRadius:_};S&&(N.options=v||this.resolveDataElementOptions(O,I.active?"active":r)),C+=B,this.updateElement(I,O,N,r)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let i=0,r;for(r=0;r<n.length;r++){const s=t._parsed[r];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(r)&&!n[r].hidden&&(i+=Math.abs(s))}return i}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?ee*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=js(n._parsed[t],i.options.locale);return{label:r[t]||"",value:s}}getMaxBorderWidth(t){let n=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"&&(n=Math.max(n,u.borderWidth||0,u.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let i=0,r=t.length;i<r;++i){const s=this.resolveDataElementOptions(i);n=Math.max(n,s.offset||0,s.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(n+=this._getRingWeight(i));return n}_getRingWeight(t){return Math.max(Ct(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class Bm extends Ii{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 n=this._cachedMeta,{dataset:i,data:r=[],_dataset:s}=n,a=this.chart._animationsDisabled;let{start:l,count:u}=Zp(n,r,a);this._drawStart=l,this._drawCount=u,Qp(n)&&(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,n,i,r){const s=r==="reset",{iScale:a,vScale:l,_stacked:u,_dataset:d}=this._cachedMeta,{sharedOptions:f,includeOptions:m}=this._getSharedOptions(n,r),g=a.axis,_=l.axis,{spanGaps:x,segment:v}=this.options,S=Ai(x)?x:Number.POSITIVE_INFINITY,C=this.chart._animationsDisabled||s||r==="none",O=n+i,B=t.length;let I=n>0&&this.getParsed(n-1);for(let N=0;N<B;++N){const W=t[N],U=C?W:{};if(N<n||N>=O){U.skip=!0;continue}const D=this.getParsed(N),w=St(D[_]),A=U[g]=a.getPixelForValue(D[g],N),L=U[_]=s||w?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,D,u):D[_],N);U.skip=isNaN(A)||isNaN(L)||w,U.stop=N>0&&Math.abs(D[g]-I[g])>S,v&&(U.parsed=D,U.raw=d.data[N]),m&&(U.options=f||this.resolveDataElementOptions(N,W.active?"active":r)),C||this.updateElement(W,N,U,r),I=D}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,i=n.options&&n.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 Fm extends Ii{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 n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return n.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,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=js(n._parsed[t].r,i.options.locale);return{label:r[t]||"",value:s}}parseObjectData(t,n,i,r){return fm.bind(this)(t,n,i,r)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={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<n.min&&(n.min=s),s>n.max&&(n.max=s))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,i=t.options,r=Math.min(n.right-n.left,n.bottom-n.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,n,i,r){const s=r==="reset",a=this.chart,u=a.options.animation,d=this._cachedMeta.rScale,f=d.xCenter,m=d.yCenter,g=d.getIndexAngle(0)-.5*Et;let _=g,x;const v=360/this.countVisibleElements();for(x=0;x<n;++x)_+=this._computeAngle(x,r,v);for(x=n;x<n+i;x++){const S=t[x];let C=_,O=_+this._computeAngle(x,r,v),B=a.getDataVisibility(x)?d.getDistanceFromCenterForValue(this.getParsed(x).r):0;_=O,s&&(u.animateScale&&(B=0),u.animateRotate&&(C=O=g));const I={x:f,y:m,innerRadius:0,outerRadius:B,startAngle:C,endAngle:O,options:this.resolveDataElementOptions(x,S.active?"active":r)};this.updateElement(S,x,I,r)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((i,r)=>{!isNaN(this.getParsed(r).r)&&this.chart.getDataVisibility(r)&&n++}),n}_computeAngle(t,n,i){return this.chart.getDataVisibility(t)?ve(this.resolveDataElementOptions(t,n).angle||i):0}}class gA extends Js{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class yA extends Ii{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 n=this._cachedMeta.vScale,i=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(i[n.axis])}}parseObjectData(t,n,i,r){return fm.bind(this)(t,n,i,r)}update(t){const n=this._cachedMeta,i=n.dataset,r=n.data||[],s=n.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,n,i,r){const s=this._cachedMeta.rScale,a=r==="reset";for(let l=n;l<n+i;l++){const u=t[l],d=this.resolveDataElementOptions(l,u.active?"active":r),f=s.getPointPositionForValue(l,this.getParsed(l).r),m=a?s.xCenter:f.x,g=a?s.yCenter:f.y,_={x:m,y:g,angle:f.angle,skip:isNaN(m)||isNaN(g),options:d};this.updateElement(u,l,_,r)}}}class zm extends Ii{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 n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:s}=n,a=this.getParsed(t),l=r.getLabelForValue(a.x),u=s.getLabelForValue(a.y);return{label:i[t]||"",value:"("+l+", "+u+")"}}update(t){const n=this._cachedMeta,{data:i=[]}=n,r=this.chart._animationsDisabled;let{start:s,count:a}=Zp(n,i,r);if(this._drawStart=s,this._drawCount=a,Qp(n)&&(s=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:l,_dataset:u}=n;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 n.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,n,i,r){const s=r==="reset",{iScale:a,vScale:l,_stacked:u,_dataset:d}=this._cachedMeta,f=this.resolveDataElementOptions(n,r),m=this.getSharedOptions(f),g=this.includeOptions(r,m),_=a.axis,x=l.axis,{spanGaps:v,segment:S}=this.options,C=Ai(v)?v:Number.POSITIVE_INFINITY,O=this.chart._animationsDisabled||s||r==="none";let B=n>0&&this.getParsed(n-1);for(let I=n;I<n+i;++I){const N=t[I],W=this.getParsed(I),U=O?N:{},D=St(W[x]),w=U[_]=a.getPixelForValue(W[_],I),A=U[x]=s||D?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,W,u):W[x],I);U.skip=isNaN(w)||isNaN(A)||D,U.stop=I>0&&Math.abs(W[_]-B[_])>C,S&&(U.parsed=W,U.raw=d.data[I]),g&&(U.options=m||this.resolveDataElementOptions(I,N.active?"active":r)),O||this.updateElement(N,I,U,r),B=W}this.updateSharedOptions(m,r,f)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let l=0;for(let u=n.length-1;u>=0;--u)l=Math.max(l,n[u].size(this.resolveDataElementOptions(u))/2);return l>0&&l}const i=t.dataset,r=i.options&&i.options.borderWidth||0;if(!n.length)return r;const s=n[0].size(this.resolveDataElementOptions(0)),a=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(r,s,a)/2}}var _A=Object.freeze({__proto__:null,BarController:Nm,BubbleController:pA,DoughnutController:Js,LineController:Bm,PieController:gA,PolarAreaController:Fm,RadarController:yA,ScatterController:zm});function fr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class hu{static override(t){Object.assign(hu.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return fr()}parse(){return fr()}format(){return fr()}add(){return fr()}diff(){return fr()}startOf(){return fr()}endOf(){return fr()}}var Um={_date:hu};function bA(e,t,n,i){const{controller:r,data:s,_sorted:a}=e,l=r._cachedMeta.iScale,u=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(l&&t===l.axis&&t!=="r"&&a&&s.length){const d=l._reversePixels?zD:oi;if(i){if(r._sharedOptions){const f=s[0],m=typeof f.getRange=="function"&&f.getRange(t);if(m){const g=d(s,t,n-m),_=d(s,t,n+m);return{lo:g.lo,hi:_.hi}}}}else{const f=d(s,t,n);if(u){const{vScale:m}=r._cachedMeta,{_parsed:g}=e,_=g.slice(0,f.lo+1).reverse().findIndex(v=>!St(v[m.axis]));f.lo-=Math.max(0,_);const x=g.slice(f.hi).findIndex(v=>!St(v[m.axis]));f.hi+=Math.max(0,x)}return f}}return{lo:0,hi:s.length-1}}function to(e,t,n,i,r){const s=e.getSortedVisibleDatasetMetas(),a=n[t];for(let l=0,u=s.length;l<u;++l){const{index:d,data:f}=s[l],{lo:m,hi:g}=bA(s[l],t,a,r);for(let _=m;_<=g;++_){const x=f[_];x.skip||i(x,d,_)}}}function xA(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(i,r){const s=t?Math.abs(i.x-r.x):0,a=n?Math.abs(i.y-r.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(a,2))}}function pu(e,t,n,i,r){const s=[];return!r&&!e.isPointInArea(t)||to(e,n,t,function(l,u,d){!r&&!ai(l,e.chartArea,0)||l.inRange(t.x,t.y,i)&&s.push({element:l,datasetIndex:u,index:d})},!0),s}function wA(e,t,n,i){let r=[];function s(a,l,u){const{startAngle:d,endAngle:f}=a.getProps(["startAngle","endAngle"],i),{angle:m}=Sa(a,{x:t.x,y:t.y});Ys(m,d,f)&&r.push({element:a,datasetIndex:l,index:u})}return to(e,n,t,s),r}function vA(e,t,n,i,r,s){let a=[];const l=xA(n);let u=Number.POSITIVE_INFINITY;function d(f,m,g){const _=f.inRange(t.x,t.y,r);if(i&&!_)return;const x=f.getCenterPoint(r);if(!(!!s||e.isPointInArea(x))&&!_)return;const S=l(t,x);S<u?(a=[{element:f,datasetIndex:m,index:g}],u=S):S===u&&a.push({element:f,datasetIndex:m,index:g})}return to(e,n,t,d),a}function mu(e,t,n,i,r,s){return!s&&!e.isPointInArea(t)?[]:n==="r"&&!i?wA(e,t,n,r):vA(e,t,n,i,r,s)}function Hm(e,t,n,i,r){const s=[],a=n==="x"?"inXRange":"inYRange";let l=!1;return to(e,n,t,(u,d,f)=>{u[a]&&u[a](t[n],r)&&(s.push({element:u,datasetIndex:d,index:f}),l=l||u.inRange(t.x,t.y,r))}),i&&!l?[]:s}var gu={evaluateInteractionItems:to,modes:{index(e,t,n,i){const r=Ei(t,e),s=n.axis||"x",a=n.includeInvisible||!1,l=n.intersect?pu(e,r,s,i,a):mu(e,r,s,!1,i,a),u=[];return l.length?(e.getSortedVisibleDatasetMetas().forEach(d=>{const f=l[0].index,m=d.data[f];m&&!m.skip&&u.push({element:m,datasetIndex:d.index,index:f})}),u):[]},dataset(e,t,n,i){const r=Ei(t,e),s=n.axis||"xy",a=n.includeInvisible||!1;let l=n.intersect?pu(e,r,s,i,a):mu(e,r,s,!1,i,a);if(l.length>0){const u=l[0].datasetIndex,d=e.getDatasetMeta(u).data;l=[];for(let f=0;f<d.length;++f)l.push({element:d[f],datasetIndex:u,index:f})}return l},point(e,t,n,i){const r=Ei(t,e),s=n.axis||"xy",a=n.includeInvisible||!1;return pu(e,r,s,i,a)},nearest(e,t,n,i){const r=Ei(t,e),s=n.axis||"xy",a=n.includeInvisible||!1;return mu(e,r,s,n.intersect,i,a)},x(e,t,n,i){const r=Ei(t,e);return Hm(e,r,"x",n.intersect,i)},y(e,t,n,i){const r=Ei(t,e);return Hm(e,r,"y",n.intersect,i)}}};const Wm=["left","top","right","bottom"];function eo(e,t){return e.filter(n=>n.pos===t)}function $m(e,t){return e.filter(n=>Wm.indexOf(n.pos)===-1&&n.box.axis===t)}function no(e,t){return e.sort((n,i)=>{const r=t?i:n,s=t?n:i;return r.weight===s.weight?r.index-s.index:r.weight-s.weight})}function SA(e){const t=[];let n,i,r,s,a,l;for(n=0,i=(e||[]).length;n<i;++n)r=e[n],{position:s,options:{stack:a,stackWeight:l=1}}=r,t.push({index:n,box:r,pos:s,horizontal:r.isHorizontal(),weight:r.weight,stack:a&&s+a,stackWeight:l});return t}function TA(e){const t={};for(const n of e){const{stack:i,pos:r,stackWeight:s}=n;if(!i||!Wm.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 MA(e,t){const n=TA(e),{vBoxMaxWidth:i,hBoxMaxHeight:r}=t;let s,a,l;for(s=0,a=e.length;s<a;++s){l=e[s];const{fullSize:u}=l.box,d=n[l.stack],f=d&&l.stackWeight/d.weight;l.horizontal?(l.width=f?f*i:u&&t.availableWidth,l.height=r):(l.width=i,l.height=f?f*r:u&&t.availableHeight)}return n}function kA(e){const t=SA(e),n=no(t.filter(d=>d.box.fullSize),!0),i=no(eo(t,"left"),!0),r=no(eo(t,"right")),s=no(eo(t,"top"),!0),a=no(eo(t,"bottom")),l=$m(t,"x"),u=$m(t,"y");return{fullSize:n,leftAndTop:i.concat(s),rightAndBottom:r.concat(u).concat(a).concat(l),chartArea:eo(t,"chartArea"),vertical:i.concat(r).concat(u),horizontal:s.concat(a).concat(l)}}function Vm(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function Ym(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function DA(e,t,n,i){const{pos:r,box:s}=n,a=e.maxPadding;if(!It(r)){n.size&&(e[r]-=n.size);const m=i[n.stack]||{size:0,count:1};m.size=Math.max(m.size,n.horizontal?s.height:s.width),n.size=m.size/m.count,e[r]+=n.size}s.getPadding&&Ym(a,s.getPadding());const l=Math.max(0,t.outerWidth-Vm(a,e,"left","right")),u=Math.max(0,t.outerHeight-Vm(a,e,"top","bottom")),d=l!==e.w,f=u!==e.h;return e.w=l,e.h=u,n.horizontal?{same:d,other:f}:{same:f,other:d}}function CA(e){const t=e.maxPadding;function n(i){const r=Math.max(t[i]-e[i],0);return e[i]+=r,r}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function AA(e,t){const n=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],n[a])}),s}return i(e?["left","right"]:["top","bottom"])}function io(e,t,n,i){const r=[];let s,a,l,u,d,f;for(s=0,a=e.length,d=0;s<a;++s){l=e[s],u=l.box,u.update(l.width||t.w,l.height||t.h,AA(l.horizontal,t));const{same:m,other:g}=DA(t,n,l,i);d|=m&&r.length,f=f||g,u.fullSize||r.push(l)}return d&&io(r,t,n,i)||f}function Ea(e,t,n,i,r){e.top=n,e.left=t,e.right=t+i,e.bottom=n+r,e.width=i,e.height=r}function qm(e,t,n,i){const r=n.padding;let{x:s,y:a}=t;for(const l of e){const u=l.box,d=i[l.stack]||{placed:0,weight:1},f=l.stackWeight/d.weight||1;if(l.horizontal){const m=t.w*f,g=d.size||u.height;rn(d.start)&&(a=d.start),u.fullSize?Ea(u,r.left,a,n.outerWidth-r.right-r.left,g):Ea(u,t.left+d.placed,a,m,g),d.start=a,d.placed+=m,a=u.bottom}else{const m=t.h*f,g=d.size||u.width;rn(d.start)&&(s=d.start),u.fullSize?Ea(u,s,r.top,g,n.outerHeight-r.bottom-r.top):Ea(u,s,t.top+d.placed,g,m),d.start=s,d.placed+=m,s=u.right}}t.x=s,t.y=a}var $e={addBox(e,t){e.boxes||(e.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(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,i){if(!e)return;const r=Se(e.options.layout.padding),s=Math.max(t-r.width,0),a=Math.max(n-r.height,0),l=kA(e.boxes),u=l.vertical,d=l.horizontal;te(e.boxes,v=>{typeof v.beforeLayout=="function"&&v.beforeLayout()});const f=u.reduce((v,S)=>S.box.options&&S.box.options.display===!1?v:v+1,0)||1,m=Object.freeze({outerWidth:t,outerHeight:n,padding:r,availableWidth:s,availableHeight:a,vBoxMaxWidth:s/2/f,hBoxMaxHeight:a/2}),g=Object.assign({},r);Ym(g,Se(i));const _=Object.assign({maxPadding:g,w:s,h:a,x:r.left,y:r.top},r),x=MA(u.concat(d),m);io(l.fullSize,_,m,x),io(u,_,m,x),io(d,_,m,x)&&io(u,_,m,x),CA(_),qm(l.leftAndTop,_,m,x),_.x+=_.w,_.y+=_.h,qm(l.rightAndBottom,_,m,x),e.chartArea={left:_.left,top:_.top,right:_.left+_.w,bottom:_.top+_.h,height:_.h,width:_.w},te(l.chartArea,v=>{const S=v.box;Object.assign(S,e.chartArea),S.update(_.w,_.h,{left:0,top:0,right:0,bottom:0})})}};class jm{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,r){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,r?Math.floor(n/r):i)}}isAttached(t){return!0}updateConfig(t){}}class OA extends jm{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Pa="$chartjs",RA={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Gm=e=>e===null||e==="";function EA(e,t){const n=e.style,i=e.getAttribute("height"),r=e.getAttribute("width");if(e[Pa]={initial:{height:i,width:r,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Gm(r)){const s=mm(e,"width");s!==void 0&&(e.width=s)}if(Gm(i))if(e.style.height==="")e.height=e.width/(t||2);else{const s=mm(e,"height");s!==void 0&&(e.height=s)}return e}const Km=EC?{passive:!0}:!1;function PA(e,t,n){e&&e.addEventListener(t,n,Km)}function IA(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,Km)}function LA(e,t){const n=RA[e.type]||e.type,{x:i,y:r}=Ei(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:r!==void 0?r:null}}function Ia(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function NA(e,t,n){const i=e.canvas,r=new MutationObserver(s=>{let a=!1;for(const l of s)a=a||Ia(l.addedNodes,i),a=a&&!Ia(l.removedNodes,i);a&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}function BA(e,t,n){const i=e.canvas,r=new MutationObserver(s=>{let a=!1;for(const l of s)a=a||Ia(l.removedNodes,i),a=a&&!Ia(l.addedNodes,i);a&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}const ro=new Map;let Xm=0;function Zm(){const e=window.devicePixelRatio;e!==Xm&&(Xm=e,ro.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function FA(e,t){ro.size||window.addEventListener("resize",Zm),ro.set(e,t)}function zA(e){ro.delete(e),ro.size||window.removeEventListener("resize",Zm)}function UA(e,t,n){const i=e.canvas,r=i&&au(i);if(!r)return;const s=Xp((l,u)=>{const d=r.clientWidth;n(l,u),d<r.clientWidth&&n()},window),a=new ResizeObserver(l=>{const u=l[0],d=u.contentRect.width,f=u.contentRect.height;d===0&&f===0||s(d,f)});return a.observe(r),FA(e,s),a}function yu(e,t,n){n&&n.disconnect(),t==="resize"&&zA(e)}function HA(e,t,n){const i=e.canvas,r=Xp(s=>{e.ctx!==null&&n(LA(s,e))},e);return PA(i,t,r),r}class WA extends jm{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(EA(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[Pa])return!1;const i=n[Pa].initial;["height","width"].forEach(s=>{const a=i[s];St(a)?n.removeAttribute(s):n.setAttribute(s,a)});const r=i.style||{};return Object.keys(r).forEach(s=>{n.style[s]=r[s]}),n.width=n.width,delete n[Pa],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const r=t.$proxies||(t.$proxies={}),a={attach:NA,detach:BA,resize:UA}[n]||HA;r[n]=a(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),r=i[n];if(!r)return;({attach:yu,detach:yu,resize:yu}[n]||IA)(t,n,r),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,r){return RC(t,n,i,r)}isAttached(t){const n=t&&au(t);return!!(n&&n.isConnected)}}function $A(e){return!ou()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?OA:WA}class Ve{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return Ai(this.x)&&Ai(this.y)}getProps(t,n){const i=this.$animations;if(!n||!i)return this;const r={};return t.forEach(s=>{r[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),r}}function VA(e,t){const n=e.options.ticks,i=YA(e),r=Math.min(n.maxTicksLimit||i,i),s=n.major.enabled?jA(t):[],a=s.length,l=s[0],u=s[a-1],d=[];if(a>r)return GA(t,d,s,a/r),d;const f=qA(s,t,r);if(a>0){let m,g;const _=a>1?Math.round((u-l)/(a-1)):null;for(La(t,d,f,St(_)?0:l-_,l),m=0,g=a-1;m<g;m++)La(t,d,f,s[m],s[m+1]);return La(t,d,f,u,St(_)?t.length:u+_),d}return La(t,d,f),d}function YA(e){const t=e.options.offset,n=e._tickSize(),i=e._length/n+(t?0:1),r=e._maxLength/n;return Math.floor(Math.min(i,r))}function qA(e,t,n){const i=KA(e),r=t.length/n;if(!i)return Math.max(r,1);const s=ID(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 jA(e){const t=[];let n,i;for(n=0,i=e.length;n<i;n++)e[n].major&&t.push(n);return t}function GA(e,t,n,i){let r=0,s=n[0],a;for(i=Math.ceil(i),a=0;a<e.length;a++)a===s&&(t.push(e[a]),r++,s=n[r*i])}function La(e,t,n,i,r){const s=Ct(i,0),a=Math.min(Ct(r,e.length),e.length);let l=0,u,d,f;for(n=Math.ceil(n),r&&(u=r-i,n=u/Math.floor(u/n)),f=s;f<0;)l++,f=Math.round(s+l*n);for(d=Math.max(s,0);d<a;d++)d===f&&(t.push(e[d]),l++,f=Math.round(s+l*n))}function KA(e){const t=e.length;let n,i;if(t<2)return!1;for(i=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==i)return!1;return i}const XA=e=>e==="left"?"right":e==="right"?"left":e,Qm=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Jm=(e,t)=>Math.min(t||e,e);function tg(e,t){const n=[],i=e.length/t,r=e.length;let s=0;for(;s<r;s+=i)n.push(e[Math.floor(s)]);return n}function ZA(e,t,n){const i=e.ticks.length,r=Math.min(t,i-1),s=e._startPixel,a=e._endPixel,l=1e-6;let u=e.getPixelForTick(r),d;if(!(n&&(i===1?d=Math.max(u-s,a-u):t===0?d=(e.getPixelForTick(1)-u)/2:d=(u-e.getPixelForTick(r-1))/2,u+=r<t?d:-d,u<s-l||u>a+l)))return u}function QA(e,t){te(e,n=>{const i=n.gc,r=i.length/2;let s;if(r>t){for(s=0;s<r;++s)delete n.data[i[s]];i.splice(0,r)}})}function so(e){return e.drawTicks?e.tickLength:0}function eg(e,t){if(!e.display)return 0;const n=ce(e.font,t),i=Se(e.padding);return(Gt(e.text)?e.text.length:1)*n.lineHeight+i.height}function JA(e,t){return Ri(e,{scale:t,type:"scale"})}function tO(e,t,n){return Ri(e,{tick:n,index:t,type:"tick"})}function eO(e,t,n){let i=Xc(e);return(n&&t!=="right"||!n&&t==="right")&&(i=XA(i)),i}function nO(e,t,n,i){const{top:r,left:s,bottom:a,right:l,chart:u}=e,{chartArea:d,scales:f}=u;let m=0,g,_,x;const v=a-r,S=l-s;if(e.isHorizontal()){if(_=We(i,s,l),It(n)){const C=Object.keys(n)[0],O=n[C];x=f[C].getPixelForValue(O)+v-t}else n==="center"?x=(d.bottom+d.top)/2+v-t:x=Qm(e,n,t);g=l-s}else{if(It(n)){const C=Object.keys(n)[0],O=n[C];_=f[C].getPixelForValue(O)-S+t}else n==="center"?_=(d.left+d.right)/2-S+t:_=Qm(e,n,t);x=We(i,a,r),m=n==="left"?-se:se}return{titleX:_,titleY:x,maxWidth:g,rotation:m}}class hr 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,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:i,_suggestedMax:r}=this;return t=mn(t,Number.POSITIVE_INFINITY),n=mn(n,Number.NEGATIVE_INFINITY),i=mn(i,Number.POSITIVE_INFINITY),r=mn(r,Number.NEGATIVE_INFINITY),{min:mn(t,i),max:mn(n,r),minDefined:le(t),maxDefined:le(n)}}getMinMax(t){let{min:n,max:i,minDefined:r,maxDefined:s}=this.getUserBounds(),a;if(r&&s)return{min:n,max:i};const l=this.getMatchingVisibleMetas();for(let u=0,d=l.length;u<d;++u)a=l[u].controller.getMinMax(this,t),r||(n=Math.min(n,a.min)),s||(i=Math.max(i,a.max));return n=s&&n>i?i:n,i=r&&n>i?n:i,{min:mn(n,mn(i,n)),max:mn(i,mn(n,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(){Jt(this.options.beforeUpdate,[this])}update(t,n,i){const{beginAtZero:r,grace:s,ticks:a}=this.options,l=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,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=cC(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const u=l<this.ticks.length;this._convertTicksToLabels(u?tg(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=VA(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,n,i;this.isHorizontal()?(n=this.left,i=this.right):(n=this.top,i=this.bottom,t=!t),this._startPixel=n,this._endPixel=i,this._reversePixels=t,this._length=i-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Jt(this.options.afterUpdate,[this])}beforeSetDimensions(){Jt(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(){Jt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Jt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Jt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let i,r,s;for(i=0,r=t.length;i<r;i++)s=t[i],s.label=Jt(n.callback,[s.value,i,t],this)}afterTickToLabelConversion(){Jt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Jt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,i=Jm(this.ticks.length,t.ticks.maxTicksLimit),r=n.minRotation||0,s=n.maxRotation;let a=r,l,u,d;if(!this._isVisible()||!n.display||r>=s||i<=1||!this.isHorizontal()){this.labelRotation=r;return}const f=this._getLabelSizes(),m=f.widest.width,g=f.highest.height,_=Re(this.chart.width-m,0,this.maxWidth);l=t.offset?this.maxWidth/i:_/(i-1),m+6>l&&(l=_/(i-(t.offset?.5:1)),u=this.maxHeight-so(t.grid)-n.padding-eg(t.title,this.chart.options.font),d=Math.sqrt(m*m+g*g),a=va(Math.min(Math.asin(Re((f.highest.height+6)/l,-1,1)),Math.asin(Re(u/d,-1,1))-Math.asin(Re(g/d,-1,1)))),a=Math.max(r,Math.min(s,a))),this.labelRotation=a}afterCalculateLabelRotation(){Jt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Jt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:r,grid:s}}=this,a=this._isVisible(),l=this.isHorizontal();if(a){const u=eg(r,n.options.font);if(l?(t.width=this.maxWidth,t.height=so(s)+u):(t.height=this.maxHeight,t.width=so(s)+u),i.display&&this.ticks.length){const{first:d,last:f,widest:m,highest:g}=this._getLabelSizes(),_=i.padding*2,x=ve(this.labelRotation),v=Math.cos(x),S=Math.sin(x);if(l){const C=i.mirror?0:S*m.width+v*g.height;t.height=Math.min(this.maxHeight,t.height+C+_)}else{const C=i.mirror?0:v*m.width+S*g.height;t.width=Math.min(this.maxWidth,t.width+C+_)}this._calculatePadding(d,f,S,v)}}this._handleMargins(),l?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,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 f=this.getPixelForTick(0)-this.left,m=this.right-this.getPixelForTick(this.ticks.length-1);let g=0,_=0;u?d?(g=r*t.width,_=i*n.height):(g=i*t.height,_=r*n.width):s==="start"?_=n.width:s==="end"?g=t.width:s!=="inner"&&(g=t.width/2,_=n.width/2),this.paddingLeft=Math.max((g-f+a)*this.width/(this.width-f),0),this.paddingRight=Math.max((_-m+a)*this.width/(this.width-m),0)}else{let f=n.height/2,m=t.height/2;s==="start"?(f=0,m=t.height):s==="end"&&(f=n.height,m=0),this.paddingTop=f+a,this.paddingBottom=m+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(){Jt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,i;for(n=0,i=t.length;n<i;n++)St(t[n].label)&&(t.splice(n,1),i--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let i=this.ticks;n<i.length&&(i=tg(i,n)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,i){const{ctx:r,_longestTextCache:s}=this,a=[],l=[],u=Math.floor(n/Jm(n,i));let d=0,f=0,m,g,_,x,v,S,C,O,B,I,N;for(m=0;m<n;m+=u){if(x=t[m].label,v=this._resolveTickFontOptions(m),r.font=S=v.string,C=s[S]=s[S]||{data:{},gc:[]},O=v.lineHeight,B=I=0,!St(x)&&!Gt(x))B=Da(r,C.data,C.gc,B,x),I=O;else if(Gt(x))for(g=0,_=x.length;g<_;++g)N=x[g],!St(N)&&!Gt(N)&&(B=Da(r,C.data,C.gc,B,N),I+=O);a.push(B),l.push(I),d=Math.max(B,d),f=Math.max(I,f)}QA(s,n);const W=a.indexOf(d),U=l.indexOf(f),D=w=>({width:a[w]||0,height:l[w]||0});return{first:D(0),last:D(n-1),widest:D(W),highest:D(U),widths:a,heights:l}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return FD(this._alignToPixels?lr(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const i=n[t];return i.$context||(i.$context=tO(this.getContext(),t,i))}return this.$context||(this.$context=JA(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=ve(this.labelRotation),i=Math.abs(Math.cos(n)),r=Math.abs(Math.sin(n)),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 n=this.axis,i=this.chart,r=this.options,{grid:s,position:a,border:l}=r,u=s.offset,d=this.isHorizontal(),m=this.ticks.length+(u?1:0),g=so(s),_=[],x=l.setContext(this.getContext()),v=x.display?x.width:0,S=v/2,C=function(ht){return lr(i,ht,v)};let O,B,I,N,W,U,D,w,A,L,$,q;if(a==="top")O=C(this.bottom),U=this.bottom-g,w=O-S,L=C(t.top)+S,q=t.bottom;else if(a==="bottom")O=C(this.top),L=t.top,q=C(t.bottom)-S,U=O+S,w=this.top+g;else if(a==="left")O=C(this.right),W=this.right-g,D=O-S,A=C(t.left)+S,$=t.right;else if(a==="right")O=C(this.left),A=t.left,$=C(t.right)-S,W=O+S,D=this.left+g;else if(n==="x"){if(a==="center")O=C((t.top+t.bottom)/2+.5);else if(It(a)){const ht=Object.keys(a)[0],ut=a[ht];O=C(this.chart.scales[ht].getPixelForValue(ut))}L=t.top,q=t.bottom,U=O+S,w=U+g}else if(n==="y"){if(a==="center")O=C((t.left+t.right)/2);else if(It(a)){const ht=Object.keys(a)[0],ut=a[ht];O=C(this.chart.scales[ht].getPixelForValue(ut))}W=O-S,D=W-g,A=t.left,$=t.right}const st=Ct(r.ticks.maxTicksLimit,m),ct=Math.max(1,Math.ceil(m/st));for(B=0;B<m;B+=ct){const ht=this.getContext(B),ut=s.setContext(ht),vt=l.setContext(ht),at=ut.lineWidth,dt=ut.color,V=vt.dash||[],P=vt.dashOffset,H=ut.tickWidth,nt=ut.tickColor,ot=ut.tickBorderDash||[],X=ut.tickBorderDashOffset;I=ZA(this,B,u),I!==void 0&&(N=lr(i,I,at),d?W=D=A=$=N:U=w=L=q=N,_.push({tx1:W,ty1:U,tx2:D,ty2:w,x1:A,y1:L,x2:$,y2:q,width:at,color:dt,borderDash:V,borderDashOffset:P,tickWidth:H,tickColor:nt,tickBorderDash:ot,tickBorderDashOffset:X}))}return this._ticksLength=m,this._borderValue=O,_}_computeLabelItems(t){const n=this.axis,i=this.options,{position:r,ticks:s}=i,a=this.isHorizontal(),l=this.ticks,{align:u,crossAlign:d,padding:f,mirror:m}=s,g=so(i.grid),_=g+f,x=m?-f:_,v=-ve(this.labelRotation),S=[];let C,O,B,I,N,W,U,D,w,A,L,$,q="middle";if(r==="top")W=this.bottom-x,U=this._getXAxisLabelAlignment();else if(r==="bottom")W=this.top+x,U=this._getXAxisLabelAlignment();else if(r==="left"){const ct=this._getYAxisLabelAlignment(g);U=ct.textAlign,N=ct.x}else if(r==="right"){const ct=this._getYAxisLabelAlignment(g);U=ct.textAlign,N=ct.x}else if(n==="x"){if(r==="center")W=(t.top+t.bottom)/2+_;else if(It(r)){const ct=Object.keys(r)[0],ht=r[ct];W=this.chart.scales[ct].getPixelForValue(ht)+_}U=this._getXAxisLabelAlignment()}else if(n==="y"){if(r==="center")N=(t.left+t.right)/2-_;else if(It(r)){const ct=Object.keys(r)[0],ht=r[ct];N=this.chart.scales[ct].getPixelForValue(ht)}U=this._getYAxisLabelAlignment(g).textAlign}n==="y"&&(u==="start"?q="top":u==="end"&&(q="bottom"));const st=this._getLabelSizes();for(C=0,O=l.length;C<O;++C){B=l[C],I=B.label;const ct=s.setContext(this.getContext(C));D=this.getPixelForTick(C)+s.labelOffset,w=this._resolveTickFontOptions(C),A=w.lineHeight,L=Gt(I)?I.length:1;const ht=L/2,ut=ct.color,vt=ct.textStrokeColor,at=ct.textStrokeWidth;let dt=U;a?(N=D,U==="inner"&&(C===O-1?dt=this.options.reverse?"left":"right":C===0?dt=this.options.reverse?"right":"left":dt="center"),r==="top"?d==="near"||v!==0?$=-L*A+A/2:d==="center"?$=-st.highest.height/2-ht*A+A:$=-st.highest.height+A/2:d==="near"||v!==0?$=A/2:d==="center"?$=st.highest.height/2-ht*A:$=st.highest.height-L*A,m&&($*=-1),v!==0&&!ct.showLabelBackdrop&&(N+=A/2*Math.sin(v))):(W=D,$=(1-L)*A/2);let V;if(ct.showLabelBackdrop){const P=Se(ct.backdropPadding),H=st.heights[C],nt=st.widths[C];let ot=$-P.top,X=0-P.left;switch(q){case"middle":ot-=H/2;break;case"bottom":ot-=H;break}switch(U){case"center":X-=nt/2;break;case"right":X-=nt;break;case"inner":C===O-1?X-=nt:C>0&&(X-=nt/2);break}V={left:X,top:ot,width:nt+P.width,height:H+P.height,color:ct.backdropColor}}S.push({label:I,font:w,textOffset:$,options:{rotation:v,color:ut,strokeColor:vt,strokeWidth:at,textAlign:dt,textBaseline:q,translation:[N,W],backdrop:V}})}return S}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-ve(this.labelRotation))return t==="top"?"left":"right";let r="center";return n.align==="start"?r="left":n.align==="end"?r="right":n.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:i,mirror:r,padding:s}}=this.options,a=this._getLabelSizes(),l=t+s,u=a.widest.width;let d,f;return n==="left"?r?(f=this.right+s,i==="near"?d="left":i==="center"?(d="center",f+=u/2):(d="right",f+=u)):(f=this.right-l,i==="near"?d="right":i==="center"?(d="center",f-=u/2):(d="left",f=this.left)):n==="right"?r?(f=this.left+s,i==="near"?d="right":i==="center"?(d="center",f-=u/2):(d="left",f-=u)):(f=this.left+l,i==="near"?d="left":i==="center"?(d="center",f+=u/2):(d="right",f=this.right)):d="right",{textAlign:d,x:f}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:i,top:r,width:s,height:a}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(i,r,s,a),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const r=this.ticks.findIndex(s=>s.value===t);return r>=0?n.setContext(this.getContext(r)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,a;const l=(u,d,f)=>{!f.width||!f.color||(i.save(),i.lineWidth=f.width,i.strokeStyle=f.color,i.setLineDash(f.borderDash||[]),i.lineDashOffset=f.borderDashOffset,i.beginPath(),i.moveTo(u.x,u.y),i.lineTo(d.x,d.y),i.stroke(),i.restore())};if(n.display)for(s=0,a=r.length;s<a;++s){const u=r[s];n.drawOnChartArea&&l({x:u.x1,y:u.y1},{x:u.x2,y:u.y2},u),n.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:n,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,f,m,g;this.isHorizontal()?(d=lr(t,this.left,a)-a/2,f=lr(t,this.right,l)+l/2,m=g=u):(m=lr(t,this.top,a)-a/2,g=lr(t,this.bottom,l)+l/2,d=f=u),n.save(),n.lineWidth=s.width,n.strokeStyle=s.color,n.beginPath(),n.moveTo(d,m),n.lineTo(f,g),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,r=this._computeLabelArea();r&&Ks(i,r);const s=this.getLabelItems(t);for(const a of s){const l=a.options,u=a.font,d=a.label,f=a.textOffset;cr(i,d,0,f,u,l)}r&&Xs(i)}drawTitle(){const{ctx:t,options:{position:n,title:i,reverse:r}}=this;if(!i.display)return;const s=ce(i.font),a=Se(i.padding),l=i.align;let u=s.lineHeight/2;n==="bottom"||n==="center"||It(n)?(u+=a.bottom,Gt(i.text)&&(u+=s.lineHeight*(i.text.length-1))):u+=a.top;const{titleX:d,titleY:f,maxWidth:m,rotation:g}=nO(this,u,n,l);cr(t,i.text,0,0,s,{color:i.color,maxWidth:m,rotation:g,textAlign:eO(l,n,r),textBaseline:"middle",translation:[d,f]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,i=Ct(t.grid&&t.grid.z,-1),r=Ct(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==hr.prototype.draw?[{z:n,draw:s=>{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",r=[];let s,a;for(s=0,a=n.length;s<a;++s){const l=n[s];l[i]===this.id&&(!t||l.type===t)&&r.push(l)}return r}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return ce(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Na{constructor(t,n,i){this.type=t,this.scope=n,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let i;sO(n)&&(i=this.register(n));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,iO(t,a,i),this.override&&oe.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const n=this.items,i=t.id,r=this.scope;i in n&&delete n[i],r&&i in oe[r]&&(delete oe[r][i],this.override&&delete ar[i])}}function iO(e,t,n){const i=Ws(Object.create(null),[n?oe.get(n):{},oe.get(t),e.defaults]);oe.set(t,i),e.defaultRoutes&&rO(t,e.defaultRoutes),e.descriptors&&oe.describe(t,e.descriptors)}function rO(e,t){Object.keys(t).forEach(n=>{const i=n.split("."),r=i.pop(),s=[e].concat(i).join("."),a=t[n].split("."),l=a.pop(),u=a.join(".");oe.route(s,r,u,l)})}function sO(e){return"id"in e&&"defaults"in e}class oO{constructor(){this.controllers=new Na(Ii,"datasets",!0),this.elements=new Na(Ve,"elements"),this.plugins=new Na(Object,"plugins"),this.scales=new Na(hr,"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,n,i){[...n].forEach(r=>{const s=i||this._getRegistryForType(r);i||s.isForType(r)||s===this.plugins&&r.id?this._exec(t,s,r):te(r,a=>{const l=i||this._getRegistryForType(a);this._exec(t,l,a)})})}_exec(t,n,i){const r=jc(t);Jt(i["before"+r],[],i),n[t](i),Jt(i["after"+r],[],i)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const i=this._typedRegistries[n];if(i.isForType(t))return i}return this.plugins}_get(t,n,i){const r=n.get(t);if(r===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return r}}var jn=new oO;class aO{constructor(){this._init=void 0}notify(t,n,i,r){if(n==="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,n,i);return n==="afterDestroy"&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),a}_notify(t,n,i,r){r=r||{};for(const s of t){const a=s.plugin,l=a[i],u=[n,r,s.options];if(Jt(l,u,a)===!1&&r.cancelable)return!1}return!0}invalidate(){St(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const i=t&&t.config,r=Ct(i.options&&i.options.plugins,{}),s=lO(i);return r===!1&&!n?[]:uO(t,s,r,n)}_notifyStateChanges(t){const n=this._oldCache||[],i=this._cache,r=(s,a)=>s.filter(l=>!a.some(u=>l.plugin.id===u.plugin.id));this._notify(r(n,i),t,"stop"),this._notify(r(i,n),t,"start")}}function lO(e){const t={},n=[],i=Object.keys(jn.plugins.items);for(let s=0;s<i.length;s++)n.push(jn.getPlugin(i[s]));const r=e.plugins||[];for(let s=0;s<r.length;s++){const a=r[s];n.indexOf(a)===-1&&(n.push(a),t[a.id]=!0)}return{plugins:n,localIds:t}}function cO(e,t){return!t&&e===!1?null:e===!0?{}:e}function uO(e,{plugins:t,localIds:n},i,r){const s=[],a=e.getContext();for(const l of t){const u=l.id,d=cO(i[u],r);d!==null&&s.push({plugin:l,options:dO(e.config,{plugin:l,local:n[u]},d,a)})}return s}function dO(e,{plugin:t,local:n},i,r){const s=e.pluginScopeKeys(t),a=e.getOptionScopes(i,s);return n&&t.defaults&&a.push(t.defaults),e.createResolver(a,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function _u(e,t){const n=oe.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function fO(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function hO(e,t){return e===t?"_index_":"_value_"}function ng(e){if(e==="x"||e==="y"||e==="r")return e}function pO(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function bu(e,...t){if(ng(e))return e;for(const n of t){const i=n.axis||pO(n.position)||e.length>1&&ng(e[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function ig(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function mO(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return ig(e,"x",n[0])||ig(e,"y",n[0])}return{}}function gO(e,t){const n=ar[e.type]||{scales:{}},i=t.scales||{},r=_u(e.type,t),s=Object.create(null);return Object.keys(i).forEach(a=>{const l=i[a];if(!It(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=bu(a,l,mO(a,e),oe.scales[l.type]),d=hO(u,r),f=n.scales||{};s[a]=$s(Object.create(null),[{axis:u},l,f[u],f[d]])}),e.data.datasets.forEach(a=>{const l=a.type||e.type,u=a.indexAxis||_u(l,t),f=(ar[l]||{}).scales||{};Object.keys(f).forEach(m=>{const g=fO(m,u),_=a[g+"AxisID"]||g;s[_]=s[_]||Object.create(null),$s(s[_],[{axis:g},i[_],f[m]])})}),Object.keys(s).forEach(a=>{const l=s[a];$s(l,[oe.scales[l.type],oe.scale])}),s}function rg(e){const t=e.options||(e.options={});t.plugins=Ct(t.plugins,{}),t.scales=gO(e,t)}function sg(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function yO(e){return e=e||{},e.data=sg(e.data),rg(e),e}const og=new Map,ag=new Set;function Ba(e,t){let n=og.get(e);return n||(n=t(),og.set(e,n),ag.add(n)),n}const oo=(e,t,n)=>{const i=Di(t,n);i!==void 0&&e.add(i)};class _O{constructor(t){this._config=yO(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=sg(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(),rg(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Ba(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Ba(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Ba(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return Ba(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let r=i.get(t);return(!r||n)&&(r=new Map,i.set(t,r)),r}getOptionScopes(t,n,i){const{options:r,type:s}=this,a=this._cachedScopes(t,i),l=a.get(n);if(l)return l;const u=new Set;n.forEach(f=>{t&&(u.add(t),f.forEach(m=>oo(u,t,m))),f.forEach(m=>oo(u,r,m)),f.forEach(m=>oo(u,ar[s]||{},m)),f.forEach(m=>oo(u,oe,m)),f.forEach(m=>oo(u,Jc,m))});const d=Array.from(u);return d.length===0&&d.push(Object.create(null)),ag.has(n)&&a.set(n,d),d}chartOptionScopes(){const{options:t,type:n}=this;return[t,ar[n]||{},oe.datasets[n]||{},{type:n},oe,Jc]}resolveNamedOptions(t,n,i,r=[""]){const s={$shared:!0},{resolver:a,subPrefixes:l}=lg(this._resolverCache,t,r);let u=a;if(xO(a,n)){s.$shared=!1,i=sn(i)?i():i;const d=this.createResolver(t,i,l);u=Yr(a,i,d)}for(const d of n)s[d]=u[d];return s}createResolver(t,n,i=[""],r){const{resolver:s}=lg(this._resolverCache,t,i);return It(n)?Yr(s,n,void 0,r):s}}function lg(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const r=n.join();let s=i.get(r);return s||(s={resolver:iu(t,n),subPrefixes:n.filter(l=>!l.toLowerCase().includes("hover"))},i.set(r,s)),s}const bO=e=>It(e)&&Object.getOwnPropertyNames(e).some(t=>sn(e[t]));function xO(e,t){const{isScriptable:n,isIndexable:i}=om(e);for(const r of t){const s=n(r),a=i(r),l=(a||s)&&e[r];if(s&&(sn(l)||bO(l))||a&&Gt(l))return!0}return!1}var wO="4.5.1";const vO=["top","bottom","left","right","chartArea"];function cg(e,t){return e==="top"||e==="bottom"||vO.indexOf(e)===-1&&t==="x"}function ug(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function dg(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Jt(n&&n.onComplete,[e],t)}function SO(e){const t=e.chart,n=t.options.animation;Jt(n&&n.onProgress,[e],t)}function fg(e){return ou()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Fa={},hg=e=>{const t=fg(e);return Object.values(Fa).filter(n=>n.canvas===t).pop()};function TO(e,t,n){const i=Object.keys(e);for(const r of i){const s=+r;if(s>=t){const a=e[r];delete e[r],(n>0||s>t)&&(e[s+n]=a)}}}function MO(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}let on=class{static defaults=oe;static instances=Fa;static overrides=ar;static registry=jn;static version=wO;static getChart=hg;static register(...t){jn.add(...t),pg()}static unregister(...t){jn.remove(...t),pg()}constructor(t,n){const i=this.config=new _O(n),r=fg(t),s=hg(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||$A(r)),this.platform.updateConfig(i);const l=this.platform.acquireContext(r,a.aspectRatio),u=l&&l.canvas,d=u&&u.height,f=u&&u.width;if(this.id=kD(),this.ctx=l,this.canvas=u,this.width=f,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 aO,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=WD(m=>this.update(m),a.resizeDelay||0),this._dataChanges=[],Fa[this.id]=this,!l||!u){console.error("Failed to create chart: can't acquire context from the given item");return}li.listen(this,"complete",dg),li.listen(this,"progress",SO),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:r,_aspectRatio:s}=this;return St(t)?n&&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 jn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():pm(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return im(this.canvas,this.ctx),this}stop(){return li.stop(this),this}resize(t,n){li.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,r=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,t,n,s),l=i.devicePixelRatio||this.platform.getDevicePixelRatio(),u=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,pm(this,l,!0)&&(this.notifyPlugins("resize",{size:a}),Jt(i.onResize,[this,a],this),this.attached&&this._doResize(u)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};te(n,(i,r)=>{i.id=r})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,r=Object.keys(i).reduce((a,l)=>(a[l]=!1,a),{});let s=[];n&&(s=s.concat(Object.keys(n).map(a=>{const l=n[a],u=bu(a,l),d=u==="r",f=u==="x";return{options:l,dposition:d?"chartArea":f?"bottom":"left",dtype:d?"radialLinear":f?"category":"linear"}}))),te(s,a=>{const l=a.options,u=l.id,d=bu(u,l),f=Ct(l.type,a.dtype);(l.position===void 0||cg(l.position,d)!==cg(a.dposition))&&(l.position=a.dposition),r[u]=!0;let m=null;if(u in i&&i[u].type===f)m=i[u];else{const g=jn.getScale(f);m=new g({id:u,type:f,ctx:this.ctx,chart:this}),i[m.id]=m}m.init(l,t)}),te(r,(a,l)=>{a||delete i[l]}),te(i,a=>{$e.configure(this,a,a.options),$e.addBox(this,a)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((r,s)=>r.index-s.index),i>n){for(let r=n;r<i;++r)this._destroyDatasetMeta(r);t.splice(n,i-n)}this._sortedMetasets=t.slice(0).sort(ug("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((i,r)=>{n.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,r;for(this._removeUnreferencedMetasets(),i=0,r=n.length;i<r;i++){const s=n[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||_u(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=jn.getController(l),{datasetElementType:d,dataElementType:f}=oe.datasets[l];Object.assign(u,{dataElementType:jn.getElement(f),datasetElementType:d&&jn.getElement(d)}),a.controller=new u(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){te(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const i=this._options=n.createResolver(n.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,f=this.data.datasets.length;d<f;d++){const{controller:m}=this.getDatasetMeta(d),g=!r&&s.indexOf(m)===-1;m.buildOrUpdateElements(g),a=Math.max(+m.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),r||te(s,d=>{d.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(ug("z","_idx"));const{_active:l,_lastEvent:u}=this;u?this._eventHandler(u,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){te(this.scales,t=>{$e.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Wp(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:r,count:s}of n){const a=i==="_removeElements"?-s:s;TO(t,r,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=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<n;s++)if(!Wp(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;$e.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],te(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 n=0,i=this.data.datasets.length;n<i;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,i=this.data.datasets.length;n<i;++n)this._updateDataset(n,sn(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const i=this.getDatasetMeta(t),r={meta:i,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(i.controller._update(n),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(li.has(this)?this.attached&&!li.running(this)&&li.start(this):(this.draw(),dg({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 n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,i=[];let r,s;for(r=0,s=n.length;r<s;++r){const a=n[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 n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i={meta:t,index:t.index,cancelable:!0},r=Tm(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(r&&Ks(n,r),t.controller.draw(),r&&Xs(n),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return ai(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,r){const s=gu.modes[n];return typeof s=="function"?s(this,t,i,r):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let r=i.filter(s=>s&&s._dataset===n).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},i.push(r)),r}getContext(){return this.$context||(this.$context=Ri(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){const r=i?"show":"hide",s=this.getDatasetMeta(t),a=s.controller._resolveAnimations(void 0,r);rn(n)?(s.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(s,{visible:i}),this.update(l=>l.datasetIndex===t?r:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),li.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),im(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Fa[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,n=this.platform,i=(s,a)=>{n.addEventListener(this,s,a),t[s]=a},r=(s,a,l)=>{s.offsetX=a,s.offsetY=l,this._eventHandler(s)};te(this.options.events,s=>i(s,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(u,d)=>{n.addEventListener(this,u,d),t[u]=d},r=(u,d)=>{t[u]&&(n.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)},n.isAttached(this.canvas)?l():a()}unbindEvents(){te(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},te(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const r=i?"set":"remove";let s,a,l,u;for(n==="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 n=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}});!_a(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,i){const r=this.options.hover,s=(u,d)=>u.filter(f=>!d.some(m=>f.datasetIndex===m.datasetIndex&&f.index===m.index)),a=s(n,t),l=i?t:s(t,n);a.length&&this.updateHoverStyle(a,r.mode,!1),l.length&&r.mode&&this.updateHoverStyle(l,r.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,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,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,r),(s||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:r=[],options:s}=this,a=n,l=this._getActiveElements(t,r,i,a),u=ED(t),d=MO(t,this._lastEvent,i,u);i&&(this._lastEvent=null,Jt(s.onHover,[t,l,this],this),u&&Jt(s.onClick,[t,l,this],this));const f=!_a(l,r);return(f||n)&&(this._active=l,this._updateHoverStyles(l,r,n)),this._lastEvent=d,f}_getActiveElements(t,n,i,r){if(t.type==="mouseout")return[];if(!i)return n;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,r)}};function pg(){return te(on.instances,e=>e._plugins.invalidate())}function kO(e,t,n){const{startAngle:i,x:r,y:s,outerRadius:a,innerRadius:l,options:u}=t,{borderWidth:d,borderJoinStyle:f}=u,m=Math.min(d/a,He(i-n));if(e.beginPath(),e.arc(r,s,a-d/2,i+m/2,n-m/2),l>0){const g=Math.min(d/l,He(i-n));e.arc(r,s,l+d/2,n-g/2,i+g/2,!0)}else{const g=Math.min(d/2,a*He(i-n));if(f==="round")e.arc(r,s,g,n-Et/2,i+Et/2,!0);else if(f==="bevel"){const _=2*g*g,x=-_*Math.cos(n+Et/2)+r,v=-_*Math.sin(n+Et/2)+s,S=_*Math.cos(i+Et/2)+r,C=_*Math.sin(i+Et/2)+s;e.lineTo(x,v),e.lineTo(S,C)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function DO(e,t,n){const{startAngle:i,pixelMargin:r,x:s,y:a,outerRadius:l,innerRadius:u}=t;let d=r/l;e.beginPath(),e.arc(s,a,l,i-d,n+d),u>r?(d=r/u,e.arc(s,a,u,n+d,i-d,!0)):e.arc(s,a,r,n+se,i-se),e.closePath(),e.clip()}function CO(e){return nu(e,["outerStart","outerEnd","innerStart","innerEnd"])}function AO(e,t,n,i){const r=CO(e.options.borderRadius),s=(n-t)/2,a=Math.min(s,i*t/2),l=u=>{const d=(n-Math.min(s,u))*i/2;return Re(u,0,Math.min(s,d))};return{outerStart:l(r.outerStart),outerEnd:l(r.outerEnd),innerStart:Re(r.innerStart,0,a),innerEnd:Re(r.innerEnd,0,a)}}function Gr(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function za(e,t,n,i,r,s){const{x:a,y:l,startAngle:u,pixelMargin:d,innerRadius:f}=t,m=Math.max(t.outerRadius+i+n-d,0),g=f>0?f+i+n+d:0;let _=0;const x=r-u;if(i){const ct=f>0?f-i:0,ht=m>0?m-i:0,ut=(ct+ht)/2,vt=ut!==0?x*ut/(ut+i):x;_=(x-vt)/2}const v=Math.max(.001,x*m-n/Et)/m,S=(x-v)/2,C=u+S+_,O=r-S-_,{outerStart:B,outerEnd:I,innerStart:N,innerEnd:W}=AO(t,g,m,O-C),U=m-B,D=m-I,w=C+B/U,A=O-I/D,L=g+N,$=g+W,q=C+N/L,st=O-W/$;if(e.beginPath(),s){const ct=(w+A)/2;if(e.arc(a,l,m,w,ct),e.arc(a,l,m,ct,A),I>0){const at=Gr(D,A,a,l);e.arc(at.x,at.y,I,A,O+se)}const ht=Gr($,O,a,l);if(e.lineTo(ht.x,ht.y),W>0){const at=Gr($,st,a,l);e.arc(at.x,at.y,W,O+se,st+Math.PI)}const ut=(O-W/g+(C+N/g))/2;if(e.arc(a,l,g,O-W/g,ut,!0),e.arc(a,l,g,ut,C+N/g,!0),N>0){const at=Gr(L,q,a,l);e.arc(at.x,at.y,N,q+Math.PI,C-se)}const vt=Gr(U,C,a,l);if(e.lineTo(vt.x,vt.y),B>0){const at=Gr(U,w,a,l);e.arc(at.x,at.y,B,C-se,w)}}else{e.moveTo(a,l);const ct=Math.cos(w)*m+a,ht=Math.sin(w)*m+l;e.lineTo(ct,ht);const ut=Math.cos(A)*m+a,vt=Math.sin(A)*m+l;e.lineTo(ut,vt)}e.closePath()}function OO(e,t,n,i,r){const{fullCircles:s,startAngle:a,circumference:l}=t;let u=t.endAngle;if(s){za(e,t,n,i,u,r);for(let d=0;d<s;++d)e.fill();isNaN(l)||(u=a+(l%ee||ee))}return za(e,t,n,i,u,r),e.fill(),u}function RO(e,t,n,i,r){const{fullCircles:s,startAngle:a,circumference:l,options:u}=t,{borderWidth:d,borderJoinStyle:f,borderDash:m,borderDashOffset:g,borderRadius:_}=u,x=u.borderAlign==="inner";if(!d)return;e.setLineDash(m||[]),e.lineDashOffset=g,x?(e.lineWidth=d*2,e.lineJoin=f||"round"):(e.lineWidth=d,e.lineJoin=f||"bevel");let v=t.endAngle;if(s){za(e,t,n,i,v,r);for(let S=0;S<s;++S)e.stroke();isNaN(l)||(v=a+(l%ee||ee))}x&&DO(e,t,v),u.selfJoin&&v-a>=Et&&_===0&&f!=="miter"&&kO(e,t,v),s||(za(e,t,n,i,v,r),e.stroke())}class EO 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,n,i){const r=this.getProps(["x","y"],i),{angle:s,distance:a}=Sa(r,{x:t,y:n}),{startAngle:l,endAngle:u,innerRadius:d,outerRadius:f,circumference:m}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),g=(this.options.spacing+this.options.borderWidth)/2,_=Ct(m,u-l),x=Ys(s,l,u)&&l!==u,v=_>=ee||x,S=si(a,d+g,f+g);return v&&S}getCenterPoint(t){const{x:n,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,f=(r+s)/2,m=(a+l+d+u)/2;return{x:n+Math.cos(f)*m,y:i+Math.sin(f)*m}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:n,circumference:i}=this,r=(n.offset||0)/4,s=(n.spacing||0)/2,a=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=i>ee?Math.floor(i/ee):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(Et,i||0)),d=r*u;t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,OO(t,this,d,s,a),RO(t,this,d,s,a),t.restore()}}function mg(e,t,n=t){e.lineCap=Ct(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Ct(n.borderDash,t.borderDash)),e.lineDashOffset=Ct(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Ct(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Ct(n.borderWidth,t.borderWidth),e.strokeStyle=Ct(n.borderColor,t.borderColor)}function PO(e,t,n){e.lineTo(n.x,n.y)}function IO(e){return e.stepped?tC:e.tension||e.cubicInterpolationMode==="monotone"?eC:PO}function gg(e,t,n={}){const i=e.length,{start:r=0,end:s=i-1}=n,{start:a,end:l}=t,u=Math.max(r,a),d=Math.min(s,l),f=r<a&&s<a||r>l&&s>l;return{count:i,start:u,loop:t.loop,ilen:d<u&&!f?i+d-u:d-u}}function LO(e,t,n,i){const{points:r,options:s}=t,{count:a,start:l,loop:u,ilen:d}=gg(r,n,i),f=IO(s);let{move:m=!0,reverse:g}=i||{},_,x,v;for(_=0;_<=d;++_)x=r[(l+(g?d-_:_))%a],!x.skip&&(m?(e.moveTo(x.x,x.y),m=!1):f(e,v,x,g,s.stepped),v=x);return u&&(x=r[(l+(g?d:0))%a],f(e,v,x,g,s.stepped)),!!u}function NO(e,t,n,i){const r=t.points,{count:s,start:a,ilen:l}=gg(r,n,i),{move:u=!0,reverse:d}=i||{};let f=0,m=0,g,_,x,v,S,C;const O=I=>(a+(d?l-I:I))%s,B=()=>{v!==S&&(e.lineTo(f,S),e.lineTo(f,v),e.lineTo(f,C))};for(u&&(_=r[O(0)],e.moveTo(_.x,_.y)),g=0;g<=l;++g){if(_=r[O(g)],_.skip)continue;const I=_.x,N=_.y,W=I|0;W===x?(N<v?v=N:N>S&&(S=N),f=(m*f+I)/++m):(B(),e.lineTo(I,N),x=W,m=0,v=S=N),C=N}B()}function xu(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?NO:LO}function BO(e){return e.stepped?PC:e.tension||e.cubicInterpolationMode==="monotone"?IC:dr}function FO(e,t,n,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,n,i)&&r.closePath()),mg(e,t.options),e.stroke(r)}function zO(e,t,n,i){const{segments:r,options:s}=t,a=xu(t);for(const l of r)mg(e,s,l.style),e.beginPath(),a(e,t,l,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const UO=typeof Path2D=="function";function HO(e,t,n,i){UO&&!t.options.segment?FO(e,t,n,i):zO(e,t,n,i)}class Ua 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,n){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const r=i.spanGaps?this._loop:this._fullLoop;MC(this._points,i,t,r,n),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=UC(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){const i=this.options,r=t[n],s=this.points,a=wm(this,{property:n,start:r,end:r});if(!a.length)return;const l=[],u=BO(i);let d,f;for(d=0,f=a.length;d<f;++d){const{start:m,end:g}=a[d],_=s[m],x=s[g];if(_===x){l.push(_);continue}const v=Math.abs((r-_[n])/(x[n]-_[n])),S=u(_,x,v,i.stepped);S[n]=t[n],l.push(S)}return l.length===1?l[0]:l}pathSegment(t,n,i){return xu(this)(t,this,n,i)}path(t,n,i){const r=this.segments,s=xu(this);let a=this._loop;n=n||0,i=i||this.points.length-n;for(const l of r)a&=s(t,this,l,{start:n,end:n+i-1});return!!a}draw(t,n,i,r){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),HO(t,this,i,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function yg(e,t,n,i){const r=e.options,{[n]:s}=e.getProps([n],i);return Math.abs(t-s)<r.radius+r.hitRadius}class WO 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,n,i){const r=this.options,{x:s,y:a}=this.getProps(["x","y"],i);return Math.pow(t-s,2)+Math.pow(n-a,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(t,n){return yg(this,t,"x",n)}inYRange(t,n){return yg(this,t,"y",n)}getCenterPoint(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}size(t){t=t||this.options||{};let n=t.radius||0;n=Math.max(n,n&&t.hoverRadius||0);const i=n&&t.borderWidth||0;return(n+i)*2}draw(t,n){const i=this.options;this.skip||i.radius<.1||!ai(this,n,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,eu(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function _g(e,t){const{x:n,y:i,base:r,width:s,height:a}=e.getProps(["x","y","base","width","height"],t);let l,u,d,f,m;return e.horizontal?(m=a/2,l=Math.min(n,r),u=Math.max(n,r),d=i-m,f=i+m):(m=s/2,l=n-m,u=n+m,d=Math.min(i,r),f=Math.max(i,r)),{left:l,top:d,right:u,bottom:f}}function Li(e,t,n,i){return e?0:Re(t,n,i)}function $O(e,t,n){const i=e.options.borderWidth,r=e.borderSkipped,s=sm(i);return{t:Li(r.top,s.top,0,n),r:Li(r.right,s.right,0,t),b:Li(r.bottom,s.bottom,0,n),l:Li(r.left,s.left,0,t)}}function VO(e,t,n){const{enableBorderRadius:i}=e.getProps(["enableBorderRadius"]),r=e.options.borderRadius,s=Oi(r),a=Math.min(t,n),l=e.borderSkipped,u=i||It(r);return{topLeft:Li(!u||l.top||l.left,s.topLeft,0,a),topRight:Li(!u||l.top||l.right,s.topRight,0,a),bottomLeft:Li(!u||l.bottom||l.left,s.bottomLeft,0,a),bottomRight:Li(!u||l.bottom||l.right,s.bottomRight,0,a)}}function YO(e){const t=_g(e),n=t.right-t.left,i=t.bottom-t.top,r=$O(e,n/2,i/2),s=VO(e,n/2,i/2);return{outer:{x:t.left,y:t.top,w:n,h:i,radius:s},inner:{x:t.left+r.l,y:t.top+r.t,w:n-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 wu(e,t,n,i){const r=t===null,s=n===null,l=e&&!(r&&s)&&_g(e,i);return l&&(r||si(t,l.left,l.right))&&(s||si(n,l.top,l.bottom))}function qO(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function jO(e,t){e.rect(t.x,t.y,t.w,t.h)}function vu(e,t,n={}){const i=e.x!==n.x?-t:0,r=e.y!==n.y?-t:0,s=(e.x+e.w!==n.x+n.w?t:0)-i,a=(e.y+e.h!==n.y+n.h?t:0)-r;return{x:e.x+i,y:e.y+r,w:e.w+s,h:e.h+a,radius:e.radius}}class GO 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:n,options:{borderColor:i,backgroundColor:r}}=this,{inner:s,outer:a}=YO(this),l=qO(a.radius)?Vr:jO;t.save(),(a.w!==s.w||a.h!==s.h)&&(t.beginPath(),l(t,vu(a,n,s)),t.clip(),l(t,vu(s,-n,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),l(t,vu(s,n)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,n,i){return wu(this,t,n,i)}inXRange(t,n){return wu(this,t,null,n)}inYRange(t,n){return wu(this,null,t,n)}getCenterPoint(t){const{x:n,y:i,base:r,horizontal:s}=this.getProps(["x","y","base","horizontal"],t);return{x:s?(n+r)/2:n,y:s?i:(i+r)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}var KO=Object.freeze({__proto__:null,ArcElement:EO,BarElement:GO,LineElement:Ua,PointElement:WO});const Su=["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)"],bg=Su.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function xg(e){return Su[e%Su.length]}function wg(e){return bg[e%bg.length]}function XO(e,t){return e.borderColor=xg(t),e.backgroundColor=wg(t),++t}function ZO(e,t){return e.backgroundColor=e.data.map(()=>xg(t++)),t}function QO(e,t){return e.backgroundColor=e.data.map(()=>wg(t++)),t}function JO(e){let t=0;return(n,i)=>{const r=e.getDatasetMeta(i).controller;r instanceof Js?t=ZO(n,t):r instanceof Fm?t=QO(n,t):r&&(t=XO(n,t))}}function vg(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function tR(e){return e&&(e.borderColor||e.backgroundColor)}function eR(){return oe.borderColor!=="rgba(0,0,0,0.1)"||oe.backgroundColor!=="rgba(0,0,0,0.1)"}var nR={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:i},options:r}=e.config,{elements:s}=r,a=vg(i)||tR(r)||s&&vg(s)||eR();if(!n.forceOverride&&a)return;const l=JO(e);i.forEach(l)}};function iR(e,t,n,i,r){const s=r.samples||i;if(s>=n)return e.slice(t,t+n);const a=[],l=(n-2)/(s-2);let u=0;const d=t+n-1;let f=t,m,g,_,x,v;for(a[u++]=e[f],m=0;m<s-2;m++){let S=0,C=0,O;const B=Math.floor((m+1)*l)+1+t,I=Math.min(Math.floor((m+2)*l)+1,n)+t,N=I-B;for(O=B;O<I;O++)S+=e[O].x,C+=e[O].y;S/=N,C/=N;const W=Math.floor(m*l)+1+t,U=Math.min(Math.floor((m+1)*l)+1,n)+t,{x:D,y:w}=e[f];for(_=x=-1,O=W;O<U;O++)x=.5*Math.abs((D-S)*(e[O].y-w)-(D-e[O].x)*(C-w)),x>_&&(_=x,g=e[O],v=O);a[u++]=g,f=v}return a[u++]=e[d],a}function rR(e,t,n,i){let r=0,s=0,a,l,u,d,f,m,g,_,x,v;const S=[],C=t+n-1,O=e[t].x,I=e[C].x-O;for(a=t;a<t+n;++a){l=e[a],u=(l.x-O)/I*i,d=l.y;const N=u|0;if(N===f)d<x?(x=d,m=a):d>v&&(v=d,g=a),r=(s*r+l.x)/++s;else{const W=a-1;if(!St(m)&&!St(g)){const U=Math.min(m,g),D=Math.max(m,g);U!==_&&U!==W&&S.push({...e[U],x:r}),D!==_&&D!==W&&S.push({...e[D],x:r})}a>0&&W!==_&&S.push(e[W]),S.push(l),f=N,s=0,x=v=d,m=g=_=a}}return S}function Sg(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Tg(e){e.data.datasets.forEach(t=>{Sg(t)})}function sR(e,t){const n=t.length;let i=0,r;const{iScale:s}=e,{min:a,max:l,minDefined:u,maxDefined:d}=s.getUserBounds();return u&&(i=Re(oi(t,s.axis,a).lo,0,n-1)),d?r=Re(oi(t,s.axis,l).hi+1,i,n)-i:r=n-i,{start:i,count:r}}var oR={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){Tg(e);return}const i=e.width;e.data.datasets.forEach((r,s)=>{const{_data:a,indexAxis:l}=r,u=e.getDatasetMeta(s),d=a||r.data;if(Zs([l,e.options.indexAxis])==="y"||!u.controller.supportsDecimation)return;const f=e.scales[u.xAxisID];if(f.type!=="linear"&&f.type!=="time"||e.options.parsing)return;let{start:m,count:g}=sR(u,d);const _=n.threshold||4*i;if(g<=_){Sg(r);return}St(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(n.algorithm){case"lttb":x=iR(d,m,g,i,n);break;case"min-max":x=rR(d,m,g,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}r._decimated=x})},destroy(e){Tg(e)}};function aR(e,t,n){const i=e.segments,r=e.points,s=t.points,a=[];for(const l of i){let{start:u,end:d}=l;d=Ha(u,d,r);const f=Tu(n,r[u],r[d],l.loop);if(!t.segments){a.push({source:l,target:f,start:r[u],end:r[d]});continue}const m=wm(t,f);for(const g of m){const _=Tu(n,s[g.start],s[g.end],g.loop),x=xm(l,r,_);for(const v of x)a.push({source:v,target:g,start:{[n]:Mg(f,_,"start",Math.max)},end:{[n]:Mg(f,_,"end",Math.min)}})}}return a}function Tu(e,t,n,i){if(i)return;let r=t[e],s=n[e];return e==="angle"&&(r=He(r),s=He(s)),{property:e,start:r,end:s}}function lR(e,t){const{x:n=null,y:i=null}=e||{},r=t.points,s=[];return t.segments.forEach(({start:a,end:l})=>{l=Ha(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})):n!==null&&(s.push({x:n,y:u.y}),s.push({x:n,y:d.y}))}),s}function Ha(e,t,n){for(;t>e;t--){const i=n[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Mg(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function kg(e,t){let n=[],i=!1;return Gt(e)?(i=!0,n=e):n=lR(e,t),n.length?new Ua({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function Dg(e){return e&&e.fill!==!1}function cR(e,t,n){let r=e[t].fill;const s=[t];let a;if(!n)return r;for(;r!==!1&&s.indexOf(r)===-1;){if(!le(r))return r;if(a=e[r],!a)return!1;if(a.visible)return r;s.push(r),r=a.fill}return!1}function uR(e,t,n){const i=pR(e);if(It(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return le(r)&&Math.floor(r)===r?dR(i[0],t,r,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function dR(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function fR(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:It(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function hR(e,t,n){let i;return e==="start"?i=n:e==="end"?i=t.options.reverse?t.min:t.max:It(e)?i=e.value:i=t.getBaseValue(),i}function pR(e){const t=e.options,n=t.fill;let i=Ct(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function mR(e){const{scale:t,index:n,line:i}=e,r=[],s=i.segments,a=i.points,l=gR(t,n);l.push(kg({x:null,y:t.bottom},i));for(let u=0;u<s.length;u++){const d=s[u];for(let f=d.start;f<=d.end;f++)yR(r,a[f],l)}return new Ua({points:r,options:{}})}function gR(e,t){const n=[],i=e.getMatchingVisibleMetas("line");for(let r=0;r<i.length;r++){const s=i[r];if(s.index===t)break;s.hidden||n.unshift(s.dataset)}return n}function yR(e,t,n){const i=[];for(let r=0;r<n.length;r++){const s=n[r],{first:a,last:l,point:u}=_R(s,t,"x");if(!(!u||a&&l)){if(a)i.unshift(u);else if(e.push(u),!l)break}}e.push(...i)}function _R(e,t,n){const i=e.interpolate(t,n);if(!i)return{};const r=i[n],s=e.segments,a=e.points;let l=!1,u=!1;for(let d=0;d<s.length;d++){const f=s[d],m=a[f.start][n],g=a[f.end][n];if(si(r,m,g)){l=r===m,u=r===g;break}}return{first:l,last:u,point:i}}class Cg{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,i){const{x:r,y:s,radius:a}=this;return n=n||{start:0,end:ee},t.arc(r,s,a,n.end,n.start,!0),!i.bounds}interpolate(t){const{x:n,y:i,radius:r}=this,s=t.angle;return{x:n+Math.cos(s)*r,y:i+Math.sin(s)*r,angle:s}}}function bR(e){const{chart:t,fill:n,line:i}=e;if(le(n))return xR(t,n);if(n==="stack")return mR(e);if(n==="shape")return!0;const r=wR(e);return r instanceof Cg?r:kg(r,i)}function xR(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function wR(e){return(e.scale||{}).getPointPositionForValue?SR(e):vR(e)}function vR(e){const{scale:t={},fill:n}=e,i=fR(n,t);if(le(i)){const r=t.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function SR(e){const{scale:t,fill:n}=e,i=t.options,r=t.getLabels().length,s=i.reverse?t.max:t.min,a=hR(n,t,s),l=[];if(i.grid.circular){const u=t.getPointPositionForValue(0,s);return new Cg({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 Mu(e,t,n){const i=bR(t),{chart:r,index:s,line:a,scale:l,axis:u}=t,d=a.options,f=d.fill,m=d.backgroundColor,{above:g=m,below:_=m}=f||{},x=r.getDatasetMeta(s),v=Tm(r,x);i&&a.points.length&&(Ks(e,n),TR(e,{line:a,target:i,above:g,below:_,area:n,scale:l,axis:u,clip:v}),Xs(e))}function TR(e,t){const{line:n,target:i,above:r,below:s,area:a,scale:l,clip:u}=t,d=n._loop?"angle":t.axis;e.save();let f=s;s!==r&&(d==="x"?(Ag(e,i,a.top),ku(e,{line:n,target:i,color:r,scale:l,property:d,clip:u}),e.restore(),e.save(),Ag(e,i,a.bottom)):d==="y"&&(Og(e,i,a.left),ku(e,{line:n,target:i,color:s,scale:l,property:d,clip:u}),e.restore(),e.save(),Og(e,i,a.right),f=r)),ku(e,{line:n,target:i,color:f,scale:l,property:d,clip:u}),e.restore()}function Ag(e,t,n){const{segments:i,points:r}=t;let s=!0,a=!1;e.beginPath();for(const l of i){const{start:u,end:d}=l,f=r[u],m=r[Ha(u,d,r)];s?(e.moveTo(f.x,f.y),s=!1):(e.lineTo(f.x,n),e.lineTo(f.x,f.y)),a=!!t.pathSegment(e,l,{move:a}),a?e.closePath():e.lineTo(m.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function Og(e,t,n){const{segments:i,points:r}=t;let s=!0,a=!1;e.beginPath();for(const l of i){const{start:u,end:d}=l,f=r[u],m=r[Ha(u,d,r)];s?(e.moveTo(f.x,f.y),s=!1):(e.lineTo(n,f.y),e.lineTo(f.x,f.y)),a=!!t.pathSegment(e,l,{move:a}),a?e.closePath():e.lineTo(n,m.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function ku(e,t){const{line:n,target:i,property:r,color:s,scale:a,clip:l}=t,u=aR(n,i,r);for(const{source:d,target:f,start:m,end:g}of u){const{style:{backgroundColor:_=s}={}}=d,x=i!==!0;e.save(),e.fillStyle=_,MR(e,a,l,x&&Tu(r,m,g)),e.beginPath();const v=!!n.pathSegment(e,d);let S;if(x){v?e.closePath():Rg(e,i,g,r);const C=!!i.pathSegment(e,f,{move:v,reverse:!0});S=v&&C,S||Rg(e,i,m,r)}e.closePath(),e.fill(S?"evenodd":"nonzero"),e.restore()}}function MR(e,t,n,i){const r=t.chart.chartArea,{property:s,start:a,end:l}=i||{};if(s==="x"||s==="y"){let u,d,f,m;s==="x"?(u=a,d=r.top,f=l,m=r.bottom):(u=r.left,d=a,f=r.right,m=l),e.beginPath(),n&&(u=Math.max(u,n.left),f=Math.min(f,n.right),d=Math.max(d,n.top),m=Math.min(m,n.bottom)),e.rect(u,d,f-u,m-d),e.clip()}}function Rg(e,t,n,i){const r=t.interpolate(n,i);r&&e.lineTo(r.x,r.y)}var kR={id:"filler",afterDatasetsUpdate(e,t,n){const i=(e.data.datasets||[]).length,r=[];let s,a,l,u;for(a=0;a<i;++a)s=e.getDatasetMeta(a),l=s.dataset,u=null,l&&l.options&&l instanceof Ua&&(u={visible:e.isDatasetVisible(a),index:a,fill:uR(l,a,i),chart:e,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=cR(r,a,n.propagate))},beforeDraw(e,t,n){const i=n.drawTime==="beforeDraw",r=e.getSortedVisibleDatasetMetas(),s=e.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&&Mu(e.ctx,l,s))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=e.getSortedVisibleDatasetMetas();for(let r=i.length-1;r>=0;--r){const s=i[r].$filler;Dg(s)&&Mu(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;!Dg(i)||n.drawTime!=="beforeDatasetDraw"||Mu(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Eg=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},DR=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Pg 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,n,i){this.maxWidth=t,this.maxHeight=n,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 n=Jt(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,r)=>t.sort(i,r,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,r=ce(i.font),s=r.size,a=this._computeTitleHeight(),{boxWidth:l,itemHeight:u}=Eg(i,s);let d,f;n.font=r.string,this.isHorizontal()?(d=this.maxWidth,f=this._fitRows(a,s,l,u)+10):(f=this.maxHeight,d=this._fitCols(a,r,l,u)+10),this.width=Math.min(d,t.maxWidth||this.maxWidth),this.height=Math.min(f,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,r){const{ctx:s,maxWidth:a,options:{labels:{padding:l}}}=this,u=this.legendHitBoxes=[],d=this.lineWidths=[0],f=r+l;let m=t;s.textAlign="left",s.textBaseline="middle";let g=-1,_=-f;return this.legendItems.forEach((x,v)=>{const S=i+n/2+s.measureText(x.text).width;(v===0||d[d.length-1]+S+2*l>a)&&(m+=f,d[d.length-(v>0?0:1)]=0,_+=f,g++),u[v]={left:0,top:_,row:g,width:S,height:r},d[d.length-1]+=S+l}),m}_fitCols(t,n,i,r){const{ctx:s,maxHeight:a,options:{labels:{padding:l}}}=this,u=this.legendHitBoxes=[],d=this.columnSizes=[],f=a-t;let m=l,g=0,_=0,x=0,v=0;return this.legendItems.forEach((S,C)=>{const{itemWidth:O,itemHeight:B}=CR(i,n,s,S,r);C>0&&_+B+2*l>f&&(m+=g+l,d.push({width:g,height:_}),x+=g+l,v++,g=_=0),u[C]={left:x,top:_,col:v,width:O,height:B},g=Math.max(g,O),_+=B+l}),m+=g,d.push({width:g,height:_}),m}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:r},rtl:s}}=this,a=jr(s,this.left,this.width);if(this.isHorizontal()){let l=0,u=We(i,this.left+r,this.right-this.lineWidths[l]);for(const d of n)l!==d.row&&(l=d.row,u=We(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=We(i,this.top+t+r,this.bottom-this.columnSizes[l].height);for(const d of n)d.col!==l&&(l=d.col,u=We(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;Ks(t,this),this._draw(),Xs(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:r}=this,{align:s,labels:a}=t,l=oe.color,u=jr(t.rtl,this.left,this.width),d=ce(a.font),{padding:f}=a,m=d.size,g=m/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:S}=Eg(a,m),C=function(W,U,D){if(isNaN(x)||x<=0||isNaN(v)||v<0)return;r.save();const w=Ct(D.lineWidth,1);if(r.fillStyle=Ct(D.fillStyle,l),r.lineCap=Ct(D.lineCap,"butt"),r.lineDashOffset=Ct(D.lineDashOffset,0),r.lineJoin=Ct(D.lineJoin,"miter"),r.lineWidth=w,r.strokeStyle=Ct(D.strokeStyle,l),r.setLineDash(Ct(D.lineDash,[])),a.usePointStyle){const A={radius:v*Math.SQRT2/2,pointStyle:D.pointStyle,rotation:D.rotation,borderWidth:w},L=u.xPlus(W,x/2),$=U+g;rm(r,A,L,$,a.pointStyleWidth&&x)}else{const A=U+Math.max((m-v)/2,0),L=u.leftForLtr(W,x),$=Oi(D.borderRadius);r.beginPath(),Object.values($).some(q=>q!==0)?Vr(r,{x:L,y:A,w:x,h:v,radius:$}):r.rect(L,A,x,v),r.fill(),w!==0&&r.stroke()}r.restore()},O=function(W,U,D){cr(r,D.text,W,U+S/2,d,{strikethrough:D.hidden,textAlign:u.textAlign(D.textAlign)})},B=this.isHorizontal(),I=this._computeTitleHeight();B?_={x:We(s,this.left+f,this.right-i[0]),y:this.top+f+I,line:0}:_={x:this.left+f,y:We(s,this.top+I+f,this.bottom-n[0].height),line:0},gm(this.ctx,t.textDirection);const N=S+f;this.legendItems.forEach((W,U)=>{r.strokeStyle=W.fontColor,r.fillStyle=W.fontColor;const D=r.measureText(W.text).width,w=u.textAlign(W.textAlign||(W.textAlign=a.textAlign)),A=x+g+D;let L=_.x,$=_.y;u.setWidth(this.width),B?U>0&&L+A+f>this.right&&($=_.y+=N,_.line++,L=_.x=We(s,this.left+f,this.right-i[_.line])):U>0&&$+N>this.bottom&&(L=_.x=L+n[_.line].width+f,_.line++,$=_.y=We(s,this.top+I+f,this.bottom-n[_.line].height));const q=u.x(L);if(C(q,$,W),L=$D(w,L+x+g,B?L+A:this.right,t.rtl),O(u.x(L),$,W),B)_.x+=A+f;else if(typeof W.text!="string"){const st=d.lineHeight;_.y+=Ig(W,st)+f}else _.y+=N}),ym(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=ce(n.font),r=Se(n.padding);if(!n.display)return;const s=jr(t.rtl,this.left,this.width),a=this.ctx,l=n.position,u=i.size/2,d=r.top+u;let f,m=this.left,g=this.width;if(this.isHorizontal())g=Math.max(...this.lineWidths),f=this.top+d,m=We(t.align,m,this.right-g);else{const x=this.columnSizes.reduce((v,S)=>Math.max(v,S.height),0);f=d+We(t.align,this.top,this.bottom-x-t.labels.padding-this._computeTitleHeight())}const _=We(l,m,m+g);a.textAlign=s.textAlign(Xc(l)),a.textBaseline="middle",a.strokeStyle=n.color,a.fillStyle=n.color,a.font=i.string,cr(a,n.text,_,f,i)}_computeTitleHeight(){const t=this.options.title,n=ce(t.font),i=Se(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,r,s;if(si(t,this.left,this.right)&&si(n,this.top,this.bottom)){for(s=this.legendHitBoxes,i=0;i<s.length;++i)if(r=s[i],si(t,r.left,r.left+r.width)&&si(n,r.top,r.top+r.height))return this.legendItems[i]}return null}handleEvent(t){const n=this.options;if(!RR(t.type,n))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,s=DR(r,i);r&&!s&&Jt(n.onLeave,[t,r,this],this),this._hoveredItem=i,i&&!s&&Jt(n.onHover,[t,i,this],this)}else i&&Jt(n.onClick,[t,i,this],this)}}function CR(e,t,n,i,r){const s=AR(i,e,t,n),a=OR(r,i,t.lineHeight);return{itemWidth:s,itemHeight:a}}function AR(e,t,n,i){let r=e.text;return r&&typeof r!="string"&&(r=r.reduce((s,a)=>s.length>a.length?s:a)),t+n.size/2+i.measureText(r).width}function OR(e,t,n){let i=e;return typeof t.text!="string"&&(i=Ig(t,n)),i}function Ig(e,t){const n=e.text?e.text.length:0;return t*n}function RR(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var ER={id:"legend",_element:Pg,start(e,t,n){const i=e.legend=new Pg({ctx:e.ctx,options:n,chart:e});$e.configure(e,i,n),$e.addBox(e,i)},stop(e){$e.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;$e.configure(e,i,n),i.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const i=t.datasetIndex,r=n.chart;r.isDatasetVisible(i)?(r.hide(i),t.hidden=!0):(r.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:r,color:s,useBorderRadius:a,borderRadius:l}}=e.legend.options;return e._getSortedDatasetMetas().map(u=>{const d=u.controller.getStyle(n?0:void 0),f=Se(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:(f.width+f.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:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Du 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,n){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=n;const r=Gt(i.text)?i.text.length:1;this._padding=Se(i.padding);const s=r*ce(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:n,left:i,bottom:r,right:s,options:a}=this,l=a.align;let u=0,d,f,m;return this.isHorizontal()?(f=We(l,i,s),m=n+t,d=s-i):(a.position==="left"?(f=i+t,m=We(l,r,n),u=Et*-.5):(f=s-t,m=We(l,n,r),u=Et*.5),d=r-n),{titleX:f,titleY:m,maxWidth:d,rotation:u}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=ce(n.font),s=i.lineHeight/2+this._padding.top,{titleX:a,titleY:l,maxWidth:u,rotation:d}=this._drawArgs(s);cr(t,n.text,0,0,i,{color:n.color,maxWidth:u,rotation:d,textAlign:Xc(n.align),textBaseline:"middle",translation:[a,l]})}}function PR(e,t){const n=new Du({ctx:e.ctx,options:t,chart:e});$e.configure(e,n,t),$e.addBox(e,n),e.titleBlock=n}var IR={id:"title",_element:Du,start(e,t,n){PR(e,n)},stop(e){const t=e.titleBlock;$e.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;$e.configure(e,i,n),i.options=n},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 Wa=new WeakMap;var LR={id:"subtitle",start(e,t,n){const i=new Du({ctx:e.ctx,options:n,chart:e});$e.configure(e,i,n),$e.addBox(e,i),Wa.set(e,i)},stop(e){$e.removeBox(e,Wa.get(e)),Wa.delete(e)},beforeUpdate(e,t,n){const i=Wa.get(e);$e.configure(e,i,n),i.options=n},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 ao={average(e){if(!e.length)return!1;let t,n,i=new Set,r=0,s=0;for(t=0,n=e.length;t<n;++t){const l=e[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(e,t){if(!e.length)return!1;let n=t.x,i=t.y,r=Number.POSITIVE_INFINITY,s,a,l;for(s=0,a=e.length;s<a;++s){const u=e[s].element;if(u&&u.hasValue()){const d=u.getCenterPoint(),f=$r(t,d);f<r&&(r=f,l=u)}}if(l){const u=l.tooltipPosition();n=u.x,i=u.y}return{x:n,y:i}}};function Gn(e,t){return t&&(Gt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function ci(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
1
|
+
(function(It,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("vue"),require("@kong/icons"),require("@kong-ui-public/i18n"),require("@kong-ui-public/analytics-metric-provider"),require("@kong/kongponents")):typeof define=="function"&&define.amd?define(["exports","vue","@kong/icons","@kong-ui-public/i18n","@kong-ui-public/analytics-metric-provider","@kong/kongponents"],f):(It=typeof globalThis<"u"?globalThis:It||self,f(It["kong-ui-publicvitals-chart"]={},It.Vue,It.KongIcons,It["kong-ui-public-i18n"],It["kong-ui-public-analytics-metric-provider"],It.Kongponents))})(this,(function(It,f,fe,hh,er,As){"use strict";var bt=(e=>(e.FIFTEEN_MIN="15m",e.ONE_HOUR="1h",e.SIX_HOUR="6h",e.TWELVE_HOUR="12h",e.ONE_DAY="24h",e.SEVEN_DAY="7d",e.THIRTY_DAY="30d",e.NINETY_DAY="90d",e.ONE_HUNDRED_EIGHTY_DAY="180d",e.ONE_YEAR="365d",e.CURRENT_WEEK="current_week",e.CURRENT_MONTH="current_month",e.CURRENT_QUARTER="current_quarter",e.CURRENT_YEAR="current_year",e.PREVIOUS_WEEK="previous_week",e.PREVIOUS_MONTH="previous_month",e.PREVIOUS_QUARTER="previous_quarter",e.PREVIOUS_YEAR="previous_year",e))(bt||{});const hx=["in","not_in","selector"],px=["empty","not_empty"],mx=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],nr=e=>e.filter(t=>t!=="time"),ph=["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"],Sc=nr(ph),gx=["active_services","error_rate","request_count","request_per_minute","response_latency_average"],mh=[...ph,"ai_gateway","ai_gateway_consumer","ai_gateway_consumer_group","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"],Tc=nr(mh),yx=[...gx,"share_of_requests","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"],_x=["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"],kc=nr(_x),bx=["a2a_context_id","a2a_error","a2a_method","a2a_task_id","a2a_task_state","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"],xx=nr(bx),wx=["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"],vx=wx,Sx=["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"],Tx=nr(Sx),kx=["platform","platform_usage"],Mx=e=>kx.includes(e),Dx=[...mh.filter(e=>e!=="consumer_group"),"a2a_context_id","a2a_error","a2a_method","a2a_task_id","a2a_task_state","ai_gateway_agent","ai_gateway_mcp_server","mcp_error","mcp_method","mcp_session_id","mcp_tool_name"],Mc=nr(Dx);[...yx];const Cx=["control_plane","data_plane_group","managed_cache","network","provider","provider_region","time"],Dc=nr(Cx);new Set(Sc),new Set(Tc),new Set(kc),new Set(Mc),new Set(Dc);const gh=[{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"}],Si=e=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",...e?{enum:e}:{}},operator:{type:"string",enum:hx},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",...e?{enum:e}:{}},operator:{type:"string",enum:px}},required:["field","operator"],additionalProperties:!1}]}});({...Si()},gh.map(e=>e.code));const Ox=["control_plane","gateway_service","realm","route","plugin","plugin_name","plugin_scope","data_plane_node_version","env","team","region","hostname"];Si(Tc),Si(Sc),Si(kc),Si(Mc),Si(Dc),Si(Array.from(new Set([...xx,...vx,...Tx]))),Si([...new Set([...Tc,...Sc,...kc,...Mc,...Ox,...Dc])]);const Ax={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"}},Ex=(e,t,n)=>{let i;const r=Ax[e];return typeof r=="string"?i=r:t===1?i=r.one:i=r.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function Cc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Rx={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Px={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ix={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Lx={date:Cc({formats:Rx,defaultWidth:"full"}),time:Cc({formats:Px,defaultWidth:"full"}),dateTime:Cc({formats:Ix,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"},Bx=(e,t,n,i)=>Nx[e];function Es(e){return(t,n)=>{const i=n?.context?String(n.context):"standalone";let r;if(i==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,l=n?.width?String(n.width):a;r=e.formattingValues[l]||e.formattingValues[a]}else{const a=e.defaultWidth,l=n?.width?String(n.width):e.defaultWidth;r=e.values[l]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return r[s]}}const Fx={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},zx={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ux={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"]},Wx={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"}},$x={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"}},Vx=(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Yx={ordinalNumber:Vx,era:Es({values:Fx,defaultWidth:"wide"}),quarter:Es({values:zx,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Es({values:Ux,defaultWidth:"wide"}),day:Es({values:Hx,defaultWidth:"wide"}),dayPeriod:Es({values:Wx,defaultWidth:"wide",formattingValues:$x,defaultFormattingWidth:"wide"})};function Rs(e){return(t,n={})=>{const i=n.width,r=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],s=t.match(r);if(!s)return null;const a=s[0],l=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(l)?jx(l,m=>m.test(a)):qx(l,m=>m.test(a));let d;d=e.valueCallback?e.valueCallback(u):u,d=n.valueCallback?n.valueCallback(d):d;const h=t.slice(a.length);return{value:d,rest:h}}}function qx(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function jx(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Gx(e){return(t,n={})=>{const i=t.match(e.matchPattern);if(!i)return null;const r=i[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const l=t.slice(r.length);return{value:a,rest:l}}}const Kx=/^(\d+)(th|st|nd|rd)?/i,Xx=/\d+/i,Zx={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},Qx={any:[/^b/i,/^(a|c)/i]},Jx={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},tw={any:[/1/i,/2/i,/3/i,/4/i]},ew={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},nw={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]},iw={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},rw={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]},sw={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},ow={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}},aw={ordinalNumber:Gx({matchPattern:Kx,parsePattern:Xx,valueCallback:e=>parseInt(e,10)}),era:Rs({matchPatterns:Zx,defaultMatchWidth:"wide",parsePatterns:Qx,defaultParseWidth:"any"}),quarter:Rs({matchPatterns:Jx,defaultMatchWidth:"wide",parsePatterns:tw,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Rs({matchPatterns:ew,defaultMatchWidth:"wide",parsePatterns:nw,defaultParseWidth:"any"}),day:Rs({matchPatterns:iw,defaultMatchWidth:"wide",parsePatterns:rw,defaultParseWidth:"any"}),dayPeriod:Rs({matchPatterns:sw,defaultMatchWidth:"any",parsePatterns:ow,defaultParseWidth:"any"})},lw={code:"en-US",formatDistance:Ex,formatLong:Lx,formatRelative:Bx,localize:Yx,match:aw,options:{weekStartsOn:0,firstWeekContainsDate:1}};let cw={};function Ps(){return cw}const yh=6048e5,uw=864e5,dw=60,fw=3600,_h=Symbol.for("constructDateFrom");function Tn(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&_h in e?e[_h](t):e instanceof Date?new e.constructor(t):new Date(t)}function He(e,t){return Tn(t||e,e)}function bh(e){const t=He(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function hw(e,...t){const n=Tn.bind(null,t.find(i=>typeof i=="object"));return t.map(n)}function Nr(e,t){const n=He(e,t?.in);return n.setHours(0,0,0,0),n}function pw(e,t,n){const[i,r]=hw(n?.in,e,t),s=Nr(i),a=Nr(r),l=+s-bh(s),u=+a-bh(a);return Math.round((l-u)/uw)}function mw(e,t){const n=He(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function gw(e,t){const n=He(e,t?.in);return pw(n,mw(n))+1}function ni(e,t){const n=Ps(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=He(e,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 sa(e,t){return ni(e,{...t,weekStartsOn:1})}function xh(e,t){const n=He(e,t?.in),i=n.getFullYear(),r=Tn(n,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=sa(r),a=Tn(n,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=sa(a);return n.getTime()>=s.getTime()?i+1:n.getTime()>=l.getTime()?i:i-1}function yw(e,t){const n=xh(e,t),i=Tn(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),sa(i)}function _w(e,t){const n=He(e,t?.in),i=+sa(n)-+yw(n);return Math.round(i/yh)+1}function wh(e,t){const n=He(e,t?.in),i=n.getFullYear(),r=Ps(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=Tn(t?.in||e,0);a.setFullYear(i+1,0,s),a.setHours(0,0,0,0);const l=ni(a,t),u=Tn(t?.in||e,0);u.setFullYear(i,0,s),u.setHours(0,0,0,0);const d=ni(u,t);return+n>=+l?i+1:+n>=+d?i:i-1}function bw(e,t){const n=Ps(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=wh(e,t),s=Tn(t?.in||e,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),ni(s,t)}function xw(e,t){const n=He(e,t?.in),i=+ni(n,t)-+bw(n,t);return Math.round(i/yh)+1}function Zt(e,t){const n=e<0?"-":"",i=Math.abs(e).toString().padStart(t,"0");return n+i}const Ti={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return Zt(t==="yy"?i%100:i,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Zt(n+1,2)},d(e,t){return Zt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Zt(e.getHours()%12||12,t.length)},H(e,t){return Zt(e.getHours(),t.length)},m(e,t){return Zt(e.getMinutes(),t.length)},s(e,t){return Zt(e.getSeconds(),t.length)},S(e,t){const n=t.length,i=e.getMilliseconds(),r=Math.trunc(i*Math.pow(10,n-3));return Zt(r,t.length)}},Br={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},vh={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const i=e.getFullYear(),r=i>0?i:1-i;return n.ordinalNumber(r,{unit:"year"})}return Ti.y(e,t)},Y:function(e,t,n,i){const r=wh(e,i),s=r>0?r:1-r;if(t==="YY"){const a=s%100;return Zt(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Zt(s,t.length)},R:function(e,t){const n=xh(e);return Zt(n,t.length)},u:function(e,t){const n=e.getFullYear();return Zt(n,t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Zt(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Zt(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return Ti.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return Zt(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const r=xw(e,i);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):Zt(r,t.length)},I:function(e,t,n){const i=_w(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):Zt(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Ti.d(e,t)},D:function(e,t,n){const i=gw(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):Zt(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const r=e.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Zt(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const r=e.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 n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),r=i===0?7:i;switch(t){case"i":return String(r);case"ii":return Zt(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let r;switch(i===12?r=Br.noon:i===0?r=Br.midnight:r=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let r;switch(i>=17?r=Br.evening:i>=12?r=Br.afternoon:i>=4?r=Br.morning:r=Br.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let i=e.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Ti.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Ti.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):Zt(i,t.length)},k:function(e,t,n){let i=e.getHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):Zt(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ti.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Ti.s(e,t)},S:function(e,t){return Ti.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Th(i);case"XXXX":case"XX":return ir(i);default:return ir(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return Th(i);case"xxxx":case"xx":return ir(i);default:return ir(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Sh(i,":");default:return"GMT"+ir(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Sh(i,":");default:return"GMT"+ir(i,":")}},t:function(e,t,n){const i=Math.trunc(+e/1e3);return Zt(i,t.length)},T:function(e,t,n){return Zt(+e,t.length)}};function Sh(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Math.trunc(i/60),s=i%60;return s===0?n+String(r):n+String(r)+t+Zt(s,2)}function Th(e,t){return e%60===0?(e>0?"-":"+")+Zt(Math.abs(e)/60,2):ir(e,t)}function ir(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Zt(Math.trunc(i/60),2),s=Zt(i%60,2);return n+r+t+s}const kh=(e,t)=>{switch(e){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"})}},Mh=(e,t)=>{switch(e){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"})}},ww=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return kh(e,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}}",kh(i,t)).replace("{{time}}",Mh(r,t))},vw={p:Mh,P:ww},Sw=/^D+$/,Tw=/^Y+$/,kw=["D","DD","YY","YYYY"];function Mw(e){return Sw.test(e)}function Dw(e){return Tw.test(e)}function Cw(e,t,n){const i=Ow(e,t,n);if(console.warn(i),kw.includes(e))throw new RangeError(i)}function Ow(e,t,n){const i=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function Aw(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Ew(e){return!(!Aw(e)&&typeof e!="number"||isNaN(+He(e)))}const Rw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Pw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Iw=/^'([^]*?)'?$/,Lw=/''/g,Nw=/[a-zA-Z]/;function Bw(e,t,n){const i=Ps(),r=n?.locale??i.locale??lw,s=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,l=He(e,n?.in);if(!Ew(l))throw new RangeError("Invalid time value");let u=t.match(Pw).map(h=>{const m=h[0];if(m==="p"||m==="P"){const g=vw[m];return g(h,r.formatLong)}return h}).join("").match(Rw).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const m=h[0];if(m==="'")return{isToken:!1,value:Fw(h)};if(vh[m])return{isToken:!0,value:h};if(m.match(Nw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");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 m=h.value;(!n?.useAdditionalWeekYearTokens&&Dw(m)||!n?.useAdditionalDayOfYearTokens&&Mw(m))&&Cw(m,t,String(e));const g=vh[m[0]];return g(l,m,r.localize,d)}).join("")}function Fw(e){const t=e.match(Iw);return t?t[1].replace(Lw,"'"):e}function oa(e,t,n){const i=He(e,n?.in);return isNaN(t)?Tn(e,NaN):(i.setDate(i.getDate()+t),i)}function Dh(e,t,n){const i=He(e,n?.in);if(isNaN(t))return Tn(e,NaN);if(!t)return i;const r=i.getDate(),s=Tn(e,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 zw(e,t,n){return Dh(e,t*3,n)}function Fr(e,t){const n=He(e,t?.in),i=n.getMonth(),r=i-i%3;return n.setMonth(r,1),n.setHours(0,0,0,0),n}function zr(e,t){const n=He(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function Uw(e,t){const n=He(e,t?.in),i=n.getFullYear(),r=n.getMonth(),s=Tn(n,0);return s.setFullYear(i,r+1,0),s.setHours(0,0,0,0),s.getDate()}function Hw(){return Object.assign({},Ps())}function Ch(e){return Math.trunc(e*fw)}function Ww(e){const t=e/dw;return Math.trunc(t)}function Oh(e,t,n){return Dh(e,-1,n)}function Ah(e,t,n){return zw(e,-1,n)}function Eh(e,t,n){const i=Hw(),r=Yw(e,n.timeZone,n.locale??i.locale);return"formatToParts"in r?$w(r,t):Vw(r,t)}function $w(e,t){const n=e.formatToParts(t);for(let i=n.length-1;i>=0;--i)if(n[i].type==="timeZoneName")return n[i].value}function Vw(e,t){const n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}function Yw(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function qw(e,t){const n=Zw(t);return"formatToParts"in n?Gw(n,e):Kw(n,e)}const jw={year:0,month:1,day:2,hour:3,minute:4,second:5};function Gw(e,t){try{const n=e.formatToParts(t),i=[];for(let r=0;r<n.length;r++){const s=jw[n[r].type];s!==void 0&&(i[s]=parseInt(n[r].value,10))}return i}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function Kw(e,t){const n=e.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);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 Oc={},Rh=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")),Xw=Rh==="06/25/2014, 00:00:00"||Rh==="06/25/2014 00:00:00";function Zw(e){return Oc[e]||(Oc[e]=Xw?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Oc[e]}function Ac(e,t,n,i,r,s,a){const l=new Date(0);return l.setUTCFullYear(e,t,n),l.setUTCHours(i,r,s,a),l}const Ph=36e5,Qw=6e4,Ec={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Is(e,t,n){if(!e)return 0;let i=Ec.timezoneZ.exec(e);if(i)return 0;let r,s;if(i=Ec.timezoneHH.exec(e),i)return r=parseInt(i[1],10),Ih(r)?-(r*Ph):NaN;if(i=Ec.timezoneHHMM.exec(e),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return Ih(r,a)?(s=Math.abs(r)*Ph+a*Qw,i[1]==="+"?-s:s):NaN}if(ev(e)){t=new Date(t||Date.now());const a=n?t:Jw(t),l=Rc(a,e);return-(n?l:tv(t,l,e))}return NaN}function Jw(e){return Ac(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function Rc(e,t){const n=qw(e,t),i=Ac(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let r=e.getTime();const s=r%1e3;return r-=s>=0?s:1e3+s,i-r}function tv(e,t,n){let i=e.getTime()-t;const r=Rc(new Date(i),n);if(t===r)return t;i-=r-t;const s=Rc(new Date(i),n);return r===s?r:Math.max(r,s)}function Ih(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const Lh={};function ev(e){if(Lh[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Lh[e]=!0,!0}catch{return!1}}const nv=60*1e3,iv={X:function(e,t,n){const i=Pc(n.timeZone,e);if(i===0)return"Z";switch(t){case"X":return Nh(i);case"XXXX":case"XX":return Ur(i);default:return Ur(i,":")}},x:function(e,t,n){const i=Pc(n.timeZone,e);switch(t){case"x":return Nh(i);case"xxxx":case"xx":return Ur(i);default:return Ur(i,":")}},O:function(e,t,n){const i=Pc(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+rv(i,":");default:return"GMT"+Ur(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return Eh("short",e,n);default:return Eh("long",e,n)}}};function Pc(e,t){const n=e?Is(e,t,!0)/nv:t?.getTimezoneOffset()??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function aa(e,t){const n=e<0?"-":"";let i=Math.abs(e).toString();for(;i.length<t;)i="0"+i;return n+i}function Ur(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=aa(Math.floor(i/60),2),s=aa(Math.floor(i%60),2);return n+r+t+s}function Nh(e,t){return e%60===0?(e>0?"-":"+")+aa(Math.abs(e)/60,2):Ur(e,t)}function rv(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Math.floor(i/60),s=i%60;return s===0?n+String(r):n+String(r)+t+aa(s,2)}function Bh(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const Fh=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Ic=36e5,zh=6e4,sv=2,Ze={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:Fh};function la(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const n=t.additionalDigits==null?sv:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const i=ov(e),{year:r,restDateString:s}=av(i.date,n),a=lv(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=cv(i.time),u===null||isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(d=Is(i.timeZone||t.timeZone,new Date(l+u)),isNaN(d))return new Date(NaN)}else d=Bh(new Date(l+u)),d=Bh(new Date(l+u+d));return new Date(l+u+d)}else return new Date(NaN)}function ov(e){const t={};let n=Ze.dateTimePattern.exec(e),i;if(n?(t.date=n[1],i=n[3]):(n=Ze.datePattern.exec(e),n?(t.date=n[1],i=n[2]):(t.date=null,i=e)),i){const r=Ze.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function av(e,t){if(e){const n=Ze.YYY[t],i=Ze.YYYYY[t];let r=Ze.YYYY.exec(e)||i.exec(e);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:e.slice(s.length)}}if(r=Ze.YY.exec(e)||n.exec(e),r){const s=r[1];return{year:parseInt(s,10)*100,restDateString:e.slice(s.length)}}}return{year:null}}function lv(e,t){if(t===null)return null;let n,i,r;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let s=Ze.MM.exec(e);if(s)return n=new Date(0),i=parseInt(s[1],10)-1,Wh(t,i)?(n.setUTCFullYear(t,i),n):new Date(NaN);if(s=Ze.DDD.exec(e),s){n=new Date(0);const a=parseInt(s[1],10);return fv(t,a)?(n.setUTCFullYear(t,0,a),n):new Date(NaN)}if(s=Ze.MMDD.exec(e),s){n=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return Wh(t,i,a)?(n.setUTCFullYear(t,i,a),n):new Date(NaN)}if(s=Ze.Www.exec(e),s)return r=parseInt(s[1],10)-1,$h(r)?Uh(t,r):new Date(NaN);if(s=Ze.WwwD.exec(e),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return $h(r,a)?Uh(t,r,a):new Date(NaN)}return null}function cv(e){let t,n,i=Ze.HH.exec(e);if(i)return t=parseFloat(i[1].replace(",",".")),Lc(t)?t%24*Ic:NaN;if(i=Ze.HHMM.exec(e),i)return t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),Lc(t,n)?t%24*Ic+n*zh:NaN;if(i=Ze.HHMMSS.exec(e),i){t=parseInt(i[1],10),n=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return Lc(t,n,r)?t%24*Ic+n*zh+r*1e3:NaN}return null}function Uh(e,t,n){t=t||0,n=n||0;const i=new Date(0);i.setUTCFullYear(e,0,4);const r=i.getUTCDay()||7,s=t*7+n+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const uv=[31,28,31,30,31,30,31,31,30,31,30,31],dv=[31,29,31,30,31,30,31,31,30,31,30,31];function Hh(e){return e%400===0||e%4===0&&e%100!==0}function Wh(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const i=Hh(e);if(i&&n>dv[t]||!i&&n>uv[t])return!1}return!0}function fv(e,t){if(t<1)return!1;const n=Hh(e);return!(n&&t>366||!n&&t>365)}function $h(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function Lc(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const hv=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function pv(e,t,n={}){t=String(t);const i=t.match(hv);if(i){const r=la(n.originalDate||e,n);t=i.reduce(function(s,a){if(a[0]==="'")return s;const l=s.indexOf(a),u=s[l-1]==="'",d=s.replace(a,"'"+iv[a[0]](r,a,n)+"'");return u?d.substring(0,l-1)+d.substring(l+1):d},t)}return Bw(e,t,n)}function Vh(e,t,n){e=la(e,n);const i=Is(t,e,!0),r=new Date(e.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 Yh(e,t,n,i){return i={...i,timeZone:t,originalDate:e},pv(Vh(e,t,{timeZone:i.timeZone}),n,i)}function mv(e,t,n){if(typeof e=="string"&&!e.match(Fh))return la(e,{...n,timeZone:t});e=la(e,n);const i=Ac(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),r=Is(t,new Date(i));return new Date(i+r)}function gv(e,t){return-Is(e,t)}function qh(e,t={}){const n=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)"),Yh(e,n,i)}function yv(e,t={}){if(!e)return e;const n=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(e);return Yh(r,n,i)}catch{return console.error("Invalid value passed to formatTime",e),"(invalid date)"}}const _v={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 ca(e){return e&&mx.find(t=>e<=_v[t])||null}var ua=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},da={exports:{}};da.exports;var jh;function bv(){return jh||(jh=1,(function(e,t){var n=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]",m="[object GeneratorFunction]",g="[object Map]",_="[object Number]",x="[object Object]",v="[object Promise]",S="[object RegExp]",C="[object Set]",A="[object String]",F="[object Symbol]",P="[object WeakMap]",B="[object ArrayBuffer]",N="[object DataView]",z="[object Float32Array]",k="[object Float64Array]",w="[object Int8Array]",O="[object Int16Array]",L="[object Int32Array]",$="[object Uint8Array]",q="[object Uint8ClampedArray]",st="[object Uint16Array]",ct="[object Uint32Array]",ht=/[\\^$.*+?()[\]{}|]/g,ut=/\w*$/,vt=/^\[object .+?Constructor\]$/,at=/^(?:0|[1-9]\d*)$/,dt={};dt[s]=dt[a]=dt[B]=dt[N]=dt[l]=dt[u]=dt[z]=dt[k]=dt[w]=dt[O]=dt[L]=dt[g]=dt[_]=dt[x]=dt[S]=dt[C]=dt[A]=dt[F]=dt[$]=dt[q]=dt[st]=dt[ct]=!0,dt[d]=dt[h]=dt[P]=!1;var V=typeof ua=="object"&&ua&&ua.Object===Object&&ua,I=typeof self=="object"&&self&&self.Object===Object&&self,W=V||I||Function("return this")(),nt=t&&!t.nodeType&&t,ot=nt&&!0&&e&&!e.nodeType&&e,X=ot&&ot.exports===nt;function tt(D,Y){return D.set(Y[0],Y[1]),D}function rt(D,Y){return D.add(Y),D}function pt(D,Y){for(var J=-1,xt=D?D.length:0;++J<xt&&Y(D[J],J,D)!==!1;);return D}function yt(D,Y){for(var J=-1,xt=Y.length,Ce=D.length;++J<xt;)D[Ce+J]=Y[J];return D}function mt(D,Y,J,xt){for(var Ce=-1,Ge=D?D.length:0;++Ce<Ge;)J=Y(J,D[Ce],Ce,D);return J}function Et(D,Y){for(var J=-1,xt=Array(D);++J<D;)xt[J]=Y(J);return xt}function zt(D,Y){return D?.[Y]}function G(D){var Y=!1;if(D!=null&&typeof D.toString!="function")try{Y=!!(D+"")}catch{}return Y}function it(D){var Y=-1,J=Array(D.size);return D.forEach(function(xt,Ce){J[++Y]=[Ce,xt]}),J}function lt(D,Y){return function(J){return D(Y(J))}}function $t(D){var Y=-1,J=Array(D.size);return D.forEach(function(xt){J[++Y]=xt}),J}var _t=Array.prototype,Vt=Function.prototype,Te=Object.prototype,ke=W["__core-js_shared__"],ae=(function(){var D=/[^.]+$/.exec(ke&&ke.keys&&ke.keys.IE_PROTO||"");return D?"Symbol(src)_1."+D:""})(),cn=Vt.toString,qt=Te.hasOwnProperty,Be=Te.toString,re=RegExp("^"+cn.call(qt).replace(ht,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),De=X?W.Buffer:void 0,Pe=W.Symbol,gn=W.Uint8Array,Wi=lt(Object.getPrototypeOf,Object),Cn=Object.create,je=Te.propertyIsEnumerable,Ln=_t.splice,di=Object.getOwnPropertySymbols,Oo=De?De.isBuffer:void 0,Ao=lt(Object.keys,Object),Tr=Zn(W,"DataView"),fi=Zn(W,"Map"),Eo=Zn(W,"Promise"),Ro=Zn(W,"Set"),Po=Zn(W,"WeakMap"),$i=Zn(Object,"create"),bl=pi(Tr),Od=pi(fi),Ad=pi(Eo),Ed=pi(Ro),Rd=pi(Po),Io=Pe?Pe.prototype:void 0,xl=Io?Io.valueOf:void 0;function hi(D){var Y=-1,J=D?D.length:0;for(this.clear();++Y<J;){var xt=D[Y];this.set(xt[0],xt[1])}}function Pd(){this.__data__=$i?$i(null):{}}function Lo(D){return this.has(D)&&delete this.__data__[D]}function Id(D){var Y=this.__data__;if($i){var J=Y[D];return J===i?void 0:J}return qt.call(Y,D)?Y[D]:void 0}function No(D){var Y=this.__data__;return $i?Y[D]!==void 0:qt.call(Y,D)}function Ld(D,Y){var J=this.__data__;return J[D]=$i&&Y===void 0?i:Y,this}hi.prototype.clear=Pd,hi.prototype.delete=Lo,hi.prototype.get=Id,hi.prototype.has=No,hi.prototype.set=Ld;function Nn(D){var Y=-1,J=D?D.length:0;for(this.clear();++Y<J;){var xt=D[Y];this.set(xt[0],xt[1])}}function Nd(){this.__data__=[]}function Bd(D){var Y=this.__data__,J=kr(Y,D);if(J<0)return!1;var xt=Y.length-1;return J==xt?Y.pop():Ln.call(Y,J,1),!0}function Fd(D){var Y=this.__data__,J=kr(Y,D);return J<0?void 0:Y[J][1]}function wl(D){return kr(this.__data__,D)>-1}function zd(D,Y){var J=this.__data__,xt=kr(J,D);return xt<0?J.push([D,Y]):J[xt][1]=Y,this}Nn.prototype.clear=Nd,Nn.prototype.delete=Bd,Nn.prototype.get=Fd,Nn.prototype.has=wl,Nn.prototype.set=zd;function Vi(D){var Y=-1,J=D?D.length:0;for(this.clear();++Y<J;){var xt=D[Y];this.set(xt[0],xt[1])}}function vl(){this.__data__={hash:new hi,map:new(fi||Nn),string:new hi}}function Ud(D){return Mr(this,D).delete(D)}function Hd(D){return Mr(this,D).get(D)}function Wd(D){return Mr(this,D).has(D)}function $d(D,Y){return Mr(this,D).set(D,Y),this}Vi.prototype.clear=vl,Vi.prototype.delete=Ud,Vi.prototype.get=Hd,Vi.prototype.has=Wd,Vi.prototype.set=$d;function Yi(D){this.__data__=new Nn(D)}function Vd(){this.__data__=new Nn}function ls(D){return this.__data__.delete(D)}function Yd(D){return this.__data__.get(D)}function cs(D){return this.__data__.has(D)}function qd(D,Y){var J=this.__data__;if(J instanceof Nn){var xt=J.__data__;if(!fi||xt.length<n-1)return xt.push([D,Y]),this;J=this.__data__=new Vi(xt)}return J.set(D,Y),this}Yi.prototype.clear=Vd,Yi.prototype.delete=ls,Yi.prototype.get=Yd,Yi.prototype.has=cs,Yi.prototype.set=qd;function jd(D,Y){var J=Ho(D)||Nl(D)?Et(D.length,String):[],xt=J.length,Ce=!!xt;for(var Ge in D)qt.call(D,Ge)&&!(Ce&&(Ge=="length"||Rl(Ge,xt)))&&J.push(Ge);return J}function Sl(D,Y,J){var xt=D[Y];(!(qt.call(D,Y)&&Ll(xt,J))||J===void 0&&!(Y in D))&&(D[Y]=J)}function kr(D,Y){for(var J=D.length;J--;)if(Ll(D[J][0],Y))return J;return-1}function Tl(D,Y){return D&&Fo(Y,Wo(Y),D)}function us(D,Y,J,xt,Ce,Ge,Bn){var Fe;if(xt&&(Fe=Ge?xt(D,Ce,Ge,Bn):xt(D)),Fe!==void 0)return Fe;if(!ms(D))return D;var Fl=Ho(D);if(Fl){if(Fe=Al(D),!Y)return Ol(D,Fe)}else{var ue=un(D),gs=ue==h||ue==m;if(sf(D))return Ml(D,Y);if(ue==x||ue==s||gs&&!Ge){if(G(D))return Ge?D:{};if(Fe=El(gs?{}:D),!Y)return zo(D,Tl(Fe,D))}else{if(!dt[ue])return Ge?D:{};Fe=ef(D,ue,us,Y)}}Bn||(Bn=new Yi);var Qn=Bn.get(D);if(Qn)return Qn;if(Bn.set(D,Fe),!Fl)var $o=J?tf(D):Wo(D);return pt($o||D,function(Dr,ze){$o&&(ze=Dr,Dr=D[ze]),Sl(Fe,ze,us(Dr,Y,J,xt,ze,D,Bn))}),Fe}function Gd(D){return ms(D)?Cn(D):{}}function Kd(D,Y,J){var xt=Y(D);return Ho(D)?xt:yt(xt,J(D))}function Xd(D){return Be.call(D)}function Zd(D){if(!ms(D)||Il(D))return!1;var Y=ps(D)||G(D)?re:vt;return Y.test(pi(D))}function kl(D){if(!Uo(D))return Ao(D);var Y=[];for(var J in Object(D))qt.call(D,J)&&J!="constructor"&&Y.push(J);return Y}function Ml(D,Y){if(Y)return D.slice();var J=new D.constructor(D.length);return D.copy(J),J}function ds(D){var Y=new D.constructor(D.byteLength);return new gn(Y).set(new gn(D)),Y}function Bo(D,Y){var J=Y?ds(D.buffer):D.buffer;return new D.constructor(J,D.byteOffset,D.byteLength)}function Qd(D,Y,J){var xt=Y?J(it(D),!0):it(D);return mt(xt,tt,new D.constructor)}function Dl(D){var Y=new D.constructor(D.source,ut.exec(D));return Y.lastIndex=D.lastIndex,Y}function fs(D,Y,J){var xt=Y?J($t(D),!0):$t(D);return mt(xt,rt,new D.constructor)}function Cl(D){return xl?Object(xl.call(D)):{}}function Jd(D,Y){var J=Y?ds(D.buffer):D.buffer;return new D.constructor(J,D.byteOffset,D.length)}function Ol(D,Y){var J=-1,xt=D.length;for(Y||(Y=Array(xt));++J<xt;)Y[J]=D[J];return Y}function Fo(D,Y,J,xt){J||(J={});for(var Ce=-1,Ge=Y.length;++Ce<Ge;){var Bn=Y[Ce],Fe=void 0;Sl(J,Bn,Fe===void 0?D[Bn]:Fe)}return J}function zo(D,Y){return Fo(D,hs(D),Y)}function tf(D){return Kd(D,Wo,hs)}function Mr(D,Y){var J=D.__data__;return Pl(Y)?J[typeof Y=="string"?"string":"hash"]:J.map}function Zn(D,Y){var J=zt(D,Y);return Zd(J)?J:void 0}var hs=di?lt(di,Object):lf,un=Xd;(Tr&&un(new Tr(new ArrayBuffer(1)))!=N||fi&&un(new fi)!=g||Eo&&un(Eo.resolve())!=v||Ro&&un(new Ro)!=C||Po&&un(new Po)!=P)&&(un=function(D){var Y=Be.call(D),J=Y==x?D.constructor:void 0,xt=J?pi(J):void 0;if(xt)switch(xt){case bl:return N;case Od:return g;case Ad:return v;case Ed:return C;case Rd:return P}return Y});function Al(D){var Y=D.length,J=D.constructor(Y);return Y&&typeof D[0]=="string"&&qt.call(D,"index")&&(J.index=D.index,J.input=D.input),J}function El(D){return typeof D.constructor=="function"&&!Uo(D)?Gd(Wi(D)):{}}function ef(D,Y,J,xt){var Ce=D.constructor;switch(Y){case B:return ds(D);case l:case u:return new Ce(+D);case N:return Bo(D,xt);case z:case k:case w:case O:case L:case $:case q:case st:case ct:return Jd(D,xt);case g:return Qd(D,xt,J);case _:case A:return new Ce(D);case S:return Dl(D);case C:return fs(D,xt,J);case F:return Cl(D)}}function Rl(D,Y){return Y=Y??r,!!Y&&(typeof D=="number"||at.test(D))&&D>-1&&D%1==0&&D<Y}function Pl(D){var Y=typeof D;return Y=="string"||Y=="number"||Y=="symbol"||Y=="boolean"?D!=="__proto__":D===null}function Il(D){return!!ae&&ae in D}function Uo(D){var Y=D&&D.constructor,J=typeof Y=="function"&&Y.prototype||Te;return D===J}function pi(D){if(D!=null){try{return cn.call(D)}catch{}try{return D+""}catch{}}return""}function nf(D){return us(D,!0,!0)}function Ll(D,Y){return D===Y||D!==D&&Y!==Y}function Nl(D){return rf(D)&&qt.call(D,"callee")&&(!je.call(D,"callee")||Be.call(D)==s)}var Ho=Array.isArray;function Bl(D){return D!=null&&of(D.length)&&!ps(D)}function rf(D){return af(D)&&Bl(D)}var sf=Oo||ne;function ps(D){var Y=ms(D)?Be.call(D):"";return Y==h||Y==m}function of(D){return typeof D=="number"&&D>-1&&D%1==0&&D<=r}function ms(D){var Y=typeof D;return!!D&&(Y=="object"||Y=="function")}function af(D){return!!D&&typeof D=="object"}function Wo(D){return Bl(D)?jd(D):kl(D)}function lf(){return[]}function ne(){return!1}e.exports=nf})(da,da.exports)),da.exports}bv();const kn=(e,t)=>new Date(e.getTime()-gv(t,e));class Ee{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 n=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&n.add("minutely"),i>=2&&i<=168&&n.add("hourly"),i>=48&&n.add("daily"),i>=672&&n.add("weekly"),n}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 n=mv(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Vh(n,t)}}class xv extends Ee{rawStart(t){let n=ni(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=kn(n,t)),n}maximumTimeframeLength(){return 3600*24*7}}class wv extends Ee{rawStart(t){let n=zr(this.tzAdjustedDate(t));return t&&(n=kn(n,t)),n}maximumTimeframeLength(){return 3600*24*31}}class vv extends Ee{rawStart(t){let n=Fr(this.tzAdjustedDate(t));return t&&(n=kn(n,t)),n}maximumTimeframeLength(){return 3600*24*92}}class Sv extends Ee{rawStart(t){let n=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(n=kn(n,t)),n}maximumTimeframeLength(){return 3600*24*366}}class Tv extends Ee{rawEnd(t){let n=ni(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=kn(n,t)),n}rawStart(t){const n=this.tzAdjustedDate(t);let i=ni(n.setDate(n.getDate()-7),{weekStartsOn:1});return t&&(i=kn(i,t)),i}}class kv extends Ee{rawEnd(t){let n=Fr(this.tzAdjustedDate(t));return t&&(n=kn(n,t)),n}rawStart(t){let n=Fr(Ah(this.tzAdjustedDate(t)));return t&&(n=kn(n,t)),n}}class Mv extends Ee{rawEnd(t){let n=zr(this.tzAdjustedDate(t));return t&&(n=kn(n,t)),n}rawStart(t){let n=zr(Oh(this.tzAdjustedDate(t)));return t&&(n=kn(n,t)),n}}class Dv extends Ee{rawEnd(t){let n=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(n=kn(n,t)),n}rawStart(t){let n=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(n=kn(n,t)),n}}bt.FIFTEEN_MIN,new Ee({key:bt.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"]}),bt.ONE_HOUR,new Ee({key:bt.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"]}),bt.SIX_HOUR,new Ee({key:bt.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"]}),bt.TWELVE_HOUR,new Ee({key:bt.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"]}),bt.ONE_DAY,new Ee({key:bt.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"]}),bt.SEVEN_DAY,new Ee({key:bt.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"]}),bt.THIRTY_DAY,new Ee({key:bt.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"]}),bt.NINETY_DAY,new Ee({key:bt.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"]}),bt.ONE_HUNDRED_EIGHTY_DAY,new Ee({key:bt.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"]}),bt.ONE_YEAR,new Ee({key:bt.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"]}),bt.CURRENT_WEEK,new xv({key:bt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const e=ni(new Date,{weekStartsOn:1});return(Nr(oa(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),bt.CURRENT_MONTH,new wv({key:bt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const e=zr(new Date);return(Nr(oa(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),bt.CURRENT_QUARTER,new vv({key:bt.CURRENT_QUARTER,display:"This quarter",timeframeText:"Quarter",timeframeLength:()=>{const e=Fr(new Date);return(Nr(oa(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),bt.CURRENT_YEAR,new Sv({key:bt.CURRENT_YEAR,display:"This year",timeframeText:"Year",timeframeLength:()=>{const e=new Date(new Date().getFullYear(),0,1);return(Nr(oa(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),bt.PREVIOUS_WEEK,new Tv({key:bt.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"]}),bt.PREVIOUS_MONTH,new Mv({key:bt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=zr(new Date),n=zr(Oh(new Date));return t.getTimezoneOffset()!==n.getTimezoneOffset()&&(e=Gh(t,n)),3600*24*Uw(new Date().setMonth(new Date().getMonth()-1))+Ch(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),bt.PREVIOUS_QUARTER,new kv({key:bt.PREVIOUS_QUARTER,display:"Previous quarter",timeframeText:"Quarter",timeframeLength:()=>{const e=Fr(new Date),t=Fr(Ah(new Date));return(e.getTime()-t.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),bt.PREVIOUS_YEAR,new Dv({key:bt.PREVIOUS_YEAR,display:"Previous year",timeframeText:"Year",timeframeLength:()=>{const e=new Date(new Date().getFullYear(),0,1),t=new Date(new Date().getFullYear()-1,0,1);let n=0;return e.getTimezoneOffset()!==t.getTimezoneOffset()&&(n=Gh(e,t)),3600*24*(365+(t.getFullYear()%4===0?1:0))+Ch(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Gh(e,t){return Ww(e.getTimezoneOffset()-t.getTimezoneOffset())}bt.FIFTEEN_MIN,bt.ONE_HOUR,bt.SIX_HOUR,bt.TWELVE_HOUR,bt.ONE_DAY,bt.SEVEN_DAY,bt.FIFTEEN_MIN,bt.ONE_HOUR,bt.SIX_HOUR,bt.TWELVE_HOUR,bt.ONE_DAY,bt.SEVEN_DAY,bt.THIRTY_DAY,bt.NINETY_DAY,bt.ONE_HUNDRED_EIGHTY_DAY,bt.ONE_YEAR,bt.CURRENT_WEEK,bt.CURRENT_MONTH,bt.CURRENT_QUARTER,bt.CURRENT_YEAR,bt.PREVIOUS_WEEK,bt.PREVIOUS_MONTH,bt.PREVIOUS_QUARTER,bt.PREVIOUS_YEAR;const Cv=new Map(gh.map(e=>[e.code,{code:e.code,name:e.name}])),Nc=e=>Cv.get(e)?.name||e,Kh=1e3,Ov=1e4,Xh=1e6,Zh=1e9,Qh=1e12,fa=(e,t)=>{if(t.separator===!1||e<1e3)return e.toString();const n=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(e).toString().split("").reverse().forEach((r,s)=>{s&&s%3===0&&i.push(n),i.push(r)}),i.reverse().join("")},Ls=(e,t,n)=>{const i=e/t,r=n.round?"round":"floor";if(n.decimal===!1)return Math[r](i).toString();let s;n.precision?s=i:s=i<10?Math[r](i*10)/10:Math[r](i);let a=s.toString();return typeof n.decimal=="string"&&(a=a.replace(".",n.decimal)),a};function ha(e,t={}){let n;const i=e<0;i&&(e=Math.abs(e)),t.precision&&(e=parseFloat(e.toPrecision(t.precision)));const r=t.min10k?Ov:Kh;return e<r||t.precision&&t.precision>Math.log10(e)?n=fa(Ls(e,1,t),t):e<Xh?n=`${Ls(e,Kh,t)}k`:e<Zh?n=`${Ls(e,Xh,t)}m`:e<Qh?n=`${fa(Ls(e,Zh,t),t)}b`:n=`${fa(Ls(e,Qh,t),t)}t`,i&&(n=`-${n}`),t.capital&&(n=n.toUpperCase()),t.prefix&&(n=`${t.prefix}${n}`),t.suffix&&(n=`${n}${t.suffix}`),n}ha.addCommas=fa;const Av=typeof document<"u"&&document.documentElement?.lang||"en-US",pa=new Intl.NumberFormat(Av);function $n({i18n:e}){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=e.formatNumber(Number.parseFloat((i/s).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):i>=a?h=e.formatNumber(Number.parseFloat((i/a).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):i>=l?h=e.formatNumber(Number.parseFloat((i/l).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):i>=u?h=e.formatNumber(Number.parseFloat((i/u).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):i>=d?h=e.formatNumber(Number.parseFloat((i/d).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):h=e.formatNumber(Number.parseFloat(i.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),h.replace(/([a-zA-Z]*)$/," $1")},n=(i,r="USD")=>isNaN(i)?r==="USD"?"$0.00":`${i}`:i>=.01||r!=="USD"?e.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 n(i,a);default:return isNaN(i)?`${i}`:l?`${ha(i,{capital:!0})} ${d}`:i>=.01?`${pa.format(Number.parseFloat(i.toFixed(2)))} ${d}`:`${Number.parseFloat(i.toPrecision(4))} ${d}`}},formatBytes:t,formatCost:n,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`${n(i,l)} - ${n(r,l)}`;default:if(isNaN(i)||isNaN(r))return`${i} - ${r}`;if(u)return`${ha(i,{capital:!0})} - ${ha(r,{capital:!0})} ${h}`}const m=i>=.01?`${pa.format(Number.parseFloat(i.toFixed(2)))}`:`${Number.parseFloat(i.toPrecision(4))}`,g=r>=.01?`${pa.format(Number.parseFloat(r.toFixed(2)))}`:`${Number.parseFloat(r.toPrecision(4))}`;return`${m} - ${g} ${h}`}}}const Ev=e=>{const t=e.length;let n=5381;for(let i=0;i<t;i++)n=n*33^e.charCodeAt(i);return n>>>0},Rv="#0044f4",Jh="#6c7489",Pv="#afb7c5",Iv="#d60027",Lv="#ffc400",Nv="#bee2ff",Bv="#8fc1ff",Fv="#5f9aff",zv="#306fff",Uv="#b5ffee",Hv="#00fabe",Wv="#00d6a4",$v="#00a17b",Vv="#007d60",Yv="#005944",qv="#b5ffee",jv="#00fabe",Gv="#b5ffee",Kv="#00a17b",Xv="#fff296",Zv="#ffe04b",Qv="#ffc400",Jv="#b37600",t1="#995c00",e1="#804400",n1="#fff296",i1="#ffe04b",r1="#ffc2b3",s1="#ff9877",o1="#ff723c",a1="#f75008",l1="#d13500",c1="#a31f00",u1="#ffc2b3",d1="#ff9877",f1="#ff723c",h1="#f75008",p1="#d13500",m1="#a31f00",g1="#ffc2b3",y1="#ff9877",_1="#ff723c",b1="#f75008",x1="#d13500",w1="#a31f00",v1="#ffc2b3",S1="#ff9877",T1="#ff723c",k1="#f75008",M1="#d13500",D1="#a31f00",C1="#ffc2b3",O1="#ff9877",A1="#ff723c",E1="#f75008",R1="#d13500",P1="#ffabab",I1="#ff7272",L1="#ff3954",N1="#f50045",B1="#d60027",F1="#ad000e",z1="#ffabab",U1="#ff7272",H1="#ff3954",W1="#f50045",$1="#d60027",V1="#eefaff",Y1="#ecfffb",q1="#fffce0",j1="#fff1ef",G1="#ffe5e5",K1="#5f9aff",X1="#00d6a4",Z1="#ffc400",Q1="#ff723c",J1="#ff3954",tS={100:Nv,101:Bv,102:Fv,103:zv,200:Uv,201:Hv,202:Wv,203:$v,204:Vv,205:Yv,206:qv,207:jv,208:Gv,226:Kv,300:Xv,301:Zv,302:Qv,303:Jv,304:t1,305:e1,307:n1,308:i1,400:r1,401:s1,402:o1,403:a1,404:l1,405:c1,406:u1,407:d1,408:f1,409:h1,410:p1,411:m1,412:g1,413:y1,414:_1,415:b1,416:x1,417:w1,418:v1,421:S1,422:T1,423:k1,424:M1,425:D1,426:C1,428:O1,429:A1,431:E1,451:R1,500:P1,501:I1,502:L1,503:N1,504:B1,505:F1,506:z1,507:U1,508:H1,510:W1,511:$1},eS={100:V1,200:Y1,300:q1,400:j1,500:G1},tp={"1XX":K1,"2XX":X1,"3XX":Z1,"4XX":Q1,"5XX":J1},nS={error:Iv,warning:Lv,empty:Pv,neutral:Jh,____OTHER____:Rv},ep=["#1693AE","#2EA697","#5CB56C","#AD47F1","#7287F1","#4DA8DF","#DA5024","#EC4D87","#D771D5","#6C931E","#AC8E26","#DB8743"],np=["#006B74","#187C62","#538732","#7201DE","#1E63D3","#1E83A3","#B2001F","#BA107B","#A739D0","#5E6400","#8B620C","#BB5420"],iS=e=>Ev(e),ip=({discriminator:e,theme:t="light",customPalette:n=void 0})=>{const i=Math.abs(Math.floor(e));return n?n[i%n.length]:t==="dark"?np[i%np.length]:ep[i%ep.length]},Ns=({state:e})=>nS[e]??Jh,rS=({statusCode:e})=>{const t=typeof e=="number"?e:Number.parseInt(e,10),n=`${t}`,i=`${Math.floor(t/100)*100}`;return tS[n]??eS[i]??Ns({state:"neutral"})},sS=({group:e})=>tp[e]?tp[e]:Ns({state:"neutral"}),Bs=({discriminator:e=void 0,state:t=void 0,dimension:n=void 0,dimensionValue:i=void 0,metric:r=void 0,theme:s="light",customPalette:a=void 0})=>{if(e!==void 0)return ip({discriminator:e,theme:s,customPalette:a});if(t!==void 0)return Ns({state:t});if(i&&["empty","____OTHER____"].includes(i))return Ns({state:i});if(n!==void 0&&i!==void 0){if(n==="status_code")return rS({statusCode:i});if(n==="status_code_grouped")return sS({group:i})}return n||i||r?ip({discriminator:iS(`${n??""}${i??""}${r??""}`),theme:s,customPalette:a}):Ns({state:"neutral"})},rp="#d60027",sp="#ffe5e5",oS="#f1f0ff",aS="#e0e4ea",op="#6c7489",lS="#afb7c5",ap="#0d0e14",cS="#d60027",uS="#ad000e",Bc="#6c7489",lp="#52596e",dS="#007d60",fS="#995c00",hS="#ffc400",pS="'Inter', Roboto, Helvetica, sans-serif",rr="16px",mS="20px",gS="#bee2ff",yS="#8fc1ff",_S="#5f9aff",bS="#306fff",xS="#b5ffee",wS="#00fabe",vS="#00d6a4",SS="#00a17b",TS="#007d60",kS="#005944",MS="#b5ffee",DS="#00fabe",CS="#b5ffee",OS="#00a17b",AS="#fff296",ES="#ffe04b",RS="#ffc400",PS="#b37600",IS="#995c00",LS="#804400",NS="#fff296",BS="#ffe04b",FS="#ffc2b3",zS="#ff9877",US="#ff723c",HS="#f75008",WS="#d13500",$S="#a31f00",VS="#ffc2b3",YS="#ff9877",qS="#ff723c",jS="#f75008",GS="#d13500",KS="#a31f00",XS="#ffc2b3",ZS="#ff9877",QS="#ff723c",JS="#f75008",tT="#d13500",eT="#a31f00",nT="#ffc2b3",iT="#ff9877",rT="#ff723c",sT="#f75008",oT="#d13500",aT="#a31f00",lT="#ffc2b3",cT="#ff9877",uT="#ff723c",dT="#f75008",fT="#d13500",hT="#ffabab",pT="#ff7272",mT="#ff3954",gT="#f50045",yT="#d60027",_T="#ad000e",bT="#ffabab",xT="#ff7272",wT="#ff3954",vT="#f50045",ST="#d60027",TT="#eefaff",kT="#ecfffb",MT="#fffce0",DT="#fff1ef",CT="#ffe5e5",OT="#5f9aff",AT="#00d6a4",ET="#ffc400",RT="#ff723c",PT="#ff3954",cp=6048e5,IT=864e5,Fs=6e4,Hr=36e5,LT=1e3,up=Symbol.for("constructDateFrom");function me(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&up in e?e[up](t):e instanceof Date?new e.constructor(t):new Date(t)}function At(e,t){return me(t||e,e)}function ma(e,t,n){const i=At(e,n?.in);return isNaN(t)?me(n?.in||e,NaN):(t&&i.setDate(i.getDate()+t),i)}function Fc(e,t,n){const i=At(e,n?.in);if(isNaN(t))return me(e,NaN);if(!t)return i;const r=i.getDate(),s=me(e,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 zc(e,t,n){return me(e,+At(e)+t)}function NT(e,t,n){return zc(e,t*Hr)}let BT={};function sr(){return BT}function Vn(e,t){const n=sr(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=At(e,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 Wr(e,t){return Vn(e,{...t,weekStartsOn:1})}function dp(e,t){const n=At(e,t?.in),i=n.getFullYear(),r=me(n,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=Wr(r),a=me(n,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=Wr(a);return n.getTime()>=s.getTime()?i+1:n.getTime()>=l.getTime()?i:i-1}function ga(e){const t=At(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function or(e,...t){const n=me.bind(null,t.find(i=>typeof i=="object"));return t.map(n)}function Uc(e,t){const n=At(e,t?.in);return n.setHours(0,0,0,0),n}function fp(e,t,n){const[i,r]=or(n?.in,e,t),s=Uc(i),a=Uc(r),l=+s-ga(s),u=+a-ga(a);return Math.round((l-u)/IT)}function FT(e,t){const n=dp(e,t),i=me(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),Wr(i)}function zT(e,t,n){const i=At(e,n?.in);return i.setTime(i.getTime()+t*Fs),i}function UT(e,t,n){return Fc(e,t*3,n)}function HT(e,t,n){return zc(e,t*1e3)}function WT(e,t,n){return ma(e,t*7,n)}function $T(e,t,n){return Fc(e,t*12,n)}function zs(e,t){const n=+At(e)-+At(t);return n<0?-1:n>0?1:n}function VT(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Hc(e){return!(!VT(e)&&typeof e!="number"||isNaN(+At(e)))}function YT(e,t,n){const[i,r]=or(n?.in,e,t),s=i.getFullYear()-r.getFullYear(),a=i.getMonth()-r.getMonth();return s*12+a}function qT(e,t,n){const[i,r]=or(n?.in,e,t);return i.getFullYear()-r.getFullYear()}function hp(e,t,n){const[i,r]=or(n?.in,e,t),s=pp(i,r),a=Math.abs(fp(i,r));i.setDate(i.getDate()-s*a);const l=+(pp(i,r)===-s),u=s*(a-l);return u===0?0:u}function pp(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function Us(e){return t=>{const i=(e?Math[e]:Math.trunc)(t);return i===0?0:i}}function jT(e,t,n){const[i,r]=or(n?.in,e,t),s=(+i-+r)/Hr;return Us(n?.roundingMethod)(s)}function Wc(e,t){return+At(e)-+At(t)}function GT(e,t,n){const i=Wc(e,t)/Fs;return Us(n?.roundingMethod)(i)}function mp(e,t){const n=At(e,t?.in);return n.setHours(23,59,59,999),n}function gp(e,t){const n=At(e,t?.in),i=n.getMonth();return n.setFullYear(n.getFullYear(),i+1,0),n.setHours(23,59,59,999),n}function KT(e,t){const n=At(e,t?.in);return+mp(n,t)==+gp(n,t)}function yp(e,t,n){const[i,r,s]=or(n?.in,e,e,t),a=zs(r,s),l=Math.abs(YT(r,s));if(l<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-a*l);let u=zs(r,s)===-a;KT(i)&&l===1&&zs(i,s)===1&&(u=!1);const d=a*(l-+u);return d===0?0:d}function XT(e,t,n){const i=yp(e,t,n)/3;return Us(n?.roundingMethod)(i)}function ZT(e,t,n){const i=Wc(e,t)/1e3;return Us(n?.roundingMethod)(i)}function QT(e,t,n){const i=hp(e,t,n)/7;return Us(n?.roundingMethod)(i)}function JT(e,t,n){const[i,r]=or(n?.in,e,t),s=zs(i,r),a=Math.abs(qT(i,r));i.setFullYear(1584),r.setFullYear(1584);const l=zs(i,r)===-s,u=s*(a-+l);return u===0?0:u}function tk(e,t){const n=At(e,t?.in),i=n.getMonth(),r=i-i%3;return n.setMonth(r,1),n.setHours(0,0,0,0),n}function ek(e,t){const n=At(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function nk(e,t){const n=At(e,t?.in),i=n.getFullYear();return n.setFullYear(i+1,0,0),n.setHours(23,59,59,999),n}function _p(e,t){const n=At(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function ik(e,t){const n=At(e,t?.in);return n.setMinutes(59,59,999),n}function rk(e,t){const n=sr(),i=n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=At(e,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 sk(e,t){const n=At(e,t?.in);return n.setSeconds(59,999),n}function ok(e,t){const n=At(e,t?.in),i=n.getMonth(),r=i-i%3+3;return n.setMonth(r,0),n.setHours(23,59,59,999),n}function ak(e,t){const n=At(e,t?.in);return n.setMilliseconds(999),n}const lk={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"}},ck=(e,t,n)=>{let i;const r=lk[e];return typeof r=="string"?i=r:t===1?i=r.one:i=r.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function $c(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const uk={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},dk={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},fk={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},hk={date:$c({formats:uk,defaultWidth:"full"}),time:$c({formats:dk,defaultWidth:"full"}),dateTime:$c({formats:fk,defaultWidth:"full"})},pk={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},mk=(e,t,n,i)=>pk[e];function Hs(e){return(t,n)=>{const i=n?.context?String(n.context):"standalone";let r;if(i==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,l=n?.width?String(n.width):a;r=e.formattingValues[l]||e.formattingValues[a]}else{const a=e.defaultWidth,l=n?.width?String(n.width):e.defaultWidth;r=e.values[l]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return r[s]}}const gk={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},yk={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},_k={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"]},bk={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"]},xk={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"}},wk={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"}},vk={ordinalNumber:(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Hs({values:gk,defaultWidth:"wide"}),quarter:Hs({values:yk,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Hs({values:_k,defaultWidth:"wide"}),day:Hs({values:bk,defaultWidth:"wide"}),dayPeriod:Hs({values:xk,defaultWidth:"wide",formattingValues:wk,defaultFormattingWidth:"wide"})};function Ws(e){return(t,n={})=>{const i=n.width,r=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],s=t.match(r);if(!s)return null;const a=s[0],l=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(l)?Tk(l,m=>m.test(a)):Sk(l,m=>m.test(a));let d;d=e.valueCallback?e.valueCallback(u):u,d=n.valueCallback?n.valueCallback(d):d;const h=t.slice(a.length);return{value:d,rest:h}}}function Sk(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Tk(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function kk(e){return(t,n={})=>{const i=t.match(e.matchPattern);if(!i)return null;const r=i[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const l=t.slice(r.length);return{value:a,rest:l}}}const Mk=/^(\d+)(th|st|nd|rd)?/i,Dk=/\d+/i,Ck={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},Ok={any:[/^b/i,/^(a|c)/i]},Ak={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ek={any:[/1/i,/2/i,/3/i,/4/i]},Rk={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},Pk={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]},Ik={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},Lk={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]},Nk={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},Bk={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}},Fk={ordinalNumber:kk({matchPattern:Mk,parsePattern:Dk,valueCallback:e=>parseInt(e,10)}),era:Ws({matchPatterns:Ck,defaultMatchWidth:"wide",parsePatterns:Ok,defaultParseWidth:"any"}),quarter:Ws({matchPatterns:Ak,defaultMatchWidth:"wide",parsePatterns:Ek,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ws({matchPatterns:Rk,defaultMatchWidth:"wide",parsePatterns:Pk,defaultParseWidth:"any"}),day:Ws({matchPatterns:Ik,defaultMatchWidth:"wide",parsePatterns:Lk,defaultParseWidth:"any"}),dayPeriod:Ws({matchPatterns:Nk,defaultMatchWidth:"any",parsePatterns:Bk,defaultParseWidth:"any"})},bp={code:"en-US",formatDistance:ck,formatLong:hk,formatRelative:mk,localize:vk,match:Fk,options:{weekStartsOn:0,firstWeekContainsDate:1}};function zk(e,t){const n=At(e,t?.in);return fp(n,_p(n))+1}function xp(e,t){const n=At(e,t?.in),i=+Wr(n)-+FT(n);return Math.round(i/cp)+1}function Vc(e,t){const n=At(e,t?.in),i=n.getFullYear(),r=sr(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=me(t?.in||e,0);a.setFullYear(i+1,0,s),a.setHours(0,0,0,0);const l=Vn(a,t),u=me(t?.in||e,0);u.setFullYear(i,0,s),u.setHours(0,0,0,0);const d=Vn(u,t);return+n>=+l?i+1:+n>=+d?i:i-1}function Uk(e,t){const n=sr(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=Vc(e,t),s=me(t?.in||e,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),Vn(s,t)}function wp(e,t){const n=At(e,t?.in),i=+Vn(n,t)-+Uk(n,t);return Math.round(i/cp)+1}function Qt(e,t){const n=e<0?"-":"",i=Math.abs(e).toString().padStart(t,"0");return n+i}const ki={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return Qt(t==="yy"?i%100:i,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Qt(n+1,2)},d(e,t){return Qt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Qt(e.getHours()%12||12,t.length)},H(e,t){return Qt(e.getHours(),t.length)},m(e,t){return Qt(e.getMinutes(),t.length)},s(e,t){return Qt(e.getSeconds(),t.length)},S(e,t){const n=t.length,i=e.getMilliseconds(),r=Math.trunc(i*Math.pow(10,n-3));return Qt(r,t.length)}},$r={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},vp={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const i=e.getFullYear(),r=i>0?i:1-i;return n.ordinalNumber(r,{unit:"year"})}return ki.y(e,t)},Y:function(e,t,n,i){const r=Vc(e,i),s=r>0?r:1-r;if(t==="YY"){const a=s%100;return Qt(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Qt(s,t.length)},R:function(e,t){const n=dp(e);return Qt(n,t.length)},u:function(e,t){const n=e.getFullYear();return Qt(n,t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Qt(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Qt(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return ki.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return Qt(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const r=wp(e,i);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):Qt(r,t.length)},I:function(e,t,n){const i=xp(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):Qt(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):ki.d(e,t)},D:function(e,t,n){const i=zk(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):Qt(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const r=e.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Qt(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const r=e.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Qt(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),r=i===0?7:i;switch(t){case"i":return String(r);case"ii":return Qt(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let r;switch(i===12?r=$r.noon:i===0?r=$r.midnight:r=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let r;switch(i>=17?r=$r.evening:i>=12?r=$r.afternoon:i>=4?r=$r.morning:r=$r.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let i=e.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return ki.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):ki.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):Qt(i,t.length)},k:function(e,t,n){let i=e.getHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):Qt(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):ki.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):ki.s(e,t)},S:function(e,t){return ki.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Tp(i);case"XXXX":case"XX":return ar(i);default:return ar(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return Tp(i);case"xxxx":case"xx":return ar(i);default:return ar(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Sp(i,":");default:return"GMT"+ar(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Sp(i,":");default:return"GMT"+ar(i,":")}},t:function(e,t,n){const i=Math.trunc(+e/1e3);return Qt(i,t.length)},T:function(e,t,n){return Qt(+e,t.length)}};function Sp(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Math.trunc(i/60),s=i%60;return s===0?n+String(r):n+String(r)+t+Qt(s,2)}function Tp(e,t){return e%60===0?(e>0?"-":"+")+Qt(Math.abs(e)/60,2):ar(e,t)}function ar(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Qt(Math.trunc(i/60),2),s=Qt(i%60,2);return n+r+t+s}const kp=(e,t)=>{switch(e){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"})}},Mp=(e,t)=>{switch(e){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"})}},Yc={p:Mp,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return kp(e,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}}",kp(i,t)).replace("{{time}}",Mp(r,t))}},Hk=/^D+$/,Wk=/^Y+$/,$k=["D","DD","YY","YYYY"];function Dp(e){return Hk.test(e)}function Cp(e){return Wk.test(e)}function qc(e,t,n){const i=Vk(e,t,n);if(console.warn(i),$k.includes(e))throw new RangeError(i)}function Vk(e,t,n){const i=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Yk=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,qk=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,jk=/^'([^]*?)'?$/,Gk=/''/g,Kk=/[a-zA-Z]/;function ya(e,t,n){const i=sr(),r=n?.locale??i.locale??bp,s=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,l=At(e,n?.in);if(!Hc(l))throw new RangeError("Invalid time value");let u=t.match(qk).map(h=>{const m=h[0];if(m==="p"||m==="P"){const g=Yc[m];return g(h,r.formatLong)}return h}).join("").match(Yk).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const m=h[0];if(m==="'")return{isToken:!1,value:Xk(h)};if(vp[m])return{isToken:!0,value:h};if(m.match(Kk))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");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 m=h.value;(!n?.useAdditionalWeekYearTokens&&Cp(m)||!n?.useAdditionalDayOfYearTokens&&Dp(m))&&qc(m,t,String(e));const g=vp[m[0]];return g(l,m,r.localize,d)}).join("")}function Xk(e){const t=e.match(jk);return t?t[1].replace(Gk,"'"):e}function Op(){return Object.assign({},sr())}function Zk(e,t){const n=At(e,t?.in).getDay();return n===0?7:n}function Qk(e,t){const n=Jk(t)?new t(0):me(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function Jk(e){return typeof e=="function"&&e.prototype?.constructor===e}const tM=10;class Ap{subPriority=0;validate(t,n){return!0}}class eM extends Ap{constructor(t,n,i,r,s){super(),this.value=t,this.validateValue=n,this.setValue=i,this.priority=r,s&&(this.subPriority=s)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,i){return this.setValue(t,n,this.value,i)}}class nM extends Ap{priority=tM;subPriority=-1;constructor(t,n){super(),this.context=t||(i=>me(n,i))}set(t,n){return n.timestampIsSet?t:me(t,Qk(t,this.context))}}class Yt{run(t,n,i,r){const s=this.parse(t,n,i,r);return s?{setter:new eM(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(t,n,i){return!0}}class iM extends Yt{priority=140;parse(t,n,i){switch(n){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,n,i){return n.era=i,t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]}const _e={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}/},Yn={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 be(e,t){return e&&{value:t(e.value),rest:e.rest}}function he(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function qn(e,t){const n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};const i=n[1]==="+"?1:-1,r=n[2]?parseInt(n[2],10):0,s=n[3]?parseInt(n[3],10):0,a=n[5]?parseInt(n[5],10):0;return{value:i*(r*Hr+s*Fs+a*LT),rest:t.slice(n[0].length)}}function Ep(e){return he(_e.anyDigitsSigned,e)}function ge(e,t){switch(e){case 1:return he(_e.singleDigit,t);case 2:return he(_e.twoDigits,t);case 3:return he(_e.threeDigits,t);case 4:return he(_e.fourDigits,t);default:return he(new RegExp("^\\d{1,"+e+"}"),t)}}function _a(e,t){switch(e){case 1:return he(_e.singleDigitSigned,t);case 2:return he(_e.twoDigitsSigned,t);case 3:return he(_e.threeDigitsSigned,t);case 4:return he(_e.fourDigitsSigned,t);default:return he(new RegExp("^-?\\d{1,"+e+"}"),t)}}function jc(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function Rp(e,t){const n=t>0,i=n?t:1-t;let r;if(i<=50)r=e||100;else{const s=i+50,a=Math.trunc(s/100)*100,l=e>=s%100;r=e+a-(l?100:0)}return n?r:1-r}function Pp(e){return e%400===0||e%4===0&&e%100!==0}class rM extends Yt{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,n,i){const r=s=>({year:s,isTwoDigitYear:n==="yy"});switch(n){case"y":return be(ge(4,t),r);case"yo":return be(i.ordinalNumber(t,{unit:"year"}),r);default:return be(ge(n.length,t),r)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,i){const r=t.getFullYear();if(i.isTwoDigitYear){const a=Rp(i.year,r);return t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}const s=!("era"in n)||n.era===1?i.year:1-i.year;return t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}}class sM extends Yt{priority=130;parse(t,n,i){const r=s=>({year:s,isTwoDigitYear:n==="YY"});switch(n){case"Y":return be(ge(4,t),r);case"Yo":return be(i.ordinalNumber(t,{unit:"year"}),r);default:return be(ge(n.length,t),r)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,i,r){const s=Vc(t,r);if(i.isTwoDigitYear){const l=Rp(i.year,s);return t.setFullYear(l,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),Vn(t,r)}const a=!("era"in n)||n.era===1?i.year:1-i.year;return t.setFullYear(a,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),Vn(t,r)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class oM extends Yt{priority=130;parse(t,n){return _a(n==="R"?4:n.length,t)}set(t,n,i){const r=me(t,0);return r.setFullYear(i,0,4),r.setHours(0,0,0,0),Wr(r)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class aM extends Yt{priority=130;parse(t,n){return _a(n==="u"?4:n.length,t)}set(t,n,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 lM extends Yt{priority=120;parse(t,n,i){switch(n){case"Q":case"QQ":return ge(n.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,n){return n>=1&&n<=4}set(t,n,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 cM extends Yt{priority=120;parse(t,n,i){switch(n){case"q":case"qq":return ge(n.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,n){return n>=1&&n<=4}set(t,n,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 uM extends Yt{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,n,i){const r=s=>s-1;switch(n){case"M":return be(he(_e.month,t),r);case"MM":return be(ge(2,t),r);case"Mo":return be(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,n){return n>=0&&n<=11}set(t,n,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}}class dM extends Yt{priority=110;parse(t,n,i){const r=s=>s-1;switch(n){case"L":return be(he(_e.month,t),r);case"LL":return be(ge(2,t),r);case"Lo":return be(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,n){return n>=0&&n<=11}set(t,n,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 fM(e,t,n){const i=At(e,n?.in),r=wp(i,n)-t;return i.setDate(i.getDate()-r*7),At(i,n?.in)}class hM extends Yt{priority=100;parse(t,n,i){switch(n){case"w":return he(_e.week,t);case"wo":return i.ordinalNumber(t,{unit:"week"});default:return ge(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,i,r){return Vn(fM(t,i,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function pM(e,t,n){const i=At(e,n?.in),r=xp(i,n)-t;return i.setDate(i.getDate()-r*7),i}class mM extends Yt{priority=100;parse(t,n,i){switch(n){case"I":return he(_e.week,t);case"Io":return i.ordinalNumber(t,{unit:"week"});default:return ge(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,i){return Wr(pM(t,i))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const gM=[31,28,31,30,31,30,31,31,30,31,30,31],yM=[31,29,31,30,31,30,31,31,30,31,30,31];class _M extends Yt{priority=90;subPriority=1;parse(t,n,i){switch(n){case"d":return he(_e.date,t);case"do":return i.ordinalNumber(t,{unit:"date"});default:return ge(n.length,t)}}validate(t,n){const i=t.getFullYear(),r=Pp(i),s=t.getMonth();return r?n>=1&&n<=yM[s]:n>=1&&n<=gM[s]}set(t,n,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 bM extends Yt{priority=90;subpriority=1;parse(t,n,i){switch(n){case"D":case"DD":return he(_e.dayOfYear,t);case"Do":return i.ordinalNumber(t,{unit:"date"});default:return ge(n.length,t)}}validate(t,n){const i=t.getFullYear();return Pp(i)?n>=1&&n<=366:n>=1&&n<=365}set(t,n,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 Gc(e,t,n){const i=sr(),r=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,s=At(e,n?.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 ma(s,h,n)}class xM extends Yt{priority=90;parse(t,n,i){switch(n){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,n){return n>=0&&n<=6}set(t,n,i,r){return t=Gc(t,i,r),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class wM extends Yt{priority=90;parse(t,n,i,r){const s=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(n){case"e":case"ee":return be(ge(n.length,t),s);case"eo":return be(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,n){return n>=0&&n<=6}set(t,n,i,r){return t=Gc(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 vM extends Yt{priority=90;parse(t,n,i,r){const s=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(n){case"c":case"cc":return be(ge(n.length,t),s);case"co":return be(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,n){return n>=0&&n<=6}set(t,n,i,r){return t=Gc(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 SM(e,t,n){const i=At(e,n?.in),r=Zk(i,n),s=t-r;return ma(i,s,n)}class TM extends Yt{priority=90;parse(t,n,i){const r=s=>s===0?7:s;switch(n){case"i":case"ii":return ge(n.length,t);case"io":return i.ordinalNumber(t,{unit:"day"});case"iii":return be(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 be(i.day(t,{width:"narrow",context:"formatting"}),r);case"iiiiii":return be(i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),r);default:return be(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,n){return n>=1&&n<=7}set(t,n,i){return t=SM(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 kM extends Yt{priority=80;parse(t,n,i){switch(n){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,n,i){return t.setHours(jc(i),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class MM extends Yt{priority=80;parse(t,n,i){switch(n){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,n,i){return t.setHours(jc(i),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class DM extends Yt{priority=80;parse(t,n,i){switch(n){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,n,i){return t.setHours(jc(i),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class CM extends Yt{priority=70;parse(t,n,i){switch(n){case"h":return he(_e.hour12h,t);case"ho":return i.ordinalNumber(t,{unit:"hour"});default:return ge(n.length,t)}}validate(t,n){return n>=1&&n<=12}set(t,n,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 OM extends Yt{priority=70;parse(t,n,i){switch(n){case"H":return he(_e.hour23h,t);case"Ho":return i.ordinalNumber(t,{unit:"hour"});default:return ge(n.length,t)}}validate(t,n){return n>=0&&n<=23}set(t,n,i){return t.setHours(i,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]}class AM extends Yt{priority=70;parse(t,n,i){switch(n){case"K":return he(_e.hour11h,t);case"Ko":return i.ordinalNumber(t,{unit:"hour"});default:return ge(n.length,t)}}validate(t,n){return n>=0&&n<=11}set(t,n,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 EM extends Yt{priority=70;parse(t,n,i){switch(n){case"k":return he(_e.hour24h,t);case"ko":return i.ordinalNumber(t,{unit:"hour"});default:return ge(n.length,t)}}validate(t,n){return n>=1&&n<=24}set(t,n,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 RM extends Yt{priority=60;parse(t,n,i){switch(n){case"m":return he(_e.minute,t);case"mo":return i.ordinalNumber(t,{unit:"minute"});default:return ge(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,i){return t.setMinutes(i,0,0),t}incompatibleTokens=["t","T"]}class PM extends Yt{priority=50;parse(t,n,i){switch(n){case"s":return he(_e.second,t);case"so":return i.ordinalNumber(t,{unit:"second"});default:return ge(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,i){return t.setSeconds(i,0),t}incompatibleTokens=["t","T"]}class IM extends Yt{priority=30;parse(t,n){const i=r=>Math.trunc(r*Math.pow(10,-n.length+3));return be(ge(n.length,t),i)}set(t,n,i){return t.setMilliseconds(i),t}incompatibleTokens=["t","T"]}class LM extends Yt{priority=10;parse(t,n){switch(n){case"X":return qn(Yn.basicOptionalMinutes,t);case"XX":return qn(Yn.basic,t);case"XXXX":return qn(Yn.basicOptionalSeconds,t);case"XXXXX":return qn(Yn.extendedOptionalSeconds,t);default:return qn(Yn.extended,t)}}set(t,n,i){return n.timestampIsSet?t:me(t,t.getTime()-ga(t)-i)}incompatibleTokens=["t","T","x"]}class NM extends Yt{priority=10;parse(t,n){switch(n){case"x":return qn(Yn.basicOptionalMinutes,t);case"xx":return qn(Yn.basic,t);case"xxxx":return qn(Yn.basicOptionalSeconds,t);case"xxxxx":return qn(Yn.extendedOptionalSeconds,t);default:return qn(Yn.extended,t)}}set(t,n,i){return n.timestampIsSet?t:me(t,t.getTime()-ga(t)-i)}incompatibleTokens=["t","T","X"]}class BM extends Yt{priority=40;parse(t){return Ep(t)}set(t,n,i){return[me(t,i*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class FM extends Yt{priority=20;parse(t){return Ep(t)}set(t,n,i){return[me(t,i),{timestampIsSet:!0}]}incompatibleTokens="*"}const zM={G:new iM,y:new rM,Y:new sM,R:new oM,u:new aM,Q:new lM,q:new cM,M:new uM,L:new dM,w:new hM,I:new mM,d:new _M,D:new bM,E:new xM,e:new wM,c:new vM,i:new TM,a:new kM,b:new MM,B:new DM,h:new CM,H:new OM,K:new AM,k:new EM,m:new RM,s:new PM,S:new IM,X:new LM,x:new NM,t:new BM,T:new FM},UM=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,HM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,WM=/^'([^]*?)'?$/,$M=/''/g,VM=/\S/,YM=/[a-zA-Z]/;function qM(e,t,n,i){const r=()=>me(i?.in||n,NaN),s=Op(),a=i?.locale??s.locale??bp,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 e?r():At(n,i?.in);const d={firstWeekContainsDate:l,weekStartsOn:u,locale:a},h=[new nM(i?.in,n)],m=t.match(HM).map(S=>{const C=S[0];if(C in Yc){const A=Yc[C];return A(S,a.formatLong)}return S}).join("").match(UM),g=[];for(let S of m){!i?.useAdditionalWeekYearTokens&&Cp(S)&&qc(S,t,e),!i?.useAdditionalDayOfYearTokens&&Dp(S)&&qc(S,t,e);const C=S[0],A=zM[C];if(A){const{incompatibleTokens:F}=A;if(Array.isArray(F)){const B=g.find(N=>F.includes(N.token)||N.token===C);if(B)throw new RangeError(`The format string mustn't contain \`${B.fullToken}\` and \`${S}\` at the same time`)}else if(A.incompatibleTokens==="*"&&g.length>0)throw new RangeError(`The format string mustn't contain \`${S}\` and any other token at the same time`);g.push({token:C,fullToken:S});const P=A.run(e,S,a.match,d);if(!P)return r();h.push(P.setter),e=P.rest}else{if(C.match(YM))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");if(S==="''"?S="'":C==="'"&&(S=jM(S)),e.indexOf(S)===0)e=e.slice(S.length);else return r()}}if(e.length>0&&VM.test(e))return r();const _=h.map(S=>S.priority).sort((S,C)=>C-S).filter((S,C,A)=>A.indexOf(S)===C).map(S=>h.filter(C=>C.priority===S).sort((C,A)=>A.subPriority-C.subPriority)).map(S=>S[0]);let x=At(n,i?.in);if(isNaN(+x))return r();const v={};for(const S of _){if(!S.validate(x,d))return r();const C=S.set(x,v,d);Array.isArray(C)?(x=C[0],Object.assign(v,C[1])):x=C}return x}function jM(e){return e.match(WM)[1].replace($M,"'")}function GM(e,t){const n=At(e,t?.in);return n.setMinutes(0,0,0),n}function KM(e,t){const n=At(e,t?.in);return n.setSeconds(0,0),n}function XM(e,t){const n=At(e,t?.in);return n.setMilliseconds(0),n}function Ip(e){const t=e/Hr;return Math.trunc(t)}function Lp(e,t){const n=()=>me(t?.in,NaN),i=t?.additionalDigits??2,r=tD(e);let s;if(r.date){const d=eD(r.date,i);s=nD(d.restDateString,d.year)}if(!s||isNaN(+s))return n();const a=+s;let l=0,u;if(r.time&&(l=iD(r.time),isNaN(l)))return n();if(r.timezone){if(u=rD(r.timezone),isNaN(u))return n()}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 ba={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ZM=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,QM=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,JM=/^([+-])(\d{2})(?::?(\d{2}))?$/;function tD(e){const t={},n=e.split(ba.dateTimeDelimiter);let i;if(n.length>2)return t;if(/:/.test(n[0])?i=n[0]:(t.date=n[0],i=n[1],ba.timeZoneDelimiter.test(t.date)&&(t.date=e.split(ba.timeZoneDelimiter)[0],i=e.substr(t.date.length,e.length))),i){const r=ba.timezone.exec(i);r?(t.time=i.replace(r[1],""),t.timezone=r[1]):t.time=i}return t}function eD(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=e.match(n);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:e.slice((i[1]||i[2]).length)}}function nD(e,t){if(t===null)return new Date(NaN);const n=e.match(ZM);if(!n)return new Date(NaN);const i=!!n[4],r=$s(n[1]),s=$s(n[2])-1,a=$s(n[3]),l=$s(n[4]),u=$s(n[5])-1;if(i)return cD(t,l,u)?sD(t,l,u):new Date(NaN);{const d=new Date(0);return!aD(t,s,a)||!lD(t,r)?new Date(NaN):(d.setUTCFullYear(t,s,Math.max(r,a)),d)}}function $s(e){return e?parseInt(e):1}function iD(e){const t=e.match(QM);if(!t)return NaN;const n=Kc(t[1]),i=Kc(t[2]),r=Kc(t[3]);return uD(n,i,r)?n*Hr+i*Fs+r*1e3:NaN}function Kc(e){return e&&parseFloat(e.replace(",","."))||0}function rD(e){if(e==="Z")return 0;const t=e.match(JM);if(!t)return 0;const n=t[1]==="+"?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return dD(i,r)?n*(i*Hr+r*Fs):NaN}function sD(e,t,n){const i=new Date(0);i.setUTCFullYear(e,0,4);const r=i.getUTCDay()||7,s=(t-1)*7+n+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const oD=[31,null,31,30,31,30,31,31,30,31,30,31];function Np(e){return e%400===0||e%4===0&&e%100!==0}function aD(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(oD[t]||(Np(e)?29:28))}function lD(e,t){return t>=1&&t<=(Np(e)?366:365)}function cD(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function uD(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function dD(e,t){return t>=0&&t<=59}const Bp={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})"},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_consumer_group:"AI gateway consumer group",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",share_of_requests:"Share of requests",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",consumer_group:"Consumer group",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",cost_per_request_average:"Cost per request (avg)",share_of_cost:"Share of cost",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",active_agents:"Active agents",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",share_of_requests:"Share of requests",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",cost_per_request_average:"Cost per request (avg)",share_of_cost:"Share of cost",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",active_agents:"Active agents",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)"}},topTalkers:{total:"{value} total",defaultEmptyStateTitle:"No data to display",defaultErrorStateTitle:"Something went wrong"},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 Fp(){const e=hh.createI18n("en-us",Bp);return{i18n:e,i18nT:hh.i18nTComponent(e)}}function Vs(e){return e+.5|0}const Mi=(e,t,n)=>Math.max(Math.min(e,n),t);function Ys(e){return Mi(Vs(e*2.55),0,255)}function Di(e){return Mi(Vs(e*255),0,255)}function ii(e){return Mi(Vs(e/2.55)/100,0,1)}function zp(e){return Mi(Vs(e*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},Xc=[..."0123456789ABCDEF"],fD=e=>Xc[e&15],hD=e=>Xc[(e&240)>>4]+Xc[e&15],xa=e=>(e&240)>>4===(e&15),pD=e=>xa(e.r)&&xa(e.g)&&xa(e.b)&&xa(e.a);function mD(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Mn[e[1]]*17,g:255&Mn[e[2]]*17,b:255&Mn[e[3]]*17,a:t===5?Mn[e[4]]*17:255}:(t===7||t===9)&&(n={r:Mn[e[1]]<<4|Mn[e[2]],g:Mn[e[3]]<<4|Mn[e[4]],b:Mn[e[5]]<<4|Mn[e[6]],a:t===9?Mn[e[7]]<<4|Mn[e[8]]:255})),n}const gD=(e,t)=>e<255?t(e):"";function yD(e){var t=pD(e)?fD:hD;return e?"#"+t(e.r)+t(e.g)+t(e.b)+gD(e.a,t):void 0}const _D=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Up(e,t,n){const i=t*Math.min(n,1-n),r=(s,a=(s+e/30)%12)=>n-i*Math.max(Math.min(a-3,9-a,1),-1);return[r(0),r(8),r(4)]}function bD(e,t,n){const i=(r,s=(r+e/60)%6)=>n-n*t*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function xD(e,t,n){const i=Up(e,1,.5);let r;for(t+n>1&&(r=1/(t+n),t*=r,n*=r),r=0;r<3;r++)i[r]*=1-t-n,i[r]+=t;return i}function wD(e,t,n,i,r){return e===r?(t-n)/i+(t<n?6:0):t===r?(n-e)/i+2:(e-t)/i+4}function Zc(e){const n=e.r/255,i=e.g/255,r=e.b/255,s=Math.max(n,i,r),a=Math.min(n,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=wD(n,i,r,h,s),u=u*60+.5),[u|0,d||0,l]}function Qc(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(Di)}function Jc(e,t,n){return Qc(Up,e,t,n)}function vD(e,t,n){return Qc(xD,e,t,n)}function SD(e,t,n){return Qc(bD,e,t,n)}function Hp(e){return(e%360+360)%360}function TD(e){const t=_D.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?Ys(+t[5]):Di(+t[5]));const r=Hp(+t[2]),s=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=vD(r,s,a):t[1]==="hsv"?i=SD(r,s,a):i=Jc(r,s,a),{r:i[0],g:i[1],b:i[2],a:n}}function kD(e,t){var n=Zc(e);n[0]=Hp(n[0]+t),n=Jc(n),e.r=n[0],e.g=n[1],e.b=n[2]}function MD(e){if(!e)return;const t=Zc(e),n=t[0],i=zp(t[1]),r=zp(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${r}%, ${ii(e.a)})`:`hsl(${n}, ${i}%, ${r}%)`}const Wp={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"},$p={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 DD(){const e={},t=Object.keys($p),n=Object.keys(Wp);let i,r,s,a,l;for(i=0;i<t.length;i++){for(a=l=t[i],r=0;r<n.length;r++)s=n[r],l=l.replace(s,Wp[s]);s=parseInt($p[a],16),e[l]=[s>>16&255,s>>8&255,s&255]}return e}let wa;function CD(e){wa||(wa=DD(),wa.transparent=[0,0,0,0]);const t=wa[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const OD=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function AD(e){const t=OD.exec(e);let n=255,i,r,s;if(t){if(t[7]!==i){const a=+t[7];n=t[8]?Ys(a):Mi(a*255,0,255)}return i=+t[1],r=+t[3],s=+t[5],i=255&(t[2]?Ys(i):Mi(i,0,255)),r=255&(t[4]?Ys(r):Mi(r,0,255)),s=255&(t[6]?Ys(s):Mi(s,0,255)),{r:i,g:r,b:s,a:n}}}function ED(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${ii(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const tu=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Vr=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function RD(e,t,n){const i=Vr(ii(e.r)),r=Vr(ii(e.g)),s=Vr(ii(e.b));return{r:Di(tu(i+n*(Vr(ii(t.r))-i))),g:Di(tu(r+n*(Vr(ii(t.g))-r))),b:Di(tu(s+n*(Vr(ii(t.b))-s))),a:e.a+n*(t.a-e.a)}}function va(e,t,n){if(e){let i=Zc(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=Jc(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function Vp(e,t){return e&&Object.assign(t||{},e)}function Yp(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Di(e[3]))):(t=Vp(e,{r:0,g:0,b:0,a:1}),t.a=Di(t.a)),t}function PD(e){return e.charAt(0)==="r"?AD(e):TD(e)}class qs{constructor(t){if(t instanceof qs)return t;const n=typeof t;let i;n==="object"?i=Yp(t):n==="string"&&(i=mD(t)||CD(t)||PD(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Vp(this._rgb);return t&&(t.a=ii(t.a)),t}set rgb(t){this._rgb=Yp(t)}rgbString(){return this._valid?ED(this._rgb):void 0}hexString(){return this._valid?yD(this._rgb):void 0}hslString(){return this._valid?MD(this._rgb):void 0}mix(t,n){if(t){const i=this.rgb,r=t.rgb;let s;const a=n===s?.5:n,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,n){return t&&(this._rgb=RD(this._rgb,t._rgb,n)),this}clone(){return new qs(this.rgb)}alpha(t){return this._rgb.a=Di(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Vs(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.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 va(this._rgb,2,t),this}darken(t){return va(this._rgb,2,-t),this}saturate(t){return va(this._rgb,1,t),this}desaturate(t){return va(this._rgb,1,-t),this}rotate(t){return kD(this._rgb,t),this}}function ri(){}const ID=(()=>{let e=0;return()=>e++})();function Tt(e){return e==null}function Gt(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Lt(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function le(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function mn(e,t){return le(e)?e:t}function Ct(e,t){return typeof e>"u"?t:e}const LD=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,qp=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Jt(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function te(e,t,n,i){let r,s,a;if(Gt(e))for(s=e.length,r=0;r<s;r++)t.call(n,e[r],r);else if(Lt(e))for(a=Object.keys(e),s=a.length,r=0;r<s;r++)t.call(n,e[a[r]],a[r])}function Sa(e,t){let n,i,r,s;if(!e||!t||e.length!==t.length)return!1;for(n=0,i=e.length;n<i;++n)if(r=e[n],s=t[n],r.datasetIndex!==s.datasetIndex||r.index!==s.index)return!1;return!0}function Ta(e){if(Gt(e))return e.map(Ta);if(Lt(e)){const t=Object.create(null),n=Object.keys(e),i=n.length;let r=0;for(;r<i;++r)t[n[r]]=Ta(e[n[r]]);return t}return e}function jp(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function ND(e,t,n,i){if(!jp(e))return;const r=t[e],s=n[e];Lt(r)&&Lt(s)?js(r,s,i):t[e]=Ta(s)}function js(e,t,n){const i=Gt(t)?t:[t],r=i.length;if(!Lt(e))return e;n=n||{};const s=n.merger||ND;let a;for(let l=0;l<r;++l){if(a=i[l],!Lt(a))continue;const u=Object.keys(a);for(let d=0,h=u.length;d<h;++d)s(u[d],e,a,n)}return e}function Gs(e,t){return js(e,t,{merger:BD})}function BD(e,t,n){if(!jp(e))return;const i=t[e],r=n[e];Lt(i)&&Lt(r)?Gs(i,r):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Ta(r))}const Gp={"":e=>e,x:e=>e.x,y:e=>e.y};function FD(e){const t=e.split("."),n=[];let i="";for(const r of t)i+=r,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function zD(e){const t=FD(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function Ci(e,t){return(Gp[t]||(Gp[t]=zD(t)))(e)}function eu(e){return e.charAt(0).toUpperCase()+e.slice(1)}const rn=e=>typeof e<"u",sn=e=>typeof e=="function",Kp=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function UD(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Rt=Math.PI,ee=2*Rt,HD=ee+Rt,ka=Number.POSITIVE_INFINITY,nu=Rt/180,se=Rt/2,Dn=Rt/4,Ma=Rt*2/3,Oi=Math.log10,jn=Math.sign;function Ks(e,t,n){return Math.abs(e-t)<n}function Xp(e){const t=Math.round(e);e=Ks(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(Oi(e))),i=e/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function WD(e){const t=[],n=Math.sqrt(e);let i;for(i=1;i<n;i++)e%i===0&&(t.push(i),t.push(e/i));return n===(n|0)&&t.push(n),t.sort((r,s)=>r-s).pop(),t}function $D(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Ai(e){return!$D(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function VD(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function Zp(e,t,n){let i,r,s;for(i=0,r=e.length;i<r;i++)s=e[i][n],isNaN(s)||(t.min=Math.min(t.min,s),t.max=Math.max(t.max,s))}function ve(e){return e*(Rt/180)}function Da(e){return e*(180/Rt)}function Qp(e){if(!le(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function Ca(e,t){const n=t.x-e.x,i=t.y-e.y,r=Math.sqrt(n*n+i*i);let s=Math.atan2(i,n);return s<-.5*Rt&&(s+=ee),{angle:s,distance:r}}function Yr(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function YD(e,t){return(e-t+HD)%ee-Rt}function We(e){return(e%ee+ee)%ee}function Xs(e,t,n,i){const r=We(e),s=We(t),a=We(n),l=We(s-r),u=We(a-r),d=We(r-s),h=We(r-a);return r===s||r===a||i&&s===a||l>u&&d<h}function Re(e,t,n){return Math.max(t,Math.min(n,e))}function qD(e){return Re(e,-32768,32767)}function si(e,t,n,i=1e-6){return e>=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function iu(e,t,n){n=n||(a=>e[a]<t);let i=e.length-1,r=0,s;for(;i-r>1;)s=r+i>>1,n(s)?r=s:i=s;return{lo:r,hi:i}}const oi=(e,t,n,i)=>iu(e,n,i?r=>{const s=e[r][t];return s<n||s===n&&e[r+1][t]===n}:r=>e[r][t]<n),jD=(e,t,n)=>iu(e,n,i=>e[i][t]>=n);function GD(e,t,n){let i=0,r=e.length;for(;i<r&&e[i]<t;)i++;for(;r>i&&e[r-1]>n;)r--;return i>0||r<e.length?e.slice(i,r):e}const Jp=["push","pop","shift","splice","unshift"];function KD(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Jp.forEach(n=>{const i="_onData"+eu(n),r=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...s){const a=r.apply(this,s);return e._chartjs.listeners.forEach(l=>{typeof l[i]=="function"&&l[i](...s)}),a}})})}function tm(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,r=i.indexOf(t);r!==-1&&i.splice(r,1),!(i.length>0)&&(Jp.forEach(s=>{delete e[s]}),delete e._chartjs)}function em(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const nm=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function im(e,t){let n=[],i=!1;return function(...r){n=r,i||(i=!0,nm.call(window,()=>{i=!1,e.apply(t,n)}))}}function XD(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const ru=e=>e==="start"?"left":e==="end"?"right":"center",$e=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,ZD=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function rm(e,t,n){const i=t.length;let r=0,s=i;if(e._sorted){const{iScale:a,vScale:l,_parsed:u}=e,d=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,h=a.axis,{min:m,max:g,minDefined:_,maxDefined:x}=a.getUserBounds();if(_){if(r=Math.min(oi(u,h,m).lo,n?i:oi(t,h,a.getPixelForValue(m)).lo),d){const v=u.slice(0,r+1).reverse().findIndex(S=>!Tt(S[l.axis]));r-=Math.max(0,v)}r=Re(r,0,i-1)}if(x){let v=Math.max(oi(u,a.axis,g,!0).hi+1,n?0:oi(t,h,a.getPixelForValue(g),!0).hi+1);if(d){const S=u.slice(v-1).findIndex(C=>!Tt(C[l.axis]));v+=Math.max(0,S)}s=Re(v,r,i)-r}else s=i-r}return{start:r,count:s}}function sm(e){const{xScale:t,yScale:n,_scaleRanges:i}=e,r={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=r,!0;const s=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,r),s}const Oa=e=>e===0||e===1,om=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*ee/n)),am=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*ee/n)+1,Zs={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*se)+1,easeOutSine:e=>Math.sin(e*se),easeInOutSine:e=>-.5*(Math.cos(Rt*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>Oa(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Oa(e)?e:om(e,.075,.3),easeOutElastic:e=>Oa(e)?e:am(e,.075,.3),easeInOutElastic(e){return Oa(e)?e:e<.5?.5*om(e*2,.1125,.45):.5+.5*am(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Zs.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Zs.easeInBounce(e*2)*.5:Zs.easeOutBounce(e*2-1)*.5+.5};function su(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Aa(e){return su(e)?e:new qs(e)}function ou(e){return su(e)?e:new qs(e).saturate(.5).darken(.1).hexString()}const QD=["x","y","borderWidth","radius","tension"],JD=["color","borderColor","backgroundColor"];function tC(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:JD},numbers:{type:"number",properties:QD}}),e.describe("animations",{_fallback:"animation"}),e.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 eC(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const lm=new Map;function nC(e,t){t=t||{};const n=e+JSON.stringify(t);let i=lm.get(n);return i||(i=new Intl.NumberFormat(e,t),lm.set(n,i)),i}function Qs(e,t,n){return nC(t,n).format(e)}const cm={values(e){return Gt(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const i=this.chart.options.locale;let r,s=e;if(n.length>1){const d=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(d<1e-4||d>1e15)&&(r="scientific"),s=iC(e,n)}const a=Oi(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),Qs(e,i,u)},logarithmic(e,t,n){if(e===0)return"0";const i=n[t].significand||e/Math.pow(10,Math.floor(Oi(e)));return[1,2,3,5,10,15].includes(i)||t>.8*n.length?cm.numeric.call(this,e,t,n):""}};function iC(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var Ea={formatters:cm};function rC(e){e.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,n)=>n.lineWidth,tickColor:(t,n)=>n.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:Ea.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const lr=Object.create(null),au=Object.create(null);function Js(e,t){if(!t)return e;const n=t.split(".");for(let i=0,r=n.length;i<r;++i){const s=n[i];e=e[s]||(e[s]=Object.create(null))}return e}function lu(e,t,n){return typeof t=="string"?js(Js(e,t),n):js(Js(e,""),t)}class sC{constructor(t,n){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)=>ou(r.backgroundColor),this.hoverBorderColor=(i,r)=>ou(r.borderColor),this.hoverColor=(i,r)=>ou(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(n)}set(t,n){return lu(this,t,n)}get(t){return Js(this,t)}describe(t,n){return lu(au,t,n)}override(t,n){return lu(lr,t,n)}route(t,n,i,r){const s=Js(this,t),a=Js(this,i),l="_"+n;Object.defineProperties(s,{[l]:{value:s[n],writable:!0},[n]:{enumerable:!0,get(){const u=this[l],d=a[r];return Lt(u)?Object.assign({},d,u):Ct(u,d)},set(u){this[l]=u}}})}apply(t){t.forEach(n=>n(this))}}var oe=new sC({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[tC,eC,rC]);function oC(e){return!e||Tt(e.size)||Tt(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Ra(e,t,n,i,r){let s=t[r];return s||(s=t[r]=e.measureText(r).width,n.push(r)),s>i&&(i=s),i}function aC(e,t,n,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),e.save(),e.font=t;let a=0;const l=n.length;let u,d,h,m,g;for(u=0;u<l;u++)if(m=n[u],m!=null&&!Gt(m))a=Ra(e,r,s,a,m);else if(Gt(m))for(d=0,h=m.length;d<h;d++)g=m[d],g!=null&&!Gt(g)&&(a=Ra(e,r,s,a,g));e.restore();const _=s.length/2;if(_>n.length){for(u=0;u<_;u++)delete r[s[u]];s.splice(0,_)}return a}function cr(e,t,n){const i=e.currentDevicePixelRatio,r=n!==0?Math.max(n/2,.5):0;return Math.round((t-r)*i)/i+r}function um(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function cu(e,t,n,i){dm(e,t,n,i,null)}function dm(e,t,n,i,r){let s,a,l,u,d,h,m,g;const _=t.pointStyle,x=t.rotation,v=t.radius;let S=(x||0)*nu;if(_&&typeof _=="object"&&(s=_.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){e.save(),e.translate(n,i),e.rotate(S),e.drawImage(_,-_.width/2,-_.height/2,_.width,_.height),e.restore();return}if(!(isNaN(v)||v<=0)){switch(e.beginPath(),_){default:r?e.ellipse(n,i,r/2,v,0,0,ee):e.arc(n,i,v,0,ee),e.closePath();break;case"triangle":h=r?r/2:v,e.moveTo(n+Math.sin(S)*h,i-Math.cos(S)*v),S+=Ma,e.lineTo(n+Math.sin(S)*h,i-Math.cos(S)*v),S+=Ma,e.lineTo(n+Math.sin(S)*h,i-Math.cos(S)*v),e.closePath();break;case"rectRounded":d=v*.516,u=v-d,a=Math.cos(S+Dn)*u,m=Math.cos(S+Dn)*(r?r/2-d:u),l=Math.sin(S+Dn)*u,g=Math.sin(S+Dn)*(r?r/2-d:u),e.arc(n-m,i-l,d,S-Rt,S-se),e.arc(n+g,i-a,d,S-se,S),e.arc(n+m,i+l,d,S,S+se),e.arc(n-g,i+a,d,S+se,S+Rt),e.closePath();break;case"rect":if(!x){u=Math.SQRT1_2*v,h=r?r/2:u,e.rect(n-h,i-u,2*h,2*u);break}S+=Dn;case"rectRot":m=Math.cos(S)*(r?r/2:v),a=Math.cos(S)*v,l=Math.sin(S)*v,g=Math.sin(S)*(r?r/2:v),e.moveTo(n-m,i-l),e.lineTo(n+g,i-a),e.lineTo(n+m,i+l),e.lineTo(n-g,i+a),e.closePath();break;case"crossRot":S+=Dn;case"cross":m=Math.cos(S)*(r?r/2:v),a=Math.cos(S)*v,l=Math.sin(S)*v,g=Math.sin(S)*(r?r/2:v),e.moveTo(n-m,i-l),e.lineTo(n+m,i+l),e.moveTo(n+g,i-a),e.lineTo(n-g,i+a);break;case"star":m=Math.cos(S)*(r?r/2:v),a=Math.cos(S)*v,l=Math.sin(S)*v,g=Math.sin(S)*(r?r/2:v),e.moveTo(n-m,i-l),e.lineTo(n+m,i+l),e.moveTo(n+g,i-a),e.lineTo(n-g,i+a),S+=Dn,m=Math.cos(S)*(r?r/2:v),a=Math.cos(S)*v,l=Math.sin(S)*v,g=Math.sin(S)*(r?r/2:v),e.moveTo(n-m,i-l),e.lineTo(n+m,i+l),e.moveTo(n+g,i-a),e.lineTo(n-g,i+a);break;case"line":a=r?r/2:Math.cos(S)*v,l=Math.sin(S)*v,e.moveTo(n-a,i-l),e.lineTo(n+a,i+l);break;case"dash":e.moveTo(n,i),e.lineTo(n+Math.cos(S)*(r?r/2:v),i+Math.sin(S)*v);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function ai(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function to(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function eo(e){e.restore()}function lC(e,t,n,i,r){if(!t)return e.lineTo(n.x,n.y);if(r==="middle"){const s=(t.x+n.x)/2;e.lineTo(s,t.y),e.lineTo(s,n.y)}else r==="after"!=!!i?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function cC(e,t,n,i){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?n.cp2x:n.cp1x,i?n.cp2y:n.cp1y,n.x,n.y)}function uC(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),Tt(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function dC(e,t,n,i,r){if(r.strikethrough||r.underline){const s=e.measureText(i),a=t-s.actualBoundingBoxLeft,l=t+s.actualBoundingBoxRight,u=n-s.actualBoundingBoxAscent,d=n+s.actualBoundingBoxDescent,h=r.strikethrough?(u+d)/2:d;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=r.decorationWidth||2,e.moveTo(a,h),e.lineTo(l,h),e.stroke()}}function fC(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function ur(e,t,n,i,r,s={}){const a=Gt(t)?t:[t],l=s.strokeWidth>0&&s.strokeColor!=="";let u,d;for(e.save(),e.font=r.string,uC(e,s),u=0;u<a.length;++u)d=a[u],s.backdrop&&fC(e,s.backdrop),l&&(s.strokeColor&&(e.strokeStyle=s.strokeColor),Tt(s.strokeWidth)||(e.lineWidth=s.strokeWidth),e.strokeText(d,n,i,s.maxWidth)),e.fillText(d,n,i,s.maxWidth),dC(e,n,i,d,s),i+=Number(r.lineHeight);e.restore()}function qr(e,t){const{x:n,y:i,w:r,h:s,radius:a}=t;e.arc(n+a.topLeft,i+a.topLeft,a.topLeft,1.5*Rt,Rt,!0),e.lineTo(n,i+s-a.bottomLeft),e.arc(n+a.bottomLeft,i+s-a.bottomLeft,a.bottomLeft,Rt,se,!0),e.lineTo(n+r-a.bottomRight,i+s),e.arc(n+r-a.bottomRight,i+s-a.bottomRight,a.bottomRight,se,0,!0),e.lineTo(n+r,i+a.topRight),e.arc(n+r-a.topRight,i+a.topRight,a.topRight,0,-se,!0),e.lineTo(n+a.topLeft,i)}const hC=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,pC=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function mC(e,t){const n=(""+e).match(hC);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const gC=e=>+e||0;function uu(e,t){const n={},i=Lt(t),r=i?Object.keys(t):t,s=Lt(e)?i?a=>Ct(e[a],e[t[a]]):a=>e[a]:()=>e;for(const a of r)n[a]=gC(s(a));return n}function fm(e){return uu(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Ei(e){return uu(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Se(e){const t=fm(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function ce(e,t){e=e||{},t=t||oe.font;let n=Ct(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=Ct(e.style,t.style);i&&!(""+i).match(pC)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:Ct(e.family,t.family),lineHeight:mC(Ct(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:Ct(e.weight,t.weight),string:""};return r.string=oC(r),r}function no(e,t,n,i){let r,s,a;for(r=0,s=e.length;r<s;++r)if(a=e[r],a!==void 0&&a!==void 0)return a}function yC(e,t,n){const{min:i,max:r}=e,s=qp(t,(r-i)/2),a=(l,u)=>n&&l===0?0:l+u;return{min:a(i,-Math.abs(s)),max:a(r,s)}}function Ri(e,t){return Object.assign(Object.create(e),t)}function du(e,t=[""],n,i,r=()=>e[0]){const s=n||e;typeof i>"u"&&(i=ym("_fallback",e));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:s,_fallback:i,_getTarget:r,override:l=>du([l,...e],t,s,i)};return new Proxy(a,{deleteProperty(l,u){return delete l[u],delete l._keys,delete e[0][u],!0},get(l,u){return pm(l,u,()=>kC(u,t,e,l))},getOwnPropertyDescriptor(l,u){return Reflect.getOwnPropertyDescriptor(l._scopes[0],u)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(l,u){return _m(l).includes(u)},ownKeys(l){return _m(l)},set(l,u,d){const h=l._storage||(l._storage=r());return l[u]=h[u]=d,delete l._keys,!0}})}function jr(e,t,n,i){const r={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:hm(e,i),setContext:s=>jr(e,s,n,i),override:s=>jr(e.override(s),t,n,i)};return new Proxy(r,{deleteProperty(s,a){return delete s[a],delete e[a],!0},get(s,a,l){return pm(s,a,()=>bC(s,a,l))},getOwnPropertyDescriptor(s,a){return s._descriptors.allKeys?Reflect.has(e,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,a)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(s,a){return Reflect.has(e,a)},ownKeys(){return Reflect.ownKeys(e)},set(s,a,l){return e[a]=l,delete s[a],!0}})}function hm(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:r=t.allKeys}=e;return{allKeys:r,scriptable:n,indexable:i,isScriptable:sn(n)?n:()=>n,isIndexable:sn(i)?i:()=>i}}const _C=(e,t)=>e?e+eu(t):t,fu=(e,t)=>Lt(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function pm(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const i=n();return e[t]=i,i}function bC(e,t,n){const{_proxy:i,_context:r,_subProxy:s,_descriptors:a}=e;let l=i[t];return sn(l)&&a.isScriptable(t)&&(l=xC(t,l,e,n)),Gt(l)&&l.length&&(l=wC(t,l,e,a.isIndexable)),fu(t,l)&&(l=jr(l,r,s&&s[t],a)),l}function xC(e,t,n,i){const{_proxy:r,_context:s,_subProxy:a,_stack:l}=n;if(l.has(e))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+e);l.add(e);let u=t(s,a||i);return l.delete(e),fu(e,u)&&(u=hu(r._scopes,r,e,u)),u}function wC(e,t,n,i){const{_proxy:r,_context:s,_subProxy:a,_descriptors:l}=n;if(typeof s.index<"u"&&i(e))return t[s.index%t.length];if(Lt(t[0])){const u=t,d=r._scopes.filter(h=>h!==u);t=[];for(const h of u){const m=hu(d,r,e,h);t.push(jr(m,s,a&&a[e],l))}}return t}function mm(e,t,n){return sn(e)?e(t,n):e}const vC=(e,t)=>e===!0?t:typeof e=="string"?Ci(t,e):void 0;function SC(e,t,n,i,r){for(const s of t){const a=vC(n,s);if(a){e.add(a);const l=mm(a._fallback,n,r);if(typeof l<"u"&&l!==n&&l!==i)return l}else if(a===!1&&typeof i<"u"&&n!==i)return null}return!1}function hu(e,t,n,i){const r=t._rootScopes,s=mm(t._fallback,n,i),a=[...e,...r],l=new Set;l.add(i);let u=gm(l,a,n,s||n,i);return u===null||typeof s<"u"&&s!==n&&(u=gm(l,a,s,u,i),u===null)?!1:du(Array.from(l),[""],r,s,()=>TC(t,n,i))}function gm(e,t,n,i,r){for(;n;)n=SC(e,t,n,i,r);return n}function TC(e,t,n){const i=e._getTarget();t in i||(i[t]={});const r=i[t];return Gt(r)&&Lt(n)?n:r||{}}function kC(e,t,n,i){let r;for(const s of t)if(r=ym(_C(s,e),n),typeof r<"u")return fu(e,r)?hu(n,i,e,r):r}function ym(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function _m(e){let t=e._keys;return t||(t=e._keys=MC(e._scopes)),t}function MC(e){const t=new Set;for(const n of e)for(const i of Object.keys(n).filter(r=>!r.startsWith("_")))t.add(i);return Array.from(t)}function bm(e,t,n,i){const{iScale:r}=e,{key:s="r"}=this._parsing,a=new Array(i);let l,u,d,h;for(l=0,u=i;l<u;++l)d=l+n,h=t[d],a[l]={r:r.parse(Ci(h,s),d)};return a}const DC=Number.EPSILON||1e-14,Gr=(e,t)=>t<e.length&&!e[t].skip&&e[t],xm=e=>e==="x"?"y":"x";function CC(e,t,n,i){const r=e.skip?t:e,s=t,a=n.skip?t:n,l=Yr(s,r),u=Yr(a,s);let d=l/(l+u),h=u/(l+u);d=isNaN(d)?0:d,h=isNaN(h)?0:h;const m=i*d,g=i*h;return{previous:{x:s.x-m*(a.x-r.x),y:s.y-m*(a.y-r.y)},next:{x:s.x+g*(a.x-r.x),y:s.y+g*(a.y-r.y)}}}function OC(e,t,n){const i=e.length;let r,s,a,l,u,d=Gr(e,0);for(let h=0;h<i-1;++h)if(u=d,d=Gr(e,h+1),!(!u||!d)){if(Ks(t[h],0,DC)){n[h]=n[h+1]=0;continue}r=n[h]/t[h],s=n[h+1]/t[h],l=Math.pow(r,2)+Math.pow(s,2),!(l<=9)&&(a=3/Math.sqrt(l),n[h]=r*a*t[h],n[h+1]=s*a*t[h])}}function AC(e,t,n="x"){const i=xm(n),r=e.length;let s,a,l,u=Gr(e,0);for(let d=0;d<r;++d){if(a=l,l=u,u=Gr(e,d+1),!l)continue;const h=l[n],m=l[i];a&&(s=(h-a[n])/3,l[`cp1${n}`]=h-s,l[`cp1${i}`]=m-s*t[d]),u&&(s=(u[n]-h)/3,l[`cp2${n}`]=h+s,l[`cp2${i}`]=m+s*t[d])}}function EC(e,t="x"){const n=xm(t),i=e.length,r=Array(i).fill(0),s=Array(i);let a,l,u,d=Gr(e,0);for(a=0;a<i;++a)if(l=u,u=d,d=Gr(e,a+1),!!u){if(d){const h=d[t]-u[t];r[a]=h!==0?(d[n]-u[n])/h:0}s[a]=l?d?jn(r[a-1])!==jn(r[a])?0:(r[a-1]+r[a])/2:r[a-1]:r[a]}OC(e,r,s),AC(e,s,t)}function Pa(e,t,n){return Math.max(Math.min(e,n),t)}function RC(e,t){let n,i,r,s,a,l=ai(e[0],t);for(n=0,i=e.length;n<i;++n)a=s,s=l,l=n<i-1&&ai(e[n+1],t),s&&(r=e[n],a&&(r.cp1x=Pa(r.cp1x,t.left,t.right),r.cp1y=Pa(r.cp1y,t.top,t.bottom)),l&&(r.cp2x=Pa(r.cp2x,t.left,t.right),r.cp2y=Pa(r.cp2y,t.top,t.bottom)))}function PC(e,t,n,i,r){let s,a,l,u;if(t.spanGaps&&(e=e.filter(d=>!d.skip)),t.cubicInterpolationMode==="monotone")EC(e,r);else{let d=i?e[e.length-1]:e[0];for(s=0,a=e.length;s<a;++s)l=e[s],u=CC(d,l,e[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&&RC(e,n)}function pu(){return typeof window<"u"&&typeof document<"u"}function mu(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Ia(e,t,n){let i;return typeof e=="string"?(i=parseInt(e,10),e.indexOf("%")!==-1&&(i=i/100*t.parentNode[n])):i=e,i}const La=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function IC(e,t){return La(e).getPropertyValue(t)}const LC=["top","right","bottom","left"];function dr(e,t,n){const i={};n=n?"-"+n:"";for(let r=0;r<4;r++){const s=LC[r];i[s]=parseFloat(e[t+"-"+s+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const NC=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function BC(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:r,offsetY:s}=i;let a=!1,l,u;if(NC(r,s,e.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 Pi(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,r=La(n),s=r.boxSizing==="border-box",a=dr(r,"padding"),l=dr(r,"border","width"),{x:u,y:d,box:h}=BC(e,n),m=a.left+(h&&l.left),g=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-m)/_*n.width/i),y:Math.round((d-g)/x*n.height/i)}}function FC(e,t,n){let i,r;if(t===void 0||n===void 0){const s=e&&mu(e);if(!s)t=e.clientWidth,n=e.clientHeight;else{const a=s.getBoundingClientRect(),l=La(s),u=dr(l,"border","width"),d=dr(l,"padding");t=a.width-d.width-u.width,n=a.height-d.height-u.height,i=Ia(l.maxWidth,s,"clientWidth"),r=Ia(l.maxHeight,s,"clientHeight")}}return{width:t,height:n,maxWidth:i||ka,maxHeight:r||ka}}const Ii=e=>Math.round(e*10)/10;function zC(e,t,n,i){const r=La(e),s=dr(r,"margin"),a=Ia(r.maxWidth,e,"clientWidth")||ka,l=Ia(r.maxHeight,e,"clientHeight")||ka,u=FC(e,t,n);let{width:d,height:h}=u;if(r.boxSizing==="content-box"){const g=dr(r,"border","width"),_=dr(r,"padding");d-=_.width+g.width,h-=_.height+g.height}return d=Math.max(0,d-s.width),h=Math.max(0,i?d/i:h-s.height),d=Ii(Math.min(d,a,u.maxWidth)),h=Ii(Math.min(h,l,u.maxHeight)),d&&!h&&(h=Ii(d/2)),(t!==void 0||n!==void 0)&&i&&u.height&&h>u.height&&(h=u.height,d=Ii(Math.floor(h*i))),{width:d,height:h}}function wm(e,t,n){const i=t||1,r=Ii(e.height*i),s=Ii(e.width*i);e.height=Ii(e.height),e.width=Ii(e.width);const a=e.canvas;return a.style&&(n||!a.style.height&&!a.style.width)&&(a.style.height=`${e.height}px`,a.style.width=`${e.width}px`),e.currentDevicePixelRatio!==i||a.height!==r||a.width!==s?(e.currentDevicePixelRatio=i,a.height=r,a.width=s,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}const UC=(function(){let e=!1;try{const t={get passive(){return e=!0,!1}};pu()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();function vm(e,t){const n=IC(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function fr(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function HC(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:i==="middle"?n<.5?e.y:t.y:i==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function WC(e,t,n,i){const r={x:e.cp2x,y:e.cp2y},s={x:t.cp1x,y:t.cp1y},a=fr(e,r,n),l=fr(r,s,n),u=fr(s,t,n),d=fr(a,l,n),h=fr(l,u,n);return fr(d,h,n)}const $C=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,i){return n-i},leftForLtr(n,i){return n-i}}},VC=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Kr(e,t,n){return e?$C(t,n):VC()}function Sm(e,t){let n,i;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)}function Tm(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function km(e){return e==="angle"?{between:Xs,compare:YD,normalize:We}:{between:si,compare:(t,n)=>t-n,normalize:t=>t}}function Mm({start:e,end:t,count:n,loop:i,style:r}){return{start:e%n,end:t%n,loop:i&&(t-e+1)%n===0,style:r}}function YC(e,t,n){const{property:i,start:r,end:s}=n,{between:a,normalize:l}=km(i),u=t.length;let{start:d,end:h,loop:m}=e,g,_;if(m){for(d+=u,h+=u,g=0,_=u;g<_&&a(l(t[d%u][i]),r,s);++g)d--,h--;d%=u,h%=u}return h<d&&(h+=u),{start:d,end:h,loop:m,style:e.style}}function Dm(e,t,n){if(!n)return[e];const{property:i,start:r,end:s}=n,a=t.length,{compare:l,between:u,normalize:d}=km(i),{start:h,end:m,loop:g,style:_}=YC(e,t,n),x=[];let v=!1,S=null,C,A,F;const P=()=>u(r,F,C)&&l(r,F)!==0,B=()=>l(s,C)===0||u(s,F,C),N=()=>v||P(),z=()=>!v||B();for(let k=h,w=h;k<=m;++k)A=t[k%a],!A.skip&&(C=d(A[i]),C!==F&&(v=u(C,r,s),S===null&&N()&&(S=l(C,r)===0?k:w),S!==null&&z()&&(x.push(Mm({start:S,end:k,loop:g,count:a,style:_})),S=null),w=k,F=C));return S!==null&&x.push(Mm({start:S,end:m,loop:g,count:a,style:_})),x}function Cm(e,t){const n=[],i=e.segments;for(let r=0;r<i.length;r++){const s=Dm(i[r],e.points,t);s.length&&n.push(...s)}return n}function qC(e,t,n,i){let r=0,s=t-1;if(n&&!i)for(;r<t&&!e[r].skip;)r++;for(;r<t&&e[r].skip;)r++;for(r%=t,n&&(s+=r);s>r&&e[s%t].skip;)s--;return s%=t,{start:r,end:s}}function jC(e,t,n,i){const r=e.length,s=[];let a=t,l=e[t],u;for(u=t+1;u<=n;++u){const d=e[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 GC(e,t){const n=e.points,i=e.options.spanGaps,r=n.length;if(!r)return[];const s=!!e._loop,{start:a,end:l}=qC(n,r,s,i);if(i===!0)return Om(e,[{start:a,end:l,loop:s}],n,t);const u=l<a?l+r:l,d=!!e._fullLoop&&a===0&&l===r-1;return Om(e,jC(n,a,u,d),n,t)}function Om(e,t,n,i){return!i||!i.setContext||!n?t:KC(e,t,n,i)}function KC(e,t,n,i){const r=e._chart.getContext(),s=Am(e.options),{_datasetIndex:a,options:{spanGaps:l}}=e,u=n.length,d=[];let h=s,m=t[0].start,g=m;function _(x,v,S,C){const A=l?-1:1;if(x!==v){for(x+=u;n[x%u].skip;)x-=A;for(;n[v%u].skip;)v+=A;x%u!==v%u&&(d.push({start:x%u,end:v%u,loop:S,style:C}),h=C,m=v%u)}}for(const x of t){m=l?m:x.start;let v=n[m%u],S;for(g=m+1;g<=x.end;g++){const C=n[g%u];S=Am(i.setContext(Ri(r,{type:"segment",p0:v,p1:C,p0DataIndex:(g-1)%u,p1DataIndex:g%u,datasetIndex:a}))),XC(S,h)&&_(m,g-1,x.loop,h),v=C,h=S}m<g-1&&_(m,g-1,x.loop,h)}return d}function Am(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function XC(e,t){if(!t)return!1;const n=[],i=function(r,s){return su(s)?(n.includes(s)||n.push(s),n.indexOf(s)):s};return JSON.stringify(e,i)!==JSON.stringify(t,i)}function Na(e,t,n){return e.options.clip?e[n]:t[n]}function ZC(e,t){const{xScale:n,yScale:i}=e;return n&&i?{left:Na(n,t,"left"),right:Na(n,t,"right"),top:Na(i,t,"top"),bottom:Na(i,t,"bottom")}:t}function Em(e,t){const n=t._clip;if(n.disabled)return!1;const i=ZC(t,e.chartArea);return{left:n.left===!1?0:i.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:i.right+(n.right===!0?0:n.right),top:n.top===!1?0:i.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:i.bottom+(n.bottom===!0?0:n.bottom)}}class QC{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,i,r){const s=n.listeners[r],a=n.duration;s.forEach(l=>l({chart:t,initial:n.initial,numSteps:a,currentStep:Math.min(i-n.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=nm.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=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),n+=s.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((i,r)=>Math.max(i,r._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const i=n.items;let r=i.length-1;for(;r>=0;--r)i[r].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var li=new QC;const Rm="transparent",JC={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=Aa(e||Rm),r=i.valid&&Aa(t||Rm);return r&&r.valid?r.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class tO{constructor(t,n,i,r){const s=n[i];r=no([t.to,r,s,t.from]);const a=no([t.from,s,r]);this._active=!0,this._fn=t.fn||JC[t.type||typeof a],this._easing=Zs[t.easing]||Zs.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=i,this._from=a,this._to=r,this._promises=void 0}active(){return this._active}update(t,n,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=no([t.to,n,r,t.from]),this._from=no([t.from,r,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=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||n<i),!this._active){this._target[r]=l,this._notify(!0);return}if(n<0){this._target[r]=s;return}u=n/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((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let r=0;r<i.length;r++)i[r][n]()}}class gu{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Lt(t))return;const n=Object.keys(oe.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{const s=t[r];if(!Lt(s))return;const a={};for(const l of n)a[l]=s[l];(Gt(s.properties)&&s.properties||[r]).forEach(l=>{(l===r||!i.has(l))&&i.set(l,a)})})}_animateOptions(t,n){const i=n.options,r=nO(t,i);if(!r)return[];const s=this._createAnimations(r,i);return i.$shared&&eO(t.options.$animations,i).then(()=>{t.options=i},()=>{}),s}_createAnimations(t,n){const i=this._properties,r=[],s=t.$animations||(t.$animations={}),a=Object.keys(n),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,n));continue}const h=n[d];let m=s[d];const g=i.get(d);if(m)if(g&&m.active()){m.update(g,h,l);continue}else m.cancel();if(!g||!g.duration){t[d]=h;continue}s[d]=m=new tO(g,t,d,h),r.push(m)}return r}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return li.add(this._chart,i),!0}}function eO(e,t){const n=[],i=Object.keys(t);for(let r=0;r<i.length;r++){const s=e[i[r]];s&&s.active()&&n.push(s.wait())}return Promise.all(n)}function nO(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function Pm(e,t){const n=e&&e.options||{},i=n.reverse,r=n.min===void 0?t:0,s=n.max===void 0?t:0;return{start:i?s:r,end:i?r:s}}function iO(e,t,n){if(n===!1)return!1;const i=Pm(e,n),r=Pm(t,n);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}function rO(e){let t,n,i,r;return Lt(e)?(t=e.top,n=e.right,i=e.bottom,r=e.left):t=n=i=r=e,{top:t,right:n,bottom:i,left:r,disabled:e===!1}}function Im(e,t){const n=[],i=e._getSortedDatasetMetas(t);let r,s;for(r=0,s=i.length;r<s;++r)n.push(i[r].index);return n}function Lm(e,t,n,i={}){const r=e.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===n){if(h=!0,i.all)continue;break}d=e.values[u],le(d)&&(s||t===0||jn(t)===jn(d))&&(t+=d)}return!h&&!i.all?0:t}function sO(e,t){const{iScale:n,vScale:i}=t,r=n.axis==="x"?"x":"y",s=i.axis==="x"?"x":"y",a=Object.keys(e),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]:e[h]};return l}function yu(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function oO(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function aO(e){const{min:t,max:n,minDefined:i,maxDefined:r}=e.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:r?n:Number.POSITIVE_INFINITY}}function lO(e,t,n){const i=e[t]||(e[t]={});return i[n]||(i[n]={})}function Nm(e,t,n,i){for(const r of t.getMatchingVisibleMetas(i).reverse()){const s=e[r.index];if(n&&s>0||!n&&s<0)return r.index}return null}function Bm(e,t){const{chart:n,_cachedMeta:i}=e,r=n._stacks||(n._stacks={}),{iScale:s,vScale:a,index:l}=i,u=s.axis,d=a.axis,h=oO(s,a,i),m=t.length;let g;for(let _=0;_<m;++_){const x=t[_],{[u]:v,[d]:S}=x,C=x._stacks||(x._stacks={});g=C[d]=lO(r,h,v),g[l]=S,g._top=Nm(g,a,!0,i.type),g._bottom=Nm(g,a,!1,i.type);const A=g._visualValues||(g._visualValues={});A[l]=S}}function _u(e,t){const n=e.scales;return Object.keys(n).filter(i=>n[i].axis===t).shift()}function cO(e,t){return Ri(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function uO(e,t,n){return Ri(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function io(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const r of t){const s=r._stacks;if(!s||s[i]===void 0||s[i][n]===void 0)return;delete s[i][n],s[i]._visualValues!==void 0&&s[i]._visualValues[n]!==void 0&&delete s[i]._visualValues[n]}}}const bu=e=>e==="reset"||e==="none",Fm=(e,t)=>t?e:Object.assign({},e),dO=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Im(n,!0),values:null};class Li{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,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=yu(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&&io(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),r=(m,g,_,x)=>m==="x"?g:m==="r"?x:_,s=n.xAxisID=Ct(i.xAxisID,_u(t,"x")),a=n.yAxisID=Ct(i.yAxisID,_u(t,"y")),l=n.rAxisID=Ct(i.rAxisID,_u(t,"r")),u=n.indexAxis,d=n.iAxisID=r(u,s,a,l),h=n.vAxisID=r(u,a,s,l);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(a),n.rScale=this.getScaleForId(l),n.iScale=this.getScaleForId(d),n.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 n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&tm(this._data,this),t._stacked&&io(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(Lt(n)){const r=this._cachedMeta;this._data=sO(n,r)}else if(i!==n){if(i){tm(i,this);const r=this._cachedMeta;io(r),r._parsed=[]}n&&Object.isExtensible(n)&&KD(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,i=this.getDataset();let r=!1;this._dataCheck();const s=n._stacked;n._stacked=yu(n.vScale,n),n.stack!==i.stack&&(r=!0,io(n),n.stack=i.stack),this._resyncElements(t),(r||s!==n._stacked)&&(Bm(this,n._parsed),n._stacked=yu(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:i,_data:r}=this,{iScale:s,_stacked:a}=i,l=s.axis;let u=t===0&&n===r.length?!0:i._sorted,d=t>0&&i._parsed[t-1],h,m,g;if(this._parsing===!1)i._parsed=r,i._sorted=!0,g=r;else{Gt(r[t])?g=this.parseArrayData(i,r,t,n):Lt(r[t])?g=this.parseObjectData(i,r,t,n):g=this.parsePrimitiveData(i,r,t,n);const _=()=>m[l]===null||d&&m[l]<d[l];for(h=0;h<n;++h)i._parsed[h+t]=m=g[h],u&&(_()&&(u=!1),d=m);i._sorted=u}a&&Bm(this,g)}parsePrimitiveData(t,n,i,r){const{iScale:s,vScale:a}=t,l=s.axis,u=a.axis,d=s.getLabels(),h=s===a,m=new Array(r);let g,_,x;for(g=0,_=r;g<_;++g)x=g+i,m[g]={[l]:h||s.parse(d[x],x),[u]:a.parse(n[x],x)};return m}parseArrayData(t,n,i,r){const{xScale:s,yScale:a}=t,l=new Array(r);let u,d,h,m;for(u=0,d=r;u<d;++u)h=u+i,m=n[h],l[u]={x:s.parse(m[0],h),y:a.parse(m[1],h)};return l}parseObjectData(t,n,i,r){const{xScale:s,yScale:a}=t,{xAxisKey:l="x",yAxisKey:u="y"}=this._parsing,d=new Array(r);let h,m,g,_;for(h=0,m=r;h<m;++h)g=h+i,_=n[g],d[h]={x:s.parse(Ci(_,l),g),y:a.parse(Ci(_,u),g)};return d}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,i){const r=this.chart,s=this._cachedMeta,a=n[t.axis],l={keys:Im(r,!0),values:n._stacks[t.axis]._visualValues};return Lm(l,a,s.index,{mode:i})}updateRangeFromParsed(t,n,i,r){const s=i[n.axis];let a=s===null?NaN:s;const l=r&&i._stacks[n.axis];r&&l&&(r.values=l,a=Lm(r,s,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,n){const i=this._cachedMeta,r=i._parsed,s=i._sorted&&t===i.iScale,a=r.length,l=this._getOtherScale(t),u=dO(n,i,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:m}=aO(l);let g,_;function x(){_=r[g];const v=_[l.axis];return!le(_[t.axis])||h>v||m<v}for(g=0;g<a&&!(!x()&&(this.updateRangeFromParsed(d,t,_,u),s));++g);if(s){for(g=a-1;g>=0;--g)if(!x()){this.updateRangeFromParsed(d,t,_,u);break}}return d}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let r,s,a;for(r=0,s=n.length;r<s;++r)a=n[r][t.axis],le(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,i=n.iScale,r=n.vScale,s=this.getParsed(t);return{label:i?""+i.getLabelForValue(s[i.axis]):"",value:r?""+r.getLabelForValue(s[r.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=rO(Ct(this.options.clip,iO(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,i=this._cachedMeta,r=i.data||[],s=n.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 m=r[h];m.hidden||(m.active&&d?a.push(m):m.draw(t,s))}for(h=0;h<a.length;++h)a[h].draw(t,s)}getStyle(t,n){const i=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,n,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=uO(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=cO(this.chart.getContext(),this.index)),s.dataset=r,s.index=s.datasetIndex=this.index;return s.active=!!n,s.mode=i,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",i){const r=n==="active",s=this._cachedDataOpts,a=t+"-"+n,l=s[a],u=this.enableOptionSharing&&rn(i);if(l)return Fm(l,u);const d=this.chart.config,h=d.datasetElementScopeKeys(this._type,t),m=r?[`${t}Hover`,"hover",t,""]:[t,""],g=d.getOptionScopes(this.getDataset(),h),_=Object.keys(oe.elements[t]),x=()=>this.getContext(i,r,n),v=d.resolveNamedOptions(g,_,x,m);return v.$shared&&(v.$shared=u,s[a]=Object.freeze(Fm(v,u))),v}_resolveAnimations(t,n,i){const r=this.chart,s=this._cachedDataOpts,a=`animation-${n}`,l=s[a];if(l)return l;let u;if(r.options.animation!==!1){const h=this.chart.config,m=h.datasetAnimationScopeKeys(this._type,n),g=h.getOptionScopes(this.getDataset(),m);u=h.createResolver(g,this.getContext(t,i,n))}const d=new gu(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,n){return!n||bu(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),r=this._sharedOptions,s=this.getSharedOptions(i),a=this.includeOptions(n,s)||s!==r;return this.updateSharedOptions(s,n,i),{sharedOptions:s,includeOptions:a}}updateElement(t,n,i,r){bu(r)?Object.assign(t,i):this._resolveAnimations(n,r).update(t,i)}updateSharedOptions(t,n,i){t&&!bu(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,r){t.active=r;const s=this.getStyle(n,r);this._resolveAnimations(n,i,r).update(t,{options:!r&&this.getSharedOptions(s)||s})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,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 n=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=n.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,n,i=!0){const r=this._cachedMeta,s=r.data,a=t+n;let l;const u=d=>{for(d.length+=n,l=d.length-1;l>=a;l--)d[l]=d[l-n]};for(u(s),l=t;l<a;++l)s[l]=new this.dataElementType;this._parsing&&u(r._parsed),this.parse(t,n),i&&this.updateElements(s,t,n,"reset")}updateElements(t,n,i,r){}_removeElements(t,n){const i=this._cachedMeta;if(this._parsing){const r=i._parsed.splice(t,n);i._stacked&&io(i,r)}i.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,i,r]=t;this[n](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,n){n&&this._sync(["_removeElements",t,n]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function fO(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let i=[];for(let r=0,s=n.length;r<s;r++)i=i.concat(n[r].controller.getAllParsedValues(e));e._cache.$bar=em(i.sort((r,s)=>r-s))}return e._cache.$bar}function hO(e){const t=e.iScale,n=fO(t,e.type);let i=t._length,r,s,a,l;const u=()=>{a===32767||a===-32768||(rn(l)&&(i=Math.min(i,Math.abs(a-l)||i)),l=a)};for(r=0,s=n.length;r<s;++r)a=t.getPixelForValue(n[r]),u();for(l=void 0,r=0,s=t.ticks.length;r<s;++r)a=t.getPixelForTick(r),u();return i}function pO(e,t,n,i){const r=n.barThickness;let s,a;return Tt(r)?(s=t.min*n.categoryPercentage,a=n.barPercentage):(s=r*i,a=1),{chunk:s/i,ratio:a,start:t.pixels[e]-s/2}}function mO(e,t,n,i){const r=t.pixels,s=r[e];let a=e>0?r[e-1]:null,l=e<r.length-1?r[e+1]:null;const u=n.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:n.barPercentage,start:d}}function gO(e,t,n,i){const r=n.parse(e[0],i),s=n.parse(e[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[n.axis]=d,t._custom={barStart:u,barEnd:d,start:r,end:s,min:a,max:l}}function zm(e,t,n,i){return Gt(e)?gO(e,t,n,i):t[n.axis]=n.parse(e,i),t}function Um(e,t,n,i){const r=e.iScale,s=e.vScale,a=r.getLabels(),l=r===s,u=[];let d,h,m,g;for(d=n,h=n+i;d<h;++d)g=t[d],m={},m[r.axis]=l||r.parse(a[d],d),u.push(zm(g,m,s,d));return u}function xu(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function yO(e,t,n){return e!==0?jn(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function _O(e){let t,n,i,r,s;return e.horizontal?(t=e.base>e.x,n="left",i="right"):(t=e.base<e.y,n="bottom",i="top"),t?(r="end",s="start"):(r="start",s="end"),{start:n,end:i,reverse:t,top:r,bottom:s}}function bO(e,t,n,i){let r=t.borderSkipped;const s={};if(!r){e.borderSkipped=s;return}if(r===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:l,reverse:u,top:d,bottom:h}=_O(e);r==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===i?r=d:(n._bottom||0)===i?r=h:(s[Hm(h,a,l,u)]=!0,r=d)),s[Hm(r,a,l,u)]=!0,e.borderSkipped=s}function Hm(e,t,n,i){return i?(e=xO(e,t,n),e=Wm(e,n,t)):e=Wm(e,t,n),e}function xO(e,t,n){return e===t?n:e===n?t:e}function Wm(e,t,n){return e==="start"?t:e==="end"?n:e}function wO(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class $m extends Li{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,n,i,r){return Um(t,n,i,r)}parseArrayData(t,n,i,r){return Um(t,n,i,r)}parseObjectData(t,n,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,m=[];let g,_,x,v;for(g=i,_=i+r;g<_;++g)v=n[g],x={},x[s.axis]=s.parse(Ci(v,d),g),m.push(zm(Ci(v,h),x,a,g));return m}updateRangeFromParsed(t,n,i,r){super.updateRangeFromParsed(t,n,i,r);const s=i._custom;s&&n===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 n=this._cachedMeta,{iScale:i,vScale:r}=n,s=this.getParsed(t),a=s._custom,l=xu(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 n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,i,r){const s=r==="reset",{index:a,_cachedMeta:{vScale:l}}=this,u=l.getBasePixel(),d=l.isHorizontal(),h=this._getRuler(),{sharedOptions:m,includeOptions:g}=this._getSharedOptions(n,r);for(let _=n;_<n+i;_++){const x=this.getParsed(_),v=s||Tt(x[l.axis])?{base:u,head:u}:this._calculateBarValuePixels(_),S=this._calculateBarIndexPixels(_,h),C=(x._stacks||{})[l.axis],A={horizontal:d,base:v.base,enableBorderRadius:!C||xu(x._custom)||a===C._top||a===C._bottom,x:d?v.head:S.center,y:d?S.center:v.head,height:d?S.size:Math.abs(v.size),width:d?Math.abs(v.size):S.size};g&&(A.options=m||this.resolveDataElementOptions(_,t[_].active?"active":r));const F=A.options||t[_].options;bO(A,F,C,a),wO(A,F,h.ratio),this.updateElement(t[_],_,A,r)}}_getStacks(t,n){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(n),u=l&&l[i.axis],d=h=>{const m=h._parsed.find(_=>_[i.axis]===u),g=m&&m[h.vScale.axis];if(Tt(g)||isNaN(g))return!0};for(const h of r)if(!(n!==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,n=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===n).shift()}_getAxis(){const t={},n=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[Ct(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,i){const r=this._getStacks(t,i),s=n!==void 0?r.indexOf(n):-1;return s===-1?r.length-1:s}_getRuler(){const t=this.options,n=this._cachedMeta,i=n.iScale,r=[];let s,a;for(s=0,a=n.data.length;s<a;++s)r.push(i.getPixelForValue(this.getParsed(s)[i.axis],s));const l=t.barThickness;return{min:l||hO(n),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:n,_stacked:i,index:r},options:{base:s,minBarLength:a}}=this,l=s||0,u=this.getParsed(t),d=u._custom,h=xu(d);let m=u[n.axis],g=0,_=i?this.applyStack(n,u,i):m,x,v;_!==m&&(g=_-m,_=m),h&&(m=d.barStart,_=d.barEnd-d.barStart,m!==0&&jn(m)!==jn(d.barEnd)&&(g=0),g+=m);const S=!Tt(s)&&!h?s:g;let C=n.getPixelForValue(S);if(this.chart.getDataVisibility(t)?x=n.getPixelForValue(g+_):x=C,v=x-C,Math.abs(v)<a){v=yO(v,n,l)*a,m===l&&(C-=v/2);const A=n.getPixelForDecimal(0),F=n.getPixelForDecimal(1),P=Math.min(A,F),B=Math.max(A,F);C=Math.max(Math.min(C,B),P),x=C+v,i&&!h&&(u._stacks[n.axis]._visualValues[r]=n.getValueForPixel(x)-n.getValueForPixel(C))}if(C===n.getPixelForValue(l)){const A=jn(v)*n.getLineWidthForValue(l)/2;C+=A,v-=A}return{size:v,base:C,head:x,center:x+v/2}}_calculateBarIndexPixels(t,n){const i=n.scale,r=this.options,s=r.skipNull,a=Ct(r.maxBarThickness,1/0);let l,u;const d=this._getAxisCount();if(n.grouped){const h=s?this._getStackCount(t):n.stackCount,m=r.barThickness==="flex"?mO(t,n,r,h*d):pO(t,n,r,h*d),g=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,_=this._getAxis().indexOf(Ct(g,this.getFirstScaleIdForIndexAxis())),x=this._getStackIndex(this.index,this._cachedMeta.stack,s?t:void 0)+_;l=m.start+m.chunk*x+m.chunk/2,u=Math.min(a,m.chunk*m.ratio)}else l=i.getPixelForValue(this.getParsed(t)[i.axis],t),u=Math.min(a,n.min*n.ratio);return{base:l-u/2,head:l+u/2,center:l,size:u}}draw(){const t=this._cachedMeta,n=t.vScale,i=t.data,r=i.length;let s=0;for(;s<r;++s)this.getParsed(s)[n.axis]!==null&&!i[s].hidden&&i[s].draw(this._ctx)}}class vO extends Li{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,n,i,r){const s=super.parsePrimitiveData(t,n,i,r);for(let a=0;a<s.length;a++)s[a]._custom=this.resolveDataElementOptions(a+i).radius;return s}parseArrayData(t,n,i,r){const s=super.parseArrayData(t,n,i,r);for(let a=0;a<s.length;a++){const l=n[i+a];s[a]._custom=Ct(l[2],this.resolveDataElementOptions(a+i).radius)}return s}parseObjectData(t,n,i,r){const s=super.parseObjectData(t,n,i,r);for(let a=0;a<s.length;a++){const l=n[i+a];s[a]._custom=Ct(l&&l.r&&+l.r,this.resolveDataElementOptions(a+i).radius)}return s}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let i=t.length-1;i>=0;--i)n=Math.max(n,t[i].size(this.resolveDataElementOptions(i))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:s}=n,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 n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,i,r){const s=r==="reset",{iScale:a,vScale:l}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,r),h=a.axis,m=l.axis;for(let g=n;g<n+i;g++){const _=t[g],x=!s&&this.getParsed(g),v={},S=v[h]=s?a.getPixelForDecimal(.5):a.getPixelForValue(x[h]),C=v[m]=s?l.getBasePixel():l.getPixelForValue(x[m]);v.skip=isNaN(S)||isNaN(C),d&&(v.options=u||this.resolveDataElementOptions(g,_.active?"active":r),s&&(v.options.radius=0)),this.updateElement(_,g,v,r)}}resolveDataElementOptions(t,n){const i=this.getParsed(t);let r=super.resolveDataElementOptions(t,n);r.$shared&&(r=Object.assign({},r,{$shared:!1}));const s=r.radius;return n!=="active"&&(r.radius=0),r.radius+=Ct(i&&i._custom,s),r}}function SO(e,t,n){let i=1,r=1,s=0,a=0;if(t<ee){const l=e,u=l+t,d=Math.cos(l),h=Math.sin(l),m=Math.cos(u),g=Math.sin(u),_=(F,P,B)=>Xs(F,l,u,!0)?1:Math.max(P,P*n,B,B*n),x=(F,P,B)=>Xs(F,l,u,!0)?-1:Math.min(P,P*n,B,B*n),v=_(0,d,m),S=_(se,h,g),C=x(Rt,d,m),A=x(Rt+se,h,g);i=(v-C)/2,r=(S-A)/2,s=-(v+C)/2,a=-(S+A)/2}return{ratioX:i,ratioY:r,offsetX:s,offsetY:a}}class ro extends Li{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 n=t.data,{labels:{pointStyle:i,textAlign:r,color:s,useBorderRadius:a,borderRadius:l}}=t.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((u,d)=>{const m=t.getDatasetMeta(0).controller.getStyle(d);return{text:u,fillStyle:m.backgroundColor,fontColor:s,hidden:!t.getDataVisibility(d),lineDash:m.borderDash,lineDashOffset:m.borderDashOffset,lineJoin:m.borderJoinStyle,lineWidth:m.borderWidth,strokeStyle:m.borderColor,textAlign:r,pointStyle:i,borderRadius:a&&(l||m.borderRadius),index:d}}):[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}};constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const i=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=i;else{let s=u=>+i[u];if(Lt(i[t])){const{key:u="value"}=this._parsing;s=d=>+Ci(i[d],u)}let a,l;for(a=t,l=t+n;a<l;++a)r._parsed[a]=s(a)}}_getRotation(){return ve(this.options.rotation-90)}_getCircumference(){return ve(this.options.circumference)}_getRotationExtents(){let t=ee,n=-ee;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),n=Math.max(n,s+a)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:i}=n,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(LD(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:h,rotation:m}=this._getRotationExtents(),{ratioX:g,ratioY:_,offsetX:x,offsetY:v}=SO(m,h,u),S=(i.width-a)/g,C=(i.height-a)/_,A=Math.max(Math.min(S,C)/2,0),F=qp(this.options.radius,A),P=Math.max(F*u,0),B=(F-P)/this._getVisibleDatasetWeightTotal();this.offsetX=x*F,this.offsetY=v*F,r.total=this.calculateTotal(),this.outerRadius=F-B*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-B*d,0),this.updateElements(s,0,s.length,t)}_circumference(t,n){const i=this.options,r=this._cachedMeta,s=this._getCircumference();return n&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||r._parsed[t]===null||r.data[t].hidden?0:this.calculateCircumference(r._parsed[t]*s/ee)}updateElements(t,n,i,r){const s=r==="reset",a=this.chart,l=a.chartArea,d=a.options.animation,h=(l.left+l.right)/2,m=(l.top+l.bottom)/2,g=s&&d.animateScale,_=g?0:this.innerRadius,x=g?0:this.outerRadius,{sharedOptions:v,includeOptions:S}=this._getSharedOptions(n,r);let C=this._getRotation(),A;for(A=0;A<n;++A)C+=this._circumference(A,s);for(A=n;A<n+i;++A){const F=this._circumference(A,s),P=t[A],B={x:h+this.offsetX,y:m+this.offsetY,startAngle:C,endAngle:C+F,circumference:F,outerRadius:x,innerRadius:_};S&&(B.options=v||this.resolveDataElementOptions(A,P.active?"active":r)),C+=F,this.updateElement(P,A,B,r)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let i=0,r;for(r=0;r<n.length;r++){const s=t._parsed[r];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(r)&&!n[r].hidden&&(i+=Math.abs(s))}return i}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?ee*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=Qs(n._parsed[t],i.options.locale);return{label:r[t]||"",value:s}}getMaxBorderWidth(t){let n=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"&&(n=Math.max(n,u.borderWidth||0,u.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let i=0,r=t.length;i<r;++i){const s=this.resolveDataElementOptions(i);n=Math.max(n,s.offset||0,s.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(n+=this._getRingWeight(i));return n}_getRingWeight(t){return Math.max(Ct(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class Vm extends Li{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 n=this._cachedMeta,{dataset:i,data:r=[],_dataset:s}=n,a=this.chart._animationsDisabled;let{start:l,count:u}=rm(n,r,a);this._drawStart=l,this._drawCount=u,sm(n)&&(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,n,i,r){const s=r==="reset",{iScale:a,vScale:l,_stacked:u,_dataset:d}=this._cachedMeta,{sharedOptions:h,includeOptions:m}=this._getSharedOptions(n,r),g=a.axis,_=l.axis,{spanGaps:x,segment:v}=this.options,S=Ai(x)?x:Number.POSITIVE_INFINITY,C=this.chart._animationsDisabled||s||r==="none",A=n+i,F=t.length;let P=n>0&&this.getParsed(n-1);for(let B=0;B<F;++B){const N=t[B],z=C?N:{};if(B<n||B>=A){z.skip=!0;continue}const k=this.getParsed(B),w=Tt(k[_]),O=z[g]=a.getPixelForValue(k[g],B),L=z[_]=s||w?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,k,u):k[_],B);z.skip=isNaN(O)||isNaN(L)||w,z.stop=B>0&&Math.abs(k[g]-P[g])>S,v&&(z.parsed=k,z.raw=d.data[B]),m&&(z.options=h||this.resolveDataElementOptions(B,N.active?"active":r)),C||this.updateElement(N,B,z,r),P=k}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,i=n.options&&n.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 Ym extends Li{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 n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return n.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,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=Qs(n._parsed[t].r,i.options.locale);return{label:r[t]||"",value:s}}parseObjectData(t,n,i,r){return bm.bind(this)(t,n,i,r)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={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<n.min&&(n.min=s),s>n.max&&(n.max=s))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,i=t.options,r=Math.min(n.right-n.left,n.bottom-n.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,n,i,r){const s=r==="reset",a=this.chart,u=a.options.animation,d=this._cachedMeta.rScale,h=d.xCenter,m=d.yCenter,g=d.getIndexAngle(0)-.5*Rt;let _=g,x;const v=360/this.countVisibleElements();for(x=0;x<n;++x)_+=this._computeAngle(x,r,v);for(x=n;x<n+i;x++){const S=t[x];let C=_,A=_+this._computeAngle(x,r,v),F=a.getDataVisibility(x)?d.getDistanceFromCenterForValue(this.getParsed(x).r):0;_=A,s&&(u.animateScale&&(F=0),u.animateRotate&&(C=A=g));const P={x:h,y:m,innerRadius:0,outerRadius:F,startAngle:C,endAngle:A,options:this.resolveDataElementOptions(x,S.active?"active":r)};this.updateElement(S,x,P,r)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((i,r)=>{!isNaN(this.getParsed(r).r)&&this.chart.getDataVisibility(r)&&n++}),n}_computeAngle(t,n,i){return this.chart.getDataVisibility(t)?ve(this.resolveDataElementOptions(t,n).angle||i):0}}class TO extends ro{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class kO extends Li{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 n=this._cachedMeta.vScale,i=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(i[n.axis])}}parseObjectData(t,n,i,r){return bm.bind(this)(t,n,i,r)}update(t){const n=this._cachedMeta,i=n.dataset,r=n.data||[],s=n.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,n,i,r){const s=this._cachedMeta.rScale,a=r==="reset";for(let l=n;l<n+i;l++){const u=t[l],d=this.resolveDataElementOptions(l,u.active?"active":r),h=s.getPointPositionForValue(l,this.getParsed(l).r),m=a?s.xCenter:h.x,g=a?s.yCenter:h.y,_={x:m,y:g,angle:h.angle,skip:isNaN(m)||isNaN(g),options:d};this.updateElement(u,l,_,r)}}}class qm extends Li{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 n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:s}=n,a=this.getParsed(t),l=r.getLabelForValue(a.x),u=s.getLabelForValue(a.y);return{label:i[t]||"",value:"("+l+", "+u+")"}}update(t){const n=this._cachedMeta,{data:i=[]}=n,r=this.chart._animationsDisabled;let{start:s,count:a}=rm(n,i,r);if(this._drawStart=s,this._drawCount=a,sm(n)&&(s=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:l,_dataset:u}=n;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 n.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,n,i,r){const s=r==="reset",{iScale:a,vScale:l,_stacked:u,_dataset:d}=this._cachedMeta,h=this.resolveDataElementOptions(n,r),m=this.getSharedOptions(h),g=this.includeOptions(r,m),_=a.axis,x=l.axis,{spanGaps:v,segment:S}=this.options,C=Ai(v)?v:Number.POSITIVE_INFINITY,A=this.chart._animationsDisabled||s||r==="none";let F=n>0&&this.getParsed(n-1);for(let P=n;P<n+i;++P){const B=t[P],N=this.getParsed(P),z=A?B:{},k=Tt(N[x]),w=z[_]=a.getPixelForValue(N[_],P),O=z[x]=s||k?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,N,u):N[x],P);z.skip=isNaN(w)||isNaN(O)||k,z.stop=P>0&&Math.abs(N[_]-F[_])>C,S&&(z.parsed=N,z.raw=d.data[P]),g&&(z.options=m||this.resolveDataElementOptions(P,B.active?"active":r)),A||this.updateElement(B,P,z,r),F=N}this.updateSharedOptions(m,r,h)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let l=0;for(let u=n.length-1;u>=0;--u)l=Math.max(l,n[u].size(this.resolveDataElementOptions(u))/2);return l>0&&l}const i=t.dataset,r=i.options&&i.options.borderWidth||0;if(!n.length)return r;const s=n[0].size(this.resolveDataElementOptions(0)),a=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(r,s,a)/2}}var MO=Object.freeze({__proto__:null,BarController:$m,BubbleController:vO,DoughnutController:ro,LineController:Vm,PieController:TO,PolarAreaController:Ym,RadarController:kO,ScatterController:qm});function hr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class wu{static override(t){Object.assign(wu.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return hr()}parse(){return hr()}format(){return hr()}add(){return hr()}diff(){return hr()}startOf(){return hr()}endOf(){return hr()}}var jm={_date:wu};function DO(e,t,n,i){const{controller:r,data:s,_sorted:a}=e,l=r._cachedMeta.iScale,u=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(l&&t===l.axis&&t!=="r"&&a&&s.length){const d=l._reversePixels?jD:oi;if(i){if(r._sharedOptions){const h=s[0],m=typeof h.getRange=="function"&&h.getRange(t);if(m){const g=d(s,t,n-m),_=d(s,t,n+m);return{lo:g.lo,hi:_.hi}}}}else{const h=d(s,t,n);if(u){const{vScale:m}=r._cachedMeta,{_parsed:g}=e,_=g.slice(0,h.lo+1).reverse().findIndex(v=>!Tt(v[m.axis]));h.lo-=Math.max(0,_);const x=g.slice(h.hi).findIndex(v=>!Tt(v[m.axis]));h.hi+=Math.max(0,x)}return h}}return{lo:0,hi:s.length-1}}function so(e,t,n,i,r){const s=e.getSortedVisibleDatasetMetas(),a=n[t];for(let l=0,u=s.length;l<u;++l){const{index:d,data:h}=s[l],{lo:m,hi:g}=DO(s[l],t,a,r);for(let _=m;_<=g;++_){const x=h[_];x.skip||i(x,d,_)}}}function CO(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(i,r){const s=t?Math.abs(i.x-r.x):0,a=n?Math.abs(i.y-r.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(a,2))}}function vu(e,t,n,i,r){const s=[];return!r&&!e.isPointInArea(t)||so(e,n,t,function(l,u,d){!r&&!ai(l,e.chartArea,0)||l.inRange(t.x,t.y,i)&&s.push({element:l,datasetIndex:u,index:d})},!0),s}function OO(e,t,n,i){let r=[];function s(a,l,u){const{startAngle:d,endAngle:h}=a.getProps(["startAngle","endAngle"],i),{angle:m}=Ca(a,{x:t.x,y:t.y});Xs(m,d,h)&&r.push({element:a,datasetIndex:l,index:u})}return so(e,n,t,s),r}function AO(e,t,n,i,r,s){let a=[];const l=CO(n);let u=Number.POSITIVE_INFINITY;function d(h,m,g){const _=h.inRange(t.x,t.y,r);if(i&&!_)return;const x=h.getCenterPoint(r);if(!(!!s||e.isPointInArea(x))&&!_)return;const S=l(t,x);S<u?(a=[{element:h,datasetIndex:m,index:g}],u=S):S===u&&a.push({element:h,datasetIndex:m,index:g})}return so(e,n,t,d),a}function Su(e,t,n,i,r,s){return!s&&!e.isPointInArea(t)?[]:n==="r"&&!i?OO(e,t,n,r):AO(e,t,n,i,r,s)}function Gm(e,t,n,i,r){const s=[],a=n==="x"?"inXRange":"inYRange";let l=!1;return so(e,n,t,(u,d,h)=>{u[a]&&u[a](t[n],r)&&(s.push({element:u,datasetIndex:d,index:h}),l=l||u.inRange(t.x,t.y,r))}),i&&!l?[]:s}var Tu={evaluateInteractionItems:so,modes:{index(e,t,n,i){const r=Pi(t,e),s=n.axis||"x",a=n.includeInvisible||!1,l=n.intersect?vu(e,r,s,i,a):Su(e,r,s,!1,i,a),u=[];return l.length?(e.getSortedVisibleDatasetMetas().forEach(d=>{const h=l[0].index,m=d.data[h];m&&!m.skip&&u.push({element:m,datasetIndex:d.index,index:h})}),u):[]},dataset(e,t,n,i){const r=Pi(t,e),s=n.axis||"xy",a=n.includeInvisible||!1;let l=n.intersect?vu(e,r,s,i,a):Su(e,r,s,!1,i,a);if(l.length>0){const u=l[0].datasetIndex,d=e.getDatasetMeta(u).data;l=[];for(let h=0;h<d.length;++h)l.push({element:d[h],datasetIndex:u,index:h})}return l},point(e,t,n,i){const r=Pi(t,e),s=n.axis||"xy",a=n.includeInvisible||!1;return vu(e,r,s,i,a)},nearest(e,t,n,i){const r=Pi(t,e),s=n.axis||"xy",a=n.includeInvisible||!1;return Su(e,r,s,n.intersect,i,a)},x(e,t,n,i){const r=Pi(t,e);return Gm(e,r,"x",n.intersect,i)},y(e,t,n,i){const r=Pi(t,e);return Gm(e,r,"y",n.intersect,i)}}};const Km=["left","top","right","bottom"];function oo(e,t){return e.filter(n=>n.pos===t)}function Xm(e,t){return e.filter(n=>Km.indexOf(n.pos)===-1&&n.box.axis===t)}function ao(e,t){return e.sort((n,i)=>{const r=t?i:n,s=t?n:i;return r.weight===s.weight?r.index-s.index:r.weight-s.weight})}function EO(e){const t=[];let n,i,r,s,a,l;for(n=0,i=(e||[]).length;n<i;++n)r=e[n],{position:s,options:{stack:a,stackWeight:l=1}}=r,t.push({index:n,box:r,pos:s,horizontal:r.isHorizontal(),weight:r.weight,stack:a&&s+a,stackWeight:l});return t}function RO(e){const t={};for(const n of e){const{stack:i,pos:r,stackWeight:s}=n;if(!i||!Km.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 PO(e,t){const n=RO(e),{vBoxMaxWidth:i,hBoxMaxHeight:r}=t;let s,a,l;for(s=0,a=e.length;s<a;++s){l=e[s];const{fullSize:u}=l.box,d=n[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 n}function IO(e){const t=EO(e),n=ao(t.filter(d=>d.box.fullSize),!0),i=ao(oo(t,"left"),!0),r=ao(oo(t,"right")),s=ao(oo(t,"top"),!0),a=ao(oo(t,"bottom")),l=Xm(t,"x"),u=Xm(t,"y");return{fullSize:n,leftAndTop:i.concat(s),rightAndBottom:r.concat(u).concat(a).concat(l),chartArea:oo(t,"chartArea"),vertical:i.concat(r).concat(u),horizontal:s.concat(a).concat(l)}}function Zm(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function Qm(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function LO(e,t,n,i){const{pos:r,box:s}=n,a=e.maxPadding;if(!Lt(r)){n.size&&(e[r]-=n.size);const m=i[n.stack]||{size:0,count:1};m.size=Math.max(m.size,n.horizontal?s.height:s.width),n.size=m.size/m.count,e[r]+=n.size}s.getPadding&&Qm(a,s.getPadding());const l=Math.max(0,t.outerWidth-Zm(a,e,"left","right")),u=Math.max(0,t.outerHeight-Zm(a,e,"top","bottom")),d=l!==e.w,h=u!==e.h;return e.w=l,e.h=u,n.horizontal?{same:d,other:h}:{same:h,other:d}}function NO(e){const t=e.maxPadding;function n(i){const r=Math.max(t[i]-e[i],0);return e[i]+=r,r}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function BO(e,t){const n=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],n[a])}),s}return i(e?["left","right"]:["top","bottom"])}function lo(e,t,n,i){const r=[];let s,a,l,u,d,h;for(s=0,a=e.length,d=0;s<a;++s){l=e[s],u=l.box,u.update(l.width||t.w,l.height||t.h,BO(l.horizontal,t));const{same:m,other:g}=LO(t,n,l,i);d|=m&&r.length,h=h||g,u.fullSize||r.push(l)}return d&&lo(r,t,n,i)||h}function Ba(e,t,n,i,r){e.top=n,e.left=t,e.right=t+i,e.bottom=n+r,e.width=i,e.height=r}function Jm(e,t,n,i){const r=n.padding;let{x:s,y:a}=t;for(const l of e){const u=l.box,d=i[l.stack]||{placed:0,weight:1},h=l.stackWeight/d.weight||1;if(l.horizontal){const m=t.w*h,g=d.size||u.height;rn(d.start)&&(a=d.start),u.fullSize?Ba(u,r.left,a,n.outerWidth-r.right-r.left,g):Ba(u,t.left+d.placed,a,m,g),d.start=a,d.placed+=m,a=u.bottom}else{const m=t.h*h,g=d.size||u.width;rn(d.start)&&(s=d.start),u.fullSize?Ba(u,s,r.top,g,n.outerHeight-r.bottom-r.top):Ba(u,s,t.top+d.placed,g,m),d.start=s,d.placed+=m,s=u.right}}t.x=s,t.y=a}var Ve={addBox(e,t){e.boxes||(e.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(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,i){if(!e)return;const r=Se(e.options.layout.padding),s=Math.max(t-r.width,0),a=Math.max(n-r.height,0),l=IO(e.boxes),u=l.vertical,d=l.horizontal;te(e.boxes,v=>{typeof v.beforeLayout=="function"&&v.beforeLayout()});const h=u.reduce((v,S)=>S.box.options&&S.box.options.display===!1?v:v+1,0)||1,m=Object.freeze({outerWidth:t,outerHeight:n,padding:r,availableWidth:s,availableHeight:a,vBoxMaxWidth:s/2/h,hBoxMaxHeight:a/2}),g=Object.assign({},r);Qm(g,Se(i));const _=Object.assign({maxPadding:g,w:s,h:a,x:r.left,y:r.top},r),x=PO(u.concat(d),m);lo(l.fullSize,_,m,x),lo(u,_,m,x),lo(d,_,m,x)&&lo(u,_,m,x),NO(_),Jm(l.leftAndTop,_,m,x),_.x+=_.w,_.y+=_.h,Jm(l.rightAndBottom,_,m,x),e.chartArea={left:_.left,top:_.top,right:_.left+_.w,bottom:_.top+_.h,height:_.h,width:_.w},te(l.chartArea,v=>{const S=v.box;Object.assign(S,e.chartArea),S.update(_.w,_.h,{left:0,top:0,right:0,bottom:0})})}};class tg{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,r){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,r?Math.floor(n/r):i)}}isAttached(t){return!0}updateConfig(t){}}class FO extends tg{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Fa="$chartjs",zO={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},eg=e=>e===null||e==="";function UO(e,t){const n=e.style,i=e.getAttribute("height"),r=e.getAttribute("width");if(e[Fa]={initial:{height:i,width:r,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",eg(r)){const s=vm(e,"width");s!==void 0&&(e.width=s)}if(eg(i))if(e.style.height==="")e.height=e.width/(t||2);else{const s=vm(e,"height");s!==void 0&&(e.height=s)}return e}const ng=UC?{passive:!0}:!1;function HO(e,t,n){e&&e.addEventListener(t,n,ng)}function WO(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,ng)}function $O(e,t){const n=zO[e.type]||e.type,{x:i,y:r}=Pi(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:r!==void 0?r:null}}function za(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function VO(e,t,n){const i=e.canvas,r=new MutationObserver(s=>{let a=!1;for(const l of s)a=a||za(l.addedNodes,i),a=a&&!za(l.removedNodes,i);a&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}function YO(e,t,n){const i=e.canvas,r=new MutationObserver(s=>{let a=!1;for(const l of s)a=a||za(l.removedNodes,i),a=a&&!za(l.addedNodes,i);a&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}const co=new Map;let ig=0;function rg(){const e=window.devicePixelRatio;e!==ig&&(ig=e,co.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function qO(e,t){co.size||window.addEventListener("resize",rg),co.set(e,t)}function jO(e){co.delete(e),co.size||window.removeEventListener("resize",rg)}function GO(e,t,n){const i=e.canvas,r=i&&mu(i);if(!r)return;const s=im((l,u)=>{const d=r.clientWidth;n(l,u),d<r.clientWidth&&n()},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),qO(e,s),a}function ku(e,t,n){n&&n.disconnect(),t==="resize"&&jO(e)}function KO(e,t,n){const i=e.canvas,r=im(s=>{e.ctx!==null&&n($O(s,e))},e);return HO(i,t,r),r}class XO extends tg{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(UO(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[Fa])return!1;const i=n[Fa].initial;["height","width"].forEach(s=>{const a=i[s];Tt(a)?n.removeAttribute(s):n.setAttribute(s,a)});const r=i.style||{};return Object.keys(r).forEach(s=>{n.style[s]=r[s]}),n.width=n.width,delete n[Fa],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const r=t.$proxies||(t.$proxies={}),a={attach:VO,detach:YO,resize:GO}[n]||KO;r[n]=a(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),r=i[n];if(!r)return;({attach:ku,detach:ku,resize:ku}[n]||WO)(t,n,r),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,r){return zC(t,n,i,r)}isAttached(t){const n=t&&mu(t);return!!(n&&n.isConnected)}}function ZO(e){return!pu()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?FO:XO}class Ye{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return Ai(this.x)&&Ai(this.y)}getProps(t,n){const i=this.$animations;if(!n||!i)return this;const r={};return t.forEach(s=>{r[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),r}}function QO(e,t){const n=e.options.ticks,i=JO(e),r=Math.min(n.maxTicksLimit||i,i),s=n.major.enabled?eA(t):[],a=s.length,l=s[0],u=s[a-1],d=[];if(a>r)return nA(t,d,s,a/r),d;const h=tA(s,t,r);if(a>0){let m,g;const _=a>1?Math.round((u-l)/(a-1)):null;for(Ua(t,d,h,Tt(_)?0:l-_,l),m=0,g=a-1;m<g;m++)Ua(t,d,h,s[m],s[m+1]);return Ua(t,d,h,u,Tt(_)?t.length:u+_),d}return Ua(t,d,h),d}function JO(e){const t=e.options.offset,n=e._tickSize(),i=e._length/n+(t?0:1),r=e._maxLength/n;return Math.floor(Math.min(i,r))}function tA(e,t,n){const i=iA(e),r=t.length/n;if(!i)return Math.max(r,1);const s=WD(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 eA(e){const t=[];let n,i;for(n=0,i=e.length;n<i;n++)e[n].major&&t.push(n);return t}function nA(e,t,n,i){let r=0,s=n[0],a;for(i=Math.ceil(i),a=0;a<e.length;a++)a===s&&(t.push(e[a]),r++,s=n[r*i])}function Ua(e,t,n,i,r){const s=Ct(i,0),a=Math.min(Ct(r,e.length),e.length);let l=0,u,d,h;for(n=Math.ceil(n),r&&(u=r-i,n=u/Math.floor(u/n)),h=s;h<0;)l++,h=Math.round(s+l*n);for(d=Math.max(s,0);d<a;d++)d===h&&(t.push(e[d]),l++,h=Math.round(s+l*n))}function iA(e){const t=e.length;let n,i;if(t<2)return!1;for(i=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==i)return!1;return i}const rA=e=>e==="left"?"right":e==="right"?"left":e,sg=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,og=(e,t)=>Math.min(t||e,e);function ag(e,t){const n=[],i=e.length/t,r=e.length;let s=0;for(;s<r;s+=i)n.push(e[Math.floor(s)]);return n}function sA(e,t,n){const i=e.ticks.length,r=Math.min(t,i-1),s=e._startPixel,a=e._endPixel,l=1e-6;let u=e.getPixelForTick(r),d;if(!(n&&(i===1?d=Math.max(u-s,a-u):t===0?d=(e.getPixelForTick(1)-u)/2:d=(u-e.getPixelForTick(r-1))/2,u+=r<t?d:-d,u<s-l||u>a+l)))return u}function oA(e,t){te(e,n=>{const i=n.gc,r=i.length/2;let s;if(r>t){for(s=0;s<r;++s)delete n.data[i[s]];i.splice(0,r)}})}function uo(e){return e.drawTicks?e.tickLength:0}function lg(e,t){if(!e.display)return 0;const n=ce(e.font,t),i=Se(e.padding);return(Gt(e.text)?e.text.length:1)*n.lineHeight+i.height}function aA(e,t){return Ri(e,{scale:t,type:"scale"})}function lA(e,t,n){return Ri(e,{tick:n,index:t,type:"tick"})}function cA(e,t,n){let i=ru(e);return(n&&t!=="right"||!n&&t==="right")&&(i=rA(i)),i}function uA(e,t,n,i){const{top:r,left:s,bottom:a,right:l,chart:u}=e,{chartArea:d,scales:h}=u;let m=0,g,_,x;const v=a-r,S=l-s;if(e.isHorizontal()){if(_=$e(i,s,l),Lt(n)){const C=Object.keys(n)[0],A=n[C];x=h[C].getPixelForValue(A)+v-t}else n==="center"?x=(d.bottom+d.top)/2+v-t:x=sg(e,n,t);g=l-s}else{if(Lt(n)){const C=Object.keys(n)[0],A=n[C];_=h[C].getPixelForValue(A)-S+t}else n==="center"?_=(d.left+d.right)/2-S+t:_=sg(e,n,t);x=$e(i,a,r),m=n==="left"?-se:se}return{titleX:_,titleY:x,maxWidth:g,rotation:m}}class pr extends Ye{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,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:i,_suggestedMax:r}=this;return t=mn(t,Number.POSITIVE_INFINITY),n=mn(n,Number.NEGATIVE_INFINITY),i=mn(i,Number.POSITIVE_INFINITY),r=mn(r,Number.NEGATIVE_INFINITY),{min:mn(t,i),max:mn(n,r),minDefined:le(t),maxDefined:le(n)}}getMinMax(t){let{min:n,max:i,minDefined:r,maxDefined:s}=this.getUserBounds(),a;if(r&&s)return{min:n,max:i};const l=this.getMatchingVisibleMetas();for(let u=0,d=l.length;u<d;++u)a=l[u].controller.getMinMax(this,t),r||(n=Math.min(n,a.min)),s||(i=Math.max(i,a.max));return n=s&&n>i?i:n,i=r&&n>i?n:i,{min:mn(n,mn(i,n)),max:mn(i,mn(n,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(){Jt(this.options.beforeUpdate,[this])}update(t,n,i){const{beginAtZero:r,grace:s,ticks:a}=this.options,l=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,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=yC(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const u=l<this.ticks.length;this._convertTicksToLabels(u?ag(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=QO(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,n,i;this.isHorizontal()?(n=this.left,i=this.right):(n=this.top,i=this.bottom,t=!t),this._startPixel=n,this._endPixel=i,this._reversePixels=t,this._length=i-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Jt(this.options.afterUpdate,[this])}beforeSetDimensions(){Jt(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(){Jt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Jt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Jt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let i,r,s;for(i=0,r=t.length;i<r;i++)s=t[i],s.label=Jt(n.callback,[s.value,i,t],this)}afterTickToLabelConversion(){Jt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Jt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,i=og(this.ticks.length,t.ticks.maxTicksLimit),r=n.minRotation||0,s=n.maxRotation;let a=r,l,u,d;if(!this._isVisible()||!n.display||r>=s||i<=1||!this.isHorizontal()){this.labelRotation=r;return}const h=this._getLabelSizes(),m=h.widest.width,g=h.highest.height,_=Re(this.chart.width-m,0,this.maxWidth);l=t.offset?this.maxWidth/i:_/(i-1),m+6>l&&(l=_/(i-(t.offset?.5:1)),u=this.maxHeight-uo(t.grid)-n.padding-lg(t.title,this.chart.options.font),d=Math.sqrt(m*m+g*g),a=Da(Math.min(Math.asin(Re((h.highest.height+6)/l,-1,1)),Math.asin(Re(u/d,-1,1))-Math.asin(Re(g/d,-1,1)))),a=Math.max(r,Math.min(s,a))),this.labelRotation=a}afterCalculateLabelRotation(){Jt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Jt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:r,grid:s}}=this,a=this._isVisible(),l=this.isHorizontal();if(a){const u=lg(r,n.options.font);if(l?(t.width=this.maxWidth,t.height=uo(s)+u):(t.height=this.maxHeight,t.width=uo(s)+u),i.display&&this.ticks.length){const{first:d,last:h,widest:m,highest:g}=this._getLabelSizes(),_=i.padding*2,x=ve(this.labelRotation),v=Math.cos(x),S=Math.sin(x);if(l){const C=i.mirror?0:S*m.width+v*g.height;t.height=Math.min(this.maxHeight,t.height+C+_)}else{const C=i.mirror?0:v*m.width+S*g.height;t.width=Math.min(this.maxWidth,t.width+C+_)}this._calculatePadding(d,h,S,v)}}this._handleMargins(),l?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,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,m=this.right-this.getPixelForTick(this.ticks.length-1);let g=0,_=0;u?d?(g=r*t.width,_=i*n.height):(g=i*t.height,_=r*n.width):s==="start"?_=n.width:s==="end"?g=t.width:s!=="inner"&&(g=t.width/2,_=n.width/2),this.paddingLeft=Math.max((g-h+a)*this.width/(this.width-h),0),this.paddingRight=Math.max((_-m+a)*this.width/(this.width-m),0)}else{let h=n.height/2,m=t.height/2;s==="start"?(h=0,m=t.height):s==="end"&&(h=n.height,m=0),this.paddingTop=h+a,this.paddingBottom=m+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(){Jt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,i;for(n=0,i=t.length;n<i;n++)Tt(t[n].label)&&(t.splice(n,1),i--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let i=this.ticks;n<i.length&&(i=ag(i,n)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,i){const{ctx:r,_longestTextCache:s}=this,a=[],l=[],u=Math.floor(n/og(n,i));let d=0,h=0,m,g,_,x,v,S,C,A,F,P,B;for(m=0;m<n;m+=u){if(x=t[m].label,v=this._resolveTickFontOptions(m),r.font=S=v.string,C=s[S]=s[S]||{data:{},gc:[]},A=v.lineHeight,F=P=0,!Tt(x)&&!Gt(x))F=Ra(r,C.data,C.gc,F,x),P=A;else if(Gt(x))for(g=0,_=x.length;g<_;++g)B=x[g],!Tt(B)&&!Gt(B)&&(F=Ra(r,C.data,C.gc,F,B),P+=A);a.push(F),l.push(P),d=Math.max(F,d),h=Math.max(P,h)}oA(s,n);const N=a.indexOf(d),z=l.indexOf(h),k=w=>({width:a[w]||0,height:l[w]||0});return{first:k(0),last:k(n-1),widest:k(N),highest:k(z),widths:a,heights:l}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return qD(this._alignToPixels?cr(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const i=n[t];return i.$context||(i.$context=lA(this.getContext(),t,i))}return this.$context||(this.$context=aA(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=ve(this.labelRotation),i=Math.abs(Math.cos(n)),r=Math.abs(Math.sin(n)),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 n=this.axis,i=this.chart,r=this.options,{grid:s,position:a,border:l}=r,u=s.offset,d=this.isHorizontal(),m=this.ticks.length+(u?1:0),g=uo(s),_=[],x=l.setContext(this.getContext()),v=x.display?x.width:0,S=v/2,C=function(ht){return cr(i,ht,v)};let A,F,P,B,N,z,k,w,O,L,$,q;if(a==="top")A=C(this.bottom),z=this.bottom-g,w=A-S,L=C(t.top)+S,q=t.bottom;else if(a==="bottom")A=C(this.top),L=t.top,q=C(t.bottom)-S,z=A+S,w=this.top+g;else if(a==="left")A=C(this.right),N=this.right-g,k=A-S,O=C(t.left)+S,$=t.right;else if(a==="right")A=C(this.left),O=t.left,$=C(t.right)-S,N=A+S,k=this.left+g;else if(n==="x"){if(a==="center")A=C((t.top+t.bottom)/2+.5);else if(Lt(a)){const ht=Object.keys(a)[0],ut=a[ht];A=C(this.chart.scales[ht].getPixelForValue(ut))}L=t.top,q=t.bottom,z=A+S,w=z+g}else if(n==="y"){if(a==="center")A=C((t.left+t.right)/2);else if(Lt(a)){const ht=Object.keys(a)[0],ut=a[ht];A=C(this.chart.scales[ht].getPixelForValue(ut))}N=A-S,k=N-g,O=t.left,$=t.right}const st=Ct(r.ticks.maxTicksLimit,m),ct=Math.max(1,Math.ceil(m/st));for(F=0;F<m;F+=ct){const ht=this.getContext(F),ut=s.setContext(ht),vt=l.setContext(ht),at=ut.lineWidth,dt=ut.color,V=vt.dash||[],I=vt.dashOffset,W=ut.tickWidth,nt=ut.tickColor,ot=ut.tickBorderDash||[],X=ut.tickBorderDashOffset;P=sA(this,F,u),P!==void 0&&(B=cr(i,P,at),d?N=k=O=$=B:z=w=L=q=B,_.push({tx1:N,ty1:z,tx2:k,ty2:w,x1:O,y1:L,x2:$,y2:q,width:at,color:dt,borderDash:V,borderDashOffset:I,tickWidth:W,tickColor:nt,tickBorderDash:ot,tickBorderDashOffset:X}))}return this._ticksLength=m,this._borderValue=A,_}_computeLabelItems(t){const n=this.axis,i=this.options,{position:r,ticks:s}=i,a=this.isHorizontal(),l=this.ticks,{align:u,crossAlign:d,padding:h,mirror:m}=s,g=uo(i.grid),_=g+h,x=m?-h:_,v=-ve(this.labelRotation),S=[];let C,A,F,P,B,N,z,k,w,O,L,$,q="middle";if(r==="top")N=this.bottom-x,z=this._getXAxisLabelAlignment();else if(r==="bottom")N=this.top+x,z=this._getXAxisLabelAlignment();else if(r==="left"){const ct=this._getYAxisLabelAlignment(g);z=ct.textAlign,B=ct.x}else if(r==="right"){const ct=this._getYAxisLabelAlignment(g);z=ct.textAlign,B=ct.x}else if(n==="x"){if(r==="center")N=(t.top+t.bottom)/2+_;else if(Lt(r)){const ct=Object.keys(r)[0],ht=r[ct];N=this.chart.scales[ct].getPixelForValue(ht)+_}z=this._getXAxisLabelAlignment()}else if(n==="y"){if(r==="center")B=(t.left+t.right)/2-_;else if(Lt(r)){const ct=Object.keys(r)[0],ht=r[ct];B=this.chart.scales[ct].getPixelForValue(ht)}z=this._getYAxisLabelAlignment(g).textAlign}n==="y"&&(u==="start"?q="top":u==="end"&&(q="bottom"));const st=this._getLabelSizes();for(C=0,A=l.length;C<A;++C){F=l[C],P=F.label;const ct=s.setContext(this.getContext(C));k=this.getPixelForTick(C)+s.labelOffset,w=this._resolveTickFontOptions(C),O=w.lineHeight,L=Gt(P)?P.length:1;const ht=L/2,ut=ct.color,vt=ct.textStrokeColor,at=ct.textStrokeWidth;let dt=z;a?(B=k,z==="inner"&&(C===A-1?dt=this.options.reverse?"left":"right":C===0?dt=this.options.reverse?"right":"left":dt="center"),r==="top"?d==="near"||v!==0?$=-L*O+O/2:d==="center"?$=-st.highest.height/2-ht*O+O:$=-st.highest.height+O/2:d==="near"||v!==0?$=O/2:d==="center"?$=st.highest.height/2-ht*O:$=st.highest.height-L*O,m&&($*=-1),v!==0&&!ct.showLabelBackdrop&&(B+=O/2*Math.sin(v))):(N=k,$=(1-L)*O/2);let V;if(ct.showLabelBackdrop){const I=Se(ct.backdropPadding),W=st.heights[C],nt=st.widths[C];let ot=$-I.top,X=0-I.left;switch(q){case"middle":ot-=W/2;break;case"bottom":ot-=W;break}switch(z){case"center":X-=nt/2;break;case"right":X-=nt;break;case"inner":C===A-1?X-=nt:C>0&&(X-=nt/2);break}V={left:X,top:ot,width:nt+I.width,height:W+I.height,color:ct.backdropColor}}S.push({label:P,font:w,textOffset:$,options:{rotation:v,color:ut,strokeColor:vt,strokeWidth:at,textAlign:dt,textBaseline:q,translation:[B,N],backdrop:V}})}return S}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-ve(this.labelRotation))return t==="top"?"left":"right";let r="center";return n.align==="start"?r="left":n.align==="end"?r="right":n.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:i,mirror:r,padding:s}}=this.options,a=this._getLabelSizes(),l=t+s,u=a.widest.width;let d,h;return n==="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)):n==="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,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:i,top:r,width:s,height:a}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(i,r,s,a),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const r=this.ticks.findIndex(s=>s.value===t);return r>=0?n.setContext(this.getContext(r)).lineWidth:0}drawGrid(t){const n=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(n.display)for(s=0,a=r.length;s<a;++s){const u=r[s];n.drawOnChartArea&&l({x:u.x1,y:u.y1},{x:u.x2,y:u.y2},u),n.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:n,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,m,g;this.isHorizontal()?(d=cr(t,this.left,a)-a/2,h=cr(t,this.right,l)+l/2,m=g=u):(m=cr(t,this.top,a)-a/2,g=cr(t,this.bottom,l)+l/2,d=h=u),n.save(),n.lineWidth=s.width,n.strokeStyle=s.color,n.beginPath(),n.moveTo(d,m),n.lineTo(h,g),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,r=this._computeLabelArea();r&&to(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;ur(i,d,0,h,u,l)}r&&eo(i)}drawTitle(){const{ctx:t,options:{position:n,title:i,reverse:r}}=this;if(!i.display)return;const s=ce(i.font),a=Se(i.padding),l=i.align;let u=s.lineHeight/2;n==="bottom"||n==="center"||Lt(n)?(u+=a.bottom,Gt(i.text)&&(u+=s.lineHeight*(i.text.length-1))):u+=a.top;const{titleX:d,titleY:h,maxWidth:m,rotation:g}=uA(this,u,n,l);ur(t,i.text,0,0,s,{color:i.color,maxWidth:m,rotation:g,textAlign:cA(l,n,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,n=t.ticks&&t.ticks.z||0,i=Ct(t.grid&&t.grid.z,-1),r=Ct(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==pr.prototype.draw?[{z:n,draw:s=>{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",r=[];let s,a;for(s=0,a=n.length;s<a;++s){const l=n[s];l[i]===this.id&&(!t||l.type===t)&&r.push(l)}return r}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return ce(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ha{constructor(t,n,i){this.type=t,this.scope=n,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let i;hA(n)&&(i=this.register(n));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,dA(t,a,i),this.override&&oe.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const n=this.items,i=t.id,r=this.scope;i in n&&delete n[i],r&&i in oe[r]&&(delete oe[r][i],this.override&&delete lr[i])}}function dA(e,t,n){const i=js(Object.create(null),[n?oe.get(n):{},oe.get(t),e.defaults]);oe.set(t,i),e.defaultRoutes&&fA(t,e.defaultRoutes),e.descriptors&&oe.describe(t,e.descriptors)}function fA(e,t){Object.keys(t).forEach(n=>{const i=n.split("."),r=i.pop(),s=[e].concat(i).join("."),a=t[n].split("."),l=a.pop(),u=a.join(".");oe.route(s,r,u,l)})}function hA(e){return"id"in e&&"defaults"in e}class pA{constructor(){this.controllers=new Ha(Li,"datasets",!0),this.elements=new Ha(Ye,"elements"),this.plugins=new Ha(Object,"plugins"),this.scales=new Ha(pr,"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,n,i){[...n].forEach(r=>{const s=i||this._getRegistryForType(r);i||s.isForType(r)||s===this.plugins&&r.id?this._exec(t,s,r):te(r,a=>{const l=i||this._getRegistryForType(a);this._exec(t,l,a)})})}_exec(t,n,i){const r=eu(t);Jt(i["before"+r],[],i),n[t](i),Jt(i["after"+r],[],i)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const i=this._typedRegistries[n];if(i.isForType(t))return i}return this.plugins}_get(t,n,i){const r=n.get(t);if(r===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return r}}var Gn=new pA;class mA{constructor(){this._init=void 0}notify(t,n,i,r){if(n==="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,n,i);return n==="afterDestroy"&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),a}_notify(t,n,i,r){r=r||{};for(const s of t){const a=s.plugin,l=a[i],u=[n,r,s.options];if(Jt(l,u,a)===!1&&r.cancelable)return!1}return!0}invalidate(){Tt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const i=t&&t.config,r=Ct(i.options&&i.options.plugins,{}),s=gA(i);return r===!1&&!n?[]:_A(t,s,r,n)}_notifyStateChanges(t){const n=this._oldCache||[],i=this._cache,r=(s,a)=>s.filter(l=>!a.some(u=>l.plugin.id===u.plugin.id));this._notify(r(n,i),t,"stop"),this._notify(r(i,n),t,"start")}}function gA(e){const t={},n=[],i=Object.keys(Gn.plugins.items);for(let s=0;s<i.length;s++)n.push(Gn.getPlugin(i[s]));const r=e.plugins||[];for(let s=0;s<r.length;s++){const a=r[s];n.indexOf(a)===-1&&(n.push(a),t[a.id]=!0)}return{plugins:n,localIds:t}}function yA(e,t){return!t&&e===!1?null:e===!0?{}:e}function _A(e,{plugins:t,localIds:n},i,r){const s=[],a=e.getContext();for(const l of t){const u=l.id,d=yA(i[u],r);d!==null&&s.push({plugin:l,options:bA(e.config,{plugin:l,local:n[u]},d,a)})}return s}function bA(e,{plugin:t,local:n},i,r){const s=e.pluginScopeKeys(t),a=e.getOptionScopes(i,s);return n&&t.defaults&&a.push(t.defaults),e.createResolver(a,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Mu(e,t){const n=oe.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function xA(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function wA(e,t){return e===t?"_index_":"_value_"}function cg(e){if(e==="x"||e==="y"||e==="r")return e}function vA(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Du(e,...t){if(cg(e))return e;for(const n of t){const i=n.axis||vA(n.position)||e.length>1&&cg(e[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function ug(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function SA(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return ug(e,"x",n[0])||ug(e,"y",n[0])}return{}}function TA(e,t){const n=lr[e.type]||{scales:{}},i=t.scales||{},r=Mu(e.type,t),s=Object.create(null);return Object.keys(i).forEach(a=>{const l=i[a];if(!Lt(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=Du(a,l,SA(a,e),oe.scales[l.type]),d=wA(u,r),h=n.scales||{};s[a]=Gs(Object.create(null),[{axis:u},l,h[u],h[d]])}),e.data.datasets.forEach(a=>{const l=a.type||e.type,u=a.indexAxis||Mu(l,t),h=(lr[l]||{}).scales||{};Object.keys(h).forEach(m=>{const g=xA(m,u),_=a[g+"AxisID"]||g;s[_]=s[_]||Object.create(null),Gs(s[_],[{axis:g},i[_],h[m]])})}),Object.keys(s).forEach(a=>{const l=s[a];Gs(l,[oe.scales[l.type],oe.scale])}),s}function dg(e){const t=e.options||(e.options={});t.plugins=Ct(t.plugins,{}),t.scales=TA(e,t)}function fg(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function kA(e){return e=e||{},e.data=fg(e.data),dg(e),e}const hg=new Map,pg=new Set;function Wa(e,t){let n=hg.get(e);return n||(n=t(),hg.set(e,n),pg.add(n)),n}const fo=(e,t,n)=>{const i=Ci(t,n);i!==void 0&&e.add(i)};class MA{constructor(t){this._config=kA(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=fg(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(),dg(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Wa(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Wa(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Wa(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return Wa(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let r=i.get(t);return(!r||n)&&(r=new Map,i.set(t,r)),r}getOptionScopes(t,n,i){const{options:r,type:s}=this,a=this._cachedScopes(t,i),l=a.get(n);if(l)return l;const u=new Set;n.forEach(h=>{t&&(u.add(t),h.forEach(m=>fo(u,t,m))),h.forEach(m=>fo(u,r,m)),h.forEach(m=>fo(u,lr[s]||{},m)),h.forEach(m=>fo(u,oe,m)),h.forEach(m=>fo(u,au,m))});const d=Array.from(u);return d.length===0&&d.push(Object.create(null)),pg.has(n)&&a.set(n,d),d}chartOptionScopes(){const{options:t,type:n}=this;return[t,lr[n]||{},oe.datasets[n]||{},{type:n},oe,au]}resolveNamedOptions(t,n,i,r=[""]){const s={$shared:!0},{resolver:a,subPrefixes:l}=mg(this._resolverCache,t,r);let u=a;if(CA(a,n)){s.$shared=!1,i=sn(i)?i():i;const d=this.createResolver(t,i,l);u=jr(a,i,d)}for(const d of n)s[d]=u[d];return s}createResolver(t,n,i=[""],r){const{resolver:s}=mg(this._resolverCache,t,i);return Lt(n)?jr(s,n,void 0,r):s}}function mg(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const r=n.join();let s=i.get(r);return s||(s={resolver:du(t,n),subPrefixes:n.filter(l=>!l.toLowerCase().includes("hover"))},i.set(r,s)),s}const DA=e=>Lt(e)&&Object.getOwnPropertyNames(e).some(t=>sn(e[t]));function CA(e,t){const{isScriptable:n,isIndexable:i}=hm(e);for(const r of t){const s=n(r),a=i(r),l=(a||s)&&e[r];if(s&&(sn(l)||DA(l))||a&&Gt(l))return!0}return!1}var OA="4.5.1";const AA=["top","bottom","left","right","chartArea"];function gg(e,t){return e==="top"||e==="bottom"||AA.indexOf(e)===-1&&t==="x"}function yg(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function _g(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Jt(n&&n.onComplete,[e],t)}function EA(e){const t=e.chart,n=t.options.animation;Jt(n&&n.onProgress,[e],t)}function bg(e){return pu()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const $a={},xg=e=>{const t=bg(e);return Object.values($a).filter(n=>n.canvas===t).pop()};function RA(e,t,n){const i=Object.keys(e);for(const r of i){const s=+r;if(s>=t){const a=e[r];delete e[r],(n>0||s>t)&&(e[s+n]=a)}}}function PA(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}let on=class{static defaults=oe;static instances=$a;static overrides=lr;static registry=Gn;static version=OA;static getChart=xg;static register(...t){Gn.add(...t),wg()}static unregister(...t){Gn.remove(...t),wg()}constructor(t,n){const i=this.config=new MA(n),r=bg(t),s=xg(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||ZO(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=ID(),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 mA,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=XD(m=>this.update(m),a.resizeDelay||0),this._dataChanges=[],$a[this.id]=this,!l||!u){console.error("Failed to create chart: can't acquire context from the given item");return}li.listen(this,"complete",_g),li.listen(this,"progress",EA),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:r,_aspectRatio:s}=this;return Tt(t)?n&&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 Gn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():wm(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return um(this.canvas,this.ctx),this}stop(){return li.stop(this),this}resize(t,n){li.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,r=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,t,n,s),l=i.devicePixelRatio||this.platform.getDevicePixelRatio(),u=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,wm(this,l,!0)&&(this.notifyPlugins("resize",{size:a}),Jt(i.onResize,[this,a],this),this.attached&&this._doResize(u)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};te(n,(i,r)=>{i.id=r})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,r=Object.keys(i).reduce((a,l)=>(a[l]=!1,a),{});let s=[];n&&(s=s.concat(Object.keys(n).map(a=>{const l=n[a],u=Du(a,l),d=u==="r",h=u==="x";return{options:l,dposition:d?"chartArea":h?"bottom":"left",dtype:d?"radialLinear":h?"category":"linear"}}))),te(s,a=>{const l=a.options,u=l.id,d=Du(u,l),h=Ct(l.type,a.dtype);(l.position===void 0||gg(l.position,d)!==gg(a.dposition))&&(l.position=a.dposition),r[u]=!0;let m=null;if(u in i&&i[u].type===h)m=i[u];else{const g=Gn.getScale(h);m=new g({id:u,type:h,ctx:this.ctx,chart:this}),i[m.id]=m}m.init(l,t)}),te(r,(a,l)=>{a||delete i[l]}),te(i,a=>{Ve.configure(this,a,a.options),Ve.addBox(this,a)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((r,s)=>r.index-s.index),i>n){for(let r=n;r<i;++r)this._destroyDatasetMeta(r);t.splice(n,i-n)}this._sortedMetasets=t.slice(0).sort(yg("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((i,r)=>{n.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,r;for(this._removeUnreferencedMetasets(),i=0,r=n.length;i<r;i++){const s=n[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||Mu(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=Gn.getController(l),{datasetElementType:d,dataElementType:h}=oe.datasets[l];Object.assign(u,{dataElementType:Gn.getElement(h),datasetElementType:d&&Gn.getElement(d)}),a.controller=new u(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){te(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const i=this._options=n.createResolver(n.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:m}=this.getDatasetMeta(d),g=!r&&s.indexOf(m)===-1;m.buildOrUpdateElements(g),a=Math.max(+m.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),r||te(s,d=>{d.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(yg("z","_idx"));const{_active:l,_lastEvent:u}=this;u?this._eventHandler(u,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){te(this.scales,t=>{Ve.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Kp(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:r,count:s}of n){const a=i==="_removeElements"?-s:s;RA(t,r,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=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<n;s++)if(!Kp(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;Ve.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],te(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 n=0,i=this.data.datasets.length;n<i;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,i=this.data.datasets.length;n<i;++n)this._updateDataset(n,sn(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const i=this.getDatasetMeta(t),r={meta:i,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(i.controller._update(n),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(li.has(this)?this.attached&&!li.running(this)&&li.start(this):(this.draw(),_g({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 n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,i=[];let r,s;for(r=0,s=n.length;r<s;++r){const a=n[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 n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i={meta:t,index:t.index,cancelable:!0},r=Em(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(r&&to(n,r),t.controller.draw(),r&&eo(n),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return ai(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,r){const s=Tu.modes[n];return typeof s=="function"?s(this,t,i,r):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let r=i.filter(s=>s&&s._dataset===n).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},i.push(r)),r}getContext(){return this.$context||(this.$context=Ri(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){const r=i?"show":"hide",s=this.getDatasetMeta(t),a=s.controller._resolveAnimations(void 0,r);rn(n)?(s.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(s,{visible:i}),this.update(l=>l.datasetIndex===t?r:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),li.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),um(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete $a[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,n=this.platform,i=(s,a)=>{n.addEventListener(this,s,a),t[s]=a},r=(s,a,l)=>{s.offsetX=a,s.offsetY=l,this._eventHandler(s)};te(this.options.events,s=>i(s,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(u,d)=>{n.addEventListener(this,u,d),t[u]=d},r=(u,d)=>{t[u]&&(n.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)},n.isAttached(this.canvas)?l():a()}unbindEvents(){te(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},te(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const r=i?"set":"remove";let s,a,l,u;for(n==="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 n=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}});!Sa(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,i){const r=this.options.hover,s=(u,d)=>u.filter(h=>!d.some(m=>h.datasetIndex===m.datasetIndex&&h.index===m.index)),a=s(n,t),l=i?t:s(t,n);a.length&&this.updateHoverStyle(a,r.mode,!1),l.length&&r.mode&&this.updateHoverStyle(l,r.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,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,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,r),(s||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:r=[],options:s}=this,a=n,l=this._getActiveElements(t,r,i,a),u=UD(t),d=PA(t,this._lastEvent,i,u);i&&(this._lastEvent=null,Jt(s.onHover,[t,l,this],this),u&&Jt(s.onClick,[t,l,this],this));const h=!Sa(l,r);return(h||n)&&(this._active=l,this._updateHoverStyles(l,r,n)),this._lastEvent=d,h}_getActiveElements(t,n,i,r){if(t.type==="mouseout")return[];if(!i)return n;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,r)}};function wg(){return te(on.instances,e=>e._plugins.invalidate())}function IA(e,t,n){const{startAngle:i,x:r,y:s,outerRadius:a,innerRadius:l,options:u}=t,{borderWidth:d,borderJoinStyle:h}=u,m=Math.min(d/a,We(i-n));if(e.beginPath(),e.arc(r,s,a-d/2,i+m/2,n-m/2),l>0){const g=Math.min(d/l,We(i-n));e.arc(r,s,l+d/2,n-g/2,i+g/2,!0)}else{const g=Math.min(d/2,a*We(i-n));if(h==="round")e.arc(r,s,g,n-Rt/2,i+Rt/2,!0);else if(h==="bevel"){const _=2*g*g,x=-_*Math.cos(n+Rt/2)+r,v=-_*Math.sin(n+Rt/2)+s,S=_*Math.cos(i+Rt/2)+r,C=_*Math.sin(i+Rt/2)+s;e.lineTo(x,v),e.lineTo(S,C)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function LA(e,t,n){const{startAngle:i,pixelMargin:r,x:s,y:a,outerRadius:l,innerRadius:u}=t;let d=r/l;e.beginPath(),e.arc(s,a,l,i-d,n+d),u>r?(d=r/u,e.arc(s,a,u,n+d,i-d,!0)):e.arc(s,a,r,n+se,i-se),e.closePath(),e.clip()}function NA(e){return uu(e,["outerStart","outerEnd","innerStart","innerEnd"])}function BA(e,t,n,i){const r=NA(e.options.borderRadius),s=(n-t)/2,a=Math.min(s,i*t/2),l=u=>{const d=(n-Math.min(s,u))*i/2;return Re(u,0,Math.min(s,d))};return{outerStart:l(r.outerStart),outerEnd:l(r.outerEnd),innerStart:Re(r.innerStart,0,a),innerEnd:Re(r.innerEnd,0,a)}}function Xr(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function Va(e,t,n,i,r,s){const{x:a,y:l,startAngle:u,pixelMargin:d,innerRadius:h}=t,m=Math.max(t.outerRadius+i+n-d,0),g=h>0?h+i+n+d:0;let _=0;const x=r-u;if(i){const ct=h>0?h-i:0,ht=m>0?m-i:0,ut=(ct+ht)/2,vt=ut!==0?x*ut/(ut+i):x;_=(x-vt)/2}const v=Math.max(.001,x*m-n/Rt)/m,S=(x-v)/2,C=u+S+_,A=r-S-_,{outerStart:F,outerEnd:P,innerStart:B,innerEnd:N}=BA(t,g,m,A-C),z=m-F,k=m-P,w=C+F/z,O=A-P/k,L=g+B,$=g+N,q=C+B/L,st=A-N/$;if(e.beginPath(),s){const ct=(w+O)/2;if(e.arc(a,l,m,w,ct),e.arc(a,l,m,ct,O),P>0){const at=Xr(k,O,a,l);e.arc(at.x,at.y,P,O,A+se)}const ht=Xr($,A,a,l);if(e.lineTo(ht.x,ht.y),N>0){const at=Xr($,st,a,l);e.arc(at.x,at.y,N,A+se,st+Math.PI)}const ut=(A-N/g+(C+B/g))/2;if(e.arc(a,l,g,A-N/g,ut,!0),e.arc(a,l,g,ut,C+B/g,!0),B>0){const at=Xr(L,q,a,l);e.arc(at.x,at.y,B,q+Math.PI,C-se)}const vt=Xr(z,C,a,l);if(e.lineTo(vt.x,vt.y),F>0){const at=Xr(z,w,a,l);e.arc(at.x,at.y,F,C-se,w)}}else{e.moveTo(a,l);const ct=Math.cos(w)*m+a,ht=Math.sin(w)*m+l;e.lineTo(ct,ht);const ut=Math.cos(O)*m+a,vt=Math.sin(O)*m+l;e.lineTo(ut,vt)}e.closePath()}function FA(e,t,n,i,r){const{fullCircles:s,startAngle:a,circumference:l}=t;let u=t.endAngle;if(s){Va(e,t,n,i,u,r);for(let d=0;d<s;++d)e.fill();isNaN(l)||(u=a+(l%ee||ee))}return Va(e,t,n,i,u,r),e.fill(),u}function zA(e,t,n,i,r){const{fullCircles:s,startAngle:a,circumference:l,options:u}=t,{borderWidth:d,borderJoinStyle:h,borderDash:m,borderDashOffset:g,borderRadius:_}=u,x=u.borderAlign==="inner";if(!d)return;e.setLineDash(m||[]),e.lineDashOffset=g,x?(e.lineWidth=d*2,e.lineJoin=h||"round"):(e.lineWidth=d,e.lineJoin=h||"bevel");let v=t.endAngle;if(s){Va(e,t,n,i,v,r);for(let S=0;S<s;++S)e.stroke();isNaN(l)||(v=a+(l%ee||ee))}x&&LA(e,t,v),u.selfJoin&&v-a>=Rt&&_===0&&h!=="miter"&&IA(e,t,v),s||(Va(e,t,n,i,v,r),e.stroke())}class UA extends Ye{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,n,i){const r=this.getProps(["x","y"],i),{angle:s,distance:a}=Ca(r,{x:t,y:n}),{startAngle:l,endAngle:u,innerRadius:d,outerRadius:h,circumference:m}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),g=(this.options.spacing+this.options.borderWidth)/2,_=Ct(m,u-l),x=Xs(s,l,u)&&l!==u,v=_>=ee||x,S=si(a,d+g,h+g);return v&&S}getCenterPoint(t){const{x:n,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,m=(a+l+d+u)/2;return{x:n+Math.cos(h)*m,y:i+Math.sin(h)*m}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:n,circumference:i}=this,r=(n.offset||0)/4,s=(n.spacing||0)/2,a=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=i>ee?Math.floor(i/ee):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=n.backgroundColor,t.strokeStyle=n.borderColor,FA(t,this,d,s,a),zA(t,this,d,s,a),t.restore()}}function vg(e,t,n=t){e.lineCap=Ct(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Ct(n.borderDash,t.borderDash)),e.lineDashOffset=Ct(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Ct(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Ct(n.borderWidth,t.borderWidth),e.strokeStyle=Ct(n.borderColor,t.borderColor)}function HA(e,t,n){e.lineTo(n.x,n.y)}function WA(e){return e.stepped?lC:e.tension||e.cubicInterpolationMode==="monotone"?cC:HA}function Sg(e,t,n={}){const i=e.length,{start:r=0,end:s=i-1}=n,{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 $A(e,t,n,i){const{points:r,options:s}=t,{count:a,start:l,loop:u,ilen:d}=Sg(r,n,i),h=WA(s);let{move:m=!0,reverse:g}=i||{},_,x,v;for(_=0;_<=d;++_)x=r[(l+(g?d-_:_))%a],!x.skip&&(m?(e.moveTo(x.x,x.y),m=!1):h(e,v,x,g,s.stepped),v=x);return u&&(x=r[(l+(g?d:0))%a],h(e,v,x,g,s.stepped)),!!u}function VA(e,t,n,i){const r=t.points,{count:s,start:a,ilen:l}=Sg(r,n,i),{move:u=!0,reverse:d}=i||{};let h=0,m=0,g,_,x,v,S,C;const A=P=>(a+(d?l-P:P))%s,F=()=>{v!==S&&(e.lineTo(h,S),e.lineTo(h,v),e.lineTo(h,C))};for(u&&(_=r[A(0)],e.moveTo(_.x,_.y)),g=0;g<=l;++g){if(_=r[A(g)],_.skip)continue;const P=_.x,B=_.y,N=P|0;N===x?(B<v?v=B:B>S&&(S=B),h=(m*h+P)/++m):(F(),e.lineTo(P,B),x=N,m=0,v=S=B),C=B}F()}function Cu(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?VA:$A}function YA(e){return e.stepped?HC:e.tension||e.cubicInterpolationMode==="monotone"?WC:fr}function qA(e,t,n,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,n,i)&&r.closePath()),vg(e,t.options),e.stroke(r)}function jA(e,t,n,i){const{segments:r,options:s}=t,a=Cu(t);for(const l of r)vg(e,s,l.style),e.beginPath(),a(e,t,l,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const GA=typeof Path2D=="function";function KA(e,t,n,i){GA&&!t.options.segment?qA(e,t,n,i):jA(e,t,n,i)}class Ya extends Ye{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,n){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const r=i.spanGaps?this._loop:this._fullLoop;PC(this._points,i,t,r,n),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=GC(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){const i=this.options,r=t[n],s=this.points,a=Cm(this,{property:n,start:r,end:r});if(!a.length)return;const l=[],u=YA(i);let d,h;for(d=0,h=a.length;d<h;++d){const{start:m,end:g}=a[d],_=s[m],x=s[g];if(_===x){l.push(_);continue}const v=Math.abs((r-_[n])/(x[n]-_[n])),S=u(_,x,v,i.stepped);S[n]=t[n],l.push(S)}return l.length===1?l[0]:l}pathSegment(t,n,i){return Cu(this)(t,this,n,i)}path(t,n,i){const r=this.segments,s=Cu(this);let a=this._loop;n=n||0,i=i||this.points.length-n;for(const l of r)a&=s(t,this,l,{start:n,end:n+i-1});return!!a}draw(t,n,i,r){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),KA(t,this,i,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Tg(e,t,n,i){const r=e.options,{[n]:s}=e.getProps([n],i);return Math.abs(t-s)<r.radius+r.hitRadius}class XA extends Ye{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,n,i){const r=this.options,{x:s,y:a}=this.getProps(["x","y"],i);return Math.pow(t-s,2)+Math.pow(n-a,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(t,n){return Tg(this,t,"x",n)}inYRange(t,n){return Tg(this,t,"y",n)}getCenterPoint(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}size(t){t=t||this.options||{};let n=t.radius||0;n=Math.max(n,n&&t.hoverRadius||0);const i=n&&t.borderWidth||0;return(n+i)*2}draw(t,n){const i=this.options;this.skip||i.radius<.1||!ai(this,n,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,cu(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function kg(e,t){const{x:n,y:i,base:r,width:s,height:a}=e.getProps(["x","y","base","width","height"],t);let l,u,d,h,m;return e.horizontal?(m=a/2,l=Math.min(n,r),u=Math.max(n,r),d=i-m,h=i+m):(m=s/2,l=n-m,u=n+m,d=Math.min(i,r),h=Math.max(i,r)),{left:l,top:d,right:u,bottom:h}}function Ni(e,t,n,i){return e?0:Re(t,n,i)}function ZA(e,t,n){const i=e.options.borderWidth,r=e.borderSkipped,s=fm(i);return{t:Ni(r.top,s.top,0,n),r:Ni(r.right,s.right,0,t),b:Ni(r.bottom,s.bottom,0,n),l:Ni(r.left,s.left,0,t)}}function QA(e,t,n){const{enableBorderRadius:i}=e.getProps(["enableBorderRadius"]),r=e.options.borderRadius,s=Ei(r),a=Math.min(t,n),l=e.borderSkipped,u=i||Lt(r);return{topLeft:Ni(!u||l.top||l.left,s.topLeft,0,a),topRight:Ni(!u||l.top||l.right,s.topRight,0,a),bottomLeft:Ni(!u||l.bottom||l.left,s.bottomLeft,0,a),bottomRight:Ni(!u||l.bottom||l.right,s.bottomRight,0,a)}}function JA(e){const t=kg(e),n=t.right-t.left,i=t.bottom-t.top,r=ZA(e,n/2,i/2),s=QA(e,n/2,i/2);return{outer:{x:t.left,y:t.top,w:n,h:i,radius:s},inner:{x:t.left+r.l,y:t.top+r.t,w:n-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 Ou(e,t,n,i){const r=t===null,s=n===null,l=e&&!(r&&s)&&kg(e,i);return l&&(r||si(t,l.left,l.right))&&(s||si(n,l.top,l.bottom))}function tE(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function eE(e,t){e.rect(t.x,t.y,t.w,t.h)}function Au(e,t,n={}){const i=e.x!==n.x?-t:0,r=e.y!==n.y?-t:0,s=(e.x+e.w!==n.x+n.w?t:0)-i,a=(e.y+e.h!==n.y+n.h?t:0)-r;return{x:e.x+i,y:e.y+r,w:e.w+s,h:e.h+a,radius:e.radius}}class nE extends Ye{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:n,options:{borderColor:i,backgroundColor:r}}=this,{inner:s,outer:a}=JA(this),l=tE(a.radius)?qr:eE;t.save(),(a.w!==s.w||a.h!==s.h)&&(t.beginPath(),l(t,Au(a,n,s)),t.clip(),l(t,Au(s,-n,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),l(t,Au(s,n)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,n,i){return Ou(this,t,n,i)}inXRange(t,n){return Ou(this,t,null,n)}inYRange(t,n){return Ou(this,null,t,n)}getCenterPoint(t){const{x:n,y:i,base:r,horizontal:s}=this.getProps(["x","y","base","horizontal"],t);return{x:s?(n+r)/2:n,y:s?i:(i+r)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}var iE=Object.freeze({__proto__:null,ArcElement:UA,BarElement:nE,LineElement:Ya,PointElement:XA});const Eu=["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)"],Mg=Eu.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function Dg(e){return Eu[e%Eu.length]}function Cg(e){return Mg[e%Mg.length]}function rE(e,t){return e.borderColor=Dg(t),e.backgroundColor=Cg(t),++t}function sE(e,t){return e.backgroundColor=e.data.map(()=>Dg(t++)),t}function oE(e,t){return e.backgroundColor=e.data.map(()=>Cg(t++)),t}function aE(e){let t=0;return(n,i)=>{const r=e.getDatasetMeta(i).controller;r instanceof ro?t=sE(n,t):r instanceof Ym?t=oE(n,t):r&&(t=rE(n,t))}}function Og(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function lE(e){return e&&(e.borderColor||e.backgroundColor)}function cE(){return oe.borderColor!=="rgba(0,0,0,0.1)"||oe.backgroundColor!=="rgba(0,0,0,0.1)"}var uE={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:i},options:r}=e.config,{elements:s}=r,a=Og(i)||lE(r)||s&&Og(s)||cE();if(!n.forceOverride&&a)return;const l=aE(e);i.forEach(l)}};function dE(e,t,n,i,r){const s=r.samples||i;if(s>=n)return e.slice(t,t+n);const a=[],l=(n-2)/(s-2);let u=0;const d=t+n-1;let h=t,m,g,_,x,v;for(a[u++]=e[h],m=0;m<s-2;m++){let S=0,C=0,A;const F=Math.floor((m+1)*l)+1+t,P=Math.min(Math.floor((m+2)*l)+1,n)+t,B=P-F;for(A=F;A<P;A++)S+=e[A].x,C+=e[A].y;S/=B,C/=B;const N=Math.floor(m*l)+1+t,z=Math.min(Math.floor((m+1)*l)+1,n)+t,{x:k,y:w}=e[h];for(_=x=-1,A=N;A<z;A++)x=.5*Math.abs((k-S)*(e[A].y-w)-(k-e[A].x)*(C-w)),x>_&&(_=x,g=e[A],v=A);a[u++]=g,h=v}return a[u++]=e[d],a}function fE(e,t,n,i){let r=0,s=0,a,l,u,d,h,m,g,_,x,v;const S=[],C=t+n-1,A=e[t].x,P=e[C].x-A;for(a=t;a<t+n;++a){l=e[a],u=(l.x-A)/P*i,d=l.y;const B=u|0;if(B===h)d<x?(x=d,m=a):d>v&&(v=d,g=a),r=(s*r+l.x)/++s;else{const N=a-1;if(!Tt(m)&&!Tt(g)){const z=Math.min(m,g),k=Math.max(m,g);z!==_&&z!==N&&S.push({...e[z],x:r}),k!==_&&k!==N&&S.push({...e[k],x:r})}a>0&&N!==_&&S.push(e[N]),S.push(l),h=B,s=0,x=v=d,m=g=_=a}}return S}function Ag(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Eg(e){e.data.datasets.forEach(t=>{Ag(t)})}function hE(e,t){const n=t.length;let i=0,r;const{iScale:s}=e,{min:a,max:l,minDefined:u,maxDefined:d}=s.getUserBounds();return u&&(i=Re(oi(t,s.axis,a).lo,0,n-1)),d?r=Re(oi(t,s.axis,l).hi+1,i,n)-i:r=n-i,{start:i,count:r}}var pE={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){Eg(e);return}const i=e.width;e.data.datasets.forEach((r,s)=>{const{_data:a,indexAxis:l}=r,u=e.getDatasetMeta(s),d=a||r.data;if(no([l,e.options.indexAxis])==="y"||!u.controller.supportsDecimation)return;const h=e.scales[u.xAxisID];if(h.type!=="linear"&&h.type!=="time"||e.options.parsing)return;let{start:m,count:g}=hE(u,d);const _=n.threshold||4*i;if(g<=_){Ag(r);return}Tt(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(n.algorithm){case"lttb":x=dE(d,m,g,i,n);break;case"min-max":x=fE(d,m,g,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}r._decimated=x})},destroy(e){Eg(e)}};function mE(e,t,n){const i=e.segments,r=e.points,s=t.points,a=[];for(const l of i){let{start:u,end:d}=l;d=qa(u,d,r);const h=Ru(n,r[u],r[d],l.loop);if(!t.segments){a.push({source:l,target:h,start:r[u],end:r[d]});continue}const m=Cm(t,h);for(const g of m){const _=Ru(n,s[g.start],s[g.end],g.loop),x=Dm(l,r,_);for(const v of x)a.push({source:v,target:g,start:{[n]:Rg(h,_,"start",Math.max)},end:{[n]:Rg(h,_,"end",Math.min)}})}}return a}function Ru(e,t,n,i){if(i)return;let r=t[e],s=n[e];return e==="angle"&&(r=We(r),s=We(s)),{property:e,start:r,end:s}}function gE(e,t){const{x:n=null,y:i=null}=e||{},r=t.points,s=[];return t.segments.forEach(({start:a,end:l})=>{l=qa(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})):n!==null&&(s.push({x:n,y:u.y}),s.push({x:n,y:d.y}))}),s}function qa(e,t,n){for(;t>e;t--){const i=n[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Rg(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function Pg(e,t){let n=[],i=!1;return Gt(e)?(i=!0,n=e):n=gE(e,t),n.length?new Ya({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function Ig(e){return e&&e.fill!==!1}function yE(e,t,n){let r=e[t].fill;const s=[t];let a;if(!n)return r;for(;r!==!1&&s.indexOf(r)===-1;){if(!le(r))return r;if(a=e[r],!a)return!1;if(a.visible)return r;s.push(r),r=a.fill}return!1}function _E(e,t,n){const i=vE(e);if(Lt(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return le(r)&&Math.floor(r)===r?bE(i[0],t,r,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function bE(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function xE(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:Lt(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function wE(e,t,n){let i;return e==="start"?i=n:e==="end"?i=t.options.reverse?t.min:t.max:Lt(e)?i=e.value:i=t.getBaseValue(),i}function vE(e){const t=e.options,n=t.fill;let i=Ct(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function SE(e){const{scale:t,index:n,line:i}=e,r=[],s=i.segments,a=i.points,l=TE(t,n);l.push(Pg({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++)kE(r,a[h],l)}return new Ya({points:r,options:{}})}function TE(e,t){const n=[],i=e.getMatchingVisibleMetas("line");for(let r=0;r<i.length;r++){const s=i[r];if(s.index===t)break;s.hidden||n.unshift(s.dataset)}return n}function kE(e,t,n){const i=[];for(let r=0;r<n.length;r++){const s=n[r],{first:a,last:l,point:u}=ME(s,t,"x");if(!(!u||a&&l)){if(a)i.unshift(u);else if(e.push(u),!l)break}}e.push(...i)}function ME(e,t,n){const i=e.interpolate(t,n);if(!i)return{};const r=i[n],s=e.segments,a=e.points;let l=!1,u=!1;for(let d=0;d<s.length;d++){const h=s[d],m=a[h.start][n],g=a[h.end][n];if(si(r,m,g)){l=r===m,u=r===g;break}}return{first:l,last:u,point:i}}class Lg{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,i){const{x:r,y:s,radius:a}=this;return n=n||{start:0,end:ee},t.arc(r,s,a,n.end,n.start,!0),!i.bounds}interpolate(t){const{x:n,y:i,radius:r}=this,s=t.angle;return{x:n+Math.cos(s)*r,y:i+Math.sin(s)*r,angle:s}}}function DE(e){const{chart:t,fill:n,line:i}=e;if(le(n))return CE(t,n);if(n==="stack")return SE(e);if(n==="shape")return!0;const r=OE(e);return r instanceof Lg?r:Pg(r,i)}function CE(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function OE(e){return(e.scale||{}).getPointPositionForValue?EE(e):AE(e)}function AE(e){const{scale:t={},fill:n}=e,i=xE(n,t);if(le(i)){const r=t.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function EE(e){const{scale:t,fill:n}=e,i=t.options,r=t.getLabels().length,s=i.reverse?t.max:t.min,a=wE(n,t,s),l=[];if(i.grid.circular){const u=t.getPointPositionForValue(0,s);return new Lg({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 Pu(e,t,n){const i=DE(t),{chart:r,index:s,line:a,scale:l,axis:u}=t,d=a.options,h=d.fill,m=d.backgroundColor,{above:g=m,below:_=m}=h||{},x=r.getDatasetMeta(s),v=Em(r,x);i&&a.points.length&&(to(e,n),RE(e,{line:a,target:i,above:g,below:_,area:n,scale:l,axis:u,clip:v}),eo(e))}function RE(e,t){const{line:n,target:i,above:r,below:s,area:a,scale:l,clip:u}=t,d=n._loop?"angle":t.axis;e.save();let h=s;s!==r&&(d==="x"?(Ng(e,i,a.top),Iu(e,{line:n,target:i,color:r,scale:l,property:d,clip:u}),e.restore(),e.save(),Ng(e,i,a.bottom)):d==="y"&&(Bg(e,i,a.left),Iu(e,{line:n,target:i,color:s,scale:l,property:d,clip:u}),e.restore(),e.save(),Bg(e,i,a.right),h=r)),Iu(e,{line:n,target:i,color:h,scale:l,property:d,clip:u}),e.restore()}function Ng(e,t,n){const{segments:i,points:r}=t;let s=!0,a=!1;e.beginPath();for(const l of i){const{start:u,end:d}=l,h=r[u],m=r[qa(u,d,r)];s?(e.moveTo(h.x,h.y),s=!1):(e.lineTo(h.x,n),e.lineTo(h.x,h.y)),a=!!t.pathSegment(e,l,{move:a}),a?e.closePath():e.lineTo(m.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function Bg(e,t,n){const{segments:i,points:r}=t;let s=!0,a=!1;e.beginPath();for(const l of i){const{start:u,end:d}=l,h=r[u],m=r[qa(u,d,r)];s?(e.moveTo(h.x,h.y),s=!1):(e.lineTo(n,h.y),e.lineTo(h.x,h.y)),a=!!t.pathSegment(e,l,{move:a}),a?e.closePath():e.lineTo(n,m.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function Iu(e,t){const{line:n,target:i,property:r,color:s,scale:a,clip:l}=t,u=mE(n,i,r);for(const{source:d,target:h,start:m,end:g}of u){const{style:{backgroundColor:_=s}={}}=d,x=i!==!0;e.save(),e.fillStyle=_,PE(e,a,l,x&&Ru(r,m,g)),e.beginPath();const v=!!n.pathSegment(e,d);let S;if(x){v?e.closePath():Fg(e,i,g,r);const C=!!i.pathSegment(e,h,{move:v,reverse:!0});S=v&&C,S||Fg(e,i,m,r)}e.closePath(),e.fill(S?"evenodd":"nonzero"),e.restore()}}function PE(e,t,n,i){const r=t.chart.chartArea,{property:s,start:a,end:l}=i||{};if(s==="x"||s==="y"){let u,d,h,m;s==="x"?(u=a,d=r.top,h=l,m=r.bottom):(u=r.left,d=a,h=r.right,m=l),e.beginPath(),n&&(u=Math.max(u,n.left),h=Math.min(h,n.right),d=Math.max(d,n.top),m=Math.min(m,n.bottom)),e.rect(u,d,h-u,m-d),e.clip()}}function Fg(e,t,n,i){const r=t.interpolate(n,i);r&&e.lineTo(r.x,r.y)}var IE={id:"filler",afterDatasetsUpdate(e,t,n){const i=(e.data.datasets||[]).length,r=[];let s,a,l,u;for(a=0;a<i;++a)s=e.getDatasetMeta(a),l=s.dataset,u=null,l&&l.options&&l instanceof Ya&&(u={visible:e.isDatasetVisible(a),index:a,fill:_E(l,a,i),chart:e,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=yE(r,a,n.propagate))},beforeDraw(e,t,n){const i=n.drawTime==="beforeDraw",r=e.getSortedVisibleDatasetMetas(),s=e.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&&Pu(e.ctx,l,s))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=e.getSortedVisibleDatasetMetas();for(let r=i.length-1;r>=0;--r){const s=i[r].$filler;Ig(s)&&Pu(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;!Ig(i)||n.drawTime!=="beforeDatasetDraw"||Pu(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const zg=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},LE=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Ug extends Ye{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,n,i){this.maxWidth=t,this.maxHeight=n,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 n=Jt(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,r)=>t.sort(i,r,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,r=ce(i.font),s=r.size,a=this._computeTitleHeight(),{boxWidth:l,itemHeight:u}=zg(i,s);let d,h;n.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,n,i,r){const{ctx:s,maxWidth:a,options:{labels:{padding:l}}}=this,u=this.legendHitBoxes=[],d=this.lineWidths=[0],h=r+l;let m=t;s.textAlign="left",s.textBaseline="middle";let g=-1,_=-h;return this.legendItems.forEach((x,v)=>{const S=i+n/2+s.measureText(x.text).width;(v===0||d[d.length-1]+S+2*l>a)&&(m+=h,d[d.length-(v>0?0:1)]=0,_+=h,g++),u[v]={left:0,top:_,row:g,width:S,height:r},d[d.length-1]+=S+l}),m}_fitCols(t,n,i,r){const{ctx:s,maxHeight:a,options:{labels:{padding:l}}}=this,u=this.legendHitBoxes=[],d=this.columnSizes=[],h=a-t;let m=l,g=0,_=0,x=0,v=0;return this.legendItems.forEach((S,C)=>{const{itemWidth:A,itemHeight:F}=NE(i,n,s,S,r);C>0&&_+F+2*l>h&&(m+=g+l,d.push({width:g,height:_}),x+=g+l,v++,g=_=0),u[C]={left:x,top:_,col:v,width:A,height:F},g=Math.max(g,A),_+=F+l}),m+=g,d.push({width:g,height:_}),m}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:r},rtl:s}}=this,a=Kr(s,this.left,this.width);if(this.isHorizontal()){let l=0,u=$e(i,this.left+r,this.right-this.lineWidths[l]);for(const d of n)l!==d.row&&(l=d.row,u=$e(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=$e(i,this.top+t+r,this.bottom-this.columnSizes[l].height);for(const d of n)d.col!==l&&(l=d.col,u=$e(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;to(t,this),this._draw(),eo(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:r}=this,{align:s,labels:a}=t,l=oe.color,u=Kr(t.rtl,this.left,this.width),d=ce(a.font),{padding:h}=a,m=d.size,g=m/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:S}=zg(a,m),C=function(N,z,k){if(isNaN(x)||x<=0||isNaN(v)||v<0)return;r.save();const w=Ct(k.lineWidth,1);if(r.fillStyle=Ct(k.fillStyle,l),r.lineCap=Ct(k.lineCap,"butt"),r.lineDashOffset=Ct(k.lineDashOffset,0),r.lineJoin=Ct(k.lineJoin,"miter"),r.lineWidth=w,r.strokeStyle=Ct(k.strokeStyle,l),r.setLineDash(Ct(k.lineDash,[])),a.usePointStyle){const O={radius:v*Math.SQRT2/2,pointStyle:k.pointStyle,rotation:k.rotation,borderWidth:w},L=u.xPlus(N,x/2),$=z+g;dm(r,O,L,$,a.pointStyleWidth&&x)}else{const O=z+Math.max((m-v)/2,0),L=u.leftForLtr(N,x),$=Ei(k.borderRadius);r.beginPath(),Object.values($).some(q=>q!==0)?qr(r,{x:L,y:O,w:x,h:v,radius:$}):r.rect(L,O,x,v),r.fill(),w!==0&&r.stroke()}r.restore()},A=function(N,z,k){ur(r,k.text,N,z+S/2,d,{strikethrough:k.hidden,textAlign:u.textAlign(k.textAlign)})},F=this.isHorizontal(),P=this._computeTitleHeight();F?_={x:$e(s,this.left+h,this.right-i[0]),y:this.top+h+P,line:0}:_={x:this.left+h,y:$e(s,this.top+P+h,this.bottom-n[0].height),line:0},Sm(this.ctx,t.textDirection);const B=S+h;this.legendItems.forEach((N,z)=>{r.strokeStyle=N.fontColor,r.fillStyle=N.fontColor;const k=r.measureText(N.text).width,w=u.textAlign(N.textAlign||(N.textAlign=a.textAlign)),O=x+g+k;let L=_.x,$=_.y;u.setWidth(this.width),F?z>0&&L+O+h>this.right&&($=_.y+=B,_.line++,L=_.x=$e(s,this.left+h,this.right-i[_.line])):z>0&&$+B>this.bottom&&(L=_.x=L+n[_.line].width+h,_.line++,$=_.y=$e(s,this.top+P+h,this.bottom-n[_.line].height));const q=u.x(L);if(C(q,$,N),L=ZD(w,L+x+g,F?L+O:this.right,t.rtl),A(u.x(L),$,N),F)_.x+=O+h;else if(typeof N.text!="string"){const st=d.lineHeight;_.y+=Hg(N,st)+h}else _.y+=B}),Tm(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=ce(n.font),r=Se(n.padding);if(!n.display)return;const s=Kr(t.rtl,this.left,this.width),a=this.ctx,l=n.position,u=i.size/2,d=r.top+u;let h,m=this.left,g=this.width;if(this.isHorizontal())g=Math.max(...this.lineWidths),h=this.top+d,m=$e(t.align,m,this.right-g);else{const x=this.columnSizes.reduce((v,S)=>Math.max(v,S.height),0);h=d+$e(t.align,this.top,this.bottom-x-t.labels.padding-this._computeTitleHeight())}const _=$e(l,m,m+g);a.textAlign=s.textAlign(ru(l)),a.textBaseline="middle",a.strokeStyle=n.color,a.fillStyle=n.color,a.font=i.string,ur(a,n.text,_,h,i)}_computeTitleHeight(){const t=this.options.title,n=ce(t.font),i=Se(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,r,s;if(si(t,this.left,this.right)&&si(n,this.top,this.bottom)){for(s=this.legendHitBoxes,i=0;i<s.length;++i)if(r=s[i],si(t,r.left,r.left+r.width)&&si(n,r.top,r.top+r.height))return this.legendItems[i]}return null}handleEvent(t){const n=this.options;if(!zE(t.type,n))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,s=LE(r,i);r&&!s&&Jt(n.onLeave,[t,r,this],this),this._hoveredItem=i,i&&!s&&Jt(n.onHover,[t,i,this],this)}else i&&Jt(n.onClick,[t,i,this],this)}}function NE(e,t,n,i,r){const s=BE(i,e,t,n),a=FE(r,i,t.lineHeight);return{itemWidth:s,itemHeight:a}}function BE(e,t,n,i){let r=e.text;return r&&typeof r!="string"&&(r=r.reduce((s,a)=>s.length>a.length?s:a)),t+n.size/2+i.measureText(r).width}function FE(e,t,n){let i=e;return typeof t.text!="string"&&(i=Hg(t,n)),i}function Hg(e,t){const n=e.text?e.text.length:0;return t*n}function zE(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var UE={id:"legend",_element:Ug,start(e,t,n){const i=e.legend=new Ug({ctx:e.ctx,options:n,chart:e});Ve.configure(e,i,n),Ve.addBox(e,i)},stop(e){Ve.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;Ve.configure(e,i,n),i.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const i=t.datasetIndex,r=n.chart;r.isDatasetVisible(i)?(r.hide(i),t.hidden=!0):(r.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:r,color:s,useBorderRadius:a,borderRadius:l}}=e.legend.options;return e._getSortedDatasetMetas().map(u=>{const d=u.controller.getStyle(n?0:void 0),h=Se(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:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Lu extends Ye{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,n){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=n;const r=Gt(i.text)?i.text.length:1;this._padding=Se(i.padding);const s=r*ce(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:n,left:i,bottom:r,right:s,options:a}=this,l=a.align;let u=0,d,h,m;return this.isHorizontal()?(h=$e(l,i,s),m=n+t,d=s-i):(a.position==="left"?(h=i+t,m=$e(l,r,n),u=Rt*-.5):(h=s-t,m=$e(l,n,r),u=Rt*.5),d=r-n),{titleX:h,titleY:m,maxWidth:d,rotation:u}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=ce(n.font),s=i.lineHeight/2+this._padding.top,{titleX:a,titleY:l,maxWidth:u,rotation:d}=this._drawArgs(s);ur(t,n.text,0,0,i,{color:n.color,maxWidth:u,rotation:d,textAlign:ru(n.align),textBaseline:"middle",translation:[a,l]})}}function HE(e,t){const n=new Lu({ctx:e.ctx,options:t,chart:e});Ve.configure(e,n,t),Ve.addBox(e,n),e.titleBlock=n}var WE={id:"title",_element:Lu,start(e,t,n){HE(e,n)},stop(e){const t=e.titleBlock;Ve.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;Ve.configure(e,i,n),i.options=n},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 ja=new WeakMap;var $E={id:"subtitle",start(e,t,n){const i=new Lu({ctx:e.ctx,options:n,chart:e});Ve.configure(e,i,n),Ve.addBox(e,i),ja.set(e,i)},stop(e){Ve.removeBox(e,ja.get(e)),ja.delete(e)},beforeUpdate(e,t,n){const i=ja.get(e);Ve.configure(e,i,n),i.options=n},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 ho={average(e){if(!e.length)return!1;let t,n,i=new Set,r=0,s=0;for(t=0,n=e.length;t<n;++t){const l=e[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(e,t){if(!e.length)return!1;let n=t.x,i=t.y,r=Number.POSITIVE_INFINITY,s,a,l;for(s=0,a=e.length;s<a;++s){const u=e[s].element;if(u&&u.hasValue()){const d=u.getCenterPoint(),h=Yr(t,d);h<r&&(r=h,l=u)}}if(l){const u=l.tooltipPosition();n=u.x,i=u.y}return{x:n,y:i}}};function Kn(e,t){return t&&(Gt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function ci(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
2
2
|
`)>-1?e.split(`
|
|
3
|
-
`):e}function NR(e,t){const{element:n,datasetIndex:i,index:r}=t,s=e.getDatasetMeta(i).controller,{label:a,value:l}=s.getLabelAndValue(r);return{chart:e,label:a,parsed:s.getParsed(r),raw:e.data.datasets[i].data[r],formattedValue:l,dataset:s.getDataset(),dataIndex:r,datasetIndex:i,element:n}}function Lg(e,t){const n=e.chart.ctx,{body:i,footer:r,title:s}=e,{boxWidth:a,boxHeight:l}=t,u=ce(t.bodyFont),d=ce(t.titleFont),f=ce(t.footerFont),m=s.length,g=r.length,_=i.length,x=Se(t.padding);let v=x.height,S=0,C=i.reduce((I,N)=>I+N.before.length+N.lines.length+N.after.length,0);if(C+=e.beforeBody.length+e.afterBody.length,m&&(v+=m*d.lineHeight+(m-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}g&&(v+=t.footerMarginTop+g*f.lineHeight+(g-1)*t.footerSpacing);let O=0;const B=function(I){S=Math.max(S,n.measureText(I).width+O)};return n.save(),n.font=d.string,te(e.title,B),n.font=u.string,te(e.beforeBody.concat(e.afterBody),B),O=t.displayColors?a+2+t.boxPadding:0,te(i,I=>{te(I.before,B),te(I.lines,B),te(I.after,B)}),O=0,n.font=f.string,te(e.footer,B),n.restore(),S+=x.width,{width:S,height:v}}function BR(e,t){const{y:n,height:i}=t;return n<i/2?"top":n>e.height-i/2?"bottom":"center"}function FR(e,t,n,i){const{x:r,width:s}=i,a=n.caretSize+n.caretPadding;if(e==="left"&&r+s+a>t.width||e==="right"&&r-s-a<0)return!0}function zR(e,t,n,i){const{x:r,width:s}=n,{width:a,chartArea:{left:l,right:u}}=e;let d="center";return i==="center"?d=r<=(l+u)/2?"left":"right":r<=s/2?d="left":r>=a-s/2&&(d="right"),FR(d,e,t,n)&&(d="center"),d}function Ng(e,t,n){const i=n.yAlign||t.yAlign||BR(e,n);return{xAlign:n.xAlign||t.xAlign||zR(e,t,n,i),yAlign:i}}function UR(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function HR(e,t,n){let{y:i,height:r}=e;return t==="top"?i+=n:t==="bottom"?i-=r+n:i-=r/2,i}function Bg(e,t,n,i){const{caretSize:r,caretPadding:s,cornerRadius:a}=e,{xAlign:l,yAlign:u}=n,d=r+s,{topLeft:f,topRight:m,bottomLeft:g,bottomRight:_}=Oi(a);let x=UR(t,l);const v=HR(t,u,d);return u==="center"?l==="left"?x+=d:l==="right"&&(x-=d):l==="left"?x-=Math.max(f,g)+r:l==="right"&&(x+=Math.max(m,_)+r),{x:Re(x,0,i.width-t.width),y:Re(v,0,i.height-t.height)}}function $a(e,t,n){const i=Se(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function Fg(e){return Gn([],ci(e))}function WR(e,t,n){return Ri(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function zg(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const Ug={beforeTitle:ri,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.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 n[t.dataIndex]}return""},afterTitle:ri,beforeBody:ri,beforeLabel:ri,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return St(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:ri,afterBody:ri,beforeFooter:ri,footer:ri,afterFooter:ri};function an(e,t,n,i){const r=e[t].call(n,i);return typeof r>"u"?Ug[t].call(n,i):r}class Hg extends Ve{static positioners=ao;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 n=this.chart,i=this.options.setContext(this.getContext()),r=i.enabled&&n.options.animation&&i.animations,s=new lu(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=WR(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,r=an(i,"beforeTitle",this,t),s=an(i,"title",this,t),a=an(i,"afterTitle",this,t);let l=[];return l=Gn(l,ci(r)),l=Gn(l,ci(s)),l=Gn(l,ci(a)),l}getBeforeBody(t,n){return Fg(an(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,r=[];return te(t,s=>{const a={before:[],lines:[],after:[]},l=zg(i,s);Gn(a.before,ci(an(l,"beforeLabel",this,s))),Gn(a.lines,an(l,"label",this,s)),Gn(a.after,ci(an(l,"afterLabel",this,s))),r.push(a)}),r}getAfterBody(t,n){return Fg(an(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,r=an(i,"beforeFooter",this,t),s=an(i,"footer",this,t),a=an(i,"afterFooter",this,t);let l=[];return l=Gn(l,ci(r)),l=Gn(l,ci(s)),l=Gn(l,ci(a)),l}_createItems(t){const n=this._active,i=this.chart.data,r=[],s=[],a=[];let l=[],u,d;for(u=0,d=n.length;u<d;++u)l.push(NR(this.chart,n[u]));return t.filter&&(l=l.filter((f,m,g)=>t.filter(f,m,g,i))),t.itemSort&&(l=l.sort((f,m)=>t.itemSort(f,m,i))),te(l,f=>{const m=zg(t.callbacks,f);r.push(an(m,"labelColor",this,f)),s.push(an(m,"labelPointStyle",this,f)),a.push(an(m,"labelTextColor",this,f))}),this.labelColors=r,this.labelPointStyles=s,this.labelTextColors=a,this.dataPoints=l,l}update(t,n){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=ao[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=Lg(this,i),d=Object.assign({},l,u),f=Ng(this.chart,i,d),m=Bg(i,d,f,this.chart);this.xAlign=f.xAlign,this.yAlign=f.yAlign,s={opacity:1,x:m.x,y:m.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:n})}drawCaret(t,n,i,r){const s=this.getCaretPosition(t,i,r);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(t,n,i){const{xAlign:r,yAlign:s}=this,{caretSize:a,cornerRadius:l}=i,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:m}=Oi(l),{x:g,y:_}=t,{width:x,height:v}=n;let S,C,O,B,I,N;return s==="center"?(I=_+v/2,r==="left"?(S=g,C=S-a,B=I+a,N=I-a):(S=g+x,C=S+a,B=I-a,N=I+a),O=S):(r==="left"?C=g+Math.max(u,f)+a:r==="right"?C=g+x-Math.max(d,m)-a:C=this.caretX,s==="top"?(B=_,I=B-a,S=C-a,O=C+a):(B=_+v,I=B+a,S=C+a,O=C-a),N=B),{x1:S,x2:C,x3:O,y1:B,y2:I,y3:N}}drawTitle(t,n,i){const r=this.title,s=r.length;let a,l,u;if(s){const d=jr(i.rtl,this.x,this.width);for(t.x=$a(this,i.titleAlign,i),n.textAlign=d.textAlign(i.titleAlign),n.textBaseline="middle",a=ce(i.titleFont),l=i.titleSpacing,n.fillStyle=i.titleColor,n.font=a.string,u=0;u<s;++u)n.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,n,i,r,s){const a=this.labelColors[i],l=this.labelPointStyles[i],{boxHeight:u,boxWidth:d}=s,f=ce(s.bodyFont),m=$a(this,"left",s),g=r.x(m),_=u<f.lineHeight?(f.lineHeight-u)/2:0,x=n.y+_;if(s.usePointStyle){const v={radius:Math.min(d,u)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},S=r.leftForLtr(g,d)+d/2,C=x+u/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,eu(t,v,S,C),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,eu(t,v,S,C)}else{t.lineWidth=It(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(g,d),S=r.leftForLtr(r.xPlus(g,1),d-2),C=Oi(a.borderRadius);Object.values(C).some(O=>O!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,Vr(t,{x:v,y:x,w:d,h:u,radius:C}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Vr(t,{x:S,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(S,x+1,d-2,u-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:r}=this,{bodySpacing:s,bodyAlign:a,displayColors:l,boxHeight:u,boxWidth:d,boxPadding:f}=i,m=ce(i.bodyFont);let g=m.lineHeight,_=0;const x=jr(i.rtl,this.x,this.width),v=function(D){n.fillText(D,x.x(t.x+_),t.y+g/2),t.y+=g+s},S=x.textAlign(a);let C,O,B,I,N,W,U;for(n.textAlign=a,n.textBaseline="middle",n.font=m.string,t.x=$a(this,S,i),n.fillStyle=i.bodyColor,te(this.beforeBody,v),_=l&&S!=="right"?a==="center"?d/2+f:d+2+f:0,I=0,W=r.length;I<W;++I){for(C=r[I],O=this.labelTextColors[I],n.fillStyle=O,te(C.before,v),B=C.lines,l&&B.length&&(this._drawColorBox(n,t,I,x,i),g=Math.max(m.lineHeight,u)),N=0,U=B.length;N<U;++N)v(B[N]),g=m.lineHeight;te(C.after,v)}_=0,g=m.lineHeight,te(this.afterBody,v),t.y-=s}drawFooter(t,n,i){const r=this.footer,s=r.length;let a,l;if(s){const u=jr(i.rtl,this.x,this.width);for(t.x=$a(this,i.footerAlign,i),t.y+=i.footerMarginTop,n.textAlign=u.textAlign(i.footerAlign),n.textBaseline="middle",a=ce(i.footerFont),n.fillStyle=i.footerColor,n.font=a.string,l=0;l<s;++l)n.fillText(r[l],u.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,n,i,r){const{xAlign:s,yAlign:a}=this,{x:l,y:u}=t,{width:d,height:f}=i,{topLeft:m,topRight:g,bottomLeft:_,bottomRight:x}=Oi(r.cornerRadius);n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,n.lineWidth=r.borderWidth,n.beginPath(),n.moveTo(l+m,u),a==="top"&&this.drawCaret(t,n,i,r),n.lineTo(l+d-g,u),n.quadraticCurveTo(l+d,u,l+d,u+g),a==="center"&&s==="right"&&this.drawCaret(t,n,i,r),n.lineTo(l+d,u+f-x),n.quadraticCurveTo(l+d,u+f,l+d-x,u+f),a==="bottom"&&this.drawCaret(t,n,i,r),n.lineTo(l+_,u+f),n.quadraticCurveTo(l,u+f,l,u+f-_),a==="center"&&s==="left"&&this.drawCaret(t,n,i,r),n.lineTo(l,u+m),n.quadraticCurveTo(l,u,l+m,u),n.closePath(),n.fill(),r.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,r=i&&i.x,s=i&&i.y;if(r||s){const a=ao[t.position].call(this,this._active,this._eventPosition);if(!a)return;const l=this._size=Lg(this,t),u=Object.assign({},a,this._size),d=Ng(n,t,u),f=Bg(t,u,d,n);(r._to!==f.x||s._to!==f.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,f))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const r={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=Se(n.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&l&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,r,n),gm(t,n.textDirection),s.y+=a.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),ym(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){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=!_a(i,r),a=this._positionChanged(r,n);(s||a)&&(this._active=r,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,s=this._active||[],a=this._getActiveElements(t,s,n,i),l=this._positionChanged(a,t),u=n||!_a(a,s)||l;return u&&(this._active=a,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),u}_getActiveElements(t,n,i,r){const s=this.options;if(t.type==="mouseout")return[];if(!r)return n.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,n){const{caretX:i,caretY:r,options:s}=this,a=ao[s.position].call(this,t,n);return a!==!1&&(i!==a.x||r!==a.y)}}var Ye={id:"tooltip",_element:Hg,positioners:ao,afterInit(e,t,n){n&&(e.tooltip=new Hg({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,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:(e,t)=>t.bodyFont.size,boxWidth:(e,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:Ug},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},$R=Object.freeze({__proto__:null,Colors:nR,Decimation:oR,Filler:kR,Legend:ER,SubTitle:LR,Title:IR,Tooltip:Ye});const VR=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function YR(e,t,n,i){const r=e.indexOf(t);if(r===-1)return VR(e,t,n,i);const s=e.lastIndexOf(t);return r!==s?n:r}const qR=(e,t)=>e===null?null:Re(Math.round(e),0,t);function Wg(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class jR extends hr{static id="category";static defaults={ticks:{callback:Wg}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const i=this.getLabels();for(const{index:r,label:s}of n)i[r]===s&&i.splice(r,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(St(t))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:YR(i,t,Ct(n,t),this._addedLabels),qR(n,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:i,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),n||(r=this.getLabels().length-1)),this.min=i,this.max=r}buildTicks(){const t=this.min,n=this.max,i=this.options.offset,r=[];let s=this.getLabels();s=t===0&&n===s.length-1?s:s.slice(t,n+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=t;a<=n;a++)r.push({value:a});return r}getLabelForValue(t){return Wg.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 n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function GR(e,t){const n=[],{bounds:r,step:s,min:a,max:l,precision:u,count:d,maxTicks:f,maxDigits:m,includeBounds:g}=e,_=s||1,x=f-1,{min:v,max:S}=t,C=!St(a),O=!St(l),B=!St(d),I=(S-v)/(m+1);let N=$p((S-v)/x/_)*_,W,U,D,w;if(N<1e-14&&!C&&!O)return[{value:v},{value:S}];w=Math.ceil(S/N)-Math.floor(v/N),w>x&&(N=$p(w*N/x/_)*_),St(u)||(W=Math.pow(10,u),N=Math.ceil(N*W)/W),r==="ticks"?(U=Math.floor(v/N)*N,D=Math.ceil(S/N)*N):(U=v,D=S),C&&O&&s&&ND((l-a)/s,N/1e3)?(w=Math.round(Math.min((l-a)/N,f)),N=(l-a)/w,U=a,D=l):B?(U=C?a:U,D=O?l:D,w=d-1,N=(D-U)/w):(w=(D-U)/N,Vs(w,Math.round(w),N/1e3)?w=Math.round(w):w=Math.ceil(w));const A=Math.max(Yp(N),Yp(U));W=Math.pow(10,St(u)?A:u),U=Math.round(U*W)/W,D=Math.round(D*W)/W;let L=0;for(C&&(g&&U!==a?(n.push({value:a}),U<a&&L++,Vs(Math.round((U+L*N)*W)/W,a,$g(a,I,e))&&L++):U<a&&L++);L<w;++L){const $=Math.round((U+L*N)*W)/W;if(O&&$>l)break;n.push({value:$})}return O&&g&&D!==l?n.length&&Vs(n[n.length-1].value,l,$g(l,I,e))?n[n.length-1].value=l:n.push({value:l}):(!O||D===l)&&n.push({value:D}),n}function $g(e,t,{horizontal:n,minRotation:i}){const r=ve(i),s=(n?Math.sin(r):Math.cos(r))||.001,a=.75*t*(""+e).length;return Math.min(t/s,a)}class Va extends hr{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,n){return St(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:r,max:s}=this;const a=u=>r=n?r:u,l=u=>s=i?s:u;if(t){const u=qn(r),d=qn(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:n,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(),n=n||11),n&&(r=Math.min(n,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=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:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},s=this._range||this,a=GR(r,s);return t.bounds==="ticks"&&Vp(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 n=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const r=(i-n)/Math.max(t.length-1,1)/2;n-=r,i+=r}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return js(t,this.chart.options.locale,this.options.ticks.format)}}class KR extends Va{static id="linear";static defaults={ticks:{callback:ka.formatters.numeric}};determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=le(t)?t:0,this.max=le(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=ve(this.options.ticks.minRotation),r=(t?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/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 lo=e=>Math.floor(Ci(e)),pr=(e,t)=>Math.pow(10,lo(e)+t);function Vg(e){return e/Math.pow(10,lo(e))===1}function Yg(e,t,n){const i=Math.pow(10,n),r=Math.floor(e/i);return Math.ceil(t/i)-r}function XR(e,t){const n=t-e;let i=lo(n);for(;Yg(e,t,i)>10;)i++;for(;Yg(e,t,i)<10;)i--;return Math.min(i,lo(e))}function ZR(e,{min:t,max:n}){t=mn(e.min,t);const i=[],r=lo(t);let s=XR(t,n),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,f=Math.floor((t-u)/l/10)*l*10;let m=Math.floor((d-f)/Math.pow(10,s)),g=mn(e.min,Math.round((u+f+m*Math.pow(10,s))*a)/a);for(;g<n;)i.push({value:g,major:Vg(g),significand:m}),m>=10?m=m<15?15:20:m++,m>=20&&(s++,m=2,a=s>=0?1:a),g=Math.round((u+f+m*Math.pow(10,s))*a)/a;const _=mn(e.max,g);return i.push({value:_,major:Vg(_),significand:m}),i}class QR extends hr{static id="logarithmic";static defaults={ticks:{callback:ka.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,n){const i=Va.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return le(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=le(t)?Math.max(0,t):null,this.max=le(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!le(this._userMin)&&(this.min=t===pr(this.min,0)?pr(this.min,-1):pr(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let i=this.min,r=this.max;const s=l=>i=t?i:l,a=l=>r=n?r:l;i===r&&(i<=0?(s(1),a(10)):(s(pr(i,-1)),a(pr(r,1)))),i<=0&&s(pr(r,-1)),r<=0&&a(pr(i,1)),this.min=i,this.max=r}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},i=ZR(n,this);return t.bounds==="ticks"&&Vp(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":js(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ci(t),this._valueRange=Ci(this.max)-Ci(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ci(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}function Cu(e){const t=e.ticks;if(t.display&&e.display){const n=Se(t.backdropPadding);return Ct(t.font&&t.font.size,oe.font.size)+n.height}return 0}function JR(e,t,n){return n=Gt(n)?n:[n],{w:JD(e,t.string,n),h:n.length*t.lineHeight}}function qg(e,t,n,i,r){return e===i||e===r?{start:t-n/2,end:t+n/2}:e<i||e>r?{start:t-n,end:t}:{start:t,end:t+n}}function tE(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),i=[],r=[],s=e._pointLabels.length,a=e.options.pointLabels,l=a.centerPointLabels?Et/s:0;for(let u=0;u<s;u++){const d=a.setContext(e.getPointLabelContext(u));r[u]=d.padding;const f=e.getPointPosition(u,e.drawingArea+r[u],l),m=ce(d.font),g=JR(e.ctx,m,e._pointLabels[u]);i[u]=g;const _=He(e.getIndexAngle(u)+l),x=Math.round(va(_)),v=qg(x,f.x,g.w,0,180),S=qg(x,f.y,g.h,90,270);eE(n,t,_,v,S)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=rE(e,i,r)}function eE(e,t,n,i,r){const s=Math.abs(Math.sin(n)),a=Math.abs(Math.cos(n));let l=0,u=0;i.start<t.l?(l=(t.l-i.start)/s,e.l=Math.min(e.l,t.l-l)):i.end>t.r&&(l=(i.end-t.r)/s,e.r=Math.max(e.r,t.r+l)),r.start<t.t?(u=(t.t-r.start)/a,e.t=Math.min(e.t,t.t-u)):r.end>t.b&&(u=(r.end-t.b)/a,e.b=Math.max(e.b,t.b+u))}function nE(e,t,n){const i=e.drawingArea,{extra:r,additionalAngle:s,padding:a,size:l}=n,u=e.getPointPosition(t,i+r+a,s),d=Math.round(va(He(u.angle+se))),f=aE(u.y,l.h,d),m=sE(d),g=oE(u.x,l.w,m);return{visible:!0,x:u.x,y:f,textAlign:m,left:g,top:f,right:g+l.w,bottom:f+l.h}}function iE(e,t){if(!t)return!0;const{left:n,top:i,right:r,bottom:s}=e;return!(ai({x:n,y:i},t)||ai({x:n,y:s},t)||ai({x:r,y:i},t)||ai({x:r,y:s},t))}function rE(e,t,n){const i=[],r=e._pointLabels.length,s=e.options,{centerPointLabels:a,display:l}=s.pointLabels,u={extra:Cu(s)/2,additionalAngle:a?Et/r:0};let d;for(let f=0;f<r;f++){u.padding=n[f],u.size=t[f];const m=nE(e,f,u);i.push(m),l==="auto"&&(m.visible=iE(m,d),m.visible&&(d=m))}return i}function sE(e){return e===0||e===180?"center":e<180?"left":"right"}function oE(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function aE(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function lE(e,t,n){const{left:i,top:r,right:s,bottom:a}=n,{backdropColor:l}=t;if(!St(l)){const u=Oi(t.borderRadius),d=Se(t.backdropPadding);e.fillStyle=l;const f=i-d.left,m=r-d.top,g=s-i+d.width,_=a-r+d.height;Object.values(u).some(x=>x!==0)?(e.beginPath(),Vr(e,{x:f,y:m,w:g,h:_,radius:u}),e.fill()):e.fillRect(f,m,g,_)}}function cE(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let r=t-1;r>=0;r--){const s=e._pointLabelItems[r];if(!s.visible)continue;const a=i.setContext(e.getPointLabelContext(r));lE(n,a,s);const l=ce(a.font),{x:u,y:d,textAlign:f}=s;cr(n,e._pointLabels[r],u,d+l.lineHeight/2,l,{color:a.color,textAlign:f,textBaseline:"middle"})}}function jg(e,t,n,i){const{ctx:r}=e;if(n)r.arc(e.xCenter,e.yCenter,t,0,ee);else{let s=e.getPointPosition(0,t);r.moveTo(s.x,s.y);for(let a=1;a<i;a++)s=e.getPointPosition(a,t),r.lineTo(s.x,s.y)}}function uE(e,t,n,i,r){const s=e.ctx,a=t.circular,{color:l,lineWidth:u}=t;!a&&!i||!l||!u||n<0||(s.save(),s.strokeStyle=l,s.lineWidth=u,s.setLineDash(r.dash||[]),s.lineDashOffset=r.dashOffset,s.beginPath(),jg(e,n,a,i),s.closePath(),s.stroke(),s.restore())}function dE(e,t,n){return Ri(e,{label:n,index:t,type:"pointLabel"})}class fE extends Va{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:ka.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=Se(Cu(this.options)/2),n=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(n,i)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=le(t)&&!isNaN(t)?t:0,this.max=le(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Cu(this.options))}generateTickLabels(t){Va.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,i)=>{const r=Jt(this.options.pointLabels.callback,[n,i],this);return r||r===0?r:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?tE(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,r){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,r))}getIndexAngle(t){const n=ee/(this._pointLabels.length||1),i=this.options.startAngle||0;return He(t*n+ve(i))}getDistanceFromCenterForValue(t){if(St(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(St(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const i=n[t];return dE(this.getContext(),t,i)}}getPointPosition(t,n,i=0){const r=this.getIndexAngle(t)-se+i;return{x:Math.cos(r)*n+this.xCenter,y:Math.sin(r)*n+this.yCenter,angle:r}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:i,right:r,bottom:s}=this._pointLabelItems[t];return{left:n,top:i,right:r,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),jg(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:i,grid:r,border:s}=n,a=this._pointLabels.length;let l,u,d;if(n.pointLabels.display&&cE(this,a),r.display&&this.ticks.forEach((f,m)=>{if(m!==0||m===0&&this.min<0){u=this.getDistanceFromCenterForValue(f.value);const g=this.getContext(m),_=r.setContext(g),x=s.setContext(g);uE(this,_,u,a,x)}}),i.display){for(t.save(),l=a-1;l>=0;l--){const f=i.setContext(this.getPointLabelContext(l)),{color:m,lineWidth:g}=f;!g||!m||(t.lineWidth=g,t.strokeStyle=m,t.setLineDash(f.borderDash),t.lineDashOffset=f.borderDashOffset,u=this.getDistanceFromCenterForValue(n.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,n=this.options,i=n.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&&!n.reverse)return;const d=i.setContext(this.getContext(u)),f=ce(d.font);if(s=this.getDistanceFromCenterForValue(this.ticks[u].value),d.showLabelBackdrop){t.font=f.string,a=t.measureText(l.label).width,t.fillStyle=d.backdropColor;const m=Se(d.backdropPadding);t.fillRect(-a/2-m.left,-s-f.size/2-m.top,a+m.width,f.size+m.height)}cr(t,l.label,0,-s,f,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),t.restore()}drawTitle(){}}const Ya={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}},ln=Object.keys(Ya);function Gg(e,t){return e-t}function Kg(e,t){if(St(t))return null;const n=e._adapter,{parser:i,round:r,isoWeekday:s}=e._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),le(a)||(a=typeof i=="string"?n.parse(a,i):n.parse(a)),a===null?null:(r&&(a=r==="week"&&(Ai(s)||s===!0)?n.startOf(a,"isoWeek",s):n.startOf(a,r)),+a)}function Xg(e,t,n,i){const r=ln.length;for(let s=ln.indexOf(e);s<r-1;++s){const a=Ya[ln[s]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-t)/(l*a.size))<=i)return ln[s]}return ln[r-1]}function hE(e,t,n,i,r){for(let s=ln.length-1;s>=ln.indexOf(n);s--){const a=ln[s];if(Ya[a].common&&e._adapter.diff(r,i,a)>=t-1)return a}return ln[n?ln.indexOf(n):0]}function pE(e){for(let t=ln.indexOf(e)+1,n=ln.length;t<n;++t)if(Ya[ln[t]].common)return ln[t]}function Zg(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:i,hi:r}=Kc(n,t),s=n[i]>=t?n[i]:n[r];e[s]=!0}}function mE(e,t,n,i){const r=e._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=n[l],u>=0&&(t[u].major=!0);return t}function Qg(e,t,n){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||!n?i:mE(e,i,r,n)}class Au extends hr{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,n={}){const i=t.time||(t.time={}),r=this._adapter=new Um._date(t.adapters.date);r.init(n),$s(i.displayFormats,r.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:Kg(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=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=le(r)&&!isNaN(r)?r:+n.startOf(Date.now(),i),s=le(s)&&!isNaN(s)?s:+n.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 n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],i=t[t.length-1]),{min:n,max:i}}buildTicks(){const t=this.options,n=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=UD(r,s,a);return this._unit=n.unit||(i.autoSkip?Xg(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):hE(this,l.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:pE(this._unit),this.initOffsets(r),t.reverse&&l.reverse(),Qg(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,i=0,r,s;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?n=1-r:n=(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;n=Re(n,0,a),i=Re(i,0,a),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,r=this.options,s=r.time,a=s.unit||Xg(s.minUnit,n,i,this._getLabelCapacity(n)),l=Ct(r.ticks.stepSize,1),u=a==="week"?s.isoWeekday:!1,d=Ai(u)||u===!0,f={};let m=n,g,_;if(d&&(m=+t.startOf(m,"isoWeek",u)),m=+t.startOf(m,d?"day":a),t.diff(i,n,a)>1e5*l)throw new Error(n+" and "+i+" are too far apart with stepSize of "+l+" "+a);const x=r.ticks.source==="data"&&this.getDataTimestamps();for(g=m,_=0;g<i;g=+t.add(g,l,a),_++)Zg(f,g,x);return(g===i||r.bounds==="ticks"||_===1)&&Zg(f,g,x),Object.keys(f).sort(Gg).map(v=>+v)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){const r=this.options.time.displayFormats,s=this._unit,a=n||r[s];return this._adapter.format(t,a)}_tickFormatFunction(t,n,i,r){const s=this.options,a=s.ticks.callback;if(a)return Jt(a,[t,n,i],this);const l=s.time.displayFormats,u=this._unit,d=this._majorUnit,f=u&&l[u],m=d&&l[d],g=i[n],_=d&&m&&g&&g.major;return this._adapter.format(t,r||(_?m:f))}generateTickLabels(t){let n,i,r;for(n=0,i=t.length;n<i;++n)r=t[n],r.label=this._tickFormatFunction(r.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+i)*n.factor)}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,i=this.ctx.measureText(t).width,r=ve(this.isHorizontal()?n.maxRotation:n.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 n=this.options.time,i=n.displayFormats,r=i[n.unit]||i.millisecond,s=this._tickFormatFunction(t,0,Qg(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||[],n,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(n=0,i=r.length;n<i;++n)t=t.concat(r[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,i;if(t.length)return t;const r=this.getLabels();for(n=0,i=r.length;n<i;++n)t.push(Kg(this,r[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Gp(t.sort(Gg))}}function qa(e,t,n){let i=0,r=e.length-1,s,a,l,u;n?(t>=e[i].pos&&t<=e[r].pos&&({lo:i,hi:r}=oi(e,"pos",t)),{pos:s,time:l}=e[i],{pos:a,time:u}=e[r]):(t>=e[i].time&&t<=e[r].time&&({lo:i,hi:r}=oi(e,"time",t)),{time:s,pos:l}=e[i],{time:a,pos:u}=e[r]);const d=a-s;return d?l+(u-l)*(t-s)/d:l}class gE extends Au{static id="timeseries";static defaults=Au.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=qa(n,this.min),this._tableRange=qa(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,r=[],s=[];let a,l,u,d,f;for(a=0,l=t.length;a<l;++a)d=t[a],d>=n&&d<=i&&r.push(d);if(r.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(a=0,l=r.length;a<l;++a)f=r[a+1],u=r[a-1],d=r[a],Math.round((f+u)/2)!==d&&s.push({time:d,pos:a/(l-1)});return s}_generate(){const t=this.min,n=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(n)||i.length===1)&&i.push(n),i.sort((r,s)=>r-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?t=this.normalize(n.concat(i)):t=n.length?n:i,t=this._cache.all=t,t}getDecimalForValue(t){return(qa(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return qa(this._table,i*this._tableRange+this._minPos,!0)}}var yE=Object.freeze({__proto__:null,CategoryScale:jR,LinearScale:KR,LogarithmicScale:QR,RadialLinearScale:fE,TimeScale:Au,TimeSeriesScale:gE});const _E=[_A,KO,$R,yE];function bE(e){const n=`barChartTooltipPosition-${e.tooltipState.chartID}`,i={enabled:!1,position:n,callbacks:{label:u=>({label:u.dataset.label,value:u.label})}};Ye.positioners[n]=function(u,d){if(!u.length||e.tooltipState.interactionMode==="interactive"||d.x===null||d.y===null)return!1;const f=this.chart.canvas.getBoundingClientRect(),m=e.tooltipState.width||this.width,g=f.width/2,_=Za(d,m,g),x=d.y,v=d.x<g?"left":"center";return{x:_-e.tooltipState.offsetX,y:x-e.tooltipState.offsetY,xAlign:v}},gu.modes.customInteractionMode=function(u,d){const f=Ei(d,u),m=[];return gu.evaluateInteractionItems(u,u.options.indexAxis||"x",f,(g,_,x)=>{u.options.indexAxis==="y"&&g.inYRange(f.y,!0)&&u.data.datasets[_].data[x]&&m.push({element:g,datasetIndex:_,index:x}),u.options.indexAxis==="x"&&f.x!==null&&g.inXRange(f.x,!0)&&u.data.datasets[_].data[x]&&m.push({element:g,datasetIndex:_,index:x})}),m};const r=e.numLabels.value>25?h0:p0,s=({chart:u,index:d})=>{const f=u.data;return{size:r,style:f?.isLabelEmpty?.[d]?"italic":"normal"}},a=(u,d,f)=>u.chart.options.indexAxis===u.axis?(d=u.getLabelForValue(f),d&&d.length>Qa?d.slice(0,Qa)+"...":d):u.getLabelForValue(Number(d)),l=h.computed(()=>({indexAxis:e.indexAxis,skipNull:!0,scales:{x:{stacked:e.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:e.indexAxis==="y"?!St(e.metricAxesTitle?.value):!St(e.dimensionAxesTitle?.value),text:e.indexAxis==="y"?e.metricAxesTitle?.value:e.dimensionAxesTitle?.value,padding:{top:3,bottom:0,left:0,right:0},font:{weight:"bold"}}},y:{stacked:e.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:e.indexAxis==="x"?!St(e.metricAxesTitle?.value):!St(e.dimensionAxesTitle?.value),text:e.indexAxis==="x"?e.metricAxesTitle?.value:e.dimensionAxesTitle?.value,padding:{bottom:3,top:0,left:0,right:0},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},tooltip:{...i,external:u=>{u0(e.tooltipState,u)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1,layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return h.getCurrentInstance()&&h.onUnmounted(()=>{Ye.positioners[n]&&delete Ye.positioners[n]}),l}on.register(..._E);const xE=(e,t)=>{const n=t.datasets.map(r=>r.label),i=e.datasets.map(r=>r.label);return e.datasets.length===t.datasets.length&&n.every((r,s)=>r===i[s])};function wE(e,t,n,i,r){const s=h.shallowRef(null),a=(l,u)=>{if(t.value)return new on(t.value,{type:e,data:l,plugins:i,options:u})};return h.onMounted(()=>{s.value=a(n.value,r.value)}),h.onBeforeUnmount(()=>{St(s.value)||s.value.destroy()}),h.watch(n,(l,u)=>{if(xE(u,l)&&!St(s.value)){for(const[d,f]of l.datasets.entries())Object.assign(s.value.data.datasets[d],f);s.value.data.labels=l.labels,s.value.update()}else St(s.value)||s.value.destroy(),s.value=a(l,r.value)}),h.watch(t,()=>{St(s.value)||s.value.destroy(),s.value=a(n.value,r.value)}),h.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))&&(St(s.value)||s.value.destroy(),s.value=a(n.value,l))}),s}const Jg=1e3,vE=1e4,t0=1e6,e0=1e9,n0=1e12,co=(e,t)=>{if(t.separator===!1||e<1e3)return e.toString();const n=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(e).toString().split("").reverse().forEach((s,a)=>{a&&a%3===0&&i.push(n),i.push(s)}),i.reverse().join("")},Kr=(e,t,n)=>{const i=e/t,r=n.round?"round":"floor";if(n.decimal===!1)return Math[r](i).toString();let s;n.precision?s=i:s=i<10?Math[r](i*10)/10:Math[r](i);let a=s.toString();return typeof n.decimal=="string"&&(a=a.replace(".",n.decimal)),a};function uo(e,t={}){let n;const i=e<0;i&&(e=Math.abs(e)),t.precision&&(e=parseFloat(e.toPrecision(t.precision)));const r=t.min10k?vE:Jg;return e<r||t.precision&&t.precision>Math.log10(e)?n=co(Kr(e,1,t),t):e<t0?n=`${Kr(e,Jg,t)}k`:e<e0?n=`${Kr(e,t0,t)}m`:e<n0?n=`${co(Kr(e,e0,t),t)}b`:n=`${co(Kr(e,n0,t),t)}t`,i&&(n=`-${n}`),t.capital&&(n=n.toUpperCase()),t.prefix&&(n=`${t.prefix}${n}`),t.suffix&&(n=`${n}${t.suffix}`),n}uo.addCommas=co;function SE(e,t,n){const{i18n:i}=Tt.useI18n(),{formatBytes:r}=ni({i18n:i}),{translateUnit:s}=Tt.useTranslatedUnits();return{legendValues:h.computed(()=>e.value.datasets.reduce((l,u)=>{const d=u.total?u.total:u.data.reduce((g,_)=>g+(typeof _=="number"?Number(_)||0:Number(_&&_.y)||0),0);let f;const m=u.unit??n.value;if(m==="bytes")f=r(d);else{const g=s(m,d);f=i&&i.t("legend.datapointValueDisplay",{value:uo(d,{capital:!0}),unit:g})||`${uo(d,{capital:!0})} ${m}`}return{...l,[u.label]:{raw:d,formatted:f,isThreshold:u.isThreshold}}},{}))}}function TE(e){return h.computed(()=>{if(!e.value?.meta)return"";const n=e.value.meta.start,i=e.value.meta.end;return n&&i?`${Uh(new Date(n))} - ${Uh(new Date(i),{includeTZ:!0})}`:""})}function ME(e){const n=`donutChartTooltipPosition-${e.tooltipState.chartID}`,i={enabled:!1,position:n,callbacks:{label:s=>({label:s.dataset.label,value:s.label})}};Ye.positioners[n]=function(s,a){if(!s.length||a.x===null||a.y===null)return!1;const l=this.chart.canvas.getBoundingClientRect(),u=e.tooltipState.width||this.width,d=l.width/2,f=Za(a,u,d),m=a.y,g=a.x<d?"left":"center";return{x:f-e.tooltipState.offsetX,y:m,xAlign:g}};const r=h.computed(()=>({cutout:"65%",responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},tooltip:{...i,external:s=>{u0(e.tooltipState,s)}}},layout:{padding:{left:0,right:0,top:5,bottom:0}}}));return h.onUnmounted(()=>{Ye.positioners[n]&&delete Ye.positioners[n]}),{options:r}}function kE(e){const t=h.computed(()=>({type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:f=>{const m=new Date(f);return E0({tickValue:m,granularity:e.granularity.value,dayBoundaryCrossed:u.value})}},title:{display:!St(e.dimensionAxesTitle?.value),text:e.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}},border:{display:!1},stacked:e.stacked.value})),n=h.computed(()=>!!e.rightYAxis?.value),i=h.computed(()=>({title:{display:!St(e.metricAxesTitle?.value),text:e.metricAxesTitle?.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1,...e.leftYAxisGrid?.value===!1?{drawOnChartArea:!1}:{}},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:e.stacked.value,...n.value?{display:"auto"}:{}})),r=h.computed(()=>{const f=e.rightYAxis?.value;if(f)return{display:"auto",position:"right",title:{display:!St(f.title),text:f.title,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1,drawOnChartArea:f.showGrid??!1},beginAtZero:!0,border:{display:!1},stacked:e.stacked.value}}),a=`lineChartTooltipPosition-${e.tooltipState.chartID}`,l={enabled:!1,position:a};Ye.positioners[a]=function(f,m){if(!f.length||e.tooltipState.interactionMode==="interactive"||m.x===null||m.y===null)return!1;const g=this.chart.canvas.getBoundingClientRect(),_=e.tooltipState.width||this.width,x=e.tooltipState.height||this.height,v=g.width/2,S=g.height/2,C=Za(m,_,v);let O=d0(m,x,S);const B=m.y<S?"top":"bottom",I=m.x<v?"left":"center";return x>g.height&&(O=0),{x:C,y:O,xAlign:I,yAlign:B}};const u=h.computed(()=>{const f=Number(e.timeRangeMs.value),m=new Date,g=new Date(m.getTime()-f);return Cp(f)>24||g.getDate()!==m.getDate()}),d=h.computed(()=>({hover:{mode:"index",intersect:!1},elements:{point:{radius:e.pointsWithoutHover?.value?3:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:i.value,...r.value?{[Eu]:r.value}:{}},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},streaming:!1,tooltip:{...l,external:f=>{Ou(e.tooltipState,f,e.granularity.value)}},thresholdPlugin:{threshold:e.threshold?.value}},interaction:{mode:"index",intersect:!1},layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return h.onUnmounted(()=>{Ye.positioners[a]&&delete Ye.positioners[a]}),{options:d}}const DE=["usd","bytes"],CE="usd";function AE(e){const{i18n:t}=Tt.useI18n(),{formatUnit:n}=ni({i18n:t}),i=(_,x)=>!x||!DE.includes(x)?_:_===0&&x===CE?t.formatNumber(0,{style:"currency",currency:"USD"}):n(_,x),r=h.computed(()=>{const _=Number(e.timeRangeMs.value),x=new Date,v=new Date(x.getTime()-_);return Cp(_)>24||v.getDate()!==x.getDate()}),s=h.computed(()=>({display:!St(e.dimensionAxesTitle?.value),text:e.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}})),a=h.computed(()=>({type:"linear",display:!0,beginAtZero:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{maxRotation:0,maxTicksLimit:7,callback:_=>i(_,e.xMetricUnit?.value)},title:s.value,border:{display:!1}})),l=h.computed(()=>({type:"time",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:_=>E0({tickValue:new Date(_),granularity:e.granularity.value,dayBoundaryCrossed:r.value})},title:s.value,border:{display:!1}})),u=h.computed(()=>({title:{display:!St(e.metricAxesTitle?.value),text:e.metricAxesTitle?.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5,callback:_=>i(_,e.metricUnit?.value)},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1}})),d=(_,x,v)=>{const S=v?.timestamp;return S===void 0?"":Jr({tickValue:new Date(S),granularity:x})},m=`scatterChartTooltipPosition-${e.tooltipState.chartID}`;Ye.positioners[m]=function(_,x){if(!_.length||e.tooltipState.interactionMode==="interactive"||x.x===null||x.y===null)return!1;const v=this.chart.canvas.getBoundingClientRect(),S=e.tooltipState.width||this.width,C=e.tooltipState.height||this.height,O=v.width/2,B=v.height/2,I=Za(x,S,O);let N=d0(x,C,B);const W=x.y<B?"top":"bottom",U=x.x<O?"left":"center";return C>v.height&&(N=0),{x:I,y:N,xAlign:U,yAlign:W}};const g=h.computed(()=>({hover:{mode:"nearest",intersect:!1},interaction:{mode:"nearest",intersect:!1},animation:{duration:250,easing:"linear"},scales:{x:e.xMetric?.value?a.value:l.value,y:u.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},streaming:!1,tooltip:{enabled:!1,position:m,external:_=>{Ou(e.tooltipState,_,e.granularity.value,{...e.xMetric?.value?{contextFormatter:d}:{}})}},outlierBandPlugin:{value:e.outlierValue?.value,color:e.themeColors.value.outlierBand},referenceLinePlugin:{lines:e.referenceLines?.value}},layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return h.onUnmounted(()=>{Ye.positioners[m]&&delete Ye.positioners[m]}),{options:g}}function OE(e){const{isMultiMetric:t,hasDimensions:n,metricNames:i,barSegmentLabels:r,pivotRecords:s,rowLabels:a,colorPalette:l,seriesDimension:u}=e,{i18n:d}=Tt.useI18n(),{evaluateFeatureFlag:f}=Tt.useEvaluateFeatureFlag(),m=f("analytics-color-updates",!1);return t?i.map(g=>({label:d&&d.te(`chartLabels.${g}`)&&d.t(`chartLabels.${g}`)||g,backgroundColor:m?ca({metric:g}):Pu(i.indexOf(g),Kn),data:a.map((_,x)=>n?s[`${_.id},${g}`]||0:s[`${x},${g}`]||null)})):Array.from(r).flatMap((g,_)=>g?{label:d&&d.te(`chartLabels.${g.name}`)&&d.t(`chartLabels.${g.name}`)||g.name,backgroundColor:m?ca({dimension:u,dimensionValue:g.id}):Iu(_,g.name,g.id==="empty",l??Kn),data:a.map(x=>s[`${x.id},${g.id}`]||null),isSegmentEmpty:g.id==="empty"}:[])}function RE(e,t){const{i18n:n}=Tt.useI18n();return h.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,f=d&&l.length>1;if(!r.length||!a)return{datasets:[],labels:[]};const m=d&&l||a,g=m[0],_=m.length>1?m[1]:m[0],x=Object.fromEntries(u?r.flatMap(w=>a.map((A,L)=>{const $=w.event[g],q=d?`${$},${A}`:`${L},${A}`,st=w.event[A];return[q,st]})):r.map(w=>{const A=d?`${w.event[g]},${w.event[_]}`:`${g},${_}`,L=w.event[a[0]];return[A,L]})),v=Object.keys(x).reduce((w,A)=>{const[L]=A.split(","),$=x[A];return w[L]?w[L]+=$:w[L]=$,w},{}),S=Object.entries(v).sort(([,w],[,A])=>Number(A)-Number(w)).map(([w])=>w),C=s[g],O=s[_];let B=d&&C&&Object.entries(C).map(([w,A])=>({id:w,name:A.name}))||a.map(w=>({id:w,name:w})),I=d&&O&&Object.entries(O).map(([w,A])=>({id:w,name:A.name}))||a.map(w=>({id:w,name:w}));if(d&&g==="country_code"&&(B=B.map(w=>({...w,name:Cc(w.id)||w.name}))),d&&_==="country_code"&&(I=I.map(w=>({...w,name:Cc(w.id)||w.name}))),g!=="status_code"&&g!=="status_code_grouped"&&(B.sort((w,A)=>S.indexOf(w.id)-S.indexOf(A.id)),I.sort((w,A)=>S.indexOf(w.id)-S.indexOf(A.id))),!B||!I)return{labels:[],datasets:[]};const N=OE({isMultiMetric:u,hasDimensions:d,metricNames:a,dimensionFieldNames:m,barSegmentLabels:I,pivotRecords:x,rowLabels:B,seriesDimension:_,colorPalette:e.colorPalette||Kn}),W=d?B.map(w=>n&&n.te(`chartLabels.${w.name}`)&&n.t(`chartLabels.${w.name}`)||w.name):a.map(w=>n&&n.te(`chartLabels.${w}`)&&n.t(`chartLabels.${w}`)||w),U=B.map(w=>w.id==="empty");return{labels:W,datasets:N,isLabelEmpty:U,isMultiDimension:f}}}catch(r){return console.error(r),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const EE=(e,t,n=1)=>Array(Math.ceil((t-e)/n)).fill(e).map((i,r)=>i+r*n),PE=e=>{if(typeof e=="string"){const t=+e;if(t)return t;try{return Ap(e).getTime()}catch(n){if(n instanceof RangeError)return 0;throw n}}return e},IE=(e,t,n,i,r)=>{const a=Math.max(t-6e4,Math.max(...(r||[]).map(d=>new Date(d.timestamp).valueOf()))),l=Math.floor((e-i)/n)*n+i,u=Math.floor((a-i)/n)*n+i+n;return EE(l,u,n)};function LE(e,t){const{i18n:n}=Tt.useI18n(),{evaluateFeatureFlag:i}=Tt.useEvaluateFeatureFlag(),r=i("analytics-color-updates",!1);return h.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const a=t.value.data,{display:l,metric_names:u,metric_units:d,start:f,end:m}=t.value.meta,g=new Date(f).getTime(),_=new Date(m).getTime();if(!u)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const x=l&&Object.keys(l)||u,v=x&&x[0],S=l?.[v],C=!!S&&u.length>1;let O=l&&S&&Object.keys(S).map(w=>({id:w,name:S[w].name}))||u.map(w=>({id:w,name:w}));v==="country_code"&&(O=O.map(w=>({...w,name:Cc(w.id)||w.name})));const B=t.value.meta.granularity_ms;if(typeof B!="number"||isNaN(B)||!isFinite(B)||B===0)return console.error("Invalid step value:",B),{datasets:[],labels:[]};if(!a.length)return{datasets:[],labels:[]};const I=PE(g),N=IE(g,_,B,I,a),W=a?.length?a.reduce((w,A)=>{const L=new Date(A.timestamp).valueOf(),$=A.event;for(const q of u)L in w||(w[L]={}),q in w[L]||(w[L][q]={});for(const q of u)O.forEach(st=>{(S?$[v]===st.id:q===st.id)?(w[L][q]||(w[L][q]={}),w[L][q][st.id]=Math.round(Number($[q])*1e3)/1e3):x.length||(w[L][q]||(w[L][q]={}),w[L][q][st.id]=Math.round(Number($[st.id])*1e3)/1e3)});return w},{}):{},D=[...S||u.length===1?u.flatMap(w=>O.map(A=>[w,A.id,A.name,A.id==="empty"])):O.map(w=>[w.name,w.id,w.name,w.id==="empty"])].map(([w,A,L,$],q)=>{const st=N.map(P=>P in W&&w in W[P]?{x:P,y:W[P][w][A]||0}:{x:P,y:0});let{colorPalette:ct,fill:ht}=e;St(ct)&&(ct=Kn);const ut=r?ca({dimension:v,dimensionValue:A}):Iu(q,L,$,ct),vt=F0(L)?n.t(`chartLabels.${L}`):L,at=F0(w)?n.t(`chartLabels.${w}`):w,dt=u.findIndex(P=>P===w),V=e.metricAxisMap?.[w]==="right";return{rawDimension:L,rawMetric:w,label:C?`${vt} — ${at}`:vt,borderColor:ut,backgroundColor:ut,data:st,total:st.reduce((P,{y:H})=>P+Number(H),0),...wP,...C?{borderDash:dt===0?[]:[dt*4,2]}:{},...!C&&V?{borderDash:[4,2]}:{},...V?{yAxisID:Eu}:{},...e.metricAxisMap?{unit:d?.[w]??""}:{},fill:ht,borderWidth:ht?SP:vP,isSegmentEmpty:$}});return v==="status_code"||v==="status_code_grouped"?D.sort((w,A)=>(w.label??"")<(A.label??"")?-1:1):D.sort((w,A)=>Number(w.total)<Number(A.total)?-1:1),{datasets:D}}}catch(a){return console.error(a),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const NE=2,BE=.6,i0=1,FE=2,r0=50,zE=[6,4],UE=[2,3],HE=(e,t)=>{const n=Math.sin(t)*1e4;return(n-Math.floor(n))*e};function WE(e,t){const{i18n:n}=Tt.useI18n(),{evaluateFeatureFlag:i}=Tt.useEvaluateFeatureFlag(),r=i("analytics-color-updates",!1),s=(a,l)=>l||(a===r0?n.t("scatter.median"):n.t("scatter.percentile",{value:a}));return h.computed(()=>{try{const a=t.value;if(!a?.points?.length)return{datasets:[]};const{metric:l,dimension:u,display:d,xMetric:f,xMetricUnit:m}=a,g=f?n.te(`chartLabels.${f}`)&&n.t(`chartLabels.${f}`)||f:"",_=e.scatter||{},x=_.jitterMs??0,v=_.pointRadius??NE,S=_.pointOpacity??BE,C=new Map,O=[];a.points.forEach(q=>{const st=q.group??l,ct=C.get(st)||[];let ht,ut;q.x!==void 0?(ht={x:q.x,timestamp:q.timestamp},ut=[{label:g,value:q.x,...m?{unit:m}:{}},...q.extras??[]]):(ht={x:q.timestamp+HE(x,q.timestamp+q.value)},ut=q.extras??[]),ct.push({...ht,y:q.value,...ut.length?{extras:ut}:{}}),C.set(st,ct),O.push(q.value)});const B=_.percentileLines||[],I=[...B.map(q=>q.percentile),..._.outlierPercentile!==void 0?[_.outlierPercentile]:[]],N=I.length?f2(O,I):new Map,W=_.outlierPercentile!==void 0?N.get(_.outlierPercentile):void 0,U=W!==void 0&&Number.isFinite(W),D=St(e.colorPalette)?Kn:e.colorPalette,w=e.themeColors?.value??Xu(),A=[],L=q=>{const st=q?.y;return U&&Number.isFinite(st)&&st>W};Array.from(C.entries()).forEach(([q,st],ct)=>{const ht=u&&d?.[q]?.name||q,ut=q==="empty",vt=r?ca({dimension:u,dimensionValue:q}):Iu(ct,ht,ut,D),at=Ku(vt,S),dt=n.te(`chartLabels.${ht}`)&&n.t(`chartLabels.${ht}`)||ht;A.push({type:"scatter",rawDimension:ht,rawMetric:l,label:dt,borderColor:V=>L(V.raw)?w.outlier:vt,backgroundColor:V=>L(V.raw)?w.outlier:at,pointRadius:V=>L(V.raw)?v+i0:v,pointHoverRadius:V=>(L(V.raw)?v+i0:v)+FE,data:st,pointBorderWidth:0,showLine:!1,isSegmentEmpty:ut})});const $=[];return B.forEach(q=>{const st=N.get(q.percentile);if(st===void 0||!Number.isFinite(st))return;const ct=q.percentile===r0;$.push({percentile:q.percentile,label:s(q.percentile,q.label),value:st,color:q.color||(ct?w.medianLine:w.outlier),borderDash:q.borderDash||(ct?zE:UE)})}),{datasets:A,...U?{outlier:{value:W,label:n.t("scatter.outlier",{label:s(_.outlierPercentile)}),color:w.outlier}}:{},...$.length?{referenceLines:$}:{}}}catch(a){return console.warn(a),{datasets:[]}}})}const $E=(e,t)=>{h.watch([e,t],(n,i,r)=>{const[s,a]=n;!a||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(a,s),r(()=>{window._AnalyticsChartDataInternal?.delete(a)}))},{immediate:!0})};function VE(){const{i18n:e}=Tt.useI18n();return{translateUnit:(n,i)=>{const r=i===1,s=`chartUnits.${n}`;return el(n)?"":e.te(s)?e.t(s,{plural:r?"":"s"}):n}}}const YE="analytics-query-provider",s0=2;function qE(){const e=h.inject(YE);return{evaluateFeatureFlag:(n,i)=>typeof e?.evaluateFeatureFlagFn!="function"?i:e.evaluateFeatureFlagFn(n,i)}}function o0(e,t){return h.getCurrentScope()?(h.onScopeDispose(e,t),!0):!1}const a0=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const jE=e=>e!=null,GE=Object.prototype.toString,KE=e=>GE.call(e)==="[object Object]";function ja(e){return Array.isArray(e)?e:[e]}function XE(e){return h.getCurrentInstance()}function ZE(e,t={}){if(!h.isRef(e))return h.toRefs(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const i in e.value)n[i]=h.customRef(()=>({get(){return e.value[i]},set(r){var s;if(!((s=h.toValue(t.replaceRef))!==null&&s!==void 0)||s)if(Array.isArray(e.value)){const a=[...e.value];a[i]=r,e.value=a}else{const a={...e.value,[i]:r};Object.setPrototypeOf(a,Object.getPrototypeOf(e.value)),e.value=a}else e.value[i]=r}}));return n}function QE(e,t=!0,n){XE()?h.onMounted(e,n):t?e():h.nextTick(e)}function JE(e,t,n){return h.watch(e,t,{...n,immediate:!0})}const Ga=a0?window:void 0;function Xr(e){var t;const n=h.toValue(e);return(t=n?.$el)!==null&&t!==void 0?t:n}function fo(...e){const t=(i,r,s,a)=>(i.addEventListener(r,s,a),()=>i.removeEventListener(r,s,a)),n=h.computed(()=>{const i=ja(h.toValue(e[0])).filter(r=>r!=null);return i.every(r=>typeof r!="string")?i:void 0});return JE(()=>{var i,r;return[(i=(r=n.value)===null||r===void 0?void 0:r.map(s=>Xr(s)))!==null&&i!==void 0?i:[Ga].filter(s=>s!=null),ja(h.toValue(n.value?e[1]:e[0])),ja(h.unref(n.value?e[2]:e[1])),h.toValue(n.value?e[3]:e[2])]},([i,r,s,a],l,u)=>{if(!i?.length||!r?.length||!s?.length)return;const d=KE(a)?{...a}:a,f=i.flatMap(m=>r.flatMap(g=>s.map(_=>t(m,g,_,d))));u(()=>{f.forEach(m=>m())})},{flush:"post"})}function tP(){const e=h.shallowRef(!1),t=h.getCurrentInstance();return t&&h.onMounted(()=>{e.value=!0},t),e}function l0(e){const t=tP();return h.computed(()=>(t.value,!!e()))}function eP(e,t,n={}){const{window:i=Ga,...r}=n;let s;const a=l0(()=>i&&"MutationObserver"in i),l=()=>{s&&(s.disconnect(),s=void 0)},u=h.watch(h.computed(()=>{const m=ja(h.toValue(e)).map(Xr).filter(jE);return new Set(m)}),m=>{l(),a.value&&m.size&&(s=new MutationObserver(t),m.forEach(g=>s.observe(g,r)))},{immediate:!0,flush:"post"}),d=()=>s?.takeRecords(),f=()=>{u(),l()};return o0(f),{isSupported:a,stop:f,takeRecords:d}}const Ka={speed:2,margin:30,direction:"both"};function nP(e){e.scrollLeft>e.scrollWidth-e.clientWidth&&(e.scrollLeft=Math.max(0,e.scrollWidth-e.clientWidth)),e.scrollTop>e.scrollHeight-e.clientHeight&&(e.scrollTop=Math.max(0,e.scrollHeight-e.clientHeight))}function iP(e,t={}){var n,i,r,s;const{pointerTypes:a,preventDefault:l,stopPropagation:u,exact:d,onMove:f,onEnd:m,onStart:g,initialValue:_,axis:x="both",draggingElement:v=Ga,containerElement:S,handle:C=e,buttons:O=[0],restrictInView:B,autoScroll:I=!1}=t,N=h.ref((n=h.toValue(_))!==null&&n!==void 0?n:{x:0,y:0}),W=h.ref(),U=V=>a?a.includes(V.pointerType):!0,D=V=>{h.toValue(l)&&V.preventDefault(),h.toValue(u)&&V.stopPropagation()},w=h.toValue(I),A=typeof w=="object"?{speed:(i=h.toValue(w.speed))!==null&&i!==void 0?i:Ka.speed,margin:(r=h.toValue(w.margin))!==null&&r!==void 0?r:Ka.margin,direction:(s=w.direction)!==null&&s!==void 0?s:Ka.direction}:Ka,L=V=>typeof V=="number"?[V,V]:[V.x,V.y],$=(V,P,H)=>{const{clientWidth:nt,clientHeight:ot,scrollLeft:X,scrollTop:tt,scrollWidth:rt,scrollHeight:pt}=V,[yt,mt]=L(A.margin),[Rt,Ft]=L(A.speed);let G=0,it=0;(A.direction==="x"||A.direction==="both")&&(H.x<yt&&X>0?G=-Rt:H.x+P.width>nt-yt&&X<rt-nt&&(G=Rt)),(A.direction==="y"||A.direction==="both")&&(H.y<mt&&tt>0?it=-Ft:H.y+P.height>ot-mt&&tt<pt-ot&&(it=Ft)),(G||it)&&V.scrollBy({left:G,top:it,behavior:"auto"})};let q=null;const st=()=>{const V=h.toValue(S);V&&!q&&(q=setInterval(()=>{const P=h.toValue(e).getBoundingClientRect(),{x:H,y:nt}=N.value,ot={x:H-V.scrollLeft,y:nt-V.scrollTop};ot.x>=0&&ot.y>=0&&($(V,P,ot),ot.x+=V.scrollLeft,ot.y+=V.scrollTop,N.value=ot)},1e3/60))},ct=()=>{q&&(clearInterval(q),q=null)},ht=(V,P,H,nt)=>{const[ot,X]=typeof H=="number"?[H,H]:[H.x,H.y],{clientWidth:tt,clientHeight:rt}=P;return V.x<ot||V.x+nt.width>tt-ot||V.y<X||V.y+nt.height>rt-X},ut=()=>{if(h.toValue(t.disabled)||!W.value)return;const V=h.toValue(S);if(!V)return;const P=h.toValue(e).getBoundingClientRect(),{x:H,y:nt}=N.value,ot={x:H-V.scrollLeft,y:nt-V.scrollTop};ht(ot,V,A.margin,P)?st():ct()};h.toValue(I)&&h.watch(N,ut);const vt=V=>{var P;if(!h.toValue(O).includes(V.button)||h.toValue(t.disabled)||!U(V)||h.toValue(d)&&V.target!==h.toValue(e))return;const H=h.toValue(S),nt=H==null||(P=H.getBoundingClientRect)===null||P===void 0?void 0:P.call(H),ot=h.toValue(e).getBoundingClientRect(),X={x:V.clientX-(H?ot.left-nt.left+(I?0:H.scrollLeft):ot.left),y:V.clientY-(H?ot.top-nt.top+(I?0:H.scrollTop):ot.top)};g?.(X,V)!==!1&&(W.value=X,D(V))},at=V=>{if(h.toValue(t.disabled)||!U(V)||!W.value)return;const P=h.toValue(S);P instanceof HTMLElement&&nP(P);const H=h.toValue(e).getBoundingClientRect();let{x:nt,y:ot}=N.value;if((x==="x"||x==="both")&&(nt=V.clientX-W.value.x,P&&(nt=Math.min(Math.max(0,nt),P.scrollWidth-H.width))),(x==="y"||x==="both")&&(ot=V.clientY-W.value.y,P&&(ot=Math.min(Math.max(0,ot),P.scrollHeight-H.height))),h.toValue(I)&&P&&(q===null&&$(P,H,{x:nt,y:ot}),nt+=P.scrollLeft,ot+=P.scrollTop),P&&(B||I)){if(x!=="y"){const X=nt-P.scrollLeft;X<0?nt=P.scrollLeft:X>P.clientWidth-H.width&&(nt=P.clientWidth-H.width+P.scrollLeft)}if(x!=="x"){const X=ot-P.scrollTop;X<0?ot=P.scrollTop:X>P.clientHeight-H.height&&(ot=P.clientHeight-H.height+P.scrollTop)}}N.value={x:nt,y:ot},f?.(N.value,V),D(V)},dt=V=>{h.toValue(t.disabled)||!U(V)||W.value&&(W.value=void 0,I&&ct(),m?.(N.value,V),D(V))};if(a0){const V=()=>{var P;return{capture:(P=t.capture)!==null&&P!==void 0?P:!0,passive:!h.toValue(l)}};fo(C,"pointerdown",vt,V),fo(v,"pointermove",at,V),fo(v,["pointerup","pointercancel"],dt,V)}return{...ZE(N),position:N,isDragging:h.computed(()=>!!W.value),style:h.computed(()=>`
|
|
4
|
-
left: ${
|
|
5
|
-
top: ${
|
|
6
|
-
${
|
|
7
|
-
`)}}function rP(e,t,n={}){const{window:i=Ga,...r}=n;let s;const a=l0(()=>i&&"ResizeObserver"in i),l=()=>{s&&(s.disconnect(),s=void 0)},u=h.watch(h.computed(()=>{const f=h.toValue(e);return Array.isArray(f)?f.map(m=>Xr(m)):[Xr(f)]}),f=>{if(l(),a.value&&i){s=new ResizeObserver(t);for(const m of f)m&&s.observe(m,r)}},{immediate:!0,flush:"post"}),d=()=>{l(),u()};return o0(d),{isSupported:a,stop:d}}function sP(e,t={}){const{reset:n=!0,windowResize:i=!0,windowScroll:r=!0,immediate:s=!0,updateTiming:a="sync"}=t,l=h.shallowRef(0),u=h.shallowRef(0),d=h.shallowRef(0),f=h.shallowRef(0),m=h.shallowRef(0),g=h.shallowRef(0),_=h.shallowRef(0),x=h.shallowRef(0);function v(){const C=Xr(e);if(!C){n&&(l.value=0,u.value=0,d.value=0,f.value=0,m.value=0,g.value=0,_.value=0,x.value=0);return}const O=C.getBoundingClientRect();l.value=O.height,u.value=O.bottom,d.value=O.left,f.value=O.right,m.value=O.top,g.value=O.width,_.value=O.x,x.value=O.y}function S(){a==="sync"?v():a==="next-frame"&&requestAnimationFrame(()=>v())}return rP(e,S),h.watch(()=>Xr(e),C=>!C&&S()),eP(e,S,{attributeFilter:["style","class"]}),r&&fo("scroll",S,{capture:!0,passive:!0}),i&&fo("resize",S,{passive:!0}),QE(()=>{s&&S()}),{height:l,bottom:u,left:d,right:f,top:m,width:g,x:_,y:x,update:S}}function oP(e,t){const{top:n,left:i}=sP(e),r=h.computed(()=>e.value?`${parseFloat(t.left)+i.value}px`:t.left),s=h.computed(()=>e.value?`${parseFloat(t.top)+n.value}px`:t.top);return{tooltipAbsoluteLeft:r,tooltipAbsoluteTop:s}}const aP=({bucketCount:e,minStamp:t,maxStamp:n,timestamps:i})=>{const r=[...i].filter(u=>u>=t&&u<=n).sort((u,d)=>u-d),s=[];if(n-t<e-2)return[];const a=(n-t)/e;let l=0;for(let u=0;u<e;u++){const d=t+u*a,f=t+(u+1)*a;let m=0;for(;l<r.length&&r[l]>=d&&r[l]<=f;)m++,l++;s.push([Math.ceil(d),m])}return s},c0=()=>({minCounts:{},maxCounts:{},minStamps:{},maxStamps:{},renderPoints:{}}),ho=h.ref({}),lP=e=>(ho.value[e]||(ho.value[e]=c0()),ho.value[e]),cP=(e,t)=>{const n=ho.value[t];if(!n)return;const i=n.minCounts[e]!==void 0||n.maxCounts[e]!==void 0||n.minStamps[e]!==void 0||n.maxStamps[e]!==void 0||n.renderPoints[e]!==void 0;n&&i&&(delete n.minCounts[e],delete n.maxCounts[e],delete n.minStamps[e],delete n.maxStamps[e],delete n.renderPoints[e],Object.keys(n.minCounts).length||Object.keys(n.maxCounts).length||Object.keys(n.minStamps).length||Object.keys(n.maxStamps).length||Object.keys(n.renderPoints).length||delete ho.value[t])};function uP({chartKey:e,datasets:t,groupKey:n,minStamp:i=void 0,maxStamp:r=void 0,minCount:s=void 0,maxCount:a=void 0,renderPoints:l=void 0,type:u}){const f=n!==void 0&&e!==void 0?lP(n):c0(),m=e!==void 0?e:"static-chart-key",g=h.computed(()=>t.reduce((A,{timestamps:L})=>[...A,...L],[])),_=h.computed(()=>i||g.value.reduce((A,L)=>A===0?L:Math.min(A,L),0)),x=h.computed(()=>r||g.value.reduce((A,L)=>Math.max(A,L),0));h.watchEffect(()=>{f.minStamps[m]=_.value,f.maxStamps[m]=x.value,l!==void 0&&(f.renderPoints[m]=l)});const v=h.computed(()=>Object.values(f.minStamps).reduce((A,L)=>A===0?L:Math.min(A,L),0)),S=h.computed(()=>Object.values(f.maxStamps).reduce((A,L)=>Math.max(A,L),0)),C=h.computed(()=>{const A=Object.values(f.renderPoints);return A.length===0?24:A.reduce((L,$)=>Math.max(L,$),2)}),O=h.computed(()=>{const A=S.value-v.value;return Math.ceil(A/C.value)}),B=h.computed(()=>t.length>1),I=h.computed(()=>t.map(({timestamps:A,color:L,label:$})=>({data:aP({bucketCount:C.value,minStamp:v.value,maxStamp:S.value,timestamps:A}).map(([ct,ht])=>({x:ct,y:ht})),label:$,...(u==="sparkline_bar"||B.value)&&L&&{backgroundColor:L},...u!=="sparkline_bar"&&L&&{borderColor:L},...B.value&&u!=="sparkline_bar"&&{fill:!0}}))),N=h.computed(()=>{const A=I.value[0]?.data?.length??0,L=[];for(let $=0;$<A;$++){let q=0;for(let st=0;st<I.value.length;st++)q+=I.value[st].data[$].y;L.push(q)}return L}),W=h.computed(()=>{const A=N.value.reduce((L,$)=>Math.max(L,$),0);return Math.max(A,a??0)}),U=h.computed(()=>{const A=I.value.reduce((q,{data:st})=>[...q,...st.map(({y:ct})=>ct)],[]),L=A.length?A[0]:0,$=A.reduce((q,st)=>Math.min(q,st),L);return s===void 0?$:Math.min($,s)});h.watchEffect(()=>{f.maxCounts[m]=W.value,f.minCounts[m]=U.value});const D=h.computed(()=>{const A=Object.values(f.minCounts),L=A.length?A[0]:0;return A.reduce(($,q)=>Math.min($,q),L)}),w=h.computed(()=>Object.values(f.maxCounts).reduce((A,L)=>Math.max(A,L),0));return h.onUnmounted(()=>{e!==void 0&&n!==void 0&&cP(e,n)}),{syncedMinStamp:v,syncedMaxStamp:S,syncedRenderPoints:C,syncedChartDatasets:I,syncedGroupSizeMs:O,syncedMinCount:D,syncedMaxCount:w}}const Tt={useBarChartOptions:bE,useChartJSCommon:wE,useChartLegendValues:SE,useChartSelectedRange:TE,useExploreResultToDatasets:RE,useExploreResultToTimeDataset:LE,useScatterDatasets:WE,useDonutChartOptions:ME,useLineChartOptions:kE,useScatterChartOptions:AE,useI18n:iD,useReportChartDataForSynthetics:$E,useTranslatedUnits:VE,useEvaluateFeatureFlag:qE,useTooltipAbsolutePosition:oP,useSparklineSync:uP},Xa=e=>["interactive","zoom-interactive"].includes(e),Ou=(e,t,n,i)=>{const{tooltip:r}=t;if(r.opacity===0&&!Xa(e.interactionMode)){e.showTooltip=!1;return}const{i18n:s}=Tt.useI18n(),{formatUnit:a}=ni({i18n:s}),l=e.chartTooltipSortFn||((u,d)=>d.rawValue-u.rawValue);if(r.body&&!Xa(e.interactionMode)){const u=r.labelColors,d=t.chart.config?.options?.indexAxis==="y"?"x":"y",f=r.dataPoints[0].parsed.x??0;e.tooltipContext=i?.contextFormatter?i.contextFormatter(f,n,r.dataPoints[0].raw):Jr({tickValue:new Date(f),granularity:n}),e.tooltipSeries=r.dataPoints.map((g,_)=>{const x=g.parsed[d],v=g.dataset.unit??e.units,S=a(x??0,v,{translateUnit:e.translateUnit}),C=g.raw?.tooltipLabel||g.dataset.label;return{backgroundColor:u[_].backgroundColor,borderColor:u[_].borderColor,label:C,value:S,rawValue:x,isSegmentEmpty:g.dataset.isSegmentEmpty}}).sort(l);const m=r.dataPoints[0]?.raw?.extras??[];for(const g of m)e.tooltipSeries.push({label:g.label,value:g.unit?a(Number(g.value)||0,g.unit,{translateUnit:e.translateUnit}):String(g.value),rawValue:Number(g.value)||0,isExtra:!0});e.left=`${r.x}px`,e.top=`${r.y}px`,e.showTooltip=!0}},u0=(e,t)=>{const{tooltip:n}=t,{i18n:i}=Tt.useI18n(),{formatUnit:r}=ni({i18n:i});if(n.opacity===0&&!Xa(e.interactionMode)){e.showTooltip=!1;return}const s=e.chartTooltipSortFn||((a,l)=>l.rawValue-a.rawValue);if(n.body&&!Xa(e.interactionMode)){const a=n.labelColors,l=t.chart.config?.options?.indexAxis==="y"?"x":"y",u=["gauge","donut"].includes(e.chartType);u?e.tooltipContext=e.dimensionDisplay||n.dataPoints[0].label:n.chart.data.isMultiDimension?e.tooltipContext=n.dataPoints[0].label:e.tooltipContext=e.dimensionDisplay||"",e.tooltipSeries=n.dataPoints.map((d,f)=>{const m=u?d.parsed:d.parsed[l],g=r(m??0,e.units,{translateUnit:e.translateUnit});let _;return u?_=d.dataset.labels[d.dataIndex]:_=d.dataset.label,{backgroundColor:a[f].backgroundColor,borderColor:a[f].borderColor,label:_,value:g,rawValue:m,isSegmentEmpty:d.dataset.isSegmentEmpty}}).sort(s),e.left=`${n.x}px`,e.top=`${n.y}px`,e.showTooltip=!0}},dP=e=>e&&e.datasets&&e.datasets.length,fP=e=>dP(e)&&e.datasets.some(t=>t.data.length),hP=e=>e.datasets.some(t=>t.data[0]&&Pc(t.data[0].x)),pP=e=>!!fP(e)&&e.datasets.some(t=>t.data.length==1),mP=e=>hP(e)&&e.datasets.some(t=>t.data[0]&&(t.data[0].x??0).toString().length>=13),Za=(e,t,n)=>{const r=Math.min(t/1150,1),s=.15,a=1.15,l=e.x??0;return l<n?l+t*s*(1-r):l-t*a*(1-r)},d0=(e,t,n)=>{const s=e.y??0;return s<n?s+t*.15:s-t*.5};function f0(e,t){let n;return(...i)=>{clearTimeout(n),n=window.setTimeout(()=>{e(...i)},t)}}const Ru=(e,t,n)=>{const i=e.data;return e.options.plugins.legend.labels.generateLabels(e).filter(r=>!t?.[r.text]?.isThreshold).map(((r,s)=>({...r,value:t&&t[r.text],isSegmentEmpty:i.datasets[s].isSegmentEmpty}))).sort(n)},gP=2,h0=10,p0=12,Qa=10,Ja="y",Eu="y1",Kn=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Pu=(e,t)=>(t||Kn)[e%Kn.length],yP="#6f7787",_P={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"}},bP=e=>{const t=Math.floor(parseInt(e,10)/100)*100;return _P[t]?.background||"#fafafa"},xP=J1,Iu=(e,t,n,i)=>{let r;return n?r=xP:Array.isArray(i)?r=Pu(e,i):r=i[t],r||Pu(e)},Lu=e=>{switch(e){case"error":return tS;case"warning":return rS;case"neutral":return tp;default:return tp}},wP={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},vP=2,SP=0,Nu=new Map,m0=(e,t)=>{const{i18n:n}=Tt.useI18n(),{formatBytes:i}=ni({i18n:n});return t==="bytes"?i(e):t==="count/minute"?e.toFixed(2):la.format(e)},TP=e=>{const n=document.createElement("canvas").getContext("2d"),i=ce({});return n.font=i.string,n.measureText(e).width},MP=()=>{const e="label_height";if(!Nu.has(e)){const t=ce({});Nu.set(e,t.lineHeight)}return Nu.get(e)},kP=(e,t)=>t.datasets.reduce((n,i,r)=>e.isDatasetVisible(r)?n+i.data.reduce((s,a)=>isNaN(a)?s:s+a,0):n,0),DP=(e,t)=>t===0?" (0.0%)":` (${(e/t*100).toFixed(1)}%)`,CP=Q1,AP={100:aS,101:lS,102:cS,103:uS,200:dS,201:fS,202:hS,203:pS,204:mS,205:gS,206:yS,207:_S,208:bS,226:xS,300:wS,301:vS,302:SS,303:TS,304:MS,305:kS,307:DS,308:CS,400:AS,401:OS,402:RS,403:ES,404:PS,405:IS,406:LS,407:NS,408:BS,409:FS,410:zS,411:US,412:HS,413:WS,414:$S,415:VS,416:YS,417:qS,418:jS,421:GS,422:KS,423:XS,424:ZS,425:QS,426:JS,428:tT,429:eT,431:nT,451:iT,500:rT,501:sT,502:oT,503:aT,504:lT,505:cT,506:uT,507:dT,508:fT,510:hT,511:pT},OP={100:mT,200:gT,300:yT,400:_T,500:bT},RP={"1XX":xT,"2XX":wT,"3XX":vT,"4XX":ST,"5XX":TT},g0=e=>{const t=parseInt(e,10),n=Math.floor(t/100)*100;return AP[t]??OP[n]??CP},Bu={...Array.from({length:500},(e,t)=>100+t).reduce((e,t)=>(e[`${t}`]=g0(`${t}`),e),{}),____OTHER____:Z1,...RP};function y0(e,t,n){const i=Sp(),r=IP(e,n.timeZone,n.locale??i.locale);return"formatToParts"in r?EP(r,t):PP(r,t)}function EP(e,t){const n=e.formatToParts(t);for(let i=n.length-1;i>=0;--i)if(n[i].type==="timeZoneName")return n[i].value}function PP(e,t){const n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}function IP(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function LP(e,t){const n=UP(t);return"formatToParts"in n?BP(n,e):FP(n,e)}const NP={year:0,month:1,day:2,hour:3,minute:4,second:5};function BP(e,t){try{const n=e.formatToParts(t),i=[];for(let r=0;r<n.length;r++){const s=NP[n[r].type];s!==void 0&&(i[s]=parseInt(n[r].value,10))}return i}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function FP(e,t){const n=e.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);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 Fu={},_0=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")),zP=_0==="06/25/2014, 00:00:00"||_0==="06/25/2014 00:00:00";function UP(e){return Fu[e]||(Fu[e]=zP?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Fu[e]}function b0(e,t,n,i,r,s,a){const l=new Date(0);return l.setUTCFullYear(e,t,n),l.setUTCHours(i,r,s,a),l}const x0=36e5,HP=6e4,zu={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Uu(e,t,n){if(!e)return 0;let i=zu.timezoneZ.exec(e);if(i)return 0;let r,s;if(i=zu.timezoneHH.exec(e),i)return r=parseInt(i[1],10),w0(r)?-(r*x0):NaN;if(i=zu.timezoneHHMM.exec(e),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return w0(r,a)?(s=Math.abs(r)*x0+a*HP,i[1]==="+"?-s:s):NaN}if(VP(e)){t=new Date(t||Date.now());const a=n?t:WP(t),l=Hu(a,e);return-(n?l:$P(t,l,e))}return NaN}function WP(e){return b0(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function Hu(e,t){const n=LP(e,t),i=b0(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let r=e.getTime();const s=r%1e3;return r-=s>=0?s:1e3+s,i-r}function $P(e,t,n){let r=e.getTime()-t;const s=Hu(new Date(r),n);if(t===s)return t;r-=s-t;const a=Hu(new Date(r),n);return s===a?s:Math.max(s,a)}function w0(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const v0={};function VP(e){if(v0[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),v0[e]=!0,!0}catch{return!1}}const YP=60*1e3,qP={X:function(e,t,n){const i=Wu(n.timeZone,e);if(i===0)return"Z";switch(t){case"X":return S0(i);case"XXXX":case"XX":return Zr(i);default:return Zr(i,":")}},x:function(e,t,n){const i=Wu(n.timeZone,e);switch(t){case"x":return S0(i);case"xxxx":case"xx":return Zr(i);default:return Zr(i,":")}},O:function(e,t,n){const i=Wu(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+jP(i,":");default:return"GMT"+Zr(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return y0("short",e,n);default:return y0("long",e,n)}}};function Wu(e,t){const n=e?Uu(e,t,!0)/YP:t?.getTimezoneOffset()??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function tl(e,t){const n=e<0?"-":"";let i=Math.abs(e).toString();for(;i.length<t;)i="0"+i;return n+i}function Zr(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=tl(Math.floor(i/60),2),s=tl(Math.floor(i%60),2);return n+r+t+s}function S0(e,t){return e%60===0?(e>0?"-":"+")+tl(Math.abs(e)/60,2):Zr(e,t)}function jP(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Math.floor(i/60),s=i%60;return s===0?n+String(r):n+String(r)+t+tl(s,2)}function T0(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const GP=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,$u=36e5,M0=6e4,KP=2,Qe={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:GP};function k0(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const n=t.additionalDigits==null?KP:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const i=XP(e),{year:r,restDateString:s}=ZP(i.date,n),a=QP(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=JP(i.time),u===null||isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(d=Uu(i.timeZone||t.timeZone,new Date(l+u)),isNaN(d))return new Date(NaN)}else d=T0(new Date(l+u)),d=T0(new Date(l+u+d));return new Date(l+u+d)}else return new Date(NaN)}function XP(e){const t={};let n=Qe.dateTimePattern.exec(e),i;if(n?(t.date=n[1],i=n[3]):(n=Qe.datePattern.exec(e),n?(t.date=n[1],i=n[2]):(t.date=null,i=e)),i){const r=Qe.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function ZP(e,t){if(e){const n=Qe.YYY[t],i=Qe.YYYYY[t];let r=Qe.YYYY.exec(e)||i.exec(e);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:e.slice(s.length)}}if(r=Qe.YY.exec(e)||n.exec(e),r){const s=r[1];return{year:parseInt(s,10)*100,restDateString:e.slice(s.length)}}}return{year:null}}function QP(e,t){if(t===null)return null;let n,i,r;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let s=Qe.MM.exec(e);if(s)return n=new Date(0),i=parseInt(s[1],10)-1,A0(t,i)?(n.setUTCFullYear(t,i),n):new Date(NaN);if(s=Qe.DDD.exec(e),s){n=new Date(0);const a=parseInt(s[1],10);return n2(t,a)?(n.setUTCFullYear(t,0,a),n):new Date(NaN)}if(s=Qe.MMDD.exec(e),s){n=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return A0(t,i,a)?(n.setUTCFullYear(t,i,a),n):new Date(NaN)}if(s=Qe.Www.exec(e),s)return r=parseInt(s[1],10)-1,O0(r)?D0(t,r):new Date(NaN);if(s=Qe.WwwD.exec(e),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return O0(r,a)?D0(t,r,a):new Date(NaN)}return null}function JP(e){let t,n,i=Qe.HH.exec(e);if(i)return t=parseFloat(i[1].replace(",",".")),Vu(t)?t%24*$u:NaN;if(i=Qe.HHMM.exec(e),i)return t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),Vu(t,n)?t%24*$u+n*M0:NaN;if(i=Qe.HHMMSS.exec(e),i){t=parseInt(i[1],10),n=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return Vu(t,n,r)?t%24*$u+n*M0+r*1e3:NaN}return null}function D0(e,t,n){t=t||0,n=n||0;const i=new Date(0);i.setUTCFullYear(e,0,4);const r=i.getUTCDay()||7,s=t*7+n+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const t2=[31,28,31,30,31,30,31,31,30,31,30,31],e2=[31,29,31,30,31,30,31,31,30,31,30,31];function C0(e){return e%400===0||e%4===0&&e%100!==0}function A0(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const i=C0(e);if(i&&n>e2[t]||!i&&n>t2[t])return!1}return!0}function n2(e,t){if(t<1)return!1;const n=C0(e);return!(n&&t>366||!n&&t>365)}function O0(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function Vu(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const i2=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Yu(e,t,n={}){t=String(t);const i=t.match(i2);if(i){const r=k0(n.originalDate||e,n);t=i.reduce(function(s,a){if(a[0]==="'")return s;const l=s.indexOf(a),u=s[l-1]==="'",d=s.replace(a,"'"+qP[a[0]](r,a,n)+"'");return u?d.substring(0,l-1)+d.substring(l+1):d},t)}return fa(e,t,n)}function r2(e,t,n){e=k0(e,n);const i=Uu(t,e,!0),r=new Date(e.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 po(e,t,n,i){return i={...i,timeZone:t,originalDate:e},Yu(r2(e,t,{timeZone:i.timeZone}),n,i)}const s2=(e,t)=>`${po(e,t,"yyyy")} W${po(e,t,"II")}`,qu="yyyy-MM-dd h:mm:ss a",ju="h:mm:ss a",mr="yyyy-MM-dd h:mm a",Qr="h:mm a",o2="yyyy-MM-dd",Gu="MMM dd, yyyy h:mm:ss a",Ni="MMM dd, yyyy h:mm a",a2={secondly:e=>e?qu:ju,tenSecondly:e=>e?qu:ju,thirtySecondly:e=>e?qu:ju,minutely:e=>e?mr:Qr,fiveMinutely:e=>e?mr:Qr,tenMinutely:e=>e?mr:Qr,thirtyMinutely:e=>e?mr:Qr,hourly:e=>e?mr:Qr,twoHourly:e=>e?mr:Qr,twelveHourly:()=>mr,daily:()=>o2},l2={secondly:()=>Gu,tenSecondly:()=>Gu,thirtySecondly:()=>Gu,minutely:()=>Ni,fiveMinutely:()=>Ni,tenMinutely:()=>Ni,thirtyMinutely:()=>Ni,hourly:()=>Ni,twoHourly:()=>Ni,twelveHourly:()=>Ni,daily:()=>Ni};function R0({tickValue:e,granularity:t,timezone:n,dayBoundaryCrossed:i=!1,tickMap:r,tooltipMap:s,defaultFormat:a}){const l=n||Intl.DateTimeFormat().resolvedOptions().timeZone;if(t==="weekly")return s2(e,l);if(r&&r[t]){const u=r[t](i);return po(e,l,u)}if(s&&s[t]){const u=s[t]();return po(e,l,u)}return po(e,l,a)}const E0=({tickValue:e,granularity:t,dayBoundaryCrossed:n,timezone:i})=>R0({tickValue:e,granularity:t,timezone:i,dayBoundaryCrossed:n,tickMap:a2,defaultFormat:"yyyy-MM-dd h:mm:ss a"}),Jr=({tickValue:e,granularity:t,timezone:n})=>R0({tickValue:e,granularity:t,timezone:n,tooltipMap:l2,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),P0=e=>e?.code==="ERR_CANCELED"||e?.name==="CanceledError"||e?.name==="AbortError",c2=e=>{const{i18n:t}=Tt.useI18n();return P0(e)?{type:"canceled",message:t.t("query_errors.canceled.message")}:e?.status===403?{status:e.status,type:"forbidden",message:t.t("query_errors.forbidden.message"),details:t.t("query_errors.forbidden.details")}:e?.status===408||e?.message?.includes("timeout")?{status:e.status,type:"timeout",message:t.t("query_errors.timeout.message"),details:t.t("query_errors.timeout.details")}:e?.response?.data?.message==="Range not allowed for this tier"?{status:e.status,type:"range_exceeded",message:t.t("query_errors.time_range_exceeded.message"),details:t.t("query_errors.time_range_exceeded.details")}:{status:e.status,type:"other",message:t.t("query_errors.other.message"),details:e.response?.data?.invalid_parameters?.map(n=>n.reason).join(", ")||e?.message}},el=e=>e.toLocaleLowerCase().endsWith("count"),u2=e=>{const t=e.toLocaleLowerCase();return["sum","count","cost","tokens"].some(n=>t.endsWith(n))},d2=(e,t)=>{if(!e.length)return NaN;const i=Math.min(100,Math.max(0,t))/100*(e.length-1),r=Math.floor(i),s=Math.ceil(i);return r===s?e[r]:e[r]+(e[s]-e[r])*(i-r)},f2=(e,t)=>{const n=e.filter(i=>Number.isFinite(i)).sort((i,r)=>i-r);return new Map(t.map(i=>[i,d2(n,i)]))},I0=.7,Ku=(e,t)=>{const n=Ma(e.trim());return n.valid?n.alpha(t).rgbString():e},Xu=e=>{const t=e??(typeof document>"u"?null:document.documentElement);if(typeof window>"u"||!t)return{medianLine:ep,outlier:Qh,outlierBand:Ku(Jh,I0)};const n=window.getComputedStyle(t),i=(r,s)=>n.getPropertyValue(r).trim()||s;return{medianLine:i("--kui-color-text",ep),outlier:i("--kui-color-background-danger",Qh),outlierBand:Ku(i("--kui-color-background-danger-weakest",Jh),I0)}},h2="empty",L0=e=>{if(!e||!("meta"in e)||!("data"in e))return;const{display:t,metric_names:n,metric_units:i,start:r,end:s,truncated:a,limit:l,datasource:u}=e.meta;if(!n?.length){console.error("Cannot build scatter chart data from this explore result. Missing metric names.");return}const d=n.length>1?n[0]:void 0,f=d?n[1]:n[0],m=t&&Object.keys(t)[0]||void 0,g=e.data??[],_=[];for(const x of g){const v=B0(x.timestamp,x.event[f],m?x.event[m]:void 0);if(v){if(d){const S=N0(x.event[d]);if(S===void 0)continue;v.x=S}_.push(v)}}return{points:_,metric:f,metricUnit:i?.[f],...d?{xMetric:d,xMetricUnit:i?.[d]}:{},dimension:m,display:m?t?.[m]:void 0,start:r,end:s,truncated:a,limit:l,datasource:u}},N0=e=>{if(e==null||e==="")return;const t=Number(e);return Number.isFinite(t)?t:void 0},B0=(e,t,n,i)=>{const r=new Date(e).valueOf(),s=N0(t);if(!Number.isFinite(r)||s===void 0)return;const a=i?.length?{extras:i}:{};return n===void 0?{timestamp:r,value:s,...a}:{timestamp:r,value:s,group:n!==null&&n!==""?String(n):h2,...a}},p2=(e,t,n)=>{if(!n?.length)return;const i=[];for(const{field:r,label:s,unit:a}of n){const l=gr(e,r)??gr(t,r);l==null||l===""||i.push({label:s??r,value:l,...a?{unit:a}:{}})}return i.length?i:void 0},m2=(e,t)=>{if(!e||!("meta"in e))return;const{metric:n,dimension:i,unroll:r,display:s,extraFields:a,metricUnit:l}=t,u=t.timestamp??"request_start";if(!n){console.error("Cannot build scatter chart data from these request records. Missing metric.");return}const d=[];for(const f of e.results??[]){const m=gr(f,u);for(const g of g2(f,r)){const _=gr(g,n),x=i?gr(g,i)??gr(f,i):void 0,v=B0(m,_,i?x??null:void 0,p2(g,f,a));v&&d.push(v)}}return{points:d,metric:n,metricUnit:l,dimension:i,display:s,start:e.meta?.time_range?.start,end:e.meta?.time_range?.end,truncated:e.truncated,limit:e.limit,datasource:"requests"}},g2=(e,t)=>{if(!t)return[e];const n=gr(e,t);return Array.isArray(n)?n:[]},gr=(e,t)=>{let n=e;for(const i of t.split(".")){if(n===null||typeof n!="object")return;n=n[i]}return n},F0=e=>Object.hasOwn(Rp.chartLabels,e),y2=["hidden","single","full"];var yr=(e=>(e.String="string",e.Number="number",e.Boolean="boolean",e.Object="object",e.Undefined="undefined",e))(yr||{});const _2=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar","scatter"],b2=["gauge","top_n","single_value"],Zu=e=>e===null||typeof e!="object"||!("points"in e)?!1:Array.isArray(e.points);var Ie=(e=>(e.Hidden="hidden",e.Bottom="bottom",e))(Ie||{});const z0={modes:{point(e,t){return nl(e,t,{intersect:!0})},nearest(e,t,n){return v2(e,t,n)},x(e,t,n){return nl(e,t,{intersect:n.intersect,axis:"x"})},y(e,t,n){return nl(e,t,{intersect:n.intersect,axis:"y"})}}};function Qu(e,t,n){return(z0.modes[n.mode]||z0.modes.nearest)(e,t,n)}function x2(e,t,n){return n!=="x"&&n!=="y"?e.inRange(t.x,t.y,"x",!0)||e.inRange(t.x,t.y,"y",!0):e.inRange(t.x,t.y,n,!0)}function w2(e,t,n){return n==="x"?{x:e.x,y:t.y}:n==="y"?{x:t.x,y:e.y}:t}function nl(e,t,n){return e.filter(i=>n.intersect?i.inRange(t.x,t.y):x2(i,t,n.axis))}function v2(e,t,n){let i=Number.POSITIVE_INFINITY;return nl(e,t,n).reduce((r,s)=>{const a=s.getCenterPoint(),l=w2(t,a,n.axis),u=$r(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 _r(e,t,n){const i=Math.cos(n),r=Math.sin(n),s=t.x,a=t.y;return{x:s+i*(e.x-s)-r*(e.y-a),y:a+r*(e.x-s)+i*(e.y-a)}}const S2=(e,t)=>t>e||e.length>t.length&&e.slice(0,t.length)===t,br=.001,il=(e,t,n)=>Math.min(n,Math.max(t,e)),U0=(e,t)=>e.value>=e.start-t&&e.value<=e.end+t;function T2(e,t,n){for(const i of Object.keys(e))e[i]=il(e[i],t,n);return e}function M2(e,t,n,i){return!e||!t||n<=0?!1:Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)<=Math.pow(n+i,2)}function H0(e,{x:t,y:n,x2:i,y2:r},s,{borderWidth:a,hitTolerance:l}){const u=(a+l)/2,d=e.x>=t-u-br&&e.x<=i+u+br,f=e.y>=n-u-br&&e.y<=r+u+br;return s==="x"?d:(s==="y"||d)&&f}function W0(e,{rect:t,center:n},i,{rotation:r,borderWidth:s,hitTolerance:a}){const l=_r(e,n,ve(-r));return H0(l,t,i,{borderWidth:s,hitTolerance:a})}function xr(e,t){const{centerX:n,centerY:i}=e.getProps(["centerX","centerY"],t);return{x:n,y:i}}function k2(e,t,n,i=!0){const r=n.split(".");let s=0;for(const a of t.split(".")){const l=r[s++];if(parseInt(a,10)<parseInt(l,10))break;if(S2(l,a)){if(i)throw new Error(`${e} v${n} is not supported. v${t} or newer is required.`);return!1}}return!0}const $0=e=>typeof e=="string"&&e.endsWith("%"),V0=e=>parseFloat(e)/100,Y0=e=>il(V0(e),0,1),mo=(e,t)=>({x:e,y:t,x2:e,y2:t,width:0,height:0}),D2={box:e=>mo(e.centerX,e.centerY),doughnutLabel:e=>mo(e.centerX,e.centerY),ellipse:e=>({centerX:e.centerX,centerY:e.centerX,radius:0,width:0,height:0}),label:e=>mo(e.centerX,e.centerY),line:e=>mo(e.x,e.y),point:e=>({centerX:e.centerX,centerY:e.centerY,radius:0,width:0,height:0}),polygon:e=>mo(e.centerX,e.centerY)};function Ju(e,t){return t==="start"?0:t==="end"?e:$0(t)?Y0(t)*e:e/2}function Bi(e,t,n=!0){return typeof t=="number"?t:$0(t)?(n?Y0(t):V0(t))*e:e}function C2(e,t){const{x:n,width:i}=e,r=t.textAlign;return r==="center"?n+i/2:r==="end"||r==="right"?n+i:n}function q0(e,t,{borderWidth:n,position:i,xAdjust:r,yAdjust:s},a){const l=It(a),u=t.width+(l?a.width:0)+n,d=t.height+(l?a.height:0)+n,f=td(i),m=X0(e.x,u,r,f.x),g=X0(e.y,d,s,f.y);return{x:m,y:g,x2:m+u,y2:g+d,width:u,height:d,centerX:m+u/2,centerY:g+d/2}}function td(e,t="center"){return It(e)?{x:Ct(e.x,t),y:Ct(e.y,t)}:(e=Ct(e,t),{x:e,y:e})}const j0=(e,t)=>e&&e.autoFit&&t<1;function G0(e,t){const n=e.font,i=Gt(n)?n:[n];return j0(e,t)?i.map(function(r){const s=ce(r);return s.size=Math.floor(r.size*t),s.lineHeight=r.lineHeight,ce(s)}):i.map(r=>ce(r))}function K0(e){return e&&(rn(e.xValue)||rn(e.yValue))}function X0(e,t,n=0,i){return e-Ju(t,i)+n}function ts(e,t,n){const i=n.init;if(i){if(i===!0)return Q0(t,n)}else return;return A2(e,t,n)}function Z0(e,t,n){let i=!1;return t.forEach(r=>{sn(e[r])?(i=!0,n[r]=e[r]):rn(n[r])&&delete n[r]}),i}function Q0(e,t){const n=t.type||"line";return D2[n](e)}function A2(e,t,n){const i=Jt(n.init,[{chart:e,properties:t,options:n}]);if(i===!0)return Q0(t,n);if(It(i))return i}const ed=new Map,O2=e=>isNaN(e)||e<=0,R2=e=>e.reduce(function(t,n){return t+=n.string,t},"");function rl(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function sl(e,{x:t,y:n},i){i&&(e.translate(t,n),e.rotate(ve(i)),e.translate(-t,-n))}function ui(e,t){if(t&&t.borderWidth)return e.lineCap=t.borderCapStyle||"butt",e.setLineDash(t.borderDash),e.lineDashOffset=t.borderDashOffset,e.lineJoin=t.borderJoinStyle||"miter",e.lineWidth=t.borderWidth,e.strokeStyle=t.borderColor,!0}function es(e,t){e.shadowColor=t.backgroundShadowColor,e.shadowBlur=t.shadowBlur,e.shadowOffsetX=t.shadowOffsetX,e.shadowOffsetY=t.shadowOffsetY}function ol(e,t){const n=t.content;if(rl(n))return{width:Bi(n.width,t.width),height:Bi(n.height,t.height)};const i=G0(t),r=t.textStrokeWidth,s=Gt(n)?n:[n],a=s.join()+R2(i)+r+(e._measureText?"-spriting":"");return ed.has(a)||ed.set(a,L2(e,s,i,r)),ed.get(a)}function J0(e,t,n){const{x:i,y:r,width:s,height:a}=t;e.save(),es(e,n);const l=ui(e,n);e.fillStyle=n.backgroundColor,e.beginPath(),Vr(e,{x:i,y:r,w:s,h:a,radius:T2(Oi(n.borderRadius),0,Math.min(s,a)/2)}),e.closePath(),e.fill(),l&&(e.shadowColor=n.borderShadowColor,e.stroke()),e.restore()}function ty(e,t,n,i){const r=n.content;if(rl(r)){e.save(),e.globalAlpha=F2(n.opacity,r.style.opacity),e.drawImage(r,t.x,t.y,t.width,t.height),e.restore();return}const s=Gt(r)?r:[r],a=G0(n,i),l=n.color,u=Gt(l)?l:[l],d=C2(t,n),f=t.y+n.textStrokeWidth/2;e.save(),e.textBaseline="middle",e.textAlign=n.textAlign,E2(e,n)&&N2(e,{x:d,y:f},s,a),B2(e,{x:d,y:f},s,{fonts:a,colors:u}),e.restore()}function E2(e,t){if(t.textStrokeWidth>0)return e.lineJoin="round",e.miterLimit=2,e.lineWidth=t.textStrokeWidth,e.strokeStyle=t.textStrokeColor,!0}function P2(e,t,n,i){const{radius:r,options:s}=t,a=s.pointStyle,l=s.rotation;let u=(l||0)*Gc;if(rl(a)){e.save(),e.translate(n,i),e.rotate(u),e.drawImage(a,-a.width/2,-a.height/2,a.width,a.height),e.restore();return}O2(r)||I2(e,{x:n,y:i,radius:r,rotation:l,style:a,rad:u})}function I2(e,{x:t,y:n,radius:i,rotation:r,style:s,rad:a}){let l,u,d,f;switch(e.beginPath(),s){default:e.arc(t,n,i,0,ee),e.closePath();break;case"triangle":e.moveTo(t+Math.sin(a)*i,n-Math.cos(a)*i),a+=wa,e.lineTo(t+Math.sin(a)*i,n-Math.cos(a)*i),a+=wa,e.lineTo(t+Math.sin(a)*i,n-Math.cos(a)*i),e.closePath();break;case"rectRounded":f=i*.516,d=i-f,l=Math.cos(a+Dn)*d,u=Math.sin(a+Dn)*d,e.arc(t-l,n-u,f,a-Et,a-se),e.arc(t+u,n-l,f,a-se,a),e.arc(t+l,n+u,f,a,a+se),e.arc(t-u,n+l,f,a+se,a+Et),e.closePath();break;case"rect":if(!r){d=Math.SQRT1_2*i,e.rect(t-d,n-d,2*d,2*d);break}a+=Dn;case"rectRot":l=Math.cos(a)*i,u=Math.sin(a)*i,e.moveTo(t-l,n-u),e.lineTo(t+u,n-l),e.lineTo(t+l,n+u),e.lineTo(t-u,n+l),e.closePath();break;case"crossRot":a+=Dn;case"cross":l=Math.cos(a)*i,u=Math.sin(a)*i,e.moveTo(t-l,n-u),e.lineTo(t+l,n+u),e.moveTo(t+u,n-l),e.lineTo(t-u,n+l);break;case"star":l=Math.cos(a)*i,u=Math.sin(a)*i,e.moveTo(t-l,n-u),e.lineTo(t+l,n+u),e.moveTo(t+u,n-l),e.lineTo(t-u,n+l),a+=Dn,l=Math.cos(a)*i,u=Math.sin(a)*i,e.moveTo(t-l,n-u),e.lineTo(t+l,n+u),e.moveTo(t+u,n-l),e.lineTo(t-u,n+l);break;case"line":l=Math.cos(a)*i,u=Math.sin(a)*i,e.moveTo(t-l,n-u),e.lineTo(t+l,n+u);break;case"dash":e.moveTo(t,n),e.lineTo(t+Math.cos(a)*i,n+Math.sin(a)*i);break}e.fill()}function L2(e,t,n,i){e.save();const r=t.length;let s=0,a=i;for(let l=0;l<r;l++){const u=n[Math.min(l,n.length-1)];e.font=u.string;const d=t[l];s=Math.max(s,e.measureText(d).width+i),a+=u.lineHeight}return e.restore(),{width:s,height:a}}function N2(e,{x:t,y:n},i,r){e.beginPath();let s=0;i.forEach(function(a,l){const u=r[Math.min(l,r.length-1)],d=u.lineHeight;e.font=u.string,e.strokeText(a,t,n+d/2+s),s+=d}),e.stroke()}function B2(e,{x:t,y:n},i,{fonts:r,colors:s}){let a=0;i.forEach(function(l,u){const d=s[Math.min(u,s.length-1)],f=r[Math.min(u,r.length-1)],m=f.lineHeight;e.beginPath(),e.font=f.string,e.fillStyle=d,e.fillText(l,t,n+m/2+a),a+=m,e.fill()})}function F2(e,t){const n=Ai(e)?e:t;return Ai(n)?il(n,0,1):1}const ey=["left","bottom","top","right"];function z2(e,t){const{pointX:n,pointY:i,options:r}=t,s=r.callout,a=s&&s.display&&V2(t,s);if(!a||q2(t,s,a))return;if(e.save(),e.beginPath(),!ui(e,s))return e.restore();const{separatorStart:u,separatorEnd:d}=U2(t,a),{sideStart:f,sideEnd:m}=W2(t,a,u);(s.margin>0||r.borderWidth===0)&&(e.moveTo(u.x,u.y),e.lineTo(d.x,d.y)),e.moveTo(f.x,f.y),e.lineTo(m.x,m.y);const g=_r({x:n,y:i},t.getCenterPoint(),ve(-t.rotation));e.lineTo(g.x,g.y),e.stroke(),e.restore()}function U2(e,t){const{x:n,y:i,x2:r,y2:s}=e,a=H2(e,t);let l,u;return t==="left"||t==="right"?(l={x:n+a,y:i},u={x:l.x,y:s}):(l={x:n,y:i+a},u={x:r,y:l.y}),{separatorStart:l,separatorEnd:u}}function H2(e,t){const{width:n,height:i,options:r}=e,s=r.callout.margin+r.borderWidth/2;return t==="right"?n+s:t==="bottom"?i+s:-s}function W2(e,t,n){const{y:i,width:r,height:s,options:a}=e,l=a.callout.start,u=$2(t,a.callout);let d,f;return t==="left"||t==="right"?(d={x:n.x,y:i+Bi(s,l)},f={x:d.x+u,y:d.y}):(d={x:n.x+Bi(r,l),y:n.y},f={x:d.x,y:d.y+u}),{sideStart:d,sideEnd:f}}function $2(e,t){const n=t.side;return e==="left"||e==="top"?-n:n}function V2(e,t){const n=t.position;return ey.includes(n)?n:Y2(e,t)}function Y2(e,t){const{x:n,y:i,x2:r,y2:s,width:a,height:l,pointX:u,pointY:d,centerX:f,centerY:m,rotation:g}=e,_={x:f,y:m},x=t.start,v=Bi(a,x),S=Bi(l,x),C=[n,n+v,n+v,r],O=[i+S,s,i,s],B=[];for(let I=0;I<4;I++){const N=_r({x:C[I],y:O[I]},_,ve(g));B.push({position:ey[I],distance:$r(N,{x:u,y:d})})}return B.sort((I,N)=>I.distance-N.distance)[0].position}function q2(e,t,n){const{pointX:i,pointY:r}=e,s=t.margin;let a=i,l=r;return n==="left"?a+=s:n==="right"?a-=s:n==="top"?l+=s:n==="bottom"&&(l-=s),e.inRange(a,l)}const ny={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 ns(e,t,n){return t=typeof t=="number"?t:e.parse(t),le(t)?e.getPixelForValue(t):n}function wr(e,t,n){const i=t[n];if(i||n==="scaleID")return i;const r=n.charAt(0),s=Object.values(e).filter(a=>a.axis&&a.axis===r);return s.length?s[0].id:r}function iy(e,t){if(e){const n=e.options.reverse,i=ns(e,t.min,n?t.end:t.start),r=ns(e,t.max,n?t.start:t.end);return{start:i,end:r}}}function ry(e,t){const{chartArea:n,scales:i}=e,r=i[wr(i,t,"xScaleID")],s=i[wr(i,t,"yScaleID")];let a=n.width/2,l=n.height/2;return r&&(a=ns(r,t.xValue,r.left+r.width/2)),s&&(l=ns(s,t.yValue,s.top+s.height/2)),{x:a,y:l}}function nd(e,t){const n=e.scales,i=n[wr(n,t,"xScaleID")],r=n[wr(n,t,"yScaleID")];if(!i&&!r)return{};let{left:s,right:a}=i||e.chartArea,{top:l,bottom:u}=r||e.chartArea;const d=ay(i,{min:t.xMin,max:t.xMax,start:s,end:a});s=d.start,a=d.end;const f=ay(r,{min:t.yMin,max:t.yMax,start:u,end:l});return l=f.start,u=f.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 sy(e,t){if(!K0(t)){const n=nd(e,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(n.width,n.height)/2,t.radius=i);const r=i*2,s=n.centerX+t.xAdjust,a=n.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 G2(e,t)}function j2(e,t){const{scales:n,chartArea:i}=e,r=n[t.scaleID],s={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return r?K2(r,s,t):X2(n,s,t),s}function oy(e,t){const n=nd(e,t);return n.initProperties=ts(e,n,t),n.elements=[{type:"label",optionScope:"label",properties:J2(e,n,t),initProperties:n.initProperties}],n}function G2(e,t){const n=ry(e,t),i=t.radius*2;return{x:n.x-t.radius+t.xAdjust,y:n.y-t.radius+t.yAdjust,x2:n.x+t.radius+t.xAdjust,y2:n.y+t.radius+t.yAdjust,centerX:n.x+t.xAdjust,centerY:n.y+t.yAdjust,radius:t.radius,width:i,height:i}}function ay(e,t){const n=iy(e,t)||t;return{start:Math.min(n.start,n.end),end:Math.max(n.start,n.end)}}function K2(e,t,n){const i=ns(e,n.value,NaN),r=ns(e,n.endValue,i);e.isHorizontal()?(t.x=i,t.x2=r):(t.y=i,t.y2=r)}function X2(e,t,n){for(const i of Object.keys(ny)){const r=e[wr(e,n,i)];if(r){const{min:s,max:a,start:l,end:u,startProp:d,endProp:f}=ny[i],m=iy(r,{min:n[s],max:n[a],start:r[l],end:r[u]});t[d]=m.start,t[f]=m.end}}}function Z2({properties:e,options:t},n,i,r){const{x:s,x2:a,width:l}=e;return ly({start:s,end:a,borderWidth:t.borderWidth},{position:i.x,padding:{start:r.left,end:r.right},adjust:t.label.xAdjust,size:n.width})}function Q2({properties:e,options:t},n,i,r){const{y:s,y2:a,height:l}=e;return ly({start:s,end:a,borderWidth:t.borderWidth},{position:i.y,padding:{start:r.top,end:r.bottom},adjust:t.label.yAdjust,size:n.height})}function ly(e,t){const{start:n,end:i,borderWidth:r}=e,{position:s,padding:{start:a,end:l},adjust:u}=t,d=i-r-n-a-l-t.size;return n+r/2+u+Ju(d,s)}function J2(e,t,n){const i=n.label;i.backgroundColor="transparent",i.callout.display=!1;const r=td(i.position),s=Se(i.padding),a=ol(e.ctx,i),l=Z2({properties:t,options:n},a,r,s),u=Q2({properties:t,options:n},a,r,s),d=a.width+s.width,f=a.height+s.height;return{x:l,y:u,x2:l+d,y2:u+f,width:d,height:f,centerX:l+d/2,centerY:u+f/2,rotation:i.rotation}}const id=["enter","leave"],rd=id.concat("click");function tI(e,t,n){t.listened=Z0(n,rd,t.listeners),t.moveListened=!1,id.forEach(i=>{sn(n[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&sn(i.click)&&(t.listened=!0),t.moveListened||id.forEach(r=>{sn(i[r])&&(t.listened=!0,t.moveListened=!0)})})}function eI(e,t,n){if(e.listened)switch(t.type){case"mousemove":case"mouseout":return nI(e,t,n);case"click":return iI(e,t,n)}}function nI(e,t,n){if(!e.moveListened)return;let i;t.type==="mousemove"?i=Qu(e.visibleElements,t,n.interaction):i=[];const r=e.hovered;e.hovered=i;const s={state:e,event:t};let a=cy(s,"leave",r,i);return cy(s,"enter",i,r)||a}function cy({state:e,event:t},n,i,r){let s;for(const a of i)r.indexOf(a)<0&&(s=uy(a.options[n]||e.listeners[n],a,t)||s);return s}function iI(e,t,n){const i=e.listeners,r=Qu(e.visibleElements,t,n.interaction);let s;for(const a of r)s=uy(a.options.click||i.click,a,t)||s;return s}function uy(e,t,n){return Jt(e,[t.$context,n])===!0}const al=["afterDraw","beforeDraw"];function rI(e,t,n){const i=t.visibleElements;t.hooked=Z0(n,al,t.hooks),t.hooked||i.forEach(r=>{t.hooked||al.forEach(s=>{sn(r.options[s])&&(t.hooked=!0)})})}function dy(e,t,n){if(e.hooked){const i=t.options[n]||e.hooks[n];return Jt(i,[t.$context])}}function sI(e,t,n){const i=uI(e.scales,t,n);let r=fy(t,i,"min","suggestedMin");r=fy(t,i,"max","suggestedMax")||r,r&&sn(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function oI(e,t){for(const n of e)lI(n,t)}function fy(e,t,n,i){if(le(t[n])&&!aI(e.options,n,i)){const r=e[n]!==t[n];return e[n]=t[n],r}}function aI(e,t,n){return rn(e[t])||rn(e[n])}function lI(e,t){for(const n of["scaleID","xScaleID","yScaleID"]){const i=wr(t,e,n);i&&!t[i]&&cI(e,n)&&console.warn(`No scale found with id '${i}' for annotation '${e.id}'`)}}function cI(e,t){if(t==="scaleID")return!0;const n=t.charAt(0);for(const i of["Min","Max","Value"])if(rn(e[n+i]))return!0;return!1}function uI(e,t,n){const i=t.axis,r=t.id,s=i+"ScaleID",a={min:Ct(t.min,Number.NEGATIVE_INFINITY),max:Ct(t.max,Number.POSITIVE_INFINITY)};for(const l of n)l.scaleID===r?hy(l,t,["value","endValue"],a):wr(e,l,s)===r&&hy(l,t,[i+"Min",i+"Max",i+"Value"],a);return a}function hy(e,t,n,i){for(const r of n){const s=e[r];if(rn(s)){const a=t.parse(s);i.min=Math.min(i.min,a),i.max=Math.max(i.max,a)}}}class is extends Ve{inRange(t,n,i,r){const{x:s,y:a}=_r({x:t,y:n},this.getCenterPoint(r),ve(-this.options.rotation));return H0({x:s,y:a},this.getProps(["x","y","x2","y2"],r),i,this.options)}getCenterPoint(t){return xr(this,t)}draw(t){t.save(),sl(t,this.getCenterPoint(),this.options.rotation),J0(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){return oy(t,n)}}is.id="boxAnnotation",is.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},is.defaultRoutes={borderColor:"color",backgroundColor:"color"},is.descriptors={label:{_fallback:!0}};class ll extends Ve{inRange(t,n,i,r){return W0({x:t,y:n},{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 xr(this,t)}draw(t){const n=this.options;!n.display||!n.content||(gI(t,this),t.save(),sl(t,this.getCenterPoint(),this.rotation),ty(t,this,n,this._fitRatio),t.restore())}resolveElementProperties(t,n){const i=dI(t,n);if(!i)return{};const{controllerMeta:r,point:s,radius:a}=hI(t,n,i);let l=ol(t.ctx,n);const u=pI(l,a);j0(n,u)&&(l={width:l.width*u,height:l.height*u});const{position:d,xAdjust:f,yAdjust:m}=n,g=q0(s,l,{borderWidth:0,position:d,xAdjust:f,yAdjust:m});return{initProperties:ts(t,g,n),...g,...r,rotation:n.rotation,_fitRatio:u}}}ll.id="doughnutLabelAnnotation",ll.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},ll.defaultRoutes={};function dI(e,t){return e.getSortedVisibleDatasetMetas().reduce(function(n,i){const r=i.controller;return r instanceof Js&&fI(e,t,i.data)&&(!n||r.innerRadius<n.controller.innerRadius)&&r.options.circumference>=90?i:n},void 0)}function fI(e,t,n){if(!t.autoHide)return!0;for(let i=0;i<n.length;i++)if(!n[i].hidden&&e.getDataVisibility(i))return!0}function hI({chartArea:e},t,n){const{left:i,top:r,right:s,bottom:a}=e,{innerRadius:l,offsetX:u,offsetY:d}=n.controller,f=(i+s)/2+u,m=(r+a)/2+d,g={left:Math.max(f-l,i),right:Math.min(f+l,s),top:Math.max(m-l,r),bottom:Math.min(m+l,a)},_={x:(g.left+g.right)/2,y:(g.top+g.bottom)/2},x=t.spacing+t.borderWidth/2,v=l-x,S=_.y>m,C=S?r+x:a-x,O=mI(C,f,m,v);return{controllerMeta:{_centerX:f,_centerY:m,_radius:v,_counterclockwise:S,...O},point:_,radius:Math.min(l,Math.min(g.right-g.left,g.bottom-g.top)/2)}}function pI({width:e,height:t},n){const i=Math.sqrt(Math.pow(e,2)+Math.pow(t,2));return n*2/i}function mI(e,t,n,i){const r=Math.pow(n-e,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:ee};const d=(-a-Math.sqrt(u))/2,f=(-a+Math.sqrt(u))/2;return{_startAngle:Sa({x:t,y:n},{x:d,y:e}).angle,_endAngle:Sa({x:t,y:n},{x:f,y:e}).angle}}function gI(e,t){const{_centerX:n,_centerY:i,_radius:r,_startAngle:s,_endAngle:a,_counterclockwise:l,options:u}=t;e.save();const d=ui(e,u);e.fillStyle=u.backgroundColor,e.beginPath(),e.arc(n,i,r,s,a,l),e.closePath(),e.fill(),d&&e.stroke(),e.restore()}class go extends Ve{inRange(t,n,i,r){return W0({x:t,y:n},{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 xr(this,t)}draw(t){const n=this.options,i=!rn(this._visible)||this._visible;!n.display||!n.content||!i||(t.save(),sl(t,this.getCenterPoint(),this.rotation),z2(t,this),J0(t,this,n),ty(t,yI(this),n),t.restore())}resolveElementProperties(t,n){let i;if(K0(n))i=ry(t,n);else{const{centerX:l,centerY:u}=nd(t,n);i={x:l,y:u}}const r=Se(n.padding),s=ol(t.ctx,n),a=q0(i,s,n,r);return{initProperties:ts(t,a,n),pointX:i.x,pointY:i.y,...a,rotation:n.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 yI({x:e,y:t,width:n,height:i,options:r}){const s=r.borderWidth/2,a=Se(r.padding);return{x:e+a.left+s,y:t+a.top+s,width:n-a.left-a.right-r.borderWidth,height:i-a.top-a.bottom-r.borderWidth}}const sd=(e,t,n)=>({x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}),od=(e,t,n)=>sd(t,n,Math.abs((e-t.y)/(n.y-t.y))).x,py=(e,t,n)=>sd(t,n,Math.abs((e-t.x)/(n.x-t.x))).y,yo=e=>e*e,_I=(e,t,{x:n,y:i,x2:r,y2:s},a)=>a==="y"?{start:Math.min(i,s),end:Math.max(i,s),value:t}:{start:Math.min(n,r),end:Math.max(n,r),value:e},my=(e,t,n,i)=>(1-i)*(1-i)*e+2*(1-i)*i*t+i*i*n,ad=(e,t,n,i)=>({x:my(e.x,t.x,n.x,i),y:my(e.y,t.y,n.y,i)}),gy=(e,t,n,i)=>2*(1-i)*(t-e)+2*i*(n-t),yy=(e,t,n,i)=>-Math.atan2(gy(e.x,t.x,n.x,i),gy(e.y,t.y,n.y,i))+.5*Et;class _o extends Ve{inRange(t,n,i,r){const s=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const a={mouseX:t,mouseY:n},{path:l,ctx:u}=this;if(l){ui(u,this.options),u.lineWidth+=this.options.hitTolerance;const{chart:f}=this.$context,m=t*f.currentDevicePixelRatio,g=n*f.currentDevicePixelRatio,_=u.isPointInStroke(l,m,g)||ld(this,a,r);return u.restore(),_}const d=yo(s);return vI(this,a,d,r)||ld(this,a,r)}return bI(this,{mouseX:t,mouseY:n},i,{hitSize:s,useFinalPosition:r})}getCenterPoint(t){return xr(this,t)}draw(t){const{x:n,y:i,x2:r,y2:s,cp:a,options:l}=this;if(t.save(),!ui(t,l))return t.restore();es(t,l);const u=Math.sqrt(Math.pow(r-n,2)+Math.pow(s-i,2));if(l.curve&&a)return OI(t,this,a,u),t.restore();const{startOpts:d,endOpts:f,startAdjust:m,endAdjust:g}=vy(this),_=Math.atan2(s-i,r-n);t.translate(n,i),t.rotate(_),t.beginPath(),t.moveTo(0+m,0),t.lineTo(u-g,0),t.shadowColor=l.borderShadowColor,t.stroke(),cd(t,0,m,d),cd(t,u,-g,f),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){const i=j2(t,n),{x:r,y:s,x2:a,y2:l}=i,u=xI(i,t.chartArea),d=u?wI({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=ts(t,d,n),n.curve){const m={x:d.x,y:d.y},g={x:d.x2,y:d.y2};d.cp=AI(d,n,$r(m,g))}const f=SI(t,d,n.label);return f._visible=u,d.elements=[{type:"label",optionScope:"label",properties:f,initProperties:d.initProperties}],d}}_o.id="lineAnnotation";const _y={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};_o.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},_y),fill:!1,length:12,start:Object.assign({},_y),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},_o.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},_o.defaultRoutes={borderColor:"color"};function bI(e,{mouseX:t,mouseY:n},i,{hitSize:r,useFinalPosition:s}){const a=_I(t,n,e.getProps(["x","y","x2","y2"],s),i);return U0(a,r)||ld(e,{mouseX:t,mouseY:n},s,i)}function xI({x:e,y:t,x2:n,y2:i},{top:r,right:s,bottom:a,left:l}){return!(e<l&&n<l||e>s&&n>s||t<r&&i<r||t>a&&i>a)}function by({x:e,y:t},n,{top:i,right:r,bottom:s,left:a}){return e<a&&(t=py(a,{x:e,y:t},n),e=a),e>r&&(t=py(r,{x:e,y:t},n),e=r),t<i&&(e=od(i,{x:e,y:t},n),t=i),t>s&&(e=od(s,{x:e,y:t},n),t=s),{x:e,y:t}}function wI(e,t,n){const{x:i,y:r}=by(e,t,n),{x:s,y:a}=by(t,e,n);return{x:i,y:r,x2:s,y2:a,width:Math.abs(s-i),height:Math.abs(a-r)}}function vI(e,{mouseX:t,mouseY:n},i=br,r){const{x:s,y:a,x2:l,y2:u}=e.getProps(["x","y","x2","y2"],r),d=l-s,f=u-a,m=yo(d)+yo(f),g=m===0?-1:((t-s)*d+(n-a)*f)/m;let _,x;return g<0?(_=s,x=a):g>1?(_=l,x=u):(_=s+g*d,x=a+g*f),yo(t-_)+yo(n-x)<=i}function ld(e,{mouseX:t,mouseY:n},i,r){const s=e.label;return s.options.display&&s.inRange(t,n,r,i)}function SI(e,t,n){const i=n.borderWidth,r=Se(n.padding),s=ol(e.ctx,n),a=s.width+r.width+i,l=s.height+r.height+i;return MI(t,n,{width:a,height:l,padding:r},e.chartArea)}function TI(e){const{x:t,y:n,x2:i,y2:r}=e,s=Math.atan2(r-n,i-t);return s>Et/2?s-Et:s<Et/-2?s+Et:s}function MI(e,t,n,i){const{width:r,height:s,padding:a}=n,{xAdjust:l,yAdjust:u}=t,d={x:e.x,y:e.y},f={x:e.x2,y:e.y2},m=t.rotation==="auto"?TI(e):ve(t.rotation),g=kI(r,s,m),_=DI(e,t,{labelSize:g,padding:a},i),x=e.cp?ad(d,e.cp,f,_):sd(d,f,_),v={size:g.w,min:i.left,max:i.right,padding:a.left},S={size:g.h,min:i.top,max:i.bottom,padding:a.top},C=wy(x.x,v)+l,O=wy(x.y,S)+u;return{x:C-r/2,y:O-s/2,x2:C+r/2,y2:O+s/2,centerX:C,centerY:O,pointX:x.x,pointY:x.y,width:r,height:s,rotation:va(m)}}function kI(e,t,n){const i=Math.cos(n),r=Math.sin(n);return{w:Math.abs(e*i)+Math.abs(t*r),h:Math.abs(e*r)+Math.abs(t*i)}}function DI(e,t,n,i){let r;const s=CI(e,i);return t.position==="start"?r=xy({w:e.x2-e.x,h:e.y2-e.y},n,t,s):t.position==="end"?r=1-xy({w:e.x-e.x2,h:e.y-e.y2},n,t,s):r=Ju(1,t.position),r}function xy(e,t,n,i){const{labelSize:r,padding:s}=t,a=e.w*i.dx,l=e.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 il(Math.max(u,d),0,.25)}function CI(e,t){const{x:n,x2:i,y:r,y2:s}=e,a=Math.min(r,s)-t.top,l=Math.min(n,i)-t.left,u=t.bottom-Math.max(r,s),d=t.right-Math.max(n,i);return{x:Math.min(l,d),y:Math.min(a,u),dx:l<=d?1:-1,dy:a<=u?1:-1}}function wy(e,t){const{size:n,min:i,max:r,padding:s}=t,a=n/2;return n>r-i?(r+i)/2:(i>=e-s-a&&(e=i+s+a),r<=e+s+a&&(e=r-s-a),e)}function vy(e){const t=e.options,n=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:n,endOpts:i,startAdjust:Sy(e,n),endAdjust:Sy(e,i)}}function Sy(e,t){if(!t||!t.display)return 0;const{length:n,width:i}=t,r=e.options.borderWidth/2,s={x:n,y:i+r};return Math.abs(od(0,s,{x:0,y:r}))}function cd(e,t,n,i){if(!i||!i.display)return;const{length:r,width:s,fill:a,backgroundColor:l,borderColor:u}=i,d=Math.abs(t-r)+n;e.beginPath(),es(e,i),ui(e,i),e.moveTo(d,-s),e.lineTo(t+n,0),e.lineTo(d,s),a===!0?(e.fillStyle=l||u,e.closePath(),e.fill(),e.shadowColor="transparent"):e.shadowColor=i.borderShadowColor,e.stroke()}function AI(e,t,n){const{x:i,y:r,x2:s,y2:a,centerX:l,centerY:u}=e,d=Math.atan2(a-r,s-i),f=td(t.controlPoint,0),m={x:l+Bi(n,f.x,!1),y:u+Bi(n,f.y,!1)};return _r(m,{x:l,y:u},d)}function Ty(e,{x:t,y:n},{angle:i,adjust:r},s){!s||!s.display||(e.save(),e.translate(t,n),e.rotate(i),cd(e,0,-r,s),e.restore())}function OI(e,t,n,i){const{x:r,y:s,x2:a,y2:l,options:u}=t,{startOpts:d,endOpts:f,startAdjust:m,endAdjust:g}=vy(t),_={x:r,y:s},x={x:a,y:l},v=yy(_,n,x,0),S=yy(_,n,x,1)-Et,C=ad(_,n,x,m/i),O=ad(_,n,x,1-g/i),B=new Path2D;e.beginPath(),B.moveTo(C.x,C.y),B.quadraticCurveTo(n.x,n.y,O.x,O.y),e.shadowColor=u.borderShadowColor,e.stroke(B),t.path=B,t.ctx=e,Ty(e,C,{angle:v,adjust:m},d),Ty(e,O,{angle:S,adjust:g},f)}class bo extends Ve{inRange(t,n,i,r){const s=this.options.rotation,a=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return RI({x:t,y:n},this.getProps(["width","height","centerX","centerY"],r),s,a);const{x:l,y:u,x2:d,y2:f}=this.getProps(["x","y","x2","y2"],r),m=i==="y"?{start:u,end:f}:{start:l,end:d},g=_r({x:t,y:n},this.getCenterPoint(r),ve(-s));return g[i]>=m.start-a-br&&g[i]<=m.end+a+br}getCenterPoint(t){return xr(this,t)}draw(t){const{width:n,height:i,centerX:r,centerY:s,options:a}=this;t.save(),sl(t,this.getCenterPoint(),a.rotation),es(t,this.options),t.beginPath(),t.fillStyle=a.backgroundColor;const l=ui(t,a);t.ellipse(r,s,i/2,n/2,Et/2,0,2*Et),t.fill(),l&&(t.shadowColor=a.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){return oy(t,n)}}bo.id="ellipseAnnotation",bo.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},is.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},bo.defaultRoutes={borderColor:"color",backgroundColor:"color"},bo.descriptors={label:{_fallback:!0}};function RI(e,t,n,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 f=ve(n||0),m=Math.cos(f),g=Math.sin(f),_=Math.pow(m*(e.x-a)+g*(e.y-l),2),x=Math.pow(g*(e.x-a)-m*(e.y-l),2);return _/Math.pow(u+i,2)+x/Math.pow(d+i,2)<=1.0001}class cl extends Ve{inRange(t,n,i,r){const{x:s,y:a,x2:l,y2:u,width:d}=this.getProps(["x","y","x2","y2","width"],r),f=(this.options.borderWidth+this.options.hitTolerance)/2;return i!=="x"&&i!=="y"?M2({x:t,y:n},this.getCenterPoint(r),d/2,f):U0(i==="y"?{start:a,end:u,value:n}:{start:s,end:l,value:t},f)}getCenterPoint(t){return xr(this,t)}draw(t){const n=this.options,i=n.borderWidth;if(n.radius<.1)return;t.save(),t.fillStyle=n.backgroundColor,es(t,n);const r=ui(t,n);P2(t,this,this.centerX,this.centerY),r&&!rl(n.pointStyle)&&(t.shadowColor=n.borderShadowColor,t.stroke()),t.restore(),n.borderWidth=i}resolveElementProperties(t,n){const i=sy(t,n);return i.initProperties=ts(t,i,n),i}}cl.id="pointAnnotation",cl.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},cl.defaultRoutes={borderColor:"color",backgroundColor:"color"};class ul extends Ve{inRange(t,n,i,r){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&PI(this.elements,t,n,r);const s=_r({x:t,y:n},this.getCenterPoint(r),ve(-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 xr(this,t)}draw(t){const{elements:n,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,es(t,i);const r=ui(t,i);let s=!0;for(const a of n)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,n){const i=sy(t,n),{sides:r,rotation:s}=n,a=[],l=2*Et/r;let u=s*Gc;for(let d=0;d<r;d++,u+=l){const f=EI(i,n,u);f.initProperties=ts(t,i,n),a.push(f)}return i.elements=a,i}}ul.id="polygonAnnotation",ul.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},ul.defaultRoutes={borderColor:"color",backgroundColor:"color"};function EI({centerX:e,centerY:t},{radius:n,borderWidth:i,hitTolerance:r},s){const a=(i+r)/2,l=Math.sin(s),u=Math.cos(s),d={x:e+l*n,y:t-u*n};return{type:"point",optionScope:"point",properties:{x:d.x,y:d.y,centerX:d.x,centerY:d.y,bX:e+l*(n+a),bY:t-u*(n+a)}}}function PI(e,t,n,i){let r=!1,s=e[e.length-1].getProps(["bX","bY"],i);for(const a of e){const l=a.getProps(["bX","bY"],i);l.bY>n!=s.bY>n&&t<(s.bX-l.bX)*(n-l.bY)/(s.bY-l.bY)+l.bX&&(r=!r),s=l}return r}const Fi={box:is,doughnutLabel:ll,ellipse:bo,label:go,line:_o,point:cl,polygon:ul};Object.keys(Fi).forEach(e=>{oe.describe(`elements.${Fi[e].id}`,{_fallback:"plugins.annotation.common"})});const II={update:Object.assign},LI=rd.concat(al),My=(e,t)=>It(t)?fd(e,t):e,ud=e=>e==="color"||e==="font";function dd(e="line"){return Fi[e]?e:(console.warn(`Unknown annotation type: '${e}', defaulting to 'line'`),"line")}function NI(e,t,n,i){const r=FI(e,n.animations,i),s=t.annotations,a=HI(t.elements,s);for(let l=0;l<s.length;l++){const u=s[l],d=ky(a,l,u.type),f=u.setContext(UI(e,d,a,u)),m=d.resolveElementProperties(e,f);m.skip=BI(m),"elements"in m&&(zI(d,m.elements,f,r),delete m.elements),rn(d.x)||Object.assign(d,m),Object.assign(d,m.initProperties),m.options=Dy(f),r.update(d,m)}}function BI(e){return isNaN(e.x)||isNaN(e.y)}function FI(e,t,n){return n==="reset"||n==="none"||n==="resize"?II:new lu(e,t)}function zI(e,t,n,i){const r=e.elements||(e.elements=[]);r.length=t.length;for(let s=0;s<t.length;s++){const a=t[s],l=a.properties,u=ky(r,s,a.type,a.initProperties),d=n[a.optionScope].override(a);l.options=Dy(d),i.update(u,l)}}function ky(e,t,n,i){const r=Fi[dd(n)];let s=e[t];return(!s||!(s instanceof r))&&(s=e[t]=new r,Object.assign(s,i)),s}function Dy(e){const t=Fi[dd(e.type)],n={};n.id=e.id,n.type=e.type,n.drawTime=e.drawTime,Object.assign(n,fd(e,t.defaults),fd(e,t.defaultRoutes));for(const i of LI)n[i]=e[i];return n}function fd(e,t){const n={};for(const i of Object.keys(t)){const r=t[i],s=e[i];ud(i)&&Gt(s)?n[i]=s.map(a=>My(a,r)):n[i]=My(s,r)}return n}function UI(e,t,n,i){return t.$context||(t.$context=Object.assign(Object.create(e.getContext()),{element:t,get elements(){return n.filter(r=>r&&r.options)},id:i.id,type:"annotation"}))}function HI(e,t){const n=t.length,i=e.length;if(i<n){const r=n-i;e.splice(i,0,...new Array(r))}else i>n&&e.splice(n,i-n);return e}var WI="3.1.0";const zi=new Map,Cy=e=>e.type!=="doughnutLabel",$I=rd.concat(al);var Ay={id:"annotation",version:WI,beforeRegister(){k2("chart.js","4.0",on.version)},afterRegister(){on.register(Fi)},afterUnregister(){on.unregister(Fi)},beforeInit(e){zi.set(e,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(e,t,n){const i=zi.get(e),r=i.annotations=[];let s=n.annotations;It(s)?Object.keys(s).forEach(a=>{const l=s[a];It(l)&&(l.id=a,r.push(l))}):Gt(s)&&r.push(...s),oI(r.filter(Cy),e.scales)},afterDataLimits(e,t){const n=zi.get(e);sI(e,t.scale,n.annotations.filter(Cy).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(e,t,n){const i=zi.get(e);tI(e,i,n),NI(e,i,n,t.mode),i.visibleElements=i.elements.filter(r=>!r.skip&&r.options.display),rI(e,i,n)},beforeDatasetsDraw(e,t,n){xo(e,"beforeDatasetsDraw",n.clip)},afterDatasetsDraw(e,t,n){xo(e,"afterDatasetsDraw",n.clip)},beforeDatasetDraw(e,t,n){xo(e,t.index,n.clip)},beforeDraw(e,t,n){xo(e,"beforeDraw",n.clip)},afterDraw(e,t,n){xo(e,"afterDraw",n.clip)},beforeEvent(e,t,n){const i=zi.get(e);eI(i,t.event,n)&&(t.changed=!0)},afterDestroy(e){zi.delete(e)},getAnnotations(e){const t=zi.get(e);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(e,t,n){return Qu(e,t,n)},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:e=>!$I.includes(e)&&e!=="init",annotations:{_allKeys:!1,_fallback:(e,t)=>`elements.${Fi[dd(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:ud,_fallback:!0},_indexable:ud}},additionalOptionScopes:[""]};function xo(e,t,n){const{ctx:i,chartArea:r}=e,s=zi.get(e);n&&Ks(i,r);const a=VI(s.visibleElements,t).sort((l,u)=>l.element.options.z-u.element.options.z);for(const l of a)YI(i,r,s,l);n&&Xs(i)}function VI(e,t){const n=[];for(const i of e)if(i.options.drawTime===t&&n.push({element:i,main:!0}),i.elements&&i.elements.length)for(const r of i.elements)r.options.display&&r.options.drawTime===t&&n.push({element:r});return n}function YI(e,t,n,i){const r=i.element;i.main?(dy(n,r,"beforeDraw"),r.draw(e,t),dy(n,r,"afterDraw")):r.draw(e,t)}const qI={class:"zoom-timerange-container"},jI={class:"zoom-timerange-details"},GI={class:"label","data-testid":"zoom-timerange-from"},KI={class:"label","data-testid":"zoom-timerange-to"},XI=h.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{},granularity:{}},setup(e){const t=e,{i18n:n}=Tt.useI18n(),i=h.ref(Jr({tickValue:t.start,granularity:t.granularity})),r=h.ref(Jr({tickValue:t.end,granularity:t.granularity})),s=(a,l)=>{f0(()=>{i.value=Jr({tickValue:a,granularity:t.granularity}),r.value=Jr({tickValue:l,granularity:t.granularity})},100)()};return h.watch(()=>[t.start,t.end],([a,l])=>{s(a,l)},{immediate:!0}),(a,l)=>(h.openBlock(),h.createElementBlock("div",qI,[h.createElementVNode("div",jI,[h.createElementVNode("div",GI,h.toDisplayString(h.unref(n).t("zoom_time_range.from")),1),h.createElementVNode("div",null,h.toDisplayString(i.value),1),h.createElementVNode("div",KI,h.toDisplayString(h.unref(n).t("zoom_time_range.to")),1),h.createElementVNode("div",null,h.toDisplayString(r.value),1)])]))}}),qe=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n},Oy=qe(XI,[["__scopeId","data-v-4fa681cf"]]),ZI={class:"zoom-actions-container"},QI={class:"zoom-actions-heading"},JI={class:"zoom-action-select"},tL=["data-testid"],eL=["aria-disabled","href"],nL=["onClick"],iL=qe(h.defineComponent({__name:"ZoomActions",props:{zoomActionItems:{},newTimeRange:{},granularity:{}},emits:["onAction"],setup(e,{emit:t}){const n=e,i=t,r=s=>{s.action&&(s.action(n.newTimeRange),i("onAction"))};return(s,a)=>(h.openBlock(),h.createElementBlock("div",ZI,[h.createElementVNode("div",QI,[h.createVNode(Oy,{end:e.newTimeRange.end,granularity:e.granularity,start:e.newTimeRange.start},null,8,["end","granularity","start"]),h.createVNode(h.unref(fe.CloseIcon),{class:"zoom-actions-close-icon",color:`var(--kui-color-text-neutral, ${h.unref(Ac)})`,size:`var(--kui-icon-size-30, ${h.unref(ir)})`,onClick:a[0]||(a[0]=l=>s.$emit("onAction"))},null,8,["color","size"])]),a[2]||(a[2]=h.createElementVNode("div",{class:"zoom-actions-heading-divider"},null,-1)),h.createElementVNode("div",JI,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(e.zoomActionItems,l=>(h.openBlock(),h.createElementBlock("div",{key:l.key,class:h.normalizeClass(["zoom-action-item",{disabled:l.disabled}]),"data-testid":`zoom-action-item-${l.key}`},[l.href?(h.openBlock(),h.createElementBlock("a",{key:0,"aria-disabled":l.disabled,class:"zoom-action-link",href:l.href,onClick:a[1]||(a[1]=u=>s.$emit("onAction"))},h.toDisplayString(l.label),9,eL)):(h.openBlock(),h.createElementBlock("div",{key:1,onClick:u=>r(l)},h.toDisplayString(l.label),9,nL))],10,tL))),128))])]))}}),[["__scopeId","data-v-79ba72f8"]]),rL={key:2},sL={class:"tooltip-title"},oL={class:"title"},aL={key:0,class:"subtitle"},lL={class:"context"},cL={class:"metric"},uL={class:"tooltip"},dL={key:0,class:"square-marker marker-placeholder"},fL={class:"display-value"},wo=qe(h.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(e,{emit:t}){const n=t,i=e,r=h.ref(null),{x:s,y:a,isDragging:l}=iP(r,{initialValue:{x:parseFloat(i.absoluteLeft),y:parseFloat(i.absoluteTop)}}),u=h.computed(()=>`${a.value}px`),d=h.computed(()=>`${s.value}px`),f=h.computed(()=>i.state.tooltipContext),m=h.computed(()=>i.state.metricDisplay),g=h.computed(()=>["interactive","zoom-interactive"].includes(i.state.interactionMode));return h.watch(()=>[i.absoluteLeft,i.absoluteTop],([_,x])=>{l.value||(s.value=parseFloat(_),a.value=parseFloat(x))}),h.watch(l,_=>{_?document.body.classList.add("no-select"):document.body.classList.remove("no-select")}),h.watch(r,_=>{if(_){const{width:x,height:v}=_.getBoundingClientRect();n("dimensions",{width:x,height:v})}}),(_,x)=>e.state.showTooltip?(h.openBlock(),h.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:r,class:h.normalizeClass(["tooltip-container",{locked:e.state.interactionMode==="interactive"}]),style:h.normalizeStyle({transform:g.value?`translate(${d.value}, ${u.value})`:`translate(${e.absoluteLeft}, ${e.absoluteTop})`,left:"0",top:"0",pointerEvents:g.value?"all":"none"})},[e.state.interactionMode==="selecting-chart-area"&&e.granularity&&e.zoomTimeRange&&e.zoomTimeRange.end&&e.zoomTimeRange.start?(h.openBlock(),h.createBlock(Oy,{key:0,end:e.zoomTimeRange?.end,granularity:e.granularity,start:e.zoomTimeRange?.start},null,8,["end","granularity","start"])):e.state.interactionMode==="zoom-interactive"&&e.zoomTimeRange&&e.zoomActionItems&&e.granularity?(h.openBlock(),h.createBlock(iL,{key:1,granularity:e.granularity,"new-time-range":e.zoomTimeRange,"zoom-action-items":e.zoomActionItems,onOnAction:x[0]||(x[0]=v=>n("onAction"))},null,8,["granularity","new-time-range","zoom-action-items"])):(h.openBlock(),h.createElementBlock("div",rL,[h.createElementVNode("div",sL,[h.createElementVNode("div",oL,[h.createElementVNode("div",null,h.toDisplayString(e.tooltipTitle),1),g.value?(h.openBlock(),h.createBlock(h.unref(fe.DragIcon),{key:0,class:"drag-icon",color:`var(--kui-color-text-neutral, ${h.unref(Ac)})`,size:`var(--kui-icon-size-30, ${h.unref(ir)})`},null,8,["color","size"])):h.createCommentVNode("",!0)]),f.value||m.value?(h.openBlock(),h.createElementBlock("div",aL,[h.createElementVNode("div",lL,h.toDisplayString(f.value),1),h.createElementVNode("div",cL,h.toDisplayString(m.value),1)])):h.createCommentVNode("",!0)]),h.createElementVNode("ul",uL,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(e.state.tooltipSeries,({backgroundColor:v,borderColor:S,label:C,value:O,isSegmentEmpty:B,isExtra:I},N)=>(h.openBlock(),h.createElementBlock(h.Fragment,{key:C+N},[e.state.tooltipSeries.length?(h.openBlock(),h.createElementBlock("li",{key:0,class:h.normalizeClass({"extra-row":I})},[I?(h.openBlock(),h.createElementBlock("div",dL)):(h.openBlock(),h.createElementBlock("div",{key:1,class:"square-marker",style:h.normalizeStyle({background:String(v),borderColor:String(S)})},null,4)),h.createElementVNode("span",{class:h.normalizeClass(["display-label",{empty:B}])},h.toDisplayString(C),3),h.createElementVNode("span",fL,h.toDisplayString(O),1)],2)):h.createCommentVNode("",!0)],64))),128))])]))],6)):h.createCommentVNode("",!0)}}),[["__scopeId","data-v-fb2f2a72"]]),hL={key:0,class:"legend-container","data-testid":"legend"},pL=["onClick"],mL={key:0,"aria-hidden":"true",class:"line-marker",height:"2",width:"16"},gL=["stroke","stroke-dasharray"],yL=["title"],_L={class:"label truncate-label"},bL={key:0,class:"sub-label"},xL={key:0},wL={class:"tooltip-content"},dl=qe(h.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(e){const t=e,{i18n:n}=Tt.useI18n(),i=h.inject("showLegendValues",!1),r=h.inject("legendPosition",h.ref(Ie.Bottom)),s=({datasetIndex:u,index:d,isKey:f},m)=>f?`key-${m}`:`dataset-${u??0}-${d??0}`,a=(u=0,d)=>{if(t.chartInstance===null)return;const f=t.chartInstance instanceof on?t.chartInstance:t.chartInstance.chart,m=l(u,d);!f.getDatasetMeta(u).dataset&&d!==void 0?f.toggleDataVisibility(d):m?f.hide(u,d):f.show(u,d),f.update()},l=(u=0,d)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const f=t.chartInstance instanceof on?t.chartInstance:t.chartInstance.chart;return f.getDatasetMeta(u).dataset||d===void 0?f.isDatasetVisible(u):f.getDataVisibility(d)};return(u,d)=>{const f=h.resolveComponent("KTooltip");return h.unref(r)!==h.unref(Ie).Hidden?(h.openBlock(),h.createElementBlock("ul",hL,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(e.items,({fillStyle:m,strokeStyle:g,text:_,datasetIndex:x,index:v,value:S,isSegmentEmpty:C,isKey:O,lineDash:B},I)=>(h.openBlock(),h.createElementBlock("li",{key:s({datasetIndex:x,index:v,isKey:O},I),class:h.normalizeClass({"legend-key":O}),onClick:N=>O?void 0:a(x,v)},[B?.length?(h.openBlock(),h.createElementBlock("svg",mL,[h.createElementVNode("line",{stroke:g,"stroke-dasharray":B.join(" "),"stroke-width":"2",x1:"0",x2:"16",y1:"1",y2:"1"},null,8,gL)])):(h.openBlock(),h.createElementBlock("div",{key:1,class:"square-marker",style:h.normalizeStyle({background:m,"border-color":g})},null,4)),h.createVNode(f,null,h.createSlots({default:h.withCtx(()=>[h.createElementVNode("div",{class:h.normalizeClass(["label-container",{"strike-through":!O&&!l(x,v),"inline-value":O}]),title:S&&(h.unref(i)||O)?`${_}: ${S.formatted}`:_},[h.createElementVNode("div",_L,h.toDisplayString(_),1),S&&(h.unref(i)||O)?(h.openBlock(),h.createElementBlock("div",bL,[O?(h.openBlock(),h.createElementBlock("span",xL,"-")):h.createCommentVNode("",!0),h.createTextVNode(" "+h.toDisplayString(S.formatted),1)])):h.createCommentVNode("",!0)],10,yL)]),_:2},[C?{name:"content",fn:h.withCtx(()=>[h.createElementVNode("div",wL,h.toDisplayString(h.unref(n).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],10,pL))),128))])):h.createCommentVNode("",!0)}}}),[["__scopeId","data-v-90ef4d12"]]),Le=[];for(let e=0;e<256;++e)Le.push((e+256).toString(16).slice(1));function vL(e,t=0){return(Le[e[t+0]]+Le[e[t+1]]+Le[e[t+2]]+Le[e[t+3]]+"-"+Le[e[t+4]]+Le[e[t+5]]+"-"+Le[e[t+6]]+Le[e[t+7]]+"-"+Le[e[t+8]]+Le[e[t+9]]+"-"+Le[e[t+10]]+Le[e[t+11]]+Le[e[t+12]]+Le[e[t+13]]+Le[e[t+14]]+Le[e[t+15]]).toLowerCase()}const SL=new Uint8Array(16);function TL(){return crypto.getRandomValues(SL)}function hd(e,t,n){return crypto.randomUUID?crypto.randomUUID():ML(e)}function ML(e,t,n){e=e||{};const i=e.random??e.rng?.()??TL();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,vL(i)}const Ry=(e,t)=>{const n=e.ctx,i=e.scales.y,r=e.scales.x,s=t[t.length-1].element;n.save(),n.strokeStyle="rgba(100, 100, 100, 1)",n.lineWidth=3,e.options.indexAxis==="x"?n.strokeRect(s.x-s.width/2,s.y,s.width,i.bottom-s.y):n.strokeRect(r.left,s.y-s.height/2,s.x-r.left,s.height),n.restore()};class Ey{id="highlightPlugin";_clickedElements;_previousHoverOption;_clicked=!1;_pause=!1;_suppressNextClick=!1;afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&Ry(t,this._clickedElements)}afterEvent(t,{event:n}){if(n.type==="click"&&this._suppressNextClick){this._suppressNextClick=!1;return}if(n.type!=="click"||!n.native||this._pause)return;this._clicked=!this._clicked;const i=t.options.interaction?.mode||"index",r=t.getElementsAtEventForMode(n.native,i,{intersect:!1},!0);r.length&&this._clicked?(this._clickedElements=r,Ry(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 kL=["id"],DL=["id"],CL={class:"axis-tooltip-content"},AL="100%",OL="100%",RL=20,EL=20,Py=6,PL=0,IL=10,LL=10,NL=1,BL=qe(h.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:(e,t)=>e.value&&t.value&&t.value.raw-e.value.raw},chartTooltipSortFn:{type:Function,default:(e,t)=>t.rawValue-e.rawValue},tooltipMetricDisplay:{default:""}},setup(e){const t=e,{i18n:n}=Tt.useI18n(),{translateUnit:i}=Tt.useTranslatedUnits(),r=crypto.randomUUID(),s=crypto.randomUUID(),a=new Ey,l=h.useTemplateRef("chartContainer"),u=h.useTemplateRef("chartParent"),d=({chart:X},tt)=>{const rt=X.data,pt=rt.labels?.indexOf(tt);return rt.datasets.reduce((yt,mt,Rt)=>{if(X.isDatasetVisible(Rt)){const Ft=mt.data[pt];return isNaN(Ft)?yt:yt+Ft}else return yt},0)},f=(X,tt,rt,pt)=>{const yt=pt==="horizontal";tt===null&&(tt=n.t("entityNoName"));const mt={type:"label",yValue:G=>yt?tt:d(G,tt),xValue:G=>yt?d(G,tt):tt},Rt={...mt,position:yt?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>yt?0:-Math.abs(MP()),content:G=>m0(d(G,tt),rt)},Ft={...mt,content:G=>DP(d(G,tt),kP(G.chart,X)),position:yt?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:G=>yt?TP(m0(d(G,tt),rt)):0,color:yP};return{[`${tt}-value`]:Rt,[`${tt}-percent`]:Ft}},m=h.useTemplateRef("canvas"),g=h.useTemplateRef("axis"),_=hd(),x=hd(),v=h.ref([]),S=h.inject("legendPosition",Ie.Bottom),C=h.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),O=h.toRef(t,"metricUnit"),B=h.computed(()=>t.orientation==="horizontal"),I=h.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:h.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:h.toRef(t,"dimensionAxesTitle"),tooltipSeries:[],left:"",top:"",units:h.toRef(t,"metricUnit"),translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,interactionMode:"idle",chartType:B.value?"horizontal_bar":"vertical_bar",chartID:s,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:N,tooltipAbsoluteTop:W}=Tt.useTooltipAbsolutePosition(u,I),U=h.ref(0),D=()=>t.annotations&&t.chartData.labels?.reduce((X,tt)=>Object.assign(X,f(t.chartData,tt,O.value,t.orientation)),{}),w={id:_,afterUpdate(X){U.value+=1,v.value=Ru(X,t.legendValues,t.chartLegendSortFn)}},A={id:x,afterUpdate(X){X.options.plugins.annotation.annotations=t.annotations?D():{}}},$=[w,{id:"axisHover",afterEvent(X,tt){if(C.show=!1,tt.event.type==="mousemove"){const rt=tt.event,pt=X.options.indexAxis,yt=X.scales,mt=X.scales[pt].getLabelForValue(Number(X.scales[pt].getValueForPixel(rt[pt]))),Ft=X.scales[pt].getLabels().indexOf(mt),G=t.chartData.isLabelEmpty?.[Ft];if((lt=>lt==="x"?rt.y>yt.x.top:rt.x<yt.y.right)(pt)){I.interactionMode!=="interactive"&&(I.showTooltip=!1);const Wt=X.canvas.getContext("2d").measureText(mt).width,_t=Math.abs(Math.round(rt.x-Wt*.5)),Vt=Math.round(rt.x+Wt*.5),Te=X.canvas.getBoundingClientRect(),Me=40;C.left=pt==="x"?`${(_t>0?_t:Vt)-C.offset+Te.left}px`:`${rt.x-Wt*.5-C.offset+Te.left}px`,C.top=`${rt.y-Me+Te.top}px`,mt.length>Qa?(C.show=!0,C.text=mt):G?(C.text=n.t("emptyEntityInfo"),C.show=!0):C.show=!1}else C.show=!1}}},a,...t.annotations?[A]:[]],q=h.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),st=h.ref(0),ct=h.ref(0),ht=new ResizeObserver(f0(X=>{st.value=X[0].contentRect.width,ct.value=X[0].contentRect.height},100)),ut=h.computed(()=>{const X=t.chartData?.labels?.length;return m.value&&X&&!B.value?`${Math.max(X*(RL+Py),st.value)}px`:AL}),vt=h.computed(()=>{const X=t.chartData?.labels?.length;return m.value&&X&&B.value?`${Math.max(X*(EL+Py),ct.value)}px`:OL});Tt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey")),h.onMounted(()=>{t.annotations&&on.register(Ay),l.value&&(st.value=l.value.offsetWidth,ct.value=l.value.offsetHeight,ht.observe(l.value))}),h.onUnmounted(()=>{l.value&&ht.unobserve(l.value)});const at=h.computed(()=>{const X=Tt.useBarChartOptions({tooltipState:I,legendID:_,stacked:h.toRef(t,"stacked"),metricAxesTitle:h.toRef(t,"metricAxesTitle"),dimensionAxesTitle:h.toRef(t,"dimensionAxesTitle"),indexAxis:B.value?"y":"x",numLabels:q});return{...X.value,plugins:{...X.value.plugins,annotation:{annotations:D(),clip:!1}}}}),dt=Tt.useChartJSCommon("bar",m,h.toRef(t,"chartData"),$,at);h.onBeforeUnmount(()=>{on.unregister(Ay)});const V={[Ie.Bottom]:"column"},P=h.computed(()=>{if(g.value&&dt.value){const X=window.devicePixelRatio,tt=dt.value,rt=tt.scales.y.width*X+NL,pt=(tt.scales.y.height+tt.scales.y.top+tt.scales.x.height)*X,yt=g.value.getContext("2d");return yt.scale(X,X),yt.canvas.width=rt,yt.canvas.height=pt,yt.canvas.style.width=`${rt/X}px`,yt.canvas.style.height=`${pt/X}px`,{scale:X,width:rt*X,height:pt*X,targetCtx:yt}}return null}),H=X=>{const tt=X.target;if(P.value&&dt.value&&!B.value){const rt=P.value.scale,pt=P.value.targetCtx,yt=P.value.width,mt=P.value.height,Rt=dt.value,Ft=Rt.canvas;pt.fillStyle="white",tt.scrollLeft>=PL&&tt.scrollLeft<=IL?(pt.globalCompositeOperation="source-over",pt.clearRect(0,0,yt,mt),pt.drawImage(Ft,0,0,yt,mt,0,0,yt,mt),pt.globalCompositeOperation="destination-over",pt.fillRect(0,0,yt,mt)):(pt.globalCompositeOperation="source-over",pt.fillRect(0,(Rt.scales.y.height+Rt.scales.y.top+LL)*rt,yt,Rt.scales.x.height*rt))}I.offsetY=tt.scrollTop,I.offsetX=tt.scrollLeft,C.offset=tt.scrollLeft},nt=({width:X,height:tt})=>{I.width=X,I.height=tt};h.watch(()=>t.orientation,()=>{if(g.value&&P.value){const X=P.value.width,tt=P.value.height;(g.value?.getContext("2d")).clearRect(0,0,X,tt)}I.showTooltip=!1,I.interactionMode="idle"}),h.watch(()=>t.annotations,X=>{dt.value&&(X?dt.value.options.plugins.annotation.annotations=D(t.chartData):delete dt.value.options.plugins.annotation.annotations)});const ot=()=>{I.showTooltip&&(I.interactionMode!=="idle"?I.interactionMode="idle":I.interactionMode="interactive")};return(X,tt)=>(h.openBlock(),h.createElementBlock("div",{ref:"chartParent",class:h.normalizeClass(["chart-parent",V[h.unref(S)]])},[h.createElementVNode("canvas",{id:h.unref(r),ref:"axis",class:"axis"},null,8,kL),h.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:tt[0]||(tt[0]=rt=>ot()),onScroll:H},[h.createElementVNode("div",{class:"chart-body",style:h.normalizeStyle({width:ut.value,height:vt.value})},[h.createElementVNode("canvas",{id:h.unref(s),ref:"canvas",class:"chart-canvas"},null,8,DL)],4)],544),(h.openBlock(),h.createBlock(h.Teleport,{to:"body"},[C.show?(h.openBlock(),h.createElementBlock("div",{key:0,class:"axis-tooltip",style:h.normalizeStyle({top:C.top,left:C.left}),width:"auto"},[h.createElementVNode("div",CL,h.toDisplayString(C.text),1)],4)):h.createCommentVNode("",!0),h.createVNode(wo,{"absolute-left":h.unref(N),"absolute-top":h.unref(W),"chart-parent-ref":u.value,state:I,"tooltip-title":e.tooltipTitle,onDimensions:nt},null,8,["absolute-left","absolute-top","chart-parent-ref","state","tooltip-title"])])),h.createVNode(dl,{id:h.unref(_),"chart-instance":h.unref(dt),items:v.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-60e5a1a7"]]);const FL={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"};Um._date.override({_id:"date-fns",formats:function(){return FL},parse:function(e,t){if(e===null||typeof e>"u")return null;const n=typeof e;return n==="number"||e instanceof Date?e=Ot(e):n==="string"&&(typeof t=="string"?e=Bk(e,t,new Date,this.options):e=Ap(e,this.options)),Pc(e)?e.getTime():null},format:function(e,t){return fa(e,t,this.options)},add:function(e,t,n){switch(n){case"millisecond":return Rc(e,t);case"second":return ET(e,t);case"minute":return OT(e,t);case"hour":return DT(e,t);case"day":return ua(e,t);case"week":return PT(e,t);case"month":return Oc(e,t);case"quarter":return RT(e,t);case"year":return IT(e,t);default:return e}},diff:function(e,t,n){switch(n){case"millisecond":return Ic(e,t);case"second":return WT(e,t);case"minute":return zT(e,t);case"hour":return FT(e,t);case"day":return ap(e,t);case"week":return $T(e,t);case"month":return dp(e,t);case"quarter":return HT(e,t);case"year":return VT(e,t);default:return 0}},startOf:function(e,t,n){switch(t){case"second":return Hk(e);case"minute":return Uk(e);case"hour":return zk(e);case"day":return Ec(e);case"week":return $n(e);case"isoWeek":return $n(e,{weekStartsOn:+n});case"month":return qT(e);case"quarter":return YT(e);case"year":return fp(e);default:return e}},endOf:function(e,t){switch(t){case"second":return QT(e);case"minute":return XT(e);case"hour":return GT(e);case"day":return cp(e);case"week":return KT(e);case"month":return up(e);case"quarter":return ZT(e);case"year":return jT(e);default:return e}}});const Iy={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},zL={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...Iy,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},UL=h.version[0]==="2"?(e,t)=>Object.assign(e,{attrs:t}):(e,t)=>Object.assign(e,t);function rs(e){return h.isProxy(e)?h.toRaw(e):e}function HL(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;return h.isProxy(t)?new Proxy(e,{}):e}function WL(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function Ly(e,t){e.labels=t}function Ny(e,t,n){const i=[];e.datasets=t.map(r=>{const s=e.datasets.find(a=>a[n]===r[n]);return!s||!r.data||i.includes(s)?{...r}:(i.push(s),Object.assign(s,r),s)})}function $L(e,t){const n={labels:[],datasets:[]};return Ly(n,e.labels),Ny(n,e.datasets,t),n}const VL=h.defineComponent({props:zL,setup(e,t){let{expose:n,slots:i}=t;const r=h.ref(null),s=h.shallowRef(null);n({chart:s});const a=()=>{if(!r.value)return;const{type:d,data:f,options:m,plugins:g,datasetIdKey:_}=e,x=$L(f,_),v=HL(x,f);s.value=new on(r.value,{type:d,data:v,options:{...m},plugins:g})},l=()=>{const d=h.toRaw(s.value);d&&(e.destroyDelay>0?setTimeout(()=>{d.destroy(),s.value=null},e.destroyDelay):(d.destroy(),s.value=null))},u=d=>{d.update(e.updateMode)};return h.onMounted(a),h.onUnmounted(l),h.watch([()=>e.options,()=>e.data],(d,f)=>{let[m,g]=d,[_,x]=f;const v=h.toRaw(s.value);if(!v)return;let S=!1;if(m){const C=rs(m),O=rs(_);C&&C!==O&&(WL(v,C),S=!0)}if(g){const C=rs(g.labels),O=rs(x.labels),B=rs(g.datasets),I=rs(x.datasets);C!==O&&(Ly(v.config.data,C),S=!0),B&&B!==I&&(Ny(v.config.data,B,e.datasetIdKey),S=!0)}S&&h.nextTick(()=>{u(v)})},{deep:!0}),()=>h.h("canvas",{role:"img","aria-label":e.ariaLabel,"aria-describedby":e.ariaDescribedby,ref:r},[h.h("p",{},[i.default?i.default():""])])}});function fl(e,t){return on.register(t),h.defineComponent({props:Iy,setup(n,i){let{expose:r}=i;const s=h.shallowRef(null),a=h.shallowRef(null);h.watch(()=>a.value?.chart??null,u=>{s.value=u},{flush:"sync"}),r({chart:s});const l=u=>{a.value=u};return()=>h.h(VL,UL({ref:l},{type:e,...n}))}})}const By=fl("bar",Nm),Fy=fl("doughnut",Js),zy=fl("line",Bm),YL=fl("scatter",zm),qL={class:"chart-container"},jL={key:0,class:"chart-center-metric"},GL={class:"chart-center-total"},KL={key:0,class:"chart-center-unit"},XL=h.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},metricName:{default:""},legendPosition:{default:Ie.Bottom},legendValues:{default:void 0},syntheticsDataKey:{default:""},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""},showCenterMetric:{type:Boolean,default:!0}},setup(e){const t=e,{translateUnit:n}=Tt.useTranslatedUnits(),{i18n:i}=Tt.useI18n(),r=crypto.randomUUID(),s=crypto.randomUUID(),a=h.ref([]),l=h.useTemplateRef("chartParent"),u=h.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:h.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:h.toRef(t,"tooltipDimensionDisplay"),tooltipSeries:[],left:"",top:"",units:h.toRef(t,"metricUnit"),translateUnit:n,offsetX:0,offsetY:0,width:0,height:0,chartID:s,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:d,tooltipAbsoluteTop:f}=Tt.useTooltipAbsolutePosition(l,u),m={id:r,afterUpdate(U){a.value=U.options.plugins.legend.labels.generateLabels(U).map(D=>({...D,value:t.legendValues&&t.legendValues[D.text],hidden:!1}))}},g=h.computed(()=>[m]),_=h.computed(()=>[t.chartData.datasets.reduce((D,w)=>(D.labels.push(w.label),D.backgroundColor.push(w.backgroundColor),D.hoverBorderColor.push(Ma(w.backgroundColor).saturate(.5).darken(.15).hexString()),D.data.push(w.data.reduce((A,L)=>A+L,0)),D),{labels:[],backgroundColor:[],borderColor:"#ffffff",borderWidth:1,hoverBorderColor:[],hoverBorderWidth:1,data:[],hoverOffset:10})]),{formatUnit:x}=ni({i18n:i}),v=h.computed(()=>u2(t.metricName??"")),S=h.computed(()=>{const U=_.value[0]?.data.reduce((D,w)=>D+w,0)??0;return x(U,t.metricUnit,{approximate:!0,translateUnit:(D,w)=>n(D,w)}).trim()}),C=h.computed(()=>t.tooltipMetricDisplay||""),O=h.computed(()=>({...t.chartData,datasets:_.value}));Tt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const{options:B}=Tt.useDonutChartOptions({tooltipState:u,legendID:r}),I=h.ref(),N=U=>({[Ie.Bottom]:"column",[Ie.Hidden]:"hidden"})[U],W=({width:U,height:D})=>{u.width=U,u.height=D};return(U,D)=>(h.openBlock(),h.createElementBlock("div",{ref:"chartParent",class:h.normalizeClass(["chart-parent",N(e.legendPosition)]),"data-testid":"donut-chart-parent"},[h.createElementVNode("div",qL,[h.createVNode(h.unref(Fy),{ref_key:"chartInstance",ref:I,"chart-id":h.unref(s),data:O.value,options:h.unref(B),plugins:g.value},null,8,["chart-id","data","options","plugins"]),e.showCenterMetric&&v.value?(h.openBlock(),h.createElementBlock("div",jL,[h.createElementVNode("span",GL,h.toDisplayString(S.value),1),C.value?(h.openBlock(),h.createElementBlock("span",KL,h.toDisplayString(C.value),1)):h.createCommentVNode("",!0)])):h.createCommentVNode("",!0),(h.openBlock(),h.createBlock(h.Teleport,{to:"body"},[h.createVNode(wo,{"absolute-left":h.unref(d),"absolute-top":h.unref(f),state:u,"tooltip-title":e.tooltipTitle,unit:e.metricUnit,onDimensions:W},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),h.createVNode(dl,{id:h.unref(r),"chart-instance":I.value,items:a.value,position:e.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),ZL=qe(XL,[["__scopeId","data-v-ecbae072"]]);class QL{id="outlierBandPlugin";beforeDatasetsDraw(t,n,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,f=Math.min(Math.max(s.getPixelForValue(r),a),l);if(f<=a)return;const m=t.ctx;m.save(),m.fillStyle=i.color,m.fillRect(u,a,d-u,f-a),m.restore()}}const JL=1.5;class tN{id="referenceLinePlugin";afterDatasetsDraw(t,n,i){const r=i?.lines;if(!r?.length)return;const s=t.scales.y;if(!s||!t.chartArea)return;const{top:a,bottom:l,left:u,right:d}=t.chartArea,f=t.ctx;f.save(),f.lineWidth=JL;for(const{value:m,color:g,borderDash:_}of r){if(!Number.isFinite(m))continue;const x=s.getPixelForValue(m);x<a||x>l||(f.beginPath(),f.setLineDash(_),f.strokeStyle=g,f.moveTo(u,x),f.lineTo(d,x),f.stroke())}f.restore()}}const eN={class:"chart-container"},nN=qe(h.defineComponent({__name:"ScatterChart",props:{chartData:{default:void 0},tooltipTitle:{},metricUnit:{default:""},xMetric:{default:void 0},xMetricUnit:{default:void 0},granularity:{},timeRangeMs:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:()=>0},chartTooltipSortFn:{type:Function,default:(e,t)=>t.rawValue-e.rawValue},tooltipMetricDisplay:{default:""},shadeOutlierRegion:{type:Boolean,default:!1},themeColors:{default:()=>Xu()}},setup(e){const t=e,n=h.inject("legendPosition",Ie.Bottom),{i18n:i}=Tt.useI18n(),{formatUnit:r}=ni({i18n:i}),{translateUnit:s}=Tt.useTranslatedUnits(),a=h.useTemplateRef("chartParent"),l=new QL,u=new tN,d=crypto.randomUUID(),f=crypto.randomUUID(),m=h.ref(),g=h.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:h.toRef(t,"tooltipMetricDisplay"),tooltipSeries:[],left:"",top:"",units:h.toRef(t,"metricUnit"),translateUnit:s,offsetX:0,offsetY:0,width:0,height:0,chartType:"scatter",chartID:f,chartTooltipSortFn:t.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:_,tooltipAbsoluteTop:x}=Tt.useTooltipAbsolutePosition(a,g);Tt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const v=h.computed(()=>t.chartData?.outlier),S=h.computed(()=>t.chartData?.referenceLines??[]),C=h.ref([]),O={id:d,afterUpdate(A){C.value=Ru(A,void 0,t.chartLegendSortFn)}},B=h.computed(()=>{const A=[];v.value&&A.push({text:v.value.label,fillStyle:v.value.color,strokeStyle:v.value.color,isKey:!0});for(const L of S.value)A.push({text:L.label,fillStyle:L.color,strokeStyle:L.color,lineDash:L.borderDash,isKey:!0,value:{raw:L.value,formatted:r(L.value,t.metricUnit,{translateUnit:s})}});return A}),I=h.computed(()=>[...C.value,...B.value]),N=h.computed(()=>t.shadeOutlierRegion?v.value?.value:void 0),W=h.computed(()=>[O,...N.value!==void 0?[l]:[],...S.value.length?[u]:[]]),U=h.computed(()=>`scatter-${W.value.map(A=>A.id).join("-")}`),{options:D}=Tt.useScatterChartOptions({tooltipState:g,legendID:d,granularity:h.toRef(t,"granularity"),timeRangeMs:h.toRef(t,"timeRangeMs"),metricAxesTitle:h.toRef(t,"metricAxesTitle"),dimensionAxesTitle:h.toRef(t,"dimensionAxesTitle"),metricUnit:h.toRef(t,"metricUnit"),xMetric:h.toRef(t,"xMetric"),xMetricUnit:h.toRef(t,"xMetricUnit"),outlierValue:N,referenceLines:S,themeColors:h.toRef(t,"themeColors")}),w=A=>({[Ie.Bottom]:"column",[Ie.Hidden]:"hidden"})[A];return(A,L)=>(h.openBlock(),h.createElementBlock("div",{ref:"chartParent",class:h.normalizeClass(["chart-parent",w(h.unref(n))]),"data-testid":"scatter-chart-parent"},[h.createElementVNode("div",eN,[(h.openBlock(),h.createBlock(h.unref(YL),{key:U.value,ref_key:"chartInstance",ref:m,"chart-id":h.unref(f),class:"chart-canvas",data:e.chartData,"data-testid":"scatter-chart",options:h.unref(D),plugins:W.value},null,8,["chart-id","data","options","plugins"]))]),h.createVNode(wo,{"absolute-left":h.unref(_),"absolute-top":h.unref(x),"data-testid":"tooltip",granularity:e.granularity,state:g,"tooltip-title":e.tooltipTitle},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title"]),h.createVNode(dl,{id:h.unref(d),"chart-instance":m.value,"data-testid":"legend",items:I.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-3bb682a5"]]),pd=(e,t,n,i,r="#0275d8")=>{e.save(),e.beginPath(),e.moveTo(t,n),e.lineTo(t,i),e.lineWidth=1,e.strokeStyle=r,e.stroke(),e.restore()},Je={},iN=()=>{Je.x=void 0,Je.chart=void 0,Je.strategy=void 0,Je.group=void 0},rN=10;class Uy{id="verticalLinePlugin";_clickedSegment;_pause=!1;_useBrushingState=!1;_brushStrategy;_brushGroup;constructor({brushGroup:t=void 0,brushStrategy:n=void 0,enableBrushing:i=!1}={}){let r=!1;n==="group"&&(r=t!==void 0),this._useBrushingState=i&&r,this._brushStrategy=n,this._brushGroup=t}afterEvent(t,n){if(!this._useBrushingState)return;const{event:i}=n;(i.type==="mousemove"||i.type==="mouseout")&&requestAnimationFrame(r=>this.onMouseBrush(i.type,t,r))}_lastMouseBrushEvent=0;onMouseBrush(t,n,i){if(t==="mousemove"&&i-this._lastMouseBrushEvent<rN)return;const r=()=>{Je.chart=n,Je.strategy=this._brushStrategy,Je.group=this._brushGroup;for(const s of Object.values(on.instances))s!==n&&s.update("none")};t==="mousemove"?n.tooltip&&n.tooltip.getActiveElements()&&n.tooltip.getActiveElements().length&&(Je.x=n.tooltip.dataPoints[0].element.x,r()):t==="mouseout"&&(Je.x=void 0,r()),this._lastMouseBrushEvent=i}afterDatasetsDraw(t){if(this.isPaused)return;const n=t.tooltip&&t.tooltip.getActiveElements()&&t.tooltip.getActiveElements().length,i=t.ctx;if(this._clickedSegment){const{x:r}=this._clickedSegment.element;pd(i,r,t.scales.y.top,t.scales.y.bottom)}else if(this._useBrushingState)this.drawByBrush(t);else if(n){const{x:r}=t.tooltip.dataPoints[0].element;pd(i,r,t.scales.y.top,t.scales.y.bottom)}}drawByBrush(t){if(Je.x===void 0)return;const n=Je.chart===t?"#0275d8":"rgba(2, 117, 216, 0.3)";this._brushStrategy==="group"&&Je.group===this._brushGroup&&pd(t.ctx,Je.x,t.scales.y.top,t.scales.y.bottom,n)}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&&Je.chart===t){const n=Je.x!==void 0;if(iN(),n)for(const i of Object.values(on.instances))i!==t&&i.update("none")}}}const sN=(e,t,n)=>{const i=e.ctx;i.save(),i.strokeStyle="rgba(95, 154, 255, 1)",i.lineWidth=2,i.beginPath(),i.moveTo(t,e.chartArea.top),i.lineTo(t,e.chartArea.bottom),i.moveTo(n,e.chartArea.top),i.lineTo(n,e.chartArea.bottom),i.stroke(),i.restore()},oN=(e,t,n)=>{const i=e.ctx;i.save(),i.fillStyle="rgba(143, 193, 255, 0.3)",i.fillRect(t,e.chartArea.top,n-t,e.chartArea.bottom-e.chartArea.top),i.restore()},Hy=(e,t)=>{const n=e.scales.x.getValueForPixel(t.startX),i=e.scales.x.getValueForPixel(t.endX);if(!(n===void 0||i===void 0))return{xStart:Math.min(n,i),xEnd:Math.max(n,i)}},Wy=(e,t,n)=>{t.canvas.dispatchEvent(new CustomEvent(e,{detail:n}))};class aN{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 n=t.canvas;let i=!1;const r=l=>{this._dragTimeout=window.setTimeout(()=>{const u=n.getBoundingClientRect();this._isDragging=!0,this._clearSelectionArea=!1,i=!0,this._startX=l.clientX-u.left,this._endX=this._startX},150)},s=l=>{const u=n.getBoundingClientRect();if(i&&this._isDragging){this._endX=l.clientX-u.left;const d=Hy(t,this);d&&Wy("dragSelectMove",t,d)}},a=l=>{const u=n.getBoundingClientRect();if(clearTimeout(this._dragTimeout),i&&this._isDragging){this._endX=l.clientX-u.left,i=!1,this._isDragging=!1;const d=Hy(t,this);d?Wy("dragSelect",t,d):this.clearSelectionArea()}};n.addEventListener("mousedown",r),n.addEventListener("mousemove",s),n.addEventListener("mouseup",a),this._dragSelectHandlers={onMouseDown:r,onMouseMove:s,onMouseUp:a}}beforeDestroy(t){const n=t.canvas;if(this._dragSelectHandlers){const{onMouseDown:i,onMouseMove:r,onMouseUp:s}=this._dragSelectHandlers;n.removeEventListener("mousedown",i),n.removeEventListener("mousemove",r),n.removeEventListener("mouseup",s)}this._isDragging=!1,this._dragTimeout&&clearTimeout(this._dragTimeout)}afterDatasetsDraw(t){(this._isDragging||!this._clearSelectionArea)&&(oN(t,this._startX,this._endX),sN(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const lN=20,cN="rgba(255, 171, 171, 0.4)",uN="rgba(255, 196, 0, 0.2)",$y=(e,t,n)=>{const i=t.y-e.y;if(i===0)return t.x;const r=(n-e.y)/i;return e.x+r*(t.x-e.x)},Vy=e=>"yAxisID"in e&&e.yAxisID||Ja,Yy=(e,t)=>{const n=e.data.datasets.find(i=>i.rawMetric===t);return n?Vy(n):Ja},dN=(e,t,n=Ja)=>{const i=[];return e.data.datasets.forEach(r=>{if(!e.getDatasetMeta(e.data.datasets.indexOf(r)).visible||Vy(r)!==n)return;const a=r.data;a?.length&&t.filter(l=>l.highlightIntersections).forEach(l=>{const u=a.map(f=>({ts:f.x,aboveThreshold:f.y>=l.value}));let d=u[0].aboveThreshold?a[0].x:void 0;for(let f=1;f<u.length;f++)!u[f-1].aboveThreshold&&u[f].aboveThreshold?d=$y(a[f-1],a[f],l.value):u[f-1].aboveThreshold&&!u[f].aboveThreshold&&d!==void 0&&(i.push({start:d,end:$y(a[f-1],a[f],l.value),type:l.type}),d=void 0);d!==void 0&&i.push({start:d,end:u[u.length-1].ts,type:l.type})})}),i},fN=e=>{if(!e.length)return[];e.sort((n,i)=>n.type.localeCompare(i.type)||n.start-i.start);const t=[];for(const n of e){const i=t.findLast(({type:r})=>r===n.type);i&&n.start<=i.end?i.end=Math.max(i.end,n.end):t.push({...n})}return t};class hN{constructor(t){this.i18n=t}i18n;id="thresholdPlugin";_thresholds;_mouseMoveHandler;_syncThresholds(t){for(const n of Object.keys(t.threshold||{})){const i=t.threshold?.[n];i&&(this._thresholds={...this._thresholds,[n]:i.map(r=>({...r,hovered:!1}))})}if(this._thresholds)for(const n of Object.keys(this._thresholds))t.threshold?.[n]||delete this._thresholds[n]}get thresholds(){return this._thresholds}beforeUpdate(t,n,i){this._syncThresholds(i)}beforeInit(t,n,i){const r=t.canvas;this._syncThresholds(i);const s=a=>{if(t){const l=a.clientY,u=r.getBoundingClientRect();for(const d of Object.keys(this._thresholds||{})){const m=(t.scales[Yy(t,d)]??t.scales.y).getValueForPixel(l-u.top);if(m){const g=this._thresholds?.[d];g&&g.forEach(_=>{_.hovered=Math.abs(_.value-m)<lN})}}}};r.addEventListener("mousemove",s),this._mouseMoveHandler=s}afterDatasetsDraw(t,n){const i=t.ctx;for(const r of Object.keys(this._thresholds||{})){const s=this._thresholds?.[r];if(s){const a=Yy(t,r),l=t.scales[a]??t.scales.y;s.forEach(f=>{const m=l.getPixelForValue(f.value);i.save(),i.beginPath(),i.moveTo(t.chartArea.left,m),i.lineTo(t.chartArea.right,m),i.lineWidth=1,i.strokeStyle=Lu(f.type),i.setLineDash([5,5]),i.stroke(),i.restore();let g="";f.label?g=`${f.label}: ${f.value}`:f.type==="warning"?g=this.i18n.t("chartLabels.threshold-warning",{value:f.value}):f.type==="error"?g=this.i18n.t("chartLabels.threshold-error",{value:f.value}):g=this.i18n.t("chartLabels.thatreshold-neutral",{value:f.value}),f.hovered&&(i.save(),i.fillStyle=Lu(f.type),i.font=sS,i.fillText(g,t.chartArea.left,m-4),i.restore())});const u=dN(t,s,a);fN(u).forEach(f=>{const m=t.scales.x.getPixelForValue(f.start),g=t.scales.x.getPixelForValue(f.end);i.save(),i.fillStyle=f.type==="error"?cN:uN,i.fillRect(m,t.chartArea.top,g-m,t.chartArea.bottom-t.chartArea.top),i.restore(),i.save(),i.beginPath(),i.moveTo(m,t.chartArea.bottom),i.lineTo(g,t.chartArea.bottom),i.lineWidth=2,i.strokeStyle=Lu(f.type),i.stroke(),i.restore()})}}}beforeDestroy(t){this._mouseMoveHandler&&t.canvas.removeEventListener("mousemove",this._mouseMoveHandler)}}const pN=qe(h.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:(e,t)=>e.value&&t.value&&t.value.raw-e.value.raw},chartTooltipSortFn:{type:Function,default:(e,t)=>t.rawValue-e.rawValue},brush:{type:Boolean,default:!1},zoomActionItems:{default:void 0},tooltipMetricDisplay:{default:""},threshold:{default:void 0},leftYAxisGrid:{type:Boolean,default:void 0},rightYAxis:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(e,{emit:t}){const n=e,i=t,{i18n:r}=Tt.useI18n(),s=new Uy,a=new Ey,l=new aN,u=new hN(r),{translateUnit:d}=Tt.useTranslatedUnits(),f=h.ref(),m=crypto.randomUUID(),g=crypto.randomUUID(),_=h.ref([]),x=h.inject("legendPosition",Ie.Bottom),v=h.useTemplateRef("chartParent"),S=h.ref(void 0),C=h.ref(!1),O=h.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:h.toRef(n,"tooltipMetricDisplay"),tooltipSeries:[],left:"",top:"",units:h.toRef(n,"metricUnit"),translateUnit:d,offsetX:0,offsetY:0,width:0,height:0,chartType:n.type,chartID:g,chartTooltipSortFn:n.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:B,tooltipAbsoluteTop:I}=Tt.useTooltipAbsolutePosition(v,O),N={id:m,afterUpdate(V){_.value=Ru(V,n.legendValues,n.chartLegendSortFn)}},W=h.computed(()=>[N,a,...n.brush?[l]:[],...n.type==="timeseries_line"?[s]:[],...n.threshold?[u]:[]]),U=h.computed(()=>`line-${W.value.map(V=>V.id).join("-")}`),D=h.computed(()=>`bar-${W.value.map(V=>V.id).join("-")}`),w=h.computed(()=>n.chartData&&pP(n.chartData)),{options:A}=Tt.useLineChartOptions({tooltipState:O,timeRangeMs:h.toRef(n,"timeRangeMs"),granularity:h.toRef(n,"granularity"),legendID:m,stacked:h.toRef(n,"stacked"),metricAxesTitle:h.toRef(n,"metricAxesTitle"),dimensionAxesTitle:h.toRef(n,"dimensionAxesTitle"),pointsWithoutHover:w,threshold:h.toRef(n,"threshold"),leftYAxisGrid:h.toRef(n,"leftYAxisGrid"),rightYAxis:h.toRef(n,"rightYAxis")});Tt.useReportChartDataForSynthetics(h.toRef(n,"chartData"),h.toRef(n,"syntheticsDataKey"));const L=V=>V?V.end.getTime()>V.start.getTime():!1,$=V=>({[Ie.Bottom]:"column",[Ie.Hidden]:"hidden"})[V],q=({width:V,height:P})=>{O.width=V,O.height=P},st=(V=!0)=>{O.interactionMode="idle",O.showTooltip=!1,l.clearSelectionArea(),a.isPaused&&a.resume(V),s.isPaused&&s.resume()},ct=()=>{O.interactionMode="interactive"},ht=()=>{!f.value||!f.value.chart.tooltip?.dataPoints?.length||(O.interactionMode==="interactive"?s.clickedSegment=f.value.chart.tooltip.dataPoints[0]:s.destroyClickedSegment())},ut=()=>{if(C.value){C.value=!1;return}O.interactionMode!=="idle"?st():ct(),ht()};h.watch(()=>n.type,()=>{O.interactionMode="idle",O.showTooltip=!1,s.destroyClickedSegment()});const vt=V=>{V.preventDefault(),V.stopPropagation();const{xStart:P,xEnd:H}=V.detail,nt={start:new Date(P),end:new Date(H),type:"absolute"};if(!L(nt)){S.value=void 0,st(!1);return}S.value=nt,O.interactionMode="zoom-interactive",nt&&i("select-chart-range",nt)},at=V=>{O.interactionMode="selecting-chart-area",C.value=!0,s.pause(),a.pause();const{xStart:P,xEnd:H}=V.detail;S.value={start:new Date(P),end:new Date(H),type:"absolute"}},dt=V=>{if(!v.value||O.interactionMode==="idle")return;const P=V.target;P&&v.value.contains(P)||C.value||st(!1)};return h.watch(()=>f.value?.chart,()=>{f.value?.chart&&(f.value.chart.canvas.removeEventListener("dragSelect",vt),f.value.chart.canvas.removeEventListener("dragSelectMove",at),f.value.chart.canvas.addEventListener("dragSelect",vt),f.value.chart.canvas.addEventListener("dragSelectMove",at))}),h.onMounted(()=>{document.addEventListener("click",dt,!0)}),h.onUnmounted(()=>{f.value?.chart&&(f.value.chart.canvas.removeEventListener("dragSelect",vt),f.value.chart.canvas.removeEventListener("dragSelectMove",at)),document.removeEventListener("click",dt,!0)}),(V,P)=>(h.openBlock(),h.createElementBlock("div",{ref:"chartParent",class:h.normalizeClass(["chart-parent",$(h.unref(x))]),"data-testid":"line-chart-parent"},[h.createElementVNode("div",{class:"chart-container",onClick:P[0]||(P[0]=H=>ut())},[e.type==="timeseries_line"?(h.openBlock(),h.createBlock(h.unref(zy),{key:U.value,ref_key:"chartInstance",ref:f,"chart-id":h.unref(g),class:"chart-canvas",data:e.chartData,"data-testid":"time-series-line-chart",options:h.unref(A),plugins:W.value},null,8,["chart-id","data","options","plugins"])):e.type==="timeseries_bar"?(h.openBlock(),h.createBlock(h.unref(By),{key:D.value,ref_key:"chartInstance",ref:f,"chart-id":h.unref(g),class:"chart-canvas",data:e.chartData,"data-testid":"time-series-bar-chart",options:h.unref(A),plugins:W.value},null,8,["chart-id","data","options","plugins"])):h.createCommentVNode("",!0)]),h.createVNode(wo,{"absolute-left":h.unref(B),"absolute-top":h.unref(I),"data-testid":"tooltip",granularity:e.granularity,state:O,"tooltip-title":e.tooltipTitle,"zoom-action-items":e.zoomActionItems,"zoom-time-range":S.value,onDimensions:q,onOnAction:P[1]||(P[1]=()=>st(!1))},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title","zoom-action-items","zoom-time-range"]),h.createVNode(dl,{id:h.unref(m),"chart-instance":f.value,"data-testid":"legend",items:_.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-28d026be"]]),mN={key:0,class:"chart-truncation-warning","data-testid":"truncation-warning"},gN={class:"tooltip-content"},yN={key:2,class:"analytics-chart-parent"},_N=h.defineComponent({__name:"AnalyticsChart",props:{chartData:{},chartOptions:{},activeMetric:{default:void 0},tooltipTitle:{default:""},emptyStateTitle:{default:""},emptyStateDescription:{default:""},legendPosition:{default:Ie.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(e,{emit:t}){const n=t,i=e,{i18n:r}=Tt.useI18n(),s=h.computed(()=>Zu(i.chartData)?void 0:i.chartData),a=h.computed(()=>{const G=i.chartOptions.metricAxisMap,it=s.value?.meta?.metric_names??[];if(!(i.chartOptions.type!=="timeseries_line"||!G||!it.some(lt=>G[lt]==="right")))return G}),l=h.computed(()=>!!a.value),u=(G,it)=>a.value?G.filter(lt=>(a.value?.[lt]??"left")===it):G,d=h.computed(()=>{const G=s.value?.meta,it=G?.metric_names??[];return["timeseries_line","timeseries_bar"].includes(i.chartOptions.type)&&!l.value&&it.length>1&&Object.keys(G?.display??{}).length>0?it:[]}),f=h.computed(()=>d.value.length>1),m=h.computed(()=>i.activeMetric&&d.value.includes(i.activeMetric)?i.activeMetric:d.value[0]),g=h.computed(()=>{const G=s.value;return!G||!f.value||!m.value?G:{...G,meta:{...G.meta,metric_names:[m.value]}}}),_=h.computed(()=>{const G=i.chartOptions.threshold;return!f.value||!G?G:{...G,...Object.fromEntries(Object.keys(G).filter(it=>it!==m.value).map(it=>[it,[]]))}}),x=h.computed(()=>{if(ht.value)return Zu(i.chartData)?i.chartData:L0(i.chartData)}),v=h.inject("app:konnectColorMode",h.computed(()=>"light")),S=h.useTemplateRef("chartShell"),C=h.computed(()=>(v.value,Xu(S.value))),O=h.computed(()=>{if(x.value){const{start:it,end:lt,metric:Wt,metricUnit:_t,truncated:Vt,limit:Te,datasource:Me}=x.value;return{start:it,end:lt,metricNames:[Wt],metricUnits:{[Wt]:_t??""},truncated:Vt,limit:Te,datasource:Me}}const G=g.value?.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}}),B=h.computed(()=>ht.value?Tt.useScatterDatasets({colorPalette:i.chartOptions.chartDatasetColors,scatter:i.chartOptions.scatter,themeColors:C},x).value:s.value?st.value?Tt.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Bu,metricAxisMap:a.value},g).value:Tt.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Bu},s).value:{datasets:[]}),I=h.computed(()=>i.timeseriesZoom||!!i.exploreLink||!!i.requestsLink),N=h.computed(()=>{if(!i.chartData||s.value&&!s.value.meta)return 0;const{start:G,end:it}=O.value;if(G&&it)return new Date(it).getTime()-new Date(G).getTime()}),W=h.computed(()=>O.value.metricUnits?f.value&&m.value?O.value.metricUnits[m.value]??"":Object.values(O.value.metricUnits)[0]??"":""),U=h.computed(()=>O.value.metricUnits?f.value&&m.value?m.value:Object.keys(O.value.metricUnits)[0]??"":""),D=h.computed(()=>i.showLegendValues&&i.legendPosition!==Ie.Hidden),{legendValues:w}=Tt.useChartLegendValues(B,i.chartOptions.type,W),A=h.computed(()=>O.value.limit?.toString()||null),L=h.computed(()=>i.chartOptions.hideTruncationWarning?!1:O.value.truncated||!1),$=h.computed(()=>r.t("limitedResultsShown",{maxReturned:A.value})),q=h.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),st=h.computed(()=>["timeseries_bar","timeseries_line"].some(G=>G===i.chartOptions.type)),ct=h.computed(()=>i.chartOptions.type==="donut"),ht=h.computed(()=>i.chartOptions.type==="scatter"),ut=h.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),vt=h.computed(()=>{const{metricNames:G,metricUnits:it}=O.value;if(l.value||!G||!it)return;const lt=G[0],Wt=it[lt]||"";if(G.length>1){if(lt.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${Wt}`,{plural:"s"})});if(lt.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${Wt}`,{plural:"s"})})}if(lt)return el(Wt)&&r.te(`metricAxisTitles.${lt}`)?r.t(`metricAxisTitles.${lt}`)||void 0:r.te(`chartLabels.${lt}`)?r.t(`chartLabels.${lt}`):lt}),at=h.computed(()=>{const G=i.chartOptions.yAxes?.left?.title??i.chartOptions?.metricAxesTitle;if(G)return G;const{metricNames:it,metricUnits:lt}=O.value;if(!(!it||!lt))return V(u(it,"left"),lt)}),dt=h.computed(()=>{if(!l.value)return;const{metricNames:G,metricUnits:it}=O.value,lt=G&&it?V(u(G,"right"),it):void 0;return{title:i.chartOptions.yAxes?.right?.title??lt,showGrid:i.chartOptions.yAxes?.right?.showGrid}}),V=(G,it)=>{const lt=G[0];if(!lt)return;const Wt=it[lt]||"";if(G.length>1){if(lt.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${Wt}`,{plural:"s"})});if(lt.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${Wt}`,{plural:"s"})})}return P(lt,Wt)},P=(G,it)=>{if(r.te(`metricAxisTitles.${G}`)){if(el(it))return r.t(`metricAxisTitles.${G}`)||void 0;const lt=r.te(`chartUnits.${it}`)?r.t(`chartUnits.${it}`,{plural:"s"}):it;return r.t(`metricAxisTitles.${G}`,{unit:lt})||void 0}return G||void 0},H=h.computed(()=>{if(i.chartOptions?.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const G=s.value?.meta,it=st.value?"Time":Object.keys(G?.display||G?.metric_names||{})[0];if(it)return r.te(`chartLabels.${it}`)?r.t(`chartLabels.${it}`):it}),nt=h.computed(()=>{if(yx(O.value.datasource))return r.t("timestampAxisTitles.platform");const G=ia(s.value?.meta?.granularity_ms);if(G)return r.te(`granularityAxisTitles.${G}`)?r.t(`granularityAxisTitles.${G}`):G}),ot=h.computed(()=>{const G=x.value?.xMetric;return G?P(G,x.value?.xMetricUnit??""):nt.value}),X=h.computed(()=>i.emptyStateTitle||r.t("noDataAvailableTitle")),tt=h.computed(()=>i.emptyStateDescription||r.t("noDataAvailableDescription")),rt=h.computed(()=>ht.value?!!x.value?.points.length:st.value?mP(B.value):!!(s.value&&s.value.meta&&s.value.data.length)),pt=h.computed(()=>{const G=s.value;return G?G.meta.granularity_ms?ia(G.meta.granularity_ms)||"hourly":ia(new Date(G.data[1].timestamp).getTime()-new Date(G.data[0].timestamp).getTime())||"hourly":"hourly"}),yt=h.computed(()=>ia(s.value?.meta?.granularity_ms)||"secondly"),mt=h.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(G,it)=>G.text===r.t("chartLabels.____OTHER____")?1:it.text===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(G.text,10))&&!isNaN(parseInt(it.text,10))?G.text<it.text?-1:1:G.value&&it.value?it.value.raw-G.value.raw:0),Rt=h.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(G,it)=>G.label===r.t("chartLabels.____OTHER____")?1:it.label===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(G.label,10))&&!isNaN(parseInt(it.label,10))?G.label<it.label?-1:1:G.value&&it.value?it.rawValue-G.rawValue:0),Ft=h.computed(()=>[...i.timeseriesZoom?[{label:r.t("zoom_action_items.zoom"),key:"zoom-in",action:G=>n("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 h.provide("showLegendValues",D),h.provide("legendPosition",h.toRef(i,"legendPosition")),(G,it)=>{const lt=h.resolveComponent("KTooltip"),Wt=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",{ref:"chartShell",class:h.normalizeClass(["analytics-chart-shell",{"show-values":D.value}])},[rt.value&&L.value&&A.value?(h.openBlock(),h.createElementBlock("div",mN,[h.createVNode(lt,{class:"tooltip","max-width":"500",placement:"right"},{content:h.withCtx(()=>[h.createElementVNode("div",gN,h.toDisplayString($.value),1)]),default:h.withCtx(()=>[h.createVNode(h.unref(fe.WarningIcon),{color:`var(--kui-color-text-warning, ${h.unref(iS)})`,size:`var(--kui-icon-size-40, ${h.unref(oS)})`},null,8,["color","size"])]),_:1})])):h.createCommentVNode("",!0),rt.value?(h.openBlock(),h.createElementBlock("div",yN,[st.value?(h.openBlock(),h.createBlock(pN,{key:0,brush:I.value,"chart-data":B.value,"chart-legend-sort-fn":mt.value,"chart-tooltip-sort-fn":Rt.value,"dimension-axes-title":nt.value,fill:e.chartOptions.stacked,granularity:pt.value,"left-y-axis-grid":e.chartOptions.yAxes?.left?.showGrid,"legend-values":h.unref(w),"metric-axes-title":at.value,"metric-unit":W.value,"right-y-axis":dt.value,stacked:e.chartOptions.stacked,"synthetics-data-key":e.syntheticsDataKey,threshold:_.value,"time-range-ms":N.value,"tooltip-metric-display":vt.value,"tooltip-title":e.tooltipTitle,type:e.chartOptions.type,"zoom-action-items":Ft.value,onSelectChartRange:it[0]||(it[0]=_t=>n("select-chart-range",_t)),onZoomTimeRange:it[1]||(it[1]=_t=>n("zoom-time-range",_t))},null,8,["brush","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","fill","granularity","left-y-axis-grid","legend-values","metric-axes-title","metric-unit","right-y-axis","stacked","synthetics-data-key","threshold","time-range-ms","tooltip-metric-display","tooltip-title","type","zoom-action-items"])):q.value?(h.openBlock(),h.createBlock(BL,{key:1,annotations:e.showAnnotations,"chart-data":B.value,"chart-legend-sort-fn":mt.value,"chart-tooltip-sort-fn":Rt.value,"data-testid":"bar-chart-container","dimension-axes-title":H.value,"legend-values":h.unref(w),"metric-axes-title":at.value,"metric-unit":W.value,orientation:ut.value,stacked:e.chartOptions.stacked,"synthetics-data-key":e.syntheticsDataKey,"tooltip-metric-display":vt.value,"tooltip-title":e.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"])):ct.value?(h.openBlock(),h.createBlock(ZL,{key:2,"chart-data":B.value,"dataset-colors":e.chartOptions.chartDatasetColors||h.unref(Bu),"legend-position":e.legendPosition,"legend-values":h.unref(w),"metric-name":U.value,"metric-unit":W.value,"show-center-metric":e.chartOptions.showCenterMetric,"synthetics-data-key":e.syntheticsDataKey,"tooltip-dimension-display":H.value,"tooltip-metric-display":vt.value,"tooltip-title":e.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"])):ht.value?(h.openBlock(),h.createBlock(nN,{key:3,"chart-data":B.value,"chart-legend-sort-fn":e.chartOptions.chartLegendSortFn,"chart-tooltip-sort-fn":Rt.value,"data-testid":"scatter-chart-container","dimension-axes-title":ot.value,granularity:yt.value,"metric-axes-title":at.value,"metric-unit":W.value,"shade-outlier-region":e.chartOptions.scatter?.shadeOutlierRegion,"synthetics-data-key":e.syntheticsDataKey,"theme-colors":C.value,"time-range-ms":N.value,"tooltip-metric-display":vt.value,"tooltip-title":e.tooltipTitle,"x-metric":x.value?.xMetric,"x-metric-unit":x.value?.xMetricUnit},null,8,["chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","granularity","metric-axes-title","metric-unit","shade-outlier-region","synthetics-data-key","theme-colors","time-range-ms","tooltip-metric-display","tooltip-title","x-metric","x-metric-unit"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(Wt,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(X.value),1)]),default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(tt.value),1)]),_:1}))],2)}}}),bN=qe(_N,[["__scopeId","data-v-c5c250ba"]]),xN={class:"chart-parent","data-testid":"gauge-chart-parent"},wN={class:"chart-totals-flex"},vN={key:1,class:"metric-small","data-testid":"gauge-chart-total"},SN=qe(h.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:Kn},height:{type:String,required:!1,default:"400px",validator:e=>/(\d *)(px|%)/.test(e)},width:{type:String,required:!1,default:"100%",validator:e=>/(\d *)(px|%)/.test(e)}},setup(e){const t=e,{i18n:n}=Tt.useI18n(),i=h.ref(hd()),r=h.computed(()=>[t.chartData.datasets.reduce((_,x)=>(_.labels.push(x.label),_.borderColor.push(x.backgroundColor),_.backgroundColor.push(x.backgroundColor),_.data.push(x.data.reduce((v,S)=>v+S,0)),_),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),s=h.computed(()=>({...t.chartData,datasets:r.value}));Tt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const a={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},l=h.computed(()=>uo(r?.value[0]?.data[t.numerator],{capital:!0})),u=h.computed(()=>uo(r?.value[0]?.data[0]+r?.value[0]?.data[1],{capital:!0})),d=h.computed(()=>`color: ${r?.value[0]?.backgroundColor[t.numerator]}`),f=h.computed(()=>["full","single"].includes(t.metricDisplay)),m=h.computed(()=>t.metricDisplay==="full");return(g,_)=>(h.openBlock(),h.createElementBlock("div",xN,[h.createElementVNode("div",wN,[f.value?(h.openBlock(),h.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:h.normalizeStyle(d.value)},h.toDisplayString(l.value),5)):h.createCommentVNode("",!0),m.value?(h.openBlock(),h.createElementBlock("div",vN,h.toDisplayString(h.unref(n).t("total"))+": "+h.toDisplayString(u.value),1)):h.createCommentVNode("",!0)]),h.createElementVNode("div",{class:"chart-container",style:h.normalizeStyle({height:e.height,width:e.width})},[h.createVNode(h.unref(Fy),{"chart-id":i.value,data:s.value,options:a},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-c461b83f"]]),TN={key:1,class:"single-value-wrapper"},MN={class:"single-value-metric"},kN={class:"name-unit-alignment"},DN={class:"single-value","data-testid":"single-value-chart"},CN={key:0,class:"single-value-unit"},AN={class:"single-value-metric-name"},ON={key:0,class:"single-value-trend"},RN={key:0,class:"single-value-trend-range","data-testid":"single-value-trend-range"},md="t1",gd="t2",EN=qe(h.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:s0},leftAlign:{type:Boolean,default:!1},showTrend:{type:Boolean,default:!1},increaseIsBad:{type:Boolean,default:!1},alignX:{type:String,default:"left"}},setup(e){const{i18n:t}=Tt.useI18n(),{formatBytes:n,formatCost:i}=ni({i18n:t}),r=e,s=h.computed(()=>`align-${r.leftAlign?"left":r.alignX}`),a=h.computed(()=>tr.buildDeltaMapping(r.data,r.showTrend,{topLevelKey:md,secondLevelKey:gd})),l=h.computed(()=>a.value?.previous?.[md]?.[gd]),u=h.computed(()=>a.value?.current?.[md]?.[gd]),d=h.computed(()=>r.data.data),f=h.computed(()=>r.data.meta?.metric_names?.[0]),m=h.computed(()=>t.te(`chartLabels.${f.value}`)?t.t(`chartLabels.${f.value}`):""),g=h.computed(()=>{const A=f.value?r.data.meta?.metric_units?.[f.value]:void 0;if(A){const L=`chartUnits.${A}`;return t.te(L)?t.t(L,{plural:""}):""}}),_=h.computed(()=>!!f.value&&(f.value.includes("_per_minute")||f.value.includes("_latency_")||f.value==="error_rate")),x=h.computed(()=>r.showTrend&&l.value!==void 0?l.value:null),v=h.computed(()=>{if(r.showTrend)return u.value??null;if(d.value.length<1||!f.value)return null;const A=d.value[0].event[f.value];return typeof A!="number"||isNaN(A)?null:A}),S=h.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=h.computed(()=>{const A=v.value;if(A===null)return"-";const L=f.value?r.data.meta?.metric_units?.[f.value]:void 0;if(L==="usd")return i(A);if(L==="bytes")return n(A);if(A>=1e9){const q=(A/1e9).toFixed(1);return q.endsWith(".0")?`${Math.floor(A/1e9)}B`:`${q}B`}if(A>=1e7){const q=(A/1e6).toFixed(1);return q.endsWith(".0")?`${Math.floor(A/1e6)}M`:`${q}M`}const $=r.decimalPoints&&typeof r.decimalPoints=="number"?r.decimalPoints:s0;return A.toLocaleString("en-US",{maximumFractionDigits:$})}),O=h.computed(()=>r.showTrend&&r.data?.data?.length<2),B=h.computed(()=>tr.calculateChange(v.value??0,x.value??0)||0),I=h.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 tr.changePolarity(B.value,!0,r.increaseIsBad)}),N=h.computed(()=>tr.defineIcon(I.value,r.increaseIsBad)),W=h.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 tr.metricChange(-1,!0,t.t("singleValue.trend.not_available"))}return tr.metricChange(B.value,r.data?.data?.length===2,t.t("singleValue.trend.not_available"))}),U=tr.useTrendRange(h.computed(()=>r.showTrend),void 0,h.computed(()=>r.data.meta)),D=A=>A>0?"positive":A<0?"negative":"neutral",w=A=>A>0?nS:A<0?eS:np;return h.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)}),(A,L)=>{const $=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["chart-parent",s.value]),"data-testid":"single-value-parent"},[S.value?(h.openBlock(),h.createBlock($,{key:0,class:"single-value-error","data-testid":"single-value-error","icon-variant":"error",title:h.unref(t).t("singleValue.valueError")},null,8,["title"])):(h.openBlock(),h.createElementBlock("div",TN,[h.createElementVNode("div",MN,[h.createElementVNode("div",kN,[h.createElementVNode("span",DN,h.toDisplayString(C.value),1),_.value&&g.value?(h.openBlock(),h.createElementBlock("span",CN," "+h.toDisplayString(g.value),1)):h.createCommentVNode("",!0)]),h.createElementVNode("div",AN,h.toDisplayString(m.value),1)]),e.showTrend?(h.openBlock(),h.createElementBlock("div",ON,[h.createElementVNode("div",{class:h.normalizeClass(["trend-change",D(I.value)]),"data-testid":"single-value-trend"},[O.value||I.value!==0?(h.openBlock(),h.createBlock(h.resolveDynamicComponent(N.value),{key:0,color:w(I.value),size:`var(--kui-icon-size-30, ${h.unref(ir)})`},null,8,["color","size"])):(h.openBlock(),h.createBlock(h.unref(fe.EqualIcon),{key:1,color:`var(--kui-color-text-neutral-strong, ${h.unref(np)})`,size:`var(--kui-icon-size-30, ${h.unref(ir)})`},null,8,["color","size"])),h.createElementVNode("div",null,h.toDisplayString(W.value),1)],2),h.unref(U)?(h.openBlock(),h.createElementBlock("div",RN,h.toDisplayString(h.unref(U)),1)):h.createCommentVNode("",!0)])):h.createCommentVNode("",!0)]))],2)}}}),[["__scopeId","data-v-640d8a8c"]]),PN={class:"simple-chart-shell"},IN={key:1,class:"analytics-chart-parent"},LN=qe(h.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:e=>/(\d *)(px|%)/.test(e)},width:{type:String,required:!1,default:"100%",validator:e=>/(\d *)(px|%)/.test(e)}},setup(e){const t=e,{i18n:n}=Tt.useI18n(),i=h.computed(()=>{const d=Tt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||Kn},h.toRef(t,"chartData")).value;return t.chartOptions?.reverseDataset&&d?.datasets.reverse(),d}),r=h.computed(()=>t.chartData.meta?.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""),s=h.computed(()=>t.chartOptions.type==="gauge"),a=h.computed(()=>t.chartOptions.type==="single_value"),l=h.computed(()=>t.emptyStateTitle||n.t("noDataAvailableTitle")),u=h.computed(()=>{const d=t.chartData&&t.chartData.meta&&t.chartData.data.length;if(a.value){const f=t.chartData.meta?.metric_names?.[0];return d&&t.chartData.data[0].event[f]!==null}return d});return(d,f)=>{const m=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",PN,[u.value?(h.openBlock(),h.createElementBlock("div",IN,[s.value?(h.openBlock(),h.createBlock(SN,{key:0,"chart-data":i.value,"dataset-colors":e.chartOptions.chartDatasetColors,"is-simple":"","metric-display":e.chartOptions.metricDisplay,"metric-unit":r.value,numerator:e.chartOptions.numerator,"synthetics-data-key":e.syntheticsDataKey,width:e.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","numerator","synthetics-data-key","width"])):h.createCommentVNode("",!0),a.value?(h.openBlock(),h.createBlock(EN,{key:1,"align-x":e.chartOptions.alignX,data:e.chartData,"decimal-points":e.chartOptions.decimalPoints,"increase-is-bad":e.chartOptions.increaseIsBad,"show-trend":e.chartOptions.showTrend},null,8,["align-x","data","decimal-points","increase-is-bad","show-trend"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(m,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(l.value),1)]),_:1}))])}}}),[["__scopeId","data-v-23ca8c84"]]),hl=(e,t)=>{if(!e||!t)return;const n=t.toLowerCase();return e[t]??Object.entries(e).find(([i])=>i.toLowerCase()===n)?.[1]},qy=e=>{if(e==null||e==="")return null;const t=typeof e=="number"?e:Number(e);return Number.isFinite(t)?t:null},NN=e=>e.reduce((t,n)=>n===null?t:{sum:t.sum+n,max:Math.max(t.max,n)},{sum:0,max:0}),BN=(e,t)=>t.sum>0?e/t.sum:null,FN=(e,t,n)=>{const i=n==="relative"?t.sum:t.max;return i<=0?0:Math.min(Math.max(e/i,0),1)},zN=(e,t)=>{const n=(t??[]).filter(s=>e>=s.value);if(!n.length)return;const i=Math.max(...n.map(s=>s.value));return n.filter(s=>s.value===i).some(s=>s.type==="error")?"error":"warning"},UN={ai_provider:{anthropic:fe.AnthropicIcon,azure:fe.AzureIcon,bedrock:fe.AmazonBedrockIcon,cerebras:fe.CerebrasIcon,cohere:fe.CohereIcon,databricks:fe.DatabricksIcon,deepseek:fe.DeepseekIcon,gemini:fe.GeminiIcon,huggingface:fe.HuggingFaceIcon,llama2:fe.MetaLlamaIcon,mistral:fe.MistralIcon,moonshot:fe.KimiIcon,nvidia:fe.NvidiaIcon,ollama:fe.OllamaIcon,openai:fe.OpenAiIcon,vertex:fe.GoogleVertexIcon,vllm:fe.VllmIcon,xai:fe.GrokIcon}},HN=(e,t)=>{if(!(!e||!t))return UN[e]?.[t.toLowerCase()]},WN=["data-threshold"],$N=qe(h.defineComponent({__name:"TopNMetricBar",props:{ratio:{},threshold:{}},setup(e){h.useCssVars(n=>({v0394367e:h.unref(t)}));const t=Kn[1];return(n,i)=>(h.openBlock(),h.createElementBlock("span",{class:h.normalizeClass(["top-n-metric-cell-bar",{[`top-n-metric-cell--bar-${e.threshold}`]:!!e.threshold}]),"data-testid":"top-n-metric-cell-bar","data-threshold":e.threshold},[h.createElementVNode("span",{class:"top-n-metric-cell-bar-fill",style:h.normalizeStyle({width:`${e.ratio*100}%`})},null,4)],10,WN))}}),[["__scopeId","data-v-24eb60ef"]]),VN=["data-threshold"],YN={class:"top-n-metric-cell-value"},qN={key:0,class:"top-n-metric-cell-relative","data-testid":"top-n-metric-cell-relative"},jN=qe(h.defineComponent({__name:"TopNMetricCell",props:{display:{},relative:{},threshold:{},hasBar:{type:Boolean}},setup(e){return(t,n)=>(h.openBlock(),h.createElementBlock("span",{class:h.normalizeClass(["top-n-metric-cell",{"top-n-metric-cell--bar":e.hasBar,[`top-n-metric-cell--text-${e.threshold}`]:!e.hasBar&&!!e.threshold}]),"data-threshold":e.threshold},[h.createElementVNode("span",YN,h.toDisplayString(e.display),1),e.relative?(h.openBlock(),h.createElementBlock("span",qN,"("+h.toDisplayString(e.relative)+")",1)):h.createCommentVNode("",!0)],10,VN))}}),[["__scopeId","data-v-17e7f860"]]),GN={class:"top-n-card-title","data-testid":"top-n-card-title"},KN={class:"top-n-card-description","data-testid":"top-n-card-description"},XN={key:3,class:"top-n-table","data-testid":"top-n-table"},ZN={"data-testid":"top-n-table-header"},QN={class:"top-n-table-header-row"},JN=["colspan"],tB={class:"table-header-label"},eB=["data-testid"],nB={class:"top-n-table-cell-label"},iB={key:0,class:"top-n-table-cell top-n-table-cell-bar"},rB=3,sB=qe(h.defineComponent({__name:"TopNTable",props:{title:{default:""},description:{default:""},data:{},emptyStateTitle:{default:""},isLoading:{type:Boolean,default:!1},titleTag:{default:"h2"},columnOptions:{default:void 0}},setup(e){const t=e,{i18n:n}=Tt.useI18n(),{formatUnit:i}=ni({i18n:n}),r=h.computed(()=>t.data.data),s=h.computed(()=>!!r.value?.length),a=h.computed(()=>t.data.meta?.display?Object.keys(t.data.meta.display).slice(0,rB):[]),l=h.computed(()=>a.value[0]||""),u=h.computed(()=>a.value.length>1),d=h.computed(()=>a.value[a.value.length-1]||""),f=h.computed(()=>l.value?t.data.meta.display[l.value]:{}),m=h.computed(()=>t.data.meta?.metric_names?.length?t.data.meta.metric_names:[]),g=h.computed(()=>m.value[0]),_=h.computed(()=>g.value?dt(g.value):""),x=h.computed(()=>{const P=a.value.map(H=>({key:H,columnKey:H,label:ut(H,u.value?dt(H):n.t("topNTable.nameLabel")),type:"dimension"}));return g.value&&P.push({key:"value",columnKey:g.value,label:ut(g.value,_.value),type:"metric"}),m.value.forEach((H,nt)=>{nt!==0&&P.push({key:H,columnKey:H,label:ut(H,dt(H)),type:"metric"})}),P}),v=h.computed(()=>x.value.filter(P=>P.type==="metric")),S=h.computed(()=>x.value.filter(P=>P.type==="dimension").slice(1)),C=P=>P.type==="dimension"&&P.key===d.value,O=P=>P.type==="metric"&&!!hl(t.columnOptions,P.columnKey)?.bar,B=P=>u.value&&P.type==="dimension"&&!C(P),I=P=>{const H=P.event;return String(H[l.value])},N=(P,H)=>{const nt=String(P.event[H]),ot=t.data.meta?.display?.[H]?.[nt];return{dimension:H,id:nt,name:ot?.name||"-",deleted:!!ot?.deleted}},W=P=>{const H=I(P),nt=f.value&&f.value[H];return nt?nt.name:"-"},U=P=>{const H=I(P),nt=f.value&&f.value[H];return nt?!!nt.deleted:!1},D=P=>{const H=nt=>i(nt,"%",{translateUnit:ot=>V(ot,nt)});return P>0&&P<.01?`< ${H(.01)}`:H(P)},w=(P,H)=>{const nt=P.event[H];if(nt==null)return"–";const ot=typeof nt=="number"?nt:Number(nt);if(Number.isNaN(ot))return"–";const X=t.data.meta?.metric_units?.[H]||"count";if(X==="%")return D(ot);const tt=["count","count/minute","token count"].includes(X);return i(ot,X,{approximate:tt,isBytes1024:!0,translateUnit:rt=>V(rt,ot)})},A=h.computed(()=>Object.fromEntries(m.value.map(P=>[P,NN(r.value.map(H=>qy(H.event[P])))]))),L=(P,H)=>{const nt=hl(t.columnOptions,H),ot=qy(P.event[H]);if(!nt||ot===null)return{display:w(P,H)};const X=A.value[H],tt=nt.value==="relative"?BN(ot,X):null;return{display:w(P,H),relative:tt===null?void 0:D(tt*100),barRatio:nt.bar?FN(ot,X,nt.bar):void 0,threshold:zN(ot,nt.thresholds)}},$=h.computed(()=>r.value?.length?r.value.map(P=>{const H=a.value.map(tt=>N(P,tt)),nt=H[0],ot=nt?.id||I(P),X={id:ot,rowKey:H.map(tt=>`${tt.dimension}:${tt.id}`).join("|")||ot,name:nt?.name||W(P),deleted:U(P),dimensions:H,metrics:{},original:P};return m.value.forEach((tt,rt)=>{X.metrics[rt===0?"value":tt]=L(P,tt)}),X}):[]),q=h.computed(()=>{if(!s.value)return"";if(t.data.meta){if(a.value.some(P=>!Object.keys(t.data.meta.display[P]||{}).length))return n.t("topNTable.errors.display");if(!g.value)return n.t("topNTable.errors.metricNames")}else return n.t("topNTable.errors.meta");return""}),st=(P,H)=>P.metrics[H]??{display:"–"},ct=(P,H)=>P.dimensions.find(nt=>nt.dimension===H)?.id||"",ht=(P,H)=>HN(hl(t.columnOptions,P)?.icon_set,H),ut=(P,H)=>P&&hl(t.columnOptions,P)?.label||H,vt=(P,H)=>P.dimensions.find(nt=>nt.dimension===H)?.name||"–",at=(P,H)=>{const nt=P.dimensions.find(ot=>ot.dimension===H);return{id:nt?.id||"",name:nt?.name||"–",deleted:nt?.deleted||!1,dimension:H,dimensions:P.dimensions,isEmpty:nt?.id==="empty"}},dt=P=>n.te(`chartLabels.${P}`)?n.t(`chartLabels.${P}`):P,V=(P,H)=>{if(el(P)||P==="count"||P==="requests")return"";const nt=H===1?"":"s";return n.te(`chartUnits.${P}`)?n.t(`chartUnits.${P}`,{plural:nt}):P};return(P,H)=>{const nt=h.resolveComponent("KEmptyState"),ot=h.resolveComponent("KSkeleton"),X=h.resolveComponent("KCard");return h.openBlock(),h.createBlock(X,{class:"kong-ui-public-top-n-table","title-tag":e.titleTag},h.createSlots({default:h.withCtx(()=>[q.value?(h.openBlock(),h.createBlock(nt,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(n).t("topNTable.defaultErrorStateTitle")),1)]),default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(q.value),1)]),_:1})):e.isLoading?(h.openBlock(),h.createBlock(ot,{key:1,"table-columns":2,type:"table"})):s.value?(h.openBlock(),h.createElementBlock("div",XN,[h.createElementVNode("table",{class:h.normalizeClass(["top-n-table-table",{"top-n-table-table--multi-dimension":u.value}])},[h.createElementVNode("thead",ZN,[h.createElementVNode("tr",QN,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(x.value,tt=>(h.openBlock(),h.createElementBlock("th",{key:tt.key,class:h.normalizeClass(["top-n-table-header-cell",{"top-n-table-header-cell-metric":tt.type==="metric","top-n-table-header-cell-dimension-compact":B(tt)}]),colspan:O(tt)?2:void 0,"data-testid":"top-n-table-header-column"},[h.createElementVNode("span",tB,h.toDisplayString(tt.label),1),H[0]||(H[0]=h.createElementVNode("div",{class:"top-n-table-header-cell-border"},null,-1))],10,JN))),128))])]),h.createElementVNode("tbody",null,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList($.value,tt=>(h.openBlock(),h.createElementBlock("tr",{key:tt.rowKey,class:"top-n-table-row"},[a.value.length?(h.openBlock(),h.createElementBlock("td",{key:0,class:h.normalizeClass(["top-n-table-cell top-n-table-cell--name",{"top-n-table-cell-dimension-compact":u.value}])},[h.createElementVNode("span",{class:"top-n-table-cell-label","data-testid":`row-${tt.id}`},[ht(l.value,tt.id)?(h.openBlock(),h.createBlock(h.resolveDynamicComponent(ht(l.value,tt.id)),{key:0,class:"top-n-table-cell-icon","data-testid":"top-n-table-cell-icon",decorative:"",size:`var(--kui-icon-size-30, ${h.unref(ir)})`},null,8,["size"])):h.createCommentVNode("",!0),h.renderSlot(P.$slots,"name",{record:{id:tt.id,name:tt.name,deleted:tt.deleted,dimension:l.value,dimensions:tt.dimensions,isEmpty:tt.id==="empty"}},()=>[h.createTextVNode(h.toDisplayString(tt.name),1)],!0)],8,eB)],2)):h.createCommentVNode("",!0),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(S.value,rt=>(h.openBlock(),h.createElementBlock("td",{key:rt.key,class:h.normalizeClass(["top-n-table-cell top-n-table-cell--dimension",{"top-n-table-cell-dimension-compact":!C(rt)}])},[h.createElementVNode("span",nB,[ht(rt.key,ct(tt,rt.key))?(h.openBlock(),h.createBlock(h.resolveDynamicComponent(ht(rt.key,ct(tt,rt.key))),{key:0,class:"top-n-table-cell-icon","data-testid":"top-n-table-cell-icon",decorative:"",size:`var(--kui-icon-size-30, ${h.unref(ir)})`},null,8,["size"])):h.createCommentVNode("",!0),h.renderSlot(P.$slots,"name",{record:at(tt,rt.key)},()=>[h.createTextVNode(h.toDisplayString(vt(tt,rt.key)),1)],!0)])],2))),128)),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(v.value,rt=>(h.openBlock(),h.createElementBlock(h.Fragment,{key:rt.key},[h.createElementVNode("td",{class:h.normalizeClass(["top-n-table-cell top-n-table-cell-metric",{"top-n-table-cell-metric--has-bar":O(rt)}])},[h.createVNode(jN,{"data-testid":rt.key==="value"?`row-${tt.id}`:`row-${tt.id}-${rt.key}`,display:st(tt,rt.key).display,"has-bar":O(rt),relative:st(tt,rt.key).relative,threshold:st(tt,rt.key).threshold},null,8,["data-testid","display","has-bar","relative","threshold"])],2),O(rt)?(h.openBlock(),h.createElementBlock("td",iB,[h.createVNode($N,{ratio:st(tt,rt.key).barRatio??0,threshold:st(tt,rt.key).threshold},null,8,["ratio","threshold"])])):h.createCommentVNode("",!0)],64))),128))]))),128))])],2)])):(h.openBlock(),h.createBlock(nt,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(e.emptyStateTitle||h.unref(n).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[e.title?{name:"title",fn:h.withCtx(()=>[h.createElementVNode("span",GN,h.toDisplayString(e.title),1)]),key:"0"}:void 0,e.description?{name:"actions",fn:h.withCtx(()=>[h.createElementVNode("div",KN,h.toDisplayString(e.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-9111e441"]]),oB={class:"container"},aB={key:0,class:"no-data","data-testid":"sparkline-empty"},lB=["title"],cB=qe(h.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(e){const t=crypto.randomUUID(),{i18n:n}=Tt.useI18n(),{syncedGroupSizeMs:i,syncedMinStamp:r,syncedMaxStamp:s,syncedMinCount:a,syncedMaxCount:l,syncedRenderPoints:u,syncedChartDatasets:d}=Tt.useSparklineSync({chartKey:e.chartKey,datasets:e.datasets,groupKey:e.groupKey,minStamp:e.minStamp,maxStamp:e.maxStamp,minCount:e.minCount,maxCount:e.maxCount,renderPoints:e.pointRenderCount,type:e.type}),f=h.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:"",tooltipSeries:[],left:"",top:"",units:"count",translateUnit:()=>"",offsetX:0,offsetY:0,width:0,height:0,chartType:e.type==="sparkline_bar"?"timeseries_bar":"timeseries_line",chartID:t,interactionMode:"idle"}),m=({width:U,height:D})=>{f.width=U,f.height=D},g=h.computed(()=>e.disableTooltip?[]:[new Uy({enableBrushing:e.groupKey!==void 0&&e.chartKey!==void 0&&e.enableBrushing,brushStrategy:"group",brushGroup:e.groupKey})]),_=h.computed(()=>d.value.reduce((U,{data:D,label:w})=>({...U,[w]:D.reduce((A,{y:L})=>A+L,0)}),{})),x=h.computed(()=>d.value.map(({label:U})=>[_.value[U],`${U}: ${_.value[U]}`]).sort(([U],[D])=>D-U).map(([,U])=>U).join(", ")),v=h.computed(()=>Object.keys(_.value).map(U=>_.value[U]).reduce((U,D)=>U+D,0)),S=h.computed(()=>v.value>0),C=h.computed(()=>({labels:new Array(u.value).fill(""),datasets:d.value})),O=h.computed(()=>e.datasets.length>1),B=`SparklineTooltipPosition-${t}`,I=h.computed(()=>{const U=e.type==="sparkline_bar",D=U?r.value-1:r.value,w=U?s.value:s.value-i.value;return{maintainAspectRatio:!1,elements:{categoryPercentage:1,barPercentage:1,line:{tension:0,stepped:e.type==="sparkline_step",borderWidth:1},point:{radius:0,pointHitRadius:11,pointHoverRadius:0}},interaction:{intersect:!1,mode:"index"},layout:{padding:{left:U?0:2,right:U?0:2,top:2}},plugins:{legend:{display:!1},tooltip:{enabled:!1,position:B,external:A=>{Ou(f,A,"minutely",{contextFormatter:L=>{const $=L+i.value;let q="";return i.value>1440*60*1e3?q=fa(new Date($),"MMM dd, yyy hh:mm a"):q=fa(new Date($),"hh:mm a"),`${lv(L)} - ${q}`}})}}},scales:{x:{min:D,max:w,type:"timeseries",offset:!1,grid:{display:!1},display:!1,stacked:O.value},y:{min:Math.max(a.value-1,0),max:l.value,grid:{display:!1},display:!1,stacked:O.value}}}}),N=h.ref("0"),W=h.ref("0");return h.onMounted(()=>{Ye.positioners[B]=function(U,D){if(!U.length||f.interactionMode==="interactive"||D.x===null)return!1;const w=10,A=this.chart.canvas.getBoundingClientRect(),L=f.width||this.width,$=f.height||this.height,q=A.top-$>0,st=q?A.top-$-w:A.top+A.height+w,ct=A.left>L/2-D.x,ht=Math.max(w,window.innerWidth-w-L),ut=Math.min(ht,ct?Math.floor(A.left-L/2)+D.x:0+w);return N.value=`${st}px`,W.value=`${ut}px`,{x:ut,y:st,xAlign:"center",yAlign:q?"top":"bottom"}}}),h.onUnmounted(()=>{Ye.positioners[B]&&delete Ye.positioners[B]}),(U,D)=>(h.openBlock(),h.createElementBlock("div",oB,[S.value?e.type==="sparkline_bar"?(h.openBlock(),h.createBlock(h.unref(By),{key:1,"chart-id":h.unref(t),data:C.value,"data-testid":"sparkline-bar",options:I.value,plugins:g.value},null,8,["chart-id","data","options","plugins"])):e.type==="sparkline_line"||e.type==="sparkline_step"?(h.openBlock(),h.createBlock(h.unref(zy),{key:2,"chart-id":h.unref(t),data:C.value,"data-testid":e.type==="sparkline_line"?"sparkline-line":"sparkline-step",options:I.value,plugins:g.value},null,8,["chart-id","data","data-testid","options","plugins"])):h.createCommentVNode("",!0):(h.openBlock(),h.createElementBlock("div",aB,[h.renderSlot(U.$slots,"empty",{},()=>[h.createTextVNode(h.toDisplayString(h.unref(n).t("sparkline_no_data")),1)],!0)])),e.disableTooltip?h.createCommentVNode("",!0):(h.openBlock(),h.createBlock(wo,{key:3,"absolute-left":W.value,"absolute-top":N.value,class:"tooltip","data-testid":"sparkline-tooltip",state:f,"tooltip-title":e.tooltipTitle,onDimensions:m},null,8,["absolute-left","absolute-top","state","tooltip-title"])),S.value&&e.showLabel?(h.openBlock(),h.createElementBlock("div",{key:4,class:"label",title:U.$slots.label?"":x.value},[h.renderSlot(U.$slots,"label",{total:v.value,totalByDataset:_.value},()=>[h.createTextVNode(h.toDisplayString(x.value),1)],!0)],8,lB)):h.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-ae8259b6"]]);var Ui=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},vo={exports:{}};var uB=vo.exports,jy;function dB(){return jy||(jy=1,(function(e,t){(function(){var n,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__",f=500,m="__lodash_placeholder__",g=1,_=2,x=4,v=1,S=2,C=1,O=2,B=4,I=8,N=16,W=32,U=64,D=128,w=256,A=512,L=30,$="...",q=800,st=16,ct=1,ht=2,ut=3,vt=1/0,at=9007199254740991,dt=17976931348623157e292,V=NaN,P=4294967295,H=P-1,nt=P>>>1,ot=[["ary",D],["bind",C],["bindKey",O],["curry",I],["curryRight",N],["flip",A],["partial",W],["partialRight",U],["rearg",w]],X="[object Arguments]",tt="[object Array]",rt="[object AsyncFunction]",pt="[object Boolean]",yt="[object Date]",mt="[object DOMException]",Rt="[object Error]",Ft="[object Function]",G="[object GeneratorFunction]",it="[object Map]",lt="[object Number]",Wt="[object Null]",_t="[object Object]",Vt="[object Promise]",Te="[object Proxy]",Me="[object RegExp]",ae="[object Set]",cn="[object String]",qt="[object Symbol]",Ne="[object Undefined]",re="[object WeakMap]",ke="[object WeakSet]",Ee="[object ArrayBuffer]",gn="[object DataView]",Hi="[object Float32Array]",Cn="[object Float64Array]",je="[object Int8Array]",Ln="[object Int16Array]",di="[object Int32Array]",So="[object Uint8Array]",To="[object Uint8ClampedArray]",vr="[object Uint16Array]",fi="[object Uint32Array]",Mo=/\b__p \+= '';/g,ko=/\b(__p \+=) '' \+/g,Do=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Wi=/&(?:amp|lt|gt|quot|#39);/g,gl=/[&<>"']/g,yd=RegExp(Wi.source),_d=RegExp(gl.source),bd=/<%-([\s\S]+?)%>/g,xd=/<%([\s\S]+?)%>/g,Co=/<%=([\s\S]+?)%>/g,yl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,hi=/^\w*$/,wd=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ao=/[\\^$.*+?()[\]{}|]/g,vd=RegExp(Ao.source),Oo=/^\s+/,Sd=/\s/,Nn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Td=/\{\n\/\* \[wrapped with (.+)\] \*/,Md=/,? & /,kd=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,_l=/[()=,{}\[\]\/\s]/,Dd=/\\(\\)?/g,$i=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,bl=/\w*$/,Cd=/^[-+]0x[0-9a-f]+$/i,Ad=/^0b[01]+$/i,Od=/^\[object .+?Constructor\]$/,Rd=/^0o[0-7]+$/i,Vi=/^(?:0|[1-9]\d*)$/,Ed=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ss=/($^)/,Pd=/['\n\r\u2028\u2029\\]/g,os="\\ud800-\\udfff",Id="\\u0300-\\u036f",Ld="\\ufe20-\\ufe2f",xl="\\u20d0-\\u20ff",Sr=Id+Ld+xl,wl="\\u2700-\\u27bf",as="a-z\\xdf-\\xf6\\xf8-\\xff",Nd="\\xac\\xb1\\xd7\\xf7",Bd="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Fd="\\u2000-\\u206f",zd=" \\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",vl="A-Z\\xc0-\\xd6\\xd8-\\xde",Sl="\\ufe0e\\ufe0f",ls=Nd+Bd+Fd+zd,Ro="['’]",Ud="["+os+"]",Tl="["+ls+"]",cs="["+Sr+"]",Ml="\\d+",Hd="["+wl+"]",kl="["+as+"]",Eo="[^"+os+ls+Ml+wl+as+vl+"]",Po="\\ud83c[\\udffb-\\udfff]",Wd="(?:"+cs+"|"+Po+")",Tr="[^"+os+"]",Xn="(?:\\ud83c[\\udde6-\\uddff]){2}",us="[\\ud800-\\udbff][\\udc00-\\udfff]",un="["+vl+"]",Dl="\\u200d",Cl="(?:"+kl+"|"+Eo+")",$d="(?:"+un+"|"+Eo+")",Al="(?:"+Ro+"(?:d|ll|m|re|s|t|ve))?",Ol="(?:"+Ro+"(?:D|LL|M|RE|S|T|VE))?",Rl=Wd+"?",Io="["+Sl+"]?",pi="(?:"+Dl+"(?:"+[Tr,Xn,us].join("|")+")"+Io+Rl+")*",Vd="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",El="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Pl=Io+Rl+pi,Lo="(?:"+[Hd,Xn,us].join("|")+")"+Pl,Il="(?:"+[Tr+cs+"?",cs,Xn,us,Ud].join("|")+")",Yd=RegExp(Ro,"g"),qd=RegExp(cs,"g"),ds=RegExp(Po+"(?="+Po+")|"+Il+Pl,"g"),jd=RegExp([un+"?"+kl+"+"+Al+"(?="+[Tl,un,"$"].join("|")+")",$d+"+"+Ol+"(?="+[Tl,un+Cl,"$"].join("|")+")",un+"?"+Cl+"+"+Al,un+"+"+Ol,El,Vd,Ml,Lo].join("|"),"g"),fs=RegExp("["+Dl+os+Sr+Sl+"]"),Gd=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,No=["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"],Kd=-1,ne={};ne[Hi]=ne[Cn]=ne[je]=ne[Ln]=ne[di]=ne[So]=ne[To]=ne[vr]=ne[fi]=!0,ne[X]=ne[tt]=ne[Ee]=ne[pt]=ne[gn]=ne[yt]=ne[Rt]=ne[Ft]=ne[it]=ne[lt]=ne[_t]=ne[Me]=ne[ae]=ne[cn]=ne[re]=!1;var k={};k[X]=k[tt]=k[Ee]=k[gn]=k[pt]=k[yt]=k[Hi]=k[Cn]=k[je]=k[Ln]=k[di]=k[it]=k[lt]=k[_t]=k[Me]=k[ae]=k[cn]=k[qt]=k[So]=k[To]=k[vr]=k[fi]=!0,k[Rt]=k[Ft]=k[re]=!1;var Y={À:"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"},J={"&":"&","<":"<",">":">",'"':""","'":"'"},xt={"&":"&","<":"<",">":">",""":'"',"'":"'"},De={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ge=parseFloat,Bn=parseInt,Be=typeof Ui=="object"&&Ui&&Ui.Object===Object&&Ui,Ll=typeof self=="object"&&self&&self.Object===Object&&self,ue=Be||Ll||Function("return this")(),hs=t&&!t.nodeType&&t,Zn=hs&&!0&&e&&!e.nodeType&&e,Bo=Zn&&Zn.exports===hs,Mr=Bo&&Be.process,Fe=(function(){try{var F=Zn&&Zn.require&&Zn.require("util").types;return F||Mr&&Mr.binding&&Mr.binding("util")}catch{}})(),Qy=Fe&&Fe.isArrayBuffer,Jy=Fe&&Fe.isDate,t_=Fe&&Fe.isMap,e_=Fe&&Fe.isRegExp,n_=Fe&&Fe.isSet,i_=Fe&&Fe.isTypedArray;function yn(F,K,j){switch(j.length){case 0:return F.call(K);case 1:return F.call(K,j[0]);case 2:return F.call(K,j[0],j[1]);case 3:return F.call(K,j[0],j[1],j[2])}return F.apply(K,j)}function MB(F,K,j,gt){for(var At=-1,jt=F==null?0:F.length;++At<jt;){var Ce=F[At];K(gt,Ce,j(Ce),F)}return gt}function _n(F,K){for(var j=-1,gt=F==null?0:F.length;++j<gt&&K(F[j],j,F)!==!1;);return F}function kB(F,K){for(var j=F==null?0:F.length;j--&&K(F[j],j,F)!==!1;);return F}function r_(F,K){for(var j=-1,gt=F==null?0:F.length;++j<gt;)if(!K(F[j],j,F))return!1;return!0}function Yi(F,K){for(var j=-1,gt=F==null?0:F.length,At=0,jt=[];++j<gt;){var Ce=F[j];K(Ce,j,F)&&(jt[At++]=Ce)}return jt}function Nl(F,K){var j=F==null?0:F.length;return!!j&&ps(F,K,0)>-1}function Xd(F,K,j){for(var gt=-1,At=F==null?0:F.length;++gt<At;)if(j(K,F[gt]))return!0;return!1}function de(F,K){for(var j=-1,gt=F==null?0:F.length,At=Array(gt);++j<gt;)At[j]=K(F[j],j,F);return At}function qi(F,K){for(var j=-1,gt=K.length,At=F.length;++j<gt;)F[At+j]=K[j];return F}function Zd(F,K,j,gt){var At=-1,jt=F==null?0:F.length;for(gt&&jt&&(j=F[++At]);++At<jt;)j=K(j,F[At],At,F);return j}function DB(F,K,j,gt){var At=F==null?0:F.length;for(gt&&At&&(j=F[--At]);At--;)j=K(j,F[At],At,F);return j}function Qd(F,K){for(var j=-1,gt=F==null?0:F.length;++j<gt;)if(K(F[j],j,F))return!0;return!1}var CB=Jd("length");function AB(F){return F.split("")}function OB(F){return F.match(kd)||[]}function s_(F,K,j){var gt;return j(F,function(At,jt,Ce){if(K(At,jt,Ce))return gt=jt,!1}),gt}function Bl(F,K,j,gt){for(var At=F.length,jt=j+(gt?1:-1);gt?jt--:++jt<At;)if(K(F[jt],jt,F))return jt;return-1}function ps(F,K,j){return K===K?WB(F,K,j):Bl(F,o_,j)}function RB(F,K,j,gt){for(var At=j-1,jt=F.length;++At<jt;)if(gt(F[At],K))return At;return-1}function o_(F){return F!==F}function a_(F,K){var j=F==null?0:F.length;return j?ef(F,K)/j:V}function Jd(F){return function(K){return K==null?n:K[F]}}function tf(F){return function(K){return F==null?n:F[K]}}function l_(F,K,j,gt,At){return At(F,function(jt,Ce,ie){j=gt?(gt=!1,jt):K(j,jt,Ce,ie)}),j}function EB(F,K){var j=F.length;for(F.sort(K);j--;)F[j]=F[j].value;return F}function ef(F,K){for(var j,gt=-1,At=F.length;++gt<At;){var jt=K(F[gt]);jt!==n&&(j=j===n?jt:j+jt)}return j}function nf(F,K){for(var j=-1,gt=Array(F);++j<F;)gt[j]=K(j);return gt}function PB(F,K){return de(K,function(j){return[j,F[j]]})}function c_(F){return F&&F.slice(0,h_(F)+1).replace(Oo,"")}function bn(F){return function(K){return F(K)}}function rf(F,K){return de(K,function(j){return F[j]})}function Fo(F,K){return F.has(K)}function u_(F,K){for(var j=-1,gt=F.length;++j<gt&&ps(K,F[j],0)>-1;);return j}function d_(F,K){for(var j=F.length;j--&&ps(K,F[j],0)>-1;);return j}function IB(F,K){for(var j=F.length,gt=0;j--;)F[j]===K&&++gt;return gt}var LB=tf(Y),NB=tf(J);function BB(F){return"\\"+De[F]}function FB(F,K){return F==null?n:F[K]}function ms(F){return fs.test(F)}function zB(F){return Gd.test(F)}function UB(F){for(var K,j=[];!(K=F.next()).done;)j.push(K.value);return j}function sf(F){var K=-1,j=Array(F.size);return F.forEach(function(gt,At){j[++K]=[At,gt]}),j}function f_(F,K){return function(j){return F(K(j))}}function ji(F,K){for(var j=-1,gt=F.length,At=0,jt=[];++j<gt;){var Ce=F[j];(Ce===K||Ce===m)&&(F[j]=m,jt[At++]=j)}return jt}function Fl(F){var K=-1,j=Array(F.size);return F.forEach(function(gt){j[++K]=gt}),j}function HB(F){var K=-1,j=Array(F.size);return F.forEach(function(gt){j[++K]=[gt,gt]}),j}function WB(F,K,j){for(var gt=j-1,At=F.length;++gt<At;)if(F[gt]===K)return gt;return-1}function $B(F,K,j){for(var gt=j+1;gt--;)if(F[gt]===K)return gt;return gt}function gs(F){return ms(F)?YB(F):CB(F)}function Fn(F){return ms(F)?qB(F):AB(F)}function h_(F){for(var K=F.length;K--&&Sd.test(F.charAt(K)););return K}var VB=tf(xt);function YB(F){for(var K=ds.lastIndex=0;ds.test(F);)++K;return K}function qB(F){return F.match(ds)||[]}function jB(F){return F.match(jd)||[]}var GB=(function F(K){K=K==null?ue:ys.defaults(ue.Object(),K,ys.pick(ue,No));var j=K.Array,gt=K.Date,At=K.Error,jt=K.Function,Ce=K.Math,ie=K.Object,of=K.RegExp,KB=K.String,An=K.TypeError,zl=j.prototype,XB=jt.prototype,_s=ie.prototype,Ul=K["__core-js_shared__"],Hl=XB.toString,Kt=_s.hasOwnProperty,ZB=0,p_=(function(){var o=/[^.]+$/.exec(Ul&&Ul.keys&&Ul.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),Wl=_s.toString,QB=Hl.call(ie),JB=ue._,tF=of("^"+Hl.call(Kt).replace(Ao,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$l=Bo?K.Buffer:n,Gi=K.Symbol,Vl=K.Uint8Array,m_=$l?$l.allocUnsafe:n,Yl=f_(ie.getPrototypeOf,ie),g_=ie.create,y_=_s.propertyIsEnumerable,ql=zl.splice,__=Gi?Gi.isConcatSpreadable:n,zo=Gi?Gi.iterator:n,kr=Gi?Gi.toStringTag:n,jl=(function(){try{var o=Rr(ie,"defineProperty");return o({},"",{}),o}catch{}})(),eF=K.clearTimeout!==ue.clearTimeout&&K.clearTimeout,nF=gt&>.now!==ue.Date.now&>.now,iF=K.setTimeout!==ue.setTimeout&&K.setTimeout,Gl=Ce.ceil,Kl=Ce.floor,af=ie.getOwnPropertySymbols,rF=$l?$l.isBuffer:n,b_=K.isFinite,sF=zl.join,oF=f_(ie.keys,ie),Ae=Ce.max,Ke=Ce.min,aF=gt.now,lF=K.parseInt,x_=Ce.random,cF=zl.reverse,lf=Rr(K,"DataView"),Uo=Rr(K,"Map"),cf=Rr(K,"Promise"),bs=Rr(K,"Set"),Ho=Rr(K,"WeakMap"),Wo=Rr(ie,"create"),Xl=Ho&&new Ho,xs={},uF=Er(lf),dF=Er(Uo),fF=Er(cf),hF=Er(bs),pF=Er(Ho),Zl=Gi?Gi.prototype:n,$o=Zl?Zl.valueOf:n,w_=Zl?Zl.toString:n;function T(o){if(ye(o)&&!Pt(o)&&!(o instanceof Ut)){if(o instanceof On)return o;if(Kt.call(o,"__wrapped__"))return vb(o)}return new On(o)}var ws=(function(){function o(){}return function(c){if(!pe(c))return{};if(g_)return g_(c);o.prototype=c;var p=new o;return o.prototype=n,p}})();function Ql(){}function On(o,c){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=n}T.templateSettings={escape:bd,evaluate:xd,interpolate:Co,variable:"",imports:{_:T}},T.prototype=Ql.prototype,T.prototype.constructor=T,On.prototype=ws(Ql.prototype),On.prototype.constructor=On;function Ut(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=P,this.__views__=[]}function mF(){var o=new Ut(this.__wrapped__);return o.__actions__=dn(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=dn(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=dn(this.__views__),o}function gF(){if(this.__filtered__){var o=new Ut(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function yF(){var o=this.__wrapped__.value(),c=this.__dir__,p=Pt(o),y=c<0,b=p?o.length:0,M=Az(0,b,this.__views__),R=M.start,E=M.end,z=E-R,Z=y?E:R-1,Q=this.__iteratees__,et=Q.length,ft=0,wt=Ke(z,this.__takeCount__);if(!p||!y&&b==z&&wt==z)return Y_(o,this.__actions__);var Dt=[];t:for(;z--&&ft<wt;){Z+=c;for(var Nt=-1,Mt=o[Z];++Nt<et;){var zt=Q[Nt],Ht=zt.iteratee,vn=zt.type,nn=Ht(Mt);if(vn==ht)Mt=nn;else if(!nn){if(vn==ct)continue t;break t}}Dt[ft++]=Mt}return Dt}Ut.prototype=ws(Ql.prototype),Ut.prototype.constructor=Ut;function Dr(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var y=o[c];this.set(y[0],y[1])}}function _F(){this.__data__=Wo?Wo(null):{},this.size=0}function bF(o){var c=this.has(o)&&delete this.__data__[o];return this.size-=c?1:0,c}function xF(o){var c=this.__data__;if(Wo){var p=c[o];return p===d?n:p}return Kt.call(c,o)?c[o]:n}function wF(o){var c=this.__data__;return Wo?c[o]!==n:Kt.call(c,o)}function vF(o,c){var p=this.__data__;return this.size+=this.has(o)?0:1,p[o]=Wo&&c===n?d:c,this}Dr.prototype.clear=_F,Dr.prototype.delete=bF,Dr.prototype.get=xF,Dr.prototype.has=wF,Dr.prototype.set=vF;function mi(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var y=o[c];this.set(y[0],y[1])}}function SF(){this.__data__=[],this.size=0}function TF(o){var c=this.__data__,p=Jl(c,o);if(p<0)return!1;var y=c.length-1;return p==y?c.pop():ql.call(c,p,1),--this.size,!0}function MF(o){var c=this.__data__,p=Jl(c,o);return p<0?n:c[p][1]}function kF(o){return Jl(this.__data__,o)>-1}function DF(o,c){var p=this.__data__,y=Jl(p,o);return y<0?(++this.size,p.push([o,c])):p[y][1]=c,this}mi.prototype.clear=SF,mi.prototype.delete=TF,mi.prototype.get=MF,mi.prototype.has=kF,mi.prototype.set=DF;function gi(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var y=o[c];this.set(y[0],y[1])}}function CF(){this.size=0,this.__data__={hash:new Dr,map:new(Uo||mi),string:new Dr}}function AF(o){var c=dc(this,o).delete(o);return this.size-=c?1:0,c}function OF(o){return dc(this,o).get(o)}function RF(o){return dc(this,o).has(o)}function EF(o,c){var p=dc(this,o),y=p.size;return p.set(o,c),this.size+=p.size==y?0:1,this}gi.prototype.clear=CF,gi.prototype.delete=AF,gi.prototype.get=OF,gi.prototype.has=RF,gi.prototype.set=EF;function Cr(o){var c=-1,p=o==null?0:o.length;for(this.__data__=new gi;++c<p;)this.add(o[c])}function PF(o){return this.__data__.set(o,d),this}function IF(o){return this.__data__.has(o)}Cr.prototype.add=Cr.prototype.push=PF,Cr.prototype.has=IF;function zn(o){var c=this.__data__=new mi(o);this.size=c.size}function LF(){this.__data__=new mi,this.size=0}function NF(o){var c=this.__data__,p=c.delete(o);return this.size=c.size,p}function BF(o){return this.__data__.get(o)}function FF(o){return this.__data__.has(o)}function zF(o,c){var p=this.__data__;if(p instanceof mi){var y=p.__data__;if(!Uo||y.length<r-1)return y.push([o,c]),this.size=++p.size,this;p=this.__data__=new gi(y)}return p.set(o,c),this.size=p.size,this}zn.prototype.clear=LF,zn.prototype.delete=NF,zn.prototype.get=BF,zn.prototype.has=FF,zn.prototype.set=zF;function v_(o,c){var p=Pt(o),y=!p&&Pr(o),b=!p&&!y&&Ji(o),M=!p&&!y&&!b&&Ms(o),R=p||y||b||M,E=R?nf(o.length,KB):[],z=E.length;for(var Z in o)(c||Kt.call(o,Z))&&!(R&&(Z=="length"||b&&(Z=="offset"||Z=="parent")||M&&(Z=="buffer"||Z=="byteLength"||Z=="byteOffset")||bi(Z,z)))&&E.push(Z);return E}function S_(o){var c=o.length;return c?o[xf(0,c-1)]:n}function UF(o,c){return fc(dn(o),Ar(c,0,o.length))}function HF(o){return fc(dn(o))}function uf(o,c,p){(p!==n&&!Hn(o[c],p)||p===n&&!(c in o))&&Qn(o,c,p)}function Vo(o,c,p){var y=o[c];(!(Kt.call(o,c)&&Hn(y,p))||p===n&&!(c in o))&&Qn(o,c,p)}function Jl(o,c){for(var p=o.length;p--;)if(Hn(o[p][0],c))return p;return-1}function WF(o,c,p,y){return Ki(o,function(b,M,R){c(y,b,p(b),R)}),y}function T_(o,c){return o&&ti(c,Pe(c),o)}function $F(o,c){return o&&ti(c,hn(c),o)}function Qn(o,c,p){c=="__proto__"&&jl?jl(o,c,{configurable:!0,enumerable:!0,value:p,writable:!0}):o[c]=p}function df(o,c){for(var p=-1,y=c.length,b=j(y),M=o==null;++p<y;)b[p]=M?n:qf(o,c[p]);return b}function Ar(o,c,p){return o===o&&(p!==n&&(o=o<=p?o:p),c!==n&&(o=o>=c?o:c)),o}function Rn(o,c,p,y,b,M){var R,E=c&g,z=c&_,Z=c&x;if(p&&(R=b?p(o,y,b,M):p(o)),R!==n)return R;if(!pe(o))return o;var Q=Pt(o);if(Q){if(R=Rz(o),!E)return dn(o,R)}else{var et=Xe(o),ft=et==Ft||et==G;if(Ji(o))return G_(o,E);if(et==_t||et==X||ft&&!b){if(R=z||ft?{}:hb(o),!E)return z?xz(o,$F(R,o)):bz(o,T_(R,o))}else{if(!k[et])return b?o:{};R=Ez(o,et,E)}}M||(M=new zn);var wt=M.get(o);if(wt)return wt;M.set(o,R),Wb(o)?o.forEach(function(Mt){R.add(Rn(Mt,c,p,Mt,o,M))}):Ub(o)&&o.forEach(function(Mt,zt){R.set(zt,Rn(Mt,c,p,zt,o,M))});var Dt=Z?z?Rf:Of:z?hn:Pe,Nt=Q?n:Dt(o);return _n(Nt||o,function(Mt,zt){Nt&&(zt=Mt,Mt=o[zt]),Vo(R,zt,Rn(Mt,c,p,zt,o,M))}),R}function VF(o){var c=Pe(o);return function(p){return M_(p,o,c)}}function M_(o,c,p){var y=p.length;if(o==null)return!y;for(o=ie(o);y--;){var b=p[y],M=c[b],R=o[b];if(R===n&&!(b in o)||!M(R))return!1}return!0}function k_(o,c,p){if(typeof o!="function")throw new An(a);return Zo(function(){o.apply(n,p)},c)}function Yo(o,c,p,y){var b=-1,M=Nl,R=!0,E=o.length,z=[],Z=c.length;if(!E)return z;p&&(c=de(c,bn(p))),y?(M=Xd,R=!1):c.length>=r&&(M=Fo,R=!1,c=new Cr(c));t:for(;++b<E;){var Q=o[b],et=p==null?Q:p(Q);if(Q=y||Q!==0?Q:0,R&&et===et){for(var ft=Z;ft--;)if(c[ft]===et)continue t;z.push(Q)}else M(c,et,y)||z.push(Q)}return z}var Ki=J_(Jn),D_=J_(hf,!0);function YF(o,c){var p=!0;return Ki(o,function(y,b,M){return p=!!c(y,b,M),p}),p}function tc(o,c,p){for(var y=-1,b=o.length;++y<b;){var M=o[y],R=c(M);if(R!=null&&(E===n?R===R&&!wn(R):p(R,E)))var E=R,z=M}return z}function qF(o,c,p,y){var b=o.length;for(p=Lt(p),p<0&&(p=-p>b?0:b+p),y=y===n||y>b?b:Lt(y),y<0&&(y+=b),y=p>y?0:Vb(y);p<y;)o[p++]=c;return o}function C_(o,c){var p=[];return Ki(o,function(y,b,M){c(y,b,M)&&p.push(y)}),p}function ze(o,c,p,y,b){var M=-1,R=o.length;for(p||(p=Iz),b||(b=[]);++M<R;){var E=o[M];c>0&&p(E)?c>1?ze(E,c-1,p,y,b):qi(b,E):y||(b[b.length]=E)}return b}var ff=tb(),A_=tb(!0);function Jn(o,c){return o&&ff(o,c,Pe)}function hf(o,c){return o&&A_(o,c,Pe)}function ec(o,c){return Yi(c,function(p){return xi(o[p])})}function Or(o,c){c=Zi(c,o);for(var p=0,y=c.length;o!=null&&p<y;)o=o[Un(c[p++])];return p&&p==y?o:n}function O_(o,c,p){var y=c(o);return Pt(o)?y:qi(y,p(o))}function tn(o){return o==null?o===n?Ne:Wt:kr&&kr in ie(o)?Cz(o):Hz(o)}function pf(o,c){return o>c}function jF(o,c){return o!=null&&Kt.call(o,c)}function GF(o,c){return o!=null&&c in ie(o)}function KF(o,c,p){return o>=Ke(c,p)&&o<Ae(c,p)}function mf(o,c,p){for(var y=p?Xd:Nl,b=o[0].length,M=o.length,R=M,E=j(M),z=1/0,Z=[];R--;){var Q=o[R];R&&c&&(Q=de(Q,bn(c))),z=Ke(Q.length,z),E[R]=!p&&(c||b>=120&&Q.length>=120)?new Cr(R&&Q):n}Q=o[0];var et=-1,ft=E[0];t:for(;++et<b&&Z.length<z;){var wt=Q[et],Dt=c?c(wt):wt;if(wt=p||wt!==0?wt:0,!(ft?Fo(ft,Dt):y(Z,Dt,p))){for(R=M;--R;){var Nt=E[R];if(!(Nt?Fo(Nt,Dt):y(o[R],Dt,p)))continue t}ft&&ft.push(Dt),Z.push(wt)}}return Z}function XF(o,c,p,y){return Jn(o,function(b,M,R){c(y,p(b),M,R)}),y}function qo(o,c,p){c=Zi(c,o),o=yb(o,c);var y=o==null?o:o[Un(Pn(c))];return y==null?n:yn(y,o,p)}function R_(o){return ye(o)&&tn(o)==X}function ZF(o){return ye(o)&&tn(o)==Ee}function QF(o){return ye(o)&&tn(o)==yt}function jo(o,c,p,y,b){return o===c?!0:o==null||c==null||!ye(o)&&!ye(c)?o!==o&&c!==c:JF(o,c,p,y,jo,b)}function JF(o,c,p,y,b,M){var R=Pt(o),E=Pt(c),z=R?tt:Xe(o),Z=E?tt:Xe(c);z=z==X?_t:z,Z=Z==X?_t:Z;var Q=z==_t,et=Z==_t,ft=z==Z;if(ft&&Ji(o)){if(!Ji(c))return!1;R=!0,Q=!1}if(ft&&!Q)return M||(M=new zn),R||Ms(o)?ub(o,c,p,y,b,M):kz(o,c,z,p,y,b,M);if(!(p&v)){var wt=Q&&Kt.call(o,"__wrapped__"),Dt=et&&Kt.call(c,"__wrapped__");if(wt||Dt){var Nt=wt?o.value():o,Mt=Dt?c.value():c;return M||(M=new zn),b(Nt,Mt,p,y,M)}}return ft?(M||(M=new zn),Dz(o,c,p,y,b,M)):!1}function tz(o){return ye(o)&&Xe(o)==it}function gf(o,c,p,y){var b=p.length,M=b,R=!y;if(o==null)return!M;for(o=ie(o);b--;){var E=p[b];if(R&&E[2]?E[1]!==o[E[0]]:!(E[0]in o))return!1}for(;++b<M;){E=p[b];var z=E[0],Z=o[z],Q=E[1];if(R&&E[2]){if(Z===n&&!(z in o))return!1}else{var et=new zn;if(y)var ft=y(Z,Q,z,o,c,et);if(!(ft===n?jo(Q,Z,v|S,y,et):ft))return!1}}return!0}function E_(o){if(!pe(o)||Nz(o))return!1;var c=xi(o)?tF:Od;return c.test(Er(o))}function ez(o){return ye(o)&&tn(o)==Me}function nz(o){return ye(o)&&Xe(o)==ae}function iz(o){return ye(o)&&_c(o.length)&&!!ne[tn(o)]}function P_(o){return typeof o=="function"?o:o==null?pn:typeof o=="object"?Pt(o)?N_(o[0],o[1]):L_(o):nx(o)}function yf(o){if(!Xo(o))return oF(o);var c=[];for(var p in ie(o))Kt.call(o,p)&&p!="constructor"&&c.push(p);return c}function rz(o){if(!pe(o))return Uz(o);var c=Xo(o),p=[];for(var y in o)y=="constructor"&&(c||!Kt.call(o,y))||p.push(y);return p}function _f(o,c){return o<c}function I_(o,c){var p=-1,y=fn(o)?j(o.length):[];return Ki(o,function(b,M,R){y[++p]=c(b,M,R)}),y}function L_(o){var c=Pf(o);return c.length==1&&c[0][2]?mb(c[0][0],c[0][1]):function(p){return p===o||gf(p,o,c)}}function N_(o,c){return Lf(o)&&pb(c)?mb(Un(o),c):function(p){var y=qf(p,o);return y===n&&y===c?jf(p,o):jo(c,y,v|S)}}function nc(o,c,p,y,b){o!==c&&ff(c,function(M,R){if(b||(b=new zn),pe(M))sz(o,c,R,p,nc,y,b);else{var E=y?y(Bf(o,R),M,R+"",o,c,b):n;E===n&&(E=M),uf(o,R,E)}},hn)}function sz(o,c,p,y,b,M,R){var E=Bf(o,p),z=Bf(c,p),Z=R.get(z);if(Z){uf(o,p,Z);return}var Q=M?M(E,z,p+"",o,c,R):n,et=Q===n;if(et){var ft=Pt(z),wt=!ft&&Ji(z),Dt=!ft&&!wt&&Ms(z);Q=z,ft||wt||Dt?Pt(E)?Q=E:xe(E)?Q=dn(E):wt?(et=!1,Q=G_(z,!0)):Dt?(et=!1,Q=K_(z,!0)):Q=[]:Qo(z)||Pr(z)?(Q=E,Pr(E)?Q=Yb(E):(!pe(E)||xi(E))&&(Q=hb(z))):et=!1}et&&(R.set(z,Q),b(Q,z,y,M,R),R.delete(z)),uf(o,p,Q)}function B_(o,c){var p=o.length;if(p)return c+=c<0?p:0,bi(c,p)?o[c]:n}function F_(o,c,p){c.length?c=de(c,function(M){return Pt(M)?function(R){return Or(R,M.length===1?M[0]:M)}:M}):c=[pn];var y=-1;c=de(c,bn(kt()));var b=I_(o,function(M,R,E){var z=de(c,function(Z){return Z(M)});return{criteria:z,index:++y,value:M}});return EB(b,function(M,R){return _z(M,R,p)})}function oz(o,c){return z_(o,c,function(p,y){return jf(o,y)})}function z_(o,c,p){for(var y=-1,b=c.length,M={};++y<b;){var R=c[y],E=Or(o,R);p(E,R)&&Go(M,Zi(R,o),E)}return M}function az(o){return function(c){return Or(c,o)}}function bf(o,c,p,y){var b=y?RB:ps,M=-1,R=c.length,E=o;for(o===c&&(c=dn(c)),p&&(E=de(o,bn(p)));++M<R;)for(var z=0,Z=c[M],Q=p?p(Z):Z;(z=b(E,Q,z,y))>-1;)E!==o&&ql.call(E,z,1),ql.call(o,z,1);return o}function U_(o,c){for(var p=o?c.length:0,y=p-1;p--;){var b=c[p];if(p==y||b!==M){var M=b;bi(b)?ql.call(o,b,1):Sf(o,b)}}return o}function xf(o,c){return o+Kl(x_()*(c-o+1))}function lz(o,c,p,y){for(var b=-1,M=Ae(Gl((c-o)/(p||1)),0),R=j(M);M--;)R[y?M:++b]=o,o+=p;return R}function wf(o,c){var p="";if(!o||c<1||c>at)return p;do c%2&&(p+=o),c=Kl(c/2),c&&(o+=o);while(c);return p}function Bt(o,c){return Ff(gb(o,c,pn),o+"")}function cz(o){return S_(ks(o))}function uz(o,c){var p=ks(o);return fc(p,Ar(c,0,p.length))}function Go(o,c,p,y){if(!pe(o))return o;c=Zi(c,o);for(var b=-1,M=c.length,R=M-1,E=o;E!=null&&++b<M;){var z=Un(c[b]),Z=p;if(z==="__proto__"||z==="constructor"||z==="prototype")return o;if(b!=R){var Q=E[z];Z=y?y(Q,z,E):n,Z===n&&(Z=pe(Q)?Q:bi(c[b+1])?[]:{})}Vo(E,z,Z),E=E[z]}return o}var H_=Xl?function(o,c){return Xl.set(o,c),o}:pn,dz=jl?function(o,c){return jl(o,"toString",{configurable:!0,enumerable:!1,value:Kf(c),writable:!0})}:pn;function fz(o){return fc(ks(o))}function En(o,c,p){var y=-1,b=o.length;c<0&&(c=-c>b?0:b+c),p=p>b?b:p,p<0&&(p+=b),b=c>p?0:p-c>>>0,c>>>=0;for(var M=j(b);++y<b;)M[y]=o[y+c];return M}function hz(o,c){var p;return Ki(o,function(y,b,M){return p=c(y,b,M),!p}),!!p}function ic(o,c,p){var y=0,b=o==null?y:o.length;if(typeof c=="number"&&c===c&&b<=nt){for(;y<b;){var M=y+b>>>1,R=o[M];R!==null&&!wn(R)&&(p?R<=c:R<c)?y=M+1:b=M}return b}return vf(o,c,pn,p)}function vf(o,c,p,y){var b=0,M=o==null?0:o.length;if(M===0)return 0;c=p(c);for(var R=c!==c,E=c===null,z=wn(c),Z=c===n;b<M;){var Q=Kl((b+M)/2),et=p(o[Q]),ft=et!==n,wt=et===null,Dt=et===et,Nt=wn(et);if(R)var Mt=y||Dt;else Z?Mt=Dt&&(y||ft):E?Mt=Dt&&ft&&(y||!wt):z?Mt=Dt&&ft&&!wt&&(y||!Nt):wt||Nt?Mt=!1:Mt=y?et<=c:et<c;Mt?b=Q+1:M=Q}return Ke(M,H)}function W_(o,c){for(var p=-1,y=o.length,b=0,M=[];++p<y;){var R=o[p],E=c?c(R):R;if(!p||!Hn(E,z)){var z=E;M[b++]=R===0?0:R}}return M}function $_(o){return typeof o=="number"?o:wn(o)?V:+o}function xn(o){if(typeof o=="string")return o;if(Pt(o))return de(o,xn)+"";if(wn(o))return w_?w_.call(o):"";var c=o+"";return c=="0"&&1/o==-vt?"-0":c}function Xi(o,c,p){var y=-1,b=Nl,M=o.length,R=!0,E=[],z=E;if(p)R=!1,b=Xd;else if(M>=r){var Z=c?null:Tz(o);if(Z)return Fl(Z);R=!1,b=Fo,z=new Cr}else z=c?[]:E;t:for(;++y<M;){var Q=o[y],et=c?c(Q):Q;if(Q=p||Q!==0?Q:0,R&&et===et){for(var ft=z.length;ft--;)if(z[ft]===et)continue t;c&&z.push(et),E.push(Q)}else b(z,et,p)||(z!==E&&z.push(et),E.push(Q))}return E}function Sf(o,c){c=Zi(c,o);var p=-1,y=c.length;if(!y)return!0;for(;++p<y;){var b=Un(c[p]);if(b==="__proto__"&&!Kt.call(o,"__proto__")||(b==="constructor"||b==="prototype")&&p<y-1)return!1}var M=yb(o,c);return M==null||delete M[Un(Pn(c))]}function V_(o,c,p,y){return Go(o,c,p(Or(o,c)),y)}function rc(o,c,p,y){for(var b=o.length,M=y?b:-1;(y?M--:++M<b)&&c(o[M],M,o););return p?En(o,y?0:M,y?M+1:b):En(o,y?M+1:0,y?b:M)}function Y_(o,c){var p=o;return p instanceof Ut&&(p=p.value()),Zd(c,function(y,b){return b.func.apply(b.thisArg,qi([y],b.args))},p)}function Tf(o,c,p){var y=o.length;if(y<2)return y?Xi(o[0]):[];for(var b=-1,M=j(y);++b<y;)for(var R=o[b],E=-1;++E<y;)E!=b&&(M[b]=Yo(M[b]||R,o[E],c,p));return Xi(ze(M,1),c,p)}function q_(o,c,p){for(var y=-1,b=o.length,M=c.length,R={};++y<b;){var E=y<M?c[y]:n;p(R,o[y],E)}return R}function Mf(o){return xe(o)?o:[]}function kf(o){return typeof o=="function"?o:pn}function Zi(o,c){return Pt(o)?o:Lf(o,c)?[o]:wb(Xt(o))}var pz=Bt;function Qi(o,c,p){var y=o.length;return p=p===n?y:p,!c&&p>=y?o:En(o,c,p)}var j_=eF||function(o){return ue.clearTimeout(o)};function G_(o,c){if(c)return o.slice();var p=o.length,y=m_?m_(p):new o.constructor(p);return o.copy(y),y}function Df(o){var c=new o.constructor(o.byteLength);return new Vl(c).set(new Vl(o)),c}function mz(o,c){var p=c?Df(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.byteLength)}function gz(o){var c=new o.constructor(o.source,bl.exec(o));return c.lastIndex=o.lastIndex,c}function yz(o){return $o?ie($o.call(o)):{}}function K_(o,c){var p=c?Df(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.length)}function X_(o,c){if(o!==c){var p=o!==n,y=o===null,b=o===o,M=wn(o),R=c!==n,E=c===null,z=c===c,Z=wn(c);if(!E&&!Z&&!M&&o>c||M&&R&&z&&!E&&!Z||y&&R&&z||!p&&z||!b)return 1;if(!y&&!M&&!Z&&o<c||Z&&p&&b&&!y&&!M||E&&p&&b||!R&&b||!z)return-1}return 0}function _z(o,c,p){for(var y=-1,b=o.criteria,M=c.criteria,R=b.length,E=p.length;++y<R;){var z=X_(b[y],M[y]);if(z){if(y>=E)return z;var Z=p[y];return z*(Z=="desc"?-1:1)}}return o.index-c.index}function Z_(o,c,p,y){for(var b=-1,M=o.length,R=p.length,E=-1,z=c.length,Z=Ae(M-R,0),Q=j(z+Z),et=!y;++E<z;)Q[E]=c[E];for(;++b<R;)(et||b<M)&&(Q[p[b]]=o[b]);for(;Z--;)Q[E++]=o[b++];return Q}function Q_(o,c,p,y){for(var b=-1,M=o.length,R=-1,E=p.length,z=-1,Z=c.length,Q=Ae(M-E,0),et=j(Q+Z),ft=!y;++b<Q;)et[b]=o[b];for(var wt=b;++z<Z;)et[wt+z]=c[z];for(;++R<E;)(ft||b<M)&&(et[wt+p[R]]=o[b++]);return et}function dn(o,c){var p=-1,y=o.length;for(c||(c=j(y));++p<y;)c[p]=o[p];return c}function ti(o,c,p,y){var b=!p;p||(p={});for(var M=-1,R=c.length;++M<R;){var E=c[M],z=y?y(p[E],o[E],E,p,o):n;z===n&&(z=o[E]),b?Qn(p,E,z):Vo(p,E,z)}return p}function bz(o,c){return ti(o,If(o),c)}function xz(o,c){return ti(o,db(o),c)}function sc(o,c){return function(p,y){var b=Pt(p)?MB:WF,M=c?c():{};return b(p,o,kt(y,2),M)}}function vs(o){return Bt(function(c,p){var y=-1,b=p.length,M=b>1?p[b-1]:n,R=b>2?p[2]:n;for(M=o.length>3&&typeof M=="function"?(b--,M):n,R&&en(p[0],p[1],R)&&(M=b<3?n:M,b=1),c=ie(c);++y<b;){var E=p[y];E&&o(c,E,y,M)}return c})}function J_(o,c){return function(p,y){if(p==null)return p;if(!fn(p))return o(p,y);for(var b=p.length,M=c?b:-1,R=ie(p);(c?M--:++M<b)&&y(R[M],M,R)!==!1;);return p}}function tb(o){return function(c,p,y){for(var b=-1,M=ie(c),R=y(c),E=R.length;E--;){var z=R[o?E:++b];if(p(M[z],z,M)===!1)break}return c}}function wz(o,c,p){var y=c&C,b=Ko(o);function M(){var R=this&&this!==ue&&this instanceof M?b:o;return R.apply(y?p:this,arguments)}return M}function eb(o){return function(c){c=Xt(c);var p=ms(c)?Fn(c):n,y=p?p[0]:c.charAt(0),b=p?Qi(p,1).join(""):c.slice(1);return y[o]()+b}}function Ss(o){return function(c){return Zd(tx(Jb(c).replace(Yd,"")),o,"")}}function Ko(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 p=ws(o.prototype),y=o.apply(p,c);return pe(y)?y:p}}function vz(o,c,p){var y=Ko(o);function b(){for(var M=arguments.length,R=j(M),E=M,z=Ts(b);E--;)R[E]=arguments[E];var Z=M<3&&R[0]!==z&&R[M-1]!==z?[]:ji(R,z);if(M-=Z.length,M<p)return ob(o,c,oc,b.placeholder,n,R,Z,n,n,p-M);var Q=this&&this!==ue&&this instanceof b?y:o;return yn(Q,this,R)}return b}function nb(o){return function(c,p,y){var b=ie(c);if(!fn(c)){var M=kt(p,3);c=Pe(c),p=function(E){return M(b[E],E,b)}}var R=o(c,p,y);return R>-1?b[M?c[R]:R]:n}}function ib(o){return _i(function(c){var p=c.length,y=p,b=On.prototype.thru;for(o&&c.reverse();y--;){var M=c[y];if(typeof M!="function")throw new An(a);if(b&&!R&&uc(M)=="wrapper")var R=new On([],!0)}for(y=R?y:p;++y<p;){M=c[y];var E=uc(M),z=E=="wrapper"?Ef(M):n;z&&Nf(z[0])&&z[1]==(D|I|W|w)&&!z[4].length&&z[9]==1?R=R[uc(z[0])].apply(R,z[3]):R=M.length==1&&Nf(M)?R[E]():R.thru(M)}return function(){var Z=arguments,Q=Z[0];if(R&&Z.length==1&&Pt(Q))return R.plant(Q).value();for(var et=0,ft=p?c[et].apply(this,Z):Q;++et<p;)ft=c[et].call(this,ft);return ft}})}function oc(o,c,p,y,b,M,R,E,z,Z){var Q=c&D,et=c&C,ft=c&O,wt=c&(I|N),Dt=c&A,Nt=ft?n:Ko(o);function Mt(){for(var zt=arguments.length,Ht=j(zt),vn=zt;vn--;)Ht[vn]=arguments[vn];if(wt)var nn=Ts(Mt),Sn=IB(Ht,nn);if(y&&(Ht=Z_(Ht,y,b,wt)),M&&(Ht=Q_(Ht,M,R,wt)),zt-=Sn,wt&&zt<Z){var we=ji(Ht,nn);return ob(o,c,oc,Mt.placeholder,p,Ht,we,E,z,Z-zt)}var Wn=et?p:this,vi=ft?Wn[o]:o;return zt=Ht.length,E?Ht=Wz(Ht,E):Dt&&zt>1&&Ht.reverse(),Q&&z<zt&&(Ht.length=z),this&&this!==ue&&this instanceof Mt&&(vi=Nt||Ko(vi)),vi.apply(Wn,Ht)}return Mt}function rb(o,c){return function(p,y){return XF(p,o,c(y),{})}}function ac(o,c){return function(p,y){var b;if(p===n&&y===n)return c;if(p!==n&&(b=p),y!==n){if(b===n)return y;typeof p=="string"||typeof y=="string"?(p=xn(p),y=xn(y)):(p=$_(p),y=$_(y)),b=o(p,y)}return b}}function Cf(o){return _i(function(c){return c=de(c,bn(kt())),Bt(function(p){var y=this;return o(c,function(b){return yn(b,y,p)})})})}function lc(o,c){c=c===n?" ":xn(c);var p=c.length;if(p<2)return p?wf(c,o):c;var y=wf(c,Gl(o/gs(c)));return ms(c)?Qi(Fn(y),0,o).join(""):y.slice(0,o)}function Sz(o,c,p,y){var b=c&C,M=Ko(o);function R(){for(var E=-1,z=arguments.length,Z=-1,Q=y.length,et=j(Q+z),ft=this&&this!==ue&&this instanceof R?M:o;++Z<Q;)et[Z]=y[Z];for(;z--;)et[Z++]=arguments[++E];return yn(ft,b?p:this,et)}return R}function sb(o){return function(c,p,y){return y&&typeof y!="number"&&en(c,p,y)&&(p=y=n),c=wi(c),p===n?(p=c,c=0):p=wi(p),y=y===n?c<p?1:-1:wi(y),lz(c,p,y,o)}}function cc(o){return function(c,p){return typeof c=="string"&&typeof p=="string"||(c=In(c),p=In(p)),o(c,p)}}function ob(o,c,p,y,b,M,R,E,z,Z){var Q=c&I,et=Q?R:n,ft=Q?n:R,wt=Q?M:n,Dt=Q?n:M;c|=Q?W:U,c&=~(Q?U:W),c&B||(c&=-4);var Nt=[o,c,b,wt,et,Dt,ft,E,z,Z],Mt=p.apply(n,Nt);return Nf(o)&&_b(Mt,Nt),Mt.placeholder=y,bb(Mt,o,c)}function Af(o){var c=Ce[o];return function(p,y){if(p=In(p),y=y==null?0:Ke(Lt(y),292),y&&b_(p)){var b=(Xt(p)+"e").split("e"),M=c(b[0]+"e"+(+b[1]+y));return b=(Xt(M)+"e").split("e"),+(b[0]+"e"+(+b[1]-y))}return c(p)}}var Tz=bs&&1/Fl(new bs([,-0]))[1]==vt?function(o){return new bs(o)}:Qf;function ab(o){return function(c){var p=Xe(c);return p==it?sf(c):p==ae?HB(c):PB(c,o(c))}}function yi(o,c,p,y,b,M,R,E){var z=c&O;if(!z&&typeof o!="function")throw new An(a);var Z=y?y.length:0;if(Z||(c&=-97,y=b=n),R=R===n?R:Ae(Lt(R),0),E=E===n?E:Lt(E),Z-=b?b.length:0,c&U){var Q=y,et=b;y=b=n}var ft=z?n:Ef(o),wt=[o,c,p,y,b,Q,et,M,R,E];if(ft&&zz(wt,ft),o=wt[0],c=wt[1],p=wt[2],y=wt[3],b=wt[4],E=wt[9]=wt[9]===n?z?0:o.length:Ae(wt[9]-Z,0),!E&&c&(I|N)&&(c&=-25),!c||c==C)var Dt=wz(o,c,p);else c==I||c==N?Dt=vz(o,c,E):(c==W||c==(C|W))&&!b.length?Dt=Sz(o,c,p,y):Dt=oc.apply(n,wt);var Nt=ft?H_:_b;return bb(Nt(Dt,wt),o,c)}function lb(o,c,p,y){return o===n||Hn(o,_s[p])&&!Kt.call(y,p)?c:o}function cb(o,c,p,y,b,M){return pe(o)&&pe(c)&&(M.set(c,o),nc(o,c,n,cb,M),M.delete(c)),o}function Mz(o){return Qo(o)?n:o}function ub(o,c,p,y,b,M){var R=p&v,E=o.length,z=c.length;if(E!=z&&!(R&&z>E))return!1;var Z=M.get(o),Q=M.get(c);if(Z&&Q)return Z==c&&Q==o;var et=-1,ft=!0,wt=p&S?new Cr:n;for(M.set(o,c),M.set(c,o);++et<E;){var Dt=o[et],Nt=c[et];if(y)var Mt=R?y(Nt,Dt,et,c,o,M):y(Dt,Nt,et,o,c,M);if(Mt!==n){if(Mt)continue;ft=!1;break}if(wt){if(!Qd(c,function(zt,Ht){if(!Fo(wt,Ht)&&(Dt===zt||b(Dt,zt,p,y,M)))return wt.push(Ht)})){ft=!1;break}}else if(!(Dt===Nt||b(Dt,Nt,p,y,M))){ft=!1;break}}return M.delete(o),M.delete(c),ft}function kz(o,c,p,y,b,M,R){switch(p){case gn:if(o.byteLength!=c.byteLength||o.byteOffset!=c.byteOffset)return!1;o=o.buffer,c=c.buffer;case Ee:return!(o.byteLength!=c.byteLength||!M(new Vl(o),new Vl(c)));case pt:case yt:case lt:return Hn(+o,+c);case Rt:return o.name==c.name&&o.message==c.message;case Me:case cn:return o==c+"";case it:var E=sf;case ae:var z=y&v;if(E||(E=Fl),o.size!=c.size&&!z)return!1;var Z=R.get(o);if(Z)return Z==c;y|=S,R.set(o,c);var Q=ub(E(o),E(c),y,b,M,R);return R.delete(o),Q;case qt:if($o)return $o.call(o)==$o.call(c)}return!1}function Dz(o,c,p,y,b,M){var R=p&v,E=Of(o),z=E.length,Z=Of(c),Q=Z.length;if(z!=Q&&!R)return!1;for(var et=z;et--;){var ft=E[et];if(!(R?ft in c:Kt.call(c,ft)))return!1}var wt=M.get(o),Dt=M.get(c);if(wt&&Dt)return wt==c&&Dt==o;var Nt=!0;M.set(o,c),M.set(c,o);for(var Mt=R;++et<z;){ft=E[et];var zt=o[ft],Ht=c[ft];if(y)var vn=R?y(Ht,zt,ft,c,o,M):y(zt,Ht,ft,o,c,M);if(!(vn===n?zt===Ht||b(zt,Ht,p,y,M):vn)){Nt=!1;break}Mt||(Mt=ft=="constructor")}if(Nt&&!Mt){var nn=o.constructor,Sn=c.constructor;nn!=Sn&&"constructor"in o&&"constructor"in c&&!(typeof nn=="function"&&nn instanceof nn&&typeof Sn=="function"&&Sn instanceof Sn)&&(Nt=!1)}return M.delete(o),M.delete(c),Nt}function _i(o){return Ff(gb(o,n,Mb),o+"")}function Of(o){return O_(o,Pe,If)}function Rf(o){return O_(o,hn,db)}var Ef=Xl?function(o){return Xl.get(o)}:Qf;function uc(o){for(var c=o.name+"",p=xs[c],y=Kt.call(xs,c)?p.length:0;y--;){var b=p[y],M=b.func;if(M==null||M==o)return b.name}return c}function Ts(o){var c=Kt.call(T,"placeholder")?T:o;return c.placeholder}function kt(){var o=T.iteratee||Xf;return o=o===Xf?P_:o,arguments.length?o(arguments[0],arguments[1]):o}function dc(o,c){var p=o.__data__;return Lz(c)?p[typeof c=="string"?"string":"hash"]:p.map}function Pf(o){for(var c=Pe(o),p=c.length;p--;){var y=c[p],b=o[y];c[p]=[y,b,pb(b)]}return c}function Rr(o,c){var p=FB(o,c);return E_(p)?p:n}function Cz(o){var c=Kt.call(o,kr),p=o[kr];try{o[kr]=n;var y=!0}catch{}var b=Wl.call(o);return y&&(c?o[kr]=p:delete o[kr]),b}var If=af?function(o){return o==null?[]:(o=ie(o),Yi(af(o),function(c){return y_.call(o,c)}))}:Jf,db=af?function(o){for(var c=[];o;)qi(c,If(o)),o=Yl(o);return c}:Jf,Xe=tn;(lf&&Xe(new lf(new ArrayBuffer(1)))!=gn||Uo&&Xe(new Uo)!=it||cf&&Xe(cf.resolve())!=Vt||bs&&Xe(new bs)!=ae||Ho&&Xe(new Ho)!=re)&&(Xe=function(o){var c=tn(o),p=c==_t?o.constructor:n,y=p?Er(p):"";if(y)switch(y){case uF:return gn;case dF:return it;case fF:return Vt;case hF:return ae;case pF:return re}return c});function Az(o,c,p){for(var y=-1,b=p.length;++y<b;){var M=p[y],R=M.size;switch(M.type){case"drop":o+=R;break;case"dropRight":c-=R;break;case"take":c=Ke(c,o+R);break;case"takeRight":o=Ae(o,c-R);break}}return{start:o,end:c}}function Oz(o){var c=o.match(Td);return c?c[1].split(Md):[]}function fb(o,c,p){c=Zi(c,o);for(var y=-1,b=c.length,M=!1;++y<b;){var R=Un(c[y]);if(!(M=o!=null&&p(o,R)))break;o=o[R]}return M||++y!=b?M:(b=o==null?0:o.length,!!b&&_c(b)&&bi(R,b)&&(Pt(o)||Pr(o)))}function Rz(o){var c=o.length,p=new o.constructor(c);return c&&typeof o[0]=="string"&&Kt.call(o,"index")&&(p.index=o.index,p.input=o.input),p}function hb(o){return typeof o.constructor=="function"&&!Xo(o)?ws(Yl(o)):{}}function Ez(o,c,p){var y=o.constructor;switch(c){case Ee:return Df(o);case pt:case yt:return new y(+o);case gn:return mz(o,p);case Hi:case Cn:case je:case Ln:case di:case So:case To:case vr:case fi:return K_(o,p);case it:return new y;case lt:case cn:return new y(o);case Me:return gz(o);case ae:return new y;case qt:return yz(o)}}function Pz(o,c){var p=c.length;if(!p)return o;var y=p-1;return c[y]=(p>1?"& ":"")+c[y],c=c.join(p>2?", ":" "),o.replace(Nn,`{
|
|
3
|
+
`):e}function VE(e,t){const{element:n,datasetIndex:i,index:r}=t,s=e.getDatasetMeta(i).controller,{label:a,value:l}=s.getLabelAndValue(r);return{chart:e,label:a,parsed:s.getParsed(r),raw:e.data.datasets[i].data[r],formattedValue:l,dataset:s.getDataset(),dataIndex:r,datasetIndex:i,element:n}}function Wg(e,t){const n=e.chart.ctx,{body:i,footer:r,title:s}=e,{boxWidth:a,boxHeight:l}=t,u=ce(t.bodyFont),d=ce(t.titleFont),h=ce(t.footerFont),m=s.length,g=r.length,_=i.length,x=Se(t.padding);let v=x.height,S=0,C=i.reduce((P,B)=>P+B.before.length+B.lines.length+B.after.length,0);if(C+=e.beforeBody.length+e.afterBody.length,m&&(v+=m*d.lineHeight+(m-1)*t.titleSpacing+t.titleMarginBottom),C){const P=t.displayColors?Math.max(l,u.lineHeight):u.lineHeight;v+=_*P+(C-_)*u.lineHeight+(C-1)*t.bodySpacing}g&&(v+=t.footerMarginTop+g*h.lineHeight+(g-1)*t.footerSpacing);let A=0;const F=function(P){S=Math.max(S,n.measureText(P).width+A)};return n.save(),n.font=d.string,te(e.title,F),n.font=u.string,te(e.beforeBody.concat(e.afterBody),F),A=t.displayColors?a+2+t.boxPadding:0,te(i,P=>{te(P.before,F),te(P.lines,F),te(P.after,F)}),A=0,n.font=h.string,te(e.footer,F),n.restore(),S+=x.width,{width:S,height:v}}function YE(e,t){const{y:n,height:i}=t;return n<i/2?"top":n>e.height-i/2?"bottom":"center"}function qE(e,t,n,i){const{x:r,width:s}=i,a=n.caretSize+n.caretPadding;if(e==="left"&&r+s+a>t.width||e==="right"&&r-s-a<0)return!0}function jE(e,t,n,i){const{x:r,width:s}=n,{width:a,chartArea:{left:l,right:u}}=e;let d="center";return i==="center"?d=r<=(l+u)/2?"left":"right":r<=s/2?d="left":r>=a-s/2&&(d="right"),qE(d,e,t,n)&&(d="center"),d}function $g(e,t,n){const i=n.yAlign||t.yAlign||YE(e,n);return{xAlign:n.xAlign||t.xAlign||jE(e,t,n,i),yAlign:i}}function GE(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function KE(e,t,n){let{y:i,height:r}=e;return t==="top"?i+=n:t==="bottom"?i-=r+n:i-=r/2,i}function Vg(e,t,n,i){const{caretSize:r,caretPadding:s,cornerRadius:a}=e,{xAlign:l,yAlign:u}=n,d=r+s,{topLeft:h,topRight:m,bottomLeft:g,bottomRight:_}=Ei(a);let x=GE(t,l);const v=KE(t,u,d);return u==="center"?l==="left"?x+=d:l==="right"&&(x-=d):l==="left"?x-=Math.max(h,g)+r:l==="right"&&(x+=Math.max(m,_)+r),{x:Re(x,0,i.width-t.width),y:Re(v,0,i.height-t.height)}}function Ga(e,t,n){const i=Se(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function Yg(e){return Kn([],ci(e))}function XE(e,t,n){return Ri(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function qg(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const jg={beforeTitle:ri,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.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 n[t.dataIndex]}return""},afterTitle:ri,beforeBody:ri,beforeLabel:ri,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return Tt(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:ri,afterBody:ri,beforeFooter:ri,footer:ri,afterFooter:ri};function an(e,t,n,i){const r=e[t].call(n,i);return typeof r>"u"?jg[t].call(n,i):r}class Gg extends Ye{static positioners=ho;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 n=this.chart,i=this.options.setContext(this.getContext()),r=i.enabled&&n.options.animation&&i.animations,s=new gu(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=XE(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,r=an(i,"beforeTitle",this,t),s=an(i,"title",this,t),a=an(i,"afterTitle",this,t);let l=[];return l=Kn(l,ci(r)),l=Kn(l,ci(s)),l=Kn(l,ci(a)),l}getBeforeBody(t,n){return Yg(an(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,r=[];return te(t,s=>{const a={before:[],lines:[],after:[]},l=qg(i,s);Kn(a.before,ci(an(l,"beforeLabel",this,s))),Kn(a.lines,an(l,"label",this,s)),Kn(a.after,ci(an(l,"afterLabel",this,s))),r.push(a)}),r}getAfterBody(t,n){return Yg(an(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,r=an(i,"beforeFooter",this,t),s=an(i,"footer",this,t),a=an(i,"afterFooter",this,t);let l=[];return l=Kn(l,ci(r)),l=Kn(l,ci(s)),l=Kn(l,ci(a)),l}_createItems(t){const n=this._active,i=this.chart.data,r=[],s=[],a=[];let l=[],u,d;for(u=0,d=n.length;u<d;++u)l.push(VE(this.chart,n[u]));return t.filter&&(l=l.filter((h,m,g)=>t.filter(h,m,g,i))),t.itemSort&&(l=l.sort((h,m)=>t.itemSort(h,m,i))),te(l,h=>{const m=qg(t.callbacks,h);r.push(an(m,"labelColor",this,h)),s.push(an(m,"labelPointStyle",this,h)),a.push(an(m,"labelTextColor",this,h))}),this.labelColors=r,this.labelPointStyles=s,this.labelTextColors=a,this.dataPoints=l,l}update(t,n){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=ho[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=Wg(this,i),d=Object.assign({},l,u),h=$g(this.chart,i,d),m=Vg(i,d,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,s={opacity:1,x:m.x,y:m.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:n})}drawCaret(t,n,i,r){const s=this.getCaretPosition(t,i,r);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(t,n,i){const{xAlign:r,yAlign:s}=this,{caretSize:a,cornerRadius:l}=i,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:m}=Ei(l),{x:g,y:_}=t,{width:x,height:v}=n;let S,C,A,F,P,B;return s==="center"?(P=_+v/2,r==="left"?(S=g,C=S-a,F=P+a,B=P-a):(S=g+x,C=S+a,F=P-a,B=P+a),A=S):(r==="left"?C=g+Math.max(u,h)+a:r==="right"?C=g+x-Math.max(d,m)-a:C=this.caretX,s==="top"?(F=_,P=F-a,S=C-a,A=C+a):(F=_+v,P=F+a,S=C+a,A=C-a),B=F),{x1:S,x2:C,x3:A,y1:F,y2:P,y3:B}}drawTitle(t,n,i){const r=this.title,s=r.length;let a,l,u;if(s){const d=Kr(i.rtl,this.x,this.width);for(t.x=Ga(this,i.titleAlign,i),n.textAlign=d.textAlign(i.titleAlign),n.textBaseline="middle",a=ce(i.titleFont),l=i.titleSpacing,n.fillStyle=i.titleColor,n.font=a.string,u=0;u<s;++u)n.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,n,i,r,s){const a=this.labelColors[i],l=this.labelPointStyles[i],{boxHeight:u,boxWidth:d}=s,h=ce(s.bodyFont),m=Ga(this,"left",s),g=r.x(m),_=u<h.lineHeight?(h.lineHeight-u)/2:0,x=n.y+_;if(s.usePointStyle){const v={radius:Math.min(d,u)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},S=r.leftForLtr(g,d)+d/2,C=x+u/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,cu(t,v,S,C),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,cu(t,v,S,C)}else{t.lineWidth=Lt(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(g,d),S=r.leftForLtr(r.xPlus(g,1),d-2),C=Ei(a.borderRadius);Object.values(C).some(A=>A!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,qr(t,{x:v,y:x,w:d,h:u,radius:C}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),qr(t,{x:S,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(S,x+1,d-2,u-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:r}=this,{bodySpacing:s,bodyAlign:a,displayColors:l,boxHeight:u,boxWidth:d,boxPadding:h}=i,m=ce(i.bodyFont);let g=m.lineHeight,_=0;const x=Kr(i.rtl,this.x,this.width),v=function(k){n.fillText(k,x.x(t.x+_),t.y+g/2),t.y+=g+s},S=x.textAlign(a);let C,A,F,P,B,N,z;for(n.textAlign=a,n.textBaseline="middle",n.font=m.string,t.x=Ga(this,S,i),n.fillStyle=i.bodyColor,te(this.beforeBody,v),_=l&&S!=="right"?a==="center"?d/2+h:d+2+h:0,P=0,N=r.length;P<N;++P){for(C=r[P],A=this.labelTextColors[P],n.fillStyle=A,te(C.before,v),F=C.lines,l&&F.length&&(this._drawColorBox(n,t,P,x,i),g=Math.max(m.lineHeight,u)),B=0,z=F.length;B<z;++B)v(F[B]),g=m.lineHeight;te(C.after,v)}_=0,g=m.lineHeight,te(this.afterBody,v),t.y-=s}drawFooter(t,n,i){const r=this.footer,s=r.length;let a,l;if(s){const u=Kr(i.rtl,this.x,this.width);for(t.x=Ga(this,i.footerAlign,i),t.y+=i.footerMarginTop,n.textAlign=u.textAlign(i.footerAlign),n.textBaseline="middle",a=ce(i.footerFont),n.fillStyle=i.footerColor,n.font=a.string,l=0;l<s;++l)n.fillText(r[l],u.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,n,i,r){const{xAlign:s,yAlign:a}=this,{x:l,y:u}=t,{width:d,height:h}=i,{topLeft:m,topRight:g,bottomLeft:_,bottomRight:x}=Ei(r.cornerRadius);n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,n.lineWidth=r.borderWidth,n.beginPath(),n.moveTo(l+m,u),a==="top"&&this.drawCaret(t,n,i,r),n.lineTo(l+d-g,u),n.quadraticCurveTo(l+d,u,l+d,u+g),a==="center"&&s==="right"&&this.drawCaret(t,n,i,r),n.lineTo(l+d,u+h-x),n.quadraticCurveTo(l+d,u+h,l+d-x,u+h),a==="bottom"&&this.drawCaret(t,n,i,r),n.lineTo(l+_,u+h),n.quadraticCurveTo(l,u+h,l,u+h-_),a==="center"&&s==="left"&&this.drawCaret(t,n,i,r),n.lineTo(l,u+m),n.quadraticCurveTo(l,u,l+m,u),n.closePath(),n.fill(),r.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,r=i&&i.x,s=i&&i.y;if(r||s){const a=ho[t.position].call(this,this._active,this._eventPosition);if(!a)return;const l=this._size=Wg(this,t),u=Object.assign({},a,this._size),d=$g(n,t,u),h=Vg(t,u,d,n);(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 n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const r={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=Se(n.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&l&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,r,n),Sm(t,n.textDirection),s.y+=a.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),Tm(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){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=!Sa(i,r),a=this._positionChanged(r,n);(s||a)&&(this._active=r,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,s=this._active||[],a=this._getActiveElements(t,s,n,i),l=this._positionChanged(a,t),u=n||!Sa(a,s)||l;return u&&(this._active=a,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),u}_getActiveElements(t,n,i,r){const s=this.options;if(t.type==="mouseout")return[];if(!r)return n.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,n){const{caretX:i,caretY:r,options:s}=this,a=ho[s.position].call(this,t,n);return a!==!1&&(i!==a.x||r!==a.y)}}var qe={id:"tooltip",_element:Gg,positioners:ho,afterInit(e,t,n){n&&(e.tooltip=new Gg({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,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:(e,t)=>t.bodyFont.size,boxWidth:(e,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:jg},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},ZE=Object.freeze({__proto__:null,Colors:uE,Decimation:pE,Filler:IE,Legend:UE,SubTitle:$E,Title:WE,Tooltip:qe});const QE=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function JE(e,t,n,i){const r=e.indexOf(t);if(r===-1)return QE(e,t,n,i);const s=e.lastIndexOf(t);return r!==s?n:r}const tR=(e,t)=>e===null?null:Re(Math.round(e),0,t);function Kg(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class eR extends pr{static id="category";static defaults={ticks:{callback:Kg}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const i=this.getLabels();for(const{index:r,label:s}of n)i[r]===s&&i.splice(r,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(Tt(t))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:JE(i,t,Ct(n,t),this._addedLabels),tR(n,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:i,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),n||(r=this.getLabels().length-1)),this.min=i,this.max=r}buildTicks(){const t=this.min,n=this.max,i=this.options.offset,r=[];let s=this.getLabels();s=t===0&&n===s.length-1?s:s.slice(t,n+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=t;a<=n;a++)r.push({value:a});return r}getLabelForValue(t){return Kg.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 n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function nR(e,t){const n=[],{bounds:r,step:s,min:a,max:l,precision:u,count:d,maxTicks:h,maxDigits:m,includeBounds:g}=e,_=s||1,x=h-1,{min:v,max:S}=t,C=!Tt(a),A=!Tt(l),F=!Tt(d),P=(S-v)/(m+1);let B=Xp((S-v)/x/_)*_,N,z,k,w;if(B<1e-14&&!C&&!A)return[{value:v},{value:S}];w=Math.ceil(S/B)-Math.floor(v/B),w>x&&(B=Xp(w*B/x/_)*_),Tt(u)||(N=Math.pow(10,u),B=Math.ceil(B*N)/N),r==="ticks"?(z=Math.floor(v/B)*B,k=Math.ceil(S/B)*B):(z=v,k=S),C&&A&&s&&VD((l-a)/s,B/1e3)?(w=Math.round(Math.min((l-a)/B,h)),B=(l-a)/w,z=a,k=l):F?(z=C?a:z,k=A?l:k,w=d-1,B=(k-z)/w):(w=(k-z)/B,Ks(w,Math.round(w),B/1e3)?w=Math.round(w):w=Math.ceil(w));const O=Math.max(Qp(B),Qp(z));N=Math.pow(10,Tt(u)?O:u),z=Math.round(z*N)/N,k=Math.round(k*N)/N;let L=0;for(C&&(g&&z!==a?(n.push({value:a}),z<a&&L++,Ks(Math.round((z+L*B)*N)/N,a,Xg(a,P,e))&&L++):z<a&&L++);L<w;++L){const $=Math.round((z+L*B)*N)/N;if(A&&$>l)break;n.push({value:$})}return A&&g&&k!==l?n.length&&Ks(n[n.length-1].value,l,Xg(l,P,e))?n[n.length-1].value=l:n.push({value:l}):(!A||k===l)&&n.push({value:k}),n}function Xg(e,t,{horizontal:n,minRotation:i}){const r=ve(i),s=(n?Math.sin(r):Math.cos(r))||.001,a=.75*t*(""+e).length;return Math.min(t/s,a)}class Ka extends pr{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,n){return Tt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:r,max:s}=this;const a=u=>r=n?r:u,l=u=>s=i?s:u;if(t){const u=jn(r),d=jn(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:n,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(),n=n||11),n&&(r=Math.min(n,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=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:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},s=this._range||this,a=nR(r,s);return t.bounds==="ticks"&&Zp(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 n=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const r=(i-n)/Math.max(t.length-1,1)/2;n-=r,i+=r}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return Qs(t,this.chart.options.locale,this.options.ticks.format)}}class iR extends Ka{static id="linear";static defaults={ticks:{callback:Ea.formatters.numeric}};determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=le(t)?t:0,this.max=le(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=ve(this.options.ticks.minRotation),r=(t?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/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 po=e=>Math.floor(Oi(e)),mr=(e,t)=>Math.pow(10,po(e)+t);function Zg(e){return e/Math.pow(10,po(e))===1}function Qg(e,t,n){const i=Math.pow(10,n),r=Math.floor(e/i);return Math.ceil(t/i)-r}function rR(e,t){const n=t-e;let i=po(n);for(;Qg(e,t,i)>10;)i++;for(;Qg(e,t,i)<10;)i--;return Math.min(i,po(e))}function sR(e,{min:t,max:n}){t=mn(e.min,t);const i=[],r=po(t);let s=rR(t,n),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 m=Math.floor((d-h)/Math.pow(10,s)),g=mn(e.min,Math.round((u+h+m*Math.pow(10,s))*a)/a);for(;g<n;)i.push({value:g,major:Zg(g),significand:m}),m>=10?m=m<15?15:20:m++,m>=20&&(s++,m=2,a=s>=0?1:a),g=Math.round((u+h+m*Math.pow(10,s))*a)/a;const _=mn(e.max,g);return i.push({value:_,major:Zg(_),significand:m}),i}class oR extends pr{static id="logarithmic";static defaults={ticks:{callback:Ea.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,n){const i=Ka.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return le(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=le(t)?Math.max(0,t):null,this.max=le(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!le(this._userMin)&&(this.min=t===mr(this.min,0)?mr(this.min,-1):mr(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let i=this.min,r=this.max;const s=l=>i=t?i:l,a=l=>r=n?r:l;i===r&&(i<=0?(s(1),a(10)):(s(mr(i,-1)),a(mr(r,1)))),i<=0&&s(mr(r,-1)),r<=0&&a(mr(i,1)),this.min=i,this.max=r}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},i=sR(n,this);return t.bounds==="ticks"&&Zp(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":Qs(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Oi(t),this._valueRange=Oi(this.max)-Oi(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Oi(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}function Nu(e){const t=e.ticks;if(t.display&&e.display){const n=Se(t.backdropPadding);return Ct(t.font&&t.font.size,oe.font.size)+n.height}return 0}function aR(e,t,n){return n=Gt(n)?n:[n],{w:aC(e,t.string,n),h:n.length*t.lineHeight}}function Jg(e,t,n,i,r){return e===i||e===r?{start:t-n/2,end:t+n/2}:e<i||e>r?{start:t-n,end:t}:{start:t,end:t+n}}function lR(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),i=[],r=[],s=e._pointLabels.length,a=e.options.pointLabels,l=a.centerPointLabels?Rt/s:0;for(let u=0;u<s;u++){const d=a.setContext(e.getPointLabelContext(u));r[u]=d.padding;const h=e.getPointPosition(u,e.drawingArea+r[u],l),m=ce(d.font),g=aR(e.ctx,m,e._pointLabels[u]);i[u]=g;const _=We(e.getIndexAngle(u)+l),x=Math.round(Da(_)),v=Jg(x,h.x,g.w,0,180),S=Jg(x,h.y,g.h,90,270);cR(n,t,_,v,S)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=fR(e,i,r)}function cR(e,t,n,i,r){const s=Math.abs(Math.sin(n)),a=Math.abs(Math.cos(n));let l=0,u=0;i.start<t.l?(l=(t.l-i.start)/s,e.l=Math.min(e.l,t.l-l)):i.end>t.r&&(l=(i.end-t.r)/s,e.r=Math.max(e.r,t.r+l)),r.start<t.t?(u=(t.t-r.start)/a,e.t=Math.min(e.t,t.t-u)):r.end>t.b&&(u=(r.end-t.b)/a,e.b=Math.max(e.b,t.b+u))}function uR(e,t,n){const i=e.drawingArea,{extra:r,additionalAngle:s,padding:a,size:l}=n,u=e.getPointPosition(t,i+r+a,s),d=Math.round(Da(We(u.angle+se))),h=mR(u.y,l.h,d),m=hR(d),g=pR(u.x,l.w,m);return{visible:!0,x:u.x,y:h,textAlign:m,left:g,top:h,right:g+l.w,bottom:h+l.h}}function dR(e,t){if(!t)return!0;const{left:n,top:i,right:r,bottom:s}=e;return!(ai({x:n,y:i},t)||ai({x:n,y:s},t)||ai({x:r,y:i},t)||ai({x:r,y:s},t))}function fR(e,t,n){const i=[],r=e._pointLabels.length,s=e.options,{centerPointLabels:a,display:l}=s.pointLabels,u={extra:Nu(s)/2,additionalAngle:a?Rt/r:0};let d;for(let h=0;h<r;h++){u.padding=n[h],u.size=t[h];const m=uR(e,h,u);i.push(m),l==="auto"&&(m.visible=dR(m,d),m.visible&&(d=m))}return i}function hR(e){return e===0||e===180?"center":e<180?"left":"right"}function pR(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function mR(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function gR(e,t,n){const{left:i,top:r,right:s,bottom:a}=n,{backdropColor:l}=t;if(!Tt(l)){const u=Ei(t.borderRadius),d=Se(t.backdropPadding);e.fillStyle=l;const h=i-d.left,m=r-d.top,g=s-i+d.width,_=a-r+d.height;Object.values(u).some(x=>x!==0)?(e.beginPath(),qr(e,{x:h,y:m,w:g,h:_,radius:u}),e.fill()):e.fillRect(h,m,g,_)}}function yR(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let r=t-1;r>=0;r--){const s=e._pointLabelItems[r];if(!s.visible)continue;const a=i.setContext(e.getPointLabelContext(r));gR(n,a,s);const l=ce(a.font),{x:u,y:d,textAlign:h}=s;ur(n,e._pointLabels[r],u,d+l.lineHeight/2,l,{color:a.color,textAlign:h,textBaseline:"middle"})}}function t0(e,t,n,i){const{ctx:r}=e;if(n)r.arc(e.xCenter,e.yCenter,t,0,ee);else{let s=e.getPointPosition(0,t);r.moveTo(s.x,s.y);for(let a=1;a<i;a++)s=e.getPointPosition(a,t),r.lineTo(s.x,s.y)}}function _R(e,t,n,i,r){const s=e.ctx,a=t.circular,{color:l,lineWidth:u}=t;!a&&!i||!l||!u||n<0||(s.save(),s.strokeStyle=l,s.lineWidth=u,s.setLineDash(r.dash||[]),s.lineDashOffset=r.dashOffset,s.beginPath(),t0(e,n,a,i),s.closePath(),s.stroke(),s.restore())}function bR(e,t,n){return Ri(e,{label:n,index:t,type:"pointLabel"})}class xR extends Ka{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:Ea.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=Se(Nu(this.options)/2),n=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(n,i)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=le(t)&&!isNaN(t)?t:0,this.max=le(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Nu(this.options))}generateTickLabels(t){Ka.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,i)=>{const r=Jt(this.options.pointLabels.callback,[n,i],this);return r||r===0?r:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?lR(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,r){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,r))}getIndexAngle(t){const n=ee/(this._pointLabels.length||1),i=this.options.startAngle||0;return We(t*n+ve(i))}getDistanceFromCenterForValue(t){if(Tt(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(Tt(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const i=n[t];return bR(this.getContext(),t,i)}}getPointPosition(t,n,i=0){const r=this.getIndexAngle(t)-se+i;return{x:Math.cos(r)*n+this.xCenter,y:Math.sin(r)*n+this.yCenter,angle:r}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:i,right:r,bottom:s}=this._pointLabelItems[t];return{left:n,top:i,right:r,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),t0(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:i,grid:r,border:s}=n,a=this._pointLabels.length;let l,u,d;if(n.pointLabels.display&&yR(this,a),r.display&&this.ticks.forEach((h,m)=>{if(m!==0||m===0&&this.min<0){u=this.getDistanceFromCenterForValue(h.value);const g=this.getContext(m),_=r.setContext(g),x=s.setContext(g);_R(this,_,u,a,x)}}),i.display){for(t.save(),l=a-1;l>=0;l--){const h=i.setContext(this.getPointLabelContext(l)),{color:m,lineWidth:g}=h;!g||!m||(t.lineWidth=g,t.strokeStyle=m,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,u=this.getDistanceFromCenterForValue(n.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,n=this.options,i=n.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&&!n.reverse)return;const d=i.setContext(this.getContext(u)),h=ce(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 m=Se(d.backdropPadding);t.fillRect(-a/2-m.left,-s-h.size/2-m.top,a+m.width,h.size+m.height)}ur(t,l.label,0,-s,h,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),t.restore()}drawTitle(){}}const Xa={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}},ln=Object.keys(Xa);function e0(e,t){return e-t}function n0(e,t){if(Tt(t))return null;const n=e._adapter,{parser:i,round:r,isoWeekday:s}=e._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),le(a)||(a=typeof i=="string"?n.parse(a,i):n.parse(a)),a===null?null:(r&&(a=r==="week"&&(Ai(s)||s===!0)?n.startOf(a,"isoWeek",s):n.startOf(a,r)),+a)}function i0(e,t,n,i){const r=ln.length;for(let s=ln.indexOf(e);s<r-1;++s){const a=Xa[ln[s]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-t)/(l*a.size))<=i)return ln[s]}return ln[r-1]}function wR(e,t,n,i,r){for(let s=ln.length-1;s>=ln.indexOf(n);s--){const a=ln[s];if(Xa[a].common&&e._adapter.diff(r,i,a)>=t-1)return a}return ln[n?ln.indexOf(n):0]}function vR(e){for(let t=ln.indexOf(e)+1,n=ln.length;t<n;++t)if(Xa[ln[t]].common)return ln[t]}function r0(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:i,hi:r}=iu(n,t),s=n[i]>=t?n[i]:n[r];e[s]=!0}}function SR(e,t,n,i){const r=e._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=n[l],u>=0&&(t[u].major=!0);return t}function s0(e,t,n){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||!n?i:SR(e,i,r,n)}class Bu extends pr{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,n={}){const i=t.time||(t.time={}),r=this._adapter=new jm._date(t.adapters.date);r.init(n),Gs(i.displayFormats,r.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:n0(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=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=le(r)&&!isNaN(r)?r:+n.startOf(Date.now(),i),s=le(s)&&!isNaN(s)?s:+n.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 n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],i=t[t.length-1]),{min:n,max:i}}buildTicks(){const t=this.options,n=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=GD(r,s,a);return this._unit=n.unit||(i.autoSkip?i0(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):wR(this,l.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:vR(this._unit),this.initOffsets(r),t.reverse&&l.reverse(),s0(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,i=0,r,s;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?n=1-r:n=(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;n=Re(n,0,a),i=Re(i,0,a),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,r=this.options,s=r.time,a=s.unit||i0(s.minUnit,n,i,this._getLabelCapacity(n)),l=Ct(r.ticks.stepSize,1),u=a==="week"?s.isoWeekday:!1,d=Ai(u)||u===!0,h={};let m=n,g,_;if(d&&(m=+t.startOf(m,"isoWeek",u)),m=+t.startOf(m,d?"day":a),t.diff(i,n,a)>1e5*l)throw new Error(n+" and "+i+" are too far apart with stepSize of "+l+" "+a);const x=r.ticks.source==="data"&&this.getDataTimestamps();for(g=m,_=0;g<i;g=+t.add(g,l,a),_++)r0(h,g,x);return(g===i||r.bounds==="ticks"||_===1)&&r0(h,g,x),Object.keys(h).sort(e0).map(v=>+v)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){const r=this.options.time.displayFormats,s=this._unit,a=n||r[s];return this._adapter.format(t,a)}_tickFormatFunction(t,n,i,r){const s=this.options,a=s.ticks.callback;if(a)return Jt(a,[t,n,i],this);const l=s.time.displayFormats,u=this._unit,d=this._majorUnit,h=u&&l[u],m=d&&l[d],g=i[n],_=d&&m&&g&&g.major;return this._adapter.format(t,r||(_?m:h))}generateTickLabels(t){let n,i,r;for(n=0,i=t.length;n<i;++n)r=t[n],r.label=this._tickFormatFunction(r.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+i)*n.factor)}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,i=this.ctx.measureText(t).width,r=ve(this.isHorizontal()?n.maxRotation:n.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 n=this.options.time,i=n.displayFormats,r=i[n.unit]||i.millisecond,s=this._tickFormatFunction(t,0,s0(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||[],n,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(n=0,i=r.length;n<i;++n)t=t.concat(r[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,i;if(t.length)return t;const r=this.getLabels();for(n=0,i=r.length;n<i;++n)t.push(n0(this,r[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return em(t.sort(e0))}}function Za(e,t,n){let i=0,r=e.length-1,s,a,l,u;n?(t>=e[i].pos&&t<=e[r].pos&&({lo:i,hi:r}=oi(e,"pos",t)),{pos:s,time:l}=e[i],{pos:a,time:u}=e[r]):(t>=e[i].time&&t<=e[r].time&&({lo:i,hi:r}=oi(e,"time",t)),{time:s,pos:l}=e[i],{time:a,pos:u}=e[r]);const d=a-s;return d?l+(u-l)*(t-s)/d:l}class TR extends Bu{static id="timeseries";static defaults=Bu.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=Za(n,this.min),this._tableRange=Za(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,r=[],s=[];let a,l,u,d,h;for(a=0,l=t.length;a<l;++a)d=t[a],d>=n&&d<=i&&r.push(d);if(r.length<2)return[{time:n,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,n=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(n)||i.length===1)&&i.push(n),i.sort((r,s)=>r-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?t=this.normalize(n.concat(i)):t=n.length?n:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Za(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return Za(this._table,i*this._tableRange+this._minPos,!0)}}var kR=Object.freeze({__proto__:null,CategoryScale:eR,LinearScale:iR,LogarithmicScale:oR,RadialLinearScale:xR,TimeScale:Bu,TimeSeriesScale:TR});const MR=[MO,iE,ZE,kR];function DR(e){const n=`barChartTooltipPosition-${e.tooltipState.chartID}`,i={enabled:!1,position:n,callbacks:{label:u=>({label:u.dataset.label,value:u.label})}};qe.positioners[n]=function(u,d){if(!u.length||e.tooltipState.interactionMode==="interactive"||d.x===null||d.y===null)return!1;const h=this.chart.canvas.getBoundingClientRect(),m=e.tooltipState.width||this.width,g=h.width/2,_=nl(d,m,g),x=d.y,v=d.x<g?"left":"center";return{x:_-e.tooltipState.offsetX,y:x-e.tooltipState.offsetY,xAlign:v}},Tu.modes.customInteractionMode=function(u,d){const h=Pi(d,u),m=[];return Tu.evaluateInteractionItems(u,u.options.indexAxis||"x",h,(g,_,x)=>{u.options.indexAxis==="y"&&g.inYRange(h.y,!0)&&u.data.datasets[_].data[x]&&m.push({element:g,datasetIndex:_,index:x}),u.options.indexAxis==="x"&&h.x!==null&&g.inXRange(h.x,!0)&&u.data.datasets[_].data[x]&&m.push({element:g,datasetIndex:_,index:x})}),m};const r=e.numLabels.value>25?v0:S0,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>il?d.slice(0,il)+"...":d):u.getLabelForValue(Number(d)),l=f.computed(()=>({indexAxis:e.indexAxis,skipNull:!0,scales:{x:{stacked:e.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:e.indexAxis==="y"?!Tt(e.metricAxesTitle?.value):!Tt(e.dimensionAxesTitle?.value),text:e.indexAxis==="y"?e.metricAxesTitle?.value:e.dimensionAxesTitle?.value,padding:{top:3,bottom:0,left:0,right:0},font:{weight:"bold"}}},y:{stacked:e.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:e.indexAxis==="x"?!Tt(e.metricAxesTitle?.value):!Tt(e.dimensionAxesTitle?.value),text:e.indexAxis==="x"?e.metricAxesTitle?.value:e.dimensionAxesTitle?.value,padding:{bottom:3,top:0,left:0,right:0},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},tooltip:{...i,external:u=>{b0(e.tooltipState,u)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1,layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return f.getCurrentInstance()&&f.onUnmounted(()=>{qe.positioners[n]&&delete qe.positioners[n]}),l}on.register(...MR);const CR=(e,t)=>{const n=t.datasets.map(r=>r.label),i=e.datasets.map(r=>r.label);return e.datasets.length===t.datasets.length&&n.every((r,s)=>r===i[s])};function OR(e,t,n,i,r){const s=f.shallowRef(null),a=(l,u)=>{if(t.value)return new on(t.value,{type:e,data:l,plugins:i,options:u})};return f.onMounted(()=>{s.value=a(n.value,r.value)}),f.onBeforeUnmount(()=>{Tt(s.value)||s.value.destroy()}),f.watch(n,(l,u)=>{if(CR(u,l)&&!Tt(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 Tt(s.value)||s.value.destroy(),s.value=a(l,r.value)}),f.watch(t,()=>{Tt(s.value)||s.value.destroy(),s.value=a(n.value,r.value)}),f.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))&&(Tt(s.value)||s.value.destroy(),s.value=a(n.value,l))}),s}const o0=1e3,AR=1e4,a0=1e6,l0=1e9,c0=1e12,mo=(e,t)=>{if(t.separator===!1||e<1e3)return e.toString();const n=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(e).toString().split("").reverse().forEach((s,a)=>{a&&a%3===0&&i.push(n),i.push(s)}),i.reverse().join("")},Zr=(e,t,n)=>{const i=e/t,r=n.round?"round":"floor";if(n.decimal===!1)return Math[r](i).toString();let s;n.precision?s=i:s=i<10?Math[r](i*10)/10:Math[r](i);let a=s.toString();return typeof n.decimal=="string"&&(a=a.replace(".",n.decimal)),a};function go(e,t={}){let n;const i=e<0;i&&(e=Math.abs(e)),t.precision&&(e=parseFloat(e.toPrecision(t.precision)));const r=t.min10k?AR:o0;return e<r||t.precision&&t.precision>Math.log10(e)?n=mo(Zr(e,1,t),t):e<a0?n=`${Zr(e,o0,t)}k`:e<l0?n=`${Zr(e,a0,t)}m`:e<c0?n=`${mo(Zr(e,l0,t),t)}b`:n=`${mo(Zr(e,c0,t),t)}t`,i&&(n=`-${n}`),t.capital&&(n=n.toUpperCase()),t.prefix&&(n=`${t.prefix}${n}`),t.suffix&&(n=`${n}${t.suffix}`),n}go.addCommas=mo;function ER(e,t,n){const{i18n:i}=St.useI18n(),{formatBytes:r}=$n({i18n:i}),{translateUnit:s}=St.useTranslatedUnits();return{legendValues:f.computed(()=>e.value.datasets.reduce((l,u)=>{const d=u.total?u.total:u.data.reduce((g,_)=>g+(typeof _=="number"?Number(_)||0:Number(_&&_.y)||0),0);let h;const m=u.unit??n.value;if(m==="bytes")h=r(d);else{const g=s(m,d);h=i&&i.t("legend.datapointValueDisplay",{value:go(d,{capital:!0}),unit:g})||`${go(d,{capital:!0})} ${m}`}return{...l,[u.label]:{raw:d,formatted:h,isThreshold:u.isThreshold}}},{}))}}function RR(e){return f.computed(()=>{if(!e.value?.meta)return"";const n=e.value.meta.start,i=e.value.meta.end;return n&&i?`${qh(new Date(n))} - ${qh(new Date(i),{includeTZ:!0})}`:""})}function PR(e){const n=`donutChartTooltipPosition-${e.tooltipState.chartID}`,i={enabled:!1,position:n,callbacks:{label:s=>({label:s.dataset.label,value:s.label})}};qe.positioners[n]=function(s,a){if(!s.length||a.x===null||a.y===null)return!1;const l=this.chart.canvas.getBoundingClientRect(),u=e.tooltipState.width||this.width,d=l.width/2,h=nl(a,u,d),m=a.y,g=a.x<d?"left":"center";return{x:h-e.tooltipState.offsetX,y:m,xAlign:g}};const r=f.computed(()=>({cutout:"65%",responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},tooltip:{...i,external:s=>{b0(e.tooltipState,s)}}},layout:{padding:{left:0,right:0,top:5,bottom:0}}}));return f.onUnmounted(()=>{qe.positioners[n]&&delete qe.positioners[n]}),{options:r}}function IR(e){const t=f.computed(()=>({type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:h=>{const m=new Date(h);return H0({tickValue:m,granularity:e.granularity.value,dayBoundaryCrossed:u.value})}},title:{display:!Tt(e.dimensionAxesTitle?.value),text:e.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}},border:{display:!1},stacked:e.stacked.value})),n=f.computed(()=>!!e.rightYAxis?.value),i=f.computed(()=>({title:{display:!Tt(e.metricAxesTitle?.value),text:e.metricAxesTitle?.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1,...e.leftYAxisGrid?.value===!1?{drawOnChartArea:!1}:{}},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:e.stacked.value,...n.value?{display:"auto"}:{}})),r=f.computed(()=>{const h=e.rightYAxis?.value;if(h)return{display:"auto",position:"right",title:{display:!Tt(h.title),text:h.title,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1,drawOnChartArea:h.showGrid??!1},beginAtZero:!0,border:{display:!1},stacked:e.stacked.value}}),a=`lineChartTooltipPosition-${e.tooltipState.chartID}`,l={enabled:!1,position:a};qe.positioners[a]=function(h,m){if(!h.length||e.tooltipState.interactionMode==="interactive"||m.x===null||m.y===null)return!1;const g=this.chart.canvas.getBoundingClientRect(),_=e.tooltipState.width||this.width,x=e.tooltipState.height||this.height,v=g.width/2,S=g.height/2,C=nl(m,_,v);let A=x0(m,x,S);const F=m.y<S?"top":"bottom",P=m.x<v?"left":"center";return x>g.height&&(A=0),{x:C,y:A,xAlign:P,yAlign:F}};const u=f.computed(()=>{const h=Number(e.timeRangeMs.value),m=new Date,g=new Date(m.getTime()-h);return Ip(h)>24||g.getDate()!==m.getDate()}),d=f.computed(()=>({hover:{mode:"index",intersect:!1},elements:{point:{radius:e.pointsWithoutHover?.value?3:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:i.value,...r.value?{[Vu]:r.value}:{}},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},streaming:!1,tooltip:{...l,external:h=>{Wu(e.tooltipState,h,e.granularity.value)}},thresholdPlugin:{threshold:e.threshold?.value}},interaction:{mode:"index",intersect:!1},layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return f.onUnmounted(()=>{qe.positioners[a]&&delete qe.positioners[a]}),{options:d}}const LR=["usd","bytes"],NR="usd";function BR(e){const{i18n:t}=St.useI18n(),{formatUnit:n}=$n({i18n:t}),i=(_,x)=>!x||!LR.includes(x)?_:_===0&&x===NR?t.formatNumber(0,{style:"currency",currency:"USD"}):n(_,x),r=f.computed(()=>{const _=Number(e.timeRangeMs.value),x=new Date,v=new Date(x.getTime()-_);return Ip(_)>24||v.getDate()!==x.getDate()}),s=f.computed(()=>({display:!Tt(e.dimensionAxesTitle?.value),text:e.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}})),a=f.computed(()=>({type:"linear",display:!0,beginAtZero:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{maxRotation:0,maxTicksLimit:7,callback:_=>i(_,e.xMetricUnit?.value)},title:s.value,border:{display:!1}})),l=f.computed(()=>({type:"time",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:_=>H0({tickValue:new Date(_),granularity:e.granularity.value,dayBoundaryCrossed:r.value})},title:s.value,border:{display:!1}})),u=f.computed(()=>({title:{display:!Tt(e.metricAxesTitle?.value),text:e.metricAxesTitle?.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5,callback:_=>i(_,e.metricUnit?.value)},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1}})),d=(_,x,v)=>{const S=v?.timestamp;return S===void 0?"":ns({tickValue:new Date(S),granularity:x})},m=`scatterChartTooltipPosition-${e.tooltipState.chartID}`;qe.positioners[m]=function(_,x){if(!_.length||e.tooltipState.interactionMode==="interactive"||x.x===null||x.y===null)return!1;const v=this.chart.canvas.getBoundingClientRect(),S=e.tooltipState.width||this.width,C=e.tooltipState.height||this.height,A=v.width/2,F=v.height/2,P=nl(x,S,A);let B=x0(x,C,F);const N=x.y<F?"top":"bottom",z=x.x<A?"left":"center";return C>v.height&&(B=0),{x:P,y:B,xAlign:z,yAlign:N}};const g=f.computed(()=>({hover:{mode:"nearest",intersect:!1},interaction:{mode:"nearest",intersect:!1},animation:{duration:250,easing:"linear"},scales:{x:e.xMetric?.value?a.value:l.value,y:u.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},streaming:!1,tooltip:{enabled:!1,position:m,external:_=>{Wu(e.tooltipState,_,e.granularity.value,{...e.xMetric?.value?{contextFormatter:d}:{}})}},outlierBandPlugin:{value:e.outlierValue?.value,color:e.themeColors.value.outlierBand},referenceLinePlugin:{lines:e.referenceLines?.value}},layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return f.onUnmounted(()=>{qe.positioners[m]&&delete qe.positioners[m]}),{options:g}}function FR(e){const{isMultiMetric:t,hasDimensions:n,metricNames:i,barSegmentLabels:r,pivotRecords:s,rowLabels:a,colorPalette:l,seriesDimension:u}=e,{i18n:d}=St.useI18n(),{evaluateFeatureFlag:h}=St.useEvaluateFeatureFlag(),m=h("analytics-color-updates",!1);return t?i.map(g=>({label:d&&d.te(`chartLabels.${g}`)&&d.t(`chartLabels.${g}`)||g,backgroundColor:m?Bs({metric:g}):Yu(i.indexOf(g),Xn),data:a.map((_,x)=>n?s[`${_.id},${g}`]||0:s[`${x},${g}`]||null)})):Array.from(r).flatMap((g,_)=>g?{label:d&&d.te(`chartLabels.${g.name}`)&&d.t(`chartLabels.${g.name}`)||g.name,backgroundColor:m?Bs({dimension:u,dimensionValue:g.id}):qu(_,g.name,g.id==="empty",l??Xn),data:a.map(x=>s[`${x.id},${g.id}`]||null),isSegmentEmpty:g.id==="empty"}:[])}function zR(e,t){const{i18n:n}=St.useI18n();return f.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 m=d&&l||a,g=m[0],_=m.length>1?m[1]:m[0],x=Object.fromEntries(u?r.flatMap(w=>a.map((O,L)=>{const $=w.event[g],q=d?`${$},${O}`:`${L},${O}`,st=w.event[O];return[q,st]})):r.map(w=>{const O=d?`${w.event[g]},${w.event[_]}`:`${g},${_}`,L=w.event[a[0]];return[O,L]})),v=Object.keys(x).reduce((w,O)=>{const[L]=O.split(","),$=x[O];return w[L]?w[L]+=$:w[L]=$,w},{}),S=Object.entries(v).sort(([,w],[,O])=>Number(O)-Number(w)).map(([w])=>w),C=s[g],A=s[_];let F=d&&C&&Object.entries(C).map(([w,O])=>({id:w,name:O.name}))||a.map(w=>({id:w,name:w})),P=d&&A&&Object.entries(A).map(([w,O])=>({id:w,name:O.name}))||a.map(w=>({id:w,name:w}));if(d&&g==="country_code"&&(F=F.map(w=>({...w,name:Nc(w.id)||w.name}))),d&&_==="country_code"&&(P=P.map(w=>({...w,name:Nc(w.id)||w.name}))),g!=="status_code"&&g!=="status_code_grouped"&&(F.sort((w,O)=>S.indexOf(w.id)-S.indexOf(O.id)),P.sort((w,O)=>S.indexOf(w.id)-S.indexOf(O.id))),!F||!P)return{labels:[],datasets:[]};const B=FR({isMultiMetric:u,hasDimensions:d,metricNames:a,dimensionFieldNames:m,barSegmentLabels:P,pivotRecords:x,rowLabels:F,seriesDimension:_,colorPalette:e.colorPalette||Xn}),N=d?F.map(w=>n&&n.te(`chartLabels.${w.name}`)&&n.t(`chartLabels.${w.name}`)||w.name):a.map(w=>n&&n.te(`chartLabels.${w}`)&&n.t(`chartLabels.${w}`)||w),z=F.map(w=>w.id==="empty");return{labels:N,datasets:B,isLabelEmpty:z,isMultiDimension:h}}}catch(r){return console.error(r),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const UR=(e,t,n=1)=>Array(Math.ceil((t-e)/n)).fill(e).map((i,r)=>i+r*n),HR=e=>{if(typeof e=="string"){const t=+e;if(t)return t;try{return Lp(e).getTime()}catch(n){if(n instanceof RangeError)return 0;throw n}}return e},WR=(e,t,n,i,r)=>{const a=Math.max(t-6e4,Math.max(...(r||[]).map(d=>new Date(d.timestamp).valueOf()))),l=Math.floor((e-i)/n)*n+i,u=Math.floor((a-i)/n)*n+i+n;return UR(l,u,n)};function $R(e,t){const{i18n:n}=St.useI18n(),{evaluateFeatureFlag:i}=St.useEvaluateFeatureFlag(),r=i("analytics-color-updates",!1);return f.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const a=t.value.data,{display:l,metric_names:u,metric_units:d,start:h,end:m}=t.value.meta,g=new Date(h).getTime(),_=new Date(m).getTime();if(!u)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const x=l&&Object.keys(l)||u,v=x&&x[0],S=l?.[v],C=!!S&&u.length>1;let A=l&&S&&Object.keys(S).map(w=>({id:w,name:S[w].name}))||u.map(w=>({id:w,name:w}));v==="country_code"&&(A=A.map(w=>({...w,name:Nc(w.id)||w.name})));const F=t.value.meta.granularity_ms;if(typeof F!="number"||isNaN(F)||!isFinite(F)||F===0)return console.error("Invalid step value:",F),{datasets:[],labels:[]};if(!a.length)return{datasets:[],labels:[]};const P=HR(g),B=WR(g,_,F,P,a),N=a?.length?a.reduce((w,O)=>{const L=new Date(O.timestamp).valueOf(),$=O.event;for(const q of u)L in w||(w[L]={}),q in w[L]||(w[L][q]={});for(const q of u)A.forEach(st=>{(S?$[v]===st.id:q===st.id)?(w[L][q]||(w[L][q]={}),w[L][q][st.id]=Math.round(Number($[q])*1e3)/1e3):x.length||(w[L][q]||(w[L][q]={}),w[L][q][st.id]=Math.round(Number($[st.id])*1e3)/1e3)});return w},{}):{},k=[...S||u.length===1?u.flatMap(w=>A.map(O=>[w,O.id,O.name,O.id==="empty"])):A.map(w=>[w.name,w.id,w.name,w.id==="empty"])].map(([w,O,L,$],q)=>{const st=B.map(I=>I in N&&w in N[I]?{x:I,y:N[I][w][O]||0}:{x:I,y:0});let{colorPalette:ct,fill:ht}=e;Tt(ct)&&(ct=Xn);const ut=r?Bs({dimension:v,dimensionValue:O}):qu(q,L,$,ct),vt=j0(L)?n.t(`chartLabels.${L}`):L,at=j0(w)?n.t(`chartLabels.${w}`):w,dt=u.findIndex(I=>I===w),V=e.metricAxisMap?.[w]==="right";return{rawDimension:L,rawMetric:w,label:C?`${vt} — ${at}`:vt,borderColor:ut,backgroundColor:ut,data:st,total:st.reduce((I,{y:W})=>I+Number(W),0),...RP,...C?{borderDash:dt===0?[]:[dt*4,2]}:{},...!C&&V?{borderDash:[4,2]}:{},...V?{yAxisID:Vu}:{},...e.metricAxisMap?{unit:d?.[w]??""}:{},fill:ht,borderWidth:ht?IP:PP,isSegmentEmpty:$}});return v==="status_code"||v==="status_code_grouped"?k.sort((w,O)=>(w.label??"")<(O.label??"")?-1:1):k.sort((w,O)=>Number(w.total)<Number(O.total)?-1:1),{datasets:k}}}catch(a){return console.error(a),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const VR=2,YR=.6,u0=1,qR=2,d0=50,jR=[6,4],GR=[2,3],KR=(e,t)=>{const n=Math.sin(t)*1e4;return(n-Math.floor(n))*e};function XR(e,t){const{i18n:n}=St.useI18n(),{evaluateFeatureFlag:i}=St.useEvaluateFeatureFlag(),r=i("analytics-color-updates",!1),s=(a,l)=>l||(a===d0?n.t("scatter.median"):n.t("scatter.percentile",{value:a}));return f.computed(()=>{try{const a=t.value;if(!a?.points?.length)return{datasets:[]};const{metric:l,dimension:u,display:d,xMetric:h,xMetricUnit:m}=a,g=h?n.te(`chartLabels.${h}`)&&n.t(`chartLabels.${h}`)||h:"",_=e.scatter||{},x=_.jitterMs??0,v=_.pointRadius??VR,S=_.pointOpacity??YR,C=new Map,A=[];a.points.forEach(q=>{const st=q.group??l,ct=C.get(st)||[];let ht,ut;q.x!==void 0?(ht={x:q.x,timestamp:q.timestamp},ut=[{label:g,value:q.x,...m?{unit:m}:{}},...q.extras??[]]):(ht={x:q.timestamp+KR(x,q.timestamp+q.value)},ut=q.extras??[]),ct.push({...ht,y:q.value,...ut.length?{extras:ut}:{}}),C.set(st,ct),A.push(q.value)});const F=_.percentileLines||[],P=[...F.map(q=>q.percentile),..._.outlierPercentile!==void 0?[_.outlierPercentile]:[]],B=P.length?S2(A,P):new Map,N=_.outlierPercentile!==void 0?B.get(_.outlierPercentile):void 0,z=N!==void 0&&Number.isFinite(N),k=Tt(e.colorPalette)?Xn:e.colorPalette,w=e.themeColors?.value??ld(),O=[],L=q=>{const st=q?.y;return z&&Number.isFinite(st)&&st>N};Array.from(C.entries()).forEach(([q,st],ct)=>{const ht=u&&d?.[q]?.name||q,ut=q==="empty",vt=r?Bs({dimension:u,dimensionValue:q}):qu(ct,ht,ut,k),at=ad(vt,S),dt=n.te(`chartLabels.${ht}`)&&n.t(`chartLabels.${ht}`)||ht;O.push({type:"scatter",rawDimension:ht,rawMetric:l,label:dt,borderColor:V=>L(V.raw)?w.outlier:vt,backgroundColor:V=>L(V.raw)?w.outlier:at,pointRadius:V=>L(V.raw)?v+u0:v,pointHoverRadius:V=>(L(V.raw)?v+u0:v)+qR,data:st,pointBorderWidth:0,showLine:!1,isSegmentEmpty:ut})});const $=[];return F.forEach(q=>{const st=B.get(q.percentile);if(st===void 0||!Number.isFinite(st))return;const ct=q.percentile===d0;$.push({percentile:q.percentile,label:s(q.percentile,q.label),value:st,color:q.color||(ct?w.medianLine:w.outlier),borderDash:q.borderDash||(ct?jR:GR)})}),{datasets:O,...z?{outlier:{value:N,label:n.t("scatter.outlier",{label:s(_.outlierPercentile)}),color:w.outlier}}:{},...$.length?{referenceLines:$}:{}}}catch(a){return console.warn(a),{datasets:[]}}})}const ZR=(e,t)=>{f.watch([e,t],(n,i,r)=>{const[s,a]=n;!a||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(a,s),r(()=>{window._AnalyticsChartDataInternal?.delete(a)}))},{immediate:!0})};function QR(){const{i18n:e}=St.useI18n();return{translateUnit:(n,i)=>{const r=i===1,s=`chartUnits.${n}`;return xo(n)?"":e.te(s)?e.t(s,{plural:r?"":"s"}):n}}}const JR="analytics-query-provider",f0=2,Fu="____OTHER____",tP="empty";function eP(){const e=f.inject(JR);return{evaluateFeatureFlag:(n,i)=>typeof e?.evaluateFeatureFlagFn!="function"?i:e.evaluateFeatureFlagFn(n,i)}}function h0(e,t){return f.getCurrentScope()?(f.onScopeDispose(e,t),!0):!1}const p0=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const nP=e=>e!=null,iP=Object.prototype.toString,rP=e=>iP.call(e)==="[object Object]";function Qa(e){return Array.isArray(e)?e:[e]}function sP(e){return f.getCurrentInstance()}function oP(e,t={}){if(!f.isRef(e))return f.toRefs(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const i in e.value)n[i]=f.customRef(()=>({get(){return e.value[i]},set(r){var s;if(!((s=f.toValue(t.replaceRef))!==null&&s!==void 0)||s)if(Array.isArray(e.value)){const a=[...e.value];a[i]=r,e.value=a}else{const a={...e.value,[i]:r};Object.setPrototypeOf(a,Object.getPrototypeOf(e.value)),e.value=a}else e.value[i]=r}}));return n}function aP(e,t=!0,n){sP()?f.onMounted(e,n):t?e():f.nextTick(e)}function lP(e,t,n){return f.watch(e,t,{...n,immediate:!0})}const Ja=p0?window:void 0;function Qr(e){var t;const n=f.toValue(e);return(t=n?.$el)!==null&&t!==void 0?t:n}function yo(...e){const t=(i,r,s,a)=>(i.addEventListener(r,s,a),()=>i.removeEventListener(r,s,a)),n=f.computed(()=>{const i=Qa(f.toValue(e[0])).filter(r=>r!=null);return i.every(r=>typeof r!="string")?i:void 0});return lP(()=>{var i,r;return[(i=(r=n.value)===null||r===void 0?void 0:r.map(s=>Qr(s)))!==null&&i!==void 0?i:[Ja].filter(s=>s!=null),Qa(f.toValue(n.value?e[1]:e[0])),Qa(f.unref(n.value?e[2]:e[1])),f.toValue(n.value?e[3]:e[2])]},([i,r,s,a],l,u)=>{if(!i?.length||!r?.length||!s?.length)return;const d=rP(a)?{...a}:a,h=i.flatMap(m=>r.flatMap(g=>s.map(_=>t(m,g,_,d))));u(()=>{h.forEach(m=>m())})},{flush:"post"})}function cP(){const e=f.shallowRef(!1),t=f.getCurrentInstance();return t&&f.onMounted(()=>{e.value=!0},t),e}function m0(e){const t=cP();return f.computed(()=>(t.value,!!e()))}function uP(e,t,n={}){const{window:i=Ja,...r}=n;let s;const a=m0(()=>i&&"MutationObserver"in i),l=()=>{s&&(s.disconnect(),s=void 0)},u=f.watch(f.computed(()=>{const m=Qa(f.toValue(e)).map(Qr).filter(nP);return new Set(m)}),m=>{l(),a.value&&m.size&&(s=new MutationObserver(t),m.forEach(g=>s.observe(g,r)))},{immediate:!0,flush:"post"}),d=()=>s?.takeRecords(),h=()=>{u(),l()};return h0(h),{isSupported:a,stop:h,takeRecords:d}}const tl={speed:2,margin:30,direction:"both"};function dP(e){e.scrollLeft>e.scrollWidth-e.clientWidth&&(e.scrollLeft=Math.max(0,e.scrollWidth-e.clientWidth)),e.scrollTop>e.scrollHeight-e.clientHeight&&(e.scrollTop=Math.max(0,e.scrollHeight-e.clientHeight))}function fP(e,t={}){var n,i,r,s;const{pointerTypes:a,preventDefault:l,stopPropagation:u,exact:d,onMove:h,onEnd:m,onStart:g,initialValue:_,axis:x="both",draggingElement:v=Ja,containerElement:S,handle:C=e,buttons:A=[0],restrictInView:F,autoScroll:P=!1}=t,B=f.ref((n=f.toValue(_))!==null&&n!==void 0?n:{x:0,y:0}),N=f.ref(),z=V=>a?a.includes(V.pointerType):!0,k=V=>{f.toValue(l)&&V.preventDefault(),f.toValue(u)&&V.stopPropagation()},w=f.toValue(P),O=typeof w=="object"?{speed:(i=f.toValue(w.speed))!==null&&i!==void 0?i:tl.speed,margin:(r=f.toValue(w.margin))!==null&&r!==void 0?r:tl.margin,direction:(s=w.direction)!==null&&s!==void 0?s:tl.direction}:tl,L=V=>typeof V=="number"?[V,V]:[V.x,V.y],$=(V,I,W)=>{const{clientWidth:nt,clientHeight:ot,scrollLeft:X,scrollTop:tt,scrollWidth:rt,scrollHeight:pt}=V,[yt,mt]=L(O.margin),[Et,zt]=L(O.speed);let G=0,it=0;(O.direction==="x"||O.direction==="both")&&(W.x<yt&&X>0?G=-Et:W.x+I.width>nt-yt&&X<rt-nt&&(G=Et)),(O.direction==="y"||O.direction==="both")&&(W.y<mt&&tt>0?it=-zt:W.y+I.height>ot-mt&&tt<pt-ot&&(it=zt)),(G||it)&&V.scrollBy({left:G,top:it,behavior:"auto"})};let q=null;const st=()=>{const V=f.toValue(S);V&&!q&&(q=setInterval(()=>{const I=f.toValue(e).getBoundingClientRect(),{x:W,y:nt}=B.value,ot={x:W-V.scrollLeft,y:nt-V.scrollTop};ot.x>=0&&ot.y>=0&&($(V,I,ot),ot.x+=V.scrollLeft,ot.y+=V.scrollTop,B.value=ot)},1e3/60))},ct=()=>{q&&(clearInterval(q),q=null)},ht=(V,I,W,nt)=>{const[ot,X]=typeof W=="number"?[W,W]:[W.x,W.y],{clientWidth:tt,clientHeight:rt}=I;return V.x<ot||V.x+nt.width>tt-ot||V.y<X||V.y+nt.height>rt-X},ut=()=>{if(f.toValue(t.disabled)||!N.value)return;const V=f.toValue(S);if(!V)return;const I=f.toValue(e).getBoundingClientRect(),{x:W,y:nt}=B.value,ot={x:W-V.scrollLeft,y:nt-V.scrollTop};ht(ot,V,O.margin,I)?st():ct()};f.toValue(P)&&f.watch(B,ut);const vt=V=>{var I;if(!f.toValue(A).includes(V.button)||f.toValue(t.disabled)||!z(V)||f.toValue(d)&&V.target!==f.toValue(e))return;const W=f.toValue(S),nt=W==null||(I=W.getBoundingClientRect)===null||I===void 0?void 0:I.call(W),ot=f.toValue(e).getBoundingClientRect(),X={x:V.clientX-(W?ot.left-nt.left+(P?0:W.scrollLeft):ot.left),y:V.clientY-(W?ot.top-nt.top+(P?0:W.scrollTop):ot.top)};g?.(X,V)!==!1&&(N.value=X,k(V))},at=V=>{if(f.toValue(t.disabled)||!z(V)||!N.value)return;const I=f.toValue(S);I instanceof HTMLElement&&dP(I);const W=f.toValue(e).getBoundingClientRect();let{x:nt,y:ot}=B.value;if((x==="x"||x==="both")&&(nt=V.clientX-N.value.x,I&&(nt=Math.min(Math.max(0,nt),I.scrollWidth-W.width))),(x==="y"||x==="both")&&(ot=V.clientY-N.value.y,I&&(ot=Math.min(Math.max(0,ot),I.scrollHeight-W.height))),f.toValue(P)&&I&&(q===null&&$(I,W,{x:nt,y:ot}),nt+=I.scrollLeft,ot+=I.scrollTop),I&&(F||P)){if(x!=="y"){const X=nt-I.scrollLeft;X<0?nt=I.scrollLeft:X>I.clientWidth-W.width&&(nt=I.clientWidth-W.width+I.scrollLeft)}if(x!=="x"){const X=ot-I.scrollTop;X<0?ot=I.scrollTop:X>I.clientHeight-W.height&&(ot=I.clientHeight-W.height+I.scrollTop)}}B.value={x:nt,y:ot},h?.(B.value,V),k(V)},dt=V=>{f.toValue(t.disabled)||!z(V)||N.value&&(N.value=void 0,P&&ct(),m?.(B.value,V),k(V))};if(p0){const V=()=>{var I;return{capture:(I=t.capture)!==null&&I!==void 0?I:!0,passive:!f.toValue(l)}};yo(C,"pointerdown",vt,V),yo(v,"pointermove",at,V),yo(v,["pointerup","pointercancel"],dt,V)}return{...oP(B),position:B,isDragging:f.computed(()=>!!N.value),style:f.computed(()=>`
|
|
4
|
+
left: ${B.value.x}px;
|
|
5
|
+
top: ${B.value.y}px;
|
|
6
|
+
${P?"text-wrap: nowrap;":""}
|
|
7
|
+
`)}}function hP(e,t,n={}){const{window:i=Ja,...r}=n;let s;const a=m0(()=>i&&"ResizeObserver"in i),l=()=>{s&&(s.disconnect(),s=void 0)},u=f.watch(f.computed(()=>{const h=f.toValue(e);return Array.isArray(h)?h.map(m=>Qr(m)):[Qr(h)]}),h=>{if(l(),a.value&&i){s=new ResizeObserver(t);for(const m of h)m&&s.observe(m,r)}},{immediate:!0,flush:"post"}),d=()=>{l(),u()};return h0(d),{isSupported:a,stop:d}}function pP(e,t={}){const{reset:n=!0,windowResize:i=!0,windowScroll:r=!0,immediate:s=!0,updateTiming:a="sync"}=t,l=f.shallowRef(0),u=f.shallowRef(0),d=f.shallowRef(0),h=f.shallowRef(0),m=f.shallowRef(0),g=f.shallowRef(0),_=f.shallowRef(0),x=f.shallowRef(0);function v(){const C=Qr(e);if(!C){n&&(l.value=0,u.value=0,d.value=0,h.value=0,m.value=0,g.value=0,_.value=0,x.value=0);return}const A=C.getBoundingClientRect();l.value=A.height,u.value=A.bottom,d.value=A.left,h.value=A.right,m.value=A.top,g.value=A.width,_.value=A.x,x.value=A.y}function S(){a==="sync"?v():a==="next-frame"&&requestAnimationFrame(()=>v())}return hP(e,S),f.watch(()=>Qr(e),C=>!C&&S()),uP(e,S,{attributeFilter:["style","class"]}),r&&yo("scroll",S,{capture:!0,passive:!0}),i&&yo("resize",S,{passive:!0}),aP(()=>{s&&S()}),{height:l,bottom:u,left:d,right:h,top:m,width:g,x:_,y:x,update:S}}function mP(e,t){const{top:n,left:i}=pP(e),r=f.computed(()=>e.value?`${parseFloat(t.left)+i.value}px`:t.left),s=f.computed(()=>e.value?`${parseFloat(t.top)+n.value}px`:t.top);return{tooltipAbsoluteLeft:r,tooltipAbsoluteTop:s}}const gP=({bucketCount:e,minStamp:t,maxStamp:n,timestamps:i})=>{const r=[...i].filter(u=>u>=t&&u<=n).sort((u,d)=>u-d),s=[];if(n-t<e-2)return[];const a=(n-t)/e;let l=0;for(let u=0;u<e;u++){const d=t+u*a,h=t+(u+1)*a;let m=0;for(;l<r.length&&r[l]>=d&&r[l]<=h;)m++,l++;s.push([Math.ceil(d),m])}return s},g0=()=>({minCounts:{},maxCounts:{},minStamps:{},maxStamps:{},renderPoints:{}}),_o=f.ref({}),yP=e=>(_o.value[e]||(_o.value[e]=g0()),_o.value[e]),_P=(e,t)=>{const n=_o.value[t];if(!n)return;const i=n.minCounts[e]!==void 0||n.maxCounts[e]!==void 0||n.minStamps[e]!==void 0||n.maxStamps[e]!==void 0||n.renderPoints[e]!==void 0;n&&i&&(delete n.minCounts[e],delete n.maxCounts[e],delete n.minStamps[e],delete n.maxStamps[e],delete n.renderPoints[e],Object.keys(n.minCounts).length||Object.keys(n.maxCounts).length||Object.keys(n.minStamps).length||Object.keys(n.maxStamps).length||Object.keys(n.renderPoints).length||delete _o.value[t])};function bP({chartKey:e,datasets:t,groupKey:n,minStamp:i=void 0,maxStamp:r=void 0,minCount:s=void 0,maxCount:a=void 0,renderPoints:l=void 0,type:u}){const h=n!==void 0&&e!==void 0?yP(n):g0(),m=e!==void 0?e:"static-chart-key",g=f.computed(()=>t.reduce((O,{timestamps:L})=>[...O,...L],[])),_=f.computed(()=>i||g.value.reduce((O,L)=>O===0?L:Math.min(O,L),0)),x=f.computed(()=>r||g.value.reduce((O,L)=>Math.max(O,L),0));f.watchEffect(()=>{h.minStamps[m]=_.value,h.maxStamps[m]=x.value,l!==void 0&&(h.renderPoints[m]=l)});const v=f.computed(()=>Object.values(h.minStamps).reduce((O,L)=>O===0?L:Math.min(O,L),0)),S=f.computed(()=>Object.values(h.maxStamps).reduce((O,L)=>Math.max(O,L),0)),C=f.computed(()=>{const O=Object.values(h.renderPoints);return O.length===0?24:O.reduce((L,$)=>Math.max(L,$),2)}),A=f.computed(()=>{const O=S.value-v.value;return Math.ceil(O/C.value)}),F=f.computed(()=>t.length>1),P=f.computed(()=>t.map(({timestamps:O,color:L,label:$})=>({data:gP({bucketCount:C.value,minStamp:v.value,maxStamp:S.value,timestamps:O}).map(([ct,ht])=>({x:ct,y:ht})),label:$,...(u==="sparkline_bar"||F.value)&&L&&{backgroundColor:L},...u!=="sparkline_bar"&&L&&{borderColor:L},...F.value&&u!=="sparkline_bar"&&{fill:!0}}))),B=f.computed(()=>{const O=P.value[0]?.data?.length??0,L=[];for(let $=0;$<O;$++){let q=0;for(let st=0;st<P.value.length;st++)q+=P.value[st].data[$].y;L.push(q)}return L}),N=f.computed(()=>{const O=B.value.reduce((L,$)=>Math.max(L,$),0);return Math.max(O,a??0)}),z=f.computed(()=>{const O=P.value.reduce((q,{data:st})=>[...q,...st.map(({y:ct})=>ct)],[]),L=O.length?O[0]:0,$=O.reduce((q,st)=>Math.min(q,st),L);return s===void 0?$:Math.min($,s)});f.watchEffect(()=>{h.maxCounts[m]=N.value,h.minCounts[m]=z.value});const k=f.computed(()=>{const O=Object.values(h.minCounts),L=O.length?O[0]:0;return O.reduce(($,q)=>Math.min($,q),L)}),w=f.computed(()=>Object.values(h.maxCounts).reduce((O,L)=>Math.max(O,L),0));return f.onUnmounted(()=>{e!==void 0&&n!==void 0&&_P(e,n)}),{syncedMinStamp:v,syncedMaxStamp:S,syncedRenderPoints:C,syncedChartDatasets:P,syncedGroupSizeMs:A,syncedMinCount:k,syncedMaxCount:w}}const gr=(e,t)=>{if(!e||!t)return;const n=t.toLowerCase();return e[t]??Object.entries(e).find(([i])=>i.toLowerCase()===n)?.[1]},Jr=e=>{if(e==null||e==="")return null;const t=typeof e=="number"?e:Number(e);return Number.isFinite(t)?t:null},zu=e=>e.reduce((t,n)=>n===null?t:{sum:t.sum+n,max:Math.max(t.max,n)},{sum:0,max:0}),Uu=(e,t)=>t.sum>0?e/t.sum:null,y0=(e,t,n)=>{const i=n==="relative"?t.sum:t.max;return i<=0?0:Math.min(Math.max(e/i,0),1)},Hu=(e,t)=>{const n=(t??[]).filter(s=>e>=s.value);if(!n.length)return;const i=Math.max(...n.map(s=>s.value));return n.filter(s=>s.value===i).some(s=>s.type==="error")?"error":"warning"},_0=18,xP=85;function wP(e,t,n,i){const{i18n:r}=Fp(),{formatUnit:s}=$n({i18n:r}),a=N=>N.map(z=>{const k=Math.min(z.ratio,.5)/.5;return{...z,color:Bs({metric:n.value}),tint:`${_0+k*(xP-_0)}%`}}),l=f.computed(()=>e.value?.data??[]),u=f.computed(()=>e.value?.meta?.metric_names??[]),d=f.computed(()=>{const N=n.value;return N&&u.value.includes(N)?N:u.value[0]}),h=f.computed(()=>u.value.filter(N=>N!==d.value)),m=f.computed(()=>e.value?.meta?.display?.[t.value]??{}),g=(N,z)=>{if(xo(N)||N==="count"||N==="requests")return"";const k=z===1?"":"s";return r.te(`chartUnits.${N}`)?r.t(`chartUnits.${N}`,{plural:k}):N},_=N=>N.replace(/\s+%/,"%").trim(),x=N=>{const z=k=>_(s(k,"%",{translateUnit:w=>g(w,k)}));return N>0&&N<.01?`< ${z(.01)}`:z(N)},v=(N,z)=>{if(N===null)return"–";const k=e.value?.meta?.metric_units?.[z]||"count";return k==="%"?x(N):_(s(N,k,{isBytes1024:!0,translateUnit:w=>g(w,N)}))},S=N=>r.te(`chartLabels.${N}`)?r.t(`chartLabels.${N}`):N,C=N=>gr(i.value,N)?.label||S(N),A=f.computed(()=>zu(l.value.map(N=>d.value?Jr(N.event[d.value]):null))),F=N=>h.value.flatMap(z=>{const k=Jr(N[z]);if(k===null)return[];const w=Hu(k,gr(i.value,z)?.thresholds);return[{key:z,label:C(z),value:v(k,z),threshold:w}]}),P=f.computed(()=>{if(!d.value)return[];const N=l.value.map(z=>{const k=z.event,w=String(k[t.value]),O=Jr(k[d.value])??0,L=Uu(O,A.value),$=L??0,q=w===Fu;return{id:w,name:q?S(Fu):m.value[w]?.name||w,deleted:!!m.value[w]?.deleted,isOther:q,isEmpty:w===tP,value:O,ratio:$,display:v(O,d.value),relative:L===null?"":x(L*100),tooltipRows:F(k)}}).sort((z,k)=>Number(z.isOther)-Number(k.isOther)||k.value-z.value);return a(N)});return{column:f.computed(()=>({dimension:t.value,label:C(t.value),total:v(A.value.sum,d.value??"count"),cells:P.value})),cells:P,sizeKey:d}}const St={useBarChartOptions:DR,useChartJSCommon:OR,useChartLegendValues:ER,useChartSelectedRange:RR,useExploreResultToDatasets:zR,useExploreResultToTimeDataset:$R,useScatterDatasets:XR,useDonutChartOptions:PR,useLineChartOptions:IR,useScatterChartOptions:BR,useI18n:Fp,useReportChartDataForSynthetics:ZR,useTranslatedUnits:QR,useEvaluateFeatureFlag:eP,useTooltipAbsolutePosition:mP,useSparklineSync:bP,useTopTalkersData:wP},el=e=>["interactive","zoom-interactive"].includes(e),Wu=(e,t,n,i)=>{const{tooltip:r}=t;if(r.opacity===0&&!el(e.interactionMode)){e.showTooltip=!1;return}const{i18n:s}=St.useI18n(),{formatUnit:a}=$n({i18n:s}),l=e.chartTooltipSortFn||((u,d)=>d.rawValue-u.rawValue);if(r.body&&!el(e.interactionMode)){const u=r.labelColors,d=t.chart.config?.options?.indexAxis==="y"?"x":"y",h=r.dataPoints[0].parsed.x??0;e.tooltipContext=i?.contextFormatter?i.contextFormatter(h,n,r.dataPoints[0].raw):ns({tickValue:new Date(h),granularity:n}),e.tooltipSeries=r.dataPoints.map((g,_)=>{const x=g.parsed[d],v=g.dataset.unit??e.units,S=a(x??0,v,{translateUnit:e.translateUnit}),C=g.raw?.tooltipLabel||g.dataset.label;return{backgroundColor:u[_].backgroundColor,borderColor:u[_].borderColor,label:C,value:S,rawValue:x,isSegmentEmpty:g.dataset.isSegmentEmpty}}).sort(l);const m=r.dataPoints[0]?.raw?.extras??[];for(const g of m)e.tooltipSeries.push({label:g.label,value:g.unit?a(Number(g.value)||0,g.unit,{translateUnit:e.translateUnit}):String(g.value),rawValue:Number(g.value)||0,isExtra:!0});e.left=`${r.x}px`,e.top=`${r.y}px`,e.showTooltip=!0}},b0=(e,t)=>{const{tooltip:n}=t,{i18n:i}=St.useI18n(),{formatUnit:r}=$n({i18n:i});if(n.opacity===0&&!el(e.interactionMode)){e.showTooltip=!1;return}const s=e.chartTooltipSortFn||((a,l)=>l.rawValue-a.rawValue);if(n.body&&!el(e.interactionMode)){const a=n.labelColors,l=t.chart.config?.options?.indexAxis==="y"?"x":"y",u=["gauge","donut"].includes(e.chartType);u?e.tooltipContext=e.dimensionDisplay||n.dataPoints[0].label:n.chart.data.isMultiDimension?e.tooltipContext=n.dataPoints[0].label:e.tooltipContext=e.dimensionDisplay||"",e.tooltipSeries=n.dataPoints.map((d,h)=>{const m=u?d.parsed:d.parsed[l],g=r(m??0,e.units,{translateUnit:e.translateUnit});let _;return u?_=d.dataset.labels[d.dataIndex]:_=d.dataset.label,{backgroundColor:a[h].backgroundColor,borderColor:a[h].borderColor,label:_,value:g,rawValue:m,isSegmentEmpty:d.dataset.isSegmentEmpty}}).sort(s),e.left=`${n.x}px`,e.top=`${n.y}px`,e.showTooltip=!0}},vP=e=>e&&e.datasets&&e.datasets.length,SP=e=>vP(e)&&e.datasets.some(t=>t.data.length),TP=e=>e.datasets.some(t=>t.data[0]&&Hc(t.data[0].x)),kP=e=>!!SP(e)&&e.datasets.some(t=>t.data.length==1),MP=e=>TP(e)&&e.datasets.some(t=>t.data[0]&&(t.data[0].x??0).toString().length>=13),nl=(e,t,n)=>{const r=Math.min(t/1150,1),s=.15,a=1.15,l=e.x??0;return l<n?l+t*s*(1-r):l-t*a*(1-r)},x0=(e,t,n)=>{const s=e.y??0;return s<n?s+t*.15:s-t*.5};function w0(e,t){let n;return(...i)=>{clearTimeout(n),n=window.setTimeout(()=>{e(...i)},t)}}const $u=(e,t,n)=>{const i=e.data;return e.options.plugins.legend.labels.generateLabels(e).filter(r=>!t?.[r.text]?.isThreshold).map(((r,s)=>({...r,value:t&&t[r.text],isSegmentEmpty:i.datasets[s].isSegmentEmpty}))).sort(n)},DP=2,v0=10,S0=12,il=10,rl="y",Vu="y1",Xn=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Yu=(e,t)=>(t||Xn)[e%Xn.length],CP="#6f7787",OP={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"}},AP=e=>{const t=Math.floor(parseInt(e,10)/100)*100;return OP[t]?.background||"#fafafa"},EP=lS,qu=(e,t,n,i)=>{let r;return n?r=EP:Array.isArray(i)?r=Yu(e,i):r=i[t],r||Yu(e)},ju=e=>{switch(e){case"error":return cS;case"warning":return hS;case"neutral":return op;default:return op}},RP={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},PP=2,IP=0,Gu=new Map,T0=(e,t)=>{const{i18n:n}=St.useI18n(),{formatBytes:i}=$n({i18n:n});return t==="bytes"?i(e):t==="count/minute"?e.toFixed(2):pa.format(e)},LP=e=>{const n=document.createElement("canvas").getContext("2d"),i=ce({});return n.font=i.string,n.measureText(e).width},NP=()=>{const e="label_height";if(!Gu.has(e)){const t=ce({});Gu.set(e,t.lineHeight)}return Gu.get(e)},BP=(e,t)=>t.datasets.reduce((n,i,r)=>e.isDatasetVisible(r)?n+i.data.reduce((s,a)=>isNaN(a)?s:s+a,0):n,0),FP=(e,t)=>t===0?" (0.0%)":` (${(e/t*100).toFixed(1)}%)`,zP=aS,UP={100:gS,101:yS,102:_S,103:bS,200:xS,201:wS,202:vS,203:SS,204:TS,205:kS,206:MS,207:DS,208:CS,226:OS,300:AS,301:ES,302:RS,303:PS,304:IS,305:LS,307:NS,308:BS,400:FS,401:zS,402:US,403:HS,404:WS,405:$S,406:VS,407:YS,408:qS,409:jS,410:GS,411:KS,412:XS,413:ZS,414:QS,415:JS,416:tT,417:eT,418:nT,421:iT,422:rT,423:sT,424:oT,425:aT,426:lT,428:cT,429:uT,431:dT,451:fT,500:hT,501:pT,502:mT,503:gT,504:yT,505:_T,506:bT,507:xT,508:wT,510:vT,511:ST},HP={100:TT,200:kT,300:MT,400:DT,500:CT},WP={"1XX":OT,"2XX":AT,"3XX":ET,"4XX":RT,"5XX":PT},k0=e=>{const t=parseInt(e,10),n=Math.floor(t/100)*100;return UP[t]??HP[n]??zP},Ku={...Array.from({length:500},(e,t)=>100+t).reduce((e,t)=>(e[`${t}`]=k0(`${t}`),e),{}),____OTHER____:oS,...WP};function M0(e,t,n){const i=Op(),r=YP(e,n.timeZone,n.locale??i.locale);return"formatToParts"in r?$P(r,t):VP(r,t)}function $P(e,t){const n=e.formatToParts(t);for(let i=n.length-1;i>=0;--i)if(n[i].type==="timeZoneName")return n[i].value}function VP(e,t){const n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}function YP(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function qP(e,t){const n=ZP(t);return"formatToParts"in n?GP(n,e):KP(n,e)}const jP={year:0,month:1,day:2,hour:3,minute:4,second:5};function GP(e,t){try{const n=e.formatToParts(t),i=[];for(let r=0;r<n.length;r++){const s=jP[n[r].type];s!==void 0&&(i[s]=parseInt(n[r].value,10))}return i}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function KP(e,t){const n=e.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);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 Xu={},D0=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")),XP=D0==="06/25/2014, 00:00:00"||D0==="06/25/2014 00:00:00";function ZP(e){return Xu[e]||(Xu[e]=XP?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Xu[e]}function C0(e,t,n,i,r,s,a){const l=new Date(0);return l.setUTCFullYear(e,t,n),l.setUTCHours(i,r,s,a),l}const O0=36e5,QP=6e4,Zu={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Qu(e,t,n){if(!e)return 0;let i=Zu.timezoneZ.exec(e);if(i)return 0;let r,s;if(i=Zu.timezoneHH.exec(e),i)return r=parseInt(i[1],10),A0(r)?-(r*O0):NaN;if(i=Zu.timezoneHHMM.exec(e),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return A0(r,a)?(s=Math.abs(r)*O0+a*QP,i[1]==="+"?-s:s):NaN}if(e2(e)){t=new Date(t||Date.now());const a=n?t:JP(t),l=Ju(a,e);return-(n?l:t2(t,l,e))}return NaN}function JP(e){return C0(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function Ju(e,t){const n=qP(e,t),i=C0(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let r=e.getTime();const s=r%1e3;return r-=s>=0?s:1e3+s,i-r}function t2(e,t,n){let r=e.getTime()-t;const s=Ju(new Date(r),n);if(t===s)return t;r-=s-t;const a=Ju(new Date(r),n);return s===a?s:Math.max(s,a)}function A0(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const E0={};function e2(e){if(E0[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),E0[e]=!0,!0}catch{return!1}}const n2=60*1e3,i2={X:function(e,t,n){const i=td(n.timeZone,e);if(i===0)return"Z";switch(t){case"X":return R0(i);case"XXXX":case"XX":return ts(i);default:return ts(i,":")}},x:function(e,t,n){const i=td(n.timeZone,e);switch(t){case"x":return R0(i);case"xxxx":case"xx":return ts(i);default:return ts(i,":")}},O:function(e,t,n){const i=td(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+r2(i,":");default:return"GMT"+ts(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return M0("short",e,n);default:return M0("long",e,n)}}};function td(e,t){const n=e?Qu(e,t,!0)/n2:t?.getTimezoneOffset()??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function sl(e,t){const n=e<0?"-":"";let i=Math.abs(e).toString();for(;i.length<t;)i="0"+i;return n+i}function ts(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=sl(Math.floor(i/60),2),s=sl(Math.floor(i%60),2);return n+r+t+s}function R0(e,t){return e%60===0?(e>0?"-":"+")+sl(Math.abs(e)/60,2):ts(e,t)}function r2(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Math.floor(i/60),s=i%60;return s===0?n+String(r):n+String(r)+t+sl(s,2)}function P0(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const s2=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,ed=36e5,I0=6e4,o2=2,Qe={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:s2};function L0(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const n=t.additionalDigits==null?o2:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const i=a2(e),{year:r,restDateString:s}=l2(i.date,n),a=c2(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=u2(i.time),u===null||isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(d=Qu(i.timeZone||t.timeZone,new Date(l+u)),isNaN(d))return new Date(NaN)}else d=P0(new Date(l+u)),d=P0(new Date(l+u+d));return new Date(l+u+d)}else return new Date(NaN)}function a2(e){const t={};let n=Qe.dateTimePattern.exec(e),i;if(n?(t.date=n[1],i=n[3]):(n=Qe.datePattern.exec(e),n?(t.date=n[1],i=n[2]):(t.date=null,i=e)),i){const r=Qe.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function l2(e,t){if(e){const n=Qe.YYY[t],i=Qe.YYYYY[t];let r=Qe.YYYY.exec(e)||i.exec(e);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:e.slice(s.length)}}if(r=Qe.YY.exec(e)||n.exec(e),r){const s=r[1];return{year:parseInt(s,10)*100,restDateString:e.slice(s.length)}}}return{year:null}}function c2(e,t){if(t===null)return null;let n,i,r;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let s=Qe.MM.exec(e);if(s)return n=new Date(0),i=parseInt(s[1],10)-1,F0(t,i)?(n.setUTCFullYear(t,i),n):new Date(NaN);if(s=Qe.DDD.exec(e),s){n=new Date(0);const a=parseInt(s[1],10);return h2(t,a)?(n.setUTCFullYear(t,0,a),n):new Date(NaN)}if(s=Qe.MMDD.exec(e),s){n=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return F0(t,i,a)?(n.setUTCFullYear(t,i,a),n):new Date(NaN)}if(s=Qe.Www.exec(e),s)return r=parseInt(s[1],10)-1,z0(r)?N0(t,r):new Date(NaN);if(s=Qe.WwwD.exec(e),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return z0(r,a)?N0(t,r,a):new Date(NaN)}return null}function u2(e){let t,n,i=Qe.HH.exec(e);if(i)return t=parseFloat(i[1].replace(",",".")),nd(t)?t%24*ed:NaN;if(i=Qe.HHMM.exec(e),i)return t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),nd(t,n)?t%24*ed+n*I0:NaN;if(i=Qe.HHMMSS.exec(e),i){t=parseInt(i[1],10),n=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return nd(t,n,r)?t%24*ed+n*I0+r*1e3:NaN}return null}function N0(e,t,n){t=t||0,n=n||0;const i=new Date(0);i.setUTCFullYear(e,0,4);const r=i.getUTCDay()||7,s=t*7+n+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const d2=[31,28,31,30,31,30,31,31,30,31,30,31],f2=[31,29,31,30,31,30,31,31,30,31,30,31];function B0(e){return e%400===0||e%4===0&&e%100!==0}function F0(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const i=B0(e);if(i&&n>f2[t]||!i&&n>d2[t])return!1}return!0}function h2(e,t){if(t<1)return!1;const n=B0(e);return!(n&&t>366||!n&&t>365)}function z0(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function nd(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const p2=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function id(e,t,n={}){t=String(t);const i=t.match(p2);if(i){const r=L0(n.originalDate||e,n);t=i.reduce(function(s,a){if(a[0]==="'")return s;const l=s.indexOf(a),u=s[l-1]==="'",d=s.replace(a,"'"+i2[a[0]](r,a,n)+"'");return u?d.substring(0,l-1)+d.substring(l+1):d},t)}return ya(e,t,n)}function m2(e,t,n){e=L0(e,n);const i=Qu(t,e,!0),r=new Date(e.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 bo(e,t,n,i){return i={...i,timeZone:t,originalDate:e},id(m2(e,t,{timeZone:i.timeZone}),n,i)}const g2=(e,t)=>`${bo(e,t,"yyyy")} W${bo(e,t,"II")}`,rd="yyyy-MM-dd h:mm:ss a",sd="h:mm:ss a",yr="yyyy-MM-dd h:mm a",es="h:mm a",y2="yyyy-MM-dd",od="MMM dd, yyyy h:mm:ss a",Bi="MMM dd, yyyy h:mm a",_2={secondly:e=>e?rd:sd,tenSecondly:e=>e?rd:sd,thirtySecondly:e=>e?rd:sd,minutely:e=>e?yr:es,fiveMinutely:e=>e?yr:es,tenMinutely:e=>e?yr:es,thirtyMinutely:e=>e?yr:es,hourly:e=>e?yr:es,twoHourly:e=>e?yr:es,twelveHourly:()=>yr,daily:()=>y2},b2={secondly:()=>od,tenSecondly:()=>od,thirtySecondly:()=>od,minutely:()=>Bi,fiveMinutely:()=>Bi,tenMinutely:()=>Bi,thirtyMinutely:()=>Bi,hourly:()=>Bi,twoHourly:()=>Bi,twelveHourly:()=>Bi,daily:()=>Bi};function U0({tickValue:e,granularity:t,timezone:n,dayBoundaryCrossed:i=!1,tickMap:r,tooltipMap:s,defaultFormat:a}){const l=n||Intl.DateTimeFormat().resolvedOptions().timeZone;if(t==="weekly")return g2(e,l);if(r&&r[t]){const u=r[t](i);return bo(e,l,u)}if(s&&s[t]){const u=s[t]();return bo(e,l,u)}return bo(e,l,a)}const H0=({tickValue:e,granularity:t,dayBoundaryCrossed:n,timezone:i})=>U0({tickValue:e,granularity:t,timezone:i,dayBoundaryCrossed:n,tickMap:_2,defaultFormat:"yyyy-MM-dd h:mm:ss a"}),ns=({tickValue:e,granularity:t,timezone:n})=>U0({tickValue:e,granularity:t,timezone:n,tooltipMap:b2,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),W0=e=>e?.code==="ERR_CANCELED"||e?.name==="CanceledError"||e?.name==="AbortError",x2=e=>{const{i18n:t}=St.useI18n();return W0(e)?{type:"canceled",message:t.t("query_errors.canceled.message")}:e?.status===403?{status:e.status,type:"forbidden",message:t.t("query_errors.forbidden.message"),details:t.t("query_errors.forbidden.details")}:e?.status===408||e?.message?.includes("timeout")?{status:e.status,type:"timeout",message:t.t("query_errors.timeout.message"),details:t.t("query_errors.timeout.details")}:e?.response?.data?.message==="Range not allowed for this tier"?{status:e.status,type:"range_exceeded",message:t.t("query_errors.time_range_exceeded.message"),details:t.t("query_errors.time_range_exceeded.details")}:{status:e.status,type:"other",message:t.t("query_errors.other.message"),details:e.response?.data?.invalid_parameters?.map(n=>n.reason).join(", ")||e?.message}},xo=e=>e.toLocaleLowerCase().endsWith("count"),w2=e=>{const t=e.toLocaleLowerCase();return["sum","count","cost","tokens"].some(n=>t.endsWith(n))},v2=(e,t)=>{if(!e.length)return NaN;const i=Math.min(100,Math.max(0,t))/100*(e.length-1),r=Math.floor(i),s=Math.ceil(i);return r===s?e[r]:e[r]+(e[s]-e[r])*(i-r)},S2=(e,t)=>{const n=e.filter(i=>Number.isFinite(i)).sort((i,r)=>i-r);return new Map(t.map(i=>[i,v2(n,i)]))},$0=.7,ad=(e,t)=>{const n=Aa(e.trim());return n.valid?n.alpha(t).rgbString():e},ld=e=>{const t=e??(typeof document>"u"?null:document.documentElement);if(typeof window>"u"||!t)return{medianLine:ap,outlier:rp,outlierBand:ad(sp,$0)};const n=window.getComputedStyle(t),i=(r,s)=>n.getPropertyValue(r).trim()||s;return{medianLine:i("--kui-color-text",ap),outlier:i("--kui-color-background-danger",rp),outlierBand:ad(i("--kui-color-background-danger-weakest",sp),$0)}},T2="empty",V0=e=>{if(!e||!("meta"in e)||!("data"in e))return;const{display:t,metric_names:n,metric_units:i,start:r,end:s,truncated:a,limit:l,datasource:u}=e.meta;if(!n?.length){console.error("Cannot build scatter chart data from this explore result. Missing metric names.");return}const d=n.length>1?n[0]:void 0,h=d?n[1]:n[0],m=t&&Object.keys(t)[0]||void 0,g=e.data??[],_=[];for(const x of g){const v=q0(x.timestamp,x.event[h],m?x.event[m]:void 0);if(v){if(d){const S=Y0(x.event[d]);if(S===void 0)continue;v.x=S}_.push(v)}}return{points:_,metric:h,metricUnit:i?.[h],...d?{xMetric:d,xMetricUnit:i?.[d]}:{},dimension:m,display:m?t?.[m]:void 0,start:r,end:s,truncated:a,limit:l,datasource:u}},Y0=e=>{if(e==null||e==="")return;const t=Number(e);return Number.isFinite(t)?t:void 0},q0=(e,t,n,i)=>{const r=new Date(e).valueOf(),s=Y0(t);if(!Number.isFinite(r)||s===void 0)return;const a=i?.length?{extras:i}:{};return n===void 0?{timestamp:r,value:s,...a}:{timestamp:r,value:s,group:n!==null&&n!==""?String(n):T2,...a}},k2=(e,t,n)=>{if(!n?.length)return;const i=[];for(const{field:r,label:s,unit:a}of n){const l=_r(e,r)??_r(t,r);l==null||l===""||i.push({label:s??r,value:l,...a?{unit:a}:{}})}return i.length?i:void 0},M2=(e,t)=>{if(!e||!("meta"in e))return;const{metric:n,dimension:i,unroll:r,display:s,extraFields:a,metricUnit:l}=t,u=t.timestamp??"request_start";if(!n){console.error("Cannot build scatter chart data from these request records. Missing metric.");return}const d=[];for(const h of e.results??[]){const m=_r(h,u);for(const g of D2(h,r)){const _=_r(g,n),x=i?_r(g,i)??_r(h,i):void 0,v=q0(m,_,i?x??null:void 0,k2(g,h,a));v&&d.push(v)}}return{points:d,metric:n,metricUnit:l,dimension:i,display:s,start:e.meta?.time_range?.start,end:e.meta?.time_range?.end,truncated:e.truncated,limit:e.limit,datasource:"requests"}},D2=(e,t)=>{if(!t)return[e];const n=_r(e,t);return Array.isArray(n)?n:[]},_r=(e,t)=>{let n=e;for(const i of t.split(".")){if(n===null||typeof n!="object")return;n=n[i]}return n},j0=e=>Object.hasOwn(Bp.chartLabels,e),C2=["hidden","single","full"];var br=(e=>(e.String="string",e.Number="number",e.Boolean="boolean",e.Object="object",e.Undefined="undefined",e))(br||{});const O2=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar","scatter"],A2=["gauge","top_n","single_value"],cd=e=>e===null||typeof e!="object"||!("points"in e)?!1:Array.isArray(e.points);var Le=(e=>(e.Hidden="hidden",e.Bottom="bottom",e))(Le||{});const G0={modes:{point(e,t){return ol(e,t,{intersect:!0})},nearest(e,t,n){return P2(e,t,n)},x(e,t,n){return ol(e,t,{intersect:n.intersect,axis:"x"})},y(e,t,n){return ol(e,t,{intersect:n.intersect,axis:"y"})}}};function ud(e,t,n){return(G0.modes[n.mode]||G0.modes.nearest)(e,t,n)}function E2(e,t,n){return n!=="x"&&n!=="y"?e.inRange(t.x,t.y,"x",!0)||e.inRange(t.x,t.y,"y",!0):e.inRange(t.x,t.y,n,!0)}function R2(e,t,n){return n==="x"?{x:e.x,y:t.y}:n==="y"?{x:t.x,y:e.y}:t}function ol(e,t,n){return e.filter(i=>n.intersect?i.inRange(t.x,t.y):E2(i,t,n.axis))}function P2(e,t,n){let i=Number.POSITIVE_INFINITY;return ol(e,t,n).reduce((r,s)=>{const a=s.getCenterPoint(),l=R2(t,a,n.axis),u=Yr(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 xr(e,t,n){const i=Math.cos(n),r=Math.sin(n),s=t.x,a=t.y;return{x:s+i*(e.x-s)-r*(e.y-a),y:a+r*(e.x-s)+i*(e.y-a)}}const I2=(e,t)=>t>e||e.length>t.length&&e.slice(0,t.length)===t,wr=.001,al=(e,t,n)=>Math.min(n,Math.max(t,e)),K0=(e,t)=>e.value>=e.start-t&&e.value<=e.end+t;function L2(e,t,n){for(const i of Object.keys(e))e[i]=al(e[i],t,n);return e}function N2(e,t,n,i){return!e||!t||n<=0?!1:Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)<=Math.pow(n+i,2)}function X0(e,{x:t,y:n,x2:i,y2:r},s,{borderWidth:a,hitTolerance:l}){const u=(a+l)/2,d=e.x>=t-u-wr&&e.x<=i+u+wr,h=e.y>=n-u-wr&&e.y<=r+u+wr;return s==="x"?d:(s==="y"||d)&&h}function Z0(e,{rect:t,center:n},i,{rotation:r,borderWidth:s,hitTolerance:a}){const l=xr(e,n,ve(-r));return X0(l,t,i,{borderWidth:s,hitTolerance:a})}function vr(e,t){const{centerX:n,centerY:i}=e.getProps(["centerX","centerY"],t);return{x:n,y:i}}function B2(e,t,n,i=!0){const r=n.split(".");let s=0;for(const a of t.split(".")){const l=r[s++];if(parseInt(a,10)<parseInt(l,10))break;if(I2(l,a)){if(i)throw new Error(`${e} v${n} is not supported. v${t} or newer is required.`);return!1}}return!0}const Q0=e=>typeof e=="string"&&e.endsWith("%"),J0=e=>parseFloat(e)/100,ty=e=>al(J0(e),0,1),wo=(e,t)=>({x:e,y:t,x2:e,y2:t,width:0,height:0}),F2={box:e=>wo(e.centerX,e.centerY),doughnutLabel:e=>wo(e.centerX,e.centerY),ellipse:e=>({centerX:e.centerX,centerY:e.centerX,radius:0,width:0,height:0}),label:e=>wo(e.centerX,e.centerY),line:e=>wo(e.x,e.y),point:e=>({centerX:e.centerX,centerY:e.centerY,radius:0,width:0,height:0}),polygon:e=>wo(e.centerX,e.centerY)};function dd(e,t){return t==="start"?0:t==="end"?e:Q0(t)?ty(t)*e:e/2}function Fi(e,t,n=!0){return typeof t=="number"?t:Q0(t)?(n?ty(t):J0(t))*e:e}function z2(e,t){const{x:n,width:i}=e,r=t.textAlign;return r==="center"?n+i/2:r==="end"||r==="right"?n+i:n}function ey(e,t,{borderWidth:n,position:i,xAdjust:r,yAdjust:s},a){const l=Lt(a),u=t.width+(l?a.width:0)+n,d=t.height+(l?a.height:0)+n,h=fd(i),m=sy(e.x,u,r,h.x),g=sy(e.y,d,s,h.y);return{x:m,y:g,x2:m+u,y2:g+d,width:u,height:d,centerX:m+u/2,centerY:g+d/2}}function fd(e,t="center"){return Lt(e)?{x:Ct(e.x,t),y:Ct(e.y,t)}:(e=Ct(e,t),{x:e,y:e})}const ny=(e,t)=>e&&e.autoFit&&t<1;function iy(e,t){const n=e.font,i=Gt(n)?n:[n];return ny(e,t)?i.map(function(r){const s=ce(r);return s.size=Math.floor(r.size*t),s.lineHeight=r.lineHeight,ce(s)}):i.map(r=>ce(r))}function ry(e){return e&&(rn(e.xValue)||rn(e.yValue))}function sy(e,t,n=0,i){return e-dd(t,i)+n}function is(e,t,n){const i=n.init;if(i){if(i===!0)return ay(t,n)}else return;return U2(e,t,n)}function oy(e,t,n){let i=!1;return t.forEach(r=>{sn(e[r])?(i=!0,n[r]=e[r]):rn(n[r])&&delete n[r]}),i}function ay(e,t){const n=t.type||"line";return F2[n](e)}function U2(e,t,n){const i=Jt(n.init,[{chart:e,properties:t,options:n}]);if(i===!0)return ay(t,n);if(Lt(i))return i}const hd=new Map,H2=e=>isNaN(e)||e<=0,W2=e=>e.reduce(function(t,n){return t+=n.string,t},"");function ll(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function cl(e,{x:t,y:n},i){i&&(e.translate(t,n),e.rotate(ve(i)),e.translate(-t,-n))}function ui(e,t){if(t&&t.borderWidth)return e.lineCap=t.borderCapStyle||"butt",e.setLineDash(t.borderDash),e.lineDashOffset=t.borderDashOffset,e.lineJoin=t.borderJoinStyle||"miter",e.lineWidth=t.borderWidth,e.strokeStyle=t.borderColor,!0}function rs(e,t){e.shadowColor=t.backgroundShadowColor,e.shadowBlur=t.shadowBlur,e.shadowOffsetX=t.shadowOffsetX,e.shadowOffsetY=t.shadowOffsetY}function ul(e,t){const n=t.content;if(ll(n))return{width:Fi(n.width,t.width),height:Fi(n.height,t.height)};const i=iy(t),r=t.textStrokeWidth,s=Gt(n)?n:[n],a=s.join()+W2(i)+r+(e._measureText?"-spriting":"");return hd.has(a)||hd.set(a,q2(e,s,i,r)),hd.get(a)}function ly(e,t,n){const{x:i,y:r,width:s,height:a}=t;e.save(),rs(e,n);const l=ui(e,n);e.fillStyle=n.backgroundColor,e.beginPath(),qr(e,{x:i,y:r,w:s,h:a,radius:L2(Ei(n.borderRadius),0,Math.min(s,a)/2)}),e.closePath(),e.fill(),l&&(e.shadowColor=n.borderShadowColor,e.stroke()),e.restore()}function cy(e,t,n,i){const r=n.content;if(ll(r)){e.save(),e.globalAlpha=K2(n.opacity,r.style.opacity),e.drawImage(r,t.x,t.y,t.width,t.height),e.restore();return}const s=Gt(r)?r:[r],a=iy(n,i),l=n.color,u=Gt(l)?l:[l],d=z2(t,n),h=t.y+n.textStrokeWidth/2;e.save(),e.textBaseline="middle",e.textAlign=n.textAlign,$2(e,n)&&j2(e,{x:d,y:h},s,a),G2(e,{x:d,y:h},s,{fonts:a,colors:u}),e.restore()}function $2(e,t){if(t.textStrokeWidth>0)return e.lineJoin="round",e.miterLimit=2,e.lineWidth=t.textStrokeWidth,e.strokeStyle=t.textStrokeColor,!0}function V2(e,t,n,i){const{radius:r,options:s}=t,a=s.pointStyle,l=s.rotation;let u=(l||0)*nu;if(ll(a)){e.save(),e.translate(n,i),e.rotate(u),e.drawImage(a,-a.width/2,-a.height/2,a.width,a.height),e.restore();return}H2(r)||Y2(e,{x:n,y:i,radius:r,rotation:l,style:a,rad:u})}function Y2(e,{x:t,y:n,radius:i,rotation:r,style:s,rad:a}){let l,u,d,h;switch(e.beginPath(),s){default:e.arc(t,n,i,0,ee),e.closePath();break;case"triangle":e.moveTo(t+Math.sin(a)*i,n-Math.cos(a)*i),a+=Ma,e.lineTo(t+Math.sin(a)*i,n-Math.cos(a)*i),a+=Ma,e.lineTo(t+Math.sin(a)*i,n-Math.cos(a)*i),e.closePath();break;case"rectRounded":h=i*.516,d=i-h,l=Math.cos(a+Dn)*d,u=Math.sin(a+Dn)*d,e.arc(t-l,n-u,h,a-Rt,a-se),e.arc(t+u,n-l,h,a-se,a),e.arc(t+l,n+u,h,a,a+se),e.arc(t-u,n+l,h,a+se,a+Rt),e.closePath();break;case"rect":if(!r){d=Math.SQRT1_2*i,e.rect(t-d,n-d,2*d,2*d);break}a+=Dn;case"rectRot":l=Math.cos(a)*i,u=Math.sin(a)*i,e.moveTo(t-l,n-u),e.lineTo(t+u,n-l),e.lineTo(t+l,n+u),e.lineTo(t-u,n+l),e.closePath();break;case"crossRot":a+=Dn;case"cross":l=Math.cos(a)*i,u=Math.sin(a)*i,e.moveTo(t-l,n-u),e.lineTo(t+l,n+u),e.moveTo(t+u,n-l),e.lineTo(t-u,n+l);break;case"star":l=Math.cos(a)*i,u=Math.sin(a)*i,e.moveTo(t-l,n-u),e.lineTo(t+l,n+u),e.moveTo(t+u,n-l),e.lineTo(t-u,n+l),a+=Dn,l=Math.cos(a)*i,u=Math.sin(a)*i,e.moveTo(t-l,n-u),e.lineTo(t+l,n+u),e.moveTo(t+u,n-l),e.lineTo(t-u,n+l);break;case"line":l=Math.cos(a)*i,u=Math.sin(a)*i,e.moveTo(t-l,n-u),e.lineTo(t+l,n+u);break;case"dash":e.moveTo(t,n),e.lineTo(t+Math.cos(a)*i,n+Math.sin(a)*i);break}e.fill()}function q2(e,t,n,i){e.save();const r=t.length;let s=0,a=i;for(let l=0;l<r;l++){const u=n[Math.min(l,n.length-1)];e.font=u.string;const d=t[l];s=Math.max(s,e.measureText(d).width+i),a+=u.lineHeight}return e.restore(),{width:s,height:a}}function j2(e,{x:t,y:n},i,r){e.beginPath();let s=0;i.forEach(function(a,l){const u=r[Math.min(l,r.length-1)],d=u.lineHeight;e.font=u.string,e.strokeText(a,t,n+d/2+s),s+=d}),e.stroke()}function G2(e,{x:t,y:n},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)],m=h.lineHeight;e.beginPath(),e.font=h.string,e.fillStyle=d,e.fillText(l,t,n+m/2+a),a+=m,e.fill()})}function K2(e,t){const n=Ai(e)?e:t;return Ai(n)?al(n,0,1):1}const uy=["left","bottom","top","right"];function X2(e,t){const{pointX:n,pointY:i,options:r}=t,s=r.callout,a=s&&s.display&&eI(t,s);if(!a||iI(t,s,a))return;if(e.save(),e.beginPath(),!ui(e,s))return e.restore();const{separatorStart:u,separatorEnd:d}=Z2(t,a),{sideStart:h,sideEnd:m}=J2(t,a,u);(s.margin>0||r.borderWidth===0)&&(e.moveTo(u.x,u.y),e.lineTo(d.x,d.y)),e.moveTo(h.x,h.y),e.lineTo(m.x,m.y);const g=xr({x:n,y:i},t.getCenterPoint(),ve(-t.rotation));e.lineTo(g.x,g.y),e.stroke(),e.restore()}function Z2(e,t){const{x:n,y:i,x2:r,y2:s}=e,a=Q2(e,t);let l,u;return t==="left"||t==="right"?(l={x:n+a,y:i},u={x:l.x,y:s}):(l={x:n,y:i+a},u={x:r,y:l.y}),{separatorStart:l,separatorEnd:u}}function Q2(e,t){const{width:n,height:i,options:r}=e,s=r.callout.margin+r.borderWidth/2;return t==="right"?n+s:t==="bottom"?i+s:-s}function J2(e,t,n){const{y:i,width:r,height:s,options:a}=e,l=a.callout.start,u=tI(t,a.callout);let d,h;return t==="left"||t==="right"?(d={x:n.x,y:i+Fi(s,l)},h={x:d.x+u,y:d.y}):(d={x:n.x+Fi(r,l),y:n.y},h={x:d.x,y:d.y+u}),{sideStart:d,sideEnd:h}}function tI(e,t){const n=t.side;return e==="left"||e==="top"?-n:n}function eI(e,t){const n=t.position;return uy.includes(n)?n:nI(e,t)}function nI(e,t){const{x:n,y:i,x2:r,y2:s,width:a,height:l,pointX:u,pointY:d,centerX:h,centerY:m,rotation:g}=e,_={x:h,y:m},x=t.start,v=Fi(a,x),S=Fi(l,x),C=[n,n+v,n+v,r],A=[i+S,s,i,s],F=[];for(let P=0;P<4;P++){const B=xr({x:C[P],y:A[P]},_,ve(g));F.push({position:uy[P],distance:Yr(B,{x:u,y:d})})}return F.sort((P,B)=>P.distance-B.distance)[0].position}function iI(e,t,n){const{pointX:i,pointY:r}=e,s=t.margin;let a=i,l=r;return n==="left"?a+=s:n==="right"?a-=s:n==="top"?l+=s:n==="bottom"&&(l-=s),e.inRange(a,l)}const dy={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 ss(e,t,n){return t=typeof t=="number"?t:e.parse(t),le(t)?e.getPixelForValue(t):n}function Sr(e,t,n){const i=t[n];if(i||n==="scaleID")return i;const r=n.charAt(0),s=Object.values(e).filter(a=>a.axis&&a.axis===r);return s.length?s[0].id:r}function fy(e,t){if(e){const n=e.options.reverse,i=ss(e,t.min,n?t.end:t.start),r=ss(e,t.max,n?t.start:t.end);return{start:i,end:r}}}function hy(e,t){const{chartArea:n,scales:i}=e,r=i[Sr(i,t,"xScaleID")],s=i[Sr(i,t,"yScaleID")];let a=n.width/2,l=n.height/2;return r&&(a=ss(r,t.xValue,r.left+r.width/2)),s&&(l=ss(s,t.yValue,s.top+s.height/2)),{x:a,y:l}}function pd(e,t){const n=e.scales,i=n[Sr(n,t,"xScaleID")],r=n[Sr(n,t,"yScaleID")];if(!i&&!r)return{};let{left:s,right:a}=i||e.chartArea,{top:l,bottom:u}=r||e.chartArea;const d=gy(i,{min:t.xMin,max:t.xMax,start:s,end:a});s=d.start,a=d.end;const h=gy(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 py(e,t){if(!ry(t)){const n=pd(e,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(n.width,n.height)/2,t.radius=i);const r=i*2,s=n.centerX+t.xAdjust,a=n.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 sI(e,t)}function rI(e,t){const{scales:n,chartArea:i}=e,r=n[t.scaleID],s={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return r?oI(r,s,t):aI(n,s,t),s}function my(e,t){const n=pd(e,t);return n.initProperties=is(e,n,t),n.elements=[{type:"label",optionScope:"label",properties:uI(e,n,t),initProperties:n.initProperties}],n}function sI(e,t){const n=hy(e,t),i=t.radius*2;return{x:n.x-t.radius+t.xAdjust,y:n.y-t.radius+t.yAdjust,x2:n.x+t.radius+t.xAdjust,y2:n.y+t.radius+t.yAdjust,centerX:n.x+t.xAdjust,centerY:n.y+t.yAdjust,radius:t.radius,width:i,height:i}}function gy(e,t){const n=fy(e,t)||t;return{start:Math.min(n.start,n.end),end:Math.max(n.start,n.end)}}function oI(e,t,n){const i=ss(e,n.value,NaN),r=ss(e,n.endValue,i);e.isHorizontal()?(t.x=i,t.x2=r):(t.y=i,t.y2=r)}function aI(e,t,n){for(const i of Object.keys(dy)){const r=e[Sr(e,n,i)];if(r){const{min:s,max:a,start:l,end:u,startProp:d,endProp:h}=dy[i],m=fy(r,{min:n[s],max:n[a],start:r[l],end:r[u]});t[d]=m.start,t[h]=m.end}}}function lI({properties:e,options:t},n,i,r){const{x:s,x2:a,width:l}=e;return yy({start:s,end:a,borderWidth:t.borderWidth},{position:i.x,padding:{start:r.left,end:r.right},adjust:t.label.xAdjust,size:n.width})}function cI({properties:e,options:t},n,i,r){const{y:s,y2:a,height:l}=e;return yy({start:s,end:a,borderWidth:t.borderWidth},{position:i.y,padding:{start:r.top,end:r.bottom},adjust:t.label.yAdjust,size:n.height})}function yy(e,t){const{start:n,end:i,borderWidth:r}=e,{position:s,padding:{start:a,end:l},adjust:u}=t,d=i-r-n-a-l-t.size;return n+r/2+u+dd(d,s)}function uI(e,t,n){const i=n.label;i.backgroundColor="transparent",i.callout.display=!1;const r=fd(i.position),s=Se(i.padding),a=ul(e.ctx,i),l=lI({properties:t,options:n},a,r,s),u=cI({properties:t,options:n},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 md=["enter","leave"],gd=md.concat("click");function dI(e,t,n){t.listened=oy(n,gd,t.listeners),t.moveListened=!1,md.forEach(i=>{sn(n[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&sn(i.click)&&(t.listened=!0),t.moveListened||md.forEach(r=>{sn(i[r])&&(t.listened=!0,t.moveListened=!0)})})}function fI(e,t,n){if(e.listened)switch(t.type){case"mousemove":case"mouseout":return hI(e,t,n);case"click":return pI(e,t,n)}}function hI(e,t,n){if(!e.moveListened)return;let i;t.type==="mousemove"?i=ud(e.visibleElements,t,n.interaction):i=[];const r=e.hovered;e.hovered=i;const s={state:e,event:t};let a=_y(s,"leave",r,i);return _y(s,"enter",i,r)||a}function _y({state:e,event:t},n,i,r){let s;for(const a of i)r.indexOf(a)<0&&(s=by(a.options[n]||e.listeners[n],a,t)||s);return s}function pI(e,t,n){const i=e.listeners,r=ud(e.visibleElements,t,n.interaction);let s;for(const a of r)s=by(a.options.click||i.click,a,t)||s;return s}function by(e,t,n){return Jt(e,[t.$context,n])===!0}const dl=["afterDraw","beforeDraw"];function mI(e,t,n){const i=t.visibleElements;t.hooked=oy(n,dl,t.hooks),t.hooked||i.forEach(r=>{t.hooked||dl.forEach(s=>{sn(r.options[s])&&(t.hooked=!0)})})}function xy(e,t,n){if(e.hooked){const i=t.options[n]||e.hooks[n];return Jt(i,[t.$context])}}function gI(e,t,n){const i=wI(e.scales,t,n);let r=wy(t,i,"min","suggestedMin");r=wy(t,i,"max","suggestedMax")||r,r&&sn(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function yI(e,t){for(const n of e)bI(n,t)}function wy(e,t,n,i){if(le(t[n])&&!_I(e.options,n,i)){const r=e[n]!==t[n];return e[n]=t[n],r}}function _I(e,t,n){return rn(e[t])||rn(e[n])}function bI(e,t){for(const n of["scaleID","xScaleID","yScaleID"]){const i=Sr(t,e,n);i&&!t[i]&&xI(e,n)&&console.warn(`No scale found with id '${i}' for annotation '${e.id}'`)}}function xI(e,t){if(t==="scaleID")return!0;const n=t.charAt(0);for(const i of["Min","Max","Value"])if(rn(e[n+i]))return!0;return!1}function wI(e,t,n){const i=t.axis,r=t.id,s=i+"ScaleID",a={min:Ct(t.min,Number.NEGATIVE_INFINITY),max:Ct(t.max,Number.POSITIVE_INFINITY)};for(const l of n)l.scaleID===r?vy(l,t,["value","endValue"],a):Sr(e,l,s)===r&&vy(l,t,[i+"Min",i+"Max",i+"Value"],a);return a}function vy(e,t,n,i){for(const r of n){const s=e[r];if(rn(s)){const a=t.parse(s);i.min=Math.min(i.min,a),i.max=Math.max(i.max,a)}}}class os extends Ye{inRange(t,n,i,r){const{x:s,y:a}=xr({x:t,y:n},this.getCenterPoint(r),ve(-this.options.rotation));return X0({x:s,y:a},this.getProps(["x","y","x2","y2"],r),i,this.options)}getCenterPoint(t){return vr(this,t)}draw(t){t.save(),cl(t,this.getCenterPoint(),this.options.rotation),ly(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){return my(t,n)}}os.id="boxAnnotation",os.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},os.defaultRoutes={borderColor:"color",backgroundColor:"color"},os.descriptors={label:{_fallback:!0}};class fl extends Ye{inRange(t,n,i,r){return Z0({x:t,y:n},{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 vr(this,t)}draw(t){const n=this.options;!n.display||!n.content||(DI(t,this),t.save(),cl(t,this.getCenterPoint(),this.rotation),cy(t,this,n,this._fitRatio),t.restore())}resolveElementProperties(t,n){const i=vI(t,n);if(!i)return{};const{controllerMeta:r,point:s,radius:a}=TI(t,n,i);let l=ul(t.ctx,n);const u=kI(l,a);ny(n,u)&&(l={width:l.width*u,height:l.height*u});const{position:d,xAdjust:h,yAdjust:m}=n,g=ey(s,l,{borderWidth:0,position:d,xAdjust:h,yAdjust:m});return{initProperties:is(t,g,n),...g,...r,rotation:n.rotation,_fitRatio:u}}}fl.id="doughnutLabelAnnotation",fl.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},fl.defaultRoutes={};function vI(e,t){return e.getSortedVisibleDatasetMetas().reduce(function(n,i){const r=i.controller;return r instanceof ro&&SI(e,t,i.data)&&(!n||r.innerRadius<n.controller.innerRadius)&&r.options.circumference>=90?i:n},void 0)}function SI(e,t,n){if(!t.autoHide)return!0;for(let i=0;i<n.length;i++)if(!n[i].hidden&&e.getDataVisibility(i))return!0}function TI({chartArea:e},t,n){const{left:i,top:r,right:s,bottom:a}=e,{innerRadius:l,offsetX:u,offsetY:d}=n.controller,h=(i+s)/2+u,m=(r+a)/2+d,g={left:Math.max(h-l,i),right:Math.min(h+l,s),top:Math.max(m-l,r),bottom:Math.min(m+l,a)},_={x:(g.left+g.right)/2,y:(g.top+g.bottom)/2},x=t.spacing+t.borderWidth/2,v=l-x,S=_.y>m,C=S?r+x:a-x,A=MI(C,h,m,v);return{controllerMeta:{_centerX:h,_centerY:m,_radius:v,_counterclockwise:S,...A},point:_,radius:Math.min(l,Math.min(g.right-g.left,g.bottom-g.top)/2)}}function kI({width:e,height:t},n){const i=Math.sqrt(Math.pow(e,2)+Math.pow(t,2));return n*2/i}function MI(e,t,n,i){const r=Math.pow(n-e,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:ee};const d=(-a-Math.sqrt(u))/2,h=(-a+Math.sqrt(u))/2;return{_startAngle:Ca({x:t,y:n},{x:d,y:e}).angle,_endAngle:Ca({x:t,y:n},{x:h,y:e}).angle}}function DI(e,t){const{_centerX:n,_centerY:i,_radius:r,_startAngle:s,_endAngle:a,_counterclockwise:l,options:u}=t;e.save();const d=ui(e,u);e.fillStyle=u.backgroundColor,e.beginPath(),e.arc(n,i,r,s,a,l),e.closePath(),e.fill(),d&&e.stroke(),e.restore()}class vo extends Ye{inRange(t,n,i,r){return Z0({x:t,y:n},{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 vr(this,t)}draw(t){const n=this.options,i=!rn(this._visible)||this._visible;!n.display||!n.content||!i||(t.save(),cl(t,this.getCenterPoint(),this.rotation),X2(t,this),ly(t,this,n),cy(t,CI(this),n),t.restore())}resolveElementProperties(t,n){let i;if(ry(n))i=hy(t,n);else{const{centerX:l,centerY:u}=pd(t,n);i={x:l,y:u}}const r=Se(n.padding),s=ul(t.ctx,n),a=ey(i,s,n,r);return{initProperties:is(t,a,n),pointX:i.x,pointY:i.y,...a,rotation:n.rotation}}}vo.id="labelAnnotation",vo.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},vo.defaultRoutes={borderColor:"color"};function CI({x:e,y:t,width:n,height:i,options:r}){const s=r.borderWidth/2,a=Se(r.padding);return{x:e+a.left+s,y:t+a.top+s,width:n-a.left-a.right-r.borderWidth,height:i-a.top-a.bottom-r.borderWidth}}const yd=(e,t,n)=>({x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}),_d=(e,t,n)=>yd(t,n,Math.abs((e-t.y)/(n.y-t.y))).x,Sy=(e,t,n)=>yd(t,n,Math.abs((e-t.x)/(n.x-t.x))).y,So=e=>e*e,OI=(e,t,{x:n,y:i,x2:r,y2:s},a)=>a==="y"?{start:Math.min(i,s),end:Math.max(i,s),value:t}:{start:Math.min(n,r),end:Math.max(n,r),value:e},Ty=(e,t,n,i)=>(1-i)*(1-i)*e+2*(1-i)*i*t+i*i*n,bd=(e,t,n,i)=>({x:Ty(e.x,t.x,n.x,i),y:Ty(e.y,t.y,n.y,i)}),ky=(e,t,n,i)=>2*(1-i)*(t-e)+2*i*(n-t),My=(e,t,n,i)=>-Math.atan2(ky(e.x,t.x,n.x,i),ky(e.y,t.y,n.y,i))+.5*Rt;class To extends Ye{inRange(t,n,i,r){const s=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const a={mouseX:t,mouseY:n},{path:l,ctx:u}=this;if(l){ui(u,this.options),u.lineWidth+=this.options.hitTolerance;const{chart:h}=this.$context,m=t*h.currentDevicePixelRatio,g=n*h.currentDevicePixelRatio,_=u.isPointInStroke(l,m,g)||xd(this,a,r);return u.restore(),_}const d=So(s);return PI(this,a,d,r)||xd(this,a,r)}return AI(this,{mouseX:t,mouseY:n},i,{hitSize:s,useFinalPosition:r})}getCenterPoint(t){return vr(this,t)}draw(t){const{x:n,y:i,x2:r,y2:s,cp:a,options:l}=this;if(t.save(),!ui(t,l))return t.restore();rs(t,l);const u=Math.sqrt(Math.pow(r-n,2)+Math.pow(s-i,2));if(l.curve&&a)return HI(t,this,a,u),t.restore();const{startOpts:d,endOpts:h,startAdjust:m,endAdjust:g}=Ey(this),_=Math.atan2(s-i,r-n);t.translate(n,i),t.rotate(_),t.beginPath(),t.moveTo(0+m,0),t.lineTo(u-g,0),t.shadowColor=l.borderShadowColor,t.stroke(),wd(t,0,m,d),wd(t,u,-g,h),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){const i=rI(t,n),{x:r,y:s,x2:a,y2:l}=i,u=EI(i,t.chartArea),d=u?RI({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=is(t,d,n),n.curve){const m={x:d.x,y:d.y},g={x:d.x2,y:d.y2};d.cp=UI(d,n,Yr(m,g))}const h=II(t,d,n.label);return h._visible=u,d.elements=[{type:"label",optionScope:"label",properties:h,initProperties:d.initProperties}],d}}To.id="lineAnnotation";const Dy={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};To.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},Dy),fill:!1,length:12,start:Object.assign({},Dy),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({},vo.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},To.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},To.defaultRoutes={borderColor:"color"};function AI(e,{mouseX:t,mouseY:n},i,{hitSize:r,useFinalPosition:s}){const a=OI(t,n,e.getProps(["x","y","x2","y2"],s),i);return K0(a,r)||xd(e,{mouseX:t,mouseY:n},s,i)}function EI({x:e,y:t,x2:n,y2:i},{top:r,right:s,bottom:a,left:l}){return!(e<l&&n<l||e>s&&n>s||t<r&&i<r||t>a&&i>a)}function Cy({x:e,y:t},n,{top:i,right:r,bottom:s,left:a}){return e<a&&(t=Sy(a,{x:e,y:t},n),e=a),e>r&&(t=Sy(r,{x:e,y:t},n),e=r),t<i&&(e=_d(i,{x:e,y:t},n),t=i),t>s&&(e=_d(s,{x:e,y:t},n),t=s),{x:e,y:t}}function RI(e,t,n){const{x:i,y:r}=Cy(e,t,n),{x:s,y:a}=Cy(t,e,n);return{x:i,y:r,x2:s,y2:a,width:Math.abs(s-i),height:Math.abs(a-r)}}function PI(e,{mouseX:t,mouseY:n},i=wr,r){const{x:s,y:a,x2:l,y2:u}=e.getProps(["x","y","x2","y2"],r),d=l-s,h=u-a,m=So(d)+So(h),g=m===0?-1:((t-s)*d+(n-a)*h)/m;let _,x;return g<0?(_=s,x=a):g>1?(_=l,x=u):(_=s+g*d,x=a+g*h),So(t-_)+So(n-x)<=i}function xd(e,{mouseX:t,mouseY:n},i,r){const s=e.label;return s.options.display&&s.inRange(t,n,r,i)}function II(e,t,n){const i=n.borderWidth,r=Se(n.padding),s=ul(e.ctx,n),a=s.width+r.width+i,l=s.height+r.height+i;return NI(t,n,{width:a,height:l,padding:r},e.chartArea)}function LI(e){const{x:t,y:n,x2:i,y2:r}=e,s=Math.atan2(r-n,i-t);return s>Rt/2?s-Rt:s<Rt/-2?s+Rt:s}function NI(e,t,n,i){const{width:r,height:s,padding:a}=n,{xAdjust:l,yAdjust:u}=t,d={x:e.x,y:e.y},h={x:e.x2,y:e.y2},m=t.rotation==="auto"?LI(e):ve(t.rotation),g=BI(r,s,m),_=FI(e,t,{labelSize:g,padding:a},i),x=e.cp?bd(d,e.cp,h,_):yd(d,h,_),v={size:g.w,min:i.left,max:i.right,padding:a.left},S={size:g.h,min:i.top,max:i.bottom,padding:a.top},C=Ay(x.x,v)+l,A=Ay(x.y,S)+u;return{x:C-r/2,y:A-s/2,x2:C+r/2,y2:A+s/2,centerX:C,centerY:A,pointX:x.x,pointY:x.y,width:r,height:s,rotation:Da(m)}}function BI(e,t,n){const i=Math.cos(n),r=Math.sin(n);return{w:Math.abs(e*i)+Math.abs(t*r),h:Math.abs(e*r)+Math.abs(t*i)}}function FI(e,t,n,i){let r;const s=zI(e,i);return t.position==="start"?r=Oy({w:e.x2-e.x,h:e.y2-e.y},n,t,s):t.position==="end"?r=1-Oy({w:e.x-e.x2,h:e.y-e.y2},n,t,s):r=dd(1,t.position),r}function Oy(e,t,n,i){const{labelSize:r,padding:s}=t,a=e.w*i.dx,l=e.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 al(Math.max(u,d),0,.25)}function zI(e,t){const{x:n,x2:i,y:r,y2:s}=e,a=Math.min(r,s)-t.top,l=Math.min(n,i)-t.left,u=t.bottom-Math.max(r,s),d=t.right-Math.max(n,i);return{x:Math.min(l,d),y:Math.min(a,u),dx:l<=d?1:-1,dy:a<=u?1:-1}}function Ay(e,t){const{size:n,min:i,max:r,padding:s}=t,a=n/2;return n>r-i?(r+i)/2:(i>=e-s-a&&(e=i+s+a),r<=e+s+a&&(e=r-s-a),e)}function Ey(e){const t=e.options,n=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:n,endOpts:i,startAdjust:Ry(e,n),endAdjust:Ry(e,i)}}function Ry(e,t){if(!t||!t.display)return 0;const{length:n,width:i}=t,r=e.options.borderWidth/2,s={x:n,y:i+r};return Math.abs(_d(0,s,{x:0,y:r}))}function wd(e,t,n,i){if(!i||!i.display)return;const{length:r,width:s,fill:a,backgroundColor:l,borderColor:u}=i,d=Math.abs(t-r)+n;e.beginPath(),rs(e,i),ui(e,i),e.moveTo(d,-s),e.lineTo(t+n,0),e.lineTo(d,s),a===!0?(e.fillStyle=l||u,e.closePath(),e.fill(),e.shadowColor="transparent"):e.shadowColor=i.borderShadowColor,e.stroke()}function UI(e,t,n){const{x:i,y:r,x2:s,y2:a,centerX:l,centerY:u}=e,d=Math.atan2(a-r,s-i),h=fd(t.controlPoint,0),m={x:l+Fi(n,h.x,!1),y:u+Fi(n,h.y,!1)};return xr(m,{x:l,y:u},d)}function Py(e,{x:t,y:n},{angle:i,adjust:r},s){!s||!s.display||(e.save(),e.translate(t,n),e.rotate(i),wd(e,0,-r,s),e.restore())}function HI(e,t,n,i){const{x:r,y:s,x2:a,y2:l,options:u}=t,{startOpts:d,endOpts:h,startAdjust:m,endAdjust:g}=Ey(t),_={x:r,y:s},x={x:a,y:l},v=My(_,n,x,0),S=My(_,n,x,1)-Rt,C=bd(_,n,x,m/i),A=bd(_,n,x,1-g/i),F=new Path2D;e.beginPath(),F.moveTo(C.x,C.y),F.quadraticCurveTo(n.x,n.y,A.x,A.y),e.shadowColor=u.borderShadowColor,e.stroke(F),t.path=F,t.ctx=e,Py(e,C,{angle:v,adjust:m},d),Py(e,A,{angle:S,adjust:g},h)}class ko extends Ye{inRange(t,n,i,r){const s=this.options.rotation,a=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return WI({x:t,y:n},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),m=i==="y"?{start:u,end:h}:{start:l,end:d},g=xr({x:t,y:n},this.getCenterPoint(r),ve(-s));return g[i]>=m.start-a-wr&&g[i]<=m.end+a+wr}getCenterPoint(t){return vr(this,t)}draw(t){const{width:n,height:i,centerX:r,centerY:s,options:a}=this;t.save(),cl(t,this.getCenterPoint(),a.rotation),rs(t,this.options),t.beginPath(),t.fillStyle=a.backgroundColor;const l=ui(t,a);t.ellipse(r,s,i/2,n/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,n){return my(t,n)}}ko.id="ellipseAnnotation",ko.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},os.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},ko.defaultRoutes={borderColor:"color",backgroundColor:"color"},ko.descriptors={label:{_fallback:!0}};function WI(e,t,n,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=ve(n||0),m=Math.cos(h),g=Math.sin(h),_=Math.pow(m*(e.x-a)+g*(e.y-l),2),x=Math.pow(g*(e.x-a)-m*(e.y-l),2);return _/Math.pow(u+i,2)+x/Math.pow(d+i,2)<=1.0001}class hl extends Ye{inRange(t,n,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"?N2({x:t,y:n},this.getCenterPoint(r),d/2,h):K0(i==="y"?{start:a,end:u,value:n}:{start:s,end:l,value:t},h)}getCenterPoint(t){return vr(this,t)}draw(t){const n=this.options,i=n.borderWidth;if(n.radius<.1)return;t.save(),t.fillStyle=n.backgroundColor,rs(t,n);const r=ui(t,n);V2(t,this,this.centerX,this.centerY),r&&!ll(n.pointStyle)&&(t.shadowColor=n.borderShadowColor,t.stroke()),t.restore(),n.borderWidth=i}resolveElementProperties(t,n){const i=py(t,n);return i.initProperties=is(t,i,n),i}}hl.id="pointAnnotation",hl.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},hl.defaultRoutes={borderColor:"color",backgroundColor:"color"};class pl extends Ye{inRange(t,n,i,r){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&VI(this.elements,t,n,r);const s=xr({x:t,y:n},this.getCenterPoint(r),ve(-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 vr(this,t)}draw(t){const{elements:n,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,rs(t,i);const r=ui(t,i);let s=!0;for(const a of n)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,n){const i=py(t,n),{sides:r,rotation:s}=n,a=[],l=2*Rt/r;let u=s*nu;for(let d=0;d<r;d++,u+=l){const h=$I(i,n,u);h.initProperties=is(t,i,n),a.push(h)}return i.elements=a,i}}pl.id="polygonAnnotation",pl.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},pl.defaultRoutes={borderColor:"color",backgroundColor:"color"};function $I({centerX:e,centerY:t},{radius:n,borderWidth:i,hitTolerance:r},s){const a=(i+r)/2,l=Math.sin(s),u=Math.cos(s),d={x:e+l*n,y:t-u*n};return{type:"point",optionScope:"point",properties:{x:d.x,y:d.y,centerX:d.x,centerY:d.y,bX:e+l*(n+a),bY:t-u*(n+a)}}}function VI(e,t,n,i){let r=!1,s=e[e.length-1].getProps(["bX","bY"],i);for(const a of e){const l=a.getProps(["bX","bY"],i);l.bY>n!=s.bY>n&&t<(s.bX-l.bX)*(n-l.bY)/(s.bY-l.bY)+l.bX&&(r=!r),s=l}return r}const zi={box:os,doughnutLabel:fl,ellipse:ko,label:vo,line:To,point:hl,polygon:pl};Object.keys(zi).forEach(e=>{oe.describe(`elements.${zi[e].id}`,{_fallback:"plugins.annotation.common"})});const YI={update:Object.assign},qI=gd.concat(dl),Iy=(e,t)=>Lt(t)?Td(e,t):e,vd=e=>e==="color"||e==="font";function Sd(e="line"){return zi[e]?e:(console.warn(`Unknown annotation type: '${e}', defaulting to 'line'`),"line")}function jI(e,t,n,i){const r=KI(e,n.animations,i),s=t.annotations,a=QI(t.elements,s);for(let l=0;l<s.length;l++){const u=s[l],d=Ly(a,l,u.type),h=u.setContext(ZI(e,d,a,u)),m=d.resolveElementProperties(e,h);m.skip=GI(m),"elements"in m&&(XI(d,m.elements,h,r),delete m.elements),rn(d.x)||Object.assign(d,m),Object.assign(d,m.initProperties),m.options=Ny(h),r.update(d,m)}}function GI(e){return isNaN(e.x)||isNaN(e.y)}function KI(e,t,n){return n==="reset"||n==="none"||n==="resize"?YI:new gu(e,t)}function XI(e,t,n,i){const r=e.elements||(e.elements=[]);r.length=t.length;for(let s=0;s<t.length;s++){const a=t[s],l=a.properties,u=Ly(r,s,a.type,a.initProperties),d=n[a.optionScope].override(a);l.options=Ny(d),i.update(u,l)}}function Ly(e,t,n,i){const r=zi[Sd(n)];let s=e[t];return(!s||!(s instanceof r))&&(s=e[t]=new r,Object.assign(s,i)),s}function Ny(e){const t=zi[Sd(e.type)],n={};n.id=e.id,n.type=e.type,n.drawTime=e.drawTime,Object.assign(n,Td(e,t.defaults),Td(e,t.defaultRoutes));for(const i of qI)n[i]=e[i];return n}function Td(e,t){const n={};for(const i of Object.keys(t)){const r=t[i],s=e[i];vd(i)&&Gt(s)?n[i]=s.map(a=>Iy(a,r)):n[i]=Iy(s,r)}return n}function ZI(e,t,n,i){return t.$context||(t.$context=Object.assign(Object.create(e.getContext()),{element:t,get elements(){return n.filter(r=>r&&r.options)},id:i.id,type:"annotation"}))}function QI(e,t){const n=t.length,i=e.length;if(i<n){const r=n-i;e.splice(i,0,...new Array(r))}else i>n&&e.splice(n,i-n);return e}var JI="3.1.0";const Ui=new Map,By=e=>e.type!=="doughnutLabel",tL=gd.concat(dl);var Fy={id:"annotation",version:JI,beforeRegister(){B2("chart.js","4.0",on.version)},afterRegister(){on.register(zi)},afterUnregister(){on.unregister(zi)},beforeInit(e){Ui.set(e,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(e,t,n){const i=Ui.get(e),r=i.annotations=[];let s=n.annotations;Lt(s)?Object.keys(s).forEach(a=>{const l=s[a];Lt(l)&&(l.id=a,r.push(l))}):Gt(s)&&r.push(...s),yI(r.filter(By),e.scales)},afterDataLimits(e,t){const n=Ui.get(e);gI(e,t.scale,n.annotations.filter(By).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(e,t,n){const i=Ui.get(e);dI(e,i,n),jI(e,i,n,t.mode),i.visibleElements=i.elements.filter(r=>!r.skip&&r.options.display),mI(e,i,n)},beforeDatasetsDraw(e,t,n){Mo(e,"beforeDatasetsDraw",n.clip)},afterDatasetsDraw(e,t,n){Mo(e,"afterDatasetsDraw",n.clip)},beforeDatasetDraw(e,t,n){Mo(e,t.index,n.clip)},beforeDraw(e,t,n){Mo(e,"beforeDraw",n.clip)},afterDraw(e,t,n){Mo(e,"afterDraw",n.clip)},beforeEvent(e,t,n){const i=Ui.get(e);fI(i,t.event,n)&&(t.changed=!0)},afterDestroy(e){Ui.delete(e)},getAnnotations(e){const t=Ui.get(e);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(e,t,n){return ud(e,t,n)},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:e=>!tL.includes(e)&&e!=="init",annotations:{_allKeys:!1,_fallback:(e,t)=>`elements.${zi[Sd(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:vd,_fallback:!0},_indexable:vd}},additionalOptionScopes:[""]};function Mo(e,t,n){const{ctx:i,chartArea:r}=e,s=Ui.get(e);n&&to(i,r);const a=eL(s.visibleElements,t).sort((l,u)=>l.element.options.z-u.element.options.z);for(const l of a)nL(i,r,s,l);n&&eo(i)}function eL(e,t){const n=[];for(const i of e)if(i.options.drawTime===t&&n.push({element:i,main:!0}),i.elements&&i.elements.length)for(const r of i.elements)r.options.display&&r.options.drawTime===t&&n.push({element:r});return n}function nL(e,t,n,i){const r=i.element;i.main?(xy(n,r,"beforeDraw"),r.draw(e,t),xy(n,r,"afterDraw")):r.draw(e,t)}const iL={class:"zoom-timerange-container"},rL={class:"zoom-timerange-details"},sL={class:"label","data-testid":"zoom-timerange-from"},oL={class:"label","data-testid":"zoom-timerange-to"},aL=f.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{},granularity:{}},setup(e){const t=e,{i18n:n}=St.useI18n(),i=f.ref(ns({tickValue:t.start,granularity:t.granularity})),r=f.ref(ns({tickValue:t.end,granularity:t.granularity})),s=(a,l)=>{w0(()=>{i.value=ns({tickValue:a,granularity:t.granularity}),r.value=ns({tickValue:l,granularity:t.granularity})},100)()};return f.watch(()=>[t.start,t.end],([a,l])=>{s(a,l)},{immediate:!0}),(a,l)=>(f.openBlock(),f.createElementBlock("div",iL,[f.createElementVNode("div",rL,[f.createElementVNode("div",sL,f.toDisplayString(f.unref(n).t("zoom_time_range.from")),1),f.createElementVNode("div",null,f.toDisplayString(i.value),1),f.createElementVNode("div",oL,f.toDisplayString(f.unref(n).t("zoom_time_range.to")),1),f.createElementVNode("div",null,f.toDisplayString(r.value),1)])]))}}),Me=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n},zy=Me(aL,[["__scopeId","data-v-4fa681cf"]]),lL={class:"zoom-actions-container"},cL={class:"zoom-actions-heading"},uL={class:"zoom-action-select"},dL=["data-testid"],fL=["aria-disabled","href"],hL=["onClick"],pL=Me(f.defineComponent({__name:"ZoomActions",props:{zoomActionItems:{},newTimeRange:{},granularity:{}},emits:["onAction"],setup(e,{emit:t}){const n=e,i=t,r=s=>{s.action&&(s.action(n.newTimeRange),i("onAction"))};return(s,a)=>(f.openBlock(),f.createElementBlock("div",lL,[f.createElementVNode("div",cL,[f.createVNode(zy,{end:e.newTimeRange.end,granularity:e.granularity,start:e.newTimeRange.start},null,8,["end","granularity","start"]),f.createVNode(f.unref(fe.CloseIcon),{class:"zoom-actions-close-icon",color:`var(--kui-color-text-neutral, ${f.unref(Bc)})`,size:`var(--kui-icon-size-30, ${f.unref(rr)})`,onClick:a[0]||(a[0]=l=>s.$emit("onAction"))},null,8,["color","size"])]),a[2]||(a[2]=f.createElementVNode("div",{class:"zoom-actions-heading-divider"},null,-1)),f.createElementVNode("div",uL,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(e.zoomActionItems,l=>(f.openBlock(),f.createElementBlock("div",{key:l.key,class:f.normalizeClass(["zoom-action-item",{disabled:l.disabled}]),"data-testid":`zoom-action-item-${l.key}`},[l.href?(f.openBlock(),f.createElementBlock("a",{key:0,"aria-disabled":l.disabled,class:"zoom-action-link",href:l.href,onClick:a[1]||(a[1]=u=>s.$emit("onAction"))},f.toDisplayString(l.label),9,fL)):(f.openBlock(),f.createElementBlock("div",{key:1,onClick:u=>r(l)},f.toDisplayString(l.label),9,hL))],10,dL))),128))])]))}}),[["__scopeId","data-v-79ba72f8"]]),mL={key:2},gL={class:"tooltip-title"},yL={class:"title"},_L={key:0,class:"subtitle"},bL={class:"context"},xL={class:"metric"},wL={class:"tooltip"},vL={key:0,class:"square-marker marker-placeholder"},SL={class:"display-value"},Do=Me(f.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(e,{emit:t}){const n=t,i=e,r=f.ref(null),{x:s,y:a,isDragging:l}=fP(r,{initialValue:{x:parseFloat(i.absoluteLeft),y:parseFloat(i.absoluteTop)}}),u=f.computed(()=>`${a.value}px`),d=f.computed(()=>`${s.value}px`),h=f.computed(()=>i.state.tooltipContext),m=f.computed(()=>i.state.metricDisplay),g=f.computed(()=>["interactive","zoom-interactive"].includes(i.state.interactionMode));return f.watch(()=>[i.absoluteLeft,i.absoluteTop],([_,x])=>{l.value||(s.value=parseFloat(_),a.value=parseFloat(x))}),f.watch(l,_=>{_?document.body.classList.add("no-select"):document.body.classList.remove("no-select")}),f.watch(r,_=>{if(_){const{width:x,height:v}=_.getBoundingClientRect();n("dimensions",{width:x,height:v})}}),(_,x)=>e.state.showTooltip?(f.openBlock(),f.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:r,class:f.normalizeClass(["tooltip-container",{locked:e.state.interactionMode==="interactive"}]),style:f.normalizeStyle({transform:g.value?`translate(${d.value}, ${u.value})`:`translate(${e.absoluteLeft}, ${e.absoluteTop})`,left:"0",top:"0",pointerEvents:g.value?"all":"none"})},[e.state.interactionMode==="selecting-chart-area"&&e.granularity&&e.zoomTimeRange&&e.zoomTimeRange.end&&e.zoomTimeRange.start?(f.openBlock(),f.createBlock(zy,{key:0,end:e.zoomTimeRange?.end,granularity:e.granularity,start:e.zoomTimeRange?.start},null,8,["end","granularity","start"])):e.state.interactionMode==="zoom-interactive"&&e.zoomTimeRange&&e.zoomActionItems&&e.granularity?(f.openBlock(),f.createBlock(pL,{key:1,granularity:e.granularity,"new-time-range":e.zoomTimeRange,"zoom-action-items":e.zoomActionItems,onOnAction:x[0]||(x[0]=v=>n("onAction"))},null,8,["granularity","new-time-range","zoom-action-items"])):(f.openBlock(),f.createElementBlock("div",mL,[f.createElementVNode("div",gL,[f.createElementVNode("div",yL,[f.createElementVNode("div",null,f.toDisplayString(e.tooltipTitle),1),g.value?(f.openBlock(),f.createBlock(f.unref(fe.DragIcon),{key:0,class:"drag-icon",color:`var(--kui-color-text-neutral, ${f.unref(Bc)})`,size:`var(--kui-icon-size-30, ${f.unref(rr)})`},null,8,["color","size"])):f.createCommentVNode("",!0)]),h.value||m.value?(f.openBlock(),f.createElementBlock("div",_L,[f.createElementVNode("div",bL,f.toDisplayString(h.value),1),f.createElementVNode("div",xL,f.toDisplayString(m.value),1)])):f.createCommentVNode("",!0)]),f.createElementVNode("ul",wL,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(e.state.tooltipSeries,({backgroundColor:v,borderColor:S,label:C,value:A,isSegmentEmpty:F,isExtra:P},B)=>(f.openBlock(),f.createElementBlock(f.Fragment,{key:C+B},[e.state.tooltipSeries.length?(f.openBlock(),f.createElementBlock("li",{key:0,class:f.normalizeClass({"extra-row":P})},[P?(f.openBlock(),f.createElementBlock("div",vL)):(f.openBlock(),f.createElementBlock("div",{key:1,class:"square-marker",style:f.normalizeStyle({background:String(v),borderColor:String(S)})},null,4)),f.createElementVNode("span",{class:f.normalizeClass(["display-label",{empty:F}])},f.toDisplayString(C),3),f.createElementVNode("span",SL,f.toDisplayString(A),1)],2)):f.createCommentVNode("",!0)],64))),128))])]))],6)):f.createCommentVNode("",!0)}}),[["__scopeId","data-v-fb2f2a72"]]),TL={key:0,class:"legend-container","data-testid":"legend"},kL=["onClick"],ML={key:0,"aria-hidden":"true",class:"line-marker",height:"2",width:"16"},DL=["stroke","stroke-dasharray"],CL=["title"],OL={class:"label truncate-label"},AL={key:0,class:"sub-label"},EL={key:0},RL={class:"tooltip-content"},ml=Me(f.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(e){const t=e,{i18n:n}=St.useI18n(),i=f.inject("showLegendValues",!1),r=f.inject("legendPosition",f.ref(Le.Bottom)),s=({datasetIndex:u,index:d,isKey:h},m)=>h?`key-${m}`:`dataset-${u??0}-${d??0}`,a=(u=0,d)=>{if(t.chartInstance===null)return;const h=t.chartInstance instanceof on?t.chartInstance:t.chartInstance.chart,m=l(u,d);!h.getDatasetMeta(u).dataset&&d!==void 0?h.toggleDataVisibility(d):m?h.hide(u,d):h.show(u,d),h.update()},l=(u=0,d)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const h=t.chartInstance instanceof on?t.chartInstance:t.chartInstance.chart;return h.getDatasetMeta(u).dataset||d===void 0?h.isDatasetVisible(u):h.getDataVisibility(d)};return(u,d)=>{const h=f.resolveComponent("KTooltip");return f.unref(r)!==f.unref(Le).Hidden?(f.openBlock(),f.createElementBlock("ul",TL,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(e.items,({fillStyle:m,strokeStyle:g,text:_,datasetIndex:x,index:v,value:S,isSegmentEmpty:C,isKey:A,lineDash:F},P)=>(f.openBlock(),f.createElementBlock("li",{key:s({datasetIndex:x,index:v,isKey:A},P),class:f.normalizeClass({"legend-key":A}),onClick:B=>A?void 0:a(x,v)},[F?.length?(f.openBlock(),f.createElementBlock("svg",ML,[f.createElementVNode("line",{stroke:g,"stroke-dasharray":F.join(" "),"stroke-width":"2",x1:"0",x2:"16",y1:"1",y2:"1"},null,8,DL)])):(f.openBlock(),f.createElementBlock("div",{key:1,class:"square-marker",style:f.normalizeStyle({background:m,"border-color":g})},null,4)),f.createVNode(h,null,f.createSlots({default:f.withCtx(()=>[f.createElementVNode("div",{class:f.normalizeClass(["label-container",{"strike-through":!A&&!l(x,v),"inline-value":A}]),title:S&&(f.unref(i)||A)?`${_}: ${S.formatted}`:_},[f.createElementVNode("div",OL,f.toDisplayString(_),1),S&&(f.unref(i)||A)?(f.openBlock(),f.createElementBlock("div",AL,[A?(f.openBlock(),f.createElementBlock("span",EL,"-")):f.createCommentVNode("",!0),f.createTextVNode(" "+f.toDisplayString(S.formatted),1)])):f.createCommentVNode("",!0)],10,CL)]),_:2},[C?{name:"content",fn:f.withCtx(()=>[f.createElementVNode("div",RL,f.toDisplayString(f.unref(n).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],10,kL))),128))])):f.createCommentVNode("",!0)}}}),[["__scopeId","data-v-90ef4d12"]]),Ne=[];for(let e=0;e<256;++e)Ne.push((e+256).toString(16).slice(1));function PL(e,t=0){return(Ne[e[t+0]]+Ne[e[t+1]]+Ne[e[t+2]]+Ne[e[t+3]]+"-"+Ne[e[t+4]]+Ne[e[t+5]]+"-"+Ne[e[t+6]]+Ne[e[t+7]]+"-"+Ne[e[t+8]]+Ne[e[t+9]]+"-"+Ne[e[t+10]]+Ne[e[t+11]]+Ne[e[t+12]]+Ne[e[t+13]]+Ne[e[t+14]]+Ne[e[t+15]]).toLowerCase()}const IL=new Uint8Array(16);function LL(){return crypto.getRandomValues(IL)}function kd(e,t,n){return crypto.randomUUID?crypto.randomUUID():NL(e)}function NL(e,t,n){e=e||{};const i=e.random??e.rng?.()??LL();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,PL(i)}const Uy=(e,t)=>{const n=e.ctx,i=e.scales.y,r=e.scales.x,s=t[t.length-1].element;n.save(),n.strokeStyle="rgba(100, 100, 100, 1)",n.lineWidth=3,e.options.indexAxis==="x"?n.strokeRect(s.x-s.width/2,s.y,s.width,i.bottom-s.y):n.strokeRect(r.left,s.y-s.height/2,s.x-r.left,s.height),n.restore()};class Hy{id="highlightPlugin";_clickedElements;_previousHoverOption;_clicked=!1;_pause=!1;_suppressNextClick=!1;afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&Uy(t,this._clickedElements)}afterEvent(t,{event:n}){if(n.type==="click"&&this._suppressNextClick){this._suppressNextClick=!1;return}if(n.type!=="click"||!n.native||this._pause)return;this._clicked=!this._clicked;const i=t.options.interaction?.mode||"index",r=t.getElementsAtEventForMode(n.native,i,{intersect:!1},!0);r.length&&this._clicked?(this._clickedElements=r,Uy(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 BL=["id"],FL=["id"],zL={class:"axis-tooltip-content"},UL="100%",HL="100%",WL=20,$L=20,Wy=6,VL=0,YL=10,qL=10,jL=1,GL=Me(f.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:(e,t)=>e.value&&t.value&&t.value.raw-e.value.raw},chartTooltipSortFn:{type:Function,default:(e,t)=>t.rawValue-e.rawValue},tooltipMetricDisplay:{default:""}},setup(e){const t=e,{i18n:n}=St.useI18n(),{translateUnit:i}=St.useTranslatedUnits(),r=crypto.randomUUID(),s=crypto.randomUUID(),a=new Hy,l=f.useTemplateRef("chartContainer"),u=f.useTemplateRef("chartParent"),d=({chart:X},tt)=>{const rt=X.data,pt=rt.labels?.indexOf(tt);return rt.datasets.reduce((yt,mt,Et)=>{if(X.isDatasetVisible(Et)){const zt=mt.data[pt];return isNaN(zt)?yt:yt+zt}else return yt},0)},h=(X,tt,rt,pt)=>{const yt=pt==="horizontal";tt===null&&(tt=n.t("entityNoName"));const mt={type:"label",yValue:G=>yt?tt:d(G,tt),xValue:G=>yt?d(G,tt):tt},Et={...mt,position:yt?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>yt?0:-Math.abs(NP()),content:G=>T0(d(G,tt),rt)},zt={...mt,content:G=>FP(d(G,tt),BP(G.chart,X)),position:yt?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:G=>yt?LP(T0(d(G,tt),rt)):0,color:CP};return{[`${tt}-value`]:Et,[`${tt}-percent`]:zt}},m=f.useTemplateRef("canvas"),g=f.useTemplateRef("axis"),_=kd(),x=kd(),v=f.ref([]),S=f.inject("legendPosition",Le.Bottom),C=f.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),A=f.toRef(t,"metricUnit"),F=f.computed(()=>t.orientation==="horizontal"),P=f.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:f.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:f.toRef(t,"dimensionAxesTitle"),tooltipSeries:[],left:"",top:"",units:f.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:B,tooltipAbsoluteTop:N}=St.useTooltipAbsolutePosition(u,P),z=f.ref(0),k=()=>t.annotations&&t.chartData.labels?.reduce((X,tt)=>Object.assign(X,h(t.chartData,tt,A.value,t.orientation)),{}),w={id:_,afterUpdate(X){z.value+=1,v.value=$u(X,t.legendValues,t.chartLegendSortFn)}},O={id:x,afterUpdate(X){X.options.plugins.annotation.annotations=t.annotations?k():{}}},$=[w,{id:"axisHover",afterEvent(X,tt){if(C.show=!1,tt.event.type==="mousemove"){const rt=tt.event,pt=X.options.indexAxis,yt=X.scales,mt=X.scales[pt].getLabelForValue(Number(X.scales[pt].getValueForPixel(rt[pt]))),zt=X.scales[pt].getLabels().indexOf(mt),G=t.chartData.isLabelEmpty?.[zt];if((lt=>lt==="x"?rt.y>yt.x.top:rt.x<yt.y.right)(pt)){P.interactionMode!=="interactive"&&(P.showTooltip=!1);const $t=X.canvas.getContext("2d").measureText(mt).width,_t=Math.abs(Math.round(rt.x-$t*.5)),Vt=Math.round(rt.x+$t*.5),Te=X.canvas.getBoundingClientRect(),ke=40;C.left=pt==="x"?`${(_t>0?_t:Vt)-C.offset+Te.left}px`:`${rt.x-$t*.5-C.offset+Te.left}px`,C.top=`${rt.y-ke+Te.top}px`,mt.length>il?(C.show=!0,C.text=mt):G?(C.text=n.t("emptyEntityInfo"),C.show=!0):C.show=!1}else C.show=!1}}},a,...t.annotations?[O]:[]],q=f.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),st=f.ref(0),ct=f.ref(0),ht=new ResizeObserver(w0(X=>{st.value=X[0].contentRect.width,ct.value=X[0].contentRect.height},100)),ut=f.computed(()=>{const X=t.chartData?.labels?.length;return m.value&&X&&!F.value?`${Math.max(X*(WL+Wy),st.value)}px`:UL}),vt=f.computed(()=>{const X=t.chartData?.labels?.length;return m.value&&X&&F.value?`${Math.max(X*($L+Wy),ct.value)}px`:HL});St.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey")),f.onMounted(()=>{t.annotations&&on.register(Fy),l.value&&(st.value=l.value.offsetWidth,ct.value=l.value.offsetHeight,ht.observe(l.value))}),f.onUnmounted(()=>{l.value&&ht.unobserve(l.value)});const at=f.computed(()=>{const X=St.useBarChartOptions({tooltipState:P,legendID:_,stacked:f.toRef(t,"stacked"),metricAxesTitle:f.toRef(t,"metricAxesTitle"),dimensionAxesTitle:f.toRef(t,"dimensionAxesTitle"),indexAxis:F.value?"y":"x",numLabels:q});return{...X.value,plugins:{...X.value.plugins,annotation:{annotations:k(),clip:!1}}}}),dt=St.useChartJSCommon("bar",m,f.toRef(t,"chartData"),$,at);f.onBeforeUnmount(()=>{on.unregister(Fy)});const V={[Le.Bottom]:"column"},I=f.computed(()=>{if(g.value&&dt.value){const X=window.devicePixelRatio,tt=dt.value,rt=tt.scales.y.width*X+jL,pt=(tt.scales.y.height+tt.scales.y.top+tt.scales.x.height)*X,yt=g.value.getContext("2d");return yt.scale(X,X),yt.canvas.width=rt,yt.canvas.height=pt,yt.canvas.style.width=`${rt/X}px`,yt.canvas.style.height=`${pt/X}px`,{scale:X,width:rt*X,height:pt*X,targetCtx:yt}}return null}),W=X=>{const tt=X.target;if(I.value&&dt.value&&!F.value){const rt=I.value.scale,pt=I.value.targetCtx,yt=I.value.width,mt=I.value.height,Et=dt.value,zt=Et.canvas;pt.fillStyle="white",tt.scrollLeft>=VL&&tt.scrollLeft<=YL?(pt.globalCompositeOperation="source-over",pt.clearRect(0,0,yt,mt),pt.drawImage(zt,0,0,yt,mt,0,0,yt,mt),pt.globalCompositeOperation="destination-over",pt.fillRect(0,0,yt,mt)):(pt.globalCompositeOperation="source-over",pt.fillRect(0,(Et.scales.y.height+Et.scales.y.top+qL)*rt,yt,Et.scales.x.height*rt))}P.offsetY=tt.scrollTop,P.offsetX=tt.scrollLeft,C.offset=tt.scrollLeft},nt=({width:X,height:tt})=>{P.width=X,P.height=tt};f.watch(()=>t.orientation,()=>{if(g.value&&I.value){const X=I.value.width,tt=I.value.height;(g.value?.getContext("2d")).clearRect(0,0,X,tt)}P.showTooltip=!1,P.interactionMode="idle"}),f.watch(()=>t.annotations,X=>{dt.value&&(X?dt.value.options.plugins.annotation.annotations=k(t.chartData):delete dt.value.options.plugins.annotation.annotations)});const ot=()=>{P.showTooltip&&(P.interactionMode!=="idle"?P.interactionMode="idle":P.interactionMode="interactive")};return(X,tt)=>(f.openBlock(),f.createElementBlock("div",{ref:"chartParent",class:f.normalizeClass(["chart-parent",V[f.unref(S)]])},[f.createElementVNode("canvas",{id:f.unref(r),ref:"axis",class:"axis"},null,8,BL),f.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:tt[0]||(tt[0]=rt=>ot()),onScroll:W},[f.createElementVNode("div",{class:"chart-body",style:f.normalizeStyle({width:ut.value,height:vt.value})},[f.createElementVNode("canvas",{id:f.unref(s),ref:"canvas",class:"chart-canvas"},null,8,FL)],4)],544),(f.openBlock(),f.createBlock(f.Teleport,{to:"body"},[C.show?(f.openBlock(),f.createElementBlock("div",{key:0,class:"axis-tooltip",style:f.normalizeStyle({top:C.top,left:C.left}),width:"auto"},[f.createElementVNode("div",zL,f.toDisplayString(C.text),1)],4)):f.createCommentVNode("",!0),f.createVNode(Do,{"absolute-left":f.unref(B),"absolute-top":f.unref(N),"chart-parent-ref":u.value,state:P,"tooltip-title":e.tooltipTitle,onDimensions:nt},null,8,["absolute-left","absolute-top","chart-parent-ref","state","tooltip-title"])])),f.createVNode(ml,{id:f.unref(_),"chart-instance":f.unref(dt),items:v.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-60e5a1a7"]]);const KL={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"};jm._date.override({_id:"date-fns",formats:function(){return KL},parse:function(e,t){if(e===null||typeof e>"u")return null;const n=typeof e;return n==="number"||e instanceof Date?e=At(e):n==="string"&&(typeof t=="string"?e=qM(e,t,new Date,this.options):e=Lp(e,this.options)),Hc(e)?e.getTime():null},format:function(e,t){return ya(e,t,this.options)},add:function(e,t,n){switch(n){case"millisecond":return zc(e,t);case"second":return HT(e,t);case"minute":return zT(e,t);case"hour":return NT(e,t);case"day":return ma(e,t);case"week":return WT(e,t);case"month":return Fc(e,t);case"quarter":return UT(e,t);case"year":return $T(e,t);default:return e}},diff:function(e,t,n){switch(n){case"millisecond":return Wc(e,t);case"second":return ZT(e,t);case"minute":return GT(e,t);case"hour":return jT(e,t);case"day":return hp(e,t);case"week":return QT(e,t);case"month":return yp(e,t);case"quarter":return XT(e,t);case"year":return JT(e,t);default:return 0}},startOf:function(e,t,n){switch(t){case"second":return XM(e);case"minute":return KM(e);case"hour":return GM(e);case"day":return Uc(e);case"week":return Vn(e);case"isoWeek":return Vn(e,{weekStartsOn:+n});case"month":return ek(e);case"quarter":return tk(e);case"year":return _p(e);default:return e}},endOf:function(e,t){switch(t){case"second":return ak(e);case"minute":return sk(e);case"hour":return ik(e);case"day":return mp(e);case"week":return rk(e);case"month":return gp(e);case"quarter":return ok(e);case"year":return nk(e);default:return e}}});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}},XL={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...$y,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},ZL=f.version[0]==="2"?(e,t)=>Object.assign(e,{attrs:t}):(e,t)=>Object.assign(e,t);function as(e){return f.isProxy(e)?f.toRaw(e):e}function QL(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;return f.isProxy(t)?new Proxy(e,{}):e}function JL(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function Vy(e,t){e.labels=t}function Yy(e,t,n){const i=[];e.datasets=t.map(r=>{const s=e.datasets.find(a=>a[n]===r[n]);return!s||!r.data||i.includes(s)?{...r}:(i.push(s),Object.assign(s,r),s)})}function tN(e,t){const n={labels:[],datasets:[]};return Vy(n,e.labels),Yy(n,e.datasets,t),n}const eN=f.defineComponent({props:XL,setup(e,t){let{expose:n,slots:i}=t;const r=f.ref(null),s=f.shallowRef(null);n({chart:s});const a=()=>{if(!r.value)return;const{type:d,data:h,options:m,plugins:g,datasetIdKey:_}=e,x=tN(h,_),v=QL(x,h);s.value=new on(r.value,{type:d,data:v,options:{...m},plugins:g})},l=()=>{const d=f.toRaw(s.value);d&&(e.destroyDelay>0?setTimeout(()=>{d.destroy(),s.value=null},e.destroyDelay):(d.destroy(),s.value=null))},u=d=>{d.update(e.updateMode)};return f.onMounted(a),f.onUnmounted(l),f.watch([()=>e.options,()=>e.data],(d,h)=>{let[m,g]=d,[_,x]=h;const v=f.toRaw(s.value);if(!v)return;let S=!1;if(m){const C=as(m),A=as(_);C&&C!==A&&(JL(v,C),S=!0)}if(g){const C=as(g.labels),A=as(x.labels),F=as(g.datasets),P=as(x.datasets);C!==A&&(Vy(v.config.data,C),S=!0),F&&F!==P&&(Yy(v.config.data,F,e.datasetIdKey),S=!0)}S&&f.nextTick(()=>{u(v)})},{deep:!0}),()=>f.h("canvas",{role:"img","aria-label":e.ariaLabel,"aria-describedby":e.ariaDescribedby,ref:r},[f.h("p",{},[i.default?i.default():""])])}});function gl(e,t){return on.register(t),f.defineComponent({props:$y,setup(n,i){let{expose:r}=i;const s=f.shallowRef(null),a=f.shallowRef(null);f.watch(()=>a.value?.chart??null,u=>{s.value=u},{flush:"sync"}),r({chart:s});const l=u=>{a.value=u};return()=>f.h(eN,ZL({ref:l},{type:e,...n}))}})}const qy=gl("bar",$m),jy=gl("doughnut",ro),Gy=gl("line",Vm),nN=gl("scatter",qm),iN={class:"chart-container"},rN={key:0,class:"chart-center-metric"},sN={class:"chart-center-total"},oN={key:0,class:"chart-center-unit"},aN=f.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},metricName:{default:""},legendPosition:{default:Le.Bottom},legendValues:{default:void 0},syntheticsDataKey:{default:""},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""},showCenterMetric:{type:Boolean,default:!0}},setup(e){const t=e,{translateUnit:n}=St.useTranslatedUnits(),{i18n:i}=St.useI18n(),r=crypto.randomUUID(),s=crypto.randomUUID(),a=f.ref([]),l=f.useTemplateRef("chartParent"),u=f.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:f.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:f.toRef(t,"tooltipDimensionDisplay"),tooltipSeries:[],left:"",top:"",units:f.toRef(t,"metricUnit"),translateUnit:n,offsetX:0,offsetY:0,width:0,height:0,chartID:s,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:d,tooltipAbsoluteTop:h}=St.useTooltipAbsolutePosition(l,u),m={id:r,afterUpdate(z){a.value=z.options.plugins.legend.labels.generateLabels(z).map(k=>({...k,value:t.legendValues&&t.legendValues[k.text],hidden:!1}))}},g=f.computed(()=>[m]),_=f.computed(()=>[t.chartData.datasets.reduce((k,w)=>(k.labels.push(w.label),k.backgroundColor.push(w.backgroundColor),k.hoverBorderColor.push(Aa(w.backgroundColor).saturate(.5).darken(.15).hexString()),k.data.push(w.data.reduce((O,L)=>O+L,0)),k),{labels:[],backgroundColor:[],borderColor:"#ffffff",borderWidth:1,hoverBorderColor:[],hoverBorderWidth:1,data:[],hoverOffset:10})]),{formatUnit:x}=$n({i18n:i}),v=f.computed(()=>w2(t.metricName??"")),S=f.computed(()=>{const z=_.value[0]?.data.reduce((k,w)=>k+w,0)??0;return x(z,t.metricUnit,{approximate:!0,translateUnit:(k,w)=>n(k,w)}).trim()}),C=f.computed(()=>t.tooltipMetricDisplay||""),A=f.computed(()=>({...t.chartData,datasets:_.value}));St.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey"));const{options:F}=St.useDonutChartOptions({tooltipState:u,legendID:r}),P=f.ref(),B=z=>({[Le.Bottom]:"column",[Le.Hidden]:"hidden"})[z],N=({width:z,height:k})=>{u.width=z,u.height=k};return(z,k)=>(f.openBlock(),f.createElementBlock("div",{ref:"chartParent",class:f.normalizeClass(["chart-parent",B(e.legendPosition)]),"data-testid":"donut-chart-parent"},[f.createElementVNode("div",iN,[f.createVNode(f.unref(jy),{ref_key:"chartInstance",ref:P,"chart-id":f.unref(s),data:A.value,options:f.unref(F),plugins:g.value},null,8,["chart-id","data","options","plugins"]),e.showCenterMetric&&v.value?(f.openBlock(),f.createElementBlock("div",rN,[f.createElementVNode("span",sN,f.toDisplayString(S.value),1),C.value?(f.openBlock(),f.createElementBlock("span",oN,f.toDisplayString(C.value),1)):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0),(f.openBlock(),f.createBlock(f.Teleport,{to:"body"},[f.createVNode(Do,{"absolute-left":f.unref(d),"absolute-top":f.unref(h),state:u,"tooltip-title":e.tooltipTitle,unit:e.metricUnit,onDimensions:N},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),f.createVNode(ml,{id:f.unref(r),"chart-instance":P.value,items:a.value,position:e.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),lN=Me(aN,[["__scopeId","data-v-ecbae072"]]);class cN{id="outlierBandPlugin";beforeDatasetsDraw(t,n,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 m=t.ctx;m.save(),m.fillStyle=i.color,m.fillRect(u,a,d-u,h-a),m.restore()}}const uN=1.5;class dN{id="referenceLinePlugin";afterDatasetsDraw(t,n,i){const r=i?.lines;if(!r?.length)return;const s=t.scales.y;if(!s||!t.chartArea)return;const{top:a,bottom:l,left:u,right:d}=t.chartArea,h=t.ctx;h.save(),h.lineWidth=uN;for(const{value:m,color:g,borderDash:_}of r){if(!Number.isFinite(m))continue;const x=s.getPixelForValue(m);x<a||x>l||(h.beginPath(),h.setLineDash(_),h.strokeStyle=g,h.moveTo(u,x),h.lineTo(d,x),h.stroke())}h.restore()}}const fN={class:"chart-container"},hN=Me(f.defineComponent({__name:"ScatterChart",props:{chartData:{default:void 0},tooltipTitle:{},metricUnit:{default:""},xMetric:{default:void 0},xMetricUnit:{default:void 0},granularity:{},timeRangeMs:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:()=>0},chartTooltipSortFn:{type:Function,default:(e,t)=>t.rawValue-e.rawValue},tooltipMetricDisplay:{default:""},shadeOutlierRegion:{type:Boolean,default:!1},themeColors:{default:()=>ld()}},setup(e){const t=e,n=f.inject("legendPosition",Le.Bottom),{i18n:i}=St.useI18n(),{formatUnit:r}=$n({i18n:i}),{translateUnit:s}=St.useTranslatedUnits(),a=f.useTemplateRef("chartParent"),l=new cN,u=new dN,d=crypto.randomUUID(),h=crypto.randomUUID(),m=f.ref(),g=f.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:f.toRef(t,"tooltipMetricDisplay"),tooltipSeries:[],left:"",top:"",units:f.toRef(t,"metricUnit"),translateUnit:s,offsetX:0,offsetY:0,width:0,height:0,chartType:"scatter",chartID:h,chartTooltipSortFn:t.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:_,tooltipAbsoluteTop:x}=St.useTooltipAbsolutePosition(a,g);St.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey"));const v=f.computed(()=>t.chartData?.outlier),S=f.computed(()=>t.chartData?.referenceLines??[]),C=f.ref([]),A={id:d,afterUpdate(O){C.value=$u(O,void 0,t.chartLegendSortFn)}},F=f.computed(()=>{const O=[];v.value&&O.push({text:v.value.label,fillStyle:v.value.color,strokeStyle:v.value.color,isKey:!0});for(const L of S.value)O.push({text:L.label,fillStyle:L.color,strokeStyle:L.color,lineDash:L.borderDash,isKey:!0,value:{raw:L.value,formatted:r(L.value,t.metricUnit,{translateUnit:s})}});return O}),P=f.computed(()=>[...C.value,...F.value]),B=f.computed(()=>t.shadeOutlierRegion?v.value?.value:void 0),N=f.computed(()=>[A,...B.value!==void 0?[l]:[],...S.value.length?[u]:[]]),z=f.computed(()=>`scatter-${N.value.map(O=>O.id).join("-")}`),{options:k}=St.useScatterChartOptions({tooltipState:g,legendID:d,granularity:f.toRef(t,"granularity"),timeRangeMs:f.toRef(t,"timeRangeMs"),metricAxesTitle:f.toRef(t,"metricAxesTitle"),dimensionAxesTitle:f.toRef(t,"dimensionAxesTitle"),metricUnit:f.toRef(t,"metricUnit"),xMetric:f.toRef(t,"xMetric"),xMetricUnit:f.toRef(t,"xMetricUnit"),outlierValue:B,referenceLines:S,themeColors:f.toRef(t,"themeColors")}),w=O=>({[Le.Bottom]:"column",[Le.Hidden]:"hidden"})[O];return(O,L)=>(f.openBlock(),f.createElementBlock("div",{ref:"chartParent",class:f.normalizeClass(["chart-parent",w(f.unref(n))]),"data-testid":"scatter-chart-parent"},[f.createElementVNode("div",fN,[(f.openBlock(),f.createBlock(f.unref(nN),{key:z.value,ref_key:"chartInstance",ref:m,"chart-id":f.unref(h),class:"chart-canvas",data:e.chartData,"data-testid":"scatter-chart",options:f.unref(k),plugins:N.value},null,8,["chart-id","data","options","plugins"]))]),f.createVNode(Do,{"absolute-left":f.unref(_),"absolute-top":f.unref(x),"data-testid":"tooltip",granularity:e.granularity,state:g,"tooltip-title":e.tooltipTitle},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title"]),f.createVNode(ml,{id:f.unref(d),"chart-instance":m.value,"data-testid":"legend",items:P.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-3bb682a5"]]),Md=(e,t,n,i,r="#0275d8")=>{e.save(),e.beginPath(),e.moveTo(t,n),e.lineTo(t,i),e.lineWidth=1,e.strokeStyle=r,e.stroke(),e.restore()},Je={},pN=()=>{Je.x=void 0,Je.chart=void 0,Je.strategy=void 0,Je.group=void 0},mN=10;class Ky{id="verticalLinePlugin";_clickedSegment;_pause=!1;_useBrushingState=!1;_brushStrategy;_brushGroup;constructor({brushGroup:t=void 0,brushStrategy:n=void 0,enableBrushing:i=!1}={}){let r=!1;n==="group"&&(r=t!==void 0),this._useBrushingState=i&&r,this._brushStrategy=n,this._brushGroup=t}afterEvent(t,n){if(!this._useBrushingState)return;const{event:i}=n;(i.type==="mousemove"||i.type==="mouseout")&&requestAnimationFrame(r=>this.onMouseBrush(i.type,t,r))}_lastMouseBrushEvent=0;onMouseBrush(t,n,i){if(t==="mousemove"&&i-this._lastMouseBrushEvent<mN)return;const r=()=>{Je.chart=n,Je.strategy=this._brushStrategy,Je.group=this._brushGroup;for(const s of Object.values(on.instances))s!==n&&s.update("none")};t==="mousemove"?n.tooltip&&n.tooltip.getActiveElements()&&n.tooltip.getActiveElements().length&&(Je.x=n.tooltip.dataPoints[0].element.x,r()):t==="mouseout"&&(Je.x=void 0,r()),this._lastMouseBrushEvent=i}afterDatasetsDraw(t){if(this.isPaused)return;const n=t.tooltip&&t.tooltip.getActiveElements()&&t.tooltip.getActiveElements().length,i=t.ctx;if(this._clickedSegment){const{x:r}=this._clickedSegment.element;Md(i,r,t.scales.y.top,t.scales.y.bottom)}else if(this._useBrushingState)this.drawByBrush(t);else if(n){const{x:r}=t.tooltip.dataPoints[0].element;Md(i,r,t.scales.y.top,t.scales.y.bottom)}}drawByBrush(t){if(Je.x===void 0)return;const n=Je.chart===t?"#0275d8":"rgba(2, 117, 216, 0.3)";this._brushStrategy==="group"&&Je.group===this._brushGroup&&Md(t.ctx,Je.x,t.scales.y.top,t.scales.y.bottom,n)}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&&Je.chart===t){const n=Je.x!==void 0;if(pN(),n)for(const i of Object.values(on.instances))i!==t&&i.update("none")}}}const gN=(e,t,n)=>{const i=e.ctx;i.save(),i.strokeStyle="rgba(95, 154, 255, 1)",i.lineWidth=2,i.beginPath(),i.moveTo(t,e.chartArea.top),i.lineTo(t,e.chartArea.bottom),i.moveTo(n,e.chartArea.top),i.lineTo(n,e.chartArea.bottom),i.stroke(),i.restore()},yN=(e,t,n)=>{const i=e.ctx;i.save(),i.fillStyle="rgba(143, 193, 255, 0.3)",i.fillRect(t,e.chartArea.top,n-t,e.chartArea.bottom-e.chartArea.top),i.restore()},Xy=(e,t)=>{const n=e.scales.x.getValueForPixel(t.startX),i=e.scales.x.getValueForPixel(t.endX);if(!(n===void 0||i===void 0))return{xStart:Math.min(n,i),xEnd:Math.max(n,i)}},Zy=(e,t,n)=>{t.canvas.dispatchEvent(new CustomEvent(e,{detail:n}))};class _N{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 n=t.canvas;let i=!1;const r=l=>{this._dragTimeout=window.setTimeout(()=>{const u=n.getBoundingClientRect();this._isDragging=!0,this._clearSelectionArea=!1,i=!0,this._startX=l.clientX-u.left,this._endX=this._startX},150)},s=l=>{const u=n.getBoundingClientRect();if(i&&this._isDragging){this._endX=l.clientX-u.left;const d=Xy(t,this);d&&Zy("dragSelectMove",t,d)}},a=l=>{const u=n.getBoundingClientRect();if(clearTimeout(this._dragTimeout),i&&this._isDragging){this._endX=l.clientX-u.left,i=!1,this._isDragging=!1;const d=Xy(t,this);d?Zy("dragSelect",t,d):this.clearSelectionArea()}};n.addEventListener("mousedown",r),n.addEventListener("mousemove",s),n.addEventListener("mouseup",a),this._dragSelectHandlers={onMouseDown:r,onMouseMove:s,onMouseUp:a}}beforeDestroy(t){const n=t.canvas;if(this._dragSelectHandlers){const{onMouseDown:i,onMouseMove:r,onMouseUp:s}=this._dragSelectHandlers;n.removeEventListener("mousedown",i),n.removeEventListener("mousemove",r),n.removeEventListener("mouseup",s)}this._isDragging=!1,this._dragTimeout&&clearTimeout(this._dragTimeout)}afterDatasetsDraw(t){(this._isDragging||!this._clearSelectionArea)&&(yN(t,this._startX,this._endX),gN(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const bN=20,xN="rgba(255, 171, 171, 0.4)",wN="rgba(255, 196, 0, 0.2)",Qy=(e,t,n)=>{const i=t.y-e.y;if(i===0)return t.x;const r=(n-e.y)/i;return e.x+r*(t.x-e.x)},Jy=e=>"yAxisID"in e&&e.yAxisID||rl,t_=(e,t)=>{const n=e.data.datasets.find(i=>i.rawMetric===t);return n?Jy(n):rl},vN=(e,t,n=rl)=>{const i=[];return e.data.datasets.forEach(r=>{if(!e.getDatasetMeta(e.data.datasets.indexOf(r)).visible||Jy(r)!==n)return;const a=r.data;a?.length&&t.filter(l=>l.highlightIntersections).forEach(l=>{const u=a.map(h=>({ts:h.x,aboveThreshold:h.y>=l.value}));let d=u[0].aboveThreshold?a[0].x:void 0;for(let h=1;h<u.length;h++)!u[h-1].aboveThreshold&&u[h].aboveThreshold?d=Qy(a[h-1],a[h],l.value):u[h-1].aboveThreshold&&!u[h].aboveThreshold&&d!==void 0&&(i.push({start:d,end:Qy(a[h-1],a[h],l.value),type:l.type}),d=void 0);d!==void 0&&i.push({start:d,end:u[u.length-1].ts,type:l.type})})}),i},SN=e=>{if(!e.length)return[];e.sort((n,i)=>n.type.localeCompare(i.type)||n.start-i.start);const t=[];for(const n of e){const i=t.findLast(({type:r})=>r===n.type);i&&n.start<=i.end?i.end=Math.max(i.end,n.end):t.push({...n})}return t};class TN{constructor(t){this.i18n=t}i18n;id="thresholdPlugin";_thresholds;_mouseMoveHandler;_syncThresholds(t){for(const n of Object.keys(t.threshold||{})){const i=t.threshold?.[n];i&&(this._thresholds={...this._thresholds,[n]:i.map(r=>({...r,hovered:!1}))})}if(this._thresholds)for(const n of Object.keys(this._thresholds))t.threshold?.[n]||delete this._thresholds[n]}get thresholds(){return this._thresholds}beforeUpdate(t,n,i){this._syncThresholds(i)}beforeInit(t,n,i){const r=t.canvas;this._syncThresholds(i);const s=a=>{if(t){const l=a.clientY,u=r.getBoundingClientRect();for(const d of Object.keys(this._thresholds||{})){const m=(t.scales[t_(t,d)]??t.scales.y).getValueForPixel(l-u.top);if(m){const g=this._thresholds?.[d];g&&g.forEach(_=>{_.hovered=Math.abs(_.value-m)<bN})}}}};r.addEventListener("mousemove",s),this._mouseMoveHandler=s}afterDatasetsDraw(t,n){const i=t.ctx;for(const r of Object.keys(this._thresholds||{})){const s=this._thresholds?.[r];if(s){const a=t_(t,r),l=t.scales[a]??t.scales.y;s.forEach(h=>{const m=l.getPixelForValue(h.value);i.save(),i.beginPath(),i.moveTo(t.chartArea.left,m),i.lineTo(t.chartArea.right,m),i.lineWidth=1,i.strokeStyle=ju(h.type),i.setLineDash([5,5]),i.stroke(),i.restore();let g="";h.label?g=`${h.label}: ${h.value}`:h.type==="warning"?g=this.i18n.t("chartLabels.threshold-warning",{value:h.value}):h.type==="error"?g=this.i18n.t("chartLabels.threshold-error",{value:h.value}):g=this.i18n.t("chartLabels.thatreshold-neutral",{value:h.value}),h.hovered&&(i.save(),i.fillStyle=ju(h.type),i.font=pS,i.fillText(g,t.chartArea.left,m-4),i.restore())});const u=vN(t,s,a);SN(u).forEach(h=>{const m=t.scales.x.getPixelForValue(h.start),g=t.scales.x.getPixelForValue(h.end);i.save(),i.fillStyle=h.type==="error"?xN:wN,i.fillRect(m,t.chartArea.top,g-m,t.chartArea.bottom-t.chartArea.top),i.restore(),i.save(),i.beginPath(),i.moveTo(m,t.chartArea.bottom),i.lineTo(g,t.chartArea.bottom),i.lineWidth=2,i.strokeStyle=ju(h.type),i.stroke(),i.restore()})}}}beforeDestroy(t){this._mouseMoveHandler&&t.canvas.removeEventListener("mousemove",this._mouseMoveHandler)}}const kN=Me(f.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:(e,t)=>e.value&&t.value&&t.value.raw-e.value.raw},chartTooltipSortFn:{type:Function,default:(e,t)=>t.rawValue-e.rawValue},brush:{type:Boolean,default:!1},zoomActionItems:{default:void 0},tooltipMetricDisplay:{default:""},threshold:{default:void 0},leftYAxisGrid:{type:Boolean,default:void 0},rightYAxis:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(e,{emit:t}){const n=e,i=t,{i18n:r}=St.useI18n(),s=new Ky,a=new Hy,l=new _N,u=new TN(r),{translateUnit:d}=St.useTranslatedUnits(),h=f.ref(),m=crypto.randomUUID(),g=crypto.randomUUID(),_=f.ref([]),x=f.inject("legendPosition",Le.Bottom),v=f.useTemplateRef("chartParent"),S=f.ref(void 0),C=f.ref(!1),A=f.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:f.toRef(n,"tooltipMetricDisplay"),tooltipSeries:[],left:"",top:"",units:f.toRef(n,"metricUnit"),translateUnit:d,offsetX:0,offsetY:0,width:0,height:0,chartType:n.type,chartID:g,chartTooltipSortFn:n.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:F,tooltipAbsoluteTop:P}=St.useTooltipAbsolutePosition(v,A),B={id:m,afterUpdate(V){_.value=$u(V,n.legendValues,n.chartLegendSortFn)}},N=f.computed(()=>[B,a,...n.brush?[l]:[],...n.type==="timeseries_line"?[s]:[],...n.threshold?[u]:[]]),z=f.computed(()=>`line-${N.value.map(V=>V.id).join("-")}`),k=f.computed(()=>`bar-${N.value.map(V=>V.id).join("-")}`),w=f.computed(()=>n.chartData&&kP(n.chartData)),{options:O}=St.useLineChartOptions({tooltipState:A,timeRangeMs:f.toRef(n,"timeRangeMs"),granularity:f.toRef(n,"granularity"),legendID:m,stacked:f.toRef(n,"stacked"),metricAxesTitle:f.toRef(n,"metricAxesTitle"),dimensionAxesTitle:f.toRef(n,"dimensionAxesTitle"),pointsWithoutHover:w,threshold:f.toRef(n,"threshold"),leftYAxisGrid:f.toRef(n,"leftYAxisGrid"),rightYAxis:f.toRef(n,"rightYAxis")});St.useReportChartDataForSynthetics(f.toRef(n,"chartData"),f.toRef(n,"syntheticsDataKey"));const L=V=>V?V.end.getTime()>V.start.getTime():!1,$=V=>({[Le.Bottom]:"column",[Le.Hidden]:"hidden"})[V],q=({width:V,height:I})=>{A.width=V,A.height=I},st=(V=!0)=>{A.interactionMode="idle",A.showTooltip=!1,l.clearSelectionArea(),a.isPaused&&a.resume(V),s.isPaused&&s.resume()},ct=()=>{A.interactionMode="interactive"},ht=()=>{!h.value||!h.value.chart.tooltip?.dataPoints?.length||(A.interactionMode==="interactive"?s.clickedSegment=h.value.chart.tooltip.dataPoints[0]:s.destroyClickedSegment())},ut=()=>{if(C.value){C.value=!1;return}A.interactionMode!=="idle"?st():ct(),ht()};f.watch(()=>n.type,()=>{A.interactionMode="idle",A.showTooltip=!1,s.destroyClickedSegment()});const vt=V=>{V.preventDefault(),V.stopPropagation();const{xStart:I,xEnd:W}=V.detail,nt={start:new Date(I),end:new Date(W),type:"absolute"};if(!L(nt)){S.value=void 0,st(!1);return}S.value=nt,A.interactionMode="zoom-interactive",nt&&i("select-chart-range",nt)},at=V=>{A.interactionMode="selecting-chart-area",C.value=!0,s.pause(),a.pause();const{xStart:I,xEnd:W}=V.detail;S.value={start:new Date(I),end:new Date(W),type:"absolute"}},dt=V=>{if(!v.value||A.interactionMode==="idle")return;const I=V.target;I&&v.value.contains(I)||C.value||st(!1)};return f.watch(()=>h.value?.chart,()=>{h.value?.chart&&(h.value.chart.canvas.removeEventListener("dragSelect",vt),h.value.chart.canvas.removeEventListener("dragSelectMove",at),h.value.chart.canvas.addEventListener("dragSelect",vt),h.value.chart.canvas.addEventListener("dragSelectMove",at))}),f.onMounted(()=>{document.addEventListener("click",dt,!0)}),f.onUnmounted(()=>{h.value?.chart&&(h.value.chart.canvas.removeEventListener("dragSelect",vt),h.value.chart.canvas.removeEventListener("dragSelectMove",at)),document.removeEventListener("click",dt,!0)}),(V,I)=>(f.openBlock(),f.createElementBlock("div",{ref:"chartParent",class:f.normalizeClass(["chart-parent",$(f.unref(x))]),"data-testid":"line-chart-parent"},[f.createElementVNode("div",{class:"chart-container",onClick:I[0]||(I[0]=W=>ut())},[e.type==="timeseries_line"?(f.openBlock(),f.createBlock(f.unref(Gy),{key:z.value,ref_key:"chartInstance",ref:h,"chart-id":f.unref(g),class:"chart-canvas",data:e.chartData,"data-testid":"time-series-line-chart",options:f.unref(O),plugins:N.value},null,8,["chart-id","data","options","plugins"])):e.type==="timeseries_bar"?(f.openBlock(),f.createBlock(f.unref(qy),{key:k.value,ref_key:"chartInstance",ref:h,"chart-id":f.unref(g),class:"chart-canvas",data:e.chartData,"data-testid":"time-series-bar-chart",options:f.unref(O),plugins:N.value},null,8,["chart-id","data","options","plugins"])):f.createCommentVNode("",!0)]),f.createVNode(Do,{"absolute-left":f.unref(F),"absolute-top":f.unref(P),"data-testid":"tooltip",granularity:e.granularity,state:A,"tooltip-title":e.tooltipTitle,"zoom-action-items":e.zoomActionItems,"zoom-time-range":S.value,onDimensions:q,onOnAction:I[1]||(I[1]=()=>st(!1))},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title","zoom-action-items","zoom-time-range"]),f.createVNode(ml,{id:f.unref(m),"chart-instance":h.value,"data-testid":"legend",items:_.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-28d026be"]]),MN={key:0,class:"chart-truncation-warning","data-testid":"truncation-warning"},DN={class:"tooltip-content"},CN={key:2,class:"analytics-chart-parent"},ON=f.defineComponent({__name:"AnalyticsChart",props:{chartData:{},chartOptions:{},activeMetric:{default:void 0},tooltipTitle:{default:""},emptyStateTitle:{default:""},emptyStateDescription:{default:""},legendPosition:{default:Le.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(e,{emit:t}){const n=t,i=e,{i18n:r}=St.useI18n(),s=f.computed(()=>cd(i.chartData)?void 0:i.chartData),a=f.computed(()=>{const G=i.chartOptions.metricAxisMap,it=s.value?.meta?.metric_names??[];if(!(i.chartOptions.type!=="timeseries_line"||!G||!it.some(lt=>G[lt]==="right")))return G}),l=f.computed(()=>!!a.value),u=(G,it)=>a.value?G.filter(lt=>(a.value?.[lt]??"left")===it):G,d=f.computed(()=>{const G=s.value?.meta,it=G?.metric_names??[];return["timeseries_line","timeseries_bar"].includes(i.chartOptions.type)&&!l.value&&it.length>1&&Object.keys(G?.display??{}).length>0?it:[]}),h=f.computed(()=>d.value.length>1),m=f.computed(()=>i.activeMetric&&d.value.includes(i.activeMetric)?i.activeMetric:d.value[0]),g=f.computed(()=>{const G=s.value;return!G||!h.value||!m.value?G:{...G,meta:{...G.meta,metric_names:[m.value]}}}),_=f.computed(()=>{const G=i.chartOptions.threshold;return!h.value||!G?G:{...G,...Object.fromEntries(Object.keys(G).filter(it=>it!==m.value).map(it=>[it,[]]))}}),x=f.computed(()=>{if(ht.value)return cd(i.chartData)?i.chartData:V0(i.chartData)}),v=f.inject("app:konnectColorMode",f.computed(()=>"light")),S=f.useTemplateRef("chartShell"),C=f.computed(()=>(v.value,ld(S.value))),A=f.computed(()=>{if(x.value){const{start:it,end:lt,metric:$t,metricUnit:_t,truncated:Vt,limit:Te,datasource:ke}=x.value;return{start:it,end:lt,metricNames:[$t],metricUnits:{[$t]:_t??""},truncated:Vt,limit:Te,datasource:ke}}const G=g.value?.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}}),F=f.computed(()=>ht.value?St.useScatterDatasets({colorPalette:i.chartOptions.chartDatasetColors,scatter:i.chartOptions.scatter,themeColors:C},x).value:s.value?st.value?St.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Ku,metricAxisMap:a.value},g).value:St.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Ku},s).value:{datasets:[]}),P=f.computed(()=>i.timeseriesZoom||!!i.exploreLink||!!i.requestsLink),B=f.computed(()=>{if(!i.chartData||s.value&&!s.value.meta)return 0;const{start:G,end:it}=A.value;if(G&&it)return new Date(it).getTime()-new Date(G).getTime()}),N=f.computed(()=>A.value.metricUnits?h.value&&m.value?A.value.metricUnits[m.value]??"":Object.values(A.value.metricUnits)[0]??"":""),z=f.computed(()=>A.value.metricUnits?h.value&&m.value?m.value:Object.keys(A.value.metricUnits)[0]??"":""),k=f.computed(()=>i.showLegendValues&&i.legendPosition!==Le.Hidden),{legendValues:w}=St.useChartLegendValues(F,i.chartOptions.type,N),O=f.computed(()=>A.value.limit?.toString()||null),L=f.computed(()=>i.chartOptions.hideTruncationWarning?!1:A.value.truncated||!1),$=f.computed(()=>r.t("limitedResultsShown",{maxReturned:O.value})),q=f.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),st=f.computed(()=>["timeseries_bar","timeseries_line"].some(G=>G===i.chartOptions.type)),ct=f.computed(()=>i.chartOptions.type==="donut"),ht=f.computed(()=>i.chartOptions.type==="scatter"),ut=f.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),vt=f.computed(()=>{const{metricNames:G,metricUnits:it}=A.value;if(l.value||!G||!it)return;const lt=G[0],$t=it[lt]||"";if(G.length>1){if(lt.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${$t}`,{plural:"s"})});if(lt.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${$t}`,{plural:"s"})})}if(lt)return xo($t)&&r.te(`metricAxisTitles.${lt}`)?r.t(`metricAxisTitles.${lt}`)||void 0:r.te(`chartLabels.${lt}`)?r.t(`chartLabels.${lt}`):lt}),at=f.computed(()=>{const G=i.chartOptions.yAxes?.left?.title??i.chartOptions?.metricAxesTitle;if(G)return G;const{metricNames:it,metricUnits:lt}=A.value;if(!(!it||!lt))return V(u(it,"left"),lt)}),dt=f.computed(()=>{if(!l.value)return;const{metricNames:G,metricUnits:it}=A.value,lt=G&&it?V(u(G,"right"),it):void 0;return{title:i.chartOptions.yAxes?.right?.title??lt,showGrid:i.chartOptions.yAxes?.right?.showGrid}}),V=(G,it)=>{const lt=G[0];if(!lt)return;const $t=it[lt]||"";if(G.length>1){if(lt.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${$t}`,{plural:"s"})});if(lt.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${$t}`,{plural:"s"})})}return I(lt,$t)},I=(G,it)=>{if(r.te(`metricAxisTitles.${G}`)){if(xo(it))return r.t(`metricAxisTitles.${G}`)||void 0;const lt=r.te(`chartUnits.${it}`)?r.t(`chartUnits.${it}`,{plural:"s"}):it;return r.t(`metricAxisTitles.${G}`,{unit:lt})||void 0}return G||void 0},W=f.computed(()=>{if(i.chartOptions?.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const G=s.value?.meta,it=st.value?"Time":Object.keys(G?.display||G?.metric_names||{})[0];if(it)return r.te(`chartLabels.${it}`)?r.t(`chartLabels.${it}`):it}),nt=f.computed(()=>{if(Mx(A.value.datasource))return r.t("timestampAxisTitles.platform");const G=ca(s.value?.meta?.granularity_ms);if(G)return r.te(`granularityAxisTitles.${G}`)?r.t(`granularityAxisTitles.${G}`):G}),ot=f.computed(()=>{const G=x.value?.xMetric;return G?I(G,x.value?.xMetricUnit??""):nt.value}),X=f.computed(()=>i.emptyStateTitle||r.t("noDataAvailableTitle")),tt=f.computed(()=>i.emptyStateDescription||r.t("noDataAvailableDescription")),rt=f.computed(()=>ht.value?!!x.value?.points.length:st.value?MP(F.value):!!(s.value&&s.value.meta&&s.value.data.length)),pt=f.computed(()=>{const G=s.value;return G?G.meta.granularity_ms?ca(G.meta.granularity_ms)||"hourly":ca(new Date(G.data[1].timestamp).getTime()-new Date(G.data[0].timestamp).getTime())||"hourly":"hourly"}),yt=f.computed(()=>ca(s.value?.meta?.granularity_ms)||"secondly"),mt=f.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(G,it)=>G.text===r.t("chartLabels.____OTHER____")?1:it.text===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(G.text,10))&&!isNaN(parseInt(it.text,10))?G.text<it.text?-1:1:G.value&&it.value?it.value.raw-G.value.raw:0),Et=f.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(G,it)=>G.label===r.t("chartLabels.____OTHER____")?1:it.label===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(G.label,10))&&!isNaN(parseInt(it.label,10))?G.label<it.label?-1:1:G.value&&it.value?it.rawValue-G.rawValue:0),zt=f.computed(()=>[...i.timeseriesZoom?[{label:r.t("zoom_action_items.zoom"),key:"zoom-in",action:G=>n("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 f.provide("showLegendValues",k),f.provide("legendPosition",f.toRef(i,"legendPosition")),(G,it)=>{const lt=f.resolveComponent("KTooltip"),$t=f.resolveComponent("KEmptyState");return f.openBlock(),f.createElementBlock("div",{ref:"chartShell",class:f.normalizeClass(["analytics-chart-shell",{"show-values":k.value}])},[rt.value&&L.value&&O.value?(f.openBlock(),f.createElementBlock("div",MN,[f.createVNode(lt,{class:"tooltip","max-width":"500",placement:"right"},{content:f.withCtx(()=>[f.createElementVNode("div",DN,f.toDisplayString($.value),1)]),default:f.withCtx(()=>[f.createVNode(f.unref(fe.WarningIcon),{color:`var(--kui-color-text-warning, ${f.unref(fS)})`,size:`var(--kui-icon-size-40, ${f.unref(mS)})`},null,8,["color","size"])]),_:1})])):f.createCommentVNode("",!0),rt.value?(f.openBlock(),f.createElementBlock("div",CN,[st.value?(f.openBlock(),f.createBlock(kN,{key:0,brush:P.value,"chart-data":F.value,"chart-legend-sort-fn":mt.value,"chart-tooltip-sort-fn":Et.value,"dimension-axes-title":nt.value,fill:e.chartOptions.stacked,granularity:pt.value,"left-y-axis-grid":e.chartOptions.yAxes?.left?.showGrid,"legend-values":f.unref(w),"metric-axes-title":at.value,"metric-unit":N.value,"right-y-axis":dt.value,stacked:e.chartOptions.stacked,"synthetics-data-key":e.syntheticsDataKey,threshold:_.value,"time-range-ms":B.value,"tooltip-metric-display":vt.value,"tooltip-title":e.tooltipTitle,type:e.chartOptions.type,"zoom-action-items":zt.value,onSelectChartRange:it[0]||(it[0]=_t=>n("select-chart-range",_t)),onZoomTimeRange:it[1]||(it[1]=_t=>n("zoom-time-range",_t))},null,8,["brush","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","fill","granularity","left-y-axis-grid","legend-values","metric-axes-title","metric-unit","right-y-axis","stacked","synthetics-data-key","threshold","time-range-ms","tooltip-metric-display","tooltip-title","type","zoom-action-items"])):q.value?(f.openBlock(),f.createBlock(GL,{key:1,annotations:e.showAnnotations,"chart-data":F.value,"chart-legend-sort-fn":mt.value,"chart-tooltip-sort-fn":Et.value,"data-testid":"bar-chart-container","dimension-axes-title":W.value,"legend-values":f.unref(w),"metric-axes-title":at.value,"metric-unit":N.value,orientation:ut.value,stacked:e.chartOptions.stacked,"synthetics-data-key":e.syntheticsDataKey,"tooltip-metric-display":vt.value,"tooltip-title":e.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"])):ct.value?(f.openBlock(),f.createBlock(lN,{key:2,"chart-data":F.value,"dataset-colors":e.chartOptions.chartDatasetColors||f.unref(Ku),"legend-position":e.legendPosition,"legend-values":f.unref(w),"metric-name":z.value,"metric-unit":N.value,"show-center-metric":e.chartOptions.showCenterMetric,"synthetics-data-key":e.syntheticsDataKey,"tooltip-dimension-display":W.value,"tooltip-metric-display":vt.value,"tooltip-title":e.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"])):ht.value?(f.openBlock(),f.createBlock(hN,{key:3,"chart-data":F.value,"chart-legend-sort-fn":e.chartOptions.chartLegendSortFn,"chart-tooltip-sort-fn":Et.value,"data-testid":"scatter-chart-container","dimension-axes-title":ot.value,granularity:yt.value,"metric-axes-title":at.value,"metric-unit":N.value,"shade-outlier-region":e.chartOptions.scatter?.shadeOutlierRegion,"synthetics-data-key":e.syntheticsDataKey,"theme-colors":C.value,"time-range-ms":B.value,"tooltip-metric-display":vt.value,"tooltip-title":e.tooltipTitle,"x-metric":x.value?.xMetric,"x-metric-unit":x.value?.xMetricUnit},null,8,["chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","granularity","metric-axes-title","metric-unit","shade-outlier-region","synthetics-data-key","theme-colors","time-range-ms","tooltip-metric-display","tooltip-title","x-metric","x-metric-unit"])):f.createCommentVNode("",!0)])):(f.openBlock(),f.createBlock($t,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(X.value),1)]),default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(tt.value),1)]),_:1}))],2)}}}),AN=Me(ON,[["__scopeId","data-v-c5c250ba"]]),EN={class:"chart-parent","data-testid":"gauge-chart-parent"},RN={class:"chart-totals-flex"},PN={key:1,class:"metric-small","data-testid":"gauge-chart-total"},IN=Me(f.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:Xn},height:{type:String,required:!1,default:"400px",validator:e=>/(\d *)(px|%)/.test(e)},width:{type:String,required:!1,default:"100%",validator:e=>/(\d *)(px|%)/.test(e)}},setup(e){const t=e,{i18n:n}=St.useI18n(),i=f.ref(kd()),r=f.computed(()=>[t.chartData.datasets.reduce((_,x)=>(_.labels.push(x.label),_.borderColor.push(x.backgroundColor),_.backgroundColor.push(x.backgroundColor),_.data.push(x.data.reduce((v,S)=>v+S,0)),_),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),s=f.computed(()=>({...t.chartData,datasets:r.value}));St.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey"));const a={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},l=f.computed(()=>go(r?.value[0]?.data[t.numerator],{capital:!0})),u=f.computed(()=>go(r?.value[0]?.data[0]+r?.value[0]?.data[1],{capital:!0})),d=f.computed(()=>`color: ${r?.value[0]?.backgroundColor[t.numerator]}`),h=f.computed(()=>["full","single"].includes(t.metricDisplay)),m=f.computed(()=>t.metricDisplay==="full");return(g,_)=>(f.openBlock(),f.createElementBlock("div",EN,[f.createElementVNode("div",RN,[h.value?(f.openBlock(),f.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:f.normalizeStyle(d.value)},f.toDisplayString(l.value),5)):f.createCommentVNode("",!0),m.value?(f.openBlock(),f.createElementBlock("div",PN,f.toDisplayString(f.unref(n).t("total"))+": "+f.toDisplayString(u.value),1)):f.createCommentVNode("",!0)]),f.createElementVNode("div",{class:"chart-container",style:f.normalizeStyle({height:e.height,width:e.width})},[f.createVNode(f.unref(jy),{"chart-id":i.value,data:s.value,options:a},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-c461b83f"]]),LN={key:1,class:"single-value-wrapper"},NN={class:"single-value-metric"},BN={class:"name-unit-alignment"},FN={class:"single-value","data-testid":"single-value-chart"},zN={key:0,class:"single-value-unit"},UN={class:"single-value-metric-name"},HN={key:0,class:"single-value-trend"},WN={key:0,class:"single-value-trend-range","data-testid":"single-value-trend-range"},Dd="t1",Cd="t2",$N=Me(f.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:f0},leftAlign:{type:Boolean,default:!1},showTrend:{type:Boolean,default:!1},increaseIsBad:{type:Boolean,default:!1},alignX:{type:String,default:"left"}},setup(e){const{i18n:t}=St.useI18n(),{formatBytes:n,formatCost:i}=$n({i18n:t}),r=e,s=f.computed(()=>`align-${r.leftAlign?"left":r.alignX}`),a=f.computed(()=>er.buildDeltaMapping(r.data,r.showTrend,{topLevelKey:Dd,secondLevelKey:Cd})),l=f.computed(()=>a.value?.previous?.[Dd]?.[Cd]),u=f.computed(()=>a.value?.current?.[Dd]?.[Cd]),d=f.computed(()=>r.data.data),h=f.computed(()=>r.data.meta?.metric_names?.[0]),m=f.computed(()=>t.te(`chartLabels.${h.value}`)?t.t(`chartLabels.${h.value}`):""),g=f.computed(()=>{const O=h.value?r.data.meta?.metric_units?.[h.value]:void 0;if(O){const L=`chartUnits.${O}`;return t.te(L)?t.t(L,{plural:""}):""}}),_=f.computed(()=>!!h.value&&(h.value.includes("_per_minute")||h.value.includes("_latency_")||h.value==="error_rate")),x=f.computed(()=>r.showTrend&&l.value!==void 0?l.value:null),v=f.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}),S=f.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=f.computed(()=>{const O=v.value;if(O===null)return"-";const L=h.value?r.data.meta?.metric_units?.[h.value]:void 0;if(L==="usd")return i(O);if(L==="bytes")return n(O);if(O>=1e9){const q=(O/1e9).toFixed(1);return q.endsWith(".0")?`${Math.floor(O/1e9)}B`:`${q}B`}if(O>=1e7){const q=(O/1e6).toFixed(1);return q.endsWith(".0")?`${Math.floor(O/1e6)}M`:`${q}M`}const $=r.decimalPoints&&typeof r.decimalPoints=="number"?r.decimalPoints:f0;return O.toLocaleString("en-US",{maximumFractionDigits:$})}),A=f.computed(()=>r.showTrend&&r.data?.data?.length<2),F=f.computed(()=>er.calculateChange(v.value??0,x.value??0)||0),P=f.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 er.changePolarity(F.value,!0,r.increaseIsBad)}),B=f.computed(()=>er.defineIcon(P.value,r.increaseIsBad)),N=f.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 er.metricChange(-1,!0,t.t("singleValue.trend.not_available"))}return er.metricChange(F.value,r.data?.data?.length===2,t.t("singleValue.trend.not_available"))}),z=er.useTrendRange(f.computed(()=>r.showTrend),void 0,f.computed(()=>r.data.meta)),k=O=>O>0?"positive":O<0?"negative":"neutral",w=O=>O>0?dS:O<0?uS:lp;return f.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,L)=>{const $=f.resolveComponent("KEmptyState");return f.openBlock(),f.createElementBlock("div",{class:f.normalizeClass(["chart-parent",s.value]),"data-testid":"single-value-parent"},[S.value?(f.openBlock(),f.createBlock($,{key:0,class:"single-value-error","data-testid":"single-value-error","icon-variant":"error",title:f.unref(t).t("singleValue.valueError")},null,8,["title"])):(f.openBlock(),f.createElementBlock("div",LN,[f.createElementVNode("div",NN,[f.createElementVNode("div",BN,[f.createElementVNode("span",FN,f.toDisplayString(C.value),1),_.value&&g.value?(f.openBlock(),f.createElementBlock("span",zN," "+f.toDisplayString(g.value),1)):f.createCommentVNode("",!0)]),f.createElementVNode("div",UN,f.toDisplayString(m.value),1)]),e.showTrend?(f.openBlock(),f.createElementBlock("div",HN,[f.createElementVNode("div",{class:f.normalizeClass(["trend-change",k(P.value)]),"data-testid":"single-value-trend"},[A.value||P.value!==0?(f.openBlock(),f.createBlock(f.resolveDynamicComponent(B.value),{key:0,color:w(P.value),size:`var(--kui-icon-size-30, ${f.unref(rr)})`},null,8,["color","size"])):(f.openBlock(),f.createBlock(f.unref(fe.EqualIcon),{key:1,color:`var(--kui-color-text-neutral-strong, ${f.unref(lp)})`,size:`var(--kui-icon-size-30, ${f.unref(rr)})`},null,8,["color","size"])),f.createElementVNode("div",null,f.toDisplayString(N.value),1)],2),f.unref(z)?(f.openBlock(),f.createElementBlock("div",WN,f.toDisplayString(f.unref(z)),1)):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0)]))],2)}}}),[["__scopeId","data-v-640d8a8c"]]),VN={class:"simple-chart-shell"},YN={key:1,class:"analytics-chart-parent"},qN=Me(f.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:e=>/(\d *)(px|%)/.test(e)},width:{type:String,required:!1,default:"100%",validator:e=>/(\d *)(px|%)/.test(e)}},setup(e){const t=e,{i18n:n}=St.useI18n(),i=f.computed(()=>{const d=St.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||Xn},f.toRef(t,"chartData")).value;return t.chartOptions?.reverseDataset&&d?.datasets.reverse(),d}),r=f.computed(()=>t.chartData.meta?.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""),s=f.computed(()=>t.chartOptions.type==="gauge"),a=f.computed(()=>t.chartOptions.type==="single_value"),l=f.computed(()=>t.emptyStateTitle||n.t("noDataAvailableTitle")),u=f.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 m=f.resolveComponent("KEmptyState");return f.openBlock(),f.createElementBlock("div",VN,[u.value?(f.openBlock(),f.createElementBlock("div",YN,[s.value?(f.openBlock(),f.createBlock(IN,{key:0,"chart-data":i.value,"dataset-colors":e.chartOptions.chartDatasetColors,"is-simple":"","metric-display":e.chartOptions.metricDisplay,"metric-unit":r.value,numerator:e.chartOptions.numerator,"synthetics-data-key":e.syntheticsDataKey,width:e.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","numerator","synthetics-data-key","width"])):f.createCommentVNode("",!0),a.value?(f.openBlock(),f.createBlock($N,{key:1,"align-x":e.chartOptions.alignX,data:e.chartData,"decimal-points":e.chartOptions.decimalPoints,"increase-is-bad":e.chartOptions.increaseIsBad,"show-trend":e.chartOptions.showTrend},null,8,["align-x","data","decimal-points","increase-is-bad","show-trend"])):f.createCommentVNode("",!0)])):(f.openBlock(),f.createBlock(m,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(l.value),1)]),_:1}))])}}}),[["__scopeId","data-v-23ca8c84"]]),jN={ai_provider:{anthropic:fe.AnthropicIcon,azure:fe.AzureIcon,bedrock:fe.AmazonBedrockIcon,cerebras:fe.CerebrasIcon,cohere:fe.CohereIcon,databricks:fe.DatabricksIcon,deepseek:fe.DeepseekIcon,gemini:fe.GeminiIcon,huggingface:fe.HuggingFaceIcon,llama2:fe.MetaLlamaIcon,mistral:fe.MistralIcon,moonshot:fe.KimiIcon,nvidia:fe.NvidiaIcon,ollama:fe.OllamaIcon,openai:fe.OpenAiIcon,vertex:fe.GoogleVertexIcon,vllm:fe.VllmIcon,xai:fe.GrokIcon}},GN=(e,t)=>{if(!(!e||!t))return jN[e]?.[t.toLowerCase()]},KN=["data-threshold"],XN=Me(f.defineComponent({__name:"TopNMetricBar",props:{ratio:{},threshold:{}},setup(e){f.useCssVars(n=>({v0394367e:f.unref(t)}));const t=Xn[1];return(n,i)=>(f.openBlock(),f.createElementBlock("span",{class:f.normalizeClass(["top-n-metric-cell-bar",{[`top-n-metric-cell--bar-${e.threshold}`]:!!e.threshold}]),"data-testid":"top-n-metric-cell-bar","data-threshold":e.threshold},[f.createElementVNode("span",{class:"top-n-metric-cell-bar-fill",style:f.normalizeStyle({width:`${e.ratio*100}%`})},null,4)],10,KN))}}),[["__scopeId","data-v-24eb60ef"]]),ZN=["data-threshold"],QN={class:"top-n-metric-cell-value"},JN={key:0,class:"top-n-metric-cell-relative","data-testid":"top-n-metric-cell-relative"},tB=Me(f.defineComponent({__name:"TopNMetricCell",props:{display:{},relative:{},threshold:{},hasBar:{type:Boolean}},setup(e){return(t,n)=>(f.openBlock(),f.createElementBlock("span",{class:f.normalizeClass(["top-n-metric-cell",{"top-n-metric-cell--bar":e.hasBar,[`top-n-metric-cell--text-${e.threshold}`]:!e.hasBar&&!!e.threshold}]),"data-threshold":e.threshold},[f.createElementVNode("span",QN,f.toDisplayString(e.display),1),e.relative?(f.openBlock(),f.createElementBlock("span",JN,"("+f.toDisplayString(e.relative)+")",1)):f.createCommentVNode("",!0)],10,ZN))}}),[["__scopeId","data-v-17e7f860"]]),eB={class:"top-n-card-title","data-testid":"top-n-card-title"},nB={class:"top-n-card-description","data-testid":"top-n-card-description"},iB={key:3,class:"top-n-table","data-testid":"top-n-table"},rB={"data-testid":"top-n-table-header"},sB={class:"top-n-table-header-row"},oB=["colspan"],aB={class:"table-header-label"},lB=["data-testid"],cB={class:"top-n-table-cell-label"},uB={key:0,class:"top-n-table-cell top-n-table-cell-bar"},dB=3,fB=Me(f.defineComponent({__name:"TopNTable",props:{title:{default:""},description:{default:""},data:{},emptyStateTitle:{default:""},isLoading:{type:Boolean,default:!1},titleTag:{default:"h2"},columnOptions:{default:void 0}},setup(e){const t=e,{i18n:n}=St.useI18n(),{formatUnit:i}=$n({i18n:n}),r=f.computed(()=>t.data.data),s=f.computed(()=>!!r.value?.length),a=f.computed(()=>t.data.meta?.display?Object.keys(t.data.meta.display).slice(0,dB):[]),l=f.computed(()=>a.value[0]||""),u=f.computed(()=>a.value.length>1),d=f.computed(()=>a.value[a.value.length-1]||""),h=f.computed(()=>l.value?t.data.meta.display[l.value]:{}),m=f.computed(()=>t.data.meta?.metric_names?.length?t.data.meta.metric_names:[]),g=f.computed(()=>m.value[0]),_=f.computed(()=>g.value?dt(g.value):""),x=f.computed(()=>{const I=a.value.map(W=>({key:W,columnKey:W,label:ut(W,u.value?dt(W):n.t("topNTable.nameLabel")),type:"dimension"}));return g.value&&I.push({key:"value",columnKey:g.value,label:ut(g.value,_.value),type:"metric"}),m.value.forEach((W,nt)=>{nt!==0&&I.push({key:W,columnKey:W,label:ut(W,dt(W)),type:"metric"})}),I}),v=f.computed(()=>x.value.filter(I=>I.type==="metric")),S=f.computed(()=>x.value.filter(I=>I.type==="dimension").slice(1)),C=I=>I.type==="dimension"&&I.key===d.value,A=I=>I.type==="metric"&&!!gr(t.columnOptions,I.columnKey)?.bar,F=I=>u.value&&I.type==="dimension"&&!C(I),P=I=>{const W=I.event;return String(W[l.value])},B=(I,W)=>{const nt=String(I.event[W]),ot=t.data.meta?.display?.[W]?.[nt];return{dimension:W,id:nt,name:ot?.name||"-",deleted:!!ot?.deleted}},N=I=>{const W=P(I),nt=h.value&&h.value[W];return nt?nt.name:"-"},z=I=>{const W=P(I),nt=h.value&&h.value[W];return nt?!!nt.deleted:!1},k=I=>{const W=nt=>i(nt,"%",{translateUnit:ot=>V(ot,nt)});return I>0&&I<.01?`< ${W(.01)}`:W(I)},w=(I,W)=>{const nt=I.event[W];if(nt==null)return"–";const ot=typeof nt=="number"?nt:Number(nt);if(Number.isNaN(ot))return"–";const X=t.data.meta?.metric_units?.[W]||"count";if(X==="%")return k(ot);const tt=["count","count/minute","token count"].includes(X);return i(ot,X,{approximate:tt,isBytes1024:!0,translateUnit:rt=>V(rt,ot)})},O=f.computed(()=>Object.fromEntries(m.value.map(I=>[I,zu(r.value.map(W=>Jr(W.event[I])))]))),L=(I,W)=>{const nt=gr(t.columnOptions,W),ot=Jr(I.event[W]);if(!nt||ot===null)return{display:w(I,W)};const X=O.value[W],tt=nt.value==="relative"?Uu(ot,X):null;return{display:w(I,W),relative:tt===null?void 0:k(tt*100),barRatio:nt.bar?y0(ot,X,nt.bar):void 0,threshold:Hu(ot,nt.thresholds)}},$=f.computed(()=>r.value?.length?r.value.map(I=>{const W=a.value.map(tt=>B(I,tt)),nt=W[0],ot=nt?.id||P(I),X={id:ot,rowKey:W.map(tt=>`${tt.dimension}:${tt.id}`).join("|")||ot,name:nt?.name||N(I),deleted:z(I),dimensions:W,metrics:{},original:I};return m.value.forEach((tt,rt)=>{X.metrics[rt===0?"value":tt]=L(I,tt)}),X}):[]),q=f.computed(()=>{if(!s.value)return"";if(t.data.meta){if(a.value.some(I=>!Object.keys(t.data.meta.display[I]||{}).length))return n.t("topNTable.errors.display");if(!g.value)return n.t("topNTable.errors.metricNames")}else return n.t("topNTable.errors.meta");return""}),st=(I,W)=>I.metrics[W]??{display:"–"},ct=(I,W)=>I.dimensions.find(nt=>nt.dimension===W)?.id||"",ht=(I,W)=>GN(gr(t.columnOptions,I)?.icon_set,W),ut=(I,W)=>I&&gr(t.columnOptions,I)?.label||W,vt=(I,W)=>I.dimensions.find(nt=>nt.dimension===W)?.name||"–",at=(I,W)=>{const nt=I.dimensions.find(ot=>ot.dimension===W);return{id:nt?.id||"",name:nt?.name||"–",deleted:nt?.deleted||!1,dimension:W,dimensions:I.dimensions,isEmpty:nt?.id==="empty"}},dt=I=>n.te(`chartLabels.${I}`)?n.t(`chartLabels.${I}`):I,V=(I,W)=>{if(xo(I)||I==="count"||I==="requests")return"";const nt=W===1?"":"s";return n.te(`chartUnits.${I}`)?n.t(`chartUnits.${I}`,{plural:nt}):I};return(I,W)=>{const nt=f.resolveComponent("KEmptyState"),ot=f.resolveComponent("KSkeleton"),X=f.resolveComponent("KCard");return f.openBlock(),f.createBlock(X,{class:"kong-ui-public-top-n-table","title-tag":e.titleTag},f.createSlots({default:f.withCtx(()=>[q.value?(f.openBlock(),f.createBlock(nt,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(f.unref(n).t("topNTable.defaultErrorStateTitle")),1)]),default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(q.value),1)]),_:1})):e.isLoading?(f.openBlock(),f.createBlock(ot,{key:1,"table-columns":2,type:"table"})):s.value?(f.openBlock(),f.createElementBlock("div",iB,[f.createElementVNode("table",{class:f.normalizeClass(["top-n-table-table",{"top-n-table-table--multi-dimension":u.value}])},[f.createElementVNode("thead",rB,[f.createElementVNode("tr",sB,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(x.value,tt=>(f.openBlock(),f.createElementBlock("th",{key:tt.key,class:f.normalizeClass(["top-n-table-header-cell",{"top-n-table-header-cell-metric":tt.type==="metric","top-n-table-header-cell-dimension-compact":F(tt)}]),colspan:A(tt)?2:void 0,"data-testid":"top-n-table-header-column"},[f.createElementVNode("span",aB,f.toDisplayString(tt.label),1),W[0]||(W[0]=f.createElementVNode("div",{class:"top-n-table-header-cell-border"},null,-1))],10,oB))),128))])]),f.createElementVNode("tbody",null,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList($.value,tt=>(f.openBlock(),f.createElementBlock("tr",{key:tt.rowKey,class:"top-n-table-row"},[a.value.length?(f.openBlock(),f.createElementBlock("td",{key:0,class:f.normalizeClass(["top-n-table-cell top-n-table-cell--name",{"top-n-table-cell-dimension-compact":u.value}])},[f.createElementVNode("span",{class:"top-n-table-cell-label","data-testid":`row-${tt.id}`},[ht(l.value,tt.id)?(f.openBlock(),f.createBlock(f.resolveDynamicComponent(ht(l.value,tt.id)),{key:0,class:"top-n-table-cell-icon","data-testid":"top-n-table-cell-icon",decorative:"",size:`var(--kui-icon-size-30, ${f.unref(rr)})`},null,8,["size"])):f.createCommentVNode("",!0),f.renderSlot(I.$slots,"name",{record:{id:tt.id,name:tt.name,deleted:tt.deleted,dimension:l.value,dimensions:tt.dimensions,isEmpty:tt.id==="empty"}},()=>[f.createTextVNode(f.toDisplayString(tt.name),1)],!0)],8,lB)],2)):f.createCommentVNode("",!0),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(S.value,rt=>(f.openBlock(),f.createElementBlock("td",{key:rt.key,class:f.normalizeClass(["top-n-table-cell top-n-table-cell--dimension",{"top-n-table-cell-dimension-compact":!C(rt)}])},[f.createElementVNode("span",cB,[ht(rt.key,ct(tt,rt.key))?(f.openBlock(),f.createBlock(f.resolveDynamicComponent(ht(rt.key,ct(tt,rt.key))),{key:0,class:"top-n-table-cell-icon","data-testid":"top-n-table-cell-icon",decorative:"",size:`var(--kui-icon-size-30, ${f.unref(rr)})`},null,8,["size"])):f.createCommentVNode("",!0),f.renderSlot(I.$slots,"name",{record:at(tt,rt.key)},()=>[f.createTextVNode(f.toDisplayString(vt(tt,rt.key)),1)],!0)])],2))),128)),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(v.value,rt=>(f.openBlock(),f.createElementBlock(f.Fragment,{key:rt.key},[f.createElementVNode("td",{class:f.normalizeClass(["top-n-table-cell top-n-table-cell-metric",{"top-n-table-cell-metric--has-bar":A(rt)}])},[f.createVNode(tB,{"data-testid":rt.key==="value"?`row-${tt.id}`:`row-${tt.id}-${rt.key}`,display:st(tt,rt.key).display,"has-bar":A(rt),relative:st(tt,rt.key).relative,threshold:st(tt,rt.key).threshold},null,8,["data-testid","display","has-bar","relative","threshold"])],2),A(rt)?(f.openBlock(),f.createElementBlock("td",uB,[f.createVNode(XN,{ratio:st(tt,rt.key).barRatio??0,threshold:st(tt,rt.key).threshold},null,8,["ratio","threshold"])])):f.createCommentVNode("",!0)],64))),128))]))),128))])],2)])):(f.openBlock(),f.createBlock(nt,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(e.emptyStateTitle||f.unref(n).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[e.title?{name:"title",fn:f.withCtx(()=>[f.createElementVNode("span",eB,f.toDisplayString(e.title),1)]),key:"0"}:void 0,e.description?{name:"actions",fn:f.withCtx(()=>[f.createElementVNode("div",nB,f.toDisplayString(e.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-9111e441"]]),hB={class:"container"},pB={key:0,class:"no-data","data-testid":"sparkline-empty"},mB=["title"],gB=Me(f.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(e){const t=crypto.randomUUID(),{i18n:n}=St.useI18n(),{syncedGroupSizeMs:i,syncedMinStamp:r,syncedMaxStamp:s,syncedMinCount:a,syncedMaxCount:l,syncedRenderPoints:u,syncedChartDatasets:d}=St.useSparklineSync({chartKey:e.chartKey,datasets:e.datasets,groupKey:e.groupKey,minStamp:e.minStamp,maxStamp:e.maxStamp,minCount:e.minCount,maxCount:e.maxCount,renderPoints:e.pointRenderCount,type:e.type}),h=f.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:"",tooltipSeries:[],left:"",top:"",units:"count",translateUnit:()=>"",offsetX:0,offsetY:0,width:0,height:0,chartType:e.type==="sparkline_bar"?"timeseries_bar":"timeseries_line",chartID:t,interactionMode:"idle"}),m=({width:z,height:k})=>{h.width=z,h.height=k},g=f.computed(()=>e.disableTooltip?[]:[new Ky({enableBrushing:e.groupKey!==void 0&&e.chartKey!==void 0&&e.enableBrushing,brushStrategy:"group",brushGroup:e.groupKey})]),_=f.computed(()=>d.value.reduce((z,{data:k,label:w})=>({...z,[w]:k.reduce((O,{y:L})=>O+L,0)}),{})),x=f.computed(()=>d.value.map(({label:z})=>[_.value[z],`${z}: ${_.value[z]}`]).sort(([z],[k])=>k-z).map(([,z])=>z).join(", ")),v=f.computed(()=>Object.keys(_.value).map(z=>_.value[z]).reduce((z,k)=>z+k,0)),S=f.computed(()=>v.value>0),C=f.computed(()=>({labels:new Array(u.value).fill(""),datasets:d.value})),A=f.computed(()=>e.datasets.length>1),F=`SparklineTooltipPosition-${t}`,P=f.computed(()=>{const z=e.type==="sparkline_bar",k=z?r.value-1:r.value,w=z?s.value:s.value-i.value;return{maintainAspectRatio:!1,elements:{categoryPercentage:1,barPercentage:1,line:{tension:0,stepped:e.type==="sparkline_step",borderWidth:1},point:{radius:0,pointHitRadius:11,pointHoverRadius:0}},interaction:{intersect:!1,mode:"index"},layout:{padding:{left:z?0:2,right:z?0:2,top:2}},plugins:{legend:{display:!1},tooltip:{enabled:!1,position:F,external:O=>{Wu(h,O,"minutely",{contextFormatter:L=>{const $=L+i.value;let q="";return i.value>1440*60*1e3?q=ya(new Date($),"MMM dd, yyy hh:mm a"):q=ya(new Date($),"hh:mm a"),`${yv(L)} - ${q}`}})}}},scales:{x:{min:k,max:w,type:"timeseries",offset:!1,grid:{display:!1},display:!1,stacked:A.value},y:{min:Math.max(a.value-1,0),max:l.value,grid:{display:!1},display:!1,stacked:A.value}}}}),B=f.ref("0"),N=f.ref("0");return f.onMounted(()=>{qe.positioners[F]=function(z,k){if(!z.length||h.interactionMode==="interactive"||k.x===null)return!1;const w=10,O=this.chart.canvas.getBoundingClientRect(),L=h.width||this.width,$=h.height||this.height,q=O.top-$>0,st=q?O.top-$-w:O.top+O.height+w,ct=O.left>L/2-k.x,ht=Math.max(w,window.innerWidth-w-L),ut=Math.min(ht,ct?Math.floor(O.left-L/2)+k.x:0+w);return B.value=`${st}px`,N.value=`${ut}px`,{x:ut,y:st,xAlign:"center",yAlign:q?"top":"bottom"}}}),f.onUnmounted(()=>{qe.positioners[F]&&delete qe.positioners[F]}),(z,k)=>(f.openBlock(),f.createElementBlock("div",hB,[S.value?e.type==="sparkline_bar"?(f.openBlock(),f.createBlock(f.unref(qy),{key:1,"chart-id":f.unref(t),data:C.value,"data-testid":"sparkline-bar",options:P.value,plugins:g.value},null,8,["chart-id","data","options","plugins"])):e.type==="sparkline_line"||e.type==="sparkline_step"?(f.openBlock(),f.createBlock(f.unref(Gy),{key:2,"chart-id":f.unref(t),data:C.value,"data-testid":e.type==="sparkline_line"?"sparkline-line":"sparkline-step",options:P.value,plugins:g.value},null,8,["chart-id","data","data-testid","options","plugins"])):f.createCommentVNode("",!0):(f.openBlock(),f.createElementBlock("div",pB,[f.renderSlot(z.$slots,"empty",{},()=>[f.createTextVNode(f.toDisplayString(f.unref(n).t("sparkline_no_data")),1)],!0)])),e.disableTooltip?f.createCommentVNode("",!0):(f.openBlock(),f.createBlock(Do,{key:3,"absolute-left":N.value,"absolute-top":B.value,class:"tooltip","data-testid":"sparkline-tooltip",state:h,"tooltip-title":e.tooltipTitle,onDimensions:m},null,8,["absolute-left","absolute-top","state","tooltip-title"])),S.value&&e.showLabel?(f.openBlock(),f.createElementBlock("div",{key:4,class:"label",title:z.$slots.label?"":x.value},[f.renderSlot(z.$slots,"label",{total:v.value,totalByDataset:_.value},()=>[f.createTextVNode(f.toDisplayString(x.value),1)],!0)],8,mB)):f.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-ae8259b6"]]),yB=["data-value"],_B=["title"],bB={class:"top-talkers-cell-metric"},xB={class:"top-talkers-cell-value","data-testid":"top-talkers-cell-value"},wB={key:0,class:"top-talkers-cell-relative","data-testid":"top-talkers-cell-relative"},vB={class:"top-talkers-tooltip","data-testid":"top-talkers-tooltip"},SB={class:"top-talkers-tooltip-title"},TB={class:"top-talkers-tooltip-rows"},kB={class:"top-talkers-tooltip-label"},MB=["data-threshold"],DB=Me(f.defineComponent({__name:"TopTalkersCell",props:{cell:{}},setup(e){return f.useCssVars(t=>({cecbd9f0:t.cell.color,v0d35e6b6:t.cell.tint})),(t,n)=>(f.openBlock(),f.createBlock(f.unref(As.KPop),{class:"top-talkers-cell-wrapper",disabled:!e.cell.tooltipRows.length,"hide-caret":"","hide-close-icon":"",placement:"right","popover-timeout":0,style:f.normalizeStyle({flexGrow:e.cell.ratio}),trigger:"hover"},{content:f.withCtx(()=>[f.createElementVNode("div",vB,[f.createElementVNode("div",SB,f.toDisplayString(e.cell.name),1),f.createElementVNode("dl",TB,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(e.cell.tooltipRows,i=>(f.openBlock(),f.createElementBlock(f.Fragment,{key:i.key},[f.createElementVNode("dt",kB,f.toDisplayString(i.label),1),f.createElementVNode("dd",{class:f.normalizeClass(["top-talkers-tooltip-value",i.threshold&&`top-talkers-tooltip-value--${i.threshold}`]),"data-threshold":i.threshold},f.toDisplayString(i.value),11,MB)],64))),128))])])]),default:f.withCtx(()=>[f.createElementVNode("div",{class:f.normalizeClass(["top-talkers-cell",{"top-talkers-cell--other":e.cell.isOther,"top-talkers-cell--empty":e.cell.isEmpty,"top-talkers-cell--deleted":e.cell.deleted}]),"data-testid":"top-talkers-cell","data-value":e.cell.id},[f.createElementVNode("span",{class:"top-talkers-cell-name","data-testid":"top-talkers-cell-name",title:e.cell.name},f.toDisplayString(e.cell.name),9,_B),f.createElementVNode("span",bB,[f.createElementVNode("span",xB,f.toDisplayString(e.cell.display),1),e.cell.relative?(f.openBlock(),f.createElementBlock("span",wB,"("+f.toDisplayString(e.cell.relative)+")",1)):f.createCommentVNode("",!0)])],10,yB)]),_:1},8,["disabled","style"]))}}),[["__scopeId","data-v-73764587"]]),CB=["data-dimension"],OB={class:"top-talkers-column-header"},AB={class:"top-talkers-column-label","data-testid":"top-talkers-column-label"},EB={key:0,class:"top-talkers-column-total","data-testid":"top-talkers-column-total"},RB={key:1,class:"top-talkers-column-empty","data-testid":"top-talkers-column-empty"},PB={key:2,class:"top-talkers-column-cells"},e_=Me(f.defineComponent({__name:"TopTalkersColumn",props:{dimension:{},label:{},data:{},sizeMetric:{},columnOptions:{},isLoading:{type:Boolean}},setup(e){const{i18n:t}=St.useI18n(),{column:n}=St.useTopTalkersData(f.toRef(()=>e.data),f.toRef(()=>e.dimension),f.toRef(()=>e.sizeMetric),f.toRef(()=>e.columnOptions)),i=f.computed(()=>e.label||n.value.label),r=f.computed(()=>t.t("topTalkers.total",{value:n.value.total}));return(s,a)=>(f.openBlock(),f.createElementBlock("div",{class:"top-talkers-column","data-dimension":e.dimension,"data-testid":"top-talkers-column"},[f.createElementVNode("div",OB,[f.createElementVNode("span",AB,f.toDisplayString(i.value),1),!e.isLoading&&f.unref(n).cells.length?(f.openBlock(),f.createElementBlock("span",EB,f.toDisplayString(r.value),1)):f.createCommentVNode("",!0)]),e.isLoading?(f.openBlock(),f.createBlock(f.unref(As.KSkeleton),{key:0,"delay-milliseconds":0,"table-columns":1,type:"table"})):f.unref(n).cells.length?(f.openBlock(),f.createElementBlock("div",PB,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(f.unref(n).cells,l=>(f.openBlock(),f.createBlock(DB,{key:l.id,cell:l},null,8,["cell"]))),128))])):(f.openBlock(),f.createElementBlock("div",RB,f.toDisplayString(f.unref(t).t("topTalkers.defaultEmptyStateTitle")),1))],8,CB))}}),[["__scopeId","data-v-e1b08041"]]),IB={class:"top-talkers-card-title","data-testid":"top-talkers-card-title"},LB={key:2,class:"top-talkers-grid","data-testid":"top-talkers-grid"},NB=Me(f.defineComponent({__name:"TopTalkersGrid",props:{title:{default:""},columns:{},sizeMetric:{default:void 0},columnOptions:{default:void 0},emptyStateTitle:{default:""},errorMessage:{default:""},titleTag:{default:"h2"}},setup(e){const t=e,{i18n:n}=St.useI18n(),i=f.useSlots(),r=f.computed(()=>!!i.column),s=f.computed(()=>r.value||t.columns.some(a=>!!a.data?.data?.length||a.isLoading));return(a,l)=>(f.openBlock(),f.createBlock(f.unref(As.KCard),{class:"kong-ui-public-top-talkers","title-tag":e.titleTag},f.createSlots({default:f.withCtx(()=>[e.errorMessage?(f.openBlock(),f.createBlock(f.unref(As.KEmptyState),{key:0,"action-button-visible":!1,"data-testid":"top-talkers-error-state","icon-variant":"error"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(f.unref(n).t("topTalkers.defaultErrorStateTitle")),1)]),default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(e.errorMessage),1)]),_:1})):s.value?(f.openBlock(),f.createElementBlock("div",LB,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(e.columns,(u,d)=>f.renderSlot(a.$slots,"column",{key:`${u.dimension}-${d}`,column:u},()=>[f.createVNode(e_,{"column-options":e.columnOptions,data:u.data,dimension:u.dimension,"is-loading":u.isLoading,label:u.label,"size-metric":e.sizeMetric},null,8,["column-options","data","dimension","is-loading","label","size-metric"])],!0)),128))])):(f.openBlock(),f.createBlock(f.unref(As.KEmptyState),{key:1,"action-button-visible":!1,"data-testid":"top-talkers-empty-state"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(e.emptyStateTitle||f.unref(n).t("topTalkers.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[e.title?{name:"title",fn:f.withCtx(()=>[f.createElementVNode("span",IB,f.toDisplayString(e.title),1)]),key:"0"}:void 0]),1032,["title-tag"]))}}),[["__scopeId","data-v-d5bb8abd"]]);var Hi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Co={exports:{}};var BB=Co.exports,n_;function FB(){return n_||(n_=1,(function(e,t){(function(){var n,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,m="__lodash_placeholder__",g=1,_=2,x=4,v=1,S=2,C=1,A=2,F=4,P=8,B=16,N=32,z=64,k=128,w=256,O=512,L=30,$="...",q=800,st=16,ct=1,ht=2,ut=3,vt=1/0,at=9007199254740991,dt=17976931348623157e292,V=NaN,I=4294967295,W=I-1,nt=I>>>1,ot=[["ary",k],["bind",C],["bindKey",A],["curry",P],["curryRight",B],["flip",O],["partial",N],["partialRight",z],["rearg",w]],X="[object Arguments]",tt="[object Array]",rt="[object AsyncFunction]",pt="[object Boolean]",yt="[object Date]",mt="[object DOMException]",Et="[object Error]",zt="[object Function]",G="[object GeneratorFunction]",it="[object Map]",lt="[object Number]",$t="[object Null]",_t="[object Object]",Vt="[object Promise]",Te="[object Proxy]",ke="[object RegExp]",ae="[object Set]",cn="[object String]",qt="[object Symbol]",Be="[object Undefined]",re="[object WeakMap]",De="[object WeakSet]",Pe="[object ArrayBuffer]",gn="[object DataView]",Wi="[object Float32Array]",Cn="[object Float64Array]",je="[object Int8Array]",Ln="[object Int16Array]",di="[object Int32Array]",Oo="[object Uint8Array]",Ao="[object Uint8ClampedArray]",Tr="[object Uint16Array]",fi="[object Uint32Array]",Eo=/\b__p \+= '';/g,Ro=/\b(__p \+=) '' \+/g,Po=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$i=/&(?:amp|lt|gt|quot|#39);/g,bl=/[&<>"']/g,Od=RegExp($i.source),Ad=RegExp(bl.source),Ed=/<%-([\s\S]+?)%>/g,Rd=/<%([\s\S]+?)%>/g,Io=/<%=([\s\S]+?)%>/g,xl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,hi=/^\w*$/,Pd=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Lo=/[\\^$.*+?()[\]{}|]/g,Id=RegExp(Lo.source),No=/^\s+/,Ld=/\s/,Nn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Nd=/\{\n\/\* \[wrapped with (.+)\] \*/,Bd=/,? & /,Fd=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,wl=/[()=,{}\[\]\/\s]/,zd=/\\(\\)?/g,Vi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,vl=/\w*$/,Ud=/^[-+]0x[0-9a-f]+$/i,Hd=/^0b[01]+$/i,Wd=/^\[object .+?Constructor\]$/,$d=/^0o[0-7]+$/i,Yi=/^(?:0|[1-9]\d*)$/,Vd=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ls=/($^)/,Yd=/['\n\r\u2028\u2029\\]/g,cs="\\ud800-\\udfff",qd="\\u0300-\\u036f",jd="\\ufe20-\\ufe2f",Sl="\\u20d0-\\u20ff",kr=qd+jd+Sl,Tl="\\u2700-\\u27bf",us="a-z\\xdf-\\xf6\\xf8-\\xff",Gd="\\xac\\xb1\\xd7\\xf7",Kd="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Xd="\\u2000-\\u206f",Zd=" \\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",kl="A-Z\\xc0-\\xd6\\xd8-\\xde",Ml="\\ufe0e\\ufe0f",ds=Gd+Kd+Xd+Zd,Bo="['’]",Qd="["+cs+"]",Dl="["+ds+"]",fs="["+kr+"]",Cl="\\d+",Jd="["+Tl+"]",Ol="["+us+"]",Fo="[^"+cs+ds+Cl+Tl+us+kl+"]",zo="\\ud83c[\\udffb-\\udfff]",tf="(?:"+fs+"|"+zo+")",Mr="[^"+cs+"]",Zn="(?:\\ud83c[\\udde6-\\uddff]){2}",hs="[\\ud800-\\udbff][\\udc00-\\udfff]",un="["+kl+"]",Al="\\u200d",El="(?:"+Ol+"|"+Fo+")",ef="(?:"+un+"|"+Fo+")",Rl="(?:"+Bo+"(?:d|ll|m|re|s|t|ve))?",Pl="(?:"+Bo+"(?:D|LL|M|RE|S|T|VE))?",Il=tf+"?",Uo="["+Ml+"]?",pi="(?:"+Al+"(?:"+[Mr,Zn,hs].join("|")+")"+Uo+Il+")*",nf="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ll="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Nl=Uo+Il+pi,Ho="(?:"+[Jd,Zn,hs].join("|")+")"+Nl,Bl="(?:"+[Mr+fs+"?",fs,Zn,hs,Qd].join("|")+")",rf=RegExp(Bo,"g"),sf=RegExp(fs,"g"),ps=RegExp(zo+"(?="+zo+")|"+Bl+Nl,"g"),of=RegExp([un+"?"+Ol+"+"+Rl+"(?="+[Dl,un,"$"].join("|")+")",ef+"+"+Pl+"(?="+[Dl,un+El,"$"].join("|")+")",un+"?"+El+"+"+Rl,un+"+"+Pl,Ll,nf,Cl,Ho].join("|"),"g"),ms=RegExp("["+Al+cs+kr+Ml+"]"),af=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Wo=["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"],lf=-1,ne={};ne[Wi]=ne[Cn]=ne[je]=ne[Ln]=ne[di]=ne[Oo]=ne[Ao]=ne[Tr]=ne[fi]=!0,ne[X]=ne[tt]=ne[Pe]=ne[pt]=ne[gn]=ne[yt]=ne[Et]=ne[zt]=ne[it]=ne[lt]=ne[_t]=ne[ke]=ne[ae]=ne[cn]=ne[re]=!1;var D={};D[X]=D[tt]=D[Pe]=D[gn]=D[pt]=D[yt]=D[Wi]=D[Cn]=D[je]=D[Ln]=D[di]=D[it]=D[lt]=D[_t]=D[ke]=D[ae]=D[cn]=D[qt]=D[Oo]=D[Ao]=D[Tr]=D[fi]=!0,D[Et]=D[zt]=D[re]=!1;var Y={À:"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"},J={"&":"&","<":"<",">":">",'"':""","'":"'"},xt={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ce={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ge=parseFloat,Bn=parseInt,Fe=typeof Hi=="object"&&Hi&&Hi.Object===Object&&Hi,Fl=typeof self=="object"&&self&&self.Object===Object&&self,ue=Fe||Fl||Function("return this")(),gs=t&&!t.nodeType&&t,Qn=gs&&!0&&e&&!e.nodeType&&e,$o=Qn&&Qn.exports===gs,Dr=$o&&Fe.process,ze=(function(){try{var U=Qn&&Qn.require&&Qn.require("util").types;return U||Dr&&Dr.binding&&Dr.binding("util")}catch{}})(),a_=ze&&ze.isArrayBuffer,l_=ze&&ze.isDate,c_=ze&&ze.isMap,u_=ze&&ze.isRegExp,d_=ze&&ze.isSet,f_=ze&&ze.isTypedArray;function yn(U,K,j){switch(j.length){case 0:return U.call(K);case 1:return U.call(K,j[0]);case 2:return U.call(K,j[0],j[1]);case 3:return U.call(K,j[0],j[1],j[2])}return U.apply(K,j)}function QB(U,K,j,gt){for(var Ot=-1,jt=U==null?0:U.length;++Ot<jt;){var Oe=U[Ot];K(gt,Oe,j(Oe),U)}return gt}function _n(U,K){for(var j=-1,gt=U==null?0:U.length;++j<gt&&K(U[j],j,U)!==!1;);return U}function JB(U,K){for(var j=U==null?0:U.length;j--&&K(U[j],j,U)!==!1;);return U}function h_(U,K){for(var j=-1,gt=U==null?0:U.length;++j<gt;)if(!K(U[j],j,U))return!1;return!0}function qi(U,K){for(var j=-1,gt=U==null?0:U.length,Ot=0,jt=[];++j<gt;){var Oe=U[j];K(Oe,j,U)&&(jt[Ot++]=Oe)}return jt}function zl(U,K){var j=U==null?0:U.length;return!!j&&ys(U,K,0)>-1}function cf(U,K,j){for(var gt=-1,Ot=U==null?0:U.length;++gt<Ot;)if(j(K,U[gt]))return!0;return!1}function de(U,K){for(var j=-1,gt=U==null?0:U.length,Ot=Array(gt);++j<gt;)Ot[j]=K(U[j],j,U);return Ot}function ji(U,K){for(var j=-1,gt=K.length,Ot=U.length;++j<gt;)U[Ot+j]=K[j];return U}function uf(U,K,j,gt){var Ot=-1,jt=U==null?0:U.length;for(gt&&jt&&(j=U[++Ot]);++Ot<jt;)j=K(j,U[Ot],Ot,U);return j}function tF(U,K,j,gt){var Ot=U==null?0:U.length;for(gt&&Ot&&(j=U[--Ot]);Ot--;)j=K(j,U[Ot],Ot,U);return j}function df(U,K){for(var j=-1,gt=U==null?0:U.length;++j<gt;)if(K(U[j],j,U))return!0;return!1}var eF=ff("length");function nF(U){return U.split("")}function iF(U){return U.match(Fd)||[]}function p_(U,K,j){var gt;return j(U,function(Ot,jt,Oe){if(K(Ot,jt,Oe))return gt=jt,!1}),gt}function Ul(U,K,j,gt){for(var Ot=U.length,jt=j+(gt?1:-1);gt?jt--:++jt<Ot;)if(K(U[jt],jt,U))return jt;return-1}function ys(U,K,j){return K===K?mF(U,K,j):Ul(U,m_,j)}function rF(U,K,j,gt){for(var Ot=j-1,jt=U.length;++Ot<jt;)if(gt(U[Ot],K))return Ot;return-1}function m_(U){return U!==U}function g_(U,K){var j=U==null?0:U.length;return j?pf(U,K)/j:V}function ff(U){return function(K){return K==null?n:K[U]}}function hf(U){return function(K){return U==null?n:U[K]}}function y_(U,K,j,gt,Ot){return Ot(U,function(jt,Oe,ie){j=gt?(gt=!1,jt):K(j,jt,Oe,ie)}),j}function sF(U,K){var j=U.length;for(U.sort(K);j--;)U[j]=U[j].value;return U}function pf(U,K){for(var j,gt=-1,Ot=U.length;++gt<Ot;){var jt=K(U[gt]);jt!==n&&(j=j===n?jt:j+jt)}return j}function mf(U,K){for(var j=-1,gt=Array(U);++j<U;)gt[j]=K(j);return gt}function oF(U,K){return de(K,function(j){return[j,U[j]]})}function __(U){return U&&U.slice(0,v_(U)+1).replace(No,"")}function bn(U){return function(K){return U(K)}}function gf(U,K){return de(K,function(j){return U[j]})}function Vo(U,K){return U.has(K)}function b_(U,K){for(var j=-1,gt=U.length;++j<gt&&ys(K,U[j],0)>-1;);return j}function x_(U,K){for(var j=U.length;j--&&ys(K,U[j],0)>-1;);return j}function aF(U,K){for(var j=U.length,gt=0;j--;)U[j]===K&&++gt;return gt}var lF=hf(Y),cF=hf(J);function uF(U){return"\\"+Ce[U]}function dF(U,K){return U==null?n:U[K]}function _s(U){return ms.test(U)}function fF(U){return af.test(U)}function hF(U){for(var K,j=[];!(K=U.next()).done;)j.push(K.value);return j}function yf(U){var K=-1,j=Array(U.size);return U.forEach(function(gt,Ot){j[++K]=[Ot,gt]}),j}function w_(U,K){return function(j){return U(K(j))}}function Gi(U,K){for(var j=-1,gt=U.length,Ot=0,jt=[];++j<gt;){var Oe=U[j];(Oe===K||Oe===m)&&(U[j]=m,jt[Ot++]=j)}return jt}function Hl(U){var K=-1,j=Array(U.size);return U.forEach(function(gt){j[++K]=gt}),j}function pF(U){var K=-1,j=Array(U.size);return U.forEach(function(gt){j[++K]=[gt,gt]}),j}function mF(U,K,j){for(var gt=j-1,Ot=U.length;++gt<Ot;)if(U[gt]===K)return gt;return-1}function gF(U,K,j){for(var gt=j+1;gt--;)if(U[gt]===K)return gt;return gt}function bs(U){return _s(U)?_F(U):eF(U)}function Fn(U){return _s(U)?bF(U):nF(U)}function v_(U){for(var K=U.length;K--&&Ld.test(U.charAt(K)););return K}var yF=hf(xt);function _F(U){for(var K=ps.lastIndex=0;ps.test(U);)++K;return K}function bF(U){return U.match(ps)||[]}function xF(U){return U.match(of)||[]}var wF=(function U(K){K=K==null?ue:xs.defaults(ue.Object(),K,xs.pick(ue,Wo));var j=K.Array,gt=K.Date,Ot=K.Error,jt=K.Function,Oe=K.Math,ie=K.Object,_f=K.RegExp,vF=K.String,On=K.TypeError,Wl=j.prototype,SF=jt.prototype,ws=ie.prototype,$l=K["__core-js_shared__"],Vl=SF.toString,Kt=ws.hasOwnProperty,TF=0,S_=(function(){var o=/[^.]+$/.exec($l&&$l.keys&&$l.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),Yl=ws.toString,kF=Vl.call(ie),MF=ue._,DF=_f("^"+Vl.call(Kt).replace(Lo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ql=$o?K.Buffer:n,Ki=K.Symbol,jl=K.Uint8Array,T_=ql?ql.allocUnsafe:n,Gl=w_(ie.getPrototypeOf,ie),k_=ie.create,M_=ws.propertyIsEnumerable,Kl=Wl.splice,D_=Ki?Ki.isConcatSpreadable:n,Yo=Ki?Ki.iterator:n,Cr=Ki?Ki.toStringTag:n,Xl=(function(){try{var o=Pr(ie,"defineProperty");return o({},"",{}),o}catch{}})(),CF=K.clearTimeout!==ue.clearTimeout&&K.clearTimeout,OF=gt&>.now!==ue.Date.now&>.now,AF=K.setTimeout!==ue.setTimeout&&K.setTimeout,Zl=Oe.ceil,Ql=Oe.floor,bf=ie.getOwnPropertySymbols,EF=ql?ql.isBuffer:n,C_=K.isFinite,RF=Wl.join,PF=w_(ie.keys,ie),Ae=Oe.max,Ke=Oe.min,IF=gt.now,LF=K.parseInt,O_=Oe.random,NF=Wl.reverse,xf=Pr(K,"DataView"),qo=Pr(K,"Map"),wf=Pr(K,"Promise"),vs=Pr(K,"Set"),jo=Pr(K,"WeakMap"),Go=Pr(ie,"create"),Jl=jo&&new jo,Ss={},BF=Ir(xf),FF=Ir(qo),zF=Ir(wf),UF=Ir(vs),HF=Ir(jo),tc=Ki?Ki.prototype:n,Ko=tc?tc.valueOf:n,A_=tc?tc.toString:n;function T(o){if(ye(o)&&!Pt(o)&&!(o instanceof Ht)){if(o instanceof An)return o;if(Kt.call(o,"__wrapped__"))return Eb(o)}return new An(o)}var Ts=(function(){function o(){}return function(c){if(!pe(c))return{};if(k_)return k_(c);o.prototype=c;var p=new o;return o.prototype=n,p}})();function ec(){}function An(o,c){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=n}T.templateSettings={escape:Ed,evaluate:Rd,interpolate:Io,variable:"",imports:{_:T}},T.prototype=ec.prototype,T.prototype.constructor=T,An.prototype=Ts(ec.prototype),An.prototype.constructor=An;function Ht(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=I,this.__views__=[]}function WF(){var o=new Ht(this.__wrapped__);return o.__actions__=dn(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=dn(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=dn(this.__views__),o}function $F(){if(this.__filtered__){var o=new Ht(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function VF(){var o=this.__wrapped__.value(),c=this.__dir__,p=Pt(o),y=c<0,b=p?o.length:0,M=nU(0,b,this.__views__),E=M.start,R=M.end,H=R-E,Z=y?R:E-1,Q=this.__iteratees__,et=Q.length,ft=0,wt=Ke(H,this.__takeCount__);if(!p||!y&&b==H&&wt==H)return tb(o,this.__actions__);var Dt=[];t:for(;H--&&ft<wt;){Z+=c;for(var Bt=-1,kt=o[Z];++Bt<et;){var Ut=Q[Bt],Wt=Ut.iteratee,vn=Ut.type,nn=Wt(kt);if(vn==ht)kt=nn;else if(!nn){if(vn==ct)continue t;break t}}Dt[ft++]=kt}return Dt}Ht.prototype=Ts(ec.prototype),Ht.prototype.constructor=Ht;function Or(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var y=o[c];this.set(y[0],y[1])}}function YF(){this.__data__=Go?Go(null):{},this.size=0}function qF(o){var c=this.has(o)&&delete this.__data__[o];return this.size-=c?1:0,c}function jF(o){var c=this.__data__;if(Go){var p=c[o];return p===d?n:p}return Kt.call(c,o)?c[o]:n}function GF(o){var c=this.__data__;return Go?c[o]!==n:Kt.call(c,o)}function KF(o,c){var p=this.__data__;return this.size+=this.has(o)?0:1,p[o]=Go&&c===n?d:c,this}Or.prototype.clear=YF,Or.prototype.delete=qF,Or.prototype.get=jF,Or.prototype.has=GF,Or.prototype.set=KF;function mi(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var y=o[c];this.set(y[0],y[1])}}function XF(){this.__data__=[],this.size=0}function ZF(o){var c=this.__data__,p=nc(c,o);if(p<0)return!1;var y=c.length-1;return p==y?c.pop():Kl.call(c,p,1),--this.size,!0}function QF(o){var c=this.__data__,p=nc(c,o);return p<0?n:c[p][1]}function JF(o){return nc(this.__data__,o)>-1}function tz(o,c){var p=this.__data__,y=nc(p,o);return y<0?(++this.size,p.push([o,c])):p[y][1]=c,this}mi.prototype.clear=XF,mi.prototype.delete=ZF,mi.prototype.get=QF,mi.prototype.has=JF,mi.prototype.set=tz;function gi(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var y=o[c];this.set(y[0],y[1])}}function ez(){this.size=0,this.__data__={hash:new Or,map:new(qo||mi),string:new Or}}function nz(o){var c=pc(this,o).delete(o);return this.size-=c?1:0,c}function iz(o){return pc(this,o).get(o)}function rz(o){return pc(this,o).has(o)}function sz(o,c){var p=pc(this,o),y=p.size;return p.set(o,c),this.size+=p.size==y?0:1,this}gi.prototype.clear=ez,gi.prototype.delete=nz,gi.prototype.get=iz,gi.prototype.has=rz,gi.prototype.set=sz;function Ar(o){var c=-1,p=o==null?0:o.length;for(this.__data__=new gi;++c<p;)this.add(o[c])}function oz(o){return this.__data__.set(o,d),this}function az(o){return this.__data__.has(o)}Ar.prototype.add=Ar.prototype.push=oz,Ar.prototype.has=az;function zn(o){var c=this.__data__=new mi(o);this.size=c.size}function lz(){this.__data__=new mi,this.size=0}function cz(o){var c=this.__data__,p=c.delete(o);return this.size=c.size,p}function uz(o){return this.__data__.get(o)}function dz(o){return this.__data__.has(o)}function fz(o,c){var p=this.__data__;if(p instanceof mi){var y=p.__data__;if(!qo||y.length<r-1)return y.push([o,c]),this.size=++p.size,this;p=this.__data__=new gi(y)}return p.set(o,c),this.size=p.size,this}zn.prototype.clear=lz,zn.prototype.delete=cz,zn.prototype.get=uz,zn.prototype.has=dz,zn.prototype.set=fz;function E_(o,c){var p=Pt(o),y=!p&&Lr(o),b=!p&&!y&&tr(o),M=!p&&!y&&!b&&Cs(o),E=p||y||b||M,R=E?mf(o.length,vF):[],H=R.length;for(var Z in o)(c||Kt.call(o,Z))&&!(E&&(Z=="length"||b&&(Z=="offset"||Z=="parent")||M&&(Z=="buffer"||Z=="byteLength"||Z=="byteOffset")||bi(Z,H)))&&R.push(Z);return R}function R_(o){var c=o.length;return c?o[Rf(0,c-1)]:n}function hz(o,c){return mc(dn(o),Er(c,0,o.length))}function pz(o){return mc(dn(o))}function vf(o,c,p){(p!==n&&!Hn(o[c],p)||p===n&&!(c in o))&&Jn(o,c,p)}function Xo(o,c,p){var y=o[c];(!(Kt.call(o,c)&&Hn(y,p))||p===n&&!(c in o))&&Jn(o,c,p)}function nc(o,c){for(var p=o.length;p--;)if(Hn(o[p][0],c))return p;return-1}function mz(o,c,p,y){return Xi(o,function(b,M,E){c(y,b,p(b),E)}),y}function P_(o,c){return o&&ei(c,Ie(c),o)}function gz(o,c){return o&&ei(c,hn(c),o)}function Jn(o,c,p){c=="__proto__"&&Xl?Xl(o,c,{configurable:!0,enumerable:!0,value:p,writable:!0}):o[c]=p}function Sf(o,c){for(var p=-1,y=c.length,b=j(y),M=o==null;++p<y;)b[p]=M?n:rh(o,c[p]);return b}function Er(o,c,p){return o===o&&(p!==n&&(o=o<=p?o:p),c!==n&&(o=o>=c?o:c)),o}function En(o,c,p,y,b,M){var E,R=c&g,H=c&_,Z=c&x;if(p&&(E=b?p(o,y,b,M):p(o)),E!==n)return E;if(!pe(o))return o;var Q=Pt(o);if(Q){if(E=rU(o),!R)return dn(o,E)}else{var et=Xe(o),ft=et==zt||et==G;if(tr(o))return ib(o,R);if(et==_t||et==X||ft&&!b){if(E=H||ft?{}:vb(o),!R)return H?jz(o,gz(E,o)):qz(o,P_(E,o))}else{if(!D[et])return b?o:{};E=sU(o,et,R)}}M||(M=new zn);var wt=M.get(o);if(wt)return wt;M.set(o,E),Zb(o)?o.forEach(function(kt){E.add(En(kt,c,p,kt,o,M))}):Kb(o)&&o.forEach(function(kt,Ut){E.set(Ut,En(kt,c,p,Ut,o,M))});var Dt=Z?H?$f:Wf:H?hn:Ie,Bt=Q?n:Dt(o);return _n(Bt||o,function(kt,Ut){Bt&&(Ut=kt,kt=o[Ut]),Xo(E,Ut,En(kt,c,p,Ut,o,M))}),E}function yz(o){var c=Ie(o);return function(p){return I_(p,o,c)}}function I_(o,c,p){var y=p.length;if(o==null)return!y;for(o=ie(o);y--;){var b=p[y],M=c[b],E=o[b];if(E===n&&!(b in o)||!M(E))return!1}return!0}function L_(o,c,p){if(typeof o!="function")throw new On(a);return ia(function(){o.apply(n,p)},c)}function Zo(o,c,p,y){var b=-1,M=zl,E=!0,R=o.length,H=[],Z=c.length;if(!R)return H;p&&(c=de(c,bn(p))),y?(M=cf,E=!1):c.length>=r&&(M=Vo,E=!1,c=new Ar(c));t:for(;++b<R;){var Q=o[b],et=p==null?Q:p(Q);if(Q=y||Q!==0?Q:0,E&&et===et){for(var ft=Z;ft--;)if(c[ft]===et)continue t;H.push(Q)}else M(c,et,y)||H.push(Q)}return H}var Xi=lb(ti),N_=lb(kf,!0);function _z(o,c){var p=!0;return Xi(o,function(y,b,M){return p=!!c(y,b,M),p}),p}function ic(o,c,p){for(var y=-1,b=o.length;++y<b;){var M=o[y],E=c(M);if(E!=null&&(R===n?E===E&&!wn(E):p(E,R)))var R=E,H=M}return H}function bz(o,c,p,y){var b=o.length;for(p=Nt(p),p<0&&(p=-p>b?0:b+p),y=y===n||y>b?b:Nt(y),y<0&&(y+=b),y=p>y?0:Jb(y);p<y;)o[p++]=c;return o}function B_(o,c){var p=[];return Xi(o,function(y,b,M){c(y,b,M)&&p.push(y)}),p}function Ue(o,c,p,y,b){var M=-1,E=o.length;for(p||(p=aU),b||(b=[]);++M<E;){var R=o[M];c>0&&p(R)?c>1?Ue(R,c-1,p,y,b):ji(b,R):y||(b[b.length]=R)}return b}var Tf=cb(),F_=cb(!0);function ti(o,c){return o&&Tf(o,c,Ie)}function kf(o,c){return o&&F_(o,c,Ie)}function rc(o,c){return qi(c,function(p){return xi(o[p])})}function Rr(o,c){c=Qi(c,o);for(var p=0,y=c.length;o!=null&&p<y;)o=o[Un(c[p++])];return p&&p==y?o:n}function z_(o,c,p){var y=c(o);return Pt(o)?y:ji(y,p(o))}function tn(o){return o==null?o===n?Be:$t:Cr&&Cr in ie(o)?eU(o):pU(o)}function Mf(o,c){return o>c}function xz(o,c){return o!=null&&Kt.call(o,c)}function wz(o,c){return o!=null&&c in ie(o)}function vz(o,c,p){return o>=Ke(c,p)&&o<Ae(c,p)}function Df(o,c,p){for(var y=p?cf:zl,b=o[0].length,M=o.length,E=M,R=j(M),H=1/0,Z=[];E--;){var Q=o[E];E&&c&&(Q=de(Q,bn(c))),H=Ke(Q.length,H),R[E]=!p&&(c||b>=120&&Q.length>=120)?new Ar(E&&Q):n}Q=o[0];var et=-1,ft=R[0];t:for(;++et<b&&Z.length<H;){var wt=Q[et],Dt=c?c(wt):wt;if(wt=p||wt!==0?wt:0,!(ft?Vo(ft,Dt):y(Z,Dt,p))){for(E=M;--E;){var Bt=R[E];if(!(Bt?Vo(Bt,Dt):y(o[E],Dt,p)))continue t}ft&&ft.push(Dt),Z.push(wt)}}return Z}function Sz(o,c,p,y){return ti(o,function(b,M,E){c(y,p(b),M,E)}),y}function Qo(o,c,p){c=Qi(c,o),o=Mb(o,c);var y=o==null?o:o[Un(Pn(c))];return y==null?n:yn(y,o,p)}function U_(o){return ye(o)&&tn(o)==X}function Tz(o){return ye(o)&&tn(o)==Pe}function kz(o){return ye(o)&&tn(o)==yt}function Jo(o,c,p,y,b){return o===c?!0:o==null||c==null||!ye(o)&&!ye(c)?o!==o&&c!==c:Mz(o,c,p,y,Jo,b)}function Mz(o,c,p,y,b,M){var E=Pt(o),R=Pt(c),H=E?tt:Xe(o),Z=R?tt:Xe(c);H=H==X?_t:H,Z=Z==X?_t:Z;var Q=H==_t,et=Z==_t,ft=H==Z;if(ft&&tr(o)){if(!tr(c))return!1;E=!0,Q=!1}if(ft&&!Q)return M||(M=new zn),E||Cs(o)?bb(o,c,p,y,b,M):Jz(o,c,H,p,y,b,M);if(!(p&v)){var wt=Q&&Kt.call(o,"__wrapped__"),Dt=et&&Kt.call(c,"__wrapped__");if(wt||Dt){var Bt=wt?o.value():o,kt=Dt?c.value():c;return M||(M=new zn),b(Bt,kt,p,y,M)}}return ft?(M||(M=new zn),tU(o,c,p,y,b,M)):!1}function Dz(o){return ye(o)&&Xe(o)==it}function Cf(o,c,p,y){var b=p.length,M=b,E=!y;if(o==null)return!M;for(o=ie(o);b--;){var R=p[b];if(E&&R[2]?R[1]!==o[R[0]]:!(R[0]in o))return!1}for(;++b<M;){R=p[b];var H=R[0],Z=o[H],Q=R[1];if(E&&R[2]){if(Z===n&&!(H in o))return!1}else{var et=new zn;if(y)var ft=y(Z,Q,H,o,c,et);if(!(ft===n?Jo(Q,Z,v|S,y,et):ft))return!1}}return!0}function H_(o){if(!pe(o)||cU(o))return!1;var c=xi(o)?DF:Wd;return c.test(Ir(o))}function Cz(o){return ye(o)&&tn(o)==ke}function Oz(o){return ye(o)&&Xe(o)==ae}function Az(o){return ye(o)&&wc(o.length)&&!!ne[tn(o)]}function W_(o){return typeof o=="function"?o:o==null?pn:typeof o=="object"?Pt(o)?Y_(o[0],o[1]):V_(o):dx(o)}function Of(o){if(!na(o))return PF(o);var c=[];for(var p in ie(o))Kt.call(o,p)&&p!="constructor"&&c.push(p);return c}function Ez(o){if(!pe(o))return hU(o);var c=na(o),p=[];for(var y in o)y=="constructor"&&(c||!Kt.call(o,y))||p.push(y);return p}function Af(o,c){return o<c}function $_(o,c){var p=-1,y=fn(o)?j(o.length):[];return Xi(o,function(b,M,E){y[++p]=c(b,M,E)}),y}function V_(o){var c=Yf(o);return c.length==1&&c[0][2]?Tb(c[0][0],c[0][1]):function(p){return p===o||Cf(p,o,c)}}function Y_(o,c){return jf(o)&&Sb(c)?Tb(Un(o),c):function(p){var y=rh(p,o);return y===n&&y===c?sh(p,o):Jo(c,y,v|S)}}function sc(o,c,p,y,b){o!==c&&Tf(c,function(M,E){if(b||(b=new zn),pe(M))Rz(o,c,E,p,sc,y,b);else{var R=y?y(Kf(o,E),M,E+"",o,c,b):n;R===n&&(R=M),vf(o,E,R)}},hn)}function Rz(o,c,p,y,b,M,E){var R=Kf(o,p),H=Kf(c,p),Z=E.get(H);if(Z){vf(o,p,Z);return}var Q=M?M(R,H,p+"",o,c,E):n,et=Q===n;if(et){var ft=Pt(H),wt=!ft&&tr(H),Dt=!ft&&!wt&&Cs(H);Q=H,ft||wt||Dt?Pt(R)?Q=R:xe(R)?Q=dn(R):wt?(et=!1,Q=ib(H,!0)):Dt?(et=!1,Q=rb(H,!0)):Q=[]:ra(H)||Lr(H)?(Q=R,Lr(R)?Q=tx(R):(!pe(R)||xi(R))&&(Q=vb(H))):et=!1}et&&(E.set(H,Q),b(Q,H,y,M,E),E.delete(H)),vf(o,p,Q)}function q_(o,c){var p=o.length;if(p)return c+=c<0?p:0,bi(c,p)?o[c]:n}function j_(o,c,p){c.length?c=de(c,function(M){return Pt(M)?function(E){return Rr(E,M.length===1?M[0]:M)}:M}):c=[pn];var y=-1;c=de(c,bn(Mt()));var b=$_(o,function(M,E,R){var H=de(c,function(Z){return Z(M)});return{criteria:H,index:++y,value:M}});return sF(b,function(M,E){return Yz(M,E,p)})}function Pz(o,c){return G_(o,c,function(p,y){return sh(o,y)})}function G_(o,c,p){for(var y=-1,b=c.length,M={};++y<b;){var E=c[y],R=Rr(o,E);p(R,E)&&ta(M,Qi(E,o),R)}return M}function Iz(o){return function(c){return Rr(c,o)}}function Ef(o,c,p,y){var b=y?rF:ys,M=-1,E=c.length,R=o;for(o===c&&(c=dn(c)),p&&(R=de(o,bn(p)));++M<E;)for(var H=0,Z=c[M],Q=p?p(Z):Z;(H=b(R,Q,H,y))>-1;)R!==o&&Kl.call(R,H,1),Kl.call(o,H,1);return o}function K_(o,c){for(var p=o?c.length:0,y=p-1;p--;){var b=c[p];if(p==y||b!==M){var M=b;bi(b)?Kl.call(o,b,1):Lf(o,b)}}return o}function Rf(o,c){return o+Ql(O_()*(c-o+1))}function Lz(o,c,p,y){for(var b=-1,M=Ae(Zl((c-o)/(p||1)),0),E=j(M);M--;)E[y?M:++b]=o,o+=p;return E}function Pf(o,c){var p="";if(!o||c<1||c>at)return p;do c%2&&(p+=o),c=Ql(c/2),c&&(o+=o);while(c);return p}function Ft(o,c){return Xf(kb(o,c,pn),o+"")}function Nz(o){return R_(Os(o))}function Bz(o,c){var p=Os(o);return mc(p,Er(c,0,p.length))}function ta(o,c,p,y){if(!pe(o))return o;c=Qi(c,o);for(var b=-1,M=c.length,E=M-1,R=o;R!=null&&++b<M;){var H=Un(c[b]),Z=p;if(H==="__proto__"||H==="constructor"||H==="prototype")return o;if(b!=E){var Q=R[H];Z=y?y(Q,H,R):n,Z===n&&(Z=pe(Q)?Q:bi(c[b+1])?[]:{})}Xo(R,H,Z),R=R[H]}return o}var X_=Jl?function(o,c){return Jl.set(o,c),o}:pn,Fz=Xl?function(o,c){return Xl(o,"toString",{configurable:!0,enumerable:!1,value:ah(c),writable:!0})}:pn;function zz(o){return mc(Os(o))}function Rn(o,c,p){var y=-1,b=o.length;c<0&&(c=-c>b?0:b+c),p=p>b?b:p,p<0&&(p+=b),b=c>p?0:p-c>>>0,c>>>=0;for(var M=j(b);++y<b;)M[y]=o[y+c];return M}function Uz(o,c){var p;return Xi(o,function(y,b,M){return p=c(y,b,M),!p}),!!p}function oc(o,c,p){var y=0,b=o==null?y:o.length;if(typeof c=="number"&&c===c&&b<=nt){for(;y<b;){var M=y+b>>>1,E=o[M];E!==null&&!wn(E)&&(p?E<=c:E<c)?y=M+1:b=M}return b}return If(o,c,pn,p)}function If(o,c,p,y){var b=0,M=o==null?0:o.length;if(M===0)return 0;c=p(c);for(var E=c!==c,R=c===null,H=wn(c),Z=c===n;b<M;){var Q=Ql((b+M)/2),et=p(o[Q]),ft=et!==n,wt=et===null,Dt=et===et,Bt=wn(et);if(E)var kt=y||Dt;else Z?kt=Dt&&(y||ft):R?kt=Dt&&ft&&(y||!wt):H?kt=Dt&&ft&&!wt&&(y||!Bt):wt||Bt?kt=!1:kt=y?et<=c:et<c;kt?b=Q+1:M=Q}return Ke(M,W)}function Z_(o,c){for(var p=-1,y=o.length,b=0,M=[];++p<y;){var E=o[p],R=c?c(E):E;if(!p||!Hn(R,H)){var H=R;M[b++]=E===0?0:E}}return M}function Q_(o){return typeof o=="number"?o:wn(o)?V:+o}function xn(o){if(typeof o=="string")return o;if(Pt(o))return de(o,xn)+"";if(wn(o))return A_?A_.call(o):"";var c=o+"";return c=="0"&&1/o==-vt?"-0":c}function Zi(o,c,p){var y=-1,b=zl,M=o.length,E=!0,R=[],H=R;if(p)E=!1,b=cf;else if(M>=r){var Z=c?null:Zz(o);if(Z)return Hl(Z);E=!1,b=Vo,H=new Ar}else H=c?[]:R;t:for(;++y<M;){var Q=o[y],et=c?c(Q):Q;if(Q=p||Q!==0?Q:0,E&&et===et){for(var ft=H.length;ft--;)if(H[ft]===et)continue t;c&&H.push(et),R.push(Q)}else b(H,et,p)||(H!==R&&H.push(et),R.push(Q))}return R}function Lf(o,c){c=Qi(c,o);var p=-1,y=c.length;if(!y)return!0;for(;++p<y;){var b=Un(c[p]);if(b==="__proto__"&&!Kt.call(o,"__proto__")||(b==="constructor"||b==="prototype")&&p<y-1)return!1}var M=Mb(o,c);return M==null||delete M[Un(Pn(c))]}function J_(o,c,p,y){return ta(o,c,p(Rr(o,c)),y)}function ac(o,c,p,y){for(var b=o.length,M=y?b:-1;(y?M--:++M<b)&&c(o[M],M,o););return p?Rn(o,y?0:M,y?M+1:b):Rn(o,y?M+1:0,y?b:M)}function tb(o,c){var p=o;return p instanceof Ht&&(p=p.value()),uf(c,function(y,b){return b.func.apply(b.thisArg,ji([y],b.args))},p)}function Nf(o,c,p){var y=o.length;if(y<2)return y?Zi(o[0]):[];for(var b=-1,M=j(y);++b<y;)for(var E=o[b],R=-1;++R<y;)R!=b&&(M[b]=Zo(M[b]||E,o[R],c,p));return Zi(Ue(M,1),c,p)}function eb(o,c,p){for(var y=-1,b=o.length,M=c.length,E={};++y<b;){var R=y<M?c[y]:n;p(E,o[y],R)}return E}function Bf(o){return xe(o)?o:[]}function Ff(o){return typeof o=="function"?o:pn}function Qi(o,c){return Pt(o)?o:jf(o,c)?[o]:Ab(Xt(o))}var Hz=Ft;function Ji(o,c,p){var y=o.length;return p=p===n?y:p,!c&&p>=y?o:Rn(o,c,p)}var nb=CF||function(o){return ue.clearTimeout(o)};function ib(o,c){if(c)return o.slice();var p=o.length,y=T_?T_(p):new o.constructor(p);return o.copy(y),y}function zf(o){var c=new o.constructor(o.byteLength);return new jl(c).set(new jl(o)),c}function Wz(o,c){var p=c?zf(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.byteLength)}function $z(o){var c=new o.constructor(o.source,vl.exec(o));return c.lastIndex=o.lastIndex,c}function Vz(o){return Ko?ie(Ko.call(o)):{}}function rb(o,c){var p=c?zf(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.length)}function sb(o,c){if(o!==c){var p=o!==n,y=o===null,b=o===o,M=wn(o),E=c!==n,R=c===null,H=c===c,Z=wn(c);if(!R&&!Z&&!M&&o>c||M&&E&&H&&!R&&!Z||y&&E&&H||!p&&H||!b)return 1;if(!y&&!M&&!Z&&o<c||Z&&p&&b&&!y&&!M||R&&p&&b||!E&&b||!H)return-1}return 0}function Yz(o,c,p){for(var y=-1,b=o.criteria,M=c.criteria,E=b.length,R=p.length;++y<E;){var H=sb(b[y],M[y]);if(H){if(y>=R)return H;var Z=p[y];return H*(Z=="desc"?-1:1)}}return o.index-c.index}function ob(o,c,p,y){for(var b=-1,M=o.length,E=p.length,R=-1,H=c.length,Z=Ae(M-E,0),Q=j(H+Z),et=!y;++R<H;)Q[R]=c[R];for(;++b<E;)(et||b<M)&&(Q[p[b]]=o[b]);for(;Z--;)Q[R++]=o[b++];return Q}function ab(o,c,p,y){for(var b=-1,M=o.length,E=-1,R=p.length,H=-1,Z=c.length,Q=Ae(M-R,0),et=j(Q+Z),ft=!y;++b<Q;)et[b]=o[b];for(var wt=b;++H<Z;)et[wt+H]=c[H];for(;++E<R;)(ft||b<M)&&(et[wt+p[E]]=o[b++]);return et}function dn(o,c){var p=-1,y=o.length;for(c||(c=j(y));++p<y;)c[p]=o[p];return c}function ei(o,c,p,y){var b=!p;p||(p={});for(var M=-1,E=c.length;++M<E;){var R=c[M],H=y?y(p[R],o[R],R,p,o):n;H===n&&(H=o[R]),b?Jn(p,R,H):Xo(p,R,H)}return p}function qz(o,c){return ei(o,qf(o),c)}function jz(o,c){return ei(o,xb(o),c)}function lc(o,c){return function(p,y){var b=Pt(p)?QB:mz,M=c?c():{};return b(p,o,Mt(y,2),M)}}function ks(o){return Ft(function(c,p){var y=-1,b=p.length,M=b>1?p[b-1]:n,E=b>2?p[2]:n;for(M=o.length>3&&typeof M=="function"?(b--,M):n,E&&en(p[0],p[1],E)&&(M=b<3?n:M,b=1),c=ie(c);++y<b;){var R=p[y];R&&o(c,R,y,M)}return c})}function lb(o,c){return function(p,y){if(p==null)return p;if(!fn(p))return o(p,y);for(var b=p.length,M=c?b:-1,E=ie(p);(c?M--:++M<b)&&y(E[M],M,E)!==!1;);return p}}function cb(o){return function(c,p,y){for(var b=-1,M=ie(c),E=y(c),R=E.length;R--;){var H=E[o?R:++b];if(p(M[H],H,M)===!1)break}return c}}function Gz(o,c,p){var y=c&C,b=ea(o);function M(){var E=this&&this!==ue&&this instanceof M?b:o;return E.apply(y?p:this,arguments)}return M}function ub(o){return function(c){c=Xt(c);var p=_s(c)?Fn(c):n,y=p?p[0]:c.charAt(0),b=p?Ji(p,1).join(""):c.slice(1);return y[o]()+b}}function Ms(o){return function(c){return uf(cx(lx(c).replace(rf,"")),o,"")}}function ea(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 p=Ts(o.prototype),y=o.apply(p,c);return pe(y)?y:p}}function Kz(o,c,p){var y=ea(o);function b(){for(var M=arguments.length,E=j(M),R=M,H=Ds(b);R--;)E[R]=arguments[R];var Z=M<3&&E[0]!==H&&E[M-1]!==H?[]:Gi(E,H);if(M-=Z.length,M<p)return mb(o,c,cc,b.placeholder,n,E,Z,n,n,p-M);var Q=this&&this!==ue&&this instanceof b?y:o;return yn(Q,this,E)}return b}function db(o){return function(c,p,y){var b=ie(c);if(!fn(c)){var M=Mt(p,3);c=Ie(c),p=function(R){return M(b[R],R,b)}}var E=o(c,p,y);return E>-1?b[M?c[E]:E]:n}}function fb(o){return _i(function(c){var p=c.length,y=p,b=An.prototype.thru;for(o&&c.reverse();y--;){var M=c[y];if(typeof M!="function")throw new On(a);if(b&&!E&&hc(M)=="wrapper")var E=new An([],!0)}for(y=E?y:p;++y<p;){M=c[y];var R=hc(M),H=R=="wrapper"?Vf(M):n;H&&Gf(H[0])&&H[1]==(k|P|N|w)&&!H[4].length&&H[9]==1?E=E[hc(H[0])].apply(E,H[3]):E=M.length==1&&Gf(M)?E[R]():E.thru(M)}return function(){var Z=arguments,Q=Z[0];if(E&&Z.length==1&&Pt(Q))return E.plant(Q).value();for(var et=0,ft=p?c[et].apply(this,Z):Q;++et<p;)ft=c[et].call(this,ft);return ft}})}function cc(o,c,p,y,b,M,E,R,H,Z){var Q=c&k,et=c&C,ft=c&A,wt=c&(P|B),Dt=c&O,Bt=ft?n:ea(o);function kt(){for(var Ut=arguments.length,Wt=j(Ut),vn=Ut;vn--;)Wt[vn]=arguments[vn];if(wt)var nn=Ds(kt),Sn=aF(Wt,nn);if(y&&(Wt=ob(Wt,y,b,wt)),M&&(Wt=ab(Wt,M,E,wt)),Ut-=Sn,wt&&Ut<Z){var we=Gi(Wt,nn);return mb(o,c,cc,kt.placeholder,p,Wt,we,R,H,Z-Ut)}var Wn=et?p:this,vi=ft?Wn[o]:o;return Ut=Wt.length,R?Wt=mU(Wt,R):Dt&&Ut>1&&Wt.reverse(),Q&&H<Ut&&(Wt.length=H),this&&this!==ue&&this instanceof kt&&(vi=Bt||ea(vi)),vi.apply(Wn,Wt)}return kt}function hb(o,c){return function(p,y){return Sz(p,o,c(y),{})}}function uc(o,c){return function(p,y){var b;if(p===n&&y===n)return c;if(p!==n&&(b=p),y!==n){if(b===n)return y;typeof p=="string"||typeof y=="string"?(p=xn(p),y=xn(y)):(p=Q_(p),y=Q_(y)),b=o(p,y)}return b}}function Uf(o){return _i(function(c){return c=de(c,bn(Mt())),Ft(function(p){var y=this;return o(c,function(b){return yn(b,y,p)})})})}function dc(o,c){c=c===n?" ":xn(c);var p=c.length;if(p<2)return p?Pf(c,o):c;var y=Pf(c,Zl(o/bs(c)));return _s(c)?Ji(Fn(y),0,o).join(""):y.slice(0,o)}function Xz(o,c,p,y){var b=c&C,M=ea(o);function E(){for(var R=-1,H=arguments.length,Z=-1,Q=y.length,et=j(Q+H),ft=this&&this!==ue&&this instanceof E?M:o;++Z<Q;)et[Z]=y[Z];for(;H--;)et[Z++]=arguments[++R];return yn(ft,b?p:this,et)}return E}function pb(o){return function(c,p,y){return y&&typeof y!="number"&&en(c,p,y)&&(p=y=n),c=wi(c),p===n?(p=c,c=0):p=wi(p),y=y===n?c<p?1:-1:wi(y),Lz(c,p,y,o)}}function fc(o){return function(c,p){return typeof c=="string"&&typeof p=="string"||(c=In(c),p=In(p)),o(c,p)}}function mb(o,c,p,y,b,M,E,R,H,Z){var Q=c&P,et=Q?E:n,ft=Q?n:E,wt=Q?M:n,Dt=Q?n:M;c|=Q?N:z,c&=~(Q?z:N),c&F||(c&=-4);var Bt=[o,c,b,wt,et,Dt,ft,R,H,Z],kt=p.apply(n,Bt);return Gf(o)&&Db(kt,Bt),kt.placeholder=y,Cb(kt,o,c)}function Hf(o){var c=Oe[o];return function(p,y){if(p=In(p),y=y==null?0:Ke(Nt(y),292),y&&C_(p)){var b=(Xt(p)+"e").split("e"),M=c(b[0]+"e"+(+b[1]+y));return b=(Xt(M)+"e").split("e"),+(b[0]+"e"+(+b[1]-y))}return c(p)}}var Zz=vs&&1/Hl(new vs([,-0]))[1]==vt?function(o){return new vs(o)}:uh;function gb(o){return function(c){var p=Xe(c);return p==it?yf(c):p==ae?pF(c):oF(c,o(c))}}function yi(o,c,p,y,b,M,E,R){var H=c&A;if(!H&&typeof o!="function")throw new On(a);var Z=y?y.length:0;if(Z||(c&=-97,y=b=n),E=E===n?E:Ae(Nt(E),0),R=R===n?R:Nt(R),Z-=b?b.length:0,c&z){var Q=y,et=b;y=b=n}var ft=H?n:Vf(o),wt=[o,c,p,y,b,Q,et,M,E,R];if(ft&&fU(wt,ft),o=wt[0],c=wt[1],p=wt[2],y=wt[3],b=wt[4],R=wt[9]=wt[9]===n?H?0:o.length:Ae(wt[9]-Z,0),!R&&c&(P|B)&&(c&=-25),!c||c==C)var Dt=Gz(o,c,p);else c==P||c==B?Dt=Kz(o,c,R):(c==N||c==(C|N))&&!b.length?Dt=Xz(o,c,p,y):Dt=cc.apply(n,wt);var Bt=ft?X_:Db;return Cb(Bt(Dt,wt),o,c)}function yb(o,c,p,y){return o===n||Hn(o,ws[p])&&!Kt.call(y,p)?c:o}function _b(o,c,p,y,b,M){return pe(o)&&pe(c)&&(M.set(c,o),sc(o,c,n,_b,M),M.delete(c)),o}function Qz(o){return ra(o)?n:o}function bb(o,c,p,y,b,M){var E=p&v,R=o.length,H=c.length;if(R!=H&&!(E&&H>R))return!1;var Z=M.get(o),Q=M.get(c);if(Z&&Q)return Z==c&&Q==o;var et=-1,ft=!0,wt=p&S?new Ar:n;for(M.set(o,c),M.set(c,o);++et<R;){var Dt=o[et],Bt=c[et];if(y)var kt=E?y(Bt,Dt,et,c,o,M):y(Dt,Bt,et,o,c,M);if(kt!==n){if(kt)continue;ft=!1;break}if(wt){if(!df(c,function(Ut,Wt){if(!Vo(wt,Wt)&&(Dt===Ut||b(Dt,Ut,p,y,M)))return wt.push(Wt)})){ft=!1;break}}else if(!(Dt===Bt||b(Dt,Bt,p,y,M))){ft=!1;break}}return M.delete(o),M.delete(c),ft}function Jz(o,c,p,y,b,M,E){switch(p){case gn:if(o.byteLength!=c.byteLength||o.byteOffset!=c.byteOffset)return!1;o=o.buffer,c=c.buffer;case Pe:return!(o.byteLength!=c.byteLength||!M(new jl(o),new jl(c)));case pt:case yt:case lt:return Hn(+o,+c);case Et:return o.name==c.name&&o.message==c.message;case ke:case cn:return o==c+"";case it:var R=yf;case ae:var H=y&v;if(R||(R=Hl),o.size!=c.size&&!H)return!1;var Z=E.get(o);if(Z)return Z==c;y|=S,E.set(o,c);var Q=bb(R(o),R(c),y,b,M,E);return E.delete(o),Q;case qt:if(Ko)return Ko.call(o)==Ko.call(c)}return!1}function tU(o,c,p,y,b,M){var E=p&v,R=Wf(o),H=R.length,Z=Wf(c),Q=Z.length;if(H!=Q&&!E)return!1;for(var et=H;et--;){var ft=R[et];if(!(E?ft in c:Kt.call(c,ft)))return!1}var wt=M.get(o),Dt=M.get(c);if(wt&&Dt)return wt==c&&Dt==o;var Bt=!0;M.set(o,c),M.set(c,o);for(var kt=E;++et<H;){ft=R[et];var Ut=o[ft],Wt=c[ft];if(y)var vn=E?y(Wt,Ut,ft,c,o,M):y(Ut,Wt,ft,o,c,M);if(!(vn===n?Ut===Wt||b(Ut,Wt,p,y,M):vn)){Bt=!1;break}kt||(kt=ft=="constructor")}if(Bt&&!kt){var nn=o.constructor,Sn=c.constructor;nn!=Sn&&"constructor"in o&&"constructor"in c&&!(typeof nn=="function"&&nn instanceof nn&&typeof Sn=="function"&&Sn instanceof Sn)&&(Bt=!1)}return M.delete(o),M.delete(c),Bt}function _i(o){return Xf(kb(o,n,Ib),o+"")}function Wf(o){return z_(o,Ie,qf)}function $f(o){return z_(o,hn,xb)}var Vf=Jl?function(o){return Jl.get(o)}:uh;function hc(o){for(var c=o.name+"",p=Ss[c],y=Kt.call(Ss,c)?p.length:0;y--;){var b=p[y],M=b.func;if(M==null||M==o)return b.name}return c}function Ds(o){var c=Kt.call(T,"placeholder")?T:o;return c.placeholder}function Mt(){var o=T.iteratee||lh;return o=o===lh?W_:o,arguments.length?o(arguments[0],arguments[1]):o}function pc(o,c){var p=o.__data__;return lU(c)?p[typeof c=="string"?"string":"hash"]:p.map}function Yf(o){for(var c=Ie(o),p=c.length;p--;){var y=c[p],b=o[y];c[p]=[y,b,Sb(b)]}return c}function Pr(o,c){var p=dF(o,c);return H_(p)?p:n}function eU(o){var c=Kt.call(o,Cr),p=o[Cr];try{o[Cr]=n;var y=!0}catch{}var b=Yl.call(o);return y&&(c?o[Cr]=p:delete o[Cr]),b}var qf=bf?function(o){return o==null?[]:(o=ie(o),qi(bf(o),function(c){return M_.call(o,c)}))}:dh,xb=bf?function(o){for(var c=[];o;)ji(c,qf(o)),o=Gl(o);return c}:dh,Xe=tn;(xf&&Xe(new xf(new ArrayBuffer(1)))!=gn||qo&&Xe(new qo)!=it||wf&&Xe(wf.resolve())!=Vt||vs&&Xe(new vs)!=ae||jo&&Xe(new jo)!=re)&&(Xe=function(o){var c=tn(o),p=c==_t?o.constructor:n,y=p?Ir(p):"";if(y)switch(y){case BF:return gn;case FF:return it;case zF:return Vt;case UF:return ae;case HF:return re}return c});function nU(o,c,p){for(var y=-1,b=p.length;++y<b;){var M=p[y],E=M.size;switch(M.type){case"drop":o+=E;break;case"dropRight":c-=E;break;case"take":c=Ke(c,o+E);break;case"takeRight":o=Ae(o,c-E);break}}return{start:o,end:c}}function iU(o){var c=o.match(Nd);return c?c[1].split(Bd):[]}function wb(o,c,p){c=Qi(c,o);for(var y=-1,b=c.length,M=!1;++y<b;){var E=Un(c[y]);if(!(M=o!=null&&p(o,E)))break;o=o[E]}return M||++y!=b?M:(b=o==null?0:o.length,!!b&&wc(b)&&bi(E,b)&&(Pt(o)||Lr(o)))}function rU(o){var c=o.length,p=new o.constructor(c);return c&&typeof o[0]=="string"&&Kt.call(o,"index")&&(p.index=o.index,p.input=o.input),p}function vb(o){return typeof o.constructor=="function"&&!na(o)?Ts(Gl(o)):{}}function sU(o,c,p){var y=o.constructor;switch(c){case Pe:return zf(o);case pt:case yt:return new y(+o);case gn:return Wz(o,p);case Wi:case Cn:case je:case Ln:case di:case Oo:case Ao:case Tr:case fi:return rb(o,p);case it:return new y;case lt:case cn:return new y(o);case ke:return $z(o);case ae:return new y;case qt:return Vz(o)}}function oU(o,c){var p=c.length;if(!p)return o;var y=p-1;return c[y]=(p>1?"& ":"")+c[y],c=c.join(p>2?", ":" "),o.replace(Nn,`{
|
|
8
8
|
/* [wrapped with `+c+`] */
|
|
9
|
-
`)}function Iz(o){return Pt(o)||Pr(o)||!!(__&&o&&o[__])}function bi(o,c){var p=typeof o;return c=c??at,!!c&&(p=="number"||p!="symbol"&&Vi.test(o))&&o>-1&&o%1==0&&o<c}function en(o,c,p){if(!pe(p))return!1;var y=typeof c;return(y=="number"?fn(p)&&bi(c,p.length):y=="string"&&c in p)?Hn(p[c],o):!1}function Lf(o,c){if(Pt(o))return!1;var p=typeof o;return p=="number"||p=="symbol"||p=="boolean"||o==null||wn(o)?!0:hi.test(o)||!yl.test(o)||c!=null&&o in ie(c)}function Lz(o){var c=typeof o;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?o!=="__proto__":o===null}function Nf(o){var c=uc(o),p=T[c];if(typeof p!="function"||!(c in Ut.prototype))return!1;if(o===p)return!0;var y=Ef(p);return!!y&&o===y[0]}function Nz(o){return!!p_&&p_ in o}var Bz=Ul?xi:th;function Xo(o){var c=o&&o.constructor,p=typeof c=="function"&&c.prototype||_s;return o===p}function pb(o){return o===o&&!pe(o)}function mb(o,c){return function(p){return p==null?!1:p[o]===c&&(c!==n||o in ie(p))}}function Fz(o){var c=gc(o,function(y){return p.size===f&&p.clear(),y}),p=c.cache;return c}function zz(o,c){var p=o[1],y=c[1],b=p|y,M=b<(C|O|D),R=y==D&&p==I||y==D&&p==w&&o[7].length<=c[8]||y==(D|w)&&c[7].length<=c[8]&&p==I;if(!(M||R))return o;y&C&&(o[2]=c[2],b|=p&C?0:B);var E=c[3];if(E){var z=o[3];o[3]=z?Z_(z,E,c[4]):E,o[4]=z?ji(o[3],m):c[4]}return E=c[5],E&&(z=o[5],o[5]=z?Q_(z,E,c[6]):E,o[6]=z?ji(o[5],m):c[6]),E=c[7],E&&(o[7]=E),y&D&&(o[8]=o[8]==null?c[8]:Ke(o[8],c[8])),o[9]==null&&(o[9]=c[9]),o[0]=c[0],o[1]=b,o}function Uz(o){var c=[];if(o!=null)for(var p in ie(o))c.push(p);return c}function Hz(o){return Wl.call(o)}function gb(o,c,p){return c=Ae(c===n?o.length-1:c,0),function(){for(var y=arguments,b=-1,M=Ae(y.length-c,0),R=j(M);++b<M;)R[b]=y[c+b];b=-1;for(var E=j(c+1);++b<c;)E[b]=y[b];return E[c]=p(R),yn(o,this,E)}}function yb(o,c){return c.length<2?o:Or(o,En(c,0,-1))}function Wz(o,c){for(var p=o.length,y=Ke(c.length,p),b=dn(o);y--;){var M=c[y];o[y]=bi(M,p)?b[M]:n}return o}function Bf(o,c){if(!(c==="constructor"&&typeof o[c]=="function")&&c!="__proto__")return o[c]}var _b=xb(H_),Zo=iF||function(o,c){return ue.setTimeout(o,c)},Ff=xb(dz);function bb(o,c,p){var y=c+"";return Ff(o,Pz(y,$z(Oz(y),p)))}function xb(o){var c=0,p=0;return function(){var y=aF(),b=st-(y-p);if(p=y,b>0){if(++c>=q)return arguments[0]}else c=0;return o.apply(n,arguments)}}function fc(o,c){var p=-1,y=o.length,b=y-1;for(c=c===n?y:c;++p<c;){var M=xf(p,b),R=o[M];o[M]=o[p],o[p]=R}return o.length=c,o}var wb=Fz(function(o){var c=[];return o.charCodeAt(0)===46&&c.push(""),o.replace(wd,function(p,y,b,M){c.push(b?M.replace(Dd,"$1"):y||p)}),c});function Un(o){if(typeof o=="string"||wn(o))return o;var c=o+"";return c=="0"&&1/o==-vt?"-0":c}function Er(o){if(o!=null){try{return Hl.call(o)}catch{}try{return o+""}catch{}}return""}function $z(o,c){return _n(ot,function(p){var y="_."+p[0];c&p[1]&&!Nl(o,y)&&o.push(y)}),o.sort()}function vb(o){if(o instanceof Ut)return o.clone();var c=new On(o.__wrapped__,o.__chain__);return c.__actions__=dn(o.__actions__),c.__index__=o.__index__,c.__values__=o.__values__,c}function Vz(o,c,p){(p?en(o,c,p):c===n)?c=1:c=Ae(Lt(c),0);var y=o==null?0:o.length;if(!y||c<1)return[];for(var b=0,M=0,R=j(Gl(y/c));b<y;)R[M++]=En(o,b,b+=c);return R}function Yz(o){for(var c=-1,p=o==null?0:o.length,y=0,b=[];++c<p;){var M=o[c];M&&(b[y++]=M)}return b}function qz(){var o=arguments.length;if(!o)return[];for(var c=j(o-1),p=arguments[0],y=o;y--;)c[y-1]=arguments[y];return qi(Pt(p)?dn(p):[p],ze(c,1))}var jz=Bt(function(o,c){return xe(o)?Yo(o,ze(c,1,xe,!0)):[]}),Gz=Bt(function(o,c){var p=Pn(c);return xe(p)&&(p=n),xe(o)?Yo(o,ze(c,1,xe,!0),kt(p,2)):[]}),Kz=Bt(function(o,c){var p=Pn(c);return xe(p)&&(p=n),xe(o)?Yo(o,ze(c,1,xe,!0),n,p):[]});function Xz(o,c,p){var y=o==null?0:o.length;return y?(c=p||c===n?1:Lt(c),En(o,c<0?0:c,y)):[]}function Zz(o,c,p){var y=o==null?0:o.length;return y?(c=p||c===n?1:Lt(c),c=y-c,En(o,0,c<0?0:c)):[]}function Qz(o,c){return o&&o.length?rc(o,kt(c,3),!0,!0):[]}function Jz(o,c){return o&&o.length?rc(o,kt(c,3),!0):[]}function tU(o,c,p,y){var b=o==null?0:o.length;return b?(p&&typeof p!="number"&&en(o,c,p)&&(p=0,y=b),qF(o,c,p,y)):[]}function Sb(o,c,p){var y=o==null?0:o.length;if(!y)return-1;var b=p==null?0:Lt(p);return b<0&&(b=Ae(y+b,0)),Bl(o,kt(c,3),b)}function Tb(o,c,p){var y=o==null?0:o.length;if(!y)return-1;var b=y-1;return p!==n&&(b=Lt(p),b=p<0?Ae(y+b,0):Ke(b,y-1)),Bl(o,kt(c,3),b,!0)}function Mb(o){var c=o==null?0:o.length;return c?ze(o,1):[]}function eU(o){var c=o==null?0:o.length;return c?ze(o,vt):[]}function nU(o,c){var p=o==null?0:o.length;return p?(c=c===n?1:Lt(c),ze(o,c)):[]}function iU(o){for(var c=-1,p=o==null?0:o.length,y={};++c<p;){var b=o[c];Qn(y,b[0],b[1])}return y}function kb(o){return o&&o.length?o[0]:n}function rU(o,c,p){var y=o==null?0:o.length;if(!y)return-1;var b=p==null?0:Lt(p);return b<0&&(b=Ae(y+b,0)),ps(o,c,b)}function sU(o){var c=o==null?0:o.length;return c?En(o,0,-1):[]}var oU=Bt(function(o){var c=de(o,Mf);return c.length&&c[0]===o[0]?mf(c):[]}),aU=Bt(function(o){var c=Pn(o),p=de(o,Mf);return c===Pn(p)?c=n:p.pop(),p.length&&p[0]===o[0]?mf(p,kt(c,2)):[]}),lU=Bt(function(o){var c=Pn(o),p=de(o,Mf);return c=typeof c=="function"?c:n,c&&p.pop(),p.length&&p[0]===o[0]?mf(p,n,c):[]});function cU(o,c){return o==null?"":sF.call(o,c)}function Pn(o){var c=o==null?0:o.length;return c?o[c-1]:n}function uU(o,c,p){var y=o==null?0:o.length;if(!y)return-1;var b=y;return p!==n&&(b=Lt(p),b=b<0?Ae(y+b,0):Ke(b,y-1)),c===c?$B(o,c,b):Bl(o,o_,b,!0)}function dU(o,c){return o&&o.length?B_(o,Lt(c)):n}var fU=Bt(Db);function Db(o,c){return o&&o.length&&c&&c.length?bf(o,c):o}function hU(o,c,p){return o&&o.length&&c&&c.length?bf(o,c,kt(p,2)):o}function pU(o,c,p){return o&&o.length&&c&&c.length?bf(o,c,n,p):o}var mU=_i(function(o,c){var p=o==null?0:o.length,y=df(o,c);return U_(o,de(c,function(b){return bi(b,p)?+b:b}).sort(X_)),y});function gU(o,c){var p=[];if(!(o&&o.length))return p;var y=-1,b=[],M=o.length;for(c=kt(c,3);++y<M;){var R=o[y];c(R,y,o)&&(p.push(R),b.push(y))}return U_(o,b),p}function zf(o){return o==null?o:cF.call(o)}function yU(o,c,p){var y=o==null?0:o.length;return y?(p&&typeof p!="number"&&en(o,c,p)?(c=0,p=y):(c=c==null?0:Lt(c),p=p===n?y:Lt(p)),En(o,c,p)):[]}function _U(o,c){return ic(o,c)}function bU(o,c,p){return vf(o,c,kt(p,2))}function xU(o,c){var p=o==null?0:o.length;if(p){var y=ic(o,c);if(y<p&&Hn(o[y],c))return y}return-1}function wU(o,c){return ic(o,c,!0)}function vU(o,c,p){return vf(o,c,kt(p,2),!0)}function SU(o,c){var p=o==null?0:o.length;if(p){var y=ic(o,c,!0)-1;if(Hn(o[y],c))return y}return-1}function TU(o){return o&&o.length?W_(o):[]}function MU(o,c){return o&&o.length?W_(o,kt(c,2)):[]}function kU(o){var c=o==null?0:o.length;return c?En(o,1,c):[]}function DU(o,c,p){return o&&o.length?(c=p||c===n?1:Lt(c),En(o,0,c<0?0:c)):[]}function CU(o,c,p){var y=o==null?0:o.length;return y?(c=p||c===n?1:Lt(c),c=y-c,En(o,c<0?0:c,y)):[]}function AU(o,c){return o&&o.length?rc(o,kt(c,3),!1,!0):[]}function OU(o,c){return o&&o.length?rc(o,kt(c,3)):[]}var RU=Bt(function(o){return Xi(ze(o,1,xe,!0))}),EU=Bt(function(o){var c=Pn(o);return xe(c)&&(c=n),Xi(ze(o,1,xe,!0),kt(c,2))}),PU=Bt(function(o){var c=Pn(o);return c=typeof c=="function"?c:n,Xi(ze(o,1,xe,!0),n,c)});function IU(o){return o&&o.length?Xi(o):[]}function LU(o,c){return o&&o.length?Xi(o,kt(c,2)):[]}function NU(o,c){return c=typeof c=="function"?c:n,o&&o.length?Xi(o,n,c):[]}function Uf(o){if(!(o&&o.length))return[];var c=0;return o=Yi(o,function(p){if(xe(p))return c=Ae(p.length,c),!0}),nf(c,function(p){return de(o,Jd(p))})}function Cb(o,c){if(!(o&&o.length))return[];var p=Uf(o);return c==null?p:de(p,function(y){return yn(c,n,y)})}var BU=Bt(function(o,c){return xe(o)?Yo(o,c):[]}),FU=Bt(function(o){return Tf(Yi(o,xe))}),zU=Bt(function(o){var c=Pn(o);return xe(c)&&(c=n),Tf(Yi(o,xe),kt(c,2))}),UU=Bt(function(o){var c=Pn(o);return c=typeof c=="function"?c:n,Tf(Yi(o,xe),n,c)}),HU=Bt(Uf);function WU(o,c){return q_(o||[],c||[],Vo)}function $U(o,c){return q_(o||[],c||[],Go)}var VU=Bt(function(o){var c=o.length,p=c>1?o[c-1]:n;return p=typeof p=="function"?(o.pop(),p):n,Cb(o,p)});function Ab(o){var c=T(o);return c.__chain__=!0,c}function YU(o,c){return c(o),o}function hc(o,c){return c(o)}var qU=_i(function(o){var c=o.length,p=c?o[0]:0,y=this.__wrapped__,b=function(M){return df(M,o)};return c>1||this.__actions__.length||!(y instanceof Ut)||!bi(p)?this.thru(b):(y=y.slice(p,+p+(c?1:0)),y.__actions__.push({func:hc,args:[b],thisArg:n}),new On(y,this.__chain__).thru(function(M){return c&&!M.length&&M.push(n),M}))});function jU(){return Ab(this)}function GU(){return new On(this.value(),this.__chain__)}function KU(){this.__values__===n&&(this.__values__=$b(this.value()));var o=this.__index__>=this.__values__.length,c=o?n:this.__values__[this.__index__++];return{done:o,value:c}}function XU(){return this}function ZU(o){for(var c,p=this;p instanceof Ql;){var y=vb(p);y.__index__=0,y.__values__=n,c?b.__wrapped__=y:c=y;var b=y;p=p.__wrapped__}return b.__wrapped__=o,c}function QU(){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:hc,args:[zf],thisArg:n}),new On(c,this.__chain__)}return this.thru(zf)}function JU(){return Y_(this.__wrapped__,this.__actions__)}var t5=sc(function(o,c,p){Kt.call(o,p)?++o[p]:Qn(o,p,1)});function e5(o,c,p){var y=Pt(o)?r_:YF;return p&&en(o,c,p)&&(c=n),y(o,kt(c,3))}function n5(o,c){var p=Pt(o)?Yi:C_;return p(o,kt(c,3))}var i5=nb(Sb),r5=nb(Tb);function s5(o,c){return ze(pc(o,c),1)}function o5(o,c){return ze(pc(o,c),vt)}function a5(o,c,p){return p=p===n?1:Lt(p),ze(pc(o,c),p)}function Ob(o,c){var p=Pt(o)?_n:Ki;return p(o,kt(c,3))}function Rb(o,c){var p=Pt(o)?kB:D_;return p(o,kt(c,3))}var l5=sc(function(o,c,p){Kt.call(o,p)?o[p].push(c):Qn(o,p,[c])});function c5(o,c,p,y){o=fn(o)?o:ks(o),p=p&&!y?Lt(p):0;var b=o.length;return p<0&&(p=Ae(b+p,0)),bc(o)?p<=b&&o.indexOf(c,p)>-1:!!b&&ps(o,c,p)>-1}var u5=Bt(function(o,c,p){var y=-1,b=typeof c=="function",M=fn(o)?j(o.length):[];return Ki(o,function(R){M[++y]=b?yn(c,R,p):qo(R,c,p)}),M}),d5=sc(function(o,c,p){Qn(o,p,c)});function pc(o,c){var p=Pt(o)?de:I_;return p(o,kt(c,3))}function f5(o,c,p,y){return o==null?[]:(Pt(c)||(c=c==null?[]:[c]),p=y?n:p,Pt(p)||(p=p==null?[]:[p]),F_(o,c,p))}var h5=sc(function(o,c,p){o[p?0:1].push(c)},function(){return[[],[]]});function p5(o,c,p){var y=Pt(o)?Zd:l_,b=arguments.length<3;return y(o,kt(c,4),p,b,Ki)}function m5(o,c,p){var y=Pt(o)?DB:l_,b=arguments.length<3;return y(o,kt(c,4),p,b,D_)}function g5(o,c){var p=Pt(o)?Yi:C_;return p(o,yc(kt(c,3)))}function y5(o){var c=Pt(o)?S_:cz;return c(o)}function _5(o,c,p){(p?en(o,c,p):c===n)?c=1:c=Lt(c);var y=Pt(o)?UF:uz;return y(o,c)}function b5(o){var c=Pt(o)?HF:fz;return c(o)}function x5(o){if(o==null)return 0;if(fn(o))return bc(o)?gs(o):o.length;var c=Xe(o);return c==it||c==ae?o.size:yf(o).length}function w5(o,c,p){var y=Pt(o)?Qd:hz;return p&&en(o,c,p)&&(c=n),y(o,kt(c,3))}var v5=Bt(function(o,c){if(o==null)return[];var p=c.length;return p>1&&en(o,c[0],c[1])?c=[]:p>2&&en(c[0],c[1],c[2])&&(c=[c[0]]),F_(o,ze(c,1),[])}),mc=nF||function(){return ue.Date.now()};function S5(o,c){if(typeof c!="function")throw new An(a);return o=Lt(o),function(){if(--o<1)return c.apply(this,arguments)}}function Eb(o,c,p){return c=p?n:c,c=o&&c==null?o.length:c,yi(o,D,n,n,n,n,c)}function Pb(o,c){var p;if(typeof c!="function")throw new An(a);return o=Lt(o),function(){return--o>0&&(p=c.apply(this,arguments)),o<=1&&(c=n),p}}var Hf=Bt(function(o,c,p){var y=C;if(p.length){var b=ji(p,Ts(Hf));y|=W}return yi(o,y,c,p,b)}),Ib=Bt(function(o,c,p){var y=C|O;if(p.length){var b=ji(p,Ts(Ib));y|=W}return yi(c,y,o,p,b)});function Lb(o,c,p){c=p?n:c;var y=yi(o,I,n,n,n,n,n,c);return y.placeholder=Lb.placeholder,y}function Nb(o,c,p){c=p?n:c;var y=yi(o,N,n,n,n,n,n,c);return y.placeholder=Nb.placeholder,y}function Bb(o,c,p){var y,b,M,R,E,z,Z=0,Q=!1,et=!1,ft=!0;if(typeof o!="function")throw new An(a);c=In(c)||0,pe(p)&&(Q=!!p.leading,et="maxWait"in p,M=et?Ae(In(p.maxWait)||0,c):M,ft="trailing"in p?!!p.trailing:ft);function wt(we){var Wn=y,vi=b;return y=b=n,Z=we,R=o.apply(vi,Wn),R}function Dt(we){return Z=we,E=Zo(zt,c),Q?wt(we):R}function Nt(we){var Wn=we-z,vi=we-Z,ix=c-Wn;return et?Ke(ix,M-vi):ix}function Mt(we){var Wn=we-z,vi=we-Z;return z===n||Wn>=c||Wn<0||et&&vi>=M}function zt(){var we=mc();if(Mt(we))return Ht(we);E=Zo(zt,Nt(we))}function Ht(we){return E=n,ft&&y?wt(we):(y=b=n,R)}function vn(){E!==n&&j_(E),Z=0,y=z=b=E=n}function nn(){return E===n?R:Ht(mc())}function Sn(){var we=mc(),Wn=Mt(we);if(y=arguments,b=this,z=we,Wn){if(E===n)return Dt(z);if(et)return j_(E),E=Zo(zt,c),wt(z)}return E===n&&(E=Zo(zt,c)),R}return Sn.cancel=vn,Sn.flush=nn,Sn}var T5=Bt(function(o,c){return k_(o,1,c)}),M5=Bt(function(o,c,p){return k_(o,In(c)||0,p)});function k5(o){return yi(o,A)}function gc(o,c){if(typeof o!="function"||c!=null&&typeof c!="function")throw new An(a);var p=function(){var y=arguments,b=c?c.apply(this,y):y[0],M=p.cache;if(M.has(b))return M.get(b);var R=o.apply(this,y);return p.cache=M.set(b,R)||M,R};return p.cache=new(gc.Cache||gi),p}gc.Cache=gi;function yc(o){if(typeof o!="function")throw new An(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 D5(o){return Pb(2,o)}var C5=pz(function(o,c){c=c.length==1&&Pt(c[0])?de(c[0],bn(kt())):de(ze(c,1),bn(kt()));var p=c.length;return Bt(function(y){for(var b=-1,M=Ke(y.length,p);++b<M;)y[b]=c[b].call(this,y[b]);return yn(o,this,y)})}),Wf=Bt(function(o,c){var p=ji(c,Ts(Wf));return yi(o,W,n,c,p)}),Fb=Bt(function(o,c){var p=ji(c,Ts(Fb));return yi(o,U,n,c,p)}),A5=_i(function(o,c){return yi(o,w,n,n,n,c)});function O5(o,c){if(typeof o!="function")throw new An(a);return c=c===n?c:Lt(c),Bt(o,c)}function R5(o,c){if(typeof o!="function")throw new An(a);return c=c==null?0:Ae(Lt(c),0),Bt(function(p){var y=p[c],b=Qi(p,0,c);return y&&qi(b,y),yn(o,this,b)})}function E5(o,c,p){var y=!0,b=!0;if(typeof o!="function")throw new An(a);return pe(p)&&(y="leading"in p?!!p.leading:y,b="trailing"in p?!!p.trailing:b),Bb(o,c,{leading:y,maxWait:c,trailing:b})}function P5(o){return Eb(o,1)}function I5(o,c){return Wf(kf(c),o)}function L5(){if(!arguments.length)return[];var o=arguments[0];return Pt(o)?o:[o]}function N5(o){return Rn(o,x)}function B5(o,c){return c=typeof c=="function"?c:n,Rn(o,x,c)}function F5(o){return Rn(o,g|x)}function z5(o,c){return c=typeof c=="function"?c:n,Rn(o,g|x,c)}function U5(o,c){return c==null||M_(o,c,Pe(c))}function Hn(o,c){return o===c||o!==o&&c!==c}var H5=cc(pf),W5=cc(function(o,c){return o>=c}),Pr=R_((function(){return arguments})())?R_:function(o){return ye(o)&&Kt.call(o,"callee")&&!y_.call(o,"callee")},Pt=j.isArray,$5=Qy?bn(Qy):ZF;function fn(o){return o!=null&&_c(o.length)&&!xi(o)}function xe(o){return ye(o)&&fn(o)}function V5(o){return o===!0||o===!1||ye(o)&&tn(o)==pt}var Ji=rF||th,Y5=Jy?bn(Jy):QF;function q5(o){return ye(o)&&o.nodeType===1&&!Qo(o)}function j5(o){if(o==null)return!0;if(fn(o)&&(Pt(o)||typeof o=="string"||typeof o.splice=="function"||Ji(o)||Ms(o)||Pr(o)))return!o.length;var c=Xe(o);if(c==it||c==ae)return!o.size;if(Xo(o))return!yf(o).length;for(var p in o)if(Kt.call(o,p))return!1;return!0}function G5(o,c){return jo(o,c)}function K5(o,c,p){p=typeof p=="function"?p:n;var y=p?p(o,c):n;return y===n?jo(o,c,n,p):!!y}function $f(o){if(!ye(o))return!1;var c=tn(o);return c==Rt||c==mt||typeof o.message=="string"&&typeof o.name=="string"&&!Qo(o)}function X5(o){return typeof o=="number"&&b_(o)}function xi(o){if(!pe(o))return!1;var c=tn(o);return c==Ft||c==G||c==rt||c==Te}function zb(o){return typeof o=="number"&&o==Lt(o)}function _c(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=at}function pe(o){var c=typeof o;return o!=null&&(c=="object"||c=="function")}function ye(o){return o!=null&&typeof o=="object"}var Ub=t_?bn(t_):tz;function Z5(o,c){return o===c||gf(o,c,Pf(c))}function Q5(o,c,p){return p=typeof p=="function"?p:n,gf(o,c,Pf(c),p)}function J5(o){return Hb(o)&&o!=+o}function tH(o){if(Bz(o))throw new At(s);return E_(o)}function eH(o){return o===null}function nH(o){return o==null}function Hb(o){return typeof o=="number"||ye(o)&&tn(o)==lt}function Qo(o){if(!ye(o)||tn(o)!=_t)return!1;var c=Yl(o);if(c===null)return!0;var p=Kt.call(c,"constructor")&&c.constructor;return typeof p=="function"&&p instanceof p&&Hl.call(p)==QB}var Vf=e_?bn(e_):ez;function iH(o){return zb(o)&&o>=-at&&o<=at}var Wb=n_?bn(n_):nz;function bc(o){return typeof o=="string"||!Pt(o)&&ye(o)&&tn(o)==cn}function wn(o){return typeof o=="symbol"||ye(o)&&tn(o)==qt}var Ms=i_?bn(i_):iz;function rH(o){return o===n}function sH(o){return ye(o)&&Xe(o)==re}function oH(o){return ye(o)&&tn(o)==ke}var aH=cc(_f),lH=cc(function(o,c){return o<=c});function $b(o){if(!o)return[];if(fn(o))return bc(o)?Fn(o):dn(o);if(zo&&o[zo])return UB(o[zo]());var c=Xe(o),p=c==it?sf:c==ae?Fl:ks;return p(o)}function wi(o){if(!o)return o===0?o:0;if(o=In(o),o===vt||o===-vt){var c=o<0?-1:1;return c*dt}return o===o?o:0}function Lt(o){var c=wi(o),p=c%1;return c===c?p?c-p:c:0}function Vb(o){return o?Ar(Lt(o),0,P):0}function In(o){if(typeof o=="number")return o;if(wn(o))return V;if(pe(o)){var c=typeof o.valueOf=="function"?o.valueOf():o;o=pe(c)?c+"":c}if(typeof o!="string")return o===0?o:+o;o=c_(o);var p=Ad.test(o);return p||Rd.test(o)?Bn(o.slice(2),p?2:8):Cd.test(o)?V:+o}function Yb(o){return ti(o,hn(o))}function cH(o){return o?Ar(Lt(o),-at,at):o===0?o:0}function Xt(o){return o==null?"":xn(o)}var uH=vs(function(o,c){if(Xo(c)||fn(c)){ti(c,Pe(c),o);return}for(var p in c)Kt.call(c,p)&&Vo(o,p,c[p])}),qb=vs(function(o,c){ti(c,hn(c),o)}),jb=vs(function(o,c,p,y){ti(c,hn(c),o,y)}),Yf=vs(function(o,c,p,y){ti(c,Pe(c),o,y)}),dH=_i(df);function fH(o,c){var p=ws(o);return c==null?p:T_(p,c)}var hH=Bt(function(o,c){o=ie(o);var p=-1,y=c.length,b=y>2?c[2]:n;for(b&&en(c[0],c[1],b)&&(y=1);++p<y;)for(var M=c[p],R=hn(M),E=-1,z=R.length;++E<z;){var Z=R[E],Q=o[Z];(Q===n||Hn(Q,_s[Z])&&!Kt.call(o,Z))&&(o[Z]=M[Z])}return o}),pH=Bt(function(o){return o.push(n,cb),yn(Gb,n,o)});function mH(o,c){return s_(o,kt(c,3),Jn)}function gH(o,c){return s_(o,kt(c,3),hf)}function yH(o,c){return o==null?o:ff(o,kt(c,3),hn)}function _H(o,c){return o==null?o:A_(o,kt(c,3),hn)}function bH(o,c){return o&&Jn(o,kt(c,3))}function xH(o,c){return o&&hf(o,kt(c,3))}function wH(o){return o==null?[]:ec(o,Pe(o))}function vH(o){return o==null?[]:ec(o,hn(o))}function qf(o,c,p){var y=o==null?n:Or(o,c);return y===n?p:y}function SH(o,c){return o!=null&&fb(o,c,jF)}function jf(o,c){return o!=null&&fb(o,c,GF)}var TH=rb(function(o,c,p){c!=null&&typeof c.toString!="function"&&(c=Wl.call(c)),o[c]=p},Kf(pn)),MH=rb(function(o,c,p){c!=null&&typeof c.toString!="function"&&(c=Wl.call(c)),Kt.call(o,c)?o[c].push(p):o[c]=[p]},kt),kH=Bt(qo);function Pe(o){return fn(o)?v_(o):yf(o)}function hn(o){return fn(o)?v_(o,!0):rz(o)}function DH(o,c){var p={};return c=kt(c,3),Jn(o,function(y,b,M){Qn(p,c(y,b,M),y)}),p}function CH(o,c){var p={};return c=kt(c,3),Jn(o,function(y,b,M){Qn(p,b,c(y,b,M))}),p}var AH=vs(function(o,c,p){nc(o,c,p)}),Gb=vs(function(o,c,p,y){nc(o,c,p,y)}),OH=_i(function(o,c){var p={};if(o==null)return p;var y=!1;c=de(c,function(M){return M=Zi(M,o),y||(y=M.length>1),M}),ti(o,Rf(o),p),y&&(p=Rn(p,g|_|x,Mz));for(var b=c.length;b--;)Sf(p,c[b]);return p});function RH(o,c){return Kb(o,yc(kt(c)))}var EH=_i(function(o,c){return o==null?{}:oz(o,c)});function Kb(o,c){if(o==null)return{};var p=de(Rf(o),function(y){return[y]});return c=kt(c),z_(o,p,function(y,b){return c(y,b[0])})}function PH(o,c,p){c=Zi(c,o);var y=-1,b=c.length;for(b||(b=1,o=n);++y<b;){var M=o==null?n:o[Un(c[y])];M===n&&(y=b,M=p),o=xi(M)?M.call(o):M}return o}function IH(o,c,p){return o==null?o:Go(o,c,p)}function LH(o,c,p,y){return y=typeof y=="function"?y:n,o==null?o:Go(o,c,p,y)}var Xb=ab(Pe),Zb=ab(hn);function NH(o,c,p){var y=Pt(o),b=y||Ji(o)||Ms(o);if(c=kt(c,4),p==null){var M=o&&o.constructor;b?p=y?new M:[]:pe(o)?p=xi(M)?ws(Yl(o)):{}:p={}}return(b?_n:Jn)(o,function(R,E,z){return c(p,R,E,z)}),p}function BH(o,c){return o==null?!0:Sf(o,c)}function FH(o,c,p){return o==null?o:V_(o,c,kf(p))}function zH(o,c,p,y){return y=typeof y=="function"?y:n,o==null?o:V_(o,c,kf(p),y)}function ks(o){return o==null?[]:rf(o,Pe(o))}function UH(o){return o==null?[]:rf(o,hn(o))}function HH(o,c,p){return p===n&&(p=c,c=n),p!==n&&(p=In(p),p=p===p?p:0),c!==n&&(c=In(c),c=c===c?c:0),Ar(In(o),c,p)}function WH(o,c,p){return c=wi(c),p===n?(p=c,c=0):p=wi(p),o=In(o),KF(o,c,p)}function $H(o,c,p){if(p&&typeof p!="boolean"&&en(o,c,p)&&(c=p=n),p===n&&(typeof c=="boolean"?(p=c,c=n):typeof o=="boolean"&&(p=o,o=n)),o===n&&c===n?(o=0,c=1):(o=wi(o),c===n?(c=o,o=0):c=wi(c)),o>c){var y=o;o=c,c=y}if(p||o%1||c%1){var b=x_();return Ke(o+b*(c-o+Ge("1e-"+((b+"").length-1))),c)}return xf(o,c)}var VH=Ss(function(o,c,p){return c=c.toLowerCase(),o+(p?Qb(c):c)});function Qb(o){return Gf(Xt(o).toLowerCase())}function Jb(o){return o=Xt(o),o&&o.replace(Ed,LB).replace(qd,"")}function YH(o,c,p){o=Xt(o),c=xn(c);var y=o.length;p=p===n?y:Ar(Lt(p),0,y);var b=p;return p-=c.length,p>=0&&o.slice(p,b)==c}function qH(o){return o=Xt(o),o&&_d.test(o)?o.replace(gl,NB):o}function jH(o){return o=Xt(o),o&&vd.test(o)?o.replace(Ao,"\\$&"):o}var GH=Ss(function(o,c,p){return o+(p?"-":"")+c.toLowerCase()}),KH=Ss(function(o,c,p){return o+(p?" ":"")+c.toLowerCase()}),XH=eb("toLowerCase");function ZH(o,c,p){o=Xt(o),c=Lt(c);var y=c?gs(o):0;if(!c||y>=c)return o;var b=(c-y)/2;return lc(Kl(b),p)+o+lc(Gl(b),p)}function QH(o,c,p){o=Xt(o),c=Lt(c);var y=c?gs(o):0;return c&&y<c?o+lc(c-y,p):o}function JH(o,c,p){o=Xt(o),c=Lt(c);var y=c?gs(o):0;return c&&y<c?lc(c-y,p)+o:o}function tW(o,c,p){return p||c==null?c=0:c&&(c=+c),lF(Xt(o).replace(Oo,""),c||0)}function eW(o,c,p){return(p?en(o,c,p):c===n)?c=1:c=Lt(c),wf(Xt(o),c)}function nW(){var o=arguments,c=Xt(o[0]);return o.length<3?c:c.replace(o[1],o[2])}var iW=Ss(function(o,c,p){return o+(p?"_":"")+c.toLowerCase()});function rW(o,c,p){return p&&typeof p!="number"&&en(o,c,p)&&(c=p=n),p=p===n?P:p>>>0,p?(o=Xt(o),o&&(typeof c=="string"||c!=null&&!Vf(c))&&(c=xn(c),!c&&ms(o))?Qi(Fn(o),0,p):o.split(c,p)):[]}var sW=Ss(function(o,c,p){return o+(p?" ":"")+Gf(c)});function oW(o,c,p){return o=Xt(o),p=p==null?0:Ar(Lt(p),0,o.length),c=xn(c),o.slice(p,p+c.length)==c}function aW(o,c,p){var y=T.templateSettings;p&&en(o,c,p)&&(c=n),o=Xt(o),c=Yf({},c,y,lb);var b=Yf({},c.imports,y.imports,lb),M=Pe(b),R=rf(b,M);_n(M,function(Mt){if(_l.test(Mt))throw new At(u)});var E,z,Z=0,Q=c.interpolate||ss,et="__p += '",ft=of((c.escape||ss).source+"|"+Q.source+"|"+(Q===Co?$i:ss).source+"|"+(c.evaluate||ss).source+"|$","g"),wt="//# sourceURL="+(Kt.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Kd+"]")+`
|
|
10
|
-
`;o.replace(ft,function(
|
|
11
|
-
__e(`+
|
|
12
|
-
'`),nn&&(
|
|
9
|
+
`)}function aU(o){return Pt(o)||Lr(o)||!!(D_&&o&&o[D_])}function bi(o,c){var p=typeof o;return c=c??at,!!c&&(p=="number"||p!="symbol"&&Yi.test(o))&&o>-1&&o%1==0&&o<c}function en(o,c,p){if(!pe(p))return!1;var y=typeof c;return(y=="number"?fn(p)&&bi(c,p.length):y=="string"&&c in p)?Hn(p[c],o):!1}function jf(o,c){if(Pt(o))return!1;var p=typeof o;return p=="number"||p=="symbol"||p=="boolean"||o==null||wn(o)?!0:hi.test(o)||!xl.test(o)||c!=null&&o in ie(c)}function lU(o){var c=typeof o;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?o!=="__proto__":o===null}function Gf(o){var c=hc(o),p=T[c];if(typeof p!="function"||!(c in Ht.prototype))return!1;if(o===p)return!0;var y=Vf(p);return!!y&&o===y[0]}function cU(o){return!!S_&&S_ in o}var uU=$l?xi:fh;function na(o){var c=o&&o.constructor,p=typeof c=="function"&&c.prototype||ws;return o===p}function Sb(o){return o===o&&!pe(o)}function Tb(o,c){return function(p){return p==null?!1:p[o]===c&&(c!==n||o in ie(p))}}function dU(o){var c=bc(o,function(y){return p.size===h&&p.clear(),y}),p=c.cache;return c}function fU(o,c){var p=o[1],y=c[1],b=p|y,M=b<(C|A|k),E=y==k&&p==P||y==k&&p==w&&o[7].length<=c[8]||y==(k|w)&&c[7].length<=c[8]&&p==P;if(!(M||E))return o;y&C&&(o[2]=c[2],b|=p&C?0:F);var R=c[3];if(R){var H=o[3];o[3]=H?ob(H,R,c[4]):R,o[4]=H?Gi(o[3],m):c[4]}return R=c[5],R&&(H=o[5],o[5]=H?ab(H,R,c[6]):R,o[6]=H?Gi(o[5],m):c[6]),R=c[7],R&&(o[7]=R),y&k&&(o[8]=o[8]==null?c[8]:Ke(o[8],c[8])),o[9]==null&&(o[9]=c[9]),o[0]=c[0],o[1]=b,o}function hU(o){var c=[];if(o!=null)for(var p in ie(o))c.push(p);return c}function pU(o){return Yl.call(o)}function kb(o,c,p){return c=Ae(c===n?o.length-1:c,0),function(){for(var y=arguments,b=-1,M=Ae(y.length-c,0),E=j(M);++b<M;)E[b]=y[c+b];b=-1;for(var R=j(c+1);++b<c;)R[b]=y[b];return R[c]=p(E),yn(o,this,R)}}function Mb(o,c){return c.length<2?o:Rr(o,Rn(c,0,-1))}function mU(o,c){for(var p=o.length,y=Ke(c.length,p),b=dn(o);y--;){var M=c[y];o[y]=bi(M,p)?b[M]:n}return o}function Kf(o,c){if(!(c==="constructor"&&typeof o[c]=="function")&&c!="__proto__")return o[c]}var Db=Ob(X_),ia=AF||function(o,c){return ue.setTimeout(o,c)},Xf=Ob(Fz);function Cb(o,c,p){var y=c+"";return Xf(o,oU(y,gU(iU(y),p)))}function Ob(o){var c=0,p=0;return function(){var y=IF(),b=st-(y-p);if(p=y,b>0){if(++c>=q)return arguments[0]}else c=0;return o.apply(n,arguments)}}function mc(o,c){var p=-1,y=o.length,b=y-1;for(c=c===n?y:c;++p<c;){var M=Rf(p,b),E=o[M];o[M]=o[p],o[p]=E}return o.length=c,o}var Ab=dU(function(o){var c=[];return o.charCodeAt(0)===46&&c.push(""),o.replace(Pd,function(p,y,b,M){c.push(b?M.replace(zd,"$1"):y||p)}),c});function Un(o){if(typeof o=="string"||wn(o))return o;var c=o+"";return c=="0"&&1/o==-vt?"-0":c}function Ir(o){if(o!=null){try{return Vl.call(o)}catch{}try{return o+""}catch{}}return""}function gU(o,c){return _n(ot,function(p){var y="_."+p[0];c&p[1]&&!zl(o,y)&&o.push(y)}),o.sort()}function Eb(o){if(o instanceof Ht)return o.clone();var c=new An(o.__wrapped__,o.__chain__);return c.__actions__=dn(o.__actions__),c.__index__=o.__index__,c.__values__=o.__values__,c}function yU(o,c,p){(p?en(o,c,p):c===n)?c=1:c=Ae(Nt(c),0);var y=o==null?0:o.length;if(!y||c<1)return[];for(var b=0,M=0,E=j(Zl(y/c));b<y;)E[M++]=Rn(o,b,b+=c);return E}function _U(o){for(var c=-1,p=o==null?0:o.length,y=0,b=[];++c<p;){var M=o[c];M&&(b[y++]=M)}return b}function bU(){var o=arguments.length;if(!o)return[];for(var c=j(o-1),p=arguments[0],y=o;y--;)c[y-1]=arguments[y];return ji(Pt(p)?dn(p):[p],Ue(c,1))}var xU=Ft(function(o,c){return xe(o)?Zo(o,Ue(c,1,xe,!0)):[]}),wU=Ft(function(o,c){var p=Pn(c);return xe(p)&&(p=n),xe(o)?Zo(o,Ue(c,1,xe,!0),Mt(p,2)):[]}),vU=Ft(function(o,c){var p=Pn(c);return xe(p)&&(p=n),xe(o)?Zo(o,Ue(c,1,xe,!0),n,p):[]});function SU(o,c,p){var y=o==null?0:o.length;return y?(c=p||c===n?1:Nt(c),Rn(o,c<0?0:c,y)):[]}function TU(o,c,p){var y=o==null?0:o.length;return y?(c=p||c===n?1:Nt(c),c=y-c,Rn(o,0,c<0?0:c)):[]}function kU(o,c){return o&&o.length?ac(o,Mt(c,3),!0,!0):[]}function MU(o,c){return o&&o.length?ac(o,Mt(c,3),!0):[]}function DU(o,c,p,y){var b=o==null?0:o.length;return b?(p&&typeof p!="number"&&en(o,c,p)&&(p=0,y=b),bz(o,c,p,y)):[]}function Rb(o,c,p){var y=o==null?0:o.length;if(!y)return-1;var b=p==null?0:Nt(p);return b<0&&(b=Ae(y+b,0)),Ul(o,Mt(c,3),b)}function Pb(o,c,p){var y=o==null?0:o.length;if(!y)return-1;var b=y-1;return p!==n&&(b=Nt(p),b=p<0?Ae(y+b,0):Ke(b,y-1)),Ul(o,Mt(c,3),b,!0)}function Ib(o){var c=o==null?0:o.length;return c?Ue(o,1):[]}function CU(o){var c=o==null?0:o.length;return c?Ue(o,vt):[]}function OU(o,c){var p=o==null?0:o.length;return p?(c=c===n?1:Nt(c),Ue(o,c)):[]}function AU(o){for(var c=-1,p=o==null?0:o.length,y={};++c<p;){var b=o[c];Jn(y,b[0],b[1])}return y}function Lb(o){return o&&o.length?o[0]:n}function EU(o,c,p){var y=o==null?0:o.length;if(!y)return-1;var b=p==null?0:Nt(p);return b<0&&(b=Ae(y+b,0)),ys(o,c,b)}function RU(o){var c=o==null?0:o.length;return c?Rn(o,0,-1):[]}var PU=Ft(function(o){var c=de(o,Bf);return c.length&&c[0]===o[0]?Df(c):[]}),IU=Ft(function(o){var c=Pn(o),p=de(o,Bf);return c===Pn(p)?c=n:p.pop(),p.length&&p[0]===o[0]?Df(p,Mt(c,2)):[]}),LU=Ft(function(o){var c=Pn(o),p=de(o,Bf);return c=typeof c=="function"?c:n,c&&p.pop(),p.length&&p[0]===o[0]?Df(p,n,c):[]});function NU(o,c){return o==null?"":RF.call(o,c)}function Pn(o){var c=o==null?0:o.length;return c?o[c-1]:n}function BU(o,c,p){var y=o==null?0:o.length;if(!y)return-1;var b=y;return p!==n&&(b=Nt(p),b=b<0?Ae(y+b,0):Ke(b,y-1)),c===c?gF(o,c,b):Ul(o,m_,b,!0)}function FU(o,c){return o&&o.length?q_(o,Nt(c)):n}var zU=Ft(Nb);function Nb(o,c){return o&&o.length&&c&&c.length?Ef(o,c):o}function UU(o,c,p){return o&&o.length&&c&&c.length?Ef(o,c,Mt(p,2)):o}function HU(o,c,p){return o&&o.length&&c&&c.length?Ef(o,c,n,p):o}var WU=_i(function(o,c){var p=o==null?0:o.length,y=Sf(o,c);return K_(o,de(c,function(b){return bi(b,p)?+b:b}).sort(sb)),y});function $U(o,c){var p=[];if(!(o&&o.length))return p;var y=-1,b=[],M=o.length;for(c=Mt(c,3);++y<M;){var E=o[y];c(E,y,o)&&(p.push(E),b.push(y))}return K_(o,b),p}function Zf(o){return o==null?o:NF.call(o)}function VU(o,c,p){var y=o==null?0:o.length;return y?(p&&typeof p!="number"&&en(o,c,p)?(c=0,p=y):(c=c==null?0:Nt(c),p=p===n?y:Nt(p)),Rn(o,c,p)):[]}function YU(o,c){return oc(o,c)}function qU(o,c,p){return If(o,c,Mt(p,2))}function jU(o,c){var p=o==null?0:o.length;if(p){var y=oc(o,c);if(y<p&&Hn(o[y],c))return y}return-1}function GU(o,c){return oc(o,c,!0)}function KU(o,c,p){return If(o,c,Mt(p,2),!0)}function XU(o,c){var p=o==null?0:o.length;if(p){var y=oc(o,c,!0)-1;if(Hn(o[y],c))return y}return-1}function ZU(o){return o&&o.length?Z_(o):[]}function QU(o,c){return o&&o.length?Z_(o,Mt(c,2)):[]}function JU(o){var c=o==null?0:o.length;return c?Rn(o,1,c):[]}function t5(o,c,p){return o&&o.length?(c=p||c===n?1:Nt(c),Rn(o,0,c<0?0:c)):[]}function e5(o,c,p){var y=o==null?0:o.length;return y?(c=p||c===n?1:Nt(c),c=y-c,Rn(o,c<0?0:c,y)):[]}function n5(o,c){return o&&o.length?ac(o,Mt(c,3),!1,!0):[]}function i5(o,c){return o&&o.length?ac(o,Mt(c,3)):[]}var r5=Ft(function(o){return Zi(Ue(o,1,xe,!0))}),s5=Ft(function(o){var c=Pn(o);return xe(c)&&(c=n),Zi(Ue(o,1,xe,!0),Mt(c,2))}),o5=Ft(function(o){var c=Pn(o);return c=typeof c=="function"?c:n,Zi(Ue(o,1,xe,!0),n,c)});function a5(o){return o&&o.length?Zi(o):[]}function l5(o,c){return o&&o.length?Zi(o,Mt(c,2)):[]}function c5(o,c){return c=typeof c=="function"?c:n,o&&o.length?Zi(o,n,c):[]}function Qf(o){if(!(o&&o.length))return[];var c=0;return o=qi(o,function(p){if(xe(p))return c=Ae(p.length,c),!0}),mf(c,function(p){return de(o,ff(p))})}function Bb(o,c){if(!(o&&o.length))return[];var p=Qf(o);return c==null?p:de(p,function(y){return yn(c,n,y)})}var u5=Ft(function(o,c){return xe(o)?Zo(o,c):[]}),d5=Ft(function(o){return Nf(qi(o,xe))}),f5=Ft(function(o){var c=Pn(o);return xe(c)&&(c=n),Nf(qi(o,xe),Mt(c,2))}),h5=Ft(function(o){var c=Pn(o);return c=typeof c=="function"?c:n,Nf(qi(o,xe),n,c)}),p5=Ft(Qf);function m5(o,c){return eb(o||[],c||[],Xo)}function g5(o,c){return eb(o||[],c||[],ta)}var y5=Ft(function(o){var c=o.length,p=c>1?o[c-1]:n;return p=typeof p=="function"?(o.pop(),p):n,Bb(o,p)});function Fb(o){var c=T(o);return c.__chain__=!0,c}function _5(o,c){return c(o),o}function gc(o,c){return c(o)}var b5=_i(function(o){var c=o.length,p=c?o[0]:0,y=this.__wrapped__,b=function(M){return Sf(M,o)};return c>1||this.__actions__.length||!(y instanceof Ht)||!bi(p)?this.thru(b):(y=y.slice(p,+p+(c?1:0)),y.__actions__.push({func:gc,args:[b],thisArg:n}),new An(y,this.__chain__).thru(function(M){return c&&!M.length&&M.push(n),M}))});function x5(){return Fb(this)}function w5(){return new An(this.value(),this.__chain__)}function v5(){this.__values__===n&&(this.__values__=Qb(this.value()));var o=this.__index__>=this.__values__.length,c=o?n:this.__values__[this.__index__++];return{done:o,value:c}}function S5(){return this}function T5(o){for(var c,p=this;p instanceof ec;){var y=Eb(p);y.__index__=0,y.__values__=n,c?b.__wrapped__=y:c=y;var b=y;p=p.__wrapped__}return b.__wrapped__=o,c}function k5(){var o=this.__wrapped__;if(o instanceof Ht){var c=o;return this.__actions__.length&&(c=new Ht(this)),c=c.reverse(),c.__actions__.push({func:gc,args:[Zf],thisArg:n}),new An(c,this.__chain__)}return this.thru(Zf)}function M5(){return tb(this.__wrapped__,this.__actions__)}var D5=lc(function(o,c,p){Kt.call(o,p)?++o[p]:Jn(o,p,1)});function C5(o,c,p){var y=Pt(o)?h_:_z;return p&&en(o,c,p)&&(c=n),y(o,Mt(c,3))}function O5(o,c){var p=Pt(o)?qi:B_;return p(o,Mt(c,3))}var A5=db(Rb),E5=db(Pb);function R5(o,c){return Ue(yc(o,c),1)}function P5(o,c){return Ue(yc(o,c),vt)}function I5(o,c,p){return p=p===n?1:Nt(p),Ue(yc(o,c),p)}function zb(o,c){var p=Pt(o)?_n:Xi;return p(o,Mt(c,3))}function Ub(o,c){var p=Pt(o)?JB:N_;return p(o,Mt(c,3))}var L5=lc(function(o,c,p){Kt.call(o,p)?o[p].push(c):Jn(o,p,[c])});function N5(o,c,p,y){o=fn(o)?o:Os(o),p=p&&!y?Nt(p):0;var b=o.length;return p<0&&(p=Ae(b+p,0)),vc(o)?p<=b&&o.indexOf(c,p)>-1:!!b&&ys(o,c,p)>-1}var B5=Ft(function(o,c,p){var y=-1,b=typeof c=="function",M=fn(o)?j(o.length):[];return Xi(o,function(E){M[++y]=b?yn(c,E,p):Qo(E,c,p)}),M}),F5=lc(function(o,c,p){Jn(o,p,c)});function yc(o,c){var p=Pt(o)?de:$_;return p(o,Mt(c,3))}function z5(o,c,p,y){return o==null?[]:(Pt(c)||(c=c==null?[]:[c]),p=y?n:p,Pt(p)||(p=p==null?[]:[p]),j_(o,c,p))}var U5=lc(function(o,c,p){o[p?0:1].push(c)},function(){return[[],[]]});function H5(o,c,p){var y=Pt(o)?uf:y_,b=arguments.length<3;return y(o,Mt(c,4),p,b,Xi)}function W5(o,c,p){var y=Pt(o)?tF:y_,b=arguments.length<3;return y(o,Mt(c,4),p,b,N_)}function $5(o,c){var p=Pt(o)?qi:B_;return p(o,xc(Mt(c,3)))}function V5(o){var c=Pt(o)?R_:Nz;return c(o)}function Y5(o,c,p){(p?en(o,c,p):c===n)?c=1:c=Nt(c);var y=Pt(o)?hz:Bz;return y(o,c)}function q5(o){var c=Pt(o)?pz:zz;return c(o)}function j5(o){if(o==null)return 0;if(fn(o))return vc(o)?bs(o):o.length;var c=Xe(o);return c==it||c==ae?o.size:Of(o).length}function G5(o,c,p){var y=Pt(o)?df:Uz;return p&&en(o,c,p)&&(c=n),y(o,Mt(c,3))}var K5=Ft(function(o,c){if(o==null)return[];var p=c.length;return p>1&&en(o,c[0],c[1])?c=[]:p>2&&en(c[0],c[1],c[2])&&(c=[c[0]]),j_(o,Ue(c,1),[])}),_c=OF||function(){return ue.Date.now()};function X5(o,c){if(typeof c!="function")throw new On(a);return o=Nt(o),function(){if(--o<1)return c.apply(this,arguments)}}function Hb(o,c,p){return c=p?n:c,c=o&&c==null?o.length:c,yi(o,k,n,n,n,n,c)}function Wb(o,c){var p;if(typeof c!="function")throw new On(a);return o=Nt(o),function(){return--o>0&&(p=c.apply(this,arguments)),o<=1&&(c=n),p}}var Jf=Ft(function(o,c,p){var y=C;if(p.length){var b=Gi(p,Ds(Jf));y|=N}return yi(o,y,c,p,b)}),$b=Ft(function(o,c,p){var y=C|A;if(p.length){var b=Gi(p,Ds($b));y|=N}return yi(c,y,o,p,b)});function Vb(o,c,p){c=p?n:c;var y=yi(o,P,n,n,n,n,n,c);return y.placeholder=Vb.placeholder,y}function Yb(o,c,p){c=p?n:c;var y=yi(o,B,n,n,n,n,n,c);return y.placeholder=Yb.placeholder,y}function qb(o,c,p){var y,b,M,E,R,H,Z=0,Q=!1,et=!1,ft=!0;if(typeof o!="function")throw new On(a);c=In(c)||0,pe(p)&&(Q=!!p.leading,et="maxWait"in p,M=et?Ae(In(p.maxWait)||0,c):M,ft="trailing"in p?!!p.trailing:ft);function wt(we){var Wn=y,vi=b;return y=b=n,Z=we,E=o.apply(vi,Wn),E}function Dt(we){return Z=we,R=ia(Ut,c),Q?wt(we):E}function Bt(we){var Wn=we-H,vi=we-Z,fx=c-Wn;return et?Ke(fx,M-vi):fx}function kt(we){var Wn=we-H,vi=we-Z;return H===n||Wn>=c||Wn<0||et&&vi>=M}function Ut(){var we=_c();if(kt(we))return Wt(we);R=ia(Ut,Bt(we))}function Wt(we){return R=n,ft&&y?wt(we):(y=b=n,E)}function vn(){R!==n&&nb(R),Z=0,y=H=b=R=n}function nn(){return R===n?E:Wt(_c())}function Sn(){var we=_c(),Wn=kt(we);if(y=arguments,b=this,H=we,Wn){if(R===n)return Dt(H);if(et)return nb(R),R=ia(Ut,c),wt(H)}return R===n&&(R=ia(Ut,c)),E}return Sn.cancel=vn,Sn.flush=nn,Sn}var Z5=Ft(function(o,c){return L_(o,1,c)}),Q5=Ft(function(o,c,p){return L_(o,In(c)||0,p)});function J5(o){return yi(o,O)}function bc(o,c){if(typeof o!="function"||c!=null&&typeof c!="function")throw new On(a);var p=function(){var y=arguments,b=c?c.apply(this,y):y[0],M=p.cache;if(M.has(b))return M.get(b);var E=o.apply(this,y);return p.cache=M.set(b,E)||M,E};return p.cache=new(bc.Cache||gi),p}bc.Cache=gi;function xc(o){if(typeof o!="function")throw new On(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 tH(o){return Wb(2,o)}var eH=Hz(function(o,c){c=c.length==1&&Pt(c[0])?de(c[0],bn(Mt())):de(Ue(c,1),bn(Mt()));var p=c.length;return Ft(function(y){for(var b=-1,M=Ke(y.length,p);++b<M;)y[b]=c[b].call(this,y[b]);return yn(o,this,y)})}),th=Ft(function(o,c){var p=Gi(c,Ds(th));return yi(o,N,n,c,p)}),jb=Ft(function(o,c){var p=Gi(c,Ds(jb));return yi(o,z,n,c,p)}),nH=_i(function(o,c){return yi(o,w,n,n,n,c)});function iH(o,c){if(typeof o!="function")throw new On(a);return c=c===n?c:Nt(c),Ft(o,c)}function rH(o,c){if(typeof o!="function")throw new On(a);return c=c==null?0:Ae(Nt(c),0),Ft(function(p){var y=p[c],b=Ji(p,0,c);return y&&ji(b,y),yn(o,this,b)})}function sH(o,c,p){var y=!0,b=!0;if(typeof o!="function")throw new On(a);return pe(p)&&(y="leading"in p?!!p.leading:y,b="trailing"in p?!!p.trailing:b),qb(o,c,{leading:y,maxWait:c,trailing:b})}function oH(o){return Hb(o,1)}function aH(o,c){return th(Ff(c),o)}function lH(){if(!arguments.length)return[];var o=arguments[0];return Pt(o)?o:[o]}function cH(o){return En(o,x)}function uH(o,c){return c=typeof c=="function"?c:n,En(o,x,c)}function dH(o){return En(o,g|x)}function fH(o,c){return c=typeof c=="function"?c:n,En(o,g|x,c)}function hH(o,c){return c==null||I_(o,c,Ie(c))}function Hn(o,c){return o===c||o!==o&&c!==c}var pH=fc(Mf),mH=fc(function(o,c){return o>=c}),Lr=U_((function(){return arguments})())?U_:function(o){return ye(o)&&Kt.call(o,"callee")&&!M_.call(o,"callee")},Pt=j.isArray,gH=a_?bn(a_):Tz;function fn(o){return o!=null&&wc(o.length)&&!xi(o)}function xe(o){return ye(o)&&fn(o)}function yH(o){return o===!0||o===!1||ye(o)&&tn(o)==pt}var tr=EF||fh,_H=l_?bn(l_):kz;function bH(o){return ye(o)&&o.nodeType===1&&!ra(o)}function xH(o){if(o==null)return!0;if(fn(o)&&(Pt(o)||typeof o=="string"||typeof o.splice=="function"||tr(o)||Cs(o)||Lr(o)))return!o.length;var c=Xe(o);if(c==it||c==ae)return!o.size;if(na(o))return!Of(o).length;for(var p in o)if(Kt.call(o,p))return!1;return!0}function wH(o,c){return Jo(o,c)}function vH(o,c,p){p=typeof p=="function"?p:n;var y=p?p(o,c):n;return y===n?Jo(o,c,n,p):!!y}function eh(o){if(!ye(o))return!1;var c=tn(o);return c==Et||c==mt||typeof o.message=="string"&&typeof o.name=="string"&&!ra(o)}function SH(o){return typeof o=="number"&&C_(o)}function xi(o){if(!pe(o))return!1;var c=tn(o);return c==zt||c==G||c==rt||c==Te}function Gb(o){return typeof o=="number"&&o==Nt(o)}function wc(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=at}function pe(o){var c=typeof o;return o!=null&&(c=="object"||c=="function")}function ye(o){return o!=null&&typeof o=="object"}var Kb=c_?bn(c_):Dz;function TH(o,c){return o===c||Cf(o,c,Yf(c))}function kH(o,c,p){return p=typeof p=="function"?p:n,Cf(o,c,Yf(c),p)}function MH(o){return Xb(o)&&o!=+o}function DH(o){if(uU(o))throw new Ot(s);return H_(o)}function CH(o){return o===null}function OH(o){return o==null}function Xb(o){return typeof o=="number"||ye(o)&&tn(o)==lt}function ra(o){if(!ye(o)||tn(o)!=_t)return!1;var c=Gl(o);if(c===null)return!0;var p=Kt.call(c,"constructor")&&c.constructor;return typeof p=="function"&&p instanceof p&&Vl.call(p)==kF}var nh=u_?bn(u_):Cz;function AH(o){return Gb(o)&&o>=-at&&o<=at}var Zb=d_?bn(d_):Oz;function vc(o){return typeof o=="string"||!Pt(o)&&ye(o)&&tn(o)==cn}function wn(o){return typeof o=="symbol"||ye(o)&&tn(o)==qt}var Cs=f_?bn(f_):Az;function EH(o){return o===n}function RH(o){return ye(o)&&Xe(o)==re}function PH(o){return ye(o)&&tn(o)==De}var IH=fc(Af),LH=fc(function(o,c){return o<=c});function Qb(o){if(!o)return[];if(fn(o))return vc(o)?Fn(o):dn(o);if(Yo&&o[Yo])return hF(o[Yo]());var c=Xe(o),p=c==it?yf:c==ae?Hl:Os;return p(o)}function wi(o){if(!o)return o===0?o:0;if(o=In(o),o===vt||o===-vt){var c=o<0?-1:1;return c*dt}return o===o?o:0}function Nt(o){var c=wi(o),p=c%1;return c===c?p?c-p:c:0}function Jb(o){return o?Er(Nt(o),0,I):0}function In(o){if(typeof o=="number")return o;if(wn(o))return V;if(pe(o)){var c=typeof o.valueOf=="function"?o.valueOf():o;o=pe(c)?c+"":c}if(typeof o!="string")return o===0?o:+o;o=__(o);var p=Hd.test(o);return p||$d.test(o)?Bn(o.slice(2),p?2:8):Ud.test(o)?V:+o}function tx(o){return ei(o,hn(o))}function NH(o){return o?Er(Nt(o),-at,at):o===0?o:0}function Xt(o){return o==null?"":xn(o)}var BH=ks(function(o,c){if(na(c)||fn(c)){ei(c,Ie(c),o);return}for(var p in c)Kt.call(c,p)&&Xo(o,p,c[p])}),ex=ks(function(o,c){ei(c,hn(c),o)}),nx=ks(function(o,c,p,y){ei(c,hn(c),o,y)}),ih=ks(function(o,c,p,y){ei(c,Ie(c),o,y)}),FH=_i(Sf);function zH(o,c){var p=Ts(o);return c==null?p:P_(p,c)}var UH=Ft(function(o,c){o=ie(o);var p=-1,y=c.length,b=y>2?c[2]:n;for(b&&en(c[0],c[1],b)&&(y=1);++p<y;)for(var M=c[p],E=hn(M),R=-1,H=E.length;++R<H;){var Z=E[R],Q=o[Z];(Q===n||Hn(Q,ws[Z])&&!Kt.call(o,Z))&&(o[Z]=M[Z])}return o}),HH=Ft(function(o){return o.push(n,_b),yn(ix,n,o)});function WH(o,c){return p_(o,Mt(c,3),ti)}function $H(o,c){return p_(o,Mt(c,3),kf)}function VH(o,c){return o==null?o:Tf(o,Mt(c,3),hn)}function YH(o,c){return o==null?o:F_(o,Mt(c,3),hn)}function qH(o,c){return o&&ti(o,Mt(c,3))}function jH(o,c){return o&&kf(o,Mt(c,3))}function GH(o){return o==null?[]:rc(o,Ie(o))}function KH(o){return o==null?[]:rc(o,hn(o))}function rh(o,c,p){var y=o==null?n:Rr(o,c);return y===n?p:y}function XH(o,c){return o!=null&&wb(o,c,xz)}function sh(o,c){return o!=null&&wb(o,c,wz)}var ZH=hb(function(o,c,p){c!=null&&typeof c.toString!="function"&&(c=Yl.call(c)),o[c]=p},ah(pn)),QH=hb(function(o,c,p){c!=null&&typeof c.toString!="function"&&(c=Yl.call(c)),Kt.call(o,c)?o[c].push(p):o[c]=[p]},Mt),JH=Ft(Qo);function Ie(o){return fn(o)?E_(o):Of(o)}function hn(o){return fn(o)?E_(o,!0):Ez(o)}function tW(o,c){var p={};return c=Mt(c,3),ti(o,function(y,b,M){Jn(p,c(y,b,M),y)}),p}function eW(o,c){var p={};return c=Mt(c,3),ti(o,function(y,b,M){Jn(p,b,c(y,b,M))}),p}var nW=ks(function(o,c,p){sc(o,c,p)}),ix=ks(function(o,c,p,y){sc(o,c,p,y)}),iW=_i(function(o,c){var p={};if(o==null)return p;var y=!1;c=de(c,function(M){return M=Qi(M,o),y||(y=M.length>1),M}),ei(o,$f(o),p),y&&(p=En(p,g|_|x,Qz));for(var b=c.length;b--;)Lf(p,c[b]);return p});function rW(o,c){return rx(o,xc(Mt(c)))}var sW=_i(function(o,c){return o==null?{}:Pz(o,c)});function rx(o,c){if(o==null)return{};var p=de($f(o),function(y){return[y]});return c=Mt(c),G_(o,p,function(y,b){return c(y,b[0])})}function oW(o,c,p){c=Qi(c,o);var y=-1,b=c.length;for(b||(b=1,o=n);++y<b;){var M=o==null?n:o[Un(c[y])];M===n&&(y=b,M=p),o=xi(M)?M.call(o):M}return o}function aW(o,c,p){return o==null?o:ta(o,c,p)}function lW(o,c,p,y){return y=typeof y=="function"?y:n,o==null?o:ta(o,c,p,y)}var sx=gb(Ie),ox=gb(hn);function cW(o,c,p){var y=Pt(o),b=y||tr(o)||Cs(o);if(c=Mt(c,4),p==null){var M=o&&o.constructor;b?p=y?new M:[]:pe(o)?p=xi(M)?Ts(Gl(o)):{}:p={}}return(b?_n:ti)(o,function(E,R,H){return c(p,E,R,H)}),p}function uW(o,c){return o==null?!0:Lf(o,c)}function dW(o,c,p){return o==null?o:J_(o,c,Ff(p))}function fW(o,c,p,y){return y=typeof y=="function"?y:n,o==null?o:J_(o,c,Ff(p),y)}function Os(o){return o==null?[]:gf(o,Ie(o))}function hW(o){return o==null?[]:gf(o,hn(o))}function pW(o,c,p){return p===n&&(p=c,c=n),p!==n&&(p=In(p),p=p===p?p:0),c!==n&&(c=In(c),c=c===c?c:0),Er(In(o),c,p)}function mW(o,c,p){return c=wi(c),p===n?(p=c,c=0):p=wi(p),o=In(o),vz(o,c,p)}function gW(o,c,p){if(p&&typeof p!="boolean"&&en(o,c,p)&&(c=p=n),p===n&&(typeof c=="boolean"?(p=c,c=n):typeof o=="boolean"&&(p=o,o=n)),o===n&&c===n?(o=0,c=1):(o=wi(o),c===n?(c=o,o=0):c=wi(c)),o>c){var y=o;o=c,c=y}if(p||o%1||c%1){var b=O_();return Ke(o+b*(c-o+Ge("1e-"+((b+"").length-1))),c)}return Rf(o,c)}var yW=Ms(function(o,c,p){return c=c.toLowerCase(),o+(p?ax(c):c)});function ax(o){return oh(Xt(o).toLowerCase())}function lx(o){return o=Xt(o),o&&o.replace(Vd,lF).replace(sf,"")}function _W(o,c,p){o=Xt(o),c=xn(c);var y=o.length;p=p===n?y:Er(Nt(p),0,y);var b=p;return p-=c.length,p>=0&&o.slice(p,b)==c}function bW(o){return o=Xt(o),o&&Ad.test(o)?o.replace(bl,cF):o}function xW(o){return o=Xt(o),o&&Id.test(o)?o.replace(Lo,"\\$&"):o}var wW=Ms(function(o,c,p){return o+(p?"-":"")+c.toLowerCase()}),vW=Ms(function(o,c,p){return o+(p?" ":"")+c.toLowerCase()}),SW=ub("toLowerCase");function TW(o,c,p){o=Xt(o),c=Nt(c);var y=c?bs(o):0;if(!c||y>=c)return o;var b=(c-y)/2;return dc(Ql(b),p)+o+dc(Zl(b),p)}function kW(o,c,p){o=Xt(o),c=Nt(c);var y=c?bs(o):0;return c&&y<c?o+dc(c-y,p):o}function MW(o,c,p){o=Xt(o),c=Nt(c);var y=c?bs(o):0;return c&&y<c?dc(c-y,p)+o:o}function DW(o,c,p){return p||c==null?c=0:c&&(c=+c),LF(Xt(o).replace(No,""),c||0)}function CW(o,c,p){return(p?en(o,c,p):c===n)?c=1:c=Nt(c),Pf(Xt(o),c)}function OW(){var o=arguments,c=Xt(o[0]);return o.length<3?c:c.replace(o[1],o[2])}var AW=Ms(function(o,c,p){return o+(p?"_":"")+c.toLowerCase()});function EW(o,c,p){return p&&typeof p!="number"&&en(o,c,p)&&(c=p=n),p=p===n?I:p>>>0,p?(o=Xt(o),o&&(typeof c=="string"||c!=null&&!nh(c))&&(c=xn(c),!c&&_s(o))?Ji(Fn(o),0,p):o.split(c,p)):[]}var RW=Ms(function(o,c,p){return o+(p?" ":"")+oh(c)});function PW(o,c,p){return o=Xt(o),p=p==null?0:Er(Nt(p),0,o.length),c=xn(c),o.slice(p,p+c.length)==c}function IW(o,c,p){var y=T.templateSettings;p&&en(o,c,p)&&(c=n),o=Xt(o),c=ih({},c,y,yb);var b=ih({},c.imports,y.imports,yb),M=Ie(b),E=gf(b,M);_n(M,function(kt){if(wl.test(kt))throw new Ot(u)});var R,H,Z=0,Q=c.interpolate||ls,et="__p += '",ft=_f((c.escape||ls).source+"|"+Q.source+"|"+(Q===Io?Vi:ls).source+"|"+(c.evaluate||ls).source+"|$","g"),wt="//# sourceURL="+(Kt.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++lf+"]")+`
|
|
10
|
+
`;o.replace(ft,function(kt,Ut,Wt,vn,nn,Sn){return Wt||(Wt=vn),et+=o.slice(Z,Sn).replace(Yd,uF),Ut&&(R=!0,et+=`' +
|
|
11
|
+
__e(`+Ut+`) +
|
|
12
|
+
'`),nn&&(H=!0,et+=`';
|
|
13
13
|
`+nn+`;
|
|
14
|
-
__p += '`),
|
|
15
|
-
((__t = (`+
|
|
16
|
-
'`),Z=Sn+
|
|
14
|
+
__p += '`),Wt&&(et+=`' +
|
|
15
|
+
((__t = (`+Wt+`)) == null ? '' : __t) +
|
|
16
|
+
'`),Z=Sn+kt.length,kt}),et+=`';
|
|
17
17
|
`;var Dt=Kt.call(c,"variable")&&c.variable;if(!Dt)et=`with (obj) {
|
|
18
18
|
`+et+`
|
|
19
19
|
}
|
|
20
|
-
`;else if(
|
|
20
|
+
`;else if(wl.test(Dt))throw new Ot(l);et=(H?et.replace(Eo,""):et).replace(Ro,"$1").replace(Po,"$1;"),et="function("+(Dt||"obj")+`) {
|
|
21
21
|
`+(Dt?"":`obj || (obj = {});
|
|
22
|
-
`)+"var __t, __p = ''"+(
|
|
22
|
+
`)+"var __t, __p = ''"+(R?", __e = _.escape":"")+(H?`, __j = Array.prototype.join;
|
|
23
23
|
function print() { __p += __j.call(arguments, '') }
|
|
24
24
|
`:`;
|
|
25
25
|
`)+et+`return __p
|
|
26
|
-
}`;var Nt=ex(function(){return jt(M,wt+"return "+et).apply(n,R)});if(Nt.source=et,$f(Nt))throw Nt;return Nt}function lW(o){return Xt(o).toLowerCase()}function cW(o){return Xt(o).toUpperCase()}function uW(o,c,p){if(o=Xt(o),o&&(p||c===n))return c_(o);if(!o||!(c=xn(c)))return o;var y=Fn(o),b=Fn(c),M=u_(y,b),R=d_(y,b)+1;return Qi(y,M,R).join("")}function dW(o,c,p){if(o=Xt(o),o&&(p||c===n))return o.slice(0,h_(o)+1);if(!o||!(c=xn(c)))return o;var y=Fn(o),b=d_(y,Fn(c))+1;return Qi(y,0,b).join("")}function fW(o,c,p){if(o=Xt(o),o&&(p||c===n))return o.replace(Oo,"");if(!o||!(c=xn(c)))return o;var y=Fn(o),b=u_(y,Fn(c));return Qi(y,b).join("")}function hW(o,c){var p=L,y=$;if(pe(c)){var b="separator"in c?c.separator:b;p="length"in c?Lt(c.length):p,y="omission"in c?xn(c.omission):y}o=Xt(o);var M=o.length;if(ms(o)){var R=Fn(o);M=R.length}if(p>=M)return o;var E=p-gs(y);if(E<1)return y;var z=R?Qi(R,0,E).join(""):o.slice(0,E);if(b===n)return z+y;if(R&&(E+=z.length-E),Vf(b)){if(o.slice(E).search(b)){var Z,Q=z;for(b.global||(b=of(b.source,Xt(bl.exec(b))+"g")),b.lastIndex=0;Z=b.exec(Q);)var et=Z.index;z=z.slice(0,et===n?E:et)}}else if(o.indexOf(xn(b),E)!=E){var ft=z.lastIndexOf(b);ft>-1&&(z=z.slice(0,ft))}return z+y}function pW(o){return o=Xt(o),o&&yd.test(o)?o.replace(Wi,VB):o}var mW=Ss(function(o,c,p){return o+(p?" ":"")+c.toUpperCase()}),Gf=eb("toUpperCase");function tx(o,c,p){return o=Xt(o),c=p?n:c,c===n?zB(o)?jB(o):OB(o):o.match(c)||[]}var ex=Bt(function(o,c){try{return yn(o,n,c)}catch(p){return $f(p)?p:new At(p)}}),gW=_i(function(o,c){return _n(c,function(p){p=Un(p),Qn(o,p,Hf(o[p],o))}),o});function yW(o){var c=o==null?0:o.length,p=kt();return o=c?de(o,function(y){if(typeof y[1]!="function")throw new An(a);return[p(y[0]),y[1]]}):[],Bt(function(y){for(var b=-1;++b<c;){var M=o[b];if(yn(M[0],this,y))return yn(M[1],this,y)}})}function _W(o){return VF(Rn(o,g))}function Kf(o){return function(){return o}}function bW(o,c){return o==null||o!==o?c:o}var xW=ib(),wW=ib(!0);function pn(o){return o}function Xf(o){return P_(typeof o=="function"?o:Rn(o,g))}function vW(o){return L_(Rn(o,g))}function SW(o,c){return N_(o,Rn(c,g))}var TW=Bt(function(o,c){return function(p){return qo(p,o,c)}}),MW=Bt(function(o,c){return function(p){return qo(o,p,c)}});function Zf(o,c,p){var y=Pe(c),b=ec(c,y);p==null&&!(pe(c)&&(b.length||!y.length))&&(p=c,c=o,o=this,b=ec(c,Pe(c)));var M=!(pe(p)&&"chain"in p)||!!p.chain,R=xi(o);return _n(b,function(E){var z=c[E];o[E]=z,R&&(o.prototype[E]=function(){var Z=this.__chain__;if(M||Z){var Q=o(this.__wrapped__),et=Q.__actions__=dn(this.__actions__);return et.push({func:z,args:arguments,thisArg:o}),Q.__chain__=Z,Q}return z.apply(o,qi([this.value()],arguments))})}),o}function kW(){return ue._===this&&(ue._=JB),this}function Qf(){}function DW(o){return o=Lt(o),Bt(function(c){return B_(c,o)})}var CW=Cf(de),AW=Cf(r_),OW=Cf(Qd);function nx(o){return Lf(o)?Jd(Un(o)):az(o)}function RW(o){return function(c){return o==null?n:Or(o,c)}}var EW=sb(),PW=sb(!0);function Jf(){return[]}function th(){return!1}function IW(){return{}}function LW(){return""}function NW(){return!0}function BW(o,c){if(o=Lt(o),o<1||o>at)return[];var p=P,y=Ke(o,P);c=kt(c),o-=P;for(var b=nf(y,c);++p<o;)c(p);return b}function FW(o){return Pt(o)?de(o,Un):wn(o)?[o]:dn(wb(Xt(o)))}function zW(o){var c=++ZB;return Xt(o)+c}var UW=ac(function(o,c){return o+c},0),HW=Af("ceil"),WW=ac(function(o,c){return o/c},1),$W=Af("floor");function VW(o){return o&&o.length?tc(o,pn,pf):n}function YW(o,c){return o&&o.length?tc(o,kt(c,2),pf):n}function qW(o){return a_(o,pn)}function jW(o,c){return a_(o,kt(c,2))}function GW(o){return o&&o.length?tc(o,pn,_f):n}function KW(o,c){return o&&o.length?tc(o,kt(c,2),_f):n}var XW=ac(function(o,c){return o*c},1),ZW=Af("round"),QW=ac(function(o,c){return o-c},0);function JW(o){return o&&o.length?ef(o,pn):0}function t3(o,c){return o&&o.length?ef(o,kt(c,2)):0}return T.after=S5,T.ary=Eb,T.assign=uH,T.assignIn=qb,T.assignInWith=jb,T.assignWith=Yf,T.at=dH,T.before=Pb,T.bind=Hf,T.bindAll=gW,T.bindKey=Ib,T.castArray=L5,T.chain=Ab,T.chunk=Vz,T.compact=Yz,T.concat=qz,T.cond=yW,T.conforms=_W,T.constant=Kf,T.countBy=t5,T.create=fH,T.curry=Lb,T.curryRight=Nb,T.debounce=Bb,T.defaults=hH,T.defaultsDeep=pH,T.defer=T5,T.delay=M5,T.difference=jz,T.differenceBy=Gz,T.differenceWith=Kz,T.drop=Xz,T.dropRight=Zz,T.dropRightWhile=Qz,T.dropWhile=Jz,T.fill=tU,T.filter=n5,T.flatMap=s5,T.flatMapDeep=o5,T.flatMapDepth=a5,T.flatten=Mb,T.flattenDeep=eU,T.flattenDepth=nU,T.flip=k5,T.flow=xW,T.flowRight=wW,T.fromPairs=iU,T.functions=wH,T.functionsIn=vH,T.groupBy=l5,T.initial=sU,T.intersection=oU,T.intersectionBy=aU,T.intersectionWith=lU,T.invert=TH,T.invertBy=MH,T.invokeMap=u5,T.iteratee=Xf,T.keyBy=d5,T.keys=Pe,T.keysIn=hn,T.map=pc,T.mapKeys=DH,T.mapValues=CH,T.matches=vW,T.matchesProperty=SW,T.memoize=gc,T.merge=AH,T.mergeWith=Gb,T.method=TW,T.methodOf=MW,T.mixin=Zf,T.negate=yc,T.nthArg=DW,T.omit=OH,T.omitBy=RH,T.once=D5,T.orderBy=f5,T.over=CW,T.overArgs=C5,T.overEvery=AW,T.overSome=OW,T.partial=Wf,T.partialRight=Fb,T.partition=h5,T.pick=EH,T.pickBy=Kb,T.property=nx,T.propertyOf=RW,T.pull=fU,T.pullAll=Db,T.pullAllBy=hU,T.pullAllWith=pU,T.pullAt=mU,T.range=EW,T.rangeRight=PW,T.rearg=A5,T.reject=g5,T.remove=gU,T.rest=O5,T.reverse=zf,T.sampleSize=_5,T.set=IH,T.setWith=LH,T.shuffle=b5,T.slice=yU,T.sortBy=v5,T.sortedUniq=TU,T.sortedUniqBy=MU,T.split=rW,T.spread=R5,T.tail=kU,T.take=DU,T.takeRight=CU,T.takeRightWhile=AU,T.takeWhile=OU,T.tap=YU,T.throttle=E5,T.thru=hc,T.toArray=$b,T.toPairs=Xb,T.toPairsIn=Zb,T.toPath=FW,T.toPlainObject=Yb,T.transform=NH,T.unary=P5,T.union=RU,T.unionBy=EU,T.unionWith=PU,T.uniq=IU,T.uniqBy=LU,T.uniqWith=NU,T.unset=BH,T.unzip=Uf,T.unzipWith=Cb,T.update=FH,T.updateWith=zH,T.values=ks,T.valuesIn=UH,T.without=BU,T.words=tx,T.wrap=I5,T.xor=FU,T.xorBy=zU,T.xorWith=UU,T.zip=HU,T.zipObject=WU,T.zipObjectDeep=$U,T.zipWith=VU,T.entries=Xb,T.entriesIn=Zb,T.extend=qb,T.extendWith=jb,Zf(T,T),T.add=UW,T.attempt=ex,T.camelCase=VH,T.capitalize=Qb,T.ceil=HW,T.clamp=HH,T.clone=N5,T.cloneDeep=F5,T.cloneDeepWith=z5,T.cloneWith=B5,T.conformsTo=U5,T.deburr=Jb,T.defaultTo=bW,T.divide=WW,T.endsWith=YH,T.eq=Hn,T.escape=qH,T.escapeRegExp=jH,T.every=e5,T.find=i5,T.findIndex=Sb,T.findKey=mH,T.findLast=r5,T.findLastIndex=Tb,T.findLastKey=gH,T.floor=$W,T.forEach=Ob,T.forEachRight=Rb,T.forIn=yH,T.forInRight=_H,T.forOwn=bH,T.forOwnRight=xH,T.get=qf,T.gt=H5,T.gte=W5,T.has=SH,T.hasIn=jf,T.head=kb,T.identity=pn,T.includes=c5,T.indexOf=rU,T.inRange=WH,T.invoke=kH,T.isArguments=Pr,T.isArray=Pt,T.isArrayBuffer=$5,T.isArrayLike=fn,T.isArrayLikeObject=xe,T.isBoolean=V5,T.isBuffer=Ji,T.isDate=Y5,T.isElement=q5,T.isEmpty=j5,T.isEqual=G5,T.isEqualWith=K5,T.isError=$f,T.isFinite=X5,T.isFunction=xi,T.isInteger=zb,T.isLength=_c,T.isMap=Ub,T.isMatch=Z5,T.isMatchWith=Q5,T.isNaN=J5,T.isNative=tH,T.isNil=nH,T.isNull=eH,T.isNumber=Hb,T.isObject=pe,T.isObjectLike=ye,T.isPlainObject=Qo,T.isRegExp=Vf,T.isSafeInteger=iH,T.isSet=Wb,T.isString=bc,T.isSymbol=wn,T.isTypedArray=Ms,T.isUndefined=rH,T.isWeakMap=sH,T.isWeakSet=oH,T.join=cU,T.kebabCase=GH,T.last=Pn,T.lastIndexOf=uU,T.lowerCase=KH,T.lowerFirst=XH,T.lt=aH,T.lte=lH,T.max=VW,T.maxBy=YW,T.mean=qW,T.meanBy=jW,T.min=GW,T.minBy=KW,T.stubArray=Jf,T.stubFalse=th,T.stubObject=IW,T.stubString=LW,T.stubTrue=NW,T.multiply=XW,T.nth=dU,T.noConflict=kW,T.noop=Qf,T.now=mc,T.pad=ZH,T.padEnd=QH,T.padStart=JH,T.parseInt=tW,T.random=$H,T.reduce=p5,T.reduceRight=m5,T.repeat=eW,T.replace=nW,T.result=PH,T.round=ZW,T.runInContext=F,T.sample=y5,T.size=x5,T.snakeCase=iW,T.some=w5,T.sortedIndex=_U,T.sortedIndexBy=bU,T.sortedIndexOf=xU,T.sortedLastIndex=wU,T.sortedLastIndexBy=vU,T.sortedLastIndexOf=SU,T.startCase=sW,T.startsWith=oW,T.subtract=QW,T.sum=JW,T.sumBy=t3,T.template=aW,T.times=BW,T.toFinite=wi,T.toInteger=Lt,T.toLength=Vb,T.toLower=lW,T.toNumber=In,T.toSafeInteger=cH,T.toString=Xt,T.toUpper=cW,T.trim=uW,T.trimEnd=dW,T.trimStart=fW,T.truncate=hW,T.unescape=pW,T.uniqueId=zW,T.upperCase=mW,T.upperFirst=Gf,T.each=Ob,T.eachRight=Rb,T.first=kb,Zf(T,(function(){var o={};return Jn(T,function(c,p){Kt.call(T.prototype,p)||(o[p]=c)}),o})(),{chain:!1}),T.VERSION=i,_n(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){T[o].placeholder=T}),_n(["drop","take"],function(o,c){Ut.prototype[o]=function(p){p=p===n?1:Ae(Lt(p),0);var y=this.__filtered__&&!c?new Ut(this):this.clone();return y.__filtered__?y.__takeCount__=Ke(p,y.__takeCount__):y.__views__.push({size:Ke(p,P),type:o+(y.__dir__<0?"Right":"")}),y},Ut.prototype[o+"Right"]=function(p){return this.reverse()[o](p).reverse()}}),_n(["filter","map","takeWhile"],function(o,c){var p=c+1,y=p==ct||p==ut;Ut.prototype[o]=function(b){var M=this.clone();return M.__iteratees__.push({iteratee:kt(b,3),type:p}),M.__filtered__=M.__filtered__||y,M}}),_n(["head","last"],function(o,c){var p="take"+(c?"Right":"");Ut.prototype[o]=function(){return this[p](1).value()[0]}}),_n(["initial","tail"],function(o,c){var p="drop"+(c?"":"Right");Ut.prototype[o]=function(){return this.__filtered__?new Ut(this):this[p](1)}}),Ut.prototype.compact=function(){return this.filter(pn)},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(p){return qo(p,o,c)})}),Ut.prototype.reject=function(o){return this.filter(yc(kt(o)))},Ut.prototype.slice=function(o,c){o=Lt(o);var p=this;return p.__filtered__&&(o>0||c<0)?new Ut(p):(o<0?p=p.takeRight(-o):o&&(p=p.drop(o)),c!==n&&(c=Lt(c),p=c<0?p.dropRight(-c):p.take(c-o)),p)},Ut.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},Ut.prototype.toArray=function(){return this.take(P)},Jn(Ut.prototype,function(o,c){var p=/^(?:filter|find|map|reject)|While$/.test(c),y=/^(?:head|last)$/.test(c),b=T[y?"take"+(c=="last"?"Right":""):c],M=y||/^find/.test(c);b&&(T.prototype[c]=function(){var R=this.__wrapped__,E=y?[1]:arguments,z=R instanceof Ut,Z=E[0],Q=z||Pt(R),et=function(zt){var Ht=b.apply(T,qi([zt],E));return y&&ft?Ht[0]:Ht};Q&&p&&typeof Z=="function"&&Z.length!=1&&(z=Q=!1);var ft=this.__chain__,wt=!!this.__actions__.length,Dt=M&&!ft,Nt=z&&!wt;if(!M&&Q){R=Nt?R:new Ut(this);var Mt=o.apply(R,E);return Mt.__actions__.push({func:hc,args:[et],thisArg:n}),new On(Mt,ft)}return Dt&&Nt?o.apply(this,E):(Mt=this.thru(et),Dt?y?Mt.value()[0]:Mt.value():Mt)})}),_n(["pop","push","shift","sort","splice","unshift"],function(o){var c=zl[o],p=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",y=/^(?:pop|shift)$/.test(o);T.prototype[o]=function(){var b=arguments;if(y&&!this.__chain__){var M=this.value();return c.apply(Pt(M)?M:[],b)}return this[p](function(R){return c.apply(Pt(R)?R:[],b)})}}),Jn(Ut.prototype,function(o,c){var p=T[c];if(p){var y=p.name+"";Kt.call(xs,y)||(xs[y]=[]),xs[y].push({name:c,func:p})}}),xs[oc(n,O).name]=[{name:"wrapper",func:n}],Ut.prototype.clone=mF,Ut.prototype.reverse=gF,Ut.prototype.value=yF,T.prototype.at=qU,T.prototype.chain=jU,T.prototype.commit=GU,T.prototype.next=KU,T.prototype.plant=ZU,T.prototype.reverse=QU,T.prototype.toJSON=T.prototype.valueOf=T.prototype.value=JU,T.prototype.first=T.prototype.head,zo&&(T.prototype[zo]=XU),T}),ys=GB();Zn?((Zn.exports=ys)._=ys,hs._=ys):ue._=ys}).call(uB)})(vo,vo.exports)),vo.exports}var Gy=dB(),pl={exports:{}},fB=pl.exports,Ky;function hB(){return Ky||(Ky=1,(function(e,t){(function(n,i){i()})(fB,function(){function n(d,f){return typeof f>"u"?f={autoBom:!1}:typeof f!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),f={autoBom:!f}),f.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,f,m){var g=new XMLHttpRequest;g.open("GET",d),g.responseType="blob",g.onload=function(){u(g.response,f,m)},g.onerror=function(){console.error("could not download file")},g.send()}function r(d){var f=new XMLHttpRequest;f.open("HEAD",d,!1);try{f.send()}catch{}return 200<=f.status&&299>=f.status}function s(d){try{d.dispatchEvent(new MouseEvent("click"))}catch{var f=document.createEvent("MouseEvents");f.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),d.dispatchEvent(f)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Ui=="object"&&Ui.global===Ui?Ui: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,f,m){var g=a.URL||a.webkitURL,_=document.createElement("a");f=f||d.name||"download",_.download=f,_.rel="noopener",typeof d=="string"?(_.href=d,_.origin===location.origin?s(_):r(_.href)?i(d,f,m):s(_,_.target="_blank")):(_.href=g.createObjectURL(d),setTimeout(function(){g.revokeObjectURL(_.href)},4e4),setTimeout(function(){s(_)},0))}:"msSaveOrOpenBlob"in navigator?function(d,f,m){if(f=f||d.name||"download",typeof d!="string")navigator.msSaveOrOpenBlob(n(d,m),f);else if(r(d))i(d,f,m);else{var g=document.createElement("a");g.href=d,g.target="_blank",setTimeout(function(){s(g)})}}:function(d,f,m,g){if(g=g||open("","_blank"),g&&(g.document.title=g.document.body.innerText="downloading..."),typeof d=="string")return i(d,f,m);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 S=new FileReader;S.onloadend=function(){var B=S.result;B=v?B:B.replace(/^data:[^;]*;/,"data:attachment/file;"),g?g.location.href=B:location=B,g=null},S.readAsDataURL(d)}else{var C=a.URL||a.webkitURL,O=C.createObjectURL(d);g?g.location=O:location.href=O,g=null,setTimeout(function(){C.revokeObjectURL(O)},4e4)}});a.saveAs=u.saveAs=u,e.exports=u})})(pl)),pl.exports}var pB=hB(),ml={exports:{}};var mB=ml.exports,Xy;function gB(){return Xy||(Xy=1,(function(e,t){((n,i)=>{e.exports=i()})(mB,function n(){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(D){return D.charCodeAt(0)===65279?D.slice(1):D}function f(D){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(w){var A=N(w);A.chunkSize=parseInt(A.chunkSize),w.step||w.chunk||(A.chunkSize=null),this._handle=new v(A),(this._handle.streamer=this)._config=A}).call(this,D),this.parseChunk=function(w,A){var L=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<L){let q=this._config.newline;q||($=this._config.quoteChar||'"',q=this._handle.guessLineEndings(w,$)),w=[...w.split(q).slice(L)].join(q)}this.isFirstChunk&&U(this._config.beforeFirstChunk)&&($=this._config.beforeFirstChunk(w))!==void 0&&(w=$),this.isFirstChunk=!1,this._halted=!1;var L=this._partialLine+w,$=(this._partialLine="",this._handle.parse(L,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(w=$.meta.cursor,L=(this._finished||(this._partialLine=L.substring(w-this._baseIndex),this._baseIndex=w),$&&$.data&&(this._rowCount+=$.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),s)i.postMessage({results:$,workerId:u.WORKER_ID,finished:L});else if(U(this._config.chunk)&&!A){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||!L||!U(this._config.complete)||$&&$.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),L||$&&$.meta.paused||this._nextChunk(),$}this._halted=!0},this._sendError=function(w){U(this._config.error)?this._config.error(w):s&&this._config.error&&i.postMessage({workerId:u.WORKER_ID,error:w,finished:!1})}}function m(D){var w;(D=D||{}).chunkSize||(D.chunkSize=u.RemoteChunkSize),f.call(this,D),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(A){this._input=A,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(w=new XMLHttpRequest,this._config.withCredentials&&(w.withCredentials=this._config.withCredentials),r||(w.onload=W(this._chunkLoaded,this),w.onerror=W(this._chunkError,this)),w.ontimeout=W(this._chunkTimeout,this),w.open(this._config.downloadRequestBody?"POST":"GET",this._input,!r),this._config.downloadTimeout&&!r&&(w.timeout=this._config.downloadTimeout),this._config.downloadRequestHeaders){var A,L=this._config.downloadRequestHeaders;for(A in L)w.setRequestHeader(A,L[A])}var $;this._config.chunkSize&&($=this._start+this._config.chunkSize-1,w.setRequestHeader("Range","bytes="+this._start+"-"+$));try{w.send(this._config.downloadRequestBody)}catch(q){this._chunkError(q.message)}r&&w.status===0&&this._chunkError()}},this._chunkLoaded=function(){w.readyState===4&&(w.status<200||400<=w.status?this._chunkError():(this._start+=this._config.chunkSize||w.responseText.length,this._finished=!this._config.chunkSize||this._start>=(A=>(A=A.getResponseHeader("Content-Range"))!==null?parseInt(A.substring(A.lastIndexOf("/")+1)):-1)(w),this.parseChunk(w.responseText)))},this._chunkError=function(A){A=w.statusText||A,this._sendError(new Error(A))},this._chunkTimeout=function(){this._chunkError("Request timed out after "+this._config.downloadTimeout+"ms")}}function g(D){(D=D||{}).chunkSize||(D.chunkSize=u.LocalChunkSize),f.call(this,D);var w,A,L=typeof FileReader<"u";this.stream=function($){this._input=$,A=$.slice||$.webkitSlice||$.mozSlice,L?((w=new FileReader).onload=W(this._chunkLoaded,this),w.onerror=W(this._chunkError,this)):w=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,q=(this._config.chunkSize&&(q=Math.min(this._start+this._config.chunkSize,this._input.size),$=A.call($,this._start,q)),w.readAsText($,this._config.encoding));L||this._chunkLoaded({target:{result:q}})},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(w.error)}}function _(D){var w;f.call(this,D=D||{}),this.stream=function(A){return w=A,this._nextChunk()},this._nextChunk=function(){var A,L;if(!this._finished)return A=this._config.chunkSize,w=A?(L=w.substring(0,A),w.substring(A)):(L=w,""),this._finished=!w,this.parseChunk(L)}}function x(D){f.call(this,D=D||{});var w=[],A=!0,L=!1;this.pause=function(){f.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){f.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(){L&&w.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),w.length?this.parseChunk(w.shift()):A=!0},this._streamData=W(function($){try{w.push(typeof $=="string"?$:$.toString(this._config.encoding)),A&&(A=!1,this._checkIsFinished(),this.parseChunk(w.shift()))}catch(q){this._streamError(q)}},this),this._streamError=W(function($){this._streamCleanUp(),this._sendError($)},this),this._streamEnd=W(function(){this._streamCleanUp(),L=!0,this._streamData("")},this),this._streamCleanUp=W(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function v(D){var w,A,L,$,q=Math.pow(2,53),st=-q,ct=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,ht=/^((\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)))$/,ut=this,vt=0,at=0,dt=!1,V=!1,P=[],H={data:[],errors:[],meta:{}};function nt(rt){return D.skipEmptyLines==="greedy"?rt.join("").trim()==="":rt.length===1&&rt[0].length===0}function ot(){if(H&&L&&(tt("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+u.DefaultDelimiter+"'"),L=!1),D.skipEmptyLines&&(H.data=H.data.filter(function(mt){return!nt(mt)})),X()){let mt=function(Rt){P.push(Rt)};if(H)if(Array.isArray(H.data[0])){for(var rt=0;X()&&rt<H.data.length;rt++)H.data[rt].forEach(mt);H.data.splice(0,1)}else H.data.forEach(mt)}function pt(mt,Rt){for(var Ft=D.header?{}:[],G=0;G<mt.length;G++){var it=G,lt=mt[G],lt=((Wt,_t)=>(Vt=>(D.dynamicTypingFunction&&D.dynamicTyping[Vt]===void 0&&(D.dynamicTyping[Vt]=D.dynamicTypingFunction(Vt)),(D.dynamicTyping[Vt]||D.dynamicTyping)===!0))(Wt)?_t==="true"||_t==="TRUE"||_t!=="false"&&_t!=="FALSE"&&((Vt=>{if(ct.test(Vt)&&(Vt=parseFloat(Vt),st<Vt&&Vt<q))return 1})(_t)?parseFloat(_t):ht.test(_t)?new Date(_t):_t===""?null:_t):_t)(it=D.header?G>=P.length?"__parsed_extra":P[G]:it,lt=D.transform?D.transform(lt,it):lt);it==="__parsed_extra"?(Ft[it]=Ft[it]||[],Ft[it].push(lt)):Ft[it]=lt}return D.header&&(G>P.length?tt("FieldMismatch","TooManyFields","Too many fields: expected "+P.length+" fields but parsed "+G,at+Rt):G<P.length&&tt("FieldMismatch","TooFewFields","Too few fields: expected "+P.length+" fields but parsed "+G,at+Rt)),Ft}var yt;H&&(D.header||D.dynamicTyping||D.transform)&&(yt=1,!H.data.length||Array.isArray(H.data[0])?(H.data=H.data.map(pt),yt=H.data.length):H.data=pt(H.data,0),D.header&&H.meta&&(H.meta.fields=P),at+=yt)}function X(){return D.header&&P.length===0}function tt(rt,pt,yt,mt){rt={type:rt,code:pt,message:yt},mt!==void 0&&(rt.row=mt),H.errors.push(rt)}U(D.step)&&($=D.step,D.step=function(rt){H=rt,X()?ot():(ot(),H.data.length!==0&&(vt+=rt.data.length,D.preview&&vt>D.preview?A.abort():(H.data=H.data[0],$(H,ut))))}),this.parse=function(rt,pt,yt){var mt=D.quoteChar||'"',mt=(D.newline||(D.newline=this.guessLineEndings(rt,mt)),L=!1,D.delimiter?U(D.delimiter)&&(D.delimiter=D.delimiter(rt),H.meta.delimiter=D.delimiter):((mt=((Rt,Ft,G,it,lt)=>{var Wt,_t,Vt,Te;lt=lt||[","," ","|",";",u.RECORD_SEP,u.UNIT_SEP];for(var Me=0;Me<lt.length;Me++){for(var ae,cn=lt[Me],qt=0,Ne=0,re=0,ke=(Vt=void 0,new C({comments:it,delimiter:cn,newline:Ft,preview:10}).parse(Rt)),Ee=0;Ee<ke.data.length;Ee++)G&&nt(ke.data[Ee])?re++:(ae=ke.data[Ee].length,Ne+=ae,Vt===void 0?Vt=ae:0<ae&&(qt+=Math.abs(ae-Vt),Vt=ae));0<ke.data.length&&(Ne/=ke.data.length-re),1.99<Ne&&(_t===void 0||qt<_t||qt===_t&&Te<Ne)&&(_t=qt,Wt=cn,Te=Ne)}return{successful:!!(D.delimiter=Wt),bestDelimiter:Wt}})(rt,D.newline,D.skipEmptyLines,D.comments,D.delimitersToGuess)).successful?D.delimiter=mt.bestDelimiter:(L=!0,D.delimiter=u.DefaultDelimiter),H.meta.delimiter=D.delimiter),N(D));return mt.header=X(),D.preview&&D.header&&mt.preview++,w=rt,A=new C(mt),H=A.parse(w,pt,yt),ot(),dt?{meta:{paused:!0}}:H||{meta:{paused:!1}}},this.paused=function(){return dt},this.pause=function(){dt=!0,A.abort(),w=U(D.chunk)?"":w.substring(A.getCharIndex())},this.resume=function(){ut.streamer._halted?(dt=!1,ut.streamer.parseChunk(w,!0)):setTimeout(ut.resume,3)},this.aborted=function(){return V},this.abort=function(){V=!0,A.abort(),H.meta.aborted=!0,U(D.complete)&&D.complete(H),w=""},this.guessLineEndings=function(Rt,mt){Rt=Rt.substring(0,1048576);var mt=new RegExp(S(mt)+"([^]*?)"+S(mt),"gm"),yt=(Rt=Rt.replace(mt,"")).split("\r"),mt=Rt.split(`
|
|
27
|
-
`),
|
|
28
|
-
`;for(var
|
|
29
|
-
`&&
|
|
30
|
-
`:"\r"}}function S(
|
|
31
|
-
`&&
|
|
32
|
-
`&&(
|
|
33
|
-
`);var at=0,dt=!1;this.parse=function(V,
|
|
34
|
-
`,st='"',ct=st+st,ht=!1,ut=null,vt=!1,at=((()=>{if(typeof w=="object"){if(typeof w.delimiter!="string"||u.BAD_DELIMITERS.filter(function(
|
|
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=m,u.FileStreamer=g,u.StringStreamer=_,u.ReadableStreamStreamer=x,s&&(i.onmessage=function(
|
|
36
|
-
`+
|
|
26
|
+
}`;var Bt=ux(function(){return jt(M,wt+"return "+et).apply(n,E)});if(Bt.source=et,eh(Bt))throw Bt;return Bt}function LW(o){return Xt(o).toLowerCase()}function NW(o){return Xt(o).toUpperCase()}function BW(o,c,p){if(o=Xt(o),o&&(p||c===n))return __(o);if(!o||!(c=xn(c)))return o;var y=Fn(o),b=Fn(c),M=b_(y,b),E=x_(y,b)+1;return Ji(y,M,E).join("")}function FW(o,c,p){if(o=Xt(o),o&&(p||c===n))return o.slice(0,v_(o)+1);if(!o||!(c=xn(c)))return o;var y=Fn(o),b=x_(y,Fn(c))+1;return Ji(y,0,b).join("")}function zW(o,c,p){if(o=Xt(o),o&&(p||c===n))return o.replace(No,"");if(!o||!(c=xn(c)))return o;var y=Fn(o),b=b_(y,Fn(c));return Ji(y,b).join("")}function UW(o,c){var p=L,y=$;if(pe(c)){var b="separator"in c?c.separator:b;p="length"in c?Nt(c.length):p,y="omission"in c?xn(c.omission):y}o=Xt(o);var M=o.length;if(_s(o)){var E=Fn(o);M=E.length}if(p>=M)return o;var R=p-bs(y);if(R<1)return y;var H=E?Ji(E,0,R).join(""):o.slice(0,R);if(b===n)return H+y;if(E&&(R+=H.length-R),nh(b)){if(o.slice(R).search(b)){var Z,Q=H;for(b.global||(b=_f(b.source,Xt(vl.exec(b))+"g")),b.lastIndex=0;Z=b.exec(Q);)var et=Z.index;H=H.slice(0,et===n?R:et)}}else if(o.indexOf(xn(b),R)!=R){var ft=H.lastIndexOf(b);ft>-1&&(H=H.slice(0,ft))}return H+y}function HW(o){return o=Xt(o),o&&Od.test(o)?o.replace($i,yF):o}var WW=Ms(function(o,c,p){return o+(p?" ":"")+c.toUpperCase()}),oh=ub("toUpperCase");function cx(o,c,p){return o=Xt(o),c=p?n:c,c===n?fF(o)?xF(o):iF(o):o.match(c)||[]}var ux=Ft(function(o,c){try{return yn(o,n,c)}catch(p){return eh(p)?p:new Ot(p)}}),$W=_i(function(o,c){return _n(c,function(p){p=Un(p),Jn(o,p,Jf(o[p],o))}),o});function VW(o){var c=o==null?0:o.length,p=Mt();return o=c?de(o,function(y){if(typeof y[1]!="function")throw new On(a);return[p(y[0]),y[1]]}):[],Ft(function(y){for(var b=-1;++b<c;){var M=o[b];if(yn(M[0],this,y))return yn(M[1],this,y)}})}function YW(o){return yz(En(o,g))}function ah(o){return function(){return o}}function qW(o,c){return o==null||o!==o?c:o}var jW=fb(),GW=fb(!0);function pn(o){return o}function lh(o){return W_(typeof o=="function"?o:En(o,g))}function KW(o){return V_(En(o,g))}function XW(o,c){return Y_(o,En(c,g))}var ZW=Ft(function(o,c){return function(p){return Qo(p,o,c)}}),QW=Ft(function(o,c){return function(p){return Qo(o,p,c)}});function ch(o,c,p){var y=Ie(c),b=rc(c,y);p==null&&!(pe(c)&&(b.length||!y.length))&&(p=c,c=o,o=this,b=rc(c,Ie(c)));var M=!(pe(p)&&"chain"in p)||!!p.chain,E=xi(o);return _n(b,function(R){var H=c[R];o[R]=H,E&&(o.prototype[R]=function(){var Z=this.__chain__;if(M||Z){var Q=o(this.__wrapped__),et=Q.__actions__=dn(this.__actions__);return et.push({func:H,args:arguments,thisArg:o}),Q.__chain__=Z,Q}return H.apply(o,ji([this.value()],arguments))})}),o}function JW(){return ue._===this&&(ue._=MF),this}function uh(){}function t3(o){return o=Nt(o),Ft(function(c){return q_(c,o)})}var e3=Uf(de),n3=Uf(h_),i3=Uf(df);function dx(o){return jf(o)?ff(Un(o)):Iz(o)}function r3(o){return function(c){return o==null?n:Rr(o,c)}}var s3=pb(),o3=pb(!0);function dh(){return[]}function fh(){return!1}function a3(){return{}}function l3(){return""}function c3(){return!0}function u3(o,c){if(o=Nt(o),o<1||o>at)return[];var p=I,y=Ke(o,I);c=Mt(c),o-=I;for(var b=mf(y,c);++p<o;)c(p);return b}function d3(o){return Pt(o)?de(o,Un):wn(o)?[o]:dn(Ab(Xt(o)))}function f3(o){var c=++TF;return Xt(o)+c}var h3=uc(function(o,c){return o+c},0),p3=Hf("ceil"),m3=uc(function(o,c){return o/c},1),g3=Hf("floor");function y3(o){return o&&o.length?ic(o,pn,Mf):n}function _3(o,c){return o&&o.length?ic(o,Mt(c,2),Mf):n}function b3(o){return g_(o,pn)}function x3(o,c){return g_(o,Mt(c,2))}function w3(o){return o&&o.length?ic(o,pn,Af):n}function v3(o,c){return o&&o.length?ic(o,Mt(c,2),Af):n}var S3=uc(function(o,c){return o*c},1),T3=Hf("round"),k3=uc(function(o,c){return o-c},0);function M3(o){return o&&o.length?pf(o,pn):0}function D3(o,c){return o&&o.length?pf(o,Mt(c,2)):0}return T.after=X5,T.ary=Hb,T.assign=BH,T.assignIn=ex,T.assignInWith=nx,T.assignWith=ih,T.at=FH,T.before=Wb,T.bind=Jf,T.bindAll=$W,T.bindKey=$b,T.castArray=lH,T.chain=Fb,T.chunk=yU,T.compact=_U,T.concat=bU,T.cond=VW,T.conforms=YW,T.constant=ah,T.countBy=D5,T.create=zH,T.curry=Vb,T.curryRight=Yb,T.debounce=qb,T.defaults=UH,T.defaultsDeep=HH,T.defer=Z5,T.delay=Q5,T.difference=xU,T.differenceBy=wU,T.differenceWith=vU,T.drop=SU,T.dropRight=TU,T.dropRightWhile=kU,T.dropWhile=MU,T.fill=DU,T.filter=O5,T.flatMap=R5,T.flatMapDeep=P5,T.flatMapDepth=I5,T.flatten=Ib,T.flattenDeep=CU,T.flattenDepth=OU,T.flip=J5,T.flow=jW,T.flowRight=GW,T.fromPairs=AU,T.functions=GH,T.functionsIn=KH,T.groupBy=L5,T.initial=RU,T.intersection=PU,T.intersectionBy=IU,T.intersectionWith=LU,T.invert=ZH,T.invertBy=QH,T.invokeMap=B5,T.iteratee=lh,T.keyBy=F5,T.keys=Ie,T.keysIn=hn,T.map=yc,T.mapKeys=tW,T.mapValues=eW,T.matches=KW,T.matchesProperty=XW,T.memoize=bc,T.merge=nW,T.mergeWith=ix,T.method=ZW,T.methodOf=QW,T.mixin=ch,T.negate=xc,T.nthArg=t3,T.omit=iW,T.omitBy=rW,T.once=tH,T.orderBy=z5,T.over=e3,T.overArgs=eH,T.overEvery=n3,T.overSome=i3,T.partial=th,T.partialRight=jb,T.partition=U5,T.pick=sW,T.pickBy=rx,T.property=dx,T.propertyOf=r3,T.pull=zU,T.pullAll=Nb,T.pullAllBy=UU,T.pullAllWith=HU,T.pullAt=WU,T.range=s3,T.rangeRight=o3,T.rearg=nH,T.reject=$5,T.remove=$U,T.rest=iH,T.reverse=Zf,T.sampleSize=Y5,T.set=aW,T.setWith=lW,T.shuffle=q5,T.slice=VU,T.sortBy=K5,T.sortedUniq=ZU,T.sortedUniqBy=QU,T.split=EW,T.spread=rH,T.tail=JU,T.take=t5,T.takeRight=e5,T.takeRightWhile=n5,T.takeWhile=i5,T.tap=_5,T.throttle=sH,T.thru=gc,T.toArray=Qb,T.toPairs=sx,T.toPairsIn=ox,T.toPath=d3,T.toPlainObject=tx,T.transform=cW,T.unary=oH,T.union=r5,T.unionBy=s5,T.unionWith=o5,T.uniq=a5,T.uniqBy=l5,T.uniqWith=c5,T.unset=uW,T.unzip=Qf,T.unzipWith=Bb,T.update=dW,T.updateWith=fW,T.values=Os,T.valuesIn=hW,T.without=u5,T.words=cx,T.wrap=aH,T.xor=d5,T.xorBy=f5,T.xorWith=h5,T.zip=p5,T.zipObject=m5,T.zipObjectDeep=g5,T.zipWith=y5,T.entries=sx,T.entriesIn=ox,T.extend=ex,T.extendWith=nx,ch(T,T),T.add=h3,T.attempt=ux,T.camelCase=yW,T.capitalize=ax,T.ceil=p3,T.clamp=pW,T.clone=cH,T.cloneDeep=dH,T.cloneDeepWith=fH,T.cloneWith=uH,T.conformsTo=hH,T.deburr=lx,T.defaultTo=qW,T.divide=m3,T.endsWith=_W,T.eq=Hn,T.escape=bW,T.escapeRegExp=xW,T.every=C5,T.find=A5,T.findIndex=Rb,T.findKey=WH,T.findLast=E5,T.findLastIndex=Pb,T.findLastKey=$H,T.floor=g3,T.forEach=zb,T.forEachRight=Ub,T.forIn=VH,T.forInRight=YH,T.forOwn=qH,T.forOwnRight=jH,T.get=rh,T.gt=pH,T.gte=mH,T.has=XH,T.hasIn=sh,T.head=Lb,T.identity=pn,T.includes=N5,T.indexOf=EU,T.inRange=mW,T.invoke=JH,T.isArguments=Lr,T.isArray=Pt,T.isArrayBuffer=gH,T.isArrayLike=fn,T.isArrayLikeObject=xe,T.isBoolean=yH,T.isBuffer=tr,T.isDate=_H,T.isElement=bH,T.isEmpty=xH,T.isEqual=wH,T.isEqualWith=vH,T.isError=eh,T.isFinite=SH,T.isFunction=xi,T.isInteger=Gb,T.isLength=wc,T.isMap=Kb,T.isMatch=TH,T.isMatchWith=kH,T.isNaN=MH,T.isNative=DH,T.isNil=OH,T.isNull=CH,T.isNumber=Xb,T.isObject=pe,T.isObjectLike=ye,T.isPlainObject=ra,T.isRegExp=nh,T.isSafeInteger=AH,T.isSet=Zb,T.isString=vc,T.isSymbol=wn,T.isTypedArray=Cs,T.isUndefined=EH,T.isWeakMap=RH,T.isWeakSet=PH,T.join=NU,T.kebabCase=wW,T.last=Pn,T.lastIndexOf=BU,T.lowerCase=vW,T.lowerFirst=SW,T.lt=IH,T.lte=LH,T.max=y3,T.maxBy=_3,T.mean=b3,T.meanBy=x3,T.min=w3,T.minBy=v3,T.stubArray=dh,T.stubFalse=fh,T.stubObject=a3,T.stubString=l3,T.stubTrue=c3,T.multiply=S3,T.nth=FU,T.noConflict=JW,T.noop=uh,T.now=_c,T.pad=TW,T.padEnd=kW,T.padStart=MW,T.parseInt=DW,T.random=gW,T.reduce=H5,T.reduceRight=W5,T.repeat=CW,T.replace=OW,T.result=oW,T.round=T3,T.runInContext=U,T.sample=V5,T.size=j5,T.snakeCase=AW,T.some=G5,T.sortedIndex=YU,T.sortedIndexBy=qU,T.sortedIndexOf=jU,T.sortedLastIndex=GU,T.sortedLastIndexBy=KU,T.sortedLastIndexOf=XU,T.startCase=RW,T.startsWith=PW,T.subtract=k3,T.sum=M3,T.sumBy=D3,T.template=IW,T.times=u3,T.toFinite=wi,T.toInteger=Nt,T.toLength=Jb,T.toLower=LW,T.toNumber=In,T.toSafeInteger=NH,T.toString=Xt,T.toUpper=NW,T.trim=BW,T.trimEnd=FW,T.trimStart=zW,T.truncate=UW,T.unescape=HW,T.uniqueId=f3,T.upperCase=WW,T.upperFirst=oh,T.each=zb,T.eachRight=Ub,T.first=Lb,ch(T,(function(){var o={};return ti(T,function(c,p){Kt.call(T.prototype,p)||(o[p]=c)}),o})(),{chain:!1}),T.VERSION=i,_n(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){T[o].placeholder=T}),_n(["drop","take"],function(o,c){Ht.prototype[o]=function(p){p=p===n?1:Ae(Nt(p),0);var y=this.__filtered__&&!c?new Ht(this):this.clone();return y.__filtered__?y.__takeCount__=Ke(p,y.__takeCount__):y.__views__.push({size:Ke(p,I),type:o+(y.__dir__<0?"Right":"")}),y},Ht.prototype[o+"Right"]=function(p){return this.reverse()[o](p).reverse()}}),_n(["filter","map","takeWhile"],function(o,c){var p=c+1,y=p==ct||p==ut;Ht.prototype[o]=function(b){var M=this.clone();return M.__iteratees__.push({iteratee:Mt(b,3),type:p}),M.__filtered__=M.__filtered__||y,M}}),_n(["head","last"],function(o,c){var p="take"+(c?"Right":"");Ht.prototype[o]=function(){return this[p](1).value()[0]}}),_n(["initial","tail"],function(o,c){var p="drop"+(c?"":"Right");Ht.prototype[o]=function(){return this.__filtered__?new Ht(this):this[p](1)}}),Ht.prototype.compact=function(){return this.filter(pn)},Ht.prototype.find=function(o){return this.filter(o).head()},Ht.prototype.findLast=function(o){return this.reverse().find(o)},Ht.prototype.invokeMap=Ft(function(o,c){return typeof o=="function"?new Ht(this):this.map(function(p){return Qo(p,o,c)})}),Ht.prototype.reject=function(o){return this.filter(xc(Mt(o)))},Ht.prototype.slice=function(o,c){o=Nt(o);var p=this;return p.__filtered__&&(o>0||c<0)?new Ht(p):(o<0?p=p.takeRight(-o):o&&(p=p.drop(o)),c!==n&&(c=Nt(c),p=c<0?p.dropRight(-c):p.take(c-o)),p)},Ht.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},Ht.prototype.toArray=function(){return this.take(I)},ti(Ht.prototype,function(o,c){var p=/^(?:filter|find|map|reject)|While$/.test(c),y=/^(?:head|last)$/.test(c),b=T[y?"take"+(c=="last"?"Right":""):c],M=y||/^find/.test(c);b&&(T.prototype[c]=function(){var E=this.__wrapped__,R=y?[1]:arguments,H=E instanceof Ht,Z=R[0],Q=H||Pt(E),et=function(Ut){var Wt=b.apply(T,ji([Ut],R));return y&&ft?Wt[0]:Wt};Q&&p&&typeof Z=="function"&&Z.length!=1&&(H=Q=!1);var ft=this.__chain__,wt=!!this.__actions__.length,Dt=M&&!ft,Bt=H&&!wt;if(!M&&Q){E=Bt?E:new Ht(this);var kt=o.apply(E,R);return kt.__actions__.push({func:gc,args:[et],thisArg:n}),new An(kt,ft)}return Dt&&Bt?o.apply(this,R):(kt=this.thru(et),Dt?y?kt.value()[0]:kt.value():kt)})}),_n(["pop","push","shift","sort","splice","unshift"],function(o){var c=Wl[o],p=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",y=/^(?:pop|shift)$/.test(o);T.prototype[o]=function(){var b=arguments;if(y&&!this.__chain__){var M=this.value();return c.apply(Pt(M)?M:[],b)}return this[p](function(E){return c.apply(Pt(E)?E:[],b)})}}),ti(Ht.prototype,function(o,c){var p=T[c];if(p){var y=p.name+"";Kt.call(Ss,y)||(Ss[y]=[]),Ss[y].push({name:c,func:p})}}),Ss[cc(n,A).name]=[{name:"wrapper",func:n}],Ht.prototype.clone=WF,Ht.prototype.reverse=$F,Ht.prototype.value=VF,T.prototype.at=b5,T.prototype.chain=x5,T.prototype.commit=w5,T.prototype.next=v5,T.prototype.plant=T5,T.prototype.reverse=k5,T.prototype.toJSON=T.prototype.valueOf=T.prototype.value=M5,T.prototype.first=T.prototype.head,Yo&&(T.prototype[Yo]=S5),T}),xs=wF();Qn?((Qn.exports=xs)._=xs,gs._=xs):ue._=xs}).call(BB)})(Co,Co.exports)),Co.exports}var i_=FB(),yl={exports:{}},zB=yl.exports,r_;function UB(){return r_||(r_=1,(function(e,t){(function(n,i){i()})(zB,function(){function n(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,m){var g=new XMLHttpRequest;g.open("GET",d),g.responseType="blob",g.onload=function(){u(g.response,h,m)},g.onerror=function(){console.error("could not download file")},g.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 Hi=="object"&&Hi.global===Hi?Hi: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,m){var g=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,m):s(_,_.target="_blank")):(_.href=g.createObjectURL(d),setTimeout(function(){g.revokeObjectURL(_.href)},4e4),setTimeout(function(){s(_)},0))}:"msSaveOrOpenBlob"in navigator?function(d,h,m){if(h=h||d.name||"download",typeof d!="string")navigator.msSaveOrOpenBlob(n(d,m),h);else if(r(d))i(d,h,m);else{var g=document.createElement("a");g.href=d,g.target="_blank",setTimeout(function(){s(g)})}}:function(d,h,m,g){if(g=g||open("","_blank"),g&&(g.document.title=g.document.body.innerText="downloading..."),typeof d=="string")return i(d,h,m);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 S=new FileReader;S.onloadend=function(){var F=S.result;F=v?F:F.replace(/^data:[^;]*;/,"data:attachment/file;"),g?g.location.href=F:location=F,g=null},S.readAsDataURL(d)}else{var C=a.URL||a.webkitURL,A=C.createObjectURL(d);g?g.location=A:location.href=A,g=null,setTimeout(function(){C.revokeObjectURL(A)},4e4)}});a.saveAs=u.saveAs=u,e.exports=u})})(yl)),yl.exports}var HB=UB(),_l={exports:{}};var WB=_l.exports,s_;function $B(){return s_||(s_=1,(function(e,t){((n,i)=>{e.exports=i()})(WB,function n(){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(k){return k.charCodeAt(0)===65279?k.slice(1):k}function h(k){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(w){var O=B(w);O.chunkSize=parseInt(O.chunkSize),w.step||w.chunk||(O.chunkSize=null),this._handle=new v(O),(this._handle.streamer=this)._config=O}).call(this,k),this.parseChunk=function(w,O){var L=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<L){let q=this._config.newline;q||($=this._config.quoteChar||'"',q=this._handle.guessLineEndings(w,$)),w=[...w.split(q).slice(L)].join(q)}this.isFirstChunk&&z(this._config.beforeFirstChunk)&&($=this._config.beforeFirstChunk(w))!==void 0&&(w=$),this.isFirstChunk=!1,this._halted=!1;var L=this._partialLine+w,$=(this._partialLine="",this._handle.parse(L,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(w=$.meta.cursor,L=(this._finished||(this._partialLine=L.substring(w-this._baseIndex),this._baseIndex=w),$&&$.data&&(this._rowCount+=$.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),s)i.postMessage({results:$,workerId:u.WORKER_ID,finished:L});else if(z(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||!L||!z(this._config.complete)||$&&$.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),L||$&&$.meta.paused||this._nextChunk(),$}this._halted=!0},this._sendError=function(w){z(this._config.error)?this._config.error(w):s&&this._config.error&&i.postMessage({workerId:u.WORKER_ID,error:w,finished:!1})}}function m(k){var w;(k=k||{}).chunkSize||(k.chunkSize=u.RemoteChunkSize),h.call(this,k),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(w=new XMLHttpRequest,this._config.withCredentials&&(w.withCredentials=this._config.withCredentials),r||(w.onload=N(this._chunkLoaded,this),w.onerror=N(this._chunkError,this)),w.ontimeout=N(this._chunkTimeout,this),w.open(this._config.downloadRequestBody?"POST":"GET",this._input,!r),this._config.downloadTimeout&&!r&&(w.timeout=this._config.downloadTimeout),this._config.downloadRequestHeaders){var O,L=this._config.downloadRequestHeaders;for(O in L)w.setRequestHeader(O,L[O])}var $;this._config.chunkSize&&($=this._start+this._config.chunkSize-1,w.setRequestHeader("Range","bytes="+this._start+"-"+$));try{w.send(this._config.downloadRequestBody)}catch(q){this._chunkError(q.message)}r&&w.status===0&&this._chunkError()}},this._chunkLoaded=function(){w.readyState===4&&(w.status<200||400<=w.status?this._chunkError():(this._start+=this._config.chunkSize||w.responseText.length,this._finished=!this._config.chunkSize||this._start>=(O=>(O=O.getResponseHeader("Content-Range"))!==null?parseInt(O.substring(O.lastIndexOf("/")+1)):-1)(w),this.parseChunk(w.responseText)))},this._chunkError=function(O){O=w.statusText||O,this._sendError(new Error(O))},this._chunkTimeout=function(){this._chunkError("Request timed out after "+this._config.downloadTimeout+"ms")}}function g(k){(k=k||{}).chunkSize||(k.chunkSize=u.LocalChunkSize),h.call(this,k);var w,O,L=typeof FileReader<"u";this.stream=function($){this._input=$,O=$.slice||$.webkitSlice||$.mozSlice,L?((w=new FileReader).onload=N(this._chunkLoaded,this),w.onerror=N(this._chunkError,this)):w=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,q=(this._config.chunkSize&&(q=Math.min(this._start+this._config.chunkSize,this._input.size),$=O.call($,this._start,q)),w.readAsText($,this._config.encoding));L||this._chunkLoaded({target:{result:q}})},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(w.error)}}function _(k){var w;h.call(this,k=k||{}),this.stream=function(O){return w=O,this._nextChunk()},this._nextChunk=function(){var O,L;if(!this._finished)return O=this._config.chunkSize,w=O?(L=w.substring(0,O),w.substring(O)):(L=w,""),this._finished=!w,this.parseChunk(L)}}function x(k){h.call(this,k=k||{});var w=[],O=!0,L=!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(){L&&w.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),w.length?this.parseChunk(w.shift()):O=!0},this._streamData=N(function($){try{w.push(typeof $=="string"?$:$.toString(this._config.encoding)),O&&(O=!1,this._checkIsFinished(),this.parseChunk(w.shift()))}catch(q){this._streamError(q)}},this),this._streamError=N(function($){this._streamCleanUp(),this._sendError($)},this),this._streamEnd=N(function(){this._streamCleanUp(),L=!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(k){var w,O,L,$,q=Math.pow(2,53),st=-q,ct=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,ht=/^((\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)))$/,ut=this,vt=0,at=0,dt=!1,V=!1,I=[],W={data:[],errors:[],meta:{}};function nt(rt){return k.skipEmptyLines==="greedy"?rt.join("").trim()==="":rt.length===1&&rt[0].length===0}function ot(){if(W&&L&&(tt("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+u.DefaultDelimiter+"'"),L=!1),k.skipEmptyLines&&(W.data=W.data.filter(function(mt){return!nt(mt)})),X()){let mt=function(Et){I.push(Et)};if(W)if(Array.isArray(W.data[0])){for(var rt=0;X()&&rt<W.data.length;rt++)W.data[rt].forEach(mt);W.data.splice(0,1)}else W.data.forEach(mt)}function pt(mt,Et){for(var zt=k.header?{}:[],G=0;G<mt.length;G++){var it=G,lt=mt[G],lt=(($t,_t)=>(Vt=>(k.dynamicTypingFunction&&k.dynamicTyping[Vt]===void 0&&(k.dynamicTyping[Vt]=k.dynamicTypingFunction(Vt)),(k.dynamicTyping[Vt]||k.dynamicTyping)===!0))($t)?_t==="true"||_t==="TRUE"||_t!=="false"&&_t!=="FALSE"&&((Vt=>{if(ct.test(Vt)&&(Vt=parseFloat(Vt),st<Vt&&Vt<q))return 1})(_t)?parseFloat(_t):ht.test(_t)?new Date(_t):_t===""?null:_t):_t)(it=k.header?G>=I.length?"__parsed_extra":I[G]:it,lt=k.transform?k.transform(lt,it):lt);it==="__parsed_extra"?(zt[it]=zt[it]||[],zt[it].push(lt)):zt[it]=lt}return k.header&&(G>I.length?tt("FieldMismatch","TooManyFields","Too many fields: expected "+I.length+" fields but parsed "+G,at+Et):G<I.length&&tt("FieldMismatch","TooFewFields","Too few fields: expected "+I.length+" fields but parsed "+G,at+Et)),zt}var yt;W&&(k.header||k.dynamicTyping||k.transform)&&(yt=1,!W.data.length||Array.isArray(W.data[0])?(W.data=W.data.map(pt),yt=W.data.length):W.data=pt(W.data,0),k.header&&W.meta&&(W.meta.fields=I),at+=yt)}function X(){return k.header&&I.length===0}function tt(rt,pt,yt,mt){rt={type:rt,code:pt,message:yt},mt!==void 0&&(rt.row=mt),W.errors.push(rt)}z(k.step)&&($=k.step,k.step=function(rt){W=rt,X()?ot():(ot(),W.data.length!==0&&(vt+=rt.data.length,k.preview&&vt>k.preview?O.abort():(W.data=W.data[0],$(W,ut))))}),this.parse=function(rt,pt,yt){var mt=k.quoteChar||'"',mt=(k.newline||(k.newline=this.guessLineEndings(rt,mt)),L=!1,k.delimiter?z(k.delimiter)&&(k.delimiter=k.delimiter(rt),W.meta.delimiter=k.delimiter):((mt=((Et,zt,G,it,lt)=>{var $t,_t,Vt,Te;lt=lt||[","," ","|",";",u.RECORD_SEP,u.UNIT_SEP];for(var ke=0;ke<lt.length;ke++){for(var ae,cn=lt[ke],qt=0,Be=0,re=0,De=(Vt=void 0,new C({comments:it,delimiter:cn,newline:zt,preview:10}).parse(Et)),Pe=0;Pe<De.data.length;Pe++)G&&nt(De.data[Pe])?re++:(ae=De.data[Pe].length,Be+=ae,Vt===void 0?Vt=ae:0<ae&&(qt+=Math.abs(ae-Vt),Vt=ae));0<De.data.length&&(Be/=De.data.length-re),1.99<Be&&(_t===void 0||qt<_t||qt===_t&&Te<Be)&&(_t=qt,$t=cn,Te=Be)}return{successful:!!(k.delimiter=$t),bestDelimiter:$t}})(rt,k.newline,k.skipEmptyLines,k.comments,k.delimitersToGuess)).successful?k.delimiter=mt.bestDelimiter:(L=!0,k.delimiter=u.DefaultDelimiter),W.meta.delimiter=k.delimiter),B(k));return mt.header=X(),k.preview&&k.header&&mt.preview++,w=rt,O=new C(mt),W=O.parse(w,pt,yt),ot(),dt?{meta:{paused:!0}}:W||{meta:{paused:!1}}},this.paused=function(){return dt},this.pause=function(){dt=!0,O.abort(),w=z(k.chunk)?"":w.substring(O.getCharIndex())},this.resume=function(){ut.streamer._halted?(dt=!1,ut.streamer.parseChunk(w,!0)):setTimeout(ut.resume,3)},this.aborted=function(){return V},this.abort=function(){V=!0,O.abort(),W.meta.aborted=!0,z(k.complete)&&k.complete(W),w=""},this.guessLineEndings=function(Et,mt){Et=Et.substring(0,1048576);var mt=new RegExp(S(mt)+"([^]*?)"+S(mt),"gm"),yt=(Et=Et.replace(mt,"")).split("\r"),mt=Et.split(`
|
|
27
|
+
`),Et=1<mt.length&&mt[0].length<yt[0].length;if(yt.length===1||Et)return`
|
|
28
|
+
`;for(var zt=0,G=0;G<yt.length;G++)yt[G][0]===`
|
|
29
|
+
`&&zt++;return zt>=yt.length/2?`\r
|
|
30
|
+
`:"\r"}}function S(k){return k.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function C(k){var w=(k=k||{}).delimiter,O=k.newline,L=k.comments,$=k.step,q=k.preview,st=k.fastMode,ct=null,ht=!1,ut=k.quoteChar==null?'"':k.quoteChar,vt=ut;if(k.escapeChar!==void 0&&(vt=k.escapeChar),(typeof w!="string"||-1<u.BAD_DELIMITERS.indexOf(w))&&(w=","),L===w)throw new Error("Comment character same as delimiter");L===!0?L="#":(typeof L!="string"||-1<u.BAD_DELIMITERS.indexOf(L))&&(L=!1),O!==`
|
|
31
|
+
`&&O!=="\r"&&O!==`\r
|
|
32
|
+
`&&(O=`
|
|
33
|
+
`);var at=0,dt=!1;this.parse=function(V,I,W){if(typeof V!="string")throw new Error("Input must be a string");var nt=V.length,ot=w.length,X=O.length,tt=L.length,rt=z($),pt=[],yt=[],mt=[],Et=at=0;if(!V)return qt();if(st||st!==!1&&V.indexOf(ut)===-1){for(var zt=V.split(O),G=0;G<zt.length;G++){if(mt=zt[G],at+=mt.length,G!==zt.length-1)at+=O.length;else if(W)return qt();if(!L||mt.substring(0,tt)!==L){if(rt){if(pt=[],Te(mt.split(w)),Be(),dt)return qt()}else Te(mt.split(w));if(q&&q<=G)return pt=pt.slice(0,q),qt(!0)}}return qt()}for(var it=V.indexOf(w,at),lt=V.indexOf(O,at),$t=new RegExp(S(vt)+S(ut),"g"),_t=V.indexOf(ut,at);;)if(V[at]===ut)for(_t=at,at++;;){if((_t=V.indexOf(ut,_t+1))===-1)return W||yt.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:pt.length,index:at}),ae();if(_t===nt-1)return ae(V.substring(at,_t).replace($t,ut));if(ut===vt&&V[_t+1]===vt)_t++;else if(ut===vt||_t===0||V[_t-1]!==vt){it!==-1&&it<_t+1&&(it=V.indexOf(w,_t+1));var Vt=ke((lt=lt!==-1&<<_t+1?V.indexOf(O,_t+1):lt)===-1?it:Math.min(it,lt));if(V.substr(_t+1+Vt,ot)===w){mt.push(V.substring(at,_t).replace($t,ut)),V[at=_t+1+Vt+ot]!==ut&&(_t=V.indexOf(ut,at)),it=V.indexOf(w,at),lt=V.indexOf(O,at);break}if(Vt=ke(lt),V.substring(_t+1+Vt,_t+1+Vt+X)===O){if(mt.push(V.substring(at,_t).replace($t,ut)),cn(_t+1+Vt+X),it=V.indexOf(w,at),_t=V.indexOf(ut,at),rt&&(Be(),dt))return qt();if(q&&pt.length>=q)return qt(!0);break}yt.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:pt.length,index:at}),_t++}}else if(L&&mt.length===0&&V.substring(at,at+tt)===L){if(lt===-1)return qt();at=lt+X,lt=V.indexOf(O,at),it=V.indexOf(w,at)}else if(it!==-1&&(it<lt||lt===-1))mt.push(V.substring(at,it)),at=it+ot,it=V.indexOf(w,at);else{if(lt===-1)break;if(mt.push(V.substring(at,lt)),cn(lt+X),rt&&(Be(),dt))return qt();if(q&&pt.length>=q)return qt(!0)}return ae();function Te(re){pt.push(re),Et=at}function ke(re){var De=0;return De=re!==-1&&(re=V.substring(_t+1,re))&&re.trim()===""?re.length:De}function ae(re){return W||(re===void 0&&(re=V.substring(at)),mt.push(re),at=nt,Te(mt),rt&&Be()),qt()}function cn(re){at=re,Te(mt),mt=[],lt=V.indexOf(O,at)}function qt(re){if(k.header&&!I&&pt.length&&!ht){var De=pt[0],Pe=Object.create(null),gn=new Set(De);let Wi=!1;for(let Cn=0;Cn<De.length;Cn++){let je=d(De[Cn]);if(Pe[je=z(k.transformHeader)?k.transformHeader(je,Cn):je]){let Ln,di=Pe[je];for(;Ln=je+"_"+di,di++,gn.has(Ln););gn.add(Ln),De[Cn]=Ln,Pe[je]++,Wi=!0,(ct=ct===null?{}:ct)[Ln]=je}else Pe[je]=1,De[Cn]=je;gn.add(je)}Wi&&console.warn("Duplicate headers found and renamed."),ht=!0}return{data:pt,errors:yt,meta:{delimiter:w,linebreak:O,aborted:dt,truncated:!!re,cursor:Et+(I||0),renamedHeaders:ct}}}function Be(){$(qt()),pt=[],yt=[]}},this.abort=function(){dt=!0},this.getCharIndex=function(){return at}}function A(k){var w=k.data,O=a[w.workerId],L=!1;if(w.error)O.userError(w.error,w.file);else if(w.results&&w.results.data){var $={abort:function(){L=!0,F(w.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:P,resume:P};if(z(O.userStep)){for(var q=0;q<w.results.data.length&&(O.userStep({data:w.results.data[q],errors:w.results.errors,meta:w.results.meta},$),!L);q++);delete w.results}else z(O.userChunk)&&(O.userChunk(w.results,$,w.file),delete w.results)}w.finished&&!L&&F(w.workerId,w.results)}function F(k,w){var O=a[k];z(O.userComplete)&&O.userComplete(w),O.terminate(),delete a[k]}function P(){throw new Error("Not implemented.")}function B(k){if(typeof k!="object"||k===null)return k;var w,O=Array.isArray(k)?[]:{};for(w in k)O[w]=B(k[w]);return O}function N(k,w){return function(){k.apply(w,arguments)}}function z(k){return typeof k=="function"}return u.parse=function(k,w){var O=(w=w||{}).dynamicTyping||!1;if(z(O)&&(w.dynamicTypingFunction=O,O={}),w.dynamicTyping=O,w.transform=!!z(w.transform)&&w.transform,w.downloadTimeout!==void 0){var O=parseInt(w.downloadTimeout);if(isNaN(O))throw new Error("Config downloadTimeout value ("+w.downloadTimeout+") not parsable by parseInt(val).");w.downloadTimeout=O}if(!w.worker||!u.WORKERS_SUPPORTED)return O=null,u.NODE_STREAM_INPUT,typeof k=="string"?(k=d(k),O=new(w.download?m:_)(w)):k.readable===!0&&z(k.read)&&z(k.on)?O=new x(w):(i.File&&k instanceof File||k instanceof Object)&&(O=new g(w)),O.stream(k);(O=(()=>{var L;return!!u.WORKERS_SUPPORTED&&(L=(()=>{var $=i.URL||i.webkitURL||null,q=n.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; ","(",q,")();"],{type:"text/javascript"})))})(),(L=new i.Worker(L)).onmessage=A,L.id=l++,a[L.id]=L)})()).userStep=w.step,O.userChunk=w.chunk,O.userComplete=w.complete,O.userError=w.error,w.step=z(w.step),w.chunk=z(w.chunk),w.complete=z(w.complete),w.error=z(w.error),delete w.worker,O.postMessage({input:k,config:w,workerId:O.id})},u.unparse=function(k,w){var O=!1,L=!0,$=",",q=`\r
|
|
34
|
+
`,st='"',ct=st+st,ht=!1,ut=null,vt=!1,at=((()=>{if(typeof w=="object"){if(typeof w.delimiter!="string"||u.BAD_DELIMITERS.filter(function(I){return w.delimiter.indexOf(I)!==-1}).length||($=w.delimiter),typeof w.quotes!="boolean"&&typeof w.quotes!="function"&&!Array.isArray(w.quotes)||(O=w.quotes),typeof w.skipEmptyLines!="boolean"&&typeof w.skipEmptyLines!="string"||(ht=w.skipEmptyLines),typeof w.newline=="string"&&(q=w.newline),typeof w.quoteChar=="string"&&(st=w.quoteChar,ct=st+st),typeof w.header=="boolean"&&(L=w.header),Array.isArray(w.columns)){if(w.columns.length===0)throw new Error("Option columns is empty");ut=w.columns}w.escapeChar!==void 0&&(ct=w.escapeChar+st),w.escapeFormulae instanceof RegExp?vt=w.escapeFormulae:typeof w.escapeFormulae=="boolean"&&w.escapeFormulae&&(vt=/^[=+\-@\t\r].*$/)}})(),new RegExp(S(st),"g"));if(typeof k=="string"&&(k=JSON.parse(k)),Array.isArray(k)){if(!k.length||Array.isArray(k[0]))return dt(null,k,ht);if(typeof k[0]=="object")return dt(ut||Object.keys(k[0]),k,ht)}else if(typeof k=="object")return typeof k.data=="string"&&(k.data=JSON.parse(k.data)),Array.isArray(k.data)&&(k.fields||(k.fields=k.meta&&k.meta.fields||ut),k.fields||(k.fields=Array.isArray(k.data[0])?k.fields:typeof k.data[0]=="object"?Object.keys(k.data[0]):[]),Array.isArray(k.data[0])||typeof k.data[0]=="object"||(k.data=[k.data])),dt(k.fields||[],k.data||[],ht);throw new Error("Unable to serialize unrecognized input");function dt(I,W,nt){var ot="",X=(typeof I=="string"&&(I=JSON.parse(I)),typeof W=="string"&&(W=JSON.parse(W)),Array.isArray(I)&&0<I.length),tt=!Array.isArray(W[0]);if(X&&L){for(var rt=0;rt<I.length;rt++)0<rt&&(ot+=$),ot+=V(I[rt],rt);0<W.length&&(ot+=q)}for(var pt=0;pt<W.length;pt++){var yt=(X?I:W[pt]).length,mt=!1,Et=X?Object.keys(W[pt]).length===0:W[pt].length===0;if(nt&&!X&&(mt=nt==="greedy"?W[pt].join("").trim()==="":W[pt].length===1&&W[pt][0].length===0),nt==="greedy"&&X){for(var zt=[],G=0;G<yt;G++){var it=tt?I[G]:G;zt.push(W[pt][it])}mt=zt.join("").trim()===""}if(!mt){for(var lt=0;lt<yt;lt++){0<lt&&!Et&&(ot+=$);var $t=X&&tt?I[lt]:lt;ot+=V(W[pt][$t],lt)}pt<W.length-1&&(!nt||0<yt&&!Et)&&(ot+=q)}}return ot}function V(I,W){var nt,ot,X;return I==null?"":I.constructor===Date?isNaN(I.getTime())?"":I.toISOString():(X=!1,vt&&typeof I=="string"&&vt.test(I)&&(I="'"+I,X=!0),ot=(nt=I.toString()).replace(at,ct),(X=X||O===!0||typeof O=="function"&&O(I,W)||Array.isArray(O)&&O[W]||((tt,rt)=>{for(var pt=0;pt<rt.length;pt++)if(-1<tt.indexOf(rt[pt]))return!0;return!1})(ot,u.BAD_DELIMITERS)||-1<ot.indexOf($)||-1<nt.indexOf(st)||ot.charAt(0)===" "||ot.charAt(ot.length-1)===" ")?st+ot+st:ot)}},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=m,u.FileStreamer=g,u.StringStreamer=_,u.ReadableStreamStreamer=x,s&&(i.onmessage=function(k){k=k.data,u.WORKER_ID===void 0&&k&&(u.WORKER_ID=k.workerId),typeof k.input=="string"?i.postMessage({workerId:u.WORKER_ID,results:u.parse(k.input,k.config),finished:!0}):(i.File&&k.input instanceof File||k.input instanceof Object)&&(k=u.parse(k.input,k.config))&&i.postMessage({workerId:u.WORKER_ID,results:k,finished:!0})}),(m.prototype=Object.create(h.prototype)).constructor=m,(g.prototype=Object.create(h.prototype)).constructor=g,(_.prototype=Object.create(_.prototype)).constructor=_,(x.prototype=Object.create(h.prototype)).constructor=x,u})})(_l)),_l.exports}var VB=$B();const YB=["id"],qB=f.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(e,{emit:t}){const n=t,i=e,r=f.computed(()=>`export_${new Date().getTime()}`),s=f.computed(()=>{const h=u();return h.length?h:null}),a=()=>{const h=i.labels;if(typeof i.fields!==br.Object)throw new Error("Labels needs to be a object containing key / value pairs.");return typeof h===br.Object?m=>i_.mapKeys(m,(g,_)=>h[_]||_):m=>m},l=()=>{const h=i.fields;if(typeof i.fields!==br.Object&&!Array.isArray(h))throw new Error("Fields needs to be an array of strings.");return Array.isArray(h)?m=>i_.pick(m,h):m=>m},u=()=>{if(typeof i.fields===br.Undefined&&typeof i.labels===br.Undefined)return i.data;const h=a(),m=l();return i.data.map(g=>h(m(g)))},d=()=>{if(!s?.value){console.warn("No data to export");return}n("export-started",s.value);let h=VB.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),n("export-finished",i.filename),!i.testing){const m=new Blob([h],{type:"text/csv;charset="+i.encoding});HB.saveAs(m,i.filename)}};return(h,m)=>(f.openBlock(),f.createElementBlock("div",{id:r.value,"data-testid":"export-csv",onClick:d},[f.renderSlot(h.$slots,"default",{},()=>[f.createTextVNode("Download "+f.toDisplayString(e.filename),1)])],8,YB))}}),jB=f.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(e){const t=e,n=f.computed(()=>Object.keys(t.headers));return(i,r)=>(f.openBlock(),f.createElementBlock("div",null,[f.createVNode(qB,{data:e.rows,fields:n.value,filename:e.filename,labels:e.headers},{default:f.withCtx(()=>[f.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),GB={class:"kong-ui-public-csv-export-modal"},KB={key:0,class:"selected-range"},XB={key:4,class:"text-muted",tag:"span"},o_=3,ZB=f.defineComponent({__name:"CsvExportModal",props:{exportState:{},filename:{},modalDescription:{default:void 0}},emits:["closeModal"],setup(e,{emit:t}){const{i18n:n}=St.useI18n(),i=e,r=t,s=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,a=f.ref(1),l=f.computed(()=>g.value.rows.length),u=f.computed(()=>i.exportState.status==="success"&&!!i.exportState.chartData?.data?.length),d=f.computed(()=>i.exportState.status!=="success"?"":St.useChartSelectedRange(f.toRef(i.exportState,"chartData"))),h=f.computed(()=>i.exportState.status!=="success"?"":n.t("csvExport.previewRows",{rowsMax:Math.min(o_,l.value),rowsTotal:l.value,plural:l.value===1?"":"s"})),m=()=>{r("closeModal")},g=f.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(B=>B.timestamp!==x.data[0].timestamp),S=x.data.map(B=>{const N=new Date(B.timestamp);return{...Object.keys(B.event).reduce((k,w)=>{if(w in x.meta.display){const O=B.event[w],L=x.meta.display[w];k[w]=O&&L&&L[O].name||B.event[w]}else k[w]=B.event[w];return k},{}),...v?{timestamp:id(N,"yyyy-MM-dd HH:mm:ss"),tzOffset:id(N,"XXX")}:{}}});let C=[];v&&(C=[{label:n.t("csvExport.Timestamp"),key:"timestamp"},{label:n.t("csvExport.UtcOffset"),key:"tzOffset"}]);const A="display"in i.exportState.chartData.meta&&i.exportState.chartData.meta?.display?i.exportState.chartData.meta?.display:{},F=[...C,...Object.keys(A).map(B=>({label:n.t(`chartLabels.${B}`),key:B})),...i.exportState.chartData.meta.metric_names.map(B=>({label:n.t(`chartLabels.${B}`),key:B}))],P=F.reduce((B,N)=>(B[N.key]=N.label,B),{});return{headers:F,csvHeaders:P,rows:S}}),_=async()=>{if(i.exportState.status!=="success")return{total:0,data:[]};const{rows:x}=g.value;return{total:Number(x.length)||0,data:x.slice(0,o_)}};return f.watch(g,()=>{a.value++}),(x,v)=>{const S=f.resolveComponent("KSkeleton"),C=f.resolveComponent("KEmptyState"),A=f.resolveComponent("KTableData"),F=f.resolveComponent("KTooltip"),P=f.resolveComponent("KButton"),B=f.resolveComponent("KModal");return f.openBlock(),f.createElementBlock("div",GB,[f.createVNode(B,{class:"vitals-report","data-testid":"csv-export-modal","show-dismiss-icon":"",title:f.unref(n).t("csvExport.exportPreview"),visible:"",onCancel:m,onKeyup:f.withKeys(m,["esc"])},{default:f.withCtx(()=>[f.createElementVNode("div",null,[e.exportState.status==="success"&&u.value?(f.openBlock(),f.createElementBlock("div",KB,[f.createElementVNode("p",null,f.toDisplayString(e.modalDescription?e.modalDescription:f.unref(n).t("csvExport.exportDescription")),1),f.createElementVNode("p",null,f.toDisplayString(f.unref(n).t("csvExport.exportTimeRange"))+": "+f.toDisplayString(d.value),1)])):f.createCommentVNode("",!0),e.exportState.status==="loading"?(f.openBlock(),f.createBlock(S,{key:1,class:"chart-skeleton",type:"table"})):e.exportState.status==="success"?(f.openBlock(),f.createBlock(A,{key:2,class:"vitals-table",fetcher:_,"fetcher-cache-key":String(a.value),headers:g.value?.headers||[],"hide-pagination":"","row-hover":!1,sortable:!1},{"empty-state":f.withCtx(()=>[f.createVNode(C,{"action-button-visible":!1},{title:f.withCtx(()=>[f.createElementVNode("h5",null,f.toDisplayString(f.unref(n).t("csvExport.noDataRange")),1)]),default:f.withCtx(()=>[f.createElementVNode("p",null,f.toDisplayString(f.unref(n).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"])):e.exportState.status==="error"?(f.openBlock(),f.createBlock(C,{key:3,"action-button-visible":!1},{title:f.withCtx(()=>[f.createElementVNode("h5",null,f.toDisplayString(f.unref(n).t("csvExport.dataError")),1)]),_:1})):f.createCommentVNode("",!0),e.exportState.status==="success"&&u.value?(f.openBlock(),f.createElementBlock("div",XB,[f.createTextVNode(f.toDisplayString(h.value)+" ",1),f.createVNode(F,{class:"preview-tooltip",placement:"right",text:f.unref(n).t("csvExport.maximumRecordAmount",{value:f.unref(1e3)})},{default:f.withCtx(()=>[f.createVNode(f.unref(fe.InfoIcon),{color:`var(--kui-color-text-neutral, ${f.unref(Bc)})`,size:`var(--kui-icon-size-30, ${f.unref(rr)})`},null,8,["color","size"])]),_:1},8,["text"])])):f.createCommentVNode("",!0)])]),"footer-actions":f.withCtx(()=>[f.createVNode(P,{appearance:"tertiary",class:"cancel-btn",onClick:m},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(f.unref(n).t("csvExport.cancelButton")),1)]),_:1}),f.createVNode(jB,{class:"vitals-report-export-button",filename:s,headers:g.value.csvHeaders,rows:g.value.rows},{default:f.withCtx(()=>[f.createVNode(P,{appearance:"primary","data-testid":"csv-download-button",disabled:e.exportState.status!=="success"||!u.value},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(f.unref(n).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}});It.AnalyticsChart=AN,It.ChartLegendPosition=Le,It.CsvExportModal=ZB,It.DECIMAL_DISPLAY=DP,It.FONT_SIZE_REGULAR=S0,It.FONT_SIZE_SMALL=v0,It.LEFT_Y_AXIS_ID=rl,It.MAX_LABEL_LENGTH=il,It.OTHER_DIMENSION_ID=Fu,It.RIGHT_Y_AXIS_ID=Vu,It.SimpleChart=qN,It.SparklineChart=gB,It.TopNTable=fB,It.TopTalkersColumn=e_,It.TopTalkersGrid=NB,It.ValidType=br,It.chartTypes=O2,It.exploreResultToScatterData=V0,It.getBarRatio=y0,It.getColumnOptions=gr,It.getColumnStats=zu,It.getRelativeValue=Uu,It.getThresholdType=Hu,It.handleQueryError=x2,It.isCancellationError=W0,It.isScatterChartData=cd,It.lookupStatusCodeColor=k0,It.requestsToScatterData=M2,It.simpleChartMetricDisplay=C2,It.simpleChartTypes=A2,It.statusCodeBadgeBackgroundColor=AP,It.toNumber=Jr,Object.defineProperty(It,Symbol.toStringTag,{value:"Module"})}));
|