@kong-ui-public/analytics-chart 10.40.1 → 10.40.2

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.
@@ -1,12 +1,12 @@
1
- (function(Lt,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):(Lt=typeof globalThis<"u"?globalThis:Lt||self,f(Lt["kong-ui-publicvitals-chart"]={},Lt.Vue,Lt.KongIcons,Lt["kong-ui-public-i18n"],Lt["kong-ui-public-analytics-metric-provider"],Lt.Kongponents))})(this,(function(Lt,f,fe,mh,er,As){"use strict";var _t=(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))(_t||{});const mx=["in","not_in","selector"],gx=["empty","not_empty"],yx=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],nr=e=>e.filter(t=>t!=="time"),gh=["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"],Tc=nr(gh),_x=["active_services","error_rate","request_count","request_per_minute","response_latency_average"],yh=[...gh,"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"],kc=nr(yh),bx=[..._x,"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"],xx=["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"],Mc=nr(xx),wx=["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"],vx=nr(wx),Sx=["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"],Tx=Sx,kx=["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=nr(kx),Dx=["platform","platform_usage"],Cx=e=>Dx.includes(e),Ox=[...yh.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"],Dc=nr(Ox);[...bx];const Ax=["control_plane","data_plane_group","managed_cache","network","provider","provider_region","time"],Cc=nr(Ax);new Set(Tc),new Set(kc),new Set(Mc),new Set(Dc),new Set(Cc);const _h=[{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:mx},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:gx}},required:["field","operator"],additionalProperties:!1}]}});({...Si()},_h.map(e=>e.code));const Ex=["control_plane","gateway_service","realm","route","plugin","plugin_name","plugin_scope","data_plane_node_version","env","team","region","hostname"];Si(kc),Si(Tc),Si(Mc),Si(Dc),Si(Cc),Si(Array.from(new Set([...vx,...Tx,...Mx]))),Si([...new Set([...kc,...Tc,...Mc,...Dc,...Ex,...Cc])]);const Rx={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"}},Px=(e,t,n)=>{let i;const r=Rx[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 Oc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Ix={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Lx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Nx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Bx={date:Oc({formats:Ix,defaultWidth:"full"}),time:Oc({formats:Lx,defaultWidth:"full"}),dateTime:Oc({formats:Nx,defaultWidth:"full"})},Fx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},zx=(e,t,n,i)=>Fx[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 Ux={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Hx={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Wx={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"]},$x={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"]},Vx={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"}},Yx={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"}},qx=(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"},jx={ordinalNumber:qx,era:Es({values:Ux,defaultWidth:"wide"}),quarter:Es({values:Hx,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Es({values:Wx,defaultWidth:"wide"}),day:Es({values:$x,defaultWidth:"wide"}),dayPeriod:Es({values:Vx,defaultWidth:"wide",formattingValues:Yx,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)?Kx(l,m=>m.test(a)):Gx(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 Gx(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Kx(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Xx(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 Zx=/^(\d+)(th|st|nd|rd)?/i,Qx=/\d+/i,Jx={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},tw={any:[/^b/i,/^(a|c)/i]},ew={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},nw={any:[/1/i,/2/i,/3/i,/4/i]},iw={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},rw={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]},sw={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},ow={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]},aw={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},lw={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}},cw={ordinalNumber:Xx({matchPattern:Zx,parsePattern:Qx,valueCallback:e=>parseInt(e,10)}),era:Rs({matchPatterns:Jx,defaultMatchWidth:"wide",parsePatterns:tw,defaultParseWidth:"any"}),quarter:Rs({matchPatterns:ew,defaultMatchWidth:"wide",parsePatterns:nw,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Rs({matchPatterns:iw,defaultMatchWidth:"wide",parsePatterns:rw,defaultParseWidth:"any"}),day:Rs({matchPatterns:sw,defaultMatchWidth:"wide",parsePatterns:ow,defaultParseWidth:"any"}),dayPeriod:Rs({matchPatterns:aw,defaultMatchWidth:"any",parsePatterns:lw,defaultParseWidth:"any"})},uw={code:"en-US",formatDistance:Px,formatLong:Bx,formatRelative:zx,localize:jx,match:cw,options:{weekStartsOn:0,firstWeekContainsDate:1}};let dw={};function Ps(){return dw}const bh=6048e5,fw=864e5,hw=60,pw=3600,xh=Symbol.for("constructDateFrom");function Tn(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&xh in e?e[xh](t):e instanceof Date?new e.constructor(t):new Date(t)}function He(e,t){return Tn(t||e,e)}function wh(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 mw(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 gw(e,t,n){const[i,r]=mw(n?.in,e,t),s=Nr(i),a=Nr(r),l=+s-wh(s),u=+a-wh(a);return Math.round((l-u)/fw)}function yw(e,t){const n=He(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function _w(e,t){const n=He(e,t?.in);return gw(n,yw(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 vh(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 bw(e,t){const n=vh(e,t),i=Tn(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),sa(i)}function xw(e,t){const n=He(e,t?.in),i=+sa(n)-+bw(n);return Math.round(i/bh)+1}function Sh(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 ww(e,t){const n=Ps(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=Sh(e,t),s=Tn(t?.in||e,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),ni(s,t)}function vw(e,t){const n=He(e,t?.in),i=+ni(n,t)-+ww(n,t);return Math.round(i/bh)+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"},Th={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=Sh(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=vh(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=vw(e,i);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):Zt(r,t.length)},I:function(e,t,n){const i=xw(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=_w(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 Mh(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 Mh(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"+kh(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"+kh(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 kh(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 Mh(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 Dh=(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"})}},Ch=(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"})}},Sw=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return Dh(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}}",Dh(i,t)).replace("{{time}}",Ch(r,t))},Tw={p:Ch,P:Sw},kw=/^D+$/,Mw=/^Y+$/,Dw=["D","DD","YY","YYYY"];function Cw(e){return kw.test(e)}function Ow(e){return Mw.test(e)}function Aw(e,t,n){const i=Ew(e,t,n);if(console.warn(i),Dw.includes(e))throw new RangeError(i)}function Ew(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 Rw(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Pw(e){return!(!Rw(e)&&typeof e!="number"||isNaN(+He(e)))}const Iw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Lw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Nw=/^'([^]*?)'?$/,Bw=/''/g,Fw=/[a-zA-Z]/;function zw(e,t,n){const i=Ps(),r=n?.locale??i.locale??uw,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(!Pw(l))throw new RangeError("Invalid time value");let u=t.match(Lw).map(h=>{const m=h[0];if(m==="p"||m==="P"){const g=Tw[m];return g(h,r.formatLong)}return h}).join("").match(Iw).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const m=h[0];if(m==="'")return{isToken:!1,value:Uw(h)};if(Th[m])return{isToken:!0,value:h};if(m.match(Fw))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&&Ow(m)||!n?.useAdditionalDayOfYearTokens&&Cw(m))&&Aw(m,t,String(e));const g=Th[m[0]];return g(l,m,r.localize,d)}).join("")}function Uw(e){const t=e.match(Nw);return t?t[1].replace(Bw,"'"):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 Oh(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 Hw(e,t,n){return Oh(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 Ww(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 $w(){return Object.assign({},Ps())}function Ah(e){return Math.trunc(e*pw)}function Vw(e){const t=e/hw;return Math.trunc(t)}function Eh(e,t,n){return Oh(e,-1,n)}function Rh(e,t,n){return Hw(e,-1,n)}function Ph(e,t,n){const i=$w(),r=jw(e,n.timeZone,n.locale??i.locale);return"formatToParts"in r?Yw(r,t):qw(r,t)}function Yw(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 qw(e,t){const n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}function jw(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function Gw(e,t){const n=Jw(t);return"formatToParts"in n?Xw(n,e):Zw(n,e)}const Kw={year:0,month:1,day:2,hour:3,minute:4,second:5};function Xw(e,t){try{const n=e.formatToParts(t),i=[];for(let r=0;r<n.length;r++){const s=Kw[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 Zw(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 Ac={},Ih=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")),Qw=Ih==="06/25/2014, 00:00:00"||Ih==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function Jw(e){return Ac[e]||(Ac[e]=Qw?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"})),Ac[e]}function Ec(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 Lh=36e5,tv=6e4,Rc={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Is(e,t,n){if(!e)return 0;let i=Rc.timezoneZ.exec(e);if(i)return 0;let r,s;if(i=Rc.timezoneHH.exec(e),i)return r=parseInt(i[1],10),Nh(r)?-(r*Lh):NaN;if(i=Rc.timezoneHHMM.exec(e),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return Nh(r,a)?(s=Math.abs(r)*Lh+a*tv,i[1]==="+"?-s:s):NaN}if(iv(e)){t=new Date(t||Date.now());const a=n?t:ev(t),l=Pc(a,e);return-(n?l:nv(t,l,e))}return NaN}function ev(e){return Ec(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function Pc(e,t){const n=Gw(e,t),i=Ec(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 nv(e,t,n){let i=e.getTime()-t;const r=Pc(new Date(i),n);if(t===r)return t;i-=r-t;const s=Pc(new Date(i),n);return r===s?r:Math.max(r,s)}function Nh(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const Bh={};function iv(e){if(Bh[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Bh[e]=!0,!0}catch{return!1}}const rv=60*1e3,sv={X:function(e,t,n){const i=Ic(n.timeZone,e);if(i===0)return"Z";switch(t){case"X":return Fh(i);case"XXXX":case"XX":return Ur(i);default:return Ur(i,":")}},x:function(e,t,n){const i=Ic(n.timeZone,e);switch(t){case"x":return Fh(i);case"xxxx":case"xx":return Ur(i);default:return Ur(i,":")}},O:function(e,t,n){const i=Ic(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+ov(i,":");default:return"GMT"+Ur(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return Ph("short",e,n);default:return Ph("long",e,n)}}};function Ic(e,t){const n=e?Is(e,t,!0)/rv: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 Fh(e,t){return e%60===0?(e>0?"-":"+")+aa(Math.abs(e)/60,2):Ur(e,t)}function ov(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 zh(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 Uh=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Lc=36e5,Hh=6e4,av=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:Uh};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?av: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=lv(e),{year:r,restDateString:s}=cv(i.date,n),a=uv(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=dv(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=zh(new Date(l+u)),d=zh(new Date(l+u+d));return new Date(l+u+d)}else return new Date(NaN)}function lv(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 cv(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 uv(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,Vh(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 pv(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 Vh(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,Yh(r)?Wh(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 Yh(r,a)?Wh(t,r,a):new Date(NaN)}return null}function dv(e){let t,n,i=Qe.HH.exec(e);if(i)return t=parseFloat(i[1].replace(",",".")),Nc(t)?t%24*Lc:NaN;if(i=Qe.HHMM.exec(e),i)return t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),Nc(t,n)?t%24*Lc+n*Hh: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 Nc(t,n,r)?t%24*Lc+n*Hh+r*1e3:NaN}return null}function Wh(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 fv=[31,28,31,30,31,30,31,31,30,31,30,31],hv=[31,29,31,30,31,30,31,31,30,31,30,31];function $h(e){return e%400===0||e%4===0&&e%100!==0}function Vh(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const i=$h(e);if(i&&n>hv[t]||!i&&n>fv[t])return!1}return!0}function pv(e,t){if(t<1)return!1;const n=$h(e);return!(n&&t>366||!n&&t>365)}function Yh(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function Nc(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const mv=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function gv(e,t,n={}){t=String(t);const i=t.match(mv);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,"'"+sv[a[0]](r,a,n)+"'");return u?d.substring(0,l-1)+d.substring(l+1):d},t)}return zw(e,t,n)}function qh(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 jh(e,t,n,i){return i={...i,timeZone:t,originalDate:e},gv(qh(e,t,{timeZone:i.timeZone}),n,i)}function yv(e,t,n){if(typeof e=="string"&&!e.match(Uh))return la(e,{...n,timeZone:t});e=la(e,n);const i=Ec(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 _v(e,t){return-Is(e,t)}function Gh(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)"),jh(e,n,i)}function bv(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 jh(r,n,i)}catch{return console.error("Invalid value passed to formatTime",e),"(invalid date)"}}const xv={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&&yx.find(t=>e<=xv[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 Kh;function wv(){return Kh||(Kh=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]",O="[object Set]",A="[object String]",P="[object Symbol]",L="[object WeakMap]",R="[object ArrayBuffer]",F="[object DataView]",U="[object Float32Array]",D="[object Float64Array]",w="[object Int8Array]",C="[object Int16Array]",N="[object Int32Array]",$="[object Uint8Array]",V="[object Uint8ClampedArray]",st="[object Uint16Array]",dt="[object Uint32Array]",ut=/[\\^$.*+?()[\]{}|]/g,ct=/\w*$/,Tt=/^\[object .+?Constructor\]$/,at=/^(?:0|[1-9]\d*)$/,pt={};pt[s]=pt[a]=pt[R]=pt[F]=pt[l]=pt[u]=pt[U]=pt[D]=pt[w]=pt[C]=pt[N]=pt[g]=pt[_]=pt[x]=pt[S]=pt[O]=pt[A]=pt[P]=pt[$]=pt[V]=pt[st]=pt[dt]=!0,pt[d]=pt[h]=pt[L]=!1;var G=typeof ua=="object"&&ua&&ua.Object===Object&&ua,B=typeof self=="object"&&self&&self.Object===Object&&self,z=G||B||Function("return this")(),Z=t&&!t.nodeType&&t,it=Z&&!0&&e&&!e.nodeType&&e,ht=it&&it.exports===Z;function mt(M,Y){return M.set(Y[0],Y[1]),M}function X(M,Y){return M.add(Y),M}function ot(M,Y){for(var tt=-1,xt=M?M.length:0;++tt<xt&&Y(M[tt],tt,M)!==!1;);return M}function vt(M,Y){for(var tt=-1,xt=Y.length,Ce=M.length;++tt<xt;)M[Ce+tt]=Y[tt];return M}function lt(M,Y,tt,xt){for(var Ce=-1,Ke=M?M.length:0;++Ce<Ke;)tt=Y(tt,M[Ce],Ce,M);return tt}function bt(M,Y){for(var tt=-1,xt=Array(M);++tt<M;)xt[tt]=Y(tt);return xt}function Rt(M,Y){return M?.[Y]}function j(M){var Y=!1;if(M!=null&&typeof M.toString!="function")try{Y=!!(M+"")}catch{}return Y}function et(M){var Y=-1,tt=Array(M.size);return M.forEach(function(xt,Ce){tt[++Y]=[Ce,xt]}),tt}function rt(M,Y){return function(tt){return M(Y(tt))}}function Gt(M){var Y=-1,tt=Array(M.size);return M.forEach(function(xt){tt[++Y]=xt}),tt}var yt=Array.prototype,$t=Function.prototype,Me=Object.prototype,Te=z["__core-js_shared__"],ee=(function(){var M=/[^.]+$/.exec(Te&&Te.keys&&Te.keys.IE_PROTO||"");return M?"Symbol(src)_1."+M:""})(),je=$t.toString,Yt=Me.hasOwnProperty,Be=Me.toString,se=RegExp("^"+je.call(Yt).replace(ut,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),De=ht?z.Buffer:void 0,Pe=z.Symbol,gn=z.Uint8Array,Wi=rt(Object.getPrototypeOf,Object),Cn=Object.create,Ge=Me.propertyIsEnumerable,Ln=yt.splice,di=Object.getOwnPropertySymbols,Oo=De?De.isBuffer:void 0,Ao=rt(Object.keys,Object),Tr=Zn(z,"DataView"),fi=Zn(z,"Map"),Eo=Zn(z,"Promise"),Ro=Zn(z,"Set"),Po=Zn(z,"WeakMap"),$i=Zn(Object,"create"),xl=pi(Tr),Ed=pi(fi),Rd=pi(Eo),Pd=pi(Ro),Id=pi(Po),Io=Pe?Pe.prototype:void 0,wl=Io?Io.valueOf:void 0;function hi(M){var Y=-1,tt=M?M.length:0;for(this.clear();++Y<tt;){var xt=M[Y];this.set(xt[0],xt[1])}}function Ld(){this.__data__=$i?$i(null):{}}function Lo(M){return this.has(M)&&delete this.__data__[M]}function Nd(M){var Y=this.__data__;if($i){var tt=Y[M];return tt===i?void 0:tt}return Yt.call(Y,M)?Y[M]:void 0}function No(M){var Y=this.__data__;return $i?Y[M]!==void 0:Yt.call(Y,M)}function Bd(M,Y){var tt=this.__data__;return tt[M]=$i&&Y===void 0?i:Y,this}hi.prototype.clear=Ld,hi.prototype.delete=Lo,hi.prototype.get=Nd,hi.prototype.has=No,hi.prototype.set=Bd;function Nn(M){var Y=-1,tt=M?M.length:0;for(this.clear();++Y<tt;){var xt=M[Y];this.set(xt[0],xt[1])}}function Fd(){this.__data__=[]}function zd(M){var Y=this.__data__,tt=kr(Y,M);if(tt<0)return!1;var xt=Y.length-1;return tt==xt?Y.pop():Ln.call(Y,tt,1),!0}function Ud(M){var Y=this.__data__,tt=kr(Y,M);return tt<0?void 0:Y[tt][1]}function vl(M){return kr(this.__data__,M)>-1}function Hd(M,Y){var tt=this.__data__,xt=kr(tt,M);return xt<0?tt.push([M,Y]):tt[xt][1]=Y,this}Nn.prototype.clear=Fd,Nn.prototype.delete=zd,Nn.prototype.get=Ud,Nn.prototype.has=vl,Nn.prototype.set=Hd;function Vi(M){var Y=-1,tt=M?M.length:0;for(this.clear();++Y<tt;){var xt=M[Y];this.set(xt[0],xt[1])}}function Sl(){this.__data__={hash:new hi,map:new(fi||Nn),string:new hi}}function Wd(M){return Mr(this,M).delete(M)}function $d(M){return Mr(this,M).get(M)}function Vd(M){return Mr(this,M).has(M)}function Yd(M,Y){return Mr(this,M).set(M,Y),this}Vi.prototype.clear=Sl,Vi.prototype.delete=Wd,Vi.prototype.get=$d,Vi.prototype.has=Vd,Vi.prototype.set=Yd;function Yi(M){this.__data__=new Nn(M)}function qd(){this.__data__=new Nn}function ls(M){return this.__data__.delete(M)}function jd(M){return this.__data__.get(M)}function cs(M){return this.__data__.has(M)}function Gd(M,Y){var tt=this.__data__;if(tt instanceof Nn){var xt=tt.__data__;if(!fi||xt.length<n-1)return xt.push([M,Y]),this;tt=this.__data__=new Vi(xt)}return tt.set(M,Y),this}Yi.prototype.clear=qd,Yi.prototype.delete=ls,Yi.prototype.get=jd,Yi.prototype.has=cs,Yi.prototype.set=Gd;function Kd(M,Y){var tt=Ho(M)||Bl(M)?bt(M.length,String):[],xt=tt.length,Ce=!!xt;for(var Ke in M)Yt.call(M,Ke)&&!(Ce&&(Ke=="length"||Pl(Ke,xt)))&&tt.push(Ke);return tt}function Tl(M,Y,tt){var xt=M[Y];(!(Yt.call(M,Y)&&Nl(xt,tt))||tt===void 0&&!(Y in M))&&(M[Y]=tt)}function kr(M,Y){for(var tt=M.length;tt--;)if(Nl(M[tt][0],Y))return tt;return-1}function kl(M,Y){return M&&Fo(Y,Wo(Y),M)}function us(M,Y,tt,xt,Ce,Ke,Bn){var Fe;if(xt&&(Fe=Ke?xt(M,Ce,Ke,Bn):xt(M)),Fe!==void 0)return Fe;if(!ms(M))return M;var zl=Ho(M);if(zl){if(Fe=El(M),!Y)return Al(M,Fe)}else{var ue=un(M),gs=ue==h||ue==m;if(af(M))return Dl(M,Y);if(ue==x||ue==s||gs&&!Ke){if(j(M))return Ke?M:{};if(Fe=Rl(gs?{}:M),!Y)return zo(M,kl(Fe,M))}else{if(!pt[ue])return Ke?M:{};Fe=rf(M,ue,us,Y)}}Bn||(Bn=new Yi);var Qn=Bn.get(M);if(Qn)return Qn;if(Bn.set(M,Fe),!zl)var $o=tt?nf(M):Wo(M);return ot($o||M,function(Dr,ze){$o&&(ze=Dr,Dr=M[ze]),Tl(Fe,ze,us(Dr,Y,tt,xt,ze,M,Bn))}),Fe}function Xd(M){return ms(M)?Cn(M):{}}function Zd(M,Y,tt){var xt=Y(M);return Ho(M)?xt:vt(xt,tt(M))}function Qd(M){return Be.call(M)}function Jd(M){if(!ms(M)||Ll(M))return!1;var Y=ps(M)||j(M)?se:Tt;return Y.test(pi(M))}function Ml(M){if(!Uo(M))return Ao(M);var Y=[];for(var tt in Object(M))Yt.call(M,tt)&&tt!="constructor"&&Y.push(tt);return Y}function Dl(M,Y){if(Y)return M.slice();var tt=new M.constructor(M.length);return M.copy(tt),tt}function ds(M){var Y=new M.constructor(M.byteLength);return new gn(Y).set(new gn(M)),Y}function Bo(M,Y){var tt=Y?ds(M.buffer):M.buffer;return new M.constructor(tt,M.byteOffset,M.byteLength)}function tf(M,Y,tt){var xt=Y?tt(et(M),!0):et(M);return lt(xt,mt,new M.constructor)}function Cl(M){var Y=new M.constructor(M.source,ct.exec(M));return Y.lastIndex=M.lastIndex,Y}function fs(M,Y,tt){var xt=Y?tt(Gt(M),!0):Gt(M);return lt(xt,X,new M.constructor)}function Ol(M){return wl?Object(wl.call(M)):{}}function ef(M,Y){var tt=Y?ds(M.buffer):M.buffer;return new M.constructor(tt,M.byteOffset,M.length)}function Al(M,Y){var tt=-1,xt=M.length;for(Y||(Y=Array(xt));++tt<xt;)Y[tt]=M[tt];return Y}function Fo(M,Y,tt,xt){tt||(tt={});for(var Ce=-1,Ke=Y.length;++Ce<Ke;){var Bn=Y[Ce],Fe=void 0;Tl(tt,Bn,Fe===void 0?M[Bn]:Fe)}return tt}function zo(M,Y){return Fo(M,hs(M),Y)}function nf(M){return Zd(M,Wo,hs)}function Mr(M,Y){var tt=M.__data__;return Il(Y)?tt[typeof Y=="string"?"string":"hash"]:tt.map}function Zn(M,Y){var tt=Rt(M,Y);return Jd(tt)?tt:void 0}var hs=di?rt(di,Object):uf,un=Qd;(Tr&&un(new Tr(new ArrayBuffer(1)))!=F||fi&&un(new fi)!=g||Eo&&un(Eo.resolve())!=v||Ro&&un(new Ro)!=O||Po&&un(new Po)!=L)&&(un=function(M){var Y=Be.call(M),tt=Y==x?M.constructor:void 0,xt=tt?pi(tt):void 0;if(xt)switch(xt){case xl:return F;case Ed:return g;case Rd:return v;case Pd:return O;case Id:return L}return Y});function El(M){var Y=M.length,tt=M.constructor(Y);return Y&&typeof M[0]=="string"&&Yt.call(M,"index")&&(tt.index=M.index,tt.input=M.input),tt}function Rl(M){return typeof M.constructor=="function"&&!Uo(M)?Xd(Wi(M)):{}}function rf(M,Y,tt,xt){var Ce=M.constructor;switch(Y){case R:return ds(M);case l:case u:return new Ce(+M);case F:return Bo(M,xt);case U:case D:case w:case C:case N:case $:case V:case st:case dt:return ef(M,xt);case g:return tf(M,xt,tt);case _:case A:return new Ce(M);case S:return Cl(M);case O:return fs(M,xt,tt);case P:return Ol(M)}}function Pl(M,Y){return Y=Y??r,!!Y&&(typeof M=="number"||at.test(M))&&M>-1&&M%1==0&&M<Y}function Il(M){var Y=typeof M;return Y=="string"||Y=="number"||Y=="symbol"||Y=="boolean"?M!=="__proto__":M===null}function Ll(M){return!!ee&&ee in M}function Uo(M){var Y=M&&M.constructor,tt=typeof Y=="function"&&Y.prototype||Me;return M===tt}function pi(M){if(M!=null){try{return je.call(M)}catch{}try{return M+""}catch{}}return""}function sf(M){return us(M,!0,!0)}function Nl(M,Y){return M===Y||M!==M&&Y!==Y}function Bl(M){return of(M)&&Yt.call(M,"callee")&&(!Ge.call(M,"callee")||Be.call(M)==s)}var Ho=Array.isArray;function Fl(M){return M!=null&&lf(M.length)&&!ps(M)}function of(M){return cf(M)&&Fl(M)}var af=Oo||ie;function ps(M){var Y=ms(M)?Be.call(M):"";return Y==h||Y==m}function lf(M){return typeof M=="number"&&M>-1&&M%1==0&&M<=r}function ms(M){var Y=typeof M;return!!M&&(Y=="object"||Y=="function")}function cf(M){return!!M&&typeof M=="object"}function Wo(M){return Fl(M)?Kd(M):Ml(M)}function uf(){return[]}function ie(){return!1}e.exports=sf})(da,da.exports)),da.exports}wv();const kn=(e,t)=>new Date(e.getTime()-_v(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=yv(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return qh(n,t)}}class vv 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 Sv extends Ee{rawStart(t){let n=zr(this.tzAdjustedDate(t));return t&&(n=kn(n,t)),n}maximumTimeframeLength(){return 3600*24*31}}class Tv extends Ee{rawStart(t){let n=Fr(this.tzAdjustedDate(t));return t&&(n=kn(n,t)),n}maximumTimeframeLength(){return 3600*24*92}}class kv 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 Mv 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 Dv extends Ee{rawEnd(t){let n=Fr(this.tzAdjustedDate(t));return t&&(n=kn(n,t)),n}rawStart(t){let n=Fr(Rh(this.tzAdjustedDate(t)));return t&&(n=kn(n,t)),n}}class Cv extends Ee{rawEnd(t){let n=zr(this.tzAdjustedDate(t));return t&&(n=kn(n,t)),n}rawStart(t){let n=zr(Eh(this.tzAdjustedDate(t)));return t&&(n=kn(n,t)),n}}class Ov 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}}_t.FIFTEEN_MIN,new Ee({key:_t.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"]}),_t.ONE_HOUR,new Ee({key:_t.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"]}),_t.SIX_HOUR,new Ee({key:_t.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"]}),_t.TWELVE_HOUR,new Ee({key:_t.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"]}),_t.ONE_DAY,new Ee({key:_t.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"]}),_t.SEVEN_DAY,new Ee({key:_t.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"]}),_t.THIRTY_DAY,new Ee({key:_t.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"]}),_t.NINETY_DAY,new Ee({key:_t.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"]}),_t.ONE_HUNDRED_EIGHTY_DAY,new Ee({key:_t.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"]}),_t.ONE_YEAR,new Ee({key:_t.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"]}),_t.CURRENT_WEEK,new vv({key:_t.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"]}),_t.CURRENT_MONTH,new Sv({key:_t.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"]}),_t.CURRENT_QUARTER,new Tv({key:_t.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"]}),_t.CURRENT_YEAR,new kv({key:_t.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"]}),_t.PREVIOUS_WEEK,new Mv({key:_t.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"]}),_t.PREVIOUS_MONTH,new Cv({key:_t.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=zr(new Date),n=zr(Eh(new Date));return t.getTimezoneOffset()!==n.getTimezoneOffset()&&(e=Xh(t,n)),3600*24*Ww(new Date().setMonth(new Date().getMonth()-1))+Ah(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),_t.PREVIOUS_QUARTER,new Dv({key:_t.PREVIOUS_QUARTER,display:"Previous quarter",timeframeText:"Quarter",timeframeLength:()=>{const e=Fr(new Date),t=Fr(Rh(new Date));return(e.getTime()-t.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),_t.PREVIOUS_YEAR,new Ov({key:_t.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=Xh(e,t)),3600*24*(365+(t.getFullYear()%4===0?1:0))+Ah(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Xh(e,t){return Vw(e.getTimezoneOffset()-t.getTimezoneOffset())}_t.FIFTEEN_MIN,_t.ONE_HOUR,_t.SIX_HOUR,_t.TWELVE_HOUR,_t.ONE_DAY,_t.SEVEN_DAY,_t.FIFTEEN_MIN,_t.ONE_HOUR,_t.SIX_HOUR,_t.TWELVE_HOUR,_t.ONE_DAY,_t.SEVEN_DAY,_t.THIRTY_DAY,_t.NINETY_DAY,_t.ONE_HUNDRED_EIGHTY_DAY,_t.ONE_YEAR,_t.CURRENT_WEEK,_t.CURRENT_MONTH,_t.CURRENT_QUARTER,_t.CURRENT_YEAR,_t.PREVIOUS_WEEK,_t.PREVIOUS_MONTH,_t.PREVIOUS_QUARTER,_t.PREVIOUS_YEAR;const Av=new Map(_h.map(e=>[e.code,{code:e.code,name:e.name}])),Bc=e=>Av.get(e)?.name||e,Zh=1e3,Ev=1e4,Qh=1e6,Jh=1e9,tp=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?Ev:Zh;return e<r||t.precision&&t.precision>Math.log10(e)?n=fa(Ls(e,1,t),t):e<Qh?n=`${Ls(e,Zh,t)}k`:e<Jh?n=`${Ls(e,Qh,t)}m`:e<tp?n=`${fa(Ls(e,Jh,t),t)}b`:n=`${fa(Ls(e,tp,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 Rv=typeof document<"u"&&document.documentElement?.lang||"en-US",pa=new Intl.NumberFormat(Rv),Pv=new Set(["%"]),Iv=e=>Pv.has(e)?"flush":"spaced";function $n({i18n:e}){const t=(r,s)=>{if(isNaN(r))return"0 B";const a=s?Math.pow(2,50):1e15,l=s?Math.pow(2,40):1e12,u=s?Math.pow(2,30):1e9,d=s?Math.pow(2,20):1e6,h=s?Math.pow(2,10):1e3;let m;return r>=a?m=e.formatNumber(Number.parseFloat((r/a).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):r>=l?m=e.formatNumber(Number.parseFloat((r/l).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):r>=u?m=e.formatNumber(Number.parseFloat((r/u).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):r>=d?m=e.formatNumber(Number.parseFloat((r/d).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):r>=h?m=e.formatNumber(Number.parseFloat((r/h).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):m=e.formatNumber(Number.parseFloat(r.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),m.replace(/([a-zA-Z]*)$/," $1")},n=(r,s="USD")=>isNaN(r)?s==="USD"?"$0.00":`${r}`:r>=.01||s!=="USD"?e.formatNumber(r,{style:"currency",currency:s}):r<1e-4?"< $0.0001":`$${Number.parseFloat(r.toPrecision(4))}`,i=(r,s,a)=>{if(!a)return r;const l=Iv(s)==="flush"?"":" ";return`${r}${l}${a}`};return{formatUnit:(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(r,a);case"usd":return n(r,l);default:return isNaN(r)?`${r}`:u?i(ha(r,{capital:!0}),s,h):r<.01?i(`${Number.parseFloat(r.toPrecision(4))}`,s,h):i(pa.format(Number.parseFloat(r.toFixed(2))),s,h)}},formatBytes:t,formatCost:n,formatRange:(r,s,a,{isBytes1024:l=!1,currency:u="USD",approximate:d=!1,translateUnit:h=m=>m}={})=>{const m=h(a,s);switch(a){case"bytes":return`${t(r,l)} - ${t(s,l)}`;case"usd":return`${n(r,u)} - ${n(s,u)}`;default:if(isNaN(r)||isNaN(s))return`${r} - ${s}`;if(d)return i(`${ha(r,{capital:!0})} - ${ha(s,{capital:!0})}`,a,m)}const g=r>=.01?`${pa.format(Number.parseFloat(r.toFixed(2)))}`:`${Number.parseFloat(r.toPrecision(4))}`,_=s>=.01?`${pa.format(Number.parseFloat(s.toFixed(2)))}`:`${Number.parseFloat(s.toPrecision(4))}`;return i(`${g} - ${_}`,a,m)}}}const Lv=e=>{const t=e.length;let n=5381;for(let i=0;i<t;i++)n=n*33^e.charCodeAt(i);return n>>>0},Nv="#0044f4",ep="#6c7489",Bv="#d60027",Fv="#ffc400",zv="#bee2ff",Uv="#8fc1ff",Hv="#5f9aff",Wv="#306fff",$v="#b5ffee",Vv="#00fabe",Yv="#00d6a4",qv="#00a17b",jv="#007d60",Gv="#005944",Kv="#b5ffee",Xv="#00fabe",Zv="#b5ffee",Qv="#00a17b",Jv="#fff296",t1="#ffe04b",e1="#ffc400",n1="#b37600",i1="#995c00",r1="#804400",s1="#fff296",o1="#ffe04b",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="#a31f00",k1="#ffc2b3",M1="#ff9877",D1="#ff723c",C1="#f75008",O1="#d13500",A1="#a31f00",E1="#ffc2b3",R1="#ff9877",P1="#ff723c",I1="#f75008",L1="#d13500",N1="#ffabab",B1="#ff7272",F1="#ff3954",z1="#f50045",U1="#d60027",H1="#ad000e",W1="#ffabab",$1="#ff7272",V1="#ff3954",Y1="#f50045",q1="#d60027",j1="#eefaff",G1="#ecfffb",K1="#fffce0",X1="#fff1ef",Z1="#ffe5e5",Q1="#5f9aff",J1="#00d6a4",tS="#ffc400",eS="#ff723c",nS="#ff3954",iS={100:zv,101:Uv,102:Hv,103:Wv,200:$v,201:Vv,202:Yv,203:qv,204:jv,205:Gv,206:Kv,207:Xv,208:Zv,226:Qv,300:Jv,301:t1,302:e1,303:n1,304:i1,305:r1,307:s1,308:o1,400:a1,401:l1,402:c1,403:u1,404:d1,405:f1,406:h1,407:p1,408:m1,409:g1,410:y1,411:_1,412:b1,413:x1,414:w1,415:v1,416:S1,417:T1,418:k1,421:M1,422:D1,423:C1,424:O1,425:A1,426:E1,428:R1,429:P1,431:I1,451:L1,500:N1,501:B1,502:F1,503:z1,504:U1,505:H1,506:W1,507:$1,508:V1,510:Y1,511:q1},rS={100:j1,200:G1,300:K1,400:X1,500:Z1},np={"1XX":Q1,"2XX":J1,"3XX":tS,"4XX":eS,"5XX":nS},sS={error:Bv,warning:Fv,empty:"#9DA99D",neutral:ep,____OTHER____:Nv},ip=["#0076F4","#00819D","#00A17B","#8A50FF","#FF3C99","#FF6D3C","#B3A100"],rp=["#5485BA","#087D96","#3D8776","#7654BA","#A1406F","#BF5430","#B5A72C"],oS=e=>Lv(e),sp=({discriminator:e,theme:t="light",customPalette:n=void 0})=>{const i=Math.abs(Math.floor(e));return n?n[i%n.length]:t==="dark"?rp[i%rp.length]:ip[i%ip.length]},Ns=({state:e})=>sS[e]??ep,aS=({statusCode:e})=>{const t=typeof e=="number"?e:Number.parseInt(e,10),n=`${t}`,i=`${Math.floor(t/100)*100}`;return iS[n]??rS[i]??Ns({state:"neutral"})},lS=({group:e})=>np[e]?np[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,customPalette:s=void 0})=>{let a="light";if(f.hasInjectionContext()&&(a=f.inject("app:konnectColorMode",f.computed(()=>"light")).value),e!==void 0)return sp({discriminator:e,theme:a,customPalette:s});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 aS({statusCode:i});if(n==="status_code_grouped")return lS({group:i})}return n||i||r?sp({discriminator:oS(`${n??""}${i??""}${r??""}`),theme:a,customPalette:s}):Ns({state:"neutral"})},op="#d60027",ap="#ffe5e5",cS="#f1f0ff",uS="#e0e4ea",lp="#6c7489",dS="#afb7c5",cp="#0d0e14",fS="#d60027",hS="#ad000e",Fc="#6c7489",up="#52596e",pS="#007d60",mS="#995c00",gS="#ffc400",yS="'Inter', Roboto, Helvetica, sans-serif",rr="16px",_S="20px",bS="#bee2ff",xS="#8fc1ff",wS="#5f9aff",vS="#306fff",SS="#b5ffee",TS="#00fabe",kS="#00d6a4",MS="#00a17b",DS="#007d60",CS="#005944",OS="#b5ffee",AS="#00fabe",ES="#b5ffee",RS="#00a17b",PS="#fff296",IS="#ffe04b",LS="#ffc400",NS="#b37600",BS="#995c00",FS="#804400",zS="#fff296",US="#ffe04b",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="#a31f00",sT="#ffc2b3",oT="#ff9877",aT="#ff723c",lT="#f75008",cT="#d13500",uT="#a31f00",dT="#ffc2b3",fT="#ff9877",hT="#ff723c",pT="#f75008",mT="#d13500",gT="#ffabab",yT="#ff7272",_T="#ff3954",bT="#f50045",xT="#d60027",wT="#ad000e",vT="#ffabab",ST="#ff7272",TT="#ff3954",kT="#f50045",MT="#d60027",DT="#eefaff",CT="#ecfffb",OT="#fffce0",AT="#fff1ef",ET="#ffe5e5",RT="#5f9aff",PT="#00d6a4",IT="#ffc400",LT="#ff723c",NT="#ff3954",dp=6048e5,BT=864e5,Fs=6e4,Hr=36e5,FT=1e3,fp=Symbol.for("constructDateFrom");function me(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&fp in e?e[fp](t):e instanceof Date?new e.constructor(t):new Date(t)}function Et(e,t){return me(t||e,e)}function ma(e,t,n){const i=Et(e,n?.in);return isNaN(t)?me(n?.in||e,NaN):(t&&i.setDate(i.getDate()+t),i)}function zc(e,t,n){const i=Et(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 Uc(e,t,n){return me(e,+Et(e)+t)}function zT(e,t,n){return Uc(e,t*Hr)}let UT={};function sr(){return UT}function Vn(e,t){const n=sr(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=Et(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 hp(e,t){const n=Et(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=Et(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 Hc(e,t){const n=Et(e,t?.in);return n.setHours(0,0,0,0),n}function pp(e,t,n){const[i,r]=or(n?.in,e,t),s=Hc(i),a=Hc(r),l=+s-ga(s),u=+a-ga(a);return Math.round((l-u)/BT)}function HT(e,t){const n=hp(e,t),i=me(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),Wr(i)}function WT(e,t,n){const i=Et(e,n?.in);return i.setTime(i.getTime()+t*Fs),i}function $T(e,t,n){return zc(e,t*3,n)}function VT(e,t,n){return Uc(e,t*1e3)}function YT(e,t,n){return ma(e,t*7,n)}function qT(e,t,n){return zc(e,t*12,n)}function zs(e,t){const n=+Et(e)-+Et(t);return n<0?-1:n>0?1:n}function jT(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Wc(e){return!(!jT(e)&&typeof e!="number"||isNaN(+Et(e)))}function GT(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 KT(e,t,n){const[i,r]=or(n?.in,e,t);return i.getFullYear()-r.getFullYear()}function mp(e,t,n){const[i,r]=or(n?.in,e,t),s=gp(i,r),a=Math.abs(pp(i,r));i.setDate(i.getDate()-s*a);const l=+(gp(i,r)===-s),u=s*(a-l);return u===0?0:u}function gp(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 XT(e,t,n){const[i,r]=or(n?.in,e,t),s=(+i-+r)/Hr;return Us(n?.roundingMethod)(s)}function $c(e,t){return+Et(e)-+Et(t)}function ZT(e,t,n){const i=$c(e,t)/Fs;return Us(n?.roundingMethod)(i)}function yp(e,t){const n=Et(e,t?.in);return n.setHours(23,59,59,999),n}function _p(e,t){const n=Et(e,t?.in),i=n.getMonth();return n.setFullYear(n.getFullYear(),i+1,0),n.setHours(23,59,59,999),n}function QT(e,t){const n=Et(e,t?.in);return+yp(n,t)==+_p(n,t)}function bp(e,t,n){const[i,r,s]=or(n?.in,e,e,t),a=zs(r,s),l=Math.abs(GT(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;QT(i)&&l===1&&zs(i,s)===1&&(u=!1);const d=a*(l-+u);return d===0?0:d}function JT(e,t,n){const i=bp(e,t,n)/3;return Us(n?.roundingMethod)(i)}function tk(e,t,n){const i=$c(e,t)/1e3;return Us(n?.roundingMethod)(i)}function ek(e,t,n){const i=mp(e,t,n)/7;return Us(n?.roundingMethod)(i)}function nk(e,t,n){const[i,r]=or(n?.in,e,t),s=zs(i,r),a=Math.abs(KT(i,r));i.setFullYear(1584),r.setFullYear(1584);const l=zs(i,r)===-s,u=s*(a-+l);return u===0?0:u}function ik(e,t){const n=Et(e,t?.in),i=n.getMonth(),r=i-i%3;return n.setMonth(r,1),n.setHours(0,0,0,0),n}function rk(e,t){const n=Et(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function sk(e,t){const n=Et(e,t?.in),i=n.getFullYear();return n.setFullYear(i+1,0,0),n.setHours(23,59,59,999),n}function xp(e,t){const n=Et(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function ok(e,t){const n=Et(e,t?.in);return n.setMinutes(59,59,999),n}function ak(e,t){const n=sr(),i=n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=Et(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 lk(e,t){const n=Et(e,t?.in);return n.setSeconds(59,999),n}function ck(e,t){const n=Et(e,t?.in),i=n.getMonth(),r=i-i%3+3;return n.setMonth(r,0),n.setHours(23,59,59,999),n}function uk(e,t){const n=Et(e,t?.in);return n.setMilliseconds(999),n}const dk={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"}},fk=(e,t,n)=>{let i;const r=dk[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 Vc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const hk={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},pk={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},mk={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},gk={date:Vc({formats:hk,defaultWidth:"full"}),time:Vc({formats:pk,defaultWidth:"full"}),dateTime:Vc({formats:mk,defaultWidth:"full"})},yk={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},_k=(e,t,n,i)=>yk[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 bk={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},xk={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},wk={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"]},vk={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"]},Sk={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"}},Tk={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"}},kk={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:bk,defaultWidth:"wide"}),quarter:Hs({values:xk,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Hs({values:wk,defaultWidth:"wide"}),day:Hs({values:vk,defaultWidth:"wide"}),dayPeriod:Hs({values:Sk,defaultWidth:"wide",formattingValues:Tk,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)?Dk(l,m=>m.test(a)):Mk(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 Mk(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Dk(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Ck(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 Ok=/^(\d+)(th|st|nd|rd)?/i,Ak=/\d+/i,Ek={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},Rk={any:[/^b/i,/^(a|c)/i]},Pk={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ik={any:[/1/i,/2/i,/3/i,/4/i]},Lk={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},Nk={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]},Bk={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},Fk={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]},zk={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},Uk={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}},Hk={ordinalNumber:Ck({matchPattern:Ok,parsePattern:Ak,valueCallback:e=>parseInt(e,10)}),era:Ws({matchPatterns:Ek,defaultMatchWidth:"wide",parsePatterns:Rk,defaultParseWidth:"any"}),quarter:Ws({matchPatterns:Pk,defaultMatchWidth:"wide",parsePatterns:Ik,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ws({matchPatterns:Lk,defaultMatchWidth:"wide",parsePatterns:Nk,defaultParseWidth:"any"}),day:Ws({matchPatterns:Bk,defaultMatchWidth:"wide",parsePatterns:Fk,defaultParseWidth:"any"}),dayPeriod:Ws({matchPatterns:zk,defaultMatchWidth:"any",parsePatterns:Uk,defaultParseWidth:"any"})},wp={code:"en-US",formatDistance:fk,formatLong:gk,formatRelative:_k,localize:kk,match:Hk,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Wk(e,t){const n=Et(e,t?.in);return pp(n,xp(n))+1}function vp(e,t){const n=Et(e,t?.in),i=+Wr(n)-+HT(n);return Math.round(i/dp)+1}function Yc(e,t){const n=Et(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 $k(e,t){const n=sr(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=Yc(e,t),s=me(t?.in||e,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),Vn(s,t)}function Sp(e,t){const n=Et(e,t?.in),i=+Vn(n,t)-+$k(n,t);return Math.round(i/dp)+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"},Tp={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=Yc(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=hp(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=Sp(e,i);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):Qt(r,t.length)},I:function(e,t,n){const i=vp(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=Wk(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 Mp(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 Mp(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"+kp(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"+kp(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 kp(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 Mp(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 Dp=(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"})}},Cp=(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"})}},qc={p:Cp,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return Dp(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}}",Dp(i,t)).replace("{{time}}",Cp(r,t))}},Vk=/^D+$/,Yk=/^Y+$/,qk=["D","DD","YY","YYYY"];function Op(e){return Vk.test(e)}function Ap(e){return Yk.test(e)}function jc(e,t,n){const i=jk(e,t,n);if(console.warn(i),qk.includes(e))throw new RangeError(i)}function jk(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 Gk=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Kk=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Xk=/^'([^]*?)'?$/,Zk=/''/g,Qk=/[a-zA-Z]/;function ya(e,t,n){const i=sr(),r=n?.locale??i.locale??wp,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=Et(e,n?.in);if(!Wc(l))throw new RangeError("Invalid time value");let u=t.match(Kk).map(h=>{const m=h[0];if(m==="p"||m==="P"){const g=qc[m];return g(h,r.formatLong)}return h}).join("").match(Gk).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const m=h[0];if(m==="'")return{isToken:!1,value:Jk(h)};if(Tp[m])return{isToken:!0,value:h};if(m.match(Qk))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&&Ap(m)||!n?.useAdditionalDayOfYearTokens&&Op(m))&&jc(m,t,String(e));const g=Tp[m[0]];return g(l,m,r.localize,d)}).join("")}function Jk(e){const t=e.match(Xk);return t?t[1].replace(Zk,"'"):e}function Ep(){return Object.assign({},sr())}function tM(e,t){const n=Et(e,t?.in).getDay();return n===0?7:n}function eM(e,t){const n=nM(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 nM(e){return typeof e=="function"&&e.prototype?.constructor===e}const iM=10;class Rp{subPriority=0;validate(t,n){return!0}}class rM extends Rp{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 sM extends Rp{priority=iM;subPriority=-1;constructor(t,n){super(),this.context=t||(i=>me(n,i))}set(t,n){return n.timestampIsSet?t:me(t,eM(t,this.context))}}class Vt{run(t,n,i,r){const s=this.parse(t,n,i,r);return s?{setter:new rM(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(t,n,i){return!0}}class oM extends Vt{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*FT),rest:t.slice(n[0].length)}}function Pp(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 Gc(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function Ip(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 Lp(e){return e%400===0||e%4===0&&e%100!==0}class aM extends Vt{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=Ip(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 lM extends Vt{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=Yc(t,r);if(i.isTwoDigitYear){const l=Ip(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 cM extends Vt{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 uM extends Vt{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 dM extends Vt{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 fM extends Vt{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 hM extends Vt{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 pM extends Vt{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 mM(e,t,n){const i=Et(e,n?.in),r=Sp(i,n)-t;return i.setDate(i.getDate()-r*7),Et(i,n?.in)}class gM extends Vt{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(mM(t,i,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function yM(e,t,n){const i=Et(e,n?.in),r=vp(i,n)-t;return i.setDate(i.getDate()-r*7),i}class _M extends Vt{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(yM(t,i))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const bM=[31,28,31,30,31,30,31,31,30,31,30,31],xM=[31,29,31,30,31,30,31,31,30,31,30,31];class wM extends Vt{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=Lp(i),s=t.getMonth();return r?n>=1&&n<=xM[s]:n>=1&&n<=bM[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 vM extends Vt{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 Lp(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 Kc(e,t,n){const i=sr(),r=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,s=Et(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 SM extends Vt{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=Kc(t,i,r),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class TM extends Vt{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=Kc(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 kM extends Vt{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=Kc(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 MM(e,t,n){const i=Et(e,n?.in),r=tM(i,n),s=t-r;return ma(i,s,n)}class DM extends Vt{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=MM(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 CM extends Vt{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(Gc(i),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class OM extends Vt{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(Gc(i),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class AM extends Vt{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(Gc(i),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class EM extends Vt{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 RM extends Vt{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 PM extends Vt{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 IM extends Vt{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 LM extends Vt{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 NM extends Vt{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 BM extends Vt{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 FM extends Vt{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 zM extends Vt{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 UM extends Vt{priority=40;parse(t){return Pp(t)}set(t,n,i){return[me(t,i*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class HM extends Vt{priority=20;parse(t){return Pp(t)}set(t,n,i){return[me(t,i),{timestampIsSet:!0}]}incompatibleTokens="*"}const WM={G:new oM,y:new aM,Y:new lM,R:new cM,u:new uM,Q:new dM,q:new fM,M:new hM,L:new pM,w:new gM,I:new _M,d:new wM,D:new vM,E:new SM,e:new TM,c:new kM,i:new DM,a:new CM,b:new OM,B:new AM,h:new EM,H:new RM,K:new PM,k:new IM,m:new LM,s:new NM,S:new BM,X:new FM,x:new zM,t:new UM,T:new HM},$M=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,VM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,YM=/^'([^]*?)'?$/,qM=/''/g,jM=/\S/,GM=/[a-zA-Z]/;function KM(e,t,n,i){const r=()=>me(i?.in||n,NaN),s=Ep(),a=i?.locale??s.locale??wp,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():Et(n,i?.in);const d={firstWeekContainsDate:l,weekStartsOn:u,locale:a},h=[new sM(i?.in,n)],m=t.match(VM).map(S=>{const O=S[0];if(O in qc){const A=qc[O];return A(S,a.formatLong)}return S}).join("").match($M),g=[];for(let S of m){!i?.useAdditionalWeekYearTokens&&Ap(S)&&jc(S,t,e),!i?.useAdditionalDayOfYearTokens&&Op(S)&&jc(S,t,e);const O=S[0],A=WM[O];if(A){const{incompatibleTokens:P}=A;if(Array.isArray(P)){const R=g.find(F=>P.includes(F.token)||F.token===O);if(R)throw new RangeError(`The format string mustn't contain \`${R.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:O,fullToken:S});const L=A.run(e,S,a.match,d);if(!L)return r();h.push(L.setter),e=L.rest}else{if(O.match(GM))throw new RangeError("Format string contains an unescaped latin alphabet character `"+O+"`");if(S==="''"?S="'":O==="'"&&(S=XM(S)),e.indexOf(S)===0)e=e.slice(S.length);else return r()}}if(e.length>0&&jM.test(e))return r();const _=h.map(S=>S.priority).sort((S,O)=>O-S).filter((S,O,A)=>A.indexOf(S)===O).map(S=>h.filter(O=>O.priority===S).sort((O,A)=>A.subPriority-O.subPriority)).map(S=>S[0]);let x=Et(n,i?.in);if(isNaN(+x))return r();const v={};for(const S of _){if(!S.validate(x,d))return r();const O=S.set(x,v,d);Array.isArray(O)?(x=O[0],Object.assign(v,O[1])):x=O}return x}function XM(e){return e.match(YM)[1].replace(qM,"'")}function ZM(e,t){const n=Et(e,t?.in);return n.setMinutes(0,0,0),n}function QM(e,t){const n=Et(e,t?.in);return n.setSeconds(0,0),n}function JM(e,t){const n=Et(e,t?.in);return n.setMilliseconds(0),n}function Np(e){const t=e/Hr;return Math.trunc(t)}function Bp(e,t){const n=()=>me(t?.in,NaN),i=t?.additionalDigits??2,r=iD(e);let s;if(r.date){const d=rD(r.date,i);s=sD(d.restDateString,d.year)}if(!s||isNaN(+s))return n();const a=+s;let l=0,u;if(r.time&&(l=oD(r.time),isNaN(l)))return n();if(r.timezone){if(u=aD(r.timezone),isNaN(u))return n()}else{const d=new Date(a+l),h=Et(0,t?.in);return h.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),h.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),h}return Et(a+l+u,t?.in)}const ba={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},tD=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,eD=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,nD=/^([+-])(\d{2})(?::?(\d{2}))?$/;function iD(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 rD(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 sD(e,t){if(t===null)return new Date(NaN);const n=e.match(tD);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 fD(t,l,u)?lD(t,l,u):new Date(NaN);{const d=new Date(0);return!uD(t,s,a)||!dD(t,r)?new Date(NaN):(d.setUTCFullYear(t,s,Math.max(r,a)),d)}}function $s(e){return e?parseInt(e):1}function oD(e){const t=e.match(eD);if(!t)return NaN;const n=Xc(t[1]),i=Xc(t[2]),r=Xc(t[3]);return hD(n,i,r)?n*Hr+i*Fs+r*1e3:NaN}function Xc(e){return e&&parseFloat(e.replace(",","."))||0}function aD(e){if(e==="Z")return 0;const t=e.match(nD);if(!t)return 0;const n=t[1]==="+"?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return pD(i,r)?n*(i*Hr+r*Fs):NaN}function lD(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 cD=[31,null,31,30,31,30,31,31,30,31,30,31];function Fp(e){return e%400===0||e%4===0&&e%100!==0}function uD(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(cD[t]||(Fp(e)?29:28))}function dD(e,t){return t>=1&&t<=(Fp(e)?366:365)}function fD(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function hD(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function pD(e,t){return t>=0&&t<=59}const zp={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:"Request cost (avg per million)",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 Up(){const e=mh.createI18n("en-us",zp);return{i18n:e,i18nT:mh.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 Hp(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},Zc=[..."0123456789ABCDEF"],mD=e=>Zc[e&15],gD=e=>Zc[(e&240)>>4]+Zc[e&15],xa=e=>(e&240)>>4===(e&15),yD=e=>xa(e.r)&&xa(e.g)&&xa(e.b)&&xa(e.a);function _D(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 bD=(e,t)=>e<255?t(e):"";function xD(e){var t=yD(e)?mD:gD;return e?"#"+t(e.r)+t(e.g)+t(e.b)+bD(e.a,t):void 0}const wD=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Wp(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 vD(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 SD(e,t,n){const i=Wp(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 TD(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 Qc(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=TD(n,i,r,h,s),u=u*60+.5),[u|0,d||0,l]}function Jc(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(Di)}function tu(e,t,n){return Jc(Wp,e,t,n)}function kD(e,t,n){return Jc(SD,e,t,n)}function MD(e,t,n){return Jc(vD,e,t,n)}function $p(e){return(e%360+360)%360}function DD(e){const t=wD.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?Ys(+t[5]):Di(+t[5]));const r=$p(+t[2]),s=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=kD(r,s,a):t[1]==="hsv"?i=MD(r,s,a):i=tu(r,s,a),{r:i[0],g:i[1],b:i[2],a:n}}function CD(e,t){var n=Qc(e);n[0]=$p(n[0]+t),n=tu(n),e.r=n[0],e.g=n[1],e.b=n[2]}function OD(e){if(!e)return;const t=Qc(e),n=t[0],i=Hp(t[1]),r=Hp(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${r}%, ${ii(e.a)})`:`hsl(${n}, ${i}%, ${r}%)`}const Vp={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Yp={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 AD(){const e={},t=Object.keys(Yp),n=Object.keys(Vp);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,Vp[s]);s=parseInt(Yp[a],16),e[l]=[s>>16&255,s>>8&255,s&255]}return e}let wa;function ED(e){wa||(wa=AD(),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 RD=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function PD(e){const t=RD.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 ID(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${ii(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const eu=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 LD(e,t,n){const i=Vr(ii(e.r)),r=Vr(ii(e.g)),s=Vr(ii(e.b));return{r:Di(eu(i+n*(Vr(ii(t.r))-i))),g:Di(eu(r+n*(Vr(ii(t.g))-r))),b:Di(eu(s+n*(Vr(ii(t.b))-s))),a:e.a+n*(t.a-e.a)}}function va(e,t,n){if(e){let i=Qc(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=tu(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function qp(e,t){return e&&Object.assign(t||{},e)}function jp(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=qp(e,{r:0,g:0,b:0,a:1}),t.a=Di(t.a)),t}function ND(e){return e.charAt(0)==="r"?PD(e):DD(e)}class qs{constructor(t){if(t instanceof qs)return t;const n=typeof t;let i;n==="object"?i=jp(t):n==="string"&&(i=_D(t)||ED(t)||ND(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=qp(this._rgb);return t&&(t.a=ii(t.a)),t}set rgb(t){this._rgb=jp(t)}rgbString(){return this._valid?ID(this._rgb):void 0}hexString(){return this._valid?xD(this._rgb):void 0}hslString(){return this._valid?OD(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=LD(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 CD(this._rgb,t),this}}function ri(){}const BD=(()=>{let e=0;return()=>e++})();function kt(e){return e==null}function jt(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 Nt(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 Ot(e,t){return typeof e>"u"?t:e}const FD=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,Gp=(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(jt(e))for(s=e.length,r=0;r<s;r++)t.call(n,e[r],r);else if(Nt(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(jt(e))return e.map(Ta);if(Nt(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 Kp(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function zD(e,t,n,i){if(!Kp(e))return;const r=t[e],s=n[e];Nt(r)&&Nt(s)?js(r,s,i):t[e]=Ta(s)}function js(e,t,n){const i=jt(t)?t:[t],r=i.length;if(!Nt(e))return e;n=n||{};const s=n.merger||zD;let a;for(let l=0;l<r;++l){if(a=i[l],!Nt(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:UD})}function UD(e,t,n){if(!Kp(e))return;const i=t[e],r=n[e];Nt(i)&&Nt(r)?Gs(i,r):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Ta(r))}const Xp={"":e=>e,x:e=>e.x,y:e=>e.y};function HD(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 WD(e){const t=HD(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function Ci(e,t){return(Xp[t]||(Xp[t]=WD(t)))(e)}function nu(e){return e.charAt(0).toUpperCase()+e.slice(1)}const sn=e=>typeof e<"u",on=e=>typeof e=="function",Zp=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function $D(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Pt=Math.PI,ne=2*Pt,VD=ne+Pt,ka=Number.POSITIVE_INFINITY,iu=Pt/180,oe=Pt/2,Dn=Pt/4,Ma=Pt*2/3,Oi=Math.log10,jn=Math.sign;function Ks(e,t,n){return Math.abs(e-t)<n}function Qp(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 YD(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 qD(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Ai(e){return!qD(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function jD(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function Jp(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*(Pt/180)}function Da(e){return e*(180/Pt)}function tm(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*Pt&&(s+=ne),{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 GD(e,t){return(e-t+VD)%ne-Pt}function We(e){return(e%ne+ne)%ne}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 KD(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 ru(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)=>ru(e,n,i?r=>{const s=e[r][t];return s<n||s===n&&e[r+1][t]===n}:r=>e[r][t]<n),XD=(e,t,n)=>ru(e,n,i=>e[i][t]>=n);function ZD(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 em=["push","pop","shift","splice","unshift"];function QD(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),em.forEach(n=>{const i="_onData"+nu(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 nm(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)&&(em.forEach(s=>{delete e[s]}),delete e._chartjs)}function im(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const rm=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function sm(e,t){let n=[],i=!1;return function(...r){n=r,i||(i=!0,rm.call(window,()=>{i=!1,e.apply(t,n)}))}}function JD(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const su=e=>e==="start"?"left":e==="end"?"right":"center",$e=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,tC=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function om(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=>!kt(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(O=>!kt(O[l.axis]));v+=Math.max(0,S)}s=Re(v,r,i)-r}else s=i-r}return{start:r,count:s}}function am(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,lm=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*ne/n)),cm=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*ne/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*oe)+1,easeOutSine:e=>Math.sin(e*oe),easeInOutSine:e=>-.5*(Math.cos(Pt*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:lm(e,.075,.3),easeOutElastic:e=>Oa(e)?e:cm(e,.075,.3),easeInOutElastic(e){return Oa(e)?e:e<.5?.5*lm(e*2,.1125,.45):.5+.5*cm(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 ou(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Aa(e){return ou(e)?e:new qs(e)}function au(e){return ou(e)?e:new qs(e).saturate(.5).darken(.1).hexString()}const eC=["x","y","borderWidth","radius","tension"],nC=["color","borderColor","backgroundColor"];function iC(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:nC},numbers:{type:"number",properties:eC}}),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 rC(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const um=new Map;function sC(e,t){t=t||{};const n=e+JSON.stringify(t);let i=um.get(n);return i||(i=new Intl.NumberFormat(e,t),um.set(n,i)),i}function Qs(e,t,n){return sC(t,n).format(e)}const dm={values(e){return jt(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=oC(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?dm.numeric.call(this,e,t,n):""}};function oC(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:dm};function aC(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),lu=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 cu(e,t,n){return typeof t=="string"?js(Js(e,t),n):js(Js(e,""),t)}class lC{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)=>au(r.backgroundColor),this.hoverBorderColor=(i,r)=>au(r.borderColor),this.hoverColor=(i,r)=>au(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 cu(this,t,n)}get(t){return Js(this,t)}describe(t,n){return cu(lu,t,n)}override(t,n){return cu(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 Nt(u)?Object.assign({},d,u):Ot(u,d)},set(u){this[l]=u}}})}apply(t){t.forEach(n=>n(this))}}var ae=new lC({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[iC,rC,aC]);function cC(e){return!e||kt(e.size)||kt(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 uC(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&&!jt(m))a=Ra(e,r,s,a,m);else if(jt(m))for(d=0,h=m.length;d<h;d++)g=m[d],g!=null&&!jt(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 fm(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function uu(e,t,n,i){hm(e,t,n,i,null)}function hm(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)*iu;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,ne):e.arc(n,i,v,0,ne),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-Pt,S-oe),e.arc(n+g,i-a,d,S-oe,S),e.arc(n+m,i+l,d,S,S+oe),e.arc(n-g,i+a,d,S+oe,S+Pt),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 dC(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 fC(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 hC(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),kt(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 pC(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 mC(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=jt(t)?t:[t],l=s.strokeWidth>0&&s.strokeColor!=="";let u,d;for(e.save(),e.font=r.string,hC(e,s),u=0;u<a.length;++u)d=a[u],s.backdrop&&mC(e,s.backdrop),l&&(s.strokeColor&&(e.strokeStyle=s.strokeColor),kt(s.strokeWidth)||(e.lineWidth=s.strokeWidth),e.strokeText(d,n,i,s.maxWidth)),e.fillText(d,n,i,s.maxWidth),pC(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*Pt,Pt,!0),e.lineTo(n,i+s-a.bottomLeft),e.arc(n+a.bottomLeft,i+s-a.bottomLeft,a.bottomLeft,Pt,oe,!0),e.lineTo(n+r-a.bottomRight,i+s),e.arc(n+r-a.bottomRight,i+s-a.bottomRight,a.bottomRight,oe,0,!0),e.lineTo(n+r,i+a.topRight),e.arc(n+r-a.topRight,i+a.topRight,a.topRight,0,-oe,!0),e.lineTo(n+a.topLeft,i)}const gC=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,yC=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function _C(e,t){const n=(""+e).match(gC);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 bC=e=>+e||0;function du(e,t){const n={},i=Nt(t),r=i?Object.keys(t):t,s=Nt(e)?i?a=>Ot(e[a],e[t[a]]):a=>e[a]:()=>e;for(const a of r)n[a]=bC(s(a));return n}function pm(e){return du(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Ei(e){return du(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Se(e){const t=pm(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function ce(e,t){e=e||{},t=t||ae.font;let n=Ot(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=Ot(e.style,t.style);i&&!(""+i).match(yC)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:Ot(e.family,t.family),lineHeight:_C(Ot(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:Ot(e.weight,t.weight),string:""};return r.string=cC(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 xC(e,t,n){const{min:i,max:r}=e,s=Gp(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 fu(e,t=[""],n,i,r=()=>e[0]){const s=n||e;typeof i>"u"&&(i=bm("_fallback",e));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:s,_fallback:i,_getTarget:r,override:l=>fu([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 gm(l,u,()=>CC(u,t,e,l))},getOwnPropertyDescriptor(l,u){return Reflect.getOwnPropertyDescriptor(l._scopes[0],u)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(l,u){return xm(l).includes(u)},ownKeys(l){return xm(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:mm(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 gm(s,a,()=>vC(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 mm(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:on(n)?n:()=>n,isIndexable:on(i)?i:()=>i}}const wC=(e,t)=>e?e+nu(t):t,hu=(e,t)=>Nt(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function gm(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const i=n();return e[t]=i,i}function vC(e,t,n){const{_proxy:i,_context:r,_subProxy:s,_descriptors:a}=e;let l=i[t];return on(l)&&a.isScriptable(t)&&(l=SC(t,l,e,n)),jt(l)&&l.length&&(l=TC(t,l,e,a.isIndexable)),hu(t,l)&&(l=jr(l,r,s&&s[t],a)),l}function SC(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),hu(e,u)&&(u=pu(r._scopes,r,e,u)),u}function TC(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(Nt(t[0])){const u=t,d=r._scopes.filter(h=>h!==u);t=[];for(const h of u){const m=pu(d,r,e,h);t.push(jr(m,s,a&&a[e],l))}}return t}function ym(e,t,n){return on(e)?e(t,n):e}const kC=(e,t)=>e===!0?t:typeof e=="string"?Ci(t,e):void 0;function MC(e,t,n,i,r){for(const s of t){const a=kC(n,s);if(a){e.add(a);const l=ym(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 pu(e,t,n,i){const r=t._rootScopes,s=ym(t._fallback,n,i),a=[...e,...r],l=new Set;l.add(i);let u=_m(l,a,n,s||n,i);return u===null||typeof s<"u"&&s!==n&&(u=_m(l,a,s,u,i),u===null)?!1:fu(Array.from(l),[""],r,s,()=>DC(t,n,i))}function _m(e,t,n,i,r){for(;n;)n=MC(e,t,n,i,r);return n}function DC(e,t,n){const i=e._getTarget();t in i||(i[t]={});const r=i[t];return jt(r)&&Nt(n)?n:r||{}}function CC(e,t,n,i){let r;for(const s of t)if(r=bm(wC(s,e),n),typeof r<"u")return hu(e,r)?pu(n,i,e,r):r}function bm(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function xm(e){let t=e._keys;return t||(t=e._keys=OC(e._scopes)),t}function OC(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 wm(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 AC=Number.EPSILON||1e-14,Gr=(e,t)=>t<e.length&&!e[t].skip&&e[t],vm=e=>e==="x"?"y":"x";function EC(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 RC(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,AC)){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 PC(e,t,n="x"){const i=vm(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 IC(e,t="x"){const n=vm(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]}RC(e,r,s),PC(e,s,t)}function Pa(e,t,n){return Math.max(Math.min(e,n),t)}function LC(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 NC(e,t,n,i,r){let s,a,l,u;if(t.spanGaps&&(e=e.filter(d=>!d.skip)),t.cubicInterpolationMode==="monotone")IC(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=EC(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&&LC(e,n)}function mu(){return typeof window<"u"&&typeof document<"u"}function gu(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 BC(e,t){return La(e).getPropertyValue(t)}const FC=["top","right","bottom","left"];function dr(e,t,n){const i={};n=n?"-"+n:"";for(let r=0;r<4;r++){const s=FC[r];i[s]=parseFloat(e[t+"-"+s+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const zC=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function UC(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:r,offsetY:s}=i;let a=!1,l,u;if(zC(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}=UC(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 HC(e,t,n){let i,r;if(t===void 0||n===void 0){const s=e&&gu(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 WC(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=HC(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 Sm(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 $C=(function(){let e=!1;try{const t={get passive(){return e=!0,!1}};mu()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();function Tm(e,t){const n=BC(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 VC(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 YC(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 qC=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}}},jC=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?qC(t,n):jC()}function km(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 Mm(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function Dm(e){return e==="angle"?{between:Xs,compare:GD,normalize:We}:{between:si,compare:(t,n)=>t-n,normalize:t=>t}}function Cm({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 GC(e,t,n){const{property:i,start:r,end:s}=n,{between:a,normalize:l}=Dm(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 Om(e,t,n){if(!n)return[e];const{property:i,start:r,end:s}=n,a=t.length,{compare:l,between:u,normalize:d}=Dm(i),{start:h,end:m,loop:g,style:_}=GC(e,t,n),x=[];let v=!1,S=null,O,A,P;const L=()=>u(r,P,O)&&l(r,P)!==0,R=()=>l(s,O)===0||u(s,P,O),F=()=>v||L(),U=()=>!v||R();for(let D=h,w=h;D<=m;++D)A=t[D%a],!A.skip&&(O=d(A[i]),O!==P&&(v=u(O,r,s),S===null&&F()&&(S=l(O,r)===0?D:w),S!==null&&U()&&(x.push(Cm({start:S,end:D,loop:g,count:a,style:_})),S=null),w=D,P=O));return S!==null&&x.push(Cm({start:S,end:m,loop:g,count:a,style:_})),x}function Am(e,t){const n=[],i=e.segments;for(let r=0;r<i.length;r++){const s=Om(i[r],e.points,t);s.length&&n.push(...s)}return n}function KC(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 XC(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 ZC(e,t){const n=e.points,i=e.options.spanGaps,r=n.length;if(!r)return[];const s=!!e._loop,{start:a,end:l}=KC(n,r,s,i);if(i===!0)return Em(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 Em(e,XC(n,a,u,d),n,t)}function Em(e,t,n,i){return!i||!i.setContext||!n?t:QC(e,t,n,i)}function QC(e,t,n,i){const r=e._chart.getContext(),s=Rm(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,O){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:O}),h=O,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 O=n[g%u];S=Rm(i.setContext(Ri(r,{type:"segment",p0:v,p1:O,p0DataIndex:(g-1)%u,p1DataIndex:g%u,datasetIndex:a}))),JC(S,h)&&_(m,g-1,x.loop,h),v=O,h=S}m<g-1&&_(m,g-1,x.loop,h)}return d}function Rm(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function JC(e,t){if(!t)return!1;const n=[],i=function(r,s){return ou(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 tO(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 Pm(e,t){const n=t._clip;if(n.disabled)return!1;const i=tO(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 eO{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=rm.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 eO;const Im="transparent",nO={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=Aa(e||Im),r=i.valid&&Aa(t||Im);return r&&r.valid?r.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class iO{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||nO[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 yu{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Nt(t))return;const n=Object.keys(ae.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{const s=t[r];if(!Nt(s))return;const a={};for(const l of n)a[l]=s[l];(jt(s.properties)&&s.properties||[r]).forEach(l=>{(l===r||!i.has(l))&&i.set(l,a)})})}_animateOptions(t,n){const i=n.options,r=sO(t,i);if(!r)return[];const s=this._createAnimations(r,i);return i.$shared&&rO(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 iO(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 rO(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 sO(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 Lm(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 oO(e,t,n){if(n===!1)return!1;const i=Lm(e,n),r=Lm(t,n);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}function aO(e){let t,n,i,r;return Nt(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 Nm(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 Bm(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 lO(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 _u(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function cO(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function uO(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 dO(e,t,n){const i=e[t]||(e[t]={});return i[n]||(i[n]={})}function Fm(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 zm(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=cO(s,a,i),m=t.length;let g;for(let _=0;_<m;++_){const x=t[_],{[u]:v,[d]:S}=x,O=x._stacks||(x._stacks={});g=O[d]=dO(r,h,v),g[l]=S,g._top=Fm(g,a,!0,i.type),g._bottom=Fm(g,a,!1,i.type);const A=g._visualValues||(g._visualValues={});A[l]=S}}function bu(e,t){const n=e.scales;return Object.keys(n).filter(i=>n[i].axis===t).shift()}function fO(e,t){return Ri(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function hO(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 xu=e=>e==="reset"||e==="none",Um=(e,t)=>t?e:Object.assign({},e),pO=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Nm(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=_u(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=Ot(i.xAxisID,bu(t,"x")),a=n.yAxisID=Ot(i.yAxisID,bu(t,"y")),l=n.rAxisID=Ot(i.rAxisID,bu(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&&nm(this._data,this),t._stacked&&io(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(Nt(n)){const r=this._cachedMeta;this._data=lO(n,r)}else if(i!==n){if(i){nm(i,this);const r=this._cachedMeta;io(r),r._parsed=[]}n&&Object.isExtensible(n)&&QD(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=_u(n.vScale,n),n.stack!==i.stack&&(r=!0,io(n),n.stack=i.stack),this._resyncElements(t),(r||s!==n._stacked)&&(zm(this,n._parsed),n._stacked=_u(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{jt(r[t])?g=this.parseArrayData(i,r,t,n):Nt(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&&zm(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:Nm(r,!0),values:n._stacks[t.axis]._visualValues};return Bm(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=Bm(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=pO(n,i,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:m}=uO(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=aO(Ot(this.options.clip,oO(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=hO(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=fO(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&&sn(i);if(l)return Um(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(ae.elements[t]),x=()=>this.getContext(i,r,n),v=d.resolveNamedOptions(g,_,x,m);return v.$shared&&(v.$shared=u,s[a]=Object.freeze(Um(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 yu(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||xu(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){xu(r)?Object.assign(t,i):this._resolveAnimations(n,r).update(t,i)}updateSharedOptions(t,n,i){t&&!xu(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 mO(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=im(i.sort((r,s)=>r-s))}return e._cache.$bar}function gO(e){const t=e.iScale,n=mO(t,e.type);let i=t._length,r,s,a,l;const u=()=>{a===32767||a===-32768||(sn(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 yO(e,t,n,i){const r=n.barThickness;let s,a;return kt(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 _O(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 bO(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 Hm(e,t,n,i){return jt(e)?bO(e,t,n,i):t[n.axis]=n.parse(e,i),t}function Wm(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(Hm(g,m,s,d));return u}function wu(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function xO(e,t,n){return e!==0?jn(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function wO(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 vO(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}=wO(e);r==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===i?r=d:(n._bottom||0)===i?r=h:(s[$m(h,a,l,u)]=!0,r=d)),s[$m(r,a,l,u)]=!0,e.borderSkipped=s}function $m(e,t,n,i){return i?(e=SO(e,t,n),e=Vm(e,n,t)):e=Vm(e,t,n),e}function SO(e,t,n){return e===t?n:e===n?t:e}function Vm(e,t,n){return e==="start"?t:e==="end"?n:e}function TO(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class Ym 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 Wm(t,n,i,r)}parseArrayData(t,n,i,r){return Wm(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(Hm(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=wu(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||kt(x[l.axis])?{base:u,head:u}:this._calculateBarValuePixels(_),S=this._calculateBarIndexPixels(_,h),O=(x._stacks||{})[l.axis],A={horizontal:d,base:v.base,enableBorderRadius:!O||wu(x._custom)||a===O._top||a===O._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 P=A.options||t[_].options;vO(A,P,O,a),TO(A,P,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(kt(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[Ot(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||gO(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=wu(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=!kt(s)&&!h?s:g;let O=n.getPixelForValue(S);if(this.chart.getDataVisibility(t)?x=n.getPixelForValue(g+_):x=O,v=x-O,Math.abs(v)<a){v=xO(v,n,l)*a,m===l&&(O-=v/2);const A=n.getPixelForDecimal(0),P=n.getPixelForDecimal(1),L=Math.min(A,P),R=Math.max(A,P);O=Math.max(Math.min(O,R),L),x=O+v,i&&!h&&(u._stacks[n.axis]._visualValues[r]=n.getValueForPixel(x)-n.getValueForPixel(O))}if(O===n.getPixelForValue(l)){const A=jn(v)*n.getLineWidthForValue(l)/2;O+=A,v-=A}return{size:v,base:O,head:x,center:x+v/2}}_calculateBarIndexPixels(t,n){const i=n.scale,r=this.options,s=r.skipNull,a=Ot(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"?_O(t,n,r,h*d):yO(t,n,r,h*d),g=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,_=this._getAxis().indexOf(Ot(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 kO 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=Ot(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=Ot(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]),O=v[m]=s?l.getBasePixel():l.getPixelForValue(x[m]);v.skip=isNaN(S)||isNaN(O),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+=Ot(i&&i._custom,s),r}}function MO(e,t,n){let i=1,r=1,s=0,a=0;if(t<ne){const l=e,u=l+t,d=Math.cos(l),h=Math.sin(l),m=Math.cos(u),g=Math.sin(u),_=(P,L,R)=>Xs(P,l,u,!0)?1:Math.max(L,L*n,R,R*n),x=(P,L,R)=>Xs(P,l,u,!0)?-1:Math.min(L,L*n,R,R*n),v=_(0,d,m),S=_(oe,h,g),O=x(Pt,d,m),A=x(Pt+oe,h,g);i=(v-O)/2,r=(S-A)/2,s=-(v+O)/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(Nt(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=ne,n=-ne;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(FD(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:h,rotation:m}=this._getRotationExtents(),{ratioX:g,ratioY:_,offsetX:x,offsetY:v}=MO(m,h,u),S=(i.width-a)/g,O=(i.height-a)/_,A=Math.max(Math.min(S,O)/2,0),P=Gp(this.options.radius,A),L=Math.max(P*u,0),R=(P-L)/this._getVisibleDatasetWeightTotal();this.offsetX=x*P,this.offsetY=v*P,r.total=this.calculateTotal(),this.outerRadius=P-R*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-R*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/ne)}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 O=this._getRotation(),A;for(A=0;A<n;++A)O+=this._circumference(A,s);for(A=n;A<n+i;++A){const P=this._circumference(A,s),L=t[A],R={x:h+this.offsetX,y:m+this.offsetY,startAngle:O,endAngle:O+P,circumference:P,outerRadius:x,innerRadius:_};S&&(R.options=v||this.resolveDataElementOptions(A,L.active?"active":r)),O+=P,this.updateElement(L,A,R,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)?ne*(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(Ot(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class qm 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}=om(n,r,a);this._drawStart=l,this._drawCount=u,am(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,O=this.chart._animationsDisabled||s||r==="none",A=n+i,P=t.length;let L=n>0&&this.getParsed(n-1);for(let R=0;R<P;++R){const F=t[R],U=O?F:{};if(R<n||R>=A){U.skip=!0;continue}const D=this.getParsed(R),w=kt(D[_]),C=U[g]=a.getPixelForValue(D[g],R),N=U[_]=s||w?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,D,u):D[_],R);U.skip=isNaN(C)||isNaN(N)||w,U.stop=R>0&&Math.abs(D[g]-L[g])>S,v&&(U.parsed=D,U.raw=d.data[R]),m&&(U.options=h||this.resolveDataElementOptions(R,F.active?"active":r)),O||this.updateElement(F,R,U,r),L=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 jm 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 wm.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*Pt;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 O=_,A=_+this._computeAngle(x,r,v),P=a.getDataVisibility(x)?d.getDistanceFromCenterForValue(this.getParsed(x).r):0;_=A,s&&(u.animateScale&&(P=0),u.animateRotate&&(O=A=g));const L={x:h,y:m,innerRadius:0,outerRadius:P,startAngle:O,endAngle:A,options:this.resolveDataElementOptions(x,S.active?"active":r)};this.updateElement(S,x,L,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 DO extends ro{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class CO 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 wm.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 Gm 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}=om(n,i,r);if(this._drawStart=s,this._drawCount=a,am(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,O=Ai(v)?v:Number.POSITIVE_INFINITY,A=this.chart._animationsDisabled||s||r==="none";let P=n>0&&this.getParsed(n-1);for(let L=n;L<n+i;++L){const R=t[L],F=this.getParsed(L),U=A?R:{},D=kt(F[x]),w=U[_]=a.getPixelForValue(F[_],L),C=U[x]=s||D?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,F,u):F[x],L);U.skip=isNaN(w)||isNaN(C)||D,U.stop=L>0&&Math.abs(F[_]-P[_])>O,S&&(U.parsed=F,U.raw=d.data[L]),g&&(U.options=m||this.resolveDataElementOptions(L,R.active?"active":r)),A||this.updateElement(R,L,U,r),P=F}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 OO=Object.freeze({__proto__:null,BarController:Ym,BubbleController:kO,DoughnutController:ro,LineController:qm,PieController:DO,PolarAreaController:jm,RadarController:CO,ScatterController:Gm});function hr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class vu{static override(t){Object.assign(vu.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 Km={_date:vu};function AO(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?XD: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=>!kt(v[m.axis]));h.lo-=Math.max(0,_);const x=g.slice(h.hi).findIndex(v=>!kt(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}=AO(s[l],t,a,r);for(let _=m;_<=g;++_){const x=h[_];x.skip||i(x,d,_)}}}function EO(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 Su(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 RO(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 PO(e,t,n,i,r,s){let a=[];const l=EO(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 Tu(e,t,n,i,r,s){return!s&&!e.isPointInArea(t)?[]:n==="r"&&!i?RO(e,t,n,r):PO(e,t,n,i,r,s)}function Xm(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 ku={evaluateInteractionItems:so,modes:{index(e,t,n,i){const r=Pi(t,e),s=n.axis||"x",a=n.includeInvisible||!1,l=n.intersect?Su(e,r,s,i,a):Tu(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?Su(e,r,s,i,a):Tu(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 Su(e,r,s,i,a)},nearest(e,t,n,i){const r=Pi(t,e),s=n.axis||"xy",a=n.includeInvisible||!1;return Tu(e,r,s,n.intersect,i,a)},x(e,t,n,i){const r=Pi(t,e);return Xm(e,r,"x",n.intersect,i)},y(e,t,n,i){const r=Pi(t,e);return Xm(e,r,"y",n.intersect,i)}}};const Zm=["left","top","right","bottom"];function oo(e,t){return e.filter(n=>n.pos===t)}function Qm(e,t){return e.filter(n=>Zm.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 IO(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 LO(e){const t={};for(const n of e){const{stack:i,pos:r,stackWeight:s}=n;if(!i||!Zm.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 NO(e,t){const n=LO(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 BO(e){const t=IO(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=Qm(t,"x"),u=Qm(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 Jm(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function tg(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 FO(e,t,n,i){const{pos:r,box:s}=n,a=e.maxPadding;if(!Nt(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&&tg(a,s.getPadding());const l=Math.max(0,t.outerWidth-Jm(a,e,"left","right")),u=Math.max(0,t.outerHeight-Jm(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 zO(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 UO(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,UO(l.horizontal,t));const{same:m,other:g}=FO(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 eg(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;sn(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;sn(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=BO(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);tg(g,Se(i));const _=Object.assign({maxPadding:g,w:s,h:a,x:r.left,y:r.top},r),x=NO(u.concat(d),m);lo(l.fullSize,_,m,x),lo(u,_,m,x),lo(d,_,m,x)&&lo(u,_,m,x),zO(_),eg(l.leftAndTop,_,m,x),_.x+=_.w,_.y+=_.h,eg(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 ng{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 HO extends ng{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Fa="$chartjs",WO={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ig=e=>e===null||e==="";function $O(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",ig(r)){const s=Tm(e,"width");s!==void 0&&(e.width=s)}if(ig(i))if(e.style.height==="")e.height=e.width/(t||2);else{const s=Tm(e,"height");s!==void 0&&(e.height=s)}return e}const rg=$C?{passive:!0}:!1;function VO(e,t,n){e&&e.addEventListener(t,n,rg)}function YO(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,rg)}function qO(e,t){const n=WO[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 jO(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 GO(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 sg=0;function og(){const e=window.devicePixelRatio;e!==sg&&(sg=e,co.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function KO(e,t){co.size||window.addEventListener("resize",og),co.set(e,t)}function XO(e){co.delete(e),co.size||window.removeEventListener("resize",og)}function ZO(e,t,n){const i=e.canvas,r=i&&gu(i);if(!r)return;const s=sm((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),KO(e,s),a}function Mu(e,t,n){n&&n.disconnect(),t==="resize"&&XO(e)}function QO(e,t,n){const i=e.canvas,r=sm(s=>{e.ctx!==null&&n(qO(s,e))},e);return VO(i,t,r),r}class JO extends ng{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?($O(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];kt(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:jO,detach:GO,resize:ZO}[n]||QO;r[n]=a(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),r=i[n];if(!r)return;({attach:Mu,detach:Mu,resize:Mu}[n]||YO)(t,n,r),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,r){return WC(t,n,i,r)}isAttached(t){const n=t&&gu(t);return!!(n&&n.isConnected)}}function tA(e){return!mu()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?HO:JO}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 eA(e,t){const n=e.options.ticks,i=nA(e),r=Math.min(n.maxTicksLimit||i,i),s=n.major.enabled?rA(t):[],a=s.length,l=s[0],u=s[a-1],d=[];if(a>r)return sA(t,d,s,a/r),d;const h=iA(s,t,r);if(a>0){let m,g;const _=a>1?Math.round((u-l)/(a-1)):null;for(Ua(t,d,h,kt(_)?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,kt(_)?t.length:u+_),d}return Ua(t,d,h),d}function nA(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 iA(e,t,n){const i=oA(e),r=t.length/n;if(!i)return Math.max(r,1);const s=YD(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 rA(e){const t=[];let n,i;for(n=0,i=e.length;n<i;n++)e[n].major&&t.push(n);return t}function sA(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=Ot(i,0),a=Math.min(Ot(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 oA(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 aA=e=>e==="left"?"right":e==="right"?"left":e,ag=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,lg=(e,t)=>Math.min(t||e,e);function cg(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 lA(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 cA(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 ug(e,t){if(!e.display)return 0;const n=ce(e.font,t),i=Se(e.padding);return(jt(e.text)?e.text.length:1)*n.lineHeight+i.height}function uA(e,t){return Ri(e,{scale:t,type:"scale"})}function dA(e,t,n){return Ri(e,{tick:n,index:t,type:"tick"})}function fA(e,t,n){let i=su(e);return(n&&t!=="right"||!n&&t==="right")&&(i=aA(i)),i}function hA(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),Nt(n)){const O=Object.keys(n)[0],A=n[O];x=h[O].getPixelForValue(A)+v-t}else n==="center"?x=(d.bottom+d.top)/2+v-t:x=ag(e,n,t);g=l-s}else{if(Nt(n)){const O=Object.keys(n)[0],A=n[O];_=h[O].getPixelForValue(A)-S+t}else n==="center"?_=(d.left+d.right)/2-S+t:_=ag(e,n,t);x=$e(i,a,r),m=n==="left"?-oe:oe}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=xC(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const u=l<this.ticks.length;this._convertTicksToLabels(u?cg(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=eA(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=lg(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-ug(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=ug(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 O=i.mirror?0:S*m.width+v*g.height;t.height=Math.min(this.maxHeight,t.height+O+_)}else{const O=i.mirror?0:v*m.width+S*g.height;t.width=Math.min(this.maxWidth,t.width+O+_)}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++)kt(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=cg(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/lg(n,i));let d=0,h=0,m,g,_,x,v,S,O,A,P,L,R;for(m=0;m<n;m+=u){if(x=t[m].label,v=this._resolveTickFontOptions(m),r.font=S=v.string,O=s[S]=s[S]||{data:{},gc:[]},A=v.lineHeight,P=L=0,!kt(x)&&!jt(x))P=Ra(r,O.data,O.gc,P,x),L=A;else if(jt(x))for(g=0,_=x.length;g<_;++g)R=x[g],!kt(R)&&!jt(R)&&(P=Ra(r,O.data,O.gc,P,R),L+=A);a.push(P),l.push(L),d=Math.max(P,d),h=Math.max(L,h)}cA(s,n);const F=a.indexOf(d),U=l.indexOf(h),D=w=>({width:a[w]||0,height:l[w]||0});return{first:D(0),last:D(n-1),widest:D(F),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 KD(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=dA(this.getContext(),t,i))}return this.$context||(this.$context=uA(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,O=function(ut){return cr(i,ut,v)};let A,P,L,R,F,U,D,w,C,N,$,V;if(a==="top")A=O(this.bottom),U=this.bottom-g,w=A-S,N=O(t.top)+S,V=t.bottom;else if(a==="bottom")A=O(this.top),N=t.top,V=O(t.bottom)-S,U=A+S,w=this.top+g;else if(a==="left")A=O(this.right),F=this.right-g,D=A-S,C=O(t.left)+S,$=t.right;else if(a==="right")A=O(this.left),C=t.left,$=O(t.right)-S,F=A+S,D=this.left+g;else if(n==="x"){if(a==="center")A=O((t.top+t.bottom)/2+.5);else if(Nt(a)){const ut=Object.keys(a)[0],ct=a[ut];A=O(this.chart.scales[ut].getPixelForValue(ct))}N=t.top,V=t.bottom,U=A+S,w=U+g}else if(n==="y"){if(a==="center")A=O((t.left+t.right)/2);else if(Nt(a)){const ut=Object.keys(a)[0],ct=a[ut];A=O(this.chart.scales[ut].getPixelForValue(ct))}F=A-S,D=F-g,C=t.left,$=t.right}const st=Ot(r.ticks.maxTicksLimit,m),dt=Math.max(1,Math.ceil(m/st));for(P=0;P<m;P+=dt){const ut=this.getContext(P),ct=s.setContext(ut),Tt=l.setContext(ut),at=ct.lineWidth,pt=ct.color,G=Tt.dash||[],B=Tt.dashOffset,z=ct.tickWidth,Z=ct.tickColor,it=ct.tickBorderDash||[],ht=ct.tickBorderDashOffset;L=lA(this,P,u),L!==void 0&&(R=cr(i,L,at),d?F=D=C=$=R:U=w=N=V=R,_.push({tx1:F,ty1:U,tx2:D,ty2:w,x1:C,y1:N,x2:$,y2:V,width:at,color:pt,borderDash:G,borderDashOffset:B,tickWidth:z,tickColor:Z,tickBorderDash:it,tickBorderDashOffset:ht}))}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 O,A,P,L,R,F,U,D,w,C,N,$,V="middle";if(r==="top")F=this.bottom-x,U=this._getXAxisLabelAlignment();else if(r==="bottom")F=this.top+x,U=this._getXAxisLabelAlignment();else if(r==="left"){const dt=this._getYAxisLabelAlignment(g);U=dt.textAlign,R=dt.x}else if(r==="right"){const dt=this._getYAxisLabelAlignment(g);U=dt.textAlign,R=dt.x}else if(n==="x"){if(r==="center")F=(t.top+t.bottom)/2+_;else if(Nt(r)){const dt=Object.keys(r)[0],ut=r[dt];F=this.chart.scales[dt].getPixelForValue(ut)+_}U=this._getXAxisLabelAlignment()}else if(n==="y"){if(r==="center")R=(t.left+t.right)/2-_;else if(Nt(r)){const dt=Object.keys(r)[0],ut=r[dt];R=this.chart.scales[dt].getPixelForValue(ut)}U=this._getYAxisLabelAlignment(g).textAlign}n==="y"&&(u==="start"?V="top":u==="end"&&(V="bottom"));const st=this._getLabelSizes();for(O=0,A=l.length;O<A;++O){P=l[O],L=P.label;const dt=s.setContext(this.getContext(O));D=this.getPixelForTick(O)+s.labelOffset,w=this._resolveTickFontOptions(O),C=w.lineHeight,N=jt(L)?L.length:1;const ut=N/2,ct=dt.color,Tt=dt.textStrokeColor,at=dt.textStrokeWidth;let pt=U;a?(R=D,U==="inner"&&(O===A-1?pt=this.options.reverse?"left":"right":O===0?pt=this.options.reverse?"right":"left":pt="center"),r==="top"?d==="near"||v!==0?$=-N*C+C/2:d==="center"?$=-st.highest.height/2-ut*C+C:$=-st.highest.height+C/2:d==="near"||v!==0?$=C/2:d==="center"?$=st.highest.height/2-ut*C:$=st.highest.height-N*C,m&&($*=-1),v!==0&&!dt.showLabelBackdrop&&(R+=C/2*Math.sin(v))):(F=D,$=(1-N)*C/2);let G;if(dt.showLabelBackdrop){const B=Se(dt.backdropPadding),z=st.heights[O],Z=st.widths[O];let it=$-B.top,ht=0-B.left;switch(V){case"middle":it-=z/2;break;case"bottom":it-=z;break}switch(U){case"center":ht-=Z/2;break;case"right":ht-=Z;break;case"inner":O===A-1?ht-=Z:O>0&&(ht-=Z/2);break}G={left:ht,top:it,width:Z+B.width,height:z+B.height,color:dt.backdropColor}}S.push({label:L,font:w,textOffset:$,options:{rotation:v,color:ct,strokeColor:Tt,strokeWidth:at,textAlign:pt,textBaseline:V,translation:[R,F],backdrop:G}})}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"||Nt(n)?(u+=a.bottom,jt(i.text)&&(u+=s.lineHeight*(i.text.length-1))):u+=a.top;const{titleX:d,titleY:h,maxWidth:m,rotation:g}=hA(this,u,n,l);ur(t,i.text,0,0,s,{color:i.color,maxWidth:m,rotation:g,textAlign:fA(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=Ot(t.grid&&t.grid.z,-1),r=Ot(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;gA(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,pA(t,a,i),this.override&&ae.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 ae[r]&&(delete ae[r][i],this.override&&delete lr[i])}}function pA(e,t,n){const i=js(Object.create(null),[n?ae.get(n):{},ae.get(t),e.defaults]);ae.set(t,i),e.defaultRoutes&&mA(t,e.defaultRoutes),e.descriptors&&ae.describe(t,e.descriptors)}function mA(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(".");ae.route(s,r,u,l)})}function gA(e){return"id"in e&&"defaults"in e}class yA{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=nu(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 yA;class _A{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(){kt(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=Ot(i.options&&i.options.plugins,{}),s=bA(i);return r===!1&&!n?[]:wA(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 bA(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 xA(e,t){return!t&&e===!1?null:e===!0?{}:e}function wA(e,{plugins:t,localIds:n},i,r){const s=[],a=e.getContext();for(const l of t){const u=l.id,d=xA(i[u],r);d!==null&&s.push({plugin:l,options:vA(e.config,{plugin:l,local:n[u]},d,a)})}return s}function vA(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 Du(e,t){const n=ae.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function SA(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function TA(e,t){return e===t?"_index_":"_value_"}function dg(e){if(e==="x"||e==="y"||e==="r")return e}function kA(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Cu(e,...t){if(dg(e))return e;for(const n of t){const i=n.axis||kA(n.position)||e.length>1&&dg(e[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function fg(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function MA(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 fg(e,"x",n[0])||fg(e,"y",n[0])}return{}}function DA(e,t){const n=lr[e.type]||{scales:{}},i=t.scales||{},r=Du(e.type,t),s=Object.create(null);return Object.keys(i).forEach(a=>{const l=i[a];if(!Nt(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=Cu(a,l,MA(a,e),ae.scales[l.type]),d=TA(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||Du(l,t),h=(lr[l]||{}).scales||{};Object.keys(h).forEach(m=>{const g=SA(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,[ae.scales[l.type],ae.scale])}),s}function hg(e){const t=e.options||(e.options={});t.plugins=Ot(t.plugins,{}),t.scales=DA(e,t)}function pg(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function CA(e){return e=e||{},e.data=pg(e.data),hg(e),e}const mg=new Map,gg=new Set;function Wa(e,t){let n=mg.get(e);return n||(n=t(),mg.set(e,n),gg.add(n)),n}const fo=(e,t,n)=>{const i=Ci(t,n);i!==void 0&&e.add(i)};class OA{constructor(t){this._config=CA(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=pg(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(),hg(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,ae,m)),h.forEach(m=>fo(u,lu,m))});const d=Array.from(u);return d.length===0&&d.push(Object.create(null)),gg.has(n)&&a.set(n,d),d}chartOptionScopes(){const{options:t,type:n}=this;return[t,lr[n]||{},ae.datasets[n]||{},{type:n},ae,lu]}resolveNamedOptions(t,n,i,r=[""]){const s={$shared:!0},{resolver:a,subPrefixes:l}=yg(this._resolverCache,t,r);let u=a;if(EA(a,n)){s.$shared=!1,i=on(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}=yg(this._resolverCache,t,i);return Nt(n)?jr(s,n,void 0,r):s}}function yg(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:fu(t,n),subPrefixes:n.filter(l=>!l.toLowerCase().includes("hover"))},i.set(r,s)),s}const AA=e=>Nt(e)&&Object.getOwnPropertyNames(e).some(t=>on(e[t]));function EA(e,t){const{isScriptable:n,isIndexable:i}=mm(e);for(const r of t){const s=n(r),a=i(r),l=(a||s)&&e[r];if(s&&(on(l)||AA(l))||a&&jt(l))return!0}return!1}var RA="4.5.1";const PA=["top","bottom","left","right","chartArea"];function _g(e,t){return e==="top"||e==="bottom"||PA.indexOf(e)===-1&&t==="x"}function bg(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function xg(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Jt(n&&n.onComplete,[e],t)}function IA(e){const t=e.chart,n=t.options.animation;Jt(n&&n.onProgress,[e],t)}function wg(e){return mu()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const $a={},vg=e=>{const t=wg(e);return Object.values($a).filter(n=>n.canvas===t).pop()};function LA(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 NA(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}let an=class{static defaults=ae;static instances=$a;static overrides=lr;static registry=Gn;static version=RA;static getChart=vg;static register(...t){Gn.add(...t),Sg()}static unregister(...t){Gn.remove(...t),Sg()}constructor(t,n){const i=this.config=new OA(n),r=wg(t),s=vg(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||tA(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=BD(),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 _A,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=JD(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",xg),li.listen(this,"progress",IA),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:r,_aspectRatio:s}=this;return kt(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():Sm(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return fm(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,Sm(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=Cu(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=Cu(u,l),h=Ot(l.type,a.dtype);(l.position===void 0||_g(l.position,d)!==_g(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(bg("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||Du(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}=ae.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(bg("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);(!Zp(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;LA(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(!Zp(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,on(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(),xg({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=Pm(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=ku.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);sn(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(),fm(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=$D(t),d=NA(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 Sg(){return te(an.instances,e=>e._plugins.invalidate())}function BA(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-Pt/2,i+Pt/2,!0);else if(h==="bevel"){const _=2*g*g,x=-_*Math.cos(n+Pt/2)+r,v=-_*Math.sin(n+Pt/2)+s,S=_*Math.cos(i+Pt/2)+r,O=_*Math.sin(i+Pt/2)+s;e.lineTo(x,v),e.lineTo(S,O)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function FA(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+oe,i-oe),e.closePath(),e.clip()}function zA(e){return du(e,["outerStart","outerEnd","innerStart","innerEnd"])}function UA(e,t,n,i){const r=zA(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 dt=h>0?h-i:0,ut=m>0?m-i:0,ct=(dt+ut)/2,Tt=ct!==0?x*ct/(ct+i):x;_=(x-Tt)/2}const v=Math.max(.001,x*m-n/Pt)/m,S=(x-v)/2,O=u+S+_,A=r-S-_,{outerStart:P,outerEnd:L,innerStart:R,innerEnd:F}=UA(t,g,m,A-O),U=m-P,D=m-L,w=O+P/U,C=A-L/D,N=g+R,$=g+F,V=O+R/N,st=A-F/$;if(e.beginPath(),s){const dt=(w+C)/2;if(e.arc(a,l,m,w,dt),e.arc(a,l,m,dt,C),L>0){const at=Xr(D,C,a,l);e.arc(at.x,at.y,L,C,A+oe)}const ut=Xr($,A,a,l);if(e.lineTo(ut.x,ut.y),F>0){const at=Xr($,st,a,l);e.arc(at.x,at.y,F,A+oe,st+Math.PI)}const ct=(A-F/g+(O+R/g))/2;if(e.arc(a,l,g,A-F/g,ct,!0),e.arc(a,l,g,ct,O+R/g,!0),R>0){const at=Xr(N,V,a,l);e.arc(at.x,at.y,R,V+Math.PI,O-oe)}const Tt=Xr(U,O,a,l);if(e.lineTo(Tt.x,Tt.y),P>0){const at=Xr(U,w,a,l);e.arc(at.x,at.y,P,O-oe,w)}}else{e.moveTo(a,l);const dt=Math.cos(w)*m+a,ut=Math.sin(w)*m+l;e.lineTo(dt,ut);const ct=Math.cos(C)*m+a,Tt=Math.sin(C)*m+l;e.lineTo(ct,Tt)}e.closePath()}function HA(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%ne||ne))}return Va(e,t,n,i,u,r),e.fill(),u}function WA(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%ne||ne))}x&&FA(e,t,v),u.selfJoin&&v-a>=Pt&&_===0&&h!=="miter"&&BA(e,t,v),s||(Va(e,t,n,i,v,r),e.stroke())}class $A 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,_=Ot(m,u-l),x=Xs(s,l,u)&&l!==u,v=_>=ne||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>ne?Math.floor(i/ne):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(Pt,i||0)),d=r*u;t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,HA(t,this,d,s,a),WA(t,this,d,s,a),t.restore()}}function Tg(e,t,n=t){e.lineCap=Ot(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Ot(n.borderDash,t.borderDash)),e.lineDashOffset=Ot(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Ot(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Ot(n.borderWidth,t.borderWidth),e.strokeStyle=Ot(n.borderColor,t.borderColor)}function VA(e,t,n){e.lineTo(n.x,n.y)}function YA(e){return e.stepped?dC:e.tension||e.cubicInterpolationMode==="monotone"?fC:VA}function kg(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 qA(e,t,n,i){const{points:r,options:s}=t,{count:a,start:l,loop:u,ilen:d}=kg(r,n,i),h=YA(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 jA(e,t,n,i){const r=t.points,{count:s,start:a,ilen:l}=kg(r,n,i),{move:u=!0,reverse:d}=i||{};let h=0,m=0,g,_,x,v,S,O;const A=L=>(a+(d?l-L:L))%s,P=()=>{v!==S&&(e.lineTo(h,S),e.lineTo(h,v),e.lineTo(h,O))};for(u&&(_=r[A(0)],e.moveTo(_.x,_.y)),g=0;g<=l;++g){if(_=r[A(g)],_.skip)continue;const L=_.x,R=_.y,F=L|0;F===x?(R<v?v=R:R>S&&(S=R),h=(m*h+L)/++m):(P(),e.lineTo(L,R),x=F,m=0,v=S=R),O=R}P()}function Ou(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?jA:qA}function GA(e){return e.stepped?VC:e.tension||e.cubicInterpolationMode==="monotone"?YC:fr}function KA(e,t,n,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,n,i)&&r.closePath()),Tg(e,t.options),e.stroke(r)}function XA(e,t,n,i){const{segments:r,options:s}=t,a=Ou(t);for(const l of r)Tg(e,s,l.style),e.beginPath(),a(e,t,l,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const ZA=typeof Path2D=="function";function QA(e,t,n,i){ZA&&!t.options.segment?KA(e,t,n,i):XA(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;NC(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=ZC(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=Am(this,{property:n,start:r,end:r});if(!a.length)return;const l=[],u=GA(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 Ou(this)(t,this,n,i)}path(t,n,i){const r=this.segments,s=Ou(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(),QA(t,this,i,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Mg(e,t,n,i){const r=e.options,{[n]:s}=e.getProps([n],i);return Math.abs(t-s)<r.radius+r.hitRadius}class JA 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 Mg(this,t,"x",n)}inYRange(t,n){return Mg(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,uu(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function Dg(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 tE(e,t,n){const i=e.options.borderWidth,r=e.borderSkipped,s=pm(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 eE(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||Nt(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 nE(e){const t=Dg(e),n=t.right-t.left,i=t.bottom-t.top,r=tE(e,n/2,i/2),s=eE(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 Au(e,t,n,i){const r=t===null,s=n===null,l=e&&!(r&&s)&&Dg(e,i);return l&&(r||si(t,l.left,l.right))&&(s||si(n,l.top,l.bottom))}function iE(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function rE(e,t){e.rect(t.x,t.y,t.w,t.h)}function Eu(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 sE 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}=nE(this),l=iE(a.radius)?qr:rE;t.save(),(a.w!==s.w||a.h!==s.h)&&(t.beginPath(),l(t,Eu(a,n,s)),t.clip(),l(t,Eu(s,-n,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),l(t,Eu(s,n)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,n,i){return Au(this,t,n,i)}inXRange(t,n){return Au(this,t,null,n)}inYRange(t,n){return Au(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 oE=Object.freeze({__proto__:null,ArcElement:$A,BarElement:sE,LineElement:Ya,PointElement:JA});const Ru=["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)"],Cg=Ru.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function Og(e){return Ru[e%Ru.length]}function Ag(e){return Cg[e%Cg.length]}function aE(e,t){return e.borderColor=Og(t),e.backgroundColor=Ag(t),++t}function lE(e,t){return e.backgroundColor=e.data.map(()=>Og(t++)),t}function cE(e,t){return e.backgroundColor=e.data.map(()=>Ag(t++)),t}function uE(e){let t=0;return(n,i)=>{const r=e.getDatasetMeta(i).controller;r instanceof ro?t=lE(n,t):r instanceof jm?t=cE(n,t):r&&(t=aE(n,t))}}function Eg(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function dE(e){return e&&(e.borderColor||e.backgroundColor)}function fE(){return ae.borderColor!=="rgba(0,0,0,0.1)"||ae.backgroundColor!=="rgba(0,0,0,0.1)"}var hE={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=Eg(i)||dE(r)||s&&Eg(s)||fE();if(!n.forceOverride&&a)return;const l=uE(e);i.forEach(l)}};function pE(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,O=0,A;const P=Math.floor((m+1)*l)+1+t,L=Math.min(Math.floor((m+2)*l)+1,n)+t,R=L-P;for(A=P;A<L;A++)S+=e[A].x,O+=e[A].y;S/=R,O/=R;const F=Math.floor(m*l)+1+t,U=Math.min(Math.floor((m+1)*l)+1,n)+t,{x:D,y:w}=e[h];for(_=x=-1,A=F;A<U;A++)x=.5*Math.abs((D-S)*(e[A].y-w)-(D-e[A].x)*(O-w)),x>_&&(_=x,g=e[A],v=A);a[u++]=g,h=v}return a[u++]=e[d],a}function mE(e,t,n,i){let r=0,s=0,a,l,u,d,h,m,g,_,x,v;const S=[],O=t+n-1,A=e[t].x,L=e[O].x-A;for(a=t;a<t+n;++a){l=e[a],u=(l.x-A)/L*i,d=l.y;const R=u|0;if(R===h)d<x?(x=d,m=a):d>v&&(v=d,g=a),r=(s*r+l.x)/++s;else{const F=a-1;if(!kt(m)&&!kt(g)){const U=Math.min(m,g),D=Math.max(m,g);U!==_&&U!==F&&S.push({...e[U],x:r}),D!==_&&D!==F&&S.push({...e[D],x:r})}a>0&&F!==_&&S.push(e[F]),S.push(l),h=R,s=0,x=v=d,m=g=_=a}}return S}function Rg(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 Pg(e){e.data.datasets.forEach(t=>{Rg(t)})}function gE(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 yE={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){Pg(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}=gE(u,d);const _=n.threshold||4*i;if(g<=_){Rg(r);return}kt(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=pE(d,m,g,i,n);break;case"min-max":x=mE(d,m,g,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}r._decimated=x})},destroy(e){Pg(e)}};function _E(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=Pu(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=Am(t,h);for(const g of m){const _=Pu(n,s[g.start],s[g.end],g.loop),x=Om(l,r,_);for(const v of x)a.push({source:v,target:g,start:{[n]:Ig(h,_,"start",Math.max)},end:{[n]:Ig(h,_,"end",Math.min)}})}}return a}function Pu(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 bE(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 Ig(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function Lg(e,t){let n=[],i=!1;return jt(e)?(i=!0,n=e):n=bE(e,t),n.length?new Ya({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function Ng(e){return e&&e.fill!==!1}function xE(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 wE(e,t,n){const i=kE(e);if(Nt(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return le(r)&&Math.floor(r)===r?vE(i[0],t,r,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function vE(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function SE(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:Nt(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function TE(e,t,n){let i;return e==="start"?i=n:e==="end"?i=t.options.reverse?t.min:t.max:Nt(e)?i=e.value:i=t.getBaseValue(),i}function kE(e){const t=e.options,n=t.fill;let i=Ot(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function ME(e){const{scale:t,index:n,line:i}=e,r=[],s=i.segments,a=i.points,l=DE(t,n);l.push(Lg({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++)CE(r,a[h],l)}return new Ya({points:r,options:{}})}function DE(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 CE(e,t,n){const i=[];for(let r=0;r<n.length;r++){const s=n[r],{first:a,last:l,point:u}=OE(s,t,"x");if(!(!u||a&&l)){if(a)i.unshift(u);else if(e.push(u),!l)break}}e.push(...i)}function OE(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 Bg{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:ne},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 AE(e){const{chart:t,fill:n,line:i}=e;if(le(n))return EE(t,n);if(n==="stack")return ME(e);if(n==="shape")return!0;const r=RE(e);return r instanceof Bg?r:Lg(r,i)}function EE(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function RE(e){return(e.scale||{}).getPointPositionForValue?IE(e):PE(e)}function PE(e){const{scale:t={},fill:n}=e,i=SE(n,t);if(le(i)){const r=t.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function IE(e){const{scale:t,fill:n}=e,i=t.options,r=t.getLabels().length,s=i.reverse?t.max:t.min,a=TE(n,t,s),l=[];if(i.grid.circular){const u=t.getPointPositionForValue(0,s);return new Bg({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 Iu(e,t,n){const i=AE(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=Pm(r,x);i&&a.points.length&&(to(e,n),LE(e,{line:a,target:i,above:g,below:_,area:n,scale:l,axis:u,clip:v}),eo(e))}function LE(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"?(Fg(e,i,a.top),Lu(e,{line:n,target:i,color:r,scale:l,property:d,clip:u}),e.restore(),e.save(),Fg(e,i,a.bottom)):d==="y"&&(zg(e,i,a.left),Lu(e,{line:n,target:i,color:s,scale:l,property:d,clip:u}),e.restore(),e.save(),zg(e,i,a.right),h=r)),Lu(e,{line:n,target:i,color:h,scale:l,property:d,clip:u}),e.restore()}function Fg(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 zg(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 Lu(e,t){const{line:n,target:i,property:r,color:s,scale:a,clip:l}=t,u=_E(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=_,NE(e,a,l,x&&Pu(r,m,g)),e.beginPath();const v=!!n.pathSegment(e,d);let S;if(x){v?e.closePath():Ug(e,i,g,r);const O=!!i.pathSegment(e,h,{move:v,reverse:!0});S=v&&O,S||Ug(e,i,m,r)}e.closePath(),e.fill(S?"evenodd":"nonzero"),e.restore()}}function NE(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 Ug(e,t,n,i){const r=t.interpolate(n,i);r&&e.lineTo(r.x,r.y)}var BE={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:wE(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=xE(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&&Iu(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;Ng(s)&&Iu(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;!Ng(i)||n.drawTime!=="beforeDatasetDraw"||Iu(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Hg=(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)}},FE=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Wg 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}=Hg(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,O)=>{const{itemWidth:A,itemHeight:P}=zE(i,n,s,S,r);O>0&&_+P+2*l>h&&(m+=g+l,d.push({width:g,height:_}),x+=g+l,v++,g=_=0),u[O]={left:x,top:_,col:v,width:A,height:P},g=Math.max(g,A),_+=P+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=ae.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}=Hg(a,m),O=function(F,U,D){if(isNaN(x)||x<=0||isNaN(v)||v<0)return;r.save();const w=Ot(D.lineWidth,1);if(r.fillStyle=Ot(D.fillStyle,l),r.lineCap=Ot(D.lineCap,"butt"),r.lineDashOffset=Ot(D.lineDashOffset,0),r.lineJoin=Ot(D.lineJoin,"miter"),r.lineWidth=w,r.strokeStyle=Ot(D.strokeStyle,l),r.setLineDash(Ot(D.lineDash,[])),a.usePointStyle){const C={radius:v*Math.SQRT2/2,pointStyle:D.pointStyle,rotation:D.rotation,borderWidth:w},N=u.xPlus(F,x/2),$=U+g;hm(r,C,N,$,a.pointStyleWidth&&x)}else{const C=U+Math.max((m-v)/2,0),N=u.leftForLtr(F,x),$=Ei(D.borderRadius);r.beginPath(),Object.values($).some(V=>V!==0)?qr(r,{x:N,y:C,w:x,h:v,radius:$}):r.rect(N,C,x,v),r.fill(),w!==0&&r.stroke()}r.restore()},A=function(F,U,D){ur(r,D.text,F,U+S/2,d,{strikethrough:D.hidden,textAlign:u.textAlign(D.textAlign)})},P=this.isHorizontal(),L=this._computeTitleHeight();P?_={x:$e(s,this.left+h,this.right-i[0]),y:this.top+h+L,line:0}:_={x:this.left+h,y:$e(s,this.top+L+h,this.bottom-n[0].height),line:0},km(this.ctx,t.textDirection);const R=S+h;this.legendItems.forEach((F,U)=>{r.strokeStyle=F.fontColor,r.fillStyle=F.fontColor;const D=r.measureText(F.text).width,w=u.textAlign(F.textAlign||(F.textAlign=a.textAlign)),C=x+g+D;let N=_.x,$=_.y;u.setWidth(this.width),P?U>0&&N+C+h>this.right&&($=_.y+=R,_.line++,N=_.x=$e(s,this.left+h,this.right-i[_.line])):U>0&&$+R>this.bottom&&(N=_.x=N+n[_.line].width+h,_.line++,$=_.y=$e(s,this.top+L+h,this.bottom-n[_.line].height));const V=u.x(N);if(O(V,$,F),N=tC(w,N+x+g,P?N+C:this.right,t.rtl),A(u.x(N),$,F),P)_.x+=C+h;else if(typeof F.text!="string"){const st=d.lineHeight;_.y+=$g(F,st)+h}else _.y+=R}),Mm(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(su(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(!WE(t.type,n))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,s=FE(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 zE(e,t,n,i,r){const s=UE(i,e,t,n),a=HE(r,i,t.lineHeight);return{itemWidth:s,itemHeight:a}}function UE(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 HE(e,t,n){let i=e;return typeof t.text!="string"&&(i=$g(t,n)),i}function $g(e,t){const n=e.text?e.text.length:0;return t*n}function WE(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var $E={id:"legend",_element:Wg,start(e,t,n){const i=e.legend=new Wg({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 Nu 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=jt(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=Pt*-.5):(h=s-t,m=$e(l,n,r),u=Pt*.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:su(n.align),textBaseline:"middle",translation:[a,l]})}}function VE(e,t){const n=new Nu({ctx:e.ctx,options:t,chart:e});Ve.configure(e,n,t),Ve.addBox(e,n),e.titleBlock=n}var YE={id:"title",_element:Nu,start(e,t,n){VE(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 qE={id:"subtitle",start(e,t,n){const i=new Nu({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&&(jt(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(Lt,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):(Lt=typeof globalThis<"u"?globalThis:Lt||self,f(Lt["kong-ui-publicvitals-chart"]={},Lt.Vue,Lt.KongIcons,Lt["kong-ui-public-i18n"],Lt["kong-ui-public-analytics-metric-provider"],Lt.Kongponents))})(this,(function(Lt,f,fe,mh,er,As){"use strict";var yt=(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))(yt||{});const mx=["in","not_in","selector"],gx=["empty","not_empty"],_x=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],nr=e=>e.filter(t=>t!=="time"),gh=["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"],Tc=nr(gh),yx=["active_services","error_rate","request_count","request_per_minute","response_latency_average"],_h=[...gh,"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"],kc=nr(_h),bx=[...yx,"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"],xx=["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","upstream_status_code","upstream_status_code_grouped","response_source"],Mc=nr(xx),wx=["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"],vx=nr(wx),Sx=["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"],Tx=Sx,kx=["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=nr(kx),Dx=["platform","platform_usage"],Cx=e=>Dx.includes(e),Ox=[..._h.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"],Dc=nr(Ox);[...bx];const Ax=["control_plane","data_plane_group","managed_cache","network","provider","provider_region","time"],Cc=nr(Ax);new Set(Tc),new Set(kc),new Set(Mc),new Set(Dc),new Set(Cc);const yh=[{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:mx},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:gx}},required:["field","operator"],additionalProperties:!1}]}});({...Si()},yh.map(e=>e.code));const Ex=["control_plane","gateway_service","realm","route","plugin","plugin_name","plugin_scope","data_plane_node_version","env","team","region","hostname"];Si(kc),Si(Tc),Si(Mc),Si(Dc),Si(Cc),Si(Array.from(new Set([...vx,...Tx,...Mx]))),Si([...new Set([...kc,...Tc,...Mc,...Dc,...Ex,...Cc])]);const Rx={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"}},Px=(e,t,n)=>{let i;const r=Rx[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 Oc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Ix={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Lx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Nx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Bx={date:Oc({formats:Ix,defaultWidth:"full"}),time:Oc({formats:Lx,defaultWidth:"full"}),dateTime:Oc({formats:Nx,defaultWidth:"full"})},Fx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},zx=(e,t,n,i)=>Fx[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 Ux={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Hx={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Wx={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"]},$x={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"]},Vx={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"}},Yx={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"}},qx=(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"},jx={ordinalNumber:qx,era:Es({values:Ux,defaultWidth:"wide"}),quarter:Es({values:Hx,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Es({values:Wx,defaultWidth:"wide"}),day:Es({values:$x,defaultWidth:"wide"}),dayPeriod:Es({values:Vx,defaultWidth:"wide",formattingValues:Yx,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)?Kx(l,m=>m.test(a)):Gx(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 Gx(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Kx(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Xx(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 Zx=/^(\d+)(th|st|nd|rd)?/i,Qx=/\d+/i,Jx={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},tw={any:[/^b/i,/^(a|c)/i]},ew={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},nw={any:[/1/i,/2/i,/3/i,/4/i]},iw={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},rw={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]},sw={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},ow={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]},aw={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},lw={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}},cw={ordinalNumber:Xx({matchPattern:Zx,parsePattern:Qx,valueCallback:e=>parseInt(e,10)}),era:Rs({matchPatterns:Jx,defaultMatchWidth:"wide",parsePatterns:tw,defaultParseWidth:"any"}),quarter:Rs({matchPatterns:ew,defaultMatchWidth:"wide",parsePatterns:nw,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Rs({matchPatterns:iw,defaultMatchWidth:"wide",parsePatterns:rw,defaultParseWidth:"any"}),day:Rs({matchPatterns:sw,defaultMatchWidth:"wide",parsePatterns:ow,defaultParseWidth:"any"}),dayPeriod:Rs({matchPatterns:aw,defaultMatchWidth:"any",parsePatterns:lw,defaultParseWidth:"any"})},uw={code:"en-US",formatDistance:Px,formatLong:Bx,formatRelative:zx,localize:jx,match:cw,options:{weekStartsOn:0,firstWeekContainsDate:1}};let dw={};function Ps(){return dw}const bh=6048e5,fw=864e5,hw=60,pw=3600,xh=Symbol.for("constructDateFrom");function Tn(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&xh in e?e[xh](t):e instanceof Date?new e.constructor(t):new Date(t)}function He(e,t){return Tn(t||e,e)}function wh(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 mw(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 gw(e,t,n){const[i,r]=mw(n?.in,e,t),s=Nr(i),a=Nr(r),l=+s-wh(s),u=+a-wh(a);return Math.round((l-u)/fw)}function _w(e,t){const n=He(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function yw(e,t){const n=He(e,t?.in);return gw(n,_w(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 vh(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 bw(e,t){const n=vh(e,t),i=Tn(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),sa(i)}function xw(e,t){const n=He(e,t?.in),i=+sa(n)-+bw(n);return Math.round(i/bh)+1}function Sh(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 ww(e,t){const n=Ps(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=Sh(e,t),s=Tn(t?.in||e,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),ni(s,t)}function vw(e,t){const n=He(e,t?.in),i=+ni(n,t)-+ww(n,t);return Math.round(i/bh)+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"},Th={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=Sh(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=vh(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=vw(e,i);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):Zt(r,t.length)},I:function(e,t,n){const i=xw(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=yw(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 Mh(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 Mh(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"+kh(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"+kh(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 kh(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 Mh(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 Dh=(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"})}},Ch=(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"})}},Sw=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return Dh(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}}",Dh(i,t)).replace("{{time}}",Ch(r,t))},Tw={p:Ch,P:Sw},kw=/^D+$/,Mw=/^Y+$/,Dw=["D","DD","YY","YYYY"];function Cw(e){return kw.test(e)}function Ow(e){return Mw.test(e)}function Aw(e,t,n){const i=Ew(e,t,n);if(console.warn(i),Dw.includes(e))throw new RangeError(i)}function Ew(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 Rw(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Pw(e){return!(!Rw(e)&&typeof e!="number"||isNaN(+He(e)))}const Iw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Lw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Nw=/^'([^]*?)'?$/,Bw=/''/g,Fw=/[a-zA-Z]/;function zw(e,t,n){const i=Ps(),r=n?.locale??i.locale??uw,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(!Pw(l))throw new RangeError("Invalid time value");let u=t.match(Lw).map(h=>{const m=h[0];if(m==="p"||m==="P"){const g=Tw[m];return g(h,r.formatLong)}return h}).join("").match(Iw).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const m=h[0];if(m==="'")return{isToken:!1,value:Uw(h)};if(Th[m])return{isToken:!0,value:h};if(m.match(Fw))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&&Ow(m)||!n?.useAdditionalDayOfYearTokens&&Cw(m))&&Aw(m,t,String(e));const g=Th[m[0]];return g(l,m,r.localize,d)}).join("")}function Uw(e){const t=e.match(Nw);return t?t[1].replace(Bw,"'"):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 Oh(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 Hw(e,t,n){return Oh(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 Ww(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 $w(){return Object.assign({},Ps())}function Ah(e){return Math.trunc(e*pw)}function Vw(e){const t=e/hw;return Math.trunc(t)}function Eh(e,t,n){return Oh(e,-1,n)}function Rh(e,t,n){return Hw(e,-1,n)}function Ph(e,t,n){const i=$w(),r=jw(e,n.timeZone,n.locale??i.locale);return"formatToParts"in r?Yw(r,t):qw(r,t)}function Yw(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 qw(e,t){const n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}function jw(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function Gw(e,t){const n=Jw(t);return"formatToParts"in n?Xw(n,e):Zw(n,e)}const Kw={year:0,month:1,day:2,hour:3,minute:4,second:5};function Xw(e,t){try{const n=e.formatToParts(t),i=[];for(let r=0;r<n.length;r++){const s=Kw[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 Zw(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 Ac={},Ih=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")),Qw=Ih==="06/25/2014, 00:00:00"||Ih==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function Jw(e){return Ac[e]||(Ac[e]=Qw?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"})),Ac[e]}function Ec(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 Lh=36e5,tv=6e4,Rc={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Is(e,t,n){if(!e)return 0;let i=Rc.timezoneZ.exec(e);if(i)return 0;let r,s;if(i=Rc.timezoneHH.exec(e),i)return r=parseInt(i[1],10),Nh(r)?-(r*Lh):NaN;if(i=Rc.timezoneHHMM.exec(e),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return Nh(r,a)?(s=Math.abs(r)*Lh+a*tv,i[1]==="+"?-s:s):NaN}if(iv(e)){t=new Date(t||Date.now());const a=n?t:ev(t),l=Pc(a,e);return-(n?l:nv(t,l,e))}return NaN}function ev(e){return Ec(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function Pc(e,t){const n=Gw(e,t),i=Ec(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 nv(e,t,n){let i=e.getTime()-t;const r=Pc(new Date(i),n);if(t===r)return t;i-=r-t;const s=Pc(new Date(i),n);return r===s?r:Math.max(r,s)}function Nh(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const Bh={};function iv(e){if(Bh[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Bh[e]=!0,!0}catch{return!1}}const rv=60*1e3,sv={X:function(e,t,n){const i=Ic(n.timeZone,e);if(i===0)return"Z";switch(t){case"X":return Fh(i);case"XXXX":case"XX":return Ur(i);default:return Ur(i,":")}},x:function(e,t,n){const i=Ic(n.timeZone,e);switch(t){case"x":return Fh(i);case"xxxx":case"xx":return Ur(i);default:return Ur(i,":")}},O:function(e,t,n){const i=Ic(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+ov(i,":");default:return"GMT"+Ur(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return Ph("short",e,n);default:return Ph("long",e,n)}}};function Ic(e,t){const n=e?Is(e,t,!0)/rv: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 Fh(e,t){return e%60===0?(e>0?"-":"+")+aa(Math.abs(e)/60,2):Ur(e,t)}function ov(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 zh(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 Uh=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Lc=36e5,Hh=6e4,av=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:Uh};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?av: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=lv(e),{year:r,restDateString:s}=cv(i.date,n),a=uv(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=dv(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=zh(new Date(l+u)),d=zh(new Date(l+u+d));return new Date(l+u+d)}else return new Date(NaN)}function lv(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 cv(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 uv(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,Vh(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 pv(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 Vh(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,Yh(r)?Wh(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 Yh(r,a)?Wh(t,r,a):new Date(NaN)}return null}function dv(e){let t,n,i=Qe.HH.exec(e);if(i)return t=parseFloat(i[1].replace(",",".")),Nc(t)?t%24*Lc:NaN;if(i=Qe.HHMM.exec(e),i)return t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),Nc(t,n)?t%24*Lc+n*Hh: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 Nc(t,n,r)?t%24*Lc+n*Hh+r*1e3:NaN}return null}function Wh(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 fv=[31,28,31,30,31,30,31,31,30,31,30,31],hv=[31,29,31,30,31,30,31,31,30,31,30,31];function $h(e){return e%400===0||e%4===0&&e%100!==0}function Vh(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const i=$h(e);if(i&&n>hv[t]||!i&&n>fv[t])return!1}return!0}function pv(e,t){if(t<1)return!1;const n=$h(e);return!(n&&t>366||!n&&t>365)}function Yh(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function Nc(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const mv=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function gv(e,t,n={}){t=String(t);const i=t.match(mv);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,"'"+sv[a[0]](r,a,n)+"'");return u?d.substring(0,l-1)+d.substring(l+1):d},t)}return zw(e,t,n)}function qh(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 jh(e,t,n,i){return i={...i,timeZone:t,originalDate:e},gv(qh(e,t,{timeZone:i.timeZone}),n,i)}function _v(e,t,n){if(typeof e=="string"&&!e.match(Uh))return la(e,{...n,timeZone:t});e=la(e,n);const i=Ec(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 yv(e,t){return-Is(e,t)}function Gh(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)"),jh(e,n,i)}function bv(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 jh(r,n,i)}catch{return console.error("Invalid value passed to formatTime",e),"(invalid date)"}}const xv={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&&_x.find(t=>e<=xv[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 Kh;function wv(){return Kh||(Kh=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]",y="[object Number]",x="[object Object]",v="[object Promise]",S="[object RegExp]",O="[object Set]",A="[object String]",P="[object Symbol]",L="[object WeakMap]",R="[object ArrayBuffer]",F="[object DataView]",U="[object Float32Array]",D="[object Float64Array]",w="[object Int8Array]",C="[object Int16Array]",N="[object Int32Array]",$="[object Uint8Array]",V="[object Uint8ClampedArray]",st="[object Uint16Array]",dt="[object Uint32Array]",ut=/[\\^$.*+?()[\]{}|]/g,ct=/\w*$/,Tt=/^\[object .+?Constructor\]$/,at=/^(?:0|[1-9]\d*)$/,pt={};pt[s]=pt[a]=pt[R]=pt[F]=pt[l]=pt[u]=pt[U]=pt[D]=pt[w]=pt[C]=pt[N]=pt[g]=pt[y]=pt[x]=pt[S]=pt[O]=pt[A]=pt[P]=pt[$]=pt[V]=pt[st]=pt[dt]=!0,pt[d]=pt[h]=pt[L]=!1;var G=typeof ua=="object"&&ua&&ua.Object===Object&&ua,B=typeof self=="object"&&self&&self.Object===Object&&self,z=G||B||Function("return this")(),Z=t&&!t.nodeType&&t,it=Z&&!0&&e&&!e.nodeType&&e,ht=it&&it.exports===Z;function mt(M,Y){return M.set(Y[0],Y[1]),M}function X(M,Y){return M.add(Y),M}function ot(M,Y){for(var tt=-1,xt=M?M.length:0;++tt<xt&&Y(M[tt],tt,M)!==!1;);return M}function vt(M,Y){for(var tt=-1,xt=Y.length,Ce=M.length;++tt<xt;)M[Ce+tt]=Y[tt];return M}function lt(M,Y,tt,xt){for(var Ce=-1,Ke=M?M.length:0;++Ce<Ke;)tt=Y(tt,M[Ce],Ce,M);return tt}function bt(M,Y){for(var tt=-1,xt=Array(M);++tt<M;)xt[tt]=Y(tt);return xt}function Rt(M,Y){return M?.[Y]}function j(M){var Y=!1;if(M!=null&&typeof M.toString!="function")try{Y=!!(M+"")}catch{}return Y}function et(M){var Y=-1,tt=Array(M.size);return M.forEach(function(xt,Ce){tt[++Y]=[Ce,xt]}),tt}function rt(M,Y){return function(tt){return M(Y(tt))}}function Gt(M){var Y=-1,tt=Array(M.size);return M.forEach(function(xt){tt[++Y]=xt}),tt}var _t=Array.prototype,$t=Function.prototype,Me=Object.prototype,Te=z["__core-js_shared__"],ee=(function(){var M=/[^.]+$/.exec(Te&&Te.keys&&Te.keys.IE_PROTO||"");return M?"Symbol(src)_1."+M:""})(),je=$t.toString,Yt=Me.hasOwnProperty,Be=Me.toString,se=RegExp("^"+je.call(Yt).replace(ut,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),De=ht?z.Buffer:void 0,Pe=z.Symbol,gn=z.Uint8Array,Wi=rt(Object.getPrototypeOf,Object),Cn=Object.create,Ge=Me.propertyIsEnumerable,Ln=_t.splice,di=Object.getOwnPropertySymbols,Oo=De?De.isBuffer:void 0,Ao=rt(Object.keys,Object),Tr=Zn(z,"DataView"),fi=Zn(z,"Map"),Eo=Zn(z,"Promise"),Ro=Zn(z,"Set"),Po=Zn(z,"WeakMap"),$i=Zn(Object,"create"),xl=pi(Tr),Ed=pi(fi),Rd=pi(Eo),Pd=pi(Ro),Id=pi(Po),Io=Pe?Pe.prototype:void 0,wl=Io?Io.valueOf:void 0;function hi(M){var Y=-1,tt=M?M.length:0;for(this.clear();++Y<tt;){var xt=M[Y];this.set(xt[0],xt[1])}}function Ld(){this.__data__=$i?$i(null):{}}function Lo(M){return this.has(M)&&delete this.__data__[M]}function Nd(M){var Y=this.__data__;if($i){var tt=Y[M];return tt===i?void 0:tt}return Yt.call(Y,M)?Y[M]:void 0}function No(M){var Y=this.__data__;return $i?Y[M]!==void 0:Yt.call(Y,M)}function Bd(M,Y){var tt=this.__data__;return tt[M]=$i&&Y===void 0?i:Y,this}hi.prototype.clear=Ld,hi.prototype.delete=Lo,hi.prototype.get=Nd,hi.prototype.has=No,hi.prototype.set=Bd;function Nn(M){var Y=-1,tt=M?M.length:0;for(this.clear();++Y<tt;){var xt=M[Y];this.set(xt[0],xt[1])}}function Fd(){this.__data__=[]}function zd(M){var Y=this.__data__,tt=kr(Y,M);if(tt<0)return!1;var xt=Y.length-1;return tt==xt?Y.pop():Ln.call(Y,tt,1),!0}function Ud(M){var Y=this.__data__,tt=kr(Y,M);return tt<0?void 0:Y[tt][1]}function vl(M){return kr(this.__data__,M)>-1}function Hd(M,Y){var tt=this.__data__,xt=kr(tt,M);return xt<0?tt.push([M,Y]):tt[xt][1]=Y,this}Nn.prototype.clear=Fd,Nn.prototype.delete=zd,Nn.prototype.get=Ud,Nn.prototype.has=vl,Nn.prototype.set=Hd;function Vi(M){var Y=-1,tt=M?M.length:0;for(this.clear();++Y<tt;){var xt=M[Y];this.set(xt[0],xt[1])}}function Sl(){this.__data__={hash:new hi,map:new(fi||Nn),string:new hi}}function Wd(M){return Mr(this,M).delete(M)}function $d(M){return Mr(this,M).get(M)}function Vd(M){return Mr(this,M).has(M)}function Yd(M,Y){return Mr(this,M).set(M,Y),this}Vi.prototype.clear=Sl,Vi.prototype.delete=Wd,Vi.prototype.get=$d,Vi.prototype.has=Vd,Vi.prototype.set=Yd;function Yi(M){this.__data__=new Nn(M)}function qd(){this.__data__=new Nn}function ls(M){return this.__data__.delete(M)}function jd(M){return this.__data__.get(M)}function cs(M){return this.__data__.has(M)}function Gd(M,Y){var tt=this.__data__;if(tt instanceof Nn){var xt=tt.__data__;if(!fi||xt.length<n-1)return xt.push([M,Y]),this;tt=this.__data__=new Vi(xt)}return tt.set(M,Y),this}Yi.prototype.clear=qd,Yi.prototype.delete=ls,Yi.prototype.get=jd,Yi.prototype.has=cs,Yi.prototype.set=Gd;function Kd(M,Y){var tt=Ho(M)||Bl(M)?bt(M.length,String):[],xt=tt.length,Ce=!!xt;for(var Ke in M)Yt.call(M,Ke)&&!(Ce&&(Ke=="length"||Pl(Ke,xt)))&&tt.push(Ke);return tt}function Tl(M,Y,tt){var xt=M[Y];(!(Yt.call(M,Y)&&Nl(xt,tt))||tt===void 0&&!(Y in M))&&(M[Y]=tt)}function kr(M,Y){for(var tt=M.length;tt--;)if(Nl(M[tt][0],Y))return tt;return-1}function kl(M,Y){return M&&Fo(Y,Wo(Y),M)}function us(M,Y,tt,xt,Ce,Ke,Bn){var Fe;if(xt&&(Fe=Ke?xt(M,Ce,Ke,Bn):xt(M)),Fe!==void 0)return Fe;if(!ms(M))return M;var zl=Ho(M);if(zl){if(Fe=El(M),!Y)return Al(M,Fe)}else{var ue=un(M),gs=ue==h||ue==m;if(af(M))return Dl(M,Y);if(ue==x||ue==s||gs&&!Ke){if(j(M))return Ke?M:{};if(Fe=Rl(gs?{}:M),!Y)return zo(M,kl(Fe,M))}else{if(!pt[ue])return Ke?M:{};Fe=rf(M,ue,us,Y)}}Bn||(Bn=new Yi);var Qn=Bn.get(M);if(Qn)return Qn;if(Bn.set(M,Fe),!zl)var $o=tt?nf(M):Wo(M);return ot($o||M,function(Dr,ze){$o&&(ze=Dr,Dr=M[ze]),Tl(Fe,ze,us(Dr,Y,tt,xt,ze,M,Bn))}),Fe}function Xd(M){return ms(M)?Cn(M):{}}function Zd(M,Y,tt){var xt=Y(M);return Ho(M)?xt:vt(xt,tt(M))}function Qd(M){return Be.call(M)}function Jd(M){if(!ms(M)||Ll(M))return!1;var Y=ps(M)||j(M)?se:Tt;return Y.test(pi(M))}function Ml(M){if(!Uo(M))return Ao(M);var Y=[];for(var tt in Object(M))Yt.call(M,tt)&&tt!="constructor"&&Y.push(tt);return Y}function Dl(M,Y){if(Y)return M.slice();var tt=new M.constructor(M.length);return M.copy(tt),tt}function ds(M){var Y=new M.constructor(M.byteLength);return new gn(Y).set(new gn(M)),Y}function Bo(M,Y){var tt=Y?ds(M.buffer):M.buffer;return new M.constructor(tt,M.byteOffset,M.byteLength)}function tf(M,Y,tt){var xt=Y?tt(et(M),!0):et(M);return lt(xt,mt,new M.constructor)}function Cl(M){var Y=new M.constructor(M.source,ct.exec(M));return Y.lastIndex=M.lastIndex,Y}function fs(M,Y,tt){var xt=Y?tt(Gt(M),!0):Gt(M);return lt(xt,X,new M.constructor)}function Ol(M){return wl?Object(wl.call(M)):{}}function ef(M,Y){var tt=Y?ds(M.buffer):M.buffer;return new M.constructor(tt,M.byteOffset,M.length)}function Al(M,Y){var tt=-1,xt=M.length;for(Y||(Y=Array(xt));++tt<xt;)Y[tt]=M[tt];return Y}function Fo(M,Y,tt,xt){tt||(tt={});for(var Ce=-1,Ke=Y.length;++Ce<Ke;){var Bn=Y[Ce],Fe=void 0;Tl(tt,Bn,Fe===void 0?M[Bn]:Fe)}return tt}function zo(M,Y){return Fo(M,hs(M),Y)}function nf(M){return Zd(M,Wo,hs)}function Mr(M,Y){var tt=M.__data__;return Il(Y)?tt[typeof Y=="string"?"string":"hash"]:tt.map}function Zn(M,Y){var tt=Rt(M,Y);return Jd(tt)?tt:void 0}var hs=di?rt(di,Object):uf,un=Qd;(Tr&&un(new Tr(new ArrayBuffer(1)))!=F||fi&&un(new fi)!=g||Eo&&un(Eo.resolve())!=v||Ro&&un(new Ro)!=O||Po&&un(new Po)!=L)&&(un=function(M){var Y=Be.call(M),tt=Y==x?M.constructor:void 0,xt=tt?pi(tt):void 0;if(xt)switch(xt){case xl:return F;case Ed:return g;case Rd:return v;case Pd:return O;case Id:return L}return Y});function El(M){var Y=M.length,tt=M.constructor(Y);return Y&&typeof M[0]=="string"&&Yt.call(M,"index")&&(tt.index=M.index,tt.input=M.input),tt}function Rl(M){return typeof M.constructor=="function"&&!Uo(M)?Xd(Wi(M)):{}}function rf(M,Y,tt,xt){var Ce=M.constructor;switch(Y){case R:return ds(M);case l:case u:return new Ce(+M);case F:return Bo(M,xt);case U:case D:case w:case C:case N:case $:case V:case st:case dt:return ef(M,xt);case g:return tf(M,xt,tt);case y:case A:return new Ce(M);case S:return Cl(M);case O:return fs(M,xt,tt);case P:return Ol(M)}}function Pl(M,Y){return Y=Y??r,!!Y&&(typeof M=="number"||at.test(M))&&M>-1&&M%1==0&&M<Y}function Il(M){var Y=typeof M;return Y=="string"||Y=="number"||Y=="symbol"||Y=="boolean"?M!=="__proto__":M===null}function Ll(M){return!!ee&&ee in M}function Uo(M){var Y=M&&M.constructor,tt=typeof Y=="function"&&Y.prototype||Me;return M===tt}function pi(M){if(M!=null){try{return je.call(M)}catch{}try{return M+""}catch{}}return""}function sf(M){return us(M,!0,!0)}function Nl(M,Y){return M===Y||M!==M&&Y!==Y}function Bl(M){return of(M)&&Yt.call(M,"callee")&&(!Ge.call(M,"callee")||Be.call(M)==s)}var Ho=Array.isArray;function Fl(M){return M!=null&&lf(M.length)&&!ps(M)}function of(M){return cf(M)&&Fl(M)}var af=Oo||ie;function ps(M){var Y=ms(M)?Be.call(M):"";return Y==h||Y==m}function lf(M){return typeof M=="number"&&M>-1&&M%1==0&&M<=r}function ms(M){var Y=typeof M;return!!M&&(Y=="object"||Y=="function")}function cf(M){return!!M&&typeof M=="object"}function Wo(M){return Fl(M)?Kd(M):Ml(M)}function uf(){return[]}function ie(){return!1}e.exports=sf})(da,da.exports)),da.exports}wv();const kn=(e,t)=>new Date(e.getTime()-yv(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=_v(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return qh(n,t)}}class vv 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 Sv extends Ee{rawStart(t){let n=zr(this.tzAdjustedDate(t));return t&&(n=kn(n,t)),n}maximumTimeframeLength(){return 3600*24*31}}class Tv extends Ee{rawStart(t){let n=Fr(this.tzAdjustedDate(t));return t&&(n=kn(n,t)),n}maximumTimeframeLength(){return 3600*24*92}}class kv 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 Mv 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 Dv extends Ee{rawEnd(t){let n=Fr(this.tzAdjustedDate(t));return t&&(n=kn(n,t)),n}rawStart(t){let n=Fr(Rh(this.tzAdjustedDate(t)));return t&&(n=kn(n,t)),n}}class Cv extends Ee{rawEnd(t){let n=zr(this.tzAdjustedDate(t));return t&&(n=kn(n,t)),n}rawStart(t){let n=zr(Eh(this.tzAdjustedDate(t)));return t&&(n=kn(n,t)),n}}class Ov 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}}yt.FIFTEEN_MIN,new Ee({key:yt.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"]}),yt.ONE_HOUR,new Ee({key:yt.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"]}),yt.SIX_HOUR,new Ee({key:yt.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"]}),yt.TWELVE_HOUR,new Ee({key:yt.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"]}),yt.ONE_DAY,new Ee({key:yt.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"]}),yt.SEVEN_DAY,new Ee({key:yt.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"]}),yt.THIRTY_DAY,new Ee({key:yt.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"]}),yt.NINETY_DAY,new Ee({key:yt.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"]}),yt.ONE_HUNDRED_EIGHTY_DAY,new Ee({key:yt.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"]}),yt.ONE_YEAR,new Ee({key:yt.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"]}),yt.CURRENT_WEEK,new vv({key:yt.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"]}),yt.CURRENT_MONTH,new Sv({key:yt.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"]}),yt.CURRENT_QUARTER,new Tv({key:yt.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"]}),yt.CURRENT_YEAR,new kv({key:yt.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"]}),yt.PREVIOUS_WEEK,new Mv({key:yt.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"]}),yt.PREVIOUS_MONTH,new Cv({key:yt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=zr(new Date),n=zr(Eh(new Date));return t.getTimezoneOffset()!==n.getTimezoneOffset()&&(e=Xh(t,n)),3600*24*Ww(new Date().setMonth(new Date().getMonth()-1))+Ah(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),yt.PREVIOUS_QUARTER,new Dv({key:yt.PREVIOUS_QUARTER,display:"Previous quarter",timeframeText:"Quarter",timeframeLength:()=>{const e=Fr(new Date),t=Fr(Rh(new Date));return(e.getTime()-t.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),yt.PREVIOUS_YEAR,new Ov({key:yt.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=Xh(e,t)),3600*24*(365+(t.getFullYear()%4===0?1:0))+Ah(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Xh(e,t){return Vw(e.getTimezoneOffset()-t.getTimezoneOffset())}yt.FIFTEEN_MIN,yt.ONE_HOUR,yt.SIX_HOUR,yt.TWELVE_HOUR,yt.ONE_DAY,yt.SEVEN_DAY,yt.FIFTEEN_MIN,yt.ONE_HOUR,yt.SIX_HOUR,yt.TWELVE_HOUR,yt.ONE_DAY,yt.SEVEN_DAY,yt.THIRTY_DAY,yt.NINETY_DAY,yt.ONE_HUNDRED_EIGHTY_DAY,yt.ONE_YEAR,yt.CURRENT_WEEK,yt.CURRENT_MONTH,yt.CURRENT_QUARTER,yt.CURRENT_YEAR,yt.PREVIOUS_WEEK,yt.PREVIOUS_MONTH,yt.PREVIOUS_QUARTER,yt.PREVIOUS_YEAR;const Av=new Map(yh.map(e=>[e.code,{code:e.code,name:e.name}])),Bc=e=>Av.get(e)?.name||e,Zh=1e3,Ev=1e4,Qh=1e6,Jh=1e9,tp=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?Ev:Zh;return e<r||t.precision&&t.precision>Math.log10(e)?n=fa(Ls(e,1,t),t):e<Qh?n=`${Ls(e,Zh,t)}k`:e<Jh?n=`${Ls(e,Qh,t)}m`:e<tp?n=`${fa(Ls(e,Jh,t),t)}b`:n=`${fa(Ls(e,tp,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 Rv=typeof document<"u"&&document.documentElement?.lang||"en-US",pa=new Intl.NumberFormat(Rv),Pv=new Set(["%"]),Iv=e=>Pv.has(e)?"flush":"spaced";function $n({i18n:e}){const t=(r,s)=>{if(isNaN(r))return"0 B";const a=s?Math.pow(2,50):1e15,l=s?Math.pow(2,40):1e12,u=s?Math.pow(2,30):1e9,d=s?Math.pow(2,20):1e6,h=s?Math.pow(2,10):1e3;let m;return r>=a?m=e.formatNumber(Number.parseFloat((r/a).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):r>=l?m=e.formatNumber(Number.parseFloat((r/l).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):r>=u?m=e.formatNumber(Number.parseFloat((r/u).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):r>=d?m=e.formatNumber(Number.parseFloat((r/d).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):r>=h?m=e.formatNumber(Number.parseFloat((r/h).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):m=e.formatNumber(Number.parseFloat(r.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),m.replace(/([a-zA-Z]*)$/," $1")},n=(r,s="USD")=>isNaN(r)?s==="USD"?"$0.00":`${r}`:r>=.01||s!=="USD"?e.formatNumber(r,{style:"currency",currency:s}):r<1e-4?"< $0.0001":`$${Number.parseFloat(r.toPrecision(4))}`,i=(r,s,a)=>{if(!a)return r;const l=Iv(s)==="flush"?"":" ";return`${r}${l}${a}`};return{formatUnit:(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(r,a);case"usd":return n(r,l);default:return isNaN(r)?`${r}`:u?i(ha(r,{capital:!0}),s,h):r<.01?i(`${Number.parseFloat(r.toPrecision(4))}`,s,h):i(pa.format(Number.parseFloat(r.toFixed(2))),s,h)}},formatBytes:t,formatCost:n,formatRange:(r,s,a,{isBytes1024:l=!1,currency:u="USD",approximate:d=!1,translateUnit:h=m=>m}={})=>{const m=h(a,s);switch(a){case"bytes":return`${t(r,l)} - ${t(s,l)}`;case"usd":return`${n(r,u)} - ${n(s,u)}`;default:if(isNaN(r)||isNaN(s))return`${r} - ${s}`;if(d)return i(`${ha(r,{capital:!0})} - ${ha(s,{capital:!0})}`,a,m)}const g=r>=.01?`${pa.format(Number.parseFloat(r.toFixed(2)))}`:`${Number.parseFloat(r.toPrecision(4))}`,y=s>=.01?`${pa.format(Number.parseFloat(s.toFixed(2)))}`:`${Number.parseFloat(s.toPrecision(4))}`;return i(`${g} - ${y}`,a,m)}}}const Lv=e=>{const t=e.length;let n=5381;for(let i=0;i<t;i++)n=n*33^e.charCodeAt(i);return n>>>0},Nv="#0044f4",ep="#6c7489",Bv="#d60027",Fv="#ffc400",zv="#bee2ff",Uv="#8fc1ff",Hv="#5f9aff",Wv="#306fff",$v="#b5ffee",Vv="#00fabe",Yv="#00d6a4",qv="#00a17b",jv="#007d60",Gv="#005944",Kv="#b5ffee",Xv="#00fabe",Zv="#b5ffee",Qv="#00a17b",Jv="#fff296",t1="#ffe04b",e1="#ffc400",n1="#b37600",i1="#995c00",r1="#804400",s1="#fff296",o1="#ffe04b",a1="#ffc2b3",l1="#ff9877",c1="#ff723c",u1="#f75008",d1="#d13500",f1="#a31f00",h1="#ffc2b3",p1="#ff9877",m1="#ff723c",g1="#f75008",_1="#d13500",y1="#a31f00",b1="#ffc2b3",x1="#ff9877",w1="#ff723c",v1="#f75008",S1="#d13500",T1="#a31f00",k1="#ffc2b3",M1="#ff9877",D1="#ff723c",C1="#f75008",O1="#d13500",A1="#a31f00",E1="#ffc2b3",R1="#ff9877",P1="#ff723c",I1="#f75008",L1="#d13500",N1="#ffabab",B1="#ff7272",F1="#ff3954",z1="#f50045",U1="#d60027",H1="#ad000e",W1="#ffabab",$1="#ff7272",V1="#ff3954",Y1="#f50045",q1="#d60027",j1="#eefaff",G1="#ecfffb",K1="#fffce0",X1="#fff1ef",Z1="#ffe5e5",Q1="#5f9aff",J1="#00d6a4",tS="#ffc400",eS="#ff723c",nS="#ff3954",iS={100:zv,101:Uv,102:Hv,103:Wv,200:$v,201:Vv,202:Yv,203:qv,204:jv,205:Gv,206:Kv,207:Xv,208:Zv,226:Qv,300:Jv,301:t1,302:e1,303:n1,304:i1,305:r1,307:s1,308:o1,400:a1,401:l1,402:c1,403:u1,404:d1,405:f1,406:h1,407:p1,408:m1,409:g1,410:_1,411:y1,412:b1,413:x1,414:w1,415:v1,416:S1,417:T1,418:k1,421:M1,422:D1,423:C1,424:O1,425:A1,426:E1,428:R1,429:P1,431:I1,451:L1,500:N1,501:B1,502:F1,503:z1,504:U1,505:H1,506:W1,507:$1,508:V1,510:Y1,511:q1},rS={100:j1,200:G1,300:K1,400:X1,500:Z1},np={"1XX":Q1,"2XX":J1,"3XX":tS,"4XX":eS,"5XX":nS},sS={error:Bv,warning:Fv,empty:"#9DA99D",neutral:ep,____OTHER____:Nv},ip=["#0076F4","#00819D","#00A17B","#8A50FF","#FF3C99","#FF6D3C","#B3A100"],rp=["#5485BA","#087D96","#3D8776","#7654BA","#A1406F","#BF5430","#B5A72C"],oS=e=>Lv(e),sp=({discriminator:e,theme:t="light",customPalette:n=void 0})=>{const i=Math.abs(Math.floor(e));return n?n[i%n.length]:t==="dark"?rp[i%rp.length]:ip[i%ip.length]},Ns=({state:e})=>sS[e]??ep,aS=({statusCode:e})=>{const t=typeof e=="number"?e:Number.parseInt(e,10),n=`${t}`,i=`${Math.floor(t/100)*100}`;return iS[n]??rS[i]??Ns({state:"neutral"})},lS=({group:e})=>np[e]?np[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,customPalette:s=void 0})=>{let a="light";if(f.hasInjectionContext()&&(a=f.inject("app:konnectColorMode",f.computed(()=>"light")).value),e!==void 0)return sp({discriminator:e,theme:a,customPalette:s});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 aS({statusCode:i});if(n==="status_code_grouped")return lS({group:i})}return n||i||r?sp({discriminator:oS(`${n??""}${i??""}${r??""}`),theme:a,customPalette:s}):Ns({state:"neutral"})},op="#d60027",ap="#ffe5e5",cS="#f1f0ff",uS="#e0e4ea",lp="#6c7489",dS="#afb7c5",cp="#0d0e14",fS="#d60027",hS="#ad000e",Fc="#6c7489",up="#52596e",pS="#007d60",mS="#995c00",gS="#ffc400",_S="'Inter', Roboto, Helvetica, sans-serif",rr="16px",yS="20px",bS="#bee2ff",xS="#8fc1ff",wS="#5f9aff",vS="#306fff",SS="#b5ffee",TS="#00fabe",kS="#00d6a4",MS="#00a17b",DS="#007d60",CS="#005944",OS="#b5ffee",AS="#00fabe",ES="#b5ffee",RS="#00a17b",PS="#fff296",IS="#ffe04b",LS="#ffc400",NS="#b37600",BS="#995c00",FS="#804400",zS="#fff296",US="#ffe04b",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="#a31f00",sT="#ffc2b3",oT="#ff9877",aT="#ff723c",lT="#f75008",cT="#d13500",uT="#a31f00",dT="#ffc2b3",fT="#ff9877",hT="#ff723c",pT="#f75008",mT="#d13500",gT="#ffabab",_T="#ff7272",yT="#ff3954",bT="#f50045",xT="#d60027",wT="#ad000e",vT="#ffabab",ST="#ff7272",TT="#ff3954",kT="#f50045",MT="#d60027",DT="#eefaff",CT="#ecfffb",OT="#fffce0",AT="#fff1ef",ET="#ffe5e5",RT="#5f9aff",PT="#00d6a4",IT="#ffc400",LT="#ff723c",NT="#ff3954",dp=6048e5,BT=864e5,Fs=6e4,Hr=36e5,FT=1e3,fp=Symbol.for("constructDateFrom");function me(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&fp in e?e[fp](t):e instanceof Date?new e.constructor(t):new Date(t)}function Et(e,t){return me(t||e,e)}function ma(e,t,n){const i=Et(e,n?.in);return isNaN(t)?me(n?.in||e,NaN):(t&&i.setDate(i.getDate()+t),i)}function zc(e,t,n){const i=Et(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 Uc(e,t,n){return me(e,+Et(e)+t)}function zT(e,t,n){return Uc(e,t*Hr)}let UT={};function sr(){return UT}function Vn(e,t){const n=sr(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=Et(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 hp(e,t){const n=Et(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=Et(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 Hc(e,t){const n=Et(e,t?.in);return n.setHours(0,0,0,0),n}function pp(e,t,n){const[i,r]=or(n?.in,e,t),s=Hc(i),a=Hc(r),l=+s-ga(s),u=+a-ga(a);return Math.round((l-u)/BT)}function HT(e,t){const n=hp(e,t),i=me(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),Wr(i)}function WT(e,t,n){const i=Et(e,n?.in);return i.setTime(i.getTime()+t*Fs),i}function $T(e,t,n){return zc(e,t*3,n)}function VT(e,t,n){return Uc(e,t*1e3)}function YT(e,t,n){return ma(e,t*7,n)}function qT(e,t,n){return zc(e,t*12,n)}function zs(e,t){const n=+Et(e)-+Et(t);return n<0?-1:n>0?1:n}function jT(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Wc(e){return!(!jT(e)&&typeof e!="number"||isNaN(+Et(e)))}function GT(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 KT(e,t,n){const[i,r]=or(n?.in,e,t);return i.getFullYear()-r.getFullYear()}function mp(e,t,n){const[i,r]=or(n?.in,e,t),s=gp(i,r),a=Math.abs(pp(i,r));i.setDate(i.getDate()-s*a);const l=+(gp(i,r)===-s),u=s*(a-l);return u===0?0:u}function gp(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 XT(e,t,n){const[i,r]=or(n?.in,e,t),s=(+i-+r)/Hr;return Us(n?.roundingMethod)(s)}function $c(e,t){return+Et(e)-+Et(t)}function ZT(e,t,n){const i=$c(e,t)/Fs;return Us(n?.roundingMethod)(i)}function _p(e,t){const n=Et(e,t?.in);return n.setHours(23,59,59,999),n}function yp(e,t){const n=Et(e,t?.in),i=n.getMonth();return n.setFullYear(n.getFullYear(),i+1,0),n.setHours(23,59,59,999),n}function QT(e,t){const n=Et(e,t?.in);return+_p(n,t)==+yp(n,t)}function bp(e,t,n){const[i,r,s]=or(n?.in,e,e,t),a=zs(r,s),l=Math.abs(GT(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;QT(i)&&l===1&&zs(i,s)===1&&(u=!1);const d=a*(l-+u);return d===0?0:d}function JT(e,t,n){const i=bp(e,t,n)/3;return Us(n?.roundingMethod)(i)}function tk(e,t,n){const i=$c(e,t)/1e3;return Us(n?.roundingMethod)(i)}function ek(e,t,n){const i=mp(e,t,n)/7;return Us(n?.roundingMethod)(i)}function nk(e,t,n){const[i,r]=or(n?.in,e,t),s=zs(i,r),a=Math.abs(KT(i,r));i.setFullYear(1584),r.setFullYear(1584);const l=zs(i,r)===-s,u=s*(a-+l);return u===0?0:u}function ik(e,t){const n=Et(e,t?.in),i=n.getMonth(),r=i-i%3;return n.setMonth(r,1),n.setHours(0,0,0,0),n}function rk(e,t){const n=Et(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function sk(e,t){const n=Et(e,t?.in),i=n.getFullYear();return n.setFullYear(i+1,0,0),n.setHours(23,59,59,999),n}function xp(e,t){const n=Et(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function ok(e,t){const n=Et(e,t?.in);return n.setMinutes(59,59,999),n}function ak(e,t){const n=sr(),i=n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=Et(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 lk(e,t){const n=Et(e,t?.in);return n.setSeconds(59,999),n}function ck(e,t){const n=Et(e,t?.in),i=n.getMonth(),r=i-i%3+3;return n.setMonth(r,0),n.setHours(23,59,59,999),n}function uk(e,t){const n=Et(e,t?.in);return n.setMilliseconds(999),n}const dk={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"}},fk=(e,t,n)=>{let i;const r=dk[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 Vc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const hk={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},pk={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},mk={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},gk={date:Vc({formats:hk,defaultWidth:"full"}),time:Vc({formats:pk,defaultWidth:"full"}),dateTime:Vc({formats:mk,defaultWidth:"full"})},_k={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},yk=(e,t,n,i)=>_k[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 bk={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},xk={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},wk={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"]},vk={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"]},Sk={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"}},Tk={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"}},kk={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:bk,defaultWidth:"wide"}),quarter:Hs({values:xk,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Hs({values:wk,defaultWidth:"wide"}),day:Hs({values:vk,defaultWidth:"wide"}),dayPeriod:Hs({values:Sk,defaultWidth:"wide",formattingValues:Tk,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)?Dk(l,m=>m.test(a)):Mk(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 Mk(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Dk(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Ck(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 Ok=/^(\d+)(th|st|nd|rd)?/i,Ak=/\d+/i,Ek={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},Rk={any:[/^b/i,/^(a|c)/i]},Pk={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ik={any:[/1/i,/2/i,/3/i,/4/i]},Lk={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},Nk={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]},Bk={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},Fk={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]},zk={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},Uk={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}},Hk={ordinalNumber:Ck({matchPattern:Ok,parsePattern:Ak,valueCallback:e=>parseInt(e,10)}),era:Ws({matchPatterns:Ek,defaultMatchWidth:"wide",parsePatterns:Rk,defaultParseWidth:"any"}),quarter:Ws({matchPatterns:Pk,defaultMatchWidth:"wide",parsePatterns:Ik,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ws({matchPatterns:Lk,defaultMatchWidth:"wide",parsePatterns:Nk,defaultParseWidth:"any"}),day:Ws({matchPatterns:Bk,defaultMatchWidth:"wide",parsePatterns:Fk,defaultParseWidth:"any"}),dayPeriod:Ws({matchPatterns:zk,defaultMatchWidth:"any",parsePatterns:Uk,defaultParseWidth:"any"})},wp={code:"en-US",formatDistance:fk,formatLong:gk,formatRelative:yk,localize:kk,match:Hk,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Wk(e,t){const n=Et(e,t?.in);return pp(n,xp(n))+1}function vp(e,t){const n=Et(e,t?.in),i=+Wr(n)-+HT(n);return Math.round(i/dp)+1}function Yc(e,t){const n=Et(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 $k(e,t){const n=sr(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=Yc(e,t),s=me(t?.in||e,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),Vn(s,t)}function Sp(e,t){const n=Et(e,t?.in),i=+Vn(n,t)-+$k(n,t);return Math.round(i/dp)+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"},Tp={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=Yc(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=hp(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=Sp(e,i);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):Qt(r,t.length)},I:function(e,t,n){const i=vp(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=Wk(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 Mp(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 Mp(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"+kp(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"+kp(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 kp(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 Mp(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 Dp=(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"})}},Cp=(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"})}},qc={p:Cp,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return Dp(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}}",Dp(i,t)).replace("{{time}}",Cp(r,t))}},Vk=/^D+$/,Yk=/^Y+$/,qk=["D","DD","YY","YYYY"];function Op(e){return Vk.test(e)}function Ap(e){return Yk.test(e)}function jc(e,t,n){const i=jk(e,t,n);if(console.warn(i),qk.includes(e))throw new RangeError(i)}function jk(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 Gk=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Kk=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Xk=/^'([^]*?)'?$/,Zk=/''/g,Qk=/[a-zA-Z]/;function _a(e,t,n){const i=sr(),r=n?.locale??i.locale??wp,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=Et(e,n?.in);if(!Wc(l))throw new RangeError("Invalid time value");let u=t.match(Kk).map(h=>{const m=h[0];if(m==="p"||m==="P"){const g=qc[m];return g(h,r.formatLong)}return h}).join("").match(Gk).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const m=h[0];if(m==="'")return{isToken:!1,value:Jk(h)};if(Tp[m])return{isToken:!0,value:h};if(m.match(Qk))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&&Ap(m)||!n?.useAdditionalDayOfYearTokens&&Op(m))&&jc(m,t,String(e));const g=Tp[m[0]];return g(l,m,r.localize,d)}).join("")}function Jk(e){const t=e.match(Xk);return t?t[1].replace(Zk,"'"):e}function Ep(){return Object.assign({},sr())}function tM(e,t){const n=Et(e,t?.in).getDay();return n===0?7:n}function eM(e,t){const n=nM(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 nM(e){return typeof e=="function"&&e.prototype?.constructor===e}const iM=10;class Rp{subPriority=0;validate(t,n){return!0}}class rM extends Rp{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 sM extends Rp{priority=iM;subPriority=-1;constructor(t,n){super(),this.context=t||(i=>me(n,i))}set(t,n){return n.timestampIsSet?t:me(t,eM(t,this.context))}}class Vt{run(t,n,i,r){const s=this.parse(t,n,i,r);return s?{setter:new rM(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(t,n,i){return!0}}class oM extends Vt{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 ye={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*FT),rest:t.slice(n[0].length)}}function Pp(e){return he(ye.anyDigitsSigned,e)}function ge(e,t){switch(e){case 1:return he(ye.singleDigit,t);case 2:return he(ye.twoDigits,t);case 3:return he(ye.threeDigits,t);case 4:return he(ye.fourDigits,t);default:return he(new RegExp("^\\d{1,"+e+"}"),t)}}function ya(e,t){switch(e){case 1:return he(ye.singleDigitSigned,t);case 2:return he(ye.twoDigitsSigned,t);case 3:return he(ye.threeDigitsSigned,t);case 4:return he(ye.fourDigitsSigned,t);default:return he(new RegExp("^-?\\d{1,"+e+"}"),t)}}function Gc(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function Ip(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 Lp(e){return e%400===0||e%4===0&&e%100!==0}class aM extends Vt{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=Ip(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 lM extends Vt{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=Yc(t,r);if(i.isTwoDigitYear){const l=Ip(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 cM extends Vt{priority=130;parse(t,n){return ya(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 uM extends Vt{priority=130;parse(t,n){return ya(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 dM extends Vt{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 fM extends Vt{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 hM extends Vt{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(ye.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 pM extends Vt{priority=110;parse(t,n,i){const r=s=>s-1;switch(n){case"L":return be(he(ye.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 mM(e,t,n){const i=Et(e,n?.in),r=Sp(i,n)-t;return i.setDate(i.getDate()-r*7),Et(i,n?.in)}class gM extends Vt{priority=100;parse(t,n,i){switch(n){case"w":return he(ye.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(mM(t,i,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function _M(e,t,n){const i=Et(e,n?.in),r=vp(i,n)-t;return i.setDate(i.getDate()-r*7),i}class yM extends Vt{priority=100;parse(t,n,i){switch(n){case"I":return he(ye.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(_M(t,i))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const bM=[31,28,31,30,31,30,31,31,30,31,30,31],xM=[31,29,31,30,31,30,31,31,30,31,30,31];class wM extends Vt{priority=90;subPriority=1;parse(t,n,i){switch(n){case"d":return he(ye.date,t);case"do":return i.ordinalNumber(t,{unit:"date"});default:return ge(n.length,t)}}validate(t,n){const i=t.getFullYear(),r=Lp(i),s=t.getMonth();return r?n>=1&&n<=xM[s]:n>=1&&n<=bM[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 vM extends Vt{priority=90;subpriority=1;parse(t,n,i){switch(n){case"D":case"DD":return he(ye.dayOfYear,t);case"Do":return i.ordinalNumber(t,{unit:"date"});default:return ge(n.length,t)}}validate(t,n){const i=t.getFullYear();return Lp(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 Kc(e,t,n){const i=sr(),r=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,s=Et(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 SM extends Vt{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=Kc(t,i,r),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class TM extends Vt{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=Kc(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 kM extends Vt{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=Kc(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 MM(e,t,n){const i=Et(e,n?.in),r=tM(i,n),s=t-r;return ma(i,s,n)}class DM extends Vt{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=MM(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 CM extends Vt{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(Gc(i),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class OM extends Vt{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(Gc(i),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class AM extends Vt{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(Gc(i),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class EM extends Vt{priority=70;parse(t,n,i){switch(n){case"h":return he(ye.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 RM extends Vt{priority=70;parse(t,n,i){switch(n){case"H":return he(ye.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 PM extends Vt{priority=70;parse(t,n,i){switch(n){case"K":return he(ye.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 IM extends Vt{priority=70;parse(t,n,i){switch(n){case"k":return he(ye.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 LM extends Vt{priority=60;parse(t,n,i){switch(n){case"m":return he(ye.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 NM extends Vt{priority=50;parse(t,n,i){switch(n){case"s":return he(ye.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 BM extends Vt{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 FM extends Vt{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 zM extends Vt{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 UM extends Vt{priority=40;parse(t){return Pp(t)}set(t,n,i){return[me(t,i*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class HM extends Vt{priority=20;parse(t){return Pp(t)}set(t,n,i){return[me(t,i),{timestampIsSet:!0}]}incompatibleTokens="*"}const WM={G:new oM,y:new aM,Y:new lM,R:new cM,u:new uM,Q:new dM,q:new fM,M:new hM,L:new pM,w:new gM,I:new yM,d:new wM,D:new vM,E:new SM,e:new TM,c:new kM,i:new DM,a:new CM,b:new OM,B:new AM,h:new EM,H:new RM,K:new PM,k:new IM,m:new LM,s:new NM,S:new BM,X:new FM,x:new zM,t:new UM,T:new HM},$M=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,VM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,YM=/^'([^]*?)'?$/,qM=/''/g,jM=/\S/,GM=/[a-zA-Z]/;function KM(e,t,n,i){const r=()=>me(i?.in||n,NaN),s=Ep(),a=i?.locale??s.locale??wp,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():Et(n,i?.in);const d={firstWeekContainsDate:l,weekStartsOn:u,locale:a},h=[new sM(i?.in,n)],m=t.match(VM).map(S=>{const O=S[0];if(O in qc){const A=qc[O];return A(S,a.formatLong)}return S}).join("").match($M),g=[];for(let S of m){!i?.useAdditionalWeekYearTokens&&Ap(S)&&jc(S,t,e),!i?.useAdditionalDayOfYearTokens&&Op(S)&&jc(S,t,e);const O=S[0],A=WM[O];if(A){const{incompatibleTokens:P}=A;if(Array.isArray(P)){const R=g.find(F=>P.includes(F.token)||F.token===O);if(R)throw new RangeError(`The format string mustn't contain \`${R.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:O,fullToken:S});const L=A.run(e,S,a.match,d);if(!L)return r();h.push(L.setter),e=L.rest}else{if(O.match(GM))throw new RangeError("Format string contains an unescaped latin alphabet character `"+O+"`");if(S==="''"?S="'":O==="'"&&(S=XM(S)),e.indexOf(S)===0)e=e.slice(S.length);else return r()}}if(e.length>0&&jM.test(e))return r();const y=h.map(S=>S.priority).sort((S,O)=>O-S).filter((S,O,A)=>A.indexOf(S)===O).map(S=>h.filter(O=>O.priority===S).sort((O,A)=>A.subPriority-O.subPriority)).map(S=>S[0]);let x=Et(n,i?.in);if(isNaN(+x))return r();const v={};for(const S of y){if(!S.validate(x,d))return r();const O=S.set(x,v,d);Array.isArray(O)?(x=O[0],Object.assign(v,O[1])):x=O}return x}function XM(e){return e.match(YM)[1].replace(qM,"'")}function ZM(e,t){const n=Et(e,t?.in);return n.setMinutes(0,0,0),n}function QM(e,t){const n=Et(e,t?.in);return n.setSeconds(0,0),n}function JM(e,t){const n=Et(e,t?.in);return n.setMilliseconds(0),n}function Np(e){const t=e/Hr;return Math.trunc(t)}function Bp(e,t){const n=()=>me(t?.in,NaN),i=t?.additionalDigits??2,r=iD(e);let s;if(r.date){const d=rD(r.date,i);s=sD(d.restDateString,d.year)}if(!s||isNaN(+s))return n();const a=+s;let l=0,u;if(r.time&&(l=oD(r.time),isNaN(l)))return n();if(r.timezone){if(u=aD(r.timezone),isNaN(u))return n()}else{const d=new Date(a+l),h=Et(0,t?.in);return h.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),h.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),h}return Et(a+l+u,t?.in)}const ba={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},tD=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,eD=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,nD=/^([+-])(\d{2})(?::?(\d{2}))?$/;function iD(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 rD(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 sD(e,t){if(t===null)return new Date(NaN);const n=e.match(tD);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 fD(t,l,u)?lD(t,l,u):new Date(NaN);{const d=new Date(0);return!uD(t,s,a)||!dD(t,r)?new Date(NaN):(d.setUTCFullYear(t,s,Math.max(r,a)),d)}}function $s(e){return e?parseInt(e):1}function oD(e){const t=e.match(eD);if(!t)return NaN;const n=Xc(t[1]),i=Xc(t[2]),r=Xc(t[3]);return hD(n,i,r)?n*Hr+i*Fs+r*1e3:NaN}function Xc(e){return e&&parseFloat(e.replace(",","."))||0}function aD(e){if(e==="Z")return 0;const t=e.match(nD);if(!t)return 0;const n=t[1]==="+"?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return pD(i,r)?n*(i*Hr+r*Fs):NaN}function lD(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 cD=[31,null,31,30,31,30,31,31,30,31,30,31];function Fp(e){return e%400===0||e%4===0&&e%100!==0}function uD(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(cD[t]||(Fp(e)?29:28))}function dD(e,t){return t>=1&&t<=(Fp(e)?366:365)}function fD(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function hD(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function pD(e,t){return t>=0&&t<=59}const zp={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:"Request cost (avg per million)",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 Up(){const e=mh.createI18n("en-us",zp);return{i18n:e,i18nT:mh.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 Hp(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},Zc=[..."0123456789ABCDEF"],mD=e=>Zc[e&15],gD=e=>Zc[(e&240)>>4]+Zc[e&15],xa=e=>(e&240)>>4===(e&15),_D=e=>xa(e.r)&&xa(e.g)&&xa(e.b)&&xa(e.a);function yD(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 bD=(e,t)=>e<255?t(e):"";function xD(e){var t=_D(e)?mD:gD;return e?"#"+t(e.r)+t(e.g)+t(e.b)+bD(e.a,t):void 0}const wD=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Wp(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 vD(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 SD(e,t,n){const i=Wp(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 TD(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 Qc(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=TD(n,i,r,h,s),u=u*60+.5),[u|0,d||0,l]}function Jc(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(Di)}function tu(e,t,n){return Jc(Wp,e,t,n)}function kD(e,t,n){return Jc(SD,e,t,n)}function MD(e,t,n){return Jc(vD,e,t,n)}function $p(e){return(e%360+360)%360}function DD(e){const t=wD.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?Ys(+t[5]):Di(+t[5]));const r=$p(+t[2]),s=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=kD(r,s,a):t[1]==="hsv"?i=MD(r,s,a):i=tu(r,s,a),{r:i[0],g:i[1],b:i[2],a:n}}function CD(e,t){var n=Qc(e);n[0]=$p(n[0]+t),n=tu(n),e.r=n[0],e.g=n[1],e.b=n[2]}function OD(e){if(!e)return;const t=Qc(e),n=t[0],i=Hp(t[1]),r=Hp(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${r}%, ${ii(e.a)})`:`hsl(${n}, ${i}%, ${r}%)`}const Vp={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Yp={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 AD(){const e={},t=Object.keys(Yp),n=Object.keys(Vp);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,Vp[s]);s=parseInt(Yp[a],16),e[l]=[s>>16&255,s>>8&255,s&255]}return e}let wa;function ED(e){wa||(wa=AD(),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 RD=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function PD(e){const t=RD.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 ID(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${ii(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const eu=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 LD(e,t,n){const i=Vr(ii(e.r)),r=Vr(ii(e.g)),s=Vr(ii(e.b));return{r:Di(eu(i+n*(Vr(ii(t.r))-i))),g:Di(eu(r+n*(Vr(ii(t.g))-r))),b:Di(eu(s+n*(Vr(ii(t.b))-s))),a:e.a+n*(t.a-e.a)}}function va(e,t,n){if(e){let i=Qc(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=tu(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function qp(e,t){return e&&Object.assign(t||{},e)}function jp(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=qp(e,{r:0,g:0,b:0,a:1}),t.a=Di(t.a)),t}function ND(e){return e.charAt(0)==="r"?PD(e):DD(e)}class qs{constructor(t){if(t instanceof qs)return t;const n=typeof t;let i;n==="object"?i=jp(t):n==="string"&&(i=yD(t)||ED(t)||ND(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=qp(this._rgb);return t&&(t.a=ii(t.a)),t}set rgb(t){this._rgb=jp(t)}rgbString(){return this._valid?ID(this._rgb):void 0}hexString(){return this._valid?xD(this._rgb):void 0}hslString(){return this._valid?OD(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=LD(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 CD(this._rgb,t),this}}function ri(){}const BD=(()=>{let e=0;return()=>e++})();function kt(e){return e==null}function jt(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 Nt(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 Ot(e,t){return typeof e>"u"?t:e}const FD=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,Gp=(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(jt(e))for(s=e.length,r=0;r<s;r++)t.call(n,e[r],r);else if(Nt(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(jt(e))return e.map(Ta);if(Nt(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 Kp(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function zD(e,t,n,i){if(!Kp(e))return;const r=t[e],s=n[e];Nt(r)&&Nt(s)?js(r,s,i):t[e]=Ta(s)}function js(e,t,n){const i=jt(t)?t:[t],r=i.length;if(!Nt(e))return e;n=n||{};const s=n.merger||zD;let a;for(let l=0;l<r;++l){if(a=i[l],!Nt(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:UD})}function UD(e,t,n){if(!Kp(e))return;const i=t[e],r=n[e];Nt(i)&&Nt(r)?Gs(i,r):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Ta(r))}const Xp={"":e=>e,x:e=>e.x,y:e=>e.y};function HD(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 WD(e){const t=HD(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function Ci(e,t){return(Xp[t]||(Xp[t]=WD(t)))(e)}function nu(e){return e.charAt(0).toUpperCase()+e.slice(1)}const sn=e=>typeof e<"u",on=e=>typeof e=="function",Zp=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function $D(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Pt=Math.PI,ne=2*Pt,VD=ne+Pt,ka=Number.POSITIVE_INFINITY,iu=Pt/180,oe=Pt/2,Dn=Pt/4,Ma=Pt*2/3,Oi=Math.log10,jn=Math.sign;function Ks(e,t,n){return Math.abs(e-t)<n}function Qp(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 YD(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 qD(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Ai(e){return!qD(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function jD(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function Jp(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*(Pt/180)}function Da(e){return e*(180/Pt)}function tm(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*Pt&&(s+=ne),{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 GD(e,t){return(e-t+VD)%ne-Pt}function We(e){return(e%ne+ne)%ne}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 KD(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 ru(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)=>ru(e,n,i?r=>{const s=e[r][t];return s<n||s===n&&e[r+1][t]===n}:r=>e[r][t]<n),XD=(e,t,n)=>ru(e,n,i=>e[i][t]>=n);function ZD(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 em=["push","pop","shift","splice","unshift"];function QD(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),em.forEach(n=>{const i="_onData"+nu(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 nm(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)&&(em.forEach(s=>{delete e[s]}),delete e._chartjs)}function im(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const rm=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function sm(e,t){let n=[],i=!1;return function(...r){n=r,i||(i=!0,rm.call(window,()=>{i=!1,e.apply(t,n)}))}}function JD(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const su=e=>e==="start"?"left":e==="end"?"right":"center",$e=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,tC=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function om(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:y,maxDefined:x}=a.getUserBounds();if(y){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=>!kt(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(O=>!kt(O[l.axis]));v+=Math.max(0,S)}s=Re(v,r,i)-r}else s=i-r}return{start:r,count:s}}function am(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,lm=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*ne/n)),cm=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*ne/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*oe)+1,easeOutSine:e=>Math.sin(e*oe),easeInOutSine:e=>-.5*(Math.cos(Pt*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:lm(e,.075,.3),easeOutElastic:e=>Oa(e)?e:cm(e,.075,.3),easeInOutElastic(e){return Oa(e)?e:e<.5?.5*lm(e*2,.1125,.45):.5+.5*cm(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 ou(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Aa(e){return ou(e)?e:new qs(e)}function au(e){return ou(e)?e:new qs(e).saturate(.5).darken(.1).hexString()}const eC=["x","y","borderWidth","radius","tension"],nC=["color","borderColor","backgroundColor"];function iC(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:nC},numbers:{type:"number",properties:eC}}),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 rC(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const um=new Map;function sC(e,t){t=t||{};const n=e+JSON.stringify(t);let i=um.get(n);return i||(i=new Intl.NumberFormat(e,t),um.set(n,i)),i}function Qs(e,t,n){return sC(t,n).format(e)}const dm={values(e){return jt(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=oC(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?dm.numeric.call(this,e,t,n):""}};function oC(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:dm};function aC(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),lu=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 cu(e,t,n){return typeof t=="string"?js(Js(e,t),n):js(Js(e,""),t)}class lC{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)=>au(r.backgroundColor),this.hoverBorderColor=(i,r)=>au(r.borderColor),this.hoverColor=(i,r)=>au(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 cu(this,t,n)}get(t){return Js(this,t)}describe(t,n){return cu(lu,t,n)}override(t,n){return cu(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 Nt(u)?Object.assign({},d,u):Ot(u,d)},set(u){this[l]=u}}})}apply(t){t.forEach(n=>n(this))}}var ae=new lC({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[iC,rC,aC]);function cC(e){return!e||kt(e.size)||kt(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 uC(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&&!jt(m))a=Ra(e,r,s,a,m);else if(jt(m))for(d=0,h=m.length;d<h;d++)g=m[d],g!=null&&!jt(g)&&(a=Ra(e,r,s,a,g));e.restore();const y=s.length/2;if(y>n.length){for(u=0;u<y;u++)delete r[s[u]];s.splice(0,y)}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 fm(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function uu(e,t,n,i){hm(e,t,n,i,null)}function hm(e,t,n,i,r){let s,a,l,u,d,h,m,g;const y=t.pointStyle,x=t.rotation,v=t.radius;let S=(x||0)*iu;if(y&&typeof y=="object"&&(s=y.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){e.save(),e.translate(n,i),e.rotate(S),e.drawImage(y,-y.width/2,-y.height/2,y.width,y.height),e.restore();return}if(!(isNaN(v)||v<=0)){switch(e.beginPath(),y){default:r?e.ellipse(n,i,r/2,v,0,0,ne):e.arc(n,i,v,0,ne),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-Pt,S-oe),e.arc(n+g,i-a,d,S-oe,S),e.arc(n+m,i+l,d,S,S+oe),e.arc(n-g,i+a,d,S+oe,S+Pt),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 dC(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 fC(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 hC(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),kt(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 pC(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 mC(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=jt(t)?t:[t],l=s.strokeWidth>0&&s.strokeColor!=="";let u,d;for(e.save(),e.font=r.string,hC(e,s),u=0;u<a.length;++u)d=a[u],s.backdrop&&mC(e,s.backdrop),l&&(s.strokeColor&&(e.strokeStyle=s.strokeColor),kt(s.strokeWidth)||(e.lineWidth=s.strokeWidth),e.strokeText(d,n,i,s.maxWidth)),e.fillText(d,n,i,s.maxWidth),pC(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*Pt,Pt,!0),e.lineTo(n,i+s-a.bottomLeft),e.arc(n+a.bottomLeft,i+s-a.bottomLeft,a.bottomLeft,Pt,oe,!0),e.lineTo(n+r-a.bottomRight,i+s),e.arc(n+r-a.bottomRight,i+s-a.bottomRight,a.bottomRight,oe,0,!0),e.lineTo(n+r,i+a.topRight),e.arc(n+r-a.topRight,i+a.topRight,a.topRight,0,-oe,!0),e.lineTo(n+a.topLeft,i)}const gC=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,_C=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function yC(e,t){const n=(""+e).match(gC);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 bC=e=>+e||0;function du(e,t){const n={},i=Nt(t),r=i?Object.keys(t):t,s=Nt(e)?i?a=>Ot(e[a],e[t[a]]):a=>e[a]:()=>e;for(const a of r)n[a]=bC(s(a));return n}function pm(e){return du(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Ei(e){return du(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Se(e){const t=pm(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function ce(e,t){e=e||{},t=t||ae.font;let n=Ot(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=Ot(e.style,t.style);i&&!(""+i).match(_C)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:Ot(e.family,t.family),lineHeight:yC(Ot(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:Ot(e.weight,t.weight),string:""};return r.string=cC(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 xC(e,t,n){const{min:i,max:r}=e,s=Gp(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 fu(e,t=[""],n,i,r=()=>e[0]){const s=n||e;typeof i>"u"&&(i=bm("_fallback",e));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:s,_fallback:i,_getTarget:r,override:l=>fu([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 gm(l,u,()=>CC(u,t,e,l))},getOwnPropertyDescriptor(l,u){return Reflect.getOwnPropertyDescriptor(l._scopes[0],u)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(l,u){return xm(l).includes(u)},ownKeys(l){return xm(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:mm(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 gm(s,a,()=>vC(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 mm(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:on(n)?n:()=>n,isIndexable:on(i)?i:()=>i}}const wC=(e,t)=>e?e+nu(t):t,hu=(e,t)=>Nt(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function gm(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const i=n();return e[t]=i,i}function vC(e,t,n){const{_proxy:i,_context:r,_subProxy:s,_descriptors:a}=e;let l=i[t];return on(l)&&a.isScriptable(t)&&(l=SC(t,l,e,n)),jt(l)&&l.length&&(l=TC(t,l,e,a.isIndexable)),hu(t,l)&&(l=jr(l,r,s&&s[t],a)),l}function SC(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),hu(e,u)&&(u=pu(r._scopes,r,e,u)),u}function TC(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(Nt(t[0])){const u=t,d=r._scopes.filter(h=>h!==u);t=[];for(const h of u){const m=pu(d,r,e,h);t.push(jr(m,s,a&&a[e],l))}}return t}function _m(e,t,n){return on(e)?e(t,n):e}const kC=(e,t)=>e===!0?t:typeof e=="string"?Ci(t,e):void 0;function MC(e,t,n,i,r){for(const s of t){const a=kC(n,s);if(a){e.add(a);const l=_m(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 pu(e,t,n,i){const r=t._rootScopes,s=_m(t._fallback,n,i),a=[...e,...r],l=new Set;l.add(i);let u=ym(l,a,n,s||n,i);return u===null||typeof s<"u"&&s!==n&&(u=ym(l,a,s,u,i),u===null)?!1:fu(Array.from(l),[""],r,s,()=>DC(t,n,i))}function ym(e,t,n,i,r){for(;n;)n=MC(e,t,n,i,r);return n}function DC(e,t,n){const i=e._getTarget();t in i||(i[t]={});const r=i[t];return jt(r)&&Nt(n)?n:r||{}}function CC(e,t,n,i){let r;for(const s of t)if(r=bm(wC(s,e),n),typeof r<"u")return hu(e,r)?pu(n,i,e,r):r}function bm(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function xm(e){let t=e._keys;return t||(t=e._keys=OC(e._scopes)),t}function OC(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 wm(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 AC=Number.EPSILON||1e-14,Gr=(e,t)=>t<e.length&&!e[t].skip&&e[t],vm=e=>e==="x"?"y":"x";function EC(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 RC(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,AC)){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 PC(e,t,n="x"){const i=vm(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 IC(e,t="x"){const n=vm(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]}RC(e,r,s),PC(e,s,t)}function Pa(e,t,n){return Math.max(Math.min(e,n),t)}function LC(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 NC(e,t,n,i,r){let s,a,l,u;if(t.spanGaps&&(e=e.filter(d=>!d.skip)),t.cubicInterpolationMode==="monotone")IC(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=EC(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&&LC(e,n)}function mu(){return typeof window<"u"&&typeof document<"u"}function gu(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 BC(e,t){return La(e).getPropertyValue(t)}const FC=["top","right","bottom","left"];function dr(e,t,n){const i={};n=n?"-"+n:"";for(let r=0;r<4;r++){const s=FC[r];i[s]=parseFloat(e[t+"-"+s+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const zC=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function UC(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:r,offsetY:s}=i;let a=!1,l,u;if(zC(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}=UC(e,n),m=a.left+(h&&l.left),g=a.top+(h&&l.top);let{width:y,height:x}=t;return s&&(y-=a.width+l.width,x-=a.height+l.height),{x:Math.round((u-m)/y*n.width/i),y:Math.round((d-g)/x*n.height/i)}}function HC(e,t,n){let i,r;if(t===void 0||n===void 0){const s=e&&gu(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 WC(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=HC(e,t,n);let{width:d,height:h}=u;if(r.boxSizing==="content-box"){const g=dr(r,"border","width"),y=dr(r,"padding");d-=y.width+g.width,h-=y.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 Sm(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 $C=(function(){let e=!1;try{const t={get passive(){return e=!0,!1}};mu()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();function Tm(e,t){const n=BC(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 VC(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 YC(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 qC=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}}},jC=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?qC(t,n):jC()}function km(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 Mm(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function Dm(e){return e==="angle"?{between:Xs,compare:GD,normalize:We}:{between:si,compare:(t,n)=>t-n,normalize:t=>t}}function Cm({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 GC(e,t,n){const{property:i,start:r,end:s}=n,{between:a,normalize:l}=Dm(i),u=t.length;let{start:d,end:h,loop:m}=e,g,y;if(m){for(d+=u,h+=u,g=0,y=u;g<y&&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 Om(e,t,n){if(!n)return[e];const{property:i,start:r,end:s}=n,a=t.length,{compare:l,between:u,normalize:d}=Dm(i),{start:h,end:m,loop:g,style:y}=GC(e,t,n),x=[];let v=!1,S=null,O,A,P;const L=()=>u(r,P,O)&&l(r,P)!==0,R=()=>l(s,O)===0||u(s,P,O),F=()=>v||L(),U=()=>!v||R();for(let D=h,w=h;D<=m;++D)A=t[D%a],!A.skip&&(O=d(A[i]),O!==P&&(v=u(O,r,s),S===null&&F()&&(S=l(O,r)===0?D:w),S!==null&&U()&&(x.push(Cm({start:S,end:D,loop:g,count:a,style:y})),S=null),w=D,P=O));return S!==null&&x.push(Cm({start:S,end:m,loop:g,count:a,style:y})),x}function Am(e,t){const n=[],i=e.segments;for(let r=0;r<i.length;r++){const s=Om(i[r],e.points,t);s.length&&n.push(...s)}return n}function KC(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 XC(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 ZC(e,t){const n=e.points,i=e.options.spanGaps,r=n.length;if(!r)return[];const s=!!e._loop,{start:a,end:l}=KC(n,r,s,i);if(i===!0)return Em(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 Em(e,XC(n,a,u,d),n,t)}function Em(e,t,n,i){return!i||!i.setContext||!n?t:QC(e,t,n,i)}function QC(e,t,n,i){const r=e._chart.getContext(),s=Rm(e.options),{_datasetIndex:a,options:{spanGaps:l}}=e,u=n.length,d=[];let h=s,m=t[0].start,g=m;function y(x,v,S,O){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:O}),h=O,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 O=n[g%u];S=Rm(i.setContext(Ri(r,{type:"segment",p0:v,p1:O,p0DataIndex:(g-1)%u,p1DataIndex:g%u,datasetIndex:a}))),JC(S,h)&&y(m,g-1,x.loop,h),v=O,h=S}m<g-1&&y(m,g-1,x.loop,h)}return d}function Rm(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function JC(e,t){if(!t)return!1;const n=[],i=function(r,s){return ou(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 tO(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 Pm(e,t){const n=t._clip;if(n.disabled)return!1;const i=tO(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 eO{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=rm.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 eO;const Im="transparent",nO={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=Aa(e||Im),r=i.valid&&Aa(t||Im);return r&&r.valid?r.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class iO{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||nO[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 _u{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Nt(t))return;const n=Object.keys(ae.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{const s=t[r];if(!Nt(s))return;const a={};for(const l of n)a[l]=s[l];(jt(s.properties)&&s.properties||[r]).forEach(l=>{(l===r||!i.has(l))&&i.set(l,a)})})}_animateOptions(t,n){const i=n.options,r=sO(t,i);if(!r)return[];const s=this._createAnimations(r,i);return i.$shared&&rO(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 iO(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 rO(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 sO(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 Lm(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 oO(e,t,n){if(n===!1)return!1;const i=Lm(e,n),r=Lm(t,n);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}function aO(e){let t,n,i,r;return Nt(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 Nm(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 Bm(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 lO(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 cO(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function uO(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 dO(e,t,n){const i=e[t]||(e[t]={});return i[n]||(i[n]={})}function Fm(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 zm(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=cO(s,a,i),m=t.length;let g;for(let y=0;y<m;++y){const x=t[y],{[u]:v,[d]:S}=x,O=x._stacks||(x._stacks={});g=O[d]=dO(r,h,v),g[l]=S,g._top=Fm(g,a,!0,i.type),g._bottom=Fm(g,a,!1,i.type);const A=g._visualValues||(g._visualValues={});A[l]=S}}function bu(e,t){const n=e.scales;return Object.keys(n).filter(i=>n[i].axis===t).shift()}function fO(e,t){return Ri(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function hO(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 xu=e=>e==="reset"||e==="none",Um=(e,t)=>t?e:Object.assign({},e),pO=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Nm(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,y,x)=>m==="x"?g:m==="r"?x:y,s=n.xAxisID=Ot(i.xAxisID,bu(t,"x")),a=n.yAxisID=Ot(i.yAxisID,bu(t,"y")),l=n.rAxisID=Ot(i.rAxisID,bu(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&&nm(this._data,this),t._stacked&&io(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(Nt(n)){const r=this._cachedMeta;this._data=lO(n,r)}else if(i!==n){if(i){nm(i,this);const r=this._cachedMeta;io(r),r._parsed=[]}n&&Object.isExtensible(n)&&QD(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)&&(zm(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{jt(r[t])?g=this.parseArrayData(i,r,t,n):Nt(r[t])?g=this.parseObjectData(i,r,t,n):g=this.parsePrimitiveData(i,r,t,n);const y=()=>m[l]===null||d&&m[l]<d[l];for(h=0;h<n;++h)i._parsed[h+t]=m=g[h],u&&(y()&&(u=!1),d=m);i._sorted=u}a&&zm(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,y,x;for(g=0,y=r;g<y;++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,y;for(h=0,m=r;h<m;++h)g=h+i,y=n[g],d[h]={x:s.parse(Ci(y,l),g),y:a.parse(Ci(y,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:Nm(r,!0),values:n._stacks[t.axis]._visualValues};return Bm(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=Bm(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=pO(n,i,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:m}=uO(l);let g,y;function x(){y=r[g];const v=y[l.axis];return!le(y[t.axis])||h>v||m<v}for(g=0;g<a&&!(!x()&&(this.updateRangeFromParsed(d,t,y,u),s));++g);if(s){for(g=a-1;g>=0;--g)if(!x()){this.updateRangeFromParsed(d,t,y,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=aO(Ot(this.options.clip,oO(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=hO(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=fO(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&&sn(i);if(l)return Um(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),y=Object.keys(ae.elements[t]),x=()=>this.getContext(i,r,n),v=d.resolveNamedOptions(g,y,x,m);return v.$shared&&(v.$shared=u,s[a]=Object.freeze(Um(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 _u(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||xu(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){xu(r)?Object.assign(t,i):this._resolveAnimations(n,r).update(t,i)}updateSharedOptions(t,n,i){t&&!xu(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 mO(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=im(i.sort((r,s)=>r-s))}return e._cache.$bar}function gO(e){const t=e.iScale,n=mO(t,e.type);let i=t._length,r,s,a,l;const u=()=>{a===32767||a===-32768||(sn(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 _O(e,t,n,i){const r=n.barThickness;let s,a;return kt(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 yO(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 bO(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 Hm(e,t,n,i){return jt(e)?bO(e,t,n,i):t[n.axis]=n.parse(e,i),t}function Wm(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(Hm(g,m,s,d));return u}function wu(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function xO(e,t,n){return e!==0?jn(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function wO(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 vO(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}=wO(e);r==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===i?r=d:(n._bottom||0)===i?r=h:(s[$m(h,a,l,u)]=!0,r=d)),s[$m(r,a,l,u)]=!0,e.borderSkipped=s}function $m(e,t,n,i){return i?(e=SO(e,t,n),e=Vm(e,n,t)):e=Vm(e,t,n),e}function SO(e,t,n){return e===t?n:e===n?t:e}function Vm(e,t,n){return e==="start"?t:e==="end"?n:e}function TO(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class Ym 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 Wm(t,n,i,r)}parseArrayData(t,n,i,r){return Wm(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,y,x,v;for(g=i,y=i+r;g<y;++g)v=n[g],x={},x[s.axis]=s.parse(Ci(v,d),g),m.push(Hm(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=wu(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 y=n;y<n+i;y++){const x=this.getParsed(y),v=s||kt(x[l.axis])?{base:u,head:u}:this._calculateBarValuePixels(y),S=this._calculateBarIndexPixels(y,h),O=(x._stacks||{})[l.axis],A={horizontal:d,base:v.base,enableBorderRadius:!O||wu(x._custom)||a===O._top||a===O._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(y,t[y].active?"active":r));const P=A.options||t[y].options;vO(A,P,O,a),TO(A,P,h.ratio),this.updateElement(t[y],y,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(y=>y[i.axis]===u),g=m&&m[h.vScale.axis];if(kt(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[Ot(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||gO(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=wu(d);let m=u[n.axis],g=0,y=i?this.applyStack(n,u,i):m,x,v;y!==m&&(g=y-m,y=m),h&&(m=d.barStart,y=d.barEnd-d.barStart,m!==0&&jn(m)!==jn(d.barEnd)&&(g=0),g+=m);const S=!kt(s)&&!h?s:g;let O=n.getPixelForValue(S);if(this.chart.getDataVisibility(t)?x=n.getPixelForValue(g+y):x=O,v=x-O,Math.abs(v)<a){v=xO(v,n,l)*a,m===l&&(O-=v/2);const A=n.getPixelForDecimal(0),P=n.getPixelForDecimal(1),L=Math.min(A,P),R=Math.max(A,P);O=Math.max(Math.min(O,R),L),x=O+v,i&&!h&&(u._stacks[n.axis]._visualValues[r]=n.getValueForPixel(x)-n.getValueForPixel(O))}if(O===n.getPixelForValue(l)){const A=jn(v)*n.getLineWidthForValue(l)/2;O+=A,v-=A}return{size:v,base:O,head:x,center:x+v/2}}_calculateBarIndexPixels(t,n){const i=n.scale,r=this.options,s=r.skipNull,a=Ot(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"?yO(t,n,r,h*d):_O(t,n,r,h*d),g=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,y=this._getAxis().indexOf(Ot(g,this.getFirstScaleIdForIndexAxis())),x=this._getStackIndex(this.index,this._cachedMeta.stack,s?t:void 0)+y;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 kO 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=Ot(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=Ot(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 y=t[g],x=!s&&this.getParsed(g),v={},S=v[h]=s?a.getPixelForDecimal(.5):a.getPixelForValue(x[h]),O=v[m]=s?l.getBasePixel():l.getPixelForValue(x[m]);v.skip=isNaN(S)||isNaN(O),d&&(v.options=u||this.resolveDataElementOptions(g,y.active?"active":r),s&&(v.options.radius=0)),this.updateElement(y,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+=Ot(i&&i._custom,s),r}}function MO(e,t,n){let i=1,r=1,s=0,a=0;if(t<ne){const l=e,u=l+t,d=Math.cos(l),h=Math.sin(l),m=Math.cos(u),g=Math.sin(u),y=(P,L,R)=>Xs(P,l,u,!0)?1:Math.max(L,L*n,R,R*n),x=(P,L,R)=>Xs(P,l,u,!0)?-1:Math.min(L,L*n,R,R*n),v=y(0,d,m),S=y(oe,h,g),O=x(Pt,d,m),A=x(Pt+oe,h,g);i=(v-O)/2,r=(S-A)/2,s=-(v+O)/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(Nt(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=ne,n=-ne;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(FD(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:h,rotation:m}=this._getRotationExtents(),{ratioX:g,ratioY:y,offsetX:x,offsetY:v}=MO(m,h,u),S=(i.width-a)/g,O=(i.height-a)/y,A=Math.max(Math.min(S,O)/2,0),P=Gp(this.options.radius,A),L=Math.max(P*u,0),R=(P-L)/this._getVisibleDatasetWeightTotal();this.offsetX=x*P,this.offsetY=v*P,r.total=this.calculateTotal(),this.outerRadius=P-R*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-R*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/ne)}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,y=g?0:this.innerRadius,x=g?0:this.outerRadius,{sharedOptions:v,includeOptions:S}=this._getSharedOptions(n,r);let O=this._getRotation(),A;for(A=0;A<n;++A)O+=this._circumference(A,s);for(A=n;A<n+i;++A){const P=this._circumference(A,s),L=t[A],R={x:h+this.offsetX,y:m+this.offsetY,startAngle:O,endAngle:O+P,circumference:P,outerRadius:x,innerRadius:y};S&&(R.options=v||this.resolveDataElementOptions(A,L.active?"active":r)),O+=P,this.updateElement(L,A,R,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)?ne*(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(Ot(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class qm 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}=om(n,r,a);this._drawStart=l,this._drawCount=u,am(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,y=l.axis,{spanGaps:x,segment:v}=this.options,S=Ai(x)?x:Number.POSITIVE_INFINITY,O=this.chart._animationsDisabled||s||r==="none",A=n+i,P=t.length;let L=n>0&&this.getParsed(n-1);for(let R=0;R<P;++R){const F=t[R],U=O?F:{};if(R<n||R>=A){U.skip=!0;continue}const D=this.getParsed(R),w=kt(D[y]),C=U[g]=a.getPixelForValue(D[g],R),N=U[y]=s||w?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,D,u):D[y],R);U.skip=isNaN(C)||isNaN(N)||w,U.stop=R>0&&Math.abs(D[g]-L[g])>S,v&&(U.parsed=D,U.raw=d.data[R]),m&&(U.options=h||this.resolveDataElementOptions(R,F.active?"active":r)),O||this.updateElement(F,R,U,r),L=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 jm 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 wm.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*Pt;let y=g,x;const v=360/this.countVisibleElements();for(x=0;x<n;++x)y+=this._computeAngle(x,r,v);for(x=n;x<n+i;x++){const S=t[x];let O=y,A=y+this._computeAngle(x,r,v),P=a.getDataVisibility(x)?d.getDistanceFromCenterForValue(this.getParsed(x).r):0;y=A,s&&(u.animateScale&&(P=0),u.animateRotate&&(O=A=g));const L={x:h,y:m,innerRadius:0,outerRadius:P,startAngle:O,endAngle:A,options:this.resolveDataElementOptions(x,S.active?"active":r)};this.updateElement(S,x,L,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 DO extends ro{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class CO 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 wm.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,y={x:m,y:g,angle:h.angle,skip:isNaN(m)||isNaN(g),options:d};this.updateElement(u,l,y,r)}}}class Gm 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}=om(n,i,r);if(this._drawStart=s,this._drawCount=a,am(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),y=a.axis,x=l.axis,{spanGaps:v,segment:S}=this.options,O=Ai(v)?v:Number.POSITIVE_INFINITY,A=this.chart._animationsDisabled||s||r==="none";let P=n>0&&this.getParsed(n-1);for(let L=n;L<n+i;++L){const R=t[L],F=this.getParsed(L),U=A?R:{},D=kt(F[x]),w=U[y]=a.getPixelForValue(F[y],L),C=U[x]=s||D?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,F,u):F[x],L);U.skip=isNaN(w)||isNaN(C)||D,U.stop=L>0&&Math.abs(F[y]-P[y])>O,S&&(U.parsed=F,U.raw=d.data[L]),g&&(U.options=m||this.resolveDataElementOptions(L,R.active?"active":r)),A||this.updateElement(R,L,U,r),P=F}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 OO=Object.freeze({__proto__:null,BarController:Ym,BubbleController:kO,DoughnutController:ro,LineController:qm,PieController:DO,PolarAreaController:jm,RadarController:CO,ScatterController:Gm});function hr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class vu{static override(t){Object.assign(vu.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 Km={_date:vu};function AO(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?XD: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),y=d(s,t,n+m);return{lo:g.lo,hi:y.hi}}}}else{const h=d(s,t,n);if(u){const{vScale:m}=r._cachedMeta,{_parsed:g}=e,y=g.slice(0,h.lo+1).reverse().findIndex(v=>!kt(v[m.axis]));h.lo-=Math.max(0,y);const x=g.slice(h.hi).findIndex(v=>!kt(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}=AO(s[l],t,a,r);for(let y=m;y<=g;++y){const x=h[y];x.skip||i(x,d,y)}}}function EO(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 Su(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 RO(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 PO(e,t,n,i,r,s){let a=[];const l=EO(n);let u=Number.POSITIVE_INFINITY;function d(h,m,g){const y=h.inRange(t.x,t.y,r);if(i&&!y)return;const x=h.getCenterPoint(r);if(!(!!s||e.isPointInArea(x))&&!y)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 Tu(e,t,n,i,r,s){return!s&&!e.isPointInArea(t)?[]:n==="r"&&!i?RO(e,t,n,r):PO(e,t,n,i,r,s)}function Xm(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 ku={evaluateInteractionItems:so,modes:{index(e,t,n,i){const r=Pi(t,e),s=n.axis||"x",a=n.includeInvisible||!1,l=n.intersect?Su(e,r,s,i,a):Tu(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?Su(e,r,s,i,a):Tu(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 Su(e,r,s,i,a)},nearest(e,t,n,i){const r=Pi(t,e),s=n.axis||"xy",a=n.includeInvisible||!1;return Tu(e,r,s,n.intersect,i,a)},x(e,t,n,i){const r=Pi(t,e);return Xm(e,r,"x",n.intersect,i)},y(e,t,n,i){const r=Pi(t,e);return Xm(e,r,"y",n.intersect,i)}}};const Zm=["left","top","right","bottom"];function oo(e,t){return e.filter(n=>n.pos===t)}function Qm(e,t){return e.filter(n=>Zm.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 IO(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 LO(e){const t={};for(const n of e){const{stack:i,pos:r,stackWeight:s}=n;if(!i||!Zm.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 NO(e,t){const n=LO(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 BO(e){const t=IO(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=Qm(t,"x"),u=Qm(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 Jm(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function tg(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 FO(e,t,n,i){const{pos:r,box:s}=n,a=e.maxPadding;if(!Nt(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&&tg(a,s.getPadding());const l=Math.max(0,t.outerWidth-Jm(a,e,"left","right")),u=Math.max(0,t.outerHeight-Jm(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 zO(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 UO(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,UO(l.horizontal,t));const{same:m,other:g}=FO(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 eg(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;sn(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;sn(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=BO(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);tg(g,Se(i));const y=Object.assign({maxPadding:g,w:s,h:a,x:r.left,y:r.top},r),x=NO(u.concat(d),m);lo(l.fullSize,y,m,x),lo(u,y,m,x),lo(d,y,m,x)&&lo(u,y,m,x),zO(y),eg(l.leftAndTop,y,m,x),y.x+=y.w,y.y+=y.h,eg(l.rightAndBottom,y,m,x),e.chartArea={left:y.left,top:y.top,right:y.left+y.w,bottom:y.top+y.h,height:y.h,width:y.w},te(l.chartArea,v=>{const S=v.box;Object.assign(S,e.chartArea),S.update(y.w,y.h,{left:0,top:0,right:0,bottom:0})})}};class ng{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 HO extends ng{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Fa="$chartjs",WO={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ig=e=>e===null||e==="";function $O(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",ig(r)){const s=Tm(e,"width");s!==void 0&&(e.width=s)}if(ig(i))if(e.style.height==="")e.height=e.width/(t||2);else{const s=Tm(e,"height");s!==void 0&&(e.height=s)}return e}const rg=$C?{passive:!0}:!1;function VO(e,t,n){e&&e.addEventListener(t,n,rg)}function YO(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,rg)}function qO(e,t){const n=WO[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 jO(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 GO(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 sg=0;function og(){const e=window.devicePixelRatio;e!==sg&&(sg=e,co.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function KO(e,t){co.size||window.addEventListener("resize",og),co.set(e,t)}function XO(e){co.delete(e),co.size||window.removeEventListener("resize",og)}function ZO(e,t,n){const i=e.canvas,r=i&&gu(i);if(!r)return;const s=sm((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),KO(e,s),a}function Mu(e,t,n){n&&n.disconnect(),t==="resize"&&XO(e)}function QO(e,t,n){const i=e.canvas,r=sm(s=>{e.ctx!==null&&n(qO(s,e))},e);return VO(i,t,r),r}class JO extends ng{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?($O(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];kt(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:jO,detach:GO,resize:ZO}[n]||QO;r[n]=a(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),r=i[n];if(!r)return;({attach:Mu,detach:Mu,resize:Mu}[n]||YO)(t,n,r),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,r){return WC(t,n,i,r)}isAttached(t){const n=t&&gu(t);return!!(n&&n.isConnected)}}function tA(e){return!mu()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?HO:JO}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 eA(e,t){const n=e.options.ticks,i=nA(e),r=Math.min(n.maxTicksLimit||i,i),s=n.major.enabled?rA(t):[],a=s.length,l=s[0],u=s[a-1],d=[];if(a>r)return sA(t,d,s,a/r),d;const h=iA(s,t,r);if(a>0){let m,g;const y=a>1?Math.round((u-l)/(a-1)):null;for(Ua(t,d,h,kt(y)?0:l-y,l),m=0,g=a-1;m<g;m++)Ua(t,d,h,s[m],s[m+1]);return Ua(t,d,h,u,kt(y)?t.length:u+y),d}return Ua(t,d,h),d}function nA(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 iA(e,t,n){const i=oA(e),r=t.length/n;if(!i)return Math.max(r,1);const s=YD(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 rA(e){const t=[];let n,i;for(n=0,i=e.length;n<i;n++)e[n].major&&t.push(n);return t}function sA(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=Ot(i,0),a=Math.min(Ot(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 oA(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 aA=e=>e==="left"?"right":e==="right"?"left":e,ag=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,lg=(e,t)=>Math.min(t||e,e);function cg(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 lA(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 cA(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 ug(e,t){if(!e.display)return 0;const n=ce(e.font,t),i=Se(e.padding);return(jt(e.text)?e.text.length:1)*n.lineHeight+i.height}function uA(e,t){return Ri(e,{scale:t,type:"scale"})}function dA(e,t,n){return Ri(e,{tick:n,index:t,type:"tick"})}function fA(e,t,n){let i=su(e);return(n&&t!=="right"||!n&&t==="right")&&(i=aA(i)),i}function hA(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,y,x;const v=a-r,S=l-s;if(e.isHorizontal()){if(y=$e(i,s,l),Nt(n)){const O=Object.keys(n)[0],A=n[O];x=h[O].getPixelForValue(A)+v-t}else n==="center"?x=(d.bottom+d.top)/2+v-t:x=ag(e,n,t);g=l-s}else{if(Nt(n)){const O=Object.keys(n)[0],A=n[O];y=h[O].getPixelForValue(A)-S+t}else n==="center"?y=(d.left+d.right)/2-S+t:y=ag(e,n,t);x=$e(i,a,r),m=n==="left"?-oe:oe}return{titleX:y,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=xC(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const u=l<this.ticks.length;this._convertTicksToLabels(u?cg(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=eA(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=lg(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,y=Re(this.chart.width-m,0,this.maxWidth);l=t.offset?this.maxWidth/i:y/(i-1),m+6>l&&(l=y/(i-(t.offset?.5:1)),u=this.maxHeight-uo(t.grid)-n.padding-ug(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=ug(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(),y=i.padding*2,x=ve(this.labelRotation),v=Math.cos(x),S=Math.sin(x);if(l){const O=i.mirror?0:S*m.width+v*g.height;t.height=Math.min(this.maxHeight,t.height+O+y)}else{const O=i.mirror?0:v*m.width+S*g.height;t.width=Math.min(this.maxWidth,t.width+O+y)}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,y=0;u?d?(g=r*t.width,y=i*n.height):(g=i*t.height,y=r*n.width):s==="start"?y=n.width:s==="end"?g=t.width:s!=="inner"&&(g=t.width/2,y=n.width/2),this.paddingLeft=Math.max((g-h+a)*this.width/(this.width-h),0),this.paddingRight=Math.max((y-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++)kt(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=cg(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/lg(n,i));let d=0,h=0,m,g,y,x,v,S,O,A,P,L,R;for(m=0;m<n;m+=u){if(x=t[m].label,v=this._resolveTickFontOptions(m),r.font=S=v.string,O=s[S]=s[S]||{data:{},gc:[]},A=v.lineHeight,P=L=0,!kt(x)&&!jt(x))P=Ra(r,O.data,O.gc,P,x),L=A;else if(jt(x))for(g=0,y=x.length;g<y;++g)R=x[g],!kt(R)&&!jt(R)&&(P=Ra(r,O.data,O.gc,P,R),L+=A);a.push(P),l.push(L),d=Math.max(P,d),h=Math.max(L,h)}cA(s,n);const F=a.indexOf(d),U=l.indexOf(h),D=w=>({width:a[w]||0,height:l[w]||0});return{first:D(0),last:D(n-1),widest:D(F),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 KD(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=dA(this.getContext(),t,i))}return this.$context||(this.$context=uA(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),y=[],x=l.setContext(this.getContext()),v=x.display?x.width:0,S=v/2,O=function(ut){return cr(i,ut,v)};let A,P,L,R,F,U,D,w,C,N,$,V;if(a==="top")A=O(this.bottom),U=this.bottom-g,w=A-S,N=O(t.top)+S,V=t.bottom;else if(a==="bottom")A=O(this.top),N=t.top,V=O(t.bottom)-S,U=A+S,w=this.top+g;else if(a==="left")A=O(this.right),F=this.right-g,D=A-S,C=O(t.left)+S,$=t.right;else if(a==="right")A=O(this.left),C=t.left,$=O(t.right)-S,F=A+S,D=this.left+g;else if(n==="x"){if(a==="center")A=O((t.top+t.bottom)/2+.5);else if(Nt(a)){const ut=Object.keys(a)[0],ct=a[ut];A=O(this.chart.scales[ut].getPixelForValue(ct))}N=t.top,V=t.bottom,U=A+S,w=U+g}else if(n==="y"){if(a==="center")A=O((t.left+t.right)/2);else if(Nt(a)){const ut=Object.keys(a)[0],ct=a[ut];A=O(this.chart.scales[ut].getPixelForValue(ct))}F=A-S,D=F-g,C=t.left,$=t.right}const st=Ot(r.ticks.maxTicksLimit,m),dt=Math.max(1,Math.ceil(m/st));for(P=0;P<m;P+=dt){const ut=this.getContext(P),ct=s.setContext(ut),Tt=l.setContext(ut),at=ct.lineWidth,pt=ct.color,G=Tt.dash||[],B=Tt.dashOffset,z=ct.tickWidth,Z=ct.tickColor,it=ct.tickBorderDash||[],ht=ct.tickBorderDashOffset;L=lA(this,P,u),L!==void 0&&(R=cr(i,L,at),d?F=D=C=$=R:U=w=N=V=R,y.push({tx1:F,ty1:U,tx2:D,ty2:w,x1:C,y1:N,x2:$,y2:V,width:at,color:pt,borderDash:G,borderDashOffset:B,tickWidth:z,tickColor:Z,tickBorderDash:it,tickBorderDashOffset:ht}))}return this._ticksLength=m,this._borderValue=A,y}_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),y=g+h,x=m?-h:y,v=-ve(this.labelRotation),S=[];let O,A,P,L,R,F,U,D,w,C,N,$,V="middle";if(r==="top")F=this.bottom-x,U=this._getXAxisLabelAlignment();else if(r==="bottom")F=this.top+x,U=this._getXAxisLabelAlignment();else if(r==="left"){const dt=this._getYAxisLabelAlignment(g);U=dt.textAlign,R=dt.x}else if(r==="right"){const dt=this._getYAxisLabelAlignment(g);U=dt.textAlign,R=dt.x}else if(n==="x"){if(r==="center")F=(t.top+t.bottom)/2+y;else if(Nt(r)){const dt=Object.keys(r)[0],ut=r[dt];F=this.chart.scales[dt].getPixelForValue(ut)+y}U=this._getXAxisLabelAlignment()}else if(n==="y"){if(r==="center")R=(t.left+t.right)/2-y;else if(Nt(r)){const dt=Object.keys(r)[0],ut=r[dt];R=this.chart.scales[dt].getPixelForValue(ut)}U=this._getYAxisLabelAlignment(g).textAlign}n==="y"&&(u==="start"?V="top":u==="end"&&(V="bottom"));const st=this._getLabelSizes();for(O=0,A=l.length;O<A;++O){P=l[O],L=P.label;const dt=s.setContext(this.getContext(O));D=this.getPixelForTick(O)+s.labelOffset,w=this._resolveTickFontOptions(O),C=w.lineHeight,N=jt(L)?L.length:1;const ut=N/2,ct=dt.color,Tt=dt.textStrokeColor,at=dt.textStrokeWidth;let pt=U;a?(R=D,U==="inner"&&(O===A-1?pt=this.options.reverse?"left":"right":O===0?pt=this.options.reverse?"right":"left":pt="center"),r==="top"?d==="near"||v!==0?$=-N*C+C/2:d==="center"?$=-st.highest.height/2-ut*C+C:$=-st.highest.height+C/2:d==="near"||v!==0?$=C/2:d==="center"?$=st.highest.height/2-ut*C:$=st.highest.height-N*C,m&&($*=-1),v!==0&&!dt.showLabelBackdrop&&(R+=C/2*Math.sin(v))):(F=D,$=(1-N)*C/2);let G;if(dt.showLabelBackdrop){const B=Se(dt.backdropPadding),z=st.heights[O],Z=st.widths[O];let it=$-B.top,ht=0-B.left;switch(V){case"middle":it-=z/2;break;case"bottom":it-=z;break}switch(U){case"center":ht-=Z/2;break;case"right":ht-=Z;break;case"inner":O===A-1?ht-=Z:O>0&&(ht-=Z/2);break}G={left:ht,top:it,width:Z+B.width,height:z+B.height,color:dt.backdropColor}}S.push({label:L,font:w,textOffset:$,options:{rotation:v,color:ct,strokeColor:Tt,strokeWidth:at,textAlign:pt,textBaseline:V,translation:[R,F],backdrop:G}})}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"||Nt(n)?(u+=a.bottom,jt(i.text)&&(u+=s.lineHeight*(i.text.length-1))):u+=a.top;const{titleX:d,titleY:h,maxWidth:m,rotation:g}=hA(this,u,n,l);ur(t,i.text,0,0,s,{color:i.color,maxWidth:m,rotation:g,textAlign:fA(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=Ot(t.grid&&t.grid.z,-1),r=Ot(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;gA(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,pA(t,a,i),this.override&&ae.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 ae[r]&&(delete ae[r][i],this.override&&delete lr[i])}}function pA(e,t,n){const i=js(Object.create(null),[n?ae.get(n):{},ae.get(t),e.defaults]);ae.set(t,i),e.defaultRoutes&&mA(t,e.defaultRoutes),e.descriptors&&ae.describe(t,e.descriptors)}function mA(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(".");ae.route(s,r,u,l)})}function gA(e){return"id"in e&&"defaults"in e}class _A{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=nu(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 _A;class yA{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(){kt(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=Ot(i.options&&i.options.plugins,{}),s=bA(i);return r===!1&&!n?[]:wA(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 bA(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 xA(e,t){return!t&&e===!1?null:e===!0?{}:e}function wA(e,{plugins:t,localIds:n},i,r){const s=[],a=e.getContext();for(const l of t){const u=l.id,d=xA(i[u],r);d!==null&&s.push({plugin:l,options:vA(e.config,{plugin:l,local:n[u]},d,a)})}return s}function vA(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 Du(e,t){const n=ae.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function SA(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function TA(e,t){return e===t?"_index_":"_value_"}function dg(e){if(e==="x"||e==="y"||e==="r")return e}function kA(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Cu(e,...t){if(dg(e))return e;for(const n of t){const i=n.axis||kA(n.position)||e.length>1&&dg(e[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function fg(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function MA(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 fg(e,"x",n[0])||fg(e,"y",n[0])}return{}}function DA(e,t){const n=lr[e.type]||{scales:{}},i=t.scales||{},r=Du(e.type,t),s=Object.create(null);return Object.keys(i).forEach(a=>{const l=i[a];if(!Nt(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=Cu(a,l,MA(a,e),ae.scales[l.type]),d=TA(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||Du(l,t),h=(lr[l]||{}).scales||{};Object.keys(h).forEach(m=>{const g=SA(m,u),y=a[g+"AxisID"]||g;s[y]=s[y]||Object.create(null),Gs(s[y],[{axis:g},i[y],h[m]])})}),Object.keys(s).forEach(a=>{const l=s[a];Gs(l,[ae.scales[l.type],ae.scale])}),s}function hg(e){const t=e.options||(e.options={});t.plugins=Ot(t.plugins,{}),t.scales=DA(e,t)}function pg(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function CA(e){return e=e||{},e.data=pg(e.data),hg(e),e}const mg=new Map,gg=new Set;function Wa(e,t){let n=mg.get(e);return n||(n=t(),mg.set(e,n),gg.add(n)),n}const fo=(e,t,n)=>{const i=Ci(t,n);i!==void 0&&e.add(i)};class OA{constructor(t){this._config=CA(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=pg(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(),hg(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,ae,m)),h.forEach(m=>fo(u,lu,m))});const d=Array.from(u);return d.length===0&&d.push(Object.create(null)),gg.has(n)&&a.set(n,d),d}chartOptionScopes(){const{options:t,type:n}=this;return[t,lr[n]||{},ae.datasets[n]||{},{type:n},ae,lu]}resolveNamedOptions(t,n,i,r=[""]){const s={$shared:!0},{resolver:a,subPrefixes:l}=_g(this._resolverCache,t,r);let u=a;if(EA(a,n)){s.$shared=!1,i=on(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}=_g(this._resolverCache,t,i);return Nt(n)?jr(s,n,void 0,r):s}}function _g(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:fu(t,n),subPrefixes:n.filter(l=>!l.toLowerCase().includes("hover"))},i.set(r,s)),s}const AA=e=>Nt(e)&&Object.getOwnPropertyNames(e).some(t=>on(e[t]));function EA(e,t){const{isScriptable:n,isIndexable:i}=mm(e);for(const r of t){const s=n(r),a=i(r),l=(a||s)&&e[r];if(s&&(on(l)||AA(l))||a&&jt(l))return!0}return!1}var RA="4.5.1";const PA=["top","bottom","left","right","chartArea"];function yg(e,t){return e==="top"||e==="bottom"||PA.indexOf(e)===-1&&t==="x"}function bg(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function xg(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Jt(n&&n.onComplete,[e],t)}function IA(e){const t=e.chart,n=t.options.animation;Jt(n&&n.onProgress,[e],t)}function wg(e){return mu()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const $a={},vg=e=>{const t=wg(e);return Object.values($a).filter(n=>n.canvas===t).pop()};function LA(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 NA(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}let an=class{static defaults=ae;static instances=$a;static overrides=lr;static registry=Gn;static version=RA;static getChart=vg;static register(...t){Gn.add(...t),Sg()}static unregister(...t){Gn.remove(...t),Sg()}constructor(t,n){const i=this.config=new OA(n),r=wg(t),s=vg(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||tA(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=BD(),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 yA,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=JD(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",xg),li.listen(this,"progress",IA),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:r,_aspectRatio:s}=this;return kt(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():Sm(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return fm(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,Sm(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=Cu(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=Cu(u,l),h=Ot(l.type,a.dtype);(l.position===void 0||yg(l.position,d)!==yg(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(bg("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||Du(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}=ae.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(bg("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);(!Zp(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;LA(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(!Zp(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,on(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(),xg({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=Pm(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=ku.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);sn(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(),fm(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=$D(t),d=NA(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 Sg(){return te(an.instances,e=>e._plugins.invalidate())}function BA(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-Pt/2,i+Pt/2,!0);else if(h==="bevel"){const y=2*g*g,x=-y*Math.cos(n+Pt/2)+r,v=-y*Math.sin(n+Pt/2)+s,S=y*Math.cos(i+Pt/2)+r,O=y*Math.sin(i+Pt/2)+s;e.lineTo(x,v),e.lineTo(S,O)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function FA(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+oe,i-oe),e.closePath(),e.clip()}function zA(e){return du(e,["outerStart","outerEnd","innerStart","innerEnd"])}function UA(e,t,n,i){const r=zA(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 y=0;const x=r-u;if(i){const dt=h>0?h-i:0,ut=m>0?m-i:0,ct=(dt+ut)/2,Tt=ct!==0?x*ct/(ct+i):x;y=(x-Tt)/2}const v=Math.max(.001,x*m-n/Pt)/m,S=(x-v)/2,O=u+S+y,A=r-S-y,{outerStart:P,outerEnd:L,innerStart:R,innerEnd:F}=UA(t,g,m,A-O),U=m-P,D=m-L,w=O+P/U,C=A-L/D,N=g+R,$=g+F,V=O+R/N,st=A-F/$;if(e.beginPath(),s){const dt=(w+C)/2;if(e.arc(a,l,m,w,dt),e.arc(a,l,m,dt,C),L>0){const at=Xr(D,C,a,l);e.arc(at.x,at.y,L,C,A+oe)}const ut=Xr($,A,a,l);if(e.lineTo(ut.x,ut.y),F>0){const at=Xr($,st,a,l);e.arc(at.x,at.y,F,A+oe,st+Math.PI)}const ct=(A-F/g+(O+R/g))/2;if(e.arc(a,l,g,A-F/g,ct,!0),e.arc(a,l,g,ct,O+R/g,!0),R>0){const at=Xr(N,V,a,l);e.arc(at.x,at.y,R,V+Math.PI,O-oe)}const Tt=Xr(U,O,a,l);if(e.lineTo(Tt.x,Tt.y),P>0){const at=Xr(U,w,a,l);e.arc(at.x,at.y,P,O-oe,w)}}else{e.moveTo(a,l);const dt=Math.cos(w)*m+a,ut=Math.sin(w)*m+l;e.lineTo(dt,ut);const ct=Math.cos(C)*m+a,Tt=Math.sin(C)*m+l;e.lineTo(ct,Tt)}e.closePath()}function HA(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%ne||ne))}return Va(e,t,n,i,u,r),e.fill(),u}function WA(e,t,n,i,r){const{fullCircles:s,startAngle:a,circumference:l,options:u}=t,{borderWidth:d,borderJoinStyle:h,borderDash:m,borderDashOffset:g,borderRadius:y}=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%ne||ne))}x&&FA(e,t,v),u.selfJoin&&v-a>=Pt&&y===0&&h!=="miter"&&BA(e,t,v),s||(Va(e,t,n,i,v,r),e.stroke())}class $A 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,y=Ot(m,u-l),x=Xs(s,l,u)&&l!==u,v=y>=ne||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>ne?Math.floor(i/ne):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(Pt,i||0)),d=r*u;t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,HA(t,this,d,s,a),WA(t,this,d,s,a),t.restore()}}function Tg(e,t,n=t){e.lineCap=Ot(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Ot(n.borderDash,t.borderDash)),e.lineDashOffset=Ot(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Ot(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Ot(n.borderWidth,t.borderWidth),e.strokeStyle=Ot(n.borderColor,t.borderColor)}function VA(e,t,n){e.lineTo(n.x,n.y)}function YA(e){return e.stepped?dC:e.tension||e.cubicInterpolationMode==="monotone"?fC:VA}function kg(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 qA(e,t,n,i){const{points:r,options:s}=t,{count:a,start:l,loop:u,ilen:d}=kg(r,n,i),h=YA(s);let{move:m=!0,reverse:g}=i||{},y,x,v;for(y=0;y<=d;++y)x=r[(l+(g?d-y:y))%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 jA(e,t,n,i){const r=t.points,{count:s,start:a,ilen:l}=kg(r,n,i),{move:u=!0,reverse:d}=i||{};let h=0,m=0,g,y,x,v,S,O;const A=L=>(a+(d?l-L:L))%s,P=()=>{v!==S&&(e.lineTo(h,S),e.lineTo(h,v),e.lineTo(h,O))};for(u&&(y=r[A(0)],e.moveTo(y.x,y.y)),g=0;g<=l;++g){if(y=r[A(g)],y.skip)continue;const L=y.x,R=y.y,F=L|0;F===x?(R<v?v=R:R>S&&(S=R),h=(m*h+L)/++m):(P(),e.lineTo(L,R),x=F,m=0,v=S=R),O=R}P()}function Ou(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?jA:qA}function GA(e){return e.stepped?VC:e.tension||e.cubicInterpolationMode==="monotone"?YC:fr}function KA(e,t,n,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,n,i)&&r.closePath()),Tg(e,t.options),e.stroke(r)}function XA(e,t,n,i){const{segments:r,options:s}=t,a=Ou(t);for(const l of r)Tg(e,s,l.style),e.beginPath(),a(e,t,l,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const ZA=typeof Path2D=="function";function QA(e,t,n,i){ZA&&!t.options.segment?KA(e,t,n,i):XA(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;NC(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=ZC(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=Am(this,{property:n,start:r,end:r});if(!a.length)return;const l=[],u=GA(i);let d,h;for(d=0,h=a.length;d<h;++d){const{start:m,end:g}=a[d],y=s[m],x=s[g];if(y===x){l.push(y);continue}const v=Math.abs((r-y[n])/(x[n]-y[n])),S=u(y,x,v,i.stepped);S[n]=t[n],l.push(S)}return l.length===1?l[0]:l}pathSegment(t,n,i){return Ou(this)(t,this,n,i)}path(t,n,i){const r=this.segments,s=Ou(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(),QA(t,this,i,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Mg(e,t,n,i){const r=e.options,{[n]:s}=e.getProps([n],i);return Math.abs(t-s)<r.radius+r.hitRadius}class JA 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 Mg(this,t,"x",n)}inYRange(t,n){return Mg(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,uu(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function Dg(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 tE(e,t,n){const i=e.options.borderWidth,r=e.borderSkipped,s=pm(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 eE(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||Nt(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 nE(e){const t=Dg(e),n=t.right-t.left,i=t.bottom-t.top,r=tE(e,n/2,i/2),s=eE(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 Au(e,t,n,i){const r=t===null,s=n===null,l=e&&!(r&&s)&&Dg(e,i);return l&&(r||si(t,l.left,l.right))&&(s||si(n,l.top,l.bottom))}function iE(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function rE(e,t){e.rect(t.x,t.y,t.w,t.h)}function Eu(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 sE 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}=nE(this),l=iE(a.radius)?qr:rE;t.save(),(a.w!==s.w||a.h!==s.h)&&(t.beginPath(),l(t,Eu(a,n,s)),t.clip(),l(t,Eu(s,-n,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),l(t,Eu(s,n)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,n,i){return Au(this,t,n,i)}inXRange(t,n){return Au(this,t,null,n)}inYRange(t,n){return Au(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 oE=Object.freeze({__proto__:null,ArcElement:$A,BarElement:sE,LineElement:Ya,PointElement:JA});const Ru=["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)"],Cg=Ru.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function Og(e){return Ru[e%Ru.length]}function Ag(e){return Cg[e%Cg.length]}function aE(e,t){return e.borderColor=Og(t),e.backgroundColor=Ag(t),++t}function lE(e,t){return e.backgroundColor=e.data.map(()=>Og(t++)),t}function cE(e,t){return e.backgroundColor=e.data.map(()=>Ag(t++)),t}function uE(e){let t=0;return(n,i)=>{const r=e.getDatasetMeta(i).controller;r instanceof ro?t=lE(n,t):r instanceof jm?t=cE(n,t):r&&(t=aE(n,t))}}function Eg(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function dE(e){return e&&(e.borderColor||e.backgroundColor)}function fE(){return ae.borderColor!=="rgba(0,0,0,0.1)"||ae.backgroundColor!=="rgba(0,0,0,0.1)"}var hE={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=Eg(i)||dE(r)||s&&Eg(s)||fE();if(!n.forceOverride&&a)return;const l=uE(e);i.forEach(l)}};function pE(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,y,x,v;for(a[u++]=e[h],m=0;m<s-2;m++){let S=0,O=0,A;const P=Math.floor((m+1)*l)+1+t,L=Math.min(Math.floor((m+2)*l)+1,n)+t,R=L-P;for(A=P;A<L;A++)S+=e[A].x,O+=e[A].y;S/=R,O/=R;const F=Math.floor(m*l)+1+t,U=Math.min(Math.floor((m+1)*l)+1,n)+t,{x:D,y:w}=e[h];for(y=x=-1,A=F;A<U;A++)x=.5*Math.abs((D-S)*(e[A].y-w)-(D-e[A].x)*(O-w)),x>y&&(y=x,g=e[A],v=A);a[u++]=g,h=v}return a[u++]=e[d],a}function mE(e,t,n,i){let r=0,s=0,a,l,u,d,h,m,g,y,x,v;const S=[],O=t+n-1,A=e[t].x,L=e[O].x-A;for(a=t;a<t+n;++a){l=e[a],u=(l.x-A)/L*i,d=l.y;const R=u|0;if(R===h)d<x?(x=d,m=a):d>v&&(v=d,g=a),r=(s*r+l.x)/++s;else{const F=a-1;if(!kt(m)&&!kt(g)){const U=Math.min(m,g),D=Math.max(m,g);U!==y&&U!==F&&S.push({...e[U],x:r}),D!==y&&D!==F&&S.push({...e[D],x:r})}a>0&&F!==y&&S.push(e[F]),S.push(l),h=R,s=0,x=v=d,m=g=y=a}}return S}function Rg(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 Pg(e){e.data.datasets.forEach(t=>{Rg(t)})}function gE(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 _E={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){Pg(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}=gE(u,d);const y=n.threshold||4*i;if(g<=y){Rg(r);return}kt(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=pE(d,m,g,i,n);break;case"min-max":x=mE(d,m,g,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}r._decimated=x})},destroy(e){Pg(e)}};function yE(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=Pu(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=Am(t,h);for(const g of m){const y=Pu(n,s[g.start],s[g.end],g.loop),x=Om(l,r,y);for(const v of x)a.push({source:v,target:g,start:{[n]:Ig(h,y,"start",Math.max)},end:{[n]:Ig(h,y,"end",Math.min)}})}}return a}function Pu(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 bE(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 Ig(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function Lg(e,t){let n=[],i=!1;return jt(e)?(i=!0,n=e):n=bE(e,t),n.length?new Ya({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function Ng(e){return e&&e.fill!==!1}function xE(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 wE(e,t,n){const i=kE(e);if(Nt(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return le(r)&&Math.floor(r)===r?vE(i[0],t,r,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function vE(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function SE(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:Nt(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function TE(e,t,n){let i;return e==="start"?i=n:e==="end"?i=t.options.reverse?t.min:t.max:Nt(e)?i=e.value:i=t.getBaseValue(),i}function kE(e){const t=e.options,n=t.fill;let i=Ot(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function ME(e){const{scale:t,index:n,line:i}=e,r=[],s=i.segments,a=i.points,l=DE(t,n);l.push(Lg({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++)CE(r,a[h],l)}return new Ya({points:r,options:{}})}function DE(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 CE(e,t,n){const i=[];for(let r=0;r<n.length;r++){const s=n[r],{first:a,last:l,point:u}=OE(s,t,"x");if(!(!u||a&&l)){if(a)i.unshift(u);else if(e.push(u),!l)break}}e.push(...i)}function OE(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 Bg{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:ne},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 AE(e){const{chart:t,fill:n,line:i}=e;if(le(n))return EE(t,n);if(n==="stack")return ME(e);if(n==="shape")return!0;const r=RE(e);return r instanceof Bg?r:Lg(r,i)}function EE(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function RE(e){return(e.scale||{}).getPointPositionForValue?IE(e):PE(e)}function PE(e){const{scale:t={},fill:n}=e,i=SE(n,t);if(le(i)){const r=t.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function IE(e){const{scale:t,fill:n}=e,i=t.options,r=t.getLabels().length,s=i.reverse?t.max:t.min,a=TE(n,t,s),l=[];if(i.grid.circular){const u=t.getPointPositionForValue(0,s);return new Bg({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 Iu(e,t,n){const i=AE(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:y=m}=h||{},x=r.getDatasetMeta(s),v=Pm(r,x);i&&a.points.length&&(to(e,n),LE(e,{line:a,target:i,above:g,below:y,area:n,scale:l,axis:u,clip:v}),eo(e))}function LE(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"?(Fg(e,i,a.top),Lu(e,{line:n,target:i,color:r,scale:l,property:d,clip:u}),e.restore(),e.save(),Fg(e,i,a.bottom)):d==="y"&&(zg(e,i,a.left),Lu(e,{line:n,target:i,color:s,scale:l,property:d,clip:u}),e.restore(),e.save(),zg(e,i,a.right),h=r)),Lu(e,{line:n,target:i,color:h,scale:l,property:d,clip:u}),e.restore()}function Fg(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 zg(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 Lu(e,t){const{line:n,target:i,property:r,color:s,scale:a,clip:l}=t,u=yE(n,i,r);for(const{source:d,target:h,start:m,end:g}of u){const{style:{backgroundColor:y=s}={}}=d,x=i!==!0;e.save(),e.fillStyle=y,NE(e,a,l,x&&Pu(r,m,g)),e.beginPath();const v=!!n.pathSegment(e,d);let S;if(x){v?e.closePath():Ug(e,i,g,r);const O=!!i.pathSegment(e,h,{move:v,reverse:!0});S=v&&O,S||Ug(e,i,m,r)}e.closePath(),e.fill(S?"evenodd":"nonzero"),e.restore()}}function NE(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 Ug(e,t,n,i){const r=t.interpolate(n,i);r&&e.lineTo(r.x,r.y)}var BE={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:wE(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=xE(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&&Iu(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;Ng(s)&&Iu(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;!Ng(i)||n.drawTime!=="beforeDatasetDraw"||Iu(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Hg=(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)}},FE=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Wg 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}=Hg(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,y=-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,y+=h,g++),u[v]={left:0,top:y,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,y=0,x=0,v=0;return this.legendItems.forEach((S,O)=>{const{itemWidth:A,itemHeight:P}=zE(i,n,s,S,r);O>0&&y+P+2*l>h&&(m+=g+l,d.push({width:g,height:y}),x+=g+l,v++,g=y=0),u[O]={left:x,top:y,col:v,width:A,height:P},g=Math.max(g,A),y+=P+l}),m+=g,d.push({width:g,height:y}),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=ae.color,u=Kr(t.rtl,this.left,this.width),d=ce(a.font),{padding:h}=a,m=d.size,g=m/2;let y;this.drawTitle(),r.textAlign=u.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=d.string;const{boxWidth:x,boxHeight:v,itemHeight:S}=Hg(a,m),O=function(F,U,D){if(isNaN(x)||x<=0||isNaN(v)||v<0)return;r.save();const w=Ot(D.lineWidth,1);if(r.fillStyle=Ot(D.fillStyle,l),r.lineCap=Ot(D.lineCap,"butt"),r.lineDashOffset=Ot(D.lineDashOffset,0),r.lineJoin=Ot(D.lineJoin,"miter"),r.lineWidth=w,r.strokeStyle=Ot(D.strokeStyle,l),r.setLineDash(Ot(D.lineDash,[])),a.usePointStyle){const C={radius:v*Math.SQRT2/2,pointStyle:D.pointStyle,rotation:D.rotation,borderWidth:w},N=u.xPlus(F,x/2),$=U+g;hm(r,C,N,$,a.pointStyleWidth&&x)}else{const C=U+Math.max((m-v)/2,0),N=u.leftForLtr(F,x),$=Ei(D.borderRadius);r.beginPath(),Object.values($).some(V=>V!==0)?qr(r,{x:N,y:C,w:x,h:v,radius:$}):r.rect(N,C,x,v),r.fill(),w!==0&&r.stroke()}r.restore()},A=function(F,U,D){ur(r,D.text,F,U+S/2,d,{strikethrough:D.hidden,textAlign:u.textAlign(D.textAlign)})},P=this.isHorizontal(),L=this._computeTitleHeight();P?y={x:$e(s,this.left+h,this.right-i[0]),y:this.top+h+L,line:0}:y={x:this.left+h,y:$e(s,this.top+L+h,this.bottom-n[0].height),line:0},km(this.ctx,t.textDirection);const R=S+h;this.legendItems.forEach((F,U)=>{r.strokeStyle=F.fontColor,r.fillStyle=F.fontColor;const D=r.measureText(F.text).width,w=u.textAlign(F.textAlign||(F.textAlign=a.textAlign)),C=x+g+D;let N=y.x,$=y.y;u.setWidth(this.width),P?U>0&&N+C+h>this.right&&($=y.y+=R,y.line++,N=y.x=$e(s,this.left+h,this.right-i[y.line])):U>0&&$+R>this.bottom&&(N=y.x=N+n[y.line].width+h,y.line++,$=y.y=$e(s,this.top+L+h,this.bottom-n[y.line].height));const V=u.x(N);if(O(V,$,F),N=tC(w,N+x+g,P?N+C:this.right,t.rtl),A(u.x(N),$,F),P)y.x+=C+h;else if(typeof F.text!="string"){const st=d.lineHeight;y.y+=$g(F,st)+h}else y.y+=R}),Mm(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 y=$e(l,m,m+g);a.textAlign=s.textAlign(su(l)),a.textBaseline="middle",a.strokeStyle=n.color,a.fillStyle=n.color,a.font=i.string,ur(a,n.text,y,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(!WE(t.type,n))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,s=FE(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 zE(e,t,n,i,r){const s=UE(i,e,t,n),a=HE(r,i,t.lineHeight);return{itemWidth:s,itemHeight:a}}function UE(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 HE(e,t,n){let i=e;return typeof t.text!="string"&&(i=$g(t,n)),i}function $g(e,t){const n=e.text?e.text.length:0;return t*n}function WE(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var $E={id:"legend",_element:Wg,start(e,t,n){const i=e.legend=new Wg({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 Nu 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=jt(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=Pt*-.5):(h=s-t,m=$e(l,n,r),u=Pt*.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:su(n.align),textBaseline:"middle",translation:[a,l]})}}function VE(e,t){const n=new Nu({ctx:e.ctx,options:t,chart:e});Ve.configure(e,n,t),Ve.addBox(e,n),e.titleBlock=n}var YE={id:"title",_element:Nu,start(e,t,n){VE(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 qE={id:"subtitle",start(e,t,n){const i=new Nu({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&&(jt(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 jE(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 Vg(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,O=i.reduce((L,R)=>L+R.before.length+R.lines.length+R.after.length,0);if(O+=e.beforeBody.length+e.afterBody.length,m&&(v+=m*d.lineHeight+(m-1)*t.titleSpacing+t.titleMarginBottom),O){const L=t.displayColors?Math.max(l,u.lineHeight):u.lineHeight;v+=_*L+(O-_)*u.lineHeight+(O-1)*t.bodySpacing}g&&(v+=t.footerMarginTop+g*h.lineHeight+(g-1)*t.footerSpacing);let A=0;const P=function(L){S=Math.max(S,n.measureText(L).width+A)};return n.save(),n.font=d.string,te(e.title,P),n.font=u.string,te(e.beforeBody.concat(e.afterBody),P),A=t.displayColors?a+2+t.boxPadding:0,te(i,L=>{te(L.before,P),te(L.lines,P),te(L.after,P)}),A=0,n.font=h.string,te(e.footer,P),n.restore(),S+=x.width,{width:S,height:v}}function GE(e,t){const{y:n,height:i}=t;return n<i/2?"top":n>e.height-i/2?"bottom":"center"}function KE(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 XE(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"),KE(d,e,t,n)&&(d="center"),d}function Yg(e,t,n){const i=n.yAlign||t.yAlign||GE(e,n);return{xAlign:n.xAlign||t.xAlign||XE(e,t,n,i),yAlign:i}}function ZE(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function QE(e,t,n){let{y:i,height:r}=e;return t==="top"?i+=n:t==="bottom"?i-=r+n:i-=r/2,i}function qg(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=ZE(t,l);const v=QE(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 jg(e){return Kn([],ci(e))}function JE(e,t,n){return Ri(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function Gg(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const Kg={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 kt(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 ln(e,t,n,i){const r=e[t].call(n,i);return typeof r>"u"?Kg[t].call(n,i):r}class Xg 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 yu(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=JE(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,r=ln(i,"beforeTitle",this,t),s=ln(i,"title",this,t),a=ln(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 jg(ln(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,r=[];return te(t,s=>{const a={before:[],lines:[],after:[]},l=Gg(i,s);Kn(a.before,ci(ln(l,"beforeLabel",this,s))),Kn(a.lines,ln(l,"label",this,s)),Kn(a.after,ci(ln(l,"afterLabel",this,s))),r.push(a)}),r}getAfterBody(t,n){return jg(ln(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,r=ln(i,"beforeFooter",this,t),s=ln(i,"footer",this,t),a=ln(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(jE(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=Gg(t.callbacks,h);r.push(ln(m,"labelColor",this,h)),s.push(ln(m,"labelPointStyle",this,h)),a.push(ln(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=Vg(this,i),d=Object.assign({},l,u),h=Yg(this.chart,i,d),m=qg(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,O,A,P,L,R;return s==="center"?(L=_+v/2,r==="left"?(S=g,O=S-a,P=L+a,R=L-a):(S=g+x,O=S+a,P=L-a,R=L+a),A=S):(r==="left"?O=g+Math.max(u,h)+a:r==="right"?O=g+x-Math.max(d,m)-a:O=this.caretX,s==="top"?(P=_,L=P-a,S=O-a,A=O+a):(P=_+v,L=P+a,S=O+a,A=O-a),R=P),{x1:S,x2:O,x3:A,y1:P,y2:L,y3:R}}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,O=x+u/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,uu(t,v,S,O),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,uu(t,v,S,O)}else{t.lineWidth=Nt(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),O=Ei(a.borderRadius);Object.values(O).some(A=>A!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,qr(t,{x:v,y:x,w:d,h:u,radius:O}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),qr(t,{x:S,y:x+1,w:d-2,h:u-2,radius:O}),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(D){n.fillText(D,x.x(t.x+_),t.y+g/2),t.y+=g+s},S=x.textAlign(a);let O,A,P,L,R,F,U;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,L=0,F=r.length;L<F;++L){for(O=r[L],A=this.labelTextColors[L],n.fillStyle=A,te(O.before,v),P=O.lines,l&&P.length&&(this._drawColorBox(n,t,L,x,i),g=Math.max(m.lineHeight,u)),R=0,U=P.length;R<U;++R)v(P[R]),g=m.lineHeight;te(O.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=Vg(this,t),u=Object.assign({},a,this._size),d=Yg(n,t,u),h=qg(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),km(t,n.textDirection),s.y+=a.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),Mm(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:Xg,positioners:ho,afterInit(e,t,n){n&&(e.tooltip=new Xg({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:Kg},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"]},tR=Object.freeze({__proto__:null,Colors:hE,Decimation:yE,Filler:BE,Legend:$E,SubTitle:qE,Title:YE,Tooltip:qe});const eR=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function nR(e,t,n,i){const r=e.indexOf(t);if(r===-1)return eR(e,t,n,i);const s=e.lastIndexOf(t);return r!==s?n:r}const iR=(e,t)=>e===null?null:Re(Math.round(e),0,t);function Zg(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class rR extends pr{static id="category";static defaults={ticks:{callback:Zg}};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(kt(t))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:nR(i,t,Ot(n,t),this._addedLabels),iR(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 Zg.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 sR(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,O=!kt(a),A=!kt(l),P=!kt(d),L=(S-v)/(m+1);let R=Qp((S-v)/x/_)*_,F,U,D,w;if(R<1e-14&&!O&&!A)return[{value:v},{value:S}];w=Math.ceil(S/R)-Math.floor(v/R),w>x&&(R=Qp(w*R/x/_)*_),kt(u)||(F=Math.pow(10,u),R=Math.ceil(R*F)/F),r==="ticks"?(U=Math.floor(v/R)*R,D=Math.ceil(S/R)*R):(U=v,D=S),O&&A&&s&&jD((l-a)/s,R/1e3)?(w=Math.round(Math.min((l-a)/R,h)),R=(l-a)/w,U=a,D=l):P?(U=O?a:U,D=A?l:D,w=d-1,R=(D-U)/w):(w=(D-U)/R,Ks(w,Math.round(w),R/1e3)?w=Math.round(w):w=Math.ceil(w));const C=Math.max(tm(R),tm(U));F=Math.pow(10,kt(u)?C:u),U=Math.round(U*F)/F,D=Math.round(D*F)/F;let N=0;for(O&&(g&&U!==a?(n.push({value:a}),U<a&&N++,Ks(Math.round((U+N*R)*F)/F,a,Qg(a,L,e))&&N++):U<a&&N++);N<w;++N){const $=Math.round((U+N*R)*F)/F;if(A&&$>l)break;n.push({value:$})}return A&&g&&D!==l?n.length&&Ks(n[n.length-1].value,l,Qg(l,L,e))?n[n.length-1].value=l:n.push({value:l}):(!A||D===l)&&n.push({value:D}),n}function Qg(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 kt(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=sR(r,s);return t.bounds==="ticks"&&Jp(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 oR 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 Jg(e){return e/Math.pow(10,po(e))===1}function t0(e,t,n){const i=Math.pow(10,n),r=Math.floor(e/i);return Math.ceil(t/i)-r}function aR(e,t){const n=t-e;let i=po(n);for(;t0(e,t,i)>10;)i++;for(;t0(e,t,i)<10;)i--;return Math.min(i,po(e))}function lR(e,{min:t,max:n}){t=mn(e.min,t);const i=[],r=po(t);let s=aR(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:Jg(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:Jg(_),significand:m}),i}class cR 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=lR(n,this);return t.bounds==="ticks"&&Jp(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 Bu(e){const t=e.ticks;if(t.display&&e.display){const n=Se(t.backdropPadding);return Ot(t.font&&t.font.size,ae.font.size)+n.height}return 0}function uR(e,t,n){return n=jt(n)?n:[n],{w:uC(e,t.string,n),h:n.length*t.lineHeight}}function e0(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 dR(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?Pt/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=uR(e.ctx,m,e._pointLabels[u]);i[u]=g;const _=We(e.getIndexAngle(u)+l),x=Math.round(Da(_)),v=e0(x,h.x,g.w,0,180),S=e0(x,h.y,g.h,90,270);fR(n,t,_,v,S)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=mR(e,i,r)}function fR(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 hR(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+oe))),h=_R(u.y,l.h,d),m=gR(d),g=yR(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 pR(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 mR(e,t,n){const i=[],r=e._pointLabels.length,s=e.options,{centerPointLabels:a,display:l}=s.pointLabels,u={extra:Bu(s)/2,additionalAngle:a?Pt/r:0};let d;for(let h=0;h<r;h++){u.padding=n[h],u.size=t[h];const m=hR(e,h,u);i.push(m),l==="auto"&&(m.visible=pR(m,d),m.visible&&(d=m))}return i}function gR(e){return e===0||e===180?"center":e<180?"left":"right"}function yR(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function _R(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function bR(e,t,n){const{left:i,top:r,right:s,bottom:a}=n,{backdropColor:l}=t;if(!kt(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 xR(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));bR(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 n0(e,t,n,i){const{ctx:r}=e;if(n)r.arc(e.xCenter,e.yCenter,t,0,ne);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 wR(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(),n0(e,n,a,i),s.closePath(),s.stroke(),s.restore())}function vR(e,t,n){return Ri(e,{label:n,index:t,type:"pointLabel"})}class SR 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(Bu(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/Bu(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?dR(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=ne/(this._pointLabels.length||1),i=this.options.startAngle||0;return We(t*n+ve(i))}getDistanceFromCenterForValue(t){if(kt(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(kt(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 vR(this.getContext(),t,i)}}getPointPosition(t,n,i=0){const r=this.getIndexAngle(t)-oe+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(),n0(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&&xR(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);wR(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}},cn=Object.keys(Xa);function i0(e,t){return e-t}function r0(e,t){if(kt(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 s0(e,t,n,i){const r=cn.length;for(let s=cn.indexOf(e);s<r-1;++s){const a=Xa[cn[s]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-t)/(l*a.size))<=i)return cn[s]}return cn[r-1]}function TR(e,t,n,i,r){for(let s=cn.length-1;s>=cn.indexOf(n);s--){const a=cn[s];if(Xa[a].common&&e._adapter.diff(r,i,a)>=t-1)return a}return cn[n?cn.indexOf(n):0]}function kR(e){for(let t=cn.indexOf(e)+1,n=cn.length;t<n;++t)if(Xa[cn[t]].common)return cn[t]}function o0(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:i,hi:r}=ru(n,t),s=n[i]>=t?n[i]:n[r];e[s]=!0}}function MR(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 a0(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:MR(e,i,r,n)}class Fu 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 Km._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:r0(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=ZD(r,s,a);return this._unit=n.unit||(i.autoSkip?s0(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):TR(this,l.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:kR(this._unit),this.initOffsets(r),t.reverse&&l.reverse(),a0(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||s0(s.minUnit,n,i,this._getLabelCapacity(n)),l=Ot(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),_++)o0(h,g,x);return(g===i||r.bounds==="ticks"||_===1)&&o0(h,g,x),Object.keys(h).sort(i0).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,a0(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(r0(this,r[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return im(t.sort(i0))}}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 DR extends Fu{static id="timeseries";static defaults=Fu.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 CR=Object.freeze({__proto__:null,CategoryScale:rR,LinearScale:oR,LogarithmicScale:cR,RadialLinearScale:SR,TimeScale:Fu,TimeSeriesScale:DR});const OR=[OO,oE,tR,CR];function AR(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}},ku.modes.customInteractionMode=function(u,d){const h=Pi(d,u),m=[];return ku.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?T0:k0,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"?!kt(e.metricAxesTitle?.value):!kt(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"?!kt(e.metricAxesTitle?.value):!kt(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=>{w0(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}an.register(...OR);const ER=(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 RR(e,t,n,i,r){const s=f.shallowRef(null),a=(l,u)=>{if(t.value)return new an(t.value,{type:e,data:l,plugins:i,options:u})};return f.onMounted(()=>{s.value=a(n.value,r.value)}),f.onBeforeUnmount(()=>{kt(s.value)||s.value.destroy()}),f.watch(n,(l,u)=>{if(ER(u,l)&&!kt(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 kt(s.value)||s.value.destroy(),s.value=a(l,r.value)}),f.watch(t,()=>{kt(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))&&(kt(s.value)||s.value.destroy(),s.value=a(n.value,l))}),s}const l0=1e3,PR=1e4,c0=1e6,u0=1e9,d0=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?PR:l0;return e<r||t.precision&&t.precision>Math.log10(e)?n=mo(Zr(e,1,t),t):e<c0?n=`${Zr(e,l0,t)}k`:e<u0?n=`${Zr(e,c0,t)}m`:e<d0?n=`${mo(Zr(e,u0,t),t)}b`:n=`${mo(Zr(e,d0,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 IR(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 LR(e){return f.computed(()=>{if(!e.value?.meta)return"";const n=e.value.meta.start,i=e.value.meta.end;return n&&i?`${Gh(new Date(n))} - ${Gh(new Date(i),{includeTZ:!0})}`:""})}function NR(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=>{w0(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 BR(e){const t=f.computed(()=>({type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:10,source:"auto",maxRotation:0,callback:h=>{const m=new Date(h);return $0({tickValue:m,granularity:e.granularity.value,dayBoundaryCrossed:u.value})}},title:{display:!1},border:{display:!1},stacked:e.stacked.value})),n=f.computed(()=>!!e.rightYAxis?.value),i=f.computed(()=>({title:{display:!kt(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:!kt(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,O=nl(m,_,v);let A=v0(m,x,S);const P=m.y<S?"top":"bottom",L=m.x<v?"left":"center";return x>g.height&&(A=0),{x:O,y:A,xAlign:L,yAlign:P}};const u=f.computed(()=>{const h=Number(e.timeRangeMs.value),m=new Date,g=new Date(m.getTime()-h);return Np(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?{[qu]:r.value}:{}},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},streaming:!1,tooltip:{...l,external:h=>{Vu(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 FR=["usd","bytes"],zR="usd";function UR(e){const{i18n:t}=St.useI18n(),{formatUnit:n}=$n({i18n:t}),i=(_,x)=>!x||!FR.includes(x)?_:_===0&&x===zR?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 Np(_)>24||v.getDate()!==x.getDate()}),s=f.computed(()=>({display:!kt(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:_=>$0({tickValue:new Date(_),granularity:e.granularity.value,dayBoundaryCrossed:r.value})},title:s.value,border:{display:!1}})),u=f.computed(()=>({title:{display:!kt(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,O=e.tooltipState.height||this.height,A=v.width/2,P=v.height/2,L=nl(x,S,A);let R=v0(x,O,P);const F=x.y<P?"top":"bottom",U=x.x<A?"left":"center";return O>v.height&&(R=0),{x:L,y:R,xAlign:U,yAlign:F}};const g=f.computed(()=>({hover:{mode:"nearest",intersect:!1},interaction:{mode:"point",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:_=>{Vu(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 HR(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}):ju(i.indexOf(g),Xn),data:a.map((_,x)=>n?s[`${_.id},${g}`]||0:s[`${x},${g}`]||null)})):Array.from(r).flatMap((g,_)=>g?{dimension:u,dimensionValue:g.id,label:d&&d.te(`chartLabels.${g.name}`)&&d.t(`chartLabels.${g.name}`)||g.name,backgroundColor:m?Bs({dimension:u,dimensionValue:g.id}):Gu(_,g.name,g.id==="empty",l??Xn),data:a.map(x=>s[`${x.id},${g.id}`]||null),isSegmentEmpty:g.id==="empty"}:[])}function WR(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((C,N)=>{const $=w.event[g],V=d?`${$},${C}`:`${N},${C}`,st=w.event[C];return[V,st]})):r.map(w=>{const C=d?`${w.event[g]},${w.event[_]}`:`${g},${_}`,N=w.event[a[0]];return[C,N]})),v=Object.keys(x).reduce((w,C)=>{const[N]=C.split(","),$=x[C];return w[N]?w[N]+=$:w[N]=$,w},{}),S=Object.entries(v).sort(([,w],[,C])=>Number(C)-Number(w)).map(([w])=>w),O=s[g],A=s[_];let P=d&&O&&Object.entries(O).map(([w,C])=>({id:w,name:C.name}))||a.map(w=>({id:w,name:w})),L=d&&A&&Object.entries(A).map(([w,C])=>({id:w,name:C.name}))||a.map(w=>({id:w,name:w}));if(d&&g==="country_code"&&(P=P.map(w=>({...w,name:Bc(w.id)||w.name}))),d&&_==="country_code"&&(L=L.map(w=>({...w,name:Bc(w.id)||w.name}))),g!=="status_code"&&g!=="status_code_grouped"&&(P.sort((w,C)=>S.indexOf(w.id)-S.indexOf(C.id)),L.sort((w,C)=>S.indexOf(w.id)-S.indexOf(C.id))),!P||!L)return{labels:[],datasets:[]};const R=HR({isMultiMetric:u,hasDimensions:d,metricNames:a,dimensionFieldNames:m,barSegmentLabels:L,pivotRecords:x,rowLabels:P,seriesDimension:_,colorPalette:e.colorPalette||Xn}),F=d?P.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=P.map(w=>w.id==="empty");return{labels:F,datasets:R,isLabelEmpty:U,isMultiDimension:h}}}catch(r){return console.error(r),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const $R=(e,t,n=1)=>Array(Math.ceil((t-e)/n)).fill(e).map((i,r)=>i+r*n),VR=e=>{if(typeof e=="string"){const t=+e;if(t)return t;try{return Bp(e).getTime()}catch(n){if(n instanceof RangeError)return 0;throw n}}return e},YR=(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 $R(l,u,n)};function qR(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],O=!!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:Bc(w.id)||w.name})));const P=t.value.meta.granularity_ms;if(typeof P!="number"||isNaN(P)||!isFinite(P)||P===0)return console.error("Invalid step value:",P),{datasets:[],labels:[]};if(!a.length)return{datasets:[],labels:[]};const L=VR(g),R=YR(g,_,P,L,a),F=a?.length?a.reduce((w,C)=>{const N=new Date(C.timestamp).valueOf(),$=C.event;for(const V of u)N in w||(w[N]={}),V in w[N]||(w[N][V]={});for(const V of u)A.forEach(st=>{(S?$[v]===st.id:V===st.id)?(w[N][V]||(w[N][V]={}),w[N][V][st.id]=Math.round(Number($[V])*1e3)/1e3):x.length||(w[N][V]||(w[N][V]={}),w[N][V][st.id]=Math.round(Number($[st.id])*1e3)/1e3)});return w},{}):{},D=[...S||u.length===1?u.flatMap(w=>A.map(C=>[w,C.id,C.name,C.id==="empty"])):A.map(w=>[w.name,w.id,w.name,w.id==="empty"])].map(([w,C,N,$],V)=>{const st=R.map(B=>B in F&&w in F[B]?{x:B,y:F[B][w][C]||0}:{x:B,y:0});let{colorPalette:dt,fill:ut}=e;kt(dt)&&(dt=Xn);const ct=r?Bs({dimension:v,dimensionValue:C}):Gu(V,N,$,dt),Tt=K0(N)?n.t(`chartLabels.${N}`):N,at=K0(w)?n.t(`chartLabels.${w}`):w,pt=u.findIndex(B=>B===w),G=e.metricAxisMap?.[w]==="right";return{dimension:v,dimensionValue:C,rawDimension:N,rawMetric:w,label:O?`${Tt} — ${at}`:Tt,borderColor:ct,backgroundColor:ct,data:st,total:st.reduce((B,{y:z})=>B+Number(z),0),...LP,...O?{borderDash:pt===0?[]:[pt*4,2]}:{},...!O&&G?{borderDash:[4,2]}:{},...G?{yAxisID:qu}:{},...e.metricAxisMap?{unit:d?.[w]??""}:{},fill:ut,borderWidth:ut?BP:NP,isSegmentEmpty:$}});return v==="status_code"||v==="status_code_grouped"?D.sort((w,C)=>(w.label??"")<(C.label??"")?-1:1):D.sort((w,C)=>Number(w.total)<Number(C.total)?-1:1),{datasets:D}}}catch(a){return console.error(a),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const jR=3,GR=.6,f0=2,KR=2,h0=50,XR=[6,4],ZR=[2,3],QR=(e,t)=>{const n=Math.sin(t)*1e4;return(n-Math.floor(n))*e};function JR(e,t){const{i18n:n}=St.useI18n(),{evaluateFeatureFlag:i}=St.useEvaluateFeatureFlag(),r=i("analytics-color-updates",!1),s=(a,l)=>l||(a===h0?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??jR,S=_.pointOpacity??GR,O=new Map,A=[];a.points.forEach(V=>{const st=V.group??l,dt=O.get(st)||[];let ut,ct;V.x!==void 0?(ut={x:V.x,timestamp:V.timestamp},ct=[{label:g,value:V.x,...m?{unit:m}:{}},...V.extras??[]]):(ut={x:V.timestamp+QR(x,V.timestamp+V.value)},ct=V.extras??[]),dt.push({...ut,y:V.value,...ct.length?{extras:ct}:{}}),O.set(st,dt),A.push(V.value)});const P=_.percentileLines||[],L=[...P.map(V=>V.percentile),..._.outlierPercentile!==void 0?[_.outlierPercentile]:[]],R=L.length?M2(A,L):new Map,F=_.outlierPercentile!==void 0?R.get(_.outlierPercentile):void 0,U=F!==void 0&&Number.isFinite(F),D=kt(e.colorPalette)?Xn:e.colorPalette,w=e.themeColors?.value??ud(),C=[],N=V=>{const st=V?.y;return U&&Number.isFinite(st)&&st>F};Array.from(O.entries()).forEach(([V,st],dt)=>{const ut=u&&d?.[V]?.name||V,ct=V==="empty",Tt=r?Bs({dimension:u,dimensionValue:V}):Gu(dt,ut,ct,D),at=cd(Tt,S),pt=n.te(`chartLabels.${ut}`)&&n.t(`chartLabels.${ut}`)||ut;C.push({dimension:u,dimensionValue:V,type:"scatter",rawDimension:ut,rawMetric:l,label:pt,borderColor:G=>N(G.raw)?w.outlier:Tt,backgroundColor:G=>N(G.raw)?w.outlier:at,pointRadius:G=>N(G.raw)?v+f0:v,pointHoverRadius:G=>(N(G.raw)?v+f0:v)+KR,data:st,pointBorderWidth:0,showLine:!1,isSegmentEmpty:ct})});const $=[];return P.forEach(V=>{const st=R.get(V.percentile);if(st===void 0||!Number.isFinite(st))return;const dt=V.percentile===h0;$.push({percentile:V.percentile,label:s(V.percentile,V.label),value:st,color:V.color||(dt?w.medianLine:w.outlier),borderDash:V.borderDash||(dt?XR:ZR)})}),{datasets:C,...U?{outlier:{value:F,label:n.t("scatter.outlier",{label:s(_.outlierPercentile)}),color:w.outlier}}:{},...$.length?{referenceLines:$}:{}}}catch(a){return console.warn(a),{datasets:[]}}})}const tP=(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 eP(){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 nP="analytics-query-provider",zu="analytics-dashboard-coordinator",p0=2,Uu="____OTHER____",iP="empty";function rP(){const e=f.inject(nP);return{evaluateFeatureFlag:(n,i)=>typeof e?.evaluateFeatureFlagFn!="function"?i:e.evaluateFeatureFlagFn(n,i)}}function m0(e,t){return f.getCurrentScope()?(f.onScopeDispose(e,t),!0):!1}const g0=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const sP=e=>e!=null,oP=Object.prototype.toString,aP=e=>oP.call(e)==="[object Object]";function Qa(e){return Array.isArray(e)?e:[e]}function lP(e){return f.getCurrentInstance()}function cP(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 uP(e,t=!0,n){lP()?f.onMounted(e,n):t?e():f.nextTick(e)}function dP(e,t,n){return f.watch(e,t,{...n,immediate:!0})}const Ja=g0?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 dP(()=>{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=aP(a)?{...a}:a,h=i.flatMap(m=>r.flatMap(g=>s.map(_=>t(m,g,_,d))));u(()=>{h.forEach(m=>m())})},{flush:"post"})}function fP(){const e=f.shallowRef(!1),t=f.getCurrentInstance();return t&&f.onMounted(()=>{e.value=!0},t),e}function y0(e){const t=fP();return f.computed(()=>(t.value,!!e()))}function hP(e,t,n={}){const{window:i=Ja,...r}=n;let s;const a=y0(()=>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(sP);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 m0(h),{isSupported:a,stop:h,takeRecords:d}}const tl={speed:2,margin:30,direction:"both"};function pP(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 mP(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:O=e,buttons:A=[0],restrictInView:P,autoScroll:L=!1}=t,R=f.ref((n=f.toValue(_))!==null&&n!==void 0?n:{x:0,y:0}),F=f.ref(),U=G=>a?a.includes(G.pointerType):!0,D=G=>{f.toValue(l)&&G.preventDefault(),f.toValue(u)&&G.stopPropagation()},w=f.toValue(L),C=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,N=G=>typeof G=="number"?[G,G]:[G.x,G.y],$=(G,B,z)=>{const{clientWidth:Z,clientHeight:it,scrollLeft:ht,scrollTop:mt,scrollWidth:X,scrollHeight:ot}=G,[vt,lt]=N(C.margin),[bt,Rt]=N(C.speed);let j=0,et=0;(C.direction==="x"||C.direction==="both")&&(z.x<vt&&ht>0?j=-bt:z.x+B.width>Z-vt&&ht<X-Z&&(j=bt)),(C.direction==="y"||C.direction==="both")&&(z.y<lt&&mt>0?et=-Rt:z.y+B.height>it-lt&&mt<ot-it&&(et=Rt)),(j||et)&&G.scrollBy({left:j,top:et,behavior:"auto"})};let V=null;const st=()=>{const G=f.toValue(S);G&&!V&&(V=setInterval(()=>{const B=f.toValue(e).getBoundingClientRect(),{x:z,y:Z}=R.value,it={x:z-G.scrollLeft,y:Z-G.scrollTop};it.x>=0&&it.y>=0&&($(G,B,it),it.x+=G.scrollLeft,it.y+=G.scrollTop,R.value=it)},1e3/60))},dt=()=>{V&&(clearInterval(V),V=null)},ut=(G,B,z,Z)=>{const[it,ht]=typeof z=="number"?[z,z]:[z.x,z.y],{clientWidth:mt,clientHeight:X}=B;return G.x<it||G.x+Z.width>mt-it||G.y<ht||G.y+Z.height>X-ht},ct=()=>{if(f.toValue(t.disabled)||!F.value)return;const G=f.toValue(S);if(!G)return;const B=f.toValue(e).getBoundingClientRect(),{x:z,y:Z}=R.value,it={x:z-G.scrollLeft,y:Z-G.scrollTop};ut(it,G,C.margin,B)?st():dt()};f.toValue(L)&&f.watch(R,ct);const Tt=G=>{var B;if(!f.toValue(A).includes(G.button)||f.toValue(t.disabled)||!U(G)||f.toValue(d)&&G.target!==f.toValue(e))return;const z=f.toValue(S),Z=z==null||(B=z.getBoundingClientRect)===null||B===void 0?void 0:B.call(z),it=f.toValue(e).getBoundingClientRect(),ht={x:G.clientX-(z?it.left-Z.left+(L?0:z.scrollLeft):it.left),y:G.clientY-(z?it.top-Z.top+(L?0:z.scrollTop):it.top)};g?.(ht,G)!==!1&&(F.value=ht,D(G))},at=G=>{if(f.toValue(t.disabled)||!U(G)||!F.value)return;const B=f.toValue(S);B instanceof HTMLElement&&pP(B);const z=f.toValue(e).getBoundingClientRect();let{x:Z,y:it}=R.value;if((x==="x"||x==="both")&&(Z=G.clientX-F.value.x,B&&(Z=Math.min(Math.max(0,Z),B.scrollWidth-z.width))),(x==="y"||x==="both")&&(it=G.clientY-F.value.y,B&&(it=Math.min(Math.max(0,it),B.scrollHeight-z.height))),f.toValue(L)&&B&&(V===null&&$(B,z,{x:Z,y:it}),Z+=B.scrollLeft,it+=B.scrollTop),B&&(P||L)){if(x!=="y"){const ht=Z-B.scrollLeft;ht<0?Z=B.scrollLeft:ht>B.clientWidth-z.width&&(Z=B.clientWidth-z.width+B.scrollLeft)}if(x!=="x"){const ht=it-B.scrollTop;ht<0?it=B.scrollTop:ht>B.clientHeight-z.height&&(it=B.clientHeight-z.height+B.scrollTop)}}R.value={x:Z,y:it},h?.(R.value,G),D(G)},pt=G=>{f.toValue(t.disabled)||!U(G)||F.value&&(F.value=void 0,L&&dt(),m?.(R.value,G),D(G))};if(g0){const G=()=>{var B;return{capture:(B=t.capture)!==null&&B!==void 0?B:!0,passive:!f.toValue(l)}};yo(O,"pointerdown",Tt,G),yo(v,"pointermove",at,G),yo(v,["pointerup","pointercancel"],pt,G)}return{...cP(R),position:R,isDragging:f.computed(()=>!!F.value),style:f.computed(()=>`
3
+ `):e}function jE(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 Vg(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,y=i.length,x=Se(t.padding);let v=x.height,S=0,O=i.reduce((L,R)=>L+R.before.length+R.lines.length+R.after.length,0);if(O+=e.beforeBody.length+e.afterBody.length,m&&(v+=m*d.lineHeight+(m-1)*t.titleSpacing+t.titleMarginBottom),O){const L=t.displayColors?Math.max(l,u.lineHeight):u.lineHeight;v+=y*L+(O-y)*u.lineHeight+(O-1)*t.bodySpacing}g&&(v+=t.footerMarginTop+g*h.lineHeight+(g-1)*t.footerSpacing);let A=0;const P=function(L){S=Math.max(S,n.measureText(L).width+A)};return n.save(),n.font=d.string,te(e.title,P),n.font=u.string,te(e.beforeBody.concat(e.afterBody),P),A=t.displayColors?a+2+t.boxPadding:0,te(i,L=>{te(L.before,P),te(L.lines,P),te(L.after,P)}),A=0,n.font=h.string,te(e.footer,P),n.restore(),S+=x.width,{width:S,height:v}}function GE(e,t){const{y:n,height:i}=t;return n<i/2?"top":n>e.height-i/2?"bottom":"center"}function KE(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 XE(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"),KE(d,e,t,n)&&(d="center"),d}function Yg(e,t,n){const i=n.yAlign||t.yAlign||GE(e,n);return{xAlign:n.xAlign||t.xAlign||XE(e,t,n,i),yAlign:i}}function ZE(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function QE(e,t,n){let{y:i,height:r}=e;return t==="top"?i+=n:t==="bottom"?i-=r+n:i-=r/2,i}function qg(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:y}=Ei(a);let x=ZE(t,l);const v=QE(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,y)+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 jg(e){return Kn([],ci(e))}function JE(e,t,n){return Ri(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function Gg(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const Kg={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 kt(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 ln(e,t,n,i){const r=e[t].call(n,i);return typeof r>"u"?Kg[t].call(n,i):r}class Xg 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 _u(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=JE(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,r=ln(i,"beforeTitle",this,t),s=ln(i,"title",this,t),a=ln(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 jg(ln(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,r=[];return te(t,s=>{const a={before:[],lines:[],after:[]},l=Gg(i,s);Kn(a.before,ci(ln(l,"beforeLabel",this,s))),Kn(a.lines,ln(l,"label",this,s)),Kn(a.after,ci(ln(l,"afterLabel",this,s))),r.push(a)}),r}getAfterBody(t,n){return jg(ln(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,r=ln(i,"beforeFooter",this,t),s=ln(i,"footer",this,t),a=ln(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(jE(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=Gg(t.callbacks,h);r.push(ln(m,"labelColor",this,h)),s.push(ln(m,"labelPointStyle",this,h)),a.push(ln(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=Vg(this,i),d=Object.assign({},l,u),h=Yg(this.chart,i,d),m=qg(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,O,A,P,L,R;return s==="center"?(L=y+v/2,r==="left"?(S=g,O=S-a,P=L+a,R=L-a):(S=g+x,O=S+a,P=L-a,R=L+a),A=S):(r==="left"?O=g+Math.max(u,h)+a:r==="right"?O=g+x-Math.max(d,m)-a:O=this.caretX,s==="top"?(P=y,L=P-a,S=O-a,A=O+a):(P=y+v,L=P+a,S=O+a,A=O-a),R=P),{x1:S,x2:O,x3:A,y1:P,y2:L,y3:R}}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),y=u<h.lineHeight?(h.lineHeight-u)/2:0,x=n.y+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,O=x+u/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,uu(t,v,S,O),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,uu(t,v,S,O)}else{t.lineWidth=Nt(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),O=Ei(a.borderRadius);Object.values(O).some(A=>A!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,qr(t,{x:v,y:x,w:d,h:u,radius:O}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),qr(t,{x:S,y:x+1,w:d-2,h:u-2,radius:O}),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,y=0;const x=Kr(i.rtl,this.x,this.width),v=function(D){n.fillText(D,x.x(t.x+y),t.y+g/2),t.y+=g+s},S=x.textAlign(a);let O,A,P,L,R,F,U;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),y=l&&S!=="right"?a==="center"?d/2+h:d+2+h:0,L=0,F=r.length;L<F;++L){for(O=r[L],A=this.labelTextColors[L],n.fillStyle=A,te(O.before,v),P=O.lines,l&&P.length&&(this._drawColorBox(n,t,L,x,i),g=Math.max(m.lineHeight,u)),R=0,U=P.length;R<U;++R)v(P[R]),g=m.lineHeight;te(O.after,v)}y=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:y,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+y,u+h),n.quadraticCurveTo(l,u+h,l,u+h-y),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=Vg(this,t),u=Object.assign({},a,this._size),d=Yg(n,t,u),h=qg(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),km(t,n.textDirection),s.y+=a.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),Mm(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:Xg,positioners:ho,afterInit(e,t,n){n&&(e.tooltip=new Xg({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:Kg},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"]},tR=Object.freeze({__proto__:null,Colors:hE,Decimation:_E,Filler:BE,Legend:$E,SubTitle:qE,Title:YE,Tooltip:qe});const eR=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function nR(e,t,n,i){const r=e.indexOf(t);if(r===-1)return eR(e,t,n,i);const s=e.lastIndexOf(t);return r!==s?n:r}const iR=(e,t)=>e===null?null:Re(Math.round(e),0,t);function Zg(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class rR extends pr{static id="category";static defaults={ticks:{callback:Zg}};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(kt(t))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:nR(i,t,Ot(n,t),this._addedLabels),iR(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 Zg.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 sR(e,t){const n=[],{bounds:r,step:s,min:a,max:l,precision:u,count:d,maxTicks:h,maxDigits:m,includeBounds:g}=e,y=s||1,x=h-1,{min:v,max:S}=t,O=!kt(a),A=!kt(l),P=!kt(d),L=(S-v)/(m+1);let R=Qp((S-v)/x/y)*y,F,U,D,w;if(R<1e-14&&!O&&!A)return[{value:v},{value:S}];w=Math.ceil(S/R)-Math.floor(v/R),w>x&&(R=Qp(w*R/x/y)*y),kt(u)||(F=Math.pow(10,u),R=Math.ceil(R*F)/F),r==="ticks"?(U=Math.floor(v/R)*R,D=Math.ceil(S/R)*R):(U=v,D=S),O&&A&&s&&jD((l-a)/s,R/1e3)?(w=Math.round(Math.min((l-a)/R,h)),R=(l-a)/w,U=a,D=l):P?(U=O?a:U,D=A?l:D,w=d-1,R=(D-U)/w):(w=(D-U)/R,Ks(w,Math.round(w),R/1e3)?w=Math.round(w):w=Math.ceil(w));const C=Math.max(tm(R),tm(U));F=Math.pow(10,kt(u)?C:u),U=Math.round(U*F)/F,D=Math.round(D*F)/F;let N=0;for(O&&(g&&U!==a?(n.push({value:a}),U<a&&N++,Ks(Math.round((U+N*R)*F)/F,a,Qg(a,L,e))&&N++):U<a&&N++);N<w;++N){const $=Math.round((U+N*R)*F)/F;if(A&&$>l)break;n.push({value:$})}return A&&g&&D!==l?n.length&&Ks(n[n.length-1].value,l,Qg(l,L,e))?n[n.length-1].value=l:n.push({value:l}):(!A||D===l)&&n.push({value:D}),n}function Qg(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 kt(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=sR(r,s);return t.bounds==="ticks"&&Jp(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 oR 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 Jg(e){return e/Math.pow(10,po(e))===1}function t0(e,t,n){const i=Math.pow(10,n),r=Math.floor(e/i);return Math.ceil(t/i)-r}function aR(e,t){const n=t-e;let i=po(n);for(;t0(e,t,i)>10;)i++;for(;t0(e,t,i)<10;)i--;return Math.min(i,po(e))}function lR(e,{min:t,max:n}){t=mn(e.min,t);const i=[],r=po(t);let s=aR(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:Jg(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 y=mn(e.max,g);return i.push({value:y,major:Jg(y),significand:m}),i}class cR 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=lR(n,this);return t.bounds==="ticks"&&Jp(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 Bu(e){const t=e.ticks;if(t.display&&e.display){const n=Se(t.backdropPadding);return Ot(t.font&&t.font.size,ae.font.size)+n.height}return 0}function uR(e,t,n){return n=jt(n)?n:[n],{w:uC(e,t.string,n),h:n.length*t.lineHeight}}function e0(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 dR(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?Pt/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=uR(e.ctx,m,e._pointLabels[u]);i[u]=g;const y=We(e.getIndexAngle(u)+l),x=Math.round(Da(y)),v=e0(x,h.x,g.w,0,180),S=e0(x,h.y,g.h,90,270);fR(n,t,y,v,S)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=mR(e,i,r)}function fR(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 hR(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+oe))),h=yR(u.y,l.h,d),m=gR(d),g=_R(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 pR(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 mR(e,t,n){const i=[],r=e._pointLabels.length,s=e.options,{centerPointLabels:a,display:l}=s.pointLabels,u={extra:Bu(s)/2,additionalAngle:a?Pt/r:0};let d;for(let h=0;h<r;h++){u.padding=n[h],u.size=t[h];const m=hR(e,h,u);i.push(m),l==="auto"&&(m.visible=pR(m,d),m.visible&&(d=m))}return i}function gR(e){return e===0||e===180?"center":e<180?"left":"right"}function _R(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function yR(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function bR(e,t,n){const{left:i,top:r,right:s,bottom:a}=n,{backdropColor:l}=t;if(!kt(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,y=a-r+d.height;Object.values(u).some(x=>x!==0)?(e.beginPath(),qr(e,{x:h,y:m,w:g,h:y,radius:u}),e.fill()):e.fillRect(h,m,g,y)}}function xR(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));bR(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 n0(e,t,n,i){const{ctx:r}=e;if(n)r.arc(e.xCenter,e.yCenter,t,0,ne);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 wR(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(),n0(e,n,a,i),s.closePath(),s.stroke(),s.restore())}function vR(e,t,n){return Ri(e,{label:n,index:t,type:"pointLabel"})}class SR 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(Bu(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/Bu(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?dR(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=ne/(this._pointLabels.length||1),i=this.options.startAngle||0;return We(t*n+ve(i))}getDistanceFromCenterForValue(t){if(kt(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(kt(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 vR(this.getContext(),t,i)}}getPointPosition(t,n,i=0){const r=this.getIndexAngle(t)-oe+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(),n0(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&&xR(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),y=r.setContext(g),x=s.setContext(g);wR(this,y,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}},cn=Object.keys(Xa);function i0(e,t){return e-t}function r0(e,t){if(kt(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 s0(e,t,n,i){const r=cn.length;for(let s=cn.indexOf(e);s<r-1;++s){const a=Xa[cn[s]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-t)/(l*a.size))<=i)return cn[s]}return cn[r-1]}function TR(e,t,n,i,r){for(let s=cn.length-1;s>=cn.indexOf(n);s--){const a=cn[s];if(Xa[a].common&&e._adapter.diff(r,i,a)>=t-1)return a}return cn[n?cn.indexOf(n):0]}function kR(e){for(let t=cn.indexOf(e)+1,n=cn.length;t<n;++t)if(Xa[cn[t]].common)return cn[t]}function o0(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:i,hi:r}=ru(n,t),s=n[i]>=t?n[i]:n[r];e[s]=!0}}function MR(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 a0(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:MR(e,i,r,n)}class Fu 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 Km._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:r0(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=ZD(r,s,a);return this._unit=n.unit||(i.autoSkip?s0(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):TR(this,l.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:kR(this._unit),this.initOffsets(r),t.reverse&&l.reverse(),a0(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||s0(s.minUnit,n,i,this._getLabelCapacity(n)),l=Ot(r.ticks.stepSize,1),u=a==="week"?s.isoWeekday:!1,d=Ai(u)||u===!0,h={};let m=n,g,y;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,y=0;g<i;g=+t.add(g,l,a),y++)o0(h,g,x);return(g===i||r.bounds==="ticks"||y===1)&&o0(h,g,x),Object.keys(h).sort(i0).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],y=d&&m&&g&&g.major;return this._adapter.format(t,r||(y?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,a0(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(r0(this,r[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return im(t.sort(i0))}}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 DR extends Fu{static id="timeseries";static defaults=Fu.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 CR=Object.freeze({__proto__:null,CategoryScale:rR,LinearScale:oR,LogarithmicScale:cR,RadialLinearScale:SR,TimeScale:Fu,TimeSeriesScale:DR});const OR=[OO,oE,tR,CR];function AR(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,y=nl(d,m,g),x=d.y,v=d.x<g?"left":"center";return{x:y-e.tooltipState.offsetX,y:x-e.tooltipState.offsetY,xAlign:v}},ku.modes.customInteractionMode=function(u,d){const h=Pi(d,u),m=[];return ku.evaluateInteractionItems(u,u.options.indexAxis||"x",h,(g,y,x)=>{u.options.indexAxis==="y"&&g.inYRange(h.y,!0)&&u.data.datasets[y].data[x]&&m.push({element:g,datasetIndex:y,index:x}),u.options.indexAxis==="x"&&h.x!==null&&g.inXRange(h.x,!0)&&u.data.datasets[y].data[x]&&m.push({element:g,datasetIndex:y,index:x})}),m};const r=e.numLabels.value>25?T0:k0,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"?!kt(e.metricAxesTitle?.value):!kt(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"?!kt(e.metricAxesTitle?.value):!kt(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=>{w0(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}an.register(...OR);const ER=(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 RR(e,t,n,i,r){const s=f.shallowRef(null),a=(l,u)=>{if(t.value)return new an(t.value,{type:e,data:l,plugins:i,options:u})};return f.onMounted(()=>{s.value=a(n.value,r.value)}),f.onBeforeUnmount(()=>{kt(s.value)||s.value.destroy()}),f.watch(n,(l,u)=>{if(ER(u,l)&&!kt(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 kt(s.value)||s.value.destroy(),s.value=a(l,r.value)}),f.watch(t,()=>{kt(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))&&(kt(s.value)||s.value.destroy(),s.value=a(n.value,l))}),s}const l0=1e3,PR=1e4,c0=1e6,u0=1e9,d0=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?PR:l0;return e<r||t.precision&&t.precision>Math.log10(e)?n=mo(Zr(e,1,t),t):e<c0?n=`${Zr(e,l0,t)}k`:e<u0?n=`${Zr(e,c0,t)}m`:e<d0?n=`${mo(Zr(e,u0,t),t)}b`:n=`${mo(Zr(e,d0,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 IR(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,y)=>g+(typeof y=="number"?Number(y)||0:Number(y&&y.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 LR(e){return f.computed(()=>{if(!e.value?.meta)return"";const n=e.value.meta.start,i=e.value.meta.end;return n&&i?`${Gh(new Date(n))} - ${Gh(new Date(i),{includeTZ:!0})}`:""})}function NR(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=>{w0(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 BR(e){const t=f.computed(()=>({type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:10,source:"auto",maxRotation:0,callback:h=>{const m=new Date(h);return $0({tickValue:m,granularity:e.granularity.value,dayBoundaryCrossed:u.value})}},title:{display:!1},border:{display:!1},stacked:e.stacked.value})),n=f.computed(()=>!!e.rightYAxis?.value),i=f.computed(()=>({title:{display:!kt(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:!kt(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(),y=e.tooltipState.width||this.width,x=e.tooltipState.height||this.height,v=g.width/2,S=g.height/2,O=nl(m,y,v);let A=v0(m,x,S);const P=m.y<S?"top":"bottom",L=m.x<v?"left":"center";return x>g.height&&(A=0),{x:O,y:A,xAlign:L,yAlign:P}};const u=f.computed(()=>{const h=Number(e.timeRangeMs.value),m=new Date,g=new Date(m.getTime()-h);return Np(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?{[qu]:r.value}:{}},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},streaming:!1,tooltip:{...l,external:h=>{Vu(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 FR=["usd","bytes"],zR="usd";function UR(e){const{i18n:t}=St.useI18n(),{formatUnit:n}=$n({i18n:t}),i=(y,x)=>!x||!FR.includes(x)?y:y===0&&x===zR?t.formatNumber(0,{style:"currency",currency:"USD"}):n(y,x),r=f.computed(()=>{const y=Number(e.timeRangeMs.value),x=new Date,v=new Date(x.getTime()-y);return Np(y)>24||v.getDate()!==x.getDate()}),s=f.computed(()=>({display:!kt(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:y=>i(y,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:y=>$0({tickValue:new Date(y),granularity:e.granularity.value,dayBoundaryCrossed:r.value})},title:s.value,border:{display:!1}})),u=f.computed(()=>({title:{display:!kt(e.metricAxesTitle?.value),text:e.metricAxesTitle?.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5,callback:y=>i(y,e.metricUnit?.value)},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1}})),d=(y,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(y,x){if(!y.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,O=e.tooltipState.height||this.height,A=v.width/2,P=v.height/2,L=nl(x,S,A);let R=v0(x,O,P);const F=x.y<P?"top":"bottom",U=x.x<A?"left":"center";return O>v.height&&(R=0),{x:L,y:R,xAlign:U,yAlign:F}};const g=f.computed(()=>({hover:{mode:"nearest",intersect:!1},interaction:{mode:"point",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:y=>{Vu(e.tooltipState,y,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 HR(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}):ju(i.indexOf(g),Xn),data:a.map((y,x)=>n?s[`${y.id},${g}`]||0:s[`${x},${g}`]||null)})):Array.from(r).flatMap((g,y)=>g?{dimension:u,dimensionValue:g.id,label:d&&d.te(`chartLabels.${g.name}`)&&d.t(`chartLabels.${g.name}`)||g.name,backgroundColor:m?Bs({dimension:u,dimensionValue:g.id}):Gu(y,g.name,g.id==="empty",l??Xn),data:a.map(x=>s[`${x.id},${g.id}`]||null),isSegmentEmpty:g.id==="empty"}:[])}function WR(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],y=m.length>1?m[1]:m[0],x=Object.fromEntries(u?r.flatMap(w=>a.map((C,N)=>{const $=w.event[g],V=d?`${$},${C}`:`${N},${C}`,st=w.event[C];return[V,st]})):r.map(w=>{const C=d?`${w.event[g]},${w.event[y]}`:`${g},${y}`,N=w.event[a[0]];return[C,N]})),v=Object.keys(x).reduce((w,C)=>{const[N]=C.split(","),$=x[C];return w[N]?w[N]+=$:w[N]=$,w},{}),S=Object.entries(v).sort(([,w],[,C])=>Number(C)-Number(w)).map(([w])=>w),O=s[g],A=s[y];let P=d&&O&&Object.entries(O).map(([w,C])=>({id:w,name:C.name}))||a.map(w=>({id:w,name:w})),L=d&&A&&Object.entries(A).map(([w,C])=>({id:w,name:C.name}))||a.map(w=>({id:w,name:w}));if(d&&g==="country_code"&&(P=P.map(w=>({...w,name:Bc(w.id)||w.name}))),d&&y==="country_code"&&(L=L.map(w=>({...w,name:Bc(w.id)||w.name}))),g!=="status_code"&&g!=="status_code_grouped"&&(P.sort((w,C)=>S.indexOf(w.id)-S.indexOf(C.id)),L.sort((w,C)=>S.indexOf(w.id)-S.indexOf(C.id))),!P||!L)return{labels:[],datasets:[]};const R=HR({isMultiMetric:u,hasDimensions:d,metricNames:a,dimensionFieldNames:m,barSegmentLabels:L,pivotRecords:x,rowLabels:P,seriesDimension:y,colorPalette:e.colorPalette||Xn}),F=d?P.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=P.map(w=>w.id==="empty");return{labels:F,datasets:R,isLabelEmpty:U,isMultiDimension:h}}}catch(r){return console.error(r),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const $R=(e,t,n=1)=>Array(Math.ceil((t-e)/n)).fill(e).map((i,r)=>i+r*n),VR=e=>{if(typeof e=="string"){const t=+e;if(t)return t;try{return Bp(e).getTime()}catch(n){if(n instanceof RangeError)return 0;throw n}}return e},YR=(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 $R(l,u,n)};function qR(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(),y=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],O=!!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:Bc(w.id)||w.name})));const P=t.value.meta.granularity_ms;if(typeof P!="number"||isNaN(P)||!isFinite(P)||P===0)return console.error("Invalid step value:",P),{datasets:[],labels:[]};if(!a.length)return{datasets:[],labels:[]};const L=VR(g),R=YR(g,y,P,L,a),F=a?.length?a.reduce((w,C)=>{const N=new Date(C.timestamp).valueOf(),$=C.event;for(const V of u)N in w||(w[N]={}),V in w[N]||(w[N][V]={});for(const V of u)A.forEach(st=>{(S?$[v]===st.id:V===st.id)?(w[N][V]||(w[N][V]={}),w[N][V][st.id]=Math.round(Number($[V])*1e3)/1e3):x.length||(w[N][V]||(w[N][V]={}),w[N][V][st.id]=Math.round(Number($[st.id])*1e3)/1e3)});return w},{}):{},D=[...S||u.length===1?u.flatMap(w=>A.map(C=>[w,C.id,C.name,C.id==="empty"])):A.map(w=>[w.name,w.id,w.name,w.id==="empty"])].map(([w,C,N,$],V)=>{const st=R.map(B=>B in F&&w in F[B]?{x:B,y:F[B][w][C]||0}:{x:B,y:0});let{colorPalette:dt,fill:ut}=e;kt(dt)&&(dt=Xn);const ct=r?Bs({dimension:v,dimensionValue:C}):Gu(V,N,$,dt),Tt=K0(N)?n.t(`chartLabels.${N}`):N,at=K0(w)?n.t(`chartLabels.${w}`):w,pt=u.findIndex(B=>B===w),G=e.metricAxisMap?.[w]==="right";return{dimension:v,dimensionValue:C,rawDimension:N,rawMetric:w,label:O?`${Tt} — ${at}`:Tt,borderColor:ct,backgroundColor:ct,data:st,total:st.reduce((B,{y:z})=>B+Number(z),0),...LP,...O?{borderDash:pt===0?[]:[pt*4,2]}:{},...!O&&G?{borderDash:[4,2]}:{},...G?{yAxisID:qu}:{},...e.metricAxisMap?{unit:d?.[w]??""}:{},fill:ut,borderWidth:ut?BP:NP,isSegmentEmpty:$}});return v==="status_code"||v==="status_code_grouped"?D.sort((w,C)=>(w.label??"")<(C.label??"")?-1:1):D.sort((w,C)=>Number(w.total)<Number(C.total)?-1:1),{datasets:D}}}catch(a){return console.error(a),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const jR=3,GR=.6,f0=2,KR=2,h0=50,XR=[6,4],ZR=[2,3],QR=(e,t)=>{const n=Math.sin(t)*1e4;return(n-Math.floor(n))*e};function JR(e,t){const{i18n:n}=St.useI18n(),{evaluateFeatureFlag:i}=St.useEvaluateFeatureFlag(),r=i("analytics-color-updates",!1),s=(a,l)=>l||(a===h0?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:"",y=e.scatter||{},x=y.jitterMs??0,v=y.pointRadius??jR,S=y.pointOpacity??GR,O=new Map,A=[];a.points.forEach(V=>{const st=V.group??l,dt=O.get(st)||[];let ut,ct;V.x!==void 0?(ut={x:V.x,timestamp:V.timestamp},ct=[{label:g,value:V.x,...m?{unit:m}:{}},...V.extras??[]]):(ut={x:V.timestamp+QR(x,V.timestamp+V.value)},ct=V.extras??[]),dt.push({...ut,y:V.value,...ct.length?{extras:ct}:{}}),O.set(st,dt),A.push(V.value)});const P=y.percentileLines||[],L=[...P.map(V=>V.percentile),...y.outlierPercentile!==void 0?[y.outlierPercentile]:[]],R=L.length?M2(A,L):new Map,F=y.outlierPercentile!==void 0?R.get(y.outlierPercentile):void 0,U=F!==void 0&&Number.isFinite(F),D=kt(e.colorPalette)?Xn:e.colorPalette,w=e.themeColors?.value??ud(),C=[],N=V=>{const st=V?.y;return U&&Number.isFinite(st)&&st>F};Array.from(O.entries()).forEach(([V,st],dt)=>{const ut=u&&d?.[V]?.name||V,ct=V==="empty",Tt=r?Bs({dimension:u,dimensionValue:V}):Gu(dt,ut,ct,D),at=cd(Tt,S),pt=n.te(`chartLabels.${ut}`)&&n.t(`chartLabels.${ut}`)||ut;C.push({dimension:u,dimensionValue:V,type:"scatter",rawDimension:ut,rawMetric:l,label:pt,borderColor:G=>N(G.raw)?w.outlier:Tt,backgroundColor:G=>N(G.raw)?w.outlier:at,pointRadius:G=>N(G.raw)?v+f0:v,pointHoverRadius:G=>(N(G.raw)?v+f0:v)+KR,data:st,pointBorderWidth:0,showLine:!1,isSegmentEmpty:ct})});const $=[];return P.forEach(V=>{const st=R.get(V.percentile);if(st===void 0||!Number.isFinite(st))return;const dt=V.percentile===h0;$.push({percentile:V.percentile,label:s(V.percentile,V.label),value:st,color:V.color||(dt?w.medianLine:w.outlier),borderDash:V.borderDash||(dt?XR:ZR)})}),{datasets:C,...U?{outlier:{value:F,label:n.t("scatter.outlier",{label:s(y.outlierPercentile)}),color:w.outlier}}:{},...$.length?{referenceLines:$}:{}}}catch(a){return console.warn(a),{datasets:[]}}})}const tP=(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 eP(){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 nP="analytics-query-provider",zu="analytics-dashboard-coordinator",p0=2,Uu="____OTHER____",iP="empty";function rP(){const e=f.inject(nP);return{evaluateFeatureFlag:(n,i)=>typeof e?.evaluateFeatureFlagFn!="function"?i:e.evaluateFeatureFlagFn(n,i)}}function m0(e,t){return f.getCurrentScope()?(f.onScopeDispose(e,t),!0):!1}const g0=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const sP=e=>e!=null,oP=Object.prototype.toString,aP=e=>oP.call(e)==="[object Object]";function Qa(e){return Array.isArray(e)?e:[e]}function lP(e){return f.getCurrentInstance()}function cP(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 uP(e,t=!0,n){lP()?f.onMounted(e,n):t?e():f.nextTick(e)}function dP(e,t,n){return f.watch(e,t,{...n,immediate:!0})}const Ja=g0?window:void 0;function Qr(e){var t;const n=f.toValue(e);return(t=n?.$el)!==null&&t!==void 0?t:n}function _o(...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 dP(()=>{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=aP(a)?{...a}:a,h=i.flatMap(m=>r.flatMap(g=>s.map(y=>t(m,g,y,d))));u(()=>{h.forEach(m=>m())})},{flush:"post"})}function fP(){const e=f.shallowRef(!1),t=f.getCurrentInstance();return t&&f.onMounted(()=>{e.value=!0},t),e}function _0(e){const t=fP();return f.computed(()=>(t.value,!!e()))}function hP(e,t,n={}){const{window:i=Ja,...r}=n;let s;const a=_0(()=>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(sP);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 m0(h),{isSupported:a,stop:h,takeRecords:d}}const tl={speed:2,margin:30,direction:"both"};function pP(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 mP(e,t={}){var n,i,r,s;const{pointerTypes:a,preventDefault:l,stopPropagation:u,exact:d,onMove:h,onEnd:m,onStart:g,initialValue:y,axis:x="both",draggingElement:v=Ja,containerElement:S,handle:O=e,buttons:A=[0],restrictInView:P,autoScroll:L=!1}=t,R=f.ref((n=f.toValue(y))!==null&&n!==void 0?n:{x:0,y:0}),F=f.ref(),U=G=>a?a.includes(G.pointerType):!0,D=G=>{f.toValue(l)&&G.preventDefault(),f.toValue(u)&&G.stopPropagation()},w=f.toValue(L),C=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,N=G=>typeof G=="number"?[G,G]:[G.x,G.y],$=(G,B,z)=>{const{clientWidth:Z,clientHeight:it,scrollLeft:ht,scrollTop:mt,scrollWidth:X,scrollHeight:ot}=G,[vt,lt]=N(C.margin),[bt,Rt]=N(C.speed);let j=0,et=0;(C.direction==="x"||C.direction==="both")&&(z.x<vt&&ht>0?j=-bt:z.x+B.width>Z-vt&&ht<X-Z&&(j=bt)),(C.direction==="y"||C.direction==="both")&&(z.y<lt&&mt>0?et=-Rt:z.y+B.height>it-lt&&mt<ot-it&&(et=Rt)),(j||et)&&G.scrollBy({left:j,top:et,behavior:"auto"})};let V=null;const st=()=>{const G=f.toValue(S);G&&!V&&(V=setInterval(()=>{const B=f.toValue(e).getBoundingClientRect(),{x:z,y:Z}=R.value,it={x:z-G.scrollLeft,y:Z-G.scrollTop};it.x>=0&&it.y>=0&&($(G,B,it),it.x+=G.scrollLeft,it.y+=G.scrollTop,R.value=it)},1e3/60))},dt=()=>{V&&(clearInterval(V),V=null)},ut=(G,B,z,Z)=>{const[it,ht]=typeof z=="number"?[z,z]:[z.x,z.y],{clientWidth:mt,clientHeight:X}=B;return G.x<it||G.x+Z.width>mt-it||G.y<ht||G.y+Z.height>X-ht},ct=()=>{if(f.toValue(t.disabled)||!F.value)return;const G=f.toValue(S);if(!G)return;const B=f.toValue(e).getBoundingClientRect(),{x:z,y:Z}=R.value,it={x:z-G.scrollLeft,y:Z-G.scrollTop};ut(it,G,C.margin,B)?st():dt()};f.toValue(L)&&f.watch(R,ct);const Tt=G=>{var B;if(!f.toValue(A).includes(G.button)||f.toValue(t.disabled)||!U(G)||f.toValue(d)&&G.target!==f.toValue(e))return;const z=f.toValue(S),Z=z==null||(B=z.getBoundingClientRect)===null||B===void 0?void 0:B.call(z),it=f.toValue(e).getBoundingClientRect(),ht={x:G.clientX-(z?it.left-Z.left+(L?0:z.scrollLeft):it.left),y:G.clientY-(z?it.top-Z.top+(L?0:z.scrollTop):it.top)};g?.(ht,G)!==!1&&(F.value=ht,D(G))},at=G=>{if(f.toValue(t.disabled)||!U(G)||!F.value)return;const B=f.toValue(S);B instanceof HTMLElement&&pP(B);const z=f.toValue(e).getBoundingClientRect();let{x:Z,y:it}=R.value;if((x==="x"||x==="both")&&(Z=G.clientX-F.value.x,B&&(Z=Math.min(Math.max(0,Z),B.scrollWidth-z.width))),(x==="y"||x==="both")&&(it=G.clientY-F.value.y,B&&(it=Math.min(Math.max(0,it),B.scrollHeight-z.height))),f.toValue(L)&&B&&(V===null&&$(B,z,{x:Z,y:it}),Z+=B.scrollLeft,it+=B.scrollTop),B&&(P||L)){if(x!=="y"){const ht=Z-B.scrollLeft;ht<0?Z=B.scrollLeft:ht>B.clientWidth-z.width&&(Z=B.clientWidth-z.width+B.scrollLeft)}if(x!=="x"){const ht=it-B.scrollTop;ht<0?it=B.scrollTop:ht>B.clientHeight-z.height&&(it=B.clientHeight-z.height+B.scrollTop)}}R.value={x:Z,y:it},h?.(R.value,G),D(G)},pt=G=>{f.toValue(t.disabled)||!U(G)||F.value&&(F.value=void 0,L&&dt(),m?.(R.value,G),D(G))};if(g0){const G=()=>{var B;return{capture:(B=t.capture)!==null&&B!==void 0?B:!0,passive:!f.toValue(l)}};_o(O,"pointerdown",Tt,G),_o(v,"pointermove",at,G),_o(v,["pointerup","pointercancel"],pt,G)}return{...cP(R),position:R,isDragging:f.computed(()=>!!F.value),style:f.computed(()=>`
4
4
  left: ${R.value.x}px;
5
5
  top: ${R.value.y}px;
6
6
  ${L?"text-wrap: nowrap;":""}
7
- `)}}function gP(e,t,n={}){const{window:i=Ja,...r}=n;let s;const a=y0(()=>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 m0(d),{isSupported:a,stop:d}}function yP(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 O=Qr(e);if(!O){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=O.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 gP(e,S),f.watch(()=>Qr(e),O=>!O&&S()),hP(e,S,{attributeFilter:["style","class"]}),r&&yo("scroll",S,{capture:!0,passive:!0}),i&&yo("resize",S,{passive:!0}),uP(()=>{s&&S()}),{height:l,bottom:u,left:d,right:h,top:m,width:g,x:_,y:x,update:S}}function _P(e,t){const{top:n,left:i}=yP(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 bP=({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},_0=()=>({minCounts:{},maxCounts:{},minStamps:{},maxStamps:{},renderPoints:{}}),_o=f.ref({}),xP=e=>(_o.value[e]||(_o.value[e]=_0()),_o.value[e]),wP=(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 vP({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?xP(n):_0(),m=e!==void 0?e:"static-chart-key",g=f.computed(()=>t.reduce((C,{timestamps:N})=>[...C,...N],[])),_=f.computed(()=>i||g.value.reduce((C,N)=>C===0?N:Math.min(C,N),0)),x=f.computed(()=>r||g.value.reduce((C,N)=>Math.max(C,N),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((C,N)=>C===0?N:Math.min(C,N),0)),S=f.computed(()=>Object.values(h.maxStamps).reduce((C,N)=>Math.max(C,N),0)),O=f.computed(()=>{const C=Object.values(h.renderPoints);return C.length===0?24:C.reduce((N,$)=>Math.max(N,$),2)}),A=f.computed(()=>{const C=S.value-v.value;return Math.ceil(C/O.value)}),P=f.computed(()=>t.length>1),L=f.computed(()=>t.map(({timestamps:C,color:N,label:$})=>({data:bP({bucketCount:O.value,minStamp:v.value,maxStamp:S.value,timestamps:C}).map(([dt,ut])=>({x:dt,y:ut})),label:$,...(u==="sparkline_bar"||P.value)&&N&&{backgroundColor:N},...u!=="sparkline_bar"&&N&&{borderColor:N},...P.value&&u!=="sparkline_bar"&&{fill:!0}}))),R=f.computed(()=>{const C=L.value[0]?.data?.length??0,N=[];for(let $=0;$<C;$++){let V=0;for(let st=0;st<L.value.length;st++)V+=L.value[st].data[$].y;N.push(V)}return N}),F=f.computed(()=>{const C=R.value.reduce((N,$)=>Math.max(N,$),0);return Math.max(C,a??0)}),U=f.computed(()=>{const C=L.value.reduce((V,{data:st})=>[...V,...st.map(({y:dt})=>dt)],[]),N=C.length?C[0]:0,$=C.reduce((V,st)=>Math.min(V,st),N);return s===void 0?$:Math.min($,s)});f.watchEffect(()=>{h.maxCounts[m]=F.value,h.minCounts[m]=U.value});const D=f.computed(()=>{const C=Object.values(h.minCounts),N=C.length?C[0]:0;return C.reduce(($,V)=>Math.min($,V),N)}),w=f.computed(()=>Object.values(h.maxCounts).reduce((C,N)=>Math.max(C,N),0));return f.onUnmounted(()=>{e!==void 0&&n!==void 0&&wP(e,n)}),{syncedMinStamp:v,syncedMaxStamp:S,syncedRenderPoints:O,syncedChartDatasets:L,syncedGroupSizeMs:A,syncedMinCount:D,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},Hu=e=>e.reduce((t,n)=>n===null?t:{sum:t.sum+n,max:Math.max(t.max,n)},{sum:0,max:0}),Wu=(e,t)=>t.sum>0?e/t.sum:null,b0=(e,t,n)=>{const i=n==="relative"?t.sum:t.max;return i<=0?0:Math.min(Math.max(e/i,0),1)},$u=(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"},x0=18,SP=85;function TP(e,t,n,i){const{i18n:r}=Up(),{formatUnit:s}=$n({i18n:r}),a=R=>R.map(F=>{const U=Math.min(F.ratio,.5)/.5;return{...F,color:Bs({metric:n.value}),tint:`${x0+U*(SP-x0)}%`}}),l=f.computed(()=>e.value?.data??[]),u=f.computed(()=>e.value?.meta?.metric_names??[]),d=f.computed(()=>{const R=n.value;return R&&u.value.includes(R)?R:u.value[0]}),h=f.computed(()=>u.value.filter(R=>R!==d.value)),m=f.computed(()=>e.value?.meta?.display?.[t.value]??{}),g=(R,F)=>{if(xo(R)||R==="count"||R==="requests")return"";const U=F===1?"":"s";return r.te(`chartUnits.${R}`)?r.t(`chartUnits.${R}`,{plural:U}):R},_=R=>{const F=U=>s(U,"%",{translateUnit:D=>g(D,U)});return R>0&&R<.01?`< ${F(.01)}`:F(R)},x=(R,F)=>{if(R===null)return"–";const U=e.value?.meta?.metric_units?.[F]||"count";return U==="%"?_(R):s(R,U,{isBytes1024:!0,translateUnit:D=>g(D,R)})},v=R=>r.te(`chartLabels.${R}`)?r.t(`chartLabels.${R}`):R,S=R=>gr(i.value,R)?.label||v(R),O=f.computed(()=>Hu(l.value.map(R=>d.value?Jr(R.event[d.value]):null))),A=R=>h.value.flatMap(F=>{const U=Jr(R[F]);if(U===null)return[];const D=$u(U,gr(i.value,F)?.thresholds);return[{key:F,label:S(F),value:x(U,F),threshold:D}]}),P=f.computed(()=>{if(!d.value)return[];const R=l.value.map(F=>{const U=F.event,D=String(U[t.value]),w=Jr(U[d.value])??0,C=Wu(w,O.value),N=C??0,$=D===Uu;return{id:D,name:$?v(Uu):m.value[D]?.name||D,deleted:!!m.value[D]?.deleted,isOther:$,isEmpty:D===iP,value:w,ratio:N,display:x(w,d.value),relative:C===null?"":_(C*100),tooltipRows:A(U)}}).sort((F,U)=>Number(F.isOther)-Number(U.isOther)||U.value-F.value);return a(R)});return{column:f.computed(()=>({dimension:t.value,label:S(t.value),total:x(O.value.sum,d.value??"count"),cells:P.value})),cells:P,sizeKey:d}}const St={useBarChartOptions:AR,useChartJSCommon:RR,useChartLegendValues:IR,useChartSelectedRange:LR,useExploreResultToDatasets:WR,useExploreResultToTimeDataset:qR,useScatterDatasets:JR,useDonutChartOptions:NR,useLineChartOptions:BR,useScatterChartOptions:UR,useI18n:Up,useReportChartDataForSynthetics:tP,useTranslatedUnits:eP,useEvaluateFeatureFlag:rP,useTooltipAbsolutePosition:_P,useSparklineSync:vP,useTopTalkersData:TP},el=e=>["interactive","zoom-interactive"].includes(e),Vu=(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}),O=g.raw?.tooltipLabel||g.dataset.label;return{backgroundColor:u[_].backgroundColor,borderColor:u[_].borderColor,label:O,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}},w0=(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}},kP=e=>e&&e.datasets&&e.datasets.length,MP=e=>kP(e)&&e.datasets.some(t=>t.data.length),DP=e=>e.datasets.some(t=>t.data[0]&&Wc(t.data[0].x)),CP=e=>!!MP(e)&&e.datasets.some(t=>t.data.length==1),OP=e=>DP(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)},v0=(e,t,n)=>{const s=e.y??0;return s<n?s+t*.15:s-t*.5};function S0(e,t){let n;return(...i)=>{clearTimeout(n),n=window.setTimeout(()=>{e(...i)},t)}}const Yu=(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)},AP=2,T0=10,k0=12,il=10,rl="y",qu="y1",Xn=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],ju=(e,t)=>(t||Xn)[e%Xn.length],EP="#6f7787",RP={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"}},PP=e=>{const t=Math.floor(parseInt(e,10)/100)*100;return RP[t]?.background||"#fafafa"},IP=dS,Gu=(e,t,n,i)=>{let r;return n?r=IP:Array.isArray(i)?r=ju(e,i):r=i[t],r||ju(e)},Ku=e=>{switch(e){case"error":return fS;case"warning":return gS;case"neutral":return lp;default:return lp}},LP={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},NP=2,BP=0,Xu=new Map,M0=(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)},FP=e=>{const n=document.createElement("canvas").getContext("2d"),i=ce({});return n.font=i.string,n.measureText(e).width},zP=()=>{const e="label_height";if(!Xu.has(e)){const t=ce({});Xu.set(e,t.lineHeight)}return Xu.get(e)},UP=(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),HP=(e,t)=>t===0?" (0.0%)":` (${(e/t*100).toFixed(1)}%)`,WP=uS,$P={100:bS,101:xS,102:wS,103:vS,200:SS,201:TS,202:kS,203:MS,204:DS,205:CS,206:OS,207:AS,208:ES,226:RS,300:PS,301:IS,302:LS,303:NS,304:BS,305:FS,307:zS,308:US,400:HS,401:WS,402:$S,403:VS,404:YS,405:qS,406:jS,407:GS,408:KS,409:XS,410:ZS,411:QS,412:JS,413:tT,414:eT,415:nT,416:iT,417:rT,418:sT,421:oT,422:aT,423:lT,424:cT,425:uT,426:dT,428:fT,429:hT,431:pT,451:mT,500:gT,501:yT,502:_T,503:bT,504:xT,505:wT,506:vT,507:ST,508:TT,510:kT,511:MT},VP={100:DT,200:CT,300:OT,400:AT,500:ET},YP={"1XX":RT,"2XX":PT,"3XX":IT,"4XX":LT,"5XX":NT},D0=e=>{const t=parseInt(e,10),n=Math.floor(t/100)*100;return $P[t]??VP[n]??WP},Zu={...Array.from({length:500},(e,t)=>100+t).reduce((e,t)=>(e[`${t}`]=D0(`${t}`),e),{}),____OTHER____:cS,...YP};function C0(e,t,n){const i=Ep(),r=GP(e,n.timeZone,n.locale??i.locale);return"formatToParts"in r?qP(r,t):jP(r,t)}function qP(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 jP(e,t){const n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}function GP(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function KP(e,t){const n=t2(t);return"formatToParts"in n?ZP(n,e):QP(n,e)}const XP={year:0,month:1,day:2,hour:3,minute:4,second:5};function ZP(e,t){try{const n=e.formatToParts(t),i=[];for(let r=0;r<n.length;r++){const s=XP[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 QP(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 Qu={},O0=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")),JP=O0==="06/25/2014, 00:00:00"||O0==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function t2(e){return Qu[e]||(Qu[e]=JP?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"})),Qu[e]}function A0(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 E0=36e5,e2=6e4,Ju={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function td(e,t,n){if(!e)return 0;let i=Ju.timezoneZ.exec(e);if(i)return 0;let r,s;if(i=Ju.timezoneHH.exec(e),i)return r=parseInt(i[1],10),R0(r)?-(r*E0):NaN;if(i=Ju.timezoneHHMM.exec(e),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return R0(r,a)?(s=Math.abs(r)*E0+a*e2,i[1]==="+"?-s:s):NaN}if(r2(e)){t=new Date(t||Date.now());const a=n?t:n2(t),l=ed(a,e);return-(n?l:i2(t,l,e))}return NaN}function n2(e){return A0(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function ed(e,t){const n=KP(e,t),i=A0(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 i2(e,t,n){let r=e.getTime()-t;const s=ed(new Date(r),n);if(t===s)return t;r-=s-t;const a=ed(new Date(r),n);return s===a?s:Math.max(s,a)}function R0(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const P0={};function r2(e){if(P0[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),P0[e]=!0,!0}catch{return!1}}const s2=60*1e3,o2={X:function(e,t,n){const i=nd(n.timeZone,e);if(i===0)return"Z";switch(t){case"X":return I0(i);case"XXXX":case"XX":return ts(i);default:return ts(i,":")}},x:function(e,t,n){const i=nd(n.timeZone,e);switch(t){case"x":return I0(i);case"xxxx":case"xx":return ts(i);default:return ts(i,":")}},O:function(e,t,n){const i=nd(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+a2(i,":");default:return"GMT"+ts(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return C0("short",e,n);default:return C0("long",e,n)}}};function nd(e,t){const n=e?td(e,t,!0)/s2: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 I0(e,t){return e%60===0?(e>0?"-":"+")+sl(Math.abs(e)/60,2):ts(e,t)}function a2(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 L0(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 l2=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,id=36e5,N0=6e4,c2=2,Je={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:l2};function B0(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?c2: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=u2(e),{year:r,restDateString:s}=d2(i.date,n),a=f2(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=h2(i.time),u===null||isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(d=td(i.timeZone||t.timeZone,new Date(l+u)),isNaN(d))return new Date(NaN)}else d=L0(new Date(l+u)),d=L0(new Date(l+u+d));return new Date(l+u+d)}else return new Date(NaN)}function u2(e){const t={};let n=Je.dateTimePattern.exec(e),i;if(n?(t.date=n[1],i=n[3]):(n=Je.datePattern.exec(e),n?(t.date=n[1],i=n[2]):(t.date=null,i=e)),i){const r=Je.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function d2(e,t){if(e){const n=Je.YYY[t],i=Je.YYYYY[t];let r=Je.YYYY.exec(e)||i.exec(e);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:e.slice(s.length)}}if(r=Je.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 f2(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=Je.MM.exec(e);if(s)return n=new Date(0),i=parseInt(s[1],10)-1,U0(t,i)?(n.setUTCFullYear(t,i),n):new Date(NaN);if(s=Je.DDD.exec(e),s){n=new Date(0);const a=parseInt(s[1],10);return g2(t,a)?(n.setUTCFullYear(t,0,a),n):new Date(NaN)}if(s=Je.MMDD.exec(e),s){n=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return U0(t,i,a)?(n.setUTCFullYear(t,i,a),n):new Date(NaN)}if(s=Je.Www.exec(e),s)return r=parseInt(s[1],10)-1,H0(r)?F0(t,r):new Date(NaN);if(s=Je.WwwD.exec(e),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return H0(r,a)?F0(t,r,a):new Date(NaN)}return null}function h2(e){let t,n,i=Je.HH.exec(e);if(i)return t=parseFloat(i[1].replace(",",".")),rd(t)?t%24*id:NaN;if(i=Je.HHMM.exec(e),i)return t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),rd(t,n)?t%24*id+n*N0:NaN;if(i=Je.HHMMSS.exec(e),i){t=parseInt(i[1],10),n=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return rd(t,n,r)?t%24*id+n*N0+r*1e3:NaN}return null}function F0(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 p2=[31,28,31,30,31,30,31,31,30,31,30,31],m2=[31,29,31,30,31,30,31,31,30,31,30,31];function z0(e){return e%400===0||e%4===0&&e%100!==0}function U0(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const i=z0(e);if(i&&n>m2[t]||!i&&n>p2[t])return!1}return!0}function g2(e,t){if(t<1)return!1;const n=z0(e);return!(n&&t>366||!n&&t>365)}function H0(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function rd(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const y2=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function sd(e,t,n={}){t=String(t);const i=t.match(y2);if(i){const r=B0(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,"'"+o2[a[0]](r,a,n)+"'");return u?d.substring(0,l-1)+d.substring(l+1):d},t)}return ya(e,t,n)}function _2(e,t,n){e=B0(e,n);const i=td(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},sd(_2(e,t,{timeZone:i.timeZone}),n,i)}const b2=(e,t)=>`${bo(e,t,"yyyy")} W${bo(e,t,"II")}`,od="MMM dd, h:mm:ss a",ad="h:mm:ss a",yr="MMM dd, h:mm a",es="h:mm a",x2="MMM dd",ld="MMM dd, h:mm:ss a",Bi="MMM dd, h:mm a",w2={secondly:e=>e?od:ad,tenSecondly:e=>e?od:ad,thirtySecondly:e=>e?od:ad,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:()=>x2},v2={secondly:()=>ld,tenSecondly:()=>ld,thirtySecondly:()=>ld,minutely:()=>Bi,fiveMinutely:()=>Bi,tenMinutely:()=>Bi,thirtyMinutely:()=>Bi,hourly:()=>Bi,twoHourly:()=>Bi,twelveHourly:()=>Bi,daily:()=>Bi};function W0({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 b2(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 $0=({tickValue:e,granularity:t,dayBoundaryCrossed:n,timezone:i})=>W0({tickValue:e,granularity:t,timezone:i,dayBoundaryCrossed:n,tickMap:w2,defaultFormat:"MMM dd, h:mm:ss a"}),ns=({tickValue:e,granularity:t,timezone:n})=>W0({tickValue:e,granularity:t,timezone:n,tooltipMap:v2,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),V0=e=>e?.code==="ERR_CANCELED"||e?.name==="CanceledError"||e?.name==="AbortError",S2=e=>{const{i18n:t}=St.useI18n();return V0(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"),T2=e=>{const t=e.toLocaleLowerCase();return["sum","count","cost","tokens"].some(n=>t.endsWith(n))},k2=(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)},M2=(e,t)=>{const n=e.filter(i=>Number.isFinite(i)).sort((i,r)=>i-r);return new Map(t.map(i=>[i,k2(n,i)]))},Y0=.7,cd=(e,t)=>{const n=Aa(e.trim());return n.valid?n.alpha(t).rgbString():e},ud=e=>{const t=e??(typeof document>"u"?null:document.documentElement);if(typeof window>"u"||!t)return{medianLine:cp,outlier:op,outlierBand:cd(ap,Y0)};const n=window.getComputedStyle(t),i=(r,s)=>n.getPropertyValue(r).trim()||s;return{medianLine:i("--kui-color-text",cp),outlier:i("--kui-color-background-danger",op),outlierBand:cd(i("--kui-color-background-danger-weakest",ap),Y0)}},D2="empty",q0=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=G0(x.timestamp,x.event[h],m?x.event[m]:void 0);if(v){if(d){const S=j0(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}},j0=e=>{if(e==null||e==="")return;const t=Number(e);return Number.isFinite(t)?t:void 0},G0=(e,t,n,i)=>{const r=new Date(e).valueOf(),s=j0(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):D2,...a}},C2=(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},O2=(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 A2(h,r)){const _=_r(g,n),x=i?_r(g,i)??_r(h,i):void 0,v=G0(m,_,i?x??null:void 0,C2(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"}},A2=(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},K0=e=>Object.hasOwn(zp.chartLabels,e),E2=["hidden","single","full"];var br=(e=>(e.String="string",e.Number="number",e.Boolean="boolean",e.Object="object",e.Undefined="undefined",e))(br||{});const R2=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar","scatter"],P2=["gauge","top_n","single_value"],dd=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 X0={modes:{point(e,t){return ol(e,t,{intersect:!0})},nearest(e,t,n){return N2(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 fd(e,t,n){return(X0.modes[n.mode]||X0.modes.nearest)(e,t,n)}function I2(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 L2(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):I2(i,t,n.axis))}function N2(e,t,n){let i=Number.POSITIVE_INFINITY;return ol(e,t,n).reduce((r,s)=>{const a=s.getCenterPoint(),l=L2(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 B2=(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)),Z0=(e,t)=>e.value>=e.start-t&&e.value<=e.end+t;function F2(e,t,n){for(const i of Object.keys(e))e[i]=al(e[i],t,n);return e}function z2(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 Q0(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 J0(e,{rect:t,center:n},i,{rotation:r,borderWidth:s,hitTolerance:a}){const l=xr(e,n,ve(-r));return Q0(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 U2(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(B2(l,a)){if(i)throw new Error(`${e} v${n} is not supported. v${t} or newer is required.`);return!1}}return!0}const ty=e=>typeof e=="string"&&e.endsWith("%"),ey=e=>parseFloat(e)/100,ny=e=>al(ey(e),0,1),wo=(e,t)=>({x:e,y:t,x2:e,y2:t,width:0,height:0}),H2={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 hd(e,t){return t==="start"?0:t==="end"?e:ty(t)?ny(t)*e:e/2}function Fi(e,t,n=!0){return typeof t=="number"?t:ty(t)?(n?ny(t):ey(t))*e:e}function W2(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 iy(e,t,{borderWidth:n,position:i,xAdjust:r,yAdjust:s},a){const l=Nt(a),u=t.width+(l?a.width:0)+n,d=t.height+(l?a.height:0)+n,h=pd(i),m=ay(e.x,u,r,h.x),g=ay(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 pd(e,t="center"){return Nt(e)?{x:Ot(e.x,t),y:Ot(e.y,t)}:(e=Ot(e,t),{x:e,y:e})}const ry=(e,t)=>e&&e.autoFit&&t<1;function sy(e,t){const n=e.font,i=jt(n)?n:[n];return ry(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 oy(e){return e&&(sn(e.xValue)||sn(e.yValue))}function ay(e,t,n=0,i){return e-hd(t,i)+n}function is(e,t,n){const i=n.init;if(i){if(i===!0)return cy(t,n)}else return;return $2(e,t,n)}function ly(e,t,n){let i=!1;return t.forEach(r=>{on(e[r])?(i=!0,n[r]=e[r]):sn(n[r])&&delete n[r]}),i}function cy(e,t){const n=t.type||"line";return H2[n](e)}function $2(e,t,n){const i=Jt(n.init,[{chart:e,properties:t,options:n}]);if(i===!0)return cy(t,n);if(Nt(i))return i}const md=new Map,V2=e=>isNaN(e)||e<=0,Y2=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=sy(t),r=t.textStrokeWidth,s=jt(n)?n:[n],a=s.join()+Y2(i)+r+(e._measureText?"-spriting":"");return md.has(a)||md.set(a,K2(e,s,i,r)),md.get(a)}function uy(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:F2(Ei(n.borderRadius),0,Math.min(s,a)/2)}),e.closePath(),e.fill(),l&&(e.shadowColor=n.borderShadowColor,e.stroke()),e.restore()}function dy(e,t,n,i){const r=n.content;if(ll(r)){e.save(),e.globalAlpha=Q2(n.opacity,r.style.opacity),e.drawImage(r,t.x,t.y,t.width,t.height),e.restore();return}const s=jt(r)?r:[r],a=sy(n,i),l=n.color,u=jt(l)?l:[l],d=W2(t,n),h=t.y+n.textStrokeWidth/2;e.save(),e.textBaseline="middle",e.textAlign=n.textAlign,q2(e,n)&&X2(e,{x:d,y:h},s,a),Z2(e,{x:d,y:h},s,{fonts:a,colors:u}),e.restore()}function q2(e,t){if(t.textStrokeWidth>0)return e.lineJoin="round",e.miterLimit=2,e.lineWidth=t.textStrokeWidth,e.strokeStyle=t.textStrokeColor,!0}function j2(e,t,n,i){const{radius:r,options:s}=t,a=s.pointStyle,l=s.rotation;let u=(l||0)*iu;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}V2(r)||G2(e,{x:n,y:i,radius:r,rotation:l,style:a,rad:u})}function G2(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,ne),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-Pt,a-oe),e.arc(t+u,n-l,h,a-oe,a),e.arc(t+l,n+u,h,a,a+oe),e.arc(t-u,n+l,h,a+oe,a+Pt),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 K2(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 X2(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 Z2(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 Q2(e,t){const n=Ai(e)?e:t;return Ai(n)?al(n,0,1):1}const fy=["left","bottom","top","right"];function J2(e,t){const{pointX:n,pointY:i,options:r}=t,s=r.callout,a=s&&s.display&&rI(t,s);if(!a||oI(t,s,a))return;if(e.save(),e.beginPath(),!ui(e,s))return e.restore();const{separatorStart:u,separatorEnd:d}=tI(t,a),{sideStart:h,sideEnd:m}=nI(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 tI(e,t){const{x:n,y:i,x2:r,y2:s}=e,a=eI(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 eI(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 nI(e,t,n){const{y:i,width:r,height:s,options:a}=e,l=a.callout.start,u=iI(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 iI(e,t){const n=t.side;return e==="left"||e==="top"?-n:n}function rI(e,t){const n=t.position;return fy.includes(n)?n:sI(e,t)}function sI(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),O=[n,n+v,n+v,r],A=[i+S,s,i,s],P=[];for(let L=0;L<4;L++){const R=xr({x:O[L],y:A[L]},_,ve(g));P.push({position:fy[L],distance:Yr(R,{x:u,y:d})})}return P.sort((L,R)=>L.distance-R.distance)[0].position}function oI(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 hy={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 py(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 my(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 gd(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=_y(i,{min:t.xMin,max:t.xMax,start:s,end:a});s=d.start,a=d.end;const h=_y(r,{min:t.yMin,max:t.yMax,start:u,end:l});return l=h.start,u=h.end,{x:s,y:l,x2:a,y2:u,width:a-s,height:u-l,centerX:s+(a-s)/2,centerY:l+(u-l)/2}}function gy(e,t){if(!oy(t)){const n=gd(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 lI(e,t)}function aI(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?cI(r,s,t):uI(n,s,t),s}function yy(e,t){const n=gd(e,t);return n.initProperties=is(e,n,t),n.elements=[{type:"label",optionScope:"label",properties:hI(e,n,t),initProperties:n.initProperties}],n}function lI(e,t){const n=my(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 _y(e,t){const n=py(e,t)||t;return{start:Math.min(n.start,n.end),end:Math.max(n.start,n.end)}}function cI(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 uI(e,t,n){for(const i of Object.keys(hy)){const r=e[Sr(e,n,i)];if(r){const{min:s,max:a,start:l,end:u,startProp:d,endProp:h}=hy[i],m=py(r,{min:n[s],max:n[a],start:r[l],end:r[u]});t[d]=m.start,t[h]=m.end}}}function dI({properties:e,options:t},n,i,r){const{x:s,x2:a,width:l}=e;return by({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 fI({properties:e,options:t},n,i,r){const{y:s,y2:a,height:l}=e;return by({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 by(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+hd(d,s)}function hI(e,t,n){const i=n.label;i.backgroundColor="transparent",i.callout.display=!1;const r=pd(i.position),s=Se(i.padding),a=ul(e.ctx,i),l=dI({properties:t,options:n},a,r,s),u=fI({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 yd=["enter","leave"],_d=yd.concat("click");function pI(e,t,n){t.listened=ly(n,_d,t.listeners),t.moveListened=!1,yd.forEach(i=>{on(n[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&on(i.click)&&(t.listened=!0),t.moveListened||yd.forEach(r=>{on(i[r])&&(t.listened=!0,t.moveListened=!0)})})}function mI(e,t,n){if(e.listened)switch(t.type){case"mousemove":case"mouseout":return gI(e,t,n);case"click":return yI(e,t,n)}}function gI(e,t,n){if(!e.moveListened)return;let i;t.type==="mousemove"?i=fd(e.visibleElements,t,n.interaction):i=[];const r=e.hovered;e.hovered=i;const s={state:e,event:t};let a=xy(s,"leave",r,i);return xy(s,"enter",i,r)||a}function xy({state:e,event:t},n,i,r){let s;for(const a of i)r.indexOf(a)<0&&(s=wy(a.options[n]||e.listeners[n],a,t)||s);return s}function yI(e,t,n){const i=e.listeners,r=fd(e.visibleElements,t,n.interaction);let s;for(const a of r)s=wy(a.options.click||i.click,a,t)||s;return s}function wy(e,t,n){return Jt(e,[t.$context,n])===!0}const dl=["afterDraw","beforeDraw"];function _I(e,t,n){const i=t.visibleElements;t.hooked=ly(n,dl,t.hooks),t.hooked||i.forEach(r=>{t.hooked||dl.forEach(s=>{on(r.options[s])&&(t.hooked=!0)})})}function vy(e,t,n){if(e.hooked){const i=t.options[n]||e.hooks[n];return Jt(i,[t.$context])}}function bI(e,t,n){const i=TI(e.scales,t,n);let r=Sy(t,i,"min","suggestedMin");r=Sy(t,i,"max","suggestedMax")||r,r&&on(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function xI(e,t){for(const n of e)vI(n,t)}function Sy(e,t,n,i){if(le(t[n])&&!wI(e.options,n,i)){const r=e[n]!==t[n];return e[n]=t[n],r}}function wI(e,t,n){return sn(e[t])||sn(e[n])}function vI(e,t){for(const n of["scaleID","xScaleID","yScaleID"]){const i=Sr(t,e,n);i&&!t[i]&&SI(e,n)&&console.warn(`No scale found with id '${i}' for annotation '${e.id}'`)}}function SI(e,t){if(t==="scaleID")return!0;const n=t.charAt(0);for(const i of["Min","Max","Value"])if(sn(e[n+i]))return!0;return!1}function TI(e,t,n){const i=t.axis,r=t.id,s=i+"ScaleID",a={min:Ot(t.min,Number.NEGATIVE_INFINITY),max:Ot(t.max,Number.POSITIVE_INFINITY)};for(const l of n)l.scaleID===r?Ty(l,t,["value","endValue"],a):Sr(e,l,s)===r&&Ty(l,t,[i+"Min",i+"Max",i+"Value"],a);return a}function Ty(e,t,n,i){for(const r of n){const s=e[r];if(sn(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 Q0({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),uy(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){return yy(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 J0({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||(AI(t,this),t.save(),cl(t,this.getCenterPoint(),this.rotation),dy(t,this,n,this._fitRatio),t.restore())}resolveElementProperties(t,n){const i=kI(t,n);if(!i)return{};const{controllerMeta:r,point:s,radius:a}=DI(t,n,i);let l=ul(t.ctx,n);const u=CI(l,a);ry(n,u)&&(l={width:l.width*u,height:l.height*u});const{position:d,xAdjust:h,yAdjust:m}=n,g=iy(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 kI(e,t){return e.getSortedVisibleDatasetMetas().reduce(function(n,i){const r=i.controller;return r instanceof ro&&MI(e,t,i.data)&&(!n||r.innerRadius<n.controller.innerRadius)&&r.options.circumference>=90?i:n},void 0)}function MI(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 DI({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,O=S?r+x:a-x,A=OI(O,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 CI({width:e,height:t},n){const i=Math.sqrt(Math.pow(e,2)+Math.pow(t,2));return n*2/i}function OI(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:ne};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 AI(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 J0({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=!sn(this._visible)||this._visible;!n.display||!n.content||!i||(t.save(),cl(t,this.getCenterPoint(),this.rotation),J2(t,this),uy(t,this,n),dy(t,EI(this),n),t.restore())}resolveElementProperties(t,n){let i;if(oy(n))i=my(t,n);else{const{centerX:l,centerY:u}=gd(t,n);i={x:l,y:u}}const r=Se(n.padding),s=ul(t.ctx,n),a=iy(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 EI({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 bd=(e,t,n)=>({x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}),xd=(e,t,n)=>bd(t,n,Math.abs((e-t.y)/(n.y-t.y))).x,ky=(e,t,n)=>bd(t,n,Math.abs((e-t.x)/(n.x-t.x))).y,So=e=>e*e,RI=(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,wd=(e,t,n,i)=>({x:My(e.x,t.x,n.x,i),y:My(e.y,t.y,n.y,i)}),Dy=(e,t,n,i)=>2*(1-i)*(t-e)+2*i*(n-t),Cy=(e,t,n,i)=>-Math.atan2(Dy(e.x,t.x,n.x,i),Dy(e.y,t.y,n.y,i))+.5*Pt;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)||vd(this,a,r);return u.restore(),_}const d=So(s);return NI(this,a,d,r)||vd(this,a,r)}return PI(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 VI(t,this,a,u),t.restore();const{startOpts:d,endOpts:h,startAdjust:m,endAdjust:g}=Py(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(),Sd(t,0,m,d),Sd(t,u,-g,h),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){const i=aI(t,n),{x:r,y:s,x2:a,y2:l}=i,u=II(i,t.chartArea),d=u?LI({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=$I(d,n,Yr(m,g))}const h=BI(t,d,n.label);return h._visible=u,d.elements=[{type:"label",optionScope:"label",properties:h,initProperties:d.initProperties}],d}}To.id="lineAnnotation";const Oy={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({},Oy),fill:!1,length:12,start:Object.assign({},Oy),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 PI(e,{mouseX:t,mouseY:n},i,{hitSize:r,useFinalPosition:s}){const a=RI(t,n,e.getProps(["x","y","x2","y2"],s),i);return Z0(a,r)||vd(e,{mouseX:t,mouseY:n},s,i)}function II({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 Ay({x:e,y:t},n,{top:i,right:r,bottom:s,left:a}){return e<a&&(t=ky(a,{x:e,y:t},n),e=a),e>r&&(t=ky(r,{x:e,y:t},n),e=r),t<i&&(e=xd(i,{x:e,y:t},n),t=i),t>s&&(e=xd(s,{x:e,y:t},n),t=s),{x:e,y:t}}function LI(e,t,n){const{x:i,y:r}=Ay(e,t,n),{x:s,y:a}=Ay(t,e,n);return{x:i,y:r,x2:s,y2:a,width:Math.abs(s-i),height:Math.abs(a-r)}}function NI(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 vd(e,{mouseX:t,mouseY:n},i,r){const s=e.label;return s.options.display&&s.inRange(t,n,r,i)}function BI(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 zI(t,n,{width:a,height:l,padding:r},e.chartArea)}function FI(e){const{x:t,y:n,x2:i,y2:r}=e,s=Math.atan2(r-n,i-t);return s>Pt/2?s-Pt:s<Pt/-2?s+Pt:s}function zI(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"?FI(e):ve(t.rotation),g=UI(r,s,m),_=HI(e,t,{labelSize:g,padding:a},i),x=e.cp?wd(d,e.cp,h,_):bd(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},O=Ry(x.x,v)+l,A=Ry(x.y,S)+u;return{x:O-r/2,y:A-s/2,x2:O+r/2,y2:A+s/2,centerX:O,centerY:A,pointX:x.x,pointY:x.y,width:r,height:s,rotation:Da(m)}}function UI(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 HI(e,t,n,i){let r;const s=WI(e,i);return t.position==="start"?r=Ey({w:e.x2-e.x,h:e.y2-e.y},n,t,s):t.position==="end"?r=1-Ey({w:e.x-e.x2,h:e.y-e.y2},n,t,s):r=hd(1,t.position),r}function Ey(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 WI(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 Ry(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 Py(e){const t=e.options,n=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:n,endOpts:i,startAdjust:Iy(e,n),endAdjust:Iy(e,i)}}function Iy(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(xd(0,s,{x:0,y:r}))}function Sd(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 $I(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=pd(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 Ly(e,{x:t,y:n},{angle:i,adjust:r},s){!s||!s.display||(e.save(),e.translate(t,n),e.rotate(i),Sd(e,0,-r,s),e.restore())}function VI(e,t,n,i){const{x:r,y:s,x2:a,y2:l,options:u}=t,{startOpts:d,endOpts:h,startAdjust:m,endAdjust:g}=Py(t),_={x:r,y:s},x={x:a,y:l},v=Cy(_,n,x,0),S=Cy(_,n,x,1)-Pt,O=wd(_,n,x,m/i),A=wd(_,n,x,1-g/i),P=new Path2D;e.beginPath(),P.moveTo(O.x,O.y),P.quadraticCurveTo(n.x,n.y,A.x,A.y),e.shadowColor=u.borderShadowColor,e.stroke(P),t.path=P,t.ctx=e,Ly(e,O,{angle:v,adjust:m},d),Ly(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 YI({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,Pt/2,0,2*Pt),t.fill(),l&&(t.shadowColor=a.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){return yy(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 YI(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"?z2({x:t,y:n},this.getCenterPoint(r),d/2,h):Z0(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);j2(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=gy(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&&jI(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=gy(t,n),{sides:r,rotation:s}=n,a=[],l=2*Pt/r;let u=s*iu;for(let d=0;d<r;d++,u+=l){const h=qI(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 qI({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 jI(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=>{ae.describe(`elements.${zi[e].id}`,{_fallback:"plugins.annotation.common"})});const GI={update:Object.assign},KI=_d.concat(dl),Ny=(e,t)=>Nt(t)?Md(e,t):e,Td=e=>e==="color"||e==="font";function kd(e="line"){return zi[e]?e:(console.warn(`Unknown annotation type: '${e}', defaulting to 'line'`),"line")}function XI(e,t,n,i){const r=QI(e,n.animations,i),s=t.annotations,a=eL(t.elements,s);for(let l=0;l<s.length;l++){const u=s[l],d=By(a,l,u.type),h=u.setContext(tL(e,d,a,u)),m=d.resolveElementProperties(e,h);m.skip=ZI(m),"elements"in m&&(JI(d,m.elements,h,r),delete m.elements),sn(d.x)||Object.assign(d,m),Object.assign(d,m.initProperties),m.options=Fy(h),r.update(d,m)}}function ZI(e){return isNaN(e.x)||isNaN(e.y)}function QI(e,t,n){return n==="reset"||n==="none"||n==="resize"?GI:new yu(e,t)}function JI(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=By(r,s,a.type,a.initProperties),d=n[a.optionScope].override(a);l.options=Fy(d),i.update(u,l)}}function By(e,t,n,i){const r=zi[kd(n)];let s=e[t];return(!s||!(s instanceof r))&&(s=e[t]=new r,Object.assign(s,i)),s}function Fy(e){const t=zi[kd(e.type)],n={};n.id=e.id,n.type=e.type,n.drawTime=e.drawTime,Object.assign(n,Md(e,t.defaults),Md(e,t.defaultRoutes));for(const i of KI)n[i]=e[i];return n}function Md(e,t){const n={};for(const i of Object.keys(t)){const r=t[i],s=e[i];Td(i)&&jt(s)?n[i]=s.map(a=>Ny(a,r)):n[i]=Ny(s,r)}return n}function tL(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 eL(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 nL="3.1.0";const Ui=new Map,zy=e=>e.type!=="doughnutLabel",iL=_d.concat(dl);var Uy={id:"annotation",version:nL,beforeRegister(){U2("chart.js","4.0",an.version)},afterRegister(){an.register(zi)},afterUnregister(){an.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;Nt(s)?Object.keys(s).forEach(a=>{const l=s[a];Nt(l)&&(l.id=a,r.push(l))}):jt(s)&&r.push(...s),xI(r.filter(zy),e.scales)},afterDataLimits(e,t){const n=Ui.get(e);bI(e,t.scale,n.annotations.filter(zy).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(e,t,n){const i=Ui.get(e);pI(e,i,n),XI(e,i,n,t.mode),i.visibleElements=i.elements.filter(r=>!r.skip&&r.options.display),_I(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);mI(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 fd(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=>!iL.includes(e)&&e!=="init",annotations:{_allKeys:!1,_fallback:(e,t)=>`elements.${zi[kd(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:Td,_fallback:!0},_indexable:Td}},additionalOptionScopes:[""]};function Mo(e,t,n){const{ctx:i,chartArea:r}=e,s=Ui.get(e);n&&to(i,r);const a=rL(s.visibleElements,t).sort((l,u)=>l.element.options.z-u.element.options.z);for(const l of a)sL(i,r,s,l);n&&eo(i)}function rL(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 sL(e,t,n,i){const r=i.element;i.main?(vy(n,r,"beforeDraw"),r.draw(e,t),vy(n,r,"afterDraw")):r.draw(e,t)}const oL={class:"zoom-timerange-container"},aL={class:"zoom-timerange-details"},lL={class:"label","data-testid":"zoom-timerange-from"},cL={class:"label","data-testid":"zoom-timerange-to"},uL=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)=>{S0(()=>{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",oL,[f.createElementVNode("div",aL,[f.createElementVNode("div",lL,f.toDisplayString(f.unref(n).t("zoom_time_range.from")),1),f.createElementVNode("div",null,f.toDisplayString(i.value),1),f.createElementVNode("div",cL,f.toDisplayString(f.unref(n).t("zoom_time_range.to")),1),f.createElementVNode("div",null,f.toDisplayString(r.value),1)])]))}}),ke=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n},Hy=ke(uL,[["__scopeId","data-v-4fa681cf"]]),dL={class:"zoom-actions-container"},fL={class:"zoom-actions-heading"},hL={class:"zoom-action-select"},pL=["data-testid"],mL=["aria-disabled","href"],gL=["onClick"],yL=ke(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",dL,[f.createElementVNode("div",fL,[f.createVNode(Hy,{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(Fc)})`,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",hL,[(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,mL)):(f.openBlock(),f.createElementBlock("div",{key:1,onClick:u=>r(l)},f.toDisplayString(l.label),9,gL))],10,pL))),128))])]))}}),[["__scopeId","data-v-79ba72f8"]]),_L={key:2},bL={class:"tooltip-title"},xL={class:"title"},wL={key:0,class:"subtitle"},vL={class:"context"},SL={class:"metric"},TL={class:"tooltip"},kL={key:0,class:"square-marker marker-placeholder"},ML={class:"display-value"},Do=ke(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}=mP(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(Hy,{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(yL,{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",_L,[f.createElementVNode("div",bL,[f.createElementVNode("div",xL,[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(Fc)})`,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",wL,[f.createElementVNode("div",vL,f.toDisplayString(h.value),1),f.createElementVNode("div",SL,f.toDisplayString(m.value),1)])):f.createCommentVNode("",!0)]),f.createElementVNode("ul",TL,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(e.state.tooltipSeries,({backgroundColor:v,borderColor:S,label:O,value:A,isSegmentEmpty:P,isExtra:L},R)=>(f.openBlock(),f.createElementBlock(f.Fragment,{key:O+R},[e.state.tooltipSeries.length?(f.openBlock(),f.createElementBlock("li",{key:0,class:f.normalizeClass({"extra-row":L})},[L?(f.openBlock(),f.createElementBlock("div",kL)):(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:P}])},f.toDisplayString(O),3),f.createElementVNode("span",ML,f.toDisplayString(A),1)],2)):f.createCommentVNode("",!0)],64))),128))])]))],6)):f.createCommentVNode("",!0)}}),[["__scopeId","data-v-fb2f2a72"]]),DL={key:0,class:"legend-container","data-testid":"legend"},CL=["onClick"],OL={key:0,"aria-hidden":"true",class:"line-marker",height:"2",width:"16"},AL=["stroke","stroke-dasharray"],EL=["title"],RL={class:"label truncate-label"},PL={key:0,class:"sub-label"},IL={key:0},LL={class:"tooltip-content"},ml=ke(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 an?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 an?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",DL,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(e.items,({fillStyle:m,strokeStyle:g,text:_,datasetIndex:x,index:v,value:S,isSegmentEmpty:O,isKey:A,lineDash:P},L)=>(f.openBlock(),f.createElementBlock("li",{key:s({datasetIndex:x,index:v,isKey:A},L),class:f.normalizeClass({"legend-key":A}),onClick:R=>A?void 0:a(x,v)},[P?.length?(f.openBlock(),f.createElementBlock("svg",OL,[f.createElementVNode("line",{stroke:g,"stroke-dasharray":P.join(" "),"stroke-width":"2",x1:"0",x2:"16",y1:"1",y2:"1"},null,8,AL)])):(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",RL,f.toDisplayString(_),1),S&&(f.unref(i)||A)?(f.openBlock(),f.createElementBlock("div",PL,[A?(f.openBlock(),f.createElementBlock("span",IL,"-")):f.createCommentVNode("",!0),f.createTextVNode(" "+f.toDisplayString(S.formatted),1)])):f.createCommentVNode("",!0)],10,EL)]),_:2},[O?{name:"content",fn:f.withCtx(()=>[f.createElementVNode("div",LL,f.toDisplayString(f.unref(n).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],10,CL))),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 NL(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 BL=new Uint8Array(16);function FL(){return crypto.getRandomValues(BL)}function Dd(e,t,n){return crypto.randomUUID?crypto.randomUUID():zL(e)}function zL(e,t,n){e=e||{};const i=e.random??e.rng?.()??FL();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,NL(i)}const Wy=(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 $y{id="highlightPlugin";_clickedElements;_previousHoverOption;_clicked=!1;_pause=!1;_suppressNextClick=!1;afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&Wy(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,Wy(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 UL=(e,t,n,i,r="#0275d8")=>{e&&(e.save(),e.beginPath(),e.moveTo(t,n),e.lineTo(t,i),e.lineWidth=1,e.strokeStyle=r,e.stroke(),e.restore())};class gl{id="coordinator";coordinator=null;instanceId="";stopWatcher=void 0;activeDimension=null;activeDimensionValue=null;requiresUpdate=!1;triggerOnSelf=!1;watchTimestamp=!1;watchDimension=!1;lastMouseBrushEvent=0;constructor({coordinator:t,requiresUpdate:n=!1,triggerOnSelf:i=!1,watchTimestamp:r=!1,watchDimension:s=!1}){this.instanceId=crypto.randomUUID(),this.coordinator=t,this.requiresUpdate=n,this.triggerOnSelf=i,this.watchTimestamp=r,this.watchDimension=s}afterInit(t){if(!this.coordinator)return;const n=this.requiresUpdate?()=>t.update("none"):()=>t.draw(),i=this._watchTimestamp(n),r=this._watchDimension(n);this.stopWatcher=()=>{i&&i(),r&&r()}}afterEvent(t,{event:n}){this.coordinator&&(n.type==="mousemove"||n.type==="mouseout")&&requestAnimationFrame(i=>this._onMouseBrush(n.native,t,i))}beforeDatasetDraw(t,n){if(!this.coordinator||!this.watchDimension||this.coordinator.activeChart.value===this.instanceId&&!this.triggerOnSelf)return;t.config.type==="doughnut"?this._highlightDimensionDonut(t):this._highlightDimensionDefault(t,n)}afterDatasetsDraw(t){if(t.ctx.globalAlpha=1,!this.coordinator||!this.watchTimestamp||!this.coordinator.activeTimestamp.value||this.coordinator.activeChart.value===this.instanceId&&!this.triggerOnSelf)return;const i=t.scales.x.getPixelForValue(this.coordinator.activeTimestamp.value),r=t.ctx;UL(r,i,t.scales.y.top,t.scales.y.bottom)}beforeDestroy(){this.stopWatcher&&this.stopWatcher()}_watchTimestamp(t){if(!this.coordinator)return;let n;return this.watchTimestamp&&(n=f.watch([this.coordinator.activeChart,this.coordinator.activeTimestamp],([i])=>{(i!==this.instanceId||this.triggerOnSelf)&&t()})),n}_watchDimension(t){if(!this.coordinator)return;let n;if(this.watchDimension){let i;n=f.watch([this.coordinator.activeChart,this.coordinator.activeDimension,this.coordinator.activeDimensionValue],([r,s,a])=>{clearTimeout(i),s===null&&(this.activeDimension=null),a===null&&(this.activeDimensionValue=null),i=setTimeout(()=>{this.activeDimension=s,this.activeDimensionValue=a,(r!==this.instanceId||this.triggerOnSelf)&&t()},this.coordinator?.DIMENSION_DEBOUNCE_MS??400),f.onWatcherCleanup(()=>{clearTimeout(i)})})}return n}_onMouseBrush(t,n,i){if(!this.coordinator)return;const r=t.type,s=Math.min(this.coordinator.TIMESTAMP_DEBOUNCE_MS,this.coordinator.DIMENSION_DEBOUNCE_MS);if(!(r==="mousemove"&&i-this.lastMouseBrushEvent<s)){if(r==="mousemove"){const a=this._getTimestamp(n,t),[l,u]=this._getDatasetDimension(n,t)??[];this.coordinator.activate({chartUuid:this.instanceId,timestamp:a,dimension:l,dimensionValue:u})}else r==="mouseout"&&this.coordinator.deactivate({chartUuid:this.instanceId});this.lastMouseBrushEvent=i}}_highlightDimensionDefault(t,n){if(this.activeDimension&&this.activeDimensionValue){const i=t.data.datasets.map((r,s)=>r?.dimension===this.activeDimension&&r?.dimensionValue===this.activeDimensionValue?s:-1).filter(r=>r>=0);i.length&&(t.ctx.globalAlpha=i.includes(n.index)?1:.3)}else t.ctx.globalAlpha=1}_highlightDimensionDonut(t){if(this.activeDimension&&this.activeDimensionValue){const{dimension:n,dimensionValue:i}=t.data.datasets[0];if(n===this.activeDimension){const r=i.findIndex(s=>s===this.activeDimensionValue);r>=0?t.setActiveElements([{datasetIndex:0,index:r}]):t.setActiveElements([])}else t.setActiveElements([])}else t.setActiveElements([])}_getDatasetDimension(t,n){const i=t.config.type,r=i!=="line",s=["doughnut","scatter"].includes(i)?"point":"dataset",a=t.getElementsAtEventForMode(n,s,{intersect:r},!1),[l]=a;if(!l)return;const{datasetIndex:u,index:d}=l,{dimension:h,dimensionValue:m}=t.data.datasets[u];return i==="doughnut"?[h,m[d]]:[h,m]}_getTimestamp(t,n){const[i]=t.getElementsAtEventForMode(n,"index",{intersect:!1},!1);if(i&&this.watchTimestamp){const{datasetIndex:r,index:s}=i,{x:a}=t.data.datasets[r].data[s];return a}}}const HL=["id"],WL=["id"],$L={class:"axis-tooltip-content"},VL="100%",YL="100%",qL=20,jL=20,Vy=6,GL=0,KL=10,XL=10,ZL=1,QL=ke(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 $y,l=f.inject("analytics-dashboard-coordinator",null),u=new gl({coordinator:l,triggerOnSelf:!0,watchTimestamp:!1,watchDimension:!0}),d=f.useTemplateRef("chartContainer"),h=f.useTemplateRef("chartParent"),m=({chart:X},ot)=>{const vt=X.data,lt=vt.labels?.indexOf(ot);return vt.datasets.reduce((bt,Rt,j)=>{if(X.isDatasetVisible(j)){const et=Rt.data[lt];return isNaN(et)?bt:bt+et}else return bt},0)},g=(X,ot,vt,lt)=>{const bt=lt==="horizontal";ot===null&&(ot=n.t("entityNoName"));const Rt={type:"label",yValue:rt=>bt?ot:m(rt,ot),xValue:rt=>bt?m(rt,ot):ot},j={...Rt,position:bt?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>bt?0:-Math.abs(zP()),content:rt=>M0(m(rt,ot),vt)},et={...Rt,content:rt=>HP(m(rt,ot),UP(rt.chart,X)),position:bt?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:rt=>bt?FP(M0(m(rt,ot),vt)):0,color:EP};return{[`${ot}-value`]:j,[`${ot}-percent`]:et}},_=f.useTemplateRef("canvas"),x=f.useTemplateRef("axis"),v=Dd(),S=Dd(),O=f.ref([]),A=f.inject("legendPosition",Le.Bottom),P=f.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),L=f.toRef(t,"metricUnit"),R=f.computed(()=>t.orientation==="horizontal"),F=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:R.value?"horizontal_bar":"vertical_bar",chartID:s,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:U,tooltipAbsoluteTop:D}=St.useTooltipAbsolutePosition(h,F),w=f.ref(0),C=()=>t.annotations&&t.chartData.labels?.reduce((X,ot)=>Object.assign(X,g(t.chartData,ot,L.value,t.orientation)),{}),N={id:v,afterUpdate(X){w.value+=1,O.value=Yu(X,t.legendValues,t.chartLegendSortFn)}},$={id:S,afterUpdate(X){X.options.plugins.annotation.annotations=t.annotations?C():{}}},st=[N,{id:"axisHover",afterEvent(X,ot){if(P.show=!1,ot.event.type==="mousemove"){const vt=ot.event,lt=X.options.indexAxis,bt=X.scales,Rt=X.scales[lt].getLabelForValue(Number(X.scales[lt].getValueForPixel(vt[lt]))),et=X.scales[lt].getLabels().indexOf(Rt),rt=t.chartData.isLabelEmpty?.[et];if((yt=>yt==="x"?vt.y>bt.x.top:vt.x<bt.y.right)(lt)){F.interactionMode!=="interactive"&&(F.showTooltip=!1);const $t=X.canvas.getContext("2d").measureText(Rt).width,Me=Math.abs(Math.round(vt.x-$t*.5)),Te=Math.round(vt.x+$t*.5),ee=X.canvas.getBoundingClientRect(),je=40;P.left=lt==="x"?`${(Me>0?Me:Te)-P.offset+ee.left}px`:`${vt.x-$t*.5-P.offset+ee.left}px`,P.top=`${vt.y-je+ee.top}px`,Rt.length>il?(P.show=!0,P.text=Rt):rt?(P.text=n.t("emptyEntityInfo"),P.show=!0):P.show=!1}else P.show=!1}}},a,u,...t.annotations?[$]:[]],dt=f.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),ut=f.ref(0),ct=f.ref(0),Tt=new ResizeObserver(S0(X=>{ut.value=X[0].contentRect.width,ct.value=X[0].contentRect.height},100)),at=f.computed(()=>{const X=t.chartData?.labels?.length;return _.value&&X&&!R.value?`${Math.max(X*(qL+Vy),ut.value)}px`:VL}),pt=f.computed(()=>{const X=t.chartData?.labels?.length;return _.value&&X&&R.value?`${Math.max(X*(jL+Vy),ct.value)}px`:YL});St.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey")),f.onMounted(()=>{t.annotations&&an.register(Uy),d.value&&(ut.value=d.value.offsetWidth,ct.value=d.value.offsetHeight,Tt.observe(d.value))}),f.onUnmounted(()=>{d.value&&Tt.unobserve(d.value)});const G=f.computed(()=>{const X=St.useBarChartOptions({tooltipState:F,legendID:v,stacked:f.toRef(t,"stacked"),metricAxesTitle:f.toRef(t,"metricAxesTitle"),dimensionAxesTitle:f.toRef(t,"dimensionAxesTitle"),indexAxis:R.value?"y":"x",numLabels:dt});return{...X.value,plugins:{...X.value.plugins,annotation:{annotations:C(),clip:!1}}}}),B=St.useChartJSCommon("bar",_,f.toRef(t,"chartData"),st,G);f.onBeforeUnmount(()=>{an.unregister(Uy)});const z={[Le.Bottom]:"column"},Z=f.computed(()=>{if(x.value&&B.value){const X=window.devicePixelRatio,ot=B.value,vt=ot.scales.y.width*X+ZL,lt=(ot.scales.y.height+ot.scales.y.top+ot.scales.x.height)*X,bt=x.value.getContext("2d");return bt.scale(X,X),bt.canvas.width=vt,bt.canvas.height=lt,bt.canvas.style.width=`${vt/X}px`,bt.canvas.style.height=`${lt/X}px`,{scale:X,width:vt*X,height:lt*X,targetCtx:bt}}return null}),it=X=>{const ot=X.target;if(Z.value&&B.value&&!R.value){const vt=Z.value.scale,lt=Z.value.targetCtx,bt=Z.value.width,Rt=Z.value.height,j=B.value,et=j.canvas;lt.fillStyle="white",ot.scrollLeft>=GL&&ot.scrollLeft<=KL?(lt.globalCompositeOperation="source-over",lt.clearRect(0,0,bt,Rt),lt.drawImage(et,0,0,bt,Rt,0,0,bt,Rt),lt.globalCompositeOperation="destination-over",lt.fillRect(0,0,bt,Rt)):(lt.globalCompositeOperation="source-over",lt.fillRect(0,(j.scales.y.height+j.scales.y.top+XL)*vt,bt,j.scales.x.height*vt))}F.offsetY=ot.scrollTop,F.offsetX=ot.scrollLeft,P.offset=ot.scrollLeft},ht=({width:X,height:ot})=>{F.width=X,F.height=ot};f.watch(()=>t.orientation,()=>{if(x.value&&Z.value){const X=Z.value.width,ot=Z.value.height;(x.value?.getContext("2d")).clearRect(0,0,X,ot)}F.showTooltip=!1,F.interactionMode="idle"}),f.watch(()=>t.annotations,X=>{B.value&&(X?B.value.options.plugins.annotation.annotations=C(t.chartData):delete B.value.options.plugins.annotation.annotations)});const mt=()=>{F.showTooltip&&(F.interactionMode!=="idle"?F.interactionMode="idle":F.interactionMode="interactive")};return(X,ot)=>(f.openBlock(),f.createElementBlock("div",{ref:"chartParent",class:f.normalizeClass(["chart-parent",z[f.unref(A)]])},[f.createElementVNode("canvas",{id:f.unref(r),ref:"axis",class:"axis"},null,8,HL),f.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:ot[0]||(ot[0]=vt=>mt()),onScroll:it},[f.createElementVNode("div",{class:"chart-body",style:f.normalizeStyle({width:at.value,height:pt.value})},[f.createElementVNode("canvas",{id:f.unref(s),ref:"canvas",class:"chart-canvas"},null,8,WL)],4)],544),(f.openBlock(),f.createBlock(f.Teleport,{to:"body"},[P.show?(f.openBlock(),f.createElementBlock("div",{key:0,class:"axis-tooltip",style:f.normalizeStyle({top:P.top,left:P.left}),width:"auto"},[f.createElementVNode("div",$L,f.toDisplayString(P.text),1)],4)):f.createCommentVNode("",!0),f.createVNode(Do,{"absolute-left":f.unref(U),"absolute-top":f.unref(D),"chart-parent-ref":h.value,state:F,"tooltip-title":e.tooltipTitle,onDimensions:ht},null,8,["absolute-left","absolute-top","chart-parent-ref","state","tooltip-title"])])),f.createVNode(ml,{id:f.unref(v),"chart-instance":f.unref(B),items:O.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-6994dd8d"]]);const JL={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"};Km._date.override({_id:"date-fns",formats:function(){return JL},parse:function(e,t){if(e===null||typeof e>"u")return null;const n=typeof e;return n==="number"||e instanceof Date?e=Et(e):n==="string"&&(typeof t=="string"?e=KM(e,t,new Date,this.options):e=Bp(e,this.options)),Wc(e)?e.getTime():null},format:function(e,t){return ya(e,t,this.options)},add:function(e,t,n){switch(n){case"millisecond":return Uc(e,t);case"second":return VT(e,t);case"minute":return WT(e,t);case"hour":return zT(e,t);case"day":return ma(e,t);case"week":return YT(e,t);case"month":return zc(e,t);case"quarter":return $T(e,t);case"year":return qT(e,t);default:return e}},diff:function(e,t,n){switch(n){case"millisecond":return $c(e,t);case"second":return tk(e,t);case"minute":return ZT(e,t);case"hour":return XT(e,t);case"day":return mp(e,t);case"week":return ek(e,t);case"month":return bp(e,t);case"quarter":return JT(e,t);case"year":return nk(e,t);default:return 0}},startOf:function(e,t,n){switch(t){case"second":return JM(e);case"minute":return QM(e);case"hour":return ZM(e);case"day":return Hc(e);case"week":return Vn(e);case"isoWeek":return Vn(e,{weekStartsOn:+n});case"month":return rk(e);case"quarter":return ik(e);case"year":return xp(e);default:return e}},endOf:function(e,t){switch(t){case"second":return uk(e);case"minute":return lk(e);case"hour":return ok(e);case"day":return yp(e);case"week":return ak(e);case"month":return _p(e);case"quarter":return ck(e);case"year":return sk(e);default:return e}}});const Yy={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},tN={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...Yy,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},eN=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 nN(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;return f.isProxy(t)?new Proxy(e,{}):e}function iN(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function qy(e,t){e.labels=t}function jy(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 rN(e,t){const n={labels:[],datasets:[]};return qy(n,e.labels),jy(n,e.datasets,t),n}const sN=f.defineComponent({props:tN,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=rN(h,_),v=nN(x,h);s.value=new an(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 O=as(m),A=as(_);O&&O!==A&&(iN(v,O),S=!0)}if(g){const O=as(g.labels),A=as(x.labels),P=as(g.datasets),L=as(x.datasets);O!==A&&(qy(v.config.data,O),S=!0),P&&P!==L&&(jy(v.config.data,P,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 yl(e,t){return an.register(t),f.defineComponent({props:Yy,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(sN,eN({ref:l},{type:e,...n}))}})}const Gy=yl("bar",Ym),Ky=yl("doughnut",ro),Xy=yl("line",qm),oN=yl("scatter",Gm),aN={class:"chart-container"},lN={key:0,class:"chart-center-metric"},cN={class:"chart-center-total"},uN={key:0,class:"chart-center-unit"},dN=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.inject(zu,null),d=new gl({coordinator:u,requiresUpdate:!0,triggerOnSelf:!1,watchTimestamp:!1,watchDimension:!0}),h=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:m,tooltipAbsoluteTop:g}=St.useTooltipAbsolutePosition(l,h),_={id:r,afterUpdate(w){a.value=w.options.plugins.legend.labels.generateLabels(w).map(C=>({...C,value:t.legendValues&&t.legendValues[C.text],hidden:!1}))}},x=f.computed(()=>[d,_]),v=f.computed(()=>[t.chartData.datasets.reduce((C,N)=>(C.dimension=N.dimension,C.dimensionValue.push(N.dimensionValue),C.labels.push(N.label),C.backgroundColor.push(N.backgroundColor),C.hoverBorderColor.push(Aa(N.backgroundColor).saturate(.5).darken(.15).hexString()),C.data.push(N.data.reduce(($,V)=>$+V,0)),C),{dimension:"",dimensionValue:[],labels:[],backgroundColor:[],borderColor:"#ffffff",borderWidth:1,hoverBorderColor:[],hoverBorderWidth:1,data:[],hoverOffset:10})]),{formatUnit:S}=$n({i18n:i}),O=f.computed(()=>T2(t.metricName??"")),A=f.computed(()=>{const w=v.value[0]?.data.reduce((C,N)=>C+N,0)??0;return S(w,t.metricUnit,{approximate:!0,translateUnit:(C,N)=>n(C,N)}).trim()}),P=f.computed(()=>t.tooltipMetricDisplay||""),L=f.computed(()=>({...t.chartData,datasets:v.value}));St.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey"));const{options:R}=St.useDonutChartOptions({tooltipState:h,legendID:r}),F=f.ref(),U=w=>({[Le.Bottom]:"column",[Le.Hidden]:"hidden"})[w],D=({width:w,height:C})=>{h.width=w,h.height=C};return(w,C)=>(f.openBlock(),f.createElementBlock("div",{ref:"chartParent",class:f.normalizeClass(["chart-parent",U(e.legendPosition)]),"data-testid":"donut-chart-parent"},[f.createElementVNode("div",aN,[f.createVNode(f.unref(Ky),{ref_key:"chartInstance",ref:F,"chart-id":f.unref(s),data:L.value,options:f.unref(R),plugins:x.value},null,8,["chart-id","data","options","plugins"]),e.showCenterMetric&&O.value?(f.openBlock(),f.createElementBlock("div",lN,[f.createElementVNode("span",cN,f.toDisplayString(A.value),1),P.value?(f.openBlock(),f.createElementBlock("span",uN,f.toDisplayString(P.value),1)):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0),(f.openBlock(),f.createBlock(f.Teleport,{to:"body"},[f.createVNode(Do,{"absolute-left":f.unref(m),"absolute-top":f.unref(g),state:h,"tooltip-title":e.tooltipTitle,unit:e.metricUnit,onDimensions:D},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),f.createVNode(ml,{id:f.unref(r),"chart-instance":F.value,items:a.value,position:e.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),fN=ke(dN,[["__scopeId","data-v-db23aff8"]]);class hN{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 pN=1.5;class mN{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=pN;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 gN={class:"chart-container"},yN=ke(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:()=>ud()}},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 hN,u=new mN,d=crypto.randomUUID(),h=crypto.randomUUID(),m=f.inject(zu,null),g=new gl({coordinator:m,requiresUpdate:!0,triggerOnSelf:!0,watchTimestamp:!1,watchDimension:!0}),_=f.ref(),x=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:v,tooltipAbsoluteTop:S}=St.useTooltipAbsolutePosition(a,x);St.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey"));const O=f.computed(()=>t.chartData?.outlier),A=f.computed(()=>t.chartData?.referenceLines??[]),P=f.ref([]),L={id:d,afterUpdate($){P.value=Yu($,void 0,t.chartLegendSortFn)}},R=f.computed(()=>{const $=[];O.value&&$.push({text:O.value.label,fillStyle:O.value.color,strokeStyle:O.value.color,isKey:!0});for(const V of A.value)$.push({text:V.label,fillStyle:V.color,strokeStyle:V.color,lineDash:V.borderDash,isKey:!0,value:{raw:V.value,formatted:r(V.value,t.metricUnit,{translateUnit:s})}});return $}),F=f.computed(()=>[...P.value,...R.value]),U=f.computed(()=>t.shadeOutlierRegion?O.value?.value:void 0),D=f.computed(()=>[g,L,...U.value!==void 0?[l]:[],...A.value.length?[u]:[]]),w=f.computed(()=>`scatter-${D.value.map($=>$.id).join("-")}`),{options:C}=St.useScatterChartOptions({tooltipState:x,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:U,referenceLines:A,themeColors:f.toRef(t,"themeColors")}),N=$=>({[Le.Bottom]:"column",[Le.Hidden]:"hidden"})[$];return($,V)=>(f.openBlock(),f.createElementBlock("div",{ref:"chartParent",class:f.normalizeClass(["chart-parent",N(f.unref(n))]),"data-testid":"scatter-chart-parent"},[f.createElementVNode("div",gN,[(f.openBlock(),f.createBlock(f.unref(oN),{key:w.value,ref_key:"chartInstance",ref:_,"chart-id":f.unref(h),class:"chart-canvas",data:e.chartData,"data-testid":"scatter-chart",options:f.unref(C),plugins:D.value},null,8,["chart-id","data","options","plugins"]))]),f.createVNode(Do,{"absolute-left":f.unref(v),"absolute-top":f.unref(S),"data-testid":"tooltip",granularity:e.granularity,state:x,"tooltip-title":e.tooltipTitle},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title"]),f.createVNode(ml,{id:f.unref(d),"chart-instance":_.value,"data-testid":"legend",items:F.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-a001076d"]]),Cd=(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()},tn={},_N=()=>{tn.x=void 0,tn.chart=void 0,tn.strategy=void 0,tn.group=void 0},bN=10;class Zy{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<bN)return;const r=()=>{tn.chart=n,tn.strategy=this._brushStrategy,tn.group=this._brushGroup;for(const s of Object.values(an.instances))s!==n&&s.update("none")};t==="mousemove"?n.tooltip&&n.tooltip.getActiveElements()&&n.tooltip.getActiveElements().length&&(tn.x=n.tooltip.dataPoints[0].element.x,r()):t==="mouseout"&&(tn.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;Cd(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;Cd(i,r,t.scales.y.top,t.scales.y.bottom)}}drawByBrush(t){if(tn.x===void 0)return;const n=tn.chart===t?"#0275d8":"rgba(2, 117, 216, 0.3)";this._brushStrategy==="group"&&tn.group===this._brushGroup&&Cd(t.ctx,tn.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&&tn.chart===t){const n=tn.x!==void 0;if(_N(),n)for(const i of Object.values(an.instances))i!==t&&i.update("none")}}}const xN=(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()},wN=(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()},Qy=(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)}},Jy=(e,t,n)=>{t.canvas.dispatchEvent(new CustomEvent(e,{detail:n}))};class vN{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=Qy(t,this);d&&Jy("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=Qy(t,this);d?Jy("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)&&(wN(t,this._startX,this._endX),xN(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const SN=20,TN="rgba(255, 171, 171, 0.4)",kN="rgba(255, 196, 0, 0.2)",t_=(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)},e_=e=>"yAxisID"in e&&e.yAxisID||rl,n_=(e,t)=>{const n=e.data.datasets.find(i=>i.rawMetric===t);return n?e_(n):rl},MN=(e,t,n=rl)=>{const i=[];return e.data.datasets.forEach(r=>{if(!e.getDatasetMeta(e.data.datasets.indexOf(r)).visible||e_(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=t_(a[h-1],a[h],l.value):u[h-1].aboveThreshold&&!u[h].aboveThreshold&&d!==void 0&&(i.push({start:d,end:t_(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},DN=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 CN{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[n_(t,d)]??t.scales.y).getValueForPixel(l-u.top);if(m){const g=this._thresholds?.[d];g&&g.forEach(_=>{_.hovered=Math.abs(_.value-m)<SN})}}}};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=n_(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=Ku(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=Ku(h.type),i.font=yS,i.fillText(g,t.chartArea.left,m-4),i.restore())});const u=MN(t,s,a);DN(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"?TN:kN,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=Ku(h.type),i.stroke(),i.restore()})}}}beforeDestroy(t){this._mouseMoveHandler&&t.canvas.removeEventListener("mousemove",this._mouseMoveHandler)}}const ON=ke(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 Zy,a=new $y,l=new vN,u=new CN(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),O=f.ref(!1),A=f.inject(zu,null),P=new gl({coordinator:A,triggerOnSelf:!0,watchTimestamp:!0,watchDimension:!0}),L=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:R,tooltipAbsoluteTop:F}=St.useTooltipAbsolutePosition(v,L),U={id:m,afterUpdate(z){_.value=Yu(z,n.legendValues,n.chartLegendSortFn)}},D=f.computed(()=>[P,U,a,...n.brush?[l]:[],...n.type==="timeseries_line"?[s]:[],...n.threshold?[u]:[]]),w=f.computed(()=>`line-${D.value.map(z=>z.id).join("-")}`),C=f.computed(()=>`bar-${D.value.map(z=>z.id).join("-")}`),N=f.computed(()=>n.chartData&&CP(n.chartData)),{options:$}=St.useLineChartOptions({tooltipState:L,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:N,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 V=z=>z?z.end.getTime()>z.start.getTime():!1,st=z=>({[Le.Bottom]:"column",[Le.Hidden]:"hidden"})[z],dt=({width:z,height:Z})=>{L.width=z,L.height=Z},ut=(z=!0)=>{L.interactionMode="idle",L.showTooltip=!1,l.clearSelectionArea(),a.isPaused&&a.resume(z),s.isPaused&&s.resume()},ct=()=>{L.interactionMode="interactive"},Tt=()=>{!h.value||!h.value.chart.tooltip?.dataPoints?.length||(L.interactionMode==="interactive"?s.clickedSegment=h.value.chart.tooltip.dataPoints[0]:s.destroyClickedSegment())},at=()=>{if(O.value){O.value=!1;return}L.interactionMode!=="idle"?ut():ct(),Tt()};f.watch(()=>n.type,()=>{L.interactionMode="idle",L.showTooltip=!1,s.destroyClickedSegment()});const pt=z=>{z.preventDefault(),z.stopPropagation();const{xStart:Z,xEnd:it}=z.detail,ht={start:new Date(Z),end:new Date(it),type:"absolute"};if(!V(ht)){S.value=void 0,ut(!1);return}S.value=ht,L.interactionMode="zoom-interactive",ht&&i("select-chart-range",ht)},G=z=>{L.interactionMode="selecting-chart-area",O.value=!0,s.pause(),a.pause();const{xStart:Z,xEnd:it}=z.detail;S.value={start:new Date(Z),end:new Date(it),type:"absolute"}},B=z=>{if(!v.value||L.interactionMode==="idle")return;const Z=z.target;Z&&v.value.contains(Z)||O.value||ut(!1)};return f.watch(()=>h.value?.chart,()=>{h.value?.chart&&(h.value.chart.canvas.removeEventListener("dragSelect",pt),h.value.chart.canvas.removeEventListener("dragSelectMove",G),h.value.chart.canvas.addEventListener("dragSelect",pt),h.value.chart.canvas.addEventListener("dragSelectMove",G))}),f.onMounted(()=>{document.addEventListener("click",B,!0)}),f.onUnmounted(()=>{h.value?.chart&&(h.value.chart.canvas.removeEventListener("dragSelect",pt),h.value.chart.canvas.removeEventListener("dragSelectMove",G)),document.removeEventListener("click",B,!0)}),(z,Z)=>(f.openBlock(),f.createElementBlock("div",{ref:"chartParent",class:f.normalizeClass(["chart-parent",st(f.unref(x))]),"data-testid":"line-chart-parent"},[f.createElementVNode("div",{class:"chart-container",onClick:Z[0]||(Z[0]=it=>at())},[e.type==="timeseries_line"?(f.openBlock(),f.createBlock(f.unref(Xy),{key:w.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($),plugins:D.value},null,8,["chart-id","data","options","plugins"])):e.type==="timeseries_bar"?(f.openBlock(),f.createBlock(f.unref(Gy),{key:C.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($),plugins:D.value},null,8,["chart-id","data","options","plugins"])):f.createCommentVNode("",!0)]),f.createVNode(Do,{"absolute-left":f.unref(R),"absolute-top":f.unref(F),"data-testid":"tooltip",granularity:e.granularity,state:L,"tooltip-title":e.tooltipTitle,"zoom-action-items":e.zoomActionItems,"zoom-time-range":S.value,onDimensions:dt,onOnAction:Z[1]||(Z[1]=()=>ut(!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-344d87c4"]]),AN={key:0,class:"chart-truncation-warning","data-testid":"truncation-warning"},EN={class:"tooltip-content"},RN={key:2,class:"analytics-chart-parent"},PN=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(()=>dd(i.chartData)?void 0:i.chartData),a=f.computed(()=>{const j=i.chartOptions.metricAxisMap,et=s.value?.meta?.metric_names??[];if(!(i.chartOptions.type!=="timeseries_line"||!j||!et.some(rt=>j[rt]==="right")))return j}),l=f.computed(()=>!!a.value),u=(j,et)=>a.value?j.filter(rt=>(a.value?.[rt]??"left")===et):j,d=f.computed(()=>{const j=s.value?.meta,et=j?.metric_names??[];return["timeseries_line","timeseries_bar"].includes(i.chartOptions.type)&&!l.value&&et.length>1&&Object.keys(j?.display??{}).length>0?et:[]}),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 j=s.value;return!j||!h.value||!m.value?j:{...j,meta:{...j.meta,metric_names:[m.value]}}}),_=f.computed(()=>{const j=i.chartOptions.threshold;return!h.value||!j?j:{...j,...Object.fromEntries(Object.keys(j).filter(et=>et!==m.value).map(et=>[et,[]]))}}),x=f.computed(()=>{if(ut.value)return dd(i.chartData)?i.chartData:q0(i.chartData)}),v=f.inject("app:konnectColorMode",f.computed(()=>"light")),S=f.useTemplateRef("chartShell"),O=f.computed(()=>(v.value,ud(S.value))),A=f.computed(()=>{if(x.value){const{start:et,end:rt,metric:Gt,metricUnit:yt,truncated:$t,limit:Me,datasource:Te}=x.value;return{start:et,end:rt,metricNames:[Gt],metricUnits:{[Gt]:yt??""},truncated:$t,limit:Me,datasource:Te}}const j=g.value?.meta;return{start:j?.start,end:j?.end,metricNames:j?.metric_names,metricUnits:j?.metric_units,truncated:j?.truncated,limit:j?.limit,datasource:j?.datasource}}),P=f.computed(()=>ut.value?St.useScatterDatasets({colorPalette:i.chartOptions.chartDatasetColors,scatter:i.chartOptions.scatter,themeColors:O},x).value:s.value?st.value?St.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Zu,metricAxisMap:a.value},g).value:St.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Zu},s).value:{datasets:[]}),L=f.computed(()=>i.timeseriesZoom||!!i.exploreLink||!!i.requestsLink),R=f.computed(()=>{if(!i.chartData||s.value&&!s.value.meta)return 0;const{start:j,end:et}=A.value;if(j&&et)return new Date(et).getTime()-new Date(j).getTime()}),F=f.computed(()=>A.value.metricUnits?h.value&&m.value?A.value.metricUnits[m.value]??"":Object.values(A.value.metricUnits)[0]??"":""),U=f.computed(()=>A.value.metricUnits?h.value&&m.value?m.value:Object.keys(A.value.metricUnits)[0]??"":""),D=f.computed(()=>i.showLegendValues&&i.legendPosition!==Le.Hidden),{legendValues:w}=St.useChartLegendValues(P,i.chartOptions.type,F),C=f.computed(()=>A.value.limit?.toString()||null),N=f.computed(()=>i.chartOptions.hideTruncationWarning?!1:A.value.truncated||!1),$=f.computed(()=>r.t("limitedResultsShown",{maxReturned:C.value})),V=f.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),st=f.computed(()=>["timeseries_bar","timeseries_line"].some(j=>j===i.chartOptions.type)),dt=f.computed(()=>i.chartOptions.type==="donut"),ut=f.computed(()=>i.chartOptions.type==="scatter"),ct=f.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),Tt=f.computed(()=>{const{metricNames:j,metricUnits:et}=A.value;if(l.value||!j||!et)return;const rt=j[0],Gt=et[rt]||"";if(j.length>1){if(rt.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${Gt}`,{plural:"s"})});if(rt.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${Gt}`,{plural:"s"})})}if(rt)return xo(Gt)&&r.te(`metricAxisTitles.${rt}`)?r.t(`metricAxisTitles.${rt}`)||void 0:r.te(`chartLabels.${rt}`)?r.t(`chartLabels.${rt}`):rt}),at=f.computed(()=>{const j=i.chartOptions.yAxes?.left?.title??i.chartOptions?.metricAxesTitle;if(j)return j;const{metricNames:et,metricUnits:rt}=A.value;if(!(!et||!rt))return G(u(et,"left"),rt)}),pt=f.computed(()=>{if(!l.value)return;const{metricNames:j,metricUnits:et}=A.value,rt=j&&et?G(u(j,"right"),et):void 0;return{title:i.chartOptions.yAxes?.right?.title??rt,showGrid:i.chartOptions.yAxes?.right?.showGrid}}),G=(j,et)=>{const rt=j[0];if(!rt)return;const Gt=et[rt]||"";if(j.length>1){if(rt.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${Gt}`,{plural:"s"})});if(rt.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${Gt}`,{plural:"s"})})}return B(rt,Gt)},B=(j,et)=>{if(r.te(`metricAxisTitles.${j}`)){if(xo(et))return r.t(`metricAxisTitles.${j}`)||void 0;const rt=r.te(`chartUnits.${et}`)?r.t(`chartUnits.${et}`,{plural:"s"}):et;return r.t(`metricAxisTitles.${j}`,{unit:rt})||void 0}return j||void 0},z=f.computed(()=>{if(i.chartOptions?.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const j=s.value?.meta,et=st.value?"Time":Object.keys(j?.display||j?.metric_names||{})[0];if(et)return r.te(`chartLabels.${et}`)?r.t(`chartLabels.${et}`):et}),Z=f.computed(()=>{if(Cx(A.value.datasource))return r.t("timestampAxisTitles.platform");const j=ca(s.value?.meta?.granularity_ms);if(j)return r.te(`granularityAxisTitles.${j}`)?r.t(`granularityAxisTitles.${j}`):j}),it=f.computed(()=>{const j=x.value?.xMetric;return j?B(j,x.value?.xMetricUnit??""):Z.value}),ht=f.computed(()=>i.emptyStateTitle||r.t("noDataAvailableTitle")),mt=f.computed(()=>i.emptyStateDescription||r.t("noDataAvailableDescription")),X=f.computed(()=>ut.value?!!x.value?.points.length:st.value?OP(P.value):!!(s.value&&s.value.meta&&s.value.data.length)),ot=f.computed(()=>{const j=s.value;return j?j.meta.granularity_ms?ca(j.meta.granularity_ms)||"hourly":ca(new Date(j.data[1].timestamp).getTime()-new Date(j.data[0].timestamp).getTime())||"hourly":"hourly"}),vt=f.computed(()=>ca(s.value?.meta?.granularity_ms)||"secondly"),lt=f.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(j,et)=>j.text===r.t("chartLabels.____OTHER____")?1:et.text===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(j.text,10))&&!isNaN(parseInt(et.text,10))?j.text<et.text?-1:1:j.value&&et.value?et.value.raw-j.value.raw:0),bt=f.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(j,et)=>j.label===r.t("chartLabels.____OTHER____")?1:et.label===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(j.label,10))&&!isNaN(parseInt(et.label,10))?j.label<et.label?-1:1:j.value&&et.value?et.rawValue-j.rawValue:0),Rt=f.computed(()=>[...i.timeseriesZoom?[{label:r.t("zoom_action_items.zoom"),key:"zoom-in",action:j=>n("zoom-time-range",j)}]:[],...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",D),f.provide("legendPosition",f.toRef(i,"legendPosition")),(j,et)=>{const rt=f.resolveComponent("KTooltip"),Gt=f.resolveComponent("KEmptyState");return f.openBlock(),f.createElementBlock("div",{ref:"chartShell",class:f.normalizeClass(["analytics-chart-shell",{"show-values":D.value}])},[X.value&&N.value&&C.value?(f.openBlock(),f.createElementBlock("div",AN,[f.createVNode(rt,{class:"tooltip","max-width":"500",placement:"right"},{content:f.withCtx(()=>[f.createElementVNode("div",EN,f.toDisplayString($.value),1)]),default:f.withCtx(()=>[f.createVNode(f.unref(fe.WarningIcon),{color:`var(--kui-color-text-warning, ${f.unref(mS)})`,size:`var(--kui-icon-size-40, ${f.unref(_S)})`},null,8,["color","size"])]),_:1})])):f.createCommentVNode("",!0),X.value?(f.openBlock(),f.createElementBlock("div",RN,[st.value?(f.openBlock(),f.createBlock(ON,{key:0,brush:L.value,"chart-data":P.value,"chart-legend-sort-fn":lt.value,"chart-tooltip-sort-fn":bt.value,"dimension-axes-title":Z.value,fill:e.chartOptions.stacked,granularity:ot.value,"left-y-axis-grid":e.chartOptions.yAxes?.left?.showGrid,"legend-values":f.unref(w),"metric-axes-title":at.value,"metric-unit":F.value,"right-y-axis":pt.value,stacked:e.chartOptions.stacked,"synthetics-data-key":e.syntheticsDataKey,threshold:_.value,"time-range-ms":R.value,"tooltip-metric-display":Tt.value,"tooltip-title":e.tooltipTitle,type:e.chartOptions.type,"zoom-action-items":Rt.value,onSelectChartRange:et[0]||(et[0]=yt=>n("select-chart-range",yt)),onZoomTimeRange:et[1]||(et[1]=yt=>n("zoom-time-range",yt))},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"])):V.value?(f.openBlock(),f.createBlock(QL,{key:1,annotations:e.showAnnotations,"chart-data":P.value,"chart-legend-sort-fn":lt.value,"chart-tooltip-sort-fn":bt.value,"data-testid":"bar-chart-container","dimension-axes-title":z.value,"legend-values":f.unref(w),"metric-axes-title":at.value,"metric-unit":F.value,orientation:ct.value,stacked:e.chartOptions.stacked,"synthetics-data-key":e.syntheticsDataKey,"tooltip-metric-display":Tt.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"])):dt.value?(f.openBlock(),f.createBlock(fN,{key:2,"chart-data":P.value,"dataset-colors":e.chartOptions.chartDatasetColors||f.unref(Zu),"legend-position":e.legendPosition,"legend-values":f.unref(w),"metric-name":U.value,"metric-unit":F.value,"show-center-metric":e.chartOptions.showCenterMetric,"synthetics-data-key":e.syntheticsDataKey,"tooltip-dimension-display":z.value,"tooltip-metric-display":Tt.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"])):ut.value?(f.openBlock(),f.createBlock(yN,{key:3,"chart-data":P.value,"chart-legend-sort-fn":e.chartOptions.chartLegendSortFn,"chart-tooltip-sort-fn":bt.value,"data-testid":"scatter-chart-container","dimension-axes-title":it.value,granularity:vt.value,"metric-axes-title":at.value,"metric-unit":F.value,"shade-outlier-region":e.chartOptions.scatter?.shadeOutlierRegion,"synthetics-data-key":e.syntheticsDataKey,"theme-colors":O.value,"time-range-ms":R.value,"tooltip-metric-display":Tt.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(Gt,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(ht.value),1)]),default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(mt.value),1)]),_:1}))],2)}}}),IN=ke(PN,[["__scopeId","data-v-c5c250ba"]]),LN={class:"chart-parent","data-testid":"gauge-chart-parent"},NN={class:"chart-totals-flex"},BN={key:1,class:"metric-small","data-testid":"gauge-chart-total"},FN=ke(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(Dd()),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",LN,[f.createElementVNode("div",NN,[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",BN,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(Ky),{"chart-id":i.value,data:s.value,options:a},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-c461b83f"]]),zN={key:1,class:"single-value-wrapper"},UN={class:"single-value-metric"},HN={class:"name-unit-alignment"},WN={class:"single-value","data-testid":"single-value-chart"},$N={key:0,class:"single-value-unit"},VN={class:"single-value-metric-name"},YN={key:0,class:"single-value-trend"},qN={key:0,class:"single-value-trend-range","data-testid":"single-value-trend-range"},Od="t1",Ad="t2",jN=ke(f.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:p0},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:Od,secondLevelKey:Ad})),l=f.computed(()=>a.value?.previous?.[Od]?.[Ad]),u=f.computed(()=>a.value?.current?.[Od]?.[Ad]),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 C=h.value?r.data.meta?.metric_units?.[h.value]:void 0;if(C){const N=`chartUnits.${C}`;return t.te(N)?t.t(N,{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 C=d.value[0].event[h.value];return typeof C!="number"||isNaN(C)?null:C}),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),O=f.computed(()=>{const C=v.value;if(C===null)return"-";const N=h.value?r.data.meta?.metric_units?.[h.value]:void 0;if(N==="usd")return i(C);if(N==="bytes")return n(C);if(C>=1e9){const V=(C/1e9).toFixed(1);return V.endsWith(".0")?`${Math.floor(C/1e9)}B`:`${V}B`}if(C>=1e7){const V=(C/1e6).toFixed(1);return V.endsWith(".0")?`${Math.floor(C/1e6)}M`:`${V}M`}const $=r.decimalPoints&&typeof r.decimalPoints=="number"?r.decimalPoints:p0;return C.toLocaleString("en-US",{maximumFractionDigits:$})}),A=f.computed(()=>r.showTrend&&r.data?.data?.length<2),P=f.computed(()=>er.calculateChange(v.value??0,x.value??0)||0),L=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(P.value,!0,r.increaseIsBad)}),R=f.computed(()=>er.defineIcon(L.value,r.increaseIsBad)),F=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(P.value,r.data?.data?.length===2,t.t("singleValue.trend.not_available"))}),U=er.useTrendRange(f.computed(()=>r.showTrend),void 0,f.computed(()=>r.data.meta)),D=C=>C>0?"positive":C<0?"negative":"neutral",w=C=>C>0?pS:C<0?hS:up;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)}),(C,N)=>{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",zN,[f.createElementVNode("div",UN,[f.createElementVNode("div",HN,[f.createElementVNode("span",WN,f.toDisplayString(O.value),1),_.value&&g.value?(f.openBlock(),f.createElementBlock("span",$N,"  "+f.toDisplayString(g.value),1)):f.createCommentVNode("",!0)]),f.createElementVNode("div",VN,f.toDisplayString(m.value),1)]),e.showTrend?(f.openBlock(),f.createElementBlock("div",YN,[f.createElementVNode("div",{class:f.normalizeClass(["trend-change",D(L.value)]),"data-testid":"single-value-trend"},[A.value||L.value!==0?(f.openBlock(),f.createBlock(f.resolveDynamicComponent(R.value),{key:0,color:w(L.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(up)})`,size:`var(--kui-icon-size-30, ${f.unref(rr)})`},null,8,["color","size"])),f.createElementVNode("div",null,f.toDisplayString(F.value),1)],2),f.unref(U)?(f.openBlock(),f.createElementBlock("div",qN,f.toDisplayString(f.unref(U)),1)):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0)]))],2)}}}),[["__scopeId","data-v-640d8a8c"]]),GN={class:"simple-chart-shell"},KN={key:1,class:"analytics-chart-parent"},XN=ke(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",GN,[u.value?(f.openBlock(),f.createElementBlock("div",KN,[s.value?(f.openBlock(),f.createBlock(FN,{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(jN,{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"]]),ZN={class:"container"},QN={key:0,class:"no-data","data-testid":"sparkline-empty"},JN=["title"],tB=ke(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:U,height:D})=>{h.width=U,h.height=D},g=f.computed(()=>e.disableTooltip?[]:[new Zy({enableBrushing:e.groupKey!==void 0&&e.chartKey!==void 0&&e.enableBrushing,brushStrategy:"group",brushGroup:e.groupKey})]),_=f.computed(()=>d.value.reduce((U,{data:D,label:w})=>({...U,[w]:D.reduce((C,{y:N})=>C+N,0)}),{})),x=f.computed(()=>d.value.map(({label:U})=>[_.value[U],`${U}: ${_.value[U]}`]).sort(([U],[D])=>D-U).map(([,U])=>U).join(", ")),v=f.computed(()=>Object.keys(_.value).map(U=>_.value[U]).reduce((U,D)=>U+D,0)),S=f.computed(()=>v.value>0),O=f.computed(()=>({labels:new Array(u.value).fill(""),datasets:d.value})),A=f.computed(()=>e.datasets.length>1),P=`SparklineTooltipPosition-${t}`,L=f.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:P,external:C=>{Vu(h,C,"minutely",{contextFormatter:N=>{const $=N+i.value;let V="";return i.value>1440*60*1e3?V=ya(new Date($),"MMM dd, yyy hh:mm a"):V=ya(new Date($),"hh:mm a"),`${bv(N)} - ${V}`}})}}},scales:{x:{min:D,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}}}}),R=f.ref("0"),F=f.ref("0");return f.onMounted(()=>{qe.positioners[P]=function(U,D){if(!U.length||h.interactionMode==="interactive"||D.x===null)return!1;const w=10,C=this.chart.canvas.getBoundingClientRect(),N=h.width||this.width,$=h.height||this.height,V=C.top-$>0,st=V?C.top-$-w:C.top+C.height+w,dt=C.left>N/2-D.x,ut=Math.max(w,window.innerWidth-w-N),ct=Math.min(ut,dt?Math.floor(C.left-N/2)+D.x:0+w);return R.value=`${st}px`,F.value=`${ct}px`,{x:ct,y:st,xAlign:"center",yAlign:V?"top":"bottom"}}}),f.onUnmounted(()=>{qe.positioners[P]&&delete qe.positioners[P]}),(U,D)=>(f.openBlock(),f.createElementBlock("div",ZN,[S.value?e.type==="sparkline_bar"?(f.openBlock(),f.createBlock(f.unref(Gy),{key:1,"chart-id":f.unref(t),data:O.value,"data-testid":"sparkline-bar",options:L.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(Xy),{key:2,"chart-id":f.unref(t),data:O.value,"data-testid":e.type==="sparkline_line"?"sparkline-line":"sparkline-step",options:L.value,plugins:g.value},null,8,["chart-id","data","data-testid","options","plugins"])):f.createCommentVNode("",!0):(f.openBlock(),f.createElementBlock("div",QN,[f.renderSlot(U.$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":F.value,"absolute-top":R.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:U.$slots.label?"":x.value},[f.renderSlot(U.$slots,"label",{total:v.value,totalByDataset:_.value},()=>[f.createTextVNode(f.toDisplayString(x.value),1)],!0)],8,JN)):f.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-ae8259b6"]]),eB=["data-value"],nB=["title"],iB={class:"top-talkers-cell-metric"},rB={class:"top-talkers-cell-value","data-testid":"top-talkers-cell-value"},sB={key:0,class:"top-talkers-cell-relative","data-testid":"top-talkers-cell-relative"},oB={class:"top-talkers-tooltip","data-testid":"top-talkers-tooltip"},aB={class:"top-talkers-tooltip-title"},lB={class:"top-talkers-tooltip-rows"},cB={class:"top-talkers-tooltip-label"},uB=["data-threshold"],dB=ke(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",oB,[f.createElementVNode("div",aB,f.toDisplayString(e.cell.name),1),f.createElementVNode("dl",lB,[(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",cB,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,uB)],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,nB),f.createElementVNode("span",iB,[f.createElementVNode("span",rB,f.toDisplayString(e.cell.display),1),e.cell.relative?(f.openBlock(),f.createElementBlock("span",sB,"("+f.toDisplayString(e.cell.relative)+")",1)):f.createCommentVNode("",!0)])],10,eB)]),_:1},8,["disabled","style"]))}}),[["__scopeId","data-v-73764587"]]),fB=["data-dimension"],hB={class:"top-talkers-column-header"},pB={class:"top-talkers-column-label","data-testid":"top-talkers-column-label"},mB={key:0,class:"top-talkers-column-total","data-testid":"top-talkers-column-total"},gB={key:1,class:"top-talkers-column-empty","data-testid":"top-talkers-column-empty"},yB={key:2,class:"top-talkers-column-cells"},i_=ke(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",hB,[f.createElementVNode("span",pB,f.toDisplayString(i.value),1),!e.isLoading&&f.unref(n).cells.length?(f.openBlock(),f.createElementBlock("span",mB,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",yB,[(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",gB,f.toDisplayString(f.unref(t).t("topTalkers.defaultEmptyStateTitle")),1))],8,fB))}}),[["__scopeId","data-v-e1b08041"]]),_B={class:"top-talkers-card-title","data-testid":"top-talkers-card-title"},bB={key:2,class:"top-talkers-grid","data-testid":"top-talkers-grid"},xB=ke(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",bB,[(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(i_,{"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",_B,f.toDisplayString(e.title),1)]),key:"0"}:void 0]),1032,["title-tag"]))}}),[["__scopeId","data-v-d5bb8abd"]]),wB={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}},vB=(e,t)=>{if(!(!e||!t))return wB[e]?.[t.toLowerCase()]},SB=["data-threshold"],TB=ke(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,SB))}}),[["__scopeId","data-v-24eb60ef"]]),kB=["data-threshold"],MB={class:"top-n-metric-cell-value"},DB={key:0,class:"top-n-metric-cell-relative","data-testid":"top-n-metric-cell-relative"},CB=ke(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",MB,f.toDisplayString(e.display),1),e.relative?(f.openBlock(),f.createElementBlock("span",DB,"("+f.toDisplayString(e.relative)+")",1)):f.createCommentVNode("",!0)],10,kB))}}),[["__scopeId","data-v-17e7f860"]]),OB={class:"top-n-card-title","data-testid":"top-n-card-title"},AB={class:"top-n-card-description","data-testid":"top-n-card-description"},EB={key:3,class:"top-n-table","data-testid":"top-n-table"},RB={"data-testid":"top-n-table-header"},PB={class:"top-n-table-header-row"},IB=["colspan"],LB={class:"table-header-label"},NB=["data-testid"],BB={class:"top-n-table-cell-label"},FB={key:0,class:"top-n-table-cell top-n-table-cell-bar"},zB=3,UB=ke(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,zB):[]),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?pt(g.value):""),x=f.computed(()=>{const B=a.value.map(z=>({key:z,columnKey:z,label:ct(z,u.value?pt(z):n.t("topNTable.nameLabel")),type:"dimension"}));return g.value&&B.push({key:"value",columnKey:g.value,label:ct(g.value,_.value),type:"metric"}),m.value.forEach((z,Z)=>{Z!==0&&B.push({key:z,columnKey:z,label:ct(z,pt(z)),type:"metric"})}),B}),v=f.computed(()=>x.value.filter(B=>B.type==="metric")),S=f.computed(()=>x.value.filter(B=>B.type==="dimension").slice(1)),O=B=>B.type==="dimension"&&B.key===d.value,A=B=>B.type==="metric"&&!!gr(t.columnOptions,B.columnKey)?.bar,P=B=>u.value&&B.type==="dimension"&&!O(B),L=B=>{const z=B.event;return String(z[l.value])},R=(B,z)=>{const Z=String(B.event[z]),it=t.data.meta?.display?.[z]?.[Z];return{dimension:z,id:Z,name:it?.name||"-",deleted:!!it?.deleted}},F=B=>{const z=L(B),Z=h.value&&h.value[z];return Z?Z.name:"-"},U=B=>{const z=L(B),Z=h.value&&h.value[z];return Z?!!Z.deleted:!1},D=B=>{const z=Z=>i(Z,"%",{translateUnit:it=>G(it,Z)});return B>0&&B<.01?`< ${z(.01)}`:z(B)},w=(B,z)=>{const Z=B.event[z];if(Z==null)return"–";const it=typeof Z=="number"?Z:Number(Z);if(Number.isNaN(it))return"–";const ht=t.data.meta?.metric_units?.[z]||"count";if(ht==="%")return D(it);const mt=["count","count/minute","token count"].includes(ht);return i(it,ht,{approximate:mt,isBytes1024:!0,translateUnit:X=>G(X,it)})},C=f.computed(()=>Object.fromEntries(m.value.map(B=>[B,Hu(r.value.map(z=>Jr(z.event[B])))]))),N=(B,z)=>{const Z=gr(t.columnOptions,z),it=Jr(B.event[z]);if(!Z||it===null)return{display:w(B,z)};const ht=C.value[z],mt=Z.value==="relative"?Wu(it,ht):null;return{display:w(B,z),relative:mt===null?void 0:D(mt*100),barRatio:Z.bar?b0(it,ht,Z.bar):void 0,threshold:$u(it,Z.thresholds)}},$=f.computed(()=>r.value?.length?r.value.map(B=>{const z=a.value.map(mt=>R(B,mt)),Z=z[0],it=Z?.id||L(B),ht={id:it,rowKey:z.map(mt=>`${mt.dimension}:${mt.id}`).join("|")||it,name:Z?.name||F(B),deleted:U(B),dimensions:z,metrics:{},original:B};return m.value.forEach((mt,X)=>{ht.metrics[X===0?"value":mt]=N(B,mt)}),ht}):[]),V=f.computed(()=>{if(!s.value)return"";if(t.data.meta){if(a.value.some(B=>!Object.keys(t.data.meta.display[B]||{}).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=(B,z)=>B.metrics[z]??{display:"–"},dt=(B,z)=>B.dimensions.find(Z=>Z.dimension===z)?.id||"",ut=(B,z)=>vB(gr(t.columnOptions,B)?.icon_set,z),ct=(B,z)=>B&&gr(t.columnOptions,B)?.label||z,Tt=(B,z)=>B.dimensions.find(Z=>Z.dimension===z)?.name||"–",at=(B,z)=>{const Z=B.dimensions.find(it=>it.dimension===z);return{id:Z?.id||"",name:Z?.name||"–",deleted:Z?.deleted||!1,dimension:z,dimensions:B.dimensions,isEmpty:Z?.id==="empty"}},pt=B=>n.te(`chartLabels.${B}`)?n.t(`chartLabels.${B}`):B,G=(B,z)=>{if(xo(B)||B==="count"||B==="requests")return"";const Z=z===1?"":"s";return n.te(`chartUnits.${B}`)?n.t(`chartUnits.${B}`,{plural:Z}):B};return(B,z)=>{const Z=f.resolveComponent("KEmptyState"),it=f.resolveComponent("KSkeleton"),ht=f.resolveComponent("KCard");return f.openBlock(),f.createBlock(ht,{class:"kong-ui-public-top-n-table","title-tag":e.titleTag},f.createSlots({default:f.withCtx(()=>[V.value?(f.openBlock(),f.createBlock(Z,{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(V.value),1)]),_:1})):e.isLoading?(f.openBlock(),f.createBlock(it,{key:1,"table-columns":2,type:"table"})):s.value?(f.openBlock(),f.createElementBlock("div",EB,[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",PB,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(x.value,mt=>(f.openBlock(),f.createElementBlock("th",{key:mt.key,class:f.normalizeClass(["top-n-table-header-cell",{"top-n-table-header-cell-metric":mt.type==="metric","top-n-table-header-cell-dimension-compact":P(mt)}]),colspan:A(mt)?2:void 0,"data-testid":"top-n-table-header-column"},[f.createElementVNode("span",LB,f.toDisplayString(mt.label),1),z[0]||(z[0]=f.createElementVNode("div",{class:"top-n-table-header-cell-border"},null,-1))],10,IB))),128))])]),f.createElementVNode("tbody",null,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList($.value,mt=>(f.openBlock(),f.createElementBlock("tr",{key:mt.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-${mt.id}`},[ut(l.value,mt.id)?(f.openBlock(),f.createBlock(f.resolveDynamicComponent(ut(l.value,mt.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(B.$slots,"name",{record:{id:mt.id,name:mt.name,deleted:mt.deleted,dimension:l.value,dimensions:mt.dimensions,isEmpty:mt.id==="empty"}},()=>[f.createTextVNode(f.toDisplayString(mt.name),1)],!0)],8,NB)],2)):f.createCommentVNode("",!0),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(S.value,X=>(f.openBlock(),f.createElementBlock("td",{key:X.key,class:f.normalizeClass(["top-n-table-cell top-n-table-cell--dimension",{"top-n-table-cell-dimension-compact":!O(X)}])},[f.createElementVNode("span",BB,[ut(X.key,dt(mt,X.key))?(f.openBlock(),f.createBlock(f.resolveDynamicComponent(ut(X.key,dt(mt,X.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(B.$slots,"name",{record:at(mt,X.key)},()=>[f.createTextVNode(f.toDisplayString(Tt(mt,X.key)),1)],!0)])],2))),128)),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(v.value,X=>(f.openBlock(),f.createElementBlock(f.Fragment,{key:X.key},[f.createElementVNode("td",{class:f.normalizeClass(["top-n-table-cell top-n-table-cell-metric",{"top-n-table-cell-metric--has-bar":A(X)}])},[f.createVNode(CB,{"data-testid":X.key==="value"?`row-${mt.id}`:`row-${mt.id}-${X.key}`,display:st(mt,X.key).display,"has-bar":A(X),relative:st(mt,X.key).relative,threshold:st(mt,X.key).threshold},null,8,["data-testid","display","has-bar","relative","threshold"])],2),A(X)?(f.openBlock(),f.createElementBlock("td",FB,[f.createVNode(TB,{ratio:st(mt,X.key).barRatio??0,threshold:st(mt,X.key).threshold},null,8,["ratio","threshold"])])):f.createCommentVNode("",!0)],64))),128))]))),128))])],2)])):(f.openBlock(),f.createBlock(Z,{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",OB,f.toDisplayString(e.title),1)]),key:"0"}:void 0,e.description?{name:"actions",fn:f.withCtx(()=>[f.createElementVNode("div",AB,f.toDisplayString(e.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-9111e441"]]);var Hi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Co={exports:{}};var HB=Co.exports,r_;function WB(){return r_||(r_=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,O=1,A=2,P=4,L=8,R=16,F=32,U=64,D=128,w=256,C=512,N=30,$="...",V=800,st=16,dt=1,ut=2,ct=3,Tt=1/0,at=9007199254740991,pt=17976931348623157e292,G=NaN,B=4294967295,z=B-1,Z=B>>>1,it=[["ary",D],["bind",O],["bindKey",A],["curry",L],["curryRight",R],["flip",C],["partial",F],["partialRight",U],["rearg",w]],ht="[object Arguments]",mt="[object Array]",X="[object AsyncFunction]",ot="[object Boolean]",vt="[object Date]",lt="[object DOMException]",bt="[object Error]",Rt="[object Function]",j="[object GeneratorFunction]",et="[object Map]",rt="[object Number]",Gt="[object Null]",yt="[object Object]",$t="[object Promise]",Me="[object Proxy]",Te="[object RegExp]",ee="[object Set]",je="[object String]",Yt="[object Symbol]",Be="[object Undefined]",se="[object WeakMap]",De="[object WeakSet]",Pe="[object ArrayBuffer]",gn="[object DataView]",Wi="[object Float32Array]",Cn="[object Float64Array]",Ge="[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,xl=/[&<>"']/g,Ed=RegExp($i.source),Rd=RegExp(xl.source),Pd=/<%-([\s\S]+?)%>/g,Id=/<%([\s\S]+?)%>/g,Io=/<%=([\s\S]+?)%>/g,wl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,hi=/^\w*$/,Ld=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Lo=/[\\^$.*+?()[\]{}|]/g,Nd=RegExp(Lo.source),No=/^\s+/,Bd=/\s/,Nn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Fd=/\{\n\/\* \[wrapped with (.+)\] \*/,zd=/,? & /,Ud=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,vl=/[()=,{}\[\]\/\s]/,Hd=/\\(\\)?/g,Vi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Sl=/\w*$/,Wd=/^[-+]0x[0-9a-f]+$/i,$d=/^0b[01]+$/i,Vd=/^\[object .+?Constructor\]$/,Yd=/^0o[0-7]+$/i,Yi=/^(?:0|[1-9]\d*)$/,qd=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ls=/($^)/,jd=/['\n\r\u2028\u2029\\]/g,cs="\\ud800-\\udfff",Gd="\\u0300-\\u036f",Kd="\\ufe20-\\ufe2f",Tl="\\u20d0-\\u20ff",kr=Gd+Kd+Tl,kl="\\u2700-\\u27bf",us="a-z\\xdf-\\xf6\\xf8-\\xff",Xd="\\xac\\xb1\\xd7\\xf7",Zd="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Qd="\\u2000-\\u206f",Jd=" \\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",Ml="A-Z\\xc0-\\xd6\\xd8-\\xde",Dl="\\ufe0e\\ufe0f",ds=Xd+Zd+Qd+Jd,Bo="['’]",tf="["+cs+"]",Cl="["+ds+"]",fs="["+kr+"]",Ol="\\d+",ef="["+kl+"]",Al="["+us+"]",Fo="[^"+cs+ds+Ol+kl+us+Ml+"]",zo="\\ud83c[\\udffb-\\udfff]",nf="(?:"+fs+"|"+zo+")",Mr="[^"+cs+"]",Zn="(?:\\ud83c[\\udde6-\\uddff]){2}",hs="[\\ud800-\\udbff][\\udc00-\\udfff]",un="["+Ml+"]",El="\\u200d",Rl="(?:"+Al+"|"+Fo+")",rf="(?:"+un+"|"+Fo+")",Pl="(?:"+Bo+"(?:d|ll|m|re|s|t|ve))?",Il="(?:"+Bo+"(?:D|LL|M|RE|S|T|VE))?",Ll=nf+"?",Uo="["+Dl+"]?",pi="(?:"+El+"(?:"+[Mr,Zn,hs].join("|")+")"+Uo+Ll+")*",sf="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Nl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Bl=Uo+Ll+pi,Ho="(?:"+[ef,Zn,hs].join("|")+")"+Bl,Fl="(?:"+[Mr+fs+"?",fs,Zn,hs,tf].join("|")+")",of=RegExp(Bo,"g"),af=RegExp(fs,"g"),ps=RegExp(zo+"(?="+zo+")|"+Fl+Bl,"g"),lf=RegExp([un+"?"+Al+"+"+Pl+"(?="+[Cl,un,"$"].join("|")+")",rf+"+"+Il+"(?="+[Cl,un+Rl,"$"].join("|")+")",un+"?"+Rl+"+"+Pl,un+"+"+Il,Nl,sf,Ol,Ho].join("|"),"g"),ms=RegExp("["+El+cs+kr+Dl+"]"),cf=/[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"],uf=-1,ie={};ie[Wi]=ie[Cn]=ie[Ge]=ie[Ln]=ie[di]=ie[Oo]=ie[Ao]=ie[Tr]=ie[fi]=!0,ie[ht]=ie[mt]=ie[Pe]=ie[ot]=ie[gn]=ie[vt]=ie[bt]=ie[Rt]=ie[et]=ie[rt]=ie[yt]=ie[Te]=ie[ee]=ie[je]=ie[se]=!1;var M={};M[ht]=M[mt]=M[Pe]=M[gn]=M[ot]=M[vt]=M[Wi]=M[Cn]=M[Ge]=M[Ln]=M[di]=M[et]=M[rt]=M[yt]=M[Te]=M[ee]=M[je]=M[Yt]=M[Oo]=M[Ao]=M[Tr]=M[fi]=!0,M[bt]=M[Rt]=M[se]=!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"},tt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},xt={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Ce={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ke=parseFloat,Bn=parseInt,Fe=typeof Hi=="object"&&Hi&&Hi.Object===Object&&Hi,zl=typeof self=="object"&&self&&self.Object===Object&&self,ue=Fe||zl||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 H=Qn&&Qn.require&&Qn.require("util").types;return H||Dr&&Dr.binding&&Dr.binding("util")}catch{}})(),c_=ze&&ze.isArrayBuffer,u_=ze&&ze.isDate,d_=ze&&ze.isMap,f_=ze&&ze.isRegExp,h_=ze&&ze.isSet,p_=ze&&ze.isTypedArray;function yn(H,K,q){switch(q.length){case 0:return H.call(K);case 1:return H.call(K,q[0]);case 2:return H.call(K,q[0],q[1]);case 3:return H.call(K,q[0],q[1],q[2])}return H.apply(K,q)}function nF(H,K,q,gt){for(var At=-1,qt=H==null?0:H.length;++At<qt;){var Oe=H[At];K(gt,Oe,q(Oe),H)}return gt}function _n(H,K){for(var q=-1,gt=H==null?0:H.length;++q<gt&&K(H[q],q,H)!==!1;);return H}function iF(H,K){for(var q=H==null?0:H.length;q--&&K(H[q],q,H)!==!1;);return H}function m_(H,K){for(var q=-1,gt=H==null?0:H.length;++q<gt;)if(!K(H[q],q,H))return!1;return!0}function qi(H,K){for(var q=-1,gt=H==null?0:H.length,At=0,qt=[];++q<gt;){var Oe=H[q];K(Oe,q,H)&&(qt[At++]=Oe)}return qt}function Ul(H,K){var q=H==null?0:H.length;return!!q&&ys(H,K,0)>-1}function df(H,K,q){for(var gt=-1,At=H==null?0:H.length;++gt<At;)if(q(K,H[gt]))return!0;return!1}function de(H,K){for(var q=-1,gt=H==null?0:H.length,At=Array(gt);++q<gt;)At[q]=K(H[q],q,H);return At}function ji(H,K){for(var q=-1,gt=K.length,At=H.length;++q<gt;)H[At+q]=K[q];return H}function ff(H,K,q,gt){var At=-1,qt=H==null?0:H.length;for(gt&&qt&&(q=H[++At]);++At<qt;)q=K(q,H[At],At,H);return q}function rF(H,K,q,gt){var At=H==null?0:H.length;for(gt&&At&&(q=H[--At]);At--;)q=K(q,H[At],At,H);return q}function hf(H,K){for(var q=-1,gt=H==null?0:H.length;++q<gt;)if(K(H[q],q,H))return!0;return!1}var sF=pf("length");function oF(H){return H.split("")}function aF(H){return H.match(Ud)||[]}function g_(H,K,q){var gt;return q(H,function(At,qt,Oe){if(K(At,qt,Oe))return gt=qt,!1}),gt}function Hl(H,K,q,gt){for(var At=H.length,qt=q+(gt?1:-1);gt?qt--:++qt<At;)if(K(H[qt],qt,H))return qt;return-1}function ys(H,K,q){return K===K?bF(H,K,q):Hl(H,y_,q)}function lF(H,K,q,gt){for(var At=q-1,qt=H.length;++At<qt;)if(gt(H[At],K))return At;return-1}function y_(H){return H!==H}function __(H,K){var q=H==null?0:H.length;return q?gf(H,K)/q:G}function pf(H){return function(K){return K==null?n:K[H]}}function mf(H){return function(K){return H==null?n:H[K]}}function b_(H,K,q,gt,At){return At(H,function(qt,Oe,re){q=gt?(gt=!1,qt):K(q,qt,Oe,re)}),q}function cF(H,K){var q=H.length;for(H.sort(K);q--;)H[q]=H[q].value;return H}function gf(H,K){for(var q,gt=-1,At=H.length;++gt<At;){var qt=K(H[gt]);qt!==n&&(q=q===n?qt:q+qt)}return q}function yf(H,K){for(var q=-1,gt=Array(H);++q<H;)gt[q]=K(q);return gt}function uF(H,K){return de(K,function(q){return[q,H[q]]})}function x_(H){return H&&H.slice(0,T_(H)+1).replace(No,"")}function bn(H){return function(K){return H(K)}}function _f(H,K){return de(K,function(q){return H[q]})}function Vo(H,K){return H.has(K)}function w_(H,K){for(var q=-1,gt=H.length;++q<gt&&ys(K,H[q],0)>-1;);return q}function v_(H,K){for(var q=H.length;q--&&ys(K,H[q],0)>-1;);return q}function dF(H,K){for(var q=H.length,gt=0;q--;)H[q]===K&&++gt;return gt}var fF=mf(Y),hF=mf(tt);function pF(H){return"\\"+Ce[H]}function mF(H,K){return H==null?n:H[K]}function _s(H){return ms.test(H)}function gF(H){return cf.test(H)}function yF(H){for(var K,q=[];!(K=H.next()).done;)q.push(K.value);return q}function bf(H){var K=-1,q=Array(H.size);return H.forEach(function(gt,At){q[++K]=[At,gt]}),q}function S_(H,K){return function(q){return H(K(q))}}function Gi(H,K){for(var q=-1,gt=H.length,At=0,qt=[];++q<gt;){var Oe=H[q];(Oe===K||Oe===m)&&(H[q]=m,qt[At++]=q)}return qt}function Wl(H){var K=-1,q=Array(H.size);return H.forEach(function(gt){q[++K]=gt}),q}function _F(H){var K=-1,q=Array(H.size);return H.forEach(function(gt){q[++K]=[gt,gt]}),q}function bF(H,K,q){for(var gt=q-1,At=H.length;++gt<At;)if(H[gt]===K)return gt;return-1}function xF(H,K,q){for(var gt=q+1;gt--;)if(H[gt]===K)return gt;return gt}function bs(H){return _s(H)?vF(H):sF(H)}function Fn(H){return _s(H)?SF(H):oF(H)}function T_(H){for(var K=H.length;K--&&Bd.test(H.charAt(K)););return K}var wF=mf(xt);function vF(H){for(var K=ps.lastIndex=0;ps.test(H);)++K;return K}function SF(H){return H.match(ps)||[]}function TF(H){return H.match(lf)||[]}var kF=(function H(K){K=K==null?ue:xs.defaults(ue.Object(),K,xs.pick(ue,Wo));var q=K.Array,gt=K.Date,At=K.Error,qt=K.Function,Oe=K.Math,re=K.Object,xf=K.RegExp,MF=K.String,On=K.TypeError,$l=q.prototype,DF=qt.prototype,ws=re.prototype,Vl=K["__core-js_shared__"],Yl=DF.toString,Kt=ws.hasOwnProperty,CF=0,k_=(function(){var o=/[^.]+$/.exec(Vl&&Vl.keys&&Vl.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),ql=ws.toString,OF=Yl.call(re),AF=ue._,EF=xf("^"+Yl.call(Kt).replace(Lo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),jl=$o?K.Buffer:n,Ki=K.Symbol,Gl=K.Uint8Array,M_=jl?jl.allocUnsafe:n,Kl=S_(re.getPrototypeOf,re),D_=re.create,C_=ws.propertyIsEnumerable,Xl=$l.splice,O_=Ki?Ki.isConcatSpreadable:n,Yo=Ki?Ki.iterator:n,Cr=Ki?Ki.toStringTag:n,Zl=(function(){try{var o=Pr(re,"defineProperty");return o({},"",{}),o}catch{}})(),RF=K.clearTimeout!==ue.clearTimeout&&K.clearTimeout,PF=gt&&gt.now!==ue.Date.now&&gt.now,IF=K.setTimeout!==ue.setTimeout&&K.setTimeout,Ql=Oe.ceil,Jl=Oe.floor,wf=re.getOwnPropertySymbols,LF=jl?jl.isBuffer:n,A_=K.isFinite,NF=$l.join,BF=S_(re.keys,re),Ae=Oe.max,Xe=Oe.min,FF=gt.now,zF=K.parseInt,E_=Oe.random,UF=$l.reverse,vf=Pr(K,"DataView"),qo=Pr(K,"Map"),Sf=Pr(K,"Promise"),vs=Pr(K,"Set"),jo=Pr(K,"WeakMap"),Go=Pr(re,"create"),tc=jo&&new jo,Ss={},HF=Ir(vf),WF=Ir(qo),$F=Ir(Sf),VF=Ir(vs),YF=Ir(jo),ec=Ki?Ki.prototype:n,Ko=ec?ec.valueOf:n,R_=ec?ec.toString:n;function T(o){if(ye(o)&&!It(o)&&!(o instanceof Ht)){if(o instanceof An)return o;if(Kt.call(o,"__wrapped__"))return Pb(o)}return new An(o)}var Ts=(function(){function o(){}return function(c){if(!pe(c))return{};if(D_)return D_(c);o.prototype=c;var p=new o;return o.prototype=n,p}})();function nc(){}function An(o,c){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=n}T.templateSettings={escape:Pd,evaluate:Id,interpolate:Io,variable:"",imports:{_:T}},T.prototype=nc.prototype,T.prototype.constructor=T,An.prototype=Ts(nc.prototype),An.prototype.constructor=An;function Ht(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=B,this.__views__=[]}function qF(){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 jF(){if(this.__filtered__){var o=new Ht(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function GF(){var o=this.__wrapped__.value(),c=this.__dir__,p=It(o),y=c<0,b=p?o.length:0,k=oU(0,b,this.__views__),E=k.start,I=k.end,W=I-E,Q=y?I:E-1,J=this.__iteratees__,nt=J.length,ft=0,wt=Xe(W,this.__takeCount__);if(!p||!y&&b==W&&wt==W)return nb(o,this.__actions__);var Ct=[];t:for(;W--&&ft<wt;){Q+=c;for(var Ft=-1,Mt=o[Q];++Ft<nt;){var Ut=J[Ft],Wt=Ut.iteratee,vn=Ut.type,rn=Wt(Mt);if(vn==ut)Mt=rn;else if(!rn){if(vn==dt)continue t;break t}}Ct[ft++]=Mt}return Ct}Ht.prototype=Ts(nc.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 KF(){this.__data__=Go?Go(null):{},this.size=0}function XF(o){var c=this.has(o)&&delete this.__data__[o];return this.size-=c?1:0,c}function ZF(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 QF(o){var c=this.__data__;return Go?c[o]!==n:Kt.call(c,o)}function JF(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=KF,Or.prototype.delete=XF,Or.prototype.get=ZF,Or.prototype.has=QF,Or.prototype.set=JF;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 tz(){this.__data__=[],this.size=0}function ez(o){var c=this.__data__,p=ic(c,o);if(p<0)return!1;var y=c.length-1;return p==y?c.pop():Xl.call(c,p,1),--this.size,!0}function nz(o){var c=this.__data__,p=ic(c,o);return p<0?n:c[p][1]}function iz(o){return ic(this.__data__,o)>-1}function rz(o,c){var p=this.__data__,y=ic(p,o);return y<0?(++this.size,p.push([o,c])):p[y][1]=c,this}mi.prototype.clear=tz,mi.prototype.delete=ez,mi.prototype.get=nz,mi.prototype.has=iz,mi.prototype.set=rz;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 sz(){this.size=0,this.__data__={hash:new Or,map:new(qo||mi),string:new Or}}function oz(o){var c=mc(this,o).delete(o);return this.size-=c?1:0,c}function az(o){return mc(this,o).get(o)}function lz(o){return mc(this,o).has(o)}function cz(o,c){var p=mc(this,o),y=p.size;return p.set(o,c),this.size+=p.size==y?0:1,this}gi.prototype.clear=sz,gi.prototype.delete=oz,gi.prototype.get=az,gi.prototype.has=lz,gi.prototype.set=cz;function Ar(o){var c=-1,p=o==null?0:o.length;for(this.__data__=new gi;++c<p;)this.add(o[c])}function uz(o){return this.__data__.set(o,d),this}function dz(o){return this.__data__.has(o)}Ar.prototype.add=Ar.prototype.push=uz,Ar.prototype.has=dz;function zn(o){var c=this.__data__=new mi(o);this.size=c.size}function fz(){this.__data__=new mi,this.size=0}function hz(o){var c=this.__data__,p=c.delete(o);return this.size=c.size,p}function pz(o){return this.__data__.get(o)}function mz(o){return this.__data__.has(o)}function gz(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=fz,zn.prototype.delete=hz,zn.prototype.get=pz,zn.prototype.has=mz,zn.prototype.set=gz;function P_(o,c){var p=It(o),y=!p&&Lr(o),b=!p&&!y&&tr(o),k=!p&&!y&&!b&&Cs(o),E=p||y||b||k,I=E?yf(o.length,MF):[],W=I.length;for(var Q in o)(c||Kt.call(o,Q))&&!(E&&(Q=="length"||b&&(Q=="offset"||Q=="parent")||k&&(Q=="buffer"||Q=="byteLength"||Q=="byteOffset")||bi(Q,W)))&&I.push(Q);return I}function I_(o){var c=o.length;return c?o[If(0,c-1)]:n}function yz(o,c){return gc(dn(o),Er(c,0,o.length))}function _z(o){return gc(dn(o))}function Tf(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 ic(o,c){for(var p=o.length;p--;)if(Hn(o[p][0],c))return p;return-1}function bz(o,c,p,y){return Xi(o,function(b,k,E){c(y,b,p(b),E)}),y}function L_(o,c){return o&&ei(c,Ie(c),o)}function xz(o,c){return o&&ei(c,hn(c),o)}function Jn(o,c,p){c=="__proto__"&&Zl?Zl(o,c,{configurable:!0,enumerable:!0,value:p,writable:!0}):o[c]=p}function kf(o,c){for(var p=-1,y=c.length,b=q(y),k=o==null;++p<y;)b[p]=k?n:oh(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,k){var E,I=c&g,W=c&_,Q=c&x;if(p&&(E=b?p(o,y,b,k):p(o)),E!==n)return E;if(!pe(o))return o;var J=It(o);if(J){if(E=lU(o),!I)return dn(o,E)}else{var nt=Ze(o),ft=nt==Rt||nt==j;if(tr(o))return sb(o,I);if(nt==yt||nt==ht||ft&&!b){if(E=W||ft?{}:Tb(o),!I)return W?Zz(o,xz(E,o)):Xz(o,L_(E,o))}else{if(!M[nt])return b?o:{};E=cU(o,nt,I)}}k||(k=new zn);var wt=k.get(o);if(wt)return wt;k.set(o,E),Jb(o)?o.forEach(function(Mt){E.add(En(Mt,c,p,Mt,o,k))}):Zb(o)&&o.forEach(function(Mt,Ut){E.set(Ut,En(Mt,c,p,Ut,o,k))});var Ct=Q?W?Yf:Vf:W?hn:Ie,Ft=J?n:Ct(o);return _n(Ft||o,function(Mt,Ut){Ft&&(Ut=Mt,Mt=o[Ut]),Xo(E,Ut,En(Mt,c,p,Ut,o,k))}),E}function wz(o){var c=Ie(o);return function(p){return N_(p,o,c)}}function N_(o,c,p){var y=p.length;if(o==null)return!y;for(o=re(o);y--;){var b=p[y],k=c[b],E=o[b];if(E===n&&!(b in o)||!k(E))return!1}return!0}function B_(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,k=Ul,E=!0,I=o.length,W=[],Q=c.length;if(!I)return W;p&&(c=de(c,bn(p))),y?(k=df,E=!1):c.length>=r&&(k=Vo,E=!1,c=new Ar(c));t:for(;++b<I;){var J=o[b],nt=p==null?J:p(J);if(J=y||J!==0?J:0,E&&nt===nt){for(var ft=Q;ft--;)if(c[ft]===nt)continue t;W.push(J)}else k(c,nt,y)||W.push(J)}return W}var Xi=ub(ti),F_=ub(Df,!0);function vz(o,c){var p=!0;return Xi(o,function(y,b,k){return p=!!c(y,b,k),p}),p}function rc(o,c,p){for(var y=-1,b=o.length;++y<b;){var k=o[y],E=c(k);if(E!=null&&(I===n?E===E&&!wn(E):p(E,I)))var I=E,W=k}return W}function Sz(o,c,p,y){var b=o.length;for(p=Bt(p),p<0&&(p=-p>b?0:b+p),y=y===n||y>b?b:Bt(y),y<0&&(y+=b),y=p>y?0:ex(y);p<y;)o[p++]=c;return o}function z_(o,c){var p=[];return Xi(o,function(y,b,k){c(y,b,k)&&p.push(y)}),p}function Ue(o,c,p,y,b){var k=-1,E=o.length;for(p||(p=dU),b||(b=[]);++k<E;){var I=o[k];c>0&&p(I)?c>1?Ue(I,c-1,p,y,b):ji(b,I):y||(b[b.length]=I)}return b}var Mf=db(),U_=db(!0);function ti(o,c){return o&&Mf(o,c,Ie)}function Df(o,c){return o&&U_(o,c,Ie)}function sc(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 H_(o,c,p){var y=c(o);return It(o)?y:ji(y,p(o))}function en(o){return o==null?o===n?Be:Gt:Cr&&Cr in re(o)?sU(o):_U(o)}function Cf(o,c){return o>c}function Tz(o,c){return o!=null&&Kt.call(o,c)}function kz(o,c){return o!=null&&c in re(o)}function Mz(o,c,p){return o>=Xe(c,p)&&o<Ae(c,p)}function Of(o,c,p){for(var y=p?df:Ul,b=o[0].length,k=o.length,E=k,I=q(k),W=1/0,Q=[];E--;){var J=o[E];E&&c&&(J=de(J,bn(c))),W=Xe(J.length,W),I[E]=!p&&(c||b>=120&&J.length>=120)?new Ar(E&&J):n}J=o[0];var nt=-1,ft=I[0];t:for(;++nt<b&&Q.length<W;){var wt=J[nt],Ct=c?c(wt):wt;if(wt=p||wt!==0?wt:0,!(ft?Vo(ft,Ct):y(Q,Ct,p))){for(E=k;--E;){var Ft=I[E];if(!(Ft?Vo(Ft,Ct):y(o[E],Ct,p)))continue t}ft&&ft.push(Ct),Q.push(wt)}}return Q}function Dz(o,c,p,y){return ti(o,function(b,k,E){c(y,p(b),k,E)}),y}function Qo(o,c,p){c=Qi(c,o),o=Cb(o,c);var y=o==null?o:o[Un(Pn(c))];return y==null?n:yn(y,o,p)}function W_(o){return ye(o)&&en(o)==ht}function Cz(o){return ye(o)&&en(o)==Pe}function Oz(o){return ye(o)&&en(o)==vt}function Jo(o,c,p,y,b){return o===c?!0:o==null||c==null||!ye(o)&&!ye(c)?o!==o&&c!==c:Az(o,c,p,y,Jo,b)}function Az(o,c,p,y,b,k){var E=It(o),I=It(c),W=E?mt:Ze(o),Q=I?mt:Ze(c);W=W==ht?yt:W,Q=Q==ht?yt:Q;var J=W==yt,nt=Q==yt,ft=W==Q;if(ft&&tr(o)){if(!tr(c))return!1;E=!0,J=!1}if(ft&&!J)return k||(k=new zn),E||Cs(o)?wb(o,c,p,y,b,k):iU(o,c,W,p,y,b,k);if(!(p&v)){var wt=J&&Kt.call(o,"__wrapped__"),Ct=nt&&Kt.call(c,"__wrapped__");if(wt||Ct){var Ft=wt?o.value():o,Mt=Ct?c.value():c;return k||(k=new zn),b(Ft,Mt,p,y,k)}}return ft?(k||(k=new zn),rU(o,c,p,y,b,k)):!1}function Ez(o){return ye(o)&&Ze(o)==et}function Af(o,c,p,y){var b=p.length,k=b,E=!y;if(o==null)return!k;for(o=re(o);b--;){var I=p[b];if(E&&I[2]?I[1]!==o[I[0]]:!(I[0]in o))return!1}for(;++b<k;){I=p[b];var W=I[0],Q=o[W],J=I[1];if(E&&I[2]){if(Q===n&&!(W in o))return!1}else{var nt=new zn;if(y)var ft=y(Q,J,W,o,c,nt);if(!(ft===n?Jo(J,Q,v|S,y,nt):ft))return!1}}return!0}function $_(o){if(!pe(o)||hU(o))return!1;var c=xi(o)?EF:Vd;return c.test(Ir(o))}function Rz(o){return ye(o)&&en(o)==Te}function Pz(o){return ye(o)&&Ze(o)==ee}function Iz(o){return ye(o)&&vc(o.length)&&!!ie[en(o)]}function V_(o){return typeof o=="function"?o:o==null?pn:typeof o=="object"?It(o)?j_(o[0],o[1]):q_(o):hx(o)}function Ef(o){if(!na(o))return BF(o);var c=[];for(var p in re(o))Kt.call(o,p)&&p!="constructor"&&c.push(p);return c}function Lz(o){if(!pe(o))return yU(o);var c=na(o),p=[];for(var y in o)y=="constructor"&&(c||!Kt.call(o,y))||p.push(y);return p}function Rf(o,c){return o<c}function Y_(o,c){var p=-1,y=fn(o)?q(o.length):[];return Xi(o,function(b,k,E){y[++p]=c(b,k,E)}),y}function q_(o){var c=jf(o);return c.length==1&&c[0][2]?Mb(c[0][0],c[0][1]):function(p){return p===o||Af(p,o,c)}}function j_(o,c){return Kf(o)&&kb(c)?Mb(Un(o),c):function(p){var y=oh(p,o);return y===n&&y===c?ah(p,o):Jo(c,y,v|S)}}function oc(o,c,p,y,b){o!==c&&Mf(c,function(k,E){if(b||(b=new zn),pe(k))Nz(o,c,E,p,oc,y,b);else{var I=y?y(Zf(o,E),k,E+"",o,c,b):n;I===n&&(I=k),Tf(o,E,I)}},hn)}function Nz(o,c,p,y,b,k,E){var I=Zf(o,p),W=Zf(c,p),Q=E.get(W);if(Q){Tf(o,p,Q);return}var J=k?k(I,W,p+"",o,c,E):n,nt=J===n;if(nt){var ft=It(W),wt=!ft&&tr(W),Ct=!ft&&!wt&&Cs(W);J=W,ft||wt||Ct?It(I)?J=I:xe(I)?J=dn(I):wt?(nt=!1,J=sb(W,!0)):Ct?(nt=!1,J=ob(W,!0)):J=[]:ra(W)||Lr(W)?(J=I,Lr(I)?J=nx(I):(!pe(I)||xi(I))&&(J=Tb(W))):nt=!1}nt&&(E.set(W,J),b(J,W,y,k,E),E.delete(W)),Tf(o,p,J)}function G_(o,c){var p=o.length;if(p)return c+=c<0?p:0,bi(c,p)?o[c]:n}function K_(o,c,p){c.length?c=de(c,function(k){return It(k)?function(E){return Rr(E,k.length===1?k[0]:k)}:k}):c=[pn];var y=-1;c=de(c,bn(Dt()));var b=Y_(o,function(k,E,I){var W=de(c,function(Q){return Q(k)});return{criteria:W,index:++y,value:k}});return cF(b,function(k,E){return Kz(k,E,p)})}function Bz(o,c){return X_(o,c,function(p,y){return ah(o,y)})}function X_(o,c,p){for(var y=-1,b=c.length,k={};++y<b;){var E=c[y],I=Rr(o,E);p(I,E)&&ta(k,Qi(E,o),I)}return k}function Fz(o){return function(c){return Rr(c,o)}}function Pf(o,c,p,y){var b=y?lF:ys,k=-1,E=c.length,I=o;for(o===c&&(c=dn(c)),p&&(I=de(o,bn(p)));++k<E;)for(var W=0,Q=c[k],J=p?p(Q):Q;(W=b(I,J,W,y))>-1;)I!==o&&Xl.call(I,W,1),Xl.call(o,W,1);return o}function Z_(o,c){for(var p=o?c.length:0,y=p-1;p--;){var b=c[p];if(p==y||b!==k){var k=b;bi(b)?Xl.call(o,b,1):Bf(o,b)}}return o}function If(o,c){return o+Jl(E_()*(c-o+1))}function zz(o,c,p,y){for(var b=-1,k=Ae(Ql((c-o)/(p||1)),0),E=q(k);k--;)E[y?k:++b]=o,o+=p;return E}function Lf(o,c){var p="";if(!o||c<1||c>at)return p;do c%2&&(p+=o),c=Jl(c/2),c&&(o+=o);while(c);return p}function zt(o,c){return Qf(Db(o,c,pn),o+"")}function Uz(o){return I_(Os(o))}function Hz(o,c){var p=Os(o);return gc(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,k=c.length,E=k-1,I=o;I!=null&&++b<k;){var W=Un(c[b]),Q=p;if(W==="__proto__"||W==="constructor"||W==="prototype")return o;if(b!=E){var J=I[W];Q=y?y(J,W,I):n,Q===n&&(Q=pe(J)?J:bi(c[b+1])?[]:{})}Xo(I,W,Q),I=I[W]}return o}var Q_=tc?function(o,c){return tc.set(o,c),o}:pn,Wz=Zl?function(o,c){return Zl(o,"toString",{configurable:!0,enumerable:!1,value:ch(c),writable:!0})}:pn;function $z(o){return gc(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 k=q(b);++y<b;)k[y]=o[y+c];return k}function Vz(o,c){var p;return Xi(o,function(y,b,k){return p=c(y,b,k),!p}),!!p}function ac(o,c,p){var y=0,b=o==null?y:o.length;if(typeof c=="number"&&c===c&&b<=Z){for(;y<b;){var k=y+b>>>1,E=o[k];E!==null&&!wn(E)&&(p?E<=c:E<c)?y=k+1:b=k}return b}return Nf(o,c,pn,p)}function Nf(o,c,p,y){var b=0,k=o==null?0:o.length;if(k===0)return 0;c=p(c);for(var E=c!==c,I=c===null,W=wn(c),Q=c===n;b<k;){var J=Jl((b+k)/2),nt=p(o[J]),ft=nt!==n,wt=nt===null,Ct=nt===nt,Ft=wn(nt);if(E)var Mt=y||Ct;else Q?Mt=Ct&&(y||ft):I?Mt=Ct&&ft&&(y||!wt):W?Mt=Ct&&ft&&!wt&&(y||!Ft):wt||Ft?Mt=!1:Mt=y?nt<=c:nt<c;Mt?b=J+1:k=J}return Xe(k,z)}function J_(o,c){for(var p=-1,y=o.length,b=0,k=[];++p<y;){var E=o[p],I=c?c(E):E;if(!p||!Hn(I,W)){var W=I;k[b++]=E===0?0:E}}return k}function tb(o){return typeof o=="number"?o:wn(o)?G:+o}function xn(o){if(typeof o=="string")return o;if(It(o))return de(o,xn)+"";if(wn(o))return R_?R_.call(o):"";var c=o+"";return c=="0"&&1/o==-Tt?"-0":c}function Zi(o,c,p){var y=-1,b=Ul,k=o.length,E=!0,I=[],W=I;if(p)E=!1,b=df;else if(k>=r){var Q=c?null:eU(o);if(Q)return Wl(Q);E=!1,b=Vo,W=new Ar}else W=c?[]:I;t:for(;++y<k;){var J=o[y],nt=c?c(J):J;if(J=p||J!==0?J:0,E&&nt===nt){for(var ft=W.length;ft--;)if(W[ft]===nt)continue t;c&&W.push(nt),I.push(J)}else b(W,nt,p)||(W!==I&&W.push(nt),I.push(J))}return I}function Bf(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 k=Cb(o,c);return k==null||delete k[Un(Pn(c))]}function eb(o,c,p,y){return ta(o,c,p(Rr(o,c)),y)}function lc(o,c,p,y){for(var b=o.length,k=y?b:-1;(y?k--:++k<b)&&c(o[k],k,o););return p?Rn(o,y?0:k,y?k+1:b):Rn(o,y?k+1:0,y?b:k)}function nb(o,c){var p=o;return p instanceof Ht&&(p=p.value()),ff(c,function(y,b){return b.func.apply(b.thisArg,ji([y],b.args))},p)}function Ff(o,c,p){var y=o.length;if(y<2)return y?Zi(o[0]):[];for(var b=-1,k=q(y);++b<y;)for(var E=o[b],I=-1;++I<y;)I!=b&&(k[b]=Zo(k[b]||E,o[I],c,p));return Zi(Ue(k,1),c,p)}function ib(o,c,p){for(var y=-1,b=o.length,k=c.length,E={};++y<b;){var I=y<k?c[y]:n;p(E,o[y],I)}return E}function zf(o){return xe(o)?o:[]}function Uf(o){return typeof o=="function"?o:pn}function Qi(o,c){return It(o)?o:Kf(o,c)?[o]:Rb(Xt(o))}var Yz=zt;function Ji(o,c,p){var y=o.length;return p=p===n?y:p,!c&&p>=y?o:Rn(o,c,p)}var rb=RF||function(o){return ue.clearTimeout(o)};function sb(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 Hf(o){var c=new o.constructor(o.byteLength);return new Gl(c).set(new Gl(o)),c}function qz(o,c){var p=c?Hf(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.byteLength)}function jz(o){var c=new o.constructor(o.source,Sl.exec(o));return c.lastIndex=o.lastIndex,c}function Gz(o){return Ko?re(Ko.call(o)):{}}function ob(o,c){var p=c?Hf(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.length)}function ab(o,c){if(o!==c){var p=o!==n,y=o===null,b=o===o,k=wn(o),E=c!==n,I=c===null,W=c===c,Q=wn(c);if(!I&&!Q&&!k&&o>c||k&&E&&W&&!I&&!Q||y&&E&&W||!p&&W||!b)return 1;if(!y&&!k&&!Q&&o<c||Q&&p&&b&&!y&&!k||I&&p&&b||!E&&b||!W)return-1}return 0}function Kz(o,c,p){for(var y=-1,b=o.criteria,k=c.criteria,E=b.length,I=p.length;++y<E;){var W=ab(b[y],k[y]);if(W){if(y>=I)return W;var Q=p[y];return W*(Q=="desc"?-1:1)}}return o.index-c.index}function lb(o,c,p,y){for(var b=-1,k=o.length,E=p.length,I=-1,W=c.length,Q=Ae(k-E,0),J=q(W+Q),nt=!y;++I<W;)J[I]=c[I];for(;++b<E;)(nt||b<k)&&(J[p[b]]=o[b]);for(;Q--;)J[I++]=o[b++];return J}function cb(o,c,p,y){for(var b=-1,k=o.length,E=-1,I=p.length,W=-1,Q=c.length,J=Ae(k-I,0),nt=q(J+Q),ft=!y;++b<J;)nt[b]=o[b];for(var wt=b;++W<Q;)nt[wt+W]=c[W];for(;++E<I;)(ft||b<k)&&(nt[wt+p[E]]=o[b++]);return nt}function dn(o,c){var p=-1,y=o.length;for(c||(c=q(y));++p<y;)c[p]=o[p];return c}function ei(o,c,p,y){var b=!p;p||(p={});for(var k=-1,E=c.length;++k<E;){var I=c[k],W=y?y(p[I],o[I],I,p,o):n;W===n&&(W=o[I]),b?Jn(p,I,W):Xo(p,I,W)}return p}function Xz(o,c){return ei(o,Gf(o),c)}function Zz(o,c){return ei(o,vb(o),c)}function cc(o,c){return function(p,y){var b=It(p)?nF:bz,k=c?c():{};return b(p,o,Dt(y,2),k)}}function ks(o){return zt(function(c,p){var y=-1,b=p.length,k=b>1?p[b-1]:n,E=b>2?p[2]:n;for(k=o.length>3&&typeof k=="function"?(b--,k):n,E&&nn(p[0],p[1],E)&&(k=b<3?n:k,b=1),c=re(c);++y<b;){var I=p[y];I&&o(c,I,y,k)}return c})}function ub(o,c){return function(p,y){if(p==null)return p;if(!fn(p))return o(p,y);for(var b=p.length,k=c?b:-1,E=re(p);(c?k--:++k<b)&&y(E[k],k,E)!==!1;);return p}}function db(o){return function(c,p,y){for(var b=-1,k=re(c),E=y(c),I=E.length;I--;){var W=E[o?I:++b];if(p(k[W],W,k)===!1)break}return c}}function Qz(o,c,p){var y=c&O,b=ea(o);function k(){var E=this&&this!==ue&&this instanceof k?b:o;return E.apply(y?p:this,arguments)}return k}function fb(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 ff(dx(ux(c).replace(of,"")),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 Jz(o,c,p){var y=ea(o);function b(){for(var k=arguments.length,E=q(k),I=k,W=Ds(b);I--;)E[I]=arguments[I];var Q=k<3&&E[0]!==W&&E[k-1]!==W?[]:Gi(E,W);if(k-=Q.length,k<p)return yb(o,c,uc,b.placeholder,n,E,Q,n,n,p-k);var J=this&&this!==ue&&this instanceof b?y:o;return yn(J,this,E)}return b}function hb(o){return function(c,p,y){var b=re(c);if(!fn(c)){var k=Dt(p,3);c=Ie(c),p=function(I){return k(b[I],I,b)}}var E=o(c,p,y);return E>-1?b[k?c[E]:E]:n}}function pb(o){return _i(function(c){var p=c.length,y=p,b=An.prototype.thru;for(o&&c.reverse();y--;){var k=c[y];if(typeof k!="function")throw new On(a);if(b&&!E&&pc(k)=="wrapper")var E=new An([],!0)}for(y=E?y:p;++y<p;){k=c[y];var I=pc(k),W=I=="wrapper"?qf(k):n;W&&Xf(W[0])&&W[1]==(D|L|F|w)&&!W[4].length&&W[9]==1?E=E[pc(W[0])].apply(E,W[3]):E=k.length==1&&Xf(k)?E[I]():E.thru(k)}return function(){var Q=arguments,J=Q[0];if(E&&Q.length==1&&It(J))return E.plant(J).value();for(var nt=0,ft=p?c[nt].apply(this,Q):J;++nt<p;)ft=c[nt].call(this,ft);return ft}})}function uc(o,c,p,y,b,k,E,I,W,Q){var J=c&D,nt=c&O,ft=c&A,wt=c&(L|R),Ct=c&C,Ft=ft?n:ea(o);function Mt(){for(var Ut=arguments.length,Wt=q(Ut),vn=Ut;vn--;)Wt[vn]=arguments[vn];if(wt)var rn=Ds(Mt),Sn=dF(Wt,rn);if(y&&(Wt=lb(Wt,y,b,wt)),k&&(Wt=cb(Wt,k,E,wt)),Ut-=Sn,wt&&Ut<Q){var we=Gi(Wt,rn);return yb(o,c,uc,Mt.placeholder,p,Wt,we,I,W,Q-Ut)}var Wn=nt?p:this,vi=ft?Wn[o]:o;return Ut=Wt.length,I?Wt=bU(Wt,I):Ct&&Ut>1&&Wt.reverse(),J&&W<Ut&&(Wt.length=W),this&&this!==ue&&this instanceof Mt&&(vi=Ft||ea(vi)),vi.apply(Wn,Wt)}return Mt}function mb(o,c){return function(p,y){return Dz(p,o,c(y),{})}}function dc(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=tb(p),y=tb(y)),b=o(p,y)}return b}}function Wf(o){return _i(function(c){return c=de(c,bn(Dt())),zt(function(p){var y=this;return o(c,function(b){return yn(b,y,p)})})})}function fc(o,c){c=c===n?" ":xn(c);var p=c.length;if(p<2)return p?Lf(c,o):c;var y=Lf(c,Ql(o/bs(c)));return _s(c)?Ji(Fn(y),0,o).join(""):y.slice(0,o)}function tU(o,c,p,y){var b=c&O,k=ea(o);function E(){for(var I=-1,W=arguments.length,Q=-1,J=y.length,nt=q(J+W),ft=this&&this!==ue&&this instanceof E?k:o;++Q<J;)nt[Q]=y[Q];for(;W--;)nt[Q++]=arguments[++I];return yn(ft,b?p:this,nt)}return E}function gb(o){return function(c,p,y){return y&&typeof y!="number"&&nn(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),zz(c,p,y,o)}}function hc(o){return function(c,p){return typeof c=="string"&&typeof p=="string"||(c=In(c),p=In(p)),o(c,p)}}function yb(o,c,p,y,b,k,E,I,W,Q){var J=c&L,nt=J?E:n,ft=J?n:E,wt=J?k:n,Ct=J?n:k;c|=J?F:U,c&=~(J?U:F),c&P||(c&=-4);var Ft=[o,c,b,wt,nt,Ct,ft,I,W,Q],Mt=p.apply(n,Ft);return Xf(o)&&Ob(Mt,Ft),Mt.placeholder=y,Ab(Mt,o,c)}function $f(o){var c=Oe[o];return function(p,y){if(p=In(p),y=y==null?0:Xe(Bt(y),292),y&&A_(p)){var b=(Xt(p)+"e").split("e"),k=c(b[0]+"e"+(+b[1]+y));return b=(Xt(k)+"e").split("e"),+(b[0]+"e"+(+b[1]-y))}return c(p)}}var eU=vs&&1/Wl(new vs([,-0]))[1]==Tt?function(o){return new vs(o)}:fh;function _b(o){return function(c){var p=Ze(c);return p==et?bf(c):p==ee?_F(c):uF(c,o(c))}}function yi(o,c,p,y,b,k,E,I){var W=c&A;if(!W&&typeof o!="function")throw new On(a);var Q=y?y.length:0;if(Q||(c&=-97,y=b=n),E=E===n?E:Ae(Bt(E),0),I=I===n?I:Bt(I),Q-=b?b.length:0,c&U){var J=y,nt=b;y=b=n}var ft=W?n:qf(o),wt=[o,c,p,y,b,J,nt,k,E,I];if(ft&&gU(wt,ft),o=wt[0],c=wt[1],p=wt[2],y=wt[3],b=wt[4],I=wt[9]=wt[9]===n?W?0:o.length:Ae(wt[9]-Q,0),!I&&c&(L|R)&&(c&=-25),!c||c==O)var Ct=Qz(o,c,p);else c==L||c==R?Ct=Jz(o,c,I):(c==F||c==(O|F))&&!b.length?Ct=tU(o,c,p,y):Ct=uc.apply(n,wt);var Ft=ft?Q_:Ob;return Ab(Ft(Ct,wt),o,c)}function bb(o,c,p,y){return o===n||Hn(o,ws[p])&&!Kt.call(y,p)?c:o}function xb(o,c,p,y,b,k){return pe(o)&&pe(c)&&(k.set(c,o),oc(o,c,n,xb,k),k.delete(c)),o}function nU(o){return ra(o)?n:o}function wb(o,c,p,y,b,k){var E=p&v,I=o.length,W=c.length;if(I!=W&&!(E&&W>I))return!1;var Q=k.get(o),J=k.get(c);if(Q&&J)return Q==c&&J==o;var nt=-1,ft=!0,wt=p&S?new Ar:n;for(k.set(o,c),k.set(c,o);++nt<I;){var Ct=o[nt],Ft=c[nt];if(y)var Mt=E?y(Ft,Ct,nt,c,o,k):y(Ct,Ft,nt,o,c,k);if(Mt!==n){if(Mt)continue;ft=!1;break}if(wt){if(!hf(c,function(Ut,Wt){if(!Vo(wt,Wt)&&(Ct===Ut||b(Ct,Ut,p,y,k)))return wt.push(Wt)})){ft=!1;break}}else if(!(Ct===Ft||b(Ct,Ft,p,y,k))){ft=!1;break}}return k.delete(o),k.delete(c),ft}function iU(o,c,p,y,b,k,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||!k(new Gl(o),new Gl(c)));case ot:case vt:case rt:return Hn(+o,+c);case bt:return o.name==c.name&&o.message==c.message;case Te:case je:return o==c+"";case et:var I=bf;case ee:var W=y&v;if(I||(I=Wl),o.size!=c.size&&!W)return!1;var Q=E.get(o);if(Q)return Q==c;y|=S,E.set(o,c);var J=wb(I(o),I(c),y,b,k,E);return E.delete(o),J;case Yt:if(Ko)return Ko.call(o)==Ko.call(c)}return!1}function rU(o,c,p,y,b,k){var E=p&v,I=Vf(o),W=I.length,Q=Vf(c),J=Q.length;if(W!=J&&!E)return!1;for(var nt=W;nt--;){var ft=I[nt];if(!(E?ft in c:Kt.call(c,ft)))return!1}var wt=k.get(o),Ct=k.get(c);if(wt&&Ct)return wt==c&&Ct==o;var Ft=!0;k.set(o,c),k.set(c,o);for(var Mt=E;++nt<W;){ft=I[nt];var Ut=o[ft],Wt=c[ft];if(y)var vn=E?y(Wt,Ut,ft,c,o,k):y(Ut,Wt,ft,o,c,k);if(!(vn===n?Ut===Wt||b(Ut,Wt,p,y,k):vn)){Ft=!1;break}Mt||(Mt=ft=="constructor")}if(Ft&&!Mt){var rn=o.constructor,Sn=c.constructor;rn!=Sn&&"constructor"in o&&"constructor"in c&&!(typeof rn=="function"&&rn instanceof rn&&typeof Sn=="function"&&Sn instanceof Sn)&&(Ft=!1)}return k.delete(o),k.delete(c),Ft}function _i(o){return Qf(Db(o,n,Nb),o+"")}function Vf(o){return H_(o,Ie,Gf)}function Yf(o){return H_(o,hn,vb)}var qf=tc?function(o){return tc.get(o)}:fh;function pc(o){for(var c=o.name+"",p=Ss[c],y=Kt.call(Ss,c)?p.length:0;y--;){var b=p[y],k=b.func;if(k==null||k==o)return b.name}return c}function Ds(o){var c=Kt.call(T,"placeholder")?T:o;return c.placeholder}function Dt(){var o=T.iteratee||uh;return o=o===uh?V_:o,arguments.length?o(arguments[0],arguments[1]):o}function mc(o,c){var p=o.__data__;return fU(c)?p[typeof c=="string"?"string":"hash"]:p.map}function jf(o){for(var c=Ie(o),p=c.length;p--;){var y=c[p],b=o[y];c[p]=[y,b,kb(b)]}return c}function Pr(o,c){var p=mF(o,c);return $_(p)?p:n}function sU(o){var c=Kt.call(o,Cr),p=o[Cr];try{o[Cr]=n;var y=!0}catch{}var b=ql.call(o);return y&&(c?o[Cr]=p:delete o[Cr]),b}var Gf=wf?function(o){return o==null?[]:(o=re(o),qi(wf(o),function(c){return C_.call(o,c)}))}:hh,vb=wf?function(o){for(var c=[];o;)ji(c,Gf(o)),o=Kl(o);return c}:hh,Ze=en;(vf&&Ze(new vf(new ArrayBuffer(1)))!=gn||qo&&Ze(new qo)!=et||Sf&&Ze(Sf.resolve())!=$t||vs&&Ze(new vs)!=ee||jo&&Ze(new jo)!=se)&&(Ze=function(o){var c=en(o),p=c==yt?o.constructor:n,y=p?Ir(p):"";if(y)switch(y){case HF:return gn;case WF:return et;case $F:return $t;case VF:return ee;case YF:return se}return c});function oU(o,c,p){for(var y=-1,b=p.length;++y<b;){var k=p[y],E=k.size;switch(k.type){case"drop":o+=E;break;case"dropRight":c-=E;break;case"take":c=Xe(c,o+E);break;case"takeRight":o=Ae(o,c-E);break}}return{start:o,end:c}}function aU(o){var c=o.match(Fd);return c?c[1].split(zd):[]}function Sb(o,c,p){c=Qi(c,o);for(var y=-1,b=c.length,k=!1;++y<b;){var E=Un(c[y]);if(!(k=o!=null&&p(o,E)))break;o=o[E]}return k||++y!=b?k:(b=o==null?0:o.length,!!b&&vc(b)&&bi(E,b)&&(It(o)||Lr(o)))}function lU(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 Tb(o){return typeof o.constructor=="function"&&!na(o)?Ts(Kl(o)):{}}function cU(o,c,p){var y=o.constructor;switch(c){case Pe:return Hf(o);case ot:case vt:return new y(+o);case gn:return qz(o,p);case Wi:case Cn:case Ge:case Ln:case di:case Oo:case Ao:case Tr:case fi:return ob(o,p);case et:return new y;case rt:case je:return new y(o);case Te:return jz(o);case ee:return new y;case Yt:return Gz(o)}}function uU(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,`{
7
+ `)}}function gP(e,t,n={}){const{window:i=Ja,...r}=n;let s;const a=_0(()=>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 m0(d),{isSupported:a,stop:d}}function _P(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),y=f.shallowRef(0),x=f.shallowRef(0);function v(){const O=Qr(e);if(!O){n&&(l.value=0,u.value=0,d.value=0,h.value=0,m.value=0,g.value=0,y.value=0,x.value=0);return}const A=O.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,y.value=A.x,x.value=A.y}function S(){a==="sync"?v():a==="next-frame"&&requestAnimationFrame(()=>v())}return gP(e,S),f.watch(()=>Qr(e),O=>!O&&S()),hP(e,S,{attributeFilter:["style","class"]}),r&&_o("scroll",S,{capture:!0,passive:!0}),i&&_o("resize",S,{passive:!0}),uP(()=>{s&&S()}),{height:l,bottom:u,left:d,right:h,top:m,width:g,x:y,y:x,update:S}}function yP(e,t){const{top:n,left:i}=_P(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 bP=({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},y0=()=>({minCounts:{},maxCounts:{},minStamps:{},maxStamps:{},renderPoints:{}}),yo=f.ref({}),xP=e=>(yo.value[e]||(yo.value[e]=y0()),yo.value[e]),wP=(e,t)=>{const n=yo.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 yo.value[t])};function vP({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?xP(n):y0(),m=e!==void 0?e:"static-chart-key",g=f.computed(()=>t.reduce((C,{timestamps:N})=>[...C,...N],[])),y=f.computed(()=>i||g.value.reduce((C,N)=>C===0?N:Math.min(C,N),0)),x=f.computed(()=>r||g.value.reduce((C,N)=>Math.max(C,N),0));f.watchEffect(()=>{h.minStamps[m]=y.value,h.maxStamps[m]=x.value,l!==void 0&&(h.renderPoints[m]=l)});const v=f.computed(()=>Object.values(h.minStamps).reduce((C,N)=>C===0?N:Math.min(C,N),0)),S=f.computed(()=>Object.values(h.maxStamps).reduce((C,N)=>Math.max(C,N),0)),O=f.computed(()=>{const C=Object.values(h.renderPoints);return C.length===0?24:C.reduce((N,$)=>Math.max(N,$),2)}),A=f.computed(()=>{const C=S.value-v.value;return Math.ceil(C/O.value)}),P=f.computed(()=>t.length>1),L=f.computed(()=>t.map(({timestamps:C,color:N,label:$})=>({data:bP({bucketCount:O.value,minStamp:v.value,maxStamp:S.value,timestamps:C}).map(([dt,ut])=>({x:dt,y:ut})),label:$,...(u==="sparkline_bar"||P.value)&&N&&{backgroundColor:N},...u!=="sparkline_bar"&&N&&{borderColor:N},...P.value&&u!=="sparkline_bar"&&{fill:!0}}))),R=f.computed(()=>{const C=L.value[0]?.data?.length??0,N=[];for(let $=0;$<C;$++){let V=0;for(let st=0;st<L.value.length;st++)V+=L.value[st].data[$].y;N.push(V)}return N}),F=f.computed(()=>{const C=R.value.reduce((N,$)=>Math.max(N,$),0);return Math.max(C,a??0)}),U=f.computed(()=>{const C=L.value.reduce((V,{data:st})=>[...V,...st.map(({y:dt})=>dt)],[]),N=C.length?C[0]:0,$=C.reduce((V,st)=>Math.min(V,st),N);return s===void 0?$:Math.min($,s)});f.watchEffect(()=>{h.maxCounts[m]=F.value,h.minCounts[m]=U.value});const D=f.computed(()=>{const C=Object.values(h.minCounts),N=C.length?C[0]:0;return C.reduce(($,V)=>Math.min($,V),N)}),w=f.computed(()=>Object.values(h.maxCounts).reduce((C,N)=>Math.max(C,N),0));return f.onUnmounted(()=>{e!==void 0&&n!==void 0&&wP(e,n)}),{syncedMinStamp:v,syncedMaxStamp:S,syncedRenderPoints:O,syncedChartDatasets:L,syncedGroupSizeMs:A,syncedMinCount:D,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},Hu=e=>e.reduce((t,n)=>n===null?t:{sum:t.sum+n,max:Math.max(t.max,n)},{sum:0,max:0}),Wu=(e,t)=>t.sum>0?e/t.sum:null,b0=(e,t,n)=>{const i=n==="relative"?t.sum:t.max;return i<=0?0:Math.min(Math.max(e/i,0),1)},$u=(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"},x0=18,SP=85;function TP(e,t,n,i){const{i18n:r}=Up(),{formatUnit:s}=$n({i18n:r}),a=R=>R.map(F=>{const U=Math.min(F.ratio,.5)/.5;return{...F,color:Bs({metric:n.value}),tint:`${x0+U*(SP-x0)}%`}}),l=f.computed(()=>e.value?.data??[]),u=f.computed(()=>e.value?.meta?.metric_names??[]),d=f.computed(()=>{const R=n.value;return R&&u.value.includes(R)?R:u.value[0]}),h=f.computed(()=>u.value.filter(R=>R!==d.value)),m=f.computed(()=>e.value?.meta?.display?.[t.value]??{}),g=(R,F)=>{if(xo(R)||R==="count"||R==="requests")return"";const U=F===1?"":"s";return r.te(`chartUnits.${R}`)?r.t(`chartUnits.${R}`,{plural:U}):R},y=R=>{const F=U=>s(U,"%",{translateUnit:D=>g(D,U)});return R>0&&R<.01?`< ${F(.01)}`:F(R)},x=(R,F)=>{if(R===null)return"–";const U=e.value?.meta?.metric_units?.[F]||"count";return U==="%"?y(R):s(R,U,{isBytes1024:!0,translateUnit:D=>g(D,R)})},v=R=>r.te(`chartLabels.${R}`)?r.t(`chartLabels.${R}`):R,S=R=>gr(i.value,R)?.label||v(R),O=f.computed(()=>Hu(l.value.map(R=>d.value?Jr(R.event[d.value]):null))),A=R=>h.value.flatMap(F=>{const U=Jr(R[F]);if(U===null)return[];const D=$u(U,gr(i.value,F)?.thresholds);return[{key:F,label:S(F),value:x(U,F),threshold:D}]}),P=f.computed(()=>{if(!d.value)return[];const R=l.value.map(F=>{const U=F.event,D=String(U[t.value]),w=Jr(U[d.value])??0,C=Wu(w,O.value),N=C??0,$=D===Uu;return{id:D,name:$?v(Uu):m.value[D]?.name||D,deleted:!!m.value[D]?.deleted,isOther:$,isEmpty:D===iP,value:w,ratio:N,display:x(w,d.value),relative:C===null?"":y(C*100),tooltipRows:A(U)}}).sort((F,U)=>Number(F.isOther)-Number(U.isOther)||U.value-F.value);return a(R)});return{column:f.computed(()=>({dimension:t.value,label:S(t.value),total:x(O.value.sum,d.value??"count"),cells:P.value})),cells:P,sizeKey:d}}const St={useBarChartOptions:AR,useChartJSCommon:RR,useChartLegendValues:IR,useChartSelectedRange:LR,useExploreResultToDatasets:WR,useExploreResultToTimeDataset:qR,useScatterDatasets:JR,useDonutChartOptions:NR,useLineChartOptions:BR,useScatterChartOptions:UR,useI18n:Up,useReportChartDataForSynthetics:tP,useTranslatedUnits:eP,useEvaluateFeatureFlag:rP,useTooltipAbsolutePosition:yP,useSparklineSync:vP,useTopTalkersData:TP},el=e=>["interactive","zoom-interactive"].includes(e),Vu=(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,y)=>{const x=g.parsed[d],v=g.dataset.unit??e.units,S=a(x??0,v,{translateUnit:e.translateUnit}),O=g.raw?.tooltipLabel||g.dataset.label;return{backgroundColor:u[y].backgroundColor,borderColor:u[y].borderColor,label:O,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}},w0=(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 y;return u?y=d.dataset.labels[d.dataIndex]:y=d.dataset.label,{backgroundColor:a[h].backgroundColor,borderColor:a[h].borderColor,label:y,value:g,rawValue:m,isSegmentEmpty:d.dataset.isSegmentEmpty}}).sort(s),e.left=`${n.x}px`,e.top=`${n.y}px`,e.showTooltip=!0}},kP=e=>e&&e.datasets&&e.datasets.length,MP=e=>kP(e)&&e.datasets.some(t=>t.data.length),DP=e=>e.datasets.some(t=>t.data[0]&&Wc(t.data[0].x)),CP=e=>!!MP(e)&&e.datasets.some(t=>t.data.length==1),OP=e=>DP(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)},v0=(e,t,n)=>{const s=e.y??0;return s<n?s+t*.15:s-t*.5};function S0(e,t){let n;return(...i)=>{clearTimeout(n),n=window.setTimeout(()=>{e(...i)},t)}}const Yu=(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)},AP=2,T0=10,k0=12,il=10,rl="y",qu="y1",Xn=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],ju=(e,t)=>(t||Xn)[e%Xn.length],EP="#6f7787",RP={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"}},PP=e=>{const t=Math.floor(parseInt(e,10)/100)*100;return RP[t]?.background||"#fafafa"},IP=dS,Gu=(e,t,n,i)=>{let r;return n?r=IP:Array.isArray(i)?r=ju(e,i):r=i[t],r||ju(e)},Ku=e=>{switch(e){case"error":return fS;case"warning":return gS;case"neutral":return lp;default:return lp}},LP={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},NP=2,BP=0,Xu=new Map,M0=(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)},FP=e=>{const n=document.createElement("canvas").getContext("2d"),i=ce({});return n.font=i.string,n.measureText(e).width},zP=()=>{const e="label_height";if(!Xu.has(e)){const t=ce({});Xu.set(e,t.lineHeight)}return Xu.get(e)},UP=(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),HP=(e,t)=>t===0?" (0.0%)":` (${(e/t*100).toFixed(1)}%)`,WP=uS,$P={100:bS,101:xS,102:wS,103:vS,200:SS,201:TS,202:kS,203:MS,204:DS,205:CS,206:OS,207:AS,208:ES,226:RS,300:PS,301:IS,302:LS,303:NS,304:BS,305:FS,307:zS,308:US,400:HS,401:WS,402:$S,403:VS,404:YS,405:qS,406:jS,407:GS,408:KS,409:XS,410:ZS,411:QS,412:JS,413:tT,414:eT,415:nT,416:iT,417:rT,418:sT,421:oT,422:aT,423:lT,424:cT,425:uT,426:dT,428:fT,429:hT,431:pT,451:mT,500:gT,501:_T,502:yT,503:bT,504:xT,505:wT,506:vT,507:ST,508:TT,510:kT,511:MT},VP={100:DT,200:CT,300:OT,400:AT,500:ET},YP={"1XX":RT,"2XX":PT,"3XX":IT,"4XX":LT,"5XX":NT},D0=e=>{const t=parseInt(e,10),n=Math.floor(t/100)*100;return $P[t]??VP[n]??WP},Zu={...Array.from({length:500},(e,t)=>100+t).reduce((e,t)=>(e[`${t}`]=D0(`${t}`),e),{}),____OTHER____:cS,...YP};function C0(e,t,n){const i=Ep(),r=GP(e,n.timeZone,n.locale??i.locale);return"formatToParts"in r?qP(r,t):jP(r,t)}function qP(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 jP(e,t){const n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}function GP(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function KP(e,t){const n=t2(t);return"formatToParts"in n?ZP(n,e):QP(n,e)}const XP={year:0,month:1,day:2,hour:3,minute:4,second:5};function ZP(e,t){try{const n=e.formatToParts(t),i=[];for(let r=0;r<n.length;r++){const s=XP[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 QP(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 Qu={},O0=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")),JP=O0==="06/25/2014, 00:00:00"||O0==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function t2(e){return Qu[e]||(Qu[e]=JP?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"})),Qu[e]}function A0(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 E0=36e5,e2=6e4,Ju={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function td(e,t,n){if(!e)return 0;let i=Ju.timezoneZ.exec(e);if(i)return 0;let r,s;if(i=Ju.timezoneHH.exec(e),i)return r=parseInt(i[1],10),R0(r)?-(r*E0):NaN;if(i=Ju.timezoneHHMM.exec(e),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return R0(r,a)?(s=Math.abs(r)*E0+a*e2,i[1]==="+"?-s:s):NaN}if(r2(e)){t=new Date(t||Date.now());const a=n?t:n2(t),l=ed(a,e);return-(n?l:i2(t,l,e))}return NaN}function n2(e){return A0(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function ed(e,t){const n=KP(e,t),i=A0(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 i2(e,t,n){let r=e.getTime()-t;const s=ed(new Date(r),n);if(t===s)return t;r-=s-t;const a=ed(new Date(r),n);return s===a?s:Math.max(s,a)}function R0(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const P0={};function r2(e){if(P0[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),P0[e]=!0,!0}catch{return!1}}const s2=60*1e3,o2={X:function(e,t,n){const i=nd(n.timeZone,e);if(i===0)return"Z";switch(t){case"X":return I0(i);case"XXXX":case"XX":return ts(i);default:return ts(i,":")}},x:function(e,t,n){const i=nd(n.timeZone,e);switch(t){case"x":return I0(i);case"xxxx":case"xx":return ts(i);default:return ts(i,":")}},O:function(e,t,n){const i=nd(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+a2(i,":");default:return"GMT"+ts(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return C0("short",e,n);default:return C0("long",e,n)}}};function nd(e,t){const n=e?td(e,t,!0)/s2: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 I0(e,t){return e%60===0?(e>0?"-":"+")+sl(Math.abs(e)/60,2):ts(e,t)}function a2(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 L0(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 l2=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,id=36e5,N0=6e4,c2=2,Je={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:l2};function B0(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?c2: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=u2(e),{year:r,restDateString:s}=d2(i.date,n),a=f2(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=h2(i.time),u===null||isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(d=td(i.timeZone||t.timeZone,new Date(l+u)),isNaN(d))return new Date(NaN)}else d=L0(new Date(l+u)),d=L0(new Date(l+u+d));return new Date(l+u+d)}else return new Date(NaN)}function u2(e){const t={};let n=Je.dateTimePattern.exec(e),i;if(n?(t.date=n[1],i=n[3]):(n=Je.datePattern.exec(e),n?(t.date=n[1],i=n[2]):(t.date=null,i=e)),i){const r=Je.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function d2(e,t){if(e){const n=Je.YYY[t],i=Je.YYYYY[t];let r=Je.YYYY.exec(e)||i.exec(e);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:e.slice(s.length)}}if(r=Je.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 f2(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=Je.MM.exec(e);if(s)return n=new Date(0),i=parseInt(s[1],10)-1,U0(t,i)?(n.setUTCFullYear(t,i),n):new Date(NaN);if(s=Je.DDD.exec(e),s){n=new Date(0);const a=parseInt(s[1],10);return g2(t,a)?(n.setUTCFullYear(t,0,a),n):new Date(NaN)}if(s=Je.MMDD.exec(e),s){n=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return U0(t,i,a)?(n.setUTCFullYear(t,i,a),n):new Date(NaN)}if(s=Je.Www.exec(e),s)return r=parseInt(s[1],10)-1,H0(r)?F0(t,r):new Date(NaN);if(s=Je.WwwD.exec(e),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return H0(r,a)?F0(t,r,a):new Date(NaN)}return null}function h2(e){let t,n,i=Je.HH.exec(e);if(i)return t=parseFloat(i[1].replace(",",".")),rd(t)?t%24*id:NaN;if(i=Je.HHMM.exec(e),i)return t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),rd(t,n)?t%24*id+n*N0:NaN;if(i=Je.HHMMSS.exec(e),i){t=parseInt(i[1],10),n=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return rd(t,n,r)?t%24*id+n*N0+r*1e3:NaN}return null}function F0(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 p2=[31,28,31,30,31,30,31,31,30,31,30,31],m2=[31,29,31,30,31,30,31,31,30,31,30,31];function z0(e){return e%400===0||e%4===0&&e%100!==0}function U0(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const i=z0(e);if(i&&n>m2[t]||!i&&n>p2[t])return!1}return!0}function g2(e,t){if(t<1)return!1;const n=z0(e);return!(n&&t>366||!n&&t>365)}function H0(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function rd(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const _2=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function sd(e,t,n={}){t=String(t);const i=t.match(_2);if(i){const r=B0(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,"'"+o2[a[0]](r,a,n)+"'");return u?d.substring(0,l-1)+d.substring(l+1):d},t)}return _a(e,t,n)}function y2(e,t,n){e=B0(e,n);const i=td(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},sd(y2(e,t,{timeZone:i.timeZone}),n,i)}const b2=(e,t)=>`${bo(e,t,"yyyy")} W${bo(e,t,"II")}`,od="MMM dd, h:mm:ss a",ad="h:mm:ss a",_r="MMM dd, h:mm a",es="h:mm a",x2="MMM dd",ld="MMM dd, h:mm:ss a",Bi="MMM dd, h:mm a",w2={secondly:e=>e?od:ad,tenSecondly:e=>e?od:ad,thirtySecondly:e=>e?od:ad,minutely:e=>e?_r:es,fiveMinutely:e=>e?_r:es,tenMinutely:e=>e?_r:es,thirtyMinutely:e=>e?_r:es,hourly:e=>e?_r:es,twoHourly:e=>e?_r:es,twelveHourly:()=>_r,daily:()=>x2},v2={secondly:()=>ld,tenSecondly:()=>ld,thirtySecondly:()=>ld,minutely:()=>Bi,fiveMinutely:()=>Bi,tenMinutely:()=>Bi,thirtyMinutely:()=>Bi,hourly:()=>Bi,twoHourly:()=>Bi,twelveHourly:()=>Bi,daily:()=>Bi};function W0({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 b2(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 $0=({tickValue:e,granularity:t,dayBoundaryCrossed:n,timezone:i})=>W0({tickValue:e,granularity:t,timezone:i,dayBoundaryCrossed:n,tickMap:w2,defaultFormat:"MMM dd, h:mm:ss a"}),ns=({tickValue:e,granularity:t,timezone:n})=>W0({tickValue:e,granularity:t,timezone:n,tooltipMap:v2,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),V0=e=>e?.code==="ERR_CANCELED"||e?.name==="CanceledError"||e?.name==="AbortError",S2=e=>{const{i18n:t}=St.useI18n();return V0(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"),T2=e=>{const t=e.toLocaleLowerCase();return["sum","count","cost","tokens"].some(n=>t.endsWith(n))},k2=(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)},M2=(e,t)=>{const n=e.filter(i=>Number.isFinite(i)).sort((i,r)=>i-r);return new Map(t.map(i=>[i,k2(n,i)]))},Y0=.7,cd=(e,t)=>{const n=Aa(e.trim());return n.valid?n.alpha(t).rgbString():e},ud=e=>{const t=e??(typeof document>"u"?null:document.documentElement);if(typeof window>"u"||!t)return{medianLine:cp,outlier:op,outlierBand:cd(ap,Y0)};const n=window.getComputedStyle(t),i=(r,s)=>n.getPropertyValue(r).trim()||s;return{medianLine:i("--kui-color-text",cp),outlier:i("--kui-color-background-danger",op),outlierBand:cd(i("--kui-color-background-danger-weakest",ap),Y0)}},D2="empty",q0=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??[],y=[];for(const x of g){const v=G0(x.timestamp,x.event[h],m?x.event[m]:void 0);if(v){if(d){const S=j0(x.event[d]);if(S===void 0)continue;v.x=S}y.push(v)}}return{points:y,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}},j0=e=>{if(e==null||e==="")return;const t=Number(e);return Number.isFinite(t)?t:void 0},G0=(e,t,n,i)=>{const r=new Date(e).valueOf(),s=j0(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):D2,...a}},C2=(e,t,n)=>{if(!n?.length)return;const i=[];for(const{field:r,label:s,unit:a}of n){const l=yr(e,r)??yr(t,r);l==null||l===""||i.push({label:s??r,value:l,...a?{unit:a}:{}})}return i.length?i:void 0},O2=(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=yr(h,u);for(const g of A2(h,r)){const y=yr(g,n),x=i?yr(g,i)??yr(h,i):void 0,v=G0(m,y,i?x??null:void 0,C2(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"}},A2=(e,t)=>{if(!t)return[e];const n=yr(e,t);return Array.isArray(n)?n:[]},yr=(e,t)=>{let n=e;for(const i of t.split(".")){if(n===null||typeof n!="object")return;n=n[i]}return n},K0=e=>Object.hasOwn(zp.chartLabels,e),E2=["hidden","single","full"];var br=(e=>(e.String="string",e.Number="number",e.Boolean="boolean",e.Object="object",e.Undefined="undefined",e))(br||{});const R2=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar","scatter"],P2=["gauge","top_n","single_value"],dd=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 X0={modes:{point(e,t){return ol(e,t,{intersect:!0})},nearest(e,t,n){return N2(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 fd(e,t,n){return(X0.modes[n.mode]||X0.modes.nearest)(e,t,n)}function I2(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 L2(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):I2(i,t,n.axis))}function N2(e,t,n){let i=Number.POSITIVE_INFINITY;return ol(e,t,n).reduce((r,s)=>{const a=s.getCenterPoint(),l=L2(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 B2=(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)),Z0=(e,t)=>e.value>=e.start-t&&e.value<=e.end+t;function F2(e,t,n){for(const i of Object.keys(e))e[i]=al(e[i],t,n);return e}function z2(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 Q0(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 J0(e,{rect:t,center:n},i,{rotation:r,borderWidth:s,hitTolerance:a}){const l=xr(e,n,ve(-r));return Q0(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 U2(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(B2(l,a)){if(i)throw new Error(`${e} v${n} is not supported. v${t} or newer is required.`);return!1}}return!0}const t_=e=>typeof e=="string"&&e.endsWith("%"),e_=e=>parseFloat(e)/100,n_=e=>al(e_(e),0,1),wo=(e,t)=>({x:e,y:t,x2:e,y2:t,width:0,height:0}),H2={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 hd(e,t){return t==="start"?0:t==="end"?e:t_(t)?n_(t)*e:e/2}function Fi(e,t,n=!0){return typeof t=="number"?t:t_(t)?(n?n_(t):e_(t))*e:e}function W2(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 i_(e,t,{borderWidth:n,position:i,xAdjust:r,yAdjust:s},a){const l=Nt(a),u=t.width+(l?a.width:0)+n,d=t.height+(l?a.height:0)+n,h=pd(i),m=a_(e.x,u,r,h.x),g=a_(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 pd(e,t="center"){return Nt(e)?{x:Ot(e.x,t),y:Ot(e.y,t)}:(e=Ot(e,t),{x:e,y:e})}const r_=(e,t)=>e&&e.autoFit&&t<1;function s_(e,t){const n=e.font,i=jt(n)?n:[n];return r_(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 o_(e){return e&&(sn(e.xValue)||sn(e.yValue))}function a_(e,t,n=0,i){return e-hd(t,i)+n}function is(e,t,n){const i=n.init;if(i){if(i===!0)return c_(t,n)}else return;return $2(e,t,n)}function l_(e,t,n){let i=!1;return t.forEach(r=>{on(e[r])?(i=!0,n[r]=e[r]):sn(n[r])&&delete n[r]}),i}function c_(e,t){const n=t.type||"line";return H2[n](e)}function $2(e,t,n){const i=Jt(n.init,[{chart:e,properties:t,options:n}]);if(i===!0)return c_(t,n);if(Nt(i))return i}const md=new Map,V2=e=>isNaN(e)||e<=0,Y2=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=s_(t),r=t.textStrokeWidth,s=jt(n)?n:[n],a=s.join()+Y2(i)+r+(e._measureText?"-spriting":"");return md.has(a)||md.set(a,K2(e,s,i,r)),md.get(a)}function u_(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:F2(Ei(n.borderRadius),0,Math.min(s,a)/2)}),e.closePath(),e.fill(),l&&(e.shadowColor=n.borderShadowColor,e.stroke()),e.restore()}function d_(e,t,n,i){const r=n.content;if(ll(r)){e.save(),e.globalAlpha=Q2(n.opacity,r.style.opacity),e.drawImage(r,t.x,t.y,t.width,t.height),e.restore();return}const s=jt(r)?r:[r],a=s_(n,i),l=n.color,u=jt(l)?l:[l],d=W2(t,n),h=t.y+n.textStrokeWidth/2;e.save(),e.textBaseline="middle",e.textAlign=n.textAlign,q2(e,n)&&X2(e,{x:d,y:h},s,a),Z2(e,{x:d,y:h},s,{fonts:a,colors:u}),e.restore()}function q2(e,t){if(t.textStrokeWidth>0)return e.lineJoin="round",e.miterLimit=2,e.lineWidth=t.textStrokeWidth,e.strokeStyle=t.textStrokeColor,!0}function j2(e,t,n,i){const{radius:r,options:s}=t,a=s.pointStyle,l=s.rotation;let u=(l||0)*iu;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}V2(r)||G2(e,{x:n,y:i,radius:r,rotation:l,style:a,rad:u})}function G2(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,ne),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-Pt,a-oe),e.arc(t+u,n-l,h,a-oe,a),e.arc(t+l,n+u,h,a,a+oe),e.arc(t-u,n+l,h,a+oe,a+Pt),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 K2(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 X2(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 Z2(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 Q2(e,t){const n=Ai(e)?e:t;return Ai(n)?al(n,0,1):1}const f_=["left","bottom","top","right"];function J2(e,t){const{pointX:n,pointY:i,options:r}=t,s=r.callout,a=s&&s.display&&rI(t,s);if(!a||oI(t,s,a))return;if(e.save(),e.beginPath(),!ui(e,s))return e.restore();const{separatorStart:u,separatorEnd:d}=tI(t,a),{sideStart:h,sideEnd:m}=nI(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 tI(e,t){const{x:n,y:i,x2:r,y2:s}=e,a=eI(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 eI(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 nI(e,t,n){const{y:i,width:r,height:s,options:a}=e,l=a.callout.start,u=iI(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 iI(e,t){const n=t.side;return e==="left"||e==="top"?-n:n}function rI(e,t){const n=t.position;return f_.includes(n)?n:sI(e,t)}function sI(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,y={x:h,y:m},x=t.start,v=Fi(a,x),S=Fi(l,x),O=[n,n+v,n+v,r],A=[i+S,s,i,s],P=[];for(let L=0;L<4;L++){const R=xr({x:O[L],y:A[L]},y,ve(g));P.push({position:f_[L],distance:Yr(R,{x:u,y:d})})}return P.sort((L,R)=>L.distance-R.distance)[0].position}function oI(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 h_={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 p_(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 m_(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 gd(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=y_(i,{min:t.xMin,max:t.xMax,start:s,end:a});s=d.start,a=d.end;const h=y_(r,{min:t.yMin,max:t.yMax,start:u,end:l});return l=h.start,u=h.end,{x:s,y:l,x2:a,y2:u,width:a-s,height:u-l,centerX:s+(a-s)/2,centerY:l+(u-l)/2}}function g_(e,t){if(!o_(t)){const n=gd(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 lI(e,t)}function aI(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?cI(r,s,t):uI(n,s,t),s}function __(e,t){const n=gd(e,t);return n.initProperties=is(e,n,t),n.elements=[{type:"label",optionScope:"label",properties:hI(e,n,t),initProperties:n.initProperties}],n}function lI(e,t){const n=m_(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 y_(e,t){const n=p_(e,t)||t;return{start:Math.min(n.start,n.end),end:Math.max(n.start,n.end)}}function cI(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 uI(e,t,n){for(const i of Object.keys(h_)){const r=e[Sr(e,n,i)];if(r){const{min:s,max:a,start:l,end:u,startProp:d,endProp:h}=h_[i],m=p_(r,{min:n[s],max:n[a],start:r[l],end:r[u]});t[d]=m.start,t[h]=m.end}}}function dI({properties:e,options:t},n,i,r){const{x:s,x2:a,width:l}=e;return b_({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 fI({properties:e,options:t},n,i,r){const{y:s,y2:a,height:l}=e;return b_({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 b_(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+hd(d,s)}function hI(e,t,n){const i=n.label;i.backgroundColor="transparent",i.callout.display=!1;const r=pd(i.position),s=Se(i.padding),a=ul(e.ctx,i),l=dI({properties:t,options:n},a,r,s),u=fI({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 _d=["enter","leave"],yd=_d.concat("click");function pI(e,t,n){t.listened=l_(n,yd,t.listeners),t.moveListened=!1,_d.forEach(i=>{on(n[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&on(i.click)&&(t.listened=!0),t.moveListened||_d.forEach(r=>{on(i[r])&&(t.listened=!0,t.moveListened=!0)})})}function mI(e,t,n){if(e.listened)switch(t.type){case"mousemove":case"mouseout":return gI(e,t,n);case"click":return _I(e,t,n)}}function gI(e,t,n){if(!e.moveListened)return;let i;t.type==="mousemove"?i=fd(e.visibleElements,t,n.interaction):i=[];const r=e.hovered;e.hovered=i;const s={state:e,event:t};let a=x_(s,"leave",r,i);return x_(s,"enter",i,r)||a}function x_({state:e,event:t},n,i,r){let s;for(const a of i)r.indexOf(a)<0&&(s=w_(a.options[n]||e.listeners[n],a,t)||s);return s}function _I(e,t,n){const i=e.listeners,r=fd(e.visibleElements,t,n.interaction);let s;for(const a of r)s=w_(a.options.click||i.click,a,t)||s;return s}function w_(e,t,n){return Jt(e,[t.$context,n])===!0}const dl=["afterDraw","beforeDraw"];function yI(e,t,n){const i=t.visibleElements;t.hooked=l_(n,dl,t.hooks),t.hooked||i.forEach(r=>{t.hooked||dl.forEach(s=>{on(r.options[s])&&(t.hooked=!0)})})}function v_(e,t,n){if(e.hooked){const i=t.options[n]||e.hooks[n];return Jt(i,[t.$context])}}function bI(e,t,n){const i=TI(e.scales,t,n);let r=S_(t,i,"min","suggestedMin");r=S_(t,i,"max","suggestedMax")||r,r&&on(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function xI(e,t){for(const n of e)vI(n,t)}function S_(e,t,n,i){if(le(t[n])&&!wI(e.options,n,i)){const r=e[n]!==t[n];return e[n]=t[n],r}}function wI(e,t,n){return sn(e[t])||sn(e[n])}function vI(e,t){for(const n of["scaleID","xScaleID","yScaleID"]){const i=Sr(t,e,n);i&&!t[i]&&SI(e,n)&&console.warn(`No scale found with id '${i}' for annotation '${e.id}'`)}}function SI(e,t){if(t==="scaleID")return!0;const n=t.charAt(0);for(const i of["Min","Max","Value"])if(sn(e[n+i]))return!0;return!1}function TI(e,t,n){const i=t.axis,r=t.id,s=i+"ScaleID",a={min:Ot(t.min,Number.NEGATIVE_INFINITY),max:Ot(t.max,Number.POSITIVE_INFINITY)};for(const l of n)l.scaleID===r?T_(l,t,["value","endValue"],a):Sr(e,l,s)===r&&T_(l,t,[i+"Min",i+"Max",i+"Value"],a);return a}function T_(e,t,n,i){for(const r of n){const s=e[r];if(sn(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 Q0({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),u_(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){return __(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 J0({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||(AI(t,this),t.save(),cl(t,this.getCenterPoint(),this.rotation),d_(t,this,n,this._fitRatio),t.restore())}resolveElementProperties(t,n){const i=kI(t,n);if(!i)return{};const{controllerMeta:r,point:s,radius:a}=DI(t,n,i);let l=ul(t.ctx,n);const u=CI(l,a);r_(n,u)&&(l={width:l.width*u,height:l.height*u});const{position:d,xAdjust:h,yAdjust:m}=n,g=i_(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 kI(e,t){return e.getSortedVisibleDatasetMetas().reduce(function(n,i){const r=i.controller;return r instanceof ro&&MI(e,t,i.data)&&(!n||r.innerRadius<n.controller.innerRadius)&&r.options.circumference>=90?i:n},void 0)}function MI(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 DI({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)},y={x:(g.left+g.right)/2,y:(g.top+g.bottom)/2},x=t.spacing+t.borderWidth/2,v=l-x,S=y.y>m,O=S?r+x:a-x,A=OI(O,h,m,v);return{controllerMeta:{_centerX:h,_centerY:m,_radius:v,_counterclockwise:S,...A},point:y,radius:Math.min(l,Math.min(g.right-g.left,g.bottom-g.top)/2)}}function CI({width:e,height:t},n){const i=Math.sqrt(Math.pow(e,2)+Math.pow(t,2));return n*2/i}function OI(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:ne};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 AI(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 J0({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=!sn(this._visible)||this._visible;!n.display||!n.content||!i||(t.save(),cl(t,this.getCenterPoint(),this.rotation),J2(t,this),u_(t,this,n),d_(t,EI(this),n),t.restore())}resolveElementProperties(t,n){let i;if(o_(n))i=m_(t,n);else{const{centerX:l,centerY:u}=gd(t,n);i={x:l,y:u}}const r=Se(n.padding),s=ul(t.ctx,n),a=i_(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 EI({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 bd=(e,t,n)=>({x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}),xd=(e,t,n)=>bd(t,n,Math.abs((e-t.y)/(n.y-t.y))).x,k_=(e,t,n)=>bd(t,n,Math.abs((e-t.x)/(n.x-t.x))).y,So=e=>e*e,RI=(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},M_=(e,t,n,i)=>(1-i)*(1-i)*e+2*(1-i)*i*t+i*i*n,wd=(e,t,n,i)=>({x:M_(e.x,t.x,n.x,i),y:M_(e.y,t.y,n.y,i)}),D_=(e,t,n,i)=>2*(1-i)*(t-e)+2*i*(n-t),C_=(e,t,n,i)=>-Math.atan2(D_(e.x,t.x,n.x,i),D_(e.y,t.y,n.y,i))+.5*Pt;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,y=u.isPointInStroke(l,m,g)||vd(this,a,r);return u.restore(),y}const d=So(s);return NI(this,a,d,r)||vd(this,a,r)}return PI(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 VI(t,this,a,u),t.restore();const{startOpts:d,endOpts:h,startAdjust:m,endAdjust:g}=P_(this),y=Math.atan2(s-i,r-n);t.translate(n,i),t.rotate(y),t.beginPath(),t.moveTo(0+m,0),t.lineTo(u-g,0),t.shadowColor=l.borderShadowColor,t.stroke(),Sd(t,0,m,d),Sd(t,u,-g,h),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){const i=aI(t,n),{x:r,y:s,x2:a,y2:l}=i,u=II(i,t.chartArea),d=u?LI({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=$I(d,n,Yr(m,g))}const h=BI(t,d,n.label);return h._visible=u,d.elements=[{type:"label",optionScope:"label",properties:h,initProperties:d.initProperties}],d}}To.id="lineAnnotation";const O_={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({},O_),fill:!1,length:12,start:Object.assign({},O_),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 PI(e,{mouseX:t,mouseY:n},i,{hitSize:r,useFinalPosition:s}){const a=RI(t,n,e.getProps(["x","y","x2","y2"],s),i);return Z0(a,r)||vd(e,{mouseX:t,mouseY:n},s,i)}function II({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 A_({x:e,y:t},n,{top:i,right:r,bottom:s,left:a}){return e<a&&(t=k_(a,{x:e,y:t},n),e=a),e>r&&(t=k_(r,{x:e,y:t},n),e=r),t<i&&(e=xd(i,{x:e,y:t},n),t=i),t>s&&(e=xd(s,{x:e,y:t},n),t=s),{x:e,y:t}}function LI(e,t,n){const{x:i,y:r}=A_(e,t,n),{x:s,y:a}=A_(t,e,n);return{x:i,y:r,x2:s,y2:a,width:Math.abs(s-i),height:Math.abs(a-r)}}function NI(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 y,x;return g<0?(y=s,x=a):g>1?(y=l,x=u):(y=s+g*d,x=a+g*h),So(t-y)+So(n-x)<=i}function vd(e,{mouseX:t,mouseY:n},i,r){const s=e.label;return s.options.display&&s.inRange(t,n,r,i)}function BI(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 zI(t,n,{width:a,height:l,padding:r},e.chartArea)}function FI(e){const{x:t,y:n,x2:i,y2:r}=e,s=Math.atan2(r-n,i-t);return s>Pt/2?s-Pt:s<Pt/-2?s+Pt:s}function zI(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"?FI(e):ve(t.rotation),g=UI(r,s,m),y=HI(e,t,{labelSize:g,padding:a},i),x=e.cp?wd(d,e.cp,h,y):bd(d,h,y),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},O=R_(x.x,v)+l,A=R_(x.y,S)+u;return{x:O-r/2,y:A-s/2,x2:O+r/2,y2:A+s/2,centerX:O,centerY:A,pointX:x.x,pointY:x.y,width:r,height:s,rotation:Da(m)}}function UI(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 HI(e,t,n,i){let r;const s=WI(e,i);return t.position==="start"?r=E_({w:e.x2-e.x,h:e.y2-e.y},n,t,s):t.position==="end"?r=1-E_({w:e.x-e.x2,h:e.y-e.y2},n,t,s):r=hd(1,t.position),r}function E_(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 WI(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 R_(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 P_(e){const t=e.options,n=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:n,endOpts:i,startAdjust:I_(e,n),endAdjust:I_(e,i)}}function I_(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(xd(0,s,{x:0,y:r}))}function Sd(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 $I(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=pd(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 L_(e,{x:t,y:n},{angle:i,adjust:r},s){!s||!s.display||(e.save(),e.translate(t,n),e.rotate(i),Sd(e,0,-r,s),e.restore())}function VI(e,t,n,i){const{x:r,y:s,x2:a,y2:l,options:u}=t,{startOpts:d,endOpts:h,startAdjust:m,endAdjust:g}=P_(t),y={x:r,y:s},x={x:a,y:l},v=C_(y,n,x,0),S=C_(y,n,x,1)-Pt,O=wd(y,n,x,m/i),A=wd(y,n,x,1-g/i),P=new Path2D;e.beginPath(),P.moveTo(O.x,O.y),P.quadraticCurveTo(n.x,n.y,A.x,A.y),e.shadowColor=u.borderShadowColor,e.stroke(P),t.path=P,t.ctx=e,L_(e,O,{angle:v,adjust:m},d),L_(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 YI({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,Pt/2,0,2*Pt),t.fill(),l&&(t.shadowColor=a.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){return __(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 YI(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),y=Math.pow(m*(e.x-a)+g*(e.y-l),2),x=Math.pow(g*(e.x-a)-m*(e.y-l),2);return y/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"?z2({x:t,y:n},this.getCenterPoint(r),d/2,h):Z0(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);j2(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=g_(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&&jI(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=g_(t,n),{sides:r,rotation:s}=n,a=[],l=2*Pt/r;let u=s*iu;for(let d=0;d<r;d++,u+=l){const h=qI(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 qI({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 jI(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=>{ae.describe(`elements.${zi[e].id}`,{_fallback:"plugins.annotation.common"})});const GI={update:Object.assign},KI=yd.concat(dl),N_=(e,t)=>Nt(t)?Md(e,t):e,Td=e=>e==="color"||e==="font";function kd(e="line"){return zi[e]?e:(console.warn(`Unknown annotation type: '${e}', defaulting to 'line'`),"line")}function XI(e,t,n,i){const r=QI(e,n.animations,i),s=t.annotations,a=eL(t.elements,s);for(let l=0;l<s.length;l++){const u=s[l],d=B_(a,l,u.type),h=u.setContext(tL(e,d,a,u)),m=d.resolveElementProperties(e,h);m.skip=ZI(m),"elements"in m&&(JI(d,m.elements,h,r),delete m.elements),sn(d.x)||Object.assign(d,m),Object.assign(d,m.initProperties),m.options=F_(h),r.update(d,m)}}function ZI(e){return isNaN(e.x)||isNaN(e.y)}function QI(e,t,n){return n==="reset"||n==="none"||n==="resize"?GI:new _u(e,t)}function JI(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=B_(r,s,a.type,a.initProperties),d=n[a.optionScope].override(a);l.options=F_(d),i.update(u,l)}}function B_(e,t,n,i){const r=zi[kd(n)];let s=e[t];return(!s||!(s instanceof r))&&(s=e[t]=new r,Object.assign(s,i)),s}function F_(e){const t=zi[kd(e.type)],n={};n.id=e.id,n.type=e.type,n.drawTime=e.drawTime,Object.assign(n,Md(e,t.defaults),Md(e,t.defaultRoutes));for(const i of KI)n[i]=e[i];return n}function Md(e,t){const n={};for(const i of Object.keys(t)){const r=t[i],s=e[i];Td(i)&&jt(s)?n[i]=s.map(a=>N_(a,r)):n[i]=N_(s,r)}return n}function tL(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 eL(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 nL="3.1.0";const Ui=new Map,z_=e=>e.type!=="doughnutLabel",iL=yd.concat(dl);var U_={id:"annotation",version:nL,beforeRegister(){U2("chart.js","4.0",an.version)},afterRegister(){an.register(zi)},afterUnregister(){an.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;Nt(s)?Object.keys(s).forEach(a=>{const l=s[a];Nt(l)&&(l.id=a,r.push(l))}):jt(s)&&r.push(...s),xI(r.filter(z_),e.scales)},afterDataLimits(e,t){const n=Ui.get(e);bI(e,t.scale,n.annotations.filter(z_).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(e,t,n){const i=Ui.get(e);pI(e,i,n),XI(e,i,n,t.mode),i.visibleElements=i.elements.filter(r=>!r.skip&&r.options.display),yI(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);mI(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 fd(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=>!iL.includes(e)&&e!=="init",annotations:{_allKeys:!1,_fallback:(e,t)=>`elements.${zi[kd(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:Td,_fallback:!0},_indexable:Td}},additionalOptionScopes:[""]};function Mo(e,t,n){const{ctx:i,chartArea:r}=e,s=Ui.get(e);n&&to(i,r);const a=rL(s.visibleElements,t).sort((l,u)=>l.element.options.z-u.element.options.z);for(const l of a)sL(i,r,s,l);n&&eo(i)}function rL(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 sL(e,t,n,i){const r=i.element;i.main?(v_(n,r,"beforeDraw"),r.draw(e,t),v_(n,r,"afterDraw")):r.draw(e,t)}const oL={class:"zoom-timerange-container"},aL={class:"zoom-timerange-details"},lL={class:"label","data-testid":"zoom-timerange-from"},cL={class:"label","data-testid":"zoom-timerange-to"},uL=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)=>{S0(()=>{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",oL,[f.createElementVNode("div",aL,[f.createElementVNode("div",lL,f.toDisplayString(f.unref(n).t("zoom_time_range.from")),1),f.createElementVNode("div",null,f.toDisplayString(i.value),1),f.createElementVNode("div",cL,f.toDisplayString(f.unref(n).t("zoom_time_range.to")),1),f.createElementVNode("div",null,f.toDisplayString(r.value),1)])]))}}),ke=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n},H_=ke(uL,[["__scopeId","data-v-4fa681cf"]]),dL={class:"zoom-actions-container"},fL={class:"zoom-actions-heading"},hL={class:"zoom-action-select"},pL=["data-testid"],mL=["aria-disabled","href"],gL=["onClick"],_L=ke(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",dL,[f.createElementVNode("div",fL,[f.createVNode(H_,{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(Fc)})`,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",hL,[(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,mL)):(f.openBlock(),f.createElementBlock("div",{key:1,onClick:u=>r(l)},f.toDisplayString(l.label),9,gL))],10,pL))),128))])]))}}),[["__scopeId","data-v-79ba72f8"]]),yL={key:2},bL={class:"tooltip-title"},xL={class:"title"},wL={key:0,class:"subtitle"},vL={class:"context"},SL={class:"metric"},TL={class:"tooltip"},kL={key:0,class:"square-marker marker-placeholder"},ML={class:"display-value"},Do=ke(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}=mP(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],([y,x])=>{l.value||(s.value=parseFloat(y),a.value=parseFloat(x))}),f.watch(l,y=>{y?document.body.classList.add("no-select"):document.body.classList.remove("no-select")}),f.watch(r,y=>{if(y){const{width:x,height:v}=y.getBoundingClientRect();n("dimensions",{width:x,height:v})}}),(y,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(H_,{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(_L,{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",yL,[f.createElementVNode("div",bL,[f.createElementVNode("div",xL,[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(Fc)})`,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",wL,[f.createElementVNode("div",vL,f.toDisplayString(h.value),1),f.createElementVNode("div",SL,f.toDisplayString(m.value),1)])):f.createCommentVNode("",!0)]),f.createElementVNode("ul",TL,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(e.state.tooltipSeries,({backgroundColor:v,borderColor:S,label:O,value:A,isSegmentEmpty:P,isExtra:L},R)=>(f.openBlock(),f.createElementBlock(f.Fragment,{key:O+R},[e.state.tooltipSeries.length?(f.openBlock(),f.createElementBlock("li",{key:0,class:f.normalizeClass({"extra-row":L})},[L?(f.openBlock(),f.createElementBlock("div",kL)):(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:P}])},f.toDisplayString(O),3),f.createElementVNode("span",ML,f.toDisplayString(A),1)],2)):f.createCommentVNode("",!0)],64))),128))])]))],6)):f.createCommentVNode("",!0)}}),[["__scopeId","data-v-fb2f2a72"]]),DL={key:0,class:"legend-container","data-testid":"legend"},CL=["onClick"],OL={key:0,"aria-hidden":"true",class:"line-marker",height:"2",width:"16"},AL=["stroke","stroke-dasharray"],EL=["title"],RL={class:"label truncate-label"},PL={key:0,class:"sub-label"},IL={key:0},LL={class:"tooltip-content"},ml=ke(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 an?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 an?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",DL,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(e.items,({fillStyle:m,strokeStyle:g,text:y,datasetIndex:x,index:v,value:S,isSegmentEmpty:O,isKey:A,lineDash:P},L)=>(f.openBlock(),f.createElementBlock("li",{key:s({datasetIndex:x,index:v,isKey:A},L),class:f.normalizeClass({"legend-key":A}),onClick:R=>A?void 0:a(x,v)},[P?.length?(f.openBlock(),f.createElementBlock("svg",OL,[f.createElementVNode("line",{stroke:g,"stroke-dasharray":P.join(" "),"stroke-width":"2",x1:"0",x2:"16",y1:"1",y2:"1"},null,8,AL)])):(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)?`${y}: ${S.formatted}`:y},[f.createElementVNode("div",RL,f.toDisplayString(y),1),S&&(f.unref(i)||A)?(f.openBlock(),f.createElementBlock("div",PL,[A?(f.openBlock(),f.createElementBlock("span",IL,"-")):f.createCommentVNode("",!0),f.createTextVNode(" "+f.toDisplayString(S.formatted),1)])):f.createCommentVNode("",!0)],10,EL)]),_:2},[O?{name:"content",fn:f.withCtx(()=>[f.createElementVNode("div",LL,f.toDisplayString(f.unref(n).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],10,CL))),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 NL(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 BL=new Uint8Array(16);function FL(){return crypto.getRandomValues(BL)}function Dd(e,t,n){return crypto.randomUUID?crypto.randomUUID():zL(e)}function zL(e,t,n){e=e||{};const i=e.random??e.rng?.()??FL();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,NL(i)}const W_=(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 $_{id="highlightPlugin";_clickedElements;_previousHoverOption;_clicked=!1;_pause=!1;_suppressNextClick=!1;afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&W_(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,W_(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 UL=(e,t,n,i,r="#0275d8")=>{e&&(e.save(),e.beginPath(),e.moveTo(t,n),e.lineTo(t,i),e.lineWidth=1,e.strokeStyle=r,e.stroke(),e.restore())};class gl{id="coordinator";coordinator=null;instanceId="";stopWatcher=void 0;activeDimension=null;activeDimensionValue=null;requiresUpdate=!1;triggerOnSelf=!1;watchTimestamp=!1;watchDimension=!1;lastMouseBrushEvent=0;constructor({coordinator:t,requiresUpdate:n=!1,triggerOnSelf:i=!1,watchTimestamp:r=!1,watchDimension:s=!1}){this.instanceId=crypto.randomUUID(),this.coordinator=t,this.requiresUpdate=n,this.triggerOnSelf=i,this.watchTimestamp=r,this.watchDimension=s}afterInit(t){if(!this.coordinator)return;const n=this.requiresUpdate?()=>t.update("none"):()=>t.draw(),i=this._watchTimestamp(n),r=this._watchDimension(n);this.stopWatcher=()=>{i&&i(),r&&r()}}afterEvent(t,{event:n}){this.coordinator&&(n.type==="mousemove"||n.type==="mouseout")&&requestAnimationFrame(i=>this._onMouseBrush(n.native,t,i))}beforeDatasetDraw(t,n){if(!this.coordinator||!this.watchDimension||this.coordinator.activeChart.value===this.instanceId&&!this.triggerOnSelf)return;t.config.type==="doughnut"?this._highlightDimensionDonut(t):this._highlightDimensionDefault(t,n)}afterDatasetsDraw(t){if(t.ctx.globalAlpha=1,!this.coordinator||!this.watchTimestamp||!this.coordinator.activeTimestamp.value||this.coordinator.activeChart.value===this.instanceId&&!this.triggerOnSelf)return;const i=t.scales.x.getPixelForValue(this.coordinator.activeTimestamp.value),r=t.ctx;UL(r,i,t.scales.y.top,t.scales.y.bottom)}beforeDestroy(){this.stopWatcher&&this.stopWatcher()}_watchTimestamp(t){if(!this.coordinator)return;let n;return this.watchTimestamp&&(n=f.watch([this.coordinator.activeChart,this.coordinator.activeTimestamp],([i])=>{(i!==this.instanceId||this.triggerOnSelf)&&t()})),n}_watchDimension(t){if(!this.coordinator)return;let n;if(this.watchDimension){let i;n=f.watch([this.coordinator.activeChart,this.coordinator.activeDimension,this.coordinator.activeDimensionValue],([r,s,a])=>{clearTimeout(i),s===null&&(this.activeDimension=null),a===null&&(this.activeDimensionValue=null),i=setTimeout(()=>{this.activeDimension=s,this.activeDimensionValue=a,(r!==this.instanceId||this.triggerOnSelf)&&t()},this.coordinator?.DIMENSION_DEBOUNCE_MS??400),f.onWatcherCleanup(()=>{clearTimeout(i)})})}return n}_onMouseBrush(t,n,i){if(!this.coordinator)return;const r=t.type,s=Math.min(this.coordinator.TIMESTAMP_DEBOUNCE_MS,this.coordinator.DIMENSION_DEBOUNCE_MS);if(!(r==="mousemove"&&i-this.lastMouseBrushEvent<s)){if(r==="mousemove"){const a=this._getTimestamp(n,t),[l,u]=this._getDatasetDimension(n,t)??[];this.coordinator.activate({chartUuid:this.instanceId,timestamp:a,dimension:l,dimensionValue:u})}else r==="mouseout"&&this.coordinator.deactivate({chartUuid:this.instanceId});this.lastMouseBrushEvent=i}}_highlightDimensionDefault(t,n){if(this.activeDimension&&this.activeDimensionValue){const i=t.data.datasets.map((r,s)=>r?.dimension===this.activeDimension&&r?.dimensionValue===this.activeDimensionValue?s:-1).filter(r=>r>=0);i.length&&(t.ctx.globalAlpha=i.includes(n.index)?1:.3)}else t.ctx.globalAlpha=1}_highlightDimensionDonut(t){if(this.activeDimension&&this.activeDimensionValue){const{dimension:n,dimensionValue:i}=t.data.datasets[0];if(n===this.activeDimension){const r=i.findIndex(s=>s===this.activeDimensionValue);r>=0?t.setActiveElements([{datasetIndex:0,index:r}]):t.setActiveElements([])}else t.setActiveElements([])}else t.setActiveElements([])}_getDatasetDimension(t,n){const i=t.config.type,r=i!=="line",s=["doughnut","scatter"].includes(i)?"point":"dataset",a=t.getElementsAtEventForMode(n,s,{intersect:r},!1),[l]=a;if(!l)return;const{datasetIndex:u,index:d}=l,{dimension:h,dimensionValue:m}=t.data.datasets[u];return i==="doughnut"?[h,m[d]]:[h,m]}_getTimestamp(t,n){const[i]=t.getElementsAtEventForMode(n,"index",{intersect:!1},!1);if(i&&this.watchTimestamp){const{datasetIndex:r,index:s}=i,{x:a}=t.data.datasets[r].data[s];return a}}}const HL=["id"],WL=["id"],$L={class:"axis-tooltip-content"},VL="100%",YL="100%",qL=20,jL=20,V_=6,GL=0,KL=10,XL=10,ZL=1,QL=ke(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 $_,l=f.inject("analytics-dashboard-coordinator",null),u=new gl({coordinator:l,triggerOnSelf:!0,watchTimestamp:!1,watchDimension:!0}),d=f.useTemplateRef("chartContainer"),h=f.useTemplateRef("chartParent"),m=({chart:X},ot)=>{const vt=X.data,lt=vt.labels?.indexOf(ot);return vt.datasets.reduce((bt,Rt,j)=>{if(X.isDatasetVisible(j)){const et=Rt.data[lt];return isNaN(et)?bt:bt+et}else return bt},0)},g=(X,ot,vt,lt)=>{const bt=lt==="horizontal";ot===null&&(ot=n.t("entityNoName"));const Rt={type:"label",yValue:rt=>bt?ot:m(rt,ot),xValue:rt=>bt?m(rt,ot):ot},j={...Rt,position:bt?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>bt?0:-Math.abs(zP()),content:rt=>M0(m(rt,ot),vt)},et={...Rt,content:rt=>HP(m(rt,ot),UP(rt.chart,X)),position:bt?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:rt=>bt?FP(M0(m(rt,ot),vt)):0,color:EP};return{[`${ot}-value`]:j,[`${ot}-percent`]:et}},y=f.useTemplateRef("canvas"),x=f.useTemplateRef("axis"),v=Dd(),S=Dd(),O=f.ref([]),A=f.inject("legendPosition",Le.Bottom),P=f.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),L=f.toRef(t,"metricUnit"),R=f.computed(()=>t.orientation==="horizontal"),F=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:R.value?"horizontal_bar":"vertical_bar",chartID:s,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:U,tooltipAbsoluteTop:D}=St.useTooltipAbsolutePosition(h,F),w=f.ref(0),C=()=>t.annotations&&t.chartData.labels?.reduce((X,ot)=>Object.assign(X,g(t.chartData,ot,L.value,t.orientation)),{}),N={id:v,afterUpdate(X){w.value+=1,O.value=Yu(X,t.legendValues,t.chartLegendSortFn)}},$={id:S,afterUpdate(X){X.options.plugins.annotation.annotations=t.annotations?C():{}}},st=[N,{id:"axisHover",afterEvent(X,ot){if(P.show=!1,ot.event.type==="mousemove"){const vt=ot.event,lt=X.options.indexAxis,bt=X.scales,Rt=X.scales[lt].getLabelForValue(Number(X.scales[lt].getValueForPixel(vt[lt]))),et=X.scales[lt].getLabels().indexOf(Rt),rt=t.chartData.isLabelEmpty?.[et];if((_t=>_t==="x"?vt.y>bt.x.top:vt.x<bt.y.right)(lt)){F.interactionMode!=="interactive"&&(F.showTooltip=!1);const $t=X.canvas.getContext("2d").measureText(Rt).width,Me=Math.abs(Math.round(vt.x-$t*.5)),Te=Math.round(vt.x+$t*.5),ee=X.canvas.getBoundingClientRect(),je=40;P.left=lt==="x"?`${(Me>0?Me:Te)-P.offset+ee.left}px`:`${vt.x-$t*.5-P.offset+ee.left}px`,P.top=`${vt.y-je+ee.top}px`,Rt.length>il?(P.show=!0,P.text=Rt):rt?(P.text=n.t("emptyEntityInfo"),P.show=!0):P.show=!1}else P.show=!1}}},a,u,...t.annotations?[$]:[]],dt=f.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),ut=f.ref(0),ct=f.ref(0),Tt=new ResizeObserver(S0(X=>{ut.value=X[0].contentRect.width,ct.value=X[0].contentRect.height},100)),at=f.computed(()=>{const X=t.chartData?.labels?.length;return y.value&&X&&!R.value?`${Math.max(X*(qL+V_),ut.value)}px`:VL}),pt=f.computed(()=>{const X=t.chartData?.labels?.length;return y.value&&X&&R.value?`${Math.max(X*(jL+V_),ct.value)}px`:YL});St.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey")),f.onMounted(()=>{t.annotations&&an.register(U_),d.value&&(ut.value=d.value.offsetWidth,ct.value=d.value.offsetHeight,Tt.observe(d.value))}),f.onUnmounted(()=>{d.value&&Tt.unobserve(d.value)});const G=f.computed(()=>{const X=St.useBarChartOptions({tooltipState:F,legendID:v,stacked:f.toRef(t,"stacked"),metricAxesTitle:f.toRef(t,"metricAxesTitle"),dimensionAxesTitle:f.toRef(t,"dimensionAxesTitle"),indexAxis:R.value?"y":"x",numLabels:dt});return{...X.value,plugins:{...X.value.plugins,annotation:{annotations:C(),clip:!1}}}}),B=St.useChartJSCommon("bar",y,f.toRef(t,"chartData"),st,G);f.onBeforeUnmount(()=>{an.unregister(U_)});const z={[Le.Bottom]:"column"},Z=f.computed(()=>{if(x.value&&B.value){const X=window.devicePixelRatio,ot=B.value,vt=ot.scales.y.width*X+ZL,lt=(ot.scales.y.height+ot.scales.y.top+ot.scales.x.height)*X,bt=x.value.getContext("2d");return bt.scale(X,X),bt.canvas.width=vt,bt.canvas.height=lt,bt.canvas.style.width=`${vt/X}px`,bt.canvas.style.height=`${lt/X}px`,{scale:X,width:vt*X,height:lt*X,targetCtx:bt}}return null}),it=X=>{const ot=X.target;if(Z.value&&B.value&&!R.value){const vt=Z.value.scale,lt=Z.value.targetCtx,bt=Z.value.width,Rt=Z.value.height,j=B.value,et=j.canvas;lt.fillStyle="white",ot.scrollLeft>=GL&&ot.scrollLeft<=KL?(lt.globalCompositeOperation="source-over",lt.clearRect(0,0,bt,Rt),lt.drawImage(et,0,0,bt,Rt,0,0,bt,Rt),lt.globalCompositeOperation="destination-over",lt.fillRect(0,0,bt,Rt)):(lt.globalCompositeOperation="source-over",lt.fillRect(0,(j.scales.y.height+j.scales.y.top+XL)*vt,bt,j.scales.x.height*vt))}F.offsetY=ot.scrollTop,F.offsetX=ot.scrollLeft,P.offset=ot.scrollLeft},ht=({width:X,height:ot})=>{F.width=X,F.height=ot};f.watch(()=>t.orientation,()=>{if(x.value&&Z.value){const X=Z.value.width,ot=Z.value.height;(x.value?.getContext("2d")).clearRect(0,0,X,ot)}F.showTooltip=!1,F.interactionMode="idle"}),f.watch(()=>t.annotations,X=>{B.value&&(X?B.value.options.plugins.annotation.annotations=C(t.chartData):delete B.value.options.plugins.annotation.annotations)});const mt=()=>{F.showTooltip&&(F.interactionMode!=="idle"?F.interactionMode="idle":F.interactionMode="interactive")};return(X,ot)=>(f.openBlock(),f.createElementBlock("div",{ref:"chartParent",class:f.normalizeClass(["chart-parent",z[f.unref(A)]])},[f.createElementVNode("canvas",{id:f.unref(r),ref:"axis",class:"axis"},null,8,HL),f.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:ot[0]||(ot[0]=vt=>mt()),onScroll:it},[f.createElementVNode("div",{class:"chart-body",style:f.normalizeStyle({width:at.value,height:pt.value})},[f.createElementVNode("canvas",{id:f.unref(s),ref:"canvas",class:"chart-canvas"},null,8,WL)],4)],544),(f.openBlock(),f.createBlock(f.Teleport,{to:"body"},[P.show?(f.openBlock(),f.createElementBlock("div",{key:0,class:"axis-tooltip",style:f.normalizeStyle({top:P.top,left:P.left}),width:"auto"},[f.createElementVNode("div",$L,f.toDisplayString(P.text),1)],4)):f.createCommentVNode("",!0),f.createVNode(Do,{"absolute-left":f.unref(U),"absolute-top":f.unref(D),"chart-parent-ref":h.value,state:F,"tooltip-title":e.tooltipTitle,onDimensions:ht},null,8,["absolute-left","absolute-top","chart-parent-ref","state","tooltip-title"])])),f.createVNode(ml,{id:f.unref(v),"chart-instance":f.unref(B),items:O.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-6994dd8d"]]);const JL={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"};Km._date.override({_id:"date-fns",formats:function(){return JL},parse:function(e,t){if(e===null||typeof e>"u")return null;const n=typeof e;return n==="number"||e instanceof Date?e=Et(e):n==="string"&&(typeof t=="string"?e=KM(e,t,new Date,this.options):e=Bp(e,this.options)),Wc(e)?e.getTime():null},format:function(e,t){return _a(e,t,this.options)},add:function(e,t,n){switch(n){case"millisecond":return Uc(e,t);case"second":return VT(e,t);case"minute":return WT(e,t);case"hour":return zT(e,t);case"day":return ma(e,t);case"week":return YT(e,t);case"month":return zc(e,t);case"quarter":return $T(e,t);case"year":return qT(e,t);default:return e}},diff:function(e,t,n){switch(n){case"millisecond":return $c(e,t);case"second":return tk(e,t);case"minute":return ZT(e,t);case"hour":return XT(e,t);case"day":return mp(e,t);case"week":return ek(e,t);case"month":return bp(e,t);case"quarter":return JT(e,t);case"year":return nk(e,t);default:return 0}},startOf:function(e,t,n){switch(t){case"second":return JM(e);case"minute":return QM(e);case"hour":return ZM(e);case"day":return Hc(e);case"week":return Vn(e);case"isoWeek":return Vn(e,{weekStartsOn:+n});case"month":return rk(e);case"quarter":return ik(e);case"year":return xp(e);default:return e}},endOf:function(e,t){switch(t){case"second":return uk(e);case"minute":return lk(e);case"hour":return ok(e);case"day":return _p(e);case"week":return ak(e);case"month":return yp(e);case"quarter":return ck(e);case"year":return sk(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}},tN={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...Y_,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},eN=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 nN(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;return f.isProxy(t)?new Proxy(e,{}):e}function iN(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function q_(e,t){e.labels=t}function j_(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 rN(e,t){const n={labels:[],datasets:[]};return q_(n,e.labels),j_(n,e.datasets,t),n}const sN=f.defineComponent({props:tN,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:y}=e,x=rN(h,y),v=nN(x,h);s.value=new an(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,[y,x]=h;const v=f.toRaw(s.value);if(!v)return;let S=!1;if(m){const O=as(m),A=as(y);O&&O!==A&&(iN(v,O),S=!0)}if(g){const O=as(g.labels),A=as(x.labels),P=as(g.datasets),L=as(x.datasets);O!==A&&(q_(v.config.data,O),S=!0),P&&P!==L&&(j_(v.config.data,P,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 _l(e,t){return an.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(sN,eN({ref:l},{type:e,...n}))}})}const G_=_l("bar",Ym),K_=_l("doughnut",ro),X_=_l("line",qm),oN=_l("scatter",Gm),aN={class:"chart-container"},lN={key:0,class:"chart-center-metric"},cN={class:"chart-center-total"},uN={key:0,class:"chart-center-unit"},dN=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.inject(zu,null),d=new gl({coordinator:u,requiresUpdate:!0,triggerOnSelf:!1,watchTimestamp:!1,watchDimension:!0}),h=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:m,tooltipAbsoluteTop:g}=St.useTooltipAbsolutePosition(l,h),y={id:r,afterUpdate(w){a.value=w.options.plugins.legend.labels.generateLabels(w).map(C=>({...C,value:t.legendValues&&t.legendValues[C.text],hidden:!1}))}},x=f.computed(()=>[d,y]),v=f.computed(()=>[t.chartData.datasets.reduce((C,N)=>(C.dimension=N.dimension,C.dimensionValue.push(N.dimensionValue),C.labels.push(N.label),C.backgroundColor.push(N.backgroundColor),C.hoverBorderColor.push(Aa(N.backgroundColor).saturate(.5).darken(.15).hexString()),C.data.push(N.data.reduce(($,V)=>$+V,0)),C),{dimension:"",dimensionValue:[],labels:[],backgroundColor:[],borderColor:"#ffffff",borderWidth:1,hoverBorderColor:[],hoverBorderWidth:1,data:[],hoverOffset:10})]),{formatUnit:S}=$n({i18n:i}),O=f.computed(()=>T2(t.metricName??"")),A=f.computed(()=>{const w=v.value[0]?.data.reduce((C,N)=>C+N,0)??0;return S(w,t.metricUnit,{approximate:!0,translateUnit:(C,N)=>n(C,N)}).trim()}),P=f.computed(()=>t.tooltipMetricDisplay||""),L=f.computed(()=>({...t.chartData,datasets:v.value}));St.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey"));const{options:R}=St.useDonutChartOptions({tooltipState:h,legendID:r}),F=f.ref(),U=w=>({[Le.Bottom]:"column",[Le.Hidden]:"hidden"})[w],D=({width:w,height:C})=>{h.width=w,h.height=C};return(w,C)=>(f.openBlock(),f.createElementBlock("div",{ref:"chartParent",class:f.normalizeClass(["chart-parent",U(e.legendPosition)]),"data-testid":"donut-chart-parent"},[f.createElementVNode("div",aN,[f.createVNode(f.unref(K_),{ref_key:"chartInstance",ref:F,"chart-id":f.unref(s),data:L.value,options:f.unref(R),plugins:x.value},null,8,["chart-id","data","options","plugins"]),e.showCenterMetric&&O.value?(f.openBlock(),f.createElementBlock("div",lN,[f.createElementVNode("span",cN,f.toDisplayString(A.value),1),P.value?(f.openBlock(),f.createElementBlock("span",uN,f.toDisplayString(P.value),1)):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0),(f.openBlock(),f.createBlock(f.Teleport,{to:"body"},[f.createVNode(Do,{"absolute-left":f.unref(m),"absolute-top":f.unref(g),state:h,"tooltip-title":e.tooltipTitle,unit:e.metricUnit,onDimensions:D},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),f.createVNode(ml,{id:f.unref(r),"chart-instance":F.value,items:a.value,position:e.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),fN=ke(dN,[["__scopeId","data-v-db23aff8"]]);class hN{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 pN=1.5;class mN{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=pN;for(const{value:m,color:g,borderDash:y}of r){if(!Number.isFinite(m))continue;const x=s.getPixelForValue(m);x<a||x>l||(h.beginPath(),h.setLineDash(y),h.strokeStyle=g,h.moveTo(u,x),h.lineTo(d,x),h.stroke())}h.restore()}}const gN={class:"chart-container"},_N=ke(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:()=>ud()}},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 hN,u=new mN,d=crypto.randomUUID(),h=crypto.randomUUID(),m=f.inject(zu,null),g=new gl({coordinator:m,requiresUpdate:!0,triggerOnSelf:!0,watchTimestamp:!1,watchDimension:!0}),y=f.ref(),x=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:v,tooltipAbsoluteTop:S}=St.useTooltipAbsolutePosition(a,x);St.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey"));const O=f.computed(()=>t.chartData?.outlier),A=f.computed(()=>t.chartData?.referenceLines??[]),P=f.ref([]),L={id:d,afterUpdate($){P.value=Yu($,void 0,t.chartLegendSortFn)}},R=f.computed(()=>{const $=[];O.value&&$.push({text:O.value.label,fillStyle:O.value.color,strokeStyle:O.value.color,isKey:!0});for(const V of A.value)$.push({text:V.label,fillStyle:V.color,strokeStyle:V.color,lineDash:V.borderDash,isKey:!0,value:{raw:V.value,formatted:r(V.value,t.metricUnit,{translateUnit:s})}});return $}),F=f.computed(()=>[...P.value,...R.value]),U=f.computed(()=>t.shadeOutlierRegion?O.value?.value:void 0),D=f.computed(()=>[g,L,...U.value!==void 0?[l]:[],...A.value.length?[u]:[]]),w=f.computed(()=>`scatter-${D.value.map($=>$.id).join("-")}`),{options:C}=St.useScatterChartOptions({tooltipState:x,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:U,referenceLines:A,themeColors:f.toRef(t,"themeColors")}),N=$=>({[Le.Bottom]:"column",[Le.Hidden]:"hidden"})[$];return($,V)=>(f.openBlock(),f.createElementBlock("div",{ref:"chartParent",class:f.normalizeClass(["chart-parent",N(f.unref(n))]),"data-testid":"scatter-chart-parent"},[f.createElementVNode("div",gN,[(f.openBlock(),f.createBlock(f.unref(oN),{key:w.value,ref_key:"chartInstance",ref:y,"chart-id":f.unref(h),class:"chart-canvas",data:e.chartData,"data-testid":"scatter-chart",options:f.unref(C),plugins:D.value},null,8,["chart-id","data","options","plugins"]))]),f.createVNode(Do,{"absolute-left":f.unref(v),"absolute-top":f.unref(S),"data-testid":"tooltip",granularity:e.granularity,state:x,"tooltip-title":e.tooltipTitle},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title"]),f.createVNode(ml,{id:f.unref(d),"chart-instance":y.value,"data-testid":"legend",items:F.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-a001076d"]]),Cd=(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()},tn={},yN=()=>{tn.x=void 0,tn.chart=void 0,tn.strategy=void 0,tn.group=void 0},bN=10;class Z_{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<bN)return;const r=()=>{tn.chart=n,tn.strategy=this._brushStrategy,tn.group=this._brushGroup;for(const s of Object.values(an.instances))s!==n&&s.update("none")};t==="mousemove"?n.tooltip&&n.tooltip.getActiveElements()&&n.tooltip.getActiveElements().length&&(tn.x=n.tooltip.dataPoints[0].element.x,r()):t==="mouseout"&&(tn.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;Cd(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;Cd(i,r,t.scales.y.top,t.scales.y.bottom)}}drawByBrush(t){if(tn.x===void 0)return;const n=tn.chart===t?"#0275d8":"rgba(2, 117, 216, 0.3)";this._brushStrategy==="group"&&tn.group===this._brushGroup&&Cd(t.ctx,tn.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&&tn.chart===t){const n=tn.x!==void 0;if(yN(),n)for(const i of Object.values(an.instances))i!==t&&i.update("none")}}}const xN=(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()},wN=(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()},Q_=(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)}},J_=(e,t,n)=>{t.canvas.dispatchEvent(new CustomEvent(e,{detail:n}))};class vN{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=Q_(t,this);d&&J_("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=Q_(t,this);d?J_("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)&&(wN(t,this._startX,this._endX),xN(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const SN=20,TN="rgba(255, 171, 171, 0.4)",kN="rgba(255, 196, 0, 0.2)",ty=(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)},ey=e=>"yAxisID"in e&&e.yAxisID||rl,ny=(e,t)=>{const n=e.data.datasets.find(i=>i.rawMetric===t);return n?ey(n):rl},MN=(e,t,n=rl)=>{const i=[];return e.data.datasets.forEach(r=>{if(!e.getDatasetMeta(e.data.datasets.indexOf(r)).visible||ey(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=ty(a[h-1],a[h],l.value):u[h-1].aboveThreshold&&!u[h].aboveThreshold&&d!==void 0&&(i.push({start:d,end:ty(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},DN=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 CN{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[ny(t,d)]??t.scales.y).getValueForPixel(l-u.top);if(m){const g=this._thresholds?.[d];g&&g.forEach(y=>{y.hovered=Math.abs(y.value-m)<SN})}}}};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=ny(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=Ku(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=Ku(h.type),i.font=_S,i.fillText(g,t.chartArea.left,m-4),i.restore())});const u=MN(t,s,a);DN(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"?TN:kN,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=Ku(h.type),i.stroke(),i.restore()})}}}beforeDestroy(t){this._mouseMoveHandler&&t.canvas.removeEventListener("mousemove",this._mouseMoveHandler)}}const ON=ke(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 Z_,a=new $_,l=new vN,u=new CN(r),{translateUnit:d}=St.useTranslatedUnits(),h=f.ref(),m=crypto.randomUUID(),g=crypto.randomUUID(),y=f.ref([]),x=f.inject("legendPosition",Le.Bottom),v=f.useTemplateRef("chartParent"),S=f.ref(void 0),O=f.ref(!1),A=f.inject(zu,null),P=new gl({coordinator:A,triggerOnSelf:!0,watchTimestamp:!0,watchDimension:!0}),L=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:R,tooltipAbsoluteTop:F}=St.useTooltipAbsolutePosition(v,L),U={id:m,afterUpdate(z){y.value=Yu(z,n.legendValues,n.chartLegendSortFn)}},D=f.computed(()=>[P,U,a,...n.brush?[l]:[],...n.type==="timeseries_line"?[s]:[],...n.threshold?[u]:[]]),w=f.computed(()=>`line-${D.value.map(z=>z.id).join("-")}`),C=f.computed(()=>`bar-${D.value.map(z=>z.id).join("-")}`),N=f.computed(()=>n.chartData&&CP(n.chartData)),{options:$}=St.useLineChartOptions({tooltipState:L,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:N,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 V=z=>z?z.end.getTime()>z.start.getTime():!1,st=z=>({[Le.Bottom]:"column",[Le.Hidden]:"hidden"})[z],dt=({width:z,height:Z})=>{L.width=z,L.height=Z},ut=(z=!0)=>{L.interactionMode="idle",L.showTooltip=!1,l.clearSelectionArea(),a.isPaused&&a.resume(z),s.isPaused&&s.resume()},ct=()=>{L.interactionMode="interactive"},Tt=()=>{!h.value||!h.value.chart.tooltip?.dataPoints?.length||(L.interactionMode==="interactive"?s.clickedSegment=h.value.chart.tooltip.dataPoints[0]:s.destroyClickedSegment())},at=()=>{if(O.value){O.value=!1;return}L.interactionMode!=="idle"?ut():ct(),Tt()};f.watch(()=>n.type,()=>{L.interactionMode="idle",L.showTooltip=!1,s.destroyClickedSegment()});const pt=z=>{z.preventDefault(),z.stopPropagation();const{xStart:Z,xEnd:it}=z.detail,ht={start:new Date(Z),end:new Date(it),type:"absolute"};if(!V(ht)){S.value=void 0,ut(!1);return}S.value=ht,L.interactionMode="zoom-interactive",ht&&i("select-chart-range",ht)},G=z=>{L.interactionMode="selecting-chart-area",O.value=!0,s.pause(),a.pause();const{xStart:Z,xEnd:it}=z.detail;S.value={start:new Date(Z),end:new Date(it),type:"absolute"}},B=z=>{if(!v.value||L.interactionMode==="idle")return;const Z=z.target;Z&&v.value.contains(Z)||O.value||ut(!1)};return f.watch(()=>h.value?.chart,()=>{h.value?.chart&&(h.value.chart.canvas.removeEventListener("dragSelect",pt),h.value.chart.canvas.removeEventListener("dragSelectMove",G),h.value.chart.canvas.addEventListener("dragSelect",pt),h.value.chart.canvas.addEventListener("dragSelectMove",G))}),f.onMounted(()=>{document.addEventListener("click",B,!0)}),f.onUnmounted(()=>{h.value?.chart&&(h.value.chart.canvas.removeEventListener("dragSelect",pt),h.value.chart.canvas.removeEventListener("dragSelectMove",G)),document.removeEventListener("click",B,!0)}),(z,Z)=>(f.openBlock(),f.createElementBlock("div",{ref:"chartParent",class:f.normalizeClass(["chart-parent",st(f.unref(x))]),"data-testid":"line-chart-parent"},[f.createElementVNode("div",{class:"chart-container",onClick:Z[0]||(Z[0]=it=>at())},[e.type==="timeseries_line"?(f.openBlock(),f.createBlock(f.unref(X_),{key:w.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($),plugins:D.value},null,8,["chart-id","data","options","plugins"])):e.type==="timeseries_bar"?(f.openBlock(),f.createBlock(f.unref(G_),{key:C.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($),plugins:D.value},null,8,["chart-id","data","options","plugins"])):f.createCommentVNode("",!0)]),f.createVNode(Do,{"absolute-left":f.unref(R),"absolute-top":f.unref(F),"data-testid":"tooltip",granularity:e.granularity,state:L,"tooltip-title":e.tooltipTitle,"zoom-action-items":e.zoomActionItems,"zoom-time-range":S.value,onDimensions:dt,onOnAction:Z[1]||(Z[1]=()=>ut(!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:y.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-344d87c4"]]),AN={key:0,class:"chart-truncation-warning","data-testid":"truncation-warning"},EN={class:"tooltip-content"},RN={key:2,class:"analytics-chart-parent"},PN=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(()=>dd(i.chartData)?void 0:i.chartData),a=f.computed(()=>{const j=i.chartOptions.metricAxisMap,et=s.value?.meta?.metric_names??[];if(!(i.chartOptions.type!=="timeseries_line"||!j||!et.some(rt=>j[rt]==="right")))return j}),l=f.computed(()=>!!a.value),u=(j,et)=>a.value?j.filter(rt=>(a.value?.[rt]??"left")===et):j,d=f.computed(()=>{const j=s.value?.meta,et=j?.metric_names??[];return["timeseries_line","timeseries_bar"].includes(i.chartOptions.type)&&!l.value&&et.length>1&&Object.keys(j?.display??{}).length>0?et:[]}),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 j=s.value;return!j||!h.value||!m.value?j:{...j,meta:{...j.meta,metric_names:[m.value]}}}),y=f.computed(()=>{const j=i.chartOptions.threshold;return!h.value||!j?j:{...j,...Object.fromEntries(Object.keys(j).filter(et=>et!==m.value).map(et=>[et,[]]))}}),x=f.computed(()=>{if(ut.value)return dd(i.chartData)?i.chartData:q0(i.chartData)}),v=f.inject("app:konnectColorMode",f.computed(()=>"light")),S=f.useTemplateRef("chartShell"),O=f.computed(()=>(v.value,ud(S.value))),A=f.computed(()=>{if(x.value){const{start:et,end:rt,metric:Gt,metricUnit:_t,truncated:$t,limit:Me,datasource:Te}=x.value;return{start:et,end:rt,metricNames:[Gt],metricUnits:{[Gt]:_t??""},truncated:$t,limit:Me,datasource:Te}}const j=g.value?.meta;return{start:j?.start,end:j?.end,metricNames:j?.metric_names,metricUnits:j?.metric_units,truncated:j?.truncated,limit:j?.limit,datasource:j?.datasource}}),P=f.computed(()=>ut.value?St.useScatterDatasets({colorPalette:i.chartOptions.chartDatasetColors,scatter:i.chartOptions.scatter,themeColors:O},x).value:s.value?st.value?St.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Zu,metricAxisMap:a.value},g).value:St.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Zu},s).value:{datasets:[]}),L=f.computed(()=>i.timeseriesZoom||!!i.exploreLink||!!i.requestsLink),R=f.computed(()=>{if(!i.chartData||s.value&&!s.value.meta)return 0;const{start:j,end:et}=A.value;if(j&&et)return new Date(et).getTime()-new Date(j).getTime()}),F=f.computed(()=>A.value.metricUnits?h.value&&m.value?A.value.metricUnits[m.value]??"":Object.values(A.value.metricUnits)[0]??"":""),U=f.computed(()=>A.value.metricUnits?h.value&&m.value?m.value:Object.keys(A.value.metricUnits)[0]??"":""),D=f.computed(()=>i.showLegendValues&&i.legendPosition!==Le.Hidden),{legendValues:w}=St.useChartLegendValues(P,i.chartOptions.type,F),C=f.computed(()=>A.value.limit?.toString()||null),N=f.computed(()=>i.chartOptions.hideTruncationWarning?!1:A.value.truncated||!1),$=f.computed(()=>r.t("limitedResultsShown",{maxReturned:C.value})),V=f.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),st=f.computed(()=>["timeseries_bar","timeseries_line"].some(j=>j===i.chartOptions.type)),dt=f.computed(()=>i.chartOptions.type==="donut"),ut=f.computed(()=>i.chartOptions.type==="scatter"),ct=f.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),Tt=f.computed(()=>{const{metricNames:j,metricUnits:et}=A.value;if(l.value||!j||!et)return;const rt=j[0],Gt=et[rt]||"";if(j.length>1){if(rt.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${Gt}`,{plural:"s"})});if(rt.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${Gt}`,{plural:"s"})})}if(rt)return xo(Gt)&&r.te(`metricAxisTitles.${rt}`)?r.t(`metricAxisTitles.${rt}`)||void 0:r.te(`chartLabels.${rt}`)?r.t(`chartLabels.${rt}`):rt}),at=f.computed(()=>{const j=i.chartOptions.yAxes?.left?.title??i.chartOptions?.metricAxesTitle;if(j)return j;const{metricNames:et,metricUnits:rt}=A.value;if(!(!et||!rt))return G(u(et,"left"),rt)}),pt=f.computed(()=>{if(!l.value)return;const{metricNames:j,metricUnits:et}=A.value,rt=j&&et?G(u(j,"right"),et):void 0;return{title:i.chartOptions.yAxes?.right?.title??rt,showGrid:i.chartOptions.yAxes?.right?.showGrid}}),G=(j,et)=>{const rt=j[0];if(!rt)return;const Gt=et[rt]||"";if(j.length>1){if(rt.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${Gt}`,{plural:"s"})});if(rt.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${Gt}`,{plural:"s"})})}return B(rt,Gt)},B=(j,et)=>{if(r.te(`metricAxisTitles.${j}`)){if(xo(et))return r.t(`metricAxisTitles.${j}`)||void 0;const rt=r.te(`chartUnits.${et}`)?r.t(`chartUnits.${et}`,{plural:"s"}):et;return r.t(`metricAxisTitles.${j}`,{unit:rt})||void 0}return j||void 0},z=f.computed(()=>{if(i.chartOptions?.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const j=s.value?.meta,et=st.value?"Time":Object.keys(j?.display||j?.metric_names||{})[0];if(et)return r.te(`chartLabels.${et}`)?r.t(`chartLabels.${et}`):et}),Z=f.computed(()=>{if(Cx(A.value.datasource))return r.t("timestampAxisTitles.platform");const j=ca(s.value?.meta?.granularity_ms);if(j)return r.te(`granularityAxisTitles.${j}`)?r.t(`granularityAxisTitles.${j}`):j}),it=f.computed(()=>{const j=x.value?.xMetric;return j?B(j,x.value?.xMetricUnit??""):Z.value}),ht=f.computed(()=>i.emptyStateTitle||r.t("noDataAvailableTitle")),mt=f.computed(()=>i.emptyStateDescription||r.t("noDataAvailableDescription")),X=f.computed(()=>ut.value?!!x.value?.points.length:st.value?OP(P.value):!!(s.value&&s.value.meta&&s.value.data.length)),ot=f.computed(()=>{const j=s.value;return j?j.meta.granularity_ms?ca(j.meta.granularity_ms)||"hourly":ca(new Date(j.data[1].timestamp).getTime()-new Date(j.data[0].timestamp).getTime())||"hourly":"hourly"}),vt=f.computed(()=>ca(s.value?.meta?.granularity_ms)||"secondly"),lt=f.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(j,et)=>j.text===r.t("chartLabels.____OTHER____")?1:et.text===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(j.text,10))&&!isNaN(parseInt(et.text,10))?j.text<et.text?-1:1:j.value&&et.value?et.value.raw-j.value.raw:0),bt=f.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(j,et)=>j.label===r.t("chartLabels.____OTHER____")?1:et.label===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(j.label,10))&&!isNaN(parseInt(et.label,10))?j.label<et.label?-1:1:j.value&&et.value?et.rawValue-j.rawValue:0),Rt=f.computed(()=>[...i.timeseriesZoom?[{label:r.t("zoom_action_items.zoom"),key:"zoom-in",action:j=>n("zoom-time-range",j)}]:[],...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",D),f.provide("legendPosition",f.toRef(i,"legendPosition")),(j,et)=>{const rt=f.resolveComponent("KTooltip"),Gt=f.resolveComponent("KEmptyState");return f.openBlock(),f.createElementBlock("div",{ref:"chartShell",class:f.normalizeClass(["analytics-chart-shell",{"show-values":D.value}])},[X.value&&N.value&&C.value?(f.openBlock(),f.createElementBlock("div",AN,[f.createVNode(rt,{class:"tooltip","max-width":"500",placement:"right"},{content:f.withCtx(()=>[f.createElementVNode("div",EN,f.toDisplayString($.value),1)]),default:f.withCtx(()=>[f.createVNode(f.unref(fe.WarningIcon),{color:`var(--kui-color-text-warning, ${f.unref(mS)})`,size:`var(--kui-icon-size-40, ${f.unref(yS)})`},null,8,["color","size"])]),_:1})])):f.createCommentVNode("",!0),X.value?(f.openBlock(),f.createElementBlock("div",RN,[st.value?(f.openBlock(),f.createBlock(ON,{key:0,brush:L.value,"chart-data":P.value,"chart-legend-sort-fn":lt.value,"chart-tooltip-sort-fn":bt.value,"dimension-axes-title":Z.value,fill:e.chartOptions.stacked,granularity:ot.value,"left-y-axis-grid":e.chartOptions.yAxes?.left?.showGrid,"legend-values":f.unref(w),"metric-axes-title":at.value,"metric-unit":F.value,"right-y-axis":pt.value,stacked:e.chartOptions.stacked,"synthetics-data-key":e.syntheticsDataKey,threshold:y.value,"time-range-ms":R.value,"tooltip-metric-display":Tt.value,"tooltip-title":e.tooltipTitle,type:e.chartOptions.type,"zoom-action-items":Rt.value,onSelectChartRange:et[0]||(et[0]=_t=>n("select-chart-range",_t)),onZoomTimeRange:et[1]||(et[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"])):V.value?(f.openBlock(),f.createBlock(QL,{key:1,annotations:e.showAnnotations,"chart-data":P.value,"chart-legend-sort-fn":lt.value,"chart-tooltip-sort-fn":bt.value,"data-testid":"bar-chart-container","dimension-axes-title":z.value,"legend-values":f.unref(w),"metric-axes-title":at.value,"metric-unit":F.value,orientation:ct.value,stacked:e.chartOptions.stacked,"synthetics-data-key":e.syntheticsDataKey,"tooltip-metric-display":Tt.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"])):dt.value?(f.openBlock(),f.createBlock(fN,{key:2,"chart-data":P.value,"dataset-colors":e.chartOptions.chartDatasetColors||f.unref(Zu),"legend-position":e.legendPosition,"legend-values":f.unref(w),"metric-name":U.value,"metric-unit":F.value,"show-center-metric":e.chartOptions.showCenterMetric,"synthetics-data-key":e.syntheticsDataKey,"tooltip-dimension-display":z.value,"tooltip-metric-display":Tt.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"])):ut.value?(f.openBlock(),f.createBlock(_N,{key:3,"chart-data":P.value,"chart-legend-sort-fn":e.chartOptions.chartLegendSortFn,"chart-tooltip-sort-fn":bt.value,"data-testid":"scatter-chart-container","dimension-axes-title":it.value,granularity:vt.value,"metric-axes-title":at.value,"metric-unit":F.value,"shade-outlier-region":e.chartOptions.scatter?.shadeOutlierRegion,"synthetics-data-key":e.syntheticsDataKey,"theme-colors":O.value,"time-range-ms":R.value,"tooltip-metric-display":Tt.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(Gt,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(ht.value),1)]),default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(mt.value),1)]),_:1}))],2)}}}),IN=ke(PN,[["__scopeId","data-v-c5c250ba"]]),LN={class:"chart-parent","data-testid":"gauge-chart-parent"},NN={class:"chart-totals-flex"},BN={key:1,class:"metric-small","data-testid":"gauge-chart-total"},FN=ke(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(Dd()),r=f.computed(()=>[t.chartData.datasets.reduce((y,x)=>(y.labels.push(x.label),y.borderColor.push(x.backgroundColor),y.backgroundColor.push(x.backgroundColor),y.data.push(x.data.reduce((v,S)=>v+S,0)),y),{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,y)=>(f.openBlock(),f.createElementBlock("div",LN,[f.createElementVNode("div",NN,[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",BN,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(K_),{"chart-id":i.value,data:s.value,options:a},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-c461b83f"]]),zN={key:1,class:"single-value-wrapper"},UN={class:"single-value-metric"},HN={class:"name-unit-alignment"},WN={class:"single-value","data-testid":"single-value-chart"},$N={key:0,class:"single-value-unit"},VN={class:"single-value-metric-name"},YN={key:0,class:"single-value-trend"},qN={key:0,class:"single-value-trend-range","data-testid":"single-value-trend-range"},Od="t1",Ad="t2",jN=ke(f.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:p0},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:Od,secondLevelKey:Ad})),l=f.computed(()=>a.value?.previous?.[Od]?.[Ad]),u=f.computed(()=>a.value?.current?.[Od]?.[Ad]),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 C=h.value?r.data.meta?.metric_units?.[h.value]:void 0;if(C){const N=`chartUnits.${C}`;return t.te(N)?t.t(N,{plural:""}):""}}),y=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 C=d.value[0].event[h.value];return typeof C!="number"||isNaN(C)?null:C}),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),O=f.computed(()=>{const C=v.value;if(C===null)return"-";const N=h.value?r.data.meta?.metric_units?.[h.value]:void 0;if(N==="usd")return i(C);if(N==="bytes")return n(C);if(C>=1e9){const V=(C/1e9).toFixed(1);return V.endsWith(".0")?`${Math.floor(C/1e9)}B`:`${V}B`}if(C>=1e7){const V=(C/1e6).toFixed(1);return V.endsWith(".0")?`${Math.floor(C/1e6)}M`:`${V}M`}const $=r.decimalPoints&&typeof r.decimalPoints=="number"?r.decimalPoints:p0;return C.toLocaleString("en-US",{maximumFractionDigits:$})}),A=f.computed(()=>r.showTrend&&r.data?.data?.length<2),P=f.computed(()=>er.calculateChange(v.value??0,x.value??0)||0),L=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(P.value,!0,r.increaseIsBad)}),R=f.computed(()=>er.defineIcon(L.value,r.increaseIsBad)),F=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(P.value,r.data?.data?.length===2,t.t("singleValue.trend.not_available"))}),U=er.useTrendRange(f.computed(()=>r.showTrend),void 0,f.computed(()=>r.data.meta)),D=C=>C>0?"positive":C<0?"negative":"neutral",w=C=>C>0?pS:C<0?hS:up;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)}),(C,N)=>{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",zN,[f.createElementVNode("div",UN,[f.createElementVNode("div",HN,[f.createElementVNode("span",WN,f.toDisplayString(O.value),1),y.value&&g.value?(f.openBlock(),f.createElementBlock("span",$N,"  "+f.toDisplayString(g.value),1)):f.createCommentVNode("",!0)]),f.createElementVNode("div",VN,f.toDisplayString(m.value),1)]),e.showTrend?(f.openBlock(),f.createElementBlock("div",YN,[f.createElementVNode("div",{class:f.normalizeClass(["trend-change",D(L.value)]),"data-testid":"single-value-trend"},[A.value||L.value!==0?(f.openBlock(),f.createBlock(f.resolveDynamicComponent(R.value),{key:0,color:w(L.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(up)})`,size:`var(--kui-icon-size-30, ${f.unref(rr)})`},null,8,["color","size"])),f.createElementVNode("div",null,f.toDisplayString(F.value),1)],2),f.unref(U)?(f.openBlock(),f.createElementBlock("div",qN,f.toDisplayString(f.unref(U)),1)):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0)]))],2)}}}),[["__scopeId","data-v-640d8a8c"]]),GN={class:"simple-chart-shell"},KN={key:1,class:"analytics-chart-parent"},XN=ke(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",GN,[u.value?(f.openBlock(),f.createElementBlock("div",KN,[s.value?(f.openBlock(),f.createBlock(FN,{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(jN,{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"]]),ZN={class:"container"},QN={key:0,class:"no-data","data-testid":"sparkline-empty"},JN=["title"],tB=ke(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:U,height:D})=>{h.width=U,h.height=D},g=f.computed(()=>e.disableTooltip?[]:[new Z_({enableBrushing:e.groupKey!==void 0&&e.chartKey!==void 0&&e.enableBrushing,brushStrategy:"group",brushGroup:e.groupKey})]),y=f.computed(()=>d.value.reduce((U,{data:D,label:w})=>({...U,[w]:D.reduce((C,{y:N})=>C+N,0)}),{})),x=f.computed(()=>d.value.map(({label:U})=>[y.value[U],`${U}: ${y.value[U]}`]).sort(([U],[D])=>D-U).map(([,U])=>U).join(", ")),v=f.computed(()=>Object.keys(y.value).map(U=>y.value[U]).reduce((U,D)=>U+D,0)),S=f.computed(()=>v.value>0),O=f.computed(()=>({labels:new Array(u.value).fill(""),datasets:d.value})),A=f.computed(()=>e.datasets.length>1),P=`SparklineTooltipPosition-${t}`,L=f.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:P,external:C=>{Vu(h,C,"minutely",{contextFormatter:N=>{const $=N+i.value;let V="";return i.value>1440*60*1e3?V=_a(new Date($),"MMM dd, yyy hh:mm a"):V=_a(new Date($),"hh:mm a"),`${bv(N)} - ${V}`}})}}},scales:{x:{min:D,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}}}}),R=f.ref("0"),F=f.ref("0");return f.onMounted(()=>{qe.positioners[P]=function(U,D){if(!U.length||h.interactionMode==="interactive"||D.x===null)return!1;const w=10,C=this.chart.canvas.getBoundingClientRect(),N=h.width||this.width,$=h.height||this.height,V=C.top-$>0,st=V?C.top-$-w:C.top+C.height+w,dt=C.left>N/2-D.x,ut=Math.max(w,window.innerWidth-w-N),ct=Math.min(ut,dt?Math.floor(C.left-N/2)+D.x:0+w);return R.value=`${st}px`,F.value=`${ct}px`,{x:ct,y:st,xAlign:"center",yAlign:V?"top":"bottom"}}}),f.onUnmounted(()=>{qe.positioners[P]&&delete qe.positioners[P]}),(U,D)=>(f.openBlock(),f.createElementBlock("div",ZN,[S.value?e.type==="sparkline_bar"?(f.openBlock(),f.createBlock(f.unref(G_),{key:1,"chart-id":f.unref(t),data:O.value,"data-testid":"sparkline-bar",options:L.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(X_),{key:2,"chart-id":f.unref(t),data:O.value,"data-testid":e.type==="sparkline_line"?"sparkline-line":"sparkline-step",options:L.value,plugins:g.value},null,8,["chart-id","data","data-testid","options","plugins"])):f.createCommentVNode("",!0):(f.openBlock(),f.createElementBlock("div",QN,[f.renderSlot(U.$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":F.value,"absolute-top":R.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:U.$slots.label?"":x.value},[f.renderSlot(U.$slots,"label",{total:v.value,totalByDataset:y.value},()=>[f.createTextVNode(f.toDisplayString(x.value),1)],!0)],8,JN)):f.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-ae8259b6"]]),eB=["data-value"],nB=["title"],iB={class:"top-talkers-cell-metric"},rB={class:"top-talkers-cell-value","data-testid":"top-talkers-cell-value"},sB={key:0,class:"top-talkers-cell-relative","data-testid":"top-talkers-cell-relative"},oB={class:"top-talkers-tooltip","data-testid":"top-talkers-tooltip"},aB={class:"top-talkers-tooltip-title"},lB={class:"top-talkers-tooltip-rows"},cB={class:"top-talkers-tooltip-label"},uB=["data-threshold"],dB=ke(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",oB,[f.createElementVNode("div",aB,f.toDisplayString(e.cell.name),1),f.createElementVNode("dl",lB,[(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",cB,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,uB)],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,nB),f.createElementVNode("span",iB,[f.createElementVNode("span",rB,f.toDisplayString(e.cell.display),1),e.cell.relative?(f.openBlock(),f.createElementBlock("span",sB,"("+f.toDisplayString(e.cell.relative)+")",1)):f.createCommentVNode("",!0)])],10,eB)]),_:1},8,["disabled","style"]))}}),[["__scopeId","data-v-73764587"]]),fB=["data-dimension"],hB={class:"top-talkers-column-header"},pB={class:"top-talkers-column-label","data-testid":"top-talkers-column-label"},mB={key:0,class:"top-talkers-column-total","data-testid":"top-talkers-column-total"},gB={key:1,class:"top-talkers-column-empty","data-testid":"top-talkers-column-empty"},_B={key:2,class:"top-talkers-column-cells"},iy=ke(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",hB,[f.createElementVNode("span",pB,f.toDisplayString(i.value),1),!e.isLoading&&f.unref(n).cells.length?(f.openBlock(),f.createElementBlock("span",mB,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",_B,[(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",gB,f.toDisplayString(f.unref(t).t("topTalkers.defaultEmptyStateTitle")),1))],8,fB))}}),[["__scopeId","data-v-e1b08041"]]),yB={class:"top-talkers-card-title","data-testid":"top-talkers-card-title"},bB={key:2,class:"top-talkers-grid","data-testid":"top-talkers-grid"},xB=ke(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",bB,[(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(iy,{"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",yB,f.toDisplayString(e.title),1)]),key:"0"}:void 0]),1032,["title-tag"]))}}),[["__scopeId","data-v-d5bb8abd"]]),wB={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}},vB=(e,t)=>{if(!(!e||!t))return wB[e]?.[t.toLowerCase()]},SB=["data-threshold"],TB=ke(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,SB))}}),[["__scopeId","data-v-24eb60ef"]]),kB=["data-threshold"],MB={class:"top-n-metric-cell-value"},DB={key:0,class:"top-n-metric-cell-relative","data-testid":"top-n-metric-cell-relative"},CB=ke(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",MB,f.toDisplayString(e.display),1),e.relative?(f.openBlock(),f.createElementBlock("span",DB,"("+f.toDisplayString(e.relative)+")",1)):f.createCommentVNode("",!0)],10,kB))}}),[["__scopeId","data-v-17e7f860"]]),OB={class:"top-n-card-title","data-testid":"top-n-card-title"},AB={class:"top-n-card-description","data-testid":"top-n-card-description"},EB={key:3,class:"top-n-table","data-testid":"top-n-table"},RB={"data-testid":"top-n-table-header"},PB={class:"top-n-table-header-row"},IB=["colspan"],LB={class:"table-header-label"},NB=["data-testid"],BB={class:"top-n-table-cell-label"},FB={key:0,class:"top-n-table-cell top-n-table-cell-bar"},zB=3,UB=ke(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,zB):[]),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]),y=f.computed(()=>g.value?pt(g.value):""),x=f.computed(()=>{const B=a.value.map(z=>({key:z,columnKey:z,label:ct(z,u.value?pt(z):n.t("topNTable.nameLabel")),type:"dimension"}));return g.value&&B.push({key:"value",columnKey:g.value,label:ct(g.value,y.value),type:"metric"}),m.value.forEach((z,Z)=>{Z!==0&&B.push({key:z,columnKey:z,label:ct(z,pt(z)),type:"metric"})}),B}),v=f.computed(()=>x.value.filter(B=>B.type==="metric")),S=f.computed(()=>x.value.filter(B=>B.type==="dimension").slice(1)),O=B=>B.type==="dimension"&&B.key===d.value,A=B=>B.type==="metric"&&!!gr(t.columnOptions,B.columnKey)?.bar,P=B=>u.value&&B.type==="dimension"&&!O(B),L=B=>{const z=B.event;return String(z[l.value])},R=(B,z)=>{const Z=String(B.event[z]),it=t.data.meta?.display?.[z]?.[Z];return{dimension:z,id:Z,name:it?.name||"-",deleted:!!it?.deleted}},F=B=>{const z=L(B),Z=h.value&&h.value[z];return Z?Z.name:"-"},U=B=>{const z=L(B),Z=h.value&&h.value[z];return Z?!!Z.deleted:!1},D=B=>{const z=Z=>i(Z,"%",{translateUnit:it=>G(it,Z)});return B>0&&B<.01?`< ${z(.01)}`:z(B)},w=(B,z)=>{const Z=B.event[z];if(Z==null)return"–";const it=typeof Z=="number"?Z:Number(Z);if(Number.isNaN(it))return"–";const ht=t.data.meta?.metric_units?.[z]||"count";if(ht==="%")return D(it);const mt=["count","count/minute","token count"].includes(ht);return i(it,ht,{approximate:mt,isBytes1024:!0,translateUnit:X=>G(X,it)})},C=f.computed(()=>Object.fromEntries(m.value.map(B=>[B,Hu(r.value.map(z=>Jr(z.event[B])))]))),N=(B,z)=>{const Z=gr(t.columnOptions,z),it=Jr(B.event[z]);if(!Z||it===null)return{display:w(B,z)};const ht=C.value[z],mt=Z.value==="relative"?Wu(it,ht):null;return{display:w(B,z),relative:mt===null?void 0:D(mt*100),barRatio:Z.bar?b0(it,ht,Z.bar):void 0,threshold:$u(it,Z.thresholds)}},$=f.computed(()=>r.value?.length?r.value.map(B=>{const z=a.value.map(mt=>R(B,mt)),Z=z[0],it=Z?.id||L(B),ht={id:it,rowKey:z.map(mt=>`${mt.dimension}:${mt.id}`).join("|")||it,name:Z?.name||F(B),deleted:U(B),dimensions:z,metrics:{},original:B};return m.value.forEach((mt,X)=>{ht.metrics[X===0?"value":mt]=N(B,mt)}),ht}):[]),V=f.computed(()=>{if(!s.value)return"";if(t.data.meta){if(a.value.some(B=>!Object.keys(t.data.meta.display[B]||{}).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=(B,z)=>B.metrics[z]??{display:"–"},dt=(B,z)=>B.dimensions.find(Z=>Z.dimension===z)?.id||"",ut=(B,z)=>vB(gr(t.columnOptions,B)?.icon_set,z),ct=(B,z)=>B&&gr(t.columnOptions,B)?.label||z,Tt=(B,z)=>B.dimensions.find(Z=>Z.dimension===z)?.name||"–",at=(B,z)=>{const Z=B.dimensions.find(it=>it.dimension===z);return{id:Z?.id||"",name:Z?.name||"–",deleted:Z?.deleted||!1,dimension:z,dimensions:B.dimensions,isEmpty:Z?.id==="empty"}},pt=B=>n.te(`chartLabels.${B}`)?n.t(`chartLabels.${B}`):B,G=(B,z)=>{if(xo(B)||B==="count"||B==="requests")return"";const Z=z===1?"":"s";return n.te(`chartUnits.${B}`)?n.t(`chartUnits.${B}`,{plural:Z}):B};return(B,z)=>{const Z=f.resolveComponent("KEmptyState"),it=f.resolveComponent("KSkeleton"),ht=f.resolveComponent("KCard");return f.openBlock(),f.createBlock(ht,{class:"kong-ui-public-top-n-table","title-tag":e.titleTag},f.createSlots({default:f.withCtx(()=>[V.value?(f.openBlock(),f.createBlock(Z,{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(V.value),1)]),_:1})):e.isLoading?(f.openBlock(),f.createBlock(it,{key:1,"table-columns":2,type:"table"})):s.value?(f.openBlock(),f.createElementBlock("div",EB,[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",PB,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(x.value,mt=>(f.openBlock(),f.createElementBlock("th",{key:mt.key,class:f.normalizeClass(["top-n-table-header-cell",{"top-n-table-header-cell-metric":mt.type==="metric","top-n-table-header-cell-dimension-compact":P(mt)}]),colspan:A(mt)?2:void 0,"data-testid":"top-n-table-header-column"},[f.createElementVNode("span",LB,f.toDisplayString(mt.label),1),z[0]||(z[0]=f.createElementVNode("div",{class:"top-n-table-header-cell-border"},null,-1))],10,IB))),128))])]),f.createElementVNode("tbody",null,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList($.value,mt=>(f.openBlock(),f.createElementBlock("tr",{key:mt.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-${mt.id}`},[ut(l.value,mt.id)?(f.openBlock(),f.createBlock(f.resolveDynamicComponent(ut(l.value,mt.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(B.$slots,"name",{record:{id:mt.id,name:mt.name,deleted:mt.deleted,dimension:l.value,dimensions:mt.dimensions,isEmpty:mt.id==="empty"}},()=>[f.createTextVNode(f.toDisplayString(mt.name),1)],!0)],8,NB)],2)):f.createCommentVNode("",!0),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(S.value,X=>(f.openBlock(),f.createElementBlock("td",{key:X.key,class:f.normalizeClass(["top-n-table-cell top-n-table-cell--dimension",{"top-n-table-cell-dimension-compact":!O(X)}])},[f.createElementVNode("span",BB,[ut(X.key,dt(mt,X.key))?(f.openBlock(),f.createBlock(f.resolveDynamicComponent(ut(X.key,dt(mt,X.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(B.$slots,"name",{record:at(mt,X.key)},()=>[f.createTextVNode(f.toDisplayString(Tt(mt,X.key)),1)],!0)])],2))),128)),(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(v.value,X=>(f.openBlock(),f.createElementBlock(f.Fragment,{key:X.key},[f.createElementVNode("td",{class:f.normalizeClass(["top-n-table-cell top-n-table-cell-metric",{"top-n-table-cell-metric--has-bar":A(X)}])},[f.createVNode(CB,{"data-testid":X.key==="value"?`row-${mt.id}`:`row-${mt.id}-${X.key}`,display:st(mt,X.key).display,"has-bar":A(X),relative:st(mt,X.key).relative,threshold:st(mt,X.key).threshold},null,8,["data-testid","display","has-bar","relative","threshold"])],2),A(X)?(f.openBlock(),f.createElementBlock("td",FB,[f.createVNode(TB,{ratio:st(mt,X.key).barRatio??0,threshold:st(mt,X.key).threshold},null,8,["ratio","threshold"])])):f.createCommentVNode("",!0)],64))),128))]))),128))])],2)])):(f.openBlock(),f.createBlock(Z,{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",OB,f.toDisplayString(e.title),1)]),key:"0"}:void 0,e.description?{name:"actions",fn:f.withCtx(()=>[f.createElementVNode("div",AB,f.toDisplayString(e.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-9111e441"]]);var Hi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Co={exports:{}};var HB=Co.exports,ry;function WB(){return ry||(ry=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,y=2,x=4,v=1,S=2,O=1,A=2,P=4,L=8,R=16,F=32,U=64,D=128,w=256,C=512,N=30,$="...",V=800,st=16,dt=1,ut=2,ct=3,Tt=1/0,at=9007199254740991,pt=17976931348623157e292,G=NaN,B=4294967295,z=B-1,Z=B>>>1,it=[["ary",D],["bind",O],["bindKey",A],["curry",L],["curryRight",R],["flip",C],["partial",F],["partialRight",U],["rearg",w]],ht="[object Arguments]",mt="[object Array]",X="[object AsyncFunction]",ot="[object Boolean]",vt="[object Date]",lt="[object DOMException]",bt="[object Error]",Rt="[object Function]",j="[object GeneratorFunction]",et="[object Map]",rt="[object Number]",Gt="[object Null]",_t="[object Object]",$t="[object Promise]",Me="[object Proxy]",Te="[object RegExp]",ee="[object Set]",je="[object String]",Yt="[object Symbol]",Be="[object Undefined]",se="[object WeakMap]",De="[object WeakSet]",Pe="[object ArrayBuffer]",gn="[object DataView]",Wi="[object Float32Array]",Cn="[object Float64Array]",Ge="[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,xl=/[&<>"']/g,Ed=RegExp($i.source),Rd=RegExp(xl.source),Pd=/<%-([\s\S]+?)%>/g,Id=/<%([\s\S]+?)%>/g,Io=/<%=([\s\S]+?)%>/g,wl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,hi=/^\w*$/,Ld=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Lo=/[\\^$.*+?()[\]{}|]/g,Nd=RegExp(Lo.source),No=/^\s+/,Bd=/\s/,Nn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Fd=/\{\n\/\* \[wrapped with (.+)\] \*/,zd=/,? & /,Ud=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,vl=/[()=,{}\[\]\/\s]/,Hd=/\\(\\)?/g,Vi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Sl=/\w*$/,Wd=/^[-+]0x[0-9a-f]+$/i,$d=/^0b[01]+$/i,Vd=/^\[object .+?Constructor\]$/,Yd=/^0o[0-7]+$/i,Yi=/^(?:0|[1-9]\d*)$/,qd=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ls=/($^)/,jd=/['\n\r\u2028\u2029\\]/g,cs="\\ud800-\\udfff",Gd="\\u0300-\\u036f",Kd="\\ufe20-\\ufe2f",Tl="\\u20d0-\\u20ff",kr=Gd+Kd+Tl,kl="\\u2700-\\u27bf",us="a-z\\xdf-\\xf6\\xf8-\\xff",Xd="\\xac\\xb1\\xd7\\xf7",Zd="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Qd="\\u2000-\\u206f",Jd=" \\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",Ml="A-Z\\xc0-\\xd6\\xd8-\\xde",Dl="\\ufe0e\\ufe0f",ds=Xd+Zd+Qd+Jd,Bo="['’]",tf="["+cs+"]",Cl="["+ds+"]",fs="["+kr+"]",Ol="\\d+",ef="["+kl+"]",Al="["+us+"]",Fo="[^"+cs+ds+Ol+kl+us+Ml+"]",zo="\\ud83c[\\udffb-\\udfff]",nf="(?:"+fs+"|"+zo+")",Mr="[^"+cs+"]",Zn="(?:\\ud83c[\\udde6-\\uddff]){2}",hs="[\\ud800-\\udbff][\\udc00-\\udfff]",un="["+Ml+"]",El="\\u200d",Rl="(?:"+Al+"|"+Fo+")",rf="(?:"+un+"|"+Fo+")",Pl="(?:"+Bo+"(?:d|ll|m|re|s|t|ve))?",Il="(?:"+Bo+"(?:D|LL|M|RE|S|T|VE))?",Ll=nf+"?",Uo="["+Dl+"]?",pi="(?:"+El+"(?:"+[Mr,Zn,hs].join("|")+")"+Uo+Ll+")*",sf="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Nl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Bl=Uo+Ll+pi,Ho="(?:"+[ef,Zn,hs].join("|")+")"+Bl,Fl="(?:"+[Mr+fs+"?",fs,Zn,hs,tf].join("|")+")",of=RegExp(Bo,"g"),af=RegExp(fs,"g"),ps=RegExp(zo+"(?="+zo+")|"+Fl+Bl,"g"),lf=RegExp([un+"?"+Al+"+"+Pl+"(?="+[Cl,un,"$"].join("|")+")",rf+"+"+Il+"(?="+[Cl,un+Rl,"$"].join("|")+")",un+"?"+Rl+"+"+Pl,un+"+"+Il,Nl,sf,Ol,Ho].join("|"),"g"),ms=RegExp("["+El+cs+kr+Dl+"]"),cf=/[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"],uf=-1,ie={};ie[Wi]=ie[Cn]=ie[Ge]=ie[Ln]=ie[di]=ie[Oo]=ie[Ao]=ie[Tr]=ie[fi]=!0,ie[ht]=ie[mt]=ie[Pe]=ie[ot]=ie[gn]=ie[vt]=ie[bt]=ie[Rt]=ie[et]=ie[rt]=ie[_t]=ie[Te]=ie[ee]=ie[je]=ie[se]=!1;var M={};M[ht]=M[mt]=M[Pe]=M[gn]=M[ot]=M[vt]=M[Wi]=M[Cn]=M[Ge]=M[Ln]=M[di]=M[et]=M[rt]=M[_t]=M[Te]=M[ee]=M[je]=M[Yt]=M[Oo]=M[Ao]=M[Tr]=M[fi]=!0,M[bt]=M[Rt]=M[se]=!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"},tt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},xt={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Ce={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ke=parseFloat,Bn=parseInt,Fe=typeof Hi=="object"&&Hi&&Hi.Object===Object&&Hi,zl=typeof self=="object"&&self&&self.Object===Object&&self,ue=Fe||zl||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 H=Qn&&Qn.require&&Qn.require("util").types;return H||Dr&&Dr.binding&&Dr.binding("util")}catch{}})(),cy=ze&&ze.isArrayBuffer,uy=ze&&ze.isDate,dy=ze&&ze.isMap,fy=ze&&ze.isRegExp,hy=ze&&ze.isSet,py=ze&&ze.isTypedArray;function _n(H,K,q){switch(q.length){case 0:return H.call(K);case 1:return H.call(K,q[0]);case 2:return H.call(K,q[0],q[1]);case 3:return H.call(K,q[0],q[1],q[2])}return H.apply(K,q)}function nF(H,K,q,gt){for(var At=-1,qt=H==null?0:H.length;++At<qt;){var Oe=H[At];K(gt,Oe,q(Oe),H)}return gt}function yn(H,K){for(var q=-1,gt=H==null?0:H.length;++q<gt&&K(H[q],q,H)!==!1;);return H}function iF(H,K){for(var q=H==null?0:H.length;q--&&K(H[q],q,H)!==!1;);return H}function my(H,K){for(var q=-1,gt=H==null?0:H.length;++q<gt;)if(!K(H[q],q,H))return!1;return!0}function qi(H,K){for(var q=-1,gt=H==null?0:H.length,At=0,qt=[];++q<gt;){var Oe=H[q];K(Oe,q,H)&&(qt[At++]=Oe)}return qt}function Ul(H,K){var q=H==null?0:H.length;return!!q&&_s(H,K,0)>-1}function df(H,K,q){for(var gt=-1,At=H==null?0:H.length;++gt<At;)if(q(K,H[gt]))return!0;return!1}function de(H,K){for(var q=-1,gt=H==null?0:H.length,At=Array(gt);++q<gt;)At[q]=K(H[q],q,H);return At}function ji(H,K){for(var q=-1,gt=K.length,At=H.length;++q<gt;)H[At+q]=K[q];return H}function ff(H,K,q,gt){var At=-1,qt=H==null?0:H.length;for(gt&&qt&&(q=H[++At]);++At<qt;)q=K(q,H[At],At,H);return q}function rF(H,K,q,gt){var At=H==null?0:H.length;for(gt&&At&&(q=H[--At]);At--;)q=K(q,H[At],At,H);return q}function hf(H,K){for(var q=-1,gt=H==null?0:H.length;++q<gt;)if(K(H[q],q,H))return!0;return!1}var sF=pf("length");function oF(H){return H.split("")}function aF(H){return H.match(Ud)||[]}function gy(H,K,q){var gt;return q(H,function(At,qt,Oe){if(K(At,qt,Oe))return gt=qt,!1}),gt}function Hl(H,K,q,gt){for(var At=H.length,qt=q+(gt?1:-1);gt?qt--:++qt<At;)if(K(H[qt],qt,H))return qt;return-1}function _s(H,K,q){return K===K?bF(H,K,q):Hl(H,_y,q)}function lF(H,K,q,gt){for(var At=q-1,qt=H.length;++At<qt;)if(gt(H[At],K))return At;return-1}function _y(H){return H!==H}function yy(H,K){var q=H==null?0:H.length;return q?gf(H,K)/q:G}function pf(H){return function(K){return K==null?n:K[H]}}function mf(H){return function(K){return H==null?n:H[K]}}function by(H,K,q,gt,At){return At(H,function(qt,Oe,re){q=gt?(gt=!1,qt):K(q,qt,Oe,re)}),q}function cF(H,K){var q=H.length;for(H.sort(K);q--;)H[q]=H[q].value;return H}function gf(H,K){for(var q,gt=-1,At=H.length;++gt<At;){var qt=K(H[gt]);qt!==n&&(q=q===n?qt:q+qt)}return q}function _f(H,K){for(var q=-1,gt=Array(H);++q<H;)gt[q]=K(q);return gt}function uF(H,K){return de(K,function(q){return[q,H[q]]})}function xy(H){return H&&H.slice(0,Ty(H)+1).replace(No,"")}function bn(H){return function(K){return H(K)}}function yf(H,K){return de(K,function(q){return H[q]})}function Vo(H,K){return H.has(K)}function wy(H,K){for(var q=-1,gt=H.length;++q<gt&&_s(K,H[q],0)>-1;);return q}function vy(H,K){for(var q=H.length;q--&&_s(K,H[q],0)>-1;);return q}function dF(H,K){for(var q=H.length,gt=0;q--;)H[q]===K&&++gt;return gt}var fF=mf(Y),hF=mf(tt);function pF(H){return"\\"+Ce[H]}function mF(H,K){return H==null?n:H[K]}function ys(H){return ms.test(H)}function gF(H){return cf.test(H)}function _F(H){for(var K,q=[];!(K=H.next()).done;)q.push(K.value);return q}function bf(H){var K=-1,q=Array(H.size);return H.forEach(function(gt,At){q[++K]=[At,gt]}),q}function Sy(H,K){return function(q){return H(K(q))}}function Gi(H,K){for(var q=-1,gt=H.length,At=0,qt=[];++q<gt;){var Oe=H[q];(Oe===K||Oe===m)&&(H[q]=m,qt[At++]=q)}return qt}function Wl(H){var K=-1,q=Array(H.size);return H.forEach(function(gt){q[++K]=gt}),q}function yF(H){var K=-1,q=Array(H.size);return H.forEach(function(gt){q[++K]=[gt,gt]}),q}function bF(H,K,q){for(var gt=q-1,At=H.length;++gt<At;)if(H[gt]===K)return gt;return-1}function xF(H,K,q){for(var gt=q+1;gt--;)if(H[gt]===K)return gt;return gt}function bs(H){return ys(H)?vF(H):sF(H)}function Fn(H){return ys(H)?SF(H):oF(H)}function Ty(H){for(var K=H.length;K--&&Bd.test(H.charAt(K)););return K}var wF=mf(xt);function vF(H){for(var K=ps.lastIndex=0;ps.test(H);)++K;return K}function SF(H){return H.match(ps)||[]}function TF(H){return H.match(lf)||[]}var kF=(function H(K){K=K==null?ue:xs.defaults(ue.Object(),K,xs.pick(ue,Wo));var q=K.Array,gt=K.Date,At=K.Error,qt=K.Function,Oe=K.Math,re=K.Object,xf=K.RegExp,MF=K.String,On=K.TypeError,$l=q.prototype,DF=qt.prototype,ws=re.prototype,Vl=K["__core-js_shared__"],Yl=DF.toString,Kt=ws.hasOwnProperty,CF=0,ky=(function(){var o=/[^.]+$/.exec(Vl&&Vl.keys&&Vl.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),ql=ws.toString,OF=Yl.call(re),AF=ue._,EF=xf("^"+Yl.call(Kt).replace(Lo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),jl=$o?K.Buffer:n,Ki=K.Symbol,Gl=K.Uint8Array,My=jl?jl.allocUnsafe:n,Kl=Sy(re.getPrototypeOf,re),Dy=re.create,Cy=ws.propertyIsEnumerable,Xl=$l.splice,Oy=Ki?Ki.isConcatSpreadable:n,Yo=Ki?Ki.iterator:n,Cr=Ki?Ki.toStringTag:n,Zl=(function(){try{var o=Pr(re,"defineProperty");return o({},"",{}),o}catch{}})(),RF=K.clearTimeout!==ue.clearTimeout&&K.clearTimeout,PF=gt&&gt.now!==ue.Date.now&&gt.now,IF=K.setTimeout!==ue.setTimeout&&K.setTimeout,Ql=Oe.ceil,Jl=Oe.floor,wf=re.getOwnPropertySymbols,LF=jl?jl.isBuffer:n,Ay=K.isFinite,NF=$l.join,BF=Sy(re.keys,re),Ae=Oe.max,Xe=Oe.min,FF=gt.now,zF=K.parseInt,Ey=Oe.random,UF=$l.reverse,vf=Pr(K,"DataView"),qo=Pr(K,"Map"),Sf=Pr(K,"Promise"),vs=Pr(K,"Set"),jo=Pr(K,"WeakMap"),Go=Pr(re,"create"),tc=jo&&new jo,Ss={},HF=Ir(vf),WF=Ir(qo),$F=Ir(Sf),VF=Ir(vs),YF=Ir(jo),ec=Ki?Ki.prototype:n,Ko=ec?ec.valueOf:n,Ry=ec?ec.toString:n;function T(o){if(_e(o)&&!It(o)&&!(o instanceof Ht)){if(o instanceof An)return o;if(Kt.call(o,"__wrapped__"))return Pb(o)}return new An(o)}var Ts=(function(){function o(){}return function(c){if(!pe(c))return{};if(Dy)return Dy(c);o.prototype=c;var p=new o;return o.prototype=n,p}})();function nc(){}function An(o,c){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=n}T.templateSettings={escape:Pd,evaluate:Id,interpolate:Io,variable:"",imports:{_:T}},T.prototype=nc.prototype,T.prototype.constructor=T,An.prototype=Ts(nc.prototype),An.prototype.constructor=An;function Ht(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=B,this.__views__=[]}function qF(){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 jF(){if(this.__filtered__){var o=new Ht(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function GF(){var o=this.__wrapped__.value(),c=this.__dir__,p=It(o),_=c<0,b=p?o.length:0,k=oU(0,b,this.__views__),E=k.start,I=k.end,W=I-E,Q=_?I:E-1,J=this.__iteratees__,nt=J.length,ft=0,wt=Xe(W,this.__takeCount__);if(!p||!_&&b==W&&wt==W)return nb(o,this.__actions__);var Ct=[];t:for(;W--&&ft<wt;){Q+=c;for(var Ft=-1,Mt=o[Q];++Ft<nt;){var Ut=J[Ft],Wt=Ut.iteratee,vn=Ut.type,rn=Wt(Mt);if(vn==ut)Mt=rn;else if(!rn){if(vn==dt)continue t;break t}}Ct[ft++]=Mt}return Ct}Ht.prototype=Ts(nc.prototype),Ht.prototype.constructor=Ht;function Or(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var _=o[c];this.set(_[0],_[1])}}function KF(){this.__data__=Go?Go(null):{},this.size=0}function XF(o){var c=this.has(o)&&delete this.__data__[o];return this.size-=c?1:0,c}function ZF(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 QF(o){var c=this.__data__;return Go?c[o]!==n:Kt.call(c,o)}function JF(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=KF,Or.prototype.delete=XF,Or.prototype.get=ZF,Or.prototype.has=QF,Or.prototype.set=JF;function mi(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var _=o[c];this.set(_[0],_[1])}}function tz(){this.__data__=[],this.size=0}function ez(o){var c=this.__data__,p=ic(c,o);if(p<0)return!1;var _=c.length-1;return p==_?c.pop():Xl.call(c,p,1),--this.size,!0}function nz(o){var c=this.__data__,p=ic(c,o);return p<0?n:c[p][1]}function iz(o){return ic(this.__data__,o)>-1}function rz(o,c){var p=this.__data__,_=ic(p,o);return _<0?(++this.size,p.push([o,c])):p[_][1]=c,this}mi.prototype.clear=tz,mi.prototype.delete=ez,mi.prototype.get=nz,mi.prototype.has=iz,mi.prototype.set=rz;function gi(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var _=o[c];this.set(_[0],_[1])}}function sz(){this.size=0,this.__data__={hash:new Or,map:new(qo||mi),string:new Or}}function oz(o){var c=mc(this,o).delete(o);return this.size-=c?1:0,c}function az(o){return mc(this,o).get(o)}function lz(o){return mc(this,o).has(o)}function cz(o,c){var p=mc(this,o),_=p.size;return p.set(o,c),this.size+=p.size==_?0:1,this}gi.prototype.clear=sz,gi.prototype.delete=oz,gi.prototype.get=az,gi.prototype.has=lz,gi.prototype.set=cz;function Ar(o){var c=-1,p=o==null?0:o.length;for(this.__data__=new gi;++c<p;)this.add(o[c])}function uz(o){return this.__data__.set(o,d),this}function dz(o){return this.__data__.has(o)}Ar.prototype.add=Ar.prototype.push=uz,Ar.prototype.has=dz;function zn(o){var c=this.__data__=new mi(o);this.size=c.size}function fz(){this.__data__=new mi,this.size=0}function hz(o){var c=this.__data__,p=c.delete(o);return this.size=c.size,p}function pz(o){return this.__data__.get(o)}function mz(o){return this.__data__.has(o)}function gz(o,c){var p=this.__data__;if(p instanceof mi){var _=p.__data__;if(!qo||_.length<r-1)return _.push([o,c]),this.size=++p.size,this;p=this.__data__=new gi(_)}return p.set(o,c),this.size=p.size,this}zn.prototype.clear=fz,zn.prototype.delete=hz,zn.prototype.get=pz,zn.prototype.has=mz,zn.prototype.set=gz;function Py(o,c){var p=It(o),_=!p&&Lr(o),b=!p&&!_&&tr(o),k=!p&&!_&&!b&&Cs(o),E=p||_||b||k,I=E?_f(o.length,MF):[],W=I.length;for(var Q in o)(c||Kt.call(o,Q))&&!(E&&(Q=="length"||b&&(Q=="offset"||Q=="parent")||k&&(Q=="buffer"||Q=="byteLength"||Q=="byteOffset")||bi(Q,W)))&&I.push(Q);return I}function Iy(o){var c=o.length;return c?o[If(0,c-1)]:n}function _z(o,c){return gc(dn(o),Er(c,0,o.length))}function yz(o){return gc(dn(o))}function Tf(o,c,p){(p!==n&&!Hn(o[c],p)||p===n&&!(c in o))&&Jn(o,c,p)}function Xo(o,c,p){var _=o[c];(!(Kt.call(o,c)&&Hn(_,p))||p===n&&!(c in o))&&Jn(o,c,p)}function ic(o,c){for(var p=o.length;p--;)if(Hn(o[p][0],c))return p;return-1}function bz(o,c,p,_){return Xi(o,function(b,k,E){c(_,b,p(b),E)}),_}function Ly(o,c){return o&&ei(c,Ie(c),o)}function xz(o,c){return o&&ei(c,hn(c),o)}function Jn(o,c,p){c=="__proto__"&&Zl?Zl(o,c,{configurable:!0,enumerable:!0,value:p,writable:!0}):o[c]=p}function kf(o,c){for(var p=-1,_=c.length,b=q(_),k=o==null;++p<_;)b[p]=k?n:oh(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,_,b,k){var E,I=c&g,W=c&y,Q=c&x;if(p&&(E=b?p(o,_,b,k):p(o)),E!==n)return E;if(!pe(o))return o;var J=It(o);if(J){if(E=lU(o),!I)return dn(o,E)}else{var nt=Ze(o),ft=nt==Rt||nt==j;if(tr(o))return sb(o,I);if(nt==_t||nt==ht||ft&&!b){if(E=W||ft?{}:Tb(o),!I)return W?Zz(o,xz(E,o)):Xz(o,Ly(E,o))}else{if(!M[nt])return b?o:{};E=cU(o,nt,I)}}k||(k=new zn);var wt=k.get(o);if(wt)return wt;k.set(o,E),Jb(o)?o.forEach(function(Mt){E.add(En(Mt,c,p,Mt,o,k))}):Zb(o)&&o.forEach(function(Mt,Ut){E.set(Ut,En(Mt,c,p,Ut,o,k))});var Ct=Q?W?Yf:Vf:W?hn:Ie,Ft=J?n:Ct(o);return yn(Ft||o,function(Mt,Ut){Ft&&(Ut=Mt,Mt=o[Ut]),Xo(E,Ut,En(Mt,c,p,Ut,o,k))}),E}function wz(o){var c=Ie(o);return function(p){return Ny(p,o,c)}}function Ny(o,c,p){var _=p.length;if(o==null)return!_;for(o=re(o);_--;){var b=p[_],k=c[b],E=o[b];if(E===n&&!(b in o)||!k(E))return!1}return!0}function By(o,c,p){if(typeof o!="function")throw new On(a);return ia(function(){o.apply(n,p)},c)}function Zo(o,c,p,_){var b=-1,k=Ul,E=!0,I=o.length,W=[],Q=c.length;if(!I)return W;p&&(c=de(c,bn(p))),_?(k=df,E=!1):c.length>=r&&(k=Vo,E=!1,c=new Ar(c));t:for(;++b<I;){var J=o[b],nt=p==null?J:p(J);if(J=_||J!==0?J:0,E&&nt===nt){for(var ft=Q;ft--;)if(c[ft]===nt)continue t;W.push(J)}else k(c,nt,_)||W.push(J)}return W}var Xi=ub(ti),Fy=ub(Df,!0);function vz(o,c){var p=!0;return Xi(o,function(_,b,k){return p=!!c(_,b,k),p}),p}function rc(o,c,p){for(var _=-1,b=o.length;++_<b;){var k=o[_],E=c(k);if(E!=null&&(I===n?E===E&&!wn(E):p(E,I)))var I=E,W=k}return W}function Sz(o,c,p,_){var b=o.length;for(p=Bt(p),p<0&&(p=-p>b?0:b+p),_=_===n||_>b?b:Bt(_),_<0&&(_+=b),_=p>_?0:ex(_);p<_;)o[p++]=c;return o}function zy(o,c){var p=[];return Xi(o,function(_,b,k){c(_,b,k)&&p.push(_)}),p}function Ue(o,c,p,_,b){var k=-1,E=o.length;for(p||(p=dU),b||(b=[]);++k<E;){var I=o[k];c>0&&p(I)?c>1?Ue(I,c-1,p,_,b):ji(b,I):_||(b[b.length]=I)}return b}var Mf=db(),Uy=db(!0);function ti(o,c){return o&&Mf(o,c,Ie)}function Df(o,c){return o&&Uy(o,c,Ie)}function sc(o,c){return qi(c,function(p){return xi(o[p])})}function Rr(o,c){c=Qi(c,o);for(var p=0,_=c.length;o!=null&&p<_;)o=o[Un(c[p++])];return p&&p==_?o:n}function Hy(o,c,p){var _=c(o);return It(o)?_:ji(_,p(o))}function en(o){return o==null?o===n?Be:Gt:Cr&&Cr in re(o)?sU(o):yU(o)}function Cf(o,c){return o>c}function Tz(o,c){return o!=null&&Kt.call(o,c)}function kz(o,c){return o!=null&&c in re(o)}function Mz(o,c,p){return o>=Xe(c,p)&&o<Ae(c,p)}function Of(o,c,p){for(var _=p?df:Ul,b=o[0].length,k=o.length,E=k,I=q(k),W=1/0,Q=[];E--;){var J=o[E];E&&c&&(J=de(J,bn(c))),W=Xe(J.length,W),I[E]=!p&&(c||b>=120&&J.length>=120)?new Ar(E&&J):n}J=o[0];var nt=-1,ft=I[0];t:for(;++nt<b&&Q.length<W;){var wt=J[nt],Ct=c?c(wt):wt;if(wt=p||wt!==0?wt:0,!(ft?Vo(ft,Ct):_(Q,Ct,p))){for(E=k;--E;){var Ft=I[E];if(!(Ft?Vo(Ft,Ct):_(o[E],Ct,p)))continue t}ft&&ft.push(Ct),Q.push(wt)}}return Q}function Dz(o,c,p,_){return ti(o,function(b,k,E){c(_,p(b),k,E)}),_}function Qo(o,c,p){c=Qi(c,o),o=Cb(o,c);var _=o==null?o:o[Un(Pn(c))];return _==null?n:_n(_,o,p)}function Wy(o){return _e(o)&&en(o)==ht}function Cz(o){return _e(o)&&en(o)==Pe}function Oz(o){return _e(o)&&en(o)==vt}function Jo(o,c,p,_,b){return o===c?!0:o==null||c==null||!_e(o)&&!_e(c)?o!==o&&c!==c:Az(o,c,p,_,Jo,b)}function Az(o,c,p,_,b,k){var E=It(o),I=It(c),W=E?mt:Ze(o),Q=I?mt:Ze(c);W=W==ht?_t:W,Q=Q==ht?_t:Q;var J=W==_t,nt=Q==_t,ft=W==Q;if(ft&&tr(o)){if(!tr(c))return!1;E=!0,J=!1}if(ft&&!J)return k||(k=new zn),E||Cs(o)?wb(o,c,p,_,b,k):iU(o,c,W,p,_,b,k);if(!(p&v)){var wt=J&&Kt.call(o,"__wrapped__"),Ct=nt&&Kt.call(c,"__wrapped__");if(wt||Ct){var Ft=wt?o.value():o,Mt=Ct?c.value():c;return k||(k=new zn),b(Ft,Mt,p,_,k)}}return ft?(k||(k=new zn),rU(o,c,p,_,b,k)):!1}function Ez(o){return _e(o)&&Ze(o)==et}function Af(o,c,p,_){var b=p.length,k=b,E=!_;if(o==null)return!k;for(o=re(o);b--;){var I=p[b];if(E&&I[2]?I[1]!==o[I[0]]:!(I[0]in o))return!1}for(;++b<k;){I=p[b];var W=I[0],Q=o[W],J=I[1];if(E&&I[2]){if(Q===n&&!(W in o))return!1}else{var nt=new zn;if(_)var ft=_(Q,J,W,o,c,nt);if(!(ft===n?Jo(J,Q,v|S,_,nt):ft))return!1}}return!0}function $y(o){if(!pe(o)||hU(o))return!1;var c=xi(o)?EF:Vd;return c.test(Ir(o))}function Rz(o){return _e(o)&&en(o)==Te}function Pz(o){return _e(o)&&Ze(o)==ee}function Iz(o){return _e(o)&&vc(o.length)&&!!ie[en(o)]}function Vy(o){return typeof o=="function"?o:o==null?pn:typeof o=="object"?It(o)?jy(o[0],o[1]):qy(o):hx(o)}function Ef(o){if(!na(o))return BF(o);var c=[];for(var p in re(o))Kt.call(o,p)&&p!="constructor"&&c.push(p);return c}function Lz(o){if(!pe(o))return _U(o);var c=na(o),p=[];for(var _ in o)_=="constructor"&&(c||!Kt.call(o,_))||p.push(_);return p}function Rf(o,c){return o<c}function Yy(o,c){var p=-1,_=fn(o)?q(o.length):[];return Xi(o,function(b,k,E){_[++p]=c(b,k,E)}),_}function qy(o){var c=jf(o);return c.length==1&&c[0][2]?Mb(c[0][0],c[0][1]):function(p){return p===o||Af(p,o,c)}}function jy(o,c){return Kf(o)&&kb(c)?Mb(Un(o),c):function(p){var _=oh(p,o);return _===n&&_===c?ah(p,o):Jo(c,_,v|S)}}function oc(o,c,p,_,b){o!==c&&Mf(c,function(k,E){if(b||(b=new zn),pe(k))Nz(o,c,E,p,oc,_,b);else{var I=_?_(Zf(o,E),k,E+"",o,c,b):n;I===n&&(I=k),Tf(o,E,I)}},hn)}function Nz(o,c,p,_,b,k,E){var I=Zf(o,p),W=Zf(c,p),Q=E.get(W);if(Q){Tf(o,p,Q);return}var J=k?k(I,W,p+"",o,c,E):n,nt=J===n;if(nt){var ft=It(W),wt=!ft&&tr(W),Ct=!ft&&!wt&&Cs(W);J=W,ft||wt||Ct?It(I)?J=I:xe(I)?J=dn(I):wt?(nt=!1,J=sb(W,!0)):Ct?(nt=!1,J=ob(W,!0)):J=[]:ra(W)||Lr(W)?(J=I,Lr(I)?J=nx(I):(!pe(I)||xi(I))&&(J=Tb(W))):nt=!1}nt&&(E.set(W,J),b(J,W,_,k,E),E.delete(W)),Tf(o,p,J)}function Gy(o,c){var p=o.length;if(p)return c+=c<0?p:0,bi(c,p)?o[c]:n}function Ky(o,c,p){c.length?c=de(c,function(k){return It(k)?function(E){return Rr(E,k.length===1?k[0]:k)}:k}):c=[pn];var _=-1;c=de(c,bn(Dt()));var b=Yy(o,function(k,E,I){var W=de(c,function(Q){return Q(k)});return{criteria:W,index:++_,value:k}});return cF(b,function(k,E){return Kz(k,E,p)})}function Bz(o,c){return Xy(o,c,function(p,_){return ah(o,_)})}function Xy(o,c,p){for(var _=-1,b=c.length,k={};++_<b;){var E=c[_],I=Rr(o,E);p(I,E)&&ta(k,Qi(E,o),I)}return k}function Fz(o){return function(c){return Rr(c,o)}}function Pf(o,c,p,_){var b=_?lF:_s,k=-1,E=c.length,I=o;for(o===c&&(c=dn(c)),p&&(I=de(o,bn(p)));++k<E;)for(var W=0,Q=c[k],J=p?p(Q):Q;(W=b(I,J,W,_))>-1;)I!==o&&Xl.call(I,W,1),Xl.call(o,W,1);return o}function Zy(o,c){for(var p=o?c.length:0,_=p-1;p--;){var b=c[p];if(p==_||b!==k){var k=b;bi(b)?Xl.call(o,b,1):Bf(o,b)}}return o}function If(o,c){return o+Jl(Ey()*(c-o+1))}function zz(o,c,p,_){for(var b=-1,k=Ae(Ql((c-o)/(p||1)),0),E=q(k);k--;)E[_?k:++b]=o,o+=p;return E}function Lf(o,c){var p="";if(!o||c<1||c>at)return p;do c%2&&(p+=o),c=Jl(c/2),c&&(o+=o);while(c);return p}function zt(o,c){return Qf(Db(o,c,pn),o+"")}function Uz(o){return Iy(Os(o))}function Hz(o,c){var p=Os(o);return gc(p,Er(c,0,p.length))}function ta(o,c,p,_){if(!pe(o))return o;c=Qi(c,o);for(var b=-1,k=c.length,E=k-1,I=o;I!=null&&++b<k;){var W=Un(c[b]),Q=p;if(W==="__proto__"||W==="constructor"||W==="prototype")return o;if(b!=E){var J=I[W];Q=_?_(J,W,I):n,Q===n&&(Q=pe(J)?J:bi(c[b+1])?[]:{})}Xo(I,W,Q),I=I[W]}return o}var Qy=tc?function(o,c){return tc.set(o,c),o}:pn,Wz=Zl?function(o,c){return Zl(o,"toString",{configurable:!0,enumerable:!1,value:ch(c),writable:!0})}:pn;function $z(o){return gc(Os(o))}function Rn(o,c,p){var _=-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 k=q(b);++_<b;)k[_]=o[_+c];return k}function Vz(o,c){var p;return Xi(o,function(_,b,k){return p=c(_,b,k),!p}),!!p}function ac(o,c,p){var _=0,b=o==null?_:o.length;if(typeof c=="number"&&c===c&&b<=Z){for(;_<b;){var k=_+b>>>1,E=o[k];E!==null&&!wn(E)&&(p?E<=c:E<c)?_=k+1:b=k}return b}return Nf(o,c,pn,p)}function Nf(o,c,p,_){var b=0,k=o==null?0:o.length;if(k===0)return 0;c=p(c);for(var E=c!==c,I=c===null,W=wn(c),Q=c===n;b<k;){var J=Jl((b+k)/2),nt=p(o[J]),ft=nt!==n,wt=nt===null,Ct=nt===nt,Ft=wn(nt);if(E)var Mt=_||Ct;else Q?Mt=Ct&&(_||ft):I?Mt=Ct&&ft&&(_||!wt):W?Mt=Ct&&ft&&!wt&&(_||!Ft):wt||Ft?Mt=!1:Mt=_?nt<=c:nt<c;Mt?b=J+1:k=J}return Xe(k,z)}function Jy(o,c){for(var p=-1,_=o.length,b=0,k=[];++p<_;){var E=o[p],I=c?c(E):E;if(!p||!Hn(I,W)){var W=I;k[b++]=E===0?0:E}}return k}function tb(o){return typeof o=="number"?o:wn(o)?G:+o}function xn(o){if(typeof o=="string")return o;if(It(o))return de(o,xn)+"";if(wn(o))return Ry?Ry.call(o):"";var c=o+"";return c=="0"&&1/o==-Tt?"-0":c}function Zi(o,c,p){var _=-1,b=Ul,k=o.length,E=!0,I=[],W=I;if(p)E=!1,b=df;else if(k>=r){var Q=c?null:eU(o);if(Q)return Wl(Q);E=!1,b=Vo,W=new Ar}else W=c?[]:I;t:for(;++_<k;){var J=o[_],nt=c?c(J):J;if(J=p||J!==0?J:0,E&&nt===nt){for(var ft=W.length;ft--;)if(W[ft]===nt)continue t;c&&W.push(nt),I.push(J)}else b(W,nt,p)||(W!==I&&W.push(nt),I.push(J))}return I}function Bf(o,c){c=Qi(c,o);var p=-1,_=c.length;if(!_)return!0;for(;++p<_;){var b=Un(c[p]);if(b==="__proto__"&&!Kt.call(o,"__proto__")||(b==="constructor"||b==="prototype")&&p<_-1)return!1}var k=Cb(o,c);return k==null||delete k[Un(Pn(c))]}function eb(o,c,p,_){return ta(o,c,p(Rr(o,c)),_)}function lc(o,c,p,_){for(var b=o.length,k=_?b:-1;(_?k--:++k<b)&&c(o[k],k,o););return p?Rn(o,_?0:k,_?k+1:b):Rn(o,_?k+1:0,_?b:k)}function nb(o,c){var p=o;return p instanceof Ht&&(p=p.value()),ff(c,function(_,b){return b.func.apply(b.thisArg,ji([_],b.args))},p)}function Ff(o,c,p){var _=o.length;if(_<2)return _?Zi(o[0]):[];for(var b=-1,k=q(_);++b<_;)for(var E=o[b],I=-1;++I<_;)I!=b&&(k[b]=Zo(k[b]||E,o[I],c,p));return Zi(Ue(k,1),c,p)}function ib(o,c,p){for(var _=-1,b=o.length,k=c.length,E={};++_<b;){var I=_<k?c[_]:n;p(E,o[_],I)}return E}function zf(o){return xe(o)?o:[]}function Uf(o){return typeof o=="function"?o:pn}function Qi(o,c){return It(o)?o:Kf(o,c)?[o]:Rb(Xt(o))}var Yz=zt;function Ji(o,c,p){var _=o.length;return p=p===n?_:p,!c&&p>=_?o:Rn(o,c,p)}var rb=RF||function(o){return ue.clearTimeout(o)};function sb(o,c){if(c)return o.slice();var p=o.length,_=My?My(p):new o.constructor(p);return o.copy(_),_}function Hf(o){var c=new o.constructor(o.byteLength);return new Gl(c).set(new Gl(o)),c}function qz(o,c){var p=c?Hf(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.byteLength)}function jz(o){var c=new o.constructor(o.source,Sl.exec(o));return c.lastIndex=o.lastIndex,c}function Gz(o){return Ko?re(Ko.call(o)):{}}function ob(o,c){var p=c?Hf(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.length)}function ab(o,c){if(o!==c){var p=o!==n,_=o===null,b=o===o,k=wn(o),E=c!==n,I=c===null,W=c===c,Q=wn(c);if(!I&&!Q&&!k&&o>c||k&&E&&W&&!I&&!Q||_&&E&&W||!p&&W||!b)return 1;if(!_&&!k&&!Q&&o<c||Q&&p&&b&&!_&&!k||I&&p&&b||!E&&b||!W)return-1}return 0}function Kz(o,c,p){for(var _=-1,b=o.criteria,k=c.criteria,E=b.length,I=p.length;++_<E;){var W=ab(b[_],k[_]);if(W){if(_>=I)return W;var Q=p[_];return W*(Q=="desc"?-1:1)}}return o.index-c.index}function lb(o,c,p,_){for(var b=-1,k=o.length,E=p.length,I=-1,W=c.length,Q=Ae(k-E,0),J=q(W+Q),nt=!_;++I<W;)J[I]=c[I];for(;++b<E;)(nt||b<k)&&(J[p[b]]=o[b]);for(;Q--;)J[I++]=o[b++];return J}function cb(o,c,p,_){for(var b=-1,k=o.length,E=-1,I=p.length,W=-1,Q=c.length,J=Ae(k-I,0),nt=q(J+Q),ft=!_;++b<J;)nt[b]=o[b];for(var wt=b;++W<Q;)nt[wt+W]=c[W];for(;++E<I;)(ft||b<k)&&(nt[wt+p[E]]=o[b++]);return nt}function dn(o,c){var p=-1,_=o.length;for(c||(c=q(_));++p<_;)c[p]=o[p];return c}function ei(o,c,p,_){var b=!p;p||(p={});for(var k=-1,E=c.length;++k<E;){var I=c[k],W=_?_(p[I],o[I],I,p,o):n;W===n&&(W=o[I]),b?Jn(p,I,W):Xo(p,I,W)}return p}function Xz(o,c){return ei(o,Gf(o),c)}function Zz(o,c){return ei(o,vb(o),c)}function cc(o,c){return function(p,_){var b=It(p)?nF:bz,k=c?c():{};return b(p,o,Dt(_,2),k)}}function ks(o){return zt(function(c,p){var _=-1,b=p.length,k=b>1?p[b-1]:n,E=b>2?p[2]:n;for(k=o.length>3&&typeof k=="function"?(b--,k):n,E&&nn(p[0],p[1],E)&&(k=b<3?n:k,b=1),c=re(c);++_<b;){var I=p[_];I&&o(c,I,_,k)}return c})}function ub(o,c){return function(p,_){if(p==null)return p;if(!fn(p))return o(p,_);for(var b=p.length,k=c?b:-1,E=re(p);(c?k--:++k<b)&&_(E[k],k,E)!==!1;);return p}}function db(o){return function(c,p,_){for(var b=-1,k=re(c),E=_(c),I=E.length;I--;){var W=E[o?I:++b];if(p(k[W],W,k)===!1)break}return c}}function Qz(o,c,p){var _=c&O,b=ea(o);function k(){var E=this&&this!==ue&&this instanceof k?b:o;return E.apply(_?p:this,arguments)}return k}function fb(o){return function(c){c=Xt(c);var p=ys(c)?Fn(c):n,_=p?p[0]:c.charAt(0),b=p?Ji(p,1).join(""):c.slice(1);return _[o]()+b}}function Ms(o){return function(c){return ff(dx(ux(c).replace(of,"")),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),_=o.apply(p,c);return pe(_)?_:p}}function Jz(o,c,p){var _=ea(o);function b(){for(var k=arguments.length,E=q(k),I=k,W=Ds(b);I--;)E[I]=arguments[I];var Q=k<3&&E[0]!==W&&E[k-1]!==W?[]:Gi(E,W);if(k-=Q.length,k<p)return _b(o,c,uc,b.placeholder,n,E,Q,n,n,p-k);var J=this&&this!==ue&&this instanceof b?_:o;return _n(J,this,E)}return b}function hb(o){return function(c,p,_){var b=re(c);if(!fn(c)){var k=Dt(p,3);c=Ie(c),p=function(I){return k(b[I],I,b)}}var E=o(c,p,_);return E>-1?b[k?c[E]:E]:n}}function pb(o){return yi(function(c){var p=c.length,_=p,b=An.prototype.thru;for(o&&c.reverse();_--;){var k=c[_];if(typeof k!="function")throw new On(a);if(b&&!E&&pc(k)=="wrapper")var E=new An([],!0)}for(_=E?_:p;++_<p;){k=c[_];var I=pc(k),W=I=="wrapper"?qf(k):n;W&&Xf(W[0])&&W[1]==(D|L|F|w)&&!W[4].length&&W[9]==1?E=E[pc(W[0])].apply(E,W[3]):E=k.length==1&&Xf(k)?E[I]():E.thru(k)}return function(){var Q=arguments,J=Q[0];if(E&&Q.length==1&&It(J))return E.plant(J).value();for(var nt=0,ft=p?c[nt].apply(this,Q):J;++nt<p;)ft=c[nt].call(this,ft);return ft}})}function uc(o,c,p,_,b,k,E,I,W,Q){var J=c&D,nt=c&O,ft=c&A,wt=c&(L|R),Ct=c&C,Ft=ft?n:ea(o);function Mt(){for(var Ut=arguments.length,Wt=q(Ut),vn=Ut;vn--;)Wt[vn]=arguments[vn];if(wt)var rn=Ds(Mt),Sn=dF(Wt,rn);if(_&&(Wt=lb(Wt,_,b,wt)),k&&(Wt=cb(Wt,k,E,wt)),Ut-=Sn,wt&&Ut<Q){var we=Gi(Wt,rn);return _b(o,c,uc,Mt.placeholder,p,Wt,we,I,W,Q-Ut)}var Wn=nt?p:this,vi=ft?Wn[o]:o;return Ut=Wt.length,I?Wt=bU(Wt,I):Ct&&Ut>1&&Wt.reverse(),J&&W<Ut&&(Wt.length=W),this&&this!==ue&&this instanceof Mt&&(vi=Ft||ea(vi)),vi.apply(Wn,Wt)}return Mt}function mb(o,c){return function(p,_){return Dz(p,o,c(_),{})}}function dc(o,c){return function(p,_){var b;if(p===n&&_===n)return c;if(p!==n&&(b=p),_!==n){if(b===n)return _;typeof p=="string"||typeof _=="string"?(p=xn(p),_=xn(_)):(p=tb(p),_=tb(_)),b=o(p,_)}return b}}function Wf(o){return yi(function(c){return c=de(c,bn(Dt())),zt(function(p){var _=this;return o(c,function(b){return _n(b,_,p)})})})}function fc(o,c){c=c===n?" ":xn(c);var p=c.length;if(p<2)return p?Lf(c,o):c;var _=Lf(c,Ql(o/bs(c)));return ys(c)?Ji(Fn(_),0,o).join(""):_.slice(0,o)}function tU(o,c,p,_){var b=c&O,k=ea(o);function E(){for(var I=-1,W=arguments.length,Q=-1,J=_.length,nt=q(J+W),ft=this&&this!==ue&&this instanceof E?k:o;++Q<J;)nt[Q]=_[Q];for(;W--;)nt[Q++]=arguments[++I];return _n(ft,b?p:this,nt)}return E}function gb(o){return function(c,p,_){return _&&typeof _!="number"&&nn(c,p,_)&&(p=_=n),c=wi(c),p===n?(p=c,c=0):p=wi(p),_=_===n?c<p?1:-1:wi(_),zz(c,p,_,o)}}function hc(o){return function(c,p){return typeof c=="string"&&typeof p=="string"||(c=In(c),p=In(p)),o(c,p)}}function _b(o,c,p,_,b,k,E,I,W,Q){var J=c&L,nt=J?E:n,ft=J?n:E,wt=J?k:n,Ct=J?n:k;c|=J?F:U,c&=~(J?U:F),c&P||(c&=-4);var Ft=[o,c,b,wt,nt,Ct,ft,I,W,Q],Mt=p.apply(n,Ft);return Xf(o)&&Ob(Mt,Ft),Mt.placeholder=_,Ab(Mt,o,c)}function $f(o){var c=Oe[o];return function(p,_){if(p=In(p),_=_==null?0:Xe(Bt(_),292),_&&Ay(p)){var b=(Xt(p)+"e").split("e"),k=c(b[0]+"e"+(+b[1]+_));return b=(Xt(k)+"e").split("e"),+(b[0]+"e"+(+b[1]-_))}return c(p)}}var eU=vs&&1/Wl(new vs([,-0]))[1]==Tt?function(o){return new vs(o)}:fh;function yb(o){return function(c){var p=Ze(c);return p==et?bf(c):p==ee?yF(c):uF(c,o(c))}}function _i(o,c,p,_,b,k,E,I){var W=c&A;if(!W&&typeof o!="function")throw new On(a);var Q=_?_.length:0;if(Q||(c&=-97,_=b=n),E=E===n?E:Ae(Bt(E),0),I=I===n?I:Bt(I),Q-=b?b.length:0,c&U){var J=_,nt=b;_=b=n}var ft=W?n:qf(o),wt=[o,c,p,_,b,J,nt,k,E,I];if(ft&&gU(wt,ft),o=wt[0],c=wt[1],p=wt[2],_=wt[3],b=wt[4],I=wt[9]=wt[9]===n?W?0:o.length:Ae(wt[9]-Q,0),!I&&c&(L|R)&&(c&=-25),!c||c==O)var Ct=Qz(o,c,p);else c==L||c==R?Ct=Jz(o,c,I):(c==F||c==(O|F))&&!b.length?Ct=tU(o,c,p,_):Ct=uc.apply(n,wt);var Ft=ft?Qy:Ob;return Ab(Ft(Ct,wt),o,c)}function bb(o,c,p,_){return o===n||Hn(o,ws[p])&&!Kt.call(_,p)?c:o}function xb(o,c,p,_,b,k){return pe(o)&&pe(c)&&(k.set(c,o),oc(o,c,n,xb,k),k.delete(c)),o}function nU(o){return ra(o)?n:o}function wb(o,c,p,_,b,k){var E=p&v,I=o.length,W=c.length;if(I!=W&&!(E&&W>I))return!1;var Q=k.get(o),J=k.get(c);if(Q&&J)return Q==c&&J==o;var nt=-1,ft=!0,wt=p&S?new Ar:n;for(k.set(o,c),k.set(c,o);++nt<I;){var Ct=o[nt],Ft=c[nt];if(_)var Mt=E?_(Ft,Ct,nt,c,o,k):_(Ct,Ft,nt,o,c,k);if(Mt!==n){if(Mt)continue;ft=!1;break}if(wt){if(!hf(c,function(Ut,Wt){if(!Vo(wt,Wt)&&(Ct===Ut||b(Ct,Ut,p,_,k)))return wt.push(Wt)})){ft=!1;break}}else if(!(Ct===Ft||b(Ct,Ft,p,_,k))){ft=!1;break}}return k.delete(o),k.delete(c),ft}function iU(o,c,p,_,b,k,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||!k(new Gl(o),new Gl(c)));case ot:case vt:case rt:return Hn(+o,+c);case bt:return o.name==c.name&&o.message==c.message;case Te:case je:return o==c+"";case et:var I=bf;case ee:var W=_&v;if(I||(I=Wl),o.size!=c.size&&!W)return!1;var Q=E.get(o);if(Q)return Q==c;_|=S,E.set(o,c);var J=wb(I(o),I(c),_,b,k,E);return E.delete(o),J;case Yt:if(Ko)return Ko.call(o)==Ko.call(c)}return!1}function rU(o,c,p,_,b,k){var E=p&v,I=Vf(o),W=I.length,Q=Vf(c),J=Q.length;if(W!=J&&!E)return!1;for(var nt=W;nt--;){var ft=I[nt];if(!(E?ft in c:Kt.call(c,ft)))return!1}var wt=k.get(o),Ct=k.get(c);if(wt&&Ct)return wt==c&&Ct==o;var Ft=!0;k.set(o,c),k.set(c,o);for(var Mt=E;++nt<W;){ft=I[nt];var Ut=o[ft],Wt=c[ft];if(_)var vn=E?_(Wt,Ut,ft,c,o,k):_(Ut,Wt,ft,o,c,k);if(!(vn===n?Ut===Wt||b(Ut,Wt,p,_,k):vn)){Ft=!1;break}Mt||(Mt=ft=="constructor")}if(Ft&&!Mt){var rn=o.constructor,Sn=c.constructor;rn!=Sn&&"constructor"in o&&"constructor"in c&&!(typeof rn=="function"&&rn instanceof rn&&typeof Sn=="function"&&Sn instanceof Sn)&&(Ft=!1)}return k.delete(o),k.delete(c),Ft}function yi(o){return Qf(Db(o,n,Nb),o+"")}function Vf(o){return Hy(o,Ie,Gf)}function Yf(o){return Hy(o,hn,vb)}var qf=tc?function(o){return tc.get(o)}:fh;function pc(o){for(var c=o.name+"",p=Ss[c],_=Kt.call(Ss,c)?p.length:0;_--;){var b=p[_],k=b.func;if(k==null||k==o)return b.name}return c}function Ds(o){var c=Kt.call(T,"placeholder")?T:o;return c.placeholder}function Dt(){var o=T.iteratee||uh;return o=o===uh?Vy:o,arguments.length?o(arguments[0],arguments[1]):o}function mc(o,c){var p=o.__data__;return fU(c)?p[typeof c=="string"?"string":"hash"]:p.map}function jf(o){for(var c=Ie(o),p=c.length;p--;){var _=c[p],b=o[_];c[p]=[_,b,kb(b)]}return c}function Pr(o,c){var p=mF(o,c);return $y(p)?p:n}function sU(o){var c=Kt.call(o,Cr),p=o[Cr];try{o[Cr]=n;var _=!0}catch{}var b=ql.call(o);return _&&(c?o[Cr]=p:delete o[Cr]),b}var Gf=wf?function(o){return o==null?[]:(o=re(o),qi(wf(o),function(c){return Cy.call(o,c)}))}:hh,vb=wf?function(o){for(var c=[];o;)ji(c,Gf(o)),o=Kl(o);return c}:hh,Ze=en;(vf&&Ze(new vf(new ArrayBuffer(1)))!=gn||qo&&Ze(new qo)!=et||Sf&&Ze(Sf.resolve())!=$t||vs&&Ze(new vs)!=ee||jo&&Ze(new jo)!=se)&&(Ze=function(o){var c=en(o),p=c==_t?o.constructor:n,_=p?Ir(p):"";if(_)switch(_){case HF:return gn;case WF:return et;case $F:return $t;case VF:return ee;case YF:return se}return c});function oU(o,c,p){for(var _=-1,b=p.length;++_<b;){var k=p[_],E=k.size;switch(k.type){case"drop":o+=E;break;case"dropRight":c-=E;break;case"take":c=Xe(c,o+E);break;case"takeRight":o=Ae(o,c-E);break}}return{start:o,end:c}}function aU(o){var c=o.match(Fd);return c?c[1].split(zd):[]}function Sb(o,c,p){c=Qi(c,o);for(var _=-1,b=c.length,k=!1;++_<b;){var E=Un(c[_]);if(!(k=o!=null&&p(o,E)))break;o=o[E]}return k||++_!=b?k:(b=o==null?0:o.length,!!b&&vc(b)&&bi(E,b)&&(It(o)||Lr(o)))}function lU(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 Tb(o){return typeof o.constructor=="function"&&!na(o)?Ts(Kl(o)):{}}function cU(o,c,p){var _=o.constructor;switch(c){case Pe:return Hf(o);case ot:case vt:return new _(+o);case gn:return qz(o,p);case Wi:case Cn:case Ge:case Ln:case di:case Oo:case Ao:case Tr:case fi:return ob(o,p);case et:return new _;case rt:case je:return new _(o);case Te:return jz(o);case ee:return new _;case Yt:return Gz(o)}}function uU(o,c){var p=c.length;if(!p)return o;var _=p-1;return c[_]=(p>1?"& ":"")+c[_],c=c.join(p>2?", ":" "),o.replace(Nn,`{
8
8
  /* [wrapped with `+c+`] */
9
- `)}function dU(o){return It(o)||Lr(o)||!!(O_&&o&&o[O_])}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 nn(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 Kf(o,c){if(It(o))return!1;var p=typeof o;return p=="number"||p=="symbol"||p=="boolean"||o==null||wn(o)?!0:hi.test(o)||!wl.test(o)||c!=null&&o in re(c)}function fU(o){var c=typeof o;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?o!=="__proto__":o===null}function Xf(o){var c=pc(o),p=T[c];if(typeof p!="function"||!(c in Ht.prototype))return!1;if(o===p)return!0;var y=qf(p);return!!y&&o===y[0]}function hU(o){return!!k_&&k_ in o}var pU=Vl?xi:ph;function na(o){var c=o&&o.constructor,p=typeof c=="function"&&c.prototype||ws;return o===p}function kb(o){return o===o&&!pe(o)}function Mb(o,c){return function(p){return p==null?!1:p[o]===c&&(c!==n||o in re(p))}}function mU(o){var c=xc(o,function(y){return p.size===h&&p.clear(),y}),p=c.cache;return c}function gU(o,c){var p=o[1],y=c[1],b=p|y,k=b<(O|A|D),E=y==D&&p==L||y==D&&p==w&&o[7].length<=c[8]||y==(D|w)&&c[7].length<=c[8]&&p==L;if(!(k||E))return o;y&O&&(o[2]=c[2],b|=p&O?0:P);var I=c[3];if(I){var W=o[3];o[3]=W?lb(W,I,c[4]):I,o[4]=W?Gi(o[3],m):c[4]}return I=c[5],I&&(W=o[5],o[5]=W?cb(W,I,c[6]):I,o[6]=W?Gi(o[5],m):c[6]),I=c[7],I&&(o[7]=I),y&D&&(o[8]=o[8]==null?c[8]:Xe(o[8],c[8])),o[9]==null&&(o[9]=c[9]),o[0]=c[0],o[1]=b,o}function yU(o){var c=[];if(o!=null)for(var p in re(o))c.push(p);return c}function _U(o){return ql.call(o)}function Db(o,c,p){return c=Ae(c===n?o.length-1:c,0),function(){for(var y=arguments,b=-1,k=Ae(y.length-c,0),E=q(k);++b<k;)E[b]=y[c+b];b=-1;for(var I=q(c+1);++b<c;)I[b]=y[b];return I[c]=p(E),yn(o,this,I)}}function Cb(o,c){return c.length<2?o:Rr(o,Rn(c,0,-1))}function bU(o,c){for(var p=o.length,y=Xe(c.length,p),b=dn(o);y--;){var k=c[y];o[y]=bi(k,p)?b[k]:n}return o}function Zf(o,c){if(!(c==="constructor"&&typeof o[c]=="function")&&c!="__proto__")return o[c]}var Ob=Eb(Q_),ia=IF||function(o,c){return ue.setTimeout(o,c)},Qf=Eb(Wz);function Ab(o,c,p){var y=c+"";return Qf(o,uU(y,xU(aU(y),p)))}function Eb(o){var c=0,p=0;return function(){var y=FF(),b=st-(y-p);if(p=y,b>0){if(++c>=V)return arguments[0]}else c=0;return o.apply(n,arguments)}}function gc(o,c){var p=-1,y=o.length,b=y-1;for(c=c===n?y:c;++p<c;){var k=If(p,b),E=o[k];o[k]=o[p],o[p]=E}return o.length=c,o}var Rb=mU(function(o){var c=[];return o.charCodeAt(0)===46&&c.push(""),o.replace(Ld,function(p,y,b,k){c.push(b?k.replace(Hd,"$1"):y||p)}),c});function Un(o){if(typeof o=="string"||wn(o))return o;var c=o+"";return c=="0"&&1/o==-Tt?"-0":c}function Ir(o){if(o!=null){try{return Yl.call(o)}catch{}try{return o+""}catch{}}return""}function xU(o,c){return _n(it,function(p){var y="_."+p[0];c&p[1]&&!Ul(o,y)&&o.push(y)}),o.sort()}function Pb(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 wU(o,c,p){(p?nn(o,c,p):c===n)?c=1:c=Ae(Bt(c),0);var y=o==null?0:o.length;if(!y||c<1)return[];for(var b=0,k=0,E=q(Ql(y/c));b<y;)E[k++]=Rn(o,b,b+=c);return E}function vU(o){for(var c=-1,p=o==null?0:o.length,y=0,b=[];++c<p;){var k=o[c];k&&(b[y++]=k)}return b}function SU(){var o=arguments.length;if(!o)return[];for(var c=q(o-1),p=arguments[0],y=o;y--;)c[y-1]=arguments[y];return ji(It(p)?dn(p):[p],Ue(c,1))}var TU=zt(function(o,c){return xe(o)?Zo(o,Ue(c,1,xe,!0)):[]}),kU=zt(function(o,c){var p=Pn(c);return xe(p)&&(p=n),xe(o)?Zo(o,Ue(c,1,xe,!0),Dt(p,2)):[]}),MU=zt(function(o,c){var p=Pn(c);return xe(p)&&(p=n),xe(o)?Zo(o,Ue(c,1,xe,!0),n,p):[]});function DU(o,c,p){var y=o==null?0:o.length;return y?(c=p||c===n?1:Bt(c),Rn(o,c<0?0:c,y)):[]}function CU(o,c,p){var y=o==null?0:o.length;return y?(c=p||c===n?1:Bt(c),c=y-c,Rn(o,0,c<0?0:c)):[]}function OU(o,c){return o&&o.length?lc(o,Dt(c,3),!0,!0):[]}function AU(o,c){return o&&o.length?lc(o,Dt(c,3),!0):[]}function EU(o,c,p,y){var b=o==null?0:o.length;return b?(p&&typeof p!="number"&&nn(o,c,p)&&(p=0,y=b),Sz(o,c,p,y)):[]}function Ib(o,c,p){var y=o==null?0:o.length;if(!y)return-1;var b=p==null?0:Bt(p);return b<0&&(b=Ae(y+b,0)),Hl(o,Dt(c,3),b)}function Lb(o,c,p){var y=o==null?0:o.length;if(!y)return-1;var b=y-1;return p!==n&&(b=Bt(p),b=p<0?Ae(y+b,0):Xe(b,y-1)),Hl(o,Dt(c,3),b,!0)}function Nb(o){var c=o==null?0:o.length;return c?Ue(o,1):[]}function RU(o){var c=o==null?0:o.length;return c?Ue(o,Tt):[]}function PU(o,c){var p=o==null?0:o.length;return p?(c=c===n?1:Bt(c),Ue(o,c)):[]}function IU(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 Bb(o){return o&&o.length?o[0]:n}function LU(o,c,p){var y=o==null?0:o.length;if(!y)return-1;var b=p==null?0:Bt(p);return b<0&&(b=Ae(y+b,0)),ys(o,c,b)}function NU(o){var c=o==null?0:o.length;return c?Rn(o,0,-1):[]}var BU=zt(function(o){var c=de(o,zf);return c.length&&c[0]===o[0]?Of(c):[]}),FU=zt(function(o){var c=Pn(o),p=de(o,zf);return c===Pn(p)?c=n:p.pop(),p.length&&p[0]===o[0]?Of(p,Dt(c,2)):[]}),zU=zt(function(o){var c=Pn(o),p=de(o,zf);return c=typeof c=="function"?c:n,c&&p.pop(),p.length&&p[0]===o[0]?Of(p,n,c):[]});function UU(o,c){return o==null?"":NF.call(o,c)}function Pn(o){var c=o==null?0:o.length;return c?o[c-1]:n}function HU(o,c,p){var y=o==null?0:o.length;if(!y)return-1;var b=y;return p!==n&&(b=Bt(p),b=b<0?Ae(y+b,0):Xe(b,y-1)),c===c?xF(o,c,b):Hl(o,y_,b,!0)}function WU(o,c){return o&&o.length?G_(o,Bt(c)):n}var $U=zt(Fb);function Fb(o,c){return o&&o.length&&c&&c.length?Pf(o,c):o}function VU(o,c,p){return o&&o.length&&c&&c.length?Pf(o,c,Dt(p,2)):o}function YU(o,c,p){return o&&o.length&&c&&c.length?Pf(o,c,n,p):o}var qU=_i(function(o,c){var p=o==null?0:o.length,y=kf(o,c);return Z_(o,de(c,function(b){return bi(b,p)?+b:b}).sort(ab)),y});function jU(o,c){var p=[];if(!(o&&o.length))return p;var y=-1,b=[],k=o.length;for(c=Dt(c,3);++y<k;){var E=o[y];c(E,y,o)&&(p.push(E),b.push(y))}return Z_(o,b),p}function Jf(o){return o==null?o:UF.call(o)}function GU(o,c,p){var y=o==null?0:o.length;return y?(p&&typeof p!="number"&&nn(o,c,p)?(c=0,p=y):(c=c==null?0:Bt(c),p=p===n?y:Bt(p)),Rn(o,c,p)):[]}function KU(o,c){return ac(o,c)}function XU(o,c,p){return Nf(o,c,Dt(p,2))}function ZU(o,c){var p=o==null?0:o.length;if(p){var y=ac(o,c);if(y<p&&Hn(o[y],c))return y}return-1}function QU(o,c){return ac(o,c,!0)}function JU(o,c,p){return Nf(o,c,Dt(p,2),!0)}function t5(o,c){var p=o==null?0:o.length;if(p){var y=ac(o,c,!0)-1;if(Hn(o[y],c))return y}return-1}function e5(o){return o&&o.length?J_(o):[]}function n5(o,c){return o&&o.length?J_(o,Dt(c,2)):[]}function i5(o){var c=o==null?0:o.length;return c?Rn(o,1,c):[]}function r5(o,c,p){return o&&o.length?(c=p||c===n?1:Bt(c),Rn(o,0,c<0?0:c)):[]}function s5(o,c,p){var y=o==null?0:o.length;return y?(c=p||c===n?1:Bt(c),c=y-c,Rn(o,c<0?0:c,y)):[]}function o5(o,c){return o&&o.length?lc(o,Dt(c,3),!1,!0):[]}function a5(o,c){return o&&o.length?lc(o,Dt(c,3)):[]}var l5=zt(function(o){return Zi(Ue(o,1,xe,!0))}),c5=zt(function(o){var c=Pn(o);return xe(c)&&(c=n),Zi(Ue(o,1,xe,!0),Dt(c,2))}),u5=zt(function(o){var c=Pn(o);return c=typeof c=="function"?c:n,Zi(Ue(o,1,xe,!0),n,c)});function d5(o){return o&&o.length?Zi(o):[]}function f5(o,c){return o&&o.length?Zi(o,Dt(c,2)):[]}function h5(o,c){return c=typeof c=="function"?c:n,o&&o.length?Zi(o,n,c):[]}function th(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}),yf(c,function(p){return de(o,pf(p))})}function zb(o,c){if(!(o&&o.length))return[];var p=th(o);return c==null?p:de(p,function(y){return yn(c,n,y)})}var p5=zt(function(o,c){return xe(o)?Zo(o,c):[]}),m5=zt(function(o){return Ff(qi(o,xe))}),g5=zt(function(o){var c=Pn(o);return xe(c)&&(c=n),Ff(qi(o,xe),Dt(c,2))}),y5=zt(function(o){var c=Pn(o);return c=typeof c=="function"?c:n,Ff(qi(o,xe),n,c)}),_5=zt(th);function b5(o,c){return ib(o||[],c||[],Xo)}function x5(o,c){return ib(o||[],c||[],ta)}var w5=zt(function(o){var c=o.length,p=c>1?o[c-1]:n;return p=typeof p=="function"?(o.pop(),p):n,zb(o,p)});function Ub(o){var c=T(o);return c.__chain__=!0,c}function v5(o,c){return c(o),o}function yc(o,c){return c(o)}var S5=_i(function(o){var c=o.length,p=c?o[0]:0,y=this.__wrapped__,b=function(k){return kf(k,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:yc,args:[b],thisArg:n}),new An(y,this.__chain__).thru(function(k){return c&&!k.length&&k.push(n),k}))});function T5(){return Ub(this)}function k5(){return new An(this.value(),this.__chain__)}function M5(){this.__values__===n&&(this.__values__=tx(this.value()));var o=this.__index__>=this.__values__.length,c=o?n:this.__values__[this.__index__++];return{done:o,value:c}}function D5(){return this}function C5(o){for(var c,p=this;p instanceof nc;){var y=Pb(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 O5(){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:yc,args:[Jf],thisArg:n}),new An(c,this.__chain__)}return this.thru(Jf)}function A5(){return nb(this.__wrapped__,this.__actions__)}var E5=cc(function(o,c,p){Kt.call(o,p)?++o[p]:Jn(o,p,1)});function R5(o,c,p){var y=It(o)?m_:vz;return p&&nn(o,c,p)&&(c=n),y(o,Dt(c,3))}function P5(o,c){var p=It(o)?qi:z_;return p(o,Dt(c,3))}var I5=hb(Ib),L5=hb(Lb);function N5(o,c){return Ue(_c(o,c),1)}function B5(o,c){return Ue(_c(o,c),Tt)}function F5(o,c,p){return p=p===n?1:Bt(p),Ue(_c(o,c),p)}function Hb(o,c){var p=It(o)?_n:Xi;return p(o,Dt(c,3))}function Wb(o,c){var p=It(o)?iF:F_;return p(o,Dt(c,3))}var z5=cc(function(o,c,p){Kt.call(o,p)?o[p].push(c):Jn(o,p,[c])});function U5(o,c,p,y){o=fn(o)?o:Os(o),p=p&&!y?Bt(p):0;var b=o.length;return p<0&&(p=Ae(b+p,0)),Sc(o)?p<=b&&o.indexOf(c,p)>-1:!!b&&ys(o,c,p)>-1}var H5=zt(function(o,c,p){var y=-1,b=typeof c=="function",k=fn(o)?q(o.length):[];return Xi(o,function(E){k[++y]=b?yn(c,E,p):Qo(E,c,p)}),k}),W5=cc(function(o,c,p){Jn(o,p,c)});function _c(o,c){var p=It(o)?de:Y_;return p(o,Dt(c,3))}function $5(o,c,p,y){return o==null?[]:(It(c)||(c=c==null?[]:[c]),p=y?n:p,It(p)||(p=p==null?[]:[p]),K_(o,c,p))}var V5=cc(function(o,c,p){o[p?0:1].push(c)},function(){return[[],[]]});function Y5(o,c,p){var y=It(o)?ff:b_,b=arguments.length<3;return y(o,Dt(c,4),p,b,Xi)}function q5(o,c,p){var y=It(o)?rF:b_,b=arguments.length<3;return y(o,Dt(c,4),p,b,F_)}function j5(o,c){var p=It(o)?qi:z_;return p(o,wc(Dt(c,3)))}function G5(o){var c=It(o)?I_:Uz;return c(o)}function K5(o,c,p){(p?nn(o,c,p):c===n)?c=1:c=Bt(c);var y=It(o)?yz:Hz;return y(o,c)}function X5(o){var c=It(o)?_z:$z;return c(o)}function Z5(o){if(o==null)return 0;if(fn(o))return Sc(o)?bs(o):o.length;var c=Ze(o);return c==et||c==ee?o.size:Ef(o).length}function Q5(o,c,p){var y=It(o)?hf:Vz;return p&&nn(o,c,p)&&(c=n),y(o,Dt(c,3))}var J5=zt(function(o,c){if(o==null)return[];var p=c.length;return p>1&&nn(o,c[0],c[1])?c=[]:p>2&&nn(c[0],c[1],c[2])&&(c=[c[0]]),K_(o,Ue(c,1),[])}),bc=PF||function(){return ue.Date.now()};function tH(o,c){if(typeof c!="function")throw new On(a);return o=Bt(o),function(){if(--o<1)return c.apply(this,arguments)}}function $b(o,c,p){return c=p?n:c,c=o&&c==null?o.length:c,yi(o,D,n,n,n,n,c)}function Vb(o,c){var p;if(typeof c!="function")throw new On(a);return o=Bt(o),function(){return--o>0&&(p=c.apply(this,arguments)),o<=1&&(c=n),p}}var eh=zt(function(o,c,p){var y=O;if(p.length){var b=Gi(p,Ds(eh));y|=F}return yi(o,y,c,p,b)}),Yb=zt(function(o,c,p){var y=O|A;if(p.length){var b=Gi(p,Ds(Yb));y|=F}return yi(c,y,o,p,b)});function qb(o,c,p){c=p?n:c;var y=yi(o,L,n,n,n,n,n,c);return y.placeholder=qb.placeholder,y}function jb(o,c,p){c=p?n:c;var y=yi(o,R,n,n,n,n,n,c);return y.placeholder=jb.placeholder,y}function Gb(o,c,p){var y,b,k,E,I,W,Q=0,J=!1,nt=!1,ft=!0;if(typeof o!="function")throw new On(a);c=In(c)||0,pe(p)&&(J=!!p.leading,nt="maxWait"in p,k=nt?Ae(In(p.maxWait)||0,c):k,ft="trailing"in p?!!p.trailing:ft);function wt(we){var Wn=y,vi=b;return y=b=n,Q=we,E=o.apply(vi,Wn),E}function Ct(we){return Q=we,I=ia(Ut,c),J?wt(we):E}function Ft(we){var Wn=we-W,vi=we-Q,px=c-Wn;return nt?Xe(px,k-vi):px}function Mt(we){var Wn=we-W,vi=we-Q;return W===n||Wn>=c||Wn<0||nt&&vi>=k}function Ut(){var we=bc();if(Mt(we))return Wt(we);I=ia(Ut,Ft(we))}function Wt(we){return I=n,ft&&y?wt(we):(y=b=n,E)}function vn(){I!==n&&rb(I),Q=0,y=W=b=I=n}function rn(){return I===n?E:Wt(bc())}function Sn(){var we=bc(),Wn=Mt(we);if(y=arguments,b=this,W=we,Wn){if(I===n)return Ct(W);if(nt)return rb(I),I=ia(Ut,c),wt(W)}return I===n&&(I=ia(Ut,c)),E}return Sn.cancel=vn,Sn.flush=rn,Sn}var eH=zt(function(o,c){return B_(o,1,c)}),nH=zt(function(o,c,p){return B_(o,In(c)||0,p)});function iH(o){return yi(o,C)}function xc(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],k=p.cache;if(k.has(b))return k.get(b);var E=o.apply(this,y);return p.cache=k.set(b,E)||k,E};return p.cache=new(xc.Cache||gi),p}xc.Cache=gi;function wc(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 rH(o){return Vb(2,o)}var sH=Yz(function(o,c){c=c.length==1&&It(c[0])?de(c[0],bn(Dt())):de(Ue(c,1),bn(Dt()));var p=c.length;return zt(function(y){for(var b=-1,k=Xe(y.length,p);++b<k;)y[b]=c[b].call(this,y[b]);return yn(o,this,y)})}),nh=zt(function(o,c){var p=Gi(c,Ds(nh));return yi(o,F,n,c,p)}),Kb=zt(function(o,c){var p=Gi(c,Ds(Kb));return yi(o,U,n,c,p)}),oH=_i(function(o,c){return yi(o,w,n,n,n,c)});function aH(o,c){if(typeof o!="function")throw new On(a);return c=c===n?c:Bt(c),zt(o,c)}function lH(o,c){if(typeof o!="function")throw new On(a);return c=c==null?0:Ae(Bt(c),0),zt(function(p){var y=p[c],b=Ji(p,0,c);return y&&ji(b,y),yn(o,this,b)})}function cH(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),Gb(o,c,{leading:y,maxWait:c,trailing:b})}function uH(o){return $b(o,1)}function dH(o,c){return nh(Uf(c),o)}function fH(){if(!arguments.length)return[];var o=arguments[0];return It(o)?o:[o]}function hH(o){return En(o,x)}function pH(o,c){return c=typeof c=="function"?c:n,En(o,x,c)}function mH(o){return En(o,g|x)}function gH(o,c){return c=typeof c=="function"?c:n,En(o,g|x,c)}function yH(o,c){return c==null||N_(o,c,Ie(c))}function Hn(o,c){return o===c||o!==o&&c!==c}var _H=hc(Cf),bH=hc(function(o,c){return o>=c}),Lr=W_((function(){return arguments})())?W_:function(o){return ye(o)&&Kt.call(o,"callee")&&!C_.call(o,"callee")},It=q.isArray,xH=c_?bn(c_):Cz;function fn(o){return o!=null&&vc(o.length)&&!xi(o)}function xe(o){return ye(o)&&fn(o)}function wH(o){return o===!0||o===!1||ye(o)&&en(o)==ot}var tr=LF||ph,vH=u_?bn(u_):Oz;function SH(o){return ye(o)&&o.nodeType===1&&!ra(o)}function TH(o){if(o==null)return!0;if(fn(o)&&(It(o)||typeof o=="string"||typeof o.splice=="function"||tr(o)||Cs(o)||Lr(o)))return!o.length;var c=Ze(o);if(c==et||c==ee)return!o.size;if(na(o))return!Ef(o).length;for(var p in o)if(Kt.call(o,p))return!1;return!0}function kH(o,c){return Jo(o,c)}function MH(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 ih(o){if(!ye(o))return!1;var c=en(o);return c==bt||c==lt||typeof o.message=="string"&&typeof o.name=="string"&&!ra(o)}function DH(o){return typeof o=="number"&&A_(o)}function xi(o){if(!pe(o))return!1;var c=en(o);return c==Rt||c==j||c==X||c==Me}function Xb(o){return typeof o=="number"&&o==Bt(o)}function vc(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 Zb=d_?bn(d_):Ez;function CH(o,c){return o===c||Af(o,c,jf(c))}function OH(o,c,p){return p=typeof p=="function"?p:n,Af(o,c,jf(c),p)}function AH(o){return Qb(o)&&o!=+o}function EH(o){if(pU(o))throw new At(s);return $_(o)}function RH(o){return o===null}function PH(o){return o==null}function Qb(o){return typeof o=="number"||ye(o)&&en(o)==rt}function ra(o){if(!ye(o)||en(o)!=yt)return!1;var c=Kl(o);if(c===null)return!0;var p=Kt.call(c,"constructor")&&c.constructor;return typeof p=="function"&&p instanceof p&&Yl.call(p)==OF}var rh=f_?bn(f_):Rz;function IH(o){return Xb(o)&&o>=-at&&o<=at}var Jb=h_?bn(h_):Pz;function Sc(o){return typeof o=="string"||!It(o)&&ye(o)&&en(o)==je}function wn(o){return typeof o=="symbol"||ye(o)&&en(o)==Yt}var Cs=p_?bn(p_):Iz;function LH(o){return o===n}function NH(o){return ye(o)&&Ze(o)==se}function BH(o){return ye(o)&&en(o)==De}var FH=hc(Rf),zH=hc(function(o,c){return o<=c});function tx(o){if(!o)return[];if(fn(o))return Sc(o)?Fn(o):dn(o);if(Yo&&o[Yo])return yF(o[Yo]());var c=Ze(o),p=c==et?bf:c==ee?Wl:Os;return p(o)}function wi(o){if(!o)return o===0?o:0;if(o=In(o),o===Tt||o===-Tt){var c=o<0?-1:1;return c*pt}return o===o?o:0}function Bt(o){var c=wi(o),p=c%1;return c===c?p?c-p:c:0}function ex(o){return o?Er(Bt(o),0,B):0}function In(o){if(typeof o=="number")return o;if(wn(o))return G;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=x_(o);var p=$d.test(o);return p||Yd.test(o)?Bn(o.slice(2),p?2:8):Wd.test(o)?G:+o}function nx(o){return ei(o,hn(o))}function UH(o){return o?Er(Bt(o),-at,at):o===0?o:0}function Xt(o){return o==null?"":xn(o)}var HH=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])}),ix=ks(function(o,c){ei(c,hn(c),o)}),rx=ks(function(o,c,p,y){ei(c,hn(c),o,y)}),sh=ks(function(o,c,p,y){ei(c,Ie(c),o,y)}),WH=_i(kf);function $H(o,c){var p=Ts(o);return c==null?p:L_(p,c)}var VH=zt(function(o,c){o=re(o);var p=-1,y=c.length,b=y>2?c[2]:n;for(b&&nn(c[0],c[1],b)&&(y=1);++p<y;)for(var k=c[p],E=hn(k),I=-1,W=E.length;++I<W;){var Q=E[I],J=o[Q];(J===n||Hn(J,ws[Q])&&!Kt.call(o,Q))&&(o[Q]=k[Q])}return o}),YH=zt(function(o){return o.push(n,xb),yn(sx,n,o)});function qH(o,c){return g_(o,Dt(c,3),ti)}function jH(o,c){return g_(o,Dt(c,3),Df)}function GH(o,c){return o==null?o:Mf(o,Dt(c,3),hn)}function KH(o,c){return o==null?o:U_(o,Dt(c,3),hn)}function XH(o,c){return o&&ti(o,Dt(c,3))}function ZH(o,c){return o&&Df(o,Dt(c,3))}function QH(o){return o==null?[]:sc(o,Ie(o))}function JH(o){return o==null?[]:sc(o,hn(o))}function oh(o,c,p){var y=o==null?n:Rr(o,c);return y===n?p:y}function tW(o,c){return o!=null&&Sb(o,c,Tz)}function ah(o,c){return o!=null&&Sb(o,c,kz)}var eW=mb(function(o,c,p){c!=null&&typeof c.toString!="function"&&(c=ql.call(c)),o[c]=p},ch(pn)),nW=mb(function(o,c,p){c!=null&&typeof c.toString!="function"&&(c=ql.call(c)),Kt.call(o,c)?o[c].push(p):o[c]=[p]},Dt),iW=zt(Qo);function Ie(o){return fn(o)?P_(o):Ef(o)}function hn(o){return fn(o)?P_(o,!0):Lz(o)}function rW(o,c){var p={};return c=Dt(c,3),ti(o,function(y,b,k){Jn(p,c(y,b,k),y)}),p}function sW(o,c){var p={};return c=Dt(c,3),ti(o,function(y,b,k){Jn(p,b,c(y,b,k))}),p}var oW=ks(function(o,c,p){oc(o,c,p)}),sx=ks(function(o,c,p,y){oc(o,c,p,y)}),aW=_i(function(o,c){var p={};if(o==null)return p;var y=!1;c=de(c,function(k){return k=Qi(k,o),y||(y=k.length>1),k}),ei(o,Yf(o),p),y&&(p=En(p,g|_|x,nU));for(var b=c.length;b--;)Bf(p,c[b]);return p});function lW(o,c){return ox(o,wc(Dt(c)))}var cW=_i(function(o,c){return o==null?{}:Bz(o,c)});function ox(o,c){if(o==null)return{};var p=de(Yf(o),function(y){return[y]});return c=Dt(c),X_(o,p,function(y,b){return c(y,b[0])})}function uW(o,c,p){c=Qi(c,o);var y=-1,b=c.length;for(b||(b=1,o=n);++y<b;){var k=o==null?n:o[Un(c[y])];k===n&&(y=b,k=p),o=xi(k)?k.call(o):k}return o}function dW(o,c,p){return o==null?o:ta(o,c,p)}function fW(o,c,p,y){return y=typeof y=="function"?y:n,o==null?o:ta(o,c,p,y)}var ax=_b(Ie),lx=_b(hn);function hW(o,c,p){var y=It(o),b=y||tr(o)||Cs(o);if(c=Dt(c,4),p==null){var k=o&&o.constructor;b?p=y?new k:[]:pe(o)?p=xi(k)?Ts(Kl(o)):{}:p={}}return(b?_n:ti)(o,function(E,I,W){return c(p,E,I,W)}),p}function pW(o,c){return o==null?!0:Bf(o,c)}function mW(o,c,p){return o==null?o:eb(o,c,Uf(p))}function gW(o,c,p,y){return y=typeof y=="function"?y:n,o==null?o:eb(o,c,Uf(p),y)}function Os(o){return o==null?[]:_f(o,Ie(o))}function yW(o){return o==null?[]:_f(o,hn(o))}function _W(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 bW(o,c,p){return c=wi(c),p===n?(p=c,c=0):p=wi(p),o=In(o),Mz(o,c,p)}function xW(o,c,p){if(p&&typeof p!="boolean"&&nn(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=E_();return Xe(o+b*(c-o+Ke("1e-"+((b+"").length-1))),c)}return If(o,c)}var wW=Ms(function(o,c,p){return c=c.toLowerCase(),o+(p?cx(c):c)});function cx(o){return lh(Xt(o).toLowerCase())}function ux(o){return o=Xt(o),o&&o.replace(qd,fF).replace(af,"")}function vW(o,c,p){o=Xt(o),c=xn(c);var y=o.length;p=p===n?y:Er(Bt(p),0,y);var b=p;return p-=c.length,p>=0&&o.slice(p,b)==c}function SW(o){return o=Xt(o),o&&Rd.test(o)?o.replace(xl,hF):o}function TW(o){return o=Xt(o),o&&Nd.test(o)?o.replace(Lo,"\\$&"):o}var kW=Ms(function(o,c,p){return o+(p?"-":"")+c.toLowerCase()}),MW=Ms(function(o,c,p){return o+(p?" ":"")+c.toLowerCase()}),DW=fb("toLowerCase");function CW(o,c,p){o=Xt(o),c=Bt(c);var y=c?bs(o):0;if(!c||y>=c)return o;var b=(c-y)/2;return fc(Jl(b),p)+o+fc(Ql(b),p)}function OW(o,c,p){o=Xt(o),c=Bt(c);var y=c?bs(o):0;return c&&y<c?o+fc(c-y,p):o}function AW(o,c,p){o=Xt(o),c=Bt(c);var y=c?bs(o):0;return c&&y<c?fc(c-y,p)+o:o}function EW(o,c,p){return p||c==null?c=0:c&&(c=+c),zF(Xt(o).replace(No,""),c||0)}function RW(o,c,p){return(p?nn(o,c,p):c===n)?c=1:c=Bt(c),Lf(Xt(o),c)}function PW(){var o=arguments,c=Xt(o[0]);return o.length<3?c:c.replace(o[1],o[2])}var IW=Ms(function(o,c,p){return o+(p?"_":"")+c.toLowerCase()});function LW(o,c,p){return p&&typeof p!="number"&&nn(o,c,p)&&(c=p=n),p=p===n?B:p>>>0,p?(o=Xt(o),o&&(typeof c=="string"||c!=null&&!rh(c))&&(c=xn(c),!c&&_s(o))?Ji(Fn(o),0,p):o.split(c,p)):[]}var NW=Ms(function(o,c,p){return o+(p?" ":"")+lh(c)});function BW(o,c,p){return o=Xt(o),p=p==null?0:Er(Bt(p),0,o.length),c=xn(c),o.slice(p,p+c.length)==c}function FW(o,c,p){var y=T.templateSettings;p&&nn(o,c,p)&&(c=n),o=Xt(o),c=sh({},c,y,bb);var b=sh({},c.imports,y.imports,bb),k=Ie(b),E=_f(b,k);_n(k,function(Mt){if(vl.test(Mt))throw new At(u)});var I,W,Q=0,J=c.interpolate||ls,nt="__p += '",ft=xf((c.escape||ls).source+"|"+J.source+"|"+(J===Io?Vi:ls).source+"|"+(c.evaluate||ls).source+"|$","g"),wt="//# sourceURL="+(Kt.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++uf+"]")+`
9
+ `)}function dU(o){return It(o)||Lr(o)||!!(Oy&&o&&o[Oy])}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 nn(o,c,p){if(!pe(p))return!1;var _=typeof c;return(_=="number"?fn(p)&&bi(c,p.length):_=="string"&&c in p)?Hn(p[c],o):!1}function Kf(o,c){if(It(o))return!1;var p=typeof o;return p=="number"||p=="symbol"||p=="boolean"||o==null||wn(o)?!0:hi.test(o)||!wl.test(o)||c!=null&&o in re(c)}function fU(o){var c=typeof o;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?o!=="__proto__":o===null}function Xf(o){var c=pc(o),p=T[c];if(typeof p!="function"||!(c in Ht.prototype))return!1;if(o===p)return!0;var _=qf(p);return!!_&&o===_[0]}function hU(o){return!!ky&&ky in o}var pU=Vl?xi:ph;function na(o){var c=o&&o.constructor,p=typeof c=="function"&&c.prototype||ws;return o===p}function kb(o){return o===o&&!pe(o)}function Mb(o,c){return function(p){return p==null?!1:p[o]===c&&(c!==n||o in re(p))}}function mU(o){var c=xc(o,function(_){return p.size===h&&p.clear(),_}),p=c.cache;return c}function gU(o,c){var p=o[1],_=c[1],b=p|_,k=b<(O|A|D),E=_==D&&p==L||_==D&&p==w&&o[7].length<=c[8]||_==(D|w)&&c[7].length<=c[8]&&p==L;if(!(k||E))return o;_&O&&(o[2]=c[2],b|=p&O?0:P);var I=c[3];if(I){var W=o[3];o[3]=W?lb(W,I,c[4]):I,o[4]=W?Gi(o[3],m):c[4]}return I=c[5],I&&(W=o[5],o[5]=W?cb(W,I,c[6]):I,o[6]=W?Gi(o[5],m):c[6]),I=c[7],I&&(o[7]=I),_&D&&(o[8]=o[8]==null?c[8]:Xe(o[8],c[8])),o[9]==null&&(o[9]=c[9]),o[0]=c[0],o[1]=b,o}function _U(o){var c=[];if(o!=null)for(var p in re(o))c.push(p);return c}function yU(o){return ql.call(o)}function Db(o,c,p){return c=Ae(c===n?o.length-1:c,0),function(){for(var _=arguments,b=-1,k=Ae(_.length-c,0),E=q(k);++b<k;)E[b]=_[c+b];b=-1;for(var I=q(c+1);++b<c;)I[b]=_[b];return I[c]=p(E),_n(o,this,I)}}function Cb(o,c){return c.length<2?o:Rr(o,Rn(c,0,-1))}function bU(o,c){for(var p=o.length,_=Xe(c.length,p),b=dn(o);_--;){var k=c[_];o[_]=bi(k,p)?b[k]:n}return o}function Zf(o,c){if(!(c==="constructor"&&typeof o[c]=="function")&&c!="__proto__")return o[c]}var Ob=Eb(Qy),ia=IF||function(o,c){return ue.setTimeout(o,c)},Qf=Eb(Wz);function Ab(o,c,p){var _=c+"";return Qf(o,uU(_,xU(aU(_),p)))}function Eb(o){var c=0,p=0;return function(){var _=FF(),b=st-(_-p);if(p=_,b>0){if(++c>=V)return arguments[0]}else c=0;return o.apply(n,arguments)}}function gc(o,c){var p=-1,_=o.length,b=_-1;for(c=c===n?_:c;++p<c;){var k=If(p,b),E=o[k];o[k]=o[p],o[p]=E}return o.length=c,o}var Rb=mU(function(o){var c=[];return o.charCodeAt(0)===46&&c.push(""),o.replace(Ld,function(p,_,b,k){c.push(b?k.replace(Hd,"$1"):_||p)}),c});function Un(o){if(typeof o=="string"||wn(o))return o;var c=o+"";return c=="0"&&1/o==-Tt?"-0":c}function Ir(o){if(o!=null){try{return Yl.call(o)}catch{}try{return o+""}catch{}}return""}function xU(o,c){return yn(it,function(p){var _="_."+p[0];c&p[1]&&!Ul(o,_)&&o.push(_)}),o.sort()}function Pb(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 wU(o,c,p){(p?nn(o,c,p):c===n)?c=1:c=Ae(Bt(c),0);var _=o==null?0:o.length;if(!_||c<1)return[];for(var b=0,k=0,E=q(Ql(_/c));b<_;)E[k++]=Rn(o,b,b+=c);return E}function vU(o){for(var c=-1,p=o==null?0:o.length,_=0,b=[];++c<p;){var k=o[c];k&&(b[_++]=k)}return b}function SU(){var o=arguments.length;if(!o)return[];for(var c=q(o-1),p=arguments[0],_=o;_--;)c[_-1]=arguments[_];return ji(It(p)?dn(p):[p],Ue(c,1))}var TU=zt(function(o,c){return xe(o)?Zo(o,Ue(c,1,xe,!0)):[]}),kU=zt(function(o,c){var p=Pn(c);return xe(p)&&(p=n),xe(o)?Zo(o,Ue(c,1,xe,!0),Dt(p,2)):[]}),MU=zt(function(o,c){var p=Pn(c);return xe(p)&&(p=n),xe(o)?Zo(o,Ue(c,1,xe,!0),n,p):[]});function DU(o,c,p){var _=o==null?0:o.length;return _?(c=p||c===n?1:Bt(c),Rn(o,c<0?0:c,_)):[]}function CU(o,c,p){var _=o==null?0:o.length;return _?(c=p||c===n?1:Bt(c),c=_-c,Rn(o,0,c<0?0:c)):[]}function OU(o,c){return o&&o.length?lc(o,Dt(c,3),!0,!0):[]}function AU(o,c){return o&&o.length?lc(o,Dt(c,3),!0):[]}function EU(o,c,p,_){var b=o==null?0:o.length;return b?(p&&typeof p!="number"&&nn(o,c,p)&&(p=0,_=b),Sz(o,c,p,_)):[]}function Ib(o,c,p){var _=o==null?0:o.length;if(!_)return-1;var b=p==null?0:Bt(p);return b<0&&(b=Ae(_+b,0)),Hl(o,Dt(c,3),b)}function Lb(o,c,p){var _=o==null?0:o.length;if(!_)return-1;var b=_-1;return p!==n&&(b=Bt(p),b=p<0?Ae(_+b,0):Xe(b,_-1)),Hl(o,Dt(c,3),b,!0)}function Nb(o){var c=o==null?0:o.length;return c?Ue(o,1):[]}function RU(o){var c=o==null?0:o.length;return c?Ue(o,Tt):[]}function PU(o,c){var p=o==null?0:o.length;return p?(c=c===n?1:Bt(c),Ue(o,c)):[]}function IU(o){for(var c=-1,p=o==null?0:o.length,_={};++c<p;){var b=o[c];Jn(_,b[0],b[1])}return _}function Bb(o){return o&&o.length?o[0]:n}function LU(o,c,p){var _=o==null?0:o.length;if(!_)return-1;var b=p==null?0:Bt(p);return b<0&&(b=Ae(_+b,0)),_s(o,c,b)}function NU(o){var c=o==null?0:o.length;return c?Rn(o,0,-1):[]}var BU=zt(function(o){var c=de(o,zf);return c.length&&c[0]===o[0]?Of(c):[]}),FU=zt(function(o){var c=Pn(o),p=de(o,zf);return c===Pn(p)?c=n:p.pop(),p.length&&p[0]===o[0]?Of(p,Dt(c,2)):[]}),zU=zt(function(o){var c=Pn(o),p=de(o,zf);return c=typeof c=="function"?c:n,c&&p.pop(),p.length&&p[0]===o[0]?Of(p,n,c):[]});function UU(o,c){return o==null?"":NF.call(o,c)}function Pn(o){var c=o==null?0:o.length;return c?o[c-1]:n}function HU(o,c,p){var _=o==null?0:o.length;if(!_)return-1;var b=_;return p!==n&&(b=Bt(p),b=b<0?Ae(_+b,0):Xe(b,_-1)),c===c?xF(o,c,b):Hl(o,_y,b,!0)}function WU(o,c){return o&&o.length?Gy(o,Bt(c)):n}var $U=zt(Fb);function Fb(o,c){return o&&o.length&&c&&c.length?Pf(o,c):o}function VU(o,c,p){return o&&o.length&&c&&c.length?Pf(o,c,Dt(p,2)):o}function YU(o,c,p){return o&&o.length&&c&&c.length?Pf(o,c,n,p):o}var qU=yi(function(o,c){var p=o==null?0:o.length,_=kf(o,c);return Zy(o,de(c,function(b){return bi(b,p)?+b:b}).sort(ab)),_});function jU(o,c){var p=[];if(!(o&&o.length))return p;var _=-1,b=[],k=o.length;for(c=Dt(c,3);++_<k;){var E=o[_];c(E,_,o)&&(p.push(E),b.push(_))}return Zy(o,b),p}function Jf(o){return o==null?o:UF.call(o)}function GU(o,c,p){var _=o==null?0:o.length;return _?(p&&typeof p!="number"&&nn(o,c,p)?(c=0,p=_):(c=c==null?0:Bt(c),p=p===n?_:Bt(p)),Rn(o,c,p)):[]}function KU(o,c){return ac(o,c)}function XU(o,c,p){return Nf(o,c,Dt(p,2))}function ZU(o,c){var p=o==null?0:o.length;if(p){var _=ac(o,c);if(_<p&&Hn(o[_],c))return _}return-1}function QU(o,c){return ac(o,c,!0)}function JU(o,c,p){return Nf(o,c,Dt(p,2),!0)}function t5(o,c){var p=o==null?0:o.length;if(p){var _=ac(o,c,!0)-1;if(Hn(o[_],c))return _}return-1}function e5(o){return o&&o.length?Jy(o):[]}function n5(o,c){return o&&o.length?Jy(o,Dt(c,2)):[]}function i5(o){var c=o==null?0:o.length;return c?Rn(o,1,c):[]}function r5(o,c,p){return o&&o.length?(c=p||c===n?1:Bt(c),Rn(o,0,c<0?0:c)):[]}function s5(o,c,p){var _=o==null?0:o.length;return _?(c=p||c===n?1:Bt(c),c=_-c,Rn(o,c<0?0:c,_)):[]}function o5(o,c){return o&&o.length?lc(o,Dt(c,3),!1,!0):[]}function a5(o,c){return o&&o.length?lc(o,Dt(c,3)):[]}var l5=zt(function(o){return Zi(Ue(o,1,xe,!0))}),c5=zt(function(o){var c=Pn(o);return xe(c)&&(c=n),Zi(Ue(o,1,xe,!0),Dt(c,2))}),u5=zt(function(o){var c=Pn(o);return c=typeof c=="function"?c:n,Zi(Ue(o,1,xe,!0),n,c)});function d5(o){return o&&o.length?Zi(o):[]}function f5(o,c){return o&&o.length?Zi(o,Dt(c,2)):[]}function h5(o,c){return c=typeof c=="function"?c:n,o&&o.length?Zi(o,n,c):[]}function th(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}),_f(c,function(p){return de(o,pf(p))})}function zb(o,c){if(!(o&&o.length))return[];var p=th(o);return c==null?p:de(p,function(_){return _n(c,n,_)})}var p5=zt(function(o,c){return xe(o)?Zo(o,c):[]}),m5=zt(function(o){return Ff(qi(o,xe))}),g5=zt(function(o){var c=Pn(o);return xe(c)&&(c=n),Ff(qi(o,xe),Dt(c,2))}),_5=zt(function(o){var c=Pn(o);return c=typeof c=="function"?c:n,Ff(qi(o,xe),n,c)}),y5=zt(th);function b5(o,c){return ib(o||[],c||[],Xo)}function x5(o,c){return ib(o||[],c||[],ta)}var w5=zt(function(o){var c=o.length,p=c>1?o[c-1]:n;return p=typeof p=="function"?(o.pop(),p):n,zb(o,p)});function Ub(o){var c=T(o);return c.__chain__=!0,c}function v5(o,c){return c(o),o}function _c(o,c){return c(o)}var S5=yi(function(o){var c=o.length,p=c?o[0]:0,_=this.__wrapped__,b=function(k){return kf(k,o)};return c>1||this.__actions__.length||!(_ instanceof Ht)||!bi(p)?this.thru(b):(_=_.slice(p,+p+(c?1:0)),_.__actions__.push({func:_c,args:[b],thisArg:n}),new An(_,this.__chain__).thru(function(k){return c&&!k.length&&k.push(n),k}))});function T5(){return Ub(this)}function k5(){return new An(this.value(),this.__chain__)}function M5(){this.__values__===n&&(this.__values__=tx(this.value()));var o=this.__index__>=this.__values__.length,c=o?n:this.__values__[this.__index__++];return{done:o,value:c}}function D5(){return this}function C5(o){for(var c,p=this;p instanceof nc;){var _=Pb(p);_.__index__=0,_.__values__=n,c?b.__wrapped__=_:c=_;var b=_;p=p.__wrapped__}return b.__wrapped__=o,c}function O5(){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:_c,args:[Jf],thisArg:n}),new An(c,this.__chain__)}return this.thru(Jf)}function A5(){return nb(this.__wrapped__,this.__actions__)}var E5=cc(function(o,c,p){Kt.call(o,p)?++o[p]:Jn(o,p,1)});function R5(o,c,p){var _=It(o)?my:vz;return p&&nn(o,c,p)&&(c=n),_(o,Dt(c,3))}function P5(o,c){var p=It(o)?qi:zy;return p(o,Dt(c,3))}var I5=hb(Ib),L5=hb(Lb);function N5(o,c){return Ue(yc(o,c),1)}function B5(o,c){return Ue(yc(o,c),Tt)}function F5(o,c,p){return p=p===n?1:Bt(p),Ue(yc(o,c),p)}function Hb(o,c){var p=It(o)?yn:Xi;return p(o,Dt(c,3))}function Wb(o,c){var p=It(o)?iF:Fy;return p(o,Dt(c,3))}var z5=cc(function(o,c,p){Kt.call(o,p)?o[p].push(c):Jn(o,p,[c])});function U5(o,c,p,_){o=fn(o)?o:Os(o),p=p&&!_?Bt(p):0;var b=o.length;return p<0&&(p=Ae(b+p,0)),Sc(o)?p<=b&&o.indexOf(c,p)>-1:!!b&&_s(o,c,p)>-1}var H5=zt(function(o,c,p){var _=-1,b=typeof c=="function",k=fn(o)?q(o.length):[];return Xi(o,function(E){k[++_]=b?_n(c,E,p):Qo(E,c,p)}),k}),W5=cc(function(o,c,p){Jn(o,p,c)});function yc(o,c){var p=It(o)?de:Yy;return p(o,Dt(c,3))}function $5(o,c,p,_){return o==null?[]:(It(c)||(c=c==null?[]:[c]),p=_?n:p,It(p)||(p=p==null?[]:[p]),Ky(o,c,p))}var V5=cc(function(o,c,p){o[p?0:1].push(c)},function(){return[[],[]]});function Y5(o,c,p){var _=It(o)?ff:by,b=arguments.length<3;return _(o,Dt(c,4),p,b,Xi)}function q5(o,c,p){var _=It(o)?rF:by,b=arguments.length<3;return _(o,Dt(c,4),p,b,Fy)}function j5(o,c){var p=It(o)?qi:zy;return p(o,wc(Dt(c,3)))}function G5(o){var c=It(o)?Iy:Uz;return c(o)}function K5(o,c,p){(p?nn(o,c,p):c===n)?c=1:c=Bt(c);var _=It(o)?_z:Hz;return _(o,c)}function X5(o){var c=It(o)?yz:$z;return c(o)}function Z5(o){if(o==null)return 0;if(fn(o))return Sc(o)?bs(o):o.length;var c=Ze(o);return c==et||c==ee?o.size:Ef(o).length}function Q5(o,c,p){var _=It(o)?hf:Vz;return p&&nn(o,c,p)&&(c=n),_(o,Dt(c,3))}var J5=zt(function(o,c){if(o==null)return[];var p=c.length;return p>1&&nn(o,c[0],c[1])?c=[]:p>2&&nn(c[0],c[1],c[2])&&(c=[c[0]]),Ky(o,Ue(c,1),[])}),bc=PF||function(){return ue.Date.now()};function tH(o,c){if(typeof c!="function")throw new On(a);return o=Bt(o),function(){if(--o<1)return c.apply(this,arguments)}}function $b(o,c,p){return c=p?n:c,c=o&&c==null?o.length:c,_i(o,D,n,n,n,n,c)}function Vb(o,c){var p;if(typeof c!="function")throw new On(a);return o=Bt(o),function(){return--o>0&&(p=c.apply(this,arguments)),o<=1&&(c=n),p}}var eh=zt(function(o,c,p){var _=O;if(p.length){var b=Gi(p,Ds(eh));_|=F}return _i(o,_,c,p,b)}),Yb=zt(function(o,c,p){var _=O|A;if(p.length){var b=Gi(p,Ds(Yb));_|=F}return _i(c,_,o,p,b)});function qb(o,c,p){c=p?n:c;var _=_i(o,L,n,n,n,n,n,c);return _.placeholder=qb.placeholder,_}function jb(o,c,p){c=p?n:c;var _=_i(o,R,n,n,n,n,n,c);return _.placeholder=jb.placeholder,_}function Gb(o,c,p){var _,b,k,E,I,W,Q=0,J=!1,nt=!1,ft=!0;if(typeof o!="function")throw new On(a);c=In(c)||0,pe(p)&&(J=!!p.leading,nt="maxWait"in p,k=nt?Ae(In(p.maxWait)||0,c):k,ft="trailing"in p?!!p.trailing:ft);function wt(we){var Wn=_,vi=b;return _=b=n,Q=we,E=o.apply(vi,Wn),E}function Ct(we){return Q=we,I=ia(Ut,c),J?wt(we):E}function Ft(we){var Wn=we-W,vi=we-Q,px=c-Wn;return nt?Xe(px,k-vi):px}function Mt(we){var Wn=we-W,vi=we-Q;return W===n||Wn>=c||Wn<0||nt&&vi>=k}function Ut(){var we=bc();if(Mt(we))return Wt(we);I=ia(Ut,Ft(we))}function Wt(we){return I=n,ft&&_?wt(we):(_=b=n,E)}function vn(){I!==n&&rb(I),Q=0,_=W=b=I=n}function rn(){return I===n?E:Wt(bc())}function Sn(){var we=bc(),Wn=Mt(we);if(_=arguments,b=this,W=we,Wn){if(I===n)return Ct(W);if(nt)return rb(I),I=ia(Ut,c),wt(W)}return I===n&&(I=ia(Ut,c)),E}return Sn.cancel=vn,Sn.flush=rn,Sn}var eH=zt(function(o,c){return By(o,1,c)}),nH=zt(function(o,c,p){return By(o,In(c)||0,p)});function iH(o){return _i(o,C)}function xc(o,c){if(typeof o!="function"||c!=null&&typeof c!="function")throw new On(a);var p=function(){var _=arguments,b=c?c.apply(this,_):_[0],k=p.cache;if(k.has(b))return k.get(b);var E=o.apply(this,_);return p.cache=k.set(b,E)||k,E};return p.cache=new(xc.Cache||gi),p}xc.Cache=gi;function wc(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 rH(o){return Vb(2,o)}var sH=Yz(function(o,c){c=c.length==1&&It(c[0])?de(c[0],bn(Dt())):de(Ue(c,1),bn(Dt()));var p=c.length;return zt(function(_){for(var b=-1,k=Xe(_.length,p);++b<k;)_[b]=c[b].call(this,_[b]);return _n(o,this,_)})}),nh=zt(function(o,c){var p=Gi(c,Ds(nh));return _i(o,F,n,c,p)}),Kb=zt(function(o,c){var p=Gi(c,Ds(Kb));return _i(o,U,n,c,p)}),oH=yi(function(o,c){return _i(o,w,n,n,n,c)});function aH(o,c){if(typeof o!="function")throw new On(a);return c=c===n?c:Bt(c),zt(o,c)}function lH(o,c){if(typeof o!="function")throw new On(a);return c=c==null?0:Ae(Bt(c),0),zt(function(p){var _=p[c],b=Ji(p,0,c);return _&&ji(b,_),_n(o,this,b)})}function cH(o,c,p){var _=!0,b=!0;if(typeof o!="function")throw new On(a);return pe(p)&&(_="leading"in p?!!p.leading:_,b="trailing"in p?!!p.trailing:b),Gb(o,c,{leading:_,maxWait:c,trailing:b})}function uH(o){return $b(o,1)}function dH(o,c){return nh(Uf(c),o)}function fH(){if(!arguments.length)return[];var o=arguments[0];return It(o)?o:[o]}function hH(o){return En(o,x)}function pH(o,c){return c=typeof c=="function"?c:n,En(o,x,c)}function mH(o){return En(o,g|x)}function gH(o,c){return c=typeof c=="function"?c:n,En(o,g|x,c)}function _H(o,c){return c==null||Ny(o,c,Ie(c))}function Hn(o,c){return o===c||o!==o&&c!==c}var yH=hc(Cf),bH=hc(function(o,c){return o>=c}),Lr=Wy((function(){return arguments})())?Wy:function(o){return _e(o)&&Kt.call(o,"callee")&&!Cy.call(o,"callee")},It=q.isArray,xH=cy?bn(cy):Cz;function fn(o){return o!=null&&vc(o.length)&&!xi(o)}function xe(o){return _e(o)&&fn(o)}function wH(o){return o===!0||o===!1||_e(o)&&en(o)==ot}var tr=LF||ph,vH=uy?bn(uy):Oz;function SH(o){return _e(o)&&o.nodeType===1&&!ra(o)}function TH(o){if(o==null)return!0;if(fn(o)&&(It(o)||typeof o=="string"||typeof o.splice=="function"||tr(o)||Cs(o)||Lr(o)))return!o.length;var c=Ze(o);if(c==et||c==ee)return!o.size;if(na(o))return!Ef(o).length;for(var p in o)if(Kt.call(o,p))return!1;return!0}function kH(o,c){return Jo(o,c)}function MH(o,c,p){p=typeof p=="function"?p:n;var _=p?p(o,c):n;return _===n?Jo(o,c,n,p):!!_}function ih(o){if(!_e(o))return!1;var c=en(o);return c==bt||c==lt||typeof o.message=="string"&&typeof o.name=="string"&&!ra(o)}function DH(o){return typeof o=="number"&&Ay(o)}function xi(o){if(!pe(o))return!1;var c=en(o);return c==Rt||c==j||c==X||c==Me}function Xb(o){return typeof o=="number"&&o==Bt(o)}function vc(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 _e(o){return o!=null&&typeof o=="object"}var Zb=dy?bn(dy):Ez;function CH(o,c){return o===c||Af(o,c,jf(c))}function OH(o,c,p){return p=typeof p=="function"?p:n,Af(o,c,jf(c),p)}function AH(o){return Qb(o)&&o!=+o}function EH(o){if(pU(o))throw new At(s);return $y(o)}function RH(o){return o===null}function PH(o){return o==null}function Qb(o){return typeof o=="number"||_e(o)&&en(o)==rt}function ra(o){if(!_e(o)||en(o)!=_t)return!1;var c=Kl(o);if(c===null)return!0;var p=Kt.call(c,"constructor")&&c.constructor;return typeof p=="function"&&p instanceof p&&Yl.call(p)==OF}var rh=fy?bn(fy):Rz;function IH(o){return Xb(o)&&o>=-at&&o<=at}var Jb=hy?bn(hy):Pz;function Sc(o){return typeof o=="string"||!It(o)&&_e(o)&&en(o)==je}function wn(o){return typeof o=="symbol"||_e(o)&&en(o)==Yt}var Cs=py?bn(py):Iz;function LH(o){return o===n}function NH(o){return _e(o)&&Ze(o)==se}function BH(o){return _e(o)&&en(o)==De}var FH=hc(Rf),zH=hc(function(o,c){return o<=c});function tx(o){if(!o)return[];if(fn(o))return Sc(o)?Fn(o):dn(o);if(Yo&&o[Yo])return _F(o[Yo]());var c=Ze(o),p=c==et?bf:c==ee?Wl:Os;return p(o)}function wi(o){if(!o)return o===0?o:0;if(o=In(o),o===Tt||o===-Tt){var c=o<0?-1:1;return c*pt}return o===o?o:0}function Bt(o){var c=wi(o),p=c%1;return c===c?p?c-p:c:0}function ex(o){return o?Er(Bt(o),0,B):0}function In(o){if(typeof o=="number")return o;if(wn(o))return G;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=xy(o);var p=$d.test(o);return p||Yd.test(o)?Bn(o.slice(2),p?2:8):Wd.test(o)?G:+o}function nx(o){return ei(o,hn(o))}function UH(o){return o?Er(Bt(o),-at,at):o===0?o:0}function Xt(o){return o==null?"":xn(o)}var HH=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])}),ix=ks(function(o,c){ei(c,hn(c),o)}),rx=ks(function(o,c,p,_){ei(c,hn(c),o,_)}),sh=ks(function(o,c,p,_){ei(c,Ie(c),o,_)}),WH=yi(kf);function $H(o,c){var p=Ts(o);return c==null?p:Ly(p,c)}var VH=zt(function(o,c){o=re(o);var p=-1,_=c.length,b=_>2?c[2]:n;for(b&&nn(c[0],c[1],b)&&(_=1);++p<_;)for(var k=c[p],E=hn(k),I=-1,W=E.length;++I<W;){var Q=E[I],J=o[Q];(J===n||Hn(J,ws[Q])&&!Kt.call(o,Q))&&(o[Q]=k[Q])}return o}),YH=zt(function(o){return o.push(n,xb),_n(sx,n,o)});function qH(o,c){return gy(o,Dt(c,3),ti)}function jH(o,c){return gy(o,Dt(c,3),Df)}function GH(o,c){return o==null?o:Mf(o,Dt(c,3),hn)}function KH(o,c){return o==null?o:Uy(o,Dt(c,3),hn)}function XH(o,c){return o&&ti(o,Dt(c,3))}function ZH(o,c){return o&&Df(o,Dt(c,3))}function QH(o){return o==null?[]:sc(o,Ie(o))}function JH(o){return o==null?[]:sc(o,hn(o))}function oh(o,c,p){var _=o==null?n:Rr(o,c);return _===n?p:_}function tW(o,c){return o!=null&&Sb(o,c,Tz)}function ah(o,c){return o!=null&&Sb(o,c,kz)}var eW=mb(function(o,c,p){c!=null&&typeof c.toString!="function"&&(c=ql.call(c)),o[c]=p},ch(pn)),nW=mb(function(o,c,p){c!=null&&typeof c.toString!="function"&&(c=ql.call(c)),Kt.call(o,c)?o[c].push(p):o[c]=[p]},Dt),iW=zt(Qo);function Ie(o){return fn(o)?Py(o):Ef(o)}function hn(o){return fn(o)?Py(o,!0):Lz(o)}function rW(o,c){var p={};return c=Dt(c,3),ti(o,function(_,b,k){Jn(p,c(_,b,k),_)}),p}function sW(o,c){var p={};return c=Dt(c,3),ti(o,function(_,b,k){Jn(p,b,c(_,b,k))}),p}var oW=ks(function(o,c,p){oc(o,c,p)}),sx=ks(function(o,c,p,_){oc(o,c,p,_)}),aW=yi(function(o,c){var p={};if(o==null)return p;var _=!1;c=de(c,function(k){return k=Qi(k,o),_||(_=k.length>1),k}),ei(o,Yf(o),p),_&&(p=En(p,g|y|x,nU));for(var b=c.length;b--;)Bf(p,c[b]);return p});function lW(o,c){return ox(o,wc(Dt(c)))}var cW=yi(function(o,c){return o==null?{}:Bz(o,c)});function ox(o,c){if(o==null)return{};var p=de(Yf(o),function(_){return[_]});return c=Dt(c),Xy(o,p,function(_,b){return c(_,b[0])})}function uW(o,c,p){c=Qi(c,o);var _=-1,b=c.length;for(b||(b=1,o=n);++_<b;){var k=o==null?n:o[Un(c[_])];k===n&&(_=b,k=p),o=xi(k)?k.call(o):k}return o}function dW(o,c,p){return o==null?o:ta(o,c,p)}function fW(o,c,p,_){return _=typeof _=="function"?_:n,o==null?o:ta(o,c,p,_)}var ax=yb(Ie),lx=yb(hn);function hW(o,c,p){var _=It(o),b=_||tr(o)||Cs(o);if(c=Dt(c,4),p==null){var k=o&&o.constructor;b?p=_?new k:[]:pe(o)?p=xi(k)?Ts(Kl(o)):{}:p={}}return(b?yn:ti)(o,function(E,I,W){return c(p,E,I,W)}),p}function pW(o,c){return o==null?!0:Bf(o,c)}function mW(o,c,p){return o==null?o:eb(o,c,Uf(p))}function gW(o,c,p,_){return _=typeof _=="function"?_:n,o==null?o:eb(o,c,Uf(p),_)}function Os(o){return o==null?[]:yf(o,Ie(o))}function _W(o){return o==null?[]:yf(o,hn(o))}function yW(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 bW(o,c,p){return c=wi(c),p===n?(p=c,c=0):p=wi(p),o=In(o),Mz(o,c,p)}function xW(o,c,p){if(p&&typeof p!="boolean"&&nn(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 _=o;o=c,c=_}if(p||o%1||c%1){var b=Ey();return Xe(o+b*(c-o+Ke("1e-"+((b+"").length-1))),c)}return If(o,c)}var wW=Ms(function(o,c,p){return c=c.toLowerCase(),o+(p?cx(c):c)});function cx(o){return lh(Xt(o).toLowerCase())}function ux(o){return o=Xt(o),o&&o.replace(qd,fF).replace(af,"")}function vW(o,c,p){o=Xt(o),c=xn(c);var _=o.length;p=p===n?_:Er(Bt(p),0,_);var b=p;return p-=c.length,p>=0&&o.slice(p,b)==c}function SW(o){return o=Xt(o),o&&Rd.test(o)?o.replace(xl,hF):o}function TW(o){return o=Xt(o),o&&Nd.test(o)?o.replace(Lo,"\\$&"):o}var kW=Ms(function(o,c,p){return o+(p?"-":"")+c.toLowerCase()}),MW=Ms(function(o,c,p){return o+(p?" ":"")+c.toLowerCase()}),DW=fb("toLowerCase");function CW(o,c,p){o=Xt(o),c=Bt(c);var _=c?bs(o):0;if(!c||_>=c)return o;var b=(c-_)/2;return fc(Jl(b),p)+o+fc(Ql(b),p)}function OW(o,c,p){o=Xt(o),c=Bt(c);var _=c?bs(o):0;return c&&_<c?o+fc(c-_,p):o}function AW(o,c,p){o=Xt(o),c=Bt(c);var _=c?bs(o):0;return c&&_<c?fc(c-_,p)+o:o}function EW(o,c,p){return p||c==null?c=0:c&&(c=+c),zF(Xt(o).replace(No,""),c||0)}function RW(o,c,p){return(p?nn(o,c,p):c===n)?c=1:c=Bt(c),Lf(Xt(o),c)}function PW(){var o=arguments,c=Xt(o[0]);return o.length<3?c:c.replace(o[1],o[2])}var IW=Ms(function(o,c,p){return o+(p?"_":"")+c.toLowerCase()});function LW(o,c,p){return p&&typeof p!="number"&&nn(o,c,p)&&(c=p=n),p=p===n?B:p>>>0,p?(o=Xt(o),o&&(typeof c=="string"||c!=null&&!rh(c))&&(c=xn(c),!c&&ys(o))?Ji(Fn(o),0,p):o.split(c,p)):[]}var NW=Ms(function(o,c,p){return o+(p?" ":"")+lh(c)});function BW(o,c,p){return o=Xt(o),p=p==null?0:Er(Bt(p),0,o.length),c=xn(c),o.slice(p,p+c.length)==c}function FW(o,c,p){var _=T.templateSettings;p&&nn(o,c,p)&&(c=n),o=Xt(o),c=sh({},c,_,bb);var b=sh({},c.imports,_.imports,bb),k=Ie(b),E=yf(b,k);yn(k,function(Mt){if(vl.test(Mt))throw new At(u)});var I,W,Q=0,J=c.interpolate||ls,nt="__p += '",ft=xf((c.escape||ls).source+"|"+J.source+"|"+(J===Io?Vi:ls).source+"|"+(c.evaluate||ls).source+"|$","g"),wt="//# sourceURL="+(Kt.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++uf+"]")+`
10
10
  `;o.replace(ft,function(Mt,Ut,Wt,vn,rn,Sn){return Wt||(Wt=vn),nt+=o.slice(Q,Sn).replace(jd,pF),Ut&&(I=!0,nt+=`' +
11
11
  __e(`+Ut+`) +
12
12
  '`),rn&&(W=!0,nt+=`';
@@ -23,14 +23,14 @@ __p += '`),Wt&&(nt+=`' +
23
23
  function print() { __p += __j.call(arguments, '') }
24
24
  `:`;
25
25
  `)+nt+`return __p
26
- }`;var Ft=fx(function(){return qt(k,wt+"return "+nt).apply(n,E)});if(Ft.source=nt,ih(Ft))throw Ft;return Ft}function zW(o){return Xt(o).toLowerCase()}function UW(o){return Xt(o).toUpperCase()}function HW(o,c,p){if(o=Xt(o),o&&(p||c===n))return x_(o);if(!o||!(c=xn(c)))return o;var y=Fn(o),b=Fn(c),k=w_(y,b),E=v_(y,b)+1;return Ji(y,k,E).join("")}function WW(o,c,p){if(o=Xt(o),o&&(p||c===n))return o.slice(0,T_(o)+1);if(!o||!(c=xn(c)))return o;var y=Fn(o),b=v_(y,Fn(c))+1;return Ji(y,0,b).join("")}function $W(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=w_(y,Fn(c));return Ji(y,b).join("")}function VW(o,c){var p=N,y=$;if(pe(c)){var b="separator"in c?c.separator:b;p="length"in c?Bt(c.length):p,y="omission"in c?xn(c.omission):y}o=Xt(o);var k=o.length;if(_s(o)){var E=Fn(o);k=E.length}if(p>=k)return o;var I=p-bs(y);if(I<1)return y;var W=E?Ji(E,0,I).join(""):o.slice(0,I);if(b===n)return W+y;if(E&&(I+=W.length-I),rh(b)){if(o.slice(I).search(b)){var Q,J=W;for(b.global||(b=xf(b.source,Xt(Sl.exec(b))+"g")),b.lastIndex=0;Q=b.exec(J);)var nt=Q.index;W=W.slice(0,nt===n?I:nt)}}else if(o.indexOf(xn(b),I)!=I){var ft=W.lastIndexOf(b);ft>-1&&(W=W.slice(0,ft))}return W+y}function YW(o){return o=Xt(o),o&&Ed.test(o)?o.replace($i,wF):o}var qW=Ms(function(o,c,p){return o+(p?" ":"")+c.toUpperCase()}),lh=fb("toUpperCase");function dx(o,c,p){return o=Xt(o),c=p?n:c,c===n?gF(o)?TF(o):aF(o):o.match(c)||[]}var fx=zt(function(o,c){try{return yn(o,n,c)}catch(p){return ih(p)?p:new At(p)}}),jW=_i(function(o,c){return _n(c,function(p){p=Un(p),Jn(o,p,eh(o[p],o))}),o});function GW(o){var c=o==null?0:o.length,p=Dt();return o=c?de(o,function(y){if(typeof y[1]!="function")throw new On(a);return[p(y[0]),y[1]]}):[],zt(function(y){for(var b=-1;++b<c;){var k=o[b];if(yn(k[0],this,y))return yn(k[1],this,y)}})}function KW(o){return wz(En(o,g))}function ch(o){return function(){return o}}function XW(o,c){return o==null||o!==o?c:o}var ZW=pb(),QW=pb(!0);function pn(o){return o}function uh(o){return V_(typeof o=="function"?o:En(o,g))}function JW(o){return q_(En(o,g))}function t3(o,c){return j_(o,En(c,g))}var e3=zt(function(o,c){return function(p){return Qo(p,o,c)}}),n3=zt(function(o,c){return function(p){return Qo(o,p,c)}});function dh(o,c,p){var y=Ie(c),b=sc(c,y);p==null&&!(pe(c)&&(b.length||!y.length))&&(p=c,c=o,o=this,b=sc(c,Ie(c)));var k=!(pe(p)&&"chain"in p)||!!p.chain,E=xi(o);return _n(b,function(I){var W=c[I];o[I]=W,E&&(o.prototype[I]=function(){var Q=this.__chain__;if(k||Q){var J=o(this.__wrapped__),nt=J.__actions__=dn(this.__actions__);return nt.push({func:W,args:arguments,thisArg:o}),J.__chain__=Q,J}return W.apply(o,ji([this.value()],arguments))})}),o}function i3(){return ue._===this&&(ue._=AF),this}function fh(){}function r3(o){return o=Bt(o),zt(function(c){return G_(c,o)})}var s3=Wf(de),o3=Wf(m_),a3=Wf(hf);function hx(o){return Kf(o)?pf(Un(o)):Fz(o)}function l3(o){return function(c){return o==null?n:Rr(o,c)}}var c3=gb(),u3=gb(!0);function hh(){return[]}function ph(){return!1}function d3(){return{}}function f3(){return""}function h3(){return!0}function p3(o,c){if(o=Bt(o),o<1||o>at)return[];var p=B,y=Xe(o,B);c=Dt(c),o-=B;for(var b=yf(y,c);++p<o;)c(p);return b}function m3(o){return It(o)?de(o,Un):wn(o)?[o]:dn(Rb(Xt(o)))}function g3(o){var c=++CF;return Xt(o)+c}var y3=dc(function(o,c){return o+c},0),_3=$f("ceil"),b3=dc(function(o,c){return o/c},1),x3=$f("floor");function w3(o){return o&&o.length?rc(o,pn,Cf):n}function v3(o,c){return o&&o.length?rc(o,Dt(c,2),Cf):n}function S3(o){return __(o,pn)}function T3(o,c){return __(o,Dt(c,2))}function k3(o){return o&&o.length?rc(o,pn,Rf):n}function M3(o,c){return o&&o.length?rc(o,Dt(c,2),Rf):n}var D3=dc(function(o,c){return o*c},1),C3=$f("round"),O3=dc(function(o,c){return o-c},0);function A3(o){return o&&o.length?gf(o,pn):0}function E3(o,c){return o&&o.length?gf(o,Dt(c,2)):0}return T.after=tH,T.ary=$b,T.assign=HH,T.assignIn=ix,T.assignInWith=rx,T.assignWith=sh,T.at=WH,T.before=Vb,T.bind=eh,T.bindAll=jW,T.bindKey=Yb,T.castArray=fH,T.chain=Ub,T.chunk=wU,T.compact=vU,T.concat=SU,T.cond=GW,T.conforms=KW,T.constant=ch,T.countBy=E5,T.create=$H,T.curry=qb,T.curryRight=jb,T.debounce=Gb,T.defaults=VH,T.defaultsDeep=YH,T.defer=eH,T.delay=nH,T.difference=TU,T.differenceBy=kU,T.differenceWith=MU,T.drop=DU,T.dropRight=CU,T.dropRightWhile=OU,T.dropWhile=AU,T.fill=EU,T.filter=P5,T.flatMap=N5,T.flatMapDeep=B5,T.flatMapDepth=F5,T.flatten=Nb,T.flattenDeep=RU,T.flattenDepth=PU,T.flip=iH,T.flow=ZW,T.flowRight=QW,T.fromPairs=IU,T.functions=QH,T.functionsIn=JH,T.groupBy=z5,T.initial=NU,T.intersection=BU,T.intersectionBy=FU,T.intersectionWith=zU,T.invert=eW,T.invertBy=nW,T.invokeMap=H5,T.iteratee=uh,T.keyBy=W5,T.keys=Ie,T.keysIn=hn,T.map=_c,T.mapKeys=rW,T.mapValues=sW,T.matches=JW,T.matchesProperty=t3,T.memoize=xc,T.merge=oW,T.mergeWith=sx,T.method=e3,T.methodOf=n3,T.mixin=dh,T.negate=wc,T.nthArg=r3,T.omit=aW,T.omitBy=lW,T.once=rH,T.orderBy=$5,T.over=s3,T.overArgs=sH,T.overEvery=o3,T.overSome=a3,T.partial=nh,T.partialRight=Kb,T.partition=V5,T.pick=cW,T.pickBy=ox,T.property=hx,T.propertyOf=l3,T.pull=$U,T.pullAll=Fb,T.pullAllBy=VU,T.pullAllWith=YU,T.pullAt=qU,T.range=c3,T.rangeRight=u3,T.rearg=oH,T.reject=j5,T.remove=jU,T.rest=aH,T.reverse=Jf,T.sampleSize=K5,T.set=dW,T.setWith=fW,T.shuffle=X5,T.slice=GU,T.sortBy=J5,T.sortedUniq=e5,T.sortedUniqBy=n5,T.split=LW,T.spread=lH,T.tail=i5,T.take=r5,T.takeRight=s5,T.takeRightWhile=o5,T.takeWhile=a5,T.tap=v5,T.throttle=cH,T.thru=yc,T.toArray=tx,T.toPairs=ax,T.toPairsIn=lx,T.toPath=m3,T.toPlainObject=nx,T.transform=hW,T.unary=uH,T.union=l5,T.unionBy=c5,T.unionWith=u5,T.uniq=d5,T.uniqBy=f5,T.uniqWith=h5,T.unset=pW,T.unzip=th,T.unzipWith=zb,T.update=mW,T.updateWith=gW,T.values=Os,T.valuesIn=yW,T.without=p5,T.words=dx,T.wrap=dH,T.xor=m5,T.xorBy=g5,T.xorWith=y5,T.zip=_5,T.zipObject=b5,T.zipObjectDeep=x5,T.zipWith=w5,T.entries=ax,T.entriesIn=lx,T.extend=ix,T.extendWith=rx,dh(T,T),T.add=y3,T.attempt=fx,T.camelCase=wW,T.capitalize=cx,T.ceil=_3,T.clamp=_W,T.clone=hH,T.cloneDeep=mH,T.cloneDeepWith=gH,T.cloneWith=pH,T.conformsTo=yH,T.deburr=ux,T.defaultTo=XW,T.divide=b3,T.endsWith=vW,T.eq=Hn,T.escape=SW,T.escapeRegExp=TW,T.every=R5,T.find=I5,T.findIndex=Ib,T.findKey=qH,T.findLast=L5,T.findLastIndex=Lb,T.findLastKey=jH,T.floor=x3,T.forEach=Hb,T.forEachRight=Wb,T.forIn=GH,T.forInRight=KH,T.forOwn=XH,T.forOwnRight=ZH,T.get=oh,T.gt=_H,T.gte=bH,T.has=tW,T.hasIn=ah,T.head=Bb,T.identity=pn,T.includes=U5,T.indexOf=LU,T.inRange=bW,T.invoke=iW,T.isArguments=Lr,T.isArray=It,T.isArrayBuffer=xH,T.isArrayLike=fn,T.isArrayLikeObject=xe,T.isBoolean=wH,T.isBuffer=tr,T.isDate=vH,T.isElement=SH,T.isEmpty=TH,T.isEqual=kH,T.isEqualWith=MH,T.isError=ih,T.isFinite=DH,T.isFunction=xi,T.isInteger=Xb,T.isLength=vc,T.isMap=Zb,T.isMatch=CH,T.isMatchWith=OH,T.isNaN=AH,T.isNative=EH,T.isNil=PH,T.isNull=RH,T.isNumber=Qb,T.isObject=pe,T.isObjectLike=ye,T.isPlainObject=ra,T.isRegExp=rh,T.isSafeInteger=IH,T.isSet=Jb,T.isString=Sc,T.isSymbol=wn,T.isTypedArray=Cs,T.isUndefined=LH,T.isWeakMap=NH,T.isWeakSet=BH,T.join=UU,T.kebabCase=kW,T.last=Pn,T.lastIndexOf=HU,T.lowerCase=MW,T.lowerFirst=DW,T.lt=FH,T.lte=zH,T.max=w3,T.maxBy=v3,T.mean=S3,T.meanBy=T3,T.min=k3,T.minBy=M3,T.stubArray=hh,T.stubFalse=ph,T.stubObject=d3,T.stubString=f3,T.stubTrue=h3,T.multiply=D3,T.nth=WU,T.noConflict=i3,T.noop=fh,T.now=bc,T.pad=CW,T.padEnd=OW,T.padStart=AW,T.parseInt=EW,T.random=xW,T.reduce=Y5,T.reduceRight=q5,T.repeat=RW,T.replace=PW,T.result=uW,T.round=C3,T.runInContext=H,T.sample=G5,T.size=Z5,T.snakeCase=IW,T.some=Q5,T.sortedIndex=KU,T.sortedIndexBy=XU,T.sortedIndexOf=ZU,T.sortedLastIndex=QU,T.sortedLastIndexBy=JU,T.sortedLastIndexOf=t5,T.startCase=NW,T.startsWith=BW,T.subtract=O3,T.sum=A3,T.sumBy=E3,T.template=FW,T.times=p3,T.toFinite=wi,T.toInteger=Bt,T.toLength=ex,T.toLower=zW,T.toNumber=In,T.toSafeInteger=UH,T.toString=Xt,T.toUpper=UW,T.trim=HW,T.trimEnd=WW,T.trimStart=$W,T.truncate=VW,T.unescape=YW,T.uniqueId=g3,T.upperCase=qW,T.upperFirst=lh,T.each=Hb,T.eachRight=Wb,T.first=Bb,dh(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(Bt(p),0);var y=this.__filtered__&&!c?new Ht(this):this.clone();return y.__filtered__?y.__takeCount__=Xe(p,y.__takeCount__):y.__views__.push({size:Xe(p,B),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==dt||p==ct;Ht.prototype[o]=function(b){var k=this.clone();return k.__iteratees__.push({iteratee:Dt(b,3),type:p}),k.__filtered__=k.__filtered__||y,k}}),_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=zt(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(wc(Dt(o)))},Ht.prototype.slice=function(o,c){o=Bt(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=Bt(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(B)},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],k=y||/^find/.test(c);b&&(T.prototype[c]=function(){var E=this.__wrapped__,I=y?[1]:arguments,W=E instanceof Ht,Q=I[0],J=W||It(E),nt=function(Ut){var Wt=b.apply(T,ji([Ut],I));return y&&ft?Wt[0]:Wt};J&&p&&typeof Q=="function"&&Q.length!=1&&(W=J=!1);var ft=this.__chain__,wt=!!this.__actions__.length,Ct=k&&!ft,Ft=W&&!wt;if(!k&&J){E=Ft?E:new Ht(this);var Mt=o.apply(E,I);return Mt.__actions__.push({func:yc,args:[nt],thisArg:n}),new An(Mt,ft)}return Ct&&Ft?o.apply(this,I):(Mt=this.thru(nt),Ct?y?Mt.value()[0]:Mt.value():Mt)})}),_n(["pop","push","shift","sort","splice","unshift"],function(o){var c=$l[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 k=this.value();return c.apply(It(k)?k:[],b)}return this[p](function(E){return c.apply(It(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[uc(n,A).name]=[{name:"wrapper",func:n}],Ht.prototype.clone=qF,Ht.prototype.reverse=jF,Ht.prototype.value=GF,T.prototype.at=S5,T.prototype.chain=T5,T.prototype.commit=k5,T.prototype.next=M5,T.prototype.plant=C5,T.prototype.reverse=O5,T.prototype.toJSON=T.prototype.valueOf=T.prototype.value=A5,T.prototype.first=T.prototype.head,Yo&&(T.prototype[Yo]=D5),T}),xs=kF();Qn?((Qn.exports=xs)._=xs,gs._=xs):ue._=xs}).call(HB)})(Co,Co.exports)),Co.exports}var s_=WB(),_l={exports:{}},$B=_l.exports,o_;function VB(){return o_||(o_=1,(function(e,t){(function(n,i){i()})($B,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 P=S.result;P=v?P:P.replace(/^data:[^;]*;/,"data:attachment/file;"),g?g.location.href=P:location=P,g=null},S.readAsDataURL(d)}else{var O=a.URL||a.webkitURL,A=O.createObjectURL(d);g?g.location=A:location.href=A,g=null,setTimeout(function(){O.revokeObjectURL(A)},4e4)}});a.saveAs=u.saveAs=u,e.exports=u})})(_l)),_l.exports}var YB=VB(),bl={exports:{}};var qB=bl.exports,a_;function jB(){return a_||(a_=1,(function(e,t){((n,i)=>{e.exports=i()})(qB,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 h(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 C=R(w);C.chunkSize=parseInt(C.chunkSize),w.step||w.chunk||(C.chunkSize=null),this._handle=new v(C),(this._handle.streamer=this)._config=C}).call(this,D),this.parseChunk=function(w,C){var N=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<N){let V=this._config.newline;V||($=this._config.quoteChar||'"',V=this._handle.guessLineEndings(w,$)),w=[...w.split(V).slice(N)].join(V)}this.isFirstChunk&&U(this._config.beforeFirstChunk)&&($=this._config.beforeFirstChunk(w))!==void 0&&(w=$),this.isFirstChunk=!1,this._halted=!1;var N=this._partialLine+w,$=(this._partialLine="",this._handle.parse(N,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(w=$.meta.cursor,N=(this._finished||(this._partialLine=N.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:N});else if(U(this._config.chunk)&&!C){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||!N||!U(this._config.complete)||$&&$.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),N||$&&$.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),h.call(this,D),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(C){this._input=C,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=F(this._chunkLoaded,this),w.onerror=F(this._chunkError,this)),w.ontimeout=F(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 C,N=this._config.downloadRequestHeaders;for(C in N)w.setRequestHeader(C,N[C])}var $;this._config.chunkSize&&($=this._start+this._config.chunkSize-1,w.setRequestHeader("Range","bytes="+this._start+"-"+$));try{w.send(this._config.downloadRequestBody)}catch(V){this._chunkError(V.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>=(C=>(C=C.getResponseHeader("Content-Range"))!==null?parseInt(C.substring(C.lastIndexOf("/")+1)):-1)(w),this.parseChunk(w.responseText)))},this._chunkError=function(C){C=w.statusText||C,this._sendError(new Error(C))},this._chunkTimeout=function(){this._chunkError("Request timed out after "+this._config.downloadTimeout+"ms")}}function g(D){(D=D||{}).chunkSize||(D.chunkSize=u.LocalChunkSize),h.call(this,D);var w,C,N=typeof FileReader<"u";this.stream=function($){this._input=$,C=$.slice||$.webkitSlice||$.mozSlice,N?((w=new FileReader).onload=F(this._chunkLoaded,this),w.onerror=F(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,V=(this._config.chunkSize&&(V=Math.min(this._start+this._config.chunkSize,this._input.size),$=C.call($,this._start,V)),w.readAsText($,this._config.encoding));N||this._chunkLoaded({target:{result:V}})},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;h.call(this,D=D||{}),this.stream=function(C){return w=C,this._nextChunk()},this._nextChunk=function(){var C,N;if(!this._finished)return C=this._config.chunkSize,w=C?(N=w.substring(0,C),w.substring(C)):(N=w,""),this._finished=!w,this.parseChunk(N)}}function x(D){h.call(this,D=D||{});var w=[],C=!0,N=!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(){N&&w.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),w.length?this.parseChunk(w.shift()):C=!0},this._streamData=F(function($){try{w.push(typeof $=="string"?$:$.toString(this._config.encoding)),C&&(C=!1,this._checkIsFinished(),this.parseChunk(w.shift()))}catch(V){this._streamError(V)}},this),this._streamError=F(function($){this._streamCleanUp(),this._sendError($)},this),this._streamEnd=F(function(){this._streamCleanUp(),N=!0,this._streamData("")},this),this._streamCleanUp=F(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,C,N,$,V=Math.pow(2,53),st=-V,dt=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,ut=/^((\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)))$/,ct=this,Tt=0,at=0,pt=!1,G=!1,B=[],z={data:[],errors:[],meta:{}};function Z(X){return D.skipEmptyLines==="greedy"?X.join("").trim()==="":X.length===1&&X[0].length===0}function it(){if(z&&N&&(mt("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+u.DefaultDelimiter+"'"),N=!1),D.skipEmptyLines&&(z.data=z.data.filter(function(lt){return!Z(lt)})),ht()){let lt=function(bt){B.push(bt)};if(z)if(Array.isArray(z.data[0])){for(var X=0;ht()&&X<z.data.length;X++)z.data[X].forEach(lt);z.data.splice(0,1)}else z.data.forEach(lt)}function ot(lt,bt){for(var Rt=D.header?{}:[],j=0;j<lt.length;j++){var et=j,rt=lt[j],rt=((Gt,yt)=>($t=>(D.dynamicTypingFunction&&D.dynamicTyping[$t]===void 0&&(D.dynamicTyping[$t]=D.dynamicTypingFunction($t)),(D.dynamicTyping[$t]||D.dynamicTyping)===!0))(Gt)?yt==="true"||yt==="TRUE"||yt!=="false"&&yt!=="FALSE"&&(($t=>{if(dt.test($t)&&($t=parseFloat($t),st<$t&&$t<V))return 1})(yt)?parseFloat(yt):ut.test(yt)?new Date(yt):yt===""?null:yt):yt)(et=D.header?j>=B.length?"__parsed_extra":B[j]:et,rt=D.transform?D.transform(rt,et):rt);et==="__parsed_extra"?(Rt[et]=Rt[et]||[],Rt[et].push(rt)):Rt[et]=rt}return D.header&&(j>B.length?mt("FieldMismatch","TooManyFields","Too many fields: expected "+B.length+" fields but parsed "+j,at+bt):j<B.length&&mt("FieldMismatch","TooFewFields","Too few fields: expected "+B.length+" fields but parsed "+j,at+bt)),Rt}var vt;z&&(D.header||D.dynamicTyping||D.transform)&&(vt=1,!z.data.length||Array.isArray(z.data[0])?(z.data=z.data.map(ot),vt=z.data.length):z.data=ot(z.data,0),D.header&&z.meta&&(z.meta.fields=B),at+=vt)}function ht(){return D.header&&B.length===0}function mt(X,ot,vt,lt){X={type:X,code:ot,message:vt},lt!==void 0&&(X.row=lt),z.errors.push(X)}U(D.step)&&($=D.step,D.step=function(X){z=X,ht()?it():(it(),z.data.length!==0&&(Tt+=X.data.length,D.preview&&Tt>D.preview?C.abort():(z.data=z.data[0],$(z,ct))))}),this.parse=function(X,ot,vt){var lt=D.quoteChar||'"',lt=(D.newline||(D.newline=this.guessLineEndings(X,lt)),N=!1,D.delimiter?U(D.delimiter)&&(D.delimiter=D.delimiter(X),z.meta.delimiter=D.delimiter):((lt=((bt,Rt,j,et,rt)=>{var Gt,yt,$t,Me;rt=rt||[","," ","|",";",u.RECORD_SEP,u.UNIT_SEP];for(var Te=0;Te<rt.length;Te++){for(var ee,je=rt[Te],Yt=0,Be=0,se=0,De=($t=void 0,new O({comments:et,delimiter:je,newline:Rt,preview:10}).parse(bt)),Pe=0;Pe<De.data.length;Pe++)j&&Z(De.data[Pe])?se++:(ee=De.data[Pe].length,Be+=ee,$t===void 0?$t=ee:0<ee&&(Yt+=Math.abs(ee-$t),$t=ee));0<De.data.length&&(Be/=De.data.length-se),1.99<Be&&(yt===void 0||Yt<yt||Yt===yt&&Me<Be)&&(yt=Yt,Gt=je,Me=Be)}return{successful:!!(D.delimiter=Gt),bestDelimiter:Gt}})(X,D.newline,D.skipEmptyLines,D.comments,D.delimitersToGuess)).successful?D.delimiter=lt.bestDelimiter:(N=!0,D.delimiter=u.DefaultDelimiter),z.meta.delimiter=D.delimiter),R(D));return lt.header=ht(),D.preview&&D.header&&lt.preview++,w=X,C=new O(lt),z=C.parse(w,ot,vt),it(),pt?{meta:{paused:!0}}:z||{meta:{paused:!1}}},this.paused=function(){return pt},this.pause=function(){pt=!0,C.abort(),w=U(D.chunk)?"":w.substring(C.getCharIndex())},this.resume=function(){ct.streamer._halted?(pt=!1,ct.streamer.parseChunk(w,!0)):setTimeout(ct.resume,3)},this.aborted=function(){return G},this.abort=function(){G=!0,C.abort(),z.meta.aborted=!0,U(D.complete)&&D.complete(z),w=""},this.guessLineEndings=function(bt,lt){bt=bt.substring(0,1048576);var lt=new RegExp(S(lt)+"([^]*?)"+S(lt),"gm"),vt=(bt=bt.replace(lt,"")).split("\r"),lt=bt.split(`
26
+ }`;var Ft=fx(function(){return qt(k,wt+"return "+nt).apply(n,E)});if(Ft.source=nt,ih(Ft))throw Ft;return Ft}function zW(o){return Xt(o).toLowerCase()}function UW(o){return Xt(o).toUpperCase()}function HW(o,c,p){if(o=Xt(o),o&&(p||c===n))return xy(o);if(!o||!(c=xn(c)))return o;var _=Fn(o),b=Fn(c),k=wy(_,b),E=vy(_,b)+1;return Ji(_,k,E).join("")}function WW(o,c,p){if(o=Xt(o),o&&(p||c===n))return o.slice(0,Ty(o)+1);if(!o||!(c=xn(c)))return o;var _=Fn(o),b=vy(_,Fn(c))+1;return Ji(_,0,b).join("")}function $W(o,c,p){if(o=Xt(o),o&&(p||c===n))return o.replace(No,"");if(!o||!(c=xn(c)))return o;var _=Fn(o),b=wy(_,Fn(c));return Ji(_,b).join("")}function VW(o,c){var p=N,_=$;if(pe(c)){var b="separator"in c?c.separator:b;p="length"in c?Bt(c.length):p,_="omission"in c?xn(c.omission):_}o=Xt(o);var k=o.length;if(ys(o)){var E=Fn(o);k=E.length}if(p>=k)return o;var I=p-bs(_);if(I<1)return _;var W=E?Ji(E,0,I).join(""):o.slice(0,I);if(b===n)return W+_;if(E&&(I+=W.length-I),rh(b)){if(o.slice(I).search(b)){var Q,J=W;for(b.global||(b=xf(b.source,Xt(Sl.exec(b))+"g")),b.lastIndex=0;Q=b.exec(J);)var nt=Q.index;W=W.slice(0,nt===n?I:nt)}}else if(o.indexOf(xn(b),I)!=I){var ft=W.lastIndexOf(b);ft>-1&&(W=W.slice(0,ft))}return W+_}function YW(o){return o=Xt(o),o&&Ed.test(o)?o.replace($i,wF):o}var qW=Ms(function(o,c,p){return o+(p?" ":"")+c.toUpperCase()}),lh=fb("toUpperCase");function dx(o,c,p){return o=Xt(o),c=p?n:c,c===n?gF(o)?TF(o):aF(o):o.match(c)||[]}var fx=zt(function(o,c){try{return _n(o,n,c)}catch(p){return ih(p)?p:new At(p)}}),jW=yi(function(o,c){return yn(c,function(p){p=Un(p),Jn(o,p,eh(o[p],o))}),o});function GW(o){var c=o==null?0:o.length,p=Dt();return o=c?de(o,function(_){if(typeof _[1]!="function")throw new On(a);return[p(_[0]),_[1]]}):[],zt(function(_){for(var b=-1;++b<c;){var k=o[b];if(_n(k[0],this,_))return _n(k[1],this,_)}})}function KW(o){return wz(En(o,g))}function ch(o){return function(){return o}}function XW(o,c){return o==null||o!==o?c:o}var ZW=pb(),QW=pb(!0);function pn(o){return o}function uh(o){return Vy(typeof o=="function"?o:En(o,g))}function JW(o){return qy(En(o,g))}function t3(o,c){return jy(o,En(c,g))}var e3=zt(function(o,c){return function(p){return Qo(p,o,c)}}),n3=zt(function(o,c){return function(p){return Qo(o,p,c)}});function dh(o,c,p){var _=Ie(c),b=sc(c,_);p==null&&!(pe(c)&&(b.length||!_.length))&&(p=c,c=o,o=this,b=sc(c,Ie(c)));var k=!(pe(p)&&"chain"in p)||!!p.chain,E=xi(o);return yn(b,function(I){var W=c[I];o[I]=W,E&&(o.prototype[I]=function(){var Q=this.__chain__;if(k||Q){var J=o(this.__wrapped__),nt=J.__actions__=dn(this.__actions__);return nt.push({func:W,args:arguments,thisArg:o}),J.__chain__=Q,J}return W.apply(o,ji([this.value()],arguments))})}),o}function i3(){return ue._===this&&(ue._=AF),this}function fh(){}function r3(o){return o=Bt(o),zt(function(c){return Gy(c,o)})}var s3=Wf(de),o3=Wf(my),a3=Wf(hf);function hx(o){return Kf(o)?pf(Un(o)):Fz(o)}function l3(o){return function(c){return o==null?n:Rr(o,c)}}var c3=gb(),u3=gb(!0);function hh(){return[]}function ph(){return!1}function d3(){return{}}function f3(){return""}function h3(){return!0}function p3(o,c){if(o=Bt(o),o<1||o>at)return[];var p=B,_=Xe(o,B);c=Dt(c),o-=B;for(var b=_f(_,c);++p<o;)c(p);return b}function m3(o){return It(o)?de(o,Un):wn(o)?[o]:dn(Rb(Xt(o)))}function g3(o){var c=++CF;return Xt(o)+c}var _3=dc(function(o,c){return o+c},0),y3=$f("ceil"),b3=dc(function(o,c){return o/c},1),x3=$f("floor");function w3(o){return o&&o.length?rc(o,pn,Cf):n}function v3(o,c){return o&&o.length?rc(o,Dt(c,2),Cf):n}function S3(o){return yy(o,pn)}function T3(o,c){return yy(o,Dt(c,2))}function k3(o){return o&&o.length?rc(o,pn,Rf):n}function M3(o,c){return o&&o.length?rc(o,Dt(c,2),Rf):n}var D3=dc(function(o,c){return o*c},1),C3=$f("round"),O3=dc(function(o,c){return o-c},0);function A3(o){return o&&o.length?gf(o,pn):0}function E3(o,c){return o&&o.length?gf(o,Dt(c,2)):0}return T.after=tH,T.ary=$b,T.assign=HH,T.assignIn=ix,T.assignInWith=rx,T.assignWith=sh,T.at=WH,T.before=Vb,T.bind=eh,T.bindAll=jW,T.bindKey=Yb,T.castArray=fH,T.chain=Ub,T.chunk=wU,T.compact=vU,T.concat=SU,T.cond=GW,T.conforms=KW,T.constant=ch,T.countBy=E5,T.create=$H,T.curry=qb,T.curryRight=jb,T.debounce=Gb,T.defaults=VH,T.defaultsDeep=YH,T.defer=eH,T.delay=nH,T.difference=TU,T.differenceBy=kU,T.differenceWith=MU,T.drop=DU,T.dropRight=CU,T.dropRightWhile=OU,T.dropWhile=AU,T.fill=EU,T.filter=P5,T.flatMap=N5,T.flatMapDeep=B5,T.flatMapDepth=F5,T.flatten=Nb,T.flattenDeep=RU,T.flattenDepth=PU,T.flip=iH,T.flow=ZW,T.flowRight=QW,T.fromPairs=IU,T.functions=QH,T.functionsIn=JH,T.groupBy=z5,T.initial=NU,T.intersection=BU,T.intersectionBy=FU,T.intersectionWith=zU,T.invert=eW,T.invertBy=nW,T.invokeMap=H5,T.iteratee=uh,T.keyBy=W5,T.keys=Ie,T.keysIn=hn,T.map=yc,T.mapKeys=rW,T.mapValues=sW,T.matches=JW,T.matchesProperty=t3,T.memoize=xc,T.merge=oW,T.mergeWith=sx,T.method=e3,T.methodOf=n3,T.mixin=dh,T.negate=wc,T.nthArg=r3,T.omit=aW,T.omitBy=lW,T.once=rH,T.orderBy=$5,T.over=s3,T.overArgs=sH,T.overEvery=o3,T.overSome=a3,T.partial=nh,T.partialRight=Kb,T.partition=V5,T.pick=cW,T.pickBy=ox,T.property=hx,T.propertyOf=l3,T.pull=$U,T.pullAll=Fb,T.pullAllBy=VU,T.pullAllWith=YU,T.pullAt=qU,T.range=c3,T.rangeRight=u3,T.rearg=oH,T.reject=j5,T.remove=jU,T.rest=aH,T.reverse=Jf,T.sampleSize=K5,T.set=dW,T.setWith=fW,T.shuffle=X5,T.slice=GU,T.sortBy=J5,T.sortedUniq=e5,T.sortedUniqBy=n5,T.split=LW,T.spread=lH,T.tail=i5,T.take=r5,T.takeRight=s5,T.takeRightWhile=o5,T.takeWhile=a5,T.tap=v5,T.throttle=cH,T.thru=_c,T.toArray=tx,T.toPairs=ax,T.toPairsIn=lx,T.toPath=m3,T.toPlainObject=nx,T.transform=hW,T.unary=uH,T.union=l5,T.unionBy=c5,T.unionWith=u5,T.uniq=d5,T.uniqBy=f5,T.uniqWith=h5,T.unset=pW,T.unzip=th,T.unzipWith=zb,T.update=mW,T.updateWith=gW,T.values=Os,T.valuesIn=_W,T.without=p5,T.words=dx,T.wrap=dH,T.xor=m5,T.xorBy=g5,T.xorWith=_5,T.zip=y5,T.zipObject=b5,T.zipObjectDeep=x5,T.zipWith=w5,T.entries=ax,T.entriesIn=lx,T.extend=ix,T.extendWith=rx,dh(T,T),T.add=_3,T.attempt=fx,T.camelCase=wW,T.capitalize=cx,T.ceil=y3,T.clamp=yW,T.clone=hH,T.cloneDeep=mH,T.cloneDeepWith=gH,T.cloneWith=pH,T.conformsTo=_H,T.deburr=ux,T.defaultTo=XW,T.divide=b3,T.endsWith=vW,T.eq=Hn,T.escape=SW,T.escapeRegExp=TW,T.every=R5,T.find=I5,T.findIndex=Ib,T.findKey=qH,T.findLast=L5,T.findLastIndex=Lb,T.findLastKey=jH,T.floor=x3,T.forEach=Hb,T.forEachRight=Wb,T.forIn=GH,T.forInRight=KH,T.forOwn=XH,T.forOwnRight=ZH,T.get=oh,T.gt=yH,T.gte=bH,T.has=tW,T.hasIn=ah,T.head=Bb,T.identity=pn,T.includes=U5,T.indexOf=LU,T.inRange=bW,T.invoke=iW,T.isArguments=Lr,T.isArray=It,T.isArrayBuffer=xH,T.isArrayLike=fn,T.isArrayLikeObject=xe,T.isBoolean=wH,T.isBuffer=tr,T.isDate=vH,T.isElement=SH,T.isEmpty=TH,T.isEqual=kH,T.isEqualWith=MH,T.isError=ih,T.isFinite=DH,T.isFunction=xi,T.isInteger=Xb,T.isLength=vc,T.isMap=Zb,T.isMatch=CH,T.isMatchWith=OH,T.isNaN=AH,T.isNative=EH,T.isNil=PH,T.isNull=RH,T.isNumber=Qb,T.isObject=pe,T.isObjectLike=_e,T.isPlainObject=ra,T.isRegExp=rh,T.isSafeInteger=IH,T.isSet=Jb,T.isString=Sc,T.isSymbol=wn,T.isTypedArray=Cs,T.isUndefined=LH,T.isWeakMap=NH,T.isWeakSet=BH,T.join=UU,T.kebabCase=kW,T.last=Pn,T.lastIndexOf=HU,T.lowerCase=MW,T.lowerFirst=DW,T.lt=FH,T.lte=zH,T.max=w3,T.maxBy=v3,T.mean=S3,T.meanBy=T3,T.min=k3,T.minBy=M3,T.stubArray=hh,T.stubFalse=ph,T.stubObject=d3,T.stubString=f3,T.stubTrue=h3,T.multiply=D3,T.nth=WU,T.noConflict=i3,T.noop=fh,T.now=bc,T.pad=CW,T.padEnd=OW,T.padStart=AW,T.parseInt=EW,T.random=xW,T.reduce=Y5,T.reduceRight=q5,T.repeat=RW,T.replace=PW,T.result=uW,T.round=C3,T.runInContext=H,T.sample=G5,T.size=Z5,T.snakeCase=IW,T.some=Q5,T.sortedIndex=KU,T.sortedIndexBy=XU,T.sortedIndexOf=ZU,T.sortedLastIndex=QU,T.sortedLastIndexBy=JU,T.sortedLastIndexOf=t5,T.startCase=NW,T.startsWith=BW,T.subtract=O3,T.sum=A3,T.sumBy=E3,T.template=FW,T.times=p3,T.toFinite=wi,T.toInteger=Bt,T.toLength=ex,T.toLower=zW,T.toNumber=In,T.toSafeInteger=UH,T.toString=Xt,T.toUpper=UW,T.trim=HW,T.trimEnd=WW,T.trimStart=$W,T.truncate=VW,T.unescape=YW,T.uniqueId=g3,T.upperCase=qW,T.upperFirst=lh,T.each=Hb,T.eachRight=Wb,T.first=Bb,dh(T,(function(){var o={};return ti(T,function(c,p){Kt.call(T.prototype,p)||(o[p]=c)}),o})(),{chain:!1}),T.VERSION=i,yn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){T[o].placeholder=T}),yn(["drop","take"],function(o,c){Ht.prototype[o]=function(p){p=p===n?1:Ae(Bt(p),0);var _=this.__filtered__&&!c?new Ht(this):this.clone();return _.__filtered__?_.__takeCount__=Xe(p,_.__takeCount__):_.__views__.push({size:Xe(p,B),type:o+(_.__dir__<0?"Right":"")}),_},Ht.prototype[o+"Right"]=function(p){return this.reverse()[o](p).reverse()}}),yn(["filter","map","takeWhile"],function(o,c){var p=c+1,_=p==dt||p==ct;Ht.prototype[o]=function(b){var k=this.clone();return k.__iteratees__.push({iteratee:Dt(b,3),type:p}),k.__filtered__=k.__filtered__||_,k}}),yn(["head","last"],function(o,c){var p="take"+(c?"Right":"");Ht.prototype[o]=function(){return this[p](1).value()[0]}}),yn(["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=zt(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(wc(Dt(o)))},Ht.prototype.slice=function(o,c){o=Bt(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=Bt(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(B)},ti(Ht.prototype,function(o,c){var p=/^(?:filter|find|map|reject)|While$/.test(c),_=/^(?:head|last)$/.test(c),b=T[_?"take"+(c=="last"?"Right":""):c],k=_||/^find/.test(c);b&&(T.prototype[c]=function(){var E=this.__wrapped__,I=_?[1]:arguments,W=E instanceof Ht,Q=I[0],J=W||It(E),nt=function(Ut){var Wt=b.apply(T,ji([Ut],I));return _&&ft?Wt[0]:Wt};J&&p&&typeof Q=="function"&&Q.length!=1&&(W=J=!1);var ft=this.__chain__,wt=!!this.__actions__.length,Ct=k&&!ft,Ft=W&&!wt;if(!k&&J){E=Ft?E:new Ht(this);var Mt=o.apply(E,I);return Mt.__actions__.push({func:_c,args:[nt],thisArg:n}),new An(Mt,ft)}return Ct&&Ft?o.apply(this,I):(Mt=this.thru(nt),Ct?_?Mt.value()[0]:Mt.value():Mt)})}),yn(["pop","push","shift","sort","splice","unshift"],function(o){var c=$l[o],p=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",_=/^(?:pop|shift)$/.test(o);T.prototype[o]=function(){var b=arguments;if(_&&!this.__chain__){var k=this.value();return c.apply(It(k)?k:[],b)}return this[p](function(E){return c.apply(It(E)?E:[],b)})}}),ti(Ht.prototype,function(o,c){var p=T[c];if(p){var _=p.name+"";Kt.call(Ss,_)||(Ss[_]=[]),Ss[_].push({name:c,func:p})}}),Ss[uc(n,A).name]=[{name:"wrapper",func:n}],Ht.prototype.clone=qF,Ht.prototype.reverse=jF,Ht.prototype.value=GF,T.prototype.at=S5,T.prototype.chain=T5,T.prototype.commit=k5,T.prototype.next=M5,T.prototype.plant=C5,T.prototype.reverse=O5,T.prototype.toJSON=T.prototype.valueOf=T.prototype.value=A5,T.prototype.first=T.prototype.head,Yo&&(T.prototype[Yo]=D5),T}),xs=kF();Qn?((Qn.exports=xs)._=xs,gs._=xs):ue._=xs}).call(HB)})(Co,Co.exports)),Co.exports}var sy=WB(),yl={exports:{}},$B=yl.exports,oy;function VB(){return oy||(oy=1,(function(e,t){(function(n,i){i()})($B,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,y=document.createElement("a");h=h||d.name||"download",y.download=h,y.rel="noopener",typeof d=="string"?(y.href=d,y.origin===location.origin?s(y):r(y.href)?i(d,h,m):s(y,y.target="_blank")):(y.href=g.createObjectURL(d),setTimeout(function(){g.revokeObjectURL(y.href)},4e4),setTimeout(function(){s(y)},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 y=d.type==="application/octet-stream",x=/constructor/i.test(a.HTMLElement)||a.safari,v=/CriOS\/[\d]+/.test(navigator.userAgent);if((v||y&&x||l)&&typeof FileReader<"u"){var S=new FileReader;S.onloadend=function(){var P=S.result;P=v?P:P.replace(/^data:[^;]*;/,"data:attachment/file;"),g?g.location.href=P:location=P,g=null},S.readAsDataURL(d)}else{var O=a.URL||a.webkitURL,A=O.createObjectURL(d);g?g.location=A:location.href=A,g=null,setTimeout(function(){O.revokeObjectURL(A)},4e4)}});a.saveAs=u.saveAs=u,e.exports=u})})(yl)),yl.exports}var YB=VB(),bl={exports:{}};var qB=bl.exports,ay;function jB(){return ay||(ay=1,(function(e,t){((n,i)=>{e.exports=i()})(qB,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 h(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 C=R(w);C.chunkSize=parseInt(C.chunkSize),w.step||w.chunk||(C.chunkSize=null),this._handle=new v(C),(this._handle.streamer=this)._config=C}).call(this,D),this.parseChunk=function(w,C){var N=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<N){let V=this._config.newline;V||($=this._config.quoteChar||'"',V=this._handle.guessLineEndings(w,$)),w=[...w.split(V).slice(N)].join(V)}this.isFirstChunk&&U(this._config.beforeFirstChunk)&&($=this._config.beforeFirstChunk(w))!==void 0&&(w=$),this.isFirstChunk=!1,this._halted=!1;var N=this._partialLine+w,$=(this._partialLine="",this._handle.parse(N,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(w=$.meta.cursor,N=(this._finished||(this._partialLine=N.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:N});else if(U(this._config.chunk)&&!C){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||!N||!U(this._config.complete)||$&&$.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),N||$&&$.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),h.call(this,D),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(C){this._input=C,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=F(this._chunkLoaded,this),w.onerror=F(this._chunkError,this)),w.ontimeout=F(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 C,N=this._config.downloadRequestHeaders;for(C in N)w.setRequestHeader(C,N[C])}var $;this._config.chunkSize&&($=this._start+this._config.chunkSize-1,w.setRequestHeader("Range","bytes="+this._start+"-"+$));try{w.send(this._config.downloadRequestBody)}catch(V){this._chunkError(V.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>=(C=>(C=C.getResponseHeader("Content-Range"))!==null?parseInt(C.substring(C.lastIndexOf("/")+1)):-1)(w),this.parseChunk(w.responseText)))},this._chunkError=function(C){C=w.statusText||C,this._sendError(new Error(C))},this._chunkTimeout=function(){this._chunkError("Request timed out after "+this._config.downloadTimeout+"ms")}}function g(D){(D=D||{}).chunkSize||(D.chunkSize=u.LocalChunkSize),h.call(this,D);var w,C,N=typeof FileReader<"u";this.stream=function($){this._input=$,C=$.slice||$.webkitSlice||$.mozSlice,N?((w=new FileReader).onload=F(this._chunkLoaded,this),w.onerror=F(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,V=(this._config.chunkSize&&(V=Math.min(this._start+this._config.chunkSize,this._input.size),$=C.call($,this._start,V)),w.readAsText($,this._config.encoding));N||this._chunkLoaded({target:{result:V}})},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 y(D){var w;h.call(this,D=D||{}),this.stream=function(C){return w=C,this._nextChunk()},this._nextChunk=function(){var C,N;if(!this._finished)return C=this._config.chunkSize,w=C?(N=w.substring(0,C),w.substring(C)):(N=w,""),this._finished=!w,this.parseChunk(N)}}function x(D){h.call(this,D=D||{});var w=[],C=!0,N=!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(){N&&w.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),w.length?this.parseChunk(w.shift()):C=!0},this._streamData=F(function($){try{w.push(typeof $=="string"?$:$.toString(this._config.encoding)),C&&(C=!1,this._checkIsFinished(),this.parseChunk(w.shift()))}catch(V){this._streamError(V)}},this),this._streamError=F(function($){this._streamCleanUp(),this._sendError($)},this),this._streamEnd=F(function(){this._streamCleanUp(),N=!0,this._streamData("")},this),this._streamCleanUp=F(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,C,N,$,V=Math.pow(2,53),st=-V,dt=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,ut=/^((\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)))$/,ct=this,Tt=0,at=0,pt=!1,G=!1,B=[],z={data:[],errors:[],meta:{}};function Z(X){return D.skipEmptyLines==="greedy"?X.join("").trim()==="":X.length===1&&X[0].length===0}function it(){if(z&&N&&(mt("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+u.DefaultDelimiter+"'"),N=!1),D.skipEmptyLines&&(z.data=z.data.filter(function(lt){return!Z(lt)})),ht()){let lt=function(bt){B.push(bt)};if(z)if(Array.isArray(z.data[0])){for(var X=0;ht()&&X<z.data.length;X++)z.data[X].forEach(lt);z.data.splice(0,1)}else z.data.forEach(lt)}function ot(lt,bt){for(var Rt=D.header?{}:[],j=0;j<lt.length;j++){var et=j,rt=lt[j],rt=((Gt,_t)=>($t=>(D.dynamicTypingFunction&&D.dynamicTyping[$t]===void 0&&(D.dynamicTyping[$t]=D.dynamicTypingFunction($t)),(D.dynamicTyping[$t]||D.dynamicTyping)===!0))(Gt)?_t==="true"||_t==="TRUE"||_t!=="false"&&_t!=="FALSE"&&(($t=>{if(dt.test($t)&&($t=parseFloat($t),st<$t&&$t<V))return 1})(_t)?parseFloat(_t):ut.test(_t)?new Date(_t):_t===""?null:_t):_t)(et=D.header?j>=B.length?"__parsed_extra":B[j]:et,rt=D.transform?D.transform(rt,et):rt);et==="__parsed_extra"?(Rt[et]=Rt[et]||[],Rt[et].push(rt)):Rt[et]=rt}return D.header&&(j>B.length?mt("FieldMismatch","TooManyFields","Too many fields: expected "+B.length+" fields but parsed "+j,at+bt):j<B.length&&mt("FieldMismatch","TooFewFields","Too few fields: expected "+B.length+" fields but parsed "+j,at+bt)),Rt}var vt;z&&(D.header||D.dynamicTyping||D.transform)&&(vt=1,!z.data.length||Array.isArray(z.data[0])?(z.data=z.data.map(ot),vt=z.data.length):z.data=ot(z.data,0),D.header&&z.meta&&(z.meta.fields=B),at+=vt)}function ht(){return D.header&&B.length===0}function mt(X,ot,vt,lt){X={type:X,code:ot,message:vt},lt!==void 0&&(X.row=lt),z.errors.push(X)}U(D.step)&&($=D.step,D.step=function(X){z=X,ht()?it():(it(),z.data.length!==0&&(Tt+=X.data.length,D.preview&&Tt>D.preview?C.abort():(z.data=z.data[0],$(z,ct))))}),this.parse=function(X,ot,vt){var lt=D.quoteChar||'"',lt=(D.newline||(D.newline=this.guessLineEndings(X,lt)),N=!1,D.delimiter?U(D.delimiter)&&(D.delimiter=D.delimiter(X),z.meta.delimiter=D.delimiter):((lt=((bt,Rt,j,et,rt)=>{var Gt,_t,$t,Me;rt=rt||[","," ","|",";",u.RECORD_SEP,u.UNIT_SEP];for(var Te=0;Te<rt.length;Te++){for(var ee,je=rt[Te],Yt=0,Be=0,se=0,De=($t=void 0,new O({comments:et,delimiter:je,newline:Rt,preview:10}).parse(bt)),Pe=0;Pe<De.data.length;Pe++)j&&Z(De.data[Pe])?se++:(ee=De.data[Pe].length,Be+=ee,$t===void 0?$t=ee:0<ee&&(Yt+=Math.abs(ee-$t),$t=ee));0<De.data.length&&(Be/=De.data.length-se),1.99<Be&&(_t===void 0||Yt<_t||Yt===_t&&Me<Be)&&(_t=Yt,Gt=je,Me=Be)}return{successful:!!(D.delimiter=Gt),bestDelimiter:Gt}})(X,D.newline,D.skipEmptyLines,D.comments,D.delimitersToGuess)).successful?D.delimiter=lt.bestDelimiter:(N=!0,D.delimiter=u.DefaultDelimiter),z.meta.delimiter=D.delimiter),R(D));return lt.header=ht(),D.preview&&D.header&&lt.preview++,w=X,C=new O(lt),z=C.parse(w,ot,vt),it(),pt?{meta:{paused:!0}}:z||{meta:{paused:!1}}},this.paused=function(){return pt},this.pause=function(){pt=!0,C.abort(),w=U(D.chunk)?"":w.substring(C.getCharIndex())},this.resume=function(){ct.streamer._halted?(pt=!1,ct.streamer.parseChunk(w,!0)):setTimeout(ct.resume,3)},this.aborted=function(){return G},this.abort=function(){G=!0,C.abort(),z.meta.aborted=!0,U(D.complete)&&D.complete(z),w=""},this.guessLineEndings=function(bt,lt){bt=bt.substring(0,1048576);var lt=new RegExp(S(lt)+"([^]*?)"+S(lt),"gm"),vt=(bt=bt.replace(lt,"")).split("\r"),lt=bt.split(`
27
27
  `),bt=1<lt.length&&lt[0].length<vt[0].length;if(vt.length===1||bt)return`
28
28
  `;for(var Rt=0,j=0;j<vt.length;j++)vt[j][0]===`
29
29
  `&&Rt++;return Rt>=vt.length/2?`\r
30
30
  `:"\r"}}function S(D){return D.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function O(D){var w=(D=D||{}).delimiter,C=D.newline,N=D.comments,$=D.step,V=D.preview,st=D.fastMode,dt=null,ut=!1,ct=D.quoteChar==null?'"':D.quoteChar,Tt=ct;if(D.escapeChar!==void 0&&(Tt=D.escapeChar),(typeof w!="string"||-1<u.BAD_DELIMITERS.indexOf(w))&&(w=","),N===w)throw new Error("Comment character same as delimiter");N===!0?N="#":(typeof N!="string"||-1<u.BAD_DELIMITERS.indexOf(N))&&(N=!1),C!==`
31
31
  `&&C!=="\r"&&C!==`\r
32
32
  `&&(C=`
33
- `);var at=0,pt=!1;this.parse=function(G,B,z){if(typeof G!="string")throw new Error("Input must be a string");var Z=G.length,it=w.length,ht=C.length,mt=N.length,X=U($),ot=[],vt=[],lt=[],bt=at=0;if(!G)return Yt();if(st||st!==!1&&G.indexOf(ct)===-1){for(var Rt=G.split(C),j=0;j<Rt.length;j++){if(lt=Rt[j],at+=lt.length,j!==Rt.length-1)at+=C.length;else if(z)return Yt();if(!N||lt.substring(0,mt)!==N){if(X){if(ot=[],Me(lt.split(w)),Be(),pt)return Yt()}else Me(lt.split(w));if(V&&V<=j)return ot=ot.slice(0,V),Yt(!0)}}return Yt()}for(var et=G.indexOf(w,at),rt=G.indexOf(C,at),Gt=new RegExp(S(Tt)+S(ct),"g"),yt=G.indexOf(ct,at);;)if(G[at]===ct)for(yt=at,at++;;){if((yt=G.indexOf(ct,yt+1))===-1)return z||vt.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:ot.length,index:at}),ee();if(yt===Z-1)return ee(G.substring(at,yt).replace(Gt,ct));if(ct===Tt&&G[yt+1]===Tt)yt++;else if(ct===Tt||yt===0||G[yt-1]!==Tt){et!==-1&&et<yt+1&&(et=G.indexOf(w,yt+1));var $t=Te((rt=rt!==-1&&rt<yt+1?G.indexOf(C,yt+1):rt)===-1?et:Math.min(et,rt));if(G.substr(yt+1+$t,it)===w){lt.push(G.substring(at,yt).replace(Gt,ct)),G[at=yt+1+$t+it]!==ct&&(yt=G.indexOf(ct,at)),et=G.indexOf(w,at),rt=G.indexOf(C,at);break}if($t=Te(rt),G.substring(yt+1+$t,yt+1+$t+ht)===C){if(lt.push(G.substring(at,yt).replace(Gt,ct)),je(yt+1+$t+ht),et=G.indexOf(w,at),yt=G.indexOf(ct,at),X&&(Be(),pt))return Yt();if(V&&ot.length>=V)return Yt(!0);break}vt.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:ot.length,index:at}),yt++}}else if(N&&lt.length===0&&G.substring(at,at+mt)===N){if(rt===-1)return Yt();at=rt+ht,rt=G.indexOf(C,at),et=G.indexOf(w,at)}else if(et!==-1&&(et<rt||rt===-1))lt.push(G.substring(at,et)),at=et+it,et=G.indexOf(w,at);else{if(rt===-1)break;if(lt.push(G.substring(at,rt)),je(rt+ht),X&&(Be(),pt))return Yt();if(V&&ot.length>=V)return Yt(!0)}return ee();function Me(se){ot.push(se),bt=at}function Te(se){var De=0;return De=se!==-1&&(se=G.substring(yt+1,se))&&se.trim()===""?se.length:De}function ee(se){return z||(se===void 0&&(se=G.substring(at)),lt.push(se),at=Z,Me(lt),X&&Be()),Yt()}function je(se){at=se,Me(lt),lt=[],rt=G.indexOf(C,at)}function Yt(se){if(D.header&&!B&&ot.length&&!ut){var De=ot[0],Pe=Object.create(null),gn=new Set(De);let Wi=!1;for(let Cn=0;Cn<De.length;Cn++){let Ge=d(De[Cn]);if(Pe[Ge=U(D.transformHeader)?D.transformHeader(Ge,Cn):Ge]){let Ln,di=Pe[Ge];for(;Ln=Ge+"_"+di,di++,gn.has(Ln););gn.add(Ln),De[Cn]=Ln,Pe[Ge]++,Wi=!0,(dt=dt===null?{}:dt)[Ln]=Ge}else Pe[Ge]=1,De[Cn]=Ge;gn.add(Ge)}Wi&&console.warn("Duplicate headers found and renamed."),ut=!0}return{data:ot,errors:vt,meta:{delimiter:w,linebreak:C,aborted:pt,truncated:!!se,cursor:bt+(B||0),renamedHeaders:dt}}}function Be(){$(Yt()),ot=[],vt=[]}},this.abort=function(){pt=!0},this.getCharIndex=function(){return at}}function A(D){var w=D.data,C=a[w.workerId],N=!1;if(w.error)C.userError(w.error,w.file);else if(w.results&&w.results.data){var $={abort:function(){N=!0,P(w.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:L,resume:L};if(U(C.userStep)){for(var V=0;V<w.results.data.length&&(C.userStep({data:w.results.data[V],errors:w.results.errors,meta:w.results.meta},$),!N);V++);delete w.results}else U(C.userChunk)&&(C.userChunk(w.results,$,w.file),delete w.results)}w.finished&&!N&&P(w.workerId,w.results)}function P(D,w){var C=a[D];U(C.userComplete)&&C.userComplete(w),C.terminate(),delete a[D]}function L(){throw new Error("Not implemented.")}function R(D){if(typeof D!="object"||D===null)return D;var w,C=Array.isArray(D)?[]:{};for(w in D)C[w]=R(D[w]);return C}function F(D,w){return function(){D.apply(w,arguments)}}function U(D){return typeof D=="function"}return u.parse=function(D,w){var C=(w=w||{}).dynamicTyping||!1;if(U(C)&&(w.dynamicTypingFunction=C,C={}),w.dynamicTyping=C,w.transform=!!U(w.transform)&&w.transform,w.downloadTimeout!==void 0){var C=parseInt(w.downloadTimeout);if(isNaN(C))throw new Error("Config downloadTimeout value ("+w.downloadTimeout+") not parsable by parseInt(val).");w.downloadTimeout=C}if(!w.worker||!u.WORKERS_SUPPORTED)return C=null,u.NODE_STREAM_INPUT,typeof D=="string"?(D=d(D),C=new(w.download?m:_)(w)):D.readable===!0&&U(D.read)&&U(D.on)?C=new x(w):(i.File&&D instanceof File||D instanceof Object)&&(C=new g(w)),C.stream(D);(C=(()=>{var N;return!!u.WORKERS_SUPPORTED&&(N=(()=>{var $=i.URL||i.webkitURL||null,V=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; ","(",V,")();"],{type:"text/javascript"})))})(),(N=new i.Worker(N)).onmessage=A,N.id=l++,a[N.id]=N)})()).userStep=w.step,C.userChunk=w.chunk,C.userComplete=w.complete,C.userError=w.error,w.step=U(w.step),w.chunk=U(w.chunk),w.complete=U(w.complete),w.error=U(w.error),delete w.worker,C.postMessage({input:D,config:w,workerId:C.id})},u.unparse=function(D,w){var C=!1,N=!0,$=",",V=`\r
33
+ `);var at=0,pt=!1;this.parse=function(G,B,z){if(typeof G!="string")throw new Error("Input must be a string");var Z=G.length,it=w.length,ht=C.length,mt=N.length,X=U($),ot=[],vt=[],lt=[],bt=at=0;if(!G)return Yt();if(st||st!==!1&&G.indexOf(ct)===-1){for(var Rt=G.split(C),j=0;j<Rt.length;j++){if(lt=Rt[j],at+=lt.length,j!==Rt.length-1)at+=C.length;else if(z)return Yt();if(!N||lt.substring(0,mt)!==N){if(X){if(ot=[],Me(lt.split(w)),Be(),pt)return Yt()}else Me(lt.split(w));if(V&&V<=j)return ot=ot.slice(0,V),Yt(!0)}}return Yt()}for(var et=G.indexOf(w,at),rt=G.indexOf(C,at),Gt=new RegExp(S(Tt)+S(ct),"g"),_t=G.indexOf(ct,at);;)if(G[at]===ct)for(_t=at,at++;;){if((_t=G.indexOf(ct,_t+1))===-1)return z||vt.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:ot.length,index:at}),ee();if(_t===Z-1)return ee(G.substring(at,_t).replace(Gt,ct));if(ct===Tt&&G[_t+1]===Tt)_t++;else if(ct===Tt||_t===0||G[_t-1]!==Tt){et!==-1&&et<_t+1&&(et=G.indexOf(w,_t+1));var $t=Te((rt=rt!==-1&&rt<_t+1?G.indexOf(C,_t+1):rt)===-1?et:Math.min(et,rt));if(G.substr(_t+1+$t,it)===w){lt.push(G.substring(at,_t).replace(Gt,ct)),G[at=_t+1+$t+it]!==ct&&(_t=G.indexOf(ct,at)),et=G.indexOf(w,at),rt=G.indexOf(C,at);break}if($t=Te(rt),G.substring(_t+1+$t,_t+1+$t+ht)===C){if(lt.push(G.substring(at,_t).replace(Gt,ct)),je(_t+1+$t+ht),et=G.indexOf(w,at),_t=G.indexOf(ct,at),X&&(Be(),pt))return Yt();if(V&&ot.length>=V)return Yt(!0);break}vt.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:ot.length,index:at}),_t++}}else if(N&&lt.length===0&&G.substring(at,at+mt)===N){if(rt===-1)return Yt();at=rt+ht,rt=G.indexOf(C,at),et=G.indexOf(w,at)}else if(et!==-1&&(et<rt||rt===-1))lt.push(G.substring(at,et)),at=et+it,et=G.indexOf(w,at);else{if(rt===-1)break;if(lt.push(G.substring(at,rt)),je(rt+ht),X&&(Be(),pt))return Yt();if(V&&ot.length>=V)return Yt(!0)}return ee();function Me(se){ot.push(se),bt=at}function Te(se){var De=0;return De=se!==-1&&(se=G.substring(_t+1,se))&&se.trim()===""?se.length:De}function ee(se){return z||(se===void 0&&(se=G.substring(at)),lt.push(se),at=Z,Me(lt),X&&Be()),Yt()}function je(se){at=se,Me(lt),lt=[],rt=G.indexOf(C,at)}function Yt(se){if(D.header&&!B&&ot.length&&!ut){var De=ot[0],Pe=Object.create(null),gn=new Set(De);let Wi=!1;for(let Cn=0;Cn<De.length;Cn++){let Ge=d(De[Cn]);if(Pe[Ge=U(D.transformHeader)?D.transformHeader(Ge,Cn):Ge]){let Ln,di=Pe[Ge];for(;Ln=Ge+"_"+di,di++,gn.has(Ln););gn.add(Ln),De[Cn]=Ln,Pe[Ge]++,Wi=!0,(dt=dt===null?{}:dt)[Ln]=Ge}else Pe[Ge]=1,De[Cn]=Ge;gn.add(Ge)}Wi&&console.warn("Duplicate headers found and renamed."),ut=!0}return{data:ot,errors:vt,meta:{delimiter:w,linebreak:C,aborted:pt,truncated:!!se,cursor:bt+(B||0),renamedHeaders:dt}}}function Be(){$(Yt()),ot=[],vt=[]}},this.abort=function(){pt=!0},this.getCharIndex=function(){return at}}function A(D){var w=D.data,C=a[w.workerId],N=!1;if(w.error)C.userError(w.error,w.file);else if(w.results&&w.results.data){var $={abort:function(){N=!0,P(w.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:L,resume:L};if(U(C.userStep)){for(var V=0;V<w.results.data.length&&(C.userStep({data:w.results.data[V],errors:w.results.errors,meta:w.results.meta},$),!N);V++);delete w.results}else U(C.userChunk)&&(C.userChunk(w.results,$,w.file),delete w.results)}w.finished&&!N&&P(w.workerId,w.results)}function P(D,w){var C=a[D];U(C.userComplete)&&C.userComplete(w),C.terminate(),delete a[D]}function L(){throw new Error("Not implemented.")}function R(D){if(typeof D!="object"||D===null)return D;var w,C=Array.isArray(D)?[]:{};for(w in D)C[w]=R(D[w]);return C}function F(D,w){return function(){D.apply(w,arguments)}}function U(D){return typeof D=="function"}return u.parse=function(D,w){var C=(w=w||{}).dynamicTyping||!1;if(U(C)&&(w.dynamicTypingFunction=C,C={}),w.dynamicTyping=C,w.transform=!!U(w.transform)&&w.transform,w.downloadTimeout!==void 0){var C=parseInt(w.downloadTimeout);if(isNaN(C))throw new Error("Config downloadTimeout value ("+w.downloadTimeout+") not parsable by parseInt(val).");w.downloadTimeout=C}if(!w.worker||!u.WORKERS_SUPPORTED)return C=null,u.NODE_STREAM_INPUT,typeof D=="string"?(D=d(D),C=new(w.download?m:y)(w)):D.readable===!0&&U(D.read)&&U(D.on)?C=new x(w):(i.File&&D instanceof File||D instanceof Object)&&(C=new g(w)),C.stream(D);(C=(()=>{var N;return!!u.WORKERS_SUPPORTED&&(N=(()=>{var $=i.URL||i.webkitURL||null,V=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; ","(",V,")();"],{type:"text/javascript"})))})(),(N=new i.Worker(N)).onmessage=A,N.id=l++,a[N.id]=N)})()).userStep=w.step,C.userChunk=w.chunk,C.userComplete=w.complete,C.userError=w.error,w.step=U(w.step),w.chunk=U(w.chunk),w.complete=U(w.complete),w.error=U(w.error),delete w.worker,C.postMessage({input:D,config:w,workerId:C.id})},u.unparse=function(D,w){var C=!1,N=!0,$=",",V=`\r
34
34
  `,st='"',dt=st+st,ut=!1,ct=null,Tt=!1,at=((()=>{if(typeof w=="object"){if(typeof w.delimiter!="string"||u.BAD_DELIMITERS.filter(function(B){return w.delimiter.indexOf(B)!==-1}).length||($=w.delimiter),typeof w.quotes!="boolean"&&typeof w.quotes!="function"&&!Array.isArray(w.quotes)||(C=w.quotes),typeof w.skipEmptyLines!="boolean"&&typeof w.skipEmptyLines!="string"||(ut=w.skipEmptyLines),typeof w.newline=="string"&&(V=w.newline),typeof w.quoteChar=="string"&&(st=w.quoteChar,dt=st+st),typeof w.header=="boolean"&&(N=w.header),Array.isArray(w.columns)){if(w.columns.length===0)throw new Error("Option columns is empty");ct=w.columns}w.escapeChar!==void 0&&(dt=w.escapeChar+st),w.escapeFormulae instanceof RegExp?Tt=w.escapeFormulae:typeof w.escapeFormulae=="boolean"&&w.escapeFormulae&&(Tt=/^[=+\-@\t\r].*$/)}})(),new RegExp(S(st),"g"));if(typeof D=="string"&&(D=JSON.parse(D)),Array.isArray(D)){if(!D.length||Array.isArray(D[0]))return pt(null,D,ut);if(typeof D[0]=="object")return pt(ct||Object.keys(D[0]),D,ut)}else if(typeof D=="object")return typeof D.data=="string"&&(D.data=JSON.parse(D.data)),Array.isArray(D.data)&&(D.fields||(D.fields=D.meta&&D.meta.fields||ct),D.fields||(D.fields=Array.isArray(D.data[0])?D.fields:typeof D.data[0]=="object"?Object.keys(D.data[0]):[]),Array.isArray(D.data[0])||typeof D.data[0]=="object"||(D.data=[D.data])),pt(D.fields||[],D.data||[],ut);throw new Error("Unable to serialize unrecognized input");function pt(B,z,Z){var it="",ht=(typeof B=="string"&&(B=JSON.parse(B)),typeof z=="string"&&(z=JSON.parse(z)),Array.isArray(B)&&0<B.length),mt=!Array.isArray(z[0]);if(ht&&N){for(var X=0;X<B.length;X++)0<X&&(it+=$),it+=G(B[X],X);0<z.length&&(it+=V)}for(var ot=0;ot<z.length;ot++){var vt=(ht?B:z[ot]).length,lt=!1,bt=ht?Object.keys(z[ot]).length===0:z[ot].length===0;if(Z&&!ht&&(lt=Z==="greedy"?z[ot].join("").trim()==="":z[ot].length===1&&z[ot][0].length===0),Z==="greedy"&&ht){for(var Rt=[],j=0;j<vt;j++){var et=mt?B[j]:j;Rt.push(z[ot][et])}lt=Rt.join("").trim()===""}if(!lt){for(var rt=0;rt<vt;rt++){0<rt&&!bt&&(it+=$);var Gt=ht&&mt?B[rt]:rt;it+=G(z[ot][Gt],rt)}ot<z.length-1&&(!Z||0<vt&&!bt)&&(it+=V)}}return it}function G(B,z){var Z,it,ht;return B==null?"":B.constructor===Date?isNaN(B.getTime())?"":B.toISOString():(ht=!1,Tt&&typeof B=="string"&&Tt.test(B)&&(B="'"+B,ht=!0),it=(Z=B.toString()).replace(at,dt),(ht=ht||C===!0||typeof C=="function"&&C(B,z)||Array.isArray(C)&&C[z]||((mt,X)=>{for(var ot=0;ot<X.length;ot++)if(-1<mt.indexOf(X[ot]))return!0;return!1})(it,u.BAD_DELIMITERS)||-1<it.indexOf($)||-1<Z.indexOf(st)||it.charAt(0)===" "||it.charAt(it.length-1)===" ")?st+it+st:it)}},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=O,u.ParserHandle=v,u.NetworkStreamer=m,u.FileStreamer=g,u.StringStreamer=_,u.ReadableStreamStreamer=x,s&&(i.onmessage=function(D){D=D.data,u.WORKER_ID===void 0&&D&&(u.WORKER_ID=D.workerId),typeof D.input=="string"?i.postMessage({workerId:u.WORKER_ID,results:u.parse(D.input,D.config),finished:!0}):(i.File&&D.input instanceof File||D.input instanceof Object)&&(D=u.parse(D.input,D.config))&&i.postMessage({workerId:u.WORKER_ID,results:D,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})})(bl)),bl.exports}var GB=jB();const KB=["id"],XB=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=>s_.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=>s_.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=GB.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});YB.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,KB))}}),ZB=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(XB,{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"])]))}}),QB={class:"kong-ui-public-csv-export-modal"},JB={key:0,class:"selected-range"},tF={key:4,class:"text-muted",tag:"span"},l_=3,eF=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(l_,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(R=>R.timestamp!==x.data[0].timestamp),S=x.data.map(R=>{const F=new Date(R.timestamp);return{...Object.keys(R.event).reduce((D,w)=>{if(w in x.meta.display){const C=R.event[w],N=x.meta.display[w];D[w]=C&&N&&N[C].name||R.event[w]}else D[w]=R.event[w];return D},{}),...v?{timestamp:sd(F,"yyyy-MM-dd HH:mm:ss"),tzOffset:sd(F,"XXX")}:{}}});let O=[];v&&(O=[{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:{},P=[...O,...Object.keys(A).map(R=>({label:n.t(`chartLabels.${R}`),key:R})),...i.exportState.chartData.meta.metric_names.map(R=>({label:n.t(`chartLabels.${R}`),key:R}))],L=P.reduce((R,F)=>(R[F.key]=F.label,R),{});return{headers:P,csvHeaders:L,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,l_)}};return f.watch(g,()=>{a.value++}),(x,v)=>{const S=f.resolveComponent("KSkeleton"),O=f.resolveComponent("KEmptyState"),A=f.resolveComponent("KTableData"),P=f.resolveComponent("KTooltip"),L=f.resolveComponent("KButton"),R=f.resolveComponent("KModal");return f.openBlock(),f.createElementBlock("div",QB,[f.createVNode(R,{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",JB,[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(O,{"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(O,{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",tF,[f.createTextVNode(f.toDisplayString(h.value)+" ",1),f.createVNode(P,{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(Fc)})`,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(L,{appearance:"tertiary",class:"cancel-btn",onClick:m},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(f.unref(n).t("csvExport.cancelButton")),1)]),_:1}),f.createVNode(ZB,{class:"vitals-report-export-button",filename:s,headers:g.value.csvHeaders,rows:g.value.rows},{default:f.withCtx(()=>[f.createVNode(L,{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"])])}}});Lt.AnalyticsChart=IN,Lt.ChartLegendPosition=Le,Lt.CsvExportModal=eF,Lt.DECIMAL_DISPLAY=AP,Lt.FONT_SIZE_REGULAR=k0,Lt.FONT_SIZE_SMALL=T0,Lt.LEFT_Y_AXIS_ID=rl,Lt.MAX_LABEL_LENGTH=il,Lt.OTHER_DIMENSION_ID=Uu,Lt.RIGHT_Y_AXIS_ID=qu,Lt.SimpleChart=XN,Lt.SparklineChart=tB,Lt.TopNTable=UB,Lt.TopTalkersColumn=i_,Lt.TopTalkersGrid=xB,Lt.ValidType=br,Lt.chartTypes=R2,Lt.exploreResultToScatterData=q0,Lt.getBarRatio=b0,Lt.getColumnOptions=gr,Lt.getColumnStats=Hu,Lt.getRelativeValue=Wu,Lt.getThresholdType=$u,Lt.handleQueryError=S2,Lt.isCancellationError=V0,Lt.isScatterChartData=dd,Lt.lookupStatusCodeColor=D0,Lt.requestsToScatterData=O2,Lt.simpleChartMetricDisplay=E2,Lt.simpleChartTypes=P2,Lt.statusCodeBadgeBackgroundColor=PP,Lt.toNumber=Jr,Object.defineProperty(Lt,Symbol.toStringTag,{value:"Module"})}));
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=O,u.ParserHandle=v,u.NetworkStreamer=m,u.FileStreamer=g,u.StringStreamer=y,u.ReadableStreamStreamer=x,s&&(i.onmessage=function(D){D=D.data,u.WORKER_ID===void 0&&D&&(u.WORKER_ID=D.workerId),typeof D.input=="string"?i.postMessage({workerId:u.WORKER_ID,results:u.parse(D.input,D.config),finished:!0}):(i.File&&D.input instanceof File||D.input instanceof Object)&&(D=u.parse(D.input,D.config))&&i.postMessage({workerId:u.WORKER_ID,results:D,finished:!0})}),(m.prototype=Object.create(h.prototype)).constructor=m,(g.prototype=Object.create(h.prototype)).constructor=g,(y.prototype=Object.create(y.prototype)).constructor=y,(x.prototype=Object.create(h.prototype)).constructor=x,u})})(bl)),bl.exports}var GB=jB();const KB=["id"],XB=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=>sy.mapKeys(m,(g,y)=>h[y]||y):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=>sy.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=GB.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});YB.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,KB))}}),ZB=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(XB,{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"])]))}}),QB={class:"kong-ui-public-csv-export-modal"},JB={key:0,class:"selected-range"},tF={key:4,class:"text-muted",tag:"span"},ly=3,eF=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(ly,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(R=>R.timestamp!==x.data[0].timestamp),S=x.data.map(R=>{const F=new Date(R.timestamp);return{...Object.keys(R.event).reduce((D,w)=>{if(w in x.meta.display){const C=R.event[w],N=x.meta.display[w];D[w]=C&&N&&N[C].name||R.event[w]}else D[w]=R.event[w];return D},{}),...v?{timestamp:sd(F,"yyyy-MM-dd HH:mm:ss"),tzOffset:sd(F,"XXX")}:{}}});let O=[];v&&(O=[{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:{},P=[...O,...Object.keys(A).map(R=>({label:n.t(`chartLabels.${R}`),key:R})),...i.exportState.chartData.meta.metric_names.map(R=>({label:n.t(`chartLabels.${R}`),key:R}))],L=P.reduce((R,F)=>(R[F.key]=F.label,R),{});return{headers:P,csvHeaders:L,rows:S}}),y=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,ly)}};return f.watch(g,()=>{a.value++}),(x,v)=>{const S=f.resolveComponent("KSkeleton"),O=f.resolveComponent("KEmptyState"),A=f.resolveComponent("KTableData"),P=f.resolveComponent("KTooltip"),L=f.resolveComponent("KButton"),R=f.resolveComponent("KModal");return f.openBlock(),f.createElementBlock("div",QB,[f.createVNode(R,{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",JB,[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:y,"fetcher-cache-key":String(a.value),headers:g.value?.headers||[],"hide-pagination":"","row-hover":!1,sortable:!1},{"empty-state":f.withCtx(()=>[f.createVNode(O,{"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(O,{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",tF,[f.createTextVNode(f.toDisplayString(h.value)+" ",1),f.createVNode(P,{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(Fc)})`,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(L,{appearance:"tertiary",class:"cancel-btn",onClick:m},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(f.unref(n).t("csvExport.cancelButton")),1)]),_:1}),f.createVNode(ZB,{class:"vitals-report-export-button",filename:s,headers:g.value.csvHeaders,rows:g.value.rows},{default:f.withCtx(()=>[f.createVNode(L,{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"])])}}});Lt.AnalyticsChart=IN,Lt.ChartLegendPosition=Le,Lt.CsvExportModal=eF,Lt.DECIMAL_DISPLAY=AP,Lt.FONT_SIZE_REGULAR=k0,Lt.FONT_SIZE_SMALL=T0,Lt.LEFT_Y_AXIS_ID=rl,Lt.MAX_LABEL_LENGTH=il,Lt.OTHER_DIMENSION_ID=Uu,Lt.RIGHT_Y_AXIS_ID=qu,Lt.SimpleChart=XN,Lt.SparklineChart=tB,Lt.TopNTable=UB,Lt.TopTalkersColumn=iy,Lt.TopTalkersGrid=xB,Lt.ValidType=br,Lt.chartTypes=R2,Lt.exploreResultToScatterData=q0,Lt.getBarRatio=b0,Lt.getColumnOptions=gr,Lt.getColumnStats=Hu,Lt.getRelativeValue=Wu,Lt.getThresholdType=$u,Lt.handleQueryError=S2,Lt.isCancellationError=V0,Lt.isScatterChartData=dd,Lt.lookupStatusCodeColor=D0,Lt.requestsToScatterData=O2,Lt.simpleChartMetricDisplay=E2,Lt.simpleChartTypes=P2,Lt.statusCodeBadgeBackgroundColor=PP,Lt.toNumber=Jr,Object.defineProperty(Lt,Symbol.toStringTag,{value:"Module"})}));