/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
import a from"./MOJH7XEP.js";import{O as o,U as h,b as m}from"./IXZEUVT2.js";import"./H6RQVSYM.js";export default $arcgis.t(([{watch:d},{f:u}])=>{var n=class extends o{constructor(){super(...arguments),this._dpi=1}static{this.properties={_dpi:16,viewModel:0,messages:0}}loaded(){this.manager.onLifecycle(()=>[d(()=>this.viewModel.templateOptions.dpi,e=>this._dpi=e<=0?1:e,{initial:!0})])}_handleDPIChange(e){let i=this.viewModel.templateOptions,t=Number(e.target.value);if(Number.isNaN(t)||t<=0||!Number.isFinite(t)){e.target.value=`${this._dpi}`;return}if(u(i.layout)){let a=i.dpi>0?i.dpi:this._dpi,r=i.width,s=i.height;if(a>0&&typeof r=="number"&&typeof s=="number"&&Number.isFinite(r)&&Number.isFinite(s)&&t!==a){let p=t/a;i.width=Math.max(1,Math.round(r*p)),i.height=Math.max(1,Math.round(s*p))}}i.dpi=t}render(){return m`<div><calcite-label>${this.messages.dpi}<calcite-input-number data-input-name=dpi min=1 .value=${`${this._dpi}`} .max=${Number.MAX_SAFE_INTEGER} @calciteInputNumberChange=${this._handleDPIChange}></calcite-input-number></calcite-label></div>`}};h("arcgis-print-dpi-input",n);return n},"core/reactiveUtils",a)