{"version":3,"file":"arlas-map.mjs","sources":["../../../projects/arlas-map/src/lib/map-settings/map-settings.component.ts","../../../projects/arlas-map/src/lib/map-settings/map-settings-dialog.component.html","../../../projects/arlas-map/src/lib/map-settings/map-settings.component.html","../../../projects/arlas-map/src/lib/map/model/map.ts","../../../projects/arlas-map/src/lib/arlas-map-framework.service.ts","../../../projects/arlas-map/src/lib/map/model/layers.ts","../../../projects/arlas-map/src/lib/arlas-map.service.ts","../../../projects/arlas-map/src/lib/basemaps/basemap.service.ts","../../../projects/arlas-map/src/lib/basemaps/basemaps.model.ts","../../../projects/arlas-map/src/lib/map/AbstractArlasMapGL.ts","../../../projects/arlas-map/src/lib/map/tools.ts","../../../projects/arlas-map/src/lib/draw/draw.service.ts","../../../projects/arlas-map/src/lib/draw/modes/LimitVertexDirectSelectMode.ts","../../../projects/arlas-map/src/lib/draw/modes/ValidGeomDrawPolygonMode.ts","../../../projects/arlas-map/src/lib/draw/modes/circles/circle.mode.ts","../../../projects/arlas-map/src/lib/draw/modes/utils.ts","../../../projects/arlas-map/src/lib/draw/modes/circles/radius.circle.mode.ts","../../../projects/arlas-map/src/lib/draw/modes/circles/utils.ts","../../../projects/arlas-map/src/lib/draw/modes/directSelectOverride.ts","../../../projects/arlas-map/src/lib/draw/modes/rectangleMode.ts","../../../projects/arlas-map/src/lib/draw/modes/simpleSelectOverride.ts","../../../projects/arlas-map/src/lib/draw/modes/strip/strip.mode.ts","../../../projects/arlas-map/src/lib/draw/modes/strip/strip.direct.mode.ts","../../../projects/arlas-map/src/lib/draw/themes/default-theme.ts","../../../projects/arlas-map/src/lib/draw/arlas-draw.component.ts","../../../projects/arlas-map/src/lib/draw/arlas-draw.component.html","../../../projects/arlas-map/src/lib/map/model/filters.ts","../../../projects/arlas-map/src/lib/legend/legend.config.ts","../../../projects/arlas-map/src/lib/legend/legend.tools.ts","../../../projects/arlas-map/src/lib/legend/legend.service.ts","../../../projects/arlas-map/src/lib/bbox-generator/coordinates.tools.ts","../../../projects/arlas-map/src/lib/coordinates/coordinates.pipe.ts","../../../projects/arlas-map/src/lib/coordinates/coordinates.component.ts","../../../projects/arlas-map/src/lib/coordinates/coordinates.component.html","../../../projects/arlas-map/src/lib/basemaps/basemap.component.ts","../../../projects/arlas-map/src/lib/basemaps/basemap.component.html","../../../projects/arlas-map/src/lib/legend/legend-icon/layer-icon.component.ts","../../../projects/arlas-map/src/lib/legend/legend-icon/layer-icon.component.html","../../../projects/arlas-map/src/lib/legend/format-legend.pipe.ts","../../../projects/arlas-map/src/lib/legend/legend-item/legend-item.component.ts","../../../projects/arlas-map/src/lib/legend/legend-item/legend-item.component.html","../../../projects/arlas-map/src/lib/legend/layer-name.pipe.ts","../../../projects/arlas-map/src/lib/legend/legend.component.ts","../../../projects/arlas-map/src/lib/legend/legend.component.html","../../../projects/arlas-map/src/lib/arlas-map.pipe.ts","../../../projects/arlas-map/src/lib/arlas-map.component.ts","../../../projects/arlas-map/src/lib/arlas-map.component.html","../../../projects/arlas-map/src/lib/map-import/map-import.component.ts","../../../projects/arlas-map/src/lib/map-import/map-import-dialog.component.html","../../../projects/arlas-map/src/lib/map-import/map-import.component.html","../../../projects/arlas-map/src/lib/map-settings/map-settings.module.ts","../../../projects/arlas-map/src/lib/map-import/map-import.module.ts","../../../projects/arlas-map/src/lib/basemaps/basemap.module.ts","../../../projects/arlas-map/src/lib/coordinates/coordinates.module.ts","../../../projects/arlas-map/src/lib/arlas-map.module.ts","../../../projects/arlas-map/src/lib/bbox-generator/bbox-form-error.pipe.ts","../../../projects/arlas-map/src/lib/bbox-generator/bbox-generator.utils.ts","../../../projects/arlas-map/src/lib/bbox-generator/bbox-generator.component.ts","../../../projects/arlas-map/src/lib/bbox-generator/bbox-generator.component.html","../../../projects/arlas-map/src/lib/bbox-generator/bbox-generator.module.ts","../../../projects/arlas-map/src/lib/draw/AbstractDraw.ts","../../../projects/arlas-map/src/lib/map/model/controls.ts","../../../projects/arlas-map/src/lib/map/model/sources.ts","../../../projects/arlas-map/src/lib/map/model/vector-style.ts","../../../projects/arlas-map/src/public-api.ts","../../../projects/arlas-map/src/arlas-map.ts"],"sourcesContent":["/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { Component, Output } from '@angular/core';\nimport { UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\nimport { marker } from '@colsen1991/ngx-translate-extract-marker';\nimport { Subject, takeUntil } from 'rxjs';\nimport { ArlasColorService } from 'arlas-web-components';\n\nexport interface GeometrySelectModel {\n  path: string;\n  selected?: boolean;\n}\nexport interface OperationSelectModel {\n  operation: GeoQueryOperator;\n  selected?: boolean;\n}\nexport interface GeoQuery {\n  operation: string;\n  geometry_path: string;\n}\n\nexport enum GeoQueryOperator {\n  WITHIN = 'within',\n  NOT_WITHIN = 'notwithin',\n  INTERSECTS = 'intersects',\n  NOT_INTERSECTS = 'notintersects'\n}\n\nexport class SelectFormControl extends UntypedFormControl {\n\n  // used only for autocomplete: list of filtered options\n  public filteredOptions: Array<string>;\n  public syncOptions: Array<string> = [];\n\n  public constructor(\n    formState: any,\n    label: string,\n    options: Array<string>) {\n\n    super(formState, Validators.required);\n    this.setValue(formState);\n    this.setSyncOptions(options);\n\n  }\n\n  public setSyncOptions(newOptions: Array<string>) {\n    this.syncOptions = newOptions;\n    this.filteredOptions = newOptions;\n  }\n}\n\nexport interface MapSettingsService {\n  getGeoQueries(): Map<string, [Array<GeometrySelectModel>, Array<OperationSelectModel>, string]>;\n}\n\n@Component({\n  selector: 'arlas-map-settings-dialog',\n  templateUrl: './map-settings-dialog.component.html',\n  styleUrls: ['./map-settings-dialog.component.scss']\n})\nexport class MapSettingsDialogComponent {\n  /**\n   * @Output : Angular\n   * Emits the geo-query to apply. A geo-query is defined by\n   * - the operation (\"within\", \"intersects\", \"notwithin\", \"notintersects\")\n   * - the geometry field to query\n   */\n  @Output() public geoQueryEmitter: Subject<Map<string, GeoQuery>> = new Subject<Map<string, GeoQuery>>();\n  public emittedGeoQueries: Map<string, GeoQuery> = new Map();\n  /** Constants */\n  public GEO_QUERIES_DESCRIPTION = marker('Draw a bbox or a polygon that');\n\n  public geoQueriesFormGroups = new Array<UntypedFormGroup>();\n  public collectionsColors = new Array<string>();\n  public selectionsSnapshot = new Map<string, string>();\n\n  private readonly _onDestroy$ = new Subject<boolean>();\n\n  public constructor(\n    private readonly dialogRef: MatDialogRef<MapSettingsComponent>,\n    private readonly colorGeneratorLoader: ArlasColorService) { }\n\n  public ngOnDestroy() {\n    this._onDestroy$.next(true);\n    this._onDestroy$.complete();\n  }\n\n  /** Emits the geo-query to apply */\n  public emitGeoFilter() {\n    this.geoQueryEmitter.next(this.emittedGeoQueries);\n  }\n\n  /** Closes the dialog */\n  public onClose() {\n    this.dialogRef.close();\n  }\n\n  public createGeoQueryForm(collectionName: string, displayCollectionName: string,\n      filterGeometries: Array<GeometrySelectModel>, operationsSelectModel: Array<OperationSelectModel>): void {\n    /** geometry */\n    const geometryPaths = filterGeometries.map(fg => fg.path);\n    const selectedGeometry = filterGeometries.find(fg => fg.selected);\n    const selectedGeometryPath = !!selectedGeometry ? selectedGeometry.path : '';\n    /** operation */\n    const operations = operationsSelectModel.map(osm => osm.operation);\n    const selectedOperationSelectModel = operationsSelectModel.find(osm => osm.selected);\n    const selectedOperation = !!selectedOperationSelectModel ?  selectedOperationSelectModel.operation : GeoQueryOperator.INTERSECTS;\n    const geoQueryControls = {\n      a_operation: new SelectFormControl(selectedOperation, '', operations),\n      b_geometryPath: new SelectFormControl(selectedGeometryPath, '', geometryPaths),\n      c_collection: new UntypedFormControl(collectionName),\n      d_displayCollectionName: new UntypedFormControl(displayCollectionName),\n    };\n    const geoQueryForm = new UntypedFormGroup(geoQueryControls);\n    /** snapshot defaultselections */\n    this.emittedGeoQueries.clear();\n    this.selectionsSnapshot.clear();\n    this.selectionsSnapshot.set(collectionName, selectedGeometry + selectedOperation);\n    geoQueryForm.valueChanges\n      .pipe(takeUntil(this._onDestroy$))\n      .subscribe(vc => {\n      const selectionSnapShot = vc.b_geometryPath + vc.a_operation;\n      /** ignore selection changes if the user go back to initial state of a control */\n      const ignoreChange = selectionSnapShot === this.selectionsSnapshot.get(vc.c_collection);\n      if (ignoreChange) {\n        this.emittedGeoQueries.delete(vc.c_collection);\n      } else {\n        this.emittedGeoQueries.set(vc.c_collection, {\n          geometry_path: vc.b_geometryPath,\n          operation: vc.a_operation\n        });\n      }\n    });\n    this.collectionsColors.push((this.colorGeneratorLoader.getColor(collectionName)));\n    this.geoQueriesFormGroups.push(geoQueryForm);\n  }\n}\n\n@Component({\n  selector: 'arlas-map-settings',\n  templateUrl: './map-settings.component.html',\n  styleUrls: ['./map-settings.component.scss']\n})\nexport class MapSettingsComponent {\n\n  /**\n   * @Output : Angular\n   * Emits the geo-query to apply. A geo-query is defined by\n   * - the operation (\"within\", \"intersects\", \"notwithin\", \"notintersects\")\n   * - the geometry field to query\n   */\n  @Output() public geoQueryEmitter = new Subject<Map<string, GeoQuery>>();\n\n  public dialogRef: MatDialogRef<MapSettingsDialogComponent>;\n\n  public constructor(public dialog: MatDialog) { }\n\n  public openDialog(mapSettingsService: MapSettingsService) {\n    this.dialogRef = this.dialog.open(MapSettingsDialogComponent, { data: null, panelClass: 'map-settings-dialog' });\n    const mapGeoQueries = mapSettingsService.getGeoQueries();\n    if (!!mapGeoQueries) {\n      mapGeoQueries.forEach((geoQueries, collection) => {\n        this.dialogRef.componentInstance.createGeoQueryForm(collection, geoQueries[2], geoQueries[0], geoQueries[1]);\n      });\n    }\n    this.dialogRef.componentInstance.geoQueryEmitter = this.geoQueryEmitter;\n  }\n}\n","<h1 mat-dialog-title class=\"mapgl-settings__title\">\n  {{ 'Geo-queries' | translate }}\n</h1>\n\n<div mat-dialog-content class=\"mapgl-settings\">\n  <div class=\"mapgl-settings__description\">\n    {{ GEO_QUERIES_DESCRIPTION | translate }}\n  </div>\n  <div class=\"mapgl-settings__form\" *ngFor=\"let formGroup of geoQueriesFormGroups; let i = index\"\n      [formGroup]=\"formGroup\" [style.borderLeftColor]=\"collectionsColors[i]\">\n    <div class=\"mapgl-settings__form__steps\">\n      <div *ngFor=\"let control of formGroup.controls | keyvalue\" class=\"mapgl-settings__form__steps__item\">\n        <div *ngIf=\"control.key === 'd_displayCollectionName'\">\n          {{ 'of_collection' | translate: { collection: (control.value.value | getCollectionDisplayName | translate) } }}\n        </div>\n        <mat-form-field *ngIf=\"control.key !== 'c_collection' && control.key !== 'color' && control.key !== 'd_displayCollectionName'\">\n          <mat-label>{{ control.key | translate }}</mat-label>\n          <mat-select [formControl]=\"control.value\">\n            <mat-option *ngFor=\"let option of control.value.syncOptions\" [value]=\"option\">\n              {{option | translate}}\n            </mat-option>\n          </mat-select>\n        </mat-form-field>\n      </div>\n    </div>\n  </div>\n</div>\n\n<div mat-dialog-actions class=\"mapgl-settings__actions\">\n  <button mat-button class=\"mapgl-settings__actions--apply\"\n    (click)=\"emitGeoFilter()\">{{ 'Apply geo-queries' | translate }}</button>\n  <button mat-button class=\"mapgl-settings__actions--apply\"\n    (click)=\"emitGeoFilter();onClose()\">{{ 'Set geo-queries' | translate }}</button>\n  <button mat-button class=\"mapgl-settings__actions--cancel\"\n    (click)=\"onClose()\">{{ 'Cancel' | translate}}</button>\n</div>\n\n\n","\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n\nexport interface OnMoveResult {\n  zoom: number;\n  zoomStart: number;\n  center: Array<number>;\n  centerWithOffset: Array<number>;\n  extend: Array<number>;\n  extendWithOffset: Array<number>;\n  rawExtendWithOffset: Array<number>;\n  extendForLoad: Array<number>;\n  extendForTest: Array<number>;\n  rawExtendForLoad: Array<number>;\n  rawExtendForTest: Array<number>;\n  xMoveRatio: number;\n  yMoveRatio: number;\n  visibleLayers: Set<string>;\n}\n\nexport class ArlasLngLat {\n  public lng: number;\n  public lat: number;\n\n  public constructor(lng, lat) {\n    this.lng = lng;\n    this.lat = lat;\n  }\n\n  public toArray(): number[] {\n    return [this.lng, this.lat];\n  }\n}\n\nexport class ArlasLngLatBounds {\n  public sw: ArlasLngLat;\n  public ne: ArlasLngLat;\n\n  public constructor(sw: ArlasLngLat, ne: ArlasLngLat) {\n    this.sw = sw;\n    this.ne = ne;\n  }\n\n  public getEast() {\n    return this.ne.lng;\n  }\n\n  public getNorth() {\n    return this.ne.lat;\n  }\n\n  public getWest() {\n    return this.sw.lng;\n  }\n\n  public getSouth() {\n    return this.sw.lat;\n  }\n}\n\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { Injectable } from '@angular/core';\nimport { FeatureCollection } from '@turf/helpers';\nimport { Subject } from 'rxjs';\nimport { AbstractDraw } from './draw/AbstractDraw';\nimport { AbstractArlasMapGL, ArlasMapOption, MapConfig } from './map/AbstractArlasMapGL';\nimport { MapLayerMouseEvent } from './map/model/events';\nimport { ArlasPoint } from './map/model/geometry';\nimport { ArlasLngLat, ArlasLngLatBounds } from './map/model/map';\nimport { VectorStyle } from './map/model/vector-style';\n\n/**\n * This service exposes a list of map interaction methods that are abstract.\n * Theses methods will be implemented by the chosen cartographical framework to use.\n *\n * L: a layer class/interface.\n * S: a source class/interface.\n * M: a Map configuration class/interface.\n */\n@Injectable({\n  providedIn: 'root'\n})\nexport abstract class ArlasMapFrameworkService<L, S, M> {\n  /** Bus used to transmit errors */\n  private readonly _errorBus$ = new Subject<string>();\n  public readonly errorBus$ = this._errorBus$.asObservable();\n\n  public abstract getInitTransformRequest(): Function;\n  public abstract setTransformRequest(map: AbstractArlasMapGL, transformRequest: Function): void;\n  public abstract buildMapProviderOption(mapOption: ArlasMapOption): M;\n  public abstract createMap(config: MapConfig<M>): AbstractArlasMapGL;\n\n  public abstract createDraw(drawOptions, enabled: boolean, map: AbstractArlasMapGL): AbstractDraw;\n\n  /**\n   * @description Gets the bounds from the two given coordinates.\n   * @param c1 Coordinates of the first corner.\n   * @param c2 Coordinates of the second corner.\n   * @returns Bounds formed from the two given coordinates.\n   */\n  public getLngLatBound(c1: ArlasLngLat, c2: ArlasLngLat): ArlasLngLatBounds {\n    return new ArlasLngLatBounds(c1, c2);\n  }\n\n  /**\n   * Fits the map to its current bounds. To be used when a map container is resized.\n   * @param map Map instance.\n   */\n  public abstract fitMapBounds(map: AbstractArlasMapGL);\n\n  public abstract getBoundsAsString(map: AbstractArlasMapGL): string;\n\n  /**\n   * @description Gets the Point (geometry) from mouse click on the screen.\n   * @param mouseEvent Click mouse event.\n   * @param container Map container.\n   * @returns a Point instance.\n   */\n  public abstract getPointFromScreen(mouseEvent: MouseEvent, container: HTMLElement): ArlasPoint;\n\n  /**\n   * @description Sets `data` to a Geojson `source` of the map\n   * @param source A Geojson source\n   * @param data A feature collection object.\n   */\n  public abstract setDataToGeojsonSource(source: S, data: FeatureCollection<GeoJSON.Geometry>);\n\n\n  /**\n   * Returns the canvas element of the map\n   * @param map Map instance.\n   */\n  public abstract getCanvas(map: AbstractArlasMapGL): HTMLCanvasElement;\n\n  public abstract addImage(name: string, url: string, map: AbstractArlasMapGL, errorMessage: string, opt?: any);\n\n  /**\n   * @description Adds a layer to the map instance.\n   * @param map Map instance.\n   * @param layer A layer. It could be a layer identifier OR a layer object (it will depend on the framwork implementation).\n   * @param beforeId Identifier of an already added layer. The 'layer' is added under this 'beforeId' layer.\n   */\n  public abstract addLayer(map: AbstractArlasMapGL, layer: L, beforeId?: L | string);\n\n  public abstract getLayersFromPattern(map: AbstractArlasMapGL, layersIdPattern: string): L[];\n  public abstract getLayersStartingWithSource(map: AbstractArlasMapGL, sourceIdPattern: string): L[];\n  public abstract getAllLayers(map: AbstractArlasMapGL): L[];\n\n  public abstract hasLayer(map: AbstractArlasMapGL, layer: L | string);\n  public abstract hasLayersFromPattern(map: AbstractArlasMapGL, layersIdPattern: string);\n  public abstract moveLayer(map: AbstractArlasMapGL, layer: L | string, beforeId?: string);\n  public abstract onLayerEvent(eventName: string, map: AbstractArlasMapGL, layer: L | string, fn: (e) => void);\n  public abstract removeLayer(map: AbstractArlasMapGL, layer: L | string);\n  public abstract removeLayers(map: AbstractArlasMapGL, layers: L[] | string[]);\n  public abstract removeLayersFromPattern(map: AbstractArlasMapGL, layersIdPattern: string);\n  public abstract setLayerVisibility(layer: L | string, isVisible: boolean, map: AbstractArlasMapGL);\n  public abstract isLayerVisible(layer: L | string): boolean;\n  public abstract getLayer(map: AbstractArlasMapGL, layerId: string): L;\n\n\n  public abstract queryFeatures(mouseEvent: MapLayerMouseEvent, map: AbstractArlasMapGL, layersIdPattern: string, options?: any);\n  public abstract hasSource(map: AbstractArlasMapGL, source: L | AbstractArlasMapGL | string);\n  public abstract getSource(sourceId: string, options: L | AbstractArlasMapGL | string): S;\n  public abstract getAllSources(options:  L | AbstractArlasMapGL | string): S[];\n  public abstract setSource(sourceId: string, source: S, options: L | AbstractArlasMapGL | string);\n  public abstract removeSource(map: AbstractArlasMapGL, source: S | string);\n\n  public abstract addPopup(map: AbstractArlasMapGL, popup: any);\n  public abstract createPopup(lng: number, lat: number, message: string);\n  public abstract removePopup(map: AbstractArlasMapGL, popup: any);\n\n  public abstract onMapEvent(eventName: any, map: AbstractArlasMapGL, fn: (e) => void);\n  public abstract setMapCursor(map: AbstractArlasMapGL, cursor: string): void;\n  public abstract flyTo(lat: number, lng: number, zoom: number, map: AbstractArlasMapGL);\n\n  public abstract addIconLayer(map: AbstractArlasMapGL, layerId: string, iconName: string,\n    iconSize: number, data: GeoJSON.Feature<GeoJSON.Geometry> | GeoJSON.FeatureCollection<GeoJSON.Geometry>);\n  public abstract addRasterLayer(map: AbstractArlasMapGL, layerId: string, url: string, bounds: number[],\n    maxZoom: number, tileSize: number, beforeId?: string): void;\n\n  public abstract addGeojsonLayer(map: AbstractArlasMapGL, layerId: string, style: VectorStyle,\n    data: GeoJSON.Feature<GeoJSON.Geometry> | GeoJSON.FeatureCollection<GeoJSON.Geometry>\n  ): void;\n\n\n  public abstract filterGeojsonData(map: AbstractArlasMapGL, layer: L | string, filter: any);\n\n  public abstract createGeojsonSource(data: GeoJSON.GeoJSON): S;\n  public abstract createRasterSource(url: string, bounds: number[], maxZoom: number, tileSize: number): S;\n\n  public emitError(message: string) {\n    this._errorBus$.next(message);\n  }\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nexport interface ArlasDataLayer {\n  id: string;\n  type: string;\n  minzoom?: number;\n  maxzoom?: number;\n  source?: string;\n  metadata?: LayerMetadata;\n  paint: ArlasPaint;\n  layout?: any;\n  filter?: any;\n}\n\nexport interface MapLayers<T> {\n  layers: Array<T>;\n  externalEventLayers?: Array<ExternalEventLayer>;\n  events: LayerEvents;\n}\n\nexport interface LayerEvents {\n  onHover: Set<string>;\n  emitOnClick: Set<string>;\n  zoomOnClick: Set<string>;\n}\n\nexport interface ExternalEventLayer {\n  id: string;\n  on: ExternalEvent;\n}\n\nexport enum ExternalEvent {\n  select = 'select',\n  hover = 'hover'\n}\n\n\nexport interface FillStroke {\n  width?: PaintValue;\n  opacity?: number;\n  color?: PaintValue;\n}\n\n/** Metadata of a layer containing info about\n * - the collection\n * - whether it has an interaction with the resultlist (scrollable)\n * - geomType for circle heatmap.\n */\nexport interface LayerMetadata {\n  collection?: string;\n  collectionDisplayName?: string;\n  stroke?: FillStroke;\n  isScrollableLayer?: boolean;\n  hiddenProps?: MetadataHiddenProps;\n  showLegend?: boolean;\n  cellShape?: CellShape;\n}\n\nexport type CellShape = 'hexagonal' | 'square';\nexport interface MetadataHiddenProps {\n  geomType?: string;\n}\n\nexport type PaintValue = Array<string | Array<string> | number> | PaintColor | string | number;\nexport interface ArlasPaint { [key: string]: PaintValue; }\nexport interface PaintColor {\n  property: string;\n  type: string;\n  stops: Array<Array<string>>;\n}\n\n\nexport const HOVER_LAYER_PREFIX = 'arlas-hover-';\nexport const SELECT_LAYER_PREFIX = 'arlas-select-';\nexport const FILLSTROKE_LAYER_PREFIX = 'arlas-fill_stroke-';\nexport const SCROLLABLE_ARLAS_ID = 'scrollable_arlas_id:';\nexport const ARLAS_ID = 'arlas_id:';\nexport const ARLAS_VSET = ':arlas_vset:';\n\n/** FROM V15.0.0 layer ids look like 'arlas_id:NAME:timestamp\n   * This pipe extracts the 'NAME' in that id\n   */\nexport function getLayerName(id: string): string {\n  if (!!id && id.startsWith(ARLAS_ID)) {\n    const datedName = id.split(ARLAS_ID)[1];\n    const undatedName = datedName.split(':')[0];\n    return undatedName;\n  }\n  return id;\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { inject, Injectable } from '@angular/core';\nimport { FeatureCollection } from '@turf/helpers';\nimport { ElementIdentifier } from 'arlas-web-components';\nimport { ArlasMapFrameworkService } from './arlas-map-framework.service';\nimport { AbstractArlasMapGL } from './map/AbstractArlasMapGL';\nimport { ArlasDataLayer, ExternalEvent, MapLayers } from './map/model/layers';\nimport { ArlasMapSource } from './map/model/sources';\nimport { VisualisationSetConfig } from './map/model/visualisationsets';\n\n/**\n * This service propose a set of method to execute the ArlasMapComponent logic.\n * Do not confuse with ArlasMapFrameworkService that is more dedicated to a framework logic.\n */\n@Injectable({\n  providedIn: 'root'\n})\n/** L: a layer class/interface.\n *  S: a source class/interface.\n *  M: a Map configuration class/interface.\n */\nexport abstract class AbstractArlasMapService<L, S, M> {\n  /** @description List of arlas data sources declared in configuration */\n  public dataSources: S[] = [];\n  /** @description Map of ARLAS data layers and their ids (the ids being the key of the map).  */\n  public layersMap: Map<string, ArlasDataLayer>;\n  /**\n   * @description Object to describe visualisation sets\n   * - visulisations: a map of <visualisation name, set of layers identifiers>;\n   * - status: a map of <visualisation name, visibility status>\n   */\n  public visualisationsSets: {\n    visualisations: Map<string, Set<string>>;\n    status: Map<string, boolean>;\n  } = {\n      visualisations: new Map(),\n      status: new Map()\n    };\n\n  protected readonly mapFrameworkService = inject(ArlasMapFrameworkService<L, S, M>);\n\n  /**\n   * @description Declares the arlas data sources provided in configuration.\n   * @param dataSourcesIds Identifiers of arlas data sources.\n   * @param data A feature collection.\n   * @param map Map instance.\n   */\n  public abstract declareArlasDataSources(dataSourcesIds: Set<string>, data: FeatureCollection<GeoJSON.Geometry>, map: AbstractArlasMapGL): void;\n\n  public abstract declareLabelSources(labelSourceId: string, data: FeatureCollection<GeoJSON.Geometry>, map: AbstractArlasMapGL): void;\n\n  public abstract declareBasemapSources(basemapSources: Array<ArlasMapSource<any>>, map: AbstractArlasMapGL): void;\n\n  public abstract setLayersMap(mapLayers: MapLayers<ArlasDataLayer>, layers?: Array<ArlasDataLayer>);\n\n  public updateLabelSources(labelSourceId: string, data: FeatureCollection<GeoJSON.Geometry>, map: AbstractArlasMapGL) {\n    if (labelSourceId) {\n      const source = this.mapFrameworkService.getSource(labelSourceId, map);\n      this.mapFrameworkService.setDataToGeojsonSource(source, data);\n    }\n  }\n\n  /**\n   * @description Inits a map of visulisation sets from the configuration.\n   * @param visualisationSetsConfig Visualisation set configuration.\n   */\n  public initVisualisationSet(visualisationSetsConfig: VisualisationSetConfig[]) {\n    if (visualisationSetsConfig) {\n      visualisationSetsConfig.forEach(visu => {\n        this.visualisationsSets.visualisations.set(visu.name, new Set(visu.layers));\n        this.visualisationsSets.status.set(visu.name, visu.enabled);\n      });\n    }\n  }\n\n  public initMapLayers(mapLayers: MapLayers<ArlasDataLayer>, map: AbstractArlasMapGL) {\n    if (mapLayers) {\n      this.setLayersMap(mapLayers);\n    }\n  }\n\n  public abstract moveArlasDataLayer(map: AbstractArlasMapGL, layer: any, layersMap: Map<string, ArlasDataLayer>, beforeId?: string);\n\n  /**\n   * Add a layer to the map instance. This method handles any specific treatment when adding ARLAS data.\n   * For instance, in mapbox and maplibre implementation, adding a fill layer needs to add systematically the stroke layer.\n   * @param map Map instance.\n   * @param layer A layer. It could be a layer identifier OR a layer object (it will depend on the framwork implementation).\n   * @param layersMap Map of ARLAS data layers and their ids (the ids being the key of the map).\n   * @param beforeId Identifier of an already added layer. The layers of layersMap are added under this 'beforeId' layer.\n   */\n  public abstract addArlasDataLayer(map: AbstractArlasMapGL, layer: ArlasDataLayer | string,\n    layersMap: Map<string, ArlasDataLayer>, beforeId?: string);\n\n  public addArlasDataLayers(visualisationSetsConfig: VisualisationSetConfig[], mapLayers: MapLayers<ArlasDataLayer>, map: AbstractArlasMapGL) {\n    this.initMapLayers(mapLayers, map);\n    this.initVisualisationSet(visualisationSetsConfig);\n    for (let i = visualisationSetsConfig.length - 1; i >= 0; i--) {\n      const visualisation: VisualisationSetConfig = visualisationSetsConfig[i];\n      if (visualisation.layers) {\n        for (let j = visualisation.layers.length - 1; j >= 0; j--) {\n          const l = visualisation.layers[j];\n          const layer = this.layersMap.get(l);\n          this.addArlasDataLayer(map, layer, this.layersMap);\n        }\n      }\n    }\n    this._addExternalEventLayers(mapLayers, map);\n    this.visualisationsSets.status.forEach((visible, vs) => {\n      this.visualisationsSets.visualisations.get(vs).forEach(l => {\n        this.mapFrameworkService.setLayerVisibility(l, visible, map);\n      });\n    });\n    this.reorderLayers(visualisationSetsConfig, map);\n  }\n\n  private _addExternalEventLayers(mapLayers: MapLayers<ArlasDataLayer>, map: AbstractArlasMapGL) {\n    if (mapLayers.externalEventLayers) {\n      mapLayers.layers\n        .filter(layer => mapLayers.externalEventLayers.map(e => e.id).includes(layer.id))\n        .forEach(l => {\n          this.mapFrameworkService.addLayer(map, l as L);\n        });\n    }\n  }\n\n\n  public reorderLayers(visualisationSetsConfig: VisualisationSetConfig[], map: AbstractArlasMapGL) {\n    // parses the visulisation list from bottom in order to put the fist ones first\n    for (let i = visualisationSetsConfig.length - 1; i >= 0; i--) {\n      const visualisation: VisualisationSetConfig = visualisationSetsConfig[i];\n      if (!!visualisation.layers && visualisation.enabled) {\n        for (let j = visualisation.layers.length - 1; j >= 0; j--) {\n          const l = visualisation.layers[j];\n          this.moveArlasDataLayer(map, l, this.layersMap);\n        }\n      }\n    }\n    this.reorderDrawLayers(map);\n\n  }\n\n  protected abstract reorderDrawLayers(map: AbstractArlasMapGL);\n\n\n  public abstract filterLayers(mapLayers: MapLayers<ArlasDataLayer>, map: AbstractArlasMapGL,\n    visibilityCondition: boolean, visibilityFilter: Array<any>, visibilityEvent: ExternalEvent,\n    collection?: string): void;\n\n  public selectFeatures(mapLayers: MapLayers<ArlasDataLayer>, map: AbstractArlasMapGL, elementToSelect: Array<ElementIdentifier>) {\n    if (elementToSelect) {\n      const ids = elementToSelect.length > 0 ?\n        elementToSelect.reduce((memo, element) => {\n          memo.push(element.idValue);\n          return memo;\n        }, []) : [];\n      const numericalIds = ids.filter(id => !Number.isNaN(+id)).map(id => +id);\n      const visibilityFilter = ids.length > 0 ? ['in', ['get', elementToSelect[0].idFieldName], ['literal', ids.concat(numericalIds)]] : [];\n      this.filterLayers(mapLayers, map, (elementToSelect.length > 0), visibilityFilter, ExternalEvent.select);\n    }\n  }\n\n  public highlightFeature(mapLayers: MapLayers<ArlasDataLayer>, map: AbstractArlasMapGL,\n    featureToHightLight: { isleaving: boolean; elementidentifier: ElementIdentifier; }) {\n    if (featureToHightLight?.elementidentifier) {\n      const ids: Array<number | string> = [featureToHightLight.elementidentifier.idValue];\n      if (!Number.isNaN(+featureToHightLight.elementidentifier.idValue)) {\n        ids.push(+featureToHightLight.elementidentifier.idValue);\n      }\n      const visibilityFilter = ['in', ['get', featureToHightLight.elementidentifier.idFieldName],\n        ['literal', ids]];\n      this.filterLayers(mapLayers, map, !featureToHightLight.isleaving, visibilityFilter, ExternalEvent.hover);\n    }\n  }\n\n  public selectFeaturesByCollection(mapLayers: MapLayers<ArlasDataLayer>, map: AbstractArlasMapGL,\n    features: Array<ElementIdentifier>, collection: string) {\n    const ids: Array<number | string> = features.map(f => f.idValue);\n    const numericalIds = ids.filter(id => !Number.isNaN(+id)).map(id => +id);\n    const visibilityFilter = ids.length > 0 ? ['in', ['get', features[0].idFieldName], ['literal', ids.concat(numericalIds)]] : [];\n    this.filterLayers(mapLayers, map, (features.length > 0), visibilityFilter, ExternalEvent.select, collection);\n  }\n\n\n  public updateLayoutVisibility(visualisationName: string, visualisationSetsConfig: VisualisationSetConfig[], map: AbstractArlasMapGL) {\n    const visuStatus = !this.visualisationsSets.status.get(visualisationName);\n    visualisationSetsConfig.find(v => v.name === visualisationName).enabled = visuStatus;\n    if (!visuStatus) {\n      const layersSet = new Set(this.visualisationsSets.visualisations.get(visualisationName));\n      this.visualisationsSets.visualisations.forEach((ls, v) => {\n        if (v !== visualisationName) {\n          ls.forEach(ll => {\n            if (layersSet?.has(ll)) {\n              layersSet.delete(ll);\n            }\n          });\n        }\n      });\n      layersSet.forEach(ll => {\n        this.mapFrameworkService.setLayerVisibility(ll, false, map);\n      });\n    }\n    this.visualisationsSets.status.set(visualisationName, visuStatus);\n    const layers = new Set<string>();\n    this.visualisationsSets.visualisations.forEach((ls, v) => {\n      if (this.visualisationsSets.status.get(v)) {\n        ls.forEach(l => {\n          layers.add(l);\n          this.mapFrameworkService.setLayerVisibility(l, true, map);\n        });\n      }\n    });\n    return layers;\n  }\n\n  public updateVisibility(visibilityStatus: Map<string, boolean>, visualisationSetsConfig: VisualisationSetConfig[], map: AbstractArlasMapGL) {\n    visibilityStatus.forEach((visibilityStatus, l) => {\n      let layerInVisualisations = false;\n      if (visibilityStatus) {\n        let oneVisualisationEnabled = false;\n        visualisationSetsConfig.forEach(v => {\n          const ls = new Set(v.layers);\n          if (!layerInVisualisations) {\n            layerInVisualisations = ls.has(l);\n          }\n          if (ls.has(l) && v.enabled) {\n            oneVisualisationEnabled = true;\n            this.mapFrameworkService.setLayerVisibility(l, true, map);\n          }\n        });\n        if (!oneVisualisationEnabled && layerInVisualisations) {\n          this.mapFrameworkService.setLayerVisibility(l, false, map);\n        }\n      } else {\n        visualisationSetsConfig.forEach(v => {\n          const ls = new Set(v.layers);\n          if (!layerInVisualisations) {\n            layerInVisualisations = ls.has(l);\n          }\n        });\n        if (layerInVisualisations) {\n          this.mapFrameworkService.setLayerVisibility(l, false, map);\n        }\n      }\n    });\n  }\n\n\n  public findVisualisationSetLayer(visuName: string, visualisationSetsConfig: VisualisationSetConfig[]) {\n    return visualisationSetsConfig.find(v => v.name === visuName).layers;\n  }\n  public setVisualisationSetLayers(visuName: string, layers: string[], visualisationSetsConfig: VisualisationSetConfig[]) {\n    const f = visualisationSetsConfig.find(v => v.name === visuName);\n    if (f) {\n      f.layers = layers;\n    }\n  }\n\n  public abstract updateMapStyle(map: AbstractArlasMapGL, l: any, ids: Array<string | number>, sourceName: string): void;\n\n  public abstract getVisibleIdsFilter(map: AbstractArlasMapGL, layer: any, ids: Array<string | number>);\n\n  /**\n   * Applies an opacity style to map layers based on a specified range of field values.\n   * This method iterates over all layers whose source IDs start with the given sourceIdPrefix\n   * and adjusts the opacity of features within those layers. Features with field values\n   * within the specified range (between start and end values) will have the insideOpacity\n   * applied, while features with values outside this range will have the outsideOpacity applied.\n   *\n   * @param {AbstractArlasMapGL} map - The map instance on which the opacity style will be applied.\n   * @param {string} sourceIdPrefix - The prefix used to identify source IDs of the layers to which the opacity style will be applied.\n   * @param {string} field - The name of the field on which the range filter is applied.\n   * @param {number} start - The start value of the range filter.\n   * @param {number} end - The end value of the range filter.\n   * @param {number} insideOpacity - The opacity value to apply to features with field values within the specified range.\n   * @param {number} outsideOpacity - The opacity value to apply to features with field values outside the specified range.\n   */\n  public abstract adjustOpacityByRange(map: AbstractArlasMapGL, sourceIdPrefix: string, field: string,\n    start: number, end: number, insideOpacity: number, outsideOpacity: number): void;\n\n  /**\n   * Resets the initial configured opacity style of the map layers whose source IDs start with the given sourceIdPrefix.\n   *\n   * @param {AbstractArlasMapGL} map - The map instance on which the opacity style will be applied.\n   * @param {string} sourceIdPrefix - The prefix used to identify source IDs of the layers to which the opacity style will be applied.\n   */\n  public abstract resetOpacity(map: AbstractArlasMapGL, sourceIdPrefix: string): void;\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { HttpClient } from '@angular/common/http';\nimport { inject, Injectable } from '@angular/core';\nimport { Observable, Subject } from 'rxjs';\nimport { ArlasMapFrameworkService } from '../arlas-map-framework.service';\nimport { AbstractArlasMapGL } from '../map/AbstractArlasMapGL';\nimport { BasemapStyle } from './basemap.config';\nimport { ArlasBasemaps } from './basemaps.model';\n\n@Injectable({\n  providedIn: 'root'\n})\n/** L: a layer class/interface.\n *  S: a source class/interface.\n *  M: a Map configuration class/interface.\n */\nexport abstract class BasemapService<L, S, M> {\n\n  protected POWERED_BY_ARLAS = ' Powered by ARLAS.';\n  protected LOCAL_STORAGE_BASEMAPS = 'arlas_last_base_map';\n\n\n  protected basemapChangedSource: Subject<void> = new Subject();\n  public basemapChanged$ = this.basemapChangedSource.asObservable();\n  public basemaps: ArlasBasemaps;\n\n  protected protomapBasemapAddedSource = new Subject<boolean>();\n  public protomapBasemapAdded$ = this.protomapBasemapAddedSource.asObservable();\n\n  protected readonly mapFrameworkService = inject(ArlasMapFrameworkService<L, S, M>);\n  protected readonly http = inject(HttpClient);\n\n  public setBasemaps(basemaps: ArlasBasemaps) {\n    this.basemaps = basemaps;\n  }\n\n  public abstract addProtomapBasemap(map: AbstractArlasMapGL);\n\n  protected addPMtilesToSource(map: AbstractArlasMapGL, pmtilesSource: any) {\n    /* eslint-disable max-len */\n    pmtilesSource['attribution'] = '<a href=\"https://protomaps.com/\" target=\"_blank\">Protomaps</a> <a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">&copy; OpenStreetMap</a>';\n    pmtilesSource['attribution'] = pmtilesSource['attribution'] + this.POWERED_BY_ARLAS;\n    this.mapFrameworkService.setSource('arlas_protomaps_source', pmtilesSource, map);\n  }\n\n  protected addProtomapLayerToMap(map: AbstractArlasMapGL, styleFile: any) {\n    styleFile.layers.forEach(l => {\n      this.mapFrameworkService.removeLayer(map, l.id);\n      this.mapFrameworkService.addLayer(map, l);\n    });\n  }\n\n  public notifyProtomapAddition() {\n    this.protomapBasemapAddedSource.next(true);\n  }\n\n  public abstract removeProtomapBasemap(map: AbstractArlasMapGL);\n\n  public abstract declareProtomapProtocol(map: AbstractArlasMapGL): void;\n  public cloneStyleFile<T>(selected: any) {\n    return { ...selected.styleFile as T};\n  }\n\n  public buildInitStyle<StyleType, LayerSpec>(clonedStyleFile: StyleType) {\n    (<any>clonedStyleFile).sources = {\n      protomaps_attribution: {\n        'type': 'vector',\n        // eslint-disable-next-line max-len\n        'attribution': '<a href=\"https://protomaps.com/\" target=\"_blank\">Protomaps</a> <a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">&copy; OpenStreetMap</a>' + this.POWERED_BY_ARLAS\n      }\n    };\n    (<any>clonedStyleFile).layers = [{\n      id: 'backgrounds',\n      type: 'background',\n      source: 'protomaps_attribution',\n      paint: {\n        'background-color': 'rgba(0,0,0,0)'\n      }\n    } as unknown as LayerSpec];\n    return clonedStyleFile;\n  };\n  public abstract getInitStyle(selected: BasemapStyle): any;\n  public abstract fetchSources$(): Observable<readonly any[]>;\n  protected abstract getStyleFile(b: BasemapStyle): Observable<any>;\n  public abstract setBasemap(s: any, newBasemap: BasemapStyle, map: AbstractArlasMapGL, options?: any);\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { BasemapStyle } from './basemap.config';\n\nexport class ArlasBasemaps {\n  private LOCAL_STORAGE_BASEMAPS = 'arlas_last_base_map';\n  public _selectedStyle: BasemapStyle;\n  public _styles: BasemapStyle[];\n  private defaultBasemapStyle: BasemapStyle;\n  private basemapStyles?: BasemapStyle[];\n\n  public constructor(defaultBasemapStyle?: BasemapStyle, basemapStyles?: BasemapStyle[]) {\n    if (defaultBasemapStyle && basemapStyles) {\n      this.defaultBasemapStyle = defaultBasemapStyle;\n      this.basemapStyles = basemapStyles;\n    } else {\n      // todo throw error ?\n    }\n  }\n\n  public styles(): BasemapStyle[] {\n    if (!this._styles) {\n      this._styles = this.getAllBasemapStyles(this.defaultBasemapStyle, this.basemapStyles);\n    }\n    return this._styles.filter(b => !b.errored);\n  }\n\n  public setSelected(style: BasemapStyle) {\n    this._selectedStyle = style;\n    return this;\n  }\n\n  public getStyle(b: BasemapStyle) {\n    return this.styles().find(s => s.name === b?.name);\n  }\n\n  public getSelected(): BasemapStyle {\n    if (!this._selectedStyle) {\n      const styles = this.styles();\n      const localStorageBasemapStyle: BasemapStyle = JSON.parse(localStorage.getItem(this.LOCAL_STORAGE_BASEMAPS));\n      const sameNameBasemaps = localStorageBasemapStyle ? styles.filter(b => b.name === localStorageBasemapStyle.name) : [];\n      if (sameNameBasemaps.length > 0) {\n        this._selectedStyle = sameNameBasemaps[0];\n      } else if (!!this.getStyle(this.defaultBasemapStyle)) {\n        this._selectedStyle = this.getStyle(this.defaultBasemapStyle);\n      } else if (styles && styles.length > 0) {\n        this._selectedStyle = styles[0];\n      } else {\n        this._selectedStyle = {\n          name: 'Background',\n          styleFile: {\n            version: 8,\n            sources: {},\n            layers: [\n              {\n                id: 'backgrounds',\n                type: 'background',\n                paint: {\n                  'background-color': 'rgba(0,0,0,0)'\n                }\n              }\n            ]\n          }\n        };\n      }\n    }\n    return this._selectedStyle;\n  }\n\n\n  private getAllBasemapStyles(defaultBasemapTheme: BasemapStyle, basemapStyles: BasemapStyle[]): Array<BasemapStyle> {\n    const allBasemapStyles = new Array<BasemapStyle>();\n    if (basemapStyles) {\n      basemapStyles.forEach(b => allBasemapStyles.push(b));\n      if (defaultBasemapTheme) {\n        if (basemapStyles.map(b => b.name).filter(n => n === defaultBasemapTheme.name).length === 0) {\n          allBasemapStyles.push(defaultBasemapTheme);\n        }\n      }\n    } else if (defaultBasemapTheme) {\n      allBasemapStyles.push(defaultBasemapTheme);\n    }\n    return allBasemapStyles;\n  }\n}\n\n\n\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { fromEvent, map, Observable, Subscription } from 'rxjs';\nimport { debounceTime } from 'rxjs/operators';\nimport { ControlPosition, ControlsOption, DrawControlsOption } from './model/controls';\nimport { MapExtent } from './model/extent';\nimport { ArlasLngLat, ArlasLngLatBounds, OnMoveResult } from './model/map';\nimport { marker } from '@colsen1991/ngx-translate-extract-marker';\nimport bbox from '@turf/bbox';\n\n\n/** Conf */\nexport interface MapConfig<T> {\n  displayCurrentCoordinates: boolean;\n  fitBoundsPadding: number;\n  margePanForLoad: number;\n  margePanForTest: number;\n  wrapLatLng: boolean;\n  offset: ArlasMapOffset;\n  mapProviderOptions?: T;\n  maxWidthScale?: number;\n  unitScale?: string;\n  controls?: ControlsOption;\n}\n\nexport interface ArlasMapOption {\n  container: string;\n  style: any;\n  center: [number, number];\n  zoom: number;\n  maxZoom: number;\n  minZoom: number;\n  renderWorldCopies: boolean;\n  preserveDrawingBuffer: boolean;\n  locale: {\n    'NavigationControl.ZoomIn'?: string;\n    'NavigationControl.ZoomOut'?: string;\n    'NavigationControl.ResetBearing'?: string;\n    'GlobeControl.Enable'?: string;\n    'GlobeControl.Disable'?: string;\n  };\n  pitchWithRotate: boolean;\n  transformRequest: unknown;\n  attributionControl: boolean;\n}\n\nexport interface ArlasMapOffset {\n  north: number;\n  east: number;\n  south: number;\n  west: number;\n}\n\nexport const GEOJSON_SOURCE_TYPE = 'geojson';\n\nexport const CROSS_LAYER_PREFIX = 'arlas_cross';\nexport const ZOOM_IN = marker('Zoom in');\nexport const ZOOM_OUT = marker('Zoom out');\nexport const RESET_BEARING = marker('Reset bearing to north');\nexport const LAYER_SWITCHER_TOOLTIP = marker('Manage layers');\nexport const OPACITY_SUFFIX = '-opacity';\nexport const ENABLE_GLOBE = marker('Enable globe');\nexport const DISABLE_GLOBE = marker('Disable globe');\n/**\n * The aim of this class is to handle all core interaction we have\n * with a map provider.\n * The aim is also to separate the Arlas map from the Angular framework.\n * It will be instantiated in the map.component and will be responsible for initializing the map and all map behavior.\n */\nexport abstract class AbstractArlasMapGL {\n  /**\n   *  props and methods with unknown type will be specific to the map provider\n   *  we use.\n   *  ex: endLngLat will have a type Maplibre.Pointlike/ Mapbox.Point\n   */\n\n  public abstract startLngLat: ArlasLngLat;\n  public abstract endLngLat: ArlasLngLat;\n  public abstract moveLngLat: ArlasLngLat;\n  protected _offset: ArlasMapOffset;\n  protected _margePanForLoad: number;\n  protected _margePanForTest: number;\n  protected _fitBoundsPadding: number;\n  protected _displayCurrentCoordinates: boolean;\n  protected _wrapLatLng: boolean;\n  protected _controls: ControlsOption;\n  protected _maxWidthScale?: number;\n  protected _unitScale?: string;\n  public currentLat: string;\n  public currentLng: string;\n  public readonly POLYGON_LABEL_SOURCE = 'polygon_label';\n\n  protected _north: number;\n  protected _east: number;\n  protected _west: number;\n  protected _south: number;\n  public zoom: number;\n  protected _zoomStart: number;\n\n  protected _dragStartX: number;\n  protected _dragStartY: number;\n\n  protected _dragEndX: number;\n  protected _dragEndY: number;\n\n  protected _xMoveRatio: number;\n  protected _yMoveRatio: number;\n\n  protected _moveEnd$: Observable<any>;\n  protected _zoomStart$: Observable<any>;\n  protected _dragStart$: Observable<any>;\n  protected _dragEnd$: Observable<any>;\n\n  protected _eventSubscription: Subscription[] = [];\n\n  protected evented = new EventTarget();\n\n  protected constructor(protected config: MapConfig<any>) {\n    this.config = config;\n    this._offset = config.offset;\n    this._margePanForLoad = config.margePanForLoad;\n    this._margePanForTest = config.margePanForTest;\n    this._displayCurrentCoordinates = config.displayCurrentCoordinates ?? false;\n    this._wrapLatLng = config.wrapLatLng ?? true;\n    this._controls = config.controls;\n    this._fitBoundsPadding = config.fitBoundsPadding ?? 10;\n    this._maxWidthScale = config.maxWidthScale;\n    this._unitScale = config.unitScale;\n    this.init(config);\n  }\n\n  protected init(config: MapConfig<any>): void {\n    try {\n      this._initMapProvider(config);\n      this._initControls();\n      this._initOnLoad();\n      this._initMapMoveEvents();\n    } catch (e) {\n      console.log(e);\n    }\n  }\n\n  protected _initOnLoad() {\n    this.onLoad(() => {\n      this.evented.dispatchEvent(new Event('beforeOnLoadInit'));\n      this._updateBounds();\n      this._updateZoom();\n      this.getMapProvider().fitBounds(this.getBounds());\n    });\n  }\n\n  public onCustomEvent(event: string, loadFn: () => void) {\n    this.evented.addEventListener(event, loadFn);\n  }\n\n  protected _initMapMoveEvents() {\n    this._zoomStart$ = fromEvent(this.getMapProvider(), 'zoomstart')\n      .pipe(debounceTime(750));\n\n    this._dragStart$ = fromEvent(this.getMapProvider(), 'dragstart')\n      .pipe(debounceTime(750));\n\n    this._dragEnd$ = fromEvent(this.getMapProvider(), 'dragend')\n      .pipe(debounceTime(750));\n\n    this._moveEnd$ = fromEvent(this.getMapProvider(), 'moveend')\n      .pipe(debounceTime(750));\n\n    this._updateOnZoomStart();\n    this._updateOnDragStart();\n    this._updateOnDragEnd();\n    this._updateOnMoveEnd();\n  }\n\n  protected _updateBounds(): void {\n    this._west = this.getWestBounds();\n    this._south = this.getSouthBounds();\n    this._east = this.getEastBounds();\n    this._north = this.getNorthBounds();\n  }\n\n  protected _updateZoom(e?: any): void {\n    this.zoom = this.getZoom();\n  }\n\n  protected _updateCurrentLngLat(e: any): void {\n    const lngLat = e.lngLat;\n    if (this._displayCurrentCoordinates) {\n      const displayedLngLat = this._wrapLatLng ? lngLat.wrap() : lngLat;\n      this.currentLng = String(Math.round(displayedLngLat.lng * 100000) / 100000);\n      this.currentLat = String(Math.round(displayedLngLat.lat * 100000) / 100000);\n    }\n  }\n\n  protected _updateDragEnd(e: any): void {\n    if (e.originalEvent) {\n      this._dragEndX = e.originalEvent.clientX;\n      this._dragEndY = e.originalEvent.clientY;\n    }\n  }\n\n  protected _updateDragStart(e: any): void {\n    this._dragStartX = e.originalEvent.clientX;\n    this._dragStartY = e.originalEvent.clientY;\n  }\n\n  protected _updateEndLngLat(e: any): void {\n    this.endLngLat = e.lngLat;\n  }\n\n  protected _updateMoveRatio(e: any): void {\n    this._xMoveRatio = Math.abs(this._dragEndX - this._dragStartX) / e.target._canvas.clientWidth;\n    this._yMoveRatio = Math.abs(this._dragEndY - this._dragStartY) / e.target._canvas.clientHeight;\n  }\n\n  protected _updateStartLngLat(e: any): void {\n    this.startLngLat = e.lngLat;\n  }\n\n\n  protected _updateZoomStart(): void {\n    this._zoomStart = this.getZoom();\n  }\n\n  protected _updateOnZoomStart() {\n    const sub = this._zoomStart$.subscribe(_ => this._updateZoomStart());\n    this._eventSubscription.push(sub);\n  }\n\n  protected _updateOnDragStart() {\n    const sub = this._dragStart$.subscribe(e => this._updateDragStart(e));\n    this._eventSubscription.push(sub);\n  }\n\n  protected _updateOnDragEnd() {\n    const sub = this._dragEnd$\n      .subscribe(e => {\n        this._updateDragEnd(e);\n        this._updateMoveRatio(e);\n      });\n    this._eventSubscription.push(sub);\n  }\n\n  protected _updateOnMoveEnd() {\n    const sub = this._moveEnd$\n      .subscribe(_ => {\n        this._updateBounds();\n        this._updateZoom();\n      });\n    this._eventSubscription.push(sub);\n  }\n\n  public onMoveEnd(visualisationsSets: {\n    visualisations: Map<string, Set<string>>;\n    status: Map<string, boolean>;\n  }, cb?: () => void) {\n    return this._moveEnd$\n      .pipe(map(_ => {\n        this._updateBounds();\n        this._updateZoom();\n        if (cb) {\n          cb();\n        }\n        return this._getMoveEnd(visualisationsSets);\n      }));\n  }\n\n  public setLayoutProperty(layer: string, name: string, value: any, options?: any) {\n    this.getMapProvider().setLayoutProperty(layer, name, value, options);\n    return this;\n  }\n\n  public unsubscribeEvents() {\n    this._eventSubscription.forEach(s => s.unsubscribe());\n  }\n\n  public getMaxZoom(): number {\n    return this.getMapProvider().getMaxZoom();\n  }\n\n  public getMinZoom(): number {\n    return this.getMapProvider().getMinZoom();\n  }\n\n  public getPitch(): number {\n    return this.getMapProvider().getPitch();\n  }\n\n  protected abstract _initMapProvider(BaseMapGlConfig): void;\n  protected abstract _initControls(): void;\n  protected abstract _getMoveEnd(visualisationsSets: {\n    visualisations: Map<string, Set<string>>;\n    status: Map<string, boolean>;\n  }): OnMoveResult;\n\n  public abstract addControl(control: any, position?: ControlPosition, eventOverride?: {\n    event: string; fn: (e?) => void;\n  });\n  public abstract calcOffsetPoint(): any;\n  public abstract disableDragPan(): void;\n  public abstract enableDragPan(): void;\n  public abstract fitBounds(bounds: ArlasLngLatBounds | number[], options?: unknown, unknown?: unknown): this;\n  public abstract fitToPaddedBounds(bounds: ArlasLngLatBounds | number[]);\n  public abstract getBounds(): unknown;\n  public abstract getCanvasContainer(): HTMLElement;\n  public abstract getEastBounds(): number;\n  public abstract getMapExtend(): MapExtent;\n  public abstract getMapProvider(): any;\n  public abstract getMaxBounds(): unknown;\n  public abstract getNorthBounds(): number;\n  public abstract getNorthEastBounds(): ArlasLngLat;\n  public abstract getSouthBounds(): number;\n  public abstract getSouthWestBounds(): ArlasLngLat;\n  public abstract getWestBounds(): number;\n  public abstract getZoom(): number;\n  public abstract initDrawControls(config: DrawControlsOption): void;\n  public abstract on(type: string, listener: (ev: any) => void): this;\n  public abstract onLoad(fn: () => void): void;\n  public abstract onIdle(fn: () => void): void;\n  public abstract queryRenderedFeatures(pointOrBox?: unknown, options?: { layers?: string[]; filter?: any[]; }): any[];\n  public abstract resize(eventData?: unknown): this;\n  public abstract setCenter(center: unknown, unknown?: unknown): this;\n  public abstract setMaxBounds(unknown?: unknown): this;\n  public abstract setFilter(layer: string, filter?: boolean | any[], options?: unknown): this;\n  public abstract paddedBounds(npad: number, spad: number, epad: number,\n    wpad: number, map: any, SW: ArlasLngLat, NE: ArlasLngLat): ArlasLngLat[];\n  public abstract setLayerOpacity(layerId: string, layerType: string, opacityValue: any): this;\n  /**\n   * Returns the corresponding keyword for paint style based on the layer type\n   * @param layerType Type of the layer\n   */\n  public abstract layerTypeToPaintKeyword(layerType: string): string;\n\n  /** Gets bounds of the given geometry */\n  public geometryToBounds(geometry: any, paddingPercentage?: number): ArlasLngLatBounds {\n    const boundingBox: any = bbox(geometry);\n    let west = boundingBox[0];\n    let south = boundingBox[1];\n    let east = boundingBox[2];\n    let north = boundingBox[3];\n    if (paddingPercentage !== undefined) {\n      let width = east - west;\n      let height = north - south;\n      /** if there is one hit, then west=east ===> we consider a width of 0.05°*/\n      if (width === 0) {\n        width = 0.05;\n      }\n      /** if there is one hit, then north=south ===> we consider a height of 0.05°*/\n      if (height === 0) {\n        height = 0.05;\n      }\n      west = west - paddingPercentage * width;\n      south = Math.max(-90, south - paddingPercentage * height);\n      east = east + paddingPercentage * width;\n      north = Math.min(90, north + paddingPercentage * height);\n    }\n    const bounds = new ArlasLngLatBounds(\n      new ArlasLngLat(west, south),\n      new ArlasLngLat(east, north)\n    );\n    return bounds;\n  }\n\n}\n\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\nexport function latLngToWKT(features): string {\n  let wktType = 'POLYGON[###]';\n  if (features.length > 1) {\n    wktType = 'MULTIPOLYGON([###])';\n  }\n\n  let polygons = '';\n  features.forEach((feat, indexFeature) => {\n    if (feat) {\n      const currentFeat: Array<any> = feat.geometry.coordinates;\n      polygons += (indexFeature === 0 ? '' : ',') + '((';\n      currentFeat[0].forEach((coord, index) => {\n        polygons += (index === 0 ? '' : ',') + coord[0] + ' ' + coord[1];\n      });\n      polygons += '))';\n    }\n  });\n\n  let wkt = '';\n  if (polygons !== '') {\n    wkt = wktType.replace('[###]', polygons);\n  }\n  return wkt;\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { Injectable } from '@angular/core';\nimport { marker } from '@colsen1991/ngx-translate-extract-marker';\nimport area from '@turf/area';\nimport bbox from '@turf/bbox';\nimport { Feature, FeatureCollection, lineString } from '@turf/helpers';\nimport length from '@turf/length';\nimport { Subject } from 'rxjs';\nimport { AbstractDraw } from './AbstractDraw';\nimport { AoiDimensions, BboxDrawCommand, Corner } from './draw.models';\n\n@Injectable()\nexport class MapboxAoiDrawService {\n  private mapDraw: AbstractDraw;\n  private editionId: string;\n  private registeringMode: boolean;\n  private ids: Set<string> = new Set();\n\n  private editAoiSource = new Subject<AoiDimensions>();\n  public editAoi$ = this.editAoiSource.asObservable();\n\n  private drawBboxSource = new Subject<BboxDrawCommand>();\n  public drawBbox$ = this.drawBboxSource.asObservable();\n\n  /** Set to true when the user is drawing a bbox. */\n  public isDrawingBbox = false;\n  /** Set to true when the user is drawing a circle. */\n  public isDrawingCircle = false;\n  /** Set to true when the user is drawing a strip. */\n  public isDrawingStrip = false;\n  /** Set to true when the user is drawing a polygon. */\n  public isDrawingPolygon = false;\n  /** Set to true when the user is in simple draw mode. */\n  public isInSimpleDrawMode = false;\n  /** Set to true when the drawn geometry is selected. */\n  public isDrawSelected = false;\n  public isReady = false;\n\n  public constructor() { }\n\n  public isDrawing() {\n    return this.isDrawingBbox || this.isDrawingCircle || this.isDrawingPolygon || this.isDrawingStrip;\n  }\n\n  public drawBbox(fCorner: Corner, sCorner: Corner) {\n    const west = Math.min(fCorner.lng, sCorner.lng);\n    const east = Math.max(fCorner.lng, sCorner.lng);\n    const south = Math.min(fCorner.lat, sCorner.lat);\n    const north = Math.max(fCorner.lat, sCorner.lat);\n    this.drawBboxSource.next({\n      west,\n      east,\n      south,\n      north\n    });\n  }\n\n  public setDraw(mapboxDraw: AbstractDraw) {\n    this.mapDraw = mapboxDraw;\n    this.isReady = true;\n    this.onSelectionChange();\n    this.onRender();\n    this.onDelete();\n    this.onStop();\n  }\n\n  /**\n   * Add new features to the mapboxdraw object.\n   * @param fc Featurecollection to be added to mapboxdraw object.\n   * @param deleteOld if true, the mapboxdraw object is purged first, before adding the new given feature collection.\n   */\n  public addFeatures(fc: FeatureCollection<GeoJSON.Geometry>, deleteOld = false) {\n    if (deleteOld) {\n      this.mapDraw.deleteAll();\n    }\n    this.registeringMode = true;\n    this.mapDraw.add(fc);\n  }\n\n  /** Deletes all the features from Mapboxdraw object */\n  public deleteAll() {\n    this.registeringMode = true;\n    this.mapDraw.deleteAll();\n  }\n\n  /** Deletes all the features from Mapboxdraw object that have not been saved */\n  public deleteUnregisteredFeatures() {\n    this.mapDraw.delete(this.getUnregistredFeatures().map(f => f.id.toString()));\n  }\n\n  /** Returns the area of the given feature */\n  public calculateArea(feature: Feature): number {\n    if (this.isArea(feature)) {\n      return area(feature);\n    }\n    return 0;\n  }\n\n  /** Returns the width x height of the given feature's envelope */\n  public calculateEnvelopeDimension(feature: Feature): [number, number] {\n    if (this.isLine(feature)) {\n      const [minX, minY, maxX, maxY] = bbox(feature);\n      const verticalLine = lineString([[minX, minY], [minX, maxY]]);\n      const horizontalLine = lineString([[minX, minY], [maxX, minY]]);\n      return [length(horizontalLine), length(verticalLine)];\n    }\n    return [0, 0];\n  }\n\n  /** on selection of a drawn polygon, we get its corresponding id. */\n  private onSelectionChange() {\n    this.mapDraw.on('draw.selectionchange', (e) => {\n      const features = e.features;\n      if (this.hasFeatures(features)) {\n        this.editionId = features[0].id;\n      } else {\n        this.endDimensionsEmission();\n      }\n    });\n  }\n\n  private hasFeatures(features: any[]) {\n    return !!features && features.length > 0;\n  }\n\n  /** Triggered on deletion of feature(s).\n   * - Removes the deleted feature(s) from this service's register.\n   * - Stops emitting Aoi dimension info.\n   * */\n  private onDelete() {\n    this.mapDraw.on('draw.delete', (e) => {\n      e.features.forEach(f => this.unregister(f.id));\n      this.endDimensionsEmission();\n    });\n  }\n\n\n  private onStop() {\n    this.mapDraw.on('draw.onStop', (e) => {\n      this.register(this.editionId);\n      this.endDimensionsEmission();\n    });\n  }\n\n  /**\n   * This event is triggered :\n   * - after draw.update\n   * - after draw.delete\n   * - on adding/deleting features from mapboxdraw object.\n   */\n  private onRender() {\n    this.mapDraw.on('draw.render', (e) => {\n      if (this.mapDraw) {\n        this.registerAll();\n        const unregisteredFeatures = this.getUnregistredFeatures();\n        if (unregisteredFeatures && (unregisteredFeatures.length === 1 || unregisteredFeatures.length === 2)) {\n          const index = unregisteredFeatures.length - 1;\n          this.editionId = unregisteredFeatures[index].id + '';\n        }\n        if (this.editionId) {\n          const feature = this.getFeature(this.editionId, this.mapDraw);\n          this.emitDimensions(feature);\n        }\n      }\n    });\n  }\n\n  public emitStartBBox() {\n    this.editAoiSource.next({\n      area: 0,\n      areaMessage: marker('Start draging to draw a bbox.'),\n      envelope: {\n        width: 0,\n        height: 0\n      },\n      show: true\n    });\n  }\n\n  /** Emits dimension info of the given feature.*/\n  public emitDimensions(feature: Feature) {\n    const a = this.calculateArea(feature);\n    const wh = this.calculateEnvelopeDimension(feature);\n    this.editAoiSource.next({\n      area: a,\n      areaMessage: a > 0 ? '' : marker('Draw at least 2 points.'),\n      envelope: {\n        width: wh[0],\n        height: wh[1]\n      },\n      show: true\n    });\n  }\n\n  /** Stops emitting Aoi dimension info */\n  public endDimensionsEmission() {\n    this.editionId = undefined;\n    this.editAoiSource.next({\n      area: 0,\n      envelope: {\n        width: 0,\n        height: 0\n      },\n      show: false\n    });\n  }\n\n  /** Mapbox lacks a method to get the identifier of a new feature that is being drawn and not yet created\n   * this method detects this feature on 'draw.render' event.\n  */\n  private getUnregistredFeatures(): Feature[] {\n    return (this.mapDraw.getAllFeatures() as Feature[]).filter(f => !this.ids.has(f.id.toString()));\n  }\n\n  /** registers the identifiers of each drawn polygon in this service. */\n  private registerAll() {\n    if (this.registeringMode) {\n      this.ids.clear();\n      const fc = this.mapDraw.getAll();\n      if (!!fc && !!fc.features) {\n        this.ids = new Set(fc.features.map(f => f.id.toString()));\n      }\n      this.registeringMode = false;\n    }\n  }\n\n  /** Unregisters the given feature id in this service. */\n  private unregister(id: string) {\n    this.ids.delete(id);\n  }\n\n  /** Registers the given feature id in this service. */\n  private register(id: string) {\n    this.ids.add(id);\n  }\n\n  /** Gets the given feature from MapboxDraw object. */\n  private getFeature(featureId: string, mapDraw: AbstractDraw): Feature {\n    return mapDraw.get(featureId) as Feature;\n  }\n\n  /** Checks if the given feature has enough coordinates to represent an area (polygon) */\n  private isArea(feature) {\n    const isGeometryDefined = !!feature && !!feature.geometry;\n    const areCoordinatesDefined = isGeometryDefined && !!feature.geometry.coordinates;\n    if (areCoordinatesDefined) {\n      const coordinates = feature.geometry.coordinates;\n      const isArea = coordinates.length === 1 && coordinates[0].length > 3;\n      return isArea;\n    }\n    return false;\n  }\n\n  /** Checks if the given feature has enough coordinates to represent a line */\n  private isLine(feature) {\n    const isGeometryDefined = !!feature && !!feature.geometry;\n    const areCoordinatesDefined = isGeometryDefined && !!feature.geometry.coordinates;\n    if (areCoordinatesDefined) {\n      const coordinates = feature.geometry.coordinates;\n      const isLine = coordinates.length === 1 && coordinates[0].length > 1;\n      return isLine;\n    }\n    return false;\n  }\n\n  /**\n   * Chck if its a valid circle\n   * @param feature\n   */\n  public isValidCircle(feature): boolean {\n    const coordinates = feature.geometry.coordinates;\n    return this.isCircle(feature) && coordinates && coordinates[0] !== null && coordinates[0][0] !== null && feature.properties.center;\n  }\n\n  public isValidPolygon(feature): boolean {\n    const coordinates = feature.geometry.coordinates;\n    return this.isPolygon(feature) && coordinates && coordinates[0] !== null && coordinates[0][0] !== null;\n  }\n\n  public isPolygon(feature): boolean {\n    return feature.geometry.type === 'Polygon' && !this.isCircle(feature);\n  }\n\n  public isCircle(feature): boolean {\n    return feature.properties?.isCircle;\n  }\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport MapboxDraw from '@mapbox/mapbox-gl-draw';\nimport * as jsts from 'jsts/dist/jsts.min';\n\nexport const limitVertexDirectSelectMode = MapboxDraw.modes.direct_select;\nconst reader = new jsts.io.GeoJSONReader();\n\nlimitVertexDirectSelectMode.fireInvalidGeom = function (feature) {\n  this.map.fire('draw.invalidGeometry', {\n    action: 'error',\n    features: [feature]\n  });\n};\n\nlimitVertexDirectSelectMode.fireInitialFeature = function (feature) {\n  this.map.fire('draw.edit.saveInitialFeature', {\n    feature: feature\n  });\n};\n\nlimitVertexDirectSelectMode.toDisplayFeatures = function (state, geojson, push) {\n  if (state.featureId === geojson.properties.id) {\n    geojson.properties.active = MapboxDraw.constants.activeStates.ACTIVE;\n    push(geojson);\n    MapboxDraw.lib.createSupplementaryPoints(geojson, {\n      map: this.map,\n      midpoints: geojson.geometry.coordinates[0].length >= state.maxVertexByPolygon + 1 ? false : true,\n      selectedPaths: state.selectedCoordPaths\n    }).forEach(push);\n  } else {\n    geojson.properties.active = MapboxDraw.constants.activeStates.INACTIVE;\n    push(geojson);\n  }\n  this.fireActionable(state);\n};\n\nlimitVertexDirectSelectMode.onTouchEnd = limitVertexDirectSelectMode.onMouseUp = function (state) {\n  if (state.dragMoving) {\n    const featureCoords = [...state.feature.coordinates[0]];\n    if (\n      featureCoords[0][0] !== featureCoords[featureCoords.length - 1][0] ||\n      featureCoords[0][1] !== featureCoords[featureCoords.length - 1][1]\n    ) {\n      featureCoords.push(featureCoords[0]);\n    }\n    const currentFeature = {\n      'type': 'Feature',\n      'geometry': {\n        'type': 'Polygon',\n        'coordinates': [featureCoords]\n      }\n    };\n    const g = reader.read(currentFeature);\n    if (!g.geometry.isValid()) {\n      this.fireInvalidGeom(currentFeature);\n    } else {\n      this.fireUpdate();\n    }\n  }\n  this.stopDragging(state);\n};\n\n\nlimitVertexDirectSelectMode.onSetup = function (opts) {\n  const featureId = opts.featureId;\n  let maxVertexByPolygon = opts.maxVertexByPolygon;\n  const feature = this.getFeature(featureId);\n  this.fireInitialFeature(feature);\n  if (!feature) {\n    throw new Error('You must provide a featureId to enter direct_select mode');\n  }\n\n  if (!maxVertexByPolygon) {\n    maxVertexByPolygon = 100;\n  }\n\n  if (feature.type === MapboxDraw.constants.geojsonTypes.POINT) {\n    throw new TypeError('direct_select mode doesn\\'t handle point features');\n  }\n\n  const state = {\n    featureId,\n    feature,\n    dragMoveLocation: opts.startPos || null,\n    dragMoving: false,\n    canDragMove: false,\n    selectedCoordPaths: opts.coordPath ? [opts.coordPath] : [],\n    maxVertexByPolygon\n  };\n\n  this.setSelectedCoordinates(this.pathsToCoordinates(featureId, state.selectedCoordPaths));\n  this.setSelected(featureId);\n  MapboxDraw.lib.doubleClickZoom.disable(this);\n\n  this.setActionableState({\n    trash: true\n  });\n\n  return state;\n};\n\nexport default limitVertexDirectSelectMode;\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport MapboxDraw from '@mapbox/mapbox-gl-draw';\nimport * as jsts from 'jsts/dist/jsts.min';\n\nexport const validGeomDrawPolygonMode = MapboxDraw.modes.draw_polygon;\nconst reader = new jsts.io.GeoJSONReader();\n\nvalidGeomDrawPolygonMode.fireInvalidGeom = function (feature) {\n  this.map.fire('draw.invalidGeometry', {\n    action: 'error',\n    features: [feature]\n  });\n};\n\nvalidGeomDrawPolygonMode.fireOnClick = function () {\n  this.map.fire('draw.onClick', 'point drawn');\n};\n\nvalidGeomDrawPolygonMode.fireOnStop = function () {\n  this.map.fire('draw.onStop', 'draw end');\n};\n\nvalidGeomDrawPolygonMode.clickOnVertex = function (state) {\n  return this.changeMode(MapboxDraw.constants.modes.STATIC, {});\n};\n\nvalidGeomDrawPolygonMode.onTap = validGeomDrawPolygonMode.onClick = function (state, e) {\n  if (MapboxDraw.lib.CommonSelectors.isVertex(e)) {\n    return this.clickOnVertex(state, e);\n  } else {\n    this.fireOnClick();\n    return this.clickAnywhere(state, e);\n  }\n};\n\nvalidGeomDrawPolygonMode.onStop = function (state) {\n  this.fireOnStop();\n  this.updateUIClasses({ mouse: MapboxDraw.constants.cursors.NONE });\n  MapboxDraw.lib.doubleClickZoom.enable(this);\n  this.activateUIButton();\n\n  // check to see if we've deleted this feature\n  if (this.getFeature(state.polygon.id) === undefined) {\n    return;\n  }\n\n  // remove last added coordinate\n  state.polygon.removeCoordinate(`0.${state.currentVertexPosition}`);\n  if (state.polygon.isValid()) {\n\n    const featureCoords = [...state.polygon.coordinates[0]];\n    if (\n      featureCoords[0][0] !== featureCoords[featureCoords.length - 1][0] ||\n      featureCoords[0][1] !== featureCoords[featureCoords.length - 1][1]\n    ) {\n      featureCoords.push(featureCoords[0]);\n    }\n    const currentFeature = {\n      'type': 'Feature',\n      'geometry': {\n        'type': 'Polygon',\n        'coordinates': [featureCoords]\n      }\n    };\n    const g = reader.read(currentFeature);\n    if (!g.geometry.isValid()) {\n      this.fireInvalidGeom(state.polygon);\n      this.deleteFeature([state.polygon.id], { silent: true });\n    } else {\n      this.map.fire(MapboxDraw.constants.events.CREATE, {\n        features: [state.polygon.toGeoJSON()]\n      });\n    }\n  } else {\n    this.deleteFeature([state.polygon.id], { silent: true });\n    this.changeMode(MapboxDraw.constants.modes.STATIC, {}, { silent: true });\n  }\n};\n\nexport default validGeomDrawPolygonMode;\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport MapboxDraw from '@mapbox/mapbox-gl-draw';\nimport circle from '@turf/circle';\n\n\nexport const circleMode = { ...MapboxDraw.modes.draw_polygon };\nconst DEFAULT_RADIUS_IN_KM = 2;\n\ncircleMode.onSetup = function (opts) {\n    const polygon = this.newFeature({\n        type: MapboxDraw.constants.geojsonTypes.FEATURE,\n        properties: {\n            isFixedRadius: opts.isFixedRadius !== undefined ? opts.isFixedRadius : false,\n            isCircle: true,\n            center: opts.center !== undefined ? opts.center : []\n        },\n        geometry: {\n            type: MapboxDraw.constants.geojsonTypes.POLYGON,\n            coordinates: [[]]\n        }\n    });\n\n    this.addFeature(polygon);\n\n    this.clearSelectedFeatures();\n    MapboxDraw.lib.doubleClickZoom.disable(this);\n    this.updateUIClasses({ mouse: MapboxDraw.constants.cursors.ADD });\n    this.activateUIButton(MapboxDraw.constants.types.POLYGON);\n    this.setActionableState({\n        trash: true\n    });\n\n    return {\n        initialRadiusInKm: opts.initialRadiusInKm || DEFAULT_RADIUS_IN_KM,\n        steps: opts.steps || 64,\n        units: opts.units || 'kilometers',\n        polygon,\n        currentVertexPosition: 0\n    };\n};\n\n\ncircleMode.clickAnywhere = function (state, e) {\n    if (state.currentVertexPosition === 0) {\n        state.currentVertexPosition++;\n        const center = [e.lngLat.lng, e.lngLat.lat];\n        const options =  {steps: state.steps, units: state.units};\n        const circleFeature = circle(center, state.initialRadiusInKm, options);\n        state.polygon.incomingCoords(circleFeature.geometry.coordinates);\n        state.polygon.properties.center = center;\n        state.polygon.properties.radiusInKm = state.initialRadiusInKm;\n    }\n    return this.changeMode(MapboxDraw.constants.modes.SIMPLE_SELECT, { featureIds: [state.polygon.id] });\n};\n\nexport default circleMode;\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nexport function createDrawVertex(parentId, coordinates, path, selected) {\n  return {\n    type: 'Feature',\n    properties: {\n      meta: 'vertex',\n      parent: parentId,\n      coord_path: path,\n      active: selected ? 'true' : 'false',\n    },\n    geometry: {\n      type: 'Point',\n      coordinates,\n    },\n  };\n}\nexport function displayFeatures(state, geojson, display) {\n  const isActiveLine = geojson.properties.id === state.line.id;\n  geojson.properties.active = isActiveLine ? 'true' : 'false';\n  if (!isActiveLine) {\n    if (!geojson.geometry.coordinates[0][0]) {\n      return null;\n    }\n    return display(geojson);\n  }\n\n  // Only render the line if it has at least one real coordinate\n  if (geojson.geometry.coordinates.length < 2) {\n    return null;\n  }\n  geojson.properties.meta = 'feature';\n\n  // displays center vertex as a point feature\n  display(\n    createDrawVertex(\n      state.line.id,\n      geojson.geometry.coordinates[\n      state.direction === 'forward'\n        ? geojson.geometry.coordinates.length - 2\n        : 1\n      ],\n      `${state.direction === 'forward'\n        ? geojson.geometry.coordinates.length - 2\n        : 1\n      }`,\n      false\n    )\n  );\n\n  // displays the line as it is drawn\n  display(geojson);\n\n}\n\n\nexport function updateCoordinates(state, e) {\n  if (state.direction === 'forward') {\n    state.currentVertexPosition += 1; // eslint-disable-line\n    state.line.updateCoordinate(\n      state.currentVertexPosition,\n      e.lngLat.lng,\n      e.lngLat.lat\n    );\n  } else {\n    state.line.addCoordinate(0, e.lngLat.lng, e.lngLat.lat);\n  }\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport MapboxDraw from '@mapbox/mapbox-gl-draw';\nimport circle from '@turf/circle';\nimport length from '@turf/length';\nimport numeral from 'numeral';\nimport { displayFeatures, updateCoordinates } from '../utils';\n\nexport const radiusCircleMode = { ...MapboxDraw.modes.draw_line_string };\n\n\nradiusCircleMode.fireOnStop = function () {\n    this.map.fire('draw.onStop', 'draw end');\n};\n\n\nfunction getDisplayMeasurements(feature) {\n    // should log both metric and standard display strings for the current drawn feature\n\n    // metric calculation\n    const drawnLength = length(feature) * 1000; // meters\n\n    let metricUnits = 'm';\n    let metricFormat = '0,0';\n    let metricMeasurement;\n\n    let standardUnits = 'feet';\n    let standardFormat = '0,0';\n    let standardMeasurement;\n\n    metricMeasurement = drawnLength;\n    if (drawnLength >= 1000) {\n        // if over 1000 meters, upgrade metric\n        metricMeasurement = drawnLength / 1000;\n        metricUnits = 'km';\n        metricFormat = '0.00';\n    }\n\n    standardMeasurement = drawnLength * 3.28084;\n    if (standardMeasurement >= 5280) {\n        // if over 5280 feet, upgrade standard\n        standardMeasurement /= 5280;\n        standardUnits = 'mi';\n        standardFormat = '0.00';\n    }\n\n    const displayMeasurements = {\n        metric: `${numeral(metricMeasurement).format(metricFormat)} ${metricUnits}`,\n        standard: `${numeral(standardMeasurement).format(\n            standardFormat\n        )} ${standardUnits}`,\n    };\n\n    return displayMeasurements;\n}\n\nconst doubleClickZoom = {\n    enable: (ctx) => {\n        setTimeout(() => {\n            // First check we've got a map and some context.\n            if (\n                !ctx.map?.doubleClickZoom ||\n                !ctx._ctx?.store?.getInitialConfigValue\n            ) {\n                return;\n            }\n            // Now check initial state wasn't false (we leave it disabled if so)\n            if (!ctx._ctx.store.getInitialConfigValue('doubleClickZoom')) {\n                return;\n            }\n            ctx.map.doubleClickZoom.enable();\n        }, 0);\n    },\n};\nradiusCircleMode.onSetup = function (opts) {\n    const props = MapboxDraw.modes.draw_line_string.onSetup.call(this, opts);\n    const polygon = this.newFeature({\n        type: MapboxDraw.constants.geojsonTypes.FEATURE,\n        properties: {\n            meta: 'radius',\n            isFixedRadius: opts.isFixedRadius !== undefined ? opts.isFixedRadius : false,\n            isCircle: true,\n            center: opts.center !== undefined ? opts.center : []\n        },\n        geometry: {\n            type: MapboxDraw.constants.geojsonTypes.POLYGON,\n            coordinates: [[]],\n        },\n    });\n    this.addFeature(polygon);\n\n    return {\n        ...props,\n        circle:polygon,\n        steps: opts.steps || 64,\n        units: opts.units || 'kilometers'\n    };\n};\n\nradiusCircleMode.clickAnywhere = function (state, e) {\n    // this ends the drawing after the user creates a second point, triggering this.onStop\n    if (state.currentVertexPosition === 1) {\n        state.line.addCoordinate(0, e.lngLat.lng, e.lngLat.lat);\n        return this.changeMode('simple_select', { featureIds: [state.line.id] });\n    }\n    this.updateUIClasses({ mouse: MapboxDraw.constants.cursors.ADD });\n    state.line.updateCoordinate(\n        state.currentVertexPosition,\n        e.lngLat.lng,\n        e.lngLat.lat\n    );\n    updateCoordinates(state, e);\n    return null;\n};\n\nradiusCircleMode.onMouseMove = function (state, e) {\n    MapboxDraw.modes.draw_line_string.onMouseMove.call(this, state, e);\n    const geojson = state.line.toGeoJSON();\n    const center = geojson.geometry.coordinates[0];\n    const radiusInKm = length(geojson, { units: 'kilometers' });\n    const options =  {steps: state.steps, units: state.units};\n    const circleFeature = circle(center, radiusInKm, options);\n    circleFeature.properties.parent = state.line.id;\n    (circleFeature.properties as any).meta = 'radius';\n    state.circle.setCoordinates(circleFeature.geometry.coordinates);\n};\n\n// creates the final geojson point feature with a radius property\n// triggers draw.create\nradiusCircleMode.onStop = function (state) {\n    doubleClickZoom.enable(this);\n\n    this.activateUIButton();\n\n    // check to see if we've deleted this feature\n    if (this.getFeature(state.line.id) === undefined) {\n        return;\n    }\n\n    // remove last added coordinate\n    state.line.removeCoordinate('0');\n    if (state.line.isValid()) {\n        this.deleteFeature([state.line.id], { silent: true });\n\n        this.map.fire('draw.create', {\n            features: [state.circle.toGeoJSON()],\n        });\n    } else {\n        this.deleteFeature([state.line.id], { silent: true });\n        this.changeMode('simple_select', {}, { silent: true });\n    }\n    this.fireOnStop();\n};\n\nradiusCircleMode.toDisplayFeatures = function (state, geojson, display) {\n    displayFeatures(state, geojson, display);\n\n    if (geojson.geometry.coordinates.length >= 2 && geojson.geometry.coordinates[1]) {\n        const displayMeasurements = getDisplayMeasurements(geojson);\n\n        // create custom feature for the current pointer position\n        const currentVertex = {\n            type: 'Feature',\n            properties: {\n                meta: 'currentPosition',\n                radiusMetric: displayMeasurements.metric,\n                radiusStandard: displayMeasurements.standard,\n                parent: state.line.id,\n            },\n            geometry: {\n                type: 'Point',\n                coordinates: geojson.geometry.coordinates[1],\n            },\n        };\n        display(currentVertex);\n    }\n\n    return null;\n};\n\nexport default radiusCircleMode;\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport MapboxDraw from '@mapbox/mapbox-gl-draw';\n\nexport function createSupplementaryPointsForCircle(geojson) {\n    const { properties, geometry } = geojson;\n\n    if (!properties.user_isCircle) {\n        return null;\n    }\n\n    const supplementaryPoints = [];\n    const vertices = geometry.coordinates[0].slice(0, -1);\n    for (let index = 0; index < vertices.length; index += Math.round((vertices.length / 4))) {\n        supplementaryPoints.push(MapboxDraw.lib.createVertex(properties.id, vertices[index], `0.${index}`, false));\n    }\n    return supplementaryPoints;\n}\n\nexport const dragPan = {\n    enable(ctx) {\n        setTimeout(() => {\n            // First check we've got a map and some context.\n            if (!ctx.map || !ctx.map.dragPan || !ctx._ctx || !ctx._ctx.store || !ctx._ctx.store.getInitialConfigValue) {\n                return;\n            }\n            // Now check initial state wasn't false (we leave it disabled if so)\n            if (!ctx._ctx.store.getInitialConfigValue('dragPan')) {\n                return;\n            }\n            ctx.map.dragPan.enable();\n        }, 0);\n    },\n\n    disable(ctx) {\n        setTimeout(() => {\n            if (!ctx.map || !ctx.map.doubleClickZoom) {\n                return;\n            }\n            // Always disable here, as it's necessary in some cases.\n            ctx.map.dragPan.disable();\n        }, 0);\n    }\n};\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport MapboxDraw from '@mapbox/mapbox-gl-draw';\nimport circle from '@turf/circle';\nimport { point } from '@turf/helpers';\nimport distance from '@turf/distance';\nimport { createSupplementaryPointsForCircle } from './circles/utils';\n\n\nexport const directModeOverride = MapboxDraw.modes.direct_select;\n\ndirectModeOverride.dragFeature = function (state, e, delta) {\n    MapboxDraw.lib.moveFeatures(this.getSelected(), delta);\n    this.getSelected()\n        .filter(feature => feature.properties.isCircle)\n        .map(circle => circle.properties.center)\n        .forEach(center => {\n            center[0] += delta.lng;\n            center[1] += delta.lat;\n        });\n    state.dragMoveLocation = e.lngLat;\n};\n\ndirectModeOverride.dragVertex = function (state, e, delta) {\n    if (state.feature.properties.isCircle && state.feature.properties.isFixedRadius) {\n        MapboxDraw.lib.moveFeatures(this.getSelected(), delta);\n        this.getSelected()\n            .filter(feature => feature.properties.isCircle)\n            .map(circle => circle.properties.center)\n            .forEach(center => {\n                center[0] += delta.lng;\n                center[1] += delta.lat;\n            });\n        state.dragMoveLocation = e.lngLat;\n    } else {\n        if (state.feature.properties.isCircle) {\n            const center = state.feature.properties.center;\n            const movedVertex = [e.lngLat.lng, e.lngLat.lat];\n            const radius = distance(point(center), point(movedVertex), { units: 'kilometers' });\n            const circleFeature = circle(center, radius);\n            state.feature.incomingCoords(circleFeature.geometry.coordinates);\n            state.feature.properties.radiusInKm = radius;\n        } else {\n            const selectedCoords = state.selectedCoordPaths.map(coord_path => state.feature.getCoordinate(coord_path));\n            const selectedCoordPoints = selectedCoords.map(coords => ({\n                type: MapboxDraw.constants.geojsonTypes.FEATURE,\n                properties: {},\n                geometry: {\n                    type: MapboxDraw.constants.geojsonTypes.POINT,\n                    coordinates: coords\n                }\n            }));\n\n            const constrainedDelta = MapboxDraw.lib.constrainFeatureMovement(selectedCoordPoints, delta);\n            for (let i = 0; i < selectedCoords.length; i++) {\n                const coord = selectedCoords[i];\n                state.feature.updateCoordinate(state.selectedCoordPaths[i], coord[0] + constrainedDelta.lng, coord[1] + constrainedDelta.lat);\n            }\n        }\n    }\n\n};\n\ndirectModeOverride.toDisplayFeatures = function (state, geojson, push) {\n    if (state.featureId === geojson.properties.id) {\n        geojson.properties.active = MapboxDraw.constants.activeStates.ACTIVE;\n        push(geojson);\n        const supplementaryPoints = geojson.properties.user_isCircle ? createSupplementaryPointsForCircle(geojson)\n            : MapboxDraw.lib.createSupplementaryPoints(geojson, {\n                map: this.map,\n                midpoints: true,\n                selectedPaths: state.selectedCoordPaths\n            });\n        supplementaryPoints.forEach(push);\n    } else {\n        geojson.properties.active = MapboxDraw.constants.activeStates.INACTIVE;\n        push(geojson);\n    }\n    this.fireActionable(state);\n\n};\n\nexport default directModeOverride;\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\nimport MapboxDraw from '@mapbox/mapbox-gl-draw';\n\n// Inspired by https://github.com/thegisdev/mapbox-gl-draw-rectangle-mode/tree/master\nexport const rectangleMode: any = { };\n\nrectangleMode.onSetup = function() {\n    const rectangle = this.newFeature({\n        type: MapboxDraw.constants.geojsonTypes.FEATURE,\n        properties: {\n            source: 'bbox'\n        },\n        geometry: {\n          type: MapboxDraw.constants.geojsonTypes.POLYGON,\n          coordinates: [[]]\n        }\n    });\n    this.addFeature(rectangle);\n\n    this.clearSelectedFeatures();\n    MapboxDraw.lib.doubleClickZoom.disable(this);\n    this.updateUIClasses({ mouse: MapboxDraw.constants.cursors.ADD });\n    this.activateUIButton(MapboxDraw.constants.types.POLYGON);\n    this.setActionableState({\n        trash: true\n    });\n\n    return {\n        rectangle,\n        currentVertexPosition: 0,\n        start: []\n    };\n};\n\nrectangleMode.onClick = function(state, e) {\n    if (state.currentVertexPosition === 1\n        && state.start[0] !== e.lngLat.lng\n        && state.start[1] !== e.lngLat.lat\n    ) {\n        this.updateUIClasses({ mouse: MapboxDraw.constants.cursors.NONE });\n        return this.changeMode('simple_select', { featuresId: state.rectangle.id });\n    }\n    state.start = [e.lngLat.lng, e.lngLat.lat];\n    state.currentVertexPosition++;\n};\n\nrectangleMode.onMouseMove = function(state, e) {\n    if (state.start?.length > 0) {\n        const start = state.start;\n\n        // The bbox needs to be oriented in a certain way to match the parsing in the contributors\n        const west = Math.min(start[0], e.lngLat.lng);\n        const north = Math.max(start[1], e.lngLat.lat);\n        const east = Math.max(start[0], e.lngLat.lng);\n        const south = Math.min(start[1], e.lngLat.lat);\n\n        state.rectangle.updateCoordinate('0.0', east, south);\n        state.rectangle.updateCoordinate('0.1', east, north);\n        state.rectangle.updateCoordinate('0.2', west, north);\n        state.rectangle.updateCoordinate('0.3', west, south);\n    }\n};\n\nrectangleMode.toDisplayFeatures = function(state, geojson, display) {\n    const isActivePolygon = geojson.properties.id === state.rectangle.id;\n    geojson.properties.active = isActivePolygon ? 'true' : 'false';\n    if (!isActivePolygon) {\n        return display(geojson);\n    }\n\n    // Only render the rectangular polygon if it has the starting point\n    if (state.start.length === 0) {\n        return;\n    }\n    return display(geojson);\n};\n\nrectangleMode.fireOnStop = function () {\n    this.map.fire('draw.onStop', 'draw end');\n};\n\nrectangleMode.onStop = function(state) {\n    MapboxDraw.lib.doubleClickZoom.enable(this);\n    this.activateUIButton();\n\n    // check to see if we've deleted this feature\n    if (this.getFeature(state.rectangle.id) === undefined) {\n        return;\n    }\n\n    // remove last added coordinate\n    state.rectangle.removeCoordinate('0.4');\n    if (state.rectangle.isValid()) {\n        this.map.fire('draw.create', {\n            features: [state.rectangle.toGeoJSON()],\n        });\n    } else {\n        this.deleteFeature([state.rectangle.id], { silent: true });\n        this.changeMode('simple_select', {featureIds: [state.rectangle.id]}, { silent: true });\n    }\n\n    this.fireOnStop();\n};\n\nrectangleMode.onTrash = function(state) {\n    this.deleteFeature([state.rectangle.id], { silent: true });\n    this.changeMode('simple_select');\n};\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport MapboxDraw from '@mapbox/mapbox-gl-draw';\nimport { createSupplementaryPointsForCircle } from './circles/utils';\n\n\nexport const simpleSelectModeOverride = MapboxDraw.modes.simple_select;\n\nsimpleSelectModeOverride.dragMove = function (state, e) {\n    // Dragging when drag move is enabled\n    state.dragMoving = true;\n    e.originalEvent.stopPropagation();\n\n    const delta = {\n        lng: e.lngLat.lng - state.dragMoveLocation.lng,\n        lat: e.lngLat.lat - state.dragMoveLocation.lat\n    };\n\n    MapboxDraw.lib.moveFeatures(this.getSelected(), delta);\n\n    this.getSelected()\n        .filter(feature => feature.properties.isCircle)\n        .map(circle => circle.properties.center)\n        .forEach(center => {\n            center[0] += delta.lng;\n            center[1] += delta.lat;\n        });\n\n    state.dragMoveLocation = e.lngLat;\n};\n\nsimpleSelectModeOverride.toDisplayFeatures = function (state, geojson, display) {\n    geojson.properties.active = (this.isSelected(geojson.properties.id)) ?\n        MapboxDraw.constants.activeStates.ACTIVE : MapboxDraw.constants.activeStates.INACTIVE;\n    display(geojson);\n    this.fireActionable();\n    if (geojson.properties.active !== MapboxDraw.constants.activeStates.ACTIVE ||\n        geojson.geometry.type === MapboxDraw.constants.geojsonTypes.POINT) {\n        return;\n    }\n    const supplementaryPoints = geojson.properties.user_isCircle ?\n        createSupplementaryPointsForCircle(geojson) : MapboxDraw.lib.createSupplementaryPoints(geojson);\n    supplementaryPoints.forEach(display);\n};\n\n\nexport default simpleSelectModeOverride;\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport MapboxDraw from '@mapbox/mapbox-gl-draw';\nimport distance from '@turf/distance';\nimport { bearingToAzimuth, point, polygon } from '@turf/helpers';\nimport length from '@turf/length';\nimport midpoint from '@turf/midpoint';\nimport rhumbBearing from '@turf/rhumb-bearing';\nimport rhumbDestination from '@turf/rhumb-destination';\nimport transformRotate from '@turf/transform-rotate';\nimport transformTranslate from '@turf/transform-translate';\nimport { displayFeatures, updateCoordinates } from '../utils';\n\nexport const stripMode = { ...MapboxDraw.modes.draw_line_string };\n\nexport function rotateStrip(start, end, state, currentMaxBearing = 0, options: any = {}) {\n    const properties = options.properties ? options.properties : {};\n    const startPoint = point(start);\n    const endPoint = point(end);\n    const bearing = rhumbBearing(startPoint, endPoint);\n    const rotatedPoly = transformRotate(state.strip, bearing - currentMaxBearing, { pivot: start });\n    state.currentMaxBearing = bearing;\n    return polygon(rotatedPoly.coordinates, properties);\n}\n\nexport function buildStrip(start, end, halfSwath, options: any = {}) {\n    const properties = options.properties ? options.properties : {};\n    // main\n    const coordinates = [];\n    const startPoint = point(start);\n    const endPoint = point(end);\n    // build polygone\n    const bearing = rhumbBearing(startPoint, endPoint);\n    const corner1 = rhumbDestination(startPoint, halfSwath, bearing - 90);\n    const corner2 = rhumbDestination(startPoint, halfSwath, bearing + 90);\n    const corner3 = rhumbDestination(endPoint, halfSwath, bearing + 90);\n    const corner4 = rhumbDestination(endPoint, halfSwath, bearing - 90);\n    coordinates.push(corner1.geometry.coordinates);\n    coordinates.push(corner2.geometry.coordinates);\n    coordinates.push(corner3.geometry.coordinates);\n    coordinates.push(corner4.geometry.coordinates);\n    coordinates.push(coordinates[0]);\n    properties.start = start;\n    properties.end = end;\n    return polygon([coordinates], properties);\n}\n\nexport function computeStripProperties(coordinates) {\n    const properties = new Map();\n\n    // Compute bearing\n    const bearingAngle = rhumbBearing(point(coordinates[0]), point(coordinates[3]));\n    properties['bearingAngle'] = bearingToAzimuth(bearingAngle);\n\n    // Compute origin\n    properties['origin'] = midpoint(point(coordinates[0]), point(coordinates[1])).geometry.coordinates;\n\n    // Compute length\n    properties['length'] = distance(point(coordinates[1]), point(coordinates[2]), { units: 'kilometers' });\n\n    return properties;\n}\n\nconst doubleClickZoom = {\n    enable: (ctx) => {\n        setTimeout(() => {\n            // First check we've got a map and some context.\n            if (\n                !ctx.map?.doubleClickZoom ||\n                !ctx._ctx?.store?.getInitialConfigValue\n            ) {\n                return;\n            }\n            // Now check initial state wasn't false (we leave it disabled if so)\n            if (!ctx._ctx.store.getInitialConfigValue('doubleClickZoom')) {\n                return;\n            }\n            ctx.map.doubleClickZoom.enable();\n        }, 0);\n    },\n};\nstripMode.onSetup = function (opts) {\n    const halfSwath = opts.halfSwath;\n    const maxLength = opts.maxLength;\n\n    if (!halfSwath) {\n        throw new Error('You must provide a valid halfSwath to enter strip_direct mode');\n    }\n    if (!maxLength) {\n        throw new Error('You must provide a valid maxLength to enter strip_direct mode');\n    }\n    const props = MapboxDraw.modes.draw_line_string.onSetup.call(this, opts);\n    const polygon = this.newFeature({\n        type: MapboxDraw.constants.geojsonTypes.FEATURE,\n        properties: {\n            meta: 'strip',\n            isCircle: false,\n            isStrip: true,\n            halfSwath: opts.halfSwath,\n            maxLength: opts.maxLength,\n            bearingAngle: 0\n\n        },\n        geometry: {\n            type: MapboxDraw.constants.geojsonTypes.POLYGON,\n            coordinates: [[]],\n        },\n    });\n    this.addFeature(polygon);\n\n    return {\n        ...props,\n        strip: polygon,\n        halfSwath,\n        maxLength,\n        meta: 'strip'\n    };\n};\n\nstripMode.fireOnStop = function () {\n    this.map.fire('draw.onStop', 'draw end');\n};\n\nstripMode.clickAnywhere = function (state, e) {\n    // this ends the drawing after the user creates a second point, triggering this.onStop\n    if (state.currentVertexPosition === 1) {\n        state.line.addCoordinate(0, e.lngLat.lng, e.lngLat.lat);\n        return this.changeMode('simple_select', {\n            featureIds: [state.line.id]\n        });\n    }\n    this.updateUIClasses({ mouse: MapboxDraw.constants.cursors.ADD });\n    state.line.updateCoordinate(\n        state.currentVertexPosition,\n        e.lngLat.lng,\n        e.lngLat.lat\n    );\n    updateCoordinates(state, e);\n    return null;\n};\n\nstripMode.onMouseMove = function (state, e) {\n    if (state.currentVertexPosition === 1) {\n        MapboxDraw.modes.draw_line_string.onMouseMove.call(this, state, e);\n        const geojson = state.line.toGeoJSON();\n        const stripLength = length(geojson, { units: 'kilometers' });\n        const start = geojson.geometry.coordinates[0];\n        const end = [e.lngLat.lng, e.lngLat.lat];\n        const startPoint = point(start);\n        const endPoint = point(end);\n        const bearing = rhumbBearing(startPoint, endPoint);\n        if (stripLength > state.maxLength && state.isStripDrew === undefined) {\n            const translateDistance = -(stripLength - state.maxLength);\n            const translatedPoint = transformTranslate(endPoint, translateDistance, bearing);\n            const stripFeature = buildStrip(start, translatedPoint.geometry.coordinates, state.halfSwath);\n            stripFeature.properties.parent = state.line.id;\n            stripFeature.properties.meta = 'strip';\n            state.strip.setCoordinates(stripFeature.geometry.coordinates);\n            state.currentMaxBearing = bearing;\n            state.isStripDrew = true;\n            Object.assign(state.strip.properties, computeStripProperties(stripFeature.geometry.coordinates[0]));\n        } else if (stripLength <= state.maxLength || state.isStripDrew === undefined) {\n            const stripFeature = buildStrip(start, end, state.halfSwath);\n            stripFeature.properties.parent = state.line.id;\n            stripFeature.properties.meta = 'strip';\n            state.strip.setCoordinates(stripFeature.geometry.coordinates);\n            state.currentMaxBearing = bearing;\n            state.isStripDrew = true;\n            Object.assign(state.strip.properties, computeStripProperties(stripFeature.geometry.coordinates[0]));\n        } else if (state.isStripDrew && stripLength > state.maxLength) {\n            const stripFeature = rotateStrip(start, end, state, state.currentMaxBearing);\n            stripFeature.properties.parent = state.line.id;\n            stripFeature.properties.meta = 'strip';\n            state.strip.setCoordinates(stripFeature.geometry.coordinates);\n            Object.assign(state.strip.properties, computeStripProperties(stripFeature.geometry.coordinates[0]));\n        }\n    }\n};\n\n// creates the final geojson point feature with a radius property\n// triggers draw.create\nstripMode.onStop = function (state) {\n    doubleClickZoom.enable(this);\n\n    this.activateUIButton();\n\n    // check to see if we've deleted this feature\n    if (this.getFeature(state.line.id) === undefined) {\n        return;\n    }\n\n    // remove last added coordinate\n    state.line.removeCoordinate('0');\n    if (state.line.isValid()) {\n        this.deleteFeature([state.line.id], { silent: true });\n\n        this.map.fire('draw.create', {\n            features: [state.strip.toGeoJSON()],\n        });\n    } else {\n        this.deleteFeature([state.line.id], { silent: true });\n        this.changeMode('simple_select', {}, { silent: true });\n    }\n    this.fireOnStop();\n};\n\nstripMode.toDisplayFeatures = function (state, geojson, display) {\n    displayFeatures(state, geojson, display);\n\n    if (geojson.geometry.coordinates.length >= 2 && geojson.geometry.coordinates[1]) {\n        // create custom feature for the current pointer position\n        const currentVertex = {\n            type: 'Feature',\n            properties: {\n                meta: 'currentPosition',\n                parent: state.line.id,\n            },\n            geometry: {\n                type: 'Point',\n                coordinates: geojson.geometry.coordinates[1],\n            },\n        };\n        display(currentVertex);\n    }\n\n    return null;\n};\n\nexport default stripMode;\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport MapboxDraw from '@mapbox/mapbox-gl-draw';\nimport center from '@turf/center';\nimport distance from '@turf/distance';\nimport { point } from '@turf/helpers';\nimport midpoint from '@turf/midpoint';\nimport rhumbDestination from '@turf/rhumb-destination';\n\nimport rhumbBearing from '@turf/rhumb-bearing';\nimport transformRotate from '@turf/transform-rotate';\nimport { buildStrip, computeStripProperties } from './strip.mode';\n\nexport const stripDirectSelectMode: any = {};\n\n\nstripDirectSelectMode.onSetup = function (opts) {\n    const featureId = opts.featureId;\n    const halfSwath = opts.halfSwath;\n    const maxLength = opts.maxLength;\n    const feature = this.getFeature(featureId);\n\n    if (!featureId) {\n        throw new Error('You must provide a valid featureId to enter strip_direct mode');\n    }\n    if (!halfSwath) {\n        throw new Error('You must provide a valid halfSwath to enter strip_direct mode');\n    }\n    if (!maxLength) {\n        throw new Error('You must provide a valid maxLength to enter strip_direct mode');\n    }\n\n    if (feature.type !== MapboxDraw.constants.geojsonTypes.POLYGON) {\n        throw new TypeError('strip_direct mode can only handle polygons');\n    }\n    if (feature.coordinates === undefined\n        || feature.coordinates.length !== 1\n        || feature.coordinates[0].length <= 2) {\n        throw new TypeError('strip_direct mode can only handle polygons');\n    }\n\n    const state = {\n        featureId,\n        feature,\n        halfSwath,\n        maxLength,\n        resizePointRadius: opts.resizePointRadius !== undefined ? opts.resizePointRadius : 1,\n        rotationPointRadius: opts.rotationPointRadius !== undefined ? opts.rotationPointRadius : 1.0,\n        canSelectFeatures: opts.canSelectFeatures !== undefined ? opts.canSelectFeatures : true,\n        dragMoveLocation: opts.startPos || null,\n        dragMoving: false,\n        canDragMove: false,\n        selectedCoordPaths: opts.coordPath ? [opts.coordPath] : []\n    };\n\n    this.setSelectedCoordinates(this.pathsToCoordinates(featureId, state.selectedCoordPaths));\n    this.setSelected(featureId);\n    MapboxDraw.lib.doubleClickZoom.disable(this);\n    this.setActionableState({\n        combineFeatures: false,\n        uncombineFeatures: false,\n        trash: true\n    });\n    this.addFeature(feature);\n\n    return state;\n};\n\nstripDirectSelectMode.fireOnStop = function () {\n    this.map.fire('draw.onStop', 'draw end');\n};\n\nstripDirectSelectMode.toDisplayFeatures = function (state, geojson, push) {\n    if (state.featureId === geojson.properties.id) {\n        geojson.properties.active = MapboxDraw.constants.activeStates.ACTIVE;\n        push(geojson);\n        const suppPoints = MapboxDraw.lib.createSupplementaryPoints(geojson, {\n            map: this.map,\n            midpoints: false,\n            selectedPaths: state.selectedCoordPaths\n        });\n        const actionsPoints = this.createActionPoints(state, geojson, suppPoints);\n        actionsPoints.forEach(push);\n    } else {\n        geojson.properties.active = MapboxDraw.constants.activeStates.INACTIVE;\n        push(geojson);\n    }\n\n    this.setActionableState({\n        combineFeatures: false,\n        uncombineFeatures: false,\n        trash: true\n    });\n\n};\n\nstripDirectSelectMode.onStop = function () {\n    MapboxDraw.lib.doubleClickZoom.enable(this);\n    this.clearSelectedCoordinates();\n    this.fireOnStop();\n};\n\nstripDirectSelectMode.pathsToCoordinates = function (featureId, paths) {\n    return paths.map(coord_path => ({ feature_id: featureId, coord_path }));\n};\n\nstripDirectSelectMode._createActionPoint = function (actionWidgets, featureId, v1, v2, rotCenter, radiusScale, type) {\n    const cR0 = midpoint(v1, v2).geometry.coordinates;\n    const heading = rhumbBearing(rotCenter, cR0);\n    const distance0 = distance(rotCenter, cR0);\n    const distance1 = radiusScale * distance0;\n    const cR1 = rhumbDestination(rotCenter, distance1, heading, {}).geometry.coordinates;\n\n    actionWidgets.push({\n        type: MapboxDraw.constants.geojsonTypes.FEATURE,\n        properties: {\n            meta: MapboxDraw.constants.meta.MIDPOINT,\n            actionType: type,\n            parent: featureId,\n            lng: cR1[0],\n            lat: cR1[1],\n            coord_path: v1.properties.coord_path,\n            coord_path_coords: cR0,\n            heading: heading,\n        },\n        geometry: {\n            type: MapboxDraw.constants.geojsonTypes.POINT,\n            coordinates: cR1\n        }\n    }\n    );\n};\n\nstripDirectSelectMode.createActionPoints = function (state, geojson, suppPoints) {\n    const { type, coordinates } = geojson.geometry;\n    const featureId = geojson.properties && geojson.properties.id;\n    const actionWidgets = [];\n    if (type !== MapboxDraw.constants.geojsonTypes.POLYGON) {\n        return;\n    }\n    const corners = suppPoints.slice(0);\n    corners[corners.length] = corners[0];\n    let v1 = null;\n    const rotCenter = this.computeCenter(state, geojson);\n    corners.forEach((v2) => {\n        if (v1 != null && (v1.properties.coord_path === '0.2')) {\n            this._createActionPoint(actionWidgets, featureId, v1, v2, rotCenter, state.rotationPointRadius, 'resize');\n        }\n        if (v1 != null && (v1.properties.coord_path === '0.0')) {\n            this._createActionPoint(actionWidgets, featureId, v1, v2, rotCenter, state.rotationPointRadius, 'origin');\n        }\n        if (v1 != null && (v1.properties.coord_path === '0.3')) {\n            this._createActionPoint(actionWidgets, featureId, v1, v2, rotCenter, state.rotationPointRadius, 'rotation');\n        }\n        v1 = v2;\n    });\n    state.actionWidgets = actionWidgets;\n    return actionWidgets;\n};\n\nstripDirectSelectMode.startDragging = function (state, e) {\n    this.map.dragPan.disable();\n    state.canDragMove = true;\n    state.dragMoveLocation = e.lngLat;\n};\n\nstripDirectSelectMode.stopDragging = function (state) {\n    this.map.dragPan.enable();\n    state.dragMoving = false;\n    state.canDragMove = false;\n    state.dragMoveLocation = null;\n};\n\nconst isMidPoint = MapboxDraw.lib.CommonSelectors.isOfMetaType(MapboxDraw.constants.meta.MIDPOINT);\n\nstripDirectSelectMode.onTouchStart = stripDirectSelectMode.onMouseDown = function (state, e) {\n    if (isMidPoint(e)) {\n        return this.onActivatePoint(state, e);\n    }\n    if (MapboxDraw.lib.CommonSelectors.isActiveFeature(e)) {\n        return this.onFeature(state, e);\n    }\n};\n\nconst stripDirectMode = {\n    Resize: 1,\n    Rotate: 2\n};\n\nstripDirectSelectMode.onActivatePoint = function (state, e) {\n    this.computeAxes(state, state.feature.toGeoJSON());\n    this.startDragging(state, e);\n    const about = e.featureTarget.properties;\n    state.selectedCoordPaths = [about.coord_path];\n    if (e.featureTarget.properties.actionType === 'rotation') {\n        state.stripDirectMode = stripDirectMode.Rotate;\n    } else if (e.featureTarget.properties.actionType === 'resize') {\n        state.stripDirectMode = stripDirectMode.Resize;\n    }\n};\n\nstripDirectSelectMode.onFeature = function (state, e) {\n    state.selectedCoordPaths = [];\n    this.startDragging(state, e);\n};\n\nstripDirectSelectMode.coordinateIndex = function (coordPaths) {\n    if (coordPaths.length >= 1) {\n        const parts = coordPaths[0].split('.');\n        return parseInt(parts[parts.length - 1], 10);\n    } else {\n        return 0;\n    }\n};\n\nstripDirectSelectMode.computeCenter = function (state, polygon) {\n    const center0 = center(polygon);\n    return center0;\n};\n\nstripDirectSelectMode.computeAxes = function (state, polygon) {\n    const center = this.computeCenter(state, polygon);\n    const corners = polygon.geometry.coordinates[0].slice(0);\n    const n = corners.length - 1;\n    const iHalf = Math.floor(n / 2);\n    const rotateCenters = [];\n    const headings = [];\n    for (let i1 = 0; i1 < n; i1++) {\n        let i0 = i1 - 1;\n        if (i0 < 0) {\n            i0 += n;\n        }\n        const c0 = corners[i0];\n        const c1 = corners[i1];\n        const rotPoint = midpoint(point(c0), point(c1));\n        rotateCenters[i1] = center.geometry.coordinates;\n        headings[i1] = rhumbBearing(center, rotPoint);\n    }\n    state.rotation = {\n        feature0: polygon,  // initial feature state\n        centers: rotateCenters,\n        headings: headings, // rotation start heading for each point\n    };\n};\n\nstripDirectSelectMode.onDrag = function (state, e) {\n    if (state.canDragMove !== true) {\n        return;\n    }\n    state.dragMoving = true;\n    e.originalEvent.stopPropagation();\n\n    const delta = {\n        lng: e.lngLat.lng - state.dragMoveLocation.lng,\n        lat: e.lngLat.lat - state.dragMoveLocation.lat\n    };\n    if (state.selectedCoordPaths.length > 0 && state.stripDirectMode) {\n        switch (state.stripDirectMode) {\n            case stripDirectMode.Rotate:\n                this.dragRotatePoint(state, e, delta);\n                break;\n            case stripDirectMode.Resize:\n                this.dragResizePoint(state, e, delta);\n                break;\n        }\n    } else {\n        this.dragFeature(state, e, delta);\n    }\n\n\n    state.dragMoveLocation = e.lngLat;\n};\n\nstripDirectSelectMode.dragRotatePoint = function (state, e, delta) {\n    if (state.rotation === undefined || state.rotation == null) {\n        console.error('state.rotation required');\n        return;\n    }\n    const m1 = point([e.lngLat.lng, e.lngLat.lat]);\n    const n = state.rotation.centers.length;\n    const cIdx = (this.coordinateIndex(state.selectedCoordPaths) + 1) % n;\n    const cCenter = state.rotation.centers[cIdx];\n    const cp = point(cCenter);\n    const heading1 = rhumbBearing(cp, m1);\n    const heading0 = state.rotation.headings[cIdx];\n    const rotateAngle = heading1 - heading0; // in degrees\n    const rotatedFeature = transformRotate(state.rotation.feature0,\n        rotateAngle,\n        {\n            pivot: cp,\n            mutate: false,\n        });\n    state.start = undefined;\n    state.feature.incomingCoords(rotatedFeature.geometry.coordinates);\n    Object.assign(state.feature.properties, computeStripProperties(state.feature.coordinates[0]));\n    this.fireUpdate();\n};\n\n\nstripDirectSelectMode.dragResizePoint = function (state, e, delta) {\n    const end = [e.lngLat.lng, e.lngLat.lat];\n    let start;\n    if (!state.selectedResizePaths) {\n        state.selectedResizePaths = state.selectedCoordPaths[0];\n    }\n    if (!state.start || state.selectedResizePaths !== state.selectedCoordPaths[0]) {\n        if (state.selectedCoordPaths[0] === '0.0') {\n            start = state.actionWidgets.find(a => a.properties.coord_path === '0.2').properties.coord_path_coords;\n        } else {\n            start = state.actionWidgets.find(a => a.properties.coord_path === '0.0').properties.coord_path_coords;\n        }\n        state.start = start;\n    }\n    const dist = distance(point(state.start), point(end), { units: 'kilometers' });\n    const newPolygon = buildStrip(state.start, end, state.halfSwath);\n    if (dist <= state.maxLength) {\n        state.feature.setCoordinates(newPolygon.geometry.coordinates);\n        Object.assign(state.feature.properties, computeStripProperties(state.feature.coordinates[0]));\n        this.fireUpdate();\n    }\n};\n\n\n\nstripDirectSelectMode.dragFeature = function (state, e, delta) {\n    MapboxDraw.lib.moveFeatures(this.getSelected(), delta);\n    state.dragMoveLocation = e.lngLat;\n    state.start = undefined;\n    Object.assign(state.feature.properties, computeStripProperties(state.feature.coordinates[0]));\n    this.fireUpdate();\n};\n\nstripDirectSelectMode.fireUpdate = function () {\n    this.map.fire(MapboxDraw.constants.events.UPDATE, {\n        action: MapboxDraw.constants.updateActions.CHANGE_COORDINATES,\n        features: this.getSelected().map(f => f.toGeoJSON())\n    });\n};\n\nstripDirectSelectMode.onMouseOut = function (state) {\n    // As soon as you mouse leaves the canvas, update the feature\n    if (state.dragMoving) {\n        this.fireUpdate();\n    }\n};\n\nstripDirectSelectMode.onTouchEnd = stripDirectSelectMode.onMouseUp = function (state) {\n    if (state.dragMoving) {\n        this.fireUpdate();\n    }\n    this.stopDragging(state);\n};\n\nstripDirectSelectMode.clickActiveFeature = function (state) {\n    state.selectedCoordPaths = [];\n    this.clearSelectedCoordinates();\n    state.feature.changed();\n};\n\nstripDirectSelectMode.onClick = function (state, e) {\n    if (MapboxDraw.lib.CommonSelectors.noTarget(e)) {\n        return this.clickNoTarget(state, e);\n    }\n    if (MapboxDraw.lib.CommonSelectors.isActiveFeature(e)) {\n        return this.clickActiveFeature(state, e);\n    }\n    if (MapboxDraw.lib.CommonSelectors.isInactiveFeature(e)) {\n        return this.clickInactive(state, e);\n    }\n    this.stopDragging(state);\n};\n\nstripDirectSelectMode.clickNoTarget = function (state, e) {\n    if (state.canSelectFeatures) {\n        this.changeMode(MapboxDraw.constants.modes.SIMPLE_SELECT);\n    }\n};\n\nstripDirectSelectMode.clickInactive = function (state, e) {\n    if (state.canSelectFeatures) {\n        this.changeMode(MapboxDraw.constants.modes.SIMPLE_SELECT, {\n            featureIds: [e.featureTarget.properties.id]\n        });\n    }\n};\n\nstripDirectSelectMode.onTrash = function () {\n    this.deleteFeature(this.getSelectedIds());\n};\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nconst roundLineLayout = {\n  'line-cap': 'round',\n  'line-join': 'round'\n};\n\nconst staticModeVertex = ['all',\n  ['==', 'meta', 'vertex'],\n  ['==', '$type', 'Point'],\n  ['!=', 'mode', 'static']\n];\n\nconst deactivatedStaticModeFeature = ['all',\n  ['==', 'active', 'false'],\n  ['==', '$type', 'Point'],\n  ['==', 'meta', 'feature'],\n  ['!=', 'mode', 'static']\n];\nconst deactivatedStaticPolygon = ['all',\n  ['==', 'active', 'false'],\n  ['==', '$type', 'Polygon'],\n  ['!=', 'mode', 'static']\n];\n\nconst activatedMidPoint = ['all',\n  ['==', '$type', 'Point'],\n  ['==', 'active', 'true'],\n  ['!=', 'meta', 'midpoint']\n];\nconst staticLineMidPoint = ['all', ['==', 'meta', 'midpoint'],\n  ['==', 'actionType', 'rotation'],\n  ['==', '$type', 'LineString'],\n  ['!=', 'mode', 'static']\n];\n\nconst staticPolygon = ['all', ['==', 'mode', 'static'], ['==', '$type', 'Polygon']];\nconst activePolygon = ['all', ['==', 'active', 'true'], ['==', '$type', 'Polygon']];\nconst staticMidpoint = ['all',\n  ['==', 'meta', 'midpoint'],\n  ['==', 'actionType', 'resize'],\n  ['==', '$type', 'Point'],\n  ['!=', 'mode', 'static']\n];\nconst dashedLinePaint = {\n  'line-color': '#fbb03b',\n  'line-dasharray': [0.2, 2],\n  'line-width': 2\n};\n\nconst linePaint = {\n  'line-color': '#3bb2d0',\n  'line-width': 2\n};\n\nconst rotatePointFilter = ['all',\n  ['==', 'meta', 'midpoint'],\n  ['==', 'actionType', 'rotation'],\n  ['==', '$type', 'Point'],\n  ['!=', 'mode', 'static']\n];\nexport default [\n  {\n    'id': 'gl-draw-polygon-fill-inactive',\n    'type': 'fill',\n    'filter': deactivatedStaticPolygon,\n    'paint': {\n      'fill-color': '#3bb2d0',\n      'fill-outline-color': '#3bb2d0',\n      'fill-opacity': 0.1\n    }\n  },\n  {\n    'id': 'gl-draw-polygon-fill-active',\n    'type': 'fill',\n    'filter': activePolygon,\n    'paint': {\n      'fill-color': '#fbb03b',\n      'fill-outline-color': '#fbb03b',\n      'fill-opacity': 0.1\n    }\n  },\n  {\n    'id': 'gl-draw-polygon-midpoint',\n    'type': 'circle',\n    'filter': ['all',\n      ['==', '$type', 'Point'],\n      ['==', 'meta', 'midpoint']],\n    'paint': {\n      'circle-radius': 3,\n      'circle-color': '#fbb03b'\n    }\n  },\n  {\n    'id': 'gl-draw-polygon-stroke-inactive',\n    'type': 'line',\n    'filter': deactivatedStaticPolygon,\n    'layout': roundLineLayout,\n    'paint': linePaint\n  },\n  {\n    'id': 'gl-draw-polygon-stroke-active',\n    'type': 'line',\n    'filter': activePolygon,\n    'layout': roundLineLayout,\n    'paint': dashedLinePaint\n  },\n  {\n    'id': 'gl-draw-line-inactive',\n    'type': 'line',\n    'filter': ['all',\n      ['==', 'active', 'false'],\n      ['==', '$type', 'LineString'],\n      ['!=', 'mode', 'static']\n    ],\n    'layout': roundLineLayout,\n\n    'paint': linePaint\n  },\n  {\n    'id': 'gl-draw-line-active',\n    'type': 'line',\n    'filter': ['all',\n      ['==', '$type', 'LineString'],\n      ['==', 'active', 'true']\n    ],\n    'layout': roundLineLayout,\n    'paint': dashedLinePaint\n  },\n  {\n    'id': 'gl-draw-polygon-and-line-vertex-stroke-inactive',\n    'type': 'circle',\n    'filter': staticModeVertex,\n    'paint': {\n      'circle-radius': 5,\n      'circle-color': '#fff'\n    }\n  },\n  {\n    'id': 'gl-draw-polygon-and-line-vertex-inactive',\n    'type': 'circle',\n    'filter': staticModeVertex,\n    'paint': {\n      'circle-radius': 3,\n      'circle-color': '#fbb03b'\n    }\n  },\n  {\n    'id': 'gl-draw-point-point-stroke-inactive',\n    'type': 'circle',\n    'filter': deactivatedStaticModeFeature,\n    'paint': {\n      'circle-radius': 5,\n      'circle-opacity': 1,\n      'circle-color': '#fff'\n    }\n  },\n  {\n    'id': 'gl-draw-point-inactive',\n    'type': 'circle',\n    'filter': deactivatedStaticModeFeature,\n    'paint': {\n      'circle-radius': 3,\n      'circle-color': '#3bb2d0'\n    }\n  },\n  {\n    'id': 'gl-draw-point-stroke-active',\n    'type': 'circle',\n    'filter': activatedMidPoint,\n    'paint': {\n      'circle-radius': 7,\n      'circle-color': '#fff'\n    }\n  },\n  {\n    'id': 'gl-draw-point-active',\n    'type': 'circle',\n    'filter': activatedMidPoint,\n    'paint': {\n      'circle-radius': 5,\n      'circle-color': '#fbb03b'\n    }\n  },\n  {\n    'id': 'gl-draw-polygon-fill-static',\n    'type': 'fill',\n    'filter': staticPolygon,\n    'paint': {\n      'fill-color': '#3bb2d0',\n      'fill-outline-color': '#3bb2d0',\n      'fill-opacity': 0.1\n    }\n  },\n  {\n    'id': 'gl-draw-polygon-stroke-static',\n    'type': 'line',\n    'filter': staticPolygon,\n    'layout': roundLineLayout,\n\n    'paint': linePaint\n  },\n  {\n    'id': 'gl-draw-line-static',\n    'type': 'line',\n    'filter': ['all', ['==', 'mode', 'static'], ['==', '$type', 'LineString']],\n    'layout': roundLineLayout,\n\n    'paint': {\n      'line-color': '#404040',\n      'line-width': 2\n    }\n  },\n  {\n    'id': 'gl-draw-point-static',\n    'type': 'circle',\n    'filter': ['all', ['==', 'mode', 'static'], ['==', '$type', 'Point']],\n    'paint': {\n      'circle-radius': 5,\n      'circle-color': '#404040'\n    }\n  },\n  {\n    'id': 'gl-draw-line-rotate-point',\n    'type': 'line',\n    'filter': staticLineMidPoint,\n    'layout': roundLineLayout,\n\n    'paint': dashedLinePaint\n  },\n  {\n    'id': 'gl-draw-polygon-rotate-point-stroke',\n    'type': 'circle',\n    'filter': rotatePointFilter,\n    'paint': {\n      'circle-radius': 4,\n      'circle-color': '#fff'\n    }\n  },\n  {\n    'id': 'gl-draw-polygon-rotate-point',\n    'type': 'circle',\n    'filter': rotatePointFilter,\n    'paint': {\n      'circle-radius': 2,\n      'circle-color': '#fbb03b'\n    }\n  },\n  {\n    'id': 'gl-draw-polygon-rotate-point-icon',\n    'type': 'symbol',\n    'filter': rotatePointFilter,\n    'layout': {\n      'icon-image': 'rotate',\n      'icon-allow-overlap': true,\n      'icon-ignore-placement': true,\n      'icon-rotation-alignment': 'map',\n      'icon-rotate': ['get', 'heading']\n    },\n    'paint': {\n      'icon-opacity': 1.0,\n      'icon-opacity-transition': {\n        'delay': 0,\n        'duration': 0\n      }\n    }\n  },\n  {\n    'id': 'gl-draw-line-resize-point',\n    'type': 'line',\n    'filter': staticLineMidPoint,\n    'layout': roundLineLayout,\n\n    'paint': dashedLinePaint\n  },\n  {\n    'id': 'gl-draw-polygon-resize-point-stroke',\n    'type': 'circle',\n    'filter': staticMidpoint,\n    'paint': {\n      'circle-radius': 5,\n      'circle-color': '#fff'\n    }\n  },\n  {\n    'id': 'gl-draw-polygon-resize-point',\n    'type': 'circle',\n    'filter': staticMidpoint,\n    'paint': {\n      'circle-radius': 6,\n      'circle-color': '#fbb03b'\n    }\n  },\n  {\n    'id': 'gl-draw-polygon-resize-point-icon',\n    'type': 'symbol',\n    'filter': staticMidpoint,\n    'layout': {\n      'icon-image': 'resize',\n      'icon-allow-overlap': true,\n      'icon-ignore-placement': true,\n      'icon-rotation-alignment': 'map',\n      'icon-rotate': ['get', 'heading']\n    },\n    'paint': {\n      'icon-opacity': 1.0,\n      'icon-opacity-transition': {\n        'delay': 0,\n        'duration': 0\n      }\n    }\n  }\n];\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { Component, EventEmitter, HostListener, inject, Input, OnInit, Output, signal, SimpleChanges, ViewEncapsulation } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { MatSnackBar } from '@angular/material/snack-bar';\nimport { marker } from '@colsen1991/ngx-translate-extract-marker';\nimport StaticMode from '@mapbox/mapbox-gl-draw-static-mode';\nimport { TranslateService } from '@ngx-translate/core';\nimport centroid from '@turf/centroid';\nimport cleanCoords from '@turf/clean-coords';\nimport { Feature, FeatureCollection, Geometry, Polygon, polygon } from '@turf/helpers';\nimport { ArlasMapFrameworkService } from '../arlas-map-framework.service';\nimport { AbstractArlasMapService } from '../arlas-map.service';\nimport { AbstractArlasMapGL } from '../map/AbstractArlasMapGL';\nimport { DrawControlsOption } from '../map/model/controls';\nimport { MapMouseEvent } from '../map/model/events';\nimport { latLngToWKT } from '../map/tools';\nimport { AbstractDraw, DrawModes } from './AbstractDraw';\nimport { AoiDimensions, BboxDrawCommand } from './draw.models';\nimport { MapboxAoiDrawService } from './draw.service';\nimport { limitVertexDirectSelectMode } from './modes/LimitVertexDirectSelectMode';\nimport { validGeomDrawPolygonMode } from './modes/ValidGeomDrawPolygonMode';\nimport { circleMode } from './modes/circles/circle.mode';\nimport { radiusCircleMode } from './modes/circles/radius.circle.mode';\nimport { directModeOverride } from './modes/directSelectOverride';\nimport { rectangleMode } from './modes/rectangleMode';\nimport { simpleSelectModeOverride } from './modes/simpleSelectOverride';\nimport { stripDirectSelectMode } from './modes/strip/strip.direct.mode';\nimport { stripMode } from './modes/strip/strip.mode';\nimport * as styles from './themes/default-theme';\n\n@Component({\n  selector: 'arlas-draw',\n  templateUrl: './arlas-draw.component.html',\n  styleUrls: ['./arlas-draw.component.scss'],\n  encapsulation: ViewEncapsulation.None\n})\n/** L: a layer class/interface.\n *  S: a source class/interface.\n *  M: a Map configuration class/interface.\n */\nexport class ArlasDrawComponent<L, S, M> implements OnInit {\n\n  @Input() public map: AbstractArlasMapGL;\n\n  @Input() private emptyData: FeatureCollection<GeoJSON.Geometry> = {\n    'type': 'FeatureCollection',\n    'features': []\n  };\n  /**  @description Options object for draw tools : https://github.com/mapbox/mapbox-gl-draw/blob/master/docs/API.md#options */\n  @Input() public drawOption: any = {};\n  /** Draw instance. */\n  public draw: AbstractDraw;\n  /** @description Features drawn at component start */\n  @Input() public drawData: FeatureCollection<GeoJSON.Geometry> = ({ ...this.emptyData });\n  /** @description Whether the draw tools are activated. */\n  @Input() public drawButtonEnabled = false;\n  /** @description Maximum number of vertices allowed for a polygon. */\n  @Input() public drawPolygonVerticesLimit: number;\n  /** @description Whether the drawing buffer is activated */\n  /** If true, the map's canvas can be exported to a PNG using map.getCanvas().toDataURL(). Default: false */\n  @Input() public preserveDrawingBuffer = false;\n\n  /** @description Emits the geojson of an aoi added to the map. */\n  @Output() public onAoiChanged: EventEmitter<FeatureCollection<GeoJSON.Geometry>> = new EventEmitter();\n\n  /** @description Emits the the dimensions of the polygon/bbox that is being drawn. */\n  @Output() public onAoiEdit: EventEmitter<AoiDimensions> = new EventEmitter();\n\n\n  /** Number of drawn vertices (incremented in draw mode). Reset to 0 when the drawing is finished. */\n  public nbPolygonVertices = 0;\n  /** Number of clicks while drawing a geometry. */\n  public drawClickCounter = 0;\n\n  /** List of drawn polygons centroid */\n  public polygonlabeldata: FeatureCollection<GeoJSON.Geometry> = ({ ...this.emptyData });\n\n\n  /** Drawn geometry's state when editing/updating. */\n  protected savedEditFeature = null;\n  /** Map container Html element */\n  protected canvas: HTMLElement;\n  /** Html element that holds the drawing message. */\n  protected drawTooltipElement: HTMLElement;\n  /** Message shown to explain how to draw. */\n  public drawTooltipMessage = signal<string>('');\n\n  private readonly mapFrameworkService = inject(ArlasMapFrameworkService<L, S, M>);\n\n  public constructor(\n    private readonly drawService: MapboxAoiDrawService,\n    private readonly _snackBar: MatSnackBar,\n    private readonly translate: TranslateService,\n    protected mapService: AbstractArlasMapService<L, S, M>\n  ) {\n    this.drawService.editAoi$.pipe(takeUntilDestroyed()).subscribe(ae => this.onAoiEdit.emit(ae));\n    this.drawService.drawBbox$.pipe(takeUntilDestroyed()).subscribe({\n      next: (bboxDC: BboxDrawCommand) => {\n        this.drawBbox(bboxDC.east, bboxDC.south, bboxDC.west, bboxDC.north);\n      }\n    });\n  }\n\n  /**\n   * @description Stops the drawing mode by changing to static mode.\n   */\n  private stopDrawingAtVerticeLimit() {\n    if (this.nbPolygonVertices === this.drawPolygonVerticesLimit) {\n      this.draw.changeMode('static');\n      this.drawService.isDrawingPolygon = false;\n      this.nbPolygonVertices = 0;\n      this.drawClickCounter = 0;\n    }\n  }\n\n  private listenToDrawOnCreate() {\n    this.draw.on('draw.create', (e) => {\n      this.onAoiChanged.next(\n        {\n          'type': 'FeatureCollection',\n          'features': this.draw.getAllFeatures().filter(fc =>\n            this.drawService.isValidPolygon(fc) ||\n            this.drawService.isValidCircle(fc)\n          ).map(f => cleanCoords(f))\n        });\n    });\n  }\n\n  private listenToDrawUpdate() {\n    this.draw.on('draw.update', (e) => {\n      if (e) {\n        const features = e.features;\n        if (features && features.length > 0) {\n          this.savedEditFeature = { ...features[0] };\n          this.savedEditFeature.coordinates = [[]];\n          features[0].geometry.coordinates[0].forEach(f => this.savedEditFeature.coordinates[0].push(f));\n        }\n      }\n    });\n  }\n\n  private listenToDrawDelete() {\n    this.draw.on('draw.delete', (e) => {\n      this.onAoiChanged.next(\n        {\n          'type': 'FeatureCollection',\n          'features': this.draw.getAllFeatures().filter(fc =>\n            this.drawService.isPolygon(fc) ||\n            this.drawService.isCircle(fc)\n          ).map(f => cleanCoords(f))\n        });\n    });\n  }\n\n  private listenToDrawInvalidGeometry() {\n    this.draw.onDrawInvalidGeometry((e) => {\n      if (this.savedEditFeature) {\n        const featureCoords = this.savedEditFeature.coordinates[0].slice();\n        if (featureCoords[0][0] !== featureCoords.at(-1)[0] ||\n          featureCoords[0][1] !== featureCoords.at(-1)[1]) {\n          featureCoords.push(featureCoords[0]);\n        }\n        const currentFeature = {\n          id: '',\n          type: 'Feature',\n          geometry: {\n            'type': 'Polygon',\n            'coordinates': [featureCoords]\n          },\n          properties: {}\n        };\n        currentFeature.id = this.savedEditFeature.id;\n        currentFeature.properties = this.savedEditFeature.properties;\n        this.draw.add(currentFeature as Feature<Polygon>);\n      }\n      this.openInvalidGeometrySnackBar();\n      this.mapFrameworkService.setMapCursor(this.map, '');\n    });\n  }\n\n  private listenToDrawSelectionChange() {\n    this.draw.onDrawSelectionchange((e) => {\n      if (e.features.length > 0) {\n        this.drawService.isDrawSelected = true;\n      } else {\n        this.savedEditFeature = null;\n        this.drawService.isDrawSelected = false;\n        this.onAoiChanged.next(\n          {\n            'type': 'FeatureCollection',\n            'features': this.draw.getAllFeatures().filter(fc =>\n              this.drawService.isValidPolygon(fc) ||\n              this.drawService.isValidCircle(fc)\n            ).map(f => cleanCoords(f))\n          });\n        this.switchToStaticMode();\n        this.mapFrameworkService.setMapCursor(this.map, '');\n      }\n    });\n  }\n\n  private listenToDrawModeChange() {\n    this.draw.onDrawModeChange((e) => {\n      this.updateTooltipMessage();\n      this.drawService.isDrawingPolygon = e.mode === this.draw.getMode('DRAW_POLYGON');\n      this.drawService.isDrawingStrip = e.mode === this.draw.getMode('DRAW_STRIP') || e.mode === this.draw.getMode('DIRECT_STRIP');\n      this.drawService.isDrawingCircle = e.mode === this.draw.getMode('DRAW_CIRCLE') || e.mode === this.draw.getMode('DRAW_RADIUS_CIRCLE');\n      this.drawService.isDrawingBbox = e.mode === this.draw.getMode('DRAW_RECTANGLE');\n      if (this.drawService.isDrawingPolygon || this.drawService.isDrawingCircle || this.drawService.isDrawingStrip || e.mode === 'static') {\n        this.drawService.isInSimpleDrawMode = false;\n      }\n      if (e.mode === 'simple_select') {\n        this.drawService.isInSimpleDrawMode = true;\n      } else if (e.mode === 'static') {\n        this.mapFrameworkService.setMapCursor(this.map, '');\n      } else if (e.mode === 'direct_select') {\n        const selectedFeatures = this.draw.getSelectedFeatures();\n        const selectedIds = this.draw.getSelectedIds();\n        if (selectedFeatures && selectedIds && selectedIds.length > 0) {\n          if (selectedFeatures[0].properties.source === 'bbox') {\n            this.draw.changeMode('simple_select', {\n              featureIds: [selectedIds[0]]\n            });\n            this.drawService.isInSimpleDrawMode = true;\n          } else if (this.drawPolygonVerticesLimit && selectedFeatures[0].properties.meta !== 'strip') {\n            this.draw.changeMode('limit_vertex', {\n              featureId: selectedIds[0],\n              maxVertexByPolygon: this.drawPolygonVerticesLimit,\n              selectedCoordPaths: (selectedFeatures[0] as Feature<Geometry>).geometry.coordinates\n            });\n            this.drawService.isInSimpleDrawMode = false;\n          } else if (this.drawPolygonVerticesLimit && selectedFeatures[0].properties.meta === 'strip') {\n            this.draw.changeMode('direct_strip', {\n              featureId: selectedIds[0],\n              maxLength: selectedFeatures[0].properties.maxLength,\n              halfSwath: selectedFeatures[0].properties.halfSwath,\n            });\n            this.drawService.isInSimpleDrawMode = false;\n          }\n        } else {\n          this.drawService.isInSimpleDrawMode = false;\n          this.mapFrameworkService.setMapCursor(this.map, '');\n        }\n      }\n    });\n\n  }\n\n  public ngOnInit(): void {\n    this.drawTooltipElement = document.getElementById('arlas-draw-tooltip');\n    const drawStyles = styles.default;\n    const drawOptions = {\n      ...this.drawOption,\n      styles: drawStyles,\n      modes: {\n        static: StaticMode,\n        limit_vertex: limitVertexDirectSelectMode,\n        draw_polygon: validGeomDrawPolygonMode,\n        draw_circle: circleMode,\n        draw_radius_circle: radiusCircleMode,\n        draw_strip: stripMode,\n        direct_strip: stripDirectSelectMode,\n        draw_rectangle: rectangleMode,\n        direct_select: directModeOverride,\n        simple_select: simpleSelectModeOverride\n      },\n      suppressAPIEvents: true\n    };\n    this.draw = this.mapFrameworkService.createDraw(drawOptions, this.drawButtonEnabled, this.map);\n    this.draw.setMode('DRAW_CIRCLE', 'draw_circle');\n    this.draw.setMode('DRAW_RADIUS_CIRCLE', 'draw_radius_circle');\n    this.draw.setMode('DRAW_STRIP', 'draw_strip');\n    this.draw.setMode('STATIC', 'static');\n    this.draw.setMode('DIRECT_STRIP', 'direct_strip');\n    this.draw.setMode('DRAW_RECTANGLE', 'draw_rectangle');\n    const drawControlConfig: DrawControlsOption = {\n      draw: { control: this.draw },\n      addGeoBox: {\n        enable: true,\n        overrideEvent:\n        {\n          event: 'click',\n          fn: this.addGeoBox\n        }\n      },\n      removeAois: {\n        enable: true,\n        overrideEvent: { event: 'click', fn: this.removeAois }\n      }\n    };\n    this.map.initDrawControls(drawControlConfig);\n    this.drawService.setDraw(this.draw);\n    this.mapFrameworkService.onMapEvent('load', this.map, () => {\n      this.mapService.declareLabelSources('', this.polygonlabeldata, this.map);\n      this.switchToStaticMode();\n      this.canvas = this.map.getCanvasContainer();\n      this.listenToDrawOnCreate();\n      this.listenToDrawUpdate();\n      this.listenToDrawDelete();\n      this.canvas.addEventListener('mousemove', this.mouseMoveForDraw, true);\n\n      this.draw.onDrawOnStart((e) => {\n        this.drawClickCounter = 0;\n        this.mapFrameworkService.setMapCursor(this.map, '');\n      });\n      this.draw.onDrawOnStop((e) => {\n        this.drawClickCounter = 0;\n        this.mapFrameworkService.setMapCursor(this.map, '');\n      });\n\n      this.listenToDrawInvalidGeometry();\n\n      this.draw.onDrawEditSaveInitialFeature((edition) => {\n        this.savedEditFeature = { ...edition.feature };\n        this.savedEditFeature.coordinates = [[]];\n        edition.feature.coordinates[0].forEach(c => this.savedEditFeature.coordinates[0].push(c));\n      });\n\n      this.listenToDrawSelectionChange();\n      this.listenToDrawModeChange();\n      this.mapFrameworkService.onMapEvent('click', this.map, (e) => {\n        if (this.drawService.isDrawing()) {\n          this.drawClickCounter++;\n          this.updateTooltipMessage();\n        }\n\n        if (this.drawService.isDrawingCircle) {\n          return;\n        }\n        if (this.drawService.isDrawingPolygon) {\n          this.nbPolygonVertices++;\n          this.stopDrawingAtVerticeLimit();\n        } else {\n          this.nbPolygonVertices = 0;\n          const features = this.map.queryRenderedFeatures(e.point);\n          // edit polygon condition : no arlas feature && mapbox-gl-draw source present\n          const editCondition = features.filter(f => f.layer.id?.indexOf('arlas') >= 0).length === 0 &&\n            features.filter(f => f.source.startsWith('mapbox-gl-draw')).length > 0;\n          if (editCondition) {\n            // edit only on click on the border of the polygon\n            const candidatesProperties = features.find(f => f.source.startsWith('mapbox-gl-draw')\n                                                            && f.layer.id?.indexOf('stroke') >= 0)?.properties;\n            if (candidatesProperties?.id) {\n              if (candidatesProperties.user_meta === 'strip') {\n                this.draw.changeMode('direct_strip', {\n                  featureId: candidatesProperties.id,\n                  maxLength: candidatesProperties.user_maxLength,\n                  halfSwath: candidatesProperties.user_halfSwath\n                });\n                this.drawService.isInSimpleDrawMode = false;\n              } else {\n                this.draw.changeMode('simple_select', {\n                  featureIds: [candidatesProperties.id]\n                });\n                this.drawService.isInSimpleDrawMode = true;\n              }\n            }\n          }\n        }\n      });\n    });\n\n    this.mapFrameworkService.onMapEvent('mousemove', this.map, (e: MapMouseEvent) => {\n      if (this.drawService.isDrawingBbox || this.drawService.isDrawingPolygon) {\n        this.mapFrameworkService.setMapCursor(this.map, 'crosshair');\n        this.map.moveLngLat = e.lngLat;\n      }\n    });\n\n  }\n\n  public ngOnChanges(changes: SimpleChanges): void {\n    if (this.map && this.map.getMapProvider() !== undefined) {\n      if (changes['drawData'] !== undefined && this.drawService.isReady) {\n        const centroides = new Array();\n        this.drawData.features.forEach(feature => {\n          const poly = polygon((feature.geometry as Polygon).coordinates);\n          const cent = centroid(poly);\n          cent.properties.arlas_id = feature.properties.arlas_id;\n          centroides.push(cent);\n        });\n        this.polygonlabeldata = {\n          type: 'FeatureCollection',\n          features: centroides\n        };\n\n        this.drawService.addFeatures(this.drawData, /** deleteOld */ true);\n        this.mapService.updateLabelSources(this.map.POLYGON_LABEL_SOURCE, this.polygonlabeldata, this.map);\n      }\n\n    }\n  }\n\n  /**\n   * Update the tooltip message when drawing to reflect drawing mode and state\n   */\n  public updateTooltipMessage() {\n    let tooltipMessage;\n    switch (this.draw.getCurrentMode().toLocaleUpperCase() as DrawModes) {\n      case 'DRAW_RADIUS_CIRCLE':\n        if (this.drawClickCounter === 0) {\n          tooltipMessage = marker('Click to set the center of the circle');\n        } else {\n          tooltipMessage = marker('Click again to set the radius of the circle');\n        }\n        break;\n      case 'DRAW_POLYGON':\n        if (this.drawClickCounter < 2) {\n          tooltipMessage = marker('Click to set a corner of the polygon');\n        } else {\n          tooltipMessage = marker('Double click to finish drawing');\n        }\n        break;\n      case 'DRAW_CIRCLE':\n        tooltipMessage = marker('Click to create a circle centered on this point');\n        break;\n      case 'DRAW_STRIP':\n        if (this.drawClickCounter === 0) {\n          tooltipMessage = marker('Click to set the origin of the strip');\n        } else {\n          tooltipMessage = marker('Click again to set the length and bearing of the strip');\n        }\n        break;\n      case 'DRAW_RECTANGLE':\n        if (this.drawClickCounter === 0) {\n          tooltipMessage = marker('Click to set the first corner of the rectangle');\n        } else {\n          tooltipMessage = marker('Click again to complete the rectangle');\n        }\n        break;\n      case 'STATIC':\n      case 'SIMPLE_SELECT':\n        this.drawClickCounter = 0;\n        break;\n      default:\n        break;\n    }\n\n    this.drawTooltipMessage.set(tooltipMessage);\n  }\n\n  private readonly mouseMoveForDraw = (e: MouseEvent) => {\n    const x = e.clientX;\n    const y = e.clientY;\n    this.drawTooltipElement.style.top = (y + 20) + 'px';\n    this.drawTooltipElement.style.left = (x + 20) + 'px';\n  };\n\n  /**\n   * @description Emits the bbox drawn by the BboxGenerator component\n   * @param east\n   * @param south\n   * @param west\n   * @param north\n   */\n  protected drawBbox(east: number, south: number, west: number, north: number) {\n    const coordinates = [[\n      [east, south],\n      [east, north],\n      [west, north],\n      [west, south],\n      [east, south],\n    ]];\n    const polygonGeojson: Feature<GeoJSON.Geometry> = {\n      type: 'Feature',\n      properties: {\n        source: 'bbox'\n      },\n      geometry: {\n        type: 'Polygon',\n        coordinates: coordinates\n      }\n    };\n    const geoboxdata = { ...this.emptyData};\n    geoboxdata.features = [];\n    if (this.drawData?.features && this.drawData.features.length > 0) {\n      this.drawData.features.forEach(df => geoboxdata.features.push(df));\n    }\n    geoboxdata.features.push(polygonGeojson);\n    /** This allows to keep the drawn box on the map. It will be overriden in ngOnChanges `changes['drawData']` */\n    this.drawService.addFeatures(geoboxdata, /** deleteOld */ true);\n    this.onAoiChanged.next(geoboxdata);\n    this.drawService.isDrawingBbox = false;\n    this.drawService.endDimensionsEmission();\n  }\n\n  /** @description Enables bbox drawing mode.*/\n  public addGeoBox() {\n    this.mapFrameworkService.setMapCursor(this.map, 'crosshair');\n    this.switchToDrawMode('draw_rectangle');\n  }\n\n  /**\n   * @description Removes all the aois if none of them is selected. Otherwise it removes the selected one only\n   */\n  public removeAois() {\n    this.mapFrameworkService.setMapCursor(this.map, '');\n    this.drawService.isDrawingBbox = false;\n    this.deleteSelectedItem();\n  }\n\n  /** @description Deletes the selected drawn geometry. If no drawn geometry is selected, all geometries are deteleted */\n  public deleteSelectedItem() {\n    if (this.drawService.isDrawSelected) {\n      this.draw.trash();\n    } else {\n      this.drawService.deleteAll();\n    }\n    this.drawService.isDrawSelected = false;\n    this.onAoiChanged.next(this.draw.getAll() as FeatureCollection<GeoJSON.Geometry>);\n  }\n\n  /**\n   * @description Shows an invalid-geometry error on a snack bar.\n   */\n  public openInvalidGeometrySnackBar() {\n    this._snackBar.open(this.translate.instant('Invalid geometry'), this.translate.instant('Ok'), {\n      duration: 3 * 1000,\n      verticalPosition: 'top',\n      panelClass: 'invalid-geo-toast'\n    });\n  }\n\n  /**\n   * @description Switches to a drawing mode of a polygon, circle, radius circle or strip.\n   * @param mode Draw mode (DRAW_POLYGON, DRAW_CIRCLE, DRAW_RADIUS_CIRCLE or DRAW_STRIP). Default to DRAW_POLYGON\n   * @param option Mapboxdraw option.\n   */\n  public switchToDrawMode(mode?: string, option?: any) {\n    const selectedMode = mode ?? this.draw.getMode('DRAW_POLYGON');\n    this.drawService.isDrawingCircle = selectedMode === this.draw.getMode('DRAW_CIRCLE')\n      || selectedMode === this.draw.getMode('DRAW_RADIUS_CIRCLE');\n    this.drawService.isDrawingPolygon = selectedMode === this.draw.getMode('DRAW_POLYGON');\n    this.drawService.isDrawingStrip = selectedMode === this.draw.getMode('DRAW_STRIP');\n    this.drawService.isDrawingBbox = selectedMode === this.draw.getMode('DRAW_RECTANGLE');\n    this.drawService.isInSimpleDrawMode = false;\n\n    this.mapFrameworkService.setMapCursor(this.map, 'crosshair');\n    this.draw.changeMode(selectedMode, option ?? {});\n    this.updateTooltipMessage();\n  }\n\n  /**\n   * @description Switches to direct_select mode.\n   * @param option Mapboxdraw option.\n   */\n  public switchToDirectSelectMode(option?: { featureIds: Array<string>; allowCircleResize: boolean; }\n    | { featureId: string; allowCircleResize: boolean; }) {\n    this.draw.changeMode('direct_select', option);\n    this.drawService.isInSimpleDrawMode = false;\n    this.drawService.isDrawingCircle = false;\n    this.drawService.isDrawingStrip = false;\n    this.drawService.isDrawingPolygon = false;\n    this.drawService.isDrawingBbox = false;\n  }\n\n  /**\n   * @description Switches to simple_select mode.\n   */\n  public switchToEditMode() {\n    this.draw.changeMode('simple_select', {\n      featureIds: this.draw.getAll().features.map(f => f.id)\n    });\n    this.drawService.isInSimpleDrawMode = true;\n    this.drawService.isDrawingCircle = false;\n    this.drawService.isDrawingStrip = false;\n    this.drawService.isDrawingPolygon = false;\n    this.drawService.isDrawingBbox = false;\n  }\n\n  /**\n   * @description Switches to static mode.\n   */\n  public switchToStaticMode() {\n    this.draw.changeMode('static');\n    this.drawService.isInSimpleDrawMode = false;\n    this.drawService.isDrawingBbox = false;\n    this.drawService.isDrawingCircle = false;\n    this.drawService.isDrawingStrip = false;\n    this.drawService.isDrawingPolygon = false;\n    this.updateTooltipMessage();\n  }\n\n  /**\n   * @description Returns all the drawn polygons as wkt or geojson.\n   * @param mode 'wkt' | 'geojson'\n   * @returns\n   */\n  public getAllPolygon(mode: 'wkt' | 'geojson'): string | Object {\n    let polygon;\n    if (mode === 'wkt') {\n      polygon = latLngToWKT(this.draw.getAll().features.filter(f => this.drawService.isPolygon(f) ||\n        this.drawService.isCircle(f)).map(f => cleanCoords(f)));\n    } else {\n      polygon = {\n        'type': 'FeatureCollection',\n        'features': this.draw.getAll().features.filter(f => this.drawService.isPolygon(f) ||\n          this.drawService.isCircle(f)).map(f => cleanCoords(f))\n      };\n    }\n    return polygon;\n  }\n\n  /**\n   * @returns the selected polygon geometry in WKT or GeoJson given the mode\n   * @param mode : 'wkt' | 'geojson'\n   * @returns Wkt string or Geojson object.\n   */\n  public getSelectedPolygon(mode: 'wkt' | 'geojson'): string | Object {\n    let polygon;\n    if (mode === 'wkt') {\n      polygon = latLngToWKT(this.draw.getSelected().features.filter(f => this.drawService.isPolygon(f) ||\n        this.drawService.isCircle(f)));\n    } else {\n      polygon = {\n        'type': 'FeatureCollection',\n        'features': this.draw.getSelected().features.filter(f => this.drawService.isPolygon(f) ||\n          this.drawService.isCircle(f))\n      };\n    }\n    return polygon;\n  }\n\n  @HostListener('document:keydown', ['$event'])\n  public handleKeyboardEvent(event: KeyboardEvent) {\n    if (event.key === 'Escape') {\n      if (this.drawService.isDrawing()) {\n        this.drawService.deleteUnregisteredFeatures();\n        this.mapFrameworkService.setMapCursor(this.map, '');\n\n        this.switchToStaticMode();\n        this.drawService.endDimensionsEmission();\n      } else if (this.drawService.isInSimpleDrawMode) {\n        this.drawService.isInSimpleDrawMode = false;\n        this.draw.changeMode('simple_select', { featureIds: [] });\n        this.updateTooltipMessage();\n      }\n    }\n  }\n\n}\n\n","<div id=\"arlas-draw-tooltip\" class=\"draw-tooltip--hide\" [class.draw-tooltip--show]=\"drawTooltipMessage()\">\n    {{drawTooltipMessage() | translate}}</div>","\n/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { marker } from '@colsen1991/ngx-translate-extract-marker';\n\n\nexport const GET = 'get';\nexport const MATCH = 'match';\nexport const INTERPOLATE = 'interpolate';\nexport const OTHER = marker('other_color');\nexport const IN = 'in';\nexport const NOT_IN = '!';\nexport const HEATMAP_DENSITY = 'Heatmap-density';\n\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { HistogramData } from 'arlas-d3/histograms/utils/HistogramUtils';\n\nexport interface LegendData {\n  minValue?: string;\n  maxValue?: string;\n  keysColorsMap?: Map<string, string>;\n}\n\nexport interface Legend {\n  type?: PROPERTY_SELECTOR_SOURCE;\n  title?: string;\n  minValue?: string;\n  maxValue?: string;\n  fixValue?: string | number;\n  interpolatedValues?: Array<string | number>;\n  /** Map (field, (color & highlight)) */\n  manualValues?: Map<string, {color: string | number; highlight: boolean;}>;\n  visible?: boolean;\n  /** data to be plotted as histogram in the legend */\n  histogram?: Array<HistogramData>;\n}\n\nexport interface CircleLegend extends FillLegend {\n  radius: Legend;\n}\n\nexport interface FillLegend {\n  color: Legend;\n  colorPalette: string;\n  strokeColor: Legend;\n  strokeColorPalette: string;\n}\n\nexport interface HeatmapLegend {\n  color: Legend;\n  colorPalette: string;\n  radius: Legend;\n}\n\nexport interface LabelLegend {\n  color: Legend;\n  colorPalette: string;\n  size: Legend;\n}\n\nexport interface LineLegend {\n  color: Legend;\n  colorPalette: string;\n  dashes: Array<number>;\n  width: Legend;\n}\n\nexport enum PROPERTY_SELECTOR_SOURCE {\n  fix = 'Fix',\n  provided = 'Provided',\n  generated = 'Generated',\n  manual = 'Manual',\n  interpolated = 'Interpolated',\n  metric_on_field = 'Metric on field',\n  heatmap_density = 'Density'\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { HistogramData } from 'arlas-d3/histograms/utils/HistogramUtils';\n\nexport function getMax(data: Array<HistogramData>): number {\n    return Math.max(...data.map(hd => +hd.value));\n}\n\nexport const MAX_CIRLE_RADIUS = 7;\nexport const MAX_LINE_WIDTH = 10;\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { Injectable } from '@angular/core';\nimport { TranslateService } from '@ngx-translate/core';\nimport { HistogramData } from 'arlas-d3/histograms/utils/HistogramUtils';\nimport { Subject } from 'rxjs';\nimport tinycolor from 'tinycolor2';\nimport { HEATMAP_DENSITY, IN, INTERPOLATE, MATCH, NOT_IN, OTHER } from '../map/model/filters';\nimport { ArlasDataLayer } from '../map/model/layers';\nimport { CircleLegend, FillLegend, HeatmapLegend, LabelLegend, Legend, LegendData, LineLegend, PROPERTY_SELECTOR_SOURCE } from './legend.config';\nimport { getMax, MAX_CIRLE_RADIUS, MAX_LINE_WIDTH } from './legend.tools';\n\n\n@Injectable({\n  providedIn: 'root'\n})\nexport abstract class LegendService {\n  /** Emits for each layerId that was hovered the properties associated to the features in order to highlight the right ones in the legend */\n  protected highlightSource = new Subject<{layerId: string; properties: Array<{[name: string]: any;}>; }>();\n  public highlight$ = this.highlightSource.asObservable();\n\n  public abstract getCircleLegend(paint: any, visibileMode: boolean, legendData: Map<string, LegendData>, layer: ArlasDataLayer): CircleLegend;\n\n  public abstract getLineLegend(paint: any, visibileMode: boolean, legendData: Map<string, LegendData>, layer: ArlasDataLayer): LineLegend;\n\n  public abstract getFillLegend(paint: any, visibileMode: boolean, legendData: Map<string, LegendData>, layer: ArlasDataLayer): FillLegend;\n\n  public abstract getHeatmapLegend(paint: any, visibileMode: boolean, legendData: Map<string, LegendData>, layer: ArlasDataLayer): HeatmapLegend;\n\n  public abstract getLabelLegend(paint: any, visibileMode: boolean, legendData: Map<string, LegendData>, layer: ArlasDataLayer): LabelLegend;\n\n  /** Based on the paint of a layer and its type, returns the field used for the color matching */\n  public abstract getColorField(paint: any, layerType: string): string;\n\n  public highlightFeatures(layerId: string, features: Array<GeoJSON.Feature<GeoJSON.Geometry>>) {\n    this.highlightSource.next({layerId, properties: features.map(f => f.properties)});\n  }\n\n  public static setProvidedColorLegend(colorLegend: Legend, field: string,\n    legendData: Map<string, LegendData>, filter, translate: TranslateService) {\n    colorLegend.title = field;\n    if (!Array.isArray(field)) {\n      colorLegend.type = PROPERTY_SELECTOR_SOURCE.provided;\n      if (field.endsWith('_arlas__color')) {\n        colorLegend.type = PROPERTY_SELECTOR_SOURCE.generated;\n      }\n      colorLegend.manualValues = new Map();\n      if (legendData?.get(field)) {\n        const keysToColors = legendData.get(field).keysColorsMap;\n        const colorList = Array.from(keysToColors.keys()).map(k => [k, keysToColors.get(k)]).flat();\n        for (let i = 0; i < colorList.length; i += 2) {\n          colorLegend.manualValues.set(translate ? translate.instant(colorList[i]) : colorList[i], { color: colorList[i + 1], highlight: false});\n        }\n        if (colorList.length === 0) {\n          colorLegend.manualValues.set('', { color: '#eee', highlight: false });\n        }\n      } else {\n        colorLegend.manualValues.set('', { color: '#eee', highlight: false });\n      }\n      if (filter) {\n        LegendService.filterLegend(colorLegend.manualValues, filter,\n          (field).endsWith('_arlas__color') ? (field).slice(0, -13) : field);\n      }\n    }\n  }\n\n\n  public static setMatchColorLegend(colorLegend: Legend, colorExpression: any[], legendData: Map<string, LegendData>,\n    filter, translate: TranslateService) {\n    /** color = [\"match\", [\"get\", \"field\"], .... ]**/\n    colorLegend.type = PROPERTY_SELECTOR_SOURCE.manual;\n    const colorsLength = colorExpression.length;\n    let hasDefaultColor = false;\n    if (colorsLength % 2 !== 0) {\n      hasDefaultColor = true;\n    }\n    const field = colorExpression[1].length === 2 ? colorExpression[1][1] : '';\n    colorLegend.title = field;\n    colorLegend.manualValues = new Map();\n    let keysToColors: Map<string, string>;\n    if (legendData?.get(field + '_color')) {\n      // If there is a legendData, use only the colors in the keysToColors\n      keysToColors = legendData.get(field + '_color').keysColorsMap;\n    } else {\n      // If no legendData for this field, use all the colors of colorExpression\n      keysToColors = new Map();\n      for (let i = 2; i < colorExpression.length; i += 2) {\n        if (hasDefaultColor && i === colorsLength - 3) {\n          keysToColors.set(colorExpression[i] + '', colorExpression[i + 1]);\n          keysToColors.set(OTHER, colorExpression[i + 2]);\n          break;\n        } else {\n          keysToColors.set(colorExpression[i] + '', colorExpression[i + 1]);\n        }\n      }\n    }\n    for (let i = 2; i < colorExpression.length; i += 2) {\n      if (hasDefaultColor && i === colorsLength - 3) {\n        if (keysToColors.has(colorExpression[i] + '')) {\n          colorLegend.manualValues.set(translate ? translate.instant(colorExpression[i] + '') : colorExpression[i],\n            {color: colorExpression[i + 1], highlight: false});\n        }\n        colorLegend.manualValues.set(translate ? translate.instant(OTHER) : OTHER, {color: colorExpression[i + 2], highlight: false});\n        break;\n      } else if (keysToColors.has(colorExpression[i] + '')) {\n        colorLegend.manualValues.set(translate ? translate.instant(colorExpression[i] + '') : colorExpression[i],\n          {color: colorExpression[i + 1], highlight: false});\n      }\n    }\n\n    if (filter) {\n      LegendService.filterLegend(colorLegend.manualValues, filter, field);\n    }\n  }\n\n\n  public static setInterpolatedColorLegend(colorLegend: Legend, colorExpression: any[],\n    legendData: Map<string, LegendData>,\n    visibleMode: boolean) {\n    colorLegend.type = PROPERTY_SELECTOR_SOURCE.interpolated;\n    /** color = [\"interplate\", ['linear'], [\"get\", \"field\"], 0, 1... ]**/\n    // todo throw exception if interpolation is not linear\n    const field = colorExpression[2].length === 2 ? colorExpression[2][1] : HEATMAP_DENSITY;\n    colorLegend.title = field;\n    colorLegend.interpolatedValues = [];\n    const palette = [];\n    const colors = colorExpression.slice(3);\n    colors.forEach((c, i) => {\n      if (i % 2 === 0) {\n        palette.push({\n          proportion: c,\n          value: colors[i + 1]\n        });\n      }\n    });\n    const minimum = palette[0].proportion;\n    const maximum = palette.slice(-1)[0].proportion;\n    palette.forEach(c => colorLegend.interpolatedValues.push(c.value));\n    const colorValues = colorExpression.filter((c, i) => i > 2 && i % 2 !== 0);\n    if (legendData?.get(field) && field !== 'count') {\n      colorLegend.minValue = legendData.get(field).minValue;\n      colorLegend.maxValue = legendData.get(field).maxValue;\n      // For heatmaps, the count is used to fetch data, so we use it for the legend\n    } else if (field === HEATMAP_DENSITY && legendData?.get('count')) {\n      colorLegend.minValue = legendData.get('count').minValue;\n      colorLegend.maxValue = legendData.get('count').maxValue;\n    } else {\n      colorLegend.minValue = colorValues[0] + '';\n      colorLegend.maxValue = colorValues[colorValues.length - 1] + '';\n    }\n    if (!visibleMode) {\n      /** apply greyscale because the layer is not visible */\n      colorLegend.interpolatedValues = colorLegend.interpolatedValues\n        .map((c) => tinycolor(c.toString()).greyscale().lighten(20).toHexString());\n      palette.forEach(p => {\n        p.value = tinycolor(p.value.toString()).greyscale().lighten(20).toHexString();\n      });\n    }\n    return palette.map(c => c.value + ' ' + (100 * (c.proportion - minimum) / (maximum - minimum)) + '%').join(',');\n\n  }\n\n  public static filterLegend(colorLegendValues: Map<string, {color: string | number; highlight: boolean;}>, filter: any[], field: string) {\n    filter.forEach((f, idx) => {\n      if (idx !== 0 && idx !== filter.length - 1) {\n        switch (f[0]) {\n          case IN: {\n            if (f[1][1] === field) {\n              const valuesToKeep: Array<string> = f[2][1];\n              colorLegendValues.forEach((val, key) => {\n                if (!(valuesToKeep.includes(key))) {\n                  colorLegendValues.delete(key);\n                }\n              });\n            }\n            break;\n          }\n          case NOT_IN: {\n            if (f[1][0] === IN && f[1][1][1] === field) {\n              const valuesToExclude: Array<string> = f[1][2][1];\n              valuesToExclude.forEach(value => {\n                colorLegendValues.delete(value);\n              });\n            }\n            break;\n          }\n        }\n      }\n    });\n  }\n\n  public static buildColorLegend(colorExpression: string | any, visibleMode: boolean, legendData: Map<string, LegendData>,\n    filter?: any, translate?: TranslateService): [Legend, string] {\n    const colorLegend: Legend = { visible: true };\n    let colorPalette = '';\n    if (typeof colorExpression === 'string') {\n      colorLegend.type = PROPERTY_SELECTOR_SOURCE.fix;\n      colorLegend.fixValue = colorExpression;\n    } else if (Array.isArray(colorExpression)) {\n      if (colorExpression.length === 2) {\n        /** color = [\"get\", \"field\"]  ==> Generated or Provided */\n        const field = colorExpression[1];\n        colorLegend.title = field;\n        LegendService.setProvidedColorLegend(colorLegend, field, legendData, filter, translate);\n      } else if (colorExpression.length >= 3) {\n        if (colorExpression[0] === MATCH) {\n          LegendService.setMatchColorLegend(colorLegend, colorExpression, legendData, filter, translate);\n        } else if (colorExpression[0] === INTERPOLATE) {\n          colorPalette = LegendService.setInterpolatedColorLegend(colorLegend, colorExpression, legendData, visibleMode);\n        }\n      }\n    }\n\n    colorLegend.visible = visibleMode;\n    return [colorLegend, colorPalette];\n  };\n\n  public static buildRadiusLegend(radiusExpression: string | any, legendData: Map<string, LegendData>): Legend {\n    const radiusLegend: Legend = {};\n    const circleRadiusEvolution: Array<HistogramData> = new Array();\n    if (Array.isArray(radiusExpression)) {\n      if (radiusExpression.length >= 3) {\n        // Filter out the zoom-dependent radius layers (circle-heatmap)\n        if (radiusExpression[0] === INTERPOLATE && radiusExpression[2].length > 1) {\n          const field = radiusExpression[2][1];\n          radiusExpression.filter((w, i) => i >= 3).forEach((w, i) => {\n            if (i % 2 === 0) {\n              circleRadiusEvolution.push({ key: w, value: radiusExpression[i + 1 + 3] });\n            }\n          });\n          radiusLegend.title = field;\n          if (legendData?.get(field)) {\n            radiusLegend.minValue = legendData.get(field).minValue;\n            radiusLegend.maxValue = legendData.get(field).maxValue;\n          } else {\n            radiusLegend.minValue = circleRadiusEvolution[0].key + '';\n            radiusLegend.maxValue = circleRadiusEvolution[circleRadiusEvolution.length - 1].key + '';\n          }\n          radiusLegend.type = PROPERTY_SELECTOR_SOURCE.interpolated;\n          const maxCircleRadius = getMax(circleRadiusEvolution);\n          if (maxCircleRadius > MAX_CIRLE_RADIUS) {\n            circleRadiusEvolution.forEach(lw => lw.value = lw.value * MAX_CIRLE_RADIUS / maxCircleRadius);\n          }\n          radiusLegend.histogram = circleRadiusEvolution;\n        }\n      }\n    }\n    return radiusLegend;\n\n  };\n\n  protected static buildWidthLegend(lineWidth: number | any,\n    legendData: Map<string, LegendData>): Legend {\n    /** if the line width is fix then it is not added to the legend*/\n    const widthLegend: Legend = {};\n    if (Array.isArray(lineWidth)) {\n      if (lineWidth.length >= 3) {\n        if (lineWidth[0] === INTERPOLATE) {\n          const field = lineWidth[2][1];\n          widthLegend.title = field;\n          if (legendData?.get(field)) {\n            widthLegend.minValue = legendData.get(field).minValue;\n            widthLegend.maxValue = legendData.get(field).maxValue;\n          }\n          widthLegend.type = PROPERTY_SELECTOR_SOURCE.interpolated;\n          const lineWidthEvolution: Array<HistogramData> = new Array();\n          lineWidth.filter((w, i) => i >= 3).forEach((w, i) => {\n            if (i % 2 === 0) {\n              lineWidthEvolution.push({ key: w, value: lineWidth[i + 1 + 3] });\n            }\n          });\n          const maxLineWidth = getMax(lineWidthEvolution);\n          if (maxLineWidth > MAX_LINE_WIDTH) {\n            lineWidthEvolution.forEach(lw => lw.value = lw.value * MAX_LINE_WIDTH / maxLineWidth);\n          }\n          widthLegend.histogram = lineWidthEvolution;\n        }\n      }\n    }\n    return widthLegend;\n  }\n\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { FormControl, FormGroup, Validators } from '@angular/forms';\nimport { Observable } from 'rxjs';\n\n// eslint-disable-next-line max-len\nexport const DECIMAL_SEXAGESIMAL_REGEX = '^(?<decimal>[+-]?([0-9]*[.])?[0-9]+)$|^(?<degrees>(-?)[0-9]+)°[ ]*((?<minutes>[0-9]+)\\'[ ]*((?<seconds>[0-9]+)\\\")?)?$';\nexport class PointFormGroup extends FormGroup {\n\n    public latitude: FormControl;\n    public longitude: FormControl;\n\n    public latitudeChanges$: Observable<any>;\n    public longitudesChanges$: Observable<any>;\n\n    public constructor(initLat: number | string, initLng: number | string) {\n        const coordinatesRegex = DECIMAL_SEXAGESIMAL_REGEX;\n        const latitude = new FormControl(String(initLat), [\n            Validators.required,\n            Validators.pattern(coordinatesRegex)\n        ]);\n        const longitude = new FormControl(String(initLng), [\n            Validators.required,\n            Validators.pattern(coordinatesRegex),\n        ]);\n        super({\n            latitude,\n            longitude\n        });\n        this.latitude = latitude;\n        this.longitude = longitude;\n    }\n}\n\nexport class Coordinate {\n  /** Parses a coordinate in decimal or sexagesimal degrees and returns the decimal degrees */\n  public static parse(value: string) {\n    const coordinatesRegex = DECIMAL_SEXAGESIMAL_REGEX;\n    const parsedCoordinates = (String(value)).match(coordinatesRegex) as any;\n    if (parsedCoordinates && parsedCoordinates.groups) {\n      const groups = parsedCoordinates.groups;\n      if (groups.decimal) {\n        return +groups.decimal;\n      } else {\n        const degrees = +groups.degrees;\n        const minutes = +groups.minutes;\n        const seconds = +groups.seconds;\n        return this.dmsToDd(degrees, minutes, seconds);\n      }\n    }\n  }\n\n  /** DegreeMinutesSeconds to Decimal degree */\n  public static dmsToDd(degrees: number, minutes: number, seconds: number) {\n    const isNegative = (degrees < 0);\n    if (!minutes) {\n      minutes = 0;\n    }\n    if (!seconds) {\n      seconds = 0;\n    }\n    const dd = Math.abs(degrees) + minutes / 60 + seconds / 3600;\n    return isNegative ? -dd : dd;\n  }\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { Pipe, PipeTransform } from '@angular/core';\nimport { FormControl, FormGroup } from '@angular/forms';\nimport { marker } from '@colsen1991/ngx-translate-extract-marker';\n\n@Pipe({\n  name: 'coordinatesFormError'\n})\nexport class CoordinatesErrorPipe implements PipeTransform {\n\n  public transform(formControl: FormControl | FormGroup): string {\n    if (formControl.hasError('required')) {\n      return marker('You must enter a coordinate');\n    }\n    return formControl.hasError('pattern') ? marker('1.1 or 1°6\\'3\"') : '';\n  }\n\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';\nimport { Coordinate, PointFormGroup } from '../bbox-generator/coordinates.tools';\nimport { FormControl, FormGroup } from '@angular/forms';\nimport { marker } from '@colsen1991/ngx-translate-extract-marker';\n\n@Component({\n  selector: 'arlas-coordinates',\n  templateUrl: './coordinates.component.html',\n  styleUrls: ['./coordinates.component.scss']\n})\nexport class CoordinatesComponent implements OnInit {\n  @Input() public currentLat: string;\n  @Input() public currentLng: string;\n\n  /**\n   * @constant\n   */\n  public placeHolder = marker('1.1 or 1°6\\'3\"');\n\n  @Output() public moveToCoordinates$: EventEmitter<[number, number]> = new EventEmitter();\n  public coordinatesForm: PointFormGroup;\n  public editionMode = false;\n\n  public ngOnInit(): void {\n    this.coordinatesForm = new PointFormGroup(this.currentLat, this.currentLng);\n  }\n\n  public switchToEditionMode() {\n    this.editionMode = true;\n    this.coordinatesForm.latitude.setValue(this.currentLat);\n    this.coordinatesForm.longitude.setValue(this.currentLng);\n  }\n\n  public moveToCoordinates() {\n    const lat = Coordinate.parse(this.coordinatesForm.latitude.value);\n    const lng = Coordinate.parse(this.coordinatesForm.longitude.value);\n    this.moveToCoordinates$.emit([lng, lat]);\n    this.editionMode = false;\n    this.currentLat = String(lat);\n    this.currentLng = String(lng);\n  }\n\n}\n","<div class=\"current-coordinate\" (click)=\"switchToEditionMode()\" (keyDown)=\"switchToEditionMode()\" [matTooltip]=\"'Enter coordinates and centre the map' | translate\"\n  matTooltipPosition=\"above\" *ngIf=\"!editionMode; else editing\">\n  <span class=\"lat\"> {{ 'Lat:' | translate }} {{ currentLat | number:'1.5-5' }} </span>\n  <span class=\"lng\"> {{ 'Lng:' | translate }} {{ currentLng | number:'1.5-5' }} </span>\n</div>\n<ng-template #editing>\n  <div class=\"current-coordinate-edition\">\n    <div class=\"section\" [formGroup]=\"coordinatesForm\">\n      <mat-form-field appearance=\"outline\">\n        <mat-label>{{'Latitude' | translate}}</mat-label>\n        <input class=\"input\" matInput [formControl]=\"coordinatesForm.latitude\"\n          [placeholder]=\"placeHolder | translate\">\n        <mat-error *ngIf=\"coordinatesForm.latitude.invalid\">{{coordinatesForm.latitude | coordinatesFormError | translate}}\n        </mat-error>\n      </mat-form-field>\n      <div class=\"coordinate\">\n        <mat-form-field appearance=\"outline\">\n          <mat-label>{{'Longitude' | translate}}</mat-label>\n          <input class=\"input\" matInput [formControl]=\"coordinatesForm.longitude\"\n            [placeholder]=\"placeHolder | translate\">\n          <mat-error *ngIf=\"coordinatesForm.longitude.invalid\">{{coordinatesForm.longitude | coordinatesFormError |\n            translate}}</mat-error>\n        </mat-form-field>\n      </div>\n      <button class=\"move\" mat-stroked-button (click)=\"moveToCoordinates()\"\n        [disabled]=\"coordinatesForm.invalid\">\n        <span class=\"label\">{{'Move to' | translate}}</span>\n      </button>\n    </div>\n    <div class=\"exit\" (click)=\"editionMode = false\" (keyDown)=\"editionMode = false\">\n      <mat-icon>clear</mat-icon>\n    </div>\n  </div>\n</ng-template>","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output } from '@angular/core';\nimport { takeUntil } from 'rxjs';\nimport { Subject } from 'rxjs/internal/Subject';\nimport { AbstractArlasMapGL } from '../map/AbstractArlasMapGL';\nimport { ArlasMapSource } from '../map/model/sources';\nimport { BasemapStyle } from './basemap.config';\nimport { BasemapService } from './basemap.service';\nimport { ArlasBasemaps } from './basemaps.model';\n\n@Component({\n  selector: 'arlas-basemap',\n  templateUrl: './basemap.component.html',\n  styleUrls: ['./basemap.component.scss']\n})\n/** L: a layer class/interface.\n *  S: a source class/interface.\n *  M: a Map configuration class/interface.\n */\nexport class BasemapComponent<L, S, M>implements OnInit, OnDestroy {\n\n  private readonly _onDestroy$ = new Subject<boolean>();\n\n  @Input() public map: AbstractArlasMapGL;\n  @Input() public mapSources: Array<ArlasMapSource<any>>;\n\n  @Output() public basemapChanged = new EventEmitter<void>();\n  @Output() public blur = new Subject<void>();\n\n  public showList = false;\n  public basemaps: ArlasBasemaps;\n\n  private readonly basemapService = inject(BasemapService<L, S, M>);\n  public constructor() {\n    this.basemapService.basemapChanged$.pipe(takeUntil(this._onDestroy$)).subscribe(() => this.basemapChanged.emit());\n  }\n\n  public ngOnInit(): void {\n    this.initBasemaps();\n  }\n\n  protected initBasemaps() {\n    this.basemaps = this.basemapService.basemaps;\n    if (this.basemaps) {\n      const styles = this.basemaps.styles();\n      if (styles) {\n        this.showList = styles.length > 0;\n        styles.filter(bm => !bm.image).forEach(bm => {\n          if (bm.type !== 'protomap' && !!bm.url) {\n            const splitUrl = bm.url.split('/style.json?key=');\n            if (splitUrl.length === 2) {\n              bm.image = `${splitUrl[0]}/0/0/0.png?key=${splitUrl[1]}`;\n            }\n          }\n        });\n      }\n    }\n  }\n\n  /** Removes the old basemap and set the new one that is given as a parameter\n   * @param newBasemap: Basemap selected by the user\n   */\n  public onChangeBasemap(newBasemap: BasemapStyle) {\n    const selectedBasemap = this.basemaps.getSelected();\n    if (selectedBasemap.type === 'protomap') {\n      this.basemapService.removeProtomapBasemap(this.map);\n    }\n    this.setBaseMapStyle(newBasemap);\n  }\n\n  public setBaseMapStyle(newBasemap: BasemapStyle) {\n    if (this.map) {\n      this.basemapService.setBasemap(this.basemaps.getSelected().styleFile as any, newBasemap, this.map, this.mapSources);\n    }\n  }\n\n  public ngOnDestroy() {\n    this._onDestroy$.next(true);\n    this._onDestroy$.complete();\n  }\n\n}\n","<div *ngIf=\"showList\" class=\"basemap-container\">\n  <ng-container *ngFor=\"let style of basemaps?._styles\">\n    <div *ngIf=\"!style.errored\" class=\"basemap\" [class.selected]=\"style.name === basemaps?._selectedStyle?.name\"\n    (click)=\"onChangeBasemap(style)\" (keyDown)=\"onChangeBasemap(style)\">\n      <div class=\"image\">\n        <img *ngIf=\"!!style?.image && style?.image !== ''\" src=\"{{style?.image}}\" (error)=\"style.image = null\" />\n        <div *ngIf=\"!style?.image || (!!style?.image && style?.image === '')\" class=\"no-image\">\n          <mat-icon>wallpaper</mat-icon>\n        </div>\n        <div class=\"name\">{{style.name | translate}}</div>\n      </div>\n    </div>\n  </ng-container>\n</div>\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { Component, ViewChild, ElementRef, Input, AfterViewInit, SimpleChanges, OnChanges } from '@angular/core';\nimport { select } from 'd3-selection';\nimport { ArlasDataLayer, CellShape } from '../../map/model/layers';\nimport { Legend, PROPERTY_SELECTOR_SOURCE } from '../legend.config';\n\n@Component({\n  selector: 'arlas-layer-icon',\n  templateUrl: './layer-icon.component.html',\n  styleUrls: ['./layer-icon.component.scss']\n})\nexport class LayerIconComponent implements AfterViewInit, OnChanges {\n  @Input() public layer: ArlasDataLayer;\n  @Input() public colorLegend: Legend = {};\n  @Input() public strokeColorLegend: Legend = {};\n  @Input() public widthLegend: Legend = {};\n  @Input() public radiusLegend: Legend = {};\n  @Input() public lineDasharray: Array<number>;\n  @ViewChild('layer_icon', { read: ElementRef, static: false }) public layerIconElement: ElementRef;\n\n  public constructor() {\n  }\n\n  public ngAfterViewInit() {\n    if (this.layer) {\n      this.drawIcons();\n    }\n  }\n\n  public ngOnChanges(changes: SimpleChanges) {\n    if (changes['layer'] !== undefined) {\n      if (this.layer && this.layerIconElement) {\n        this.drawIcons();\n      }\n    }\n  }\n\n  private drawIcons(): void {\n    const type = this.layer.type;\n    const source: string = this.layer.source as string;\n    switch (type) {\n      case 'circle':\n      case 'circle-heatmap': {\n        if (source.startsWith('feature-metric')) {\n          drawFeatureCircleIcon(this.layerIconElement.nativeElement, this.colorLegend, this.strokeColorLegend, true);\n        } else if (source.startsWith('feature')) {\n          drawFeatureCircleIcon(this.layerIconElement.nativeElement, this.colorLegend, this.strokeColorLegend);\n        } else if (source.startsWith('cluster')) {\n          const addBlur = type === 'circle-heatmap';\n          drawClusterCircleIcon(this.layerIconElement.nativeElement, this.colorLegend, this.strokeColorLegend, addBlur);\n        }\n        break;\n      }\n      case 'line': {\n        if (source.startsWith('feature-metric')) {\n          drawLineIcon(this.layerIconElement.nativeElement, this.colorLegend, this.lineDasharray, true);\n        } else {\n          drawLineIcon(this.layerIconElement.nativeElement, this.colorLegend, this.lineDasharray);\n        }\n        break;\n      }\n      case 'fill': {\n        if (source.startsWith('cluster')) {\n          const fillShape = this.layer.metadata?.cellShape ?? this.layer?.metadata['cell-shape'];\n          drawClusterFillIcon(this.layerIconElement.nativeElement, this.colorLegend, this.strokeColorLegend, fillShape);\n        } else if (source.startsWith('feature-metric')) {\n          drawFeatureFillIcon(this.layerIconElement.nativeElement, this.colorLegend, this.strokeColorLegend, true);\n        } else {\n          drawFeatureFillIcon(this.layerIconElement.nativeElement, this.colorLegend, this.strokeColorLegend);\n        }\n        break;\n      }\n      case 'heatmap': {\n        drawHeatmapIcon(this.layerIconElement.nativeElement, this.colorLegend, this.layer.source.toString().startsWith('feature-metric'));\n        break;\n      }\n      case 'symbol': {\n        const l: any = (this.layer.layout);\n        if (l['text-field']) {\n          drawTextIcon(this.layerIconElement.nativeElement, this.colorLegend);\n        }\n      }\n    }\n  }\n\n}\n\n/**\n * Draws the rectangles icon for cluster mode\n * @param svgNode SVG element on which we append the rectangles using d3.\n * @param colorLegend Color legend, to give the drawn icons rectangles the same color on the map\n * @param strokeColorLegend Color legend, to give the drawn icons rectangles the same stroke color on the map\n * @param fillShape used to define a more precise shape for an icon\n */\nexport function drawClusterFillIcon(svgNode: SVGElement, colorLegend: Legend, strokeColorLegend: Legend, fillShape?: CellShape) {\n  const fillFourColors = getClusterFillColors(colorLegend);\n  let strokeFourColors = fillFourColors;\n  if (strokeColorLegend) {\n    strokeFourColors = getClusterFillColors(strokeColorLegend);\n  }\n  const svg = select(svgNode);\n  svg.selectAll('g').remove();\n  if(fillShape === 'hexagonal') {\n     [\n      drawHexagon(12, 4, 5),\n      drawHexagon(5, 8, 4.5),\n      drawHexagon(11.5, 11.7, 4),\n    ].forEach((hex, i) => {\n       svg.append('g').append('polygon')\n         .data([hex])\n         .attr('points', (d) => d.map(d => [d.x, d.y].join(',')).join(' '))\n         .attr('fill', fillFourColors[i])\n         .attr('fill-opacity', 0.8)\n         .attr('stroke', strokeFourColors[i]).attr('stroke-width', 0.6);\n     });\n  } else {\n    svg.append('g').append('rect')\n      .attr('height', 7).attr('width', 7)\n      .attr('fill', fillFourColors[0]).attr('fill-opacity', 0.8)\n      .attr('stroke', strokeFourColors[0]).attr('stroke-width', 0.6)\n      .attr('y', 3).attr('x', 3);\n    svg.append('g').append('rect')\n      .attr('height', 7).attr('width', 7)\n      .attr('fill', fillFourColors[1]).attr('fill-opacity', 0.6)\n      .attr('stroke', strokeFourColors[1]).attr('stroke-width', 0.6)\n      .attr('y', 10).attr('x', 3);\n    svg.append('g').append('rect')\n      .attr('height', 7).attr('width', 7)\n      .attr('fill', fillFourColors[2]).attr('fill-opacity', 0.6)\n      .attr('stroke', strokeFourColors[2]).attr('stroke-width', 0.6)\n      .attr('y', 10).attr('x', 10);\n    svg.append('g').append('rect')\n      .attr('height', 7).attr('width', 7)\n      .attr('fill', fillFourColors[3]).attr('fill-opacity', 0.6)\n      .attr('stroke', strokeFourColors[3]).attr('stroke-width', 0.6)\n      .attr('y', 3).attr('x', 10);\n  }\n}\n\n/**\n * Draws the hexagon icon for cluster h3 mode\n * @param x\n * @param y\n * @param r rayon\n */\nexport function drawHexagon(x: number, y: number, r: number) {\n  const a = 2 * Math.PI / 6;\n  const data = [];\n  for (let i = 0; i < 6; i++) {\n    data.push({x: x + r * Math.cos(a * i), y: y + r * Math.sin(a * i)});\n  }\n  return data;\n}\n\n/**\n * Draws the rectangles icon for feature and feature-metric modes\n * @param svgNode SVG element on which we append the rectangles using d3.\n * @param colorLegend Color legend, to give the drawn icons rectangles the same color on the map\n * @param strokeColorLegend Color legend, to give the drawn icons rectangles the same stroke color on the map\n * @param [isMetric=false] Whether the layer depends on a metric\n */\nexport function drawFeatureFillIcon(svgNode: SVGElement, colorLegend: Legend, strokeColorLegend: Legend, isMetric = false) {\n  const fillColor = getOneColor(colorLegend);\n  let strokeColor = fillColor;\n  if (strokeColorLegend) {\n    strokeColor = getOneColor(strokeColorLegend);\n  }\n  const polygon = [\n    { 'x': 0, 'y': 2 },\n    { 'x': 18, 'y': 2 },\n    { 'x': 13, 'y': 18 },\n    { 'x': 1, 'y': 18 },\n    { 'x': 8, 'y': 9 },\n    { 'x': 0, 'y': 2 }];\n  const svg = select(svgNode);\n  svg.selectAll('g').remove();\n  svg.append('g').selectAll('polygon')\n    .data([polygon])\n    .enter().append('polygon')\n    .attr('points', (d) => d.map(d => [d.x, d.y].join(',')).join(' ')).attr('fill', fillColor)\n    .attr('fill-opacity', 0.5)\n    .attr('stroke', strokeColor)\n    .attr('stroke-width', 0.9);\n  if (isMetric) {\n    svg.append('g').append('text').text('∑')\n      .attr('x', 14).attr('y', 14).attr('font-size', '0.5em').attr('font-weight', 'bold').attr('fill', colorLegend.fixValue);\n  }\n}\n\n\nexport function getOneColor(legend: Legend): string {\n  let color = '';\n  if (legend.type === PROPERTY_SELECTOR_SOURCE.interpolated) {\n    const iv = legend.interpolatedValues;\n    color = iv[0] + '';\n  } else if (legend.type === PROPERTY_SELECTOR_SOURCE.fix) {\n    color = legend.fixValue + '';\n  } else if (legend.type === PROPERTY_SELECTOR_SOURCE.manual || legend.type === PROPERTY_SELECTOR_SOURCE.generated\n    || legend.type === PROPERTY_SELECTOR_SOURCE.provided) {\n    const mv = legend.manualValues;\n    color = mv.values().next().value.color;\n  }\n  return color;\n}\n\n\nexport function drawTextIcon(svgNode: SVGElement, colorLegend: Legend) {\n  const svg = select(svgNode);\n  svg.selectAll('g').remove();\n  svg.append('g').append('text').text(' T ').attr('transform', ' translate(5 0)')\n    .attr('y', 14).attr('font-size', '0.9em').attr('font-family', 'Garamond').attr('fill', colorLegend.fixValue);\n}\n\n/**\n * draws the heatmap icon for cluster mode\n * @param svgNode SVG element on which we append the heamap circles using d3.\n * @param colorLegend Color legend, to give the drawn icons circles the same color on the map\n * @param small Whether to create a small version of the icon\n */\nexport function drawHeatmapIcon(svgNode: SVGElement, colorLegend: Legend, small: boolean) {\n  const heatmapColors = [];\n  if (colorLegend.type === PROPERTY_SELECTOR_SOURCE.interpolated) {\n    const iv = colorLegend.interpolatedValues;\n    if (iv) {\n      if (iv.length === 1) {\n        heatmapColors.push(iv[0], iv[0], iv[0]);\n      } else if (iv.length === 2) {\n        heatmapColors.push(iv[0], iv[0], iv[1]);\n      } else if (iv.length === 3) {\n        heatmapColors.push(iv[1], iv[Math.trunc(iv.length / 2)], iv[iv.length - 1]);\n      } else if (iv.length >= 4) {\n        heatmapColors.push(iv[1], iv[Math.trunc(iv.length / 3)], iv[Math.trunc(2 * iv.length / 3)], iv[iv.length - 1]);\n      }\n    }\n  }\n  const svg = select(svgNode);\n  svg.selectAll('defs').remove();\n  svg.append('defs')\n    .append('filter').attr('id', 'blur')\n    .append('feGaussianBlur').attr('stdDeviation', 0.8);\n  if (small) {\n    svg.selectAll('g').remove();\n    svg.append('g')\n      .append('circle')\n      .attr('cx', 10).attr('cy', 10)\n      .attr('r', 7)\n      .style('fill', heatmapColors[0])\n      .attr('filter', 'url(#blur)');\n  } else {\n    svg.selectAll('circle').remove();\n    svg.selectAll('circle')\n      .data(heatmapColors).enter()\n      .append('circle')\n      .attr('cx', 10).attr('cy', 10)\n      .attr('r', (d, i) => {\n        if (i === 0) {\n          return 10;\n        }\n        if (i === 1) {\n          return 8;\n        }\n        if (i === 2) {\n          return 6;\n        }\n        if (i === 3) {\n          return 3;\n        }\n      })\n      .style('fill', (d, i) => d)\n      .attr('filter', 'url(#blur)');\n  }\n}\n\n/**\n * Draws the line icon for feature mode\n * @param svgNode SVG element on which we append the line using d3.\n * @param colorLegend Color legend, to give the drawn icons line the same color on the map\n * @param dashArray Array representing the dash pattern\n * @param [isMetric=false] Whether the layer depends on a metric\n */\nexport function drawLineIcon(svgNode: SVGElement, colorLegend: Legend, dashArray: Array<number>, isMetric = false) {\n  let lineColor = '';\n  if (colorLegend.type === PROPERTY_SELECTOR_SOURCE.fix) {\n    lineColor = colorLegend.fixValue + '';\n  } else if (colorLegend.type === PROPERTY_SELECTOR_SOURCE.interpolated) {\n    const iv = colorLegend.interpolatedValues;\n    if (iv) {\n      lineColor = iv[0] + '';\n    } else {\n      lineColor = '#2da4ff';\n    }\n  } else if (colorLegend.type === PROPERTY_SELECTOR_SOURCE.manual || colorLegend.type === PROPERTY_SELECTOR_SOURCE.generated\n    || colorLegend.type === PROPERTY_SELECTOR_SOURCE.provided) {\n    const mv = colorLegend.manualValues;\n    lineColor = mv.values().next().value.color;\n  }\n  let svgDashArray = '0';\n  if (!!dashArray && dashArray.length > 1) {\n    const joinedDashArray = dashArray.join(',');\n    if (joinedDashArray === '2,5') {\n      svgDashArray = '0, 2, 3';\n    } else if (joinedDashArray === '0.1,5') {\n      svgDashArray = '1,2.5';\n    } else {\n      svgDashArray = '4,2,1';\n    }\n  }\n  const svg = select(svgNode);\n  svg.selectAll('g').remove();\n  svg.append('g').append('line')\n    .attr('x1', 0).attr('y1', 18)\n    .attr('x2', 6).attr('y2', 10)\n    .attr('cx', 2).attr('cy', 2)\n    .attr('stroke', lineColor).attr('stroke-width', 1.5).attr('stroke-dasharray', svgDashArray);\n  svg.append('g').append('line')\n    .attr('x1', 6).attr('y1', 10)\n    .attr('x2', 12).attr('y2', 4)\n    .attr('cx', 2).attr('cy', 2)\n    .attr('stroke', lineColor).attr('stroke-width', 1.5).attr('stroke-dasharray', svgDashArray);\n  svg.append('g').append('line')\n    .attr('x1', 12).attr('y1', 4)\n    .attr('x2', 18).attr('y2', 0)\n    .attr('cx', 2).attr('cy', 2)\n    .attr('stroke', lineColor).attr('stroke-width', 1.5).attr('stroke-dasharray', svgDashArray);\n  if (isMetric) {\n    svg.append('g').append('text').text('∑')\n      .attr('x', 10).attr('y', 16).attr('font-size', '0.5em').attr('font-weight', 'bold').attr('fill', colorLegend.fixValue);\n  }\n}\n\n/**\n * Draws the circle icon for feature mode\n * @param svgNode SVG element on which we append the circles using d3.\n * @param colorLegend Color legend, to give the drawn icons circles the same color on the map\n * @param strokeColorLegend Color legend, to give the drawn icons circles the same stroke color on the map\n * @param [isMetric=false] Whether the layer depends on a metric\n */\nexport function drawFeatureCircleIcon(svgNode: SVGElement, colorLegend: Legend, strokeColorLegend: Legend, isMetric = false) {\n  const colorsList = [];\n  const strokeColorsList = [];\n  populateListFromLegend(colorsList, colorLegend);\n  populateListFromLegend(strokeColorsList, strokeColorLegend);\n\n  const svg = select(svgNode);\n  svg.selectAll('circle').remove();\n  svg.selectAll('g').remove();\n  svg.selectAll('circle')\n    .data(colorsList).enter()\n    .append('circle')\n    .attr('cx', (d, i) => {\n      if (colorsList.length === 1) {\n        return 10;\n      } else {\n        if (i === 0) {\n          return 6;\n        }\n        if (i === 1) {\n          return 12;\n        }\n        if (i === 2) {\n          return 5;\n        }\n      }\n    })\n    .attr('cy', (d, i) => {\n      if (colorsList.length === 1) {\n        return 10;\n      } else {\n        if (i === 0) {\n          return 5;\n        }\n        if (i === 1) {\n          return 10;\n        }\n        if (i === 2) {\n          return 15;\n        }\n      }\n    })\n    .attr('r', (d, i) => {\n      if (colorsList.length === 1) {\n        return 7;\n      } else {\n        return 3;\n      }\n    })\n    .style('fill', (d, i) => d).style('fill-opacity', colorsList.length === 1 ? 0.6 : 0.8)\n    .style('stroke', (d, i) => strokeColorsList[i]).style('stroke-width', 0.5);\n\n  if (isMetric) {\n    svg.append('g').append('text').text('∑')\n      .attr('x', 10).attr('y', 16).attr('font-size', '0.5em').attr('font-weight', 'bold').attr('fill', colorLegend.fixValue);\n  }\n}\n\n\n/**\n * draws the circle icon for cluster mode\n * @param svgNode SVG element on which we append the circles using d3.\n * @param colorLegend Color legend, to give the drawn icons circles the same color on the map\n * @param strokeColorLegend Color legend, to give the drawn icons circles the same stroke color on the map\n * @param addBlur Whether to add blur to the drawn circles\n */\nexport function drawClusterCircleIcon(svgNode: SVGElement, colorLegend: Legend, strokeColorLegend: Legend, addBlur = false) {\n  // todo include radius legend in drawing icons\n  const colorsList = [];\n  const strokeColorsList = [];\n  populateListFromLegend(colorsList, colorLegend);\n  populateListFromLegend(strokeColorsList, strokeColorLegend);\n  const svg = select(svgNode);\n  svg.selectAll('circle').remove();\n  svg.append('defs')\n    .append('filter')\n    .attr('id', 'blurHeatmapCircle')\n    .attr('x', '-10%')\n    .attr('y', '-40%')\n    .attr('width', '160%')\n    .attr('height', '160%')\n    .append('feGaussianBlur').attr('stdDeviation', 1.9);\n  svg.selectAll('circle')\n    .data(colorsList).enter()\n    .append('circle')\n    .attr('cx', (d, i) => {\n      if (i === 0) {\n        return 12;\n      }\n      if (i === 1) {\n        return 6;\n      }\n      if (i === 2) {\n        return 10;\n      }\n    })\n    .attr('cy', (d, i) => {\n      if (i === 0) {\n        return 7;\n      }\n      if (i === 1) {\n        return 11;\n      }\n      if (i === 2) {\n        return 15;\n      }\n    })\n    .attr('r', (d, i) => {\n      if (i === 0) {\n        return 6;\n      }\n      if (i === 1) {\n        return 5;\n      }\n      if (i === 2) {\n        return 3;\n      }\n    })\n    .style('fill', (d, i) => d).style('fill-opacity', 0.7)\n    .style('stroke', (d, i) => strokeColorsList[i]).style('stroke-width', 0.8);\n\n  if (addBlur) {\n    svg.selectAll('circle').attr('filter', 'url(#blurHeatmapCircle)');\n  }\n\n}\n\n\nexport function populateListFromLegend(list: Array<string | number>, legend: Legend) {\n  if (legend.type === PROPERTY_SELECTOR_SOURCE.fix) {\n    list.push(legend.fixValue);\n    list.push(legend.fixValue);\n    list.push(legend.fixValue);\n  } else if (legend.type === PROPERTY_SELECTOR_SOURCE.interpolated) {\n    const iv = legend.interpolatedValues;\n    if (iv?.length === 1) {\n      list.push(iv[0], iv[0], iv[0]);\n    } else if (iv.length === 2) {\n      list.push(iv[0], iv[0], iv[1]);\n    } else if (iv.length >= 3) {\n      list.push(iv[0], iv[Math.trunc(iv.length / 2)], iv[iv.length - 1]);\n    }\n  } else if (legend.type === PROPERTY_SELECTOR_SOURCE.manual || legend.type === PROPERTY_SELECTOR_SOURCE.generated\n    || legend.type === PROPERTY_SELECTOR_SOURCE.provided) {\n    const iv = legend.manualValues;\n    if (iv) {\n      if (iv.size === 1) {\n        const color = iv.values().next().value.color;\n        list.push(color, color, color);\n      } else if (iv.size === 2) {\n        list.push(Array.from(iv.values())[0].color, Array.from(iv.values())[0].color, Array.from(iv.values())[1].color);\n      } else if (iv.size >= 3) {\n        list.push(Array.from(iv.values())[0].color, Array.from(iv.values())[Math.trunc(Array.from(iv.keys()).length / 2)].color,\n          Array.from(iv.values())[Array.from(iv.keys()).length - 1].color);\n      }\n    } else if (!iv || iv.size === 0) {\n      list.push('#eee', '#eee', '#eee');\n    }\n  }\n}\n\nexport function getClusterFillColors(colorLegend: Legend): string[] {\n  const fourColors = [];\n  if (colorLegend.type === PROPERTY_SELECTOR_SOURCE.interpolated) {\n    const iv = colorLegend.interpolatedValues;\n    if (iv) {\n      if (iv.length === 1) {\n        for (let i = 0; i < 4; i++) {\n          fourColors.push(iv[0]);\n        }\n      } else if (iv.length === 2) {\n        fourColors.push(iv[0]);\n        fourColors.push(iv[1]);\n        fourColors.push(iv[0]);\n        fourColors.push(iv[1]);\n      } else if (iv.length >= 3) {\n        fourColors.push(iv[0]);\n        fourColors.push(iv[Math.trunc(2 * iv.length / 3)]);\n        fourColors.push(iv[iv.length - 1]);\n        fourColors.push(iv[Math.trunc(iv.length / 3)]);\n      }\n    }\n  } else if (colorLegend.type === PROPERTY_SELECTOR_SOURCE.fix) {\n    const c = colorLegend.fixValue;\n    fourColors.push(c, c, c, c);\n  }\n  return fourColors;\n}\n","<div class=\"legend-icon\">\n  <svg #layer_icon class=\"legend-icon__svg\"></svg>\n</div>\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\nimport { Pipe, PipeTransform } from '@angular/core';\nimport { marker } from '@colsen1991/ngx-translate-extract-marker';\nimport { CollectionService } from 'arlas-web-components';\n\nexport interface LegendParamsResult {\n  translateKey: string;\n  field?: string;\n  normalized?: string;\n  normalizedKey?: string;\n  metric?: string;\n  format: ParamsResultType;\n}\n\n/**\n * full :\n *  return all interpolated values to construct a title legend\n *  ex: Average of boats (normalized)\n * metricField :\n *  return metric and field interpolated values.\n *  ex: Average of boats\n * metricNormalised :\n *   return metric and normalized interpolated values.\n *   ex: count (normalized)\n * noMetric :\n *   return field and normalized interpolated values.\n *   ex: Boat visibility (normalized)\n * original\n *   return the original key to be translated. This case appear only if we fail\n *   to parse of if we have an error.\n */\nexport type  ParamsResultType = 'full' | 'metricField' | 'metricNormalised' | 'noMetric' | 'original';\n\n@Pipe({\n  name: 'formatLegend'\n})\nexport class FormatLegendPipe implements PipeTransform {\n\n  public constructor(private readonly collectionService: CollectionService) {\n  }\n  private readonly metrics: string[] = [\n    'avg',\n    'sum',\n    'min',\n    'max',\n    'cardinality',\n    'count'\n  ];\n\n  public transform(field: string): LegendParamsResult | null {\n    let params: LegendParamsResult = {\n      translateKey: this.collectionService.getDisplayFieldName(field),\n      format: 'original'\n    };\n\n    if (!field) {\n      return null;\n    }\n\n    const parts = field.split(':');\n    // Regular normalized\n    const containsNormalizedPartOrMetric = parts.length === 2\n      // Normalized by key\n      || parts.length === 3\n      // Metric\n      || (parts.length === 1 && this.containsMetrics(parts[0]));\n\n    if (containsNormalizedPartOrMetric) {\n      const valueSplit = parts[0].split('_');\n      if (valueSplit.length === 0) {\n        return params;\n      }\n\n      const hasExtraEmptyValue = valueSplit[valueSplit.length - 1] === '';\n      if (hasExtraEmptyValue) {\n        valueSplit.splice(valueSplit.length - 1, 1);\n      }\n\n      const metric = this.getMetric(valueSplit);\n      const field = this.getField(valueSplit);\n      const normalized = parts[1] ?? '';\n      const normalizedKey =  parts[2] ?? '';\n      params = this.buildInterpolatedParams(params, metric, field, normalized, normalizedKey);\n    } else if (parts[0].endsWith('_arlas__color')){\n      params.translateKey = this.collectionService.getDisplayFieldName(params.translateKey.replace('_arlas__color', ''));\n    }\n\n    return params;\n  }\n\n  public buildInterpolatedParams(params: LegendParamsResult, metric: string, field: string,\n      normalized: string, normalizedKey: string): LegendParamsResult {\n    const legendParams: LegendParamsResult = {\n      ...params,\n      field: this.collectionService.getDisplayFieldName(field),\n      normalized: '',\n      metric,\n    };\n\n    if (!metric) {\n      legendParams.format = 'noMetric';\n      legendParams.translateKey = marker('legend without metric');\n    } else if (field && normalized) {\n      legendParams.format = 'full';\n      legendParams.translateKey = marker('legend');\n    } else if (field) {\n      legendParams.format = 'metricField';\n      legendParams.translateKey =  marker('legend without normalized');\n    } else if (normalized) {\n      legendParams.format = 'metricNormalised';\n      legendParams.translateKey =  marker('legend without field');\n    }\n\n    if (normalized) {\n      if (normalizedKey) {\n        legendParams.normalized = marker('normalized by key');\n        legendParams.normalizedKey = normalizedKey;\n      } else {\n        legendParams.normalized = marker('normalized');\n      }\n    }\n\n    return legendParams;\n  }\n\n  public getMetric(valueSplit: string[]) {\n    if (this.isMetrics(valueSplit[valueSplit.length - 1])) {\n      return valueSplit[valueSplit.length - 1];\n    }\n  }\n\n  public getField(valueSplit: string[]) {\n    // If last split is a metric, then exclude it\n    if (this.isMetrics(valueSplit[valueSplit.length - 1])) {\n      return valueSplit.slice(0, valueSplit.length - 1).join('_');\n    }\n    return valueSplit.join('_');\n  }\n\n  public isMetrics(metrics: string) {\n    return this.metrics.includes(metrics);\n  }\n\n  public containsMetrics(value: string) {\n    for (const metric of this.metrics) {\n      if (value.includes(metric)) {\n        return true;\n      }\n    }\n  }\n\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { Component, DestroyRef, ElementRef, Input, signal, ViewChild } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { filter } from 'rxjs';\nimport { OTHER } from '../../map/model/filters';\nimport { ArlasDataLayer } from '../../map/model/layers';\nimport { Legend, PROPERTY_SELECTOR_SOURCE } from '../legend.config';\nimport { LegendService } from '../legend.service';\nimport { TranslateService } from '@ngx-translate/core';\n\n@Component({\n  selector: 'arlas-legend-item',\n  templateUrl: './legend-item.component.html',\n  styleUrls: ['./legend-item.component.scss']\n})\nexport class LegendItemComponent {\n  @Input() public legend: Legend;\n  @Input() public title: string;\n  @Input() public layer: ArlasDataLayer;\n  @Input() public colorPalette: string;\n  /** Whether to display highlights of the legend on hover of the map features */\n  @Input() public highlightLegend = true;\n  @ViewChild('interpolated_svg', { read: ElementRef, static: false }) public interpolatedElement: ElementRef;\n\n  protected PROPERTY_SELECTOR_SOURCE = PROPERTY_SELECTOR_SOURCE;\n\n  /** List of cursors to display around the interpolated legend */\n  public cursors = new Array<{position: number; value: string;}>();\n\n  public hasHighlightedKeywords = signal(false);\n\n  public constructor(\n    private readonly legendService: LegendService,\n    private readonly destroyRef: DestroyRef,\n    private readonly translate: TranslateService\n  ) { }\n\n  public ngOnInit() {\n    this.legendService.highlight$\n      .pipe(filter(v => this.highlightLegend && v.layerId === this.layer.id), takeUntilDestroyed(this.destroyRef))\n      .subscribe(highlight => {\n        if (this.legend.manualValues) {\n          this.highlightKeywords(highlight);\n        }\n\n        if (this.legend.interpolatedValues) {\n          this.displayCursors(highlight);\n        }\n      });\n  }\n\n  /**\n   * Change the 'highlight' state of the keywords in the legend to make them pop more\n   * @param highlight The features'values to highlight\n   */\n  private highlightKeywords(highlight: {layerId: string; properties: Array<{[name: string]: any;}>; }) {\n    const colorField = this.legendService.getColorField(this.layer.paint, this.layer.type);\n    if (!colorField) {\n      return;\n    }\n\n    this.hasHighlightedKeywords.set(highlight.properties.length > 0);\n\n    // Get all the unique values from the properties\n    const valuesToHighlight = new Set(highlight.properties.map(p => {\n      const value = p[colorField];\n      if (!this.legend.manualValues.has(value)) {\n        return this.translate.instant(OTHER);\n      }\n      return value;\n    }));\n\n    // Based on what is received, change the highlight\n    this.legend.manualValues.forEach((v, k) => {\n      v.highlight = valuesToHighlight.has(k);\n    });\n  }\n\n  /**\n   * For every different value to highlight, add a cursor on the legend.\n   * Only the topmost feature's value will be displayed.\n   * @param highlight The features'values to highlight\n   */\n  private displayCursors(highlight: {layerId: string; properties: Array<{[name: string]: any;}>; }) {\n    if (!this.legend.title) {\n      return;\n    }\n\n    const colorField = this.legend.title;\n\n    if (this.legend.title.endsWith('normalized')) {\n      const valueField = colorField.split(':')[0] + ':_arlas__short_format';\n\n      this.cursors = highlight.properties\n        .map(p => ({ position: Math.min(100, 100 * p[colorField]), value: p[valueField]}));\n    } else {\n      const min = +this.legend.minValue;\n      const max = +this.legend.maxValue;\n\n      this.cursors = highlight.properties\n        .map(p => ({ position: Math.min(100, 100 * (p[colorField] - min) / (max - min)), value: p[colorField] }));\n    }\n\n    // Keep the value only for the topmost feature (first in array)\n    this.cursors.forEach((c, idx) => {\n      if (idx !== 0) {\n        c.value = undefined;\n      }\n    });\n  }\n}\n","<div *ngIf=\"legend && legend.type && legend.visible !== false && layer\" class=\"legend\">\n  <ng-container *ngIf=\"(legend.title | formatLegend) as l\">\n    <div class=\"legend__title\">\n      {{ title | translate}} {{ l.translateKey | translate: {metric: l.metric | translate, field: l.field | translate, normalized: l.normalized | translate: {normalizedKey: l.normalizedKey | translate} } }}\n    </div>\n  </ng-container>\n\n  <div class=\"legend--manual\" *ngIf=\"legend.type === PROPERTY_SELECTOR_SOURCE.manual\n        || legend.type === PROPERTY_SELECTOR_SOURCE.generated\n        || legend.type === PROPERTY_SELECTOR_SOURCE.provided\">\n    <div class=\"legend--manual__item\" *ngFor=\"let manualColor of legend.manualValues | keyvalue\"\n        [class.legend--manual__item--highlighted]=\"manualColor.value.highlight\"\n        [class.legend--manual__item--lessened]=\"!manualColor.value.highlight && hasHighlightedKeywords()\">\n      <div class=\"legend--manual__item__color\" [style.backgroundColor]=\"manualColor.value.color\"\n        [class.circle-tip]=\"layer.type === 'circle'\"\n        [class.line-tip]=\"layer.type === 'line'\"\n        [class.fill-tip]=\"layer.type === 'fill'\">\n      </div>\n      <div class=\"legend--manual__item__key\" [matTooltip]=\"manualColor.key | translate\" [matTooltipPosition]=\"'left'\">\n        {{manualColor.key | translate}}\n      </div>\n    </div>\n  </div>\n\n  <div class=\"legend--interpolated\" *ngIf=\"legend.type === PROPERTY_SELECTOR_SOURCE.interpolated\">\n    @for (cursor of cursors; track cursor.value) {\n      <div class=\"legend--interpolated__cursor\" [style.left]=\"cursor.position + '%'\" [class.legend--interpolated__cursor--main]=\"$first\"></div>\n      @if (cursor.value) {\n        <div class=\"legend--interpolated__cursor__value\" [style.left]=\"cursor.position + '%'\">\n          {{ cursor.value | shortenNumber }}\n        </div>\n      }\n    }\n    @if (!!colorPalette) {\n      <div class=\"legend--interpolated__palette\"\n        [style.background]=\"'linear-gradient(to right, ' + colorPalette + ')'\"></div>\n    } @else {\n      <div class=\"legend--interpolated__svg\">\n        <svg #interpolated_svg></svg>\n      </div>\n    }\n    <div class=\"legend--interpolated__range\">\n      <div class=\"legend--interpolated__range__value\">\n        {{legend?.minValue | formatNumber:'NUMBER_FORMAT_CHAR' | translate}}\n      </div>\n      <div class=\"legend--interpolated__range__value\">\n        {{legend?.maxValue | formatNumber:'NUMBER_FORMAT_CHAR' | translate}}\n      </div>\n    </div>\n  </div>\n</div>","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { Pipe, PipeTransform } from '@angular/core';\nimport { getLayerName } from '../map/model/layers';\n\n\n@Pipe({\n  name: 'layerIdToName'\n})\nexport class LayerIdToName implements PipeTransform {\n\n  /** FROM V15.0.0 layer ids look like 'arlas_id:NAME:timestamp\n   * This pipe extracts the 'NAME' in that id\n   */\n  public transform(id: string): any {\n    return getLayerName(id);\n  }\n\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n  AfterViewInit, Component, computed, Input, OnChanges, OnInit, Output, signal, SimpleChanges, ViewChild, WritableSignal\n} from '@angular/core';\nimport { TranslateService } from '@ngx-translate/core';\nimport { HistogramData } from 'arlas-d3/histograms/utils/HistogramUtils';\nimport { ArlasColorService } from 'arlas-web-components';\nimport { scaleLinear, ScaleLinear } from 'd3-scale';\nimport { select } from 'd3-selection';\nimport { area, curveLinear, line } from 'd3-shape';\nimport { Subject, takeUntil } from 'rxjs';\nimport { ARLAS_ID, ArlasDataLayer, FILLSTROKE_LAYER_PREFIX, HOVER_LAYER_PREFIX, SELECT_LAYER_PREFIX } from '../map/model/layers';\nimport { Legend, LegendData, PROPERTY_SELECTOR_SOURCE } from './legend.config';\nimport { LegendService } from './legend.service';\nimport { getMax, MAX_LINE_WIDTH } from './legend.tools';\n\n\n@Component({\n  selector: 'arlas-legend',\n  templateUrl: './legend.component.html',\n  styleUrls: ['./legend.component.scss']\n})\nexport class LegendComponent implements OnInit, AfterViewInit, OnChanges {\n  /**\n   * @Input : Angular\n   * @description Layer object\n   */\n  @Input() public layer: ArlasDataLayer;\n  /**\n   * @Input : Angular\n   * @description Collection of the layer\n   */\n  @Input() public collection: string;\n  /**\n   * @Input : Angular\n   * @description Current zoom level of the map\n   */\n  @Input() public zoom: number;\n  /**\n   * @Input : Angular\n   * @description Whether the layer is enabled.\n   */\n  @Input() public enabled: boolean;\n  /**\n   * @Input : Angular\n   * @description Subject of [collection, [field, legendData]] map. The map subscribes to it to keep\n   * the legend updated with the data displayed on the map.\n   */\n  @Input() public legendUpdater: Subject<Map<string, Map<string, LegendData>>> = new Subject();\n  /**\n   * @Input : Angular\n   * @description Subject of [field, boolean] map. The map subscribes to it to keep\n   * the legend updated with the visibility of the layer.\n   */\n  @Input() public visibilityUpdater: Subject<Map<string, boolean>> = new Subject();\n  /**\n   * @Input : Angular\n   * @description Whether to highlight the keywords or color of hovered features\n   */\n  @Input() public highlightLegend = true;\n\n  /**\n   * @Output : Angular\n   * @description Notifies the parent component that this layer is visible or not\n   */\n  @Output() public visibilityStatus: Subject<boolean> = new Subject();\n\n  /**\n   * @Output : Angular\n   * @description Notifies the parent component that the user wants to download the layer\n   */\n  @Output() public downloadSourceEmitter: Subject<{ layer: any; downloadType: string; }> = new Subject();\n\n  @ViewChild('width_legend', { static: false }) public lineWidthLegend: any;\n  @ViewChild('radius_legend', { static: false }) public circleRadiusLegend: any;\n\n  public lineDasharray: Array<number>;\n\n  public colorLegend: WritableSignal<Legend> = signal({});\n  public hasColorLegend = computed(() => this.colorLegend().type !== undefined && this.colorLegend().type !== 'Fix');\n\n  public strokeColorLegend: WritableSignal<Legend> = signal({});\n  public hasStrokeLegend = computed(() => this.strokeColorLegend().type !== undefined && this.strokeColorLegend().type !== 'Fix');\n\n  public widthLegend: WritableSignal<Legend> = signal({});\n  public hasWidthLegend = computed(() => this.widthLegend().type !== undefined && this.widthLegend().type !== 'Fix');\n\n  public radiusLegend: WritableSignal<Legend> = signal({});\n  public hasRadiusLegend = computed(() => this.radiusLegend().type !== undefined && this.radiusLegend().type !== 'Fix');\n\n  public displayLegendDetailToggle = computed(() =>\n    this.hasColorLegend() || this.hasStrokeLegend() || this.hasWidthLegend() || this.hasRadiusLegend());\n\n  public detail = false;\n  public visibleMode = false;\n  public PROPERTY_SELECTOR_SOURCE = PROPERTY_SELECTOR_SOURCE;\n\n  private legendData: Map<string, LegendData> = new Map();\n  public colorPalette = '';\n  public strokeColorPalette = '';\n\n  private readonly MAX_CIRLE_RADIUS = 7;\n  private readonly LEGEND_WIDTH = 210;\n  private readonly _onDestroy$ = new Subject<boolean>();\n\n  public constructor(\n    public translate: TranslateService,\n    public colorService: ArlasColorService,\n    private readonly legendService: LegendService\n  ) { }\n\n  public ngOnInit() {\n    this.legendUpdater\n      .pipe(takeUntil(this._onDestroy$))\n      .subscribe(legendDataPerCollection => {\n\n        this.legendData = legendDataPerCollection.get(this.collection);\n        if (this.layer) {\n          this.drawLegends(this.visibleMode);\n        }\n      });\n    this.visibilityUpdater\n      .pipe(takeUntil(this._onDestroy$))\n      .subscribe(visibilityUpdater => {\n        /** check legend visibility according to Data source status (mapcontirbutor) */\n        if (this.layer) {\n          /** if the visibility updater contains the layer we pick the visibility status otherwise we keep it unchaged */\n          this.visibleMode = visibilityUpdater.get(this.layer.id) !== undefined ? visibilityUpdater.get(this.layer.id) : this.visibleMode;\n        } else {\n          this.visibleMode = false;\n        }\n        /** check legend visibility according to VisibilityRules */\n        if (this.visibleMode && this.layer && !!this.layer.minzoom && !!this.layer.maxzoom) {\n          this.visibleMode = (this.zoom <= this.layer.maxzoom && this.zoom >= this.layer.minzoom);\n        }\n        /** check legend visibility according to legend enabled or not */\n        if (!this.enabled) {\n          this.visibleMode = false;\n        }\n        if (!this.visibleMode) {\n          this.detail = this.visibleMode;\n        }\n        /** check legend visibility for external layers that are not set by config nor map contributors */\n        if (this.layer && !this.layer.id.startsWith(ARLAS_ID) &&\n          !this.layer.id.startsWith(FILLSTROKE_LAYER_PREFIX) && !this.layer.id.startsWith(HOVER_LAYER_PREFIX)\n          && !this.layer.id.startsWith(SELECT_LAYER_PREFIX)) {\n          this.visibleMode = this.enabled;\n          if (!!this.layer.metadata && this.layer.metadata.showLegend === false) {\n            this.visibleMode = false;\n          }\n        }\n        if (this.layer) {\n          this.drawLegends(this.visibleMode);\n        }\n        this.visibilityStatus.next(this.visibleMode);\n      });\n  }\n\n  public ngAfterViewInit() {\n    if (this.layer) {\n      this.drawLegends(this.visibleMode);\n    }\n  }\n\n  public ngOnChanges(changes: SimpleChanges) {\n    if (changes['layer'] !== undefined) {\n      if (this.layer) {\n        this.drawLegends(this.visibleMode);\n      }\n    }\n  }\n\n  public ngOnDestroy() {\n    this._onDestroy$.next(true);\n    this._onDestroy$.complete();\n  }\n\n  public downloadLayerSource(layer: any, downloadType: string): void {\n    const download = {\n      layer,\n      downloadType\n    };\n    this.downloadSourceEmitter.next(download);\n  }\n\n  public showDetail(event: Event) {\n    this.detail = !this.detail;\n    event.stopPropagation();\n  }\n\n  /** Parses the `paint` attribute of a layer and draws the legend elements such as\n   * - color palette\n   * - line width evolution\n   * - circle radius evolution\n   */\n  private drawLegends(visibileMode: boolean): void {\n    const type = this.layer.type;\n    const paint = this.layer.paint;\n    switch (type) {\n      case 'circle': {\n        const circleLegend = this.legendService.getCircleLegend(paint, visibileMode, this.legendData, this.layer);\n        this.colorLegend.set(circleLegend.color);\n\n        // For circle-heatmap layer the stroke can't be configured, so hide it\n        if (this.layer.metadata?.hiddenProps?.geomType !== 'circle-heatmap') {\n          this.strokeColorLegend.set(circleLegend.strokeColor);\n        }\n        this.colorPalette = circleLegend.colorPalette;\n        this.strokeColorPalette = circleLegend.strokeColorPalette;\n        this.radiusLegend.set(circleLegend.radius);\n        if (this.circleRadiusLegend?.interpolatedElement) {\n          const circleRadiusEvolution = circleLegend.radius.histogram;\n          drawCircleSupportLine(this.circleRadiusLegend.interpolatedElement.nativeElement, circleRadiusEvolution, this.colorLegend(),\n            this.LEGEND_WIDTH, Math.min(this.MAX_CIRLE_RADIUS, getMax(circleRadiusEvolution)) * 2);\n        }\n        break;\n      }\n      case 'line': {\n        const lineLegend = this.legendService.getLineLegend(paint, visibileMode, this.legendData, this.layer);\n        this.lineDasharray = lineLegend.dashes;\n        this.colorLegend.set(lineLegend.color);\n        this.colorPalette = lineLegend.colorPalette;\n        this.widthLegend.set(lineLegend.width);\n        if (this.lineWidthLegend?.interpolatedElement) {\n          const lineWidthEvolution = lineLegend.width.histogram;\n          drawLineWidth(this.lineWidthLegend.interpolatedElement.nativeElement, lineWidthEvolution, this.colorLegend(),\n            this.LEGEND_WIDTH, MAX_LINE_WIDTH);\n        }\n        break;\n      }\n      case 'fill': {\n        const fillLegend = this.legendService.getFillLegend(paint, visibileMode, this.legendData, this.layer);\n        this.colorLegend.set(fillLegend.color);\n        this.colorPalette = fillLegend.colorPalette;\n        this.strokeColorLegend.set(fillLegend?.strokeColor);\n        this.strokeColorPalette = fillLegend?.strokeColorPalette;\n        break;\n      }\n      case 'heatmap': {\n        const heatmapLegend = this.legendService.getHeatmapLegend(paint, visibileMode, this.legendData, this.layer);\n\n        this.colorLegend.set(heatmapLegend.color);\n        this.colorPalette = heatmapLegend.colorPalette;\n        this.radiusLegend.set(heatmapLegend.radius);\n        if (this.circleRadiusLegend?.interpolatedElement) {\n          const heatmapRadiusEvolution = heatmapLegend.radius.histogram;\n          drawCircleSupportLine(this.circleRadiusLegend.interpolatedElement.nativeElement, heatmapRadiusEvolution, this.colorLegend(),\n            this.LEGEND_WIDTH, Math.min(this.MAX_CIRLE_RADIUS, getMax(heatmapRadiusEvolution)) * 2);\n        }\n        break;\n      }\n      case 'symbol': {\n        const symbolLegend = this.legendService.getLabelLegend(paint, visibileMode, this.legendData, this.layer);\n        this.colorLegend.set(symbolLegend.color);\n        this.colorPalette = symbolLegend.colorPalette;\n        this.widthLegend.set(symbolLegend.size);\n        if (!!this.lineWidthLegend && !!this.lineWidthLegend.interpolatedElement) {\n          const lineWidthEvolution = symbolLegend.size.histogram;\n          drawLineWidth(this.lineWidthLegend.interpolatedElement.nativeElement, lineWidthEvolution, this.colorLegend(),\n            this.LEGEND_WIDTH, MAX_LINE_WIDTH);\n        }\n        break;\n      }\n    }\n    if (!this.colorLegend().fixValue) {\n      this.colorLegend().fixValue = visibileMode ? '#444' : '#d3d3d3';\n    }\n    const layer = { ...this.layer };\n    this.layer = null;\n    this.layer = { ...layer };\n  }\n\n\n}\n\n/**\n * draws the line width legend\n * @param svgNode SVG element on which we append the line using d3.\n * @param lineWidths List of {key, linewidth}\n * @param cLegend Color legend, to give the drawn legend lines the same color on the map\n * @param legendWidth The width that the svg will take to draw the legend\n * @param legendHeight The height that the svg will take to draw the legend\n */\nexport function drawLineWidth(svgNode: SVGElement, lineWidths: Array<HistogramData>,\n  cLegend: Legend, legendWidth: number, legendHeight: number) {\n  const maxHeight = getMax(lineWidths);\n  const xDomain: any = (scaleLinear()).range([0, legendWidth]);\n  const xDomainExtent = [lineWidths[0].key, lineWidths[lineWidths.length - 1].key];\n  xDomain.domain(xDomainExtent);\n  const yDomain: ScaleLinear<number, number> = scaleLinear().range([maxHeight, 0]);\n  yDomain.domain([0, maxHeight]);\n  const svg = select(svgNode).attr('width', legendWidth).attr('height', legendHeight);\n  svg.selectAll('g').remove();\n  const context = svg.append('g').attr('class', 'context');\n  const ar = area()\n    .curve(curveLinear)\n    .x((d: any) => xDomain(d.key))\n    .y0(maxHeight)\n    .y1((d: any) => yDomain(d.value));\n\n  const widthLineColor = getMiddleColor(cLegend);\n  context.append('path')\n    .datum(lineWidths)\n    .style('fill', widthLineColor)\n    .style('fill-opacity', 0.6)\n    .style('stroke', widthLineColor)\n    .style('stroke-opacity', 0.6)\n    .style('stroke-width', 0.5)\n    .attr('d', <any>ar);\n}\n\nexport function getMiddleColor(colorLegend: Legend): string {\n  let color = '';\n  if (colorLegend.type === PROPERTY_SELECTOR_SOURCE.fix) {\n    color = colorLegend.fixValue as string;\n  } else if (colorLegend.type === PROPERTY_SELECTOR_SOURCE.interpolated) {\n    const iv = colorLegend.interpolatedValues as Array<string>;\n    if (iv.length === 1 || iv.length === 2) {\n      color = iv[0];\n    } else if (iv.length >= 3) {\n      color = iv[Math.trunc(iv.length / 2)];\n    }\n  } else if (colorLegend.type === PROPERTY_SELECTOR_SOURCE.manual || colorLegend.type === PROPERTY_SELECTOR_SOURCE.generated\n    || colorLegend.type === PROPERTY_SELECTOR_SOURCE.provided) {\n    const iv = colorLegend.manualValues;\n    if (iv) {\n      if (iv.size === 1) {\n        color = iv.keys().next().value;\n      } else if (iv.size >= 2) {\n        const values = Array.from(iv.values());\n        color = values[Math.trunc(values.length / 2)].color as string;\n      }\n    }\n  }\n  return color;\n}\n/**\n * draws the circle radius legend\n * @param svgNode SVG element on which we append the circles using d3.\n * @param circlesRadiuses List of {key, circleradius}\n * @param cLegend Color legend, to give the drawn legend circles the same color on the map\n * @param legendWidth The width that the svg will take to draw the legend\n * @param legendHeight The height that the svg will take to draw the legend\n */\nexport function drawCircleSupportLine(svgNode: SVGElement, circlesRadiuses: Array<HistogramData>,\n  cLegend: Legend, legendWidth: number, legendHeight: number) {\n  const circleDiameters = [];\n  circlesRadiuses.forEach(cr => circleDiameters.push({ key: cr.key, value: cr.value * 2 }));\n  const maxHeight = getMax(circleDiameters);\n  const firstRadius = circlesRadiuses[0].value;\n  const lastRadius = circlesRadiuses[circlesRadiuses.length - 1].value;\n  const xDomain: any = (scaleLinear()).range([0, legendWidth - firstRadius - lastRadius]);\n  const xDomainExtent = [circleDiameters[0].key, circleDiameters[circleDiameters.length - 1].key];\n  xDomain.domain(xDomainExtent);\n  const yDomain: ScaleLinear<number, number> = scaleLinear().range([maxHeight, 0]);\n  yDomain.domain([0, maxHeight]);\n  const svg = select(svgNode).attr('width', legendWidth).attr('height', legendHeight);\n  svg.selectAll('g').remove();\n  const context = svg.append('g').attr('class', 'context');\n  const l = line()\n    .x((d: any) => xDomain(d.key))\n    .y((d: any) => yDomain(d.value));\n  context.append('path')\n    .datum(circleDiameters)\n    .attr('fill', 'none')\n    .attr('stroke', '#eaeaea')\n    .attr('stroke-width', 0.8)\n    .attr('transform', 'translate(' + firstRadius + ', 0)')\n    .attr('d', <any>l);\n  context.append('g').append('line')\n    .attr('x1', 0).attr('y1', maxHeight)\n    .attr('x2', legendWidth - firstRadius - lastRadius).attr('y2', maxHeight)\n    .attr('cx', 2).attr('cy', 2).attr('fill', 'none')\n    .attr('stroke', '#eaeaea')\n    .attr('stroke-width', 0.8)\n    .attr('transform', 'translate(' + firstRadius + ', 0)');\n  const circles = [circlesRadiuses[0], circlesRadiuses[circlesRadiuses.length - 1]];\n  const circleColor = getMiddleColor(cLegend);\n  context.append('g')\n    .selectAll('dot').data(circles).enter().append('circle')\n    .attr('r', (d) => d.value)\n    .attr('cx', (d) => xDomain(d.key))\n    .attr('cy', (d) => maxHeight - d.value)\n    .attr('transform', 'translate(' + firstRadius + ', 0)')\n    .style('fill', circleColor)\n    .style('fill-opacity', 0.6)\n    .style('stroke', circleColor)\n    .style('stroke-width', 0.5);\n\n}\n","\n<div class=\"layer_wrapper\">\n    <div class=collection_color [matTooltip]=\"'Collection:' | translate: {collection: (collection | getCollectionDisplayName)}\"\n      [style.backgroundColor]=\"!!collection ? (collection | getColor) : 'transparent'\"></div>\n    <div class=\"layer_container\" >\n      <div class=\"layer_icon_container\">\n        <div class=\"layer_icon\" >\n          <arlas-layer-icon [layer]=\"layer\" [colorLegend]=\"colorLegend()\" [strokeColorLegend]=\"strokeColorLegend()\"\n            [lineDasharray]=\"lineDasharray\" [widthLegend]=\"widthLegend()\" [radiusLegend]=\"radiusLegend()\"></arlas-layer-icon>\n        </div>\n        <div class=\"layer_name\" [style.color]=\"visibleMode ? '#444': '#d3d3d3'\">\n          {{layer?.id | layerIdToName | translate}}\n        </div>\n      </div>\n      <div class=\"layer_detail\">\n        <div class=\"download_button\">\n          <mat-icon class=\"download_icon\" [matMenuTriggerFor]=\"menu\" [matTooltip]=\"'Download the layer\\'s data' | translate\">file_download</mat-icon>\n          <mat-menu #menu=\"matMenu\">\n            <button mat-menu-item (click)=\"downloadLayerSource(layer, 'csv')\">\n              {{'CSV' | translate}}\n            </button>\n            <button mat-menu-item (click)=\"downloadLayerSource(layer, 'geojson')\">\n              {{'GeoJson' | translate}}\n            </button>\n          </mat-menu>\n        </div>\n\n        @if (displayLegendDetailToggle()) {\n          <div class=\"detail_button\" (click)=\"showDetail($event)\" (keyDown)=\"showDetail($event)\">\n            <mat-icon class=\"detail_icon\">{{ detail ? 'keyboard_arrow_up' : 'keyboard_arrow_down' }}</mat-icon>\n          </div>\n        }\n      </div>\n    </div>\n\n    <div [hidden]=\"!detail\" class=\"legend-wrapper\">\n      <arlas-legend-item [hidden]=\"!hasColorLegend()\" [legend]=\"colorLegend()\" [layer]=\"layer\"\n        [title]=\"'Fill:' | marker\" [colorPalette]=\"colorPalette\" [highlightLegend]=\"highlightLegend\"></arlas-legend-item>\n\n      <arlas-legend-item [hidden]=\"!hasStrokeLegend()\" [legend]=\"strokeColorLegend()\" [layer]=\"layer\"\n        [title]=\"'Stroke:' | marker\" [colorPalette]=\"colorPalette\" [highlightLegend]=\"highlightLegend\"></arlas-legend-item>\n\n      <arlas-legend-item [hidden]=\"!hasWidthLegend()\" #width_legend [legend]=\"widthLegend()\" [layer]=\"layer\"\n        [title]=\"'Width:' | marker\" [highlightLegend]=\"highlightLegend\"></arlas-legend-item>\n\n      <arlas-legend-item [hidden]=\"!hasRadiusLegend()\" #radius_legend [legend]=\"radiusLegend()\" [layer]=\"layer\"\n        [title]=\"'Radius:' | marker\" [highlightLegend]=\"highlightLegend\"></arlas-legend-item>\n    </div>\n  </div>\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({ name: 'getCollection' })\nexport class GetCollectionPipe implements PipeTransform {\n  public transform(value: string, layersMap?: Map<string, any>): string {\n    let collection: string;\n    if (layersMap?.get(value)?.metadata?.collection) {\n      collection = layersMap.get(value).metadata.collection;\n    }\n    return collection;\n  }\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';\nimport { Component, EventEmitter, inject, Input, Output, SimpleChanges, ViewChild, ViewEncapsulation } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { TranslateService } from '@ngx-translate/core';\nimport { Feature, FeatureCollection } from '@turf/helpers';\nimport { ElementIdentifier } from 'arlas-web-components';\nimport { finalize, fromEvent, Subject, takeUntil } from 'rxjs';\nimport { ArlasMapFrameworkService } from './arlas-map-framework.service';\nimport * as mapJsonSchema from './arlas-map.schema.json';\nimport { AbstractArlasMapService } from './arlas-map.service';\nimport { BasemapStyle } from './basemaps/basemap.config';\nimport { BasemapService } from './basemaps/basemap.service';\nimport { ArlasBasemaps } from './basemaps/basemaps.model';\nimport { ArlasDrawComponent } from './draw/arlas-draw.component';\nimport { AoiDimensions } from './draw/draw.models';\nimport { MapboxAoiDrawService } from './draw/draw.service';\nimport { LegendData } from './legend/legend.config';\nimport { LegendService } from './legend/legend.service';\nimport {\n  AbstractArlasMapGL,\n  ArlasMapOffset, ArlasMapOption,\n  CROSS_LAYER_PREFIX,\n  DISABLE_GLOBE,\n  ENABLE_GLOBE,\n  MapConfig,\n  RESET_BEARING,\n  ZOOM_IN, ZOOM_OUT\n} from './map/AbstractArlasMapGL';\nimport { ControlPosition, IconConfig } from './map/model/controls';\nimport { MapLayerMouseEvent, MapMouseEvent } from './map/model/events';\nimport { MapExtent } from './map/model/extent';\nimport { ARLAS_VSET, ArlasDataLayer, getLayerName, MapLayers } from './map/model/layers';\nimport { ArlasLngLatBounds, OnMoveResult } from './map/model/map';\nimport { ArlasMapSource } from './map/model/sources';\nimport { VisualisationSetConfig } from './map/model/visualisationsets';\n\n@Component({\n  selector: 'arlas-map',\n  templateUrl: './arlas-map.component.html',\n  styleUrls: ['./arlas-map.component.scss'],\n  encapsulation: ViewEncapsulation.None\n})\n/** L: a layer class/interface.\n *  S: a source class/interface.\n *  M: a Map configuration class/interface.\n */\nexport class ArlasMapComponent<L, S, M> {\n\n  /** Map instance. */\n  public map: AbstractArlasMapGL;\n  /** Whether the legend is visible (open) or not.*/\n  public legendOpen = true;\n  /** Used to clear geojson sources. */\n  public emptyData: FeatureCollection<GeoJSON.Geometry> = {\n    'type': 'FeatureCollection',\n    'features': []\n  };\n\n  /** Whether the list of basemaps is shown. */\n  public showBasemapList = false;\n\n  /** Visibility status of each visualisation set*. */\n  public visibilityStatus = new Map<string, boolean>();\n  private readonly _onDestroy$ = new Subject<boolean>();\n\n\n  @ViewChild('drawComponent', { static: false }) public drawComponent: ArlasDrawComponent<ArlasDataLayer, S, M>;\n\n\n  /** ANGULAR INPUTS */\n\n  /** @description Html identifier given to the map container (it's a div ;))*/\n  @Input() public id = 'mapgl';\n  /** @description An object with north,east,south,west properies which represent an offset in pixels */\n  /** Origin is top-left and x-axis is west to east and y-axis north to south.*/\n  @Input() public offset: ArlasMapOffset = { north: 0, east: 0, south: 0, west: 0 };\n\n  /** --- LAYERS */\n\n  /** @description List of configured (by the builder) layers. */\n  @Input() public mapLayers: MapLayers<ArlasDataLayer>;\n\n  /** --- SCALE & COORDINATES */\n\n  /** @description Whether the map scale is displayed. */\n  @Input() public displayScale = true;\n  /** @description Maximim width in pixels that the map scale could take. */\n  @Input() public maxWidthScale = 100;\n  /** @description Unit display for the map scale. */\n  @Input() public unitScale = 'metric';\n  /** @description Whether to display the coordinates of the mouse while moving. */\n  @Input() public displayCurrentCoordinates = false;\n  /** @description If true, the coordinates values are wrapped between -180 and 180. */\n  @Input() public wrapLatLng = true;\n\n  /** --- BASEMAPS */\n\n  /** @description Default basemap to display. */\n  @Input() public defaultBasemapStyle: BasemapStyle;\n  /** @description List of available basemaps. */\n  @Input() public basemapStyles = new Array<BasemapStyle>();\n\n  /** --- INITIAL MAP VIEW : ZOOMs, CENTER, BOUNDS */\n\n  /** @description Zoom of the map when it's initialized. */\n  @Input() public initZoom = 2;\n  /** @description Max zoom of the map. */\n  @Input() public maxZoom = 22;\n  /** @description Min zoom of the map. */\n  @Input() public minZoom = 0;\n  /** @description Coordinates of the map's center when it's first loaded. */\n  @Input() public initCenter: [number, number] = [2.1972656250000004, 45.706179285330855];\n\n  /** --- BOUNDS TO FIT STRATEGY */\n\n  /** @description Bounds that the view map fits. It's an array of two corners. */\n  /** Each corner is an lat-long position. For example: boundsToFit = [[30.51, -54.3],[30.57, -54.2]] */\n  @Input() public boundsToFit: Array<Array<number>>;\n  /** @description The padding added in the top-left and bottom-right corners of a map container that shouldn't be accounted */\n  /** for when setting the view to fit bounds.*/\n  @Input() public fitBoundsOffSet: [number, number] = [0, 0];\n  /**  @description Padding value applied around a fitBounds to fully show the area targeted. */\n  @Input() public fitBoundsPadding = 10;\n  /** @description The maximum zoom level so that the bounds fit the map view. */\n  @Input() public fitBoundsMaxZoom = 22;\n\n  /** --- DATA LOADING STRATEGIES */\n\n  /** @description Margin applied to the map extent. Data will be fetched in all this extent. */\n  @Input() public margePanForLoad: number;\n  /** @description Margin applied to the map extent. Before loading data,\n   * the components checks first if there are features already loaded in this extent. */\n  @Input() public margePanForTest: number;\n  /** @description A callback run before the Map makes a request for an external URL/ */\n  @Input() public transformRequest: unknown /** TransformRequestFunction or RequestTransformRequest */;\n\n  /** --- MAP INTERACTION */\n\n  /** @description Feature to highlight. */\n  @Input() public featureToHightLight: { isleaving: boolean; elementidentifier: ElementIdentifier; };\n  /** @description List of features to select. */\n  @Input() public featuresToSelect: Array<ElementIdentifier>;\n\n  /** --- SOURCES */\n\n  /** @description List of sources to add to the map. */\n  @Input() public mapSources: Array<ArlasMapSource<S>>;\n  /** @description Subject to which the component subscribes to redraw on the map the `data` of the given `source`. */\n  @Input() public redrawSource = new Subject<{ source: string; data: Feature<GeoJSON.Geometry>[]; }>();\n  /** @description List of data sources names that should be added to the map. Sources should be of type `geojson`. */\n  @Input() public dataSources: Set<string>;\n\n  /** --- DRAW */\n\n  /**  @description Options object for draw tools : https://github.com/mapbox/mapbox-gl-draw/blob/master/docs/API.md#options */\n  @Input() public drawOption: any = {};\n  /** @description Features drawn at component start */\n  @Input() public drawData: FeatureCollection<GeoJSON.Geometry> = ({ ...this.emptyData});\n  /** @description Whether the draw tools are activated. */\n  @Input() public drawButtonEnabled = false;\n  /** @description Maximum number of vertices allowed for a polygon. */\n  @Input() public drawPolygonVerticesLimit: number;\n  /** @description Whether the drawing buffer is activated */\n  /** If true, the map's canvas can be exported to a PNG using map.getCanvas().toDataURL(). Default: false */\n  @Input() public preserveDrawingBuffer = false;\n\n  /** --- ATTRIBUTION */\n\n  /** @description Position of the map attribution. */\n  @Input() public mapAttributionPosition: ControlPosition = 'bottom-right';\n\n  /** --- MAP ICONS */\n\n  /** @description List of icons to add to the map and that can be used in layers. */\n  @Input() public icons: Array<IconConfig>;\n\n  /** --- LEGEND AND VISUALISATIONS */\n\n  /** @description Subject of [collection, [field, legendData]] map. The map subscribes to it to keep */\n  /** the legend updated with the data displayed on the map. */\n  @Input() public legendUpdater: Subject<Map<string, Map<string, LegendData>>> = new Subject();\n  /** @description Subject of [layerId, boolean] map. The map subscribes to it to keep */\n  /** the legend updated with the visibility of the layer.*/\n  @Input() public visibilityUpdater: Subject<Map<string, boolean>> = new Subject();\n  /** @description List of visualisation sets. A Visualisation set is an entity where layers are grouped together. */\n  /** If a visualisation set is enabled, all the layers in it can be displayed on the map, otherwise the layers are removed from the map. */\n  @Input() public visualisationSetsConfig: Array<VisualisationSetConfig>;\n\n  /** --- GLOBE */\n  /** @description Whether to allow to switch to globe mode */\n  @Input() public enableGlobe: boolean;\n\n  /** --- LEGEND HIGHLIGHTS */\n  /** @description Whether to highlight the keywords or color of hovered features */\n  @Input() public highlightLegend = true;\n\n  /** ANGULAR OUTPUTS */\n\n  /** @description Emits true after the map is loaded and all sources & layers are added. */\n  @Output() public onMapLoaded: Subject<boolean> = new Subject<boolean>();\n\n  /** @description Emits the map extent when the browser tab is closed/refreshed. */\n  @Output() public onMapClosed: EventEmitter<MapExtent> = new EventEmitter<MapExtent>();\n\n  /**\n   * @deprecated\n   * @description  Emits the event of moving the map. */\n  @Output() public onMove: EventEmitter<OnMoveResult> = new EventEmitter<OnMoveResult>();\n\n  /** @description Emits the visible visualisation sets' names */\n  @Output() public visualisations: EventEmitter<Set<string>> = new EventEmitter();\n\n  /** @description Emits the features that were clicked on. */\n  @Output() public onFeatureClick = new EventEmitter<{ features: Array<GeoJSON.Feature<GeoJSON.Geometry>>; point: [number, number]; }>();\n\n  /** @description Emits the features that were hovered. */\n  @Output() public onFeatureHover = new EventEmitter<{ features: Array<GeoJSON.Feature<GeoJSON.Geometry>>; point: [number, number]; } | {}>();\n\n  /** @description Emits the geojson of all aois added to the map. */\n  @Output() public onAoiChanged: EventEmitter<FeatureCollection<GeoJSON.Geometry>> = new EventEmitter();\n\n  /** @description Emits the the dimensions of the polygon/bbox that is being drawn. */\n  @Output() public onAoiEdit: EventEmitter<AoiDimensions> = new EventEmitter();\n\n  /** @description Emits an event when the basemap has been changed by the user. */\n  @Output() public onBasemapChanged: Subject<boolean> = new Subject();\n\n  /** @description Emits which layers are displayed on the map. */\n  @Output() public legendVisibiltyStatus: Subject<Map<string, boolean>> = new Subject();\n\n  /** @description  Notifies that the user wants to download the selected layer */\n  @Output() public downloadSourceEmitter: Subject<{\n    layerId: string;\n    layerName: string;\n    collection: string;\n    sourceName: string;\n    downloadType: string;\n  }> = new Subject();\n\n  protected ICONS_BASE_PATH = 'assets/icons/';\n\n  private readonly mapFrameworkService = inject(ArlasMapFrameworkService<L, S, M>);\n\n  public constructor(\n    private readonly drawService: MapboxAoiDrawService,\n    private readonly basemapService: BasemapService<L, S, M>,\n    private readonly translate: TranslateService,\n    protected mapService: AbstractArlasMapService<L, S, M>,\n    private readonly legendService: LegendService\n  ) {\n      this.basemapService.protomapBasemapAdded$.pipe(takeUntilDestroyed())\n      .subscribe(() => this.reorderLayers());\n  }\n\n  public ngAfterViewInit() {\n    /** init values */\n    if (!this.initCenter) {\n      this.initCenter = [0, 0];\n    }\n    if (this.initZoom === undefined || this.initZoom === null) {\n      this.initZoom = 3;\n    }\n    if (this.maxZoom === undefined || this.maxZoom === null) {\n      this.maxZoom = 23;\n    }\n    this.minZoom = this.minZoom ?? 0;\n\n    /** BASEMAPS */\n    if (this.defaultBasemapStyle && typeof this.defaultBasemapStyle.styleFile === 'string') {\n      this.defaultBasemapStyle.url = this.defaultBasemapStyle.styleFile;\n    }\n    this.basemapStyles.forEach(bm => {\n      if (typeof bm.styleFile === 'string') {\n        bm.url = (bm.styleFile);\n      }\n    });\n    this.basemapService.setBasemaps(new ArlasBasemaps(this.defaultBasemapStyle, this.basemapStyles));\n    this.basemapService.fetchSources$()\n      .pipe(finalize(() => this.declareMap()))\n      .subscribe();\n  }\n\n  public ngOnChanges(changes: SimpleChanges): void {\n    if (this.map && this.map.getMapProvider() !== undefined) {\n      if (changes['boundsToFit'] !== undefined) {\n        const newBoundsToFit = changes['boundsToFit'].currentValue;\n        this.map.fitBounds(newBoundsToFit, {\n          maxZoom: this.fitBoundsMaxZoom,\n          offset: this.fitBoundsOffSet\n        });\n      }\n      if (changes['featureToHightLight'] !== undefined\n        && changes['featureToHightLight'].currentValue !== changes['featureToHightLight'].previousValue) {\n        const featureToHightLight = changes['featureToHightLight'].currentValue;\n        this.highlightFeature(featureToHightLight);\n      }\n      if (changes['featuresToSelect'] !== undefined\n        && changes['featuresToSelect'].currentValue !== changes['featuresToSelect'].previousValue) {\n        const featuresToSelect = changes['featuresToSelect'].currentValue;\n        this.selectFeatures(featuresToSelect);\n      }\n    }\n  }\n\n  /** If transformRequest' @Input was not set, set a default value : a function that maintains the same url */\n  public initTransformRequest() {\n    if (!this.transformRequest) {\n      this.transformRequest = this.mapFrameworkService.getInitTransformRequest();\n    }\n  }\n\n  /** Zooms on clicked feature from map mouse event e.\n   * @param mouseEvent Map mouse event provided by the map instance.\n   */\n  public zoomOnClick(mouseEvent: MapMouseEvent) {\n    const zoom = this.map.getZoom();\n      let newZoom: number;\n      if (zoom >= 0 && zoom < 3) {\n        newZoom = 4;\n      } else if (zoom >= 3 && zoom < 5) {\n        newZoom = 5;\n      } else if (zoom >= 5 && zoom < 7) {\n        newZoom = 7;\n      } else if (zoom >= 7 && zoom < 10) {\n        newZoom = 10;\n      } else if (zoom >= 10 && zoom < 11) {\n        newZoom = 11;\n      } else {\n        newZoom = 12;\n      }\n      this.mapFrameworkService.flyTo(mouseEvent.lngLat.lat, mouseEvent.lngLat.lng, newZoom, this.map);\n  }\n\n  /**\n   * Queries all rendered features on the position that was clicked on, on a layer; and emits those features.\n   * @param mapLayerMouseEvent Map mouse event provided by a layer instance.\n   */\n  protected queryRender(mapLayerMouseEvent: MapLayerMouseEvent) {\n    const hasCrossOrDrawLayer = this.mapFrameworkService.queryFeatures(mapLayerMouseEvent, this.map, CROSS_LAYER_PREFIX);\n    if (!this.drawService.isDrawingBbox && !this.drawService.isDrawingPolygon\n      && !this.drawService.isDrawingCircle && !this.drawService.isInSimpleDrawMode && !hasCrossOrDrawLayer) {\n      this.onFeatureClick.next({ features: mapLayerMouseEvent.features, point: [mapLayerMouseEvent.lngLat.lng, mapLayerMouseEvent.lngLat.lat] });\n    }\n  }\n\n  /** @description Adds the custom icons given in the component's input */\n  public addIcons() {\n    if (this.icons) {\n      this.icons.forEach(icon => {\n        const iconName = icon.path.split('.')[0];\n        const iconPath = this.ICONS_BASE_PATH + icon.path;\n        const iconErrorMessage = 'The icon \"' + this.ICONS_BASE_PATH + icon.path + '\" is not found';\n        this.mapFrameworkService.addImage(iconName, iconPath, this.map, iconErrorMessage, { 'sdf': icon.recolorable });\n      });\n    }\n\n    this.mapFrameworkService.addImage('rotate', this.ICONS_BASE_PATH + 'rotate/01.png', this.map, 'Rotate not found');\n    this.mapFrameworkService.addImage('resize', this.ICONS_BASE_PATH + 'resize/01.png', this.map, 'Resize not found');\n  }\n\n  /**\n   * @description Creates the map instance and adds the basemap, arlas data\n   * and starts listening to arlas data changes and layers visibility updates.\n   * It also starts emiting map moveend event.\n   */\n  public declareMap() {\n    this.initTransformRequest();\n    const arlasMapOption: ArlasMapOption = {\n      container: this.id,\n      style: this.basemapService.getInitStyle(this.basemapService.basemaps.getSelected()),\n      center: this.initCenter,\n      zoom: this.initZoom,\n      maxZoom: this.maxZoom,\n      minZoom: this.minZoom,\n      renderWorldCopies: true,\n      preserveDrawingBuffer: this.preserveDrawingBuffer,\n      locale: {\n        'NavigationControl.ZoomIn': this.translate.instant(ZOOM_IN),\n        'NavigationControl.ZoomOut': this.translate.instant(ZOOM_OUT),\n        'NavigationControl.ResetBearing': this.translate.instant(RESET_BEARING),\n        'GlobeControl.Enable': this.translate.instant(ENABLE_GLOBE),\n        'GlobeControl.Disable': this.translate.instant(DISABLE_GLOBE)\n      },\n      pitchWithRotate: false,\n      transformRequest: this.transformRequest,\n      attributionControl: false,\n    };\n    const mapProviderOptions = this.mapFrameworkService.buildMapProviderOption(arlasMapOption);\n    const config: MapConfig<M> = {\n      displayCurrentCoordinates: this.displayCurrentCoordinates,\n      fitBoundsPadding: this.fitBoundsPadding,\n      margePanForLoad: this.margePanForLoad,\n      margePanForTest: this.margePanForTest,\n      offset: this.offset,\n      wrapLatLng: this.wrapLatLng,\n      maxWidthScale: this.maxWidthScale,\n      unitScale: this.unitScale,\n      mapProviderOptions,\n      controls: {\n        mapAttribution: {\n          enable: true,\n          position: this.mapAttributionPosition,\n          config: {\n            compact: false\n          }\n        },\n        scale: {\n          enable: this.displayScale\n        },\n        navigationControl: {\n          enable: true\n        },\n        pitchToggle: {\n          enable: true,\n          config: { bearing: -20, pitch: 70, minpitchzoom: 11 }\n        },\n        globe: {\n          enable: this.enableGlobe === true\n        }\n      }\n    };\n    this.map = this.mapFrameworkService.createMap(config);\n    fromEvent(globalThis, 'beforeunload').subscribe(() => {\n      this.onMapClosed.next(this.map.getMapExtend());\n    });\n\n    this.map.onCustomEvent('beforeOnLoadInit', () => {\n      this.basemapService.declareProtomapProtocol(this.map);\n      this.basemapService.addProtomapBasemap(this.map);\n      this.addIcons();\n      this.mapService.declareArlasDataSources(this.dataSources, this.emptyData, this.map);\n      this.mapService.declareBasemapSources(this.mapSources, this.map);\n      this.mapService.addArlasDataLayers(this.visualisationSetsConfig, this.mapLayers, this.map);\n      this.listenToLayersEvents();\n    });\n\n    this.mapFrameworkService.onMapEvent('load', this.map, () => {\n      if (this.mapLayers !== null) {\n        this.visibilityUpdater.subscribe(visibilityStatus => {\n          this.mapService.updateVisibility(visibilityStatus, this.visualisationSetsConfig, this.map);\n        });\n      }\n      this.onMapLoaded.next(true);\n    });\n\n    this.map.onMoveEnd(this.mapService.visualisationsSets).subscribe((moveResult => {\n      this.onMove.next(moveResult);\n    }));\n\n    if (this.redrawSource) {\n      this.redrawSource.pipe(takeUntil(this._onDestroy$)).subscribe(sd => {\n        this.mapFrameworkService.setDataToGeojsonSource(this.mapFrameworkService.getSource(sd.source, this.map), {\n          'type': 'FeatureCollection',\n          'features': sd.data\n        });\n      });\n    }\n  }\n\n  /**\n   * @description Listens to events on mapLayers input (configured layers).\n   */\n  public listenToLayersEvents() {\n    /** Zooms on the clicked feature of the given layers. */\n    this.mapLayers.events.zoomOnClick.forEach(layerId => {\n      this.mapFrameworkService.onLayerEvent('click', this.map, layerId, (e) => this.zoomOnClick(e));\n    });\n    this.mapLayers.events.onHover.forEach(layerId => {\n      /** Emits the hovered feature on mousemove. */\n      this.mapFrameworkService.onLayerEvent('mousemove', this.map, layerId, (e) => {\n        this.onFeatureHover.next({ features: e.features, point: [e.lngLat.lng, e.lngLat.lat] });\n      });\n      /** Emits an empty object on mouse leaving a feature. */\n      this.mapFrameworkService.onLayerEvent('mouseleave', this.map, layerId, (e) => {\n        this.onFeatureHover.next({});\n      });\n    });\n    /** Emits the clicked on feature. */\n    this.mapLayers.events.emitOnClick.forEach(layerId => {\n      this.mapFrameworkService.onLayerEvent('click', this.map, layerId, (e) =>\n        this.queryRender(e));\n    });\n    const drawPolygonLayers = [\n      'gl-draw-polygon-stroke-inactive',\n      'gl-draw-polygon-stroke-active',\n      'gl-draw-polygon-stroke-static'\n    ].map(layer => ['.cold', '.hot']\n      .map(id => layer.concat(id)))\n      .reduce((p, ac) => ac.concat(p), []);\n    /** Sets mouse cursor on drawn features */\n    drawPolygonLayers.forEach(layerId => {\n      this.mapFrameworkService.onLayerEvent('mousemove', this.map, layerId, (e) =>\n        this.mapFrameworkService.setMapCursor(this.map, 'pointer'));\n      this.mapFrameworkService.onLayerEvent('mouseleave', this.map, layerId, (e) => {\n        if (this.drawService.isDrawing()) {\n          this.mapFrameworkService.setMapCursor(this.map, 'crosshair');\n        } else {\n          this.mapFrameworkService.setMapCursor(this.map, '');\n        }\n      });\n    });\n\n    // For each layer other than select and hover layers, listen to the events of enter and exit of the mouse\n    this.mapLayers.layers.filter(l => !l.id.startsWith('arlas-select') && !l.id.startsWith('arlas-hover')).forEach(layer => {\n      /** Emits the hovered feature on mousemove. */\n      this.mapFrameworkService.onLayerEvent('mousemove', this.map, layer.id, (e) => {\n        if (this.highlightLegend) {\n          this.legendService.highlightFeatures(layer.id, e.features);\n        }\n      });\n      /** Emits an empty object on mouse leaving a feature. */\n      this.mapFrameworkService.onLayerEvent('mouseleave', this.map, layer.id, (e) => {\n        if (this.highlightLegend) {\n          this.legendService.highlightFeatures(layer.id, []);\n        }\n      });\n    });\n  }\n\n  /** Sets the layers order according to the current order of `visualisationSetsConfig` list*/\n  public reorderLayers() {\n    this.mapService.reorderLayers(this.visualisationSetsConfig, this.map);\n  }\n\n  /** @description Display the basemapswitcher */\n  public showBasemapSwitcher() {\n    this.showBasemapList = true;\n  }\n\n  /** @description Emits event notifiying that the basemap has been changed */\n  public onChangeBasemapStyle() {\n    this.onBasemapChanged.next(true);\n  }\n\n  /**\n   * Updates the visibility status of the layer and emits that update.\n   * @param visualisation visualisation set name\n   * @param l layer id\n   * @param visible whether the layer is enabled and visible in the visualisation set\n   */\n  public emitLegendVisibility(visualisation: string, l: string, visible: boolean): void {\n    // Copy the map so the pipe updates the values\n    this.visibilityStatus = new Map(this.visibilityStatus);\n    this.visibilityStatus.set(visualisation + ARLAS_VSET + l, visible);\n    this.legendVisibiltyStatus.next(this.visibilityStatus);\n  }\n\n  /**\n   * @description Emits the visible visualisation set\n   * @param visualisationName Name of the visualisation.\n   */\n  public emitVisualisations(visualisationName: string) {\n    const layers = this.mapService.updateLayoutVisibility(visualisationName, this.visualisationSetsConfig, this.map);\n    this.visualisations.emit(layers);\n    this.reorderLayers();\n  }\n\n  public downloadLayerSource(downaload: { layer: any; downloadType: string; }): void {\n    const downlodedSource = {\n      layerId: downaload.layer.id,\n      layerName: getLayerName(downaload.layer.id),\n      collection: downaload.layer.metadata.collection,\n      sourceName: downaload.layer.source as string,\n      downloadType: downaload.downloadType\n    };\n    this.downloadSourceEmitter.next(downlodedSource);\n  }\n\n  /** puts the visualisation set list in the new order after dropping */\n  public drop(event: CdkDragDrop<string[]>) {\n    moveItemInArray(this.visualisationSetsConfig, event.previousIndex, event.currentIndex);\n    this.reorderLayers();\n  }\n\n  /** puts the layers list in the new order after dropping */\n  public dropLayer(event: CdkDragDrop<string[]>, visuName: string) {\n    const layers = Array.from(this.mapService.findVisualisationSetLayer(visuName, this.visualisationSetsConfig));\n    moveItemInArray(layers, event.previousIndex, event.currentIndex);\n    this.mapService.setVisualisationSetLayers(visuName, layers, this.visualisationSetsConfig);\n    this.reorderLayers();\n  }\n  public hideBasemapSwitcher() {\n    this.showBasemapList = false;\n  }\n  /**\n   * Fit to given bounds. Options are for padding.\n   * @param bounds Bounds of the map to fit to.\n   */\n  public fitToPaddedBounds(bounds: ArlasLngLatBounds) {\n    this.map.fitToPaddedBounds(bounds);\n  }\n  /**\n   * Centers the map to the given latitude/longitude coordinates.\n   * @param lngLat Latitude/longitude coordinates.\n   */\n  public moveToCoordinates(lngLat: [number, number]) {\n    this.map.setCenter(lngLat);\n  }\n  /** Highlights, in all data sources,the feature(s) having the given elementIdentifier */\n  private highlightFeature(featureToHightLight: { isleaving: boolean; elementidentifier: ElementIdentifier; }) {\n    this.mapService.highlightFeature(this.mapLayers, this.map, featureToHightLight);\n  }\n  /** Selects, in all data sources,the feature(s) having the given elementIdentifier */\n  private selectFeatures(elementToSelect: Array<ElementIdentifier>) {\n    this.mapService.selectFeatures(this.mapLayers, this.map, elementToSelect);\n  }\n  /** Selects, in all data sources, all the features having the given elementIdentifiers and under the given collection.\n   * @param features list of features identifiers.\n   * @param collection data collection (metadata of the data source).\n  */\n  public selectFeaturesByCollection(features: Array<ElementIdentifier>, collection: string) {\n    this.mapService.selectFeaturesByCollection(this.mapLayers, this.map, features, collection);\n  }\n\n  public static getMapJsonSchema(): Object {\n    return mapJsonSchema;\n  }\n  /** Destroys all the components subscriptions. */\n  public ngOnDestroy(): void {\n    if (this.map) {\n      this.map.unsubscribeEvents();\n    }\n    this._onDestroy$.next(true);\n    this._onDestroy$.complete();\n  }\n\n  /** @description Enables bbox drawing mode.*/\n  public addGeoBox() {\n    this.drawComponent.addGeoBox();\n  }\n\n  /**\n   * @description Removes all the aois if none of them is selected. Otherwise it removes the selected one only\n   */\n  public removeAois() {\n    this.drawComponent.removeAois();\n  }\n\n  /** @description Deletes the selected drawn geometry. If no drawn geometry is selected, all geometries are deteleted */\n  public deleteSelectedItem() {\n    this.drawComponent.deleteSelectedItem();\n  }\n\n\n  /**\n   * @description Switches to a drawing mode of a DRAW_POLYGON, DRAW_CIRCLE or DRAW_RADIUS_CIRCLE.\n   * @param mode Draw mode (DRAW_POLYGON, DRAW_CIRCLE or DRAW_RADIUS_CIRCLE). Default to DRAW_POLYGON\n   * @param option Mapboxdraw option.\n   */\n  public switchToDrawMode(mode?: string, option?: any) {\n    this.drawComponent.switchToDrawMode(mode, option);\n  }\n\n  /**\n   * @description Switches to direct_select mode.\n   * @param option Mapboxdraw option.\n   */\n  public switchToDirectSelectMode(option?: { featureIds: Array<string>; allowCircleResize: boolean; }\n    | { featureId: string; allowCircleResize: boolean; }) {\n    this.drawComponent.switchToDirectSelectMode(option);\n  }\n\n  /**\n   * @description Switches to simple_select mode.\n   * @param option Mapboxdraw option.\n   */\n  public switchToEditMode() {\n    this.drawComponent.switchToEditMode();\n  }\n\n  /**\n   * @description Returns all the drawn polygons as wkt or geojson.\n   * @param mode 'wkt' | 'geojson'\n   * @returns Wkt string or Geojson object.\n   */\n  public getAllPolygon(mode: 'wkt' | 'geojson') {\n    return this.drawComponent.getAllPolygon(mode);\n  }\n\n  /**\n   * @description returns the selected polygon geometry in WKT or GeoJson given the mode\n   * @param mode : 'wkt' | 'geojson'\n   * @returns Wkt string or Geojson object.\n   */\n  public getSelectedPolygon(mode: 'wkt' | 'geojson') {\n    return this.drawComponent.getSelectedPolygon(mode);\n  }\n}\n","<div id=\"{{id}}\" class=\"map__container\">\n  <div class=\"map__visu-list\" *ngIf=\"visualisationSetsConfig?.length > 0\">\n    <div class=\"map__legend-button\" [matTooltipPosition]=\"'left'\" matTooltip=\"{{'Manage layers' | translate}}\">\n      <mat-icon (click)=\"legendOpen=!legendOpen\" (keyDown)=\"legendOpen=!legendOpen\">layers</mat-icon>\n    </div>\n    <div [hidden]=\"!legendOpen\" class=\"map__visu-list--container\" cdkDropList\n      (cdkDropListDropped)=\"drop($event)\">\n      <div cdkDrag class=\"map__visu-item\" *ngFor=\"let visu of visualisationSetsConfig\">\n        <div cdkDragHandle class=\"map__visu-title\">\n          <span class=\"map__visu-title-text\" [class.map__visu-title-text--disabled]=\"!visu.enabled\">\n            {{visu.name | translate}}</span>\n          <mat-slide-toggle [checked]=\"visu.enabled\" (change)=\"emitVisualisations(visu.name)\"\n            [matTooltip]=\"'show_layers' | translate\" [hideIcon]=\"true\"></mat-slide-toggle>\n        </div>\n        <div class=\"map__visu-content\" cdkDropList (cdkDropListDropped)=\"dropLayer($event, visu.name)\">\n          <div cdkDrag *ngFor=\"let l of visu.layers\" class=\"map__visu-layer\"\n            [class.cdk-visually-hidden]=\"((visu.name + ':arlas_vset:' + l) | getValue:visibilityStatus) !== true\">\n            <div cdkDragHandle class=\"map__visu-layer-drag\">\n              <mat-icon>drag_indicator</mat-icon>\n            </div>\n            <arlas-legend [collection]=\"l | getCollection: mapService.layersMap \" [enabled]=\"visu.enabled\"\n              [layer]=\"l | getValue: mapService.layersMap \" [zoom]=\"map?.zoom\"\n              (visibilityStatus)=\"emitLegendVisibility(visu.name, l, $event)\" [legendUpdater]=\"legendUpdater\"\n              [visibilityUpdater]=\"visibilityUpdater\" [highlightLegend]=\"highlightLegend\"\n              (downloadSourceEmitter)=\"downloadLayerSource($event)\"></arlas-legend>\n          </div>\n        </div>\n      </div>\n    </div>\n  </div>\n</div>\n<arlas-coordinates *ngIf=\"displayCurrentCoordinates\" [currentLat]=\"map?.currentLat\" [currentLng]=\"map?.currentLng\"\n  (moveToCoordinates$)=\"moveToCoordinates($event)\"></arlas-coordinates>\n\n<arlas-basemap *ngIf=\"showBasemapList\" [mapSources]=\"mapSources\" [map]=\"map\" (mouseleave)=\"hideBasemapSwitcher()\"\n  (basemapChanged)=\"onChangeBasemapStyle()\"></arlas-basemap>\n\n\n<arlas-draw #drawComponent *ngIf=\"map\" [map]=\"map\" [emptyData]=\"emptyData\" [drawData]=\"drawData\"\n  [drawButtonEnabled]=\"drawButtonEnabled\" [drawOption]=\"drawOption\"\n  [drawPolygonVerticesLimit]=\"drawPolygonVerticesLimit\" [preserveDrawingBuffer]=\"preserveDrawingBuffer\"\n  (onAoiChanged)=\"onAoiChanged.emit($event)\"\n  (onAoiEdit)=\"onAoiEdit.emit($event)\"></arlas-draw>\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { Component, ElementRef, inject, Inject, Input, Output, ViewChild } from '@angular/core';\nimport { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog';\nimport { marker } from '@colsen1991/ngx-translate-extract-marker';\nimport * as toGeoJSON from '@tmcw/togeojson';\nimport centroid from '@turf/centroid';\nimport { FeatureCollection, polygon } from '@turf/helpers';\nimport { Feature } from 'geojson';\nimport * as gpsi_ from 'geojson-polygon-self-intersections';\nimport { valid } from 'geojson-validation';\nimport JSZip from 'jszip';\nimport { Subject } from 'rxjs';\nimport * as shp_ from 'shpjs/dist/shp';\nimport { parse } from 'wellknown';\nimport { ArlasMapFrameworkService } from '../arlas-map-framework.service';\nimport { ArlasMapComponent } from '../arlas-map.component';\n\n\nconst gpsi = gpsi_.default;\nconst shp = shp_.default;\n\n\n@Component({\n  templateUrl: './map-import-dialog.component.html',\n  selector: 'arlas-map-import-dialog',\n  styleUrls: ['./map-import-dialog.component.scss']\n})\nexport class MapImportDialogComponent {\n  public displayError = false;\n  public isRunning = false;\n  public fitResult = false;\n  public errorMessage: string;\n  public errorThreshold: string;\n  public currentFile: File;\n\n  public importType: string;\n  public allowedFileExtension: string;\n  public allowedImportType: string[];\n  public wktContent = '';\n\n  public SHP: string = marker('shp');\n  public KML: string = marker('kml');\n  public WKT: string = marker('wkt');\n  public GEOJSON: string = marker('geojson');\n\n  @Output() public file = new Subject<File>();\n  @Output() public importRun = new Subject<any>();\n  @ViewChild('fileInput', { static: false }) public fileInput: ElementRef;\n\n  public constructor(\n    private dialogRef: MatDialogRef<MapImportDialogComponent>,\n    @Inject(MAT_DIALOG_DATA) private data: { allowedImportType: Array<string>; defaultFitResult?: boolean; }\n  ) {\n    this.fitResult = data.defaultFitResult ?? false;\n    this.allowedImportType = this.data.allowedImportType.filter(t => [this.SHP, this.KML, this.WKT, this.GEOJSON].includes(t));\n\n    if (this.allowedImportType.includes(this.SHP)) {\n      this.importType = this.SHP;\n    } else if (this.allowedImportType.includes(this.KML)) {\n      this.importType = this.KML;\n    } else if (this.allowedImportType.includes(this.WKT)) {\n      this.importType = this.WKT;\n    } else {\n      this.importType = this.GEOJSON;\n    }\n    this.changeType();\n  }\n\n  public onFileChange(files: FileList) {\n    this.file.next(files.item(0));\n    this.currentFile = files.item(0);\n    this.displayError = false;\n  }\n\n  public import() {\n    this.importRun.next({ type: this.importType, fitResult: this.fitResult, wktContent: this.wktContent });\n  }\n\n  public onTextChange() { }\n\n  public changeType() {\n    if (this.importType === this.SHP) {\n      this.allowedFileExtension = '.zip';\n    } else if (this.importType === this.KML) {\n      this.allowedFileExtension = '.kml,.kmz';\n    } else if (this.importType === this.GEOJSON) {\n      this.allowedFileExtension = '.json,.geojson';\n    }\n  }\n\n  public onCancel() {\n    this.dialogRef.close();\n  }\n}\n\nexport type AllowedImportGeometry = 'Polygon' | 'Point';\nconst SIMPLE_GEOMETRY_OBJECT = new Set(['Polygon', 'Point', 'LineString']);\n\n@Component({\n  selector: 'arlas-map-import',\n  templateUrl: './map-import.component.html',\n  styleUrls: ['./map-import.component.scss']\n})\n/** L: a layer class/interface.\n *  S: a source class/interface.\n *  M: a Map configuration class/interface.\n */\nexport class MapImportComponent<L, S, M> {\n\n  public SHP = 'shp';\n  public KML = 'kml';\n  public WKT = 'wkt';\n  public GEOJSON = 'geojson';\n\n  public SELF_INTERSECT = marker('Geometry is not valid due to self-intersection');\n  public PARSING_ISSUE = marker('Problem parsing input file');\n  public FILE_TOO_LARGE = marker('File is too large');\n  public GEOMETRY_INVALID = marker('Geometry is not valid');\n  public TOO_MANY_VERTICES = marker('Too many vertices in a polygon');\n  public TOO_MANY_FEATURES = marker('Too many features');\n  public TIMEOUT = marker('Timeout');\n\n  public currentFile: File;\n  public dialogRef: MatDialogRef<MapImportDialogComponent>;\n  public reader: FileReader;\n\n  private tooManyVertex = false;\n  private fitResult = false;\n  private jszip: JSZip;\n  private readonly SOURCE_NAME_POLYGON_LABEL = 'polygon_label';\n  private emptyData: FeatureCollection<GeoJSON.Geometry> = {\n    'type': 'FeatureCollection',\n    'features': []\n  };\n  private featureIndex = 0;\n\n  @Input() public mapComponent: ArlasMapComponent<L, S, M>;\n  @Input() public maxVertexByPolygon: number;\n  @Input() public maxFeatures?: number;\n  @Input() public maxFileSize?: number;\n  @Input() public maxLoadingTime = 20000;\n  @Input() public allowedImportType = [this.SHP, this.KML, this.WKT, this.GEOJSON];\n  @Input() public allowedGeometryObjectType: Array<AllowedImportGeometry> = ['Polygon'];\n  @Output() public imported = new Subject<any>();\n  @Output() public error = new Subject<any>();\n  private _currentAllowedGeom: Set<string>;\n\n  private readonly mapService = inject(ArlasMapFrameworkService<L, S, M>);\n\n  public constructor(\n    public dialog: MatDialog\n  ) { }\n\n  public promiseTimeout(ms, promise) {\n\n    // Create a promise that rejects in <ms> milliseconds\n    const timeout = new Promise((resolve, reject) => {\n      const id = setTimeout(() => {\n        clearTimeout(id);\n        reject(new Error(this.TIMEOUT));\n      }, ms);\n    });\n\n    // Returns a race between our timeout and the passed in promise\n    return Promise.race([\n      promise,\n      timeout\n    ]);\n  }\n\n  private buildAllowedGeometryForImportType(importType: string) {\n    this._currentAllowedGeom = new Set();\n    for (const allowed of this.allowedGeometryObjectType) {\n      this._currentAllowedGeom = this._currentAllowedGeom.union(this.getAllowedGeom(allowed));\n    }\n\n    if (importType === this.KML) {\n      this._currentAllowedGeom.add('GeometryCollection');\n      this._currentAllowedGeom.add('MultiGeometry');\n    } else if (importType === this.WKT) {\n      this._currentAllowedGeom.add('GeometryCollection');\n    }\n  }\n\n  private getAllowedGeom(allowed: AllowedImportGeometry): Set<string> {\n    if (allowed === 'Polygon') {\n      return new Set(['Polygon', 'MultiPolygon']);\n    }\n    if (allowed === 'Point') {\n      return new Set(['Point', 'MultiPoint']);\n    }\n  }\n\n  public openDialog(defaultFitResult?: boolean) {\n    this.dialogRef = this.dialog.open(MapImportDialogComponent,\n      { data: { allowedImportType: this.allowedImportType, defaultFitResult }, panelClass: 'map-import-dialog' });\n    this.dialogRef.componentInstance.file.subscribe((file: File) => {\n      this.currentFile = file;\n    });\n    this.dialogRef.componentInstance.importRun.subscribe(importOptions => {\n      this.fitResult = importOptions.fitResult;\n      this.buildAllowedGeometryForImportType(importOptions.type);\n      this.import(importOptions.type, importOptions.wktContent);\n    });\n  }\n\n  public import(importType: string, content?: string) {\n    this.dialogRef.componentInstance.isRunning = true;\n    this.tooManyVertex = false;\n    this.jszip = new JSZip();\n    let processPromise: Promise<void>;\n    if (importType === this.SHP) {\n      processPromise = this.processAllShape();\n    } else if (importType === this.KML) {\n      processPromise = this.processAllKml();\n    } else if (importType === this.WKT) {\n      processPromise = this.processWKT(content);\n    } else if (importType === this.GEOJSON) {\n      processPromise = this.processJson();\n    }\n    this.promiseTimeout(this.maxLoadingTime, processPromise).catch(error => {\n      if (importType !== this.WKT) {\n        this.reader.abort();\n      }\n      this.throwError(error);\n    });\n  }\n\n  public buildFeature(geom: any, feature: Feature | any, geometryType?: string, bbox?: boolean) {\n    const f = {\n      type: 'Feature',\n      geometry: {\n        coordinates: geom,\n        type: geometryType ?? geom.type\n      },\n      properties: feature.properties\n    };\n\n    if (bbox) {\n      f.geometry['bbox'] = feature.geometry.bbox;\n    }\n    return f;\n  }\n\n  public handleSimpleGeometry(feature, centroids, importedGeojson) {\n    // avoid self intersect control for point\n    if (feature.geometry.type === 'Point' || gpsi(feature).geometry.coordinates.length === 0) {\n      this.addFeature(feature, centroids, importedGeojson, ++this.featureIndex);\n    } else {\n      throw new Error('Geometry is not valid due to self-intersection');\n    }\n  }\n\n  public handleMultiGeometry(feature, centroids, importedGeojson) {\n    // Create a new Polygon feature for each polygon in the MultiPolygon\n    // All properties of the MultiPolygon are copied in each feature created\n    const geomType = (feature.geometry.type === 'MultiPolygon') ? 'Polygon' : 'Point';\n    for (const geom of feature.geometry.coordinates) {\n      const newFeature = this.buildFeature(geom, feature, geomType, true);\n      this.handleSimpleGeometry(newFeature, centroids, importedGeojson);\n    }\n  }\n\n  public handleGeometryCollection(feature, centroids, importedGeojson) {\n    // Create a new Polygon feature for each polygon in the MultiPolygon\n    // All properties of the MultiPolygon are copied in each feature created\n    const simpleGeometry = this._currentAllowedGeom.intersection(SIMPLE_GEOMETRY_OBJECT);\n    for (const geom of feature.geometry.geometries.filter(geom => simpleGeometry.has(geom.type))) {\n      const newFeature = this.buildFeature(geom, feature);\n      this.handleSimpleGeometry(newFeature, centroids, importedGeojson);\n    }\n  }\n\n  public handleFeatureCollection(feature, centroids, importedGeojson) {\n    const features = feature.features.filter(f => this._currentAllowedGeom.has(f.geometry.type));\n    for (const f of features) {\n      const multiGeometry = this._currentAllowedGeom.difference(SIMPLE_GEOMETRY_OBJECT);\n      if (multiGeometry.has(f.geometry.type)) {\n        this.handleMultiGeometry(f, centroids, importedGeojson);\n      } else {\n        this.handleSimpleGeometry(f, centroids, importedGeojson);\n      }\n    }\n  }\n\n  /** *************/\n  /** *** KML *****/\n  /** *************/\n  public readKmlFile() {\n    return new Promise<string | ArrayBuffer>((resolve, reject) => {\n      this.reader = new FileReader();\n      const reader = this.reader;\n      reader.onload = () => {\n        resolve(reader.result);\n      };\n      reader.onerror = () => {\n        reader.abort();\n        reject(new Error(this.PARSING_ISSUE));\n      };\n\n      if (this.maxFileSize && this.currentFile.size > this.maxFileSize) {\n        reject(new Error(this.FILE_TOO_LARGE));\n      } else if (this.currentFile.name.split('.').pop().toLowerCase() === this.KML) {\n          reader.readAsText(this.currentFile);\n        } else if (this.currentFile.name.split('.').pop().toLowerCase() === 'kmz') {\n          reader.readAsArrayBuffer(this.currentFile);\n        } else {\n          reject(new Error(marker('Only `kml` or `zip` file is allowed')));\n        }\n    });\n  }\n\n  private resolveFileFromGzip(result, resolve, reject) {\n    this.jszip.loadAsync(result).then(kmzContent => {\n      const kmlFile = Object.keys(kmzContent.files).find(file => file.split('.').pop().toLowerCase() === this.KML);\n      if (kmlFile) {\n        this.jszip.file(kmlFile).async('text').then((data) => resolve(data));\n      } else {\n        reject(new Error(marker('kml file not found in the zip')));\n      }\n    });\n  }\n\n  public processAllKml() {\n    const readKmlFile = this.readKmlFile();\n\n    let readKmzFile = readKmlFile;\n    if (this.currentFile.name.split('.').pop().toLowerCase() === 'kmz') {\n      readKmzFile = readKmlFile.then(result => new Promise<string>((resolve, reject) => {\n      this.resolveFileFromGzip(result, resolve, reject);\n      }));\n    }\n\n    const parseKml = readKmzFile.then((file: string) => new Promise((resolve, reject) => {\n      const geojson = toGeoJSON.kml((new DOMParser()).parseFromString(file, 'text/xml'));\n      resolve(geojson);\n    }));\n    const geojsonParserPromise = parseKml.then((geojson: any) => new Promise<{ geojson: any; centroides: any; }>((resolve, reject) => {\n      this.computeGeojson(geojson, reject, resolve);\n    }));\n\n    return geojsonParserPromise.then((importedResult) => this.setImportedData(importedResult));\n  }\n\n\n  /** *************/\n  /** * GEOJSON ***/\n  /** *************/\n  public readJsonFile() {\n    return new Promise<string | ArrayBuffer>((resolve, reject) => {\n      this.reader = new FileReader();\n      const reader = this.reader;\n      reader.onload = () => {\n        resolve(reader.result);\n      };\n      reader.onerror = () => {\n        reader.abort();\n        reject(new Error(this.PARSING_ISSUE));\n      };\n\n      if (this.maxFileSize && this.currentFile.size > this.maxFileSize) {\n        reject(new Error(this.FILE_TOO_LARGE));\n      } else {\n        const extension = this.currentFile.name.split('.').pop().toLowerCase();\n        if (extension === 'json' || extension === 'geojson') {\n          reader.readAsText(this.currentFile);\n        } else {\n          reject(new Error(marker('Only `json` or `geojson` file is allowed')));\n        }\n      }\n    });\n  }\n\n  public processJson() {\n    const readJsonFile = this.readJsonFile();\n    const parseJson = readJsonFile.then((fileContent: string) => new Promise<{ geojson: any; centroides: any; }>((resolve, reject) => {\n      const feature = JSON.parse(fileContent);\n      if (valid(feature) && (this._currentAllowedGeom.has(feature.geometry) || feature.type === 'FeatureCollection')) {\n        const centroides = new Array<any>();\n        const importedGeojson = {\n          type: 'FeatureCollection',\n          features: []\n        };\n        try {\n          if (feature.geometry && (feature.geometry.type === 'Polygon' || feature.geometry.type === 'Point')) {\n            this.handleSimpleGeometry(feature, centroides, importedGeojson);\n          } else if (feature.geometry && (feature.geometry.type === 'MultiPolygon' || feature.geometry.type === 'MultiPoint')) {\n            this.handleMultiGeometry(feature, centroides, importedGeojson);\n          } else if (feature.type && feature.type === 'FeatureCollection') {\n            this.handleFeatureCollection(feature, centroides, importedGeojson);\n          }\n          resolve({ geojson: importedGeojson, centroides: centroides });\n        } catch (e) {\n          reject(e);\n        }\n      } else {\n        reject(new Error(this.GEOMETRY_INVALID));\n      }\n    }));\n\n    return parseJson.then((importedResult) => this.setImportedData(importedResult));\n  }\n\n  /** *************/\n  /** ** SHAPE ****/\n  /** *************/\n  public readZipFile() {\n    return new Promise((resolve, reject) => {\n      this.reader = new FileReader();\n      const reader = this.reader;\n      reader.onload = () => {\n        const resultToArray = new Uint8Array(<ArrayBuffer>reader.result);\n        if (resultToArray.length === 0) {\n          reader.abort();\n          reject(new Error(marker('File is empty')));\n        } else {\n          resolve(reader.result);\n        }\n      };\n      reader.onerror = () => {\n        reader.abort();\n        reject(new Error(this.PARSING_ISSUE));\n      };\n\n      if (this.maxFileSize && this.currentFile.size > this.maxFileSize) {\n        reject(new Error(this.FILE_TOO_LARGE));\n      } else if (this.currentFile.name.split('.').pop().toLowerCase() === 'zip') {\n        reader.readAsArrayBuffer(this.currentFile);\n      } else {\n        reject(new Error(marker('Only `zip` file is allowed')));\n      }\n    });\n  }\n\n  private areFilesInvalid(zipResult): boolean {\n    const testArray = Object.keys(zipResult.files).map(fileName => fileName.split('.').pop().toLowerCase());\n    return (testArray.filter(elem => elem === this.SHP || elem === 'shx' || elem === 'dbf').length < 3) &&\n    (testArray.filter(elem => elem === 'json').length !== 1);\n  }\n\n  public processAllShape() {\n    const fileReaderPromise = this.readZipFile();\n\n    const zipLoaderPromise = fileReaderPromise.then((buffer: ArrayBuffer) => new Promise<any>((resolve, reject) => {\n      this.jszip.loadAsync(buffer).then(zipResult => {\n        if (this.areFilesInvalid(zipResult)) {\n          reject(new Error(marker('Zip file must contain at least a `*.shp`, `*.shx` and `*.dbf` or a `*.json`')));\n        } else {\n          resolve(buffer);\n        }\n      });\n    }));\n\n    const shapeParserPromise = zipLoaderPromise\n      .then(buffer => shp(buffer));\n\n    const geojsonParserPromise = shapeParserPromise.then(geojson => new Promise<{ geojson: any; centroides: any; }>((resolve, reject) => {\n      this.computeGeojson(geojson, reject, resolve);\n    }));\n\n    return Promise.all([fileReaderPromise, zipLoaderPromise, shapeParserPromise, geojsonParserPromise])\n      .then(([a, b, c, importedResult]) => {\n        this.setImportedData(importedResult);\n      });\n  }\n\n  /** *************/\n  /** **  WKT  ****/\n  /** *************/\n  public processWKT(wkt: string) {\n    const wktParserPromise = new Promise<{ geojson: any; centroides: any; }>((resolve, reject) => {\n      const geojsonWKT = parse(wkt);\n\n      const centroides = new Array<any>();\n      const importedGeojson = {\n        type: 'FeatureCollection',\n        features: []\n      };\n\n      if (geojsonWKT && valid(geojsonWKT) && this._currentAllowedGeom.has(geojsonWKT.type)) {\n        const feature = {\n          type: 'Feature',\n          geometry: geojsonWKT,\n          properties: { arlas_id: null }\n        };\n        this.handleGeom(feature, centroides, importedGeojson, reject);\n        resolve({ geojson: importedGeojson, centroides: centroides });\n      } else {\n        reject(new Error(this.GEOMETRY_INVALID));\n      }\n    });\n\n    return wktParserPromise.then((importedResult) => this.setImportedData(importedResult));\n  }\n\n  /** *************/\n  /** ** TOOLS ****/\n  /** *************/\n  public clearPolygons() {\n    // Clean source of imported polygons\n    const labelSource = this.mapService.getSource(this.SOURCE_NAME_POLYGON_LABEL, this.mapComponent.map);\n    this.featureIndex = 0;\n    this.mapComponent.onAoiChanged.next(this.emptyData);\n    if (labelSource !== undefined) {\n      this.mapService.setDataToGeojsonSource(labelSource, this.emptyData);\n    }\n  }\n\n  public addFeature(feature: any, centroides: Array<any>,\n    importedGeojson: { type: string; features: Array<any>; }, index: number) {\n    feature.properties.arlas_id = index;\n    const cent = this.calcCentroid(feature);\n    centroides.push(cent);\n    importedGeojson.features.push(feature);\n  }\n\n  public setImportedData(importedResult) {\n    if (this.tooManyVertex) {\n      throw new Error(this.TOO_MANY_VERTICES);\n    } else if (this.maxFeatures && importedResult.geojson.features.length > this.maxFeatures) {\n      throw new Error(this.TOO_MANY_FEATURES);\n    } else if (importedResult.geojson.features.length > 0) {\n      this.dialogRef.componentInstance.isRunning = false;\n      if (this.fitResult) {\n        this.mapComponent.fitToPaddedBounds(this.mapComponent.map.geometryToBounds(importedResult.geojson));\n      }\n      if (this.mapComponent.drawData.features.length > 0) {\n        for (const df of this.mapComponent.drawData.features) {\n          importedResult.geojson.features.push(df);\n        }\n      }\n      this.mapComponent.drawComponent.draw.changeMode('static');\n      this.imported.next(importedResult.geojson.features);\n      this.mapComponent.onAoiChanged.next(importedResult.geojson);\n      this.dialogRef.close();\n    } else {\n      throw new Error(marker('No polygon to display in this file'));\n    }\n  }\n\n  public calcCentroid(feature) {\n    let cent;\n    if (feature.type === 'Point') {\n      cent = centroid(feature);\n    } else {\n      if (!this.maxVertexByPolygon) {\n        this.maxVertexByPolygon = 100;\n      }\n      if (this.maxVertexByPolygon && feature.geometry.coordinates[0].length - 1 > this.maxVertexByPolygon) {\n        this.tooManyVertex = true;\n      }\n      const poly = polygon(feature.geometry.coordinates);\n      cent = centroid(poly);\n    }\n\n    cent.properties.arlas_id = feature.properties.arlas_id;\n    return cent;\n  }\n\n  private throwError(error: Error) {\n    this.dialogRef.componentInstance.displayError = true;\n    this.dialogRef.componentInstance.isRunning = false;\n    this.dialogRef.componentInstance.errorMessage = error.message;\n    switch (this.dialogRef.componentInstance.errorMessage) {\n      case this.TOO_MANY_FEATURES:\n        this.dialogRef.componentInstance.errorThreshold = this.maxFeatures.toString();\n        break;\n      case this.TOO_MANY_VERTICES:\n        this.dialogRef.componentInstance.errorThreshold = this.maxVertexByPolygon.toString();\n        break;\n      case this.FILE_TOO_LARGE:\n        this.dialogRef.componentInstance.errorThreshold = this.formatBytes(this.maxFileSize);\n        break;\n      case this.TIMEOUT:\n        this.dialogRef.componentInstance.errorThreshold = this.maxLoadingTime + ' ms';\n        break;\n      default:\n        this.dialogRef.componentInstance.errorThreshold = '';\n    }\n    if (this.dialogRef.componentInstance.fileInput) {\n      this.dialogRef.componentInstance.fileInput.nativeElement.value = '';\n    }\n    this.dialogRef.componentInstance.currentFile = null;\n    this.error.next(error.message);\n  }\n\n  private formatBytes(bytes, decimals = 2) {\n    if (bytes === 0) {\n      return '0 Bytes';\n    }\n\n    const k = 1024;\n    const dm = Math.max(0, decimals);\n    const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\n    const i = Math.floor(Math.log(bytes) / Math.log(k));\n\n    return Number.parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];\n  }\n\n  private computeGeojson(geojson: any, reject: (reason?: any) => void,\n    resolve: (value: { geojson: any; centroides: any; } | PromiseLike<{ geojson: any; centroides: any; }>) => void) {\n    if (valid(geojson)) {\n      const centroides = new Array<any>();\n      const importedGeojson = {\n        type: 'FeatureCollection',\n        features: []\n      };\n      const allowedFeatures = geojson.features.filter(feature => this._currentAllowedGeom.has(feature.geometry.type));\n      for (const feature of allowedFeatures) {\n        this.handleGeom(feature, centroides, importedGeojson, reject);\n      }\n\n      resolve({ geojson: importedGeojson, centroides: centroides });\n    } else {\n      reject(new Error('Geometry is not valid'));\n    }\n  }\n\n  private handleGeom(feature: any, centroides: any[], importedGeojson: { type: string; features: any[]; }, reject: (reason?: any) => void) {\n    try {\n      if (feature.geometry.type === 'GeometryCollection' || feature.geometry.type === 'MultiGeometry') {\n        // Create a new Polygon feature for each polygon in the MultiPolygon\n        // All properties of the MultiPolygon are copied in each feature created\n        this.handleGeometryCollection(feature, centroides, importedGeojson);\n      } else if (feature.geometry.type === 'MultiPolygon' || feature.geometry.type === 'MultiPoint') {\n        this.handleMultiGeometry(feature, centroides, importedGeojson);\n      } else {\n        this.handleSimpleGeometry(feature, centroides, importedGeojson);\n      }\n    } catch (e) {\n      reject(new Error('Error during import'));\n    }\n  }\n}\n","<h1 mat-dialog-title class=\"mapgl-import-title\">{{ 'Import file' | translate}}</h1>\n<div mat-dialog-content class=\"mapgl-import-body\">\n  <mat-radio-group class=\"mapgl-import-radio-group\" [(ngModel)]=\"importType\" (change)=\"changeType()\">\n    <mat-radio-button *ngFor=\"let type of allowedImportType\" [value]=\"type\" class=\"mapgl-import-radio-button\">\n      {{ type | translate }}\n    </mat-radio-button>\n  </mat-radio-group>\n\n  <input *ngIf=\"importType !== WKT\" type=\"file\" class=\"mapgl-import-upload\" #fileInput accept=\"{{allowedFileExtension}}\" (change)=\"onFileChange($event.target.files)\">\n  <textarea *ngIf=\"importType === WKT\" class=\"mapgl-import-text-area\" [(ngModel)]=\"wktContent\" placeholder=\"{{'Paste your WKT' | translate}}\" (change)=\"onTextChange()\"></textarea>\n\n  <div class=\"mapgl-import-zoom\">\n    <mat-checkbox [(ngModel)]=\"fitResult\">{{ 'Zoom to result' | translate}}</mat-checkbox>\n  </div>\n  <div *ngIf=\"displayError\" class=\"mapgl-import-error\">\n    {{ errorMessage | translate}} <ng-container *ngIf=\"errorThreshold !== ''\"> - ({{'Max:' | translate }} {{errorThreshold}})</ng-container>\n  </div>\n</div>\n\n<div mat-dialog-actions class=\"mapgl-import-actions\">\n  <button mat-button (click)=\"onCancel()\">{{ 'Cancel' | translate}}</button>\n  <button mat-button [disabled]=\"((importType === SHP || importType === KML || importType === GEOJSON) && !currentFile) || isRunning || (importType === WKT && wktContent === '')\" (click)=\"import()\">{{ 'Import' | translate}}</button>\n  <mat-progress-spinner *ngIf=\"isRunning\" [color]=\"'accent'\" [diameter]=\"40\" [mode]=\"'indeterminate'\">\n  </mat-progress-spinner>\n</div>\n","\n\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatButtonToggleModule } from '@angular/material/button-toggle';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatRadioModule } from '@angular/material/radio';\nimport { MatSelectModule } from '@angular/material/select';\nimport { MatTabsModule } from '@angular/material/tabs';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { MapSettingsComponent, MapSettingsDialogComponent } from './map-settings.component';\nimport { GetCollectionDisplayModule } from 'arlas-web-components';\n\n\n@NgModule({\n    imports: [\n        CommonModule,\n        FormsModule,\n        MatTabsModule,\n        MatDialogModule,\n        MatFormFieldModule,\n        MatSelectModule,\n        MatButtonToggleModule,\n        MatIconModule,\n        MatButtonModule,\n        MatRadioModule,\n        ReactiveFormsModule,\n        TranslateModule,\n        GetCollectionDisplayModule\n    ],\n  declarations: [MapSettingsComponent, MapSettingsDialogComponent],\n  exports: [MapSettingsComponent]\n})\nexport class MapSettingsModule {\n\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\nimport { MatRadioModule } from '@angular/material/radio';\nimport { MatSelectModule } from '@angular/material/select';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { MapImportComponent, MapImportDialogComponent } from './map-import.component';\n\n\n\n@NgModule({\n  imports: [\n    CommonModule,\n    FormsModule,\n    MatButtonModule,\n    MatCheckboxModule,\n    MatDialogModule,\n    MatProgressSpinnerModule,\n    MatSelectModule,\n    MatRadioModule,\n    TranslateModule\n  ],\n  declarations: [MapImportComponent, MapImportDialogComponent],\n  exports: [MapImportComponent]\n})\nexport class MapImportModule {\n\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { CommonModule } from '@angular/common';\nimport { MatIconModule } from '@angular/material/icon';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { NgModule } from '@angular/core';\nimport { BasemapComponent } from './basemap.component';\n\n@NgModule({\n  imports: [\n    CommonModule,\n    MatIconModule,\n    TranslateModule\n  ],\n  declarations: [BasemapComponent],\n  exports: [BasemapComponent]\n})\nexport class BasemapModule {\n\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { CommonModule } from '@angular/common';\nimport { MatIconModule } from '@angular/material/icon';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { NgModule } from '@angular/core';\nimport { CoordinatesComponent } from './coordinates.component';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatInputModule } from '@angular/material/input';\nimport { CoordinatesErrorPipe } from './coordinates.pipe';\n\n@NgModule({\n  imports: [\n    CommonModule,\n    MatIconModule,\n    MatFormFieldModule,\n    FormsModule,\n    ReactiveFormsModule,\n    MatTooltipModule,\n    MatInputModule,\n    TranslateModule\n  ],\n  declarations: [CoordinatesComponent, CoordinatesErrorPipe],\n  exports: [CoordinatesComponent]\n})\nexport class CoordinatesModule {\n\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { DragDropModule } from '@angular/cdk/drag-drop';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatMenuModule } from '@angular/material/menu';\nimport { MatSlideToggleModule } from '@angular/material/slide-toggle';\nimport { MatSnackBarModule } from '@angular/material/snack-bar';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MarkerModule } from '@colsen1991/ngx-translate-extract-marker/extras';\nimport { TranslateModule } from '@ngx-translate/core';\nimport {\n  ArlasColorService, FormatNumberModule,\n  GetCollectionDisplayModule, GetColorModule, GetValueModule,\n  ShortenNumberModule\n} from 'arlas-web-components';\nimport { ArlasMapComponent } from './arlas-map.component';\nimport { GetCollectionPipe } from './arlas-map.pipe';\nimport { BasemapModule } from './basemaps/basemap.module';\nimport { CoordinatesModule } from './coordinates/coordinates.module';\nimport { ArlasDrawComponent } from './draw/arlas-draw.component';\nimport { MapboxAoiDrawService } from './draw/draw.service';\nimport { FormatLegendPipe } from './legend/format-legend.pipe';\nimport { LayerIdToName } from './legend/layer-name.pipe';\nimport { LayerIconComponent } from './legend/legend-icon/layer-icon.component';\nimport { LegendItemComponent } from './legend/legend-item/legend-item.component';\nimport { LegendComponent } from './legend/legend.component';\nimport { MapImportComponent } from './map-import/map-import.component';\nimport { MapImportModule } from './map-import/map-import.module';\nimport { MapSettingsComponent } from './map-settings/map-settings.component';\nimport { MapSettingsModule } from './map-settings/map-settings.module';\n\n\n@NgModule({\n  declarations: [\n    ArlasMapComponent,\n    LayerIconComponent,\n    LegendComponent,\n    LegendItemComponent,\n    ArlasDrawComponent,\n    LayerIdToName,\n    GetCollectionPipe,\n    FormatLegendPipe\n  ],\n  imports: [\n    MatSnackBarModule,\n    TranslateModule,\n    MatIconModule,\n    MatMenuModule,\n    MatSlideToggleModule,\n    MatTooltipModule,\n    MatFormFieldModule,\n    GetCollectionDisplayModule,\n    GetColorModule,\n    DragDropModule,\n    GetValueModule,\n    FormatNumberModule,\n    CommonModule,\n    CoordinatesModule,\n    MapSettingsModule,\n    MapImportModule,\n    BasemapModule,\n    MarkerModule,\n    ShortenNumberModule\n  ],\n  providers: [\n    MapboxAoiDrawService,\n    ArlasColorService\n  ],\n  exports: [\n    LayerIconComponent,\n    LegendComponent,\n    LegendItemComponent,\n    LayerIdToName,\n    ArlasMapComponent,\n    MapImportComponent,\n    MapSettingsComponent,\n    GetCollectionPipe,\n    FormatLegendPipe\n  ]\n})\nexport class ArlasMapModule { }\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { Pipe, PipeTransform } from '@angular/core';\nimport { FormControl, FormGroup } from '@angular/forms';\nimport { marker } from '@colsen1991/ngx-translate-extract-marker';\nimport { BboxFormGroup } from './bbox-generator.utils';\n\n@Pipe({\n  name: 'bboxFormError'\n})\nexport class BboxFormErrorPipe implements PipeTransform {\n\n  public transform(formControl: FormControl | FormGroup): string {\n    if (formControl.hasError('required')) {\n      return marker('You must enter a coordinate');\n    } else if ((formControl as BboxFormGroup).latitudeErrors) {\n      return marker('Both corners have the same latitudes, modify one of them.');\n    }\n    return formControl.hasError('pattern') ? marker('Enter a coordinate in decimal (1.1) or sexagesimal (1° 6\\' 3\")') : '';\n  }\n\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { FormGroup } from '@angular/forms';\nimport { Coordinate, PointFormGroup } from './coordinates.tools';\nimport { Corner } from '../draw/draw.models';\nimport { Subscription } from 'rxjs';\n\n\nexport class BboxFormGroup extends FormGroup {\n\n  private firstCornerLatitude: string;\n  private secondCornerLatitude: string;\n  public firstCorner: PointFormGroup;\n  public secondCorner: PointFormGroup;\n  public latitudeErrors = false;\n\n  public subscriptions = new Array<Subscription>();\n\n  public constructor(corner: Corner) {\n    const firstCorner = new PointFormGroup(corner.lat - 0.5, corner.lng - 0.5);\n    const secondCorner = new PointFormGroup(corner.lat + 0.5, corner.lng + 0.5);\n    super({\n      firstCorner,\n      secondCorner\n    });\n    this.firstCorner = firstCorner;\n    this.secondCorner = secondCorner;\n\n    const latSub = this.firstCorner.latitude.valueChanges.subscribe(v => {\n      this.firstCornerLatitude = v;\n      this.secondCornerLatitude = this.secondCorner.latitude.value;\n      if (this.secondCornerLatitude !== undefined) {\n        if (Coordinate.parse(this.firstCornerLatitude) === Coordinate.parse(this.secondCornerLatitude)) {\n          this.latitudeErrors = true;\n        } else {\n          this.latitudeErrors = false;\n        }\n      }\n    });\n    this.subscriptions.push(latSub);\n\n    const lonSub = this.secondCorner.latitude.valueChanges.subscribe(v => {\n      this.secondCornerLatitude = v;\n      this.firstCornerLatitude = this.firstCorner.latitude.value;\n      if (this.firstCornerLatitude !== undefined) {\n        if (Coordinate.parse(this.firstCornerLatitude) === Coordinate.parse(this.secondCornerLatitude)) {\n          this.latitudeErrors = true;\n        } else {\n          this.latitudeErrors = false;\n        }\n      }\n    });\n    this.subscriptions.push(lonSub);\n  }\n\n  public getFirstCorner(): Corner {\n    return {\n      lat: Coordinate.parse(this.firstCorner.latitude.value),\n      lng: Coordinate.parse(this.firstCorner.longitude.value)\n    };\n  }\n\n  public getSecondCorner(): Corner {\n    return {\n      lat: Coordinate.parse(this.secondCorner.latitude.value),\n      lng: Coordinate.parse(this.secondCorner.longitude.value)\n    };\n  }\n}\n\n\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { AfterViewInit, ChangeDetectorRef, Component, Inject, OnDestroy, OnInit } from '@angular/core';\nimport { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\nimport { BboxFormGroup } from './bbox-generator.utils';\nimport { marker } from '@colsen1991/ngx-translate-extract-marker';\nimport { MapboxAoiDrawService } from '../draw/draw.service';\nimport { Corner } from '../draw/draw.models';\n\n@Component({\n  selector: 'arlas-bbox-generator',\n  templateUrl: './bbox-generator.component.html',\n  styleUrls: ['./bbox-generator.component.scss']\n})\nexport class BboxGeneratorComponent implements OnInit, AfterViewInit, OnDestroy {\n  /**\n   * @constant\n   */\n  public DESCRIPTION = marker('Enter coordinates in decimal or sexagesimal degrees');\n  public bboxForm: BboxFormGroup;\n  /**\n   * @constant\n   */\n  public placeHolder = marker('Decimal: 1.1 or Sexagesimal 1°6\\'3\" coordinate');\n  public constructor(\n    private drawService: MapboxAoiDrawService,\n    private cdr: ChangeDetectorRef,\n    @Inject(MAT_DIALOG_DATA) public data: {\n      initCorner: Corner;\n    },\n    public dialogRef: MatDialogRef<BboxGeneratorComponent>,) {\n  }\n\n  public ngOnInit(): void {\n    if (!!this.data && !this.data.initCorner) {\n      this.data.initCorner = {\n        lat: 0,\n        lng: 0\n      };\n    }\n    this.bboxForm = new BboxFormGroup(this.data.initCorner);\n  }\n  public ngAfterViewInit(): void {\n    this.cdr.detectChanges();\n  }\n\n  public ngOnDestroy(): void {\n    this.bboxForm.subscriptions.forEach(s => s.unsubscribe());\n  }\n\n  public close() {\n    this.dialogRef.close();\n  }\n\n  public generateBbox() {\n    this.drawService.drawBbox(this.bboxForm.getFirstCorner(), this.bboxForm.getSecondCorner());\n    this.dialogRef.close();\n  }\n\n}\n","<div class=\"wrapper\">\n    <div class=\"title-wrapper\">\n        <span>{{'BBox generator' | translate}}</span>\n        <mat-icon class=\"clear\" (click)=\"close()\" (keyDown)=\"close()\">clear</mat-icon>\n    </div>\n    <div class=\"content\">\n        <div class=\"description\">\n            <mat-icon>info</mat-icon>\n            <span>{{DESCRIPTION | translate}}</span>\n        </div>\n        <div class=\"section\" *ngIf=\"bboxForm?.firstCorner\" [formGroup]=\"bboxForm?.firstCorner\">\n            <div class=\"title\">{{'First corner' | translate}}</div>\n            <div class=\"coordinate\">\n                <mat-form-field appearance=\"outline\" >\n                    <mat-label>{{'Latitude' |translate}}</mat-label>\n                    <input class=\"input\"  matInput [formControl]=\"bboxForm.firstCorner.latitude\" [placeholder]=\"placeHolder | translate\">\n                    <mat-error *ngIf=\"bboxForm.firstCorner.latitude.invalid\">{{bboxForm.firstCorner.latitude | bboxFormError | translate}}</mat-error>\n                </mat-form-field>\n            </div>\n            <div class=\"coordinate\">\n                <mat-form-field appearance=\"outline\">\n                    <mat-label>{{'Longitude'|translate }}</mat-label>\n                    <input class=\"input\"  matInput [formControl]=\"bboxForm.firstCorner.longitude\" [placeholder]=\"placeHolder | translate\">\n                    <mat-error *ngIf=\"bboxForm.firstCorner.longitude.invalid\">{{bboxForm.firstCorner.longitude | bboxFormError | translate}}</mat-error>\n                </mat-form-field>\n            </div>\n        </div>\n        <div class=\"section\" *ngIf=\"bboxForm?.secondCorner\" [formGroup]=\"bboxForm?.secondCorner\">\n            <div class=\"title\">{{'Second corner' | translate}}</div>\n            <div class=\"coordinate\">\n                <mat-form-field appearance=\"outline\" >\n                    <mat-label>{{'Latitude' | translate}}</mat-label>\n                    <input class=\"input\"  matInput [formControl]=\"bboxForm.secondCorner.latitude\" [placeholder]=\"placeHolder | translate\">\n                    <mat-error *ngIf=\"bboxForm.secondCorner.latitude.invalid\">{{bboxForm.secondCorner.latitude | bboxFormError | translate}} </mat-error>\n                </mat-form-field>\n            </div>\n            <div class=\"coordinate\">\n                <mat-form-field appearance=\"outline\">\n                    <mat-label>{{'Longitude' | translate}}</mat-label>\n                    <input class=\"input\"  matInput [formControl]=\"bboxForm.secondCorner.longitude\" [placeholder]=\"placeHolder | translate\">\n                    <mat-error *ngIf=\"bboxForm.secondCorner.longitude.invalid\">{{bboxForm.secondCorner.longitude | bboxFormError | translate}}</mat-error>\n                </mat-form-field>\n            </div>\n\n\n        </div>\n        <div class=\"errors\" *ngIf=\"bboxForm.latitudeErrors\">\n            <mat-icon>report</mat-icon>\n            <mat-error>{{bboxForm | bboxFormError | translate}}</mat-error>\n        </div>\n    </div>\n    <div class=\"actions\">\n        <button mat-button [mat-dialog-close]=\"null\">{{'Close' | translate}}\n        </button>\n        <button class=\"create-action\" mat-stroked-button (click)=\"generateBbox()\"\n            [disabled]=\"bboxForm.invalid || bboxForm.latitudeErrors\">\n            <span class=\"label\">{{'Generate AOI' | translate}}</span>\n        </button>\n    </div>\n</div>","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { CommonModule } from '@angular/common';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { BboxGeneratorComponent } from './bbox-generator.component';\nimport { NgModule } from '@angular/core';\nimport { MatInputModule } from '@angular/material/input';\nimport { BboxFormErrorPipe } from './bbox-form-error.pipe';\n\n@NgModule({\n  imports: [\n    CommonModule,\n    FormsModule,\n    MatDialogModule,\n    MatFormFieldModule,\n    MatIconModule,\n    MatButtonModule,\n    MatInputModule,\n    ReactiveFormsModule,\n    TranslateModule\n  ],\n  declarations: [BboxGeneratorComponent, BboxFormErrorPipe],\n  exports: [BboxGeneratorComponent, BboxFormErrorPipe]\n})\nexport class BboxGeneratorModule {\n\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport MapboxDraw from '@mapbox/mapbox-gl-draw';\nimport { AbstractArlasMapGL } from '../map/AbstractArlasMapGL';\nimport { Feature, FeatureCollection, Geometry } from '@turf/helpers';\n\nexport type DrawEvents = 'draw.create' | 'draw.delete' | 'draw.combine' | 'draw.uncombine' |\n  'draw.update' | 'draw.selectionchange' | 'draw.modechange' | 'draw.render' | 'draw.actionable' |\n  'draw.edit.saveInitialFeature' | 'draw.onClick' | 'draw.onStart' | 'draw.onStop'\n  | 'draw.invalidGeometry';\n\nexport type DrawModes = 'SIMPLE_SELECT' | 'DRAW_CIRCLE' | 'DIRECT_SELECT' |\n  'DRAW_LINE_STRING' | 'DRAW_POLYGON' | 'DRAW_POINT' | 'DRAW_RADIUS_CIRCLE' |\n  'DRAW_STRIP' | 'DIRECT_STRIP'| 'DRAW_RECTANGLE' | 'STATIC';\n\nexport interface DrawEventsInterface {\n  onDrawCreate: (...args) => void;\n  onDrawUpdate: (...args) => void;\n  onDrawDelete: (...args) => void;\n  onDrawOnClick: (...args) => void;\n  onDrawOnStart: (...args) => void;\n  onDrawOnStop: (...args) => void;\n  onDrawInvalidGeometry: (...args) => void;\n  onDrawEditSaveInitialFeature: (...args) => void;\n  onDrawSelectionchange: (...args) => void;\n  onDrawModeChange: (...args) => void;\n}\n\nexport class AbstractDraw implements DrawEventsInterface {\n  protected config;\n  public arlasMap: AbstractArlasMapGL;\n  public enabled: boolean;\n  public drawProvider: MapboxDraw;\n  public constructor(config: any, enabled: boolean, map: AbstractArlasMapGL) {\n    const modes = MapboxDraw.modes;\n    this.config = JSON.parse(JSON.stringify(config));\n    this.config.modes = Object.assign(modes, config.modes);\n    this.drawProvider = new MapboxDraw(this.config);\n    this.arlasMap = map;\n    this.enabled = enabled;\n  }\n\n  public onAdd(map) {\n    const controlContainer = this.drawProvider.onAdd(map);\n    if (!this.enabled) {\n      controlContainer.className += ' draw-control-disabled';\n    }\n    return controlContainer;\n  }\n\n  public onRemove(map) {\n    return this.drawProvider.onRemove(map);\n  }\n\n  public setMode(drawModes: DrawModes, replaceMode: any) {\n    this.drawProvider.modes[drawModes] = replaceMode;\n  }\n\n  public getAllFeatures() {\n    return this.getAll().features;\n  }\n\n  public onDrawCreate(fn: (e) => void): void {\n    this.on('draw.create', (e) => {\n      fn(e);\n    });\n  }\n\n  public onDrawDelete(fn: (e) => void): void {\n    this.on('draw.delete', (e) => {\n      fn(e);\n    });\n  }\n\n  public onDrawEditSaveInitialFeature(fn: (e) => void): void {\n    this.on('draw.edit.saveInitialFeature', (e) => {\n      fn(e);\n    });\n  }\n\n  public onDrawInvalidGeometry(fn: (e) => void): void {\n    this.on('draw.invalidGeometry', (e) => {\n      fn(e);\n    });\n  }\n\n  public onDrawModeChange(fn: (e) => void): void {\n    this.on('draw.modechange', (e) => {\n      fn(e);\n    });\n  }\n\n  public onDrawOnClick(fn: (e) => void): void {\n    this.on('draw.onClick', (e) => {\n      fn(e);\n    });\n  }\n\n  public onDrawOnStart(fn: (e) => void): void {\n    this.on('draw.onStart', (e) => {\n      fn(e);\n    });\n  }\n\n  public onDrawOnStop(fn: (e) => void): void {\n    this.on('draw.onStop', (e) => {\n      fn(e);\n    });\n  }\n\n  public onDrawSelectionchange(fn: (e) => void): void {\n    this.on('draw.selectionchange', (e) => {\n      fn(e);\n    });\n  }\n\n  public onDrawUpdate(fn: (e) => void): void {\n    this.on('draw.update', (e) => {\n      fn(e);\n    });\n  }\n\n  public getMode(modes: DrawModes) {\n    return this.drawProvider.modes[modes];\n  }\n\n  public on(event: DrawEvents, func: (e) => void): void {\n    this.arlasMap.on(event, func);\n  }\n\n  public add(feature: Feature<Geometry> | FeatureCollection<GeoJSON.Geometry>) {\n    this.drawProvider.add(feature);\n  }\n\n  public get(featureId: string): Feature | undefined {\n    return this.drawProvider.get(featureId);\n  }\n\n  public delete(ids: string | Array<string>): this {\n    this.drawProvider.delete(ids);\n    return this;\n  }\n  public deleteAll(): this {\n    this.drawProvider.deleteAll();\n    return this;\n  }\n\n  public set(featureCollection: FeatureCollection): Array<string> {\n    return this.drawProvider.set(featureCollection);\n  }\n\n  public trash(): this {\n    this.drawProvider.trash();\n    return this;\n  }\n\n  public combineFeatures(): this {\n    this.drawProvider.combineFeatures();\n    return this;\n  }\n  public uncombineFeatures(): this {\n    this.drawProvider.uncombineFeatures();\n    return this;\n  }\n\n  public getCurrentMode(): string {\n    return this.drawProvider.getMode();\n  }\n\n  public getFeatureIdsAt(point: { x: number; y: number; }): Array<string> {\n    return this.drawProvider.getFeatureIdsAt(point);\n  }\n\n  public getSelectedIds(): Array<string> {\n    return this.drawProvider.getSelectedIds();\n  }\n\n  public getSelected() {\n    return this.drawProvider.getSelected();\n  }\n\n  public getAll() {\n    return this.drawProvider.getAll();\n  }\n\n  public getSelectedFeatures() {\n    return this.getSelected().features;\n  }\n\n  public setFeatureProperty(featureId: string, property: string, value: any): this {\n    this.drawProvider.setFeatureProperty(featureId, property, value);\n    return this;\n  }\n\n  public changeMode(mode: string, opt?: any): this {\n    this.drawProvider.changeMode(mode, opt);\n    return this;\n  }\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { marker } from '@colsen1991/ngx-translate-extract-marker';\n\n\n/** All the map controls configuration\n * These interfaces are generic.\n */\n\nexport type ControlPosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';\n\nexport interface IconConfig {\n  path: string;\n  recolorable?: boolean;\n}\n\nexport interface ConfigControls {\n  enable: boolean;\n  position?: ControlPosition;\n  config?: any;\n  overrideEvent?: { event: any; fn: (e) => void; };\n}\n\nexport interface PitchToggleConfigControls extends ConfigControls {\n  config: { bearing: number; pitch: number; minpitchzoom: number; };\n  overrideEvent?: { event: any; fn: (e?) => void; };\n}\n\nexport interface ControlsOption {\n  mapAttribution?: ConfigControls;\n  scale?: ConfigControls;\n  pitchToggle?: PitchToggleConfigControls;\n  navigationControl?: ConfigControls;\n  globe?: ConfigControls;\n}\n\nexport interface DrawConfigControl extends ConfigControls {\n  name?: string;\n}\n\nexport interface DrawControlsOption {\n  draw: { control: any; position?: ControlPosition; };\n  addGeoBox: DrawConfigControl;\n  removeAois: DrawConfigControl;\n}\n\nexport class PitchToggle {\n  public bearing: number;\n  public pitch: number;\n  public minpitchzoom: number;\n  public map: any;\n  public btn: HTMLButtonElement;\n  public container: HTMLDivElement;\n\n  public image3D = 'url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzM' +\n    'CI+ICAgIDx0ZXh0IHg9IjUwJSIgeT0iNTAlIiBkeT0iLjM1ZW0iIHN0eWxlPSJmb250LXNpemU6IDE0cHg7IGZvbnQtZmFtaWx5OiAnSGVsdmV0aWNhIE5ldWUnLEFya' +\n    'WFsLEhlbHZldGljYSxzYW5zLXNlcmlmOyBmb250LXdlaWdodDogYm9sZDsgdGV4dC1hbmNob3I6IG1pZGRsZTsiPjNEPC90ZXh0Pjwvc3ZnPg==)';\n  public image2D = 'url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzM' +\n    'CI+ICAgIDx0ZXh0IHg9IjUwJSIgeT0iNTAlIiBkeT0iLjM1ZW0iIHN0eWxlPSJmb250LXNpemU6IDE0cHg7IGZvbnQtZmFtaWx5OiAnSGVsdmV0aWNhIE5ldWUnLEFyaWF' +\n    'sLEhlbHZldGljYSxzYW5zLXNlcmlmOyBmb250LXdlaWdodDogYm9sZDsgdGV4dC1hbmNob3I6IG1pZGRsZTsiPjJEPC90ZXh0Pjwvc3ZnPg==)';\n\n  public btnClasses: string[] = [];\n  public containerClasses: string[] = [];\n\n  public constructor(bearing, pitch, minpitchzoom) {\n    this.bearing = bearing;\n    this.pitch = pitch;\n    this.minpitchzoom = minpitchzoom;\n    this._buildClasses();\n  }\n\n  protected _buildClasses() {\n    this.btnClasses = [];\n    this.containerClasses = [];\n  }\n\n  public onAdd(map) {\n    this.map = map;\n    this.btn = document.createElement('button');\n    this.btn.className = this.btnClasses.join(' ');\n    this.btn.style.backgroundImage = this.image3D;\n    this.btn.type = 'button';\n    this.btn['aria-label'] = marker('Toggle Pitch');\n    this.btn.onclick = () => {\n      if (map.getPitch() === 0) {\n        const options = { pitch: this.pitch, bearing: this.bearing, minpitchzoom: null };\n        if (this.minpitchzoom && map.getZoom() > this.minpitchzoom) {\n          options.minpitchzoom = this.minpitchzoom;\n        }\n        map.easeTo(options);\n        this.btn.style.backgroundImage = this.image2D;\n      } else {\n        map.easeTo({ pitch: 0, bearing: 0 });\n        this.btn.style.backgroundImage = this.image3D;\n      }\n    };\n    this.container = document.createElement('div');\n    this.container.className = this.containerClasses.join(' ');\n    this.container.appendChild(this.btn);\n    return this.container;\n  }\n\n  public onRemove() {\n    this.container.parentNode.removeChild(this.container);\n    this.map = undefined;\n  }\n}\n\nexport class ControlButton {\n  public map: any;\n  public btn: HTMLButtonElement;\n  public container: HTMLDivElement;\n  public icon;\n  public name;\n  private tooltip;\n  public btnClasses: string[] = [];\n  public containerClasses: string[] = [];\n  public constructor(name: string, tooltip?: string) {\n    this.name = name;\n    this.tooltip = tooltip;\n    this._buildClasses();\n  }\n\n  protected _buildClasses() {\n    this.btnClasses = [];\n    this.containerClasses = [];\n  }\n  public onAdd(map) {\n    this.map = map;\n    this.btn = document.createElement('button');\n    this.btn.className = this.btnClasses.join(' ');\n    this.btn.type = 'button';\n    this.btn.id = 'layers_switcher_btn';\n    this.container = document.createElement('div');\n    this.container.className = this.containerClasses.join(' ');\n    this.container.setAttribute('title', this.tooltip);\n    this.container.appendChild(this.btn);\n    return this.container;\n  }\n  public onRemove() {\n    this.container.parentNode.removeChild(this.container);\n    this.map = undefined;\n  }\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n\n/** Data source of a layer */\nexport class ArlasMapSource<SourceType> {\n  public id: string;\n  public source: string | SourceType;\n}\n","/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { ArlasPaint, PaintValue } from '../model/layers';\n\n\n/** This file describes how to style a vector layer */\n\nexport enum VectorStyleEnum {\n    circle = 'circle',\n    fill = 'fill',\n    line = 'line'\n}\n\nexport class VectorStyle {\n    public type: VectorStyleEnum;\n    public style: ArlasPaint;\n    public constructor(type: VectorStyleEnum, style: ArlasPaint) {\n        this.type = type;\n        this.style = style;\n    }\n}\n","\n/*\n * Licensed to Gisaïa under one or more contributor\n * license agreements. See the NOTICE.txt file distributed with\n * this work for additional information regarding copyright\n * ownership. Gisaïa licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n/*\n * Public API Surface of arlas-map\n */\n\nexport {\n  MapSettingsComponent, MapSettingsService, GeoQuery, GeometrySelectModel, OperationSelectModel, MapSettingsDialogComponent,\n  GeoQueryOperator\n} from './lib/map-settings/map-settings.component';\nexport {\n  AllowedImportGeometry, MapImportComponent, MapImportDialogComponent\n} from './lib/map-import/map-import.component';\nexport { MapSettingsModule } from './lib/map-settings/map-settings.module';\nexport { MapImportModule } from './lib/map-import/map-import.module';\nexport { GetCollectionPipe } from './lib/arlas-map.pipe';\nexport { LayerIdToName } from './lib/legend/layer-name.pipe';\nexport { LegendService } from './lib/legend/legend.service';\nexport { ArlasMapModule } from './lib/arlas-map.module';\nexport { LegendItemComponent } from './lib/legend/legend-item/legend-item.component';\nexport { LegendComponent } from './lib/legend/legend.component';\nexport { LayerIconComponent } from './lib/legend/legend-icon/layer-icon.component';\nexport * from './lib/arlas-map-framework.service';\nexport * from './lib/arlas-map.component';\nexport * from './lib/arlas-map.module';\nexport { CoordinatesComponent } from './lib/coordinates/coordinates.component';\nexport { CoordinatesErrorPipe } from './lib/coordinates/coordinates.pipe';\nexport { BasemapComponent } from './lib/basemaps/basemap.component';\nexport { BasemapStyle } from './lib/basemaps/basemap.config';\nexport { BasemapService } from './lib/basemaps/basemap.service';\nexport { ArlasBasemaps } from './lib/basemaps/basemaps.model';\nexport { BboxFormErrorPipe } from './lib/bbox-generator/bbox-form-error.pipe';\nexport { BboxGeneratorComponent } from './lib/bbox-generator/bbox-generator.component';\nexport { BboxGeneratorModule } from './lib/bbox-generator/bbox-generator.module';\nexport { BboxFormGroup } from './lib/bbox-generator/bbox-generator.utils';\nexport { Coordinate } from './lib/bbox-generator/coordinates.tools';\nexport { AbstractDraw } from './lib/draw/AbstractDraw';\nexport { AoiDimensions as AoiEdition, Corner } from './lib/draw/draw.models';\nexport { MapboxAoiDrawService } from './lib/draw/draw.service';\nexport { limitVertexDirectSelectMode } from './lib/draw/modes/LimitVertexDirectSelectMode';\nexport { validGeomDrawPolygonMode } from './lib/draw/modes/ValidGeomDrawPolygonMode';\nexport { directModeOverride } from './lib/draw/modes/directSelectOverride';\nexport { simpleSelectModeOverride } from './lib/draw/modes/simpleSelectOverride';\nexport { circleMode } from './lib/draw/modes/circles/circle.mode';\nexport { radiusCircleMode } from './lib/draw/modes/circles/radius.circle.mode';\nexport { createSupplementaryPointsForCircle, dragPan } from './lib/draw/modes/circles/utils';\nexport { stripDirectSelectMode } from './lib/draw/modes/strip/strip.direct.mode';\nexport { stripMode } from './lib/draw/modes/strip/strip.mode';\nexport { rectangleMode } from './lib/draw/modes/rectangleMode';\nexport {\n  AbstractArlasMapGL, ArlasMapOffset, CROSS_LAYER_PREFIX,\n  GEOJSON_SOURCE_TYPE, LAYER_SWITCHER_TOOLTIP,\n  MapConfig, RESET_BEARING, ZOOM_IN, ZOOM_OUT, OPACITY_SUFFIX\n} from './lib/map/AbstractArlasMapGL';\nexport {\n  ConfigControls, ControlButton, ControlPosition, ControlsOption, DrawConfigControl,\n  DrawControlsOption, IconConfig, PitchToggle, PitchToggleConfigControls\n} from './lib/map/model/controls';\nexport { MapExtent } from './lib/map/model/extent';\nexport {\n  ARLAS_ID, ARLAS_VSET, ExternalEvent, ExternalEventLayer, FILLSTROKE_LAYER_PREFIX, FillStroke, HOVER_LAYER_PREFIX,\n  LayerEvents, LayerMetadata, MapLayers, MetadataHiddenProps, PaintColor, PaintValue, SCROLLABLE_ARLAS_ID, SELECT_LAYER_PREFIX,\n  getLayerName, ArlasDataLayer, ArlasPaint\n} from './lib/map/model/layers';\nexport { ArlasMapSource } from './lib/map/model/sources';\nexport { VisualisationSetConfig } from './lib/map/model/visualisationsets';\nexport {\n  Legend, LegendData, PROPERTY_SELECTOR_SOURCE, CircleLegend, LineLegend,\n  FillLegend, HeatmapLegend, LabelLegend\n} from './lib/legend/legend.config';\nexport { getMax, MAX_CIRLE_RADIUS, MAX_LINE_WIDTH } from './lib/legend/legend.tools';\nexport { FormatLegendPipe } from './lib/legend/format-legend.pipe';\nexport * as styles from './lib/draw/themes/default-theme';\nexport { ArlasMapComponent } from './lib/arlas-map.component';\nexport { ArlasLngLat, OnMoveResult, ArlasLngLatBounds, } from './lib/map/model/map';\nexport { VectorStyle, VectorStyleEnum } from './lib/map/model/vector-style';\n/** Map component logic */\nexport { AbstractArlasMapService } from './lib/arlas-map.service';\n/** Map framework logic */\nexport { ArlasMapFrameworkService } from './lib/arlas-map-framework.service';\nexport { GET, HEATMAP_DENSITY, IN, INTERPOLATE, MATCH, NOT_IN, OTHER } from './lib/map/model/filters';\nexport { MapLayerMouseEvent, MapMouseEvent} from './lib/map/model/events';\nexport { latLngToWKT } from './lib/map/tools';\nexport { ArlasMapOption } from './lib/map/AbstractArlasMapGL';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i3","i9","reader","doubleClickZoom","styles.default","i1.MapboxAoiDrawService","i2","i4.AbstractArlasMapService","i1","i5","i6","i7","i8.CoordinatesErrorPipe","Subject","i1.LegendService","i4","i6.FormatLegendPipe","i3.LegendService","i7.LayerIconComponent","i8.LegendItemComponent","i10.LayerIdToName","area","i2.BasemapService","i5.LegendService","i8","i10","i11.CoordinatesComponent","i12.BasemapComponent","i13.LegendComponent","i14.ArlasDrawComponent","i15","i16.GetCollectionPipe","i10.BboxFormErrorPipe"],"mappings":";;;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