"use strict";(self.webpackChunkgrafana_lokiexplore_app=self.webpackChunkgrafana_lokiexplore_app||[]).push([[677],{677:(e,r,t)=>{t.r(r),t.d(r,{VARIABLE_NAMESPACE:()=>O,buildLogsExplorationFromState:()=>d,default:()=>m});var n=t(5959),o=t.n(n),a=t(5366),l=t(4509),i=t(8469),c=t(8714),u=t(1296),s=t(3257),p=t(2152);function f(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function b(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function y(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function d(e){var{onTimeRangeChange:r,query:t,referenceQuery:n,timeRangeState:o,options:i}=e,p=y(e,["onTimeRangeChange","query","referenceQuery","timeRangeState","options"]);const d=new a.JZ(o);if(d.subscribeToState(e=>{r&&r(e.value)}),!t)return console.error("No query parameter found! Please pass in a valid logQL query string when embedding Logs Drilldown."),(0,l.EE)(l.NO.service_details,l.ir.service_details.embedded_error),null;(0,u.default)();const{labelFilters:O,lineFilters:m}=(0,s.BW)(t),g=(0,s.BW)(null!=n?n:""),v=O.map(e=>({key:e.key,operator:e.operator,value:e.value})),j=g.labelFilters.map(e=>({key:e.key,operator:e.operator,value:e.value}));return(0,l.EE)(l.NO.service_details,l.ir.service_details.embedded_init),new c.P(b(function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){f(e,r,t[r])})}return e}({},p),{$timeRange:d,defaultLineFilters:m,embedded:!0,embeddedOptions:i,initialLabels:v,referenceLabels:j}))}const O="ld";function m(e){const[r,t]=(0,n.useState)(null);return(0,n.useEffect)(()=>{r||((0,p.rX)(!0),t(d(e)))},[r,e]),r?o().createElement(a.$L,{scene:r,updateUrlOnInit:!1,createBrowserHistorySteps:!0,namespace:null!==(l=e.namespace)&&void 0!==l?l:O,excludeFromNamespace:["from","to","timezone",i.o,i.Z]},o().createElement(r.Component,{model:r})):null;var l}}}]);
//# sourceMappingURL=677.js.map?_cache=212c1ea885ae6d839340