import { lF as e, mD as t, lH as n } from "./ant-design-icons-6bfdc7d5.js";
import { c as i, b as o, _ as r, g as a, h as s, d as l, j as c } from "./antd-2abdded3.js";
import { createContext as d, createRef as h, createElement as u, Component as f } from "react";
import { findDOMNode as p } from "react-dom";
import { g } from "./alasql-f60045ee.js";
import { P as y } from "./fontawesome-3904a214.js";
function v(t2) {
  for (var n2 = 1; n2 < arguments.length; n2++) {
    var i2 = null != arguments[n2] ? Object(arguments[n2]) : {}, o2 = Object.keys(i2);
    "function" == typeof Object.getOwnPropertySymbols && o2.push.apply(o2, Object.getOwnPropertySymbols(i2).filter(function(e2) {
      return Object.getOwnPropertyDescriptor(i2, e2).enumerable;
    })), o2.forEach(function(n3) {
      e(t2, n3, i2[n3]);
    });
  }
  return t2;
}
const m = g(function(e2, t2, n2, i2, o2, r2, a2, s2) {
  if ("production" !== process.env.NODE_ENV && void 0 === t2)
    throw new Error("invariant requires an error message argument");
  if (!e2) {
    var l2;
    if (void 0 === t2)
      l2 = new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");
    else {
      var c2 = [n2, i2, o2, r2, a2, s2], d2 = 0;
      (l2 = new Error(t2.replace(/%s/g, function() {
        return c2[d2++];
      }))).name = "Invariant Violation";
    }
    throw l2.framesToPop = 1, l2;
  }
});
var x = function() {
  function t2() {
    o(this, t2), e(this, "refs", {});
  }
  return i(t2, [{ key: "add", value: function(e2, t3) {
    this.refs[e2] || (this.refs[e2] = []), this.refs[e2].push(t3);
  } }, { key: "remove", value: function(e2, t3) {
    var n2 = this.getIndex(e2, t3);
    -1 !== n2 && this.refs[e2].splice(n2, 1);
  } }, { key: "isActive", value: function() {
    return this.active;
  } }, { key: "getActive", value: function() {
    var e2 = this;
    return this.refs[this.active.collection].find(function(t3) {
      return t3.node.sortableInfo.index == e2.active.index;
    });
  } }, { key: "getIndex", value: function(e2, t3) {
    return this.refs[e2].indexOf(t3);
  } }, { key: "getOrderedRefs", value: function() {
    var e2 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.active.collection;
    return this.refs[e2].sort(w);
  } }]), t2;
}();
function w(e2, t2) {
  return e2.node.sortableInfo.index - t2.node.sortableInfo.index;
}
function b(e2, t2, n2) {
  return process.env.NODE_ENV, (e2 = e2.slice()).splice(n2 < 0 ? e2.length + n2 : n2, 0, e2.splice(t2, 1)[0]), e2;
}
function S(e2, t2) {
  return Object.keys(e2).reduce(function(n2, i2) {
    return -1 === t2.indexOf(i2) && (n2[i2] = e2[i2]), n2;
  }, {});
}
var O = { end: ["touchend", "touchcancel", "mouseup"], move: ["touchmove", "mousemove"], start: ["touchstart", "mousedown"] }, T = function() {
  if ("undefined" == typeof window || "undefined" == typeof document)
    return "";
  var e2 = window.getComputedStyle(document.documentElement, "") || ["-moz-hidden-iframe"], t2 = (Array.prototype.slice.call(e2).join("").match(/-(moz|webkit|ms)-/) || "" === e2.OLink && ["", "o"])[1];
  return "ms" === t2 ? "ms" : t2 && t2.length ? t2[0].toUpperCase() + t2.substr(1) : "";
}();
function C(e2, t2) {
  Object.keys(t2).forEach(function(n2) {
    e2.style[n2] = t2[n2];
  });
}
function I(e2, t2) {
  e2.style["".concat(T, "Transform")] = null == t2 ? "" : "translate3d(".concat(t2.x, "px,").concat(t2.y, "px,0)");
}
function k(e2, t2) {
  e2.style["".concat(T, "TransitionDuration")] = null == t2 ? "" : "".concat(t2, "ms");
}
function E(e2, t2) {
  for (; e2; ) {
    if (t2(e2))
      return e2;
    e2 = e2.parentNode;
  }
  return null;
}
function D(e2, t2, n2) {
  return Math.max(e2, Math.min(n2, t2));
}
function R(e2) {
  return "px" === e2.substr(-2) ? parseFloat(e2) : 0;
}
function N(e2, t2) {
  var n2 = t2.displayName || t2.name;
  return n2 ? "".concat(e2, "(").concat(n2, ")") : e2;
}
function A(e2, t2) {
  var n2 = e2.getBoundingClientRect();
  return { top: n2.top + t2.top, left: n2.left + t2.left };
}
function W(e2) {
  return e2.touches && e2.touches.length ? { x: e2.touches[0].pageX, y: e2.touches[0].pageY } : e2.changedTouches && e2.changedTouches.length ? { x: e2.changedTouches[0].pageX, y: e2.changedTouches[0].pageY } : { x: e2.pageX, y: e2.pageY };
}
function M(e2, t2) {
  var n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : { left: 0, top: 0 };
  if (e2) {
    var i2 = { left: n2.left + e2.offsetLeft, top: n2.top + e2.offsetTop };
    return e2.parentNode === t2 ? i2 : M(e2.parentNode, t2, i2);
  }
}
function L(e2) {
  var t2 = e2.lockOffset, n2 = e2.width, i2 = e2.height, o2 = t2, r2 = t2, a2 = "px";
  if ("string" == typeof t2) {
    var s2 = /^[+-]?\d*(?:\.\d*)?(px|%)$/.exec(t2);
    m(null !== s2, 'lockOffset value should be a number or a string of a number followed by "px" or "%". Given %s', t2), o2 = parseFloat(t2), r2 = parseFloat(t2), a2 = s2[1];
  }
  return m(isFinite(o2) && isFinite(r2), "lockOffset value should be a finite. Given %s", t2), "%" === a2 && (o2 = o2 * n2 / 100, r2 = r2 * i2 / 100), { x: o2, y: r2 };
}
function H(e2) {
  return e2 instanceof HTMLElement ? function(e3) {
    var t2 = window.getComputedStyle(e3), n2 = /(auto|scroll)/;
    return ["overflow", "overflowX", "overflowY"].find(function(e4) {
      return n2.test(t2[e4]);
    });
  }(e2) ? e2 : H(e2.parentNode) : null;
}
var K = 27, P = 32, j = 37, G = 38, B = 39, X = 40, _ = { Anchor: "A", Button: "BUTTON", Canvas: "CANVAS", Input: "INPUT", Option: "OPTION", Textarea: "TEXTAREA", Select: "SELECT" };
function F(n2) {
  var c2, d2, g2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : { withRef: false };
  return d2 = c2 = function(c3) {
    function d3() {
      var t2, n3;
      o(this, d3);
      for (var i2 = arguments.length, r2 = new Array(i2), c4 = 0; c4 < i2; c4++)
        r2[c4] = arguments[c4];
      return n3 = a(this, (t2 = s(d3)).call.apply(t2, [this].concat(r2))), e(l(l(n3)), "wrappedInstance", h()), n3;
    }
    return r(d3, f), i(d3, [{ key: "componentDidMount", value: function() {
      p(this).sortableHandle = true;
    } }, { key: "getWrappedInstance", value: function() {
      return m(g2.withRef, "To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableHandle() call"), this.wrappedInstance.current;
    } }, { key: "render", value: function() {
      var e2 = g2.withRef ? this.wrappedInstance : null;
      return u(n2, t({ ref: e2 }, this.props));
    } }]), d3;
  }(), e(c2, "displayName", N("sortableHandle", n2)), d2;
}
function U(e2) {
  return null != e2.sortableHandle;
}
var V = function() {
  function e2(t2, n2) {
    o(this, e2), this.container = t2, this.onScrollCallback = n2;
  }
  return i(e2, [{ key: "clear", value: function() {
    null != this.interval && (clearInterval(this.interval), this.interval = null);
  } }, { key: "update", value: function(e3) {
    var t2 = this, n2 = e3.translate, i2 = e3.minTranslate, o2 = e3.maxTranslate, r2 = e3.width, a2 = e3.height, s2 = { x: 0, y: 0 }, l2 = { x: 1, y: 1 }, c2 = 10, d2 = 10, h2 = this.container, u2 = h2.scrollTop, f2 = h2.scrollLeft, p2 = h2.scrollHeight, g2 = h2.scrollWidth, y2 = 0 === u2, v2 = p2 - u2 - h2.clientHeight == 0, m2 = 0 === f2, x2 = g2 - f2 - h2.clientWidth == 0;
    n2.y >= o2.y - a2 / 2 && !v2 ? (s2.y = 1, l2.y = d2 * Math.abs((o2.y - a2 / 2 - n2.y) / a2)) : n2.x >= o2.x - r2 / 2 && !x2 ? (s2.x = 1, l2.x = c2 * Math.abs((o2.x - r2 / 2 - n2.x) / r2)) : n2.y <= i2.y + a2 / 2 && !y2 ? (s2.y = -1, l2.y = d2 * Math.abs((n2.y - a2 / 2 - i2.y) / a2)) : n2.x <= i2.x + r2 / 2 && !m2 && (s2.x = -1, l2.x = c2 * Math.abs((n2.x - r2 / 2 - i2.x) / r2)), this.interval && (this.clear(), this.isAutoScrolling = false), 0 === s2.x && 0 === s2.y || (this.interval = setInterval(function() {
      t2.isAutoScrolling = true;
      var e4 = { left: l2.x * s2.x, top: l2.y * s2.y };
      t2.container.scrollTop += e4.top, t2.container.scrollLeft += e4.left, t2.onScrollCallback(e4);
    }, 5));
  } }]), e2;
}();
var Y = { axis: y.oneOf(["x", "y", "xy"]), contentWindow: y.any, disableAutoscroll: y.bool, distance: y.number, getContainer: y.func, getHelperDimensions: y.func, helperClass: y.string, helperContainer: y.oneOfType([y.func, "undefined" == typeof HTMLElement ? y.any : y.instanceOf(HTMLElement)]), hideSortableGhost: y.bool, keyboardSortingTransitionDuration: y.number, lockAxis: y.string, lockOffset: y.oneOfType([y.number, y.string, y.arrayOf(y.oneOfType([y.number, y.string]))]), lockToContainerEdges: y.bool, onSortEnd: y.func, onSortMove: y.func, onSortOver: y.func, onSortStart: y.func, pressDelay: y.number, pressThreshold: y.number, keyCodes: y.shape({ lift: y.arrayOf(y.number), drop: y.arrayOf(y.number), cancel: y.arrayOf(y.number), up: y.arrayOf(y.number), down: y.arrayOf(y.number) }), shouldCancelStart: y.func, transitionDuration: y.number, updateBeforeSortStart: y.func, useDragHandle: y.bool, useWindowAsScrollContainer: y.bool }, q = { lift: [P], drop: [P], cancel: [K], up: [G, j], down: [X, B] }, z = { axis: "y", disableAutoscroll: false, distance: 0, getHelperDimensions: function(e2) {
  var t2 = e2.node;
  return { height: t2.offsetHeight, width: t2.offsetWidth };
}, hideSortableGhost: true, lockOffset: "50%", lockToContainerEdges: false, pressDelay: 0, pressThreshold: 5, keyCodes: q, shouldCancelStart: function(e2) {
  return -1 !== [_.Input, _.Textarea, _.Select, _.Option, _.Button].indexOf(e2.target.tagName) || !!E(e2.target, function(e3) {
    return "true" === e3.contentEditable;
  });
}, transitionDuration: 300, useWindowAsScrollContainer: false }, $ = Object.keys(Y);
var J = d({ manager: {} });
function Q(d2) {
  var g2, y2, w2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : { withRef: false };
  return y2 = g2 = function(g3) {
    function y3(t2) {
      var n2;
      o(this, y3), n2 = a(this, s(y3).call(this, t2)), e(l(l(n2)), "state", {}), e(l(l(n2)), "handleStart", function(e2) {
        var t3 = n2.props, i3 = t3.distance, o2 = t3.shouldCancelStart;
        if (2 !== e2.button && !o2(e2)) {
          n2.touched = true, n2.position = W(e2);
          var r2 = E(e2.target, function(e3) {
            return null != e3.sortableInfo;
          });
          if (r2 && r2.sortableInfo && n2.nodeIsChild(r2) && !n2.state.sorting) {
            var a2 = n2.props.useDragHandle, s2 = r2.sortableInfo, l2 = s2.index, c2 = s2.collection;
            if (s2.disabled)
              return;
            if (a2 && !E(e2.target, U))
              return;
            n2.manager.active = { collection: c2, index: l2 }, function(e3) {
              return e3.touches && e3.touches.length || e3.changedTouches && e3.changedTouches.length;
            }(e2) || e2.target.tagName !== _.Anchor || e2.preventDefault(), i3 || (0 === n2.props.pressDelay ? n2.handlePress(e2) : n2.pressTimer = setTimeout(function() {
              return n2.handlePress(e2);
            }, n2.props.pressDelay));
          }
        }
      }), e(l(l(n2)), "nodeIsChild", function(e2) {
        return e2.sortableInfo.manager === n2.manager;
      }), e(l(l(n2)), "handleMove", function(e2) {
        var t3 = n2.props, i3 = t3.distance, o2 = t3.pressThreshold;
        if (!n2.state.sorting && n2.touched && !n2._awaitingUpdateBeforeSortStart) {
          var r2 = W(e2), a2 = { x: n2.position.x - r2.x, y: n2.position.y - r2.y }, s2 = Math.abs(a2.x) + Math.abs(a2.y);
          n2.delta = a2, i3 || o2 && !(s2 >= o2) ? i3 && s2 >= i3 && n2.manager.isActive() && n2.handlePress(e2) : (clearTimeout(n2.cancelTimer), n2.cancelTimer = setTimeout(n2.cancel, 0));
        }
      }), e(l(l(n2)), "handleEnd", function() {
        n2.touched = false, n2.cancel();
      }), e(l(l(n2)), "cancel", function() {
        var e2 = n2.props.distance;
        n2.state.sorting || (e2 || clearTimeout(n2.pressTimer), n2.manager.active = null);
      }), e(l(l(n2)), "handlePress", function(e2) {
        try {
          var t3 = n2.manager.getActive(), i3 = function() {
            if (t3) {
              var i4 = function() {
                var t4, i5, o3, d4, y5, m2, x2 = f2.sortableInfo.index, w3 = (t4 = f2, { bottom: R((i5 = window.getComputedStyle(t4)).marginBottom), left: R(i5.marginLeft), right: R(i5.marginRight), top: R(i5.marginTop) }), b2 = function(e3) {
                  var t5 = window.getComputedStyle(e3);
                  return "grid" === t5.display ? { x: R(t5.gridColumnGap), y: R(t5.gridRowGap) } : { x: 0, y: 0 };
                }(n2.container), S2 = n2.scrollContainer.getBoundingClientRect(), T2 = a2({ index: x2, node: f2, collection: p2 });
                if (n2.node = f2, n2.margin = w3, n2.gridGap = b2, n2.width = T2.width, n2.height = T2.height, n2.marginOffset = { x: n2.margin.left + n2.margin.right + n2.gridGap.x, y: Math.max(n2.margin.top, n2.margin.bottom, n2.gridGap.y) }, n2.boundingClientRect = f2.getBoundingClientRect(), n2.containerBoundingRect = S2, n2.index = x2, n2.newIndex = x2, n2.axis = { x: r2.indexOf("x") >= 0, y: r2.indexOf("y") >= 0 }, n2.offsetEdge = M(f2, n2.container), n2.initialOffset = W(g4 ? v({}, e2, { pageX: n2.boundingClientRect.left, pageY: n2.boundingClientRect.top }) : e2), n2.initialScroll = { left: n2.scrollContainer.scrollLeft, top: n2.scrollContainer.scrollTop }, n2.initialWindowScroll = { left: window.pageXOffset, top: window.pageYOffset }, n2.helper = n2.helperContainer.appendChild((d4 = "input, textarea, select, canvas, [contenteditable]", y5 = (o3 = f2).querySelectorAll(d4), m2 = o3.cloneNode(true), c(m2.querySelectorAll(d4)).forEach(function(e3, t5) {
                  "file" !== e3.type && (e3.value = y5[t5].value), "radio" === e3.type && e3.name && (e3.name = "__sortableClone__".concat(e3.name)), e3.tagName === _.Canvas && y5[t5].width > 0 && y5[t5].height > 0 && e3.getContext("2d").drawImage(y5[t5], 0, 0);
                }), m2)), C(n2.helper, { boxSizing: "border-box", height: "".concat(n2.height, "px"), left: "".concat(n2.boundingClientRect.left - w3.left, "px"), pointerEvents: "none", position: "fixed", top: "".concat(n2.boundingClientRect.top - w3.top, "px"), width: "".concat(n2.width, "px") }), g4 && n2.helper.focus(), l2 && (n2.sortableGhost = f2, C(f2, { opacity: 0, visibility: "hidden" })), n2.minTranslate = {}, n2.maxTranslate = {}, g4) {
                  var I2 = u2 ? { top: 0, left: 0, width: n2.contentWindow.innerWidth, height: n2.contentWindow.innerHeight } : n2.containerBoundingRect, k2 = I2.top, E2 = I2.left, D2 = I2.width, N2 = k2 + I2.height, A2 = E2 + D2;
                  n2.axis.x && (n2.minTranslate.x = E2 - n2.boundingClientRect.left, n2.maxTranslate.x = A2 - (n2.boundingClientRect.left + n2.width)), n2.axis.y && (n2.minTranslate.y = k2 - n2.boundingClientRect.top, n2.maxTranslate.y = N2 - (n2.boundingClientRect.top + n2.height));
                } else
                  n2.axis.x && (n2.minTranslate.x = (u2 ? 0 : S2.left) - n2.boundingClientRect.left - n2.width / 2, n2.maxTranslate.x = (u2 ? n2.contentWindow.innerWidth : S2.left + S2.width) - n2.boundingClientRect.left - n2.width / 2), n2.axis.y && (n2.minTranslate.y = (u2 ? 0 : S2.top) - n2.boundingClientRect.top - n2.height / 2, n2.maxTranslate.y = (u2 ? n2.contentWindow.innerHeight : S2.top + S2.height) - n2.boundingClientRect.top - n2.height / 2);
                s2 && s2.split(" ").forEach(function(e3) {
                  return n2.helper.classList.add(e3);
                }), n2.listenerNode = e2.touches ? e2.target : n2.contentWindow, g4 ? (n2.listenerNode.addEventListener("wheel", n2.handleKeyEnd, true), n2.listenerNode.addEventListener("mousedown", n2.handleKeyEnd, true), n2.listenerNode.addEventListener("keydown", n2.handleKeyDown)) : (O.move.forEach(function(e3) {
                  return n2.listenerNode.addEventListener(e3, n2.handleSortMove, false);
                }), O.end.forEach(function(e3) {
                  return n2.listenerNode.addEventListener(e3, n2.handleSortEnd, false);
                })), n2.setState({ sorting: true, sortingIndex: x2 }), h2 && h2({ node: f2, index: x2, collection: p2, isKeySorting: g4, nodes: n2.manager.getOrderedRefs(), helper: n2.helper }, e2), g4 && n2.keyMove(0);
              }, o2 = n2.props, r2 = o2.axis, a2 = o2.getHelperDimensions, s2 = o2.helperClass, l2 = o2.hideSortableGhost, d3 = o2.updateBeforeSortStart, h2 = o2.onSortStart, u2 = o2.useWindowAsScrollContainer, f2 = t3.node, p2 = t3.collection, g4 = n2.manager.isKeySorting, y4 = function() {
                if ("function" == typeof d3) {
                  n2._awaitingUpdateBeforeSortStart = true;
                  var t4 = function(e3, t5) {
                    try {
                      var n3 = e3();
                    } catch (e4) {
                      return t5(true, e4);
                    }
                    return n3 && n3.then ? n3.then(t5.bind(null, false), t5.bind(null, true)) : t5(false, value);
                  }(function() {
                    var t5 = f2.sortableInfo.index;
                    return Promise.resolve(d3({ collection: p2, index: t5, node: f2, isKeySorting: g4 }, e2)).then(function() {
                    });
                  }, function(e3, t5) {
                    if (n2._awaitingUpdateBeforeSortStart = false, e3)
                      throw t5;
                    return t5;
                  });
                  if (t4 && t4.then)
                    return t4.then(function() {
                    });
                }
              }();
              return y4 && y4.then ? y4.then(i4) : i4();
            }
          }();
          return Promise.resolve(i3 && i3.then ? i3.then(function() {
          }) : void 0);
        } catch (e3) {
          return Promise.reject(e3);
        }
      }), e(l(l(n2)), "handleSortMove", function(e2) {
        var t3 = n2.props.onSortMove;
        "function" == typeof e2.preventDefault && e2.cancelable && e2.preventDefault(), n2.updateHelperPosition(e2), n2.animateNodes(), n2.autoscroll(), t3 && t3(e2);
      }), e(l(l(n2)), "handleSortEnd", function(e2) {
        var t3 = n2.props, i3 = t3.hideSortableGhost, o2 = t3.onSortEnd, r2 = n2.manager, a2 = r2.active.collection, s2 = r2.isKeySorting, l2 = n2.manager.getOrderedRefs();
        n2.listenerNode && (s2 ? (n2.listenerNode.removeEventListener("wheel", n2.handleKeyEnd, true), n2.listenerNode.removeEventListener("mousedown", n2.handleKeyEnd, true), n2.listenerNode.removeEventListener("keydown", n2.handleKeyDown)) : (O.move.forEach(function(e3) {
          return n2.listenerNode.removeEventListener(e3, n2.handleSortMove);
        }), O.end.forEach(function(e3) {
          return n2.listenerNode.removeEventListener(e3, n2.handleSortEnd);
        }))), n2.helper.parentNode.removeChild(n2.helper), i3 && n2.sortableGhost && C(n2.sortableGhost, { opacity: "", visibility: "" });
        for (var c2 = 0, d3 = l2.length; c2 < d3; c2++) {
          var h2 = l2[c2], u2 = h2.node;
          h2.edgeOffset = null, h2.boundingClientRect = null, I(u2, null), k(u2, null), h2.translate = null;
        }
        n2.autoScroller.clear(), n2.manager.active = null, n2.manager.isKeySorting = false, n2.setState({ sorting: false, sortingIndex: null }), "function" == typeof o2 && o2({ collection: a2, newIndex: n2.newIndex, oldIndex: n2.index, isKeySorting: s2, nodes: l2 }, e2), n2.touched = false;
      }), e(l(l(n2)), "autoscroll", function() {
        var e2 = n2.props.disableAutoscroll, t3 = n2.manager.isKeySorting;
        if (e2)
          n2.autoScroller.clear();
        else {
          if (t3) {
            var i3 = v({}, n2.translate), o2 = 0, r2 = 0;
            return n2.axis.x && (i3.x = Math.min(n2.maxTranslate.x, Math.max(n2.minTranslate.x, n2.translate.x)), o2 = n2.translate.x - i3.x), n2.axis.y && (i3.y = Math.min(n2.maxTranslate.y, Math.max(n2.minTranslate.y, n2.translate.y)), r2 = n2.translate.y - i3.y), n2.translate = i3, I(n2.helper, n2.translate), n2.scrollContainer.scrollLeft += o2, void (n2.scrollContainer.scrollTop += r2);
          }
          n2.autoScroller.update({ height: n2.height, maxTranslate: n2.maxTranslate, minTranslate: n2.minTranslate, translate: n2.translate, width: n2.width });
        }
      }), e(l(l(n2)), "onAutoScroll", function(e2) {
        n2.translate.x += e2.left, n2.translate.y += e2.top, n2.animateNodes();
      }), e(l(l(n2)), "handleKeyDown", function(e2) {
        var t3 = e2.keyCode, i3 = n2.props, o2 = i3.shouldCancelStart, r2 = i3.keyCodes, a2 = v({}, q, void 0 === r2 ? {} : r2);
        n2.manager.active && !n2.manager.isKeySorting || !(n2.manager.active || a2.lift.includes(t3) && !o2(e2) && n2.isValidSortingTarget(e2)) || (e2.stopPropagation(), e2.preventDefault(), a2.lift.includes(t3) && !n2.manager.active ? n2.keyLift(e2) : a2.drop.includes(t3) && n2.manager.active ? n2.keyDrop(e2) : a2.cancel.includes(t3) ? (n2.newIndex = n2.manager.active.index, n2.keyDrop(e2)) : a2.up.includes(t3) ? n2.keyMove(-1) : a2.down.includes(t3) && n2.keyMove(1));
      }), e(l(l(n2)), "keyLift", function(e2) {
        var t3 = e2.target, i3 = E(t3, function(e3) {
          return null != e3.sortableInfo;
        }).sortableInfo, o2 = i3.index, r2 = i3.collection;
        n2.initialFocusedNode = t3, n2.manager.isKeySorting = true, n2.manager.active = { index: o2, collection: r2 }, n2.handlePress(e2);
      }), e(l(l(n2)), "keyMove", function(e2) {
        var t3 = n2.manager.getOrderedRefs(), i3 = t3[t3.length - 1].node.sortableInfo.index, o2 = n2.newIndex + e2, r2 = n2.newIndex;
        if (!(o2 < 0 || o2 > i3)) {
          n2.prevIndex = r2, n2.newIndex = o2;
          var a2 = function(e3, t4, n3) {
            return e3 < n3 && e3 > t4 ? e3 - 1 : e3 > n3 && e3 < t4 ? e3 + 1 : e3;
          }(n2.newIndex, n2.prevIndex, n2.index), s2 = t3.find(function(e3) {
            return e3.node.sortableInfo.index === a2;
          }), l2 = s2.node, c2 = n2.containerScrollDelta, d3 = s2.boundingClientRect || A(l2, c2), h2 = s2.translate || { x: 0, y: 0 }, u2 = d3.top + h2.y - c2.top, f2 = d3.left + h2.x - c2.left, p2 = r2 < o2, g4 = p2 && n2.axis.x ? l2.offsetWidth - n2.width : 0, y4 = p2 && n2.axis.y ? l2.offsetHeight - n2.height : 0;
          n2.handleSortMove({ pageX: f2 + g4, pageY: u2 + y4, ignoreTransition: 0 === e2 });
        }
      }), e(l(l(n2)), "keyDrop", function(e2) {
        n2.handleSortEnd(e2), n2.initialFocusedNode && n2.initialFocusedNode.focus();
      }), e(l(l(n2)), "handleKeyEnd", function(e2) {
        n2.manager.active && n2.keyDrop(e2);
      }), e(l(l(n2)), "isValidSortingTarget", function(e2) {
        var t3 = n2.props.useDragHandle, i3 = e2.target, o2 = E(i3, function(e3) {
          return null != e3.sortableInfo;
        });
        return o2 && o2.sortableInfo && !o2.sortableInfo.disabled && (t3 ? U(i3) : i3.sortableInfo);
      });
      var i2 = new x();
      return function(e2) {
        m(!(e2.distance && e2.pressDelay), "Attempted to set both `pressDelay` and `distance` on SortableContainer, you may only use one or the other, not both at the same time.");
      }(t2), n2.manager = i2, n2.wrappedInstance = h(), n2.sortableContextValue = { manager: i2 }, n2.events = { end: n2.handleEnd, move: n2.handleMove, start: n2.handleStart }, n2;
    }
    return r(y3, f), i(y3, [{ key: "componentDidMount", value: function() {
      var e2 = this, t2 = this.props.useWindowAsScrollContainer, n2 = this.getContainer();
      Promise.resolve(n2).then(function(n3) {
        e2.container = n3, e2.document = e2.container.ownerDocument || document;
        var i2 = e2.props.contentWindow || e2.document.defaultView || window;
        e2.contentWindow = "function" == typeof i2 ? i2() : i2, e2.scrollContainer = t2 ? e2.document.scrollingElement || e2.document.documentElement : H(e2.container) || e2.container, e2.autoScroller = new V(e2.scrollContainer, e2.onAutoScroll), Object.keys(e2.events).forEach(function(t3) {
          return O[t3].forEach(function(n4) {
            return e2.container.addEventListener(n4, e2.events[t3], false);
          });
        }), e2.container.addEventListener("keydown", e2.handleKeyDown);
      });
    } }, { key: "componentWillUnmount", value: function() {
      var e2 = this;
      this.helper && this.helper.parentNode && this.helper.parentNode.removeChild(this.helper), this.container && (Object.keys(this.events).forEach(function(t2) {
        return O[t2].forEach(function(n2) {
          return e2.container.removeEventListener(n2, e2.events[t2]);
        });
      }), this.container.removeEventListener("keydown", this.handleKeyDown));
    } }, { key: "updateHelperPosition", value: function(e2) {
      var t2 = this.props, i2 = t2.lockAxis, o2 = t2.lockOffset, r2 = t2.lockToContainerEdges, a2 = t2.transitionDuration, s2 = t2.keyboardSortingTransitionDuration, l2 = void 0 === s2 ? a2 : s2, c2 = this.manager.isKeySorting, d3 = e2.ignoreTransition, h2 = W(e2), u2 = { x: h2.x - this.initialOffset.x, y: h2.y - this.initialOffset.y };
      if (u2.y -= window.pageYOffset - this.initialWindowScroll.top, u2.x -= window.pageXOffset - this.initialWindowScroll.left, this.translate = u2, r2) {
        var f2 = function(e3) {
          var t3 = e3.height, i3 = e3.width, o3 = e3.lockOffset, r3 = Array.isArray(o3) ? o3 : [o3, o3];
          m(2 === r3.length, "lockOffset prop of SortableContainer should be a single value or an array of exactly two values. Given %s", o3);
          var a3 = n(r3, 2), s3 = a3[0], l3 = a3[1];
          return [L({ height: t3, lockOffset: s3, width: i3 }), L({ height: t3, lockOffset: l3, width: i3 })];
        }({ height: this.height, lockOffset: o2, width: this.width }), p2 = n(f2, 2), g4 = p2[0], y4 = p2[1], v2 = { x: this.width / 2 - g4.x, y: this.height / 2 - g4.y }, x2 = { x: this.width / 2 - y4.x, y: this.height / 2 - y4.y };
        u2.x = D(this.minTranslate.x + v2.x, this.maxTranslate.x - x2.x, u2.x), u2.y = D(this.minTranslate.y + v2.y, this.maxTranslate.y - x2.y, u2.y);
      }
      "x" === i2 ? u2.y = 0 : "y" === i2 && (u2.x = 0), c2 && l2 && !d3 && k(this.helper, l2), I(this.helper, u2);
    } }, { key: "animateNodes", value: function() {
      var e2 = this.props, t2 = e2.transitionDuration, n2 = e2.hideSortableGhost, i2 = e2.onSortOver, o2 = this.containerScrollDelta, r2 = this.windowScrollDelta, a2 = this.manager.getOrderedRefs(), s2 = this.offsetEdge.left + this.translate.x + o2.left, l2 = this.offsetEdge.top + this.translate.y + o2.top, c2 = this.manager.isKeySorting, d3 = this.newIndex;
      this.newIndex = null;
      for (var h2 = 0, u2 = a2.length; h2 < u2; h2++) {
        var f2 = a2[h2].node, p2 = f2.sortableInfo.index, g4 = f2.offsetWidth, y4 = f2.offsetHeight, v2 = { height: this.height > y4 ? y4 / 2 : this.height / 2, width: this.width > g4 ? g4 / 2 : this.width / 2 }, m2 = c2 && p2 > this.index && p2 <= d3, x2 = c2 && p2 < this.index && p2 >= d3, w3 = { x: 0, y: 0 }, b2 = a2[h2].edgeOffset;
        b2 || (b2 = M(f2, this.container), a2[h2].edgeOffset = b2, c2 && (a2[h2].boundingClientRect = A(f2, o2)));
        var S2 = h2 < a2.length - 1 && a2[h2 + 1], O2 = h2 > 0 && a2[h2 - 1];
        S2 && !S2.edgeOffset && (S2.edgeOffset = M(S2.node, this.container), c2 && (S2.boundingClientRect = A(S2.node, o2))), p2 !== this.index ? (t2 && k(f2, t2), this.axis.x ? this.axis.y ? x2 || p2 < this.index && (s2 + r2.left - v2.width <= b2.left && l2 + r2.top <= b2.top + v2.height || l2 + r2.top + v2.height <= b2.top) ? (w3.x = this.width + this.marginOffset.x, b2.left + w3.x > this.containerBoundingRect.width - v2.width && S2 && (w3.x = S2.edgeOffset.left - b2.left, w3.y = S2.edgeOffset.top - b2.top), null === this.newIndex && (this.newIndex = p2)) : (m2 || p2 > this.index && (s2 + r2.left + v2.width >= b2.left && l2 + r2.top + v2.height >= b2.top || l2 + r2.top + v2.height >= b2.top + y4)) && (w3.x = -(this.width + this.marginOffset.x), b2.left + w3.x < this.containerBoundingRect.left + v2.width && O2 && (w3.x = O2.edgeOffset.left - b2.left, w3.y = O2.edgeOffset.top - b2.top), this.newIndex = p2) : m2 || p2 > this.index && s2 + r2.left + v2.width >= b2.left ? (w3.x = -(this.width + this.marginOffset.x), this.newIndex = p2) : (x2 || p2 < this.index && s2 + r2.left <= b2.left + v2.width) && (w3.x = this.width + this.marginOffset.x, null == this.newIndex && (this.newIndex = p2)) : this.axis.y && (m2 || p2 > this.index && l2 + r2.top + v2.height >= b2.top ? (w3.y = -(this.height + this.marginOffset.y), this.newIndex = p2) : (x2 || p2 < this.index && l2 + r2.top <= b2.top + v2.height) && (w3.y = this.height + this.marginOffset.y, null == this.newIndex && (this.newIndex = p2))), I(f2, w3), a2[h2].translate = w3) : n2 && (this.sortableGhost = f2, C(f2, { opacity: 0, visibility: "hidden" }));
      }
      null == this.newIndex && (this.newIndex = this.index), c2 && (this.newIndex = d3);
      var T2 = c2 ? this.prevIndex : d3;
      i2 && this.newIndex !== T2 && i2({ collection: this.manager.active.collection, index: this.index, newIndex: this.newIndex, oldIndex: T2, isKeySorting: c2, nodes: a2, helper: this.helper });
    } }, { key: "getWrappedInstance", value: function() {
      return m(w2.withRef, "To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableContainer() call"), this.wrappedInstance.current;
    } }, { key: "getContainer", value: function() {
      var e2 = this.props.getContainer;
      return "function" != typeof e2 ? p(this) : e2(w2.withRef ? this.getWrappedInstance() : void 0);
    } }, { key: "render", value: function() {
      var e2 = w2.withRef ? this.wrappedInstance : null;
      return u(J.Provider, { value: this.sortableContextValue }, u(d2, t({ ref: e2 }, S(this.props, $))));
    } }, { key: "helperContainer", get: function() {
      var e2 = this.props.helperContainer;
      return "function" == typeof e2 ? e2() : this.props.helperContainer || this.document.body;
    } }, { key: "containerScrollDelta", get: function() {
      return this.props.useWindowAsScrollContainer ? { left: 0, top: 0 } : { left: this.scrollContainer.scrollLeft - this.initialScroll.left, top: this.scrollContainer.scrollTop - this.initialScroll.top };
    } }, { key: "windowScrollDelta", get: function() {
      return { left: this.contentWindow.pageXOffset - this.initialWindowScroll.left, top: this.contentWindow.pageYOffset - this.initialWindowScroll.top };
    } }]), y3;
  }(), e(g2, "displayName", N("sortableList", d2)), e(g2, "defaultProps", z), e(g2, "propTypes", Y), y2;
}
var Z = { index: y.number.isRequired, collection: y.oneOfType([y.number, y.string]), disabled: y.bool }, ee = Object.keys(Z);
function te(n2) {
  var c2, d2, g2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : { withRef: false };
  return d2 = c2 = function(c3) {
    function d3() {
      var t2, n3;
      o(this, d3);
      for (var i2 = arguments.length, r2 = new Array(i2), c4 = 0; c4 < i2; c4++)
        r2[c4] = arguments[c4];
      return n3 = a(this, (t2 = s(d3)).call.apply(t2, [this].concat(r2))), e(l(l(n3)), "wrappedInstance", h()), n3;
    }
    return r(d3, f), i(d3, [{ key: "componentDidMount", value: function() {
      this.register();
    } }, { key: "componentDidUpdate", value: function(e2) {
      this.node && (e2.index !== this.props.index && (this.node.sortableInfo.index = this.props.index), e2.disabled !== this.props.disabled && (this.node.sortableInfo.disabled = this.props.disabled)), e2.collection !== this.props.collection && (this.unregister(e2.collection), this.register());
    } }, { key: "componentWillUnmount", value: function() {
      this.unregister();
    } }, { key: "register", value: function() {
      var e2 = this.props, t2 = e2.collection, n3 = e2.disabled, i2 = e2.index, o2 = p(this);
      o2.sortableInfo = { collection: t2, disabled: n3, index: i2, manager: this.context.manager }, this.node = o2, this.ref = { node: o2 }, this.context.manager.add(t2, this.ref);
    } }, { key: "unregister", value: function() {
      var e2 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.props.collection;
      this.context.manager.remove(e2, this.ref);
    } }, { key: "getWrappedInstance", value: function() {
      return m(g2.withRef, "To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableElement() call"), this.wrappedInstance.current;
    } }, { key: "render", value: function() {
      var e2 = g2.withRef ? this.wrappedInstance : null;
      return u(n2, t({ ref: e2 }, S(this.props, ee)));
    } }]), d3;
  }(), e(c2, "displayName", N("sortableElement", n2)), e(c2, "contextType", J), e(c2, "propTypes", Z), e(c2, "defaultProps", { collection: 0 }), d2;
}
export {
  te as a,
  Q as b,
  b as c,
  F as s
};
