/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
import{a as f}from"./H47NPYUM.js";import{a as g}from"./JD74LG7K.js";import b from"./ZUXQKICJ.js";import{h as d}from"./JCTU3MST.js";import"./BXKNMJRR.js";import a from"./FT7ETWDM.js";import"./IJQZON2Z.js";import{O as u,P as m,R as r,U as h,a as n,b as l,x as i}from"./IXZEUVT2.js";import"./H6RQVSYM.js";export default $arcgis.t(([{when:z},,{a:v}])=>{function y(t){if(!t)return!1;if(t.type==="3d")return t.ready;if(!t?.ready)return!1;let o=p(t),e=t.constraints?.effectiveMaxScale;return e===0||o>e}function b(t){if(!t)return!1;if(t.type==="3d")return t.ready;if(!t?.ready)return!1;let o=p(t),e=t.constraints?.effectiveMinScale;return e===0||o<e}function p(t){let o=t?.animation?.target;return(o&&"then"in o?void 0:o?.scale)??t?.scale??0}var w=n`.arcgis-button{--calcite-icon-color: var(--calcite-color-text-3);--calcite-button-background-color: var(--calcite-color-foreground-1);color:var(--calcite-color-text-3);line-height:var(--calcite-font-line-height-relative-tight);calcite-button{--calcite-offset-invert-focus: 1}display:flex;flex-flow:column;cursor:pointer;background-color:var(--calcite-color-foreground-1);font-size:var(--calcite-font-size);:hover{--calcite-icon-color: var(--calcite-color-text-1);--calcite-button-background-color: var(--calcite-color-transparent-hover)}}:host{display:flex;max-width:fit-content}.zoom-out{border-block-start:solid 1px var(--calcite-color-border-1)}.horizontal{flex-flow:row-reverse nowrap}.horizontal .zoom-out{border-block-start:none;border-inline-end:solid 1px var(--calcite-color-border-1)}`,s=class extends u{constructor(){super(...arguments),this.messages=f({}),this._state="disabled",this.view=v(this),this.autoDestroyDisabled=!1,this.icon="magnifying-glass-plus",this.layout="vertical",this.visualScale="m",this.arcgisActionZoom=i(),this.arcgisPropertyChange=d()("state"),this.arcgisReady=i()}static{this.properties={_state:16,view:0,autoDestroyDisabled:5,icon:1,label:1,layout:3,messageOverrides:0,referenceElement:1,visualScale:1,state:32}}static{this.styles=w}get state(){return this._state}async destroy(){await this.manager.destroy()}async zoomIn(){await this.zoomBy(1)}async zoomOut(){await this.zoomBy(-1)}loaded(){this.manager.onLifecycle(()=>[z(()=>this.view?.ready?"ready":"disabled",o=>{this._state=o},{sync:!0,initial:!0})])}async zoomBy(o){let{view:e}=this,a=o===1;!(a?y(e):b(e))||!e||(this.arcgisActionZoom.emit({action:a?"zoomIn":"zoomOut"}),a?await e.zoomIn():await e.zoomOut())}render(){let o=y(this.view),e=b(this.view),{zoomIn:a,zoomOut:c}=this.messages;return l`<div class=${m({[g.arcgisButton]:!0,horizontal:this.layout==="horizontal"})}><calcite-button class="zoom-in" .disabled=${!o} icon-start=plus kind=neutral .label=${a} @click=${this.zoomIn} .scale=${this.visualScale} title=${a??r}></calcite-button><calcite-button class="zoom-out" .disabled=${!e} icon-start=minus kind=neutral .label=${c} @click=${this.zoomOut} .scale=${this.visualScale} title=${c??r}></calcite-button></div>`}};h("arcgis-zoom",s);return s},"core/reactiveUtils",a,b)