/*
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","../../request","../../core/Handles","../../core/JSONSupport","../../core/lang","../../core/maybe","../../core/reactiveUtils","../../core/accessorSupport/decorators/property","../../core/accessorSupport/ensureType","../../core/accessorSupport/decorators/reader","../../core/accessorSupport/decorators/subclass","../../core/accessorSupport/decorators/persistable","./PolygonCollection","../../chunks/persistableUrlUtils"],(function(e,r,t,o,s,i,n,a,c,l,p,u,d,h,m){"use strict";var g;let y=g=function(r){function s(e){var t;return(t=r.call(this,e)||this).spatialRelationship="disjoint",t.geometries=new h,t._geometriesSource=null,t._handles=new o,t}e._inheritsLoose(s,r);var c=s.prototype;return c.initialize=function(){this._handles.add(a.on((()=>this.geometries),"after-changes",(()=>this.geometries=this.geometries),a.sync))},c.destroy=function(){this._handles.destroy()},c.readGeometries=function(e,r,t){this._geometriesSource={url:m.fromJSON(e,t),context:t}},c.loadGeometries=function(){var r=e._asyncToGenerator((function*(e,r){if(n.isNone(this._geometriesSource))return;const{url:o,context:s}=this._geometriesSource,i=yield t(o,{responseType:"json",signal:n.get(r,"signal")}),a=e.toJSON(),c=i.data.map((e=>({...e,spatialReference:a})));this.geometries=h.fromJSON(c,s),this._geometriesSource=null}));function o(e,t){return r.apply(this,arguments)}return o}(),c.clone=function(){return new g({geometries:i.clone(this.geometries),spatialRelationship:this.spatialRelationship})},s}(s.JSONSupport);r.__decorate([c.property({type:["disjoint","contains"],nonNullable:!0,json:{write:!0}})],y.prototype,"spatialRelationship",void 0),r.__decorate([c.property({type:h,nonNullable:!0,json:{write:!0}}),d.persistable({origins:["web-scene","portal-item"],type:"resource",prefix:"geometries"})],y.prototype,"geometries",void 0),r.__decorate([p.reader(["web-scene","portal-item"],"geometries")],y.prototype,"readGeometries",null),y=g=r.__decorate([u.subclass("esri.layers.support.SceneFilter")],y);return y}));
