/*! 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 g from"./RLWRTT5R.js";import d from"./W7663NDV.js";import"./OY5IWAZW.js";import c from"./E5V5AKTV.js";import{a as $}from"./VK24LKXI.js";import{a as h}from"./LL7T22QC.js";import b from"./Y4DAIYBP.js";import a from"./DTE4O2DP.js";import{e as w}from"./LYMDZ73M.js";import"./MG6XDMQJ.js";import"./HITJFSBP.js";import{B as u,E as f,P as v,Q as e,U as _,j as m,k as l}from"./3VKC6PRK.js";export default $geoscene.t(([A,{property:O,subclass:C},,,b,,x])=>{var k=m`@layer{geoscene-line-of-sight{display:block}.geoscene-line-of-sight__container{display:flex;position:relative;flex-flow:column;gap:var(--calcite-spacing-md);padding:var(--geoscene-widget-padding);overflow-y:auto}.geoscene-line-of-sight__error{color:var(--calcite-color-status-danger)}.geoscene-line-of-sight__hint{display:flex;flex-direction:column;gap:var(--calcite-spacing-md)}.geoscene-line-of-sight__error,.geoscene-line-of-sight__hint{overflow:hidden;animation:geoscene-line-of-sight-fade-in .25s ease-in-out;p{margin:0;padding:0}}.geoscene-line-of-sight__actions{display:flex;flex-flow:column;gap:var(--calcite-spacing-xxs);justify-content:center}@keyframes geoscene-line-of-sight-fade-in{0%{opacity:0}25%{opacity:0}to{opacity:1}}}`,r="geoscene-line-of-sight",n={base:r,actions:`${r}__actions`,container:`${r}__container`,error:`${r}__error`,hint:`${r}__hint`,hintText:`${r}__hint-text`,newAnalysisButton:`${r}__new-analysis-button`},D=Object.defineProperty,S=Object.getOwnPropertyDescriptor,M=(t,s,a,o)=>{for(var i=o>1?void 0:o?S(s,a):s,d=t.length-1,p;d>=0;d--)(p=t[d])&&(i=(o?p(s,a,i):p(i))||i);return o&&i&&D(s,a,i),i},c=class extends x{constructor(){super(...arguments),this.supportedViewType="3d",this.unsupportedErrorMessage="The Line Of Sight component is only supported in 3D views."}get state(){return this.disabled||!this.ready?"disabled":this.operationState==="active"?"creating":this.analysis.valid?"created":"ready"}constructAnalysis(){return new A}clearAnalysis(){this.analysis.observer=null,this.analysis.targets.removeAll()}async place(t){await this.analysisView?.place(t)}};M([O({readOnly:!0})],c.prototype,"state",1);c=M([C("geoscene.components.LineOfSight.LineOfSightViewModel")],c);var L=b(c),y=class extends v{constructor(){super(...arguments),this.viewModel=L(this),this._messages=$({blocking:!0}),this.view=this.viewModel.view,this.analysis=this.viewModel.analysis,this.autoDestroyDisabled=!1,this.icon="line-of-sight",this.position="bottom-left",this.geoscenePropertyChange=w()("analysis","state"),this.geosceneReady=u()}static{this.properties={analysis:0,autoDestroyDisabled:5,icon:3,label:1,messageOverrides:0,position:1,referenceElement:1,state:35,_supported:16}}static{this.shadowRootOptions=f}static{this.styles=k}get state(){return this.viewModel.state}get _supported(){return this.view==null||this.view.type==="3d"}async clear(){this.viewModel.clear()}async continue(){this.viewModel.start()}async destroy(){await this.manager.destroy()}async start(){this.viewModel.startNewAnalysis()}async stop(){this.viewModel.stop()}render(){return l`<div class=${e({[n.base]:!0,[h.widget]:!0,[h.panel]:!0})} role=presentation>${this._renderContainerNode()}</div>`}_renderContainerNode(){if(!this._supported)return l`<div class=${e(n.error)}><p>${this._messages.unsupported}</p></div>`;let s=this.viewModel.state,a=s==="creating";return l`<div class=${e(n.container)}>${a?l`<div class=${e(n.hint)}><p class=${e(n.hintText)}>${this._messages.hint}</p></div>`:null}<div class=${e(n.actions)}>${s==="creating"?g({onClick:()=>{this.stop()},children:this._messages.done}):null}${s==="created"?g({onClick:()=>{this.continue()},children:this._messages.continueAnalysis}):null}${g({className:n.newAnalysisButton,onClick:()=>{this.start()},primary:!0,disabled:s==="disabled",children:this._messages.newAnalysis})}</div></div>`}};function g({className:t,onClick:s,primary:a,disabled:o,children:i}){return l`<calcite-button .appearance=${a?"solid":"outline-fill"} class=${e(t)} .disabled=${o} @click=${s}>${i}</calcite-button>`}_("geoscene-line-of-sight",y);return y},"analysis/LineOfSightAnalysis","core/accessorSupport/decorators",a,b,c,d,g)