/*! Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one or more contributor license agreements. * Licensed under the Elastic License 2.0; you may not use this file except in compliance with the Elastic License 2.0. */ (window.maps_bundle_jsonpfunction=window.maps_bundle_jsonpfunction||[]).push([[28],{69:function(e,t,s){"use strict";s.r(t);var a=s(2),n=s.n(a),o=s(4),l=s(14),i=s(1),p=s(40),c=s(3);const r="details",d="mapStyle",b=[{id:r,name:i.i18n.translate("xpack.maps.inspector.mapDetailsTitle",{defaultMessage:"Map details"}),dataTestSubj:"mapDetailsTab"},{id:d,name:i.i18n.translate("xpack.maps.inspector.mapboxStyleTitle",{defaultMessage:"Mapbox style"}),dataTestSubj:"mapboxStyleTab"}];class map_details_MapDetails extends o.Component{constructor(...e){super(...e),n()(this,"state",{selectedTabId:r}),n()(this,"onSelectedTabChanged",(e=>{this.setState({selectedTabId:e})})),n()(this,"renderTab",(()=>d===this.state.selectedTabId?Object(c.jsx)("div",{"data-test-subj":"mapboxStyleContainer"},Object(c.jsx)(l.EuiCodeBlock,{language:"json",paddingSize:"s"},JSON.stringify(this.props.style,null,2))):Object(c.jsx)(l.EuiTable,{style:{tableLayout:"auto"}},Object(c.jsx)(l.EuiTableBody,null,Object(c.jsx)(l.EuiTableRow,null,Object(c.jsx)(l.EuiTableRowCell,null,Object(c.jsx)(p.FormattedMessage,{id:"xpack.maps.inspector.centerLonLabel",defaultMessage:"Center lon"})),Object(c.jsx)(l.EuiTableRowCell,{"data-test-subj":"centerLon"},this.props.centerLon)),Object(c.jsx)(l.EuiTableRow,null,Object(c.jsx)(l.EuiTableRowCell,null,Object(c.jsx)(p.FormattedMessage,{id:"xpack.maps.inspector.centerLatLabel",defaultMessage:"Center lat"})),Object(c.jsx)(l.EuiTableRowCell,{"data-test-subj":"centerLat"},this.props.centerLat)),Object(c.jsx)(l.EuiTableRow,null,Object(c.jsx)(l.EuiTableRowCell,null,Object(c.jsx)(p.FormattedMessage,{id:"xpack.maps.inspector.zoomLabel",defaultMessage:"Zoom"})),Object(c.jsx)(l.EuiTableRowCell,{"data-test-subj":"zoom"},this.props.zoom))))))}renderTabs(){return b.map(((e,t)=>Object(c.jsx)(l.EuiTab,{onClick:()=>this.onSelectedTabChanged(e.id),isSelected:e.id===this.state.selectedTabId,key:t,"data-test-subj":e.dataTestSubj},e.name)))}render(){return Object(c.jsx)("div",null,Object(c.jsx)(l.EuiTabs,{size:"s"},this.renderTabs()),this.renderTab())}}class map_view_component_MapViewComponent extends o.Component{constructor(...e){super(...e),n()(this,"state",this.props.adapters.map.getMapState()),n()(this,"_onMapChange",(()=>{this.setState(this.props.adapters.map.getMapState())}))}componentDidMount(){this.props.adapters.map.on("change",this._onMapChange)}componentWillUnmount(){this.props.adapters.map.removeListener("change",this._onMapChange)}render(){return Object(c.jsx)(map_details_MapDetails,{centerLon:this.state.stats.center[0],centerLat:this.state.stats.center[1],zoom:this.state.stats.zoom,style:this.state.style})}}t.default=map_view_component_MapViewComponent}}]);