"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[1034],{57393:(M,i,e)=>{e.r(i),e.d(i,{SoloPanel:()=>l,SoloPanelPage:()=>o,default:()=>D});var n=e(85960),u=e(36752),h=e(53565),p=e(6005),P=e(33964),c=e(77705);const E=r=>({dashboard:r.dashboard.getModel()}),m={initDashboard:c.mV},_=(0,u.connect)(E,m);class o extends n.Component{constructor(){super(...arguments),this.state={panel:null,notFound:!1}}componentDidMount(){const{match:a,route:t}=this.props;this.props.initDashboard({urlSlug:a.params.slug,urlUid:a.params.uid,urlType:a.params.type,routeName:t.routeName,fixUrl:!1,keybindingSrv:this.context.keybindings})}getPanelId(){return parseInt(this.props.queryParams.panelId??"0",10)}componentDidUpdate(a){const{dashboard:t}=this.props;if(t&&(!a.dashboard||a.dashboard.uid!==t.uid)){const s=t.getPanelByUrlId(this.props.queryParams.panelId);if(!s){this.setState({notFound:!0});return}s&&t.exitViewPanel(s),this.setState({panel:s}),t.initViewPanel(s)}}render(){return n.createElement(l,{dashboard:this.props.dashboard,notFound:this.state.notFound,panel:this.state.panel,panelId:this.getPanelId(),timezone:this.props.queryParams.timezone})}}o.contextType=p.h;const l=({dashboard:r,notFound:a,panel:t,panelId:s,timezone:f})=>a?n.createElement("div",{className:"alert alert-error"},"Panel with id ",s," not found"):!t||!r?n.createElement("div",null,"Loading & initializing dashboard"):n.createElement("div",{className:"panel-solo"},n.createElement(h.Z,null,({width:d,height:g})=>d===0?null:n.createElement(P.l,{stateKey:t.key,width:d,height:g,dashboard:r,panel:t,isEditing:!1,isViewing:!0,lazy:!1,timezone:f,hideMenu:!0}))),D=_(o)}}]);

//# sourceMappingURL=SoloPanelPage.9b0588f00d596b38ce41.js.map