import '@das-fed/ui/packages/components/select-list/style.css';
import { withInstall as wi } from "@das-fed/utils/with-install/index";
import { i18n as je, setI18nRule as Si } from "@das-fed/web/packages/i18n/index";
import { getVar as ut, setThemeRule as _i } from "@das-fed/web/packages/theme/index";
import { ElInfiniteScroll as Ei } from "element-plus/es";
import "element-plus/es/components/base/style/css";
import "element-plus/es/components/infinite-scroll/style/css";
import { pushScopeId as Di, popScopeId as Ii, nextTick as et, withScopeId as Ti, createBlock as oe, openBlock as z, markRaw as Ci, shallowReactive as Oi, resolveComponent as Ai, resolveDirective as zi, withDirectives as Se, createElementBlock as X, normalizeClass as ce, createCommentVNode as G, createVNode as ki, renderSlot as he, resolveDynamicComponent as Ft, normalizeStyle as Jt, withCtx as tt, Fragment as _t, renderList as Et, mergeProps as Pi, toHandlers as Ni, ref as Pe, computed as Ne, onMounted as Zt, onBeforeUnmount as $i, watch as Rt, defineComponent as Mi, useCssVars as xi, createElementVNode as Ce, toDisplayString as Oe, unref as E, createTextVNode as Le } from "vue";
import { vDasTooltip as ct } from "@das-fed/ui/packages/components/text-tooltip/index";
import { DasButton as Vi } from "@das-fed/ui/packages/components/button/index";
import { vOverlay as Fi } from "@das-fed/ui/packages/components/overlay/index";
import { DasIconClose2 as dt } from "@das-fed/ui/packages/icons/close-2/index";
import { DasIconDrag as Ri } from "@das-fed/ui/packages/icons/drag/index";
import { useModelValue as Qt } from "@das-fed/utils/vue";
import { SizeWatcher as Hi } from "@das-fed/utils/size-watcher";
import "@das-fed/ui/packages/global/theme";
import "@das-fed/ui/packages/global/style";
function Li() {
  var t = window.navigator.userAgent, e = t.indexOf("MSIE ");
  if (e > 0)
    return parseInt(t.substring(e + 5, t.indexOf(".", e)), 10);
  var i = t.indexOf("Trident/");
  if (i > 0) {
    var n = t.indexOf("rv:");
    return parseInt(t.substring(n + 3, t.indexOf(".", n)), 10);
  }
  var r = t.indexOf("Edge/");
  return r > 0 ? parseInt(t.substring(r + 5, t.indexOf(".", r)), 10) : -1;
}
let Ke;
function Dt() {
  Dt.init || (Dt.init = !0, Ke = Li() !== -1);
}
var at = {
  name: "ResizeObserver",
  props: {
    emitOnMount: {
      type: Boolean,
      default: !1
    },
    ignoreWidth: {
      type: Boolean,
      default: !1
    },
    ignoreHeight: {
      type: Boolean,
      default: !1
    }
  },
  emits: [
    "notify"
  ],
  mounted() {
    Dt(), et(() => {
      this._w = this.$el.offsetWidth, this._h = this.$el.offsetHeight, this.emitOnMount && this.emitSize();
    });
    const t = document.createElement("object");
    this._resizeObject = t, t.setAttribute("aria-hidden", "true"), t.setAttribute("tabindex", -1), t.onload = this.addResizeHandlers, t.type = "text/html", Ke && this.$el.appendChild(t), t.data = "about:blank", Ke || this.$el.appendChild(t);
  },
  beforeUnmount() {
    this.removeResizeHandlers();
  },
  methods: {
    compareAndNotify() {
      (!this.ignoreWidth && this._w !== this.$el.offsetWidth || !this.ignoreHeight && this._h !== this.$el.offsetHeight) && (this._w = this.$el.offsetWidth, this._h = this.$el.offsetHeight, this.emitSize());
    },
    emitSize() {
      this.$emit("notify", {
        width: this._w,
        height: this._h
      });
    },
    addResizeHandlers() {
      this._resizeObject.contentDocument.defaultView.addEventListener("resize", this.compareAndNotify), this.compareAndNotify();
    },
    removeResizeHandlers() {
      this._resizeObject && this._resizeObject.onload && (!Ke && this._resizeObject.contentDocument && this._resizeObject.contentDocument.defaultView.removeEventListener("resize", this.compareAndNotify), this.$el.removeChild(this._resizeObject), this._resizeObject.onload = null, this._resizeObject = null);
    }
  }
};
const Bi = /* @__PURE__ */ Ti("data-v-b329ee4c");
Di("data-v-b329ee4c");
const Yi = {
  class: "resize-observer",
  tabindex: "-1"
};
Ii();
const Xi = /* @__PURE__ */ Bi((t, e, i, n, r, o) => (z(), oe("div", Yi)));
at.render = Xi;
at.__scopeId = "data-v-b329ee4c";
at.__file = "src/components/ResizeObserver.vue";
function Ge(t) {
  "@babel/helpers - typeof";
  return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Ge = function(e) {
    return typeof e;
  } : Ge = function(e) {
    return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
  }, Ge(t);
}
function Wi(t, e) {
  if (!(t instanceof e))
    throw new TypeError("Cannot call a class as a function");
}
function ji(t, e) {
  for (var i = 0; i < e.length; i++) {
    var n = e[i];
    n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(t, n.key, n);
  }
}
function Ki(t, e, i) {
  return e && ji(t.prototype, e), t;
}
function Ht(t) {
  return Gi(t) || Ui(t) || qi(t) || Ji();
}
function Gi(t) {
  if (Array.isArray(t)) return It(t);
}
function Ui(t) {
  if (typeof Symbol < "u" && Symbol.iterator in Object(t)) return Array.from(t);
}
function qi(t, e) {
  if (t) {
    if (typeof t == "string") return It(t, e);
    var i = Object.prototype.toString.call(t).slice(8, -1);
    if (i === "Object" && t.constructor && (i = t.constructor.name), i === "Map" || i === "Set") return Array.from(t);
    if (i === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)) return It(t, e);
  }
}
function It(t, e) {
  (e == null || e > t.length) && (e = t.length);
  for (var i = 0, n = new Array(e); i < e; i++) n[i] = t[i];
  return n;
}
function Ji() {
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function Zi(t) {
  var e;
  return typeof t == "function" ? e = {
    callback: t
  } : e = t, e;
}
function Qi(t, e) {
  var i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, n, r, o, l = function(a) {
    for (var u = arguments.length, c = new Array(u > 1 ? u - 1 : 0), h = 1; h < u; h++)
      c[h - 1] = arguments[h];
    if (o = c, !(n && a === r)) {
      var g = i.leading;
      typeof g == "function" && (g = g(a, r)), (!n || a !== r) && g && t.apply(void 0, [a].concat(Ht(o))), r = a, clearTimeout(n), n = setTimeout(function() {
        t.apply(void 0, [a].concat(Ht(o))), n = 0;
      }, e);
    }
  };
  return l._clear = function() {
    clearTimeout(n), n = null;
  }, l;
}
function ei(t, e) {
  if (t === e) return !0;
  if (Ge(t) === "object") {
    for (var i in t)
      if (!ei(t[i], e[i]))
        return !1;
    return !0;
  }
  return !1;
}
var en = /* @__PURE__ */ function() {
  function t(e, i, n) {
    Wi(this, t), this.el = e, this.observer = null, this.frozen = !1, this.createObserver(i, n);
  }
  return Ki(t, [{
    key: "createObserver",
    value: function(i, n) {
      var r = this;
      if (this.observer && this.destroyObserver(), !this.frozen) {
        if (this.options = Zi(i), this.callback = function(s, a) {
          r.options.callback(s, a), s && r.options.once && (r.frozen = !0, r.destroyObserver());
        }, this.callback && this.options.throttle) {
          var o = this.options.throttleOptions || {}, l = o.leading;
          this.callback = Qi(this.callback, this.options.throttle, {
            leading: function(a) {
              return l === "both" || l === "visible" && a || l === "hidden" && !a;
            }
          });
        }
        this.oldResult = void 0, this.observer = new IntersectionObserver(function(s) {
          var a = s[0];
          if (s.length > 1) {
            var u = s.find(function(h) {
              return h.isIntersecting;
            });
            u && (a = u);
          }
          if (r.callback) {
            var c = a.isIntersecting && a.intersectionRatio >= r.threshold;
            if (c === r.oldResult) return;
            r.oldResult = c, r.callback(c, a);
          }
        }, this.options.intersection), et(function() {
          r.observer && r.observer.observe(r.el);
        });
      }
    }
  }, {
    key: "destroyObserver",
    value: function() {
      this.observer && (this.observer.disconnect(), this.observer = null), this.callback && this.callback._clear && (this.callback._clear(), this.callback = null);
    }
  }, {
    key: "threshold",
    get: function() {
      return this.options.intersection && typeof this.options.intersection.threshold == "number" ? this.options.intersection.threshold : 0;
    }
  }]), t;
}();
function ti(t, e, i) {
  var n = e.value;
  if (n && !(typeof IntersectionObserver > "u")) {
    var r = new en(t, n, i);
    t._vue_visibilityState = r;
  }
}
function tn(t, e, i) {
  var n = e.value, r = e.oldValue;
  if (!ei(n, r)) {
    var o = t._vue_visibilityState;
    if (!n) {
      ii(t);
      return;
    }
    o ? o.createObserver(n, i) : ti(t, {
      value: n
    }, i);
  }
}
function ii(t) {
  var e = t._vue_visibilityState;
  e && (e.destroyObserver(), delete t._vue_visibilityState);
}
var nn = {
  beforeMount: ti,
  updated: tn,
  unmounted: ii
}, rn = {
  itemsLimit: 1e3
}, on = /(auto|scroll)/;
function ni(t, e) {
  return t.parentNode === null ? e : ni(t.parentNode, e.concat([t]));
}
var ft = function(e, i) {
  return getComputedStyle(e, null).getPropertyValue(i);
}, ln = function(e) {
  return ft(e, "overflow") + ft(e, "overflow-y") + ft(e, "overflow-x");
}, an = function(e) {
  return on.test(ln(e));
};
function Lt(t) {
  if (t instanceof HTMLElement || t instanceof SVGElement) {
    for (var e = ni(t.parentNode, []), i = 0; i < e.length; i += 1)
      if (an(e[i]))
        return e[i];
    return document.scrollingElement || document.documentElement;
  }
}
function Tt(t) {
  "@babel/helpers - typeof";
  return Tt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
    return typeof e;
  } : function(e) {
    return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
  }, Tt(t);
}
var sn = {
  items: {
    type: Array,
    required: !0
  },
  keyField: {
    type: String,
    default: "id"
  },
  direction: {
    type: String,
    default: "vertical",
    validator: function(e) {
      return ["vertical", "horizontal"].includes(e);
    }
  },
  listTag: {
    type: String,
    default: "div"
  },
  itemTag: {
    type: String,
    default: "div"
  }
};
function un() {
  return this.items.length && Tt(this.items[0]) !== "object";
}
var Ct = !1;
if (typeof window < "u") {
  Ct = !1;
  try {
    var cn = Object.defineProperty({}, "passive", {
      get: function() {
        Ct = !0;
      }
    });
    window.addEventListener("test", null, cn);
  } catch {
  }
}
let dn = 0;
var Pt = {
  name: "RecycleScroller",
  components: {
    ResizeObserver: at
  },
  directives: {
    ObserveVisibility: nn
  },
  props: {
    ...sn,
    itemSize: {
      type: Number,
      default: null
    },
    gridItems: {
      type: Number,
      default: void 0
    },
    itemSecondarySize: {
      type: Number,
      default: void 0
    },
    minItemSize: {
      type: [Number, String],
      default: null
    },
    sizeField: {
      type: String,
      default: "size"
    },
    typeField: {
      type: String,
      default: "type"
    },
    buffer: {
      type: Number,
      default: 200
    },
    pageMode: {
      type: Boolean,
      default: !1
    },
    prerender: {
      type: Number,
      default: 0
    },
    emitUpdate: {
      type: Boolean,
      default: !1
    },
    updateInterval: {
      type: Number,
      default: 0
    },
    skipHover: {
      type: Boolean,
      default: !1
    },
    listTag: {
      type: String,
      default: "div"
    },
    itemTag: {
      type: String,
      default: "div"
    },
    listClass: {
      type: [String, Object, Array],
      default: ""
    },
    itemClass: {
      type: [String, Object, Array],
      default: ""
    }
  },
  emits: [
    "resize",
    "visible",
    "hidden",
    "update",
    "scroll-start",
    "scroll-end"
  ],
  data() {
    return {
      pool: [],
      totalSize: 0,
      ready: !1,
      hoverKey: null
    };
  },
  computed: {
    sizes() {
      if (this.itemSize === null) {
        const t = {
          "-1": { accumulator: 0 }
        }, e = this.items, i = this.sizeField, n = this.minItemSize;
        let r = 1e4, o = 0, l;
        for (let s = 0, a = e.length; s < a; s++)
          l = e[s][i] || n, l < r && (r = l), o += l, t[s] = { accumulator: o, size: l };
        return this.$_computedMinItemSize = r, t;
      }
      return [];
    },
    simpleArray: un,
    itemIndexByKey() {
      const { keyField: t, items: e } = this, i = {};
      for (let n = 0, r = e.length; n < r; n++)
        i[e[n][t]] = n;
      return i;
    }
  },
  watch: {
    items() {
      this.updateVisibleItems(!0);
    },
    pageMode() {
      this.applyPageMode(), this.updateVisibleItems(!1);
    },
    sizes: {
      handler() {
        this.updateVisibleItems(!1);
      },
      deep: !0
    },
    gridItems() {
      this.updateVisibleItems(!0);
    },
    itemSecondarySize() {
      this.updateVisibleItems(!0);
    }
  },
  created() {
    this.$_startIndex = 0, this.$_endIndex = 0, this.$_views = /* @__PURE__ */ new Map(), this.$_unusedViews = /* @__PURE__ */ new Map(), this.$_scrollDirty = !1, this.$_lastUpdateScrollPosition = 0, this.prerender && (this.$_prerender = !0, this.updateVisibleItems(!1)), this.gridItems && this.itemSize;
  },
  mounted() {
    this.applyPageMode(), this.$nextTick(() => {
      this.$_prerender = !1, this.updateVisibleItems(!0), this.ready = !0;
    });
  },
  activated() {
    const t = this.$_lastUpdateScrollPosition;
    typeof t == "number" && this.$nextTick(() => {
      this.scrollToPosition(t);
    });
  },
  beforeUnmount() {
    this.removeListeners();
  },
  methods: {
    addView(t, e, i, n, r) {
      const o = Ci({
        id: dn++,
        index: e,
        used: !0,
        key: n,
        type: r
      }), l = Oi({
        item: i,
        position: 0,
        nr: o
      });
      return t.push(l), l;
    },
    unuseView(t, e = !1) {
      const i = this.$_unusedViews, n = t.nr.type;
      let r = i.get(n);
      r || (r = [], i.set(n, r)), r.push(t), e || (t.nr.used = !1, t.position = -9999);
    },
    handleResize() {
      this.$emit("resize"), this.ready && this.updateVisibleItems(!1);
    },
    handleScroll(t) {
      if (!this.$_scrollDirty) {
        if (this.$_scrollDirty = !0, this.$_updateTimeout) return;
        const e = () => requestAnimationFrame(() => {
          this.$_scrollDirty = !1;
          const { continuous: i } = this.updateVisibleItems(!1, !0);
          i || (clearTimeout(this.$_refreshTimout), this.$_refreshTimout = setTimeout(this.handleScroll, this.updateInterval + 100));
        });
        e(), this.updateInterval && (this.$_updateTimeout = setTimeout(() => {
          this.$_updateTimeout = 0, this.$_scrollDirty && e();
        }, this.updateInterval));
      }
    },
    handleVisibilityChange(t, e) {
      this.ready && (t || e.boundingClientRect.width !== 0 || e.boundingClientRect.height !== 0 ? (this.$emit("visible"), requestAnimationFrame(() => {
        this.updateVisibleItems(!1);
      })) : this.$emit("hidden"));
    },
    updateVisibleItems(t, e = !1) {
      const i = this.itemSize, n = this.gridItems || 1, r = this.itemSecondarySize || i, o = this.$_computedMinItemSize, l = this.typeField, s = this.simpleArray ? null : this.keyField, a = this.items, u = a.length, c = this.sizes, h = this.$_views, g = this.$_unusedViews, D = this.pool, _ = this.itemIndexByKey;
      let v, T, $, p, d;
      if (!u)
        v = T = p = d = $ = 0;
      else if (this.$_prerender)
        v = p = 0, T = d = Math.min(this.prerender, a.length), $ = null;
      else {
        const I = this.getScroll();
        if (e) {
          let A = I.start - this.$_lastUpdateScrollPosition;
          if (A < 0 && (A = -A), i === null && A < o || A < i)
            return {
              continuous: !0
            };
        }
        this.$_lastUpdateScrollPosition = I.start;
        const x = this.buffer;
        I.start -= x, I.end += x;
        let P = 0;
        if (this.$refs.before && (P = this.$refs.before.scrollHeight, I.start -= P), this.$refs.after) {
          const A = this.$refs.after.scrollHeight;
          I.end += A;
        }
        if (i === null) {
          let A, J = 0, ue = u - 1, V = ~~(u / 2), me;
          do
            me = V, A = c[V].accumulator, A < I.start ? J = V : V < u - 1 && c[V + 1].accumulator > I.start && (ue = V), V = ~~((J + ue) / 2);
          while (V !== me);
          for (V < 0 && (V = 0), v = V, $ = c[u - 1].accumulator, T = V; T < u && c[T].accumulator < I.end; T++) ;
          for (T === -1 ? T = a.length - 1 : (T++, T > u && (T = u)), p = v; p < u && P + c[p].accumulator < I.start; p++) ;
          for (d = p; d < u && P + c[d].accumulator < I.end; d++) ;
        } else {
          v = ~~(I.start / i * n);
          const A = v % n;
          v -= A, T = Math.ceil(I.end / i * n), p = Math.max(0, Math.floor((I.start - P) / i * n)), d = Math.floor((I.end - P) / i * n), v < 0 && (v = 0), T > u && (T = u), p < 0 && (p = 0), d > u && (d = u), $ = Math.ceil(u / n) * i;
        }
      }
      T - v > rn.itemsLimit && this.itemsLimitError(), this.totalSize = $;
      let m;
      const W = v <= this.$_endIndex && T >= this.$_startIndex;
      if (W)
        for (let I = 0, x = D.length; I < x; I++)
          m = D[I], m.nr.used && (t && (m.nr.index = _[m.item[s]]), (m.nr.index == null || m.nr.index < v || m.nr.index >= T) && this.unuseView(m));
      const w = W ? null : /* @__PURE__ */ new Map();
      let F, L, B;
      for (let I = v; I < T; I++) {
        F = a[I];
        const x = s ? F[s] : F;
        if (x == null)
          throw new Error(`Key is ${x} on item (keyField is '${s}')`);
        if (m = h.get(x), !i && !c[I].size) {
          m && this.unuseView(m);
          continue;
        }
        L = F[l];
        let P = g.get(L), A = !1;
        if (!m)
          W ? P && P.length ? m = P.pop() : m = this.addView(D, I, F, x, L) : (B = w.get(L) || 0, (!P || B >= P.length) && (m = this.addView(D, I, F, x, L), this.unuseView(m, !0), P = g.get(L)), m = P[B], w.set(L, B + 1)), h.delete(m.nr.key), m.nr.used = !0, m.nr.index = I, m.nr.key = x, m.nr.type = L, h.set(x, m), A = !0;
        else if (!m.nr.used && (m.nr.used = !0, A = !0, P)) {
          const J = P.indexOf(m);
          J !== -1 && P.splice(J, 1);
        }
        m.item = F, A && (I === a.length - 1 && this.$emit("scroll-end"), I === 0 && this.$emit("scroll-start")), i === null ? (m.position = c[I - 1].accumulator, m.offset = 0) : (m.position = Math.floor(I / n) * i, m.offset = I % n * r);
      }
      return this.$_startIndex = v, this.$_endIndex = T, this.emitUpdate && this.$emit("update", v, T, p, d), clearTimeout(this.$_sortTimer), this.$_sortTimer = setTimeout(this.sortViews, this.updateInterval + 300), {
        continuous: W
      };
    },
    getListenerTarget() {
      let t = Lt(this.$el);
      return window.document && (t === window.document.documentElement || t === window.document.body) && (t = window), t;
    },
    getScroll() {
      const { $el: t, direction: e } = this, i = e === "vertical";
      let n;
      if (this.pageMode) {
        const r = t.getBoundingClientRect(), o = i ? r.height : r.width;
        let l = -(i ? r.top : r.left), s = i ? window.innerHeight : window.innerWidth;
        l < 0 && (s += l, l = 0), l + s > o && (s = o - l), n = {
          start: l,
          end: l + s
        };
      } else i ? n = {
        start: t.scrollTop,
        end: t.scrollTop + t.clientHeight
      } : n = {
        start: t.scrollLeft,
        end: t.scrollLeft + t.clientWidth
      };
      return n;
    },
    applyPageMode() {
      this.pageMode ? this.addListeners() : this.removeListeners();
    },
    addListeners() {
      this.listenerTarget = this.getListenerTarget(), this.listenerTarget.addEventListener("scroll", this.handleScroll, Ct ? {
        passive: !0
      } : !1), this.listenerTarget.addEventListener("resize", this.handleResize);
    },
    removeListeners() {
      this.listenerTarget && (this.listenerTarget.removeEventListener("scroll", this.handleScroll), this.listenerTarget.removeEventListener("resize", this.handleResize), this.listenerTarget = null);
    },
    scrollToItem(t) {
      let e;
      const i = this.gridItems || 1;
      this.itemSize === null ? e = t > 0 ? this.sizes[t - 1].accumulator : 0 : e = Math.floor(t / i) * this.itemSize, this.scrollToPosition(e);
    },
    scrollToPosition(t) {
      const e = this.direction === "vertical" ? { scroll: "scrollTop", start: "top" } : { scroll: "scrollLeft", start: "left" };
      let i, n, r;
      if (this.pageMode) {
        const o = Lt(this.$el), l = o.tagName === "HTML" ? 0 : o[e.scroll], s = o.getBoundingClientRect(), u = this.$el.getBoundingClientRect()[e.start] - s[e.start];
        i = o, n = e.scroll, r = t + l + u;
      } else
        i = this.$el, n = e.scroll, r = t;
      i[n] = r;
    },
    itemsLimitError() {
      throw setTimeout(() => {
      }), new Error("Rendered items limit reached");
    },
    sortViews() {
      this.pool.sort((t, e) => t.nr.index - e.nr.index);
    }
  }
};
const fn = {
  key: 0,
  ref: "before",
  class: "vue-recycle-scroller__slot"
}, hn = {
  key: 1,
  ref: "after",
  class: "vue-recycle-scroller__slot"
};
function pn(t, e, i, n, r, o) {
  const l = Ai("ResizeObserver"), s = zi("observe-visibility");
  return Se((z(), X(
    "div",
    {
      class: ce(["vue-recycle-scroller", {
        ready: r.ready,
        "page-mode": i.pageMode,
        [`direction-${t.direction}`]: !0
      }]),
      onScrollPassive: e[0] || (e[0] = (...a) => o.handleScroll && o.handleScroll(...a))
    },
    [
      t.$slots.before ? (z(), X(
        "div",
        fn,
        [
          he(t.$slots, "before")
        ],
        512
        /* NEED_PATCH */
      )) : G("v-if", !0),
      (z(), oe(Ft(i.listTag), {
        ref: "wrapper",
        style: Jt({ [t.direction === "vertical" ? "minHeight" : "minWidth"]: r.totalSize + "px" }),
        class: ce(["vue-recycle-scroller__item-wrapper", i.listClass])
      }, {
        default: tt(() => [
          (z(!0), X(
            _t,
            null,
            Et(r.pool, (a) => (z(), oe(Ft(i.itemTag), Pi({
              key: a.nr.id,
              style: r.ready ? {
                transform: `translate${t.direction === "vertical" ? "Y" : "X"}(${a.position}px) translate${t.direction === "vertical" ? "X" : "Y"}(${a.offset}px)`,
                width: i.gridItems ? `${t.direction === "vertical" && i.itemSecondarySize || i.itemSize}px` : void 0,
                height: i.gridItems ? `${t.direction === "horizontal" && i.itemSecondarySize || i.itemSize}px` : void 0
              } : null,
              class: ["vue-recycle-scroller__item-view", [
                i.itemClass,
                {
                  hover: !i.skipHover && r.hoverKey === a.nr.key
                }
              ]]
            }, Ni(i.skipHover ? {} : {
              mouseenter: () => {
                r.hoverKey = a.nr.key;
              },
              mouseleave: () => {
                r.hoverKey = null;
              }
            })), {
              default: tt(() => [
                he(t.$slots, "default", {
                  item: a.item,
                  index: a.nr.index,
                  active: a.nr.used
                })
              ]),
              _: 2
              /* DYNAMIC */
            }, 1040, ["style", "class"]))),
            128
            /* KEYED_FRAGMENT */
          )),
          he(t.$slots, "empty")
        ]),
        _: 3
        /* FORWARDED */
      }, 8, ["style", "class"])),
      t.$slots.after ? (z(), X(
        "div",
        hn,
        [
          he(t.$slots, "after")
        ],
        512
        /* NEED_PATCH */
      )) : G("v-if", !0),
      ki(l, { onNotify: o.handleResize }, null, 8, ["onNotify"])
    ],
    34
    /* CLASS, HYDRATE_EVENTS */
  )), [
    [s, o.handleVisibilityChange]
  ]);
}
Pt.render = pn;
Pt.__file = "src/components/RecycleScroller.vue";
const mn = (t, e) => {
  const i = Pe(), n = Pe(), r = Qt(t, "modelValue"), o = t.valueKey, l = Ne(() => t.selectedNum ? t.selectedNum : `${t.customTitle || je("das-select-list-selected").value}${je("das-select-list-parentheses-left").value}${r.value.length}${je("das-select-list-parentheses-right").value}`), s = Ne(() => ({ disabled: "disabled", ...t.props })), a = (p) => {
    if (t.closeable === void 0)
      return !0;
    if (typeof t.closeable == "boolean")
      return t.closeable;
    if (typeof t.closeable == "function") {
      const d = t.closeable(p);
      if (typeof d == "boolean")
        return d;
    }
    return !1;
  }, u = (p) => {
    let d = !1;
    return typeof s.value.disabled == "string" ? d = p[s.value.disabled] : d = s.value.disabled(p) ?? !1, d;
  }, c = Ne({
    get: () => t.selectdValue,
    set: (p) => {
      e("update:selectdValue", p);
    }
  }), h = (p) => {
    t.isView || u(p) || (c.value = p[o], e("select-item", p));
  }, g = (p) => {
    const d = r.value.filter((m) => m[o] !== p[o]);
    e("item-remove", p), e("update:modelValue", d);
  }, D = () => {
    const p = r.value.filter((m) => !u(m) && a(m)), d = r.value.filter((m) => u(m) || !a(m));
    e("remove-all", p), e("update:modelValue", d);
  }, _ = () => {
    t.infiniteScroll && t.infiniteScroll().then((p) => {
      if (p && p.length) {
        let d = [];
        d = p, d = d.filter(
          (W) => !r.value.map((w) => w[t.valueKey]).includes(W[t.valueKey])
        );
        const m = r.value.concat(d);
        e("update:modelValue", m);
      }
    });
  };
  let v = 0;
  const T = (p) => {
    var m;
    const d = ((m = n.value) == null ? void 0 : m.offsetHeight) || 0;
    v !== 0 && p === 0 && _(), v = p, p !== 0 && p - d < 10 && _();
  }, $ = Pe();
  return Zt(() => {
    var d;
    if (t.infiniteDisabled) return;
    const p = (d = n.value) == null ? void 0 : d.querySelector(".selected-group");
    $.value = Hi((m) => {
      T(m.height);
    }, p);
  }), $i(() => {
    var p;
    (p = $.value) == null || p.disconnect();
  }), {
    selectListRef: i,
    $list: n,
    disabledFlag: u,
    itemGroups: r,
    selectedLabel: l,
    itemRemove: g,
    removeAll: D,
    innerSelectdValue: c,
    selectItem: h,
    infiniteLoad: _,
    closeableFn: a
  };
};
/**!
 * Sortable 1.15.6
 * @author	RubaXa   <trash@rubaxa.org>
 * @author	owenm    <owen23355@gmail.com>
 * @license MIT
 */
