"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[7849],{97414(x,E,t){t.r(E),t.d(E,{SoloPanelPage:()=>c,SoloPanelRenderer:()=>i,default:()=>L});var n=t(74848),D=t(22803),d=t(96540),f=t(54148),M=t(92745),O=t(44248),g=t(34999),u=t(31286),v=t(63142),h=t(11098),C=t(1506),A=t(6262),I=t(32215),P=t(96691);function c({queryParams:e}){const s=(0,I.sP)(),{dashboard:a,loadError:o}=s.useState(),{uid:r="",type:_,slug:l}=(0,f.g)();return(0,d.useEffect)(()=>(s.loadDashboard({uid:r,type:_,slug:l,route:A.Z4.Embedded}),()=>s.clearState()),[s,e,r,_,l]),e.panelId?o?(0,n.jsx)(u.a,{justifyContent:"center",alignItems:"center",display:"flex",height:"100%",children:(0,n.jsx)(g.F,{severity:"error",title:(0,M.t)("dashboard.errors.failed-to-load","Failed to load dashboard"),children:o.message})}):a?(0,n.jsx)(O.$L,{scene:a,updateUrlOnInit:!0,children:(0,n.jsx)(i,{dashboard:a,panelId:e.panelId})}):(0,n.jsx)(h.A,{}):(0,n.jsx)(C.L,{entity:"Panel"})}const L=c;function i({dashboard:e,panelId:s}){const{controls:a,body:o}=e.useState(),r=a?.useState()?.refreshPicker,_=(0,v.of)(R),l=(0,P.XF)(s);return(0,d.useEffect)(()=>{const U=e.activate(),T=r?.activate();return()=>{U(),T?.()}},[e,r]),(0,n.jsxs)("div",{className:_.container,children:[m(e),(0,n.jsx)(P.Ob,{value:l,dashboard:e,singleMatch:!0,children:(0,n.jsx)(o.Component,{model:o})})]})}function m(e){if(!e.state.$variables)return null;const s=e.state.$variables.state.variables;return(0,n.jsx)(n.Fragment,{children:s.map(a=>a.UNSAFE_renderAsHidden?(0,n.jsx)(a.Component,{model:a},a.state.key):null)})}const R=e=>({container:(0,D.css)({position:"fixed",bottom:0,right:0,margin:0,left:0,top:0,width:"100%",height:"100%"})})}}]);

//# sourceMappingURL=SoloPanelPage.4b8d18820bd3c59902e1.js.map