/*! 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 */
import{P as d,Q as s,U as u,j as o,k as p}from"./3VKC6PRK.js";export default $geoscene.t(([{watch:m}])=>{var h=o`.geoscene-print__scale-input-container{display:flex;align-items:center;padding-bottom:var(--calcite-spacing-md)}.geoscene-print__scale-input-container .geoscene-print__scale-input{flex-grow:1}`,c="geoscene-print",n={scaleInfoContainer:`${c}__scale-info-container`,scaleInputContainer:`${c}__scale-input-container`,scaleInput:`${c}__scale-input`},r=class extends d{constructor(){super(...arguments),this._scale=0,this._scaleEnabled=!1}static{this.properties={_scale:16,_scaleEnabled:16,viewModel:0,messages:0}}static{this.styles=h}loaded(){this.manager.onLifecycle(()=>[m(()=>[this.viewModel.templateOptions.scale,this.viewModel.templateOptions.scaleEnabled],()=>{let{scale:e,scaleEnabled:t}=this.viewModel.templateOptions;this._scale=e,this._scaleEnabled=t},{initial:!0}),m(()=>this.viewModel.view?.scale,e=>{e&&(!this.viewModel.templateOptions.scaleEnabled||!this.viewModel.templateOptions.scale)&&(this.viewModel.templateOptions.scale=e)},{initial:!0})])}_resetToCurrentScale(){this.viewModel.templateOptions.scale=this.viewModel.view?.scale}render(){let{messages:e,_scale:t,_scaleEnabled:l}=this;return p`<div class=${s(n.scaleInfoContainer)}><calcite-label layout=inline><calcite-checkbox .checked=${l} @calciteCheckboxChange=${a=>{this.viewModel.templateOptions.scaleEnabled=a.target.checked,this._resetToCurrentScale()}}></calcite-checkbox>${e.scale}</calcite-label><div class=${s(n.scaleInputContainer)}><calcite-input-number .ariaLabel=${e.scaleLabel} .ariaValueNow=${`${t}`} class=${s(n.scaleInput)} .disabled=${!l} .value=${`${t}`} .max=${Number.MAX_SAFE_INTEGER} @calciteInputNumberInput=${a=>{let i=Number(a.target.value);if(Number.isNaN(i)||i<0||!Number.isFinite(i)){a.target.value=`${t}`;return}this.viewModel.templateOptions.scale=i}}></calcite-input-number><calcite-button appearance=outline .ariaLabel=${e.reset} .disabled=${!l} icon-start=refresh kind=neutral @click=${()=>this._resetToCurrentScale()}></calcite-button></div></div>`}};u("geoscene-print-scale-section",r);return r},"core/reactiveUtils")