/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../chunks/_rollupPluginBabelHelpers","../../../chunks/tslib.es6","../../../core/Collection","../../../core/accessorSupport/decorators/property","../../../core/arrayUtils","../../../core/has","../../../core/accessorSupport/ensureType","../../../core/accessorSupport/decorators/subclass","../../LayerList/LayerListViewModel","./snappingLayerListUtils","./SnappingListItem"],(function(e,t,r,i,s,o,a,n,p,c,l,u){"use strict";e.SnappingLayerListViewModel=function(e){function r(){var t;return(t=e.apply(this,arguments)||this).featureSnappingSources=new i,t}t._inheritsLoose(r,e);var s=r.prototype;return s._compileList=function(){const e=this.get("view.map.layers");if(!e)return;const t=e.filter(l.isValidSnappingLayer);this._watchLayersListMode(t);const r=this._getViewableLayers(t);r&&r.length?(this._createNewItems(r),this._removeItems(r),this._sortItems(r)):this._removeAllItems()},s._createListItem=function(e){return new u.SnappingListItem({layer:e,view:this.view,getFeatureSnappingSources:()=>this.featureSnappingSources})},t._createClass(r,[{key:"operationalItemsFlat",get:function(){return this.operationalItems.flatten((e=>e.children))}}]),r}(c),r.__decorate([s.property()],e.SnappingLayerListViewModel.prototype,"featureSnappingSources",void 0),r.__decorate([s.property()],e.SnappingLayerListViewModel.prototype,"operationalItems",void 0),e.SnappingLayerListViewModel=r.__decorate([p.subclass("esri.widgets.support.SnappingControls.SnappingLayerListViewModel")],e.SnappingLayerListViewModel),Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
