import{__decorate as e}from"tslib";import{layerToJson as r}from"../json/LayerJson.js";import{serializable as t}from"../support/Serializable.js";import{notifyChange as i}from"../support/observableUtils.js";import{ReadOnlyCollection as s}from"../utilities/ReadOnlyCollection.js";import{isCSVLayer as n}from"../utilities/_layers.js";import{LayerExtension as o,LayerExtensionSchema as a}from"./_LayerExtension.js";import{ArrayWrappedCollection as l}from"./support/ArrayWrappedCollection.js";import{PopupTemplateFeatureSettings as p}from"./support/PopupTemplateFeatureSettings.js";let y=class extends o{get renderer(){return this.layer?.renderer}get hasFeatures(){return!0}get layer(){return super.layer}get canChangeLabels(){return!0}get canChangeRenderer(){return!0}get canChangeDefinitionExpression(){return!0}get _layerView(){return this.layer&&this.mapExtension?._allLayerViews.find((e=>e.layer===this.layer))}_getProjectWebmapJSON(){const e=super._getProjectWebmapJSON();if(!e||this.dynamicallyAddedLayer)return e;const{layerDefinition:t}=r(this.layer),{definitionExpression:i,drawingInfo:s}=t??{};return i&&(e.layerDefinition={...e.layerDefinition,definitionExpression:i}),s&&(e.layerDefinition={...e.layerDefinition,drawingInfo:s}),e}_capabilities(){return{...super._capabilities(),supportsStandardizedQueries:!0}}_getSerializableProperties(){const e=super._getSerializableProperties();return{...e,layer:{...this._toPropertyDef(e.layer),default:{layerType:"CSV"}}}}_isSupportedLayer(e){return n(e)}_createFeatureSettings(){return new p(this)}_createSchema(){return new d(this)}};y=e([t],y);export{y as CSVLayerExtension};let d=class extends a{_fieldsCollection;constructor(e){super(e),this._fieldsCollection=new s(new l({parent:e,targetProperty:"layer",arrayProperty:"fields"}),{destroyBackingCollection:!0}),i(this,"_fields")}get _fields(){return this._fieldsCollection}destroy(){this._fieldsCollection.destroy(),super.destroy()}_getPropertyBindings(){return{displayField:"displayField",spatialReference:"spatialReference",geometryType:"geometryType"}}};d=e([t],d);