@kong-ui-public/analytics-utilities 11.0.0 → 11.0.1-pr.2392.2d3e3661f.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types/dashboardSchema.v2.d.ts +223 -1
- package/dist/types/dashboardSchema.v2.d.ts.map +1 -1
- package/dist/vitals-utilities.cjs +1 -1
- package/dist/vitals-utilities.cjs.map +1 -1
- package/dist/vitals-utilities.es.js +455 -412
- package/dist/vitals-utilities.es.js.map +1 -1
- package/dist/vitals-utilities.umd.js +1 -1
- package/dist/vitals-utilities.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var Ta=Object.defineProperty;var Da=(e,t,r)=>t in e?Ta(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var b=(e,t,r)=>Da(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Oa=30*1e3;var m=(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.CURRENT_WEEK="current_week",e.CURRENT_MONTH="current_month",e.CURRENT_QUARTER="current_quarter",e.PREVIOUS_WEEK="previous_week",e.PREVIOUS_MONTH="previous_month",e.PREVIOUS_QUARTER="previous_quarter",e))(m||{});const Ma=["horizontal_bar","vertical_bar","timeseries_line","choropleth_map","timeseries_bar","donut","single_value"],sr=["in","not_in","selector"],Sa=["=","!="],va=["=","!=","<",">","<=",">="],or=["empty","not_empty"],xa=["starts_with","ends_with"],Ea=["absolute","relative"],ur=["15m","1h","6h","12h","24h","7d","current_week","previous_week","30d","current_month","previous_month"],Qe=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],se=e=>e.filter(t=>t!=="time"),ve=["api","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],oe=se(ve),Ze=["active_services","request_count","request_per_minute","response_latency_average"],Be=[...ve,"application","consumer","country_code","iso_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm"],ue=se(Be),cr=[...Ze,"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","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"],Ke=["control_plane","control_plane_group","gateway_service","consumer","application","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"],ce=se(Ke),lr=["total_tokens","prompt_tokens","completion_tokens","ai_request_count","cost","llm_cache_embeddings_latency_average","llm_cache_fetch_latency_average","llm_latency_average","llm_embeddings_tokens","llm_embeddings_cost"],dr=["api","api_product","api_product_version","application","auth_type","client_ip","consumer","consumer_group","control_plane","control_plane_group","country_code","data_plane_node","data_plane_node_version","gateway_service","header_host","header_user_agent","http_method","iso_code","portal","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"],fr=se(dr),hr=["auth_type","client_ip","country_code","data_plane_node_version","header_host","header_user_agent","http_method","request_id","request_uri","response_header_content_type","response_source","service_port","service_protocol","trace_id","upstream_uri"],Pa=hr,mr=["ai_count","latencies_response_ms","latencies_upstream_ms","latencies_kong_gateway_ms","request_body_size","response_body_size","response_header_content_length","status_code","upstream_status_code"],yr=se(mr),Na=["15M","1H","6H","12H","24H","7D"],ka=["basic","api_usage","llm_usage"],gr={basic:new Set(oe),api_usage:new Set(ue),llm_usage:new Set(ce)},Ia=(e,t)=>t.filter(r=>gr[e].has(r.field)),Ra=["horizontal_bar","vertical_bar","gauge","donut","timeseries_line","timeseries_bar","golden_signals","top_n","slottable","single_value"],le={type:"string"},V={type:"string"},pr={type:"boolean"},_r={type:["object","array"],items:{type:"string"},additionalProperties:{type:"string"}},wr={type:"object",properties:{type:{type:"string",enum:["slottable"]},id:{type:"string"}},required:["type","id"],additionalProperties:!1},br={type:"object",properties:{type:{type:"string",enum:["horizontal_bar","vertical_bar"]},stacked:{type:"boolean"},chart_dataset_colors:_r,synthetics_data_key:le,chart_title:V,allow_csv_export:pr},required:["type"],additionalProperties:!1},Tr={type:"object",properties:{type:{type:"string",enum:["timeseries_line","timeseries_bar"]},stacked:{type:"boolean"},threshold:{type:"object",additionalProperties:{type:"number"}},chart_dataset_colors:_r,synthetics_data_key:le,chart_title:V,allow_csv_export:pr},required:["type"],additionalProperties:!1},Dr={type:"object",properties:{type:{type:"string",enum:["gauge"]},metric_display:{type:"string",enum:["hidden","single","full"]},reverse_dataset:{type:"boolean"},numerator:{type:"number"},synthetics_data_key:le,chart_title:V},required:["type"],additionalProperties:!1},Or={type:"object",properties:{type:{type:"string",enum:["donut"]},synthetics_data_key:le,chart_title:V},required:["type"],additionalProperties:!1},Mr={type:"object",properties:{chart_title:V,synthetics_data_key:le,type:{type:"string",enum:["top_n"]},description:{type:"string"},entity_link:{type:"string"}},required:["type"],additionalProperties:!1},Sr={type:"object",properties:{chart_title:V,type:{type:"string",enum:["golden_signals"]},long_card_titles:{type:"boolean"},description:{type:"string"},percentile_latency:{type:"boolean"}},required:["type"],additionalProperties:!1},vr={type:"object",properties:{type:{type:"string",enum:["single_value"]},decimal_points:{type:"number"},chart_title:V},required:["type"],additionalProperties:!1},Ca={type:"object",properties:{tz:{type:"string",default:"Etc/UTC"},type:{type:"string",enum:["relative"]},time_range:{type:"string",enum:ur,default:"1h"}},required:["type","time_range"],additionalProperties:!1},Ya={type:"object",description:"A duration representing an exact start and end time.",properties:{tz:{type:"string"},type:{type:"string",enum:["absolute"]},start:{type:"string"},end:{type:"string"}},required:["type","start","end"],additionalProperties:!1},Je={granularity:{type:"string",description:'Force time grouping into buckets of this duration. Only has an effect if "time" is in the "dimensions" list.',enum:Qe},time_range:{type:"object",description:"The time range to query.",anyOf:[Ca,Ya],default:{type:"relative",time_range:"1h"}},limit:{type:"number"},meta:{type:"object"}},et=e=>({type:"array",description:"List of aggregated metrics to collect across the requested time span.",items:{type:"string",enum:e}}),tt=e=>({type:"array",description:"List of attributes or entity types to group by.",minItems:0,maxItems:2,items:{type:"string",enum:e}}),xe=e=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",enum:e},operator:{type:"string",enum:sr},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",enum:e},operator:{type:"string",enum:or}},required:["field","operator"],additionalProperties:!1}]}}),xr={type:"object",description:"A query to launch at the advanced explore API",properties:{datasource:{type:"string",enum:["api_usage"]},metrics:et(cr),dimensions:tt(Be),filters:xe(ue),...Je},required:["datasource"],additionalProperties:!1},Er={type:"object",description:"A query to launch at the basic explore API",properties:{datasource:{type:"string",enum:["basic"]},metrics:et(Ze),dimensions:tt(ve),filters:xe(oe),...Je},required:["datasource"],additionalProperties:!1},Pr={type:"object",description:"A query to launch at the AI explore API",properties:{datasource:{type:"string",enum:["llm_usage"]},metrics:et(lr),dimensions:tt(Ke),filters:xe(ce),...Je},required:["datasource"],additionalProperties:!1},Nr={anyOf:[xr,Er,Pr]},kr={type:"object",properties:{query:Nr,chart:{anyOf:[br,Dr,Or,Tr,Sr,Mr,wr,vr]}},required:["query","chart"],additionalProperties:!1},Ir={type:"object",properties:{position:{type:"object",properties:{col:{type:"number"},row:{type:"number"}},description:"Position of the tile in the grid.",required:["col","row"],additionalProperties:!1},size:{type:"object",properties:{cols:{type:"number"},rows:{type:"number"},fit_to_content:{type:"boolean"}},description:"Number of columns and rows the tile occupies. If fitToContent is true for every tile in a row, and each tile only occupies 1 row, then the row will auto-fit to its content.",required:["cols","rows"],additionalProperties:!1}},required:["position","size"],additionalProperties:!1},Rr={type:"object",properties:{type:{type:"string",enum:["chart"]},definition:kr,layout:Ir,id:{type:"string",description:"Unique identifier for the tile. If not provided, one will be generated."}},required:["type","definition","layout"],additionalProperties:!1},Ha={type:"object",properties:{tiles:{type:"array",items:Rr},tile_height:{type:"number",description:"Height of each tile in pixels."},preset_filters:xe([...new Set([...ue,...oe,...ce])]),template_id:{type:["string","null"],description:"Template id which was used to instantiate this dashboard."}},required:["tiles"],additionalProperties:!1},qa=e=>{const t=[];return oe.includes(e)&&t.push("basic"),ue.includes(e)&&t.push("api_usage"),ce.includes(e)&&t.push("llm_usage"),(fr.includes(e)||yr.includes(e))&&t.push("requests"),t},Cr=6048e5,Fa=864e5,Ga=60,Aa=3600,At=Symbol.for("constructDateFrom");function I(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&At in e?e[At](t):e instanceof Date?new e.constructor(t):new Date(t)}function O(e,t){return I(t||e,e)}function Wt(e,t,r){const n=O(e,r==null?void 0:r.in);return isNaN(t)?I(e,NaN):(n.setDate(n.getDate()+t),n)}function Wa(e,t,r){const n=O(e,r==null?void 0:r.in);if(isNaN(t))return I(e,NaN);const i=n.getDate(),o=I(e,n.getTime());o.setMonth(n.getMonth()+t+1,0);const c=o.getDate();return i>=c?o:(n.setFullYear(o.getFullYear(),o.getMonth(),i),n)}let ja={};function de(){return ja}function q(e,t){var d,h,f,_;const r=de(),n=(t==null?void 0:t.weekStartsOn)??((h=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:h.weekStartsOn)??r.weekStartsOn??((_=(f=r.locale)==null?void 0:f.options)==null?void 0:_.weekStartsOn)??0,i=O(e,t==null?void 0:t.in),o=i.getDay(),c=(o<n?7:0)+o-n;return i.setDate(i.getDate()-c),i.setHours(0,0,0,0),i}function Te(e,t){return q(e,{...t,weekStartsOn:1})}function Yr(e,t){const r=O(e,t==null?void 0:t.in),n=r.getFullYear(),i=I(r,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const o=Te(i),c=I(r,0);c.setFullYear(n,0,4),c.setHours(0,0,0,0);const d=Te(c);return r.getTime()>=o.getTime()?n+1:r.getTime()>=d.getTime()?n:n-1}function jt(e){const t=O(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function La(e,...t){const r=I.bind(null,t.find(n=>typeof n=="object"));return t.map(r)}function De(e,t){const r=O(e,t==null?void 0:t.in);return r.setHours(0,0,0,0),r}function Ua(e,t,r){const[n,i]=La(r==null?void 0:r.in,e,t),o=De(n),c=De(i),d=+o-jt(o),h=+c-jt(c);return Math.round((d-h)/Fa)}function za(e,t){const r=Yr(e,t),n=I(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),Te(n)}function Va(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function $a(e){return!(!Va(e)&&typeof e!="number"||isNaN(+O(e)))}function J(e,t){const r=O(e,t==null?void 0:t.in);return r.setDate(1),r.setHours(0,0,0,0),r}function Xa(e,t){const r=O(e,t==null?void 0:t.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}const Qa={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"}},Za=(e,t,r)=>{let n;const i=Qa[e];return typeof i=="string"?n=i:t===1?n=i.one:n=i.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function We(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const Ba={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ka={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ja={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ei={date:We({formats:Ba,defaultWidth:"full"}),time:We({formats:Ka,defaultWidth:"full"}),dateTime:We({formats:Ja,defaultWidth:"full"})},ti={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ri=(e,t,r,n)=>ti[e];function ne(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let i;if(n==="formatting"&&e.formattingValues){const c=e.defaultFormattingWidth||e.defaultWidth,d=r!=null&&r.width?String(r.width):c;i=e.formattingValues[d]||e.formattingValues[c]}else{const c=e.defaultWidth,d=r!=null&&r.width?String(r.width):e.defaultWidth;i=e.values[d]||e.values[c]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const ni={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ai={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ii={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"]},si={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"]},oi={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"}},ui={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"}},ci=(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},li={ordinalNumber:ci,era:ne({values:ni,defaultWidth:"wide"}),quarter:ne({values:ai,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ne({values:ii,defaultWidth:"wide"}),day:ne({values:si,defaultWidth:"wide"}),dayPeriod:ne({values:oi,defaultWidth:"wide",formattingValues:ui,defaultFormattingWidth:"wide"})};function ae(e){return(t,r={})=>{const n=r.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const c=o[0],d=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],h=Array.isArray(d)?fi(d,y=>y.test(c)):di(d,y=>y.test(c));let f;f=e.valueCallback?e.valueCallback(h):h,f=r.valueCallback?r.valueCallback(f):f;const _=t.slice(c.length);return{value:f,rest:_}}}function di(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function fi(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function hi(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const i=n[0],o=t.match(e.parsePattern);if(!o)return null;let c=e.valueCallback?e.valueCallback(o[0]):o[0];c=r.valueCallback?r.valueCallback(c):c;const d=t.slice(i.length);return{value:c,rest:d}}}const mi=/^(\d+)(th|st|nd|rd)?/i,yi=/\d+/i,gi={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},pi={any:[/^b/i,/^(a|c)/i]},_i={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},wi={any:[/1/i,/2/i,/3/i,/4/i]},bi={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},Ti={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]},Di={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},Oi={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]},Mi={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},Si={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}},vi={ordinalNumber:hi({matchPattern:mi,parsePattern:yi,valueCallback:e=>parseInt(e,10)}),era:ae({matchPatterns:gi,defaultMatchWidth:"wide",parsePatterns:pi,defaultParseWidth:"any"}),quarter:ae({matchPatterns:_i,defaultMatchWidth:"wide",parsePatterns:wi,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ae({matchPatterns:bi,defaultMatchWidth:"wide",parsePatterns:Ti,defaultParseWidth:"any"}),day:ae({matchPatterns:Di,defaultMatchWidth:"wide",parsePatterns:Oi,defaultParseWidth:"any"}),dayPeriod:ae({matchPatterns:Mi,defaultMatchWidth:"any",parsePatterns:Si,defaultParseWidth:"any"})},xi={code:"en-US",formatDistance:Za,formatLong:ei,formatRelative:ri,localize:li,match:vi,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Ei(e,t){const r=O(e,t==null?void 0:t.in);return Ua(r,Xa(r))+1}function Pi(e,t){const r=O(e,t==null?void 0:t.in),n=+Te(r)-+za(r);return Math.round(n/Cr)+1}function Hr(e,t){var _,y,g,E;const r=O(e,t==null?void 0:t.in),n=r.getFullYear(),i=de(),o=(t==null?void 0:t.firstWeekContainsDate)??((y=(_=t==null?void 0:t.locale)==null?void 0:_.options)==null?void 0:y.firstWeekContainsDate)??i.firstWeekContainsDate??((E=(g=i.locale)==null?void 0:g.options)==null?void 0:E.firstWeekContainsDate)??1,c=I((t==null?void 0:t.in)||e,0);c.setFullYear(n+1,0,o),c.setHours(0,0,0,0);const d=q(c,t),h=I((t==null?void 0:t.in)||e,0);h.setFullYear(n,0,o),h.setHours(0,0,0,0);const f=q(h,t);return+r>=+d?n+1:+r>=+f?n:n-1}function Ni(e,t){var d,h,f,_;const r=de(),n=(t==null?void 0:t.firstWeekContainsDate)??((h=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??r.firstWeekContainsDate??((_=(f=r.locale)==null?void 0:f.options)==null?void 0:_.firstWeekContainsDate)??1,i=Hr(e,t),o=I((t==null?void 0:t.in)||e,0);return o.setFullYear(i,0,n),o.setHours(0,0,0,0),q(o,t)}function ki(e,t){const r=O(e,t==null?void 0:t.in),n=+q(r,t)-+Ni(r,t);return Math.round(n/Cr)+1}function p(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const G={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return p(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):p(r+1,2)},d(e,t){return p(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return p(e.getHours()%12||12,t.length)},H(e,t){return p(e.getHours(),t.length)},m(e,t){return p(e.getMinutes(),t.length)},s(e,t){return p(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),i=Math.trunc(n*Math.pow(10,r-3));return p(i,t.length)}},B={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Lt={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),i=n>0?n:1-n;return r.ordinalNumber(i,{unit:"year"})}return G.y(e,t)},Y:function(e,t,r,n){const i=Hr(e,n),o=i>0?i:1-i;if(t==="YY"){const c=o%100;return p(c,2)}return t==="Yo"?r.ordinalNumber(o,{unit:"year"}):p(o,t.length)},R:function(e,t){const r=Yr(e);return p(r,t.length)},u:function(e,t){const r=e.getFullYear();return p(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return p(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return p(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return G.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return p(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const i=ki(e,n);return t==="wo"?r.ordinalNumber(i,{unit:"week"}):p(i,t.length)},I:function(e,t,r){const n=Pi(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):p(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):G.d(e,t)},D:function(e,t,r){const n=Ei(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):p(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const i=e.getDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return p(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const i=e.getDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return p(o,t.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),i=n===0?7:n;switch(t){case"i":return String(i);case"ii":return p(i,t.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let i;switch(n===12?i=B.noon:n===0?i=B.midnight:i=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let i;switch(n>=17?i=B.evening:n>=12?i=B.afternoon:n>=4?i=B.morning:i=B.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return G.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):G.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):p(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):p(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):G.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):G.s(e,t)},S:function(e,t){return G.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return zt(n);case"XXXX":case"XX":return z(n);case"XXXXX":case"XXX":default:return z(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return zt(n);case"xxxx":case"xx":return z(n);case"xxxxx":case"xxx":default:return z(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Ut(n,":");case"OOOO":default:return"GMT"+z(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Ut(n,":");case"zzzz":default:return"GMT"+z(n,":")}},t:function(e,t,r){const n=Math.trunc(+e/1e3);return p(n,t.length)},T:function(e,t,r){return p(+e,t.length)}};function Ut(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Math.trunc(n/60),o=n%60;return o===0?r+String(i):r+String(i)+t+p(o,2)}function zt(e,t){return e%60===0?(e>0?"-":"+")+p(Math.abs(e)/60,2):z(e,t)}function z(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=p(Math.trunc(n/60),2),o=p(n%60,2);return r+i+t+o}const Vt=(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"});case"PPPP":default:return t.date({width:"full"})}},qr=(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"});case"pppp":default:return t.time({width:"full"})}},Ii=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],i=r[2];if(!i)return Vt(e,t);let o;switch(n){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",Vt(n,t)).replace("{{time}}",qr(i,t))},Ri={p:qr,P:Ii},Ci=/^D+$/,Yi=/^Y+$/,Hi=["D","DD","YY","YYYY"];function qi(e){return Ci.test(e)}function Fi(e){return Yi.test(e)}function Gi(e,t,r){const n=Ai(e,t,r);if(console.warn(n),Hi.includes(e))throw new RangeError(n)}function Ai(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Wi=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ji=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Li=/^'([^]*?)'?$/,Ui=/''/g,zi=/[a-zA-Z]/;function Fr(e,t,r){var _,y,g,E,N,k,R,A;const n=de(),i=(r==null?void 0:r.locale)??n.locale??xi,o=(r==null?void 0:r.firstWeekContainsDate)??((y=(_=r==null?void 0:r.locale)==null?void 0:_.options)==null?void 0:y.firstWeekContainsDate)??n.firstWeekContainsDate??((E=(g=n.locale)==null?void 0:g.options)==null?void 0:E.firstWeekContainsDate)??1,c=(r==null?void 0:r.weekStartsOn)??((k=(N=r==null?void 0:r.locale)==null?void 0:N.options)==null?void 0:k.weekStartsOn)??n.weekStartsOn??((A=(R=n.locale)==null?void 0:R.options)==null?void 0:A.weekStartsOn)??0,d=O(e,r==null?void 0:r.in);if(!$a(d))throw new RangeError("Invalid time value");let h=t.match(ji).map(M=>{const T=M[0];if(T==="p"||T==="P"){const W=Ri[T];return W(M,i.formatLong)}return M}).join("").match(Wi).map(M=>{if(M==="''")return{isToken:!1,value:"'"};const T=M[0];if(T==="'")return{isToken:!1,value:Vi(M)};if(Lt[T])return{isToken:!0,value:M};if(T.match(zi))throw new RangeError("Format string contains an unescaped latin alphabet character `"+T+"`");return{isToken:!1,value:M}});i.localize.preprocessor&&(h=i.localize.preprocessor(d,h));const f={firstWeekContainsDate:o,weekStartsOn:c,locale:i};return h.map(M=>{if(!M.isToken)return M.value;const T=M.value;(!(r!=null&&r.useAdditionalWeekYearTokens)&&Fi(T)||!(r!=null&&r.useAdditionalDayOfYearTokens)&&qi(T))&&Gi(T,t,String(e));const W=Lt[T[0]];return W(d,T,i.localize,f)}).join("")}function Vi(e){const t=e.match(Li);return t?t[1].replace(Ui,"'"):e}function $i(e,t){const r=O(e,t==null?void 0:t.in),n=r.getFullYear(),i=r.getMonth(),o=I(r,0);return o.setFullYear(n,i+1,0),o.setHours(0,0,0,0),o.getDate()}function Xi(){return Object.assign({},de())}function $t(e){return+O(e)}function Xt(e){return Math.trunc(+O(e)/1e3)}function Qi(e){return Math.trunc(e*Aa)}function Zi(e){const t=e/Ga;return Math.trunc(t)}function Gr(e,t,r){return Wa(e,-1,r)}function Qt(e,t,r){const n=Xi(),i=Ji(e,r.timeZone,r.locale??n.locale);return"formatToParts"in i?Bi(i,t):Ki(i,t)}function Bi(e,t){const r=e.formatToParts(t);for(let n=r.length-1;n>=0;--n)if(r[n].type==="timeZoneName")return r[n].value}function Ki(e,t){const r=e.format(t).replace(/\u200E/g,""),n=/ [\w-+ ]+$/.exec(r);return n?n[0].substr(1):""}function Ji(e,t,r){return new Intl.DateTimeFormat(r?[r.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function es(e,t){const r=is(t);return"formatToParts"in r?rs(r,e):ns(r,e)}const ts={year:0,month:1,day:2,hour:3,minute:4,second:5};function rs(e,t){try{const r=e.formatToParts(t),n=[];for(let i=0;i<r.length;i++){const o=ts[r[i].type];o!==void 0&&(n[o]=parseInt(r[i].value,10))}return n}catch(r){if(r instanceof RangeError)return[NaN];throw r}}function ns(e,t){const r=e.format(t),n=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(r);return[parseInt(n[3],10),parseInt(n[1],10),parseInt(n[2],10),parseInt(n[4],10),parseInt(n[5],10),parseInt(n[6],10)]}const je={},Zt=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")),as=Zt==="06/25/2014, 00:00:00"||Zt==="06/25/2014 00:00:00";function is(e){return je[e]||(je[e]=as?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"})),je[e]}function rt(e,t,r,n,i,o,c){const d=new Date(0);return d.setUTCFullYear(e,t,r),d.setUTCHours(n,i,o,c),d}const Bt=36e5,ss=6e4,Le={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function fe(e,t,r){if(!e)return 0;let n=Le.timezoneZ.exec(e);if(n)return 0;let i,o;if(n=Le.timezoneHH.exec(e),n)return i=parseInt(n[1],10),Kt(i)?-(i*Bt):NaN;if(n=Le.timezoneHHMM.exec(e),n){i=parseInt(n[2],10);const c=parseInt(n[3],10);return Kt(i,c)?(o=Math.abs(i)*Bt+c*ss,n[1]==="+"?-o:o):NaN}if(cs(e)){t=new Date(t||Date.now());const c=r?t:os(t),d=$e(c,e);return-(r?d:us(t,d,e))}return NaN}function os(e){return rt(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function $e(e,t){const r=es(e,t),n=rt(r[0],r[1]-1,r[2],r[3]%24,r[4],r[5],0).getTime();let i=e.getTime();const o=i%1e3;return i-=o>=0?o:1e3+o,n-i}function us(e,t,r){let i=e.getTime()-t;const o=$e(new Date(i),r);if(t===o)return t;i-=o-t;const c=$e(new Date(i),r);return o===c?o:Math.max(o,c)}function Kt(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const Jt={};function cs(e){if(Jt[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Jt[e]=!0,!0}catch{return!1}}const ls=60*1e3,ds={X:function(e,t,r){const n=Ue(r.timeZone,e);if(n===0)return"Z";switch(t){case"X":return er(n);case"XXXX":case"XX":return K(n);case"XXXXX":case"XXX":default:return K(n,":")}},x:function(e,t,r){const n=Ue(r.timeZone,e);switch(t){case"x":return er(n);case"xxxx":case"xx":return K(n);case"xxxxx":case"xxx":default:return K(n,":")}},O:function(e,t,r){const n=Ue(r.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+fs(n,":");case"OOOO":default:return"GMT"+K(n,":")}},z:function(e,t,r){switch(t){case"z":case"zz":case"zzz":return Qt("short",e,r);case"zzzz":default:return Qt("long",e,r)}}};function Ue(e,t){const r=e?fe(e,t,!0)/ls:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(r))throw new RangeError("Invalid time zone specified: "+e);return r}function Oe(e,t){const r=e<0?"-":"";let n=Math.abs(e).toString();for(;n.length<t;)n="0"+n;return r+n}function K(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Oe(Math.floor(n/60),2),o=Oe(Math.floor(n%60),2);return r+i+t+o}function er(e,t){return e%60===0?(e>0?"-":"+")+Oe(Math.abs(e)/60,2):K(e,t)}function fs(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Math.floor(n/60),o=n%60;return o===0?r+String(i):r+String(i)+t+Oe(o,2)}function tr(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 Ar=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,ze=36e5,rr=6e4,hs=2,S={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:Ar};function Me(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 r=t.additionalDigits==null?hs:Number(t.additionalDigits);if(r!==2&&r!==1&&r!==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 n=ms(e),{year:i,restDateString:o}=ys(n.date,r),c=gs(o,i);if(c===null||isNaN(c.getTime()))return new Date(NaN);if(c){const d=c.getTime();let h=0,f;if(n.time&&(h=ps(n.time),h===null||isNaN(h)))return new Date(NaN);if(n.timeZone||t.timeZone){if(f=fe(n.timeZone||t.timeZone,new Date(d+h)),isNaN(f))return new Date(NaN)}else f=tr(new Date(d+h)),f=tr(new Date(d+h+f));return new Date(d+h+f)}else return new Date(NaN)}function ms(e){const t={};let r=S.dateTimePattern.exec(e),n;if(r?(t.date=r[1],n=r[3]):(r=S.datePattern.exec(e),r?(t.date=r[1],n=r[2]):(t.date=null,n=e)),n){const i=S.timeZone.exec(n);i?(t.time=n.replace(i[1],""),t.timeZone=i[1].trim()):t.time=n}return t}function ys(e,t){if(e){const r=S.YYY[t],n=S.YYYYY[t];let i=S.YYYY.exec(e)||n.exec(e);if(i){const o=i[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(i=S.YY.exec(e)||r.exec(e),i){const o=i[1];return{year:parseInt(o,10)*100,restDateString:e.slice(o.length)}}}return{year:null}}function gs(e,t){if(t===null)return null;let r,n,i;if(!e||!e.length)return r=new Date(0),r.setUTCFullYear(t),r;let o=S.MM.exec(e);if(o)return r=new Date(0),n=parseInt(o[1],10)-1,ar(t,n)?(r.setUTCFullYear(t,n),r):new Date(NaN);if(o=S.DDD.exec(e),o){r=new Date(0);const c=parseInt(o[1],10);return bs(t,c)?(r.setUTCFullYear(t,0,c),r):new Date(NaN)}if(o=S.MMDD.exec(e),o){r=new Date(0),n=parseInt(o[1],10)-1;const c=parseInt(o[2],10);return ar(t,n,c)?(r.setUTCFullYear(t,n,c),r):new Date(NaN)}if(o=S.Www.exec(e),o)return i=parseInt(o[1],10)-1,ir(i)?nr(t,i):new Date(NaN);if(o=S.WwwD.exec(e),o){i=parseInt(o[1],10)-1;const c=parseInt(o[2],10)-1;return ir(i,c)?nr(t,i,c):new Date(NaN)}return null}function ps(e){let t,r,n=S.HH.exec(e);if(n)return t=parseFloat(n[1].replace(",",".")),Ve(t)?t%24*ze:NaN;if(n=S.HHMM.exec(e),n)return t=parseInt(n[1],10),r=parseFloat(n[2].replace(",",".")),Ve(t,r)?t%24*ze+r*rr:NaN;if(n=S.HHMMSS.exec(e),n){t=parseInt(n[1],10),r=parseInt(n[2],10);const i=parseFloat(n[3].replace(",","."));return Ve(t,r,i)?t%24*ze+r*rr+i*1e3:NaN}return null}function nr(e,t,r){t=t||0,r=r||0;const n=new Date(0);n.setUTCFullYear(e,0,4);const i=n.getUTCDay()||7,o=t*7+r+1-i;return n.setUTCDate(n.getUTCDate()+o),n}const _s=[31,28,31,30,31,30,31,31,30,31,30,31],ws=[31,29,31,30,31,30,31,31,30,31,30,31];function Wr(e){return e%400===0||e%4===0&&e%100!==0}function ar(e,t,r){if(t<0||t>11)return!1;if(r!=null){if(r<1)return!1;const n=Wr(e);if(n&&r>ws[t]||!n&&r>_s[t])return!1}return!0}function bs(e,t){if(t<1)return!1;const r=Wr(e);return!(r&&t>366||!r&&t>365)}function ir(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function Ve(e,t,r){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||r!=null&&(r<0||r>=60))}const Ts=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Ds(e,t,r={}){t=String(t);const n=t.match(Ts);if(n){const i=Me(r.originalDate||e,r);t=n.reduce(function(o,c){if(c[0]==="'")return o;const d=o.indexOf(c),h=o[d-1]==="'",f=o.replace(c,"'"+ds[c[0]](i,c,r)+"'");return h?f.substring(0,d-1)+f.substring(d+1):f},t)}return Fr(e,t,r)}function jr(e,t,r){e=Me(e,r);const n=fe(t,e,!0),i=new Date(e.getTime()-n),o=new Date(0);return o.setFullYear(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()),o.setHours(i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds()),o}function Os(e,t,r,n){return n={...n,timeZone:t,originalDate:e},Ds(jr(e,t,{timeZone:n.timeZone}),r,n)}function Ms(e,t,r){if(typeof e=="string"&&!e.match(Ar))return Me(e,{...r,timeZone:t});e=Me(e,r);const n=rt(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),i=fe(t,new Date(n));return new Date(n+i)}function Lr(e,t){return-fe(e,t)}function Ss(e){return Fr(e,"yyyy-MM-dd'T'HH:mm:ss.SSSXXX")}function Xe(e,t={}){if(!e)return e;const r=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let n="MMM dd, yyy hh:mm a";t.short&&(n="MMM dd, yyy"),t.includeTZ&&(n+=" (z)");const i=new Date(e);return Os(i,r,n)}catch{return console.error("Invalid value passed to formatTime",e),"(invalid date)"}}function vs(e,t){return`${Xe(e.getTime())} - ${Xe(t.getTime(),{includeTZ:!0})}`}const ie={secondly:1e3,tenSecondly:10*1e3,thirtySecondly:30*1e3,minutely:60*1e3,fiveMinutely:5*60*1e3,tenMinutely:10*60*1e3,thirtyMinutely:30*60*1e3,hourly:60*60*1e3,twoHourly:2*60*60*1e3,twelveHourly:12*60*60*1e3,daily:60*60*24*1e3,weekly:60*60*24*7*1e3,trend:0};function xs(e,t){return e.map(r=>({value:r,label:t.t(`configuration.vitals.reports.granularity.${r}`)}))}function Ur(e,t){return{duration:e,type:"duration",origin:t}}function Es(e){return e&&Qe.find(r=>e<=ie[r])||null}function zr(e,t,r,n){const i=ie[r];let o=0;return i>=ie.daily&&(n?o=-Lr(n,t):o=t.getTimezoneOffset()*60*1e3),new Date(e((t.getTime()-o)/i)*i+o)}function Vr(e,t,r){return zr(Math.floor,e,t,r)}function nt(e,t,r){return zr(Math.ceil,e,t,r)}class Ee{constructor(t,r,n){b(this,"timeframe");b(this,"tz");b(this,"dataGranularity");if(this.constructor===Ee)throw new Error("BaseQueryTime is not meant to be used directly.");this.timeframe=t,this.tz=r,this.dataGranularity=n??t.dataGranularity}calculateStartDate(t,r,n=1){if(t)return new Date(this.endDate().getTime()-this.timeframe.timeframeLengthMs()*n);{const i=this.endDate(),o=this.timeframe.rawStart(this.tz),c=Vr(o,r,this.tz),h=(i.getTime()-c.getTime())*(n-1);return new Date(c.getTime()-h)}}granularitySeconds(){return Math.floor(this.granularityMs()/1e3)}granularityDruid(){return Ur(this.granularityMs(),this.startDate().toISOString())}startSeconds(){return Xt(this.startDate())}endSeconds(){return Xt(this.endDate())}startMs(){return $t(this.startDate())}endMs(){return $t(this.endDate())}}class Ps extends Ee{constructor(r,n,i,o,c){super(r,i,o);b(this,"granularity");n&&r.allowedGranularities(c).has(n)?this.granularity=n:c?this.granularity=r.fineGrainedDefaultGranularity??r.defaultResponseGranularity:this.granularity=r.defaultResponseGranularity}startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.granularity)}endDate(){return nt(this.timeframe.rawEnd(),this.granularity,this.tz)}granularityMs(){return ie[this.granularity]}}class $r extends Ee{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.dataGranularity)}endDate(){return nt(this.timeframe.rawEnd(this.tz),this.dataGranularity,this.tz)}granularityMs(){return this.endDate().getTime()-this.startDate().getTime()}}class Ns extends $r{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.dataGranularity,2)}granularityMs(){return this.endDate().getTime()-super.startDate().getTime()}}var be=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ks(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Se={exports:{}};Se.exports;(function(e,t){var r=200,n="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",c="[object Array]",d="[object Boolean]",h="[object Date]",f="[object Error]",_="[object Function]",y="[object GeneratorFunction]",g="[object Map]",E="[object Number]",N="[object Object]",k="[object Promise]",R="[object RegExp]",A="[object Set]",M="[object String]",T="[object Symbol]",W="[object WeakMap]",it="[object ArrayBuffer]",he="[object DataView]",st="[object Float32Array]",ot="[object Float64Array]",ut="[object Int8Array]",ct="[object Int16Array]",lt="[object Int32Array]",dt="[object Uint8Array]",ft="[object Uint8ClampedArray]",ht="[object Uint16Array]",mt="[object Uint32Array]",Zr=/[\\^$.*+?()[\]{}|]/g,Br=/\w*$/,Kr=/^\[object .+?Constructor\]$/,Jr=/^(?:0|[1-9]\d*)$/,w={};w[o]=w[c]=w[it]=w[he]=w[d]=w[h]=w[st]=w[ot]=w[ut]=w[ct]=w[lt]=w[g]=w[E]=w[N]=w[R]=w[A]=w[M]=w[T]=w[dt]=w[ft]=w[ht]=w[mt]=!0,w[f]=w[_]=w[W]=!1;var en=typeof be=="object"&&be&&be.Object===Object&&be,tn=typeof self=="object"&&self&&self.Object===Object&&self,C=en||tn||Function("return this")(),yt=t&&!t.nodeType&&t,gt=yt&&!0&&e&&!e.nodeType&&e,rn=gt&>.exports===yt;function nn(a,s){return a.set(s[0],s[1]),a}function an(a,s){return a.add(s),a}function sn(a,s){for(var u=-1,l=a?a.length:0;++u<l&&s(a[u],u,a)!==!1;);return a}function on(a,s){for(var u=-1,l=s.length,D=a.length;++u<l;)a[D+u]=s[u];return a}function pt(a,s,u,l){for(var D=-1,v=a?a.length:0;++D<v;)u=s(u,a[D],D,a);return u}function un(a,s){for(var u=-1,l=Array(a);++u<a;)l[u]=s(u);return l}function cn(a,s){return a==null?void 0:a[s]}function _t(a){var s=!1;if(a!=null&&typeof a.toString!="function")try{s=!!(a+"")}catch{}return s}function wt(a){var s=-1,u=Array(a.size);return a.forEach(function(l,D){u[++s]=[D,l]}),u}function Ne(a,s){return function(u){return a(s(u))}}function bt(a){var s=-1,u=Array(a.size);return a.forEach(function(l){u[++s]=l}),u}var ln=Array.prototype,dn=Function.prototype,me=Object.prototype,ke=C["__core-js_shared__"],Tt=function(){var a=/[^.]+$/.exec(ke&&ke.keys&&ke.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""}(),Dt=dn.toString,F=me.hasOwnProperty,ye=me.toString,fn=RegExp("^"+Dt.call(F).replace(Zr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ot=rn?C.Buffer:void 0,Mt=C.Symbol,St=C.Uint8Array,hn=Ne(Object.getPrototypeOf,Object),mn=Object.create,yn=me.propertyIsEnumerable,gn=ln.splice,vt=Object.getOwnPropertySymbols,pn=Ot?Ot.isBuffer:void 0,_n=Ne(Object.keys,Object),Ie=Q(C,"DataView"),te=Q(C,"Map"),Re=Q(C,"Promise"),Ce=Q(C,"Set"),Ye=Q(C,"WeakMap"),re=Q(Object,"create"),wn=U(Ie),bn=U(te),Tn=U(Re),Dn=U(Ce),On=U(Ye),xt=Mt?Mt.prototype:void 0,Et=xt?xt.valueOf:void 0;function j(a){var s=-1,u=a?a.length:0;for(this.clear();++s<u;){var l=a[s];this.set(l[0],l[1])}}function Mn(){this.__data__=re?re(null):{}}function Sn(a){return this.has(a)&&delete this.__data__[a]}function vn(a){var s=this.__data__;if(re){var u=s[a];return u===n?void 0:u}return F.call(s,a)?s[a]:void 0}function xn(a){var s=this.__data__;return re?s[a]!==void 0:F.call(s,a)}function En(a,s){var u=this.__data__;return u[a]=re&&s===void 0?n:s,this}j.prototype.clear=Mn,j.prototype.delete=Sn,j.prototype.get=vn,j.prototype.has=xn,j.prototype.set=En;function Y(a){var s=-1,u=a?a.length:0;for(this.clear();++s<u;){var l=a[s];this.set(l[0],l[1])}}function Pn(){this.__data__=[]}function Nn(a){var s=this.__data__,u=ge(s,a);if(u<0)return!1;var l=s.length-1;return u==l?s.pop():gn.call(s,u,1),!0}function kn(a){var s=this.__data__,u=ge(s,a);return u<0?void 0:s[u][1]}function In(a){return ge(this.__data__,a)>-1}function Rn(a,s){var u=this.__data__,l=ge(u,a);return l<0?u.push([a,s]):u[l][1]=s,this}Y.prototype.clear=Pn,Y.prototype.delete=Nn,Y.prototype.get=kn,Y.prototype.has=In,Y.prototype.set=Rn;function $(a){var s=-1,u=a?a.length:0;for(this.clear();++s<u;){var l=a[s];this.set(l[0],l[1])}}function Cn(){this.__data__={hash:new j,map:new(te||Y),string:new j}}function Yn(a){return pe(this,a).delete(a)}function Hn(a){return pe(this,a).get(a)}function qn(a){return pe(this,a).has(a)}function Fn(a,s){return pe(this,a).set(a,s),this}$.prototype.clear=Cn,$.prototype.delete=Yn,$.prototype.get=Hn,$.prototype.has=qn,$.prototype.set=Fn;function X(a){this.__data__=new Y(a)}function Gn(){this.__data__=new Y}function An(a){return this.__data__.delete(a)}function Wn(a){return this.__data__.get(a)}function jn(a){return this.__data__.has(a)}function Ln(a,s){var u=this.__data__;if(u instanceof Y){var l=u.__data__;if(!te||l.length<r-1)return l.push([a,s]),this;u=this.__data__=new $(l)}return u.set(a,s),this}X.prototype.clear=Gn,X.prototype.delete=An,X.prototype.get=Wn,X.prototype.has=jn,X.prototype.set=Ln;function Un(a,s){var u=Fe(a)||ma(a)?un(a.length,String):[],l=u.length,D=!!l;for(var v in a)F.call(a,v)&&!(D&&(v=="length"||la(v,l)))&&u.push(v);return u}function Pt(a,s,u){var l=a[s];(!(F.call(a,s)&&Rt(l,u))||u===void 0&&!(s in a))&&(a[s]=u)}function ge(a,s){for(var u=a.length;u--;)if(Rt(a[u][0],s))return u;return-1}function zn(a,s){return a&&Nt(s,Ge(s),a)}function He(a,s,u,l,D,v,H){var x;if(l&&(x=v?l(a,D,v,H):l(a)),x!==void 0)return x;if(!_e(a))return a;var Ht=Fe(a);if(Ht){if(x=oa(a),!s)return aa(a,x)}else{var Z=L(a),qt=Z==_||Z==y;if(ga(a))return Bn(a,s);if(Z==N||Z==o||qt&&!v){if(_t(a))return v?a:{};if(x=ua(qt?{}:a),!s)return ia(a,zn(x,a))}else{if(!w[Z])return v?a:{};x=ca(a,Z,He,s)}}H||(H=new X);var Ft=H.get(a);if(Ft)return Ft;if(H.set(a,x),!Ht)var Gt=u?sa(a):Ge(a);return sn(Gt||a,function(Ae,we){Gt&&(we=Ae,Ae=a[we]),Pt(x,we,He(Ae,s,u,l,we,a,H))}),x}function Vn(a){return _e(a)?mn(a):{}}function $n(a,s,u){var l=s(a);return Fe(a)?l:on(l,u(a))}function Xn(a){return ye.call(a)}function Qn(a){if(!_e(a)||fa(a))return!1;var s=Yt(a)||_t(a)?fn:Kr;return s.test(U(a))}function Zn(a){if(!It(a))return _n(a);var s=[];for(var u in Object(a))F.call(a,u)&&u!="constructor"&&s.push(u);return s}function Bn(a,s){if(s)return a.slice();var u=new a.constructor(a.length);return a.copy(u),u}function qe(a){var s=new a.constructor(a.byteLength);return new St(s).set(new St(a)),s}function Kn(a,s){var u=s?qe(a.buffer):a.buffer;return new a.constructor(u,a.byteOffset,a.byteLength)}function Jn(a,s,u){var l=s?u(wt(a),!0):wt(a);return pt(l,nn,new a.constructor)}function ea(a){var s=new a.constructor(a.source,Br.exec(a));return s.lastIndex=a.lastIndex,s}function ta(a,s,u){var l=s?u(bt(a),!0):bt(a);return pt(l,an,new a.constructor)}function ra(a){return Et?Object(Et.call(a)):{}}function na(a,s){var u=s?qe(a.buffer):a.buffer;return new a.constructor(u,a.byteOffset,a.length)}function aa(a,s){var u=-1,l=a.length;for(s||(s=Array(l));++u<l;)s[u]=a[u];return s}function Nt(a,s,u,l){u||(u={});for(var D=-1,v=s.length;++D<v;){var H=s[D],x=void 0;Pt(u,H,x===void 0?a[H]:x)}return u}function ia(a,s){return Nt(a,kt(a),s)}function sa(a){return $n(a,Ge,kt)}function pe(a,s){var u=a.__data__;return da(s)?u[typeof s=="string"?"string":"hash"]:u.map}function Q(a,s){var u=cn(a,s);return Qn(u)?u:void 0}var kt=vt?Ne(vt,Object):wa,L=Xn;(Ie&&L(new Ie(new ArrayBuffer(1)))!=he||te&&L(new te)!=g||Re&&L(Re.resolve())!=k||Ce&&L(new Ce)!=A||Ye&&L(new Ye)!=W)&&(L=function(a){var s=ye.call(a),u=s==N?a.constructor:void 0,l=u?U(u):void 0;if(l)switch(l){case wn:return he;case bn:return g;case Tn:return k;case Dn:return A;case On:return W}return s});function oa(a){var s=a.length,u=a.constructor(s);return s&&typeof a[0]=="string"&&F.call(a,"index")&&(u.index=a.index,u.input=a.input),u}function ua(a){return typeof a.constructor=="function"&&!It(a)?Vn(hn(a)):{}}function ca(a,s,u,l){var D=a.constructor;switch(s){case it:return qe(a);case d:case h:return new D(+a);case he:return Kn(a,l);case st:case ot:case ut:case ct:case lt:case dt:case ft:case ht:case mt:return na(a,l);case g:return Jn(a,l,u);case E:case M:return new D(a);case R:return ea(a);case A:return ta(a,l,u);case T:return ra(a)}}function la(a,s){return s=s??i,!!s&&(typeof a=="number"||Jr.test(a))&&a>-1&&a%1==0&&a<s}function da(a){var s=typeof a;return s=="string"||s=="number"||s=="symbol"||s=="boolean"?a!=="__proto__":a===null}function fa(a){return!!Tt&&Tt in a}function It(a){var s=a&&a.constructor,u=typeof s=="function"&&s.prototype||me;return a===u}function U(a){if(a!=null){try{return Dt.call(a)}catch{}try{return a+""}catch{}}return""}function ha(a){return He(a,!0,!0)}function Rt(a,s){return a===s||a!==a&&s!==s}function ma(a){return ya(a)&&F.call(a,"callee")&&(!yn.call(a,"callee")||ye.call(a)==o)}var Fe=Array.isArray;function Ct(a){return a!=null&&pa(a.length)&&!Yt(a)}function ya(a){return _a(a)&&Ct(a)}var ga=pn||ba;function Yt(a){var s=_e(a)?ye.call(a):"";return s==_||s==y}function pa(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=i}function _e(a){var s=typeof a;return!!a&&(s=="object"||s=="function")}function _a(a){return!!a&&typeof a=="object"}function Ge(a){return Ct(a)?Un(a):Zn(a)}function wa(){return[]}function ba(){return!1}e.exports=ha})(Se,Se.exports);var Is=Se.exports;const Rs=ks(Is),ee=(e,t)=>new Date(e.getTime()-Lr(t,e));class P{constructor(t){b(this,"timeframeText");b(this,"key");b(this,"display");b(this,"timeframeLength");b(this,"allowedTiers");b(this,"defaultResponseGranularity");b(this,"dataGranularity");b(this,"isRelative");b(this,"fineGrainedDefaultGranularity");b(this,"_startCustom");b(this,"_endCustom");b(this,"_allowedGranularitiesOverride");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 r=new Set,n=this.maximumTimeframeLength()/3600;return n<=6&&r.add("minutely"),n>=2&&n<=7*24&&r.add("hourly"),n>=2*24&&r.add("daily"),n>=2*24*14&&r.add("weekly"),r}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 r=Ms(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return jr(r,t)}}class Cs extends P{rawStart(t){let r=q(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(r=ee(r,t)),r}maximumTimeframeLength(){return 60*60*24*7}}class Ys extends P{rawStart(t){let r=J(this.tzAdjustedDate(t));return t&&(r=ee(r,t)),r}maximumTimeframeLength(){return 60*60*24*31}}class Hs extends P{rawEnd(t){let r=q(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(r=ee(r,t)),r}rawStart(t){const r=this.tzAdjustedDate(t);let n=q(r.setDate(r.getDate()-7),{weekStartsOn:1});return t&&(n=ee(n,t)),n}}class qs extends P{rawEnd(t){let r=J(this.tzAdjustedDate(t));return t&&(r=ee(r,t)),r}rawStart(t){let r=J(Gr(this.tzAdjustedDate(t)));return t&&(r=ee(r,t)),r}}const Xr=new Map([[m.FIFTEEN_MIN,new P({key:m.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"thirtySecondly",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely"]})],[m.ONE_HOUR,new P({key:m.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"minutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely"]})],[m.SIX_HOUR,new P({key:m.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"fiveMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]})],[m.TWELVE_HOUR,new P({key:m.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"tenMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]})],[m.ONE_DAY,new P({key:m.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"thirtyMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["fiveMinutely","tenMinutely","thirtyMinutely","hourly"]})],[m.SEVEN_DAY,new P({key:m.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]})],[m.THIRTY_DAY,new P({key:m.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twelveHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]})],[m.CURRENT_WEEK,new Cs({key:m.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const e=q(new Date,{weekStartsOn:1});return(De(Wt(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]})],[m.CURRENT_MONTH,new Ys({key:m.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const e=J(new Date);return(De(Wt(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})],[m.PREVIOUS_WEEK,new Hs({key:m.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]})],[m.PREVIOUS_MONTH,new qs({key:m.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=J(new Date),r=J(Gr(new Date));return t.getTimezoneOffset()!==r.getTimezoneOffset()&&(e=Qr(t,r)),60*60*24*$i(new Date().setMonth(new Date().getMonth()-1))+Qi(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})]]);function Fs(e){const t=new Date(e.start),r=new Date(e.end),n=(r.getTime()-t.getTime())/1e3;return e.timePeriodsKey&&Rs(Xr.get(e.timePeriodsKey))||new P({key:"custom",timeframeText:"custom",display:"custom",startCustom:t,endCustom:r,timeframeLength:()=>n,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["free","plus","enterprise"]})}function Gs(e){return{...e.key!=="custom"&&{timePeriodsKey:e.key},start:e.rawStart(),end:e.rawEnd()}}function As(e){return{key:e.key,display:e.display,timeframeText:e.timeframeText,timeframeLength:()=>e.key,start:()=>e.rawStart(),end:()=>e.rawEnd()}}function Qr(e,t){return Zi(e.getTimezoneOffset()-t.getTimezoneOffset())}const Ws={"15M":m.FIFTEEN_MIN,"1H":m.ONE_HOUR,"6H":m.SIX_HOUR,"12H":m.TWELVE_HOUR,"24H":m.ONE_DAY,"7D":m.SEVEN_DAY,"15m":m.FIFTEEN_MIN,"1h":m.ONE_HOUR,"6h":m.SIX_HOUR,"12h":m.TWELVE_HOUR,"24h":m.ONE_DAY,"7d":m.SEVEN_DAY,"30d":m.THIRTY_DAY,current_week:m.CURRENT_WEEK,current_month:m.CURRENT_MONTH,previous_week:m.PREVIOUS_WEEK,previous_month:m.PREVIOUS_MONTH};class Pe{constructor(t){b(this,"_seed");this._seed=t}next(t,r){const n=Math.sin(this._seed++)*1e4,i=n-Math.floor(n);return Math.floor(i*(r-t+1))+t}}const js=(e,t,r)=>{const n=at(10,1e4),i=new Pe(n),o=Date.now()-6*60*60*1e3,c=Date.now(),d=[];let h=0;for(let y=o;y<=c;y+=60*60*1e3)if(t)for(const g in t)t[g].forEach(E=>{h+=i.next(50,500);const N={[g]:E,[e.name]:h},k={version:"1.0",timestamp:new Date(y).toISOString(),event:N};d.push(k)});else{h+=i.next(50,500);const g={version:"1.0",timestamp:new Date(y).toISOString(),event:{[e.name]:h}};d.push(g)}const f={};if(t)for(const y in t)f[y]={},t[y].forEach(g=>{f[y][g]={name:g,deleted:!1}});const _={start_ms:o,end_ms:c,start:new Date(o).toISOString(),end:new Date(c).toISOString(),query_id:"12345",metric_names:[e.name],metric_units:{[e.name]:e.unit},granularity_ms:60*60*1e3,display:f,...r??{}};return{data:d,meta:_}},Ls=(e,t)=>{const r=at(10,1e4),n=new Pe(r),i=Date.now()-6*60*60*1e3,o=Date.now(),c=[],d={};e.forEach(f=>{d[f.name]=0});for(let f=i;f<=o;f+=60*60*1e3){const _={};e.forEach(g=>{d[g.name]+=n.next(50,500),_[g.name]=d[g.name]});const y={version:"1.0",timestamp:new Date(f).toISOString(),event:_};c.push(y)}const h={start_ms:i,end_ms:o,start:new Date(i).toISOString(),end:new Date(o).toISOString(),query_id:"12345",metric_names:e.map(f=>f.name),metric_units:e.reduce((f,_)=>(f[_.name]=_.unit,f),{}),granularity_ms:60*60*1e3,display:{},...t??{}};return{data:c,meta:h}},Us=(e,t,r)=>{const n=Math.floor(Math.random()*9991)+10,i=new Pe(n),o=Date.now()-6*60*60*1e3,c=Date.now(),d=new Date((o+c)/2).toISOString(),h=[];if(t){const y=Object.keys(t),g=Object.values(t),E=(N,k)=>{if(k===y.length){e.forEach(R=>{N[R.name]=i.next(1e3,5e7)}),h.push({version:"1.0",timestamp:new Date().toISOString(),event:{...N}});return}g[k].forEach(R=>{E({...N,[y[k]]:R},k+1)})};E({},0)}else{const y={};e.forEach(g=>{y[g.name]=i.next(50,500)}),h.push({version:"1.0",timestamp:d,event:y})}const f={};if(t)for(const y in t)f[y]={},t[y].forEach(g=>{f[y][g]={name:g,deleted:!1}});const _={start_ms:o,end_ms:c,start:new Date(o).toISOString(),end:new Date(c).toISOString(),query_id:"12345",metric_names:e.map(y=>y.name),metric_units:e.reduce((y,g)=>(y[g.name]=g.unit,y),{}),truncated:!1,limit:50,display:f,granularity_ms:c-o,...r??{}};return{data:h,meta:_}};function at(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1)+e)}exports.DeltaQueryTime=Ns;exports.Granularities=ie;exports.REFRESH_INTERVAL_MS=Oa;exports.SeededRandom=Pe;exports.TIMEFRAME_LOOKUP=Ws;exports.TimePeriods=Xr;exports.Timeframe=P;exports.TimeframeKeys=m;exports.TimeseriesQueryTime=Ps;exports.UnaryQueryTime=$r;exports.aiExploreAggregations=lr;exports.apiUsageQuerySchema=xr;exports.barChartSchema=br;exports.basicExploreAggregations=Ze;exports.basicQuerySchema=Er;exports.ceilToNearestTimeGrain=nt;exports.dashboardConfigSchema=Ha;exports.dashboardTileTypes=Ra;exports.datasourceToFilterableDimensions=gr;exports.datePickerSelectionToTimeframe=Fs;exports.donutChartSchema=Or;exports.dstOffsetHours=Qr;exports.exploreAggregations=cr;exports.exploreFilterTypesV2=sr;exports.filterableAiExploreDimensions=ce;exports.filterableBasicExploreDimensions=oe;exports.filterableExploreDimensions=ue;exports.filterableRequestDimensions=fr;exports.filterableRequestMetrics=yr;exports.filterableRequestWildcardDimensions=Pa;exports.floorToNearestTimeGrain=Vr;exports.formatISOTimeWithTZ=Ss;exports.formatTime=Xe;exports.formatTimeRange=vs;exports.gaugeChartSchema=Dr;exports.generateCrossSectionalData=Us;exports.generateMultipleMetricTimeSeriesData=Ls;exports.generateSingleMetricTimeSeriesData=js;exports.getFieldDataSources=qa;exports.granularitiesToOptions=xs;exports.granularityMsToQuery=Ur;exports.granularityValues=Qe;exports.llmUsageSchema=Pr;exports.metricCardSchema=Sr;exports.msToGranularity=Es;exports.queryDatasources=ka;exports.queryableAiExploreDimensions=Ke;exports.queryableBasicExploreDimensions=ve;exports.queryableExploreDimensions=Be;exports.queryableRequestDimensions=dr;exports.queryableRequestMetrics=mr;exports.queryableRequestWildcardDimensions=hr;exports.rand=at;exports.relativeTimeRangeValuesRequestV2=Na;exports.relativeTimeRangeValuesV4=ur;exports.reportChartTypes=Ma;exports.requestFilterTypeEmptyV2=or;exports.requestFilterTypeEqualsV2=Sa;exports.requestFilterTypeMetricV2=va;exports.requestFilterTypeWildcardV2=xa;exports.singleValueSchema=vr;exports.slottableSchema=wr;exports.stripUnknownFilters=Ia;exports.tileConfigSchema=Rr;exports.tileDefinitionSchema=kr;exports.tileLayoutSchema=Ir;exports.timeRangeTypeV2=Ea;exports.timeframeToDatepickerSelection=Gs;exports.timeframeToDatepickerTimeperiod=As;exports.timeseriesChartSchema=Tr;exports.topNTableSchema=Mr;exports.validDashboardQuery=Nr;
|
|
1
|
+
"use strict";var Da=Object.defineProperty;var Oa=(e,t,r)=>t in e?Da(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var b=(e,t,r)=>Oa(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ma=30*1e3;var h=(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.CURRENT_WEEK="current_week",e.CURRENT_MONTH="current_month",e.CURRENT_QUARTER="current_quarter",e.PREVIOUS_WEEK="previous_week",e.PREVIOUS_MONTH="previous_month",e.PREVIOUS_QUARTER="previous_quarter",e))(h||{});const Sa=["horizontal_bar","vertical_bar","timeseries_line","choropleth_map","timeseries_bar","donut","single_value"],sr=["in","not_in","selector"],va=["=","!="],xa=["=","!=","<",">","<=",">="],or=["empty","not_empty"],Ea=["starts_with","ends_with"],Pa=["absolute","relative"],ur=["15m","1h","6h","12h","24h","7d","current_week","previous_week","30d","current_month","previous_month"],Qe=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],se=e=>e.filter(t=>t!=="time"),ve=["api","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],oe=se(ve),Ze=["active_services","request_count","request_per_minute","response_latency_average"],Be=[...ve,"application","consumer","country_code","iso_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm"],ue=se(Be),cr=[...Ze,"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","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"],Ke=["control_plane","control_plane_group","gateway_service","consumer","application","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"],ce=se(Ke),lr=["total_tokens","prompt_tokens","completion_tokens","ai_request_count","cost","llm_cache_embeddings_latency_average","llm_cache_fetch_latency_average","llm_latency_average","llm_embeddings_tokens","llm_embeddings_cost"],dr=["api","api_product","api_product_version","application","auth_type","client_ip","consumer","consumer_group","control_plane","control_plane_group","country_code","data_plane_node","data_plane_node_version","gateway_service","header_host","header_user_agent","http_method","iso_code","portal","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"],fr=se(dr),mr=["auth_type","client_ip","country_code","data_plane_node_version","header_host","header_user_agent","http_method","request_id","request_uri","response_header_content_type","response_source","service_port","service_protocol","trace_id","upstream_uri"],Na=mr,hr=["ai_count","latencies_response_ms","latencies_upstream_ms","latencies_kong_gateway_ms","request_body_size","response_body_size","response_header_content_length","status_code","upstream_status_code"],yr=se(hr),Ia=["15M","1H","6H","12H","24H","7D"],ka=["basic","api_usage","llm_usage"],gr={basic:new Set(oe),api_usage:new Set(ue),llm_usage:new Set(ce)},Ra=(e,t)=>t.filter(r=>gr[e].has(r.field)),Ca=["horizontal_bar","vertical_bar","gauge","donut","timeseries_line","timeseries_bar","golden_signals","top_n","slottable","single_value","choropleth_map"],le={type:"string"},A={type:"string"},pr={type:"boolean"},_r={type:["object","array"],items:{type:"string"},additionalProperties:{type:"string"}},wr={type:"object",properties:{type:{type:"string",enum:["slottable"]},id:{type:"string"}},required:["type","id"],additionalProperties:!1},br={type:"object",properties:{type:{type:"string",enum:["horizontal_bar","vertical_bar"]},stacked:{type:"boolean"},chart_dataset_colors:_r,synthetics_data_key:le,chart_title:A,allow_csv_export:pr},required:["type"],additionalProperties:!1},Tr={type:"object",properties:{type:{type:"string",enum:["timeseries_line","timeseries_bar"]},stacked:{type:"boolean"},threshold:{type:"object",additionalProperties:{type:"number"}},chart_dataset_colors:_r,synthetics_data_key:le,chart_title:A,allow_csv_export:pr},required:["type"],additionalProperties:!1},Dr={type:"object",properties:{type:{type:"string",enum:["gauge"]},metric_display:{type:"string",enum:["hidden","single","full"]},reverse_dataset:{type:"boolean"},numerator:{type:"number"},synthetics_data_key:le,chart_title:A},required:["type"],additionalProperties:!1},Or={type:"object",properties:{type:{type:"string",enum:["donut"]},synthetics_data_key:le,chart_title:A},required:["type"],additionalProperties:!1},Mr={type:"object",properties:{chart_title:A,synthetics_data_key:le,type:{type:"string",enum:["top_n"]},description:{type:"string"},entity_link:{type:"string"}},required:["type"],additionalProperties:!1},Sr={type:"object",properties:{chart_title:A,type:{type:"string",enum:["golden_signals"]},long_card_titles:{type:"boolean"},description:{type:"string"},percentile_latency:{type:"boolean"}},required:["type"],additionalProperties:!1},vr={type:"object",properties:{type:{type:"string",enum:["single_value"]},decimal_points:{type:"number"},chart_title:A},required:["type"],additionalProperties:!1},xr={type:"object",properties:{type:{type:"string",enum:["choropleth_map"]},chart_title:A,bounds:{oneOf:[{type:"array",minItems:2,maxItems:2,items:{type:"array",minItems:2,maxItems:2,items:[{type:"number",minimum:-180,maximum:180},{type:"number",minimum:-90,maximum:90}]}},{type:"array",minItems:4,maxItems:4,items:[{type:"number",minimum:-180,maximum:180},{type:"number",minimum:-90,maximum:90},{type:"number",minimum:-180,maximum:180},{type:"number",minimum:-90,maximum:90}]}]}},required:["type"],additionalProperties:!1},Ya={type:"object",properties:{tz:{type:"string",default:"Etc/UTC"},type:{type:"string",enum:["relative"]},time_range:{type:"string",enum:ur,default:"1h"}},required:["type","time_range"],additionalProperties:!1},qa={type:"object",description:"A duration representing an exact start and end time.",properties:{tz:{type:"string"},type:{type:"string",enum:["absolute"]},start:{type:"string"},end:{type:"string"}},required:["type","start","end"],additionalProperties:!1},Je={granularity:{type:"string",description:'Force time grouping into buckets of this duration. Only has an effect if "time" is in the "dimensions" list.',enum:Qe},time_range:{type:"object",description:"The time range to query.",anyOf:[Ya,qa],default:{type:"relative",time_range:"1h"}},limit:{type:"number"},meta:{type:"object"}},et=e=>({type:"array",description:"List of aggregated metrics to collect across the requested time span.",items:{type:"string",enum:e}}),tt=e=>({type:"array",description:"List of attributes or entity types to group by.",minItems:0,maxItems:2,items:{type:"string",enum:e}}),xe=e=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",enum:e},operator:{type:"string",enum:sr},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",enum:e},operator:{type:"string",enum:or}},required:["field","operator"],additionalProperties:!1}]}}),Er={type:"object",description:"A query to launch at the advanced explore API",properties:{datasource:{type:"string",enum:["api_usage"]},metrics:et(cr),dimensions:tt(Be),filters:xe(ue),...Je},required:["datasource"],additionalProperties:!1},Pr={type:"object",description:"A query to launch at the basic explore API",properties:{datasource:{type:"string",enum:["basic"]},metrics:et(Ze),dimensions:tt(ve),filters:xe(oe),...Je},required:["datasource"],additionalProperties:!1},Nr={type:"object",description:"A query to launch at the AI explore API",properties:{datasource:{type:"string",enum:["llm_usage"]},metrics:et(lr),dimensions:tt(Ke),filters:xe(ce),...Je},required:["datasource"],additionalProperties:!1},Ir={anyOf:[Er,Pr,Nr]},kr={type:"object",properties:{query:Ir,chart:{anyOf:[br,Dr,Or,Tr,Sr,Mr,wr,vr,xr]}},required:["query","chart"],additionalProperties:!1},Rr={type:"object",properties:{position:{type:"object",properties:{col:{type:"number"},row:{type:"number"}},description:"Position of the tile in the grid.",required:["col","row"],additionalProperties:!1},size:{type:"object",properties:{cols:{type:"number"},rows:{type:"number"},fit_to_content:{type:"boolean"}},description:"Number of columns and rows the tile occupies. If fitToContent is true for every tile in a row, and each tile only occupies 1 row, then the row will auto-fit to its content.",required:["cols","rows"],additionalProperties:!1}},required:["position","size"],additionalProperties:!1},Cr={type:"object",properties:{type:{type:"string",enum:["chart"]},definition:kr,layout:Rr,id:{type:"string",description:"Unique identifier for the tile. If not provided, one will be generated."}},required:["type","definition","layout"],additionalProperties:!1},Ha={type:"object",properties:{tiles:{type:"array",items:Cr},tile_height:{type:"number",description:"Height of each tile in pixels."},preset_filters:xe([...new Set([...ue,...oe,...ce])]),template_id:{type:["string","null"],description:"Template id which was used to instantiate this dashboard."}},required:["tiles"],additionalProperties:!1},Fa=e=>{const t=[];return oe.includes(e)&&t.push("basic"),ue.includes(e)&&t.push("api_usage"),ce.includes(e)&&t.push("llm_usage"),(fr.includes(e)||yr.includes(e))&&t.push("requests"),t},Yr=6048e5,Ga=864e5,Aa=60,Wa=3600,At=Symbol.for("constructDateFrom");function k(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&At in e?e[At](t):e instanceof Date?new e.constructor(t):new Date(t)}function O(e,t){return k(t||e,e)}function Wt(e,t,r){const n=O(e,r==null?void 0:r.in);return isNaN(t)?k(e,NaN):(n.setDate(n.getDate()+t),n)}function ja(e,t,r){const n=O(e,r==null?void 0:r.in);if(isNaN(t))return k(e,NaN);const i=n.getDate(),o=k(e,n.getTime());o.setMonth(n.getMonth()+t+1,0);const c=o.getDate();return i>=c?o:(n.setFullYear(o.getFullYear(),o.getMonth(),i),n)}let La={};function de(){return La}function H(e,t){var d,m,f,_;const r=de(),n=(t==null?void 0:t.weekStartsOn)??((m=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:m.weekStartsOn)??r.weekStartsOn??((_=(f=r.locale)==null?void 0:f.options)==null?void 0:_.weekStartsOn)??0,i=O(e,t==null?void 0:t.in),o=i.getDay(),c=(o<n?7:0)+o-n;return i.setDate(i.getDate()-c),i.setHours(0,0,0,0),i}function Te(e,t){return H(e,{...t,weekStartsOn:1})}function qr(e,t){const r=O(e,t==null?void 0:t.in),n=r.getFullYear(),i=k(r,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const o=Te(i),c=k(r,0);c.setFullYear(n,0,4),c.setHours(0,0,0,0);const d=Te(c);return r.getTime()>=o.getTime()?n+1:r.getTime()>=d.getTime()?n:n-1}function jt(e){const t=O(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function Ua(e,...t){const r=k.bind(null,t.find(n=>typeof n=="object"));return t.map(r)}function De(e,t){const r=O(e,t==null?void 0:t.in);return r.setHours(0,0,0,0),r}function za(e,t,r){const[n,i]=Ua(r==null?void 0:r.in,e,t),o=De(n),c=De(i),d=+o-jt(o),m=+c-jt(c);return Math.round((d-m)/Ga)}function Va(e,t){const r=qr(e,t),n=k(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),Te(n)}function $a(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Xa(e){return!(!$a(e)&&typeof e!="number"||isNaN(+O(e)))}function J(e,t){const r=O(e,t==null?void 0:t.in);return r.setDate(1),r.setHours(0,0,0,0),r}function Qa(e,t){const r=O(e,t==null?void 0:t.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}const Za={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"}},Ba=(e,t,r)=>{let n;const i=Za[e];return typeof i=="string"?n=i:t===1?n=i.one:n=i.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function We(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const Ka={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ja={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ei={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ti={date:We({formats:Ka,defaultWidth:"full"}),time:We({formats:Ja,defaultWidth:"full"}),dateTime:We({formats:ei,defaultWidth:"full"})},ri={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ni=(e,t,r,n)=>ri[e];function ne(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let i;if(n==="formatting"&&e.formattingValues){const c=e.defaultFormattingWidth||e.defaultWidth,d=r!=null&&r.width?String(r.width):c;i=e.formattingValues[d]||e.formattingValues[c]}else{const c=e.defaultWidth,d=r!=null&&r.width?String(r.width):e.defaultWidth;i=e.values[d]||e.values[c]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const ai={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ii={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},si={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"]},oi={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"]},ui={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"}},ci={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"}},li=(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},di={ordinalNumber:li,era:ne({values:ai,defaultWidth:"wide"}),quarter:ne({values:ii,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ne({values:si,defaultWidth:"wide"}),day:ne({values:oi,defaultWidth:"wide"}),dayPeriod:ne({values:ui,defaultWidth:"wide",formattingValues:ci,defaultFormattingWidth:"wide"})};function ae(e){return(t,r={})=>{const n=r.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const c=o[0],d=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],m=Array.isArray(d)?mi(d,y=>y.test(c)):fi(d,y=>y.test(c));let f;f=e.valueCallback?e.valueCallback(m):m,f=r.valueCallback?r.valueCallback(f):f;const _=t.slice(c.length);return{value:f,rest:_}}}function fi(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function mi(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function hi(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const i=n[0],o=t.match(e.parsePattern);if(!o)return null;let c=e.valueCallback?e.valueCallback(o[0]):o[0];c=r.valueCallback?r.valueCallback(c):c;const d=t.slice(i.length);return{value:c,rest:d}}}const yi=/^(\d+)(th|st|nd|rd)?/i,gi=/\d+/i,pi={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},_i={any:[/^b/i,/^(a|c)/i]},wi={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},bi={any:[/1/i,/2/i,/3/i,/4/i]},Ti={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},Di={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]},Oi={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},Mi={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]},Si={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},vi={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}},xi={ordinalNumber:hi({matchPattern:yi,parsePattern:gi,valueCallback:e=>parseInt(e,10)}),era:ae({matchPatterns:pi,defaultMatchWidth:"wide",parsePatterns:_i,defaultParseWidth:"any"}),quarter:ae({matchPatterns:wi,defaultMatchWidth:"wide",parsePatterns:bi,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ae({matchPatterns:Ti,defaultMatchWidth:"wide",parsePatterns:Di,defaultParseWidth:"any"}),day:ae({matchPatterns:Oi,defaultMatchWidth:"wide",parsePatterns:Mi,defaultParseWidth:"any"}),dayPeriod:ae({matchPatterns:Si,defaultMatchWidth:"any",parsePatterns:vi,defaultParseWidth:"any"})},Ei={code:"en-US",formatDistance:Ba,formatLong:ti,formatRelative:ni,localize:di,match:xi,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Pi(e,t){const r=O(e,t==null?void 0:t.in);return za(r,Qa(r))+1}function Ni(e,t){const r=O(e,t==null?void 0:t.in),n=+Te(r)-+Va(r);return Math.round(n/Yr)+1}function Hr(e,t){var _,y,g,E;const r=O(e,t==null?void 0:t.in),n=r.getFullYear(),i=de(),o=(t==null?void 0:t.firstWeekContainsDate)??((y=(_=t==null?void 0:t.locale)==null?void 0:_.options)==null?void 0:y.firstWeekContainsDate)??i.firstWeekContainsDate??((E=(g=i.locale)==null?void 0:g.options)==null?void 0:E.firstWeekContainsDate)??1,c=k((t==null?void 0:t.in)||e,0);c.setFullYear(n+1,0,o),c.setHours(0,0,0,0);const d=H(c,t),m=k((t==null?void 0:t.in)||e,0);m.setFullYear(n,0,o),m.setHours(0,0,0,0);const f=H(m,t);return+r>=+d?n+1:+r>=+f?n:n-1}function Ii(e,t){var d,m,f,_;const r=de(),n=(t==null?void 0:t.firstWeekContainsDate)??((m=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:m.firstWeekContainsDate)??r.firstWeekContainsDate??((_=(f=r.locale)==null?void 0:f.options)==null?void 0:_.firstWeekContainsDate)??1,i=Hr(e,t),o=k((t==null?void 0:t.in)||e,0);return o.setFullYear(i,0,n),o.setHours(0,0,0,0),H(o,t)}function ki(e,t){const r=O(e,t==null?void 0:t.in),n=+H(r,t)-+Ii(r,t);return Math.round(n/Yr)+1}function p(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const G={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return p(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):p(r+1,2)},d(e,t){return p(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return p(e.getHours()%12||12,t.length)},H(e,t){return p(e.getHours(),t.length)},m(e,t){return p(e.getMinutes(),t.length)},s(e,t){return p(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),i=Math.trunc(n*Math.pow(10,r-3));return p(i,t.length)}},B={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Lt={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),i=n>0?n:1-n;return r.ordinalNumber(i,{unit:"year"})}return G.y(e,t)},Y:function(e,t,r,n){const i=Hr(e,n),o=i>0?i:1-i;if(t==="YY"){const c=o%100;return p(c,2)}return t==="Yo"?r.ordinalNumber(o,{unit:"year"}):p(o,t.length)},R:function(e,t){const r=qr(e);return p(r,t.length)},u:function(e,t){const r=e.getFullYear();return p(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return p(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return p(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return G.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return p(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const i=ki(e,n);return t==="wo"?r.ordinalNumber(i,{unit:"week"}):p(i,t.length)},I:function(e,t,r){const n=Ni(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):p(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):G.d(e,t)},D:function(e,t,r){const n=Pi(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):p(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const i=e.getDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return p(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const i=e.getDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return p(o,t.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),i=n===0?7:n;switch(t){case"i":return String(i);case"ii":return p(i,t.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let i;switch(n===12?i=B.noon:n===0?i=B.midnight:i=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let i;switch(n>=17?i=B.evening:n>=12?i=B.afternoon:n>=4?i=B.morning:i=B.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return G.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):G.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):p(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):p(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):G.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):G.s(e,t)},S:function(e,t){return G.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return zt(n);case"XXXX":case"XX":return V(n);case"XXXXX":case"XXX":default:return V(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return zt(n);case"xxxx":case"xx":return V(n);case"xxxxx":case"xxx":default:return V(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Ut(n,":");case"OOOO":default:return"GMT"+V(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Ut(n,":");case"zzzz":default:return"GMT"+V(n,":")}},t:function(e,t,r){const n=Math.trunc(+e/1e3);return p(n,t.length)},T:function(e,t,r){return p(+e,t.length)}};function Ut(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Math.trunc(n/60),o=n%60;return o===0?r+String(i):r+String(i)+t+p(o,2)}function zt(e,t){return e%60===0?(e>0?"-":"+")+p(Math.abs(e)/60,2):V(e,t)}function V(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=p(Math.trunc(n/60),2),o=p(n%60,2);return r+i+t+o}const Vt=(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"});case"PPPP":default:return t.date({width:"full"})}},Fr=(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"});case"pppp":default:return t.time({width:"full"})}},Ri=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],i=r[2];if(!i)return Vt(e,t);let o;switch(n){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",Vt(n,t)).replace("{{time}}",Fr(i,t))},Ci={p:Fr,P:Ri},Yi=/^D+$/,qi=/^Y+$/,Hi=["D","DD","YY","YYYY"];function Fi(e){return Yi.test(e)}function Gi(e){return qi.test(e)}function Ai(e,t,r){const n=Wi(e,t,r);if(console.warn(n),Hi.includes(e))throw new RangeError(n)}function Wi(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const ji=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Li=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ui=/^'([^]*?)'?$/,zi=/''/g,Vi=/[a-zA-Z]/;function Gr(e,t,r){var _,y,g,E,N,I,R,W;const n=de(),i=(r==null?void 0:r.locale)??n.locale??Ei,o=(r==null?void 0:r.firstWeekContainsDate)??((y=(_=r==null?void 0:r.locale)==null?void 0:_.options)==null?void 0:y.firstWeekContainsDate)??n.firstWeekContainsDate??((E=(g=n.locale)==null?void 0:g.options)==null?void 0:E.firstWeekContainsDate)??1,c=(r==null?void 0:r.weekStartsOn)??((I=(N=r==null?void 0:r.locale)==null?void 0:N.options)==null?void 0:I.weekStartsOn)??n.weekStartsOn??((W=(R=n.locale)==null?void 0:R.options)==null?void 0:W.weekStartsOn)??0,d=O(e,r==null?void 0:r.in);if(!Xa(d))throw new RangeError("Invalid time value");let m=t.match(Li).map(M=>{const T=M[0];if(T==="p"||T==="P"){const j=Ci[T];return j(M,i.formatLong)}return M}).join("").match(ji).map(M=>{if(M==="''")return{isToken:!1,value:"'"};const T=M[0];if(T==="'")return{isToken:!1,value:$i(M)};if(Lt[T])return{isToken:!0,value:M};if(T.match(Vi))throw new RangeError("Format string contains an unescaped latin alphabet character `"+T+"`");return{isToken:!1,value:M}});i.localize.preprocessor&&(m=i.localize.preprocessor(d,m));const f={firstWeekContainsDate:o,weekStartsOn:c,locale:i};return m.map(M=>{if(!M.isToken)return M.value;const T=M.value;(!(r!=null&&r.useAdditionalWeekYearTokens)&&Gi(T)||!(r!=null&&r.useAdditionalDayOfYearTokens)&&Fi(T))&&Ai(T,t,String(e));const j=Lt[T[0]];return j(d,T,i.localize,f)}).join("")}function $i(e){const t=e.match(Ui);return t?t[1].replace(zi,"'"):e}function Xi(e,t){const r=O(e,t==null?void 0:t.in),n=r.getFullYear(),i=r.getMonth(),o=k(r,0);return o.setFullYear(n,i+1,0),o.setHours(0,0,0,0),o.getDate()}function Qi(){return Object.assign({},de())}function $t(e){return+O(e)}function Xt(e){return Math.trunc(+O(e)/1e3)}function Zi(e){return Math.trunc(e*Wa)}function Bi(e){const t=e/Aa;return Math.trunc(t)}function Ar(e,t,r){return ja(e,-1,r)}function Qt(e,t,r){const n=Qi(),i=es(e,r.timeZone,r.locale??n.locale);return"formatToParts"in i?Ki(i,t):Ji(i,t)}function Ki(e,t){const r=e.formatToParts(t);for(let n=r.length-1;n>=0;--n)if(r[n].type==="timeZoneName")return r[n].value}function Ji(e,t){const r=e.format(t).replace(/\u200E/g,""),n=/ [\w-+ ]+$/.exec(r);return n?n[0].substr(1):""}function es(e,t,r){return new Intl.DateTimeFormat(r?[r.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function ts(e,t){const r=ss(t);return"formatToParts"in r?ns(r,e):as(r,e)}const rs={year:0,month:1,day:2,hour:3,minute:4,second:5};function ns(e,t){try{const r=e.formatToParts(t),n=[];for(let i=0;i<r.length;i++){const o=rs[r[i].type];o!==void 0&&(n[o]=parseInt(r[i].value,10))}return n}catch(r){if(r instanceof RangeError)return[NaN];throw r}}function as(e,t){const r=e.format(t),n=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(r);return[parseInt(n[3],10),parseInt(n[1],10),parseInt(n[2],10),parseInt(n[4],10),parseInt(n[5],10),parseInt(n[6],10)]}const je={},Zt=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")),is=Zt==="06/25/2014, 00:00:00"||Zt==="06/25/2014 00:00:00";function ss(e){return je[e]||(je[e]=is?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"})),je[e]}function rt(e,t,r,n,i,o,c){const d=new Date(0);return d.setUTCFullYear(e,t,r),d.setUTCHours(n,i,o,c),d}const Bt=36e5,os=6e4,Le={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function fe(e,t,r){if(!e)return 0;let n=Le.timezoneZ.exec(e);if(n)return 0;let i,o;if(n=Le.timezoneHH.exec(e),n)return i=parseInt(n[1],10),Kt(i)?-(i*Bt):NaN;if(n=Le.timezoneHHMM.exec(e),n){i=parseInt(n[2],10);const c=parseInt(n[3],10);return Kt(i,c)?(o=Math.abs(i)*Bt+c*os,n[1]==="+"?-o:o):NaN}if(ls(e)){t=new Date(t||Date.now());const c=r?t:us(t),d=$e(c,e);return-(r?d:cs(t,d,e))}return NaN}function us(e){return rt(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function $e(e,t){const r=ts(e,t),n=rt(r[0],r[1]-1,r[2],r[3]%24,r[4],r[5],0).getTime();let i=e.getTime();const o=i%1e3;return i-=o>=0?o:1e3+o,n-i}function cs(e,t,r){let i=e.getTime()-t;const o=$e(new Date(i),r);if(t===o)return t;i-=o-t;const c=$e(new Date(i),r);return o===c?o:Math.max(o,c)}function Kt(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const Jt={};function ls(e){if(Jt[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Jt[e]=!0,!0}catch{return!1}}const ds=60*1e3,fs={X:function(e,t,r){const n=Ue(r.timeZone,e);if(n===0)return"Z";switch(t){case"X":return er(n);case"XXXX":case"XX":return K(n);case"XXXXX":case"XXX":default:return K(n,":")}},x:function(e,t,r){const n=Ue(r.timeZone,e);switch(t){case"x":return er(n);case"xxxx":case"xx":return K(n);case"xxxxx":case"xxx":default:return K(n,":")}},O:function(e,t,r){const n=Ue(r.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+ms(n,":");case"OOOO":default:return"GMT"+K(n,":")}},z:function(e,t,r){switch(t){case"z":case"zz":case"zzz":return Qt("short",e,r);case"zzzz":default:return Qt("long",e,r)}}};function Ue(e,t){const r=e?fe(e,t,!0)/ds:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(r))throw new RangeError("Invalid time zone specified: "+e);return r}function Oe(e,t){const r=e<0?"-":"";let n=Math.abs(e).toString();for(;n.length<t;)n="0"+n;return r+n}function K(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Oe(Math.floor(n/60),2),o=Oe(Math.floor(n%60),2);return r+i+t+o}function er(e,t){return e%60===0?(e>0?"-":"+")+Oe(Math.abs(e)/60,2):K(e,t)}function ms(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Math.floor(n/60),o=n%60;return o===0?r+String(i):r+String(i)+t+Oe(o,2)}function tr(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 Wr=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,ze=36e5,rr=6e4,hs=2,S={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:Wr};function Me(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 r=t.additionalDigits==null?hs:Number(t.additionalDigits);if(r!==2&&r!==1&&r!==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 n=ys(e),{year:i,restDateString:o}=gs(n.date,r),c=ps(o,i);if(c===null||isNaN(c.getTime()))return new Date(NaN);if(c){const d=c.getTime();let m=0,f;if(n.time&&(m=_s(n.time),m===null||isNaN(m)))return new Date(NaN);if(n.timeZone||t.timeZone){if(f=fe(n.timeZone||t.timeZone,new Date(d+m)),isNaN(f))return new Date(NaN)}else f=tr(new Date(d+m)),f=tr(new Date(d+m+f));return new Date(d+m+f)}else return new Date(NaN)}function ys(e){const t={};let r=S.dateTimePattern.exec(e),n;if(r?(t.date=r[1],n=r[3]):(r=S.datePattern.exec(e),r?(t.date=r[1],n=r[2]):(t.date=null,n=e)),n){const i=S.timeZone.exec(n);i?(t.time=n.replace(i[1],""),t.timeZone=i[1].trim()):t.time=n}return t}function gs(e,t){if(e){const r=S.YYY[t],n=S.YYYYY[t];let i=S.YYYY.exec(e)||n.exec(e);if(i){const o=i[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(i=S.YY.exec(e)||r.exec(e),i){const o=i[1];return{year:parseInt(o,10)*100,restDateString:e.slice(o.length)}}}return{year:null}}function ps(e,t){if(t===null)return null;let r,n,i;if(!e||!e.length)return r=new Date(0),r.setUTCFullYear(t),r;let o=S.MM.exec(e);if(o)return r=new Date(0),n=parseInt(o[1],10)-1,ar(t,n)?(r.setUTCFullYear(t,n),r):new Date(NaN);if(o=S.DDD.exec(e),o){r=new Date(0);const c=parseInt(o[1],10);return Ts(t,c)?(r.setUTCFullYear(t,0,c),r):new Date(NaN)}if(o=S.MMDD.exec(e),o){r=new Date(0),n=parseInt(o[1],10)-1;const c=parseInt(o[2],10);return ar(t,n,c)?(r.setUTCFullYear(t,n,c),r):new Date(NaN)}if(o=S.Www.exec(e),o)return i=parseInt(o[1],10)-1,ir(i)?nr(t,i):new Date(NaN);if(o=S.WwwD.exec(e),o){i=parseInt(o[1],10)-1;const c=parseInt(o[2],10)-1;return ir(i,c)?nr(t,i,c):new Date(NaN)}return null}function _s(e){let t,r,n=S.HH.exec(e);if(n)return t=parseFloat(n[1].replace(",",".")),Ve(t)?t%24*ze:NaN;if(n=S.HHMM.exec(e),n)return t=parseInt(n[1],10),r=parseFloat(n[2].replace(",",".")),Ve(t,r)?t%24*ze+r*rr:NaN;if(n=S.HHMMSS.exec(e),n){t=parseInt(n[1],10),r=parseInt(n[2],10);const i=parseFloat(n[3].replace(",","."));return Ve(t,r,i)?t%24*ze+r*rr+i*1e3:NaN}return null}function nr(e,t,r){t=t||0,r=r||0;const n=new Date(0);n.setUTCFullYear(e,0,4);const i=n.getUTCDay()||7,o=t*7+r+1-i;return n.setUTCDate(n.getUTCDate()+o),n}const ws=[31,28,31,30,31,30,31,31,30,31,30,31],bs=[31,29,31,30,31,30,31,31,30,31,30,31];function jr(e){return e%400===0||e%4===0&&e%100!==0}function ar(e,t,r){if(t<0||t>11)return!1;if(r!=null){if(r<1)return!1;const n=jr(e);if(n&&r>bs[t]||!n&&r>ws[t])return!1}return!0}function Ts(e,t){if(t<1)return!1;const r=jr(e);return!(r&&t>366||!r&&t>365)}function ir(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function Ve(e,t,r){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||r!=null&&(r<0||r>=60))}const Ds=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Os(e,t,r={}){t=String(t);const n=t.match(Ds);if(n){const i=Me(r.originalDate||e,r);t=n.reduce(function(o,c){if(c[0]==="'")return o;const d=o.indexOf(c),m=o[d-1]==="'",f=o.replace(c,"'"+fs[c[0]](i,c,r)+"'");return m?f.substring(0,d-1)+f.substring(d+1):f},t)}return Gr(e,t,r)}function Lr(e,t,r){e=Me(e,r);const n=fe(t,e,!0),i=new Date(e.getTime()-n),o=new Date(0);return o.setFullYear(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()),o.setHours(i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds()),o}function Ms(e,t,r,n){return n={...n,timeZone:t,originalDate:e},Os(Lr(e,t,{timeZone:n.timeZone}),r,n)}function Ss(e,t,r){if(typeof e=="string"&&!e.match(Wr))return Me(e,{...r,timeZone:t});e=Me(e,r);const n=rt(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),i=fe(t,new Date(n));return new Date(n+i)}function Ur(e,t){return-fe(e,t)}function vs(e){return Gr(e,"yyyy-MM-dd'T'HH:mm:ss.SSSXXX")}function Xe(e,t={}){if(!e)return e;const r=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let n="MMM dd, yyy hh:mm a";t.short&&(n="MMM dd, yyy"),t.includeTZ&&(n+=" (z)");const i=new Date(e);return Ms(i,r,n)}catch{return console.error("Invalid value passed to formatTime",e),"(invalid date)"}}function xs(e,t){return`${Xe(e.getTime())} - ${Xe(t.getTime(),{includeTZ:!0})}`}const ie={secondly:1e3,tenSecondly:10*1e3,thirtySecondly:30*1e3,minutely:60*1e3,fiveMinutely:5*60*1e3,tenMinutely:10*60*1e3,thirtyMinutely:30*60*1e3,hourly:60*60*1e3,twoHourly:2*60*60*1e3,twelveHourly:12*60*60*1e3,daily:60*60*24*1e3,weekly:60*60*24*7*1e3,trend:0};function Es(e,t){return e.map(r=>({value:r,label:t.t(`configuration.vitals.reports.granularity.${r}`)}))}function zr(e,t){return{duration:e,type:"duration",origin:t}}function Ps(e){return e&&Qe.find(r=>e<=ie[r])||null}function Vr(e,t,r,n){const i=ie[r];let o=0;return i>=ie.daily&&(n?o=-Ur(n,t):o=t.getTimezoneOffset()*60*1e3),new Date(e((t.getTime()-o)/i)*i+o)}function $r(e,t,r){return Vr(Math.floor,e,t,r)}function nt(e,t,r){return Vr(Math.ceil,e,t,r)}class Ee{constructor(t,r,n){b(this,"timeframe");b(this,"tz");b(this,"dataGranularity");if(this.constructor===Ee)throw new Error("BaseQueryTime is not meant to be used directly.");this.timeframe=t,this.tz=r,this.dataGranularity=n??t.dataGranularity}calculateStartDate(t,r,n=1){if(t)return new Date(this.endDate().getTime()-this.timeframe.timeframeLengthMs()*n);{const i=this.endDate(),o=this.timeframe.rawStart(this.tz),c=$r(o,r,this.tz),m=(i.getTime()-c.getTime())*(n-1);return new Date(c.getTime()-m)}}granularitySeconds(){return Math.floor(this.granularityMs()/1e3)}granularityDruid(){return zr(this.granularityMs(),this.startDate().toISOString())}startSeconds(){return Xt(this.startDate())}endSeconds(){return Xt(this.endDate())}startMs(){return $t(this.startDate())}endMs(){return $t(this.endDate())}}class Ns extends Ee{constructor(r,n,i,o,c){super(r,i,o);b(this,"granularity");n&&r.allowedGranularities(c).has(n)?this.granularity=n:c?this.granularity=r.fineGrainedDefaultGranularity??r.defaultResponseGranularity:this.granularity=r.defaultResponseGranularity}startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.granularity)}endDate(){return nt(this.timeframe.rawEnd(),this.granularity,this.tz)}granularityMs(){return ie[this.granularity]}}class Xr extends Ee{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.dataGranularity)}endDate(){return nt(this.timeframe.rawEnd(this.tz),this.dataGranularity,this.tz)}granularityMs(){return this.endDate().getTime()-this.startDate().getTime()}}class Is extends Xr{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.dataGranularity,2)}granularityMs(){return this.endDate().getTime()-super.startDate().getTime()}}var be=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ks(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Se={exports:{}};Se.exports;(function(e,t){var r=200,n="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",c="[object Array]",d="[object Boolean]",m="[object Date]",f="[object Error]",_="[object Function]",y="[object GeneratorFunction]",g="[object Map]",E="[object Number]",N="[object Object]",I="[object Promise]",R="[object RegExp]",W="[object Set]",M="[object String]",T="[object Symbol]",j="[object WeakMap]",it="[object ArrayBuffer]",me="[object DataView]",st="[object Float32Array]",ot="[object Float64Array]",ut="[object Int8Array]",ct="[object Int16Array]",lt="[object Int32Array]",dt="[object Uint8Array]",ft="[object Uint8ClampedArray]",mt="[object Uint16Array]",ht="[object Uint32Array]",Br=/[\\^$.*+?()[\]{}|]/g,Kr=/\w*$/,Jr=/^\[object .+?Constructor\]$/,en=/^(?:0|[1-9]\d*)$/,w={};w[o]=w[c]=w[it]=w[me]=w[d]=w[m]=w[st]=w[ot]=w[ut]=w[ct]=w[lt]=w[g]=w[E]=w[N]=w[R]=w[W]=w[M]=w[T]=w[dt]=w[ft]=w[mt]=w[ht]=!0,w[f]=w[_]=w[j]=!1;var tn=typeof be=="object"&&be&&be.Object===Object&&be,rn=typeof self=="object"&&self&&self.Object===Object&&self,C=tn||rn||Function("return this")(),yt=t&&!t.nodeType&&t,gt=yt&&!0&&e&&!e.nodeType&&e,nn=gt&>.exports===yt;function an(a,s){return a.set(s[0],s[1]),a}function sn(a,s){return a.add(s),a}function on(a,s){for(var u=-1,l=a?a.length:0;++u<l&&s(a[u],u,a)!==!1;);return a}function un(a,s){for(var u=-1,l=s.length,D=a.length;++u<l;)a[D+u]=s[u];return a}function pt(a,s,u,l){for(var D=-1,v=a?a.length:0;++D<v;)u=s(u,a[D],D,a);return u}function cn(a,s){for(var u=-1,l=Array(a);++u<a;)l[u]=s(u);return l}function ln(a,s){return a==null?void 0:a[s]}function _t(a){var s=!1;if(a!=null&&typeof a.toString!="function")try{s=!!(a+"")}catch{}return s}function wt(a){var s=-1,u=Array(a.size);return a.forEach(function(l,D){u[++s]=[D,l]}),u}function Ne(a,s){return function(u){return a(s(u))}}function bt(a){var s=-1,u=Array(a.size);return a.forEach(function(l){u[++s]=l}),u}var dn=Array.prototype,fn=Function.prototype,he=Object.prototype,Ie=C["__core-js_shared__"],Tt=function(){var a=/[^.]+$/.exec(Ie&&Ie.keys&&Ie.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""}(),Dt=fn.toString,F=he.hasOwnProperty,ye=he.toString,mn=RegExp("^"+Dt.call(F).replace(Br,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ot=nn?C.Buffer:void 0,Mt=C.Symbol,St=C.Uint8Array,hn=Ne(Object.getPrototypeOf,Object),yn=Object.create,gn=he.propertyIsEnumerable,pn=dn.splice,vt=Object.getOwnPropertySymbols,_n=Ot?Ot.isBuffer:void 0,wn=Ne(Object.keys,Object),ke=Q(C,"DataView"),te=Q(C,"Map"),Re=Q(C,"Promise"),Ce=Q(C,"Set"),Ye=Q(C,"WeakMap"),re=Q(Object,"create"),bn=z(ke),Tn=z(te),Dn=z(Re),On=z(Ce),Mn=z(Ye),xt=Mt?Mt.prototype:void 0,Et=xt?xt.valueOf:void 0;function L(a){var s=-1,u=a?a.length:0;for(this.clear();++s<u;){var l=a[s];this.set(l[0],l[1])}}function Sn(){this.__data__=re?re(null):{}}function vn(a){return this.has(a)&&delete this.__data__[a]}function xn(a){var s=this.__data__;if(re){var u=s[a];return u===n?void 0:u}return F.call(s,a)?s[a]:void 0}function En(a){var s=this.__data__;return re?s[a]!==void 0:F.call(s,a)}function Pn(a,s){var u=this.__data__;return u[a]=re&&s===void 0?n:s,this}L.prototype.clear=Sn,L.prototype.delete=vn,L.prototype.get=xn,L.prototype.has=En,L.prototype.set=Pn;function Y(a){var s=-1,u=a?a.length:0;for(this.clear();++s<u;){var l=a[s];this.set(l[0],l[1])}}function Nn(){this.__data__=[]}function In(a){var s=this.__data__,u=ge(s,a);if(u<0)return!1;var l=s.length-1;return u==l?s.pop():pn.call(s,u,1),!0}function kn(a){var s=this.__data__,u=ge(s,a);return u<0?void 0:s[u][1]}function Rn(a){return ge(this.__data__,a)>-1}function Cn(a,s){var u=this.__data__,l=ge(u,a);return l<0?u.push([a,s]):u[l][1]=s,this}Y.prototype.clear=Nn,Y.prototype.delete=In,Y.prototype.get=kn,Y.prototype.has=Rn,Y.prototype.set=Cn;function $(a){var s=-1,u=a?a.length:0;for(this.clear();++s<u;){var l=a[s];this.set(l[0],l[1])}}function Yn(){this.__data__={hash:new L,map:new(te||Y),string:new L}}function qn(a){return pe(this,a).delete(a)}function Hn(a){return pe(this,a).get(a)}function Fn(a){return pe(this,a).has(a)}function Gn(a,s){return pe(this,a).set(a,s),this}$.prototype.clear=Yn,$.prototype.delete=qn,$.prototype.get=Hn,$.prototype.has=Fn,$.prototype.set=Gn;function X(a){this.__data__=new Y(a)}function An(){this.__data__=new Y}function Wn(a){return this.__data__.delete(a)}function jn(a){return this.__data__.get(a)}function Ln(a){return this.__data__.has(a)}function Un(a,s){var u=this.__data__;if(u instanceof Y){var l=u.__data__;if(!te||l.length<r-1)return l.push([a,s]),this;u=this.__data__=new $(l)}return u.set(a,s),this}X.prototype.clear=An,X.prototype.delete=Wn,X.prototype.get=jn,X.prototype.has=Ln,X.prototype.set=Un;function zn(a,s){var u=Fe(a)||ya(a)?cn(a.length,String):[],l=u.length,D=!!l;for(var v in a)F.call(a,v)&&!(D&&(v=="length"||da(v,l)))&&u.push(v);return u}function Pt(a,s,u){var l=a[s];(!(F.call(a,s)&&Rt(l,u))||u===void 0&&!(s in a))&&(a[s]=u)}function ge(a,s){for(var u=a.length;u--;)if(Rt(a[u][0],s))return u;return-1}function Vn(a,s){return a&&Nt(s,Ge(s),a)}function qe(a,s,u,l,D,v,q){var x;if(l&&(x=v?l(a,D,v,q):l(a)),x!==void 0)return x;if(!_e(a))return a;var qt=Fe(a);if(qt){if(x=ua(a),!s)return ia(a,x)}else{var Z=U(a),Ht=Z==_||Z==y;if(pa(a))return Kn(a,s);if(Z==N||Z==o||Ht&&!v){if(_t(a))return v?a:{};if(x=ca(Ht?{}:a),!s)return sa(a,Vn(x,a))}else{if(!w[Z])return v?a:{};x=la(a,Z,qe,s)}}q||(q=new X);var Ft=q.get(a);if(Ft)return Ft;if(q.set(a,x),!qt)var Gt=u?oa(a):Ge(a);return on(Gt||a,function(Ae,we){Gt&&(we=Ae,Ae=a[we]),Pt(x,we,qe(Ae,s,u,l,we,a,q))}),x}function $n(a){return _e(a)?yn(a):{}}function Xn(a,s,u){var l=s(a);return Fe(a)?l:un(l,u(a))}function Qn(a){return ye.call(a)}function Zn(a){if(!_e(a)||ma(a))return!1;var s=Yt(a)||_t(a)?mn:Jr;return s.test(z(a))}function Bn(a){if(!kt(a))return wn(a);var s=[];for(var u in Object(a))F.call(a,u)&&u!="constructor"&&s.push(u);return s}function Kn(a,s){if(s)return a.slice();var u=new a.constructor(a.length);return a.copy(u),u}function He(a){var s=new a.constructor(a.byteLength);return new St(s).set(new St(a)),s}function Jn(a,s){var u=s?He(a.buffer):a.buffer;return new a.constructor(u,a.byteOffset,a.byteLength)}function ea(a,s,u){var l=s?u(wt(a),!0):wt(a);return pt(l,an,new a.constructor)}function ta(a){var s=new a.constructor(a.source,Kr.exec(a));return s.lastIndex=a.lastIndex,s}function ra(a,s,u){var l=s?u(bt(a),!0):bt(a);return pt(l,sn,new a.constructor)}function na(a){return Et?Object(Et.call(a)):{}}function aa(a,s){var u=s?He(a.buffer):a.buffer;return new a.constructor(u,a.byteOffset,a.length)}function ia(a,s){var u=-1,l=a.length;for(s||(s=Array(l));++u<l;)s[u]=a[u];return s}function Nt(a,s,u,l){u||(u={});for(var D=-1,v=s.length;++D<v;){var q=s[D],x=void 0;Pt(u,q,x===void 0?a[q]:x)}return u}function sa(a,s){return Nt(a,It(a),s)}function oa(a){return Xn(a,Ge,It)}function pe(a,s){var u=a.__data__;return fa(s)?u[typeof s=="string"?"string":"hash"]:u.map}function Q(a,s){var u=ln(a,s);return Zn(u)?u:void 0}var It=vt?Ne(vt,Object):ba,U=Qn;(ke&&U(new ke(new ArrayBuffer(1)))!=me||te&&U(new te)!=g||Re&&U(Re.resolve())!=I||Ce&&U(new Ce)!=W||Ye&&U(new Ye)!=j)&&(U=function(a){var s=ye.call(a),u=s==N?a.constructor:void 0,l=u?z(u):void 0;if(l)switch(l){case bn:return me;case Tn:return g;case Dn:return I;case On:return W;case Mn:return j}return s});function ua(a){var s=a.length,u=a.constructor(s);return s&&typeof a[0]=="string"&&F.call(a,"index")&&(u.index=a.index,u.input=a.input),u}function ca(a){return typeof a.constructor=="function"&&!kt(a)?$n(hn(a)):{}}function la(a,s,u,l){var D=a.constructor;switch(s){case it:return He(a);case d:case m:return new D(+a);case me:return Jn(a,l);case st:case ot:case ut:case ct:case lt:case dt:case ft:case mt:case ht:return aa(a,l);case g:return ea(a,l,u);case E:case M:return new D(a);case R:return ta(a);case W:return ra(a,l,u);case T:return na(a)}}function da(a,s){return s=s??i,!!s&&(typeof a=="number"||en.test(a))&&a>-1&&a%1==0&&a<s}function fa(a){var s=typeof a;return s=="string"||s=="number"||s=="symbol"||s=="boolean"?a!=="__proto__":a===null}function ma(a){return!!Tt&&Tt in a}function kt(a){var s=a&&a.constructor,u=typeof s=="function"&&s.prototype||he;return a===u}function z(a){if(a!=null){try{return Dt.call(a)}catch{}try{return a+""}catch{}}return""}function ha(a){return qe(a,!0,!0)}function Rt(a,s){return a===s||a!==a&&s!==s}function ya(a){return ga(a)&&F.call(a,"callee")&&(!gn.call(a,"callee")||ye.call(a)==o)}var Fe=Array.isArray;function Ct(a){return a!=null&&_a(a.length)&&!Yt(a)}function ga(a){return wa(a)&&Ct(a)}var pa=_n||Ta;function Yt(a){var s=_e(a)?ye.call(a):"";return s==_||s==y}function _a(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=i}function _e(a){var s=typeof a;return!!a&&(s=="object"||s=="function")}function wa(a){return!!a&&typeof a=="object"}function Ge(a){return Ct(a)?zn(a):Bn(a)}function ba(){return[]}function Ta(){return!1}e.exports=ha})(Se,Se.exports);var Rs=Se.exports;const Cs=ks(Rs),ee=(e,t)=>new Date(e.getTime()-Ur(t,e));class P{constructor(t){b(this,"timeframeText");b(this,"key");b(this,"display");b(this,"timeframeLength");b(this,"allowedTiers");b(this,"defaultResponseGranularity");b(this,"dataGranularity");b(this,"isRelative");b(this,"fineGrainedDefaultGranularity");b(this,"_startCustom");b(this,"_endCustom");b(this,"_allowedGranularitiesOverride");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 r=new Set,n=this.maximumTimeframeLength()/3600;return n<=6&&r.add("minutely"),n>=2&&n<=7*24&&r.add("hourly"),n>=2*24&&r.add("daily"),n>=2*24*14&&r.add("weekly"),r}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 r=Ss(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Lr(r,t)}}class Ys extends P{rawStart(t){let r=H(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(r=ee(r,t)),r}maximumTimeframeLength(){return 60*60*24*7}}class qs extends P{rawStart(t){let r=J(this.tzAdjustedDate(t));return t&&(r=ee(r,t)),r}maximumTimeframeLength(){return 60*60*24*31}}class Hs extends P{rawEnd(t){let r=H(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(r=ee(r,t)),r}rawStart(t){const r=this.tzAdjustedDate(t);let n=H(r.setDate(r.getDate()-7),{weekStartsOn:1});return t&&(n=ee(n,t)),n}}class Fs extends P{rawEnd(t){let r=J(this.tzAdjustedDate(t));return t&&(r=ee(r,t)),r}rawStart(t){let r=J(Ar(this.tzAdjustedDate(t)));return t&&(r=ee(r,t)),r}}const Qr=new Map([[h.FIFTEEN_MIN,new P({key:h.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"thirtySecondly",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely"]})],[h.ONE_HOUR,new P({key:h.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"minutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely"]})],[h.SIX_HOUR,new P({key:h.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"fiveMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]})],[h.TWELVE_HOUR,new P({key:h.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"tenMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]})],[h.ONE_DAY,new P({key:h.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"thirtyMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["fiveMinutely","tenMinutely","thirtyMinutely","hourly"]})],[h.SEVEN_DAY,new P({key:h.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]})],[h.THIRTY_DAY,new P({key:h.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twelveHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]})],[h.CURRENT_WEEK,new Ys({key:h.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const e=H(new Date,{weekStartsOn:1});return(De(Wt(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]})],[h.CURRENT_MONTH,new qs({key:h.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const e=J(new Date);return(De(Wt(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})],[h.PREVIOUS_WEEK,new Hs({key:h.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]})],[h.PREVIOUS_MONTH,new Fs({key:h.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=J(new Date),r=J(Ar(new Date));return t.getTimezoneOffset()!==r.getTimezoneOffset()&&(e=Zr(t,r)),60*60*24*Xi(new Date().setMonth(new Date().getMonth()-1))+Zi(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})]]);function Gs(e){const t=new Date(e.start),r=new Date(e.end),n=(r.getTime()-t.getTime())/1e3;return e.timePeriodsKey&&Cs(Qr.get(e.timePeriodsKey))||new P({key:"custom",timeframeText:"custom",display:"custom",startCustom:t,endCustom:r,timeframeLength:()=>n,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["free","plus","enterprise"]})}function As(e){return{...e.key!=="custom"&&{timePeriodsKey:e.key},start:e.rawStart(),end:e.rawEnd()}}function Ws(e){return{key:e.key,display:e.display,timeframeText:e.timeframeText,timeframeLength:()=>e.key,start:()=>e.rawStart(),end:()=>e.rawEnd()}}function Zr(e,t){return Bi(e.getTimezoneOffset()-t.getTimezoneOffset())}const js={"15M":h.FIFTEEN_MIN,"1H":h.ONE_HOUR,"6H":h.SIX_HOUR,"12H":h.TWELVE_HOUR,"24H":h.ONE_DAY,"7D":h.SEVEN_DAY,"15m":h.FIFTEEN_MIN,"1h":h.ONE_HOUR,"6h":h.SIX_HOUR,"12h":h.TWELVE_HOUR,"24h":h.ONE_DAY,"7d":h.SEVEN_DAY,"30d":h.THIRTY_DAY,current_week:h.CURRENT_WEEK,current_month:h.CURRENT_MONTH,previous_week:h.PREVIOUS_WEEK,previous_month:h.PREVIOUS_MONTH};class Pe{constructor(t){b(this,"_seed");this._seed=t}next(t,r){const n=Math.sin(this._seed++)*1e4,i=n-Math.floor(n);return Math.floor(i*(r-t+1))+t}}const Ls=(e,t,r)=>{const n=at(10,1e4),i=new Pe(n),o=Date.now()-6*60*60*1e3,c=Date.now(),d=[];let m=0;for(let y=o;y<=c;y+=60*60*1e3)if(t)for(const g in t)t[g].forEach(E=>{m+=i.next(50,500);const N={[g]:E,[e.name]:m},I={version:"1.0",timestamp:new Date(y).toISOString(),event:N};d.push(I)});else{m+=i.next(50,500);const g={version:"1.0",timestamp:new Date(y).toISOString(),event:{[e.name]:m}};d.push(g)}const f={};if(t)for(const y in t)f[y]={},t[y].forEach(g=>{f[y][g]={name:g,deleted:!1}});const _={start_ms:o,end_ms:c,start:new Date(o).toISOString(),end:new Date(c).toISOString(),query_id:"12345",metric_names:[e.name],metric_units:{[e.name]:e.unit},granularity_ms:60*60*1e3,display:f,...r??{}};return{data:d,meta:_}},Us=(e,t)=>{const r=at(10,1e4),n=new Pe(r),i=Date.now()-6*60*60*1e3,o=Date.now(),c=[],d={};e.forEach(f=>{d[f.name]=0});for(let f=i;f<=o;f+=60*60*1e3){const _={};e.forEach(g=>{d[g.name]+=n.next(50,500),_[g.name]=d[g.name]});const y={version:"1.0",timestamp:new Date(f).toISOString(),event:_};c.push(y)}const m={start_ms:i,end_ms:o,start:new Date(i).toISOString(),end:new Date(o).toISOString(),query_id:"12345",metric_names:e.map(f=>f.name),metric_units:e.reduce((f,_)=>(f[_.name]=_.unit,f),{}),granularity_ms:60*60*1e3,display:{},...t??{}};return{data:c,meta:m}},zs=(e,t,r)=>{const n=Math.floor(Math.random()*9991)+10,i=new Pe(n),o=Date.now()-6*60*60*1e3,c=Date.now(),d=new Date((o+c)/2).toISOString(),m=[];if(t){const y=Object.keys(t),g=Object.values(t),E=(N,I)=>{if(I===y.length){e.forEach(R=>{N[R.name]=i.next(1e3,5e7)}),m.push({version:"1.0",timestamp:new Date().toISOString(),event:{...N}});return}g[I].forEach(R=>{E({...N,[y[I]]:R},I+1)})};E({},0)}else{const y={};e.forEach(g=>{y[g.name]=i.next(50,500)}),m.push({version:"1.0",timestamp:d,event:y})}const f={};if(t)for(const y in t)f[y]={},t[y].forEach(g=>{f[y][g]={name:g,deleted:!1}});const _={start_ms:o,end_ms:c,start:new Date(o).toISOString(),end:new Date(c).toISOString(),query_id:"12345",metric_names:e.map(y=>y.name),metric_units:e.reduce((y,g)=>(y[g.name]=g.unit,y),{}),truncated:!1,limit:50,display:f,granularity_ms:c-o,...r??{}};return{data:m,meta:_}};function at(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1)+e)}exports.DeltaQueryTime=Is;exports.Granularities=ie;exports.REFRESH_INTERVAL_MS=Ma;exports.SeededRandom=Pe;exports.TIMEFRAME_LOOKUP=js;exports.TimePeriods=Qr;exports.Timeframe=P;exports.TimeframeKeys=h;exports.TimeseriesQueryTime=Ns;exports.UnaryQueryTime=Xr;exports.aiExploreAggregations=lr;exports.apiUsageQuerySchema=Er;exports.barChartSchema=br;exports.basicExploreAggregations=Ze;exports.basicQuerySchema=Pr;exports.ceilToNearestTimeGrain=nt;exports.choroplethMapSchema=xr;exports.dashboardConfigSchema=Ha;exports.dashboardTileTypes=Ca;exports.datasourceToFilterableDimensions=gr;exports.datePickerSelectionToTimeframe=Gs;exports.donutChartSchema=Or;exports.dstOffsetHours=Zr;exports.exploreAggregations=cr;exports.exploreFilterTypesV2=sr;exports.filterableAiExploreDimensions=ce;exports.filterableBasicExploreDimensions=oe;exports.filterableExploreDimensions=ue;exports.filterableRequestDimensions=fr;exports.filterableRequestMetrics=yr;exports.filterableRequestWildcardDimensions=Na;exports.floorToNearestTimeGrain=$r;exports.formatISOTimeWithTZ=vs;exports.formatTime=Xe;exports.formatTimeRange=xs;exports.gaugeChartSchema=Dr;exports.generateCrossSectionalData=zs;exports.generateMultipleMetricTimeSeriesData=Us;exports.generateSingleMetricTimeSeriesData=Ls;exports.getFieldDataSources=Fa;exports.granularitiesToOptions=Es;exports.granularityMsToQuery=zr;exports.granularityValues=Qe;exports.llmUsageSchema=Nr;exports.metricCardSchema=Sr;exports.msToGranularity=Ps;exports.queryDatasources=ka;exports.queryableAiExploreDimensions=Ke;exports.queryableBasicExploreDimensions=ve;exports.queryableExploreDimensions=Be;exports.queryableRequestDimensions=dr;exports.queryableRequestMetrics=hr;exports.queryableRequestWildcardDimensions=mr;exports.rand=at;exports.relativeTimeRangeValuesRequestV2=Ia;exports.relativeTimeRangeValuesV4=ur;exports.reportChartTypes=Sa;exports.requestFilterTypeEmptyV2=or;exports.requestFilterTypeEqualsV2=va;exports.requestFilterTypeMetricV2=xa;exports.requestFilterTypeWildcardV2=Ea;exports.singleValueSchema=vr;exports.slottableSchema=wr;exports.stripUnknownFilters=Ra;exports.tileConfigSchema=Cr;exports.tileDefinitionSchema=kr;exports.tileLayoutSchema=Rr;exports.timeRangeTypeV2=Pa;exports.timeframeToDatepickerSelection=As;exports.timeframeToDatepickerTimeperiod=Ws;exports.timeseriesChartSchema=Tr;exports.topNTableSchema=Mr;exports.validDashboardQuery=Ir;
|
|
2
2
|
//# sourceMappingURL=vitals-utilities.cjs.map
|