{"version":3,"file":"ng-dnd-sortable.mjs","sources":["../../src/isEmpty.ts","../../src/types.ts","../../src/directives/sortable.ts","../../src/directives/sortable-external.ts","../../src/directives/sortable-template.ts","../../src/directives/sortable-list.ts","../../src/hoverTriggers.ts","../../src/directives/sortable-render.ts","../../src/ngrx-helpers.ts","../../src/spillTarget.ts","../../src/module.ts","../../ng-dnd-sortable.ts"],"sourcesContent":["/**\n * @ignore\n * Returns isEmpty, whether it's an immutable List or an array\n */\nexport function isEmpty(list: Iterable<any>) {\n  for (const _ of list) {\n    return false;\n  }\n  return true;\n}\n","import { DragSourceMonitor, DropTargetMonitor } from '@ng-dnd/core';\nimport { Observable } from 'rxjs';\n\nexport interface SortableSpec<Data, Type = string | symbol> {\n  /**\n   * The underlying @ng-dnd/core / dnd-core type.\n   * String or symbol, if that's not clear from the documentation output..\n   */\n  type: Type;\n\n  /**\n   * By default, a sortable accepts the type it produces. But you could have\n   * it accept more types. Be sure to include `type` if you want to sort a\n   * list within itself.\n   *\n   * This opens up other possibilities: if you set `type` to `\"A\"` but\n   * `accepts` to `\"B\"`, you could allow dragging `\"B\"`s into it but not\n   * sorting within the list.\n   */\n  accepts?: string | symbol | (string | symbol)[];\n\n  /**\n   * Used for external data sources only.\n   *\n   * Must produce a new object, with some Data which will be unique for the given trackBy function.\n   */\n  createData?(): Data;\n\n  /**\n   * Required. Must produce a different value for every available Data.\n   * Usually, this will be `data => data.id`.\n   */\n  trackBy(data: Data): any;\n\n  /**\n   * Optional if you provided `[dndSortableChildren],` otherwise required.\n   * NOTE: return an Observable! If you don't have one already, use `[dndSortableChildren]`.\n   * A typical use is with an @ngrx/store: `getList: _listId => this.store.select(...)`\n   */\n  getList?(listId: any): Observable<Iterable<Data>>;\n\n  /** Optional; some implementations do not need beginDrag. */\n  beginDrag?(item: DraggedItem<Data>, monitor: DragSourceMonitor<void, void>): void;\n\n  /**\n   * Required.\n   *\n   * After `hover`, the element you picked up (= *transit*) must be:\n   *\n   * 1. under the mouse; and\n   * 2. at the index `item.hover.index` in the list identified by\n   *    `item.hover.listId`\n   */\n  hover(item: DraggedItem<Data>, monitor: DropTargetMonitor<DraggedItem<Data>>): void;\n\n  /** Required; because if you don't have a drop function, what are you even doing? */\n  drop(item: DraggedItem<Data>, monitor: DropTargetMonitor<DraggedItem<Data>>): void;\n\n  /** Required; you must reset and remove any temporarily added data from the drag. */\n  endDrag(item: DraggedItem<Data>, monitor: DragSourceMonitor<DraggedItem<Data>>): void;\n\n  /**\n   * Optional; you may override the default 'same trackBy' implementation.\n   *\n   * isDragging determines which card on the ground will regard itself as\n   * \"the same as the one in flight\". It must return true for exactly one\n   * card at a time, and that card MUST be placed under the most recently\n   * hovered DraggedItem.\n   *\n   * If it is not implemented correctly, then each card will not be able to\n   * determine whether it is under the mouse (and therefore should not emit\n   * hover events); you will get a deluge of incorrect hover events.\n   *\n   * By default, it is defined as:\n   *\n   * ```typescript\n   * trackBy(ground) === trackBy(inFlight.data)\n   * ```\n   *\n   * If you want to be able to copy cards around, and there's an extra clone\n   * in transit around the board, you have to be careful to implement\n   * isDragging correctly, or ensure that any clones have a different\n   * `trackBy()` result. Note, however, that the item in `beginDrag` is the\n   * original, so simply giving clones a different `id` is not typically\n   * enough; the clone will not respond to `isDragging`, the original will\n   * (and you want to move the clone).\n   *\n   * Therefore, one solution is as follows:\n   *\n   * ```typescript\n   * isDragging: (ground, inFlight) => {\n   *   let flyingId = this.isCopying ? CARD_ID_WHEN_COPYING : inFlight.data.id;\n   *   return ground.id === flyingId;\n   * }\n   * ```\n   *\n   */\n  isDragging?(ground: Data, inFlight: DraggedItem<Data>): boolean;\n\n  /**\n   * Optional; you may override default `() => true`.\n   *\n   * When used with the `[dndSortableExternal]` directive, the first two arguments will be undefined,\n   * because the data has not yet been created and external items are not associated with a list.\n   * You should be able to decide `canDrag` without these.\n   */\n  canDrag?(data: Data, listId: any, monitor: DragSourceMonitor<void, void>): boolean;\n\n  /**\n   * Optional; you may override default `() => true`.\n   * Inspect `item.hover` for where it is hovering.\n   */\n  canDrop?(item: DraggedItem<Data>, monitor: DropTargetMonitor<DraggedItem<Data>>): boolean;\n}\n\nexport class Size {\n  constructor(\n    public width: number,\n    public height: number\n  ) {}\n  style() {\n    return {\n      width: this.width + 'px',\n      height: this.height + 'px',\n    };\n  }\n}\n\nexport interface DraggedItem<Data> {\n  data: Data;\n  size: Size;\n  type: string | symbol;\n  index: number;\n  listId: any;\n  isInternal?: boolean;\n  // isCopy?: boolean;\n  hover: {\n    index: number;\n    listId: any;\n  };\n}\n\nexport enum HoverTrigger {\n  halfway = 'halfway',\n  fixed = 'fixed',\n}\n\nexport interface RenderContext<Data> {\n  data: Data;\n  index: number;\n  horizontal: boolean;\n  hoverTrigger: HoverTrigger;\n  listId: number | string | symbol;\n  spec: SortableSpec<Data>;\n}\n","import {\n  AfterViewInit,\n  ChangeDetectorRef,\n  Directive,\n  ElementRef,\n  inject,\n  Input,\n  OnChanges,\n  OnDestroy,\n  OnInit,\n  SimpleChanges,\n} from '@angular/core';\nimport { DndService, DropTarget, DropTargetMonitor } from '@ng-dnd/core';\nimport { BehaviorSubject, Observable, Subscription } from 'rxjs';\nimport { isEmpty } from '../isEmpty';\nimport { DraggedItem, HoverTrigger, RenderContext, SortableSpec } from '../types';\n\n@Directive({\n  selector: '[dndSortable]',\n  exportAs: 'dndSortable',\n})\nexport class DndSortable<Data> implements OnChanges, OnInit, AfterViewInit, OnDestroy {\n  protected cdr = inject(ChangeDetectorRef);\n  protected dnd = inject(DndService);\n  protected el = inject<ElementRef<HTMLElement>>(ElementRef);\n\n  @Input() listId: number | string | symbol = Math.random().toString();\n  @Input() horizontal = false;\n  @Input() spec!: SortableSpec<Data>;\n  @Input() children?: Iterable<Data>;\n  /**\n   * Possible values:\n   *\n   * - 'halfway' (default): triggers a reorder when you drag halfway over a neighbour\n   * - 'fixed': triggers as soon as you move over a neighbouring element. Does not work with variable size elements. */\n  @Input() hoverTrigger = HoverTrigger.halfway;\n\n  /** @ignore */\n  private childrenSubject$ = new BehaviorSubject<Iterable<Data>>([]);\n  /** A handy way to subscribe to spec.getList(). */\n  children$: Observable<Iterable<Data>> = this.childrenSubject$;\n\n  /** @ignore */\n  subs = new Subscription();\n  /** @ignore */\n  listSubs = new Subscription();\n\n  /**\n   * This DropTarget is attached to the whole list.\n   *\n   * You may monitor it for information like 'is an item hovering over this entire list somewhere?'\n   */\n  target: DropTarget<DraggedItem<Data>>;\n\n  /** @ignore */\n  constructor() {\n    this.target = this.dnd.dropTarget<DraggedItem<Data>>(\n      null,\n      {\n        canDrop: monitor => {\n          if (!this.acceptsType(monitor.getItemType())) {\n            return false;\n          }\n          const item = monitor.getItem();\n          if (!item) {\n            return false;\n          }\n          return this.getCanDrop(item, monitor);\n        },\n        drop: monitor => {\n          const item = monitor.getItem();\n          if (item && this.getCanDrop(item, monitor)) {\n            this.spec.drop?.(item, monitor);\n          }\n          return {};\n        },\n        hover: monitor => {\n          const item = monitor.getItem();\n          if (this.children && isEmpty(this.children) && item) {\n            const canDrop = this.getCanDrop(item, monitor);\n            if (canDrop && monitor.isOver({ shallow: true })) {\n              this.callHover(item, monitor, {\n                listId: this.listId,\n                index: 0,\n              });\n            }\n          }\n        },\n      },\n      this.subs\n    );\n  }\n\n  contextFor(data: Data, index: number): RenderContext<Data> {\n    return {\n      data,\n      index,\n      listId: this.listId,\n      spec: this.spec,\n      horizontal: this.horizontal,\n      hoverTrigger: this.hoverTrigger,\n    };\n  }\n\n  /** @ignore */\n  private updateSubscription() {\n    if (this.listId != null && this.spec) {\n      if (this.listSubs) {\n        this.subs.remove(this.listSubs);\n        this.listSubs.unsubscribe();\n      }\n\n      if (this.spec.getList) {\n        const cs$ = this.spec.getList(this.listId);\n        this.listSubs = cs$?.subscribe(l => {\n          if (l) {\n            this.childrenSubject$.next(l);\n            this.children = l;\n            this.cdr.markForCheck();\n          }\n        });\n\n        this.subs.add(this.listSubs);\n      }\n    }\n  }\n\n  /** @ignore */\n  private getCanDrop(\n    item: DraggedItem<Data>,\n    monitor: DropTargetMonitor<DraggedItem<Data>>,\n    _default = true\n  ) {\n    if (this.spec.canDrop) {\n      return this.spec.canDrop(item, monitor);\n    }\n    return _default;\n  }\n\n  /** @ignore */\n  private callHover(\n    item: DraggedItem<Data>,\n    monitor: DropTargetMonitor<DraggedItem<Data>>,\n    newHover?: { listId: any; index: number }\n  ) {\n    if (newHover) {\n      // mutate the object\n      item.hover = newHover;\n      // but also shallow clone so distinct from previous,\n      // useful if you rely on that for ngrx\n      item = { ...item };\n    }\n    this.spec.hover?.(item, monitor);\n  }\n\n  /** @ignore */\n  ngOnInit() {\n    this.updateSubscription();\n    this.target.setTypes(this.getTargetType());\n  }\n\n  getTargetType() {\n    if (Array.isArray(this.spec.accepts)) {\n      return this.spec.accepts;\n    } else {\n      return this.spec.accepts || this.spec.type;\n    }\n  }\n\n  acceptsType(ty: string | symbol | null) {\n    if (ty == null) return false;\n    if (Array.isArray(this.spec.accepts)) {\n      const arr = this.spec.accepts;\n      return arr.indexOf(ty) !== -1;\n    } else {\n      const acc = this.getTargetType();\n      return ty == acc;\n    }\n  }\n\n  /** @ignore */\n  ngOnChanges({ spec, listId }: SimpleChanges) {\n    if (listId) {\n      this.updateSubscription();\n    }\n    if (spec) {\n      this.updateSubscription();\n    }\n    this.target.setTypes(this.getTargetType());\n  }\n\n  /** @ignore */\n  ngAfterViewInit() {\n    if (this.el) {\n      this.target.connectDropTarget(this.el.nativeElement);\n    } else {\n      throw new Error('dndSortable directive must have ElementRef');\n    }\n  }\n\n  /** @ignore */\n  ngOnDestroy() {\n    this.subs.unsubscribe();\n  }\n}\n","import { Directive, ElementRef, inject, Input, OnChanges, OnDestroy } from '@angular/core';\nimport { DndService, DragSource } from '@ng-dnd/core';\nimport { DraggedItem, Size, SortableSpec } from '../types';\n\nexport const EXTERNAL_LIST_ID: symbol = Symbol('EXTERNAL_LIST_ID');\n\n@Directive({\n  selector: '[dndSortableExternal]',\n  exportAs: 'dndSortableExternal',\n})\nexport class DndSortableExternal<Data> implements OnChanges, OnDestroy {\n  private dnd = inject(DndService);\n  private el = inject<ElementRef<Element>>(ElementRef);\n\n  @Input('dndSortableExternal') spec!: SortableSpec<Data>;\n\n  /**\n   * This source has beginDrag and endDrag implemented in line with what dndSortableRender does.\n   *\n   * You must, like dndSortableRender, attach it with [dragSource] somewhere.\n   */\n  source: DragSource<DraggedItem<Data>>;\n\n  /** @ignore */\n  constructor() {\n    this.source = this.dnd.dragSource<DraggedItem<Data>>(null, {\n      canDrag: monitor => {\n        if (this.spec.canDrag) {\n          // beginDrag has not been called yet, so there is no data, and this is not part of a list.\n          // you should be able to decide canDrag without these anyway.\n          return this.spec.canDrag(undefined as any, undefined, monitor);\n        }\n        return true;\n      },\n      beginDrag: () => {\n        if (typeof this.spec.createData !== 'function') {\n          throw new Error('spec.createData must be a function');\n        }\n        return {\n          type: this.spec.type,\n          data: this.spec.createData(),\n          hover: { index: -1, listId: EXTERNAL_LIST_ID },\n          isInternal: false,\n          index: -1,\n          listId: EXTERNAL_LIST_ID,\n          size: this.size(),\n        };\n      },\n      endDrag: monitor => {\n        const item = monitor.getItem();\n        if (item) {\n          this.spec.endDrag?.(item, monitor);\n        }\n      },\n    });\n  }\n\n  /** @ignore */\n  private size() {\n    const rect = this.el.nativeElement.getBoundingClientRect();\n    return new Size(rect.width || rect.right - rect.left, rect.height || rect.bottom - rect.top);\n  }\n\n  /** @ignore */\n  ngOnChanges() {\n    this.source.setType(this.spec.type);\n  }\n  /** @ignore */\n  ngOnDestroy() {\n    this.source.unsubscribe();\n  }\n}\n","import { Directive } from '@angular/core';\nimport { RenderContext } from '../types';\n\nexport interface TemplateContext<Data> {\n  $implicit: RenderContext<Data>;\n}\n\n@Directive({\n  selector: '[dndSortableTemplate]',\n})\nexport class DndSortableTemplate {}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n  AfterContentInit,\n  AfterViewInit,\n  ChangeDetectionStrategy,\n  Component,\n  ContentChildren,\n  Input,\n  OnChanges,\n  OnDestroy,\n  OnInit,\n  QueryList,\n  SimpleChanges,\n  TemplateRef,\n} from '@angular/core';\nimport { DndSortable } from './sortable';\nimport { DndSortableTemplate, TemplateContext } from './sortable-template';\n\n@Component({\n  selector: 'dnd-sortable-list',\n  template: `\n    @for (card of children; let i = $index; track trackById(i, card)) {\n      <ng-container *ngTemplateOutlet=\"template; context: { $implicit: contextFor(card, i) }\" />\n    }\n  `,\n  styles: `\n    :host {\n      display: block;\n    }\n  `,\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  // allow injecting the directive and getting the component\n  providers: [{ provide: DndSortable, useExisting: DndSortableList }],\n  imports: [NgTemplateOutlet],\n})\nexport class DndSortableList<Data>\n  extends DndSortable<Data>\n  implements OnChanges, OnInit, AfterContentInit, AfterViewInit, OnDestroy\n{\n  @Input() template: TemplateRef<TemplateContext<Data>> | null = null;\n\n  /** @ignore */\n  @ContentChildren(DndSortableTemplate, {\n    read: TemplateRef,\n  })\n  set renderTemplates(ql: QueryList<TemplateRef<TemplateContext<Data>>>) {\n    if (ql.length > 0) {\n      this.template = ql.first;\n    }\n  }\n\n  /** @ignore */\n  trackById = (_index: number, data: Data) => {\n    return this.spec.trackBy(data);\n  };\n\n  /** @ignore */\n  ngAfterContentInit() {\n    if (!this.template) {\n      throw new Error(\n        'You must provide a <ng-template cardTemplate> as a content child, or with [template]=\"myTemplateRef\"'\n      );\n    }\n  }\n\n  // forwarding lifecycle events is required until Ivy renderer\n\n  /** @ignore */\n  ngOnChanges(changes: SimpleChanges) {\n    super.ngOnChanges(changes);\n  }\n\n  /** @ignore */\n  ngOnInit() {\n    super.ngOnInit();\n  }\n\n  /** @ignore */\n  ngAfterViewInit() {\n    super.ngAfterViewInit();\n  }\n\n  /** @ignore */\n  ngOnDestroy() {\n    super.ngOnDestroy();\n  }\n}\n","import { Offset } from '@ng-dnd/core';\nimport { DraggedItem, HoverTrigger, RenderContext } from './types';\n\n//     ~ List ~\n// [\n//   [ index 0 ]\n//   [ index 1 ] <-- index 1 gets picked up\n//   [ index 2 ]\n// ]\n//\n// We want to emit a hover when:\n//   - the mouse moves over the top half of 0\n//   - the mouse moves over the bottom half of 2\n//\n// ,----------------------,\n// | target 0 top half    | => emits 0\n// |----------------------|\n// | target 0 bottom half | => computes 1, doesn't emit\n// '----------------------'\n// ,----------------------,\n// | target 1 (inert)     | => computes 1, doesn't emit\n// '----------------------'\n// ,----------------------,\n// | target 2 top half    | => computes 1, doesn't emit\n// |----------------------|\n// | target 2 bottom half | => emits 2\n// '----------------------'\n//\n\nexport function suggestHalfway<Data>(\n  ctx: RenderContext<Data>,\n  item: DraggedItem<Data>,\n  rect: DOMRect | ClientRect,\n  clientOffset: Offset\n) {\n  const { hover } = item;\n  const dim = ctx.horizontal\n    ? rect.width || rect.right - rect.left\n    : rect.height || rect.bottom - rect.top;\n  const start = ctx.horizontal ? rect.left : rect.top;\n  const targetCentre = start + dim / 2.0;\n  const mouse = ctx.horizontal ? clientOffset.x : clientOffset.y;\n  const topHalf = mouse < targetCentre;\n  let suggestedIndex: number;\n  if (ctx.listId === hover.listId) {\n    if (ctx.index < hover.index) {\n      suggestedIndex = topHalf ? ctx.index : ctx.index + 1;\n    } else {\n      suggestedIndex = topHalf ? ctx.index - 1 : ctx.index;\n      // Fix rare issue when trying to drag too high\n      if (suggestedIndex < 0) {\n        suggestedIndex = 0;\n      }\n    }\n  } else {\n    // first hover on a different list;\n    // there is no relevant hover.index to compare to\n    suggestedIndex = topHalf ? ctx.index : ctx.index + 1;\n  }\n  return suggestedIndex;\n}\n\nexport function suggestFixed<Data>(ctx: RenderContext<Data>) {\n  return ctx.index;\n}\n\nexport function getSuggester(trigger: HoverTrigger) {\n  switch (trigger) {\n    case HoverTrigger.fixed:\n      return suggestFixed;\n    default:\n      return suggestHalfway;\n  }\n}\n","import {\n  AfterViewInit,\n  Directive,\n  ElementRef,\n  inject,\n  Input,\n  OnChanges,\n  OnDestroy,\n  OnInit,\n} from '@angular/core';\nimport {\n  DndService,\n  DragSource,\n  DragSourceMonitor,\n  DropTarget,\n  DropTargetMonitor,\n} from '@ng-dnd/core';\nimport { Observable, Subscription } from 'rxjs';\nimport { getSuggester } from '../hoverTriggers';\nimport { DraggedItem, RenderContext, Size } from '../types';\n\n/** @ignore */\nconst _scheduleMicroTaskPolyfill: (f: () => void) => any =\n  requestAnimationFrame || ((f: () => void) => setTimeout(f, 0));\n\n@Directive({\n  selector: '[dndSortableRender]',\n  exportAs: 'dndSortableRender',\n})\nexport class DndSortableRenderer<Data> implements OnChanges, OnInit, AfterViewInit, OnDestroy {\n  private dnd = inject(DndService);\n  private el = inject<ElementRef<HTMLElement>>(ElementRef);\n\n  @Input('dndSortableRender') context!: RenderContext<Data>;\n\n  get data() {\n    return this.context.data;\n  }\n\n  get index() {\n    return this.context.index;\n  }\n\n  get type() {\n    return this.context.spec.type;\n  }\n\n  get listId() {\n    return this.context.listId;\n  }\n\n  /** @ignore */\n  private get accepts() {\n    const spec = this.context.spec;\n    if (!spec) return [];\n    if (Array.isArray(spec.accepts)) {\n      return spec.accepts;\n    } else {\n      return spec.accepts || spec.type;\n    }\n  }\n  /** @ignore */\n  private get spec() {\n    return this.context.spec;\n  }\n\n  /** @ignore */\n  private subs = new Subscription();\n\n  /**\n   * This DropTarget is attached where [dndSortableRender] is.\n   *\n   * It is responsible for triggering {@link SortableSpec.hover} when the place you are hovering changes.\n   */\n  target: DropTarget<DraggedItem<Data>>;\n\n  /**\n   * This DragSource is NOT attached for you.\n   *\n   * You need to attach it yourself, by pulling #render=\"dndSortableRender\", and applying [dragSource]=\"render.source\".\n   */\n  source: DragSource<DraggedItem<Data>>;\n\n  /**\n   * Shortcut for `this.source.listen(m => m.isDragging())`\n   */\n  isDragging$: Observable<boolean>;\n\n  /** @ignore */\n  constructor() {\n    this.target = this.dnd.dropTarget<DraggedItem<Data>>(\n      null,\n      {\n        // this is a hover-only situation\n        canDrop: () => false,\n        hover: monitor => {\n          this.hover(monitor);\n        },\n      },\n      this.subs\n    );\n\n    this.source = this.dnd.dragSource<DraggedItem<Data>>(\n      null,\n      {\n        canDrag: monitor => {\n          return this.getCanDrag(monitor);\n        },\n        isDragging: monitor => {\n          return this.isDragging(monitor.getItem());\n        },\n        beginDrag: monitor => {\n          const item = this.createItem();\n\n          // Chromium bug since 2016: if you modify styles or DOM\n          // synchronously within 'dragstart' handler, Chrome fires\n          // a 'dragend' immediately.\n          //\n          // https://bugs.chromium.org/p/chromium/issues/detail?id=674882\n          // although recommended Promise.resolve().then() doesn't work.\n          this.spec.beginDrag &&\n            _scheduleMicroTaskPolyfill(() => {\n              this.spec.beginDrag?.(item, monitor);\n            });\n\n          return item;\n        },\n        endDrag: monitor => {\n          const item = monitor.getItem();\n          if (item) {\n            this.spec.endDrag?.(item, monitor);\n          }\n        },\n      },\n      this.subs\n    );\n\n    this.isDragging$ = this.source.listen(m => m.isDragging());\n  }\n\n  /** @ignore */\n  private createItem(): DraggedItem<Data> {\n    return {\n      data: this.data,\n      index: this.index,\n      size: this.size(),\n      type: this.type,\n      isInternal: true,\n      listId: this.listId,\n      hover: {\n        index: this.index,\n        listId: this.listId,\n      },\n    };\n  }\n\n  /** @ignore */\n  private sameIds = (data: Data, other: DraggedItem<Data>) => {\n    return data && other.data && this.spec.trackBy(data) === this.spec.trackBy(other.data);\n  };\n\n  /** @ignore */\n  private getCanDrag(monitor: DragSourceMonitor<void, void>) {\n    if (this.spec.canDrag) {\n      return this.spec.canDrag(this.data, this.listId, monitor);\n    }\n    return true;\n  }\n\n  /** @ignore */\n  private isDragging(item: DraggedItem<Data> | null) {\n    if (this.spec.isDragging) {\n      return (item && this.spec.isDragging(this.data, item)) || false;\n    } else {\n      return (item && this.sameIds(this.data, item)) || false;\n    }\n  }\n\n  /** @ignore */\n  private hover(monitor: DropTargetMonitor<DraggedItem<Data>>) {\n    const item = monitor.getItem();\n    const clientOffset = monitor.getClientOffset();\n    if (item == null || clientOffset == null) {\n      return;\n    }\n    // hovering on yourself should do nothing\n    if (\n      this.isDragging(item) &&\n      this.index === item.hover.index &&\n      this.listId === item.hover.listId\n    ) {\n      return;\n    }\n    const { hover } = item;\n    const suggester = getSuggester(this.context.hoverTrigger);\n    const suggestedIndex = suggester(this.context, item, this.rect(), clientOffset);\n\n    // happens if you aren't implementing SortableSpec correctly.\n    if (suggestedIndex < 0) {\n      // console.warn('this.listId',this.listId, 'hover.listId', hover.listId)\n      // suggestedIndex = 0;\n      throw new Error('@ng-dnd/sortable: Cannot move a card to an index < 0.');\n    }\n\n    // move the item if its new position is different\n    if (suggestedIndex !== hover.index || this.listId !== hover.listId) {\n      item.hover = {\n        index: suggestedIndex,\n        listId: this.listId,\n      };\n      if (this.spec.canDrop && !this.spec.canDrop(item, monitor)) {\n        return;\n      }\n      // shallow clone so library consumers don't mutate our items\n      this.spec.hover?.({ ...item }, monitor);\n    }\n  }\n\n  /** @ignore */\n  private rect() {\n    if (!this.el) {\n      throw new Error(\n        '@ng-dnd/sortable: [dndSortableRender] expected to be attached to a real DOM element'\n      );\n    }\n    const rect = this.el.nativeElement.getBoundingClientRect();\n    return rect;\n  }\n\n  /** @ignore */\n  private size() {\n    const rect = this.rect();\n    const width = rect.width || rect.right - rect.left;\n    const height = rect.height || rect.bottom - rect.top;\n    return new Size(width, height);\n  }\n\n  /** @ignore */\n  ngOnChanges() {\n    this.target.setTypes(this.accepts);\n    this.source.setType(this.type);\n  }\n\n  /** @ignore */\n  ngOnInit() {\n    this.target.setTypes(this.accepts);\n    this.source.setType(this.type);\n  }\n\n  /** @ignore */\n  ngAfterViewInit() {\n    if (this.el) {\n      this.target.connectDropTarget(this.el.nativeElement);\n    }\n  }\n\n  /** @ignore */\n  ngOnDestroy() {\n    this.subs.unsubscribe();\n  }\n}\n","import { DragSourceMonitor, DropTargetMonitor } from '@ng-dnd/core';\nimport { Observable } from 'rxjs';\nimport { DraggedItem, SortableSpec } from './types';\n\nexport enum SortableEvents {\n  BeginDrag = 'BeginDrag',\n  Hover = 'Hover',\n  Drop = 'Drop',\n  EndDrag = 'EndDrag',\n}\n\nexport class BeginDragAction<AT, T> {\n  readonly event = SortableEvents.BeginDrag;\n  constructor(\n    public readonly type: AT,\n    public readonly item: DraggedItem<T>\n  ) {}\n}\n\nexport class HoverAction<AT, T> {\n  readonly event = SortableEvents.Hover;\n  constructor(\n    public readonly type: AT,\n    public readonly item: DraggedItem<T>\n  ) {}\n}\n\nexport class DropAction<AT, T> {\n  readonly event = SortableEvents.Drop;\n  constructor(\n    public readonly type: AT,\n    public readonly item: DraggedItem<T>\n  ) {}\n}\n\nexport class EndDragAction<AT, T> {\n  readonly event = SortableEvents.EndDrag;\n  constructor(\n    public readonly type: AT,\n    public readonly item: DraggedItem<T>\n  ) {}\n}\n\nexport type SortableAction<AT, D> =\n  | BeginDragAction<AT, D>\n  | HoverAction<AT, D>\n  | DropAction<AT, D>\n  | EndDragAction<AT, D>;\n\n/** Intended to be your NgRx Store object */\nexport interface Dispatcher {\n  dispatch: (action: SortableAction<any, any>) => void;\n}\n\nexport interface NgRxSortableConfiguration<D> {\n  type: string | symbol;\n  accepts?: string | symbol | (string | symbol)[];\n  trackBy: (data: D) => any;\n  getList: (listId: any) => Observable<Iterable<D>>;\n  canDrop?: (item: DraggedItem<D>, monitor: DropTargetMonitor<DraggedItem<D>>) => boolean;\n  canDrag?: (data: D, listId: any, monitor: DragSourceMonitor<void, void>) => boolean;\n  isDragging?: (ground: D, inFlight: DraggedItem<D>) => boolean;\n  createData?: () => D;\n}\n\nexport class NgRxSortable<D> implements SortableSpec<D> {\n  public type!: string | symbol;\n  public accepts?: string | symbol | (string | symbol)[];\n  public trackBy!: (data: D) => any;\n  public getList!: (listId: any) => Observable<Iterable<D>>;\n  public canDrop?: (item: DraggedItem<D>, monitor: DropTargetMonitor<DraggedItem<D>>) => boolean;\n  public canDrag?: (data: D, listId: any, monitor: DragSourceMonitor<void, void>) => boolean;\n  public isDragging?: (ground: D, inFlight: DraggedItem<D>) => boolean;\n  public createData?: () => D;\n\n  /**\n   * @param store      An @ngrx store instance.\n   * @param actionType The type in your own @ngrx/store `ActionTypes` enum you want the sortable actions to use.\n   * @param configure  You must provide `trackBy` and `getList` functions here. Hopefully your `getList` will select from the store you passed!\n   */\n  constructor(\n    protected store: Dispatcher,\n    protected actionType: string,\n    configure: NgRxSortableConfiguration<D>\n  ) {\n    if (configure.type !== undefined) this.type = configure.type;\n    if (configure.accepts !== undefined) this.accepts = configure.accepts;\n    if (configure.trackBy !== undefined) this.trackBy = configure.trackBy;\n    if (configure.getList !== undefined) this.getList = configure.getList;\n    if (configure.canDrag !== undefined) this.canDrag = configure.canDrag;\n    if (configure.canDrop !== undefined) this.canDrop = configure.canDrop;\n    if (configure.isDragging !== undefined) this.isDragging = configure.isDragging;\n    if (configure.createData !== undefined) this.createData = configure.createData;\n  }\n\n  // We now implement the SortableSpec interface by dispatching actions\n\n  beginDrag = (item: DraggedItem<D>, _monitor: DragSourceMonitor<void, void>): void => {\n    this.store.dispatch(new BeginDragAction(this.actionType, item));\n  };\n  hover = (item: DraggedItem<D>, _monitor: DropTargetMonitor<DraggedItem<D>>): void => {\n    this.store.dispatch(new HoverAction(this.actionType, item));\n  };\n  drop = (item: DraggedItem<D>, _monitor: DropTargetMonitor<DraggedItem<D>>): void => {\n    this.store.dispatch(new DropAction(this.actionType, item));\n  };\n  endDrag = (item: DraggedItem<D>, _monitor: DragSourceMonitor<DraggedItem<D>>): void => {\n    this.store.dispatch(new EndDragAction(this.actionType, item));\n  };\n}\n","import { DndService, DropTarget } from '@ng-dnd/core';\nimport { Subject } from 'rxjs';\nimport { distinctUntilChanged, filter } from 'rxjs/operators';\nimport { DraggedItem } from './types';\n\nexport const SPILLED_LIST_ID: symbol = Symbol('SPILLED_LIST_ID');\n\nexport interface SpillConfiguration<Data> {\n  drop?: (item: DraggedItem<Data>) => void;\n  hover?: (item: DraggedItem<Data>) => void;\n}\n\nexport function spillTarget<Data>(\n  dnd: DndService,\n  types: string | symbol | (string | symbol)[] | null,\n  config: SpillConfiguration<Data>\n): DropTarget<DraggedItem<Data>> {\n  const mutate = (item: DraggedItem<Data> | null) => {\n    if (!item) return null;\n    item.hover = { listId: SPILLED_LIST_ID, index: -1 };\n    return { ...item };\n  };\n\n  const hover$ = new Subject<DraggedItem<Data> | null>();\n\n  const target = dnd.dropTarget<DraggedItem<Data>>(types, {\n    hover: monitor => {\n      if (monitor.canDrop() && monitor.isOver({ shallow: true })) {\n        const item = mutate(monitor.getItem());\n        hover$.next(item);\n      } else {\n        hover$.next(null);\n      }\n    },\n    drop:\n      (config.drop &&\n        (monitor => {\n          const item = mutate(monitor.getItem());\n          if (!monitor.didDrop()) {\n            item && config.drop?.(item);\n          }\n        })) ||\n      undefined,\n  });\n\n  const spilled$ = hover$.pipe(\n    distinctUntilChanged(),\n    filter(a => !!a)\n  );\n\n  const subs = spilled$.subscribe(item => {\n    item && config.hover?.(item);\n  });\n\n  target.add(subs);\n  return target;\n}\n","import { NgModule } from '@angular/core';\nimport { DndSortable } from './directives/sortable';\nimport { DndSortableExternal } from './directives/sortable-external';\nimport { DndSortableList } from './directives/sortable-list';\nimport { DndSortableRenderer } from './directives/sortable-render';\nimport { DndSortableTemplate } from './directives/sortable-template';\n\n/** @ignore */\nconst EXPORTS = [\n  DndSortable,\n  DndSortableList,\n  DndSortableTemplate,\n  DndSortableRenderer,\n  DndSortableExternal,\n];\n\n@NgModule({\n  imports: EXPORTS,\n  exports: EXPORTS,\n})\nexport class DndSortableModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAAA;;;AAGG;AACG,SAAU,OAAO,CAAC,IAAmB,EAAA;AACzC,IAAA,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE;AACpB,QAAA,OAAO,KAAK;IACd;AACA,IAAA,OAAO,IAAI;AACb;;MC0Ga,IAAI,CAAA;IACf,WAAA,CACS,KAAa,EACb,MAAc,EAAA;QADd,IAAA,CAAA,KAAK,GAAL,KAAK;QACL,IAAA,CAAA,MAAM,GAAN,MA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