/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["../chunks/_rollupPluginBabelHelpers","../chunks/tslib.es6","../analysis/LineOfSightAnalysis","../analysis/LineOfSightAnalysisObserver","../analysis/LineOfSightAnalysisTarget","../core/Collection","../core/maybe","../core/MultiOriginJSONSupport","../core/reactiveUtils","../core/accessorSupport/decorators/property","../core/arrayUtils","../core/has","../core/accessorSupport/ensureType","../core/accessorSupport/decorators/subclass","./Layer","./mixins/OperationalLayer"],(function(e,t,r,i,s,a,n,o,l,p,y,c,u,d,h,f){"use strict";const g=a.ofType(s);let _=function(t){function i(e){var i;return(i=t.call(this,e)||this).type="line-of-sight",i.operationalLayerType="LineOfSightLayer",i.analysis=new r,i.opacity=1,i}e._inheritsLoose(i,t);var s=i.prototype;return s.initialize=function(){this.own(l.watch((()=>this.analysis),((e,t)=>{n.isSome(t)&&t.parent===this&&(t.parent=null),n.isSome(e)&&(e.parent=this)}),l.syncAndInitial))},s.load=function(){var t=e._asyncToGenerator((function*(){return n.isSome(this.analysis)&&this.addResolvingPromise(this.analysis.waitComputeExtent()),this}));function r(){return t.apply(this,arguments)}return r}(),s.removeAnalysis=function(e){this.analysis===e&&(this.analysis=new r)},e._createClass(i,[{key:"observer",get:function(){return n.applySome(this.analysis,(e=>e.observer))},set:function(e){n.applySome(this.analysis,(t=>t.observer=e))}},{key:"targets",get:function(){return n.isSome(this.analysis)?this.analysis.targets:null},set:function(e){n.applySome(this.analysis,(t=>t.targets=e))}},{key:"fullExtent",get:function(){return n.isSome(this.analysis)?this.analysis.extent:null}},{key:"spatialReference",get:function(){return n.isSome(this.analysis)?this.analysis.spatialReference:null}}]),i}(f.OperationalLayer(o.MultiOriginJSONMixin(h)));t.__decorate([p.property({json:{read:!1},readOnly:!0})],_.prototype,"type",void 0),t.__decorate([p.property({type:["LineOfSightLayer"]})],_.prototype,"operationalLayerType",void 0),t.__decorate([p.property({type:i,json:{read:!0,write:{ignoreOrigin:!0}}})],_.prototype,"observer",null),t.__decorate([p.property({type:g,json:{read:!0,write:{ignoreOrigin:!0}}})],_.prototype,"targets",null),t.__decorate([p.property({nonNullable:!0,json:{read:!1,write:!1}})],_.prototype,"analysis",void 0),t.__decorate([p.property({readOnly:!0})],_.prototype,"fullExtent",null),t.__decorate([p.property({readOnly:!0})],_.prototype,"spatialReference",null),t.__decorate([p.property({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],_.prototype,"opacity",void 0),t.__decorate([p.property({type:["show","hide"]})],_.prototype,"listMode",void 0),_=t.__decorate([d.subclass("esri.layers.LineOfSightLayer")],_);return _}));
