"use strict";(self.webpackChunkgrafana_metricsdrilldown_app=self.webpackChunkgrafana_metricsdrilldown_app||[]).push([[377],{2377:(e,t,a)=>{a.r(t),a.d(t,{default:()=>p});var n=a(5959),r=a.n(n),i=a(2993),l=a(8732),d=a(1522),o=a(5935),c=a(1004),u=a(3781),s=a(7781),m=a(128);function f(e){return"string"==typeof e&&s.dateMath.isMathString(e)?e:s.dateMath.toDateTime(new Date(e),{roundUp:!1}).toISOString()}const p=({query:e,initialStart:t,initialEnd:a,dataSource:s})=>{const[p]=(0,d.n)(),[b,w]=(0,n.useState)(null),g=(0,n.useRef)(!1);if((0,n.useEffect)(()=>{g.current||(g.current=!0,(0,o.z)("exposed_component_viewed",{component:"label_breakdown"}))},[]),(0,n.useEffect)(()=>{(0,u.$9)(e).then(w)},[e]),!b)return r().createElement("div",null,"Loading...");const E=(0,c.ef)({metric:b.metric,initialDS:s.uid,initialFilters:b.labels.map(({label:e,op:t,value:a})=>({key:e,operator:t,value:a})),$timeRange:(S=t,h=a,new m.SceneTimeRange({from:f(S),to:f(h)})),embedded:!0});var S,h;return r().createElement("div",{"data-testid":"metrics-drilldown-embedded-label-breakdown"},p?r().createElement(i.E,{error:p}):r().createElement(l.X,{trail:E}))}}}]);
//# sourceMappingURL=377.js.map?_cache=50e3066338db1f841033