"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[4492],{55087:(S,d,t)=>{t.r(d),t.d(d,{SoloPanel:()=>u,SoloPanelPage:()=>c,default:()=>m});var o=t(74848),O=t(32196),s=t(96540),I=t(71468),v=t(54148),C=t(70713),T=t(40845),U=t(42418),h=t(76888),A=t(39569),L=t(20470);const B=e=>({dashboard:e.dashboard.getModel()}),K={initDashboard:L.vR},R=(0,I.connect)(B,K),c=({route:e,queryParams:a,dashboard:n,initDashboard:i})=>{const[r,E]=(0,s.useState)(null),[_,P]=(0,s.useState)(!1),{keybindings:f}=(0,h.Il)(),{slug:D,uid:M,type:g}=(0,v.g)();(0,s.useEffect)(()=>{i({urlSlug:D,urlUid:M,urlType:g,routeName:e.routeName,fixUrl:!1,keybindingSrv:f})},[D,M,g,e.routeName,i,f]);const W=(0,s.useCallback)(()=>parseInt(a.panelId??"0",10),[a.panelId]);return(0,s.useEffect)(()=>{if(n){const l=n.getPanelByUrlId(a.panelId);if(!l){P(!0);return}l&&n.exitViewPanel(l),E(l),n.initViewPanel(l)}},[n,a.panelId]),(0,o.jsx)(u,{dashboard:n,notFound:_,panel:r,panelId:W(),timezone:a.timezone})},u=({dashboard:e,notFound:a,panel:n,panelId:i,timezone:r})=>{const E=(0,T.of)(x);return a?(0,o.jsx)(U.F,{severity:"error",title:`Panel with id ${i} not found`}):!n||!e?(0,o.jsx)("div",{children:"Loading & initializing dashboard"}):(0,o.jsx)("div",{className:E.container,children:(0,o.jsx)(C.Ay,{children:({width:_,height:P})=>_===0?null:(0,o.jsx)(A.L,{stateKey:n.key,width:_,height:P,dashboard:e,panel:n,isEditing:!1,isViewing:!0,lazy:!1,timezone:r,hideMenu:!0})})})},m=R(c),x=e=>({container:(0,O.css)({position:"fixed",bottom:0,right:0,margin:0,left:0,top:0,width:"100%",height:"100%"})})}}]);

//# sourceMappingURL=SoloPanelPageOld.d95e3159fd334b9b625e.js.map