{"version":3,"file":"hslayers-ng-components-map-swipe.mjs","sources":["../../../projects/hslayers/components/map-swipe/swipe-control/swipe.control.ts","../../../projects/hslayers/components/map-swipe/map-swipe.service.ts","../../../projects/hslayers/components/map-swipe/map-swipe.component.ts","../../../projects/hslayers/components/map-swipe/map-swipe.component.html","../../../projects/hslayers/components/map-swipe/map-swipe.module.ts","../../../projects/hslayers/components/map-swipe/hslayers-ng-components-map-swipe.ts"],"sourcesContent":["/**\n * Original code from https://github.com/Viglino/ol-ext/blob/master/src/control/Swipe.js\n */\n\nimport {Control} from 'ol/control';\nimport {Layer} from 'ol/layer';\nimport {Source} from 'ol/source';\n\nimport {LayerListItem} from 'hslayers-ng/services/layer-shifting';\n\n/**\n * Initialization options for SwipeControl\n *  @param leftLayers - layer to swipe on the left side\n *  @param rightLayer - layer to swipe on right side\n *  @param className - control class name\n *  @param position - position property of the swipe [0,1], default 0.5\n *  @param orientation - orientation property (vertical|horizontal), default vertical\n */\nexport type SwipeControlOptions = {\n  leftLayers?: LayerListItem[];\n  rightLayers?: LayerListItem[];\n  className?: string;\n  position?: number;\n  orientation?: string;\n  app?: string;\n};\n\nexport class SwipeControl extends Control {\n  options: SwipeControlOptions;\n  leftLayers: LayerListItem[];\n  rightLayers: LayerListItem[];\n  isMoving: boolean;\n  listeners = new Map<string, any>();\n  constructor(options?: SwipeControlOptions) {\n    const button = document.createElement('button');\n    const element = document.createElement('div');\n    element.className =\n      (options?.className || 'ol-swipe') + ' ol-unselectable ol-control';\n    element.appendChild(button);\n    super({element: element});\n\n    this.options = options || {};\n    element.addEventListener('mousedown', this.move.bind(this));\n    element.addEventListener('touchstart', this.move.bind(this));\n    // An array of listener on layer postcompose\n    this.precomposeRight = this.precomposeRight.bind(this);\n    this.precomposeLeft = this.precomposeLeft.bind(this);\n    this.postcompose = this.postcompose.bind(this);\n\n    this.leftLayers = [];\n    this.rightLayers = [];\n    if (options?.leftLayers) {\n      this.addLayers(options.leftLayers);\n    }\n    if (options?.rightLayers) {\n      this.addLayers(options.rightLayers, true);\n    }\n    const swipe_pos_prop = options.app\n      ? `${options.app}:hs_map_swipe_pos`\n      : 'hs_map_swipe_pos';\n    const storagePos = localStorage.getItem(swipe_pos_prop);\n    this.on('propertychange', () => {\n      if (this.getMap()) {\n        try {\n          this.getMap().renderSync();\n        } catch (e) {\n          console.error(e);\n        }\n      }\n      if (this.get('orientation') === 'horizontal') {\n        this.element.style.top = this.get('position') * 100 + '%';\n        this.element.style.left = '';\n      } else {\n        if (this.get('orientation') !== 'vertical') {\n          this.set('orientation', 'vertical');\n        }\n        this.element.style.left = this.get('position') * 100 + '%';\n        this.element.style.top = '';\n      }\n      this.element.classList.remove('horizontal', 'vertical');\n      this.element.classList.add(this.get('orientation'));\n      localStorage.setItem(swipe_pos_prop, this.get('position'));\n    });\n\n    this.set('position', storagePos ?? options?.position ?? 0.5);\n    this.set('orientation', options?.orientation || 'vertical');\n  }\n\n  /**\n   * Set the map instance the control associated with.\n   * @param map - The map instance.\n   */\n  setTargetMap(map) {\n    if (map) {\n      this.setMap(map);\n    }\n    if (this.getMap()) {\n      for (const l of this.leftLayers) {\n        this.disableEvents(l);\n      }\n      for (const l of this.rightLayers) {\n        this.disableEvents(l, true);\n      }\n      try {\n        this.getMap().renderSync();\n      } catch (e) {\n        //console.error(e);\n      }\n    }\n  }\n\n  private enableEvents(l: LayerListItem, right?: boolean): void {\n    if (right) {\n      (l.layer as any).on(['precompose', 'prerender'], this.precomposeRight);\n    } else {\n      (l.layer as any).on(['precompose', 'prerender'], this.precomposeLeft);\n    }\n    (l.layer as any).on(['postcompose', 'postrender'], this.postcompose);\n  }\n\n  private disableEvents(l: LayerListItem, right?: boolean): void {\n    if (right) {\n      (l.layer as any).un(['precompose', 'prerender'], this.precomposeRight);\n    } else {\n      (l.layer as any).un(['precompose', 'prerender'], this.precomposeLeft);\n    }\n    (l.layer as any).un(['postcompose', 'postrender'], this.postcompose);\n  }\n\n  private isLayerAdded(lyr: LayerListItem, right?: boolean) {\n    const found = right\n      ? this.rightLayers.find((l) => l.layer == lyr.layer)\n      : this.leftLayers.find((l) => l.layer == lyr.layer);\n    if (!found) {\n      return -1;\n    }\n    const index = right\n      ? this.rightLayers.indexOf(found)\n      : this.leftLayers.indexOf(found);\n    return index;\n  }\n\n  /**\n   * Add layers array to clip\n   *\t@param layers - to clip\n   *\t@param right - layers in the right part of the map, default left.\n   */\n  addLayers(layers: LayerListItem[], right?: boolean): void {\n    if (!(layers instanceof Array)) {\n      layers = [layers];\n    }\n    for (const l of layers) {\n      this.addLayer(l, right);\n    }\n  }\n\n  /**\n   * Add a layer to clip\n   *\t@param layer - to clip\n   *\t@param right - layer in the right part of the map, default left.\n   */\n  addLayer(layer: LayerListItem, right?: boolean) {\n    if (this.isLayerAdded(layer, right) < 0) {\n      right ? this.rightLayers.push(layer) : this.leftLayers.push(layer);\n      if (this.getMap()) {\n        this.enableEvents(layer, right);\n        try {\n          this.getMap().renderSync();\n        } catch (e) {\n          console.error(e);\n        }\n      }\n    }\n  }\n\n  /**\n   * Sets available layer events to enabled/disabled\n   * @param enabled - (Optional) If true, map swipe control is enabled, else it is removed\n   */\n  setEvents(enabled?: boolean): void {\n    this.leftLayers.forEach((l) => {\n      enabled ? this.enableEvents(l) : this.disableEvents(l);\n    });\n    this.rightLayers.forEach((l) => {\n      enabled ? this.enableEvents(l, true) : this.disableEvents(l, true);\n    });\n  }\n\n  /**\n   * Remove all layers\n   */\n  removeLayers() {\n    this.leftLayers.forEach((l) => {\n      this.removeLayer(l);\n    });\n    this.rightLayers.forEach((l) => {\n      this.removeLayer(l, true);\n    });\n  }\n\n  /**\n   * Remove a specific layer from swipe control completely\n   */\n  removeCompletely(layerToRm: Layer<Source>): void {\n    let layerFound;\n    layerFound = this.leftLayers.find((l) => l.layer == layerToRm);\n    if (layerFound) {\n      this.removeLayer(layerFound);\n    } else {\n      layerFound = this.rightLayers.find((l) => l.layer == layerToRm);\n      if (layerFound) {\n        this.removeLayer(layerFound, true);\n      }\n    }\n  }\n\n  /**\n   * Remove a layer to clip\n   *\t@param layer - to clip\n   *  @param right - layer from right side to clip\n   */\n  removeLayer(layer: LayerListItem, right?: boolean) {\n    const k = this.isLayerAdded(layer, right);\n    if (k > -1) {\n      this.disableEvents(layer, right);\n      right ? this.rightLayers.splice(k, 1) : this.leftLayers.splice(k, 1);\n    }\n    if (this.getMap()) {\n      try {\n        this.getMap().renderSync();\n      } catch (e) {\n        console.error(e);\n      }\n    }\n  }\n\n  private move(e) {\n    switch (e.type) {\n      case 'touchcancel':\n      case 'touchend':\n      case 'mouseup': {\n        this.isMoving = false;\n        this.listeners.forEach((value, key) => {\n          document.removeEventListener(key, value);\n        });\n        this.listeners.clear();\n        break;\n      }\n      case 'mousedown':\n      case 'touchstart': {\n        if (!this.isMoving) {\n          this.isMoving = true;\n          [\n            'mouseup',\n            'mousemove',\n            'touchend',\n            'touchcancel',\n            'touchmove',\n          ].forEach((eventName) => {\n            const callback = this.move.bind(this);\n            this.listeners.set(eventName, callback);\n            document.addEventListener(eventName, callback);\n          });\n        }\n      }\n      // fallthrough\n      case 'mousemove':\n      case 'touchmove': {\n        if (this.isMoving) {\n          if (this.get('orientation') === 'vertical') {\n            let pageX =\n              e.pageX ||\n              (e.touches && e.touches.length && e.touches[0].pageX) ||\n              (e.changedTouches &&\n                e.changedTouches.length &&\n                e.changedTouches[0].pageX);\n            if (!pageX) {\n              break;\n            }\n            pageX -=\n              this.getMap().getTargetElement().getBoundingClientRect().left +\n              window.pageXOffset -\n              document.documentElement.clientLeft;\n\n            this.set(\n              'position',\n              this.getPosValue(this.getMap().getSize()[0], pageX),\n            );\n            this.dispatchEvent('moving');\n          } else {\n            let pageY =\n              e.pageY ||\n              (e.touches && e.touches.length && e.touches[0].pageY) ||\n              (e.changedTouches &&\n                e.changedTouches.length &&\n                e.changedTouches[0].pageY);\n            if (!pageY) {\n              break;\n            }\n            pageY -=\n              this.getMap().getTargetElement().getBoundingClientRect().top +\n              window.pageYOffset -\n              document.documentElement.clientTop;\n            this.set(\n              'position',\n              this.getPosValue(this.getMap().getSize()[1], pageY),\n            );\n            this.dispatchEvent('moving');\n          }\n        }\n        break;\n      }\n      default:\n        break;\n    }\n  }\n\n  private drawRect(e, pts) {\n    const tr = e.inversePixelTransform;\n    if (tr) {\n      const r = [\n        [pts[0][0], pts[0][1]],\n        [pts[0][0], pts[1][1]],\n        [pts[1][0], pts[1][1]],\n        [pts[1][0], pts[0][1]],\n        [pts[0][0], pts[0][1]],\n      ];\n      r.forEach((pt, i) => {\n        pt = [\n          pt[0] * tr[0] - pt[1] * tr[1] + tr[4],\n          -pt[0] * tr[2] + pt[1] * tr[3] + tr[5],\n        ];\n        if (!i) {\n          e.context.moveTo(pt[0], pt[1]);\n        } else {\n          e.context.lineTo(pt[0], pt[1]);\n        }\n      });\n    } else {\n      const ratio = e.frameState.pixelRatio;\n      e.context.rect(\n        pts[0][0] * ratio,\n        pts[0][1] * ratio,\n        pts[1][0] * ratio,\n        pts[1][1] * ratio,\n      );\n    }\n  }\n\n  precomposeLeft(e) {\n    const size = e.frameState.size;\n    const pts = [\n      [0, 0],\n      [size[0], size[1]],\n    ];\n    if (this.get('orientation') === 'vertical') {\n      pts[1] = [size[0] * this.get('position'), size[1]];\n    } else {\n      pts[1] = [size[0], size[1] * this.get('position')];\n    }\n    this.precompose(e, pts);\n  }\n\n  precompose(e, pts): void {\n    const ctx = e.context;\n    ctx.save();\n    ctx.beginPath();\n    this.drawRect(e, pts);\n    ctx.clip();\n  }\n\n  precomposeRight(e) {\n    const size = e.frameState.size;\n    const pts = [\n      [0, 0],\n      [size[0], size[1]],\n    ];\n    if (this.get('orientation') === 'vertical') {\n      pts[0] = [size[0] * this.get('position'), 0];\n    } else {\n      pts[0] = [0, size[1] * this.get('position')];\n    }\n    this.precompose(e, pts);\n  }\n\n  postcompose(e) {\n    // restore context when decluttering is done (ol>=6)\n    // https://github.com/openlayers/openlayers/issues/10096\n    if (\n      e.target.getClassName &&\n      e.target.getClassName() !== 'ol-layer' &&\n      e.target.get('declutter')\n    ) {\n      setTimeout(() => {\n        e.context.restore();\n      }, 0);\n    } else {\n      e.context.restore();\n    }\n  }\n\n  /**\n   * Get the position of an element or event action relative to the map\n   * @param mapSize - OL Map size (width or height)\n   * @param coord - Coordinate provided (X or Y)\n   * @returns Position relative to map size\n   */\n  getPosValue(mapSize: number, coord: number): number {\n    let l = mapSize;\n    const w = l - Math.min(Math.max(0, l - coord), l);\n    l = w / l;\n    return l;\n  }\n}\n","import {Injectable, NgZone, inject} from '@angular/core';\nimport {Observable, merge} from 'rxjs';\nimport {buffer, filter, first, map, switchMap, take} from 'rxjs/operators';\n\nimport {Layer} from 'ol/layer';\nimport {Source} from 'ol/source';\nimport {Map as olMap} from 'ol';\n\nimport {HsConfig} from 'hslayers-ng/config';\nimport {HsEventBusService} from 'hslayers-ng/services/event-bus';\nimport {HsLayerEditorService} from 'hslayers-ng/components/layer-manager';\nimport {HsLayerManagerService} from 'hslayers-ng/services/layer-manager';\nimport {\n  HsLayerShiftingService,\n  LayerListItem,\n} from 'hslayers-ng/services/layer-shifting';\nimport {HsLayoutService} from 'hslayers-ng/services/layout';\nimport {HsLogService} from 'hslayers-ng/services/log';\nimport {HsMapService} from 'hslayers-ng/services/map';\nimport {HsShareUrlService} from 'hslayers-ng/services/share';\nimport {SwipeControl} from './swipe-control/swipe.control';\nimport {\n  getQueryFilter,\n  getSwipeSide,\n  setQueryFilter,\n  setSwipeSide,\n} from 'hslayers-ng/common/extensions';\n\nexport enum SwipeSide {\n  Left = 'left',\n  Right = 'right',\n  Full = 'full',\n}\n@Injectable({\n  providedIn: 'root',\n})\nexport class HsMapSwipeService {\n  private hsMapService = inject(HsMapService);\n  private hsConfig = inject(HsConfig);\n  private hsLayerShiftingService = inject(HsLayerShiftingService);\n  private hsEventBusService = inject(HsEventBusService);\n  private hsLayerManagerService = inject(HsLayerManagerService);\n  private hsShareUrlService = inject(HsShareUrlService);\n  private hsLayoutService = inject(HsLayoutService);\n  private hsLayerEditorService = inject(HsLayerEditorService);\n  private hsLog = inject(HsLogService);\n  private zone = inject(NgZone);\n\n  swipeCtrl: SwipeControl;\n  rightLayers: LayerListItem[] = [];\n  leftLayers: LayerListItem[] = [];\n  entireMapLayers: LayerListItem[] = [];\n  movingSide = SwipeSide.Left;\n  wasMoved: boolean;\n  swipeControlActive: boolean;\n  orientation: 'vertical' | 'horizontal';\n  orientationVertical = true;\n\n  constructor() {\n    this.swipeCtrl = null;\n    this.rightLayers = [];\n    this.leftLayers = [];\n    this.entireMapLayers = [];\n    this.movingSide = SwipeSide.Left;\n    this.orientationVertical = true;\n    this.wasMoved = null;\n    this.swipeControlActive = null;\n    this.orientation = null;\n\n    this.hsMapService.loaded().then(() => {\n      this.setInitCtrlActive();\n      this.setInitOri();\n      if (this.hsLayoutService.panelEnabled('mapSwipe')) {\n        this.initSwipeControl();\n      }\n    });\n    this.hsEventBusService.layerManagerUpdates.pipe(first()).subscribe(() => {\n      if (this.hsLayoutService.panelEnabled('mapSwipe')) {\n        this.setInitialSwipeLayers();\n      }\n    });\n\n    //Stream used to update layers while mapSwipe panel is active\n    const isMapSwipe$ = this.getLayerUpdateWithCurrentPanel().pipe(\n      filter(({panel}) => panel === 'mapSwipe'),\n      map(({layer}) => [layer]),\n    );\n    //Stream used to update layers while mapSwipe panel is not active\n    const isNotMapSwipe$ = this.getLayerUpdateWithCurrentPanel().pipe(\n      filter(({panel}) => panel !== 'mapSwipe'),\n      map(({layer}) => layer),\n      //buffer layerManagerUpdates until mapSwipe panel is opened\n      buffer(\n        this.hsLayoutService.mainpanel$.pipe(filter((p) => p === 'mapSwipe')),\n      ),\n    );\n\n    merge(isMapSwipe$, isNotMapSwipe$)\n      .pipe(\n        filter((layers) => layers?.length > 0),\n        map((layers) => this.removeDuplicateUpdates(layers as Layer<Source>[])),\n      )\n      .subscribe((layers) => {\n        this.fillSwipeLayers(layers);\n      });\n\n    this.hsLayerEditorService.layerTitleChange.subscribe(({layer}) => {\n      setTimeout(() => {\n        this.removeCompletely(layer);\n        this.fillSwipeLayers(layer);\n      }, 500);\n    });\n  }\n\n  /**\n   * Get layer manager update along with the current mainPanel\n   */\n  private getLayerUpdateWithCurrentPanel(): Observable<{\n    layer: Layer<Source>;\n    panel: string;\n  }> {\n    return this.hsEventBusService.layerManagerUpdates.pipe(\n      //filter out nulls\n      filter((layer): layer is Layer<Source> => !!layer),\n      switchMap((layer) =>\n        this.hsLayoutService.mainpanel$.pipe(\n          take(1),\n          map((panel) => ({layer, panel})),\n        ),\n      ),\n    );\n  }\n\n  /**\n   * Remove duplicate layerManagerUpdates to get one update per layer\n   */\n  private removeDuplicateUpdates(layers: Layer<Source>[]): Layer<Source>[] {\n    const unique = new Map();\n    layers\n      .filter((l) => !!l)\n      .forEach((layer) => unique.set(layer['ol_uid'], layer));\n    return Array.from(unique.values());\n  }\n\n  /**\n   * Set initial map-swipe control state\n   */\n  setInitCtrlActive(): void {\n    const param = this.hsShareUrlService.getParamValue('map-swipe');\n    if (param) {\n      switch (param) {\n        case 'enabled':\n          this.swipeControlActive = true;\n          break;\n        default:\n          this.swipeControlActive = false;\n          break;\n      }\n    } else {\n      this.swipeControlActive =\n        this.hsConfig?.componentsEnabled?.mapSwipe ?? false;\n    }\n    this.updateUrlParam();\n  }\n\n  /**\n   * Set initial orientation value\n   */\n  setInitOri(): void {\n    const swipe_ori_prop = this.hsConfig.id\n      ? `${this.hsConfig.id}:hs_map_swipe_ori`\n      : 'hs_map_swipe_ori';\n    const storageOri = localStorage.getItem(swipe_ori_prop) as\n      | 'vertical'\n      | 'horizontal';\n    if (storageOri) {\n      this.orientation = storageOri;\n    } else {\n      this.orientation =\n        this.hsConfig?.mapSwipeOptions?.orientation ?? 'vertical';\n    }\n    if (this.orientation !== 'vertical') {\n      this.orientationVertical = false;\n    }\n    this.updateStorageOri();\n  }\n\n  /**\n   * Initializes swipe control add adds it to the map\n   */\n  initSwipeControl(): void {\n    this.zone.runOutsideAngular(() => {\n      this.swipeCtrl = new SwipeControl({\n        orientation: this.orientation,\n        app: this.hsConfig.id,\n      });\n    });\n\n    if (this.swipeControlActive) {\n      this.swipeCtrl.setTargetMap(this.hsMapService.getMap());\n      this.hsMapService.getMap().addControl(this.swipeCtrl);\n    }\n  }\n\n  /**\n   * Update local storage orientation value\n   */\n  updateStorageOri(): void {\n    const swipe_ori_prop = this.hsConfig.id\n      ? `${this.hsConfig.id}:hs_map_swipe_ori`\n      : 'hs_map_swipe_ori';\n    localStorage.setItem(swipe_ori_prop, this.orientation);\n  }\n\n  /**\n   * Update url params to include map swipe state\n   */\n  updateUrlParam(): void {\n    this.hsShareUrlService.updateCustomParams({\n      'map-swipe': this.swipeControlActive ? 'enabled' : 'disabled',\n    });\n  }\n\n  /**\n   * Check if any layers are added to the swipe control\n   */\n  layersAvailable(): boolean {\n    return (\n      this.swipeCtrl?.leftLayers?.length > 0 ||\n      this.swipeCtrl?.rightLayers?.length > 0 ||\n      this.entireMapLayers?.length > 0\n    );\n  }\n\n  /**\n   * Set swipe control orientation\n   */\n  setOrientation(): void {\n    this.orientationVertical = !this.orientationVertical;\n    this.orientation = this.orientationVertical ? 'vertical' : 'horizontal';\n    this.swipeCtrl.set('orientation', this.orientation);\n    this.updateStorageOri();\n  }\n\n  /**\n   * Fill swipe control layers\n   * @param layer - layer or array of layers issued from layerManagerUpdates event\n   */\n  fillSwipeLayers(input: Layer<Source> | Layer<Source>[] | void): void {\n    this.hsLayerShiftingService.fillLayers();\n    if (!input) {\n      return;\n    }\n    const layers = Array.isArray(input) ? input : [input];\n    layers.forEach((l) => {\n      const layerFound = this.hsLayerShiftingService.layersCopy.find(\n        (wrapper) => wrapper.layer == l,\n      );\n      if (layerFound !== undefined) {\n        this.setLayerActive(layerFound);\n        if (this.wasMoved) {\n          this.moveSwipeLayer(layerFound);\n        } else {\n          this.addSwipeLayer(layerFound);\n        }\n        this.checkForMissingLayers();\n      } else {\n        this.removeCompletely(l);\n      }\n    });\n    this.sortLayers();\n    this.wasMoved = false;\n    this.movingSide = SwipeSide.Left;\n  }\n\n  /**\n   * Move a layer to swipe control\n   * @param layerItem - layer issued from layerManagerUpdates event\n   */\n  addSwipeLayer(layerItem: LayerListItem): void {\n    if (!this.swipeCtrl) {\n      this.initSwipeControl();\n    }\n    this.createQueryFilter(layerItem);\n    if (!this.findLayer(layerItem.layer)?.l) {\n      layerItem.visible = layerItem.layer.getVisible();\n      if (getSwipeSide(layerItem.layer) === 'right') {\n        this.swipeCtrl.addLayer(layerItem, true);\n        this.rightLayers.push(layerItem);\n      } else if (getSwipeSide(layerItem.layer) === 'left') {\n        this.swipeCtrl.addLayer(layerItem);\n        this.leftLayers.push(layerItem);\n      } else {\n        this.entireMapLayers.push(layerItem);\n      }\n      layerItem.layer.on('change:visible', (e) =>\n        this.layerVisibilityChanged(e),\n      );\n    }\n  }\n\n  /**\n   * Crate queryFilter callback function for layer and set it as layer's property\n   * Query will work for the layer, if the user's click was made on the same map swipe panel\n   * where the layer is being rendered\n   * If the layer swipe side is not specified, query will work by default\n   * @param layerItem - layer issued from layerManagerUpdates event\n   */\n  createQueryFilter(layerItem: LayerListItem): void {\n    const existingFilter = getQueryFilter(layerItem.layer);\n    const filter = (map: olMap, layer: Layer, pixel: number[]) => {\n      let swipeFilter: boolean;\n      const swipeSide = getSwipeSide(layer);\n      if (!this.swipeControlActive || !swipeSide) {\n        swipeFilter = true;\n      } else {\n        const clickPos =\n          this.orientation == 'vertical'\n            ? this.swipeCtrl.getPosValue(map.getSize()[0], pixel[0])\n            : this.swipeCtrl.getPosValue(map.getSize()[1], pixel[1]);\n\n        if (\n          (clickPos <= this.swipeCtrl.get('position') && swipeSide == 'left') ||\n          (clickPos > this.swipeCtrl.get('position') && swipeSide == 'right')\n        ) {\n          swipeFilter = true;\n        } else {\n          swipeFilter = false;\n        }\n      }\n      if (existingFilter != undefined) {\n        return existingFilter(map, layer, pixel) && swipeFilter;\n      }\n      return swipeFilter;\n    };\n    setQueryFilter(layerItem.layer, filter);\n  }\n\n  /**\n   * Move a layer to swipe control\n   * @param lyrListItem - layer issued from layerManagerUpdates event\n   */\n  moveSwipeLayer(lyrListItem: LayerListItem): void {\n    if (this.movingSide === SwipeSide.Right) {\n      this.moveRight(lyrListItem);\n      setSwipeSide(lyrListItem.layer, 'right');\n    }\n    if (this.movingSide === SwipeSide.Left) {\n      this.moveLeft(lyrListItem);\n      setSwipeSide(lyrListItem.layer, 'left');\n    }\n    if (this.movingSide === SwipeSide.Full) {\n      setSwipeSide(lyrListItem.layer, undefined);\n      this.swipeCtrl.removeCompletely(lyrListItem.layer);\n    }\n  }\n\n  /**\n   * Move a layer to swipe control right side\n   * @param layer - layer issued from layerManagerUpdates event\n   */\n  moveRight(layer: LayerListItem): void {\n    this.swipeCtrl.removeLayer(layer);\n    this.swipeCtrl.addLayer(layer, true);\n  }\n\n  /**\n   * Move a layer to swipe control left side\n   * @param layer - layer issued from layerManagerUpdates event\n   */\n  moveLeft(layer: LayerListItem): void {\n    this.swipeCtrl.removeLayer(layer, true);\n    this.swipeCtrl.addLayer(layer);\n  }\n\n  /**\n   * Set map swipe control status enabled/disabled\n   */\n  setControl(): void {\n    this.swipeControlActive = !this.swipeControlActive;\n    this.updateUrlParam();\n    if (!this.hsMapService.getMap()) {\n      return;\n    }\n    if (this.swipeControlActive) {\n      this.swipeCtrl.setTargetMap(this.hsMapService.getMap());\n      this.hsMapService.getMap().addControl(this.swipeCtrl);\n      this.swipeCtrl.setEvents(true);\n    } else {\n      this.hsMapService.getMap().removeControl(this.swipeCtrl);\n      this.swipeCtrl.setEvents();\n    }\n    try {\n      this.hsMapService.getMap().renderSync();\n    } catch (e) {\n      this.hsLog.error(e);\n    }\n  }\n  /**\n   * Remove layer completely\n   * @param layer - layer issued from layerManagerUpdates event\n   */\n  removeCompletely(layerToRm: Layer<Source>): void {\n    const layerFound = this.findLayer(layerToRm);\n    if (layerFound.l) {\n      if (layerFound.arr === 'layers') {\n        this.leftLayers = this.leftLayers.filter((l) => l.layer != layerToRm);\n      }\n      if (layerFound.arr === 'rightLayers') {\n        this.rightLayers = this.rightLayers.filter((l) => l.layer != layerToRm);\n      }\n      if (layerFound.arr === 'entireMapLayers') {\n        this.entireMapLayers = this.entireMapLayers.filter(\n          (l) => l.layer != layerToRm,\n        );\n      }\n    }\n    this.swipeCtrl.removeCompletely(layerToRm);\n  }\n  /**\n   * Set layer as active (last dragged)\n   * @param layer - layer issued from layerManagerUpdates event\n   */\n  setLayerActive(layer: LayerListItem): void {\n    const layerFound = this.findLayer(layer.layer);\n    this.leftLayers.forEach((l) => (l.active = false));\n    this.rightLayers.forEach((l) => (l.active = false));\n    this.entireMapLayers.forEach((l) => (l.active = false));\n    if (layerFound?.l) {\n      layerFound.l.active = true;\n    }\n  }\n  /**\n   * Set and add initial swipe control layers\n   */\n  setInitialSwipeLayers(): void {\n    this.leftLayers = [];\n    this.rightLayers = [];\n    this.entireMapLayers = [];\n    this.hsLayerShiftingService.fillLayers();\n    if (!this.hsLayerShiftingService.layersCopy) {\n      return;\n    }\n    for (const layer of this.hsLayerShiftingService.layersCopy) {\n      this.addSwipeLayer(layer);\n    }\n    this.sortLayers();\n  }\n  /**\n   * Check if any layer is left out from swipe control and add it\n   */\n  checkForMissingLayers(): void {\n    const missingLayers = this.hsLayerShiftingService.layersCopy.filter((l) => {\n      return !this.findLayer(l.layer)?.l;\n    });\n    for (const layer of missingLayers) {\n      this.addSwipeLayer(layer);\n    }\n    this.sortLayers();\n  }\n\n  /**\n   * Sort layers to resemble layer order by ZIndex on the map\n   */\n  sortLayers(): void {\n    this.leftLayers = this.hsLayerManagerService.sortLayersByZ(this.leftLayers);\n    this.rightLayers = this.hsLayerManagerService.sortLayersByZ(\n      this.rightLayers,\n    );\n    this.entireMapLayers = this.hsLayerManagerService.sortLayersByZ(\n      this.entireMapLayers,\n    );\n  }\n\n  /**\n   * Change layer visibility\n   * @param layerItem - Layer item selected\n   */\n  changeLayerVisibility(layerItem: LayerListItem): void {\n    layerItem.layer.setVisible(!layerItem.layer.getVisible());\n    layerItem.visible = layerItem.layer.getVisible();\n  }\n\n  /**\n   * Act upon layer visibility changes\n   * @param e - Event description\n   */\n  layerVisibilityChanged(e): void {\n    const found = this.findLayer(e.target);\n    if (found.l) {\n      found.l.visible = e.target.getVisible();\n    }\n  }\n\n  /**\n   * Find layer based on layer source\n   * @param targetLayer - Layer to be found\n   */\n  findLayer(targetLayer: Layer<Source>): {l: LayerListItem; arr: string} {\n    const found = {l: null, arr: ''};\n    found.l = this.leftLayers.find((lyr) => lyr.layer == targetLayer);\n    found.arr = 'layers';\n    if (!found.l) {\n      found.l = this.rightLayers.find((lyr) => lyr.layer == targetLayer);\n      found.arr = 'rightLayers';\n    }\n    if (!found.l) {\n      found.l = this.entireMapLayers.find((lyr) => lyr.layer == targetLayer);\n      found.arr = 'entireMapLayers';\n    }\n    return found;\n  }\n}\n","import {Component, inject} from '@angular/core';\n\nimport {\n  CdkDragDrop,\n  moveItemInArray,\n  transferArrayItem,\n} from '@angular/cdk/drag-drop';\n\nimport {\n  HsLayerShiftingService,\n  LayerListItem,\n} from 'hslayers-ng/services/layer-shifting';\nimport {HsMapSwipeService, SwipeSide} from './map-swipe.service';\nimport {HsPanelBaseComponent} from 'hslayers-ng/common/panels';\n\n@Component({\n  selector: 'hs-map-swipe',\n  templateUrl: './map-swipe.component.html',\n  styleUrls: ['./map-swipe.component.scss'],\n  standalone: false,\n})\nexport class HsMapSwipeComponent extends HsPanelBaseComponent {\n  hsMapSwipeService = inject(HsMapSwipeService);\n  private hsLayerShiftingService = inject(HsLayerShiftingService);\n\n  swipeSide = SwipeSide;\n  placeholders = {\n    entire: true,\n    left: true,\n    right: true,\n  };\n  name = 'mapSwipe';\n  swipeOptions = ['vertical', 'horizontal'];\n\n  /**\n   * Return label for button changing map swipe state from enabled to disabled\n   */\n  getEnabledButtonString(): string {\n    if (this.hsMapSwipeService.swipeControlActive) {\n      return 'MAP_SWIPE.disableSwipe';\n    }\n    return 'MAP_SWIPE.enableSwipe';\n  }\n\n  /**\n   * Return label for button changing swipe orientation from horizontal swipe to vertical swipe\n   */\n  getOrientationButtonString(): string {\n    if (this.hsMapSwipeService.orientationVertical) {\n      return 'MAP_SWIPE.horizontalSwipe';\n    }\n    return 'MAP_SWIPE.verticalSwipe';\n  }\n\n  /**\n   * Reset swipe slider position to default\n   */\n  resetSwipePos(): void {\n    this.hsMapSwipeService.swipeCtrl.set('position', 0.5);\n  }\n\n  /**\n   * Modify arrays after drag and drop\n   * @param event - CdkDragDrop drop event\n   * @param right - (Optional) Item dragged to right\n   */\n  drop(event: CdkDragDrop<string[]>, side?: SwipeSide): void {\n    let draggedLayer;\n    let replacedLayer;\n    this.hsMapSwipeService.movingSide = side;\n    this.hsMapSwipeService.wasMoved = true;\n    if (event.previousContainer === event.container) {\n      draggedLayer = event.container.data[event.previousIndex];\n      replacedLayer = event.container.data[event.currentIndex];\n      moveItemInArray(\n        event.container.data,\n        event.previousIndex,\n        event.currentIndex,\n      );\n    } else {\n      draggedLayer = event.previousContainer.data[event.previousIndex];\n      replacedLayer = event.container.data[event.currentIndex];\n      transferArrayItem(\n        event.previousContainer.data,\n        event.container.data,\n        event.previousIndex,\n        event.currentIndex,\n      );\n    }\n    if (draggedLayer && replacedLayer?.layer) {\n      this.hsLayerShiftingService.moveTo(draggedLayer, replacedLayer.layer);\n    } else {\n      this.hsMapSwipeService.fillSwipeLayers(draggedLayer.layer);\n    }\n  }\n\n  /**\n   * Change selected layer visibility\n   * @param layer - Selected layer from the list\n   */\n  changeLayerVisibility(layer: LayerListItem): void {\n    this.hsMapSwipeService.changeLayerVisibility(layer);\n  }\n\n  /**\n   * Set map-swipe swipe element orientation\n   */\n  setOrientation(): void {\n    this.hsMapSwipeService.setOrientation();\n  }\n\n  /**\n   * Check if layers for map-swipe component are available\n   */\n  layersAvailable(): boolean {\n    return this.hsMapSwipeService.layersAvailable();\n  }\n\n  /**\n   * Set control for map-swipe component\n   */\n  setControl(): void {\n    this.hsMapSwipeService.setControl();\n  }\n\n  /**\n   * Get rightLayers for map-swipe component\n   */\n  getRightLayers(): LayerListItem[] {\n    return this.hsMapSwipeService.rightLayers;\n  }\n}\n","<!-- Layer item template -->\n<ng-template #layerItem let-layer=\"layer\">\n  <div class=\"hs-lm-item-title d-flex align-items-center\" style=\"word-break:break-all; cursor:move\">\n    <button type=\"button\" class=\"btn btn-sm hs-lm-item-visibility m-0 p-0\"\n      (click)=\"changeLayerVisibility(layer);$event.stopPropagation()\"\n    [ngClass]=\"layer.visible ? 'hs-checkmark' : 'hs-uncheckmark'\"></button>\n    <p class=\"m-0 ps-1\">{{'LAYERS.' + layer.title | translate : {fallbackValue: layer.title} }}</p>\n  </div>\n</ng-template>\n<!-- List placeholder template -->\n<ng-template #listPlaceholder>\n  <div class=\"p-2\" style=\"border: 1px solid #ddd; text-align: center; color: rgba(0,0,0,0.3);\">\n    {{'MAP_SWIPE.noLayers' | translate }}\n  </div>\n</ng-template>\n\n@if (isVisible$ | async) {\n  <div class=\"card hs-main-panel\" [ngClass]=\"panelWidthClass\">\n    <hs-panel-header name=\"mapSwipe\" [panelTabs]=\"'MAP_SWIPE'\">\n    </hs-panel-header>\n    <div class=\"card-body m-2\">\n      <div class=\"alert alert-info ps-2 text-center\" role=\"alert\">\n        {{'MAP_SWIPE.dndLayers' | translate }}\n      </div>\n      <div class=\"d-flex justify-content-between gap-2 mb-2\">\n        <div class=\"btn-group align-items-center d-flex flex-grow-1\" data-toggle=\"buttons\">\n          @for (swipeOption of swipeOptions; track swipeOption) {\n            <button class=\"btn btn-sm  text-truncate h-100\" type=\"button\"\n              (click)=\"setOrientation()\" [disabled]=\"!hsMapSwipeService.swipeControlActive\"\n              [ngClass]=\"hsMapSwipeService.orientation === swipeOption ? 'btn-primary' : 'btn-secondary'\">\n              {{'MAP_SWIPE.' + swipeOption | translate }}\n            </button>\n          }\n        </div>\n        <div class=\"btn-group\">\n          <button class=\"btn btn-sm btn-secondary hs-map-swipe-reset\" type=\"button\" (click)=\"resetSwipePos()\"\n            style=\"max-width: 15ch;\" [title]=\"'MAP_SWIPE.resetSlider' | translate\"\n            [disabled]=\"!hsMapSwipeService.swipeControlActive\">\n            <i class=\"fa-solid fa-rotate-right\"></i>\n          </button>\n          <button class=\"btn btn-sm\" type=\"button\" (click)=\"setControl()\"\n            [ngClass]=\"hsMapSwipeService.swipeControlActive ? 'active btn-danger' : 'btn-primary'\">\n            {{getEnabledButtonString() | translate }}\n          </button>\n        </div>\n      </div>\n      @if (layersAvailable() && hsMapSwipeService.swipeControlActive) {\n        <div class=\"pt-1\">\n          <table class=\"table table-sm table-striped table-borderless p-1\" style=\"table-layout: fixed;\">\n            <tbody>\n              <tr style=\"text-align: center;\">\n                <th colspan=\"2\">{{'MAP_SWIPE.entireMap' | translate }}</th>\n              </tr>\n              <tr class=\"mb-1\">\n                <td colspan=\"2\" cdkDropList #entireMapList=\"cdkDropList\" (cdkDropListExited)=\"placeholders.entire = true\"\n                  (cdkDropListEntered)=\"placeholders.entire = false\" [cdkDropListConnectedTo]=\"[leftList, rightList]\"\n                  [cdkDropListData]=\"hsMapSwipeService.entireMapLayers\" (cdkDropListDropped)=\"drop($event, swipeSide.Full)\">\n                  @for (layer of hsMapSwipeService.entireMapLayers; track layer) {\n                    <div class=\"list-group-item p-2\" [ngClass]=\"{'activeLayer': layer.active}\"\n                      cdkDrag>\n                      <ng-container *ngTemplateOutlet=\"layerItem;context:{layer: layer}\"></ng-container>\n                    </div>\n                  }\n                  @if (hsMapSwipeService.entireMapLayers?.length === 0 && placeholders.entire) {\n                    <div>\n                      <ng-container *ngTemplateOutlet=\"listPlaceholder\"></ng-container>\n                    </div>\n                  }\n                </td>\n              </tr>\n              <tr style=\"text-align: center;\">\n                @if (hsMapSwipeService.orientation === 'vertical') {\n                  <th>{{'MAP_SWIPE.leftSide' | translate }}</th>\n                  <th>{{'MAP_SWIPE.rightSide' | translate }}</th>\n                } @else {\n                  <th>{{'MAP_SWIPE.top' | translate }}</th>\n                  <th>{{'MAP_SWIPE.bottom' | translate }}</th>\n                }\n              </tr>\n              <tr>\n                <td cdkDropList #leftList=\"cdkDropList\" [cdkDropListConnectedTo]=\"[rightList, entireMapList]\"\n                  [cdkDropListData]=\"hsMapSwipeService.leftLayers\" (cdkDropListDropped)=\"drop($event, swipeSide.Left)\"\n                  (cdkDropListExited)=\"placeholders.left = true\" (cdkDropListEntered)=\"placeholders.left = false\">\n                  @for (layer of hsMapSwipeService.leftLayers; track layer) {\n                    <div class=\"list-group-item p-2\" [ngClass]=\"{'activeLayer': layer.active}\"\n                      cdkDrag>\n                      <ng-container *ngTemplateOutlet=\"layerItem;context:{layer: layer}\"></ng-container>\n                    </div>\n                  }\n                  @if (hsMapSwipeService.leftLayers?.length === 0 && placeholders.left) {\n                    <div>\n                      <ng-container *ngTemplateOutlet=\"listPlaceholder\"></ng-container>\n                    </div>\n                  }\n                </td>\n                <td cdkDropList #rightList=\"cdkDropList\" [cdkDropListConnectedTo]=\"[leftList, entireMapList]\"\n                  [cdkDropListData]=\"hsMapSwipeService.rightLayers\" (cdkDropListDropped)=\"drop($event, swipeSide.Right)\"\n                  (cdkDropListExited)=\"placeholders.right = true\" (cdkDropListEntered)=\"placeholders.right = false\">\n                  @for (layer of hsMapSwipeService.rightLayers; track layer) {\n                    <div class=\"list-group-item p-2\" [ngClass]=\"{'activeLayer': layer.active}\"\n                      cdkDrag>\n                      <ng-container *ngTemplateOutlet=\"layerItem;context:{layer: layer}\"></ng-container>\n                    </div>\n                  }\n                  @if (hsMapSwipeService.rightLayers?.length === 0 && placeholders.right) {\n                    <div>\n                      <ng-container *ngTemplateOutlet=\"listPlaceholder\"></ng-container>\n                    </div>\n                  }\n                </td>\n              </tr>\n            </tbody>\n          </table>\n        </div>\n      }\n    </div>\n  </div>\n}\n","import {CommonModule} from '@angular/common';\nimport {DragDropModule} from '@angular/cdk/drag-drop';\nimport {FormsModule} from '@angular/forms';\nimport {NgModule} from '@angular/core';\nimport {TranslatePipe} from '@ngx-translate/core';\n\nimport {HsMapSwipeComponent} from './map-swipe.component';\nimport {HsPanelHeaderComponent} from 'hslayers-ng/common/panels';\n\n@NgModule({\n  declarations: [HsMapSwipeComponent],\n  imports: [\n    CommonModule,\n    HsPanelHeaderComponent,\n    FormsModule,\n    TranslatePipe,\n    DragDropModule,\n  ],\n  exports: [HsMapSwipeComponent],\n})\nexport class HsMapSwipeModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEG;AAyBG,MAAO,YAAa,SAAQ,OAAO,CAAA;AAMvC,IAAA,WAAA,CAAY,OAA6B,EAAA;QACvC,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC;QAC/C,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC;AAC7C,QAAA,OAAO,CAAC,SAAS;YACf,CAAC,OAAO,EAAE,SAAS,IAAI,UAAU,IAAI,6BAA6B;AACpE,QAAA,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC;AAC3B,QAAA,KAAK,CAAC,EAAC,OAAO,EAAE,OAAO,EAAC,CAAC;AAP3B,QAAA,IAAA,CAAA,SAAS,GAAG,IAAI,GAAG,EAAe;AAShC,QAAA,IAAI,CAAC,OAAO,GAAG,OAAO,IAAI,EAAE;AAC5B,QAAA,OAAO,CAAC,gBAAgB,CAAC,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC3D,QAAA,OAAO,CAAC,gBAAgB,CAAC,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;;QAE5D,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC;QACtD,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC;QACpD,IAAI,CAAC,WAAW,GAA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