import { c as a } from "../../chunks/runtime.js";
import { html as s } from "lit-html";
import { watch as n } from "@geoscene/core/core/reactiveUtils.js";
import { LitElement as r, noShadowRoot as p } from "@arcgis/lumina";
/*! All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
See https://js.geoscene.cn/4.33/geoscene/copyright.txt for details.
v4.33.18 */
class o extends r {
  constructor() {
    super(...arguments), this._dpi = 1;
  }
  static {
    this.properties = { _dpi: 16, viewModel: 0, messages: 0 };
  }
  static {
    this.shadowRootOptions = p;
  }
  loaded() {
    this.manager.onLifecycle(() => [
      n(() => this.viewModel.templateOptions.dpi, (t) => this._dpi = t <= 0 ? 1 : t, { initial: !0 })
    ]);
  }
  _handleDPIChange(t) {
    const i = this.viewModel.templateOptions, e = Number(t.target.value);
    if (Number.isNaN(e) || e <= 0 || !Number.isFinite(e)) {
      t.target.value = `${this._dpi}`;
      return;
    }
    i.dpi = e;
  }
  render() {
    return s`<div><calcite-label>${this.messages.dpi}<calcite-input-number data-input-name=dpi min=1 .value=${`${this._dpi}`} .max=${Number.MAX_SAFE_INTEGER} @calciteInputNumberInput=${this._handleDPIChange}></calcite-input-number></calcite-label></div>`;
  }
}
a("geoscene-print-dpi-input", o);
export {
  o as PrintDPIInput
};