function Bt(t, e) {
  var i = Object.keys(t);
  if (Object.getOwnPropertySymbols) {
    var n = Object.getOwnPropertySymbols(t);
    e && (n = n.filter(function(r) {
      return Object.getOwnPropertyDescriptor(t, r).enumerable;
    })), i.push.apply(i, n);
  }
  return i;
}
function re(t) {
  for (var e = 1; e < arguments.length; e++) {
    var i = arguments[e] != null ? arguments[e] : {};
    e % 2 ? Bt(Object(i), !0).forEach(function(n) {
      gn(t, n, i[n]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(i)) : Bt(Object(i)).forEach(function(n) {
      Object.defineProperty(t, n, Object.getOwnPropertyDescriptor(i, n));
    });
  }
  return t;
}
function Ue(t) {
  "@babel/helpers - typeof";
  return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Ue = function(e) {
    return typeof e;
  } : Ue = function(e) {
    return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
  }, Ue(t);
}
function gn(t, e, i) {
  return e in t ? Object.defineProperty(t, e, {
    value: i,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : t[e] = i, t;
}
function ae() {
  return ae = Object.assign || function(t) {
    for (var e = 1; e < arguments.length; e++) {
      var i = arguments[e];
      for (var n in i)
        Object.prototype.hasOwnProperty.call(i, n) && (t[n] = i[n]);
    }
    return t;
  }, ae.apply(this, arguments);
}
function vn(t, e) {
  if (t == null) return {};
  var i = {}, n = Object.keys(t), r, o;
  for (o = 0; o < n.length; o++)
    r = n[o], !(e.indexOf(r) >= 0) && (i[r] = t[r]);
  return i;
}
function bn(t, e) {
  if (t == null) return {};
  var i = vn(t, e), n, r;
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(t);
    for (r = 0; r < o.length; r++)
      n = o[r], !(e.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(t, n) && (i[n] = t[n]);
  }
  return i;
}
var yn = "1.15.6";
function le(t) {
  if (typeof window < "u" && window.navigator)
    return !!/* @__PURE__ */ navigator.userAgent.match(t);
}
var se = le(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), Re = le(/Edge/i), Yt = le(/firefox/i), $e = le(/safari/i) && !le(/chrome/i) && !le(/android/i), Nt = le(/iP(ad|od|hone)/i), ri = le(/chrome/i) && le(/android/i), oi = {
  capture: !1,
  passive: !1
};
function O(t, e, i) {
  t.addEventListener(e, i, !se && oi);
}
function C(t, e, i) {
  t.removeEventListener(e, i, !se && oi);
}
function it(t, e) {
  if (e) {
    if (e[0] === ">" && (e = e.substring(1)), t)
      try {
        if (t.matches)
          return t.matches(e);
        if (t.msMatchesSelector)
          return t.msMatchesSelector(e);
        if (t.webkitMatchesSelector)
          return t.webkitMatchesSelector(e);
      } catch {
        return !1;
      }
    return !1;
  }
}
function li(t) {
  return t.host && t !== document && t.host.nodeType ? t.host : t.parentNode;
}
function ie(t, e, i, n) {
  if (t) {
    i = i || document;
    do {
      if (e != null && (e[0] === ">" ? t.parentNode === i && it(t, e) : it(t, e)) || n && t === i)
        return t;
      if (t === i) break;
    } while (t = li(t));
  }
  return null;
}
var Xt = /\s+/g;
function Z(t, e, i) {
  if (t && e)
    if (t.classList)
      t.classList[i ? "add" : "remove"](e);
    else {
      var n = (" " + t.className + " ").replace(Xt, " ").replace(" " + e + " ", " ");
      t.className = (n + (i ? " " + e : "")).replace(Xt, " ");
    }
}
function b(t, e, i) {
  var n = t && t.style;
  if (n) {
    if (i === void 0)
      return document.defaultView && document.defaultView.getComputedStyle ? i = document.defaultView.getComputedStyle(t, "") : t.currentStyle && (i = t.currentStyle), e === void 0 ? i : i[e];
    !(e in n) && e.indexOf("webkit") === -1 && (e = "-webkit-" + e), n[e] = i + (typeof i == "string" ? "" : "px");
  }
}
function De(t, e) {
  var i = "";
  if (typeof t == "string")
    i = t;
  else
    do {
      var n = b(t, "transform");
      n && n !== "none" && (i = n + " " + i);
    } while (!e && (t = t.parentNode));
  var r = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
  return r && new r(i);
}
function ai(t, e, i) {
  if (t) {
    var n = t.getElementsByTagName(e), r = 0, o = n.length;
    if (i)
      for (; r < o; r++)
        i(n[r], r);
    return n;
  }
  return [];
}
function ne() {
  var t = document.scrollingElement;
  return t || document.documentElement;
}
function H(t, e, i, n, r) {
  if (!(!t.getBoundingClientRect && t !== window)) {
    var o, l, s, a, u, c, h;
    if (t !== window && t.parentNode && t !== ne() ? (o = t.getBoundingClientRect(), l = o.top, s = o.left, a = o.bottom, u = o.right, c = o.height, h = o.width) : (l = 0, s = 0, a = window.innerHeight, u = window.innerWidth, c = window.innerHeight, h = window.innerWidth), (e || i) && t !== window && (r = r || t.parentNode, !se))
      do
        if (r && r.getBoundingClientRect && (b(r, "transform") !== "none" || i && b(r, "position") !== "static")) {
          var g = r.getBoundingClientRect();
          l -= g.top + parseInt(b(r, "border-top-width")), s -= g.left + parseInt(b(r, "border-left-width")), a = l + o.height, u = s + o.width;
          break;
        }
      while (r = r.parentNode);
    if (n && t !== window) {
      var D = De(r || t), _ = D && D.a, v = D && D.d;
      D && (l /= v, s /= _, h /= _, c /= v, a = l + c, u = s + h);
    }
    return {
      top: l,
      left: s,
      bottom: a,
      right: u,
      width: h,
      height: c
    };
  }
}
function Wt(t, e, i) {
  for (var n = pe(t, !0), r = H(t)[e]; n; ) {
    var o = H(n)[i], l = void 0;
    if (l = r >= o, !l) return n;
    if (n === ne()) break;
    n = pe(n, !1);
  }
  return !1;
}
function Ie(t, e, i, n) {
  for (var r = 0, o = 0, l = t.children; o < l.length; ) {
    if (l[o].style.display !== "none" && l[o] !== y.ghost && (n || l[o] !== y.dragged) && ie(l[o], i.draggable, t, !1)) {
      if (r === e)
        return l[o];
      r++;
    }
    o++;
  }
  return null;
}
function $t(t, e) {
  for (var i = t.lastElementChild; i && (i === y.ghost || b(i, "display") === "none" || e && !it(i, e)); )
    i = i.previousElementSibling;
  return i || null;
}
function ee(t, e) {
  var i = 0;
  if (!t || !t.parentNode)
    return -1;
  for (; t = t.previousElementSibling; )
    t.nodeName.toUpperCase() !== "TEMPLATE" && t !== y.clone && (!e || it(t, e)) && i++;
  return i;
}
function jt(t) {
  var e = 0, i = 0, n = ne();
  if (t)
    do {
      var r = De(t), o = r.a, l = r.d;
      e += t.scrollLeft * o, i += t.scrollTop * l;
    } while (t !== n && (t = t.parentNode));
  return [e, i];
}
function wn(t, e) {
  for (var i in t)
    if (t.hasOwnProperty(i)) {
      for (var n in e)
        if (e.hasOwnProperty(n) && e[n] === t[i][n]) return Number(i);
    }
  return -1;
}
function pe(t, e) {
  if (!t || !t.getBoundingClientRect) return ne();
  var i = t, n = !1;
  do
    if (i.clientWidth < i.scrollWidth || i.clientHeight < i.scrollHeight) {
      var r = b(i);
      if (i.clientWidth < i.scrollWidth && (r.overflowX == "auto" || r.overflowX == "scroll") || i.clientHeight < i.scrollHeight && (r.overflowY == "auto" || r.overflowY == "scroll")) {
        if (!i.getBoundingClientRect || i === document.body) return ne();
        if (n || e) return i;
        n = !0;
      }
    }
  while (i = i.parentNode);
  return ne();
}
function Sn(t, e) {
  if (t && e)
    for (var i in e)
      e.hasOwnProperty(i) && (t[i] = e[i]);
  return t;
}
function ht(t, e) {
  return Math.round(t.top) === Math.round(e.top) && Math.round(t.left) === Math.round(e.left) && Math.round(t.height) === Math.round(e.height) && Math.round(t.width) === Math.round(e.width);
}
var Me;
function si(t, e) {
  return function() {
    if (!Me) {
      var i = arguments, n = this;
      i.length === 1 ? t.call(n, i[0]) : t.apply(n, i), Me = setTimeout(function() {
        Me = void 0;
      }, e);
    }
  };
}
function _n() {
  clearTimeout(Me), Me = void 0;
}
function ui(t, e, i) {
  t.scrollLeft += e, t.scrollTop += i;
}
function ci(t) {
  var e = window.Polymer, i = window.jQuery || window.Zepto;
  return e && e.dom ? e.dom(t).cloneNode(!0) : i ? i(t).clone(!0)[0] : t.cloneNode(!0);
}
function di(t, e, i) {
  var n = {};
  return Array.from(t.children).forEach(function(r) {
    var o, l, s, a;
    if (!(!ie(r, e.draggable, t, !1) || r.animated || r === i)) {
      var u = H(r);
      n.left = Math.min((o = n.left) !== null && o !== void 0 ? o : 1 / 0, u.left), n.top = Math.min((l = n.top) !== null && l !== void 0 ? l : 1 / 0, u.top), n.right = Math.max((s = n.right) !== null && s !== void 0 ? s : -1 / 0, u.right), n.bottom = Math.max((a = n.bottom) !== null && a !== void 0 ? a : -1 / 0, u.bottom);
    }
  }), n.width = n.right - n.left, n.height = n.bottom - n.top, n.x = n.left, n.y = n.top, n;
}
var q = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
function En() {
  var t = [], e;
  return {
    captureAnimationState: function() {
      if (t = [], !!this.options.animation) {
        var n = [].slice.call(this.el.children);
        n.forEach(function(r) {
          if (!(b(r, "display") === "none" || r === y.ghost)) {
            t.push({
              target: r,
              rect: H(r)
            });
            var o = re({}, t[t.length - 1].rect);
            if (r.thisAnimationDuration) {
              var l = De(r, !0);
              l && (o.top -= l.f, o.left -= l.e);
            }
            r.fromRect = o;
          }
        });
      }
    },
    addAnimationState: function(n) {
      t.push(n);
    },
    removeAnimationState: function(n) {
      t.splice(wn(t, {
        target: n
      }), 1);
    },
    animateAll: function(n) {
      var r = this;
      if (!this.options.animation) {
        clearTimeout(e), typeof n == "function" && n();
        return;
      }
      var o = !1, l = 0;
      t.forEach(function(s) {
        var a = 0, u = s.target, c = u.fromRect, h = H(u), g = u.prevFromRect, D = u.prevToRect, _ = s.rect, v = De(u, !0);
        v && (h.top -= v.f, h.left -= v.e), u.toRect = h, u.thisAnimationDuration && ht(g, h) && !ht(c, h) && // Make sure animatingRect is on line between toRect & fromRect
        (_.top - h.top) / (_.left - h.left) === (c.top - h.top) / (c.left - h.left) && (a = In(_, g, D, r.options)), ht(h, c) || (u.prevFromRect = c, u.prevToRect = h, a || (a = r.options.animation), r.animate(u, _, h, a)), a && (o = !0, l = Math.max(l, a), clearTimeout(u.animationResetTimer), u.animationResetTimer = setTimeout(function() {
          u.animationTime = 0, u.prevFromRect = null, u.fromRect = null, u.prevToRect = null, u.thisAnimationDuration = null;
        }, a), u.thisAnimationDuration = a);
      }), clearTimeout(e), o ? e = setTimeout(function() {
        typeof n == "function" && n();
      }, l) : typeof n == "function" && n(), t = [];
    },
    animate: function(n, r, o, l) {
      if (l) {
        b(n, "transition", ""), b(n, "transform", "");
        var s = De(this.el), a = s && s.a, u = s && s.d, c = (r.left - o.left) / (a || 1), h = (r.top - o.top) / (u || 1);
        n.animatingX = !!c, n.animatingY = !!h, b(n, "transform", "translate3d(" + c + "px," + h + "px,0)"), this.forRepaintDummy = Dn(n), b(n, "transition", "transform " + l + "ms" + (this.options.easing ? " " + this.options.easing : "")), b(n, "transform", "translate3d(0,0,0)"), typeof n.animated == "number" && clearTimeout(n.animated), n.animated = setTimeout(function() {
          b(n, "transition", ""), b(n, "transform", ""), n.animated = !1, n.animatingX = !1, n.animatingY = !1;
        }, l);
      }
    }
  };
}
function Dn(t) {
  return t.offsetWidth;
}
function In(t, e, i, n) {
  return Math.sqrt(Math.pow(e.top - t.top, 2) + Math.pow(e.left - t.left, 2)) / Math.sqrt(Math.pow(e.top - i.top, 2) + Math.pow(e.left - i.left, 2)) * n.animation;
}
var ye = [], pt = {
  initializeByDefault: !0
}, He = {
  mount: function(e) {
    for (var i in pt)
      pt.hasOwnProperty(i) && !(i in e) && (e[i] = pt[i]);
    ye.forEach(function(n) {
      if (n.pluginName === e.pluginName)
        throw "Sortable: Cannot mount plugin ".concat(e.pluginName, " more than once");
    }), ye.push(e);
  },
  pluginEvent: function(e, i, n) {
    var r = this;
    this.eventCanceled = !1, n.cancel = function() {
      r.eventCanceled = !0;
    };
    var o = e + "Global";
    ye.forEach(function(l) {
      i[l.pluginName] && (i[l.pluginName][o] && i[l.pluginName][o](re({
        sortable: i
      }, n)), i.options[l.pluginName] && i[l.pluginName][e] && i[l.pluginName][e](re({
        sortable: i
      }, n)));
    });
  },
  initializePlugins: function(e, i, n, r) {
    ye.forEach(function(s) {
      var a = s.pluginName;
      if (!(!e.options[a] && !s.initializeByDefault)) {
        var u = new s(e, i, e.options);
        u.sortable = e, u.options = e.options, e[a] = u, ae(n, u.defaults);
      }
    });
    for (var o in e.options)
      if (e.options.hasOwnProperty(o)) {
        var l = this.modifyOption(e, o, e.options[o]);
        typeof l < "u" && (e.options[o] = l);
      }
  },
  getEventProperties: function(e, i) {
    var n = {};
    return ye.forEach(function(r) {
      typeof r.eventProperties == "function" && ae(n, r.eventProperties.call(i[r.pluginName], e));
    }), n;
  },
  modifyOption: function(e, i, n) {
    var r;
    return ye.forEach(function(o) {
      e[o.pluginName] && o.optionListeners && typeof o.optionListeners[i] == "function" && (r = o.optionListeners[i].call(e[o.pluginName], n));
    }), r;
  }
};
function Tn(t) {
  var e = t.sortable, i = t.rootEl, n = t.name, r = t.targetEl, o = t.cloneEl, l = t.toEl, s = t.fromEl, a = t.oldIndex, u = t.newIndex, c = t.oldDraggableIndex, h = t.newDraggableIndex, g = t.originalEvent, D = t.putSortable, _ = t.extraEventProperties;
  if (e = e || i && i[q], !!e) {
    var v, T = e.options, $ = "on" + n.charAt(0).toUpperCase() + n.substr(1);
    window.CustomEvent && !se && !Re ? v = new CustomEvent(n, {
      bubbles: !0,
      cancelable: !0
    }) : (v = document.createEvent("Event"), v.initEvent(n, !0, !0)), v.to = l || i, v.from = s || i, v.item = r || i, v.clone = o, v.oldIndex = a, v.newIndex = u, v.oldDraggableIndex = c, v.newDraggableIndex = h, v.originalEvent = g, v.pullMode = D ? D.lastPutMode : void 0;
    var p = re(re({}, _), He.getEventProperties(n, e));
    for (var d in p)
      v[d] = p[d];
    i && i.dispatchEvent(v), T[$] && T[$].call(e, v);
  }
}
var Cn = ["evt"], U = function(e, i) {
  var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, r = n.evt, o = bn(n, Cn);
  He.pluginEvent.bind(y)(e, i, re({
    dragEl: f,
    parentEl: M,
    ghostEl: S,
    rootEl: k,
    nextEl: be,
    lastDownEl: qe,
    cloneEl: N,
    cloneHidden: fe,
    dragStarted: Ae,
    putSortable: Y,
    activeSortable: y.active,
    originalEvent: r,
    oldIndex: Ee,
    oldDraggableIndex: xe,
    newIndex: Q,
    newDraggableIndex: de,
    hideGhostForTarget: mi,
    unhideGhostForTarget: gi,
    cloneNowHidden: function() {
      fe = !0;
    },
    cloneNowShown: function() {
      fe = !1;
    },
    dispatchSortableEvent: function(s) {
      K({
        sortable: i,
        name: s,
        originalEvent: r
      });
    }
  }, o));
};
function K(t) {
  Tn(re({
    putSortable: Y,
    cloneEl: N,
    targetEl: f,
    rootEl: k,
    oldIndex: Ee,
    oldDraggableIndex: xe,
    newIndex: Q,
    newDraggableIndex: de
  }, t));
}
var f, M, S, k, be, qe, N, fe, Ee, Q, xe, de, Be, Y, _e = !1, nt = !1, rt = [], ge, te, mt, gt, Kt, Gt, Ae, we, Ve, Fe = !1, Ye = !1, Je, j, vt = [], Ot = !1, ot = [], st = typeof document < "u", Xe = Nt, Ut = Re || se ? "cssFloat" : "float", On = st && !ri && !Nt && "draggable" in document.createElement("div"), fi = function() {
  if (st) {
    if (se)
      return !1;
    var t = document.createElement("x");
    return t.style.cssText = "pointer-events:auto", t.style.pointerEvents === "auto";
  }
}(), hi = function(e, i) {
  var n = b(e), r = parseInt(n.width) - parseInt(n.paddingLeft) - parseInt(n.paddingRight) - parseInt(n.borderLeftWidth) - parseInt(n.borderRightWidth), o = Ie(e, 0, i), l = Ie(e, 1, i), s = o && b(o), a = l && b(l), u = s && parseInt(s.marginLeft) + parseInt(s.marginRight) + H(o).width, c = a && parseInt(a.marginLeft) + parseInt(a.marginRight) + H(l).width;
  if (n.display === "flex")
    return n.flexDirection === "column" || n.flexDirection === "column-reverse" ? "vertical" : "horizontal";
  if (n.display === "grid")
    return n.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
  if (o && s.float && s.float !== "none") {
    var h = s.float === "left" ? "left" : "right";
    return l && (a.clear === "both" || a.clear === h) ? "vertical" : "horizontal";
  }
  return o && (s.display === "block" || s.display === "flex" || s.display === "table" || s.display === "grid" || u >= r && n[Ut] === "none" || l && n[Ut] === "none" && u + c > r) ? "vertical" : "horizontal";
}, An = function(e, i, n) {
  var r = n ? e.left : e.top, o = n ? e.right : e.bottom, l = n ? e.width : e.height, s = n ? i.left : i.top, a = n ? i.right : i.bottom, u = n ? i.width : i.height;
  return r === s || o === a || r + l / 2 === s + u / 2;
}, zn = function(e, i) {
  var n;
  return rt.some(function(r) {
    var o = r[q].options.emptyInsertThreshold;
    if (!(!o || $t(r))) {
      var l = H(r), s = e >= l.left - o && e <= l.right + o, a = i >= l.top - o && i <= l.bottom + o;
      if (s && a)
        return n = r;
    }
  }), n;
}, pi = function(e) {
  function i(o, l) {
    return function(s, a, u, c) {
      var h = s.options.group.name && a.options.group.name && s.options.group.name === a.options.group.name;
      if (o == null && (l || h))
        return !0;
      if (o == null || o === !1)
        return !1;
      if (l && o === "clone")
        return o;
      if (typeof o == "function")
        return i(o(s, a, u, c), l)(s, a, u, c);
      var g = (l ? s : a).options.group.name;
      return o === !0 || typeof o == "string" && o === g || o.join && o.indexOf(g) > -1;
    };
  }
  var n = {}, r = e.group;
  (!r || Ue(r) != "object") && (r = {
    name: r
  }), n.name = r.name, n.checkPull = i(r.pull, !0), n.checkPut = i(r.put), n.revertClone = r.revertClone, e.group = n;
}, mi = function() {
  !fi && S && b(S, "display", "none");
}, gi = function() {
  !fi && S && b(S, "display", "");
};
st && !ri && document.addEventListener("click", function(t) {
  if (nt)
    return t.preventDefault(), t.stopPropagation && t.stopPropagation(), t.stopImmediatePropagation && t.stopImmediatePropagation(), nt = !1, !1;
}, !0);
var ve = function(e) {
  if (f) {
    e = e.touches ? e.touches[0] : e;
    var i = zn(e.clientX, e.clientY);
    if (i) {
      var n = {};
      for (var r in e)
        e.hasOwnProperty(r) && (n[r] = e[r]);
      n.target = n.rootEl = i, n.preventDefault = void 0, n.stopPropagation = void 0, i[q]._onDragOver(n);
    }
  }
}, kn = function(e) {
  f && f.parentNode[q]._isOutsideThisEl(e.target);
};
function y(t, e) {
  if (!(t && t.nodeType && t.nodeType === 1))
    throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));
  this.el = t, this.options = e = ae({}, e), t[q] = this;
  var i = {
    group: null,
    sort: !0,
    disabled: !1,
    store: null,
    handle: null,
    draggable: /^[uo]l$/i.test(t.nodeName) ? ">li" : ">*",
    swapThreshold: 1,
    // percentage; 0 <= x <= 1
    invertSwap: !1,
    // invert always
    invertedSwapThreshold: null,
    // will be set to same as swapThreshold if default
    removeCloneOnHide: !0,
    direction: function() {
      return hi(t, this.options);
    },
    ghostClass: "sortable-ghost",
    chosenClass: "sortable-chosen",
    dragClass: "sortable-drag",
    ignore: "a, img",
    filter: null,
    preventOnFilter: !0,
    animation: 0,
    easing: null,
    setData: function(l, s) {
      l.setData("Text", s.textContent);
    },
    dropBubble: !1,
    dragoverBubble: !1,
    dataIdAttr: "data-id",
    delay: 0,
    delayOnTouchOnly: !1,
    touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
    forceFallback: !1,
    fallbackClass: "sortable-fallback",
    fallbackOnBody: !1,
    fallbackTolerance: 0,
    fallbackOffset: {
      x: 0,
      y: 0
    },
    // Disabled on Safari: #1571; Enabled on Safari IOS: #2244
    supportPointer: y.supportPointer !== !1 && "PointerEvent" in window && (!$e || Nt),
    emptyInsertThreshold: 5
  };
  He.initializePlugins(this, t, i);
  for (var n in i)
    !(n in e) && (e[n] = i[n]);
  pi(e);
  for (var r in this)
    r.charAt(0) === "_" && typeof this[r] == "function" && (this[r] = this[r].bind(this));
  this.nativeDraggable = e.forceFallback ? !1 : On, this.nativeDraggable && (this.options.touchStartThreshold = 1), e.supportPointer ? O(t, "pointerdown", this._onTapStart) : (O(t, "mousedown", this._onTapStart), O(t, "touchstart", this._onTapStart)), this.nativeDraggable && (O(t, "dragover", this), O(t, "dragenter", this)), rt.push(this.el), e.store && e.store.get && this.sort(e.store.get(this) || []), ae(this, En());
}
y.prototype = /** @lends Sortable.prototype */
{
  constructor: y,
  _isOutsideThisEl: function(e) {
    !this.el.contains(e) && e !== this.el && (we = null);
  },
  _getDirection: function(e, i) {
    return typeof this.options.direction == "function" ? this.options.direction.call(this, e, i, f) : this.options.direction;
  },
  _onTapStart: function(e) {
    if (e.cancelable) {
      var i = this, n = this.el, r = this.options, o = r.preventOnFilter, l = e.type, s = e.touches && e.touches[0] || e.pointerType && e.pointerType === "touch" && e, a = (s || e).target, u = e.target.shadowRoot && (e.path && e.path[0] || e.composedPath && e.composedPath()[0]) || a, c = r.filter;
      if (Rn(n), !f && !(/mousedown|pointerdown/.test(l) && e.button !== 0 || r.disabled) && !u.isContentEditable && !(!this.nativeDraggable && $e && a && a.tagName.toUpperCase() === "SELECT") && (a = ie(a, r.draggable, n, !1), !(a && a.animated) && qe !== a)) {
        if (Ee = ee(a), xe = ee(a, r.draggable), typeof c == "function") {
          if (c.call(this, e, a, this)) {
            K({
              sortable: i,
              rootEl: u,
              name: "filter",
              targetEl: a,
              toEl: n,
              fromEl: n
            }), U("filter", i, {
              evt: e
            }), o && e.preventDefault();
            return;
          }
        } else if (c && (c = c.split(",").some(function(h) {
          if (h = ie(u, h.trim(), n, !1), h)
            return K({
              sortable: i,
              rootEl: h,
              name: "filter",
              targetEl: a,
              fromEl: n,
              toEl: n
            }), U("filter", i, {
              evt: e
            }), !0;
        }), c)) {
          o && e.preventDefault();
          return;
        }
        r.handle && !ie(u, r.handle, n, !1) || this._prepareDragStart(e, s, a);
      }
    }
  },
  _prepareDragStart: function(e, i, n) {
    var r = this, o = r.el, l = r.options, s = o.ownerDocument, a;
    if (n && !f && n.parentNode === o) {
      var u = H(n);
      if (k = o, f = n, M = f.parentNode, be = f.nextSibling, qe = n, Be = l.group, y.dragged = f, ge = {
        target: f,
        clientX: (i || e).clientX,
        clientY: (i || e).clientY
      }, Kt = ge.clientX - u.left, Gt = ge.clientY - u.top, this._lastX = (i || e).clientX, this._lastY = (i || e).clientY, f.style["will-change"] = "all", a = function() {
        if (U("delayEnded", r, {
          evt: e
        }), y.eventCanceled) {
          r._onDrop();
          return;
        }
        r._disableDelayedDragEvents(), !Yt && r.nativeDraggable && (f.draggable = !0), r._triggerDragStart(e, i), K({
          sortable: r,
          name: "choose",
          originalEvent: e
        }), Z(f, l.chosenClass, !0);
      }, l.ignore.split(",").forEach(function(c) {
        ai(f, c.trim(), bt);
      }), O(s, "dragover", ve), O(s, "mousemove", ve), O(s, "touchmove", ve), l.supportPointer ? (O(s, "pointerup", r._onDrop), !this.nativeDraggable && O(s, "pointercancel", r._onDrop)) : (O(s, "mouseup", r._onDrop), O(s, "touchend", r._onDrop), O(s, "touchcancel", r._onDrop)), Yt && this.nativeDraggable && (this.options.touchStartThreshold = 4, f.draggable = !0), U("delayStart", this, {
        evt: e
      }), l.delay && (!l.delayOnTouchOnly || i) && (!this.nativeDraggable || !(Re || se))) {
        if (y.eventCanceled) {
          this._onDrop();
          return;
        }
        l.supportPointer ? (O(s, "pointerup", r._disableDelayedDrag), O(s, "pointercancel", r._disableDelayedDrag)) : (O(s, "mouseup", r._disableDelayedDrag), O(s, "touchend", r._disableDelayedDrag), O(s, "touchcancel", r._disableDelayedDrag)), O(s, "mousemove", r._delayedDragTouchMoveHandler), O(s, "touchmove", r._delayedDragTouchMoveHandler), l.supportPointer && O(s, "pointermove", r._delayedDragTouchMoveHandler), r._dragStartTimer = setTimeout(a, l.delay);
      } else
        a();
    }
  },
  _delayedDragTouchMoveHandler: function(e) {
    var i = e.touches ? e.touches[0] : e;
    Math.max(Math.abs(i.clientX - this._lastX), Math.abs(i.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1)) && this._disableDelayedDrag();
  },
  _disableDelayedDrag: function() {
    f && bt(f), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents();
  },
  _disableDelayedDragEvents: function() {
    var e = this.el.ownerDocument;
    C(e, "mouseup", this._disableDelayedDrag), C(e, "touchend", this._disableDelayedDrag), C(e, "touchcancel", this._disableDelayedDrag), C(e, "pointerup", this._disableDelayedDrag), C(e, "pointercancel", this._disableDelayedDrag), C(e, "mousemove", this._delayedDragTouchMoveHandler), C(e, "touchmove", this._delayedDragTouchMoveHandler), C(e, "pointermove", this._delayedDragTouchMoveHandler);
  },
  _triggerDragStart: function(e, i) {
    i = i || e.pointerType == "touch" && e, !this.nativeDraggable || i ? this.options.supportPointer ? O(document, "pointermove", this._onTouchMove) : i ? O(document, "touchmove", this._onTouchMove) : O(document, "mousemove", this._onTouchMove) : (O(f, "dragend", this), O(k, "dragstart", this._onDragStart));
    try {
      document.selection ? Ze(function() {
        document.selection.empty();
      }) : window.getSelection().removeAllRanges();
    } catch {
    }
  },
  _dragStarted: function(e, i) {
    if (_e = !1, k && f) {
      U("dragStarted", this, {
        evt: i
      }), this.nativeDraggable && O(document, "dragover", kn);
      var n = this.options;
      !e && Z(f, n.dragClass, !1), Z(f, n.ghostClass, !0), y.active = this, e && this._appendGhost(), K({
        sortable: this,
        name: "start",
        originalEvent: i
      });
    } else
      this._nulling();
  },
  _emulateDragOver: function() {
    if (te) {
      this._lastX = te.clientX, this._lastY = te.clientY, mi();
      for (var e = document.elementFromPoint(te.clientX, te.clientY), i = e; e && e.shadowRoot && (e = e.shadowRoot.elementFromPoint(te.clientX, te.clientY), e !== i); )
        i = e;
      if (f.parentNode[q]._isOutsideThisEl(e), i)
        do {
          if (i[q]) {
            var n = void 0;
            if (n = i[q]._onDragOver({
              clientX: te.clientX,
              clientY: te.clientY,
              target: e,
              rootEl: i
            }), n && !this.options.dragoverBubble)
              break;
          }
          e = i;
        } while (i = li(i));
      gi();
    }
  },
  _onTouchMove: function(e) {
    if (ge) {
      var i = this.options, n = i.fallbackTolerance, r = i.fallbackOffset, o = e.touches ? e.touches[0] : e, l = S && De(S, !0), s = S && l && l.a, a = S && l && l.d, u = Xe && j && jt(j), c = (o.clientX - ge.clientX + r.x) / (s || 1) + (u ? u[0] - vt[0] : 0) / (s || 1), h = (o.clientY - ge.clientY + r.y) / (a || 1) + (u ? u[1] - vt[1] : 0) / (a || 1);
      if (!y.active && !_e) {
        if (n && Math.max(Math.abs(o.clientX - this._lastX), Math.abs(o.clientY - this._lastY)) < n)
          return;
        this._onDragStart(e, !0);
      }
      if (S) {
        l ? (l.e += c - (mt || 0), l.f += h - (gt || 0)) : l = {
          a: 1,
          b: 0,
          c: 0,
          d: 1,
          e: c,
          f: h
        };
        var g = "matrix(".concat(l.a, ",").concat(l.b, ",").concat(l.c, ",").concat(l.d, ",").concat(l.e, ",").concat(l.f, ")");
        b(S, "webkitTransform", g), b(S, "mozTransform", g), b(S, "msTransform", g), b(S, "transform", g), mt = c, gt = h, te = o;
      }
      e.cancelable && e.preventDefault();
    }
  },
  _appendGhost: function() {
    if (!S) {
      var e = this.options.fallbackOnBody ? document.body : k, i = H(f, !0, Xe, !0, e), n = this.options;
      if (Xe) {
        for (j = e; b(j, "position") === "static" && b(j, "transform") === "none" && j !== document; )
          j = j.parentNode;
        j !== document.body && j !== document.documentElement ? (j === document && (j = ne()), i.top += j.scrollTop, i.left += j.scrollLeft) : j = ne(), vt = jt(j);
      }
      S = f.cloneNode(!0), Z(S, n.ghostClass, !1), Z(S, n.fallbackClass, !0), Z(S, n.dragClass, !0), b(S, "transition", ""), b(S, "transform", ""), b(S, "box-sizing", "border-box"), b(S, "margin", 0), b(S, "top", i.top), b(S, "left", i.left), b(S, "width", i.width), b(S, "height", i.height), b(S, "opacity", "0.8"), b(S, "position", Xe ? "absolute" : "fixed"), b(S, "zIndex", "100000"), b(S, "pointerEvents", "none"), y.ghost = S, e.appendChild(S), b(S, "transform-origin", Kt / parseInt(S.style.width) * 100 + "% " + Gt / parseInt(S.style.height) * 100 + "%");
    }
  },
  _onDragStart: function(e, i) {
    var n = this, r = e.dataTransfer, o = n.options;
    if (U("dragStart", this, {
      evt: e
    }), y.eventCanceled) {
      this._onDrop();
      return;
    }
    U("setupClone", this), y.eventCanceled || (N = ci(f), N.removeAttribute("id"), N.draggable = !1, N.style["will-change"] = "", this._hideClone(), Z(N, this.options.chosenClass, !1), y.clone = N), n.cloneId = Ze(function() {
      U("clone", n), !y.eventCanceled && (n.options.removeCloneOnHide || k.insertBefore(N, f), n._hideClone(), K({
        sortable: n,
        name: "clone"
      }));
    }), !i && Z(f, o.dragClass, !0), i ? (nt = !0, n._loopId = setInterval(n._emulateDragOver, 50)) : (C(document, "mouseup", n._onDrop), C(document, "touchend", n._onDrop), C(document, "touchcancel", n._onDrop), r && (r.effectAllowed = "move", o.setData && o.setData.call(n, r, f)), O(document, "drop", n), b(f, "transform", "translateZ(0)")), _e = !0, n._dragStartId = Ze(n._dragStarted.bind(n, i, e)), O(document, "selectstart", n), Ae = !0, window.getSelection().removeAllRanges(), $e && b(document.body, "user-select", "none");
  },
  // Returns true - if no further action is needed (either inserted or another condition)
  _onDragOver: function(e) {
    var i = this.el, n = e.target, r, o, l, s = this.options, a = s.group, u = y.active, c = Be === a, h = s.sort, g = Y || u, D, _ = this, v = !1;
    if (Ot) return;
    function T(Te, bi) {
      U(Te, _, re({
        evt: e,
        isOwner: c,
        axis: D ? "vertical" : "horizontal",
        revert: l,
        dragRect: r,
        targetRect: o,
        canSort: h,
        fromSortable: g,
        target: n,
        completed: p,
        onMove: function(Vt, yi) {
          return We(k, i, f, r, Vt, H(Vt), e, yi);
        },
        changed: d
      }, bi));
    }
    function $() {
      T("dragOverAnimationCapture"), _.captureAnimationState(), _ !== g && g.captureAnimationState();
    }
    function p(Te) {
      return T("dragOverCompleted", {
        insertion: Te
      }), Te && (c ? u._hideClone() : u._showClone(_), _ !== g && (Z(f, Y ? Y.options.ghostClass : u.options.ghostClass, !1), Z(f, s.ghostClass, !0)), Y !== _ && _ !== y.active ? Y = _ : _ === y.active && Y && (Y = null), g === _ && (_._ignoreWhileAnimating = n), _.animateAll(function() {
        T("dragOverAnimationComplete"), _._ignoreWhileAnimating = null;
      }), _ !== g && (g.animateAll(), g._ignoreWhileAnimating = null)), (n === f && !f.animated || n === i && !n.animated) && (we = null), !s.dragoverBubble && !e.rootEl && n !== document && (f.parentNode[q]._isOutsideThisEl(e.target), !Te && ve(e)), !s.dragoverBubble && e.stopPropagation && e.stopPropagation(), v = !0;
    }
    function d() {
      Q = ee(f), de = ee(f, s.draggable), K({
        sortable: _,
        name: "change",
        toEl: i,
        newIndex: Q,
        newDraggableIndex: de,
        originalEvent: e
      });
    }
    if (e.preventDefault !== void 0 && e.cancelable && e.preventDefault(), n = ie(n, s.draggable, i, !0), T("dragOver"), y.eventCanceled) return v;
    if (f.contains(e.target) || n.animated && n.animatingX && n.animatingY || _._ignoreWhileAnimating === n)
      return p(!1);
    if (nt = !1, u && !s.disabled && (c ? h || (l = M !== k) : Y === this || (this.lastPutMode = Be.checkPull(this, u, f, e)) && a.checkPut(this, u, f, e))) {
      if (D = this._getDirection(e, n) === "vertical", r = H(f), T("dragOverValid"), y.eventCanceled) return v;
      if (l)
        return M = k, $(), this._hideClone(), T("revert"), y.eventCanceled || (be ? k.insertBefore(f, be) : k.appendChild(f)), p(!0);
      var m = $t(i, s.draggable);
      if (!m || Mn(e, D, this) && !m.animated) {
        if (m === f)
          return p(!1);
        if (m && i === e.target && (n = m), n && (o = H(n)), We(k, i, f, r, n, o, e, !!n) !== !1)
          return $(), m && m.nextSibling ? i.insertBefore(f, m.nextSibling) : i.appendChild(f), M = i, d(), p(!0);
      } else if (m && $n(e, D, this)) {
        var W = Ie(i, 0, s, !0);
        if (W === f)
          return p(!1);
        if (n = W, o = H(n), We(k, i, f, r, n, o, e, !1) !== !1)
          return $(), i.insertBefore(f, W), M = i, d(), p(!0);
      } else if (n.parentNode === i) {
        o = H(n);
        var w = 0, F, L = f.parentNode !== i, B = !An(f.animated && f.toRect || r, n.animated && n.toRect || o, D), I = D ? "top" : "left", x = Wt(n, "top", "top") || Wt(f, "top", "top"), P = x ? x.scrollTop : void 0;
        we !== n && (F = o[I], Fe = !1, Ye = !B && s.invertSwap || L), w = xn(e, n, o, D, B ? 1 : s.swapThreshold, s.invertedSwapThreshold == null ? s.swapThreshold : s.invertedSwapThreshold, Ye, we === n);
        var A;
        if (w !== 0) {
          var J = ee(f);
          do
            J -= w, A = M.children[J];
          while (A && (b(A, "display") === "none" || A === S));
        }
        if (w === 0 || A === n)
          return p(!1);
        we = n, Ve = w;
        var ue = n.nextElementSibling, V = !1;
        V = w === 1;
        var me = We(k, i, f, r, n, o, e, V);
        if (me !== !1)
          return (me === 1 || me === -1) && (V = me === 1), Ot = !0, setTimeout(Nn, 30), $(), V && !ue ? i.appendChild(f) : n.parentNode.insertBefore(f, V ? ue : n), x && ui(x, 0, P - x.scrollTop), M = f.parentNode, F !== void 0 && !Ye && (Je = Math.abs(F - H(n)[I])), d(), p(!0);
      }
      if (i.contains(f))
        return p(!1);
    }
    return !1;
  },
  _ignoreWhileAnimating: null,
  _offMoveEvents: function() {
    C(document, "mousemove", this._onTouchMove), C(document, "touchmove", this._onTouchMove), C(document, "pointermove", this._onTouchMove), C(document, "dragover", ve), C(document, "mousemove", ve), C(document, "touchmove", ve);
  },
  _offUpEvents: function() {
    var e = this.el.ownerDocument;
    C(e, "mouseup", this._onDrop), C(e, "touchend", this._onDrop), C(e, "pointerup", this._onDrop), C(e, "pointercancel", this._onDrop), C(e, "touchcancel", this._onDrop), C(document, "selectstart", this);
  },
  _onDrop: function(e) {
    var i = this.el, n = this.options;
    if (Q = ee(f), de = ee(f, n.draggable), U("drop", this, {
      evt: e
    }), M = f && f.parentNode, Q = ee(f), de = ee(f, n.draggable), y.eventCanceled) {
      this._nulling();
      return;
    }
    _e = !1, Ye = !1, Fe = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), At(this.cloneId), At(this._dragStartId), this.nativeDraggable && (C(document, "drop", this), C(i, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), $e && b(document.body, "user-select", ""), b(f, "transform", ""), e && (Ae && (e.cancelable && e.preventDefault(), !n.dropBubble && e.stopPropagation()), S && S.parentNode && S.parentNode.removeChild(S), (k === M || Y && Y.lastPutMode !== "clone") && N && N.parentNode && N.parentNode.removeChild(N), f && (this.nativeDraggable && C(f, "dragend", this), bt(f), f.style["will-change"] = "", Ae && !_e && Z(f, Y ? Y.options.ghostClass : this.options.ghostClass, !1), Z(f, this.options.chosenClass, !1), K({
      sortable: this,
      name: "unchoose",
      toEl: M,
      newIndex: null,
      newDraggableIndex: null,
      originalEvent: e
    }), k !== M ? (Q >= 0 && (K({
      rootEl: M,
      name: "add",
      toEl: M,
      fromEl: k,
      originalEvent: e
    }), K({
      sortable: this,
      name: "remove",
      toEl: M,
      originalEvent: e
    }), K({
      rootEl: M,
      name: "sort",
      toEl: M,
      fromEl: k,
      originalEvent: e
    }), K({
      sortable: this,
      name: "sort",
      toEl: M,
      originalEvent: e
    })), Y && Y.save()) : Q !== Ee && Q >= 0 && (K({
      sortable: this,
      name: "update",
      toEl: M,
      originalEvent: e
    }), K({
      sortable: this,
      name: "sort",
      toEl: M,
      originalEvent: e
    })), y.active && ((Q == null || Q === -1) && (Q = Ee, de = xe), K({
      sortable: this,
      name: "end",
      toEl: M,
      originalEvent: e
    }), this.save()))), this._nulling();
  },
  _nulling: function() {
    U("nulling", this), k = f = M = S = be = N = qe = fe = ge = te = Ae = Q = de = Ee = xe = we = Ve = Y = Be = y.dragged = y.ghost = y.clone = y.active = null, ot.forEach(function(e) {
      e.checked = !0;
    }), ot.length = mt = gt = 0;
  },
  handleEvent: function(e) {
    switch (e.type) {
      case "drop":
      case "dragend":
        this._onDrop(e);
        break;
      case "dragenter":
      case "dragover":
        f && (this._onDragOver(e), Pn(e));
        break;
      case "selectstart":
        e.preventDefault();
        break;
    }
  },
  /**
   * Serializes the item into an array of string.
   * @returns {String[]}
   */
  toArray: function() {
    for (var e = [], i, n = this.el.children, r = 0, o = n.length, l = this.options; r < o; r++)
      i = n[r], ie(i, l.draggable, this.el, !1) && e.push(i.getAttribute(l.dataIdAttr) || Fn(i));
    return e;
  },
  /**
   * Sorts the elements according to the array.
   * @param  {String[]}  order  order of the items
   */
  sort: function(e, i) {
    var n = {}, r = this.el;
    this.toArray().forEach(function(o, l) {
      var s = r.children[l];
      ie(s, this.options.draggable, r, !1) && (n[o] = s);
    }, this), i && this.captureAnimationState(), e.forEach(function(o) {
      n[o] && (r.removeChild(n[o]), r.appendChild(n[o]));
    }), i && this.animateAll();
  },
  /**
   * Save the current sorting
   */
  save: function() {
    var e = this.options.store;
    e && e.set && e.set(this);
  },
  /**
   * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
   * @param   {HTMLElement}  el
   * @param   {String}       [selector]  default: `options.draggable`
   * @returns {HTMLElement|null}
   */
  closest: function(e, i) {
    return ie(e, i || this.options.draggable, this.el, !1);
  },
  /**
   * Set/get option
   * @param   {string} name
   * @param   {*}      [value]
   * @returns {*}
   */
  option: function(e, i) {
    var n = this.options;
    if (i === void 0)
      return n[e];
    var r = He.modifyOption(this, e, i);
    typeof r < "u" ? n[e] = r : n[e] = i, e === "group" && pi(n);
  },
  /**
   * Destroy
   */
  destroy: function() {
    U("destroy", this);
    var e = this.el;
    e[q] = null, C(e, "mousedown", this._onTapStart), C(e, "touchstart", this._onTapStart), C(e, "pointerdown", this._onTapStart), this.nativeDraggable && (C(e, "dragover", this), C(e, "dragenter", this)), Array.prototype.forEach.call(e.querySelectorAll("[draggable]"), function(i) {
      i.removeAttribute("draggable");
    }), this._onDrop(), this._disableDelayedDragEvents(), rt.splice(rt.indexOf(this.el), 1), this.el = e = null;
  },
  _hideClone: function() {
    if (!fe) {
      if (U("hideClone", this), y.eventCanceled) return;
      b(N, "display", "none"), this.options.removeCloneOnHide && N.parentNode && N.parentNode.removeChild(N), fe = !0;
    }
  },
  _showClone: function(e) {
    if (e.lastPutMode !== "clone") {
      this._hideClone();
      return;
    }
    if (fe) {
      if (U("showClone", this), y.eventCanceled) return;
      f.parentNode == k && !this.options.group.revertClone ? k.insertBefore(N, f) : be ? k.insertBefore(N, be) : k.appendChild(N), this.options.group.revertClone && this.animate(f, N), b(N, "display", ""), fe = !1;
    }
  }
};
function Pn(t) {
  t.dataTransfer && (t.dataTransfer.dropEffect = "move"), t.cancelable && t.preventDefault();
}
function We(t, e, i, n, r, o, l, s) {
  var a, u = t[q], c = u.options.onMove, h;
  return window.CustomEvent && !se && !Re ? a = new CustomEvent("move", {
    bubbles: !0,
    cancelable: !0
  }) : (a = document.createEvent("Event"), a.initEvent("move", !0, !0)), a.to = e, a.from = t, a.dragged = i, a.draggedRect = n, a.related = r || e, a.relatedRect = o || H(e), a.willInsertAfter = s, a.originalEvent = l, t.dispatchEvent(a), c && (h = c.call(u, a, l)), h;
}
function bt(t) {
  t.draggable = !1;
}
function Nn() {
  Ot = !1;
}
function $n(t, e, i) {
  var n = H(Ie(i.el, 0, i.options, !0)), r = di(i.el, i.options, S), o = 10;
  return e ? t.clientX < r.left - o || t.clientY < n.top && t.clientX < n.right : t.clientY < r.top - o || t.clientY < n.bottom && t.clientX < n.left;
}
function Mn(t, e, i) {
  var n = H($t(i.el, i.options.draggable)), r = di(i.el, i.options, S), o = 10;
  return e ? t.clientX > r.right + o || t.clientY > n.bottom && t.clientX > n.left : t.clientY > r.bottom + o || t.clientX > n.right && t.clientY > n.top;
}
function xn(t, e, i, n, r, o, l, s) {
  var a = n ? t.clientY : t.clientX, u = n ? i.height : i.width, c = n ? i.top : i.left, h = n ? i.bottom : i.right, g = !1;
  if (!l) {
    if (s && Je < u * r) {
      if (!Fe && (Ve === 1 ? a > c + u * o / 2 : a < h - u * o / 2) && (Fe = !0), Fe)
        g = !0;
      else if (Ve === 1 ? a < c + Je : a > h - Je)
        return -Ve;
    } else if (a > c + u * (1 - r) / 2 && a < h - u * (1 - r) / 2)
      return Vn(e);
  }
  return g = g || l, g && (a < c + u * o / 2 || a > h - u * o / 2) ? a > c + u / 2 ? 1 : -1 : 0;
}
function Vn(t) {
  return ee(f) < ee(t) ? 1 : -1;
}
function Fn(t) {
  for (var e = t.tagName + t.className + t.src + t.href + t.textContent, i = e.length, n = 0; i--; )
    n += e.charCodeAt(i);
  return n.toString(36);
}
function Rn(t) {
  ot.length = 0;
  for (var e = t.getElementsByTagName("input"), i = e.length; i--; ) {
    var n = e[i];
    n.checked && ot.push(n);
  }
}
function Ze(t) {
  return setTimeout(t, 0);
}
function At(t) {
  return clearTimeout(t);
}
st && O(document, "touchmove", function(t) {
  (y.active || _e) && t.cancelable && t.preventDefault();
});
y.utils = {
  on: O,
  off: C,
  css: b,
  find: ai,
  is: function(e, i) {
    return !!ie(e, i, e, !1);
  },
  extend: Sn,
  throttle: si,
  closest: ie,
  toggleClass: Z,
  clone: ci,
  index: ee,
  nextTick: Ze,
  cancelNextTick: At,
  detectDirection: hi,
  getChild: Ie,
  expando: q
};
y.get = function(t) {
  return t[q];
};
y.mount = function() {
  for (var t = arguments.length, e = new Array(t), i = 0; i < t; i++)
    e[i] = arguments[i];
  e[0].constructor === Array && (e = e[0]), e.forEach(function(n) {
    if (!n.prototype || !n.prototype.constructor)
      throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(n));
    n.utils && (y.utils = re(re({}, y.utils), n.utils)), He.mount(n);
  });
};
y.create = function(t, e) {
  return new y(t, e);
};
y.version = yn;
var R = [], ze, zt, kt = !1, yt, wt, lt, ke;
function Hn() {
  function t() {
    this.defaults = {
      scroll: !0,
      forceAutoScrollFallback: !1,
      scrollSensitivity: 30,
      scrollSpeed: 10,
      bubbleScroll: !0
    };
    for (var e in this)
      e.charAt(0) === "_" && typeof this[e] == "function" && (this[e] = this[e].bind(this));
  }
  return t.prototype = {
    dragStarted: function(i) {
      var n = i.originalEvent;
      this.sortable.nativeDraggable ? O(document, "dragover", this._handleAutoScroll) : this.options.supportPointer ? O(document, "pointermove", this._handleFallbackAutoScroll) : n.touches ? O(document, "touchmove", this._handleFallbackAutoScroll) : O(document, "mousemove", this._handleFallbackAutoScroll);
    },
    dragOverCompleted: function(i) {
      var n = i.originalEvent;
      !this.options.dragOverBubble && !n.rootEl && this._handleAutoScroll(n);
    },
    drop: function() {
      this.sortable.nativeDraggable ? C(document, "dragover", this._handleAutoScroll) : (C(document, "pointermove", this._handleFallbackAutoScroll), C(document, "touchmove", this._handleFallbackAutoScroll), C(document, "mousemove", this._handleFallbackAutoScroll)), qt(), Qe(), _n();
    },
    nulling: function() {
      lt = zt = ze = kt = ke = yt = wt = null, R.length = 0;
    },
    _handleFallbackAutoScroll: function(i) {
      this._handleAutoScroll(i, !0);
    },
    _handleAutoScroll: function(i, n) {
      var r = this, o = (i.touches ? i.touches[0] : i).clientX, l = (i.touches ? i.touches[0] : i).clientY, s = document.elementFromPoint(o, l);
      if (lt = i, n || this.options.forceAutoScrollFallback || Re || se || $e) {
        St(i, this.options, s, n);
        var a = pe(s, !0);
        kt && (!ke || o !== yt || l !== wt) && (ke && qt(), ke = setInterval(function() {
          var u = pe(document.elementFromPoint(o, l), !0);
          u !== a && (a = u, Qe()), St(i, r.options, u, n);
        }, 10), yt = o, wt = l);
      } else {
        if (!this.options.bubbleScroll || pe(s, !0) === ne()) {
          Qe();
          return;
        }
        St(i, this.options, pe(s, !1), !1);
      }
    }
  }, ae(t, {
    pluginName: "scroll",
    initializeByDefault: !0
  });
}
function Qe() {
  R.forEach(function(t) {
    clearInterval(t.pid);
  }), R = [];
}
function qt() {
  clearInterval(ke);
}
var St = si(function(t, e, i, n) {
  if (e.scroll) {
    var r = (t.touches ? t.touches[0] : t).clientX, o = (t.touches ? t.touches[0] : t).clientY, l = e.scrollSensitivity, s = e.scrollSpeed, a = ne(), u = !1, c;
    zt !== i && (zt = i, Qe(), ze = e.scroll, c = e.scrollFn, ze === !0 && (ze = pe(i, !0)));
    var h = 0, g = ze;
    do {
      var D = g, _ = H(D), v = _.top, T = _.bottom, $ = _.left, p = _.right, d = _.width, m = _.height, W = void 0, w = void 0, F = D.scrollWidth, L = D.scrollHeight, B = b(D), I = D.scrollLeft, x = D.scrollTop;
      D === a ? (W = d < F && (B.overflowX === "auto" || B.overflowX === "scroll" || B.overflowX === "visible"), w = m < L && (B.overflowY === "auto" || B.overflowY === "scroll" || B.overflowY === "visible")) : (W = d < F && (B.overflowX === "auto" || B.overflowX === "scroll"), w = m < L && (B.overflowY === "auto" || B.overflowY === "scroll"));
      var P = W && (Math.abs(p - r) <= l && I + d < F) - (Math.abs($ - r) <= l && !!I), A = w && (Math.abs(T - o) <= l && x + m < L) - (Math.abs(v - o) <= l && !!x);
      if (!R[h])
        for (var J = 0; J <= h; J++)
          R[J] || (R[J] = {});
      (R[h].vx != P || R[h].vy != A || R[h].el !== D) && (R[h].el = D, R[h].vx = P, R[h].vy = A, clearInterval(R[h].pid), (P != 0 || A != 0) && (u = !0, R[h].pid = setInterval((function() {
        n && this.layer === 0 && y.active._onTouchMove(lt);
        var ue = R[this.layer].vy ? R[this.layer].vy * s : 0, V = R[this.layer].vx ? R[this.layer].vx * s : 0;
        typeof c == "function" && c.call(y.dragged.parentNode[q], V, ue, t, lt, R[this.layer].el) !== "continue" || ui(R[this.layer].el, V, ue);
      }).bind({
        layer: h
      }), 24))), h++;
    } while (e.bubbleScroll && g !== a && (g = pe(g, !1)));
    kt = u;
  }
}, 30), vi = function(e) {
  var i = e.originalEvent, n = e.putSortable, r = e.dragEl, o = e.activeSortable, l = e.dispatchSortableEvent, s = e.hideGhostForTarget, a = e.unhideGhostForTarget;
  if (i) {
    var u = n || o;
    s();
    var c = i.changedTouches && i.changedTouches.length ? i.changedTouches[0] : i, h = document.elementFromPoint(c.clientX, c.clientY);
    a(), u && !u.el.contains(h) && (l("spill"), this.onSpill({
      dragEl: r,
      putSortable: n
    }));
  }
};
function Mt() {
}
Mt.prototype = {
  startIndex: null,
  dragStart: function(e) {
    var i = e.oldDraggableIndex;
    this.startIndex = i;
  },
  onSpill: function(e) {
    var i = e.dragEl, n = e.putSortable;
    this.sortable.captureAnimationState(), n && n.captureAnimationState();
    var r = Ie(this.sortable.el, this.startIndex, this.options);
    r ? this.sortable.el.insertBefore(i, r) : this.sortable.el.appendChild(i), this.sortable.animateAll(), n && n.animateAll();
  },
  drop: vi
};
ae(Mt, {
  pluginName: "revertOnSpill"
});
function xt() {
}
xt.prototype = {
  onSpill: function(e) {
    var i = e.dragEl, n = e.putSortable, r = n || this.sortable;
    r.captureAnimationState(), i.parentNode && i.parentNode.removeChild(i), r.animateAll();
  },
  drop: vi
};
ae(xt, {
  pluginName: "removeOnSpill"
});
y.mount(new Hn());
y.mount(xt, Mt);
const Ln = (t, e, i, n) => {
  const r = Qt(t, "dragSort");
  let o = null, l = Pe(0);
  Rt(
    r,
    (u) => {
      et(() => {
        u ? s() : a();
      });
    },
    {
      immediate: !0
    }
  ), Rt(n, (u, c) => {
    et(() => {
      r.value ? s() : a();
    });
  });
  const s = () => {
    const u = i.value;
    u.style.cursor = "move", o = y.create(u, {
      draggable: ".selected-item.enable",
      //指定样式类的元素才允许拖动
      animation: 300,
      //过渡动画时间
      //拖拽结束时事件
      onEnd: (c) => {
        const h = JSON.parse(JSON.stringify(n.value)), g = JSON.parse(JSON.stringify(n.value));
        g.splice(c.oldIndex, 1)[0];
        const D = h[c.oldIndex];
        g.splice(c.newIndex, 0, D), e("update:modelValue", g), l.value = Date.now(), e("sortEnd", h, g, c.oldIndex, c.newIndex);
      }
    });
  }, a = () => {
    const u = i.value;
    u.style.cursor = "default", o == null || o.option("disabled", !0);
  };
  return { timeStamp: l };
}, Bn = {
  key: 0,
  class: "selected-number-header"
}, Yn = { class: "selected-num" }, Xn = ["onClick"], Wn = { class: "name" }, jn = ["onClick"], Kn = { class: "name" }, Gn = ["infinite-scroll-disabled"], Un = { class: "selected-group" }, qn = ["onClick"], Jn = { class: "name" }, Zn = /* @__PURE__ */ Mi({
  __name: "Index",
  props: {
    width: { default: "100%" },
    height: { default: "100%" },
    modelValue: {},
    selectdValue: { default: "" },
    valueKey: { default: "id" },
    labelKey: { default: "name" },
    customStyle: {},
    dragSort: { type: Boolean },
    isView: { type: Boolean },
    closeable: { type: [Boolean, Function], default: !0 },
    clearable: { type: Boolean, default: !0 },
    customTitle: { default: "" },
    selectedNum: {},
    props: { default: { disabled: "disabled" } },
    virtual: { type: Boolean, default: !0 },
    itemHeight: { default: 32 },
    infiniteScroll: {},
    infiniteDisabled: { type: Boolean, default: !0 },
    hideHeader: { type: Boolean, default: !1 }
  },
  emits: ["update:modelValue", "update:selectdValue", "select-item", "item-remove", "remove-all", "sortEnd", "update:infiniteDisabled"],
  setup(t, { expose: e, emit: i }) {
    xi((d) => ({
      "29d24cb2": o.value
    }));
    const n = t, r = i, o = Ne(() => n.itemHeight + "px"), l = Ne(() => n.dragSort || n.infiniteScroll ? !1 : n.virtual), {
      selectListRef: s,
      $list: a,
      disabledFlag: u,
      itemGroups: c,
      selectedLabel: h,
      itemRemove: g,
      removeAll: D,
      innerSelectdValue: _,
      selectItem: v,
      infiniteLoad: T,
      closeableFn: $
    } = mn(n, r);
    Ln(n, r, a, c);
    const p = Pe(!0);
    return Zt(() => {
      p.value = !1, setTimeout(() => {
        p.value = !0;
      }, 300);
    }), e({
      infiniteLoad: T
    }), (d, m) => {
      const W = Ei;
      return z(), X(
        "div",
        {
          ref_key: "selectListRef",
          ref: s,
          class: "das-ui-select-list",
          style: Jt({ width: d.width, height: d.height, ...d.customStyle })
        },
        [
          he(d.$slots, "header", {}, () => [
            d.hideHeader ? G("v-if", !0) : (z(), X("div", Bn, [
              Ce(
                "div",
                Yn,
                Oe(E(h)),
                1
                /* TEXT */
              ),
              !d.isView && d.clearable ? (z(), oe(E(Vi), {
                key: 0,
                "btn-type": "primary-text",
                block: "",
                onClick: E(D),
                disabled: !E(c) || !E(c).length
              }, {
                default: tt(() => [
                  Le(
                    Oe(E(je)("das-select-list-removeAll").value),
                    1
                    /* TEXT */
                  )
                ]),
                _: 1
                /* STABLE */
              }, 8, ["onClick", "disabled"])) : G("v-if", !0)
            ]))
          ], !0),
          G(" 普通 "),
          !d.infiniteScroll && !l.value ? Se((z(), X(
            "div",
            {
              key: 0,
              ref_key: "$list",
              ref: a,
              class: ce(["selected-container", { "hide-header": d.hideHeader }])
            },
            [
              (z(!0), X(
                _t,
                null,
                Et(E(c), (w, F) => (z(), X("div", {
                  class: ce({
                    "selected-item": !0,
                    disabled: !d.isView && E(u)(w),
                    enable: !d.isView && !E(u)(w),
                    active: E(_) === w[d.valueKey]
                  }),
                  key: w[d.valueKey] + F,
                  onClick: (L) => E(v)(w)
                }, [
                  d.dragSort ? (z(), oe(E(Ri), {
                    key: 0,
                    class: "drag-icon",
                    size: "medium",
                    style: { "margin-right": "8px" }
                  })) : G("v-if", !0),
                  Ce("div", Wn, [
                    he(d.$slots, "default", { item: w }, () => [
                      Se((z(), X("div", null, [
                        Le(
                          Oe(w[d.labelKey]),
                          1
                          /* TEXT */
                        )
                      ])), [
                        [E(ct)]
                      ])
                    ], !0)
                  ]),
                  !d.isView && E($)(w) ? (z(), oe(E(dt), {
                    key: 1,
                    size: "small",
                    class: "close-icon",
                    "icon-color": E(ut)("--das-ui-color-secondary"),
                    onClick: (L) => E(g)(w)
                  }, null, 8, ["icon-color", "onClick"])) : G("v-if", !0)
                ], 10, Xn))),
                128
                /* KEYED_FRAGMENT */
              ))
            ],
            2
            /* CLASS */
          )), [
            [E(Fi), { usePrevOverlay: !0 }]
          ]) : G("v-if", !0),
          G(" 虚拟滚动 "),
          !d.dragSort && l.value ? (z(), X(
            "div",
            {
              key: 1,
              ref_key: "$list",
              ref: a,
              class: ce(["selected-container", { "hide-header": d.hideHeader }])
            },
            [
              p.value && E(c).length > 0 ? (z(), oe(E(Pt), {
                key: E(c).length,
                items: E(c),
                "item-size": d.itemHeight,
                "key-field": d.valueKey,
                class: "virtual-list"
              }, {
                default: tt(({ item: w, index: F }) => [
                  (z(), X("div", {
                    class: ce({
                      "selected-item": !0,
                      disabled: !d.isView && E(u)(w),
                      enable: !d.isView && !E(u)(w),
                      active: E(_) === w[d.valueKey]
                    }),
                    key: w[d.valueKey],
                    onClick: (L) => E(v)(w)
                  }, [
                    Ce("div", Kn, [
                      he(d.$slots, "default", { item: w }, () => [
                        Se((z(), X("div", null, [
                          Le(
                            Oe(w[d.labelKey]),
                            1
                            /* TEXT */
                          )
                        ])), [
                          [E(ct)]
                        ])
                      ], !0)
                    ]),
                    !d.isView && E($)(w) ? (z(), oe(E(dt), {
                      key: 0,
                      size: "small",
                      class: "close-icon",
                      "icon-color": E(ut)("--das-ui-color-secondary"),
                      onClick: (L) => E(g)(w)
                    }, null, 8, ["icon-color", "onClick"])) : G("v-if", !0)
                  ], 10, jn))
                ]),
                _: 3
                /* FORWARDED */
              }, 8, ["items", "item-size", "key-field"])) : G("v-if", !0)
            ],
            2
            /* CLASS */
          )) : G("v-if", !0),
          G(" 分页加载 "),
          !d.dragSort && d.infiniteScroll ? Se((z(), X("div", {
            key: 2,
            ref_key: "$list",
            ref: a,
            class: ce(["selected-container selected-page-container", { "hide-header": d.hideHeader }]),
            "infinite-scroll-disabled": d.infiniteDisabled,
            style: { overflow: "overlay" }
          }, [
            Ce("div", Un, [
              (z(!0), X(
                _t,
                null,
                Et(E(c), (w) => (z(), X("div", {
                  class: ce({
                    "selected-item": !0,
                    disabled: !d.isView && E(u)(w),
                    enable: !d.isView && !E(u)(w),
                    active: E(_) === w[d.valueKey]
                  }),
                  key: w[d.valueKey],
                  onClick: (F) => E(v)(w)
                }, [
                  Ce("div", Jn, [
                    he(d.$slots, "default", { item: w }, () => [
                      Se((z(), X("div", null, [
                        Le(
                          Oe(w[d.labelKey]),
                          1
                          /* TEXT */
                        )
                      ])), [
                        [E(ct)]
                      ])
                    ], !0)
                  ]),
                  !d.isView && E($)(w) ? (z(), oe(E(dt), {
                    key: 0,
                    size: "small",
                    class: "close-icon",
                    "icon-color": E(ut)("--das-ui-color-secondary"),
                    onClick: (F) => E(g)(w)
                  }, null, 8, ["icon-color", "onClick"])) : G("v-if", !0)
                ], 10, qn))),
                128
                /* KEYED_FRAGMENT */
              ))
            ])
          ], 10, Gn)), [
            [W, E(T)]
          ]) : G("v-if", !0)
        ],
        4
        /* STYLE */
      );
    };
  }
}), Qn = (t, e) => {
  const i = t.__vccOpts || t;
  for (const [n, r] of e)
    i[n] = r;
  return i;
}, er = /* @__PURE__ */ Qn(Zn, [["__scopeId", "data-v-ef9fb494"]]), tr = {
  "das-select-list-removeAll": { "zh-CN": "清空", en: "Clear", _appCode: "framework" },
  "das-select-list-selected": { "zh-CN": "已选", en: "Selected", _appCode: "framework" },
  "das-select-list-parentheses-left": { "zh-CN": "（", en: "(", _appCode: "framework" },
  "das-select-list-parentheses-right": { "zh-CN": "）", en: ")", _appCode: "framework" }
}, ir = {
  "--das-ui-select-list-hover-bg": { light: "#F2F2F2" },
  "--das-ui-select-list-close-btn-hover": { light: "#5582F3" },
  "--das-ui-select-list-active-bg-color": "#E3EBFF",
  "--das-ui-select-list-active-font-color": "#5582F3"
}, wr = wi(er);
Si(tr);
_i(ir);
export {
  wr as DasSelectList,
  wr as default
};
