/*! 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.reporting_bundle_jsonpfunction=window.reporting_bundle_jsonpfunction||[]).push([[4],{56:function(t,e,a){"use strict";a.r(e),a.d(e,"ScreenCapturePanelContent",(function(){return ScreenCapturePanelContent}));var n=a(14),s=a.n(n),o=a(1),i=a.n(o),r=a(6),u=a(5),p=a(4),h=a(55),d=a(0);class ScreenCapturePanelContent extends p.Component{constructor(t){super(t),i()(this,"renderOptions",(()=>"print"===this.props.layoutOption?Object(d.jsx)(r.EuiFormRow,{helpText:Object(d.jsx)(u.FormattedMessage,{id:"xpack.reporting.screenCapturePanelContent.optimizeForPrintingHelpText",defaultMessage:"Uses multiple pages, showing at most 2 visualizations per page"})},Object(d.jsx)(r.EuiSwitch,{label:Object(d.jsx)(u.FormattedMessage,{id:"xpack.reporting.screenCapturePanelContent.optimizeForPrintingLabel",defaultMessage:"Optimize for printing"}),checked:this.state.usePrintLayout,onChange:this.handlePrintLayoutChange,"data-test-subj":"usePrintLayout"})):"canvas"===this.props.layoutOption?Object(d.jsx)(r.EuiFormRow,{helpText:Object(d.jsx)(u.FormattedMessage,{id:"xpack.reporting.screenCapturePanelContent.canvasLayoutHelpText",defaultMessage:"Remove borders and footer logo"})},Object(d.jsx)(r.EuiSwitch,{label:Object(d.jsx)(u.FormattedMessage,{id:"xpack.reporting.screenCapturePanelContent.canvasLayoutLabel",defaultMessage:"Full page layout"}),checked:this.state.useCanvasLayout,onChange:this.handleCanvasLayoutChange,"data-test-subj":"reportModeToggle"})):null)),i()(this,"handlePrintLayoutChange",(t=>{this.setState({usePrintLayout:t.target.checked,useCanvasLayout:!1})})),i()(this,"handleCanvasLayoutChange",(t=>{this.setState({useCanvasLayout:t.target.checked,usePrintLayout:!1})})),i()(this,"getLayout",(()=>{const{layout:t}=this.props.getJobParams();let e=null==t?void 0:t.dimensions;if(!e){const t=document.querySelector("[data-shared-items-container]"),{height:a,width:n}=t?t.getBoundingClientRect():{height:768,width:1024};e={height:a,width:n}}return this.state.usePrintLayout?{id:"print",dimensions:e}:this.state.useCanvasLayout?{id:"canvas",dimensions:e}:{id:"preserve_layout",dimensions:e}})),i()(this,"getJobParams",(()=>({...this.props.getJobParams(),layout:this.getLayout()}))),this.state={usePrintLayout:!1,useCanvasLayout:!1}}render(){return Object(d.jsx)(h.ReportingPanelContent,s()({},this.props,{layoutId:this.getLayout().id,getJobParams:this.getJobParams,options:this.renderOptions()}))}}}}]